htdig-3.2.0b6/0040755006314600127310000000000010063260371012364 5ustar angusgbhtdightdig-3.2.0b6/contrib/0040755006314600127310000000000010063260367014031 5ustar angusgbhtdightdig-3.2.0b6/contrib/acroconv.pl0100755006314600127310000000423507427026534016212 0ustar angusgbhtdig#!/usr/local/bin/perl # # Sample external converter for htdig 3.1.4 or later, to convert PDFs # using Adobe Acrobat 3's acroread -toPostScript option on UNIX systems. # (Use it in place of conv_doc.pl if you have acroread but not pdftotext.) # Written by Gilles Detillieux. # # Usage: (in htdig.conf) # # external_parsers: application/pdf->text/html /usr/local/bin/acroconv.pl # # This is a pretty quick and dirty implementation, but it does seem to # give functionality equivalent to the now defunct htdig/PDF.cc parser. # I'm not a Perl expert by any stretch of the imagination, so the code # could probably use a lot of optimization to make it work better. # $watch = 0; $bigspace = 0; $putspace = 0; $putbody = 1; system("ln $ARGV[0] $ARGV[0].pdf; acroread -toPostScript $ARGV[0].pdf"); open(INP, "< $ARGV[0].ps") || die "Can't open $ARGV[0].ps\n"; print "\n\n"; while () { if (/^%%Title: / && $putbody) { s/^%%Title: \((.*)\).*\n/$1/; s/\\222/'/g; s/\\267/*/g; s/\\336/fi/g; s/\\([0-7]{3})/pack(C, oct($1))/eig; s/\\([0-7]{2})/pack(C, oct($1))/eig; s/\\([0-7])/pack(C, oct($1))/eig; s/\\[nrtbf]/ /g; s/\\(.)/$1/g; s/&/\&\;/g; s//\>\;/g; print "$_\n"; print "\n\n"; $putbody = 0; } elsif (/^BT/) { $watch = 1; } elsif (/^ET/) { $watch = 0; if ($putspace) { print "\n"; $putspace = 0; } } elsif ($watch) { if (/T[Jj]$/) { s/\)[^(]*\(//g; s/^[^(]*\((.*)\).*\n/$1/; s/\\222/'/g; s/\\267/*/g; s/\\336/fi/g; s/\\([0-7]{3})/pack(C, oct($1))/eig; s/\\([0-7]{2})/pack(C, oct($1))/eig; s/\\([0-7])/pack(C, oct($1))/eig; s/\\[nrtbf]/ /g; s/\\(.)/$1/g; if ($bigspace) { s/(.)/$1 /g; } s/&/\&\;/g; s//\>\;/g; if ($putbody) { print "\n\n"; $putbody = 0; } print "$_"; $putspace = 1; } elsif (/T[Ddm*]$/ && $putspace) { print "\n"; $putspace = 0; } elsif (/Tc$/) { $bigspace = 0; if (/^([3-9]|[1-9][0-9]+)\..*Tc$/) { $bigspace = 1; } } } } if ($putbody) { print "\n\n"; } print "\n\n"; close(INP); system("rm -f $ARGV[0].pdf $ARGV[0].ps"); htdig-3.2.0b6/contrib/README0100644006314600127310000000323007426615567014723 0ustar angusgbhtdight://Dig contributed scripts This directory tree contains perl and shell programs that attempt to do things with the generated databases. Most of these were written for a very specific purpose for the specific version of ht://Dig that was current at that point. This means that some of these programs will be severely broken! Do not expect them to work; use them only as examples of the types of things you can do with the ht://Dig databases. More contributed work is available on the ht://Dig website: What's here: acroconv.pl An external converter script that uses acroread to parse PDFs autorun An example of automating the database building changehost A script to change hostnames of URLs in the databases conv_doc.pl A sample script to use the conversion features of external_parsers doclist List the information in the doc db (or after a certain date) ewswrap Two sample htsearch wrappers to emulate Excite for Web Servers (EWS) and to simplify queries handler.pl A sample external_protocols script to handle HTTP/HTTPS using curl htparsedoc A sample shell script to parse Word documents multidig A set of scripts to simplify updating multiple databases parse_doc.pl A general external parser script that handles MS Word documents (among others) run-robot.sh Another example of automating the database building scriptname An example of using htsearch within dynamic SSI pages status.pl Build a status page of last 5 runs and top 10 servers (by # URLs) urlindex Build an index of all the URLs in the database whatsnew Build a "what's new" page with custom header and footer wordfreq Build a list of words and frequency in the database htdig-3.2.0b6/contrib/autorun/0040755006314600127310000000000010063260367015526 5ustar angusgbhtdightdig-3.2.0b6/contrib/autorun/README0100644006314600127310000000045506275416055016416 0ustar angusgbhtdigREADME for autorun. The autorun program is an attempt at automatic the steps needed to build a complete search database. If the search domain is not too big, this can be run on a daily (nightly) basis. Usage: autorun Configuration: Edit the autorun script and change things to your liking... htdig-3.2.0b6/contrib/autorun/autorun0100755006314600127310000000140706275416055017157 0ustar angusgbhtdig#!/bin/sh ## ## Configurable variables ## ## ## Specify the location of the htdig and htmerge binaries ## htbin=/opt/www/bin ## ## Specify the configuration file to use for digging and merging ## conffile=/opt/www/htdig/sdsu.conf ## ## Specify the location where the temporary database is ## source=/tmp ## ## Specify the location of the target search database ## target=/gopher/www/htdig ## ## Specify the host of the target search database ## search_host=athena ## ## Specify how to copy the new database to the location ## where the search engine can get at it. ## docopy() { rcp $source/*.docdb $source/*.docs.index $source/*.words.gdbm ${search_host}:$target } $htbin/htdig -i -c $conffile $htbin/htmerge -c $conffile $htbin/htnotify -vv -c $conffile docopy htdig-3.2.0b6/contrib/conv_doc.pl0100755006314600127310000001721707426615567016207 0ustar angusgbhtdig#!/usr/local/bin/perl # # Sample external converter for htdig 3.1.4 or later. # Usage: (in htdig.conf) # # external_parsers: application/msword->text/html /usr/local/bin/conv_doc.pl \ # application/postscript->text/html /usr/local/bin/conv_doc.pl \ # application/pdf->text/html /usr/local/bin/conv_doc.pl # # Written by Gilles Detillieux . # Based in part on the parse_word_doc.pl script, written by # Jesse op den Brouw but heavily revised. # # 1998/12/11 # Added: catdoc test (is catdoc runnable?) # 1999/02/09 # Added: uses ps2ascii to handle PS files # 1999/02/15 # Added: check for some file formats # 1999/02/25 # Added: uses pdftotext to handle PDF files # 1999/03/01 # Added: extra checks for file "wrappers" # & check for MS Word signature (no longer defaults to catdoc) # 1999/03/05 # Changed: rejoin hyphenated words across lines # (in PDFs) # 1999/08/12 # Changed: adapted for xpdf 0.90 release # Added: uses pdfinfo to handle PDF titles # Changed: change dashes to hyphens # 1999/09/09 # Changed: fix to handle empty PDF title right # 1999/12/01 # Changed: rewritten as external converter # stripped out all parser-related code # Added: test to silently ignore wrapped EPS files < " > # Added: test for null device on Win32 env. # 2000/01/12 # Changed: "break" to "last" (no break in Perl) # 2001/07/12 # Changed: fix "last" handling in dehyphenation # Added: handle %xx codes in title from URL ######################################### # # set this to your MS Word to text converter # get it from: http://www.fe.msk.ru/~vitus/catdoc/ # $CATDOC = "/usr/local/bin/catdoc"; # # set this to your WordPerfect to text converter, or /bin/true if none available # this nabs WP documents with .doc suffix, so catdoc doesn't see them # $CATWP = "/bin/true"; # # set this to your RTF to text converter, or /bin/true if none available # this nabs RTF documents with .doc suffix, so catdoc doesn't see them # $CATRTF = "/bin/true"; # # set this to your PostScript to text converter # get it from the ghostscript 3.33 (or later) package # $CATPS = "/usr/bin/ps2ascii"; # # set this to your PDF to text converter, and pdfinfo tool # get it from the xpdf 0.90 package at http://www.foolabs.com/xpdf/ # $CATPDF = "/usr/bin/pdftotext"; $PDFINFO = "/usr/bin/pdfinfo"; #$CATPDF = "/usr/local/bin/pdftotext"; #$PDFINFO = "/usr/local/bin/pdfinfo"; ######################################### # # need some var's $dehyphenate = 0; # set if we must dehyphenate text output $ishtml = 0; # set if converter produces HTML $null = ""; $magic = ""; $type = ""; $cvtr = ""; $cvtcmd = ""; $title = ""; @parts = (); # make portable to win32 platform or unix $null = "/dev/null"; if ($^O eq "MSWin32") {$null = "nul";} ######################################### # # Read first bytes of file to check for file type (like file(1) does) open(FILE, "< $ARGV[0]") || die "Can't open file $ARGV[0]: $!\n"; read FILE,$magic,8; close FILE; if ($magic =~ /^\0\n/) { # possible MacBinary header open(FILE, "< $ARGV[0]") || die "Can't open file $ARGV[0]: $!\n"; read FILE,$magic,136; # let's hope converters can handle them! close FILE; } if ($magic =~ /%!|^\033%-12345/) { # it's PostScript (or HP print job) $cvtr = $CATPS; # gs 3.33 leaves _temp_.??? files in . # keep quiet even if PS gives errors... $cvtcmd = "(cd /tmp; $cvtr; rm -f _temp_.???) < $ARGV[0] 2>$null"; # allow PS interpreter to give error messages... # $cvtcmd = "(cd /tmp; $cvtr; rm -f _temp_.???) < $ARGV[0]"; $type = "PostScript"; $dehyphenate = 0; # ps2ascii already does this if ($magic =~ /^\033%-12345/) { # HP print job open(FILE, "< $ARGV[0]") || die "Can't open file $ARGV[0]: $!\n"; read FILE,$magic,256; close FILE; exit unless $magic =~ /^\033%-12345X\@PJL.*\n*.*\n*.*ENTER\s*LANGUAGE\s*=\s*POSTSCRIPT.*\n*.*\n*.*\n%!/ } } elsif ($magic =~ /\305\320\323\306\036/) { # it's a wrapped EPS - ignore exit } elsif ($magic =~ /%PDF-/) { # it's PDF (Acrobat) $cvtr = $CATPDF; $cvtcmd = "$cvtr -raw $ARGV[0] -"; # to handle single-column, strangely laid out PDFs, use coalescing feature... # $cvtcmd = "$cvtr $ARGV[0] -"; $type = "PDF"; $dehyphenate = 1; # PDFs often have hyphenated lines if (open(INFO, "$PDFINFO $ARGV[0] 2>$null |")) { while () { if (/^Title:/) { s/^Title:\s+//; s/\s+$//; s/\s+/ /g; s/&/\&\;/g; s//\>\;/g; $title = $_; last; } } close INFO; } # to use coalescing feature conditionally... # if ($title =~ /...Title of Corel DRAW output.../) { # $cvtcmd = "$cvtr $ARGV[0] -"; # } } elsif ($magic =~ /WPC/) { # it's WordPerfect $cvtr = $CATWP; $cvtcmd = "$cvtr $ARGV[0]"; $type = "WordPerfect"; $dehyphenate = 0; # WP documents not likely hyphenated } elsif ($magic =~ /^{\\rtf/) { # it's Richtext $cvtr = $CATRTF; $cvtcmd = "$cvtr $ARGV[0]"; $type = "RTF"; $dehyphenate = 0; # RTF documents not likely hyphenated } elsif ($magic =~ /\320\317\021\340/) { # it's MS Word $cvtr = $CATDOC; $cvtcmd = "$cvtr -a -w $ARGV[0]"; $type = "Word"; $dehyphenate = 0; # Word documents not likely hyphenated } else { die "Can't determine type of file $ARGV[0]; content-type: $ARGV[1]; URL: $ARGV[2]\n"; } die "$cvtr is absent or unwilling to execute.\n" unless -x $cvtr; ############################################# # # Start output. # if running as a converter for "user-defined" output type... #print "Content-Type: text/html\n\n"; if ($ishtml) { # converter will give its own HTML output system("$cvtcmd") || die "$cvtr doesn't want to be run from shell.\n"; exit; } # Produce HTML output from converter's text output, so we can add title. print "\n\n"; # print out the title, if it's set, and not just a file name, or make one up if ($title eq "" || $title =~ /^[A-G]:[^\s]+\.[Pp][Dd][Ff]$/) { @parts = split(/\//, $ARGV[2]); # get the file basename $parts[-1] =~ s/%([A-F0-9][A-F0-9])/pack("C", hex($1))/gie; $title = "$type Document $parts[-1]"; # use it in title } print "$title\n"; print "\n\n"; # Open file via selected converter, output its text. open(CAT, "$cvtcmd |") || die "$cvtr doesn't want to be opened using pipe.\n"; while () { while (/[A-Za-z\300-\377]-\s*$/ && $dehyphenate) { $_ .= ; last if eof; s/([A-Za-z\300-\377])-\s*\n\s*([A-Za-z\300-\377])/$1$2/s } s/[\255]/-/g; # replace dashes with hyphens s/\f/\n/g; # replace form feed s/&/\&\;/g; # HTMLify text s//\>\;/g; print; } print "\n\n"; close CAT; htdig-3.2.0b6/contrib/handler.pl0100755006314600127310000000223107053425016016000 0ustar angusgbhtdig#!/usr/bin/perl # # handler.pl # Sample ExternalTransport handler for HTTP and HTTPS using curl # for the ht://Dig package 3.2.x and higher # by Geoffrey Hutchison # Copyright (c) 1999 under the terms of the GNU Public License vesion 2 (GPL) # # handler.pl protocol url config_file # # Really a simplistic example--this should probably use Perl's LWP for HTTP/HTTPS/FTP # Right now it uses the program 'curl' to do HTTP or HTTPS transactions. # my $curl_path="/usr/local/bin/curl"; my $protocol=$ARGV[0]; my $url=$ARGV[1]; my $config_file=$ARGV[2]; open (DOC, "$curl_path -i $url |") || die "s:\t404\nr:\tCan't open curl!\n"; while ( my $line = ) { if ( $line =~ /^HTTP.?\/\d.\d\s(\d\d\d)\s(.*)/io ) { print "s:\t$1\n"; print "r:\t$2\n"; } elsif ( $line =~ /^last-modified: (.*)$/io ) { print "m:\t$1\n"; } elsif ( $line =~ /^content-type: (.*)$/io ) { print "t:\t$1\n"; } elsif ( $line =~ /^content-length: (.*)$/io ) { print "l:\t$1\n"; } elsif ( $line =~ /^location: (.*)$/io ) { print "u:\t$1\n"; } last if ( $line =~ /^\s*$/ ) } local($/) = undef; my $text = ; close(DOC); print "\n$text"; htdig-3.2.0b6/contrib/htdig-3.2.0.spec0100644006314600127310000001476010062351737016450 0ustar angusgbhtdig# Last definitions below override, so change the order to redefine. You can't # comment them out because %defines are parsed inside comments. # For Red Hat [456].x... %define contentdir /home/httpd %define commondir /var/lib/htdig/common %define databasedir /var/lib/htdig/db %define searchdir %{contentdir}/html %define configdir /etc/htdig %define bindir /usr/sbin %define mandir /usr/man %define docdir /usr/doc # For Red Hat [789].x, FCx... %define contentdir /var/www %define commondir %{_prefix}/share/htdig %define databasedir /var/lib/htdig %define searchdir %{contentdir}/html/htdig %define configdir %{_sysconfdir}/htdig %define bindir %{_bindir} %define mandir %{_mandir} %define docdir %{_docdir} Summary: A web indexing and searching system for a small domain or intranet Name: htdig Version: 3.2.0b6 Release: 8 Copyright: GPL Group: Networking/Utilities BuildRoot: /var/tmp/htdig-root Source0: http://www.htdig.org/files/htdig-%{PACKAGE_VERSION}.tar.gz URL: http://www.htdig.org/ Packager: Gilles Detillieux %description The ht://Dig system is a complete world wide web indexing and searching system for a small domain or intranet. This system is not meant to replace the need for powerful internet-wide search systems like Lycos, Infoseek, Webcrawler and AltaVista. Instead it is meant to cover the search needs for a single company, campus, or even a particular sub section of a web site. As opposed to some WAIS-based or web-server based search engines, ht://Dig can span several web servers at a site. The type of these different web servers doesn't matter as long as they understand the HTTP 1.0 protocol. %prep %setup -q -n htdig-%{PACKAGE_VERSION} #%patch0 -p0 -b .noparse %build CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --mandir=%{mandir} \ --bindir=%{bindir} --libexec=/usr/lib --libdir=/usr/lib \ --with-image-dir=%{contentdir}/html/htdig \ --with-cgi-bin-dir=%{contentdir}/cgi-bin \ --with-search-dir=%{searchdir} \ --with-config-dir=%{configdir} \ --with-common-dir=%{commondir} \ --with-database-dir=%{databasedir} #rm -f htlib/langinfo.h # conflicts with libc5 headers #echo '#include "/usr/include/langinfo.h"' > htlib/langinfo.h # to keep htlib/Makefile happy make %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install-strip mkdir -p $RPM_BUILD_ROOT/etc/cron.daily ln -s ../..%{bindir}/rundig $RPM_BUILD_ROOT/etc/cron.daily/htdig-dbgen ln -s ../../../..%{docdir}/htdig-%{PACKAGE_VERSION} \ $RPM_BUILD_ROOT%{contentdir}/html/htdig/htdoc %clean rm -rf $RPM_BUILD_ROOT %post # Only run this if installing for the first time if [ "$1" = 1 ]; then SERVERNAME="`grep '^ServerName' /etc/httpd/conf/httpd.conf | awk 'NR == 1 {print $2}'`" [ -z "$SERVERNAME" ] && SERVERNAME="`hostname -f`" [ -z "$SERVERNAME" ] && SERVERNAME="localhost" TMPFILE=$(mktemp /tmp/ht.XXXXXX) || exit 1 sed 's/^start_url:.*/#&\ # (See end of file for this parameter.)/' %{configdir}/htdig.conf > $TMPFILE cat $TMPFILE > %{configdir}/htdig.conf rm $TMPFILE cat >> %{configdir}/htdig.conf < - built with 3.2.0b6, adding man pages & include files - updated pathnames for current systems (/usr/share/htdig for common dir) - used variable for configdir, mandir & docdir - used mktemp to create safe temp file in post script * Wed Jul 4 2001 Gilles Detillieux - used variables for many pathnames, to allow easy switchover to 7.x (using Powertools-like pathnames for Red Hat 7) * Thu Jun 7 2001 Gilles Detillieux - updated to 3.2.0b4 * Fri Dec 1 2000 Gilles Detillieux - updated to 3.2.0b3 * Mon Feb 21 2000 Gilles Detillieux - fixed post script to add more descriptive entries in htdig.conf - made cron script a config file - updated to 3.2.0b2 * Thu Feb 3 2000 Gilles Detillieux - added mime.types as a config file * Mon Jan 17 2000 Gilles Detillieux - updated to 3.2.0b1 * Fri Aug 13 1999 Gilles Detillieux - changed configure & install options and got rid of conf.patch file to work with latest 3.2 code * Mon Jun 7 1999 Gilles Detillieux - fixed post script to use only first ServerName directive in httpd.conf * Tue Mar 23 1999 Gilles Detillieux - updated to 3.2.0dev, for testing * Thu Feb 4 1999 Gilles Detillieux - put web stuff back in /home/httpd/html & /home/httpd/cgi-bin, so it can go over a standard Apache installation on Red Hat - cleaned up install to make use of new features * Thu Feb 4 1999 Ric Klaren - changed buildroot stuff - minor spec file fixes - install web stuff in /home/httpd/htdig - made rundig config file * Tue Sep 22 1998 Gilles Detillieux - Added local_urls stuff to generated htdig.conf file * Fri Sep 18 1998 Gilles Detillieux - Built the rpm from latest htdig source (3.1.0b1), using earlier versions of rpms by Mihai Ibanescu and Elliot Lee as a model, incorporating ideas from both. I've made the install locations as FSSTND compliant as I can think of. htdig-3.2.0b6/contrib/parse_doc.pl0100755006314600127310000002366607670562520016350 0ustar angusgbhtdig#!/usr/local/bin/perl # 1998/12/10 # Added: push @allwords, $fields[$x]; # Replaced: matching patterns. they match words starting or ending with ()[]'`;:?.,! now, not when in between! # Gone: the variable $line is gone (using $_ now) # # 1998/12/11 # Added: catdoc test (is catdoc runnable?) # Changed: push line semi-colomn wrong. # Changed: matching works for end of lines now # Added: option to rigorously delete all punctuation # # 1999/02/09 # Added: option to delete all hyphens # Added: uses ps2ascii to handle PS files # 1999/02/15 # Added: check for some file formats # 1999/02/25 # Added: uses pdftotext to handle PDF files # Changed: generates a head record with punct. # 1999/03/01 # Added: extra checks for file "wrappers" # & check for MS Word signature (no longer defaults to catdoc) # 1999/03/05 # Changed: rejoin hyphenated words across lines # (in PDFs) & remove multiple punct. chars. between words (all) # 1999/03/10 # Changed: fix handling of minimum word length # 1999/08/12 # Changed: adapted for xpdf 0.90 release # Added: uses pdfinfo to handle PDF titles # Changed: keep hyphens by default, as htdig # does, but change dashes to hyphens # 1999/09/09 # Changed: fix to handle empty PDF title right # 2000/01/12 # Changed: "break" to "last" (no break in Perl) # Changed: code for parsing a line into a list of # words, to use "split", other streamlining. # 2001/07/12 # Changed: fix "last" handling in dehyphenation # Added: handle %xx codes in title from URL # 2003/06/07 # Changed: allow file names with spaces ######################################### # # set this to your MS Word to text converter # get it from: http://www.fe.msk.ru/~vitus/catdoc/ # $CATDOC = "/usr/local/bin/catdoc"; # # set this to your WordPerfect to text converter, or /bin/true if none available # this nabs WP documents with .doc suffix, so catdoc doesn't see them # $CATWP = "/bin/true"; # # set this to your RTF to text converter, or /bin/true if none available # this nabs RTF documents with .doc suffix, so catdoc doesn't see them # $CATRTF = "/bin/true"; # # set this to your PostScript to text converter # get it from the ghostscript 3.33 (or later) package # $CATPS = "/usr/bin/ps2ascii"; # # set this to your PDF to text converter, and pdfinfo tool # get it from the xpdf 0.90 package at http://www.foolabs.com/xpdf/ # $CATPDF = "/usr/bin/pdftotext"; $PDFINFO = "/usr/bin/pdfinfo"; #$CATPDF = "/usr/local/bin/pdftotext"; #$PDFINFO = "/usr/local/bin/pdfinfo"; # need some var's $minimum_word_length = 3; $head = ""; @allwords = (); @temp = (); $x = 0; #@fields = (); $calc = 0; $dehyphenate = 0; $title = ""; # # okay. my programming style isn't that nice, but it works... #for ($x=0; $x<@ARGV; $x++) { # print out the args # print STDERR "$ARGV[$x]\n"; #} # Read first bytes of file to check for file type (like file(1) does) open(FILE, "< $ARGV[0]") || die "Oops. Can't open file $ARGV[0]: $!\n"; read FILE,$magic,8; close FILE; if ($magic =~ /^\0\n/) { # possible MacBinary header open(FILE, "< $ARGV[0]") || die "Oops. Can't open file $ARGV[0]: $!\n"; read FILE,$magic,136; # let's hope parsers can handle them! close FILE; } if ($magic =~ /%!|^\033%-12345/) { # it's PostScript (or HP print job) $parser = $CATPS; # gs 3.33 leaves _temp_.??? files in . $parsecmd = "(cd /tmp; $parser; rm -f _temp_.???) < \"$ARGV[0]\" |"; # keep quiet even if PS gives errors... # $parsecmd = "(cd /tmp; $parser; rm -f _temp_.???) < \"$ARGV[0]\" 2>/dev/null |"; $type = "PostScript"; $dehyphenate = 0; # ps2ascii already does this if ($magic =~ /^\033%-12345/) { # HP print job open(FILE, "< $ARGV[0]") || die "Oops. Can't open file $ARGV[0]: $!\n"; read FILE,$magic,256; close FILE; exit unless $magic =~ /^\033%-12345X\@PJL.*\n*.*\n*.*ENTER\s*LANGUAGE\s*=\s*POSTSCRIPT.*\n*.*\n*.*\n%!/ } } elsif ($magic =~ /%PDF-/) { # it's PDF (Acrobat) $parser = $CATPDF; $parsecmd = "$parser -raw \"$ARGV[0]\" - |"; # to handle single-column, strangely laid out PDFs, use coalescing feature... # $parsecmd = "$parser \"$ARGV[0]\" - |"; $type = "PDF"; $dehyphenate = 1; # PDFs often have hyphenated lines if (open(INFO, "$PDFINFO \"$ARGV[0]\" 2>/dev/null |")) { while () { if (/^Title:/) { $title = $_; $title =~ s/^Title:\s+//; $title =~ s/\s+$//; $title =~ s/\s+/ /g; $title =~ s/&/\&\;/g; $title =~ s//\>\;/g; last; } } close INFO; } } elsif ($magic =~ /WPC/) { # it's WordPerfect $parser = $CATWP; $parsecmd = "$parser \"$ARGV[0]\" |"; $type = "WordPerfect"; $dehyphenate = 0; # WP documents not likely hyphenated } elsif ($magic =~ /^{\\rtf/) { # it's Richtext $parser = $CATRTF; $parsecmd = "$parser \"$ARGV[0]\" |"; $type = "RTF"; $dehyphenate = 0; # RTF documents not likely hyphenated } elsif ($magic =~ /\320\317\021\340/) { # it's MS Word $parser = $CATDOC; $parsecmd = "$parser -a -w \"$ARGV[0]\" |"; $type = "Word"; $dehyphenate = 0; # Word documents not likely hyphenated } else { die "Can't determine type of file $ARGV[0]; content-type: $ARGV[1]; URL: $ARGV[2]\n"; } # print STDERR "$ARGV[0]: $type $parsecmd\n"; die "Hmm. $parser is absent or unwilling to execute.\n" unless -x $parser; # open it open(CAT, "$parsecmd") || die "Hmmm. $parser doesn't want to be opened using pipe.\n"; while () { while (/[A-Za-z\300-\377]-\s*$/ && $dehyphenate) { $_ .= ; last if eof; s/([A-Za-z\300-\377])-\s*\n\s*([A-Za-z\300-\377])/$1$2/s } $head .= " " . $_; # s/\s+[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]+|[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]+\s+|^[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]+|[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]+$/ /g; # replace reading-chars with space (only at end or begin of word, but allow multiple characters) ## s/\s[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]|[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]\s|^[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]|[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]$/ /g; # replace reading-chars with space (only at end or begin of word) ## s/[\(\)\[\]\\\/\^\;\:\"\'\`\.\,\?!\*]/ /g; # rigorously replace all by ## s/[\-\255]/ /g; # replace hyphens with space # s/[\255]/-/g; # replace dashes with hyphens # @fields = split; # split up line # next if (@fields == 0); # skip if no fields (does it speed up?) # for ($x=0; $x<@fields; $x++) { # check each field if string length >= 3 # if (length($fields[$x]) >= $minimum_word_length) { # push @allwords, $fields[$x]; # add to list # } # } # Delete valid punctuation. These are the default values # for valid_punctuation, and should be changed other values # are specified in the config file. tr{-\255._/!#$%^&'}{}d; push @allwords, grep { length >= $minimum_word_length } split /\W+/; } close CAT; exit unless @allwords > 0; # nothing to output ############################################# # print out the title, if it's set, and not just a file name if ($title !~ /^$/ && $title !~ /^[A-G]:[^\s]+\.[Pp][Dd][Ff]$/) { print "t\t$title\n"; } else { # otherwise generate a title @temp = split(/\//, $ARGV[2]); # get the filename, get rid of basename $temp[-1] =~ s/%([A-F0-9][A-F0-9])/pack("C", hex($1))/gie; print "t\t$type Document $temp[-1]\n"; # print it } ############################################# # print out the head $head =~ s/^\s+//; # remove leading and trailing space $head =~ s/\s+$//; $head =~ s/\s+/ /g; $head =~ s/&/\&\;/g; $head =~ s//\>\;/g; print "h\t$head\n"; #$calc = @allwords; #print "h\t"; ##if ($calc >100) { # but not more than 100 words ## $calc = 100; ##} #for ($x=0; $x<$calc; $x++) { # print out the words for the exerpt # print "$allwords[$x] "; #} #print "\n"; ############################################# # now the words #for ($x=0; $x<@allwords; $x++) { # $calc=int(1000*$x/@allwords); # calculate rel. position (0-1000) # print "w\t$allwords[$x]\t$calc\t0\n"; # print out word, rel. pos. and text type (0) #} $x = 0; for ( @allwords ) { # print out word, rel. pos. and text type (0) printf "w\t%s\t%d\t0\n", $_, 1000*$x++/@allwords; } $calc=@allwords; # print STDERR "# of words indexed: $calc\n"; htdig-3.2.0b6/contrib/run-robot.sh0100644006314600127310000000126406275416054016322 0ustar angusgbhtdig#!/bin/sh CfgFile=/www/search.sbs.de/test/conf/htfig.conf BinDir=/www/search.sbs.de/test/bin CgiBinDir=/www/search.sbs.de/test/cgi-bin DataDir=/www/search.sbs.de/data/robot Date=`date +%y%m%d` date > $DataDir/$Date-runtime $BinDir/htdig -v -t -s -c $CfgFile >> $DataDir/$Date-robot $BinDir/htmerge -v -c $CfgFile >> $DataDir/$Date-robot date >> $DataDir/$Date-runtime $BinDir/whatsnew.pl -v > $DataDir/$Date-whatsnew sort $BinDir/urls | uniq > $DataDir/$Date-urls rm -f $DataDir/current-* ln -s $DataDir/$Date-runtime $DataDir/current-runtime ln -s $DataDir/$Date-robot $DataDir/current-robot ln -s $DataDir/$Date-urls $DataDir/current-urls $BinDir/status.pl -v > $DataDir/$Date-status htdig-3.2.0b6/contrib/status.pl0100755006314600127310000001402506275416054015721 0ustar angusgbhtdig#!/usr/local/bin/perl # # status.pl v1.0 960413 Iain Lea (iain@sbs.de) # # ChangeLog # 960413 IL # # Produces a HTML 'Search Engine Status' page with last 5 runs # and 'Top 10' servers by #URLS indexed. # # Usage: status.pl [options] # -h help # -F file HTML footer # -H file HTML header # -o file HTML generated file # -v verbose # # TODO require 'timelocal.pl'; require 'getopts.pl'; require '/www/search.sbs.de/bin/sbs.pl'; $DataDir = '/www/search.sbs.de/data/robot'; $RunTimeFile = "$DataDir/current-runtime"; $RobotFile = "$DataDir/current-robot"; $IndexFile = '/www/search.sbs.de/test/db/db.wordlist'; $DefOutputFile = '/www/search.sbs.de/test/pub/status.html'; $TmpFile = "/tmp/status.$$"; $DefFooter = ''; $DefHeader = ''; $Verbose = 0; $Top10Servers = 10; &ParseCmdLine; print "Generating status.html...\n" if $Verbose; &ReadDataFiles ($RunTimeFile, $RobotFile, $IndexFile); &WriteStatus ($DataDir, $DefOutputFile, $DefHeader, $DefFooter); exit 1; ############################################################################# # Subroutines # sub ParseCmdLine { &Getopts ('F:hH:o:v'); if ($opt_h ne "") { print <) { chop; if (! $EndTime && $BegTime) { # Sat Apr 13 12:57:52 MET DST 1996 /^...\ (...)\ ([0-9][0-9])\ (..):(..):(..)\ ... ... ([0-9]{4}$)/; $EndTime = timelocal ($5, $4, $3, $2, $Months{$1}, $6 - 1900); $RunTime = $EndTime - $BegTime; $RunTime = sprintf ("%02d%02d", $RunTime/3600, ($RunTime%3600)/60); print "END=[$_] [$EndTime] [$RunTime]\n" if $Verbose; } if (! $BegTime) { # Sat Apr 13 12:57:52 MET DST 1996 /^...\ (...)\ ([0-9][0-9])\ (..):(..):(..)\ ... ... ([0-9]{4}$)/; $Mon = $Months{$1}; $Year = $6 - 1900; $BegTime = timelocal ($5, $4, $3, $2, $Mon, $Year); $RunDate = sprintf ("%02d%02d%02d", $Year, $Mon+1, $2); print "BEG=[$_] [$BegTime] [$RunDate]\n" if $Verbose; } } close (TIME); # IndexSize : NumWords : NumURLS : NumServers @StatData = stat ($IndexFile); $IndexSize = $StatData[7]; print "SIZE=[$IndexSize]\n" if $Verbose; # NumWords : NumURLS : NumServers $NumWords = $NumURLS = $NumServers = 0; open (ROBOT, "$RobotFile") || die "Error: $RobotFile - $!\n"; while () { if (/^htdig:\s+(.*)\s+([0-9]*)\s+documents$/) { $NumURLS += $2; $NumServers++; if ($2 > 0) { $Key = sprintf ("%07d|%s", $2, $1); $Top10ByName{$Key} = $2; } print "SERVER=[$1] DOCS=[$2]\n" if $Verbose; } elsif (/^Read\s+([0-9]*)\s+words$/) { $NumWords = $1; print "WORDS=[$NumWords]\n" if $Verbose; } } close (ROBOT); # Write data to YYMMDD-info file $InfoFile = "$DataDir/$RunDate-info"; $CurrFile = "$DataDir/current-info"; open (INFO, ">$InfoFile") || die "Error: $InfoFile - $!\n"; print "$RunDate:$RunTime:$IndexSize:$NumWords:$NumURLS:$NumServers\n" if $Verbose; print INFO "$RunDate:$RunTime:$IndexSize:$NumWords:$NumURLS:$NumServers\n"; close (INFO); unlink ($CurrFile); symlink ($InfoFile, $CurrFile); } sub WriteStatus { my ($DataDir, $OutFile, $Header, $Footer) = @_; $RobotInfo = &ReadRobotInfo ("$DataDir/current-info"); open (HTML, ">$OutFile") || die "Error: $OutFile - $!\n"; &PrintBoilerPlate ($Header, 1); print HTML < $RobotInfo

EOT ; # read YYMMDD-info files opendir (DIR, $DataDir) || die "Error: $DataDir - $!\n"; @InfoFiles = grep (/^[0-9]{6}-info$/, readdir (DIR)); closedir (DIR); @InfoFiles = reverse (sort (@InfoFiles)); @InfoFiles = @InfoFiles[0,1,2,3,4]; foreach $File (@InfoFiles) { $File = "$DataDir/$File"; open (INFO, "$File") || die "Error: $File - $!\n"; chop (($_ = )); ($RunDate, $RunTime, $IndexSize, $NumWords, $NumURLS, $NumServers) = split (':'); $IndexSize = sprintf ("%.1f", $IndexSize / (1024*1024)); $RunTime =~ /(..)(..)/; $RunTime = "$1:$2"; print HTML <$RunDate EOT ; close (INFO); } print HTML <

Table of last 5 robot runs.
Run DateRun Time# Servers# URL's# WordsIndex (MB)
$RunTime $NumServers $NumURLS $NumWords $IndexSize
EOT ; $NumServers = 0; foreach $Key (reverse (sort (keys (%Top10ByName)))) { if ($NumServers < $Top10Servers) { $NumServers++; $NumURLS = $Top10ByName{$Key}; $Key =~ /^[0-9]*\|(.*)$/; $Server = $1; $Server =~ s/:80$//; print HTML <$Server EOT ; } } print HTML "
Table of Top 10 servers listed by number of indexed documents.
Top 10 Servers# URL's
$NumURLS
\n"; &PrintBoilerPlate ($Footer, 0); close (HTML); } sub PrintBoilerPlate { my ($File, $IsHeader) = @_; if ($File ne "" && -e $File) { open (FILE, $File) || die "Error: $File - $!\n"; while () { print HTML; } close (FILE); } else { if ($IsHeader) { print HTML < Search Engine Status

Search Engine Status


EOT ; } else { &PrintFooterHTML; } } } htdig-3.2.0b6/contrib/changehost/0040755006314600127310000000000010063260367016154 5ustar angusgbhtdightdig-3.2.0b6/contrib/changehost/changehost.pl0100755006314600127310000001416606275416055020653 0ustar angusgbhtdig#!/usr/local/bin/perl ## ## changehost.pl (C) 1995 Andrew Scherpbier ## ## This program will change hostnames of URLs in the document database and index. ## ## usage: ## changehost.pl database_base from to ## ## example: ## changehost.pl /opt/www/htdig/sdsu www.sdsu.edu www.northpole.net ## ## Two new database will be created with a base of '/tmp/new'. ## These databases can then be used by htsearch. ## use GDBM_File; $base = $ARGV[0]; $from = $ARGV[1]; $to = $ARGV[2]; $dbfile = "$base.docdb"; $newfile = "/tmp/new.docdb"; ## ## Convert the document database first. ## tie(%newdb, GDBM_File, $newfile, GDBM_NEWDB, 0644) || die "$newfile: '$!'"; tie(%docdb, GDBM_File, $dbfile, GDBM_READER, 0) || die "$dbfile: $!"; while (($key, $value) = each %docdb) { if ($key =~ /http:\/\/$from/i) { %record = parse_ref_record($value); $key =~ s/http:\/\/$from/http:\/\/$to/i; print "$key\n"; $t = $record{"URL"}; $t =~ s/http:\/\/$from/http:\/\/$to/i; $record{"URL"} = $t; $value = create_ref_record(%record); } $newdb{$key} = $value; } untie %newdb; untie %docdb; ## ## Now create the document index ## $newfile = "/tmp/new.docs.index"; $dbfile = "$base.docs.index"; tie(%newdb, GDBM_File, $newfile, GDBM_NEWDB, 0644) || die "$newfile: '$!'"; tie(%docdb, GDBM_File, $dbfile, GDBM_READER, 0) || die "$dbfile: $!"; while (($key, $value) = each %docdb) { if ($value =~ /http:\/\/$from/i) { $value =~ s/http:\/\/$from/http:\/\/$to/i; } $newdb{$key} = $value; } untie %newdb; untie %docdb; ###################################################################### sub create_ref_record { local(%rec) = @_; local($s); if (exists $rec{"ID"}) { $s .= pack("Ci", 0, $rec{"ID"}); } if (exists $rec{"TIME"}) { $s .= pack("Ci", 1, $rec{"TIME"}); } if (exists $rec{"ACCESSED"}) { $s .= pack("Ci", 2, $rec{"ACCESSED"}); } if (exists $rec{"STATE"}) { $s .= pack("Ci", 3, $rec{"STATE"}); } if (exists $rec{"SIZE"}) { $s .= pack("Ci", 4, $rec{"SIZE"}); } if (exists $rec{"LINKS"}) { $s .= pack("Ci", 5, $rec{"LINKS"}); } if (exists $rec{"IMAGESIZE"}) { $s .= pack("Ci", 6, $rec{"IMAGESIZE"}); } if (exists $rec{"HOPCOUNT"}) { $s .= pack("Ci", 7, $rec{"HOPCOUNT"}); } if (exists $rec{"URL"}) { $s .= pack("Ci", 8, length($rec{"URL"})); $s .= $rec{"URL"}; } if (exists $rec{"HEAD"}) { $s .= pack("Ci", 9, length($rec{"HEAD"})); $s .= $rec{"HEAD"}; } if (exists $rec{"TITLE"}) { $s .= pack("Ci", 10, length($rec{"TITLE"})); $s .= $rec{"TITLE"}; } if (exists $rec{"DESCRIPTIONS"}) { @v = split('', $rec{"DESCRIPTIONS"}); $s .= pack("Ci", 11, $#v - 1); foreach (@v) { $s .= pack("i", length($_)); $s .= $_; } } if (exists $rec{"ANCHORS"}) { @v = split('', $rec{"ANCHORS"}); $s .= pack("Ci", 12, $#v - 1); foreach (@v) { $s .= pack("i", length($_)); $s .= $_; } } if (exists $rec{"EMAIL"}) { $s .= pack("Ci", 13, length($rec{"EMAIL"})); $s .= $rec{"EMAIL"}; } if (exists $rec{"NOTIFICATION"}) { $s .= pack("Ci", 14, length($rec{"NOTIFICATION"})); $s .= $rec{"NOTIFICATION"}; } if (exists $rec{"SUBJECT"}) { $s .= pack("Ci", 15, length($rec{"SUBJECT"})); $s .= $rec{"SUBJECT"}; } return $s; } sub parse_ref_record { local($value) = @_; local(%rec, $length, $count, $result); while (length($value) > 0) { $what = unpack("C", $value); $value = substr($value, 1); if ($what == 0) { # ID $rec{"ID"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 1) { # TIME $rec{"TIME"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 2) { # ACCESSED $rec{"ACCESSED"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 3) { # STATE $rec{"STATE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 4) { # SIZE $rec{"SIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 5) { # LINKS $rec{"LINKS"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 6) { # IMAGESIZE $rec{"IMAGESIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 7) { # HOPCOUNT $rec{"HOPCOUNT"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 8) { # URL $length = unpack("i", $value); $rec{"URL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 9) { # HEAD $length = unpack("i", $value); $rec{"HEAD"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 10) { # TITLE $length = unpack("i", $value); $rec{"TITLE"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 11) { # DESCRIPTIONS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"DESCRIPTIONS"} = $result; } elsif ($what == 12) { # ANCHORS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"ANCHORS"} = $result; } elsif ($what == 13) { # EMAIL $length = unpack("i", $value); $rec{"EMAIL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 14) { # NOTIFICATION $length = unpack("i", $value); $rec{"NOTIFICATION"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 15) { # SUBJECT $length = unpack("i", $value); $rec{"SUBJECT"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } } return %rec; } htdig-3.2.0b6/contrib/doc2html/0040755006314600127310000000000010063260367015545 5ustar angusgbhtdightdig-3.2.0b6/contrib/doc2html/doc2html.cfg0100644006314600127310000002245207427026534017752 0ustar angusgbhtdig# Configuration file for use with doc2html.pl, which is used # to index Word, WordPerfect , etc. files using Ht://dig. # # Based on wp2html.cfg file supplied with wp2html version 3.0 # The special token "typeout" simply outputs the given text # and can be used to inform users of versions, configuration changes etc. typeout="" #------------------- Single character translations --------------- # Protect HTML magic symbols. '<'="<" '>'=">" '&'="&" '"'=""" #------------------- WP code translations --------------- # File header. BEGIN is called before any text is output # BEGIN is passed three strings being the # Input Directory, Input file name and Input file type. # Do what you like with them! BEGIN=" %X<XDocSubject> \"> \">

%xH " # Beginning of a subpart. This is called for each file. begin=" %X<XDocSubject - %O \n" # File end. END is called at the end of the document # You may wish to insert signatures etc. END="

%xf %xF %X \n" # End of a subpart. This is called for each sub part of a file except last. end="\n%xf\n\n\n" # End of the last subpart. This is only for the final sub-part # which may wish to have a different ending to the others (like # perhaps not refering to the NEXT chapter?) End="\n%xf\n\n\n" # Message output by wp2html into output file but not to be displayed # or for "hidden" WP text Message="" # PageNo="\\folio{}" # insert page number # RomanPage="%\n%% Set roman page number %1\n" # set roman numerals # ArabicPage="%\n%% Set arabic page number %1\n" # set arabic numerals HSpace=" " # Unbreakable (Hard) space # Tabs in Netscape (before HTML3) cannot be done properly # We fudge them here with non breaking space until Netscape 1.2? Tab=" " # Hard page looks quite good as a line HPg="\n" # Soft page is usually ignored SPg=" " CondEOP=" " HRt="
\n" # Single Hard return just a break HRt2="

\n" # Two or more terminates paragraph SRt="\n" # Soft return is a newline DSRt="\n" # Deletable return at end of line DSPg="\n" # Deletable return at end of page softHyphen="" # Hyphens are ignored, since wrapping is up the clients. softHyphenEOL="" # same for hyphens at end of a line hardHyphen="-" # Nonbreaking hyphen, must put in autoHyphen="" # auto Hyphens will be ignored too NoHyphWord="" # Inhibit hyphenation of this word # Margins are left as comments until HTML3 arrives Marg=" " TopMarg=" " PageLength=" " # Line spacing changes are ignored SS="" 1.5S="" DS="" TS="" LS="" LPI="" # Font changes mapped to Netscape font size defn ExtraLarge="

" extralarge="

" VeryLarge="

" verylarge="

" Large="

" large="

" Small="
" small="
" Fine="" fine="
" FontColour="\n" fontColour="\n" Font=" " font=" " Bold="" # Boldface bold="" Und="" und="" Red="" # Redlining red="" Strike="" # Strikeout XXX strike="" Italics="" italics="" Rev="" # Reverse video XXX rev="" Over="" # overprinting not supported XXX over="" # Netscape 2 and after can use Sup="" sup="" Sub="" sub="" # UpHalfLine, DownHalfLine, AdvanceToHalf -- undefined # Indent mapped to unordered lists, good for blocked indents #Indent="\n
    \n" #indent="\n
\n" #DIndent="\n
    \n" #dindent="\n
\n" # Indents as space, use if indents are like TABS for you Indent=" " indent="" DIndent=" " dindent="" # Margin release is passed one parameter, the number of characters. MarginRelease=" " Center="
" # centering, Netscape way center="
\n" Left="
" # Netscape left justify left="
" Right="
" # Netscape right justify right="
" Full="
" # Netscape full justify full="
" # Can use also # Left # left # Full # full # Math, math, MathCalc, MathCalcColumn, SubTtl, IsSubTtl, Ttl, IsTtl, GrandTtl # -- undefined Column="" column="" Header="\n" header="\n" Footer="\n" footer="\n" Footnote="    " footnote="" FootnoteFormat="%1" footnoteFormat="" # Displays for various automatic numbers # uncomment these to "eat" the autonumbers inserted by WP6 FootnoteDisplay="%e" footnoteDisplay="%f" #EndnoteDisplay="%e" #endnoteDisplay="%f" #ParanumDisplay="%e" #paranumDisplay="%f" #LinenumDisplay="%e" #linenumDisplay="%f" BeginTabs="" SetTab="" SetTabCenter="" SetTabRight="" SetTabDecimal="" EndTabs="" Hyph="" # Allow hyphenation hyph="" # Disable hyphenation Wid="" # Widow protection wid="" # Allow widows # HZone, DAlign -- undefined Supp=" " CtrPg=" " SetFont=" " SetBin=" " # True table definitions, these are Netscape style (HTML3) # Start of a table Table="\n" # end of a table table="\n
\n" # New row Row="\n" # End row row="\n" # New cell. Is passed the col and row spans integers and align flags #Cell="\n\n" Cell="\n\n" # End cell cell="\n" # Table header cells. HeadCell="\n\n" HeadCell="\n\n" # End header cell headCell="\n" # Ordinary WP comment anywhere in the document, passed comment text Comment="\n\n" # default Style operation for styles user has not names below defaultStyleOn=" " defaultStyleOff=" " defaultStyleOpen=" " defaultStyleEnd=" " # Set defaults for TOC markers here ToC=" " toC=" " ToC1=" " toC1=" " ToC2=" " toC2=" " ToC3=" " toC3=" " ToC4=" " toC4=" " ToC5=" " toC5=" " # Detect start and end of index in document Index=" " index=" " # Set defaults for List markers here List=" " list=" " List1=" " list1=" " List2=" " list2=" " List3=" " list3=" " List4=" " list4=" " List5=" " list5=" " ToA=" " toA=" " ToAMark=" " XrefMark=" " xrefMark=" " XrefTarget=" " # Figure inside WP. # Right now we have a confusing 3 options, that is we have # A WPG image inside Wordperfect, # 1. With no GIF/JPEG conversion available # 2. Of unknown size but a GIF/JPEG conversion exists # 3. With known (set) size and with GIF/JPEG conversion # Depending on which of the above we find we call one of the next # three tags, Figure, Image, ImageSized # NO GIF/JPEG Figure=" " # GIF/JPEG available, but sizes and alignment unknown # Image=" # Click thumbnail picture to see full size version" # You can also do thumbnails too, like this #Image=" #Click thumbnail picture to see full size in separate window" Image="" # GIF/JPEG available, and sizes and alignment known # If this is NOT given, Image will be used instead #ImageSized="" # Boxes, Table, Text and User TableBox="\n" tableBox="\n" TextBox="\n" textBox="\n" UserBox="\n" userBox="\n" # Equations are rendered as rough text right now, wait for HTML3 # and we can switch this on properly Equation=" " equation=" " # Captions for all boxes Caption="
[" caption="]
\n" HLine="
" ParaNum1="%s " ParaNum2="%s " ParaNum3="%s " ParaNum4="%s " ParaNum5="%s " ParaNum6="%s " ParaNum7="%s " ParaNum8="%s " ParaNumEnd=" " PN0=" " PN1=" " PN2=" " PN3=" " PN4=" " PN5=" " PN6=" " PN7=" " PN8=" " #********************************************************************* # End of required parameters -- start of optional entries # Here is the complete list of fields which can optionally be # extracted from the extended document summary area of the file # If they are not defined (to be anything) they will not be extracted #!XDocName="Filename" #!XDocType="Type" XDocAuthor="" XDocAbstract="" #!XDocAccount="Account" XDocKeywords="" XDocSubject="%X" #!XDocTypist="Typist" # These tags allow you to convert WP6 hypertext refs into HTML hypertext # But you should be careful how you use them as documents NOT designed # to be HTML (perhaps linking to other documents in unreachable # directories) would generate confusing links. #!HyperBegin="<a href=\"%s.htm#%t\">%e" #!hyperBegin="%f" #!HyperEnd="</a>%e" #!hyperEnd="%f" # Or you can use WP hypertext refs as direct hypertext # but make sure you insert the URL in the BOOKMARK field HyperBegin="<a href=\"%t\">%e" hyperBegin="%f" HyperEnd="</a>%e" hyperEnd="%f" # These tags allow you to convert WP6 bookmarks into appropriate # HTML anchors which are needed if you use the Hyper tags above. BookMark="<a name=\"%s\">" bookMark="</a>" # Hypertext references in Word Documents (real URL) Href="<a href=\"%s\">" href="</a>" # These tags allow you to find the file name of included files #SubDoc="<hr>Start Included file %s<hr>\n" #subDoc="<hr>End Included file %s<hr>\n" SubDoc="\n" subDoc="\n" # These tags are trigger by WP Small Caps attributes (On/Off) #!SmallCaps="" #!smallCaps="" # End of main configuration file ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/contrib/doc2html/DETAILS��������������������������������������������������������������0100644�0063146�0012731�00000032476�07604041615�016566� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������INTRODUCTION ============ This DETAILS file accompanies doc2html version 3.0.1. Read this file for instructions on the installation and use of the doc2html scripts. The set of files is: DETAILS - this file doc2html.pl - the main Perl script doc2html.cfg - configuration file for use with wp2html doc2html.sty - style file for use with wp2html pdf2html.pl - Perl script for converting PDF files to HTML swf2html.pl - Perl script for extracting links from Shockwave flash files. README - brief description doc2html.pl is a Perl5 script for use as an external converter with htdig 3.1.4 or later. It takes as input the name of a file containing a document in a number of possible formats and its MIME type. It uses the appropriate conversion utility to convert it to HTML on standard output. doc2html.pl was designed to be easily adapted to use whatever conversion utilities are available, and although it has been written around the "wp2html" utility, it does not require wp2html to function. NOTE: version 3.0.1 has only been tested on Unix. pdf2html.pl is a Perl script which uses a pair of utilities (pdfinfo and pdf2text) to extract information and text from an Adobe PDF file and write HTML output. It can be called directly from htdig, but you are recommended to call it via doc2html.pl. swf2html.pl is a Perl script which calls a utility (swfparse) and outputs HTML containing links to the URL's found in a Shockwave flash file. It can be called directly from htdig, but you are recommended to call it via doc2html.pl. ABOUT DOC2HTML.PL ================= doc2html.pl is essentially a wrapper script, and is itself only capable of reading plain text files. It requires the utility programs described below to work properly. doc2html.pl was written by David Adams <d.j.adams@soton.ac.uk>, it is based on conv_doc.pl written by Gilles Detillieux <grdetil@scrc.umanitoba.ca>. This in turn was based on the parse_word_doc.pl script, written by Jesse op den Brouw <MSQL_User@st.hhs.nl>. doc2html.pl makes up to three attempts to read a file. It first tries utilities which convert directly into HTML. If one is not found, or no output is produced, it then tries utilities which output plain text. If none is found, and the file is not of a type known to be unconvertable, then doc2html.pl attempts to read the file itself, stripping out any control characters. doc2html.pl is written to be flexible and easy to adapt to whatever conversion utilites are available. New conversion utilities may be added simply by making additions to routine 'store_methods', with no other changes being necessary. The existing lines in store_methods should provide sufficient examples on how to add more converters. Note that converters which produce HTML are entered differently to those that produce plain text. htdig provides three arguments which are read by doc2html.pl: 1) the name of a temporary file containing a copy of the document to be converted. 2) the MIME type of the document. 3) the URL of the document (which is used in generating the title in the output). The test for document type uses both the MIME-type passed as second argument and the "Magic number" of the file. INSTALLATION ============ Installation requires that you acquire, compile and install the utilities you need to do the conversions. Those already setup in the Perl scripts are described below. If you don't have Perl module Sys::AlarmCall installed, then consider installing it, see section "TIMEOUT" below. You may need to change the first line of each script to the location of Perl on your system. Edit doc2html.pl to include the full pathname of each utility you have installed. For example: my $WP2HTML = '/opt/local/wp2html-3.2/bin/wp2html'; If you don't have a particular utility then leave its location as a null string. Then place doc2html.pl and the other scripts where htdig can access them. If you are going to convert PDF files then you will need to edit pdf2html.pl and include its full path name in doc2html.pl. If you are going to extract links from Shockwave flash files then you will need to edit swf2html.pl and include its full path name in doc2html.pl. Edit the htdig.conf configuration file to use the script, as in this example: external_parsers: application/rtf->text/html /usr/local/scripts/doc2html.pl \ text/rtf->text/html /usr/local/scripts/doc2html.pl \ application/pdf->text/html /usr/local/scripts/doc2html.pl \ application/postscript->text/html /usr/local/scripts/doc2html.pl \ application/msword->text/html /usr/local/scripts/doc2html.pl \ application/Wordperfect5.1->text/html /usr/local/scripts/doc2html.pl \ application/msexcel->text/html /usr/local/scripts/doc2html.pl \ application/vnd.ms-excel->text/html /usr/local/scripts/doc2html.pl \ application/vnd.ms-powerpoint->text/html /usr/local/scripts/doc2html.pl \ application/x-shockwave-flash->text/html /usr/local/scripts/doc2html.pl \ application/x-shockwave-flash2-preview->text/html /usr/local/scripts/doc2html.pl If you are using wp2html then place the files doc2html.cfg and doc2html.sty in the wp2html library directory. UTILITY WP2HTML =============== Obtain wp2html from http://www.res.bbsrc.ac.uk/wp2html/ Note that wp2html is not free; its author charges a small fee for "registration". Various pre-compiled versions and the source code are available, together with extensive documentation. Upgrades are available at no further charge. wp2html converts WordPerfect documents (5.1 and later) to HTML. Versions 3.2 and later will also convert Word7 and Word97 documents to HTML. A feature of wp2html which doc2html.pl exploits is that the -q option will result in either good HTML or no output at all. wp2html is very flexible in the output it creates. The two files, doc2html.cfg and doc2html.sty, should be placed in the wp2html library directory along with the .cfg and .sty files supplied with wp2html. Edit the line in doc2html.pl: my $WP2HTML = ''; to set $WP2HTML to the full pathname of wp2html. wp2html will look for the title in a document, and if it is found then output it in <TITLE>.... markup. If a title is not found then it defaults to the file name in square brackets. If wp2html is unable to convert a document, or is not installed, then doc2html.pl can use the "catdoc" or "catwpd" utilities instead. UTILITY CATDOC ============== Obtain catdoc from http://www.ice.ru/~vitus/catdoc/, it is available under the terms of the Gnu Public License. Edit the line in doc2html.pl: my $CATDOC = ''; to set the variables to the full pathname of catdoc. You might want to use a different version of catdoc for Word2 documents or for MAC Word files. catdoc converts MS Word6, Word7, etc., documents to plain text. The latest beta version is also able to convert Word2 documents. catdoc also produces a certaint amount of "garbage" as well as the text of the document. The -b option improves the likelihood that catdoc will extract all the text from the document, but at the expense of increasing the garbage as well. doc2html.pl removes some non-printing characters to minimise the garbage. If a later version of catdoc than 0.91.4 is obtained then the use of the -b option should be reviewed. UTILITY CATWPD ============== Obtain catwpd from the contribs section of the Ht://Dig web site where you obtained doc2html. It extracts words from some versions of WordPerfect files. You won't need it if you buy the superior wp2html. If you do use it, then edit the line in doc2html.pl: my $CATWPD = ''; to set the variables to the full pathname of catwpd. UTILITY PPTHTML =============== obtain ppthtml from http://www.xlhtml.org, where it is bundled in with xlhtml. In doc2html.pl, edit the line: my $PPT2HTML = ''; to set $PPT2HTML to the full pathname of ppthtml. ppthtml converts Microsoft Powerpoint files into HTML. It uses the input filename as the title. doc2html.pl replaces this with the original filename from the URL in square brackets. UTILITY XLHTML ============== Obtain xlhtml from http://www.xlhtml.org In doc2html.pl, edit the line: my $XLS2HTML = ''; to set $XLS2HTML to the full pathname of xlhtml. xlhtml converts Microsoft Excel spreadsheets into HTML. It uses the input filename as the title. doc2html.pl replaces this with the original filename from the URL in square brackets. The present version of xlHtml (0.4) writes HTML output, but does not mark up hyperlinks in .xls files as links in its output. An alternative to xlHtml is xls2csv, see below. UTILITY RTF2HTML ================ Obtain rtf2html from http://www.ice.ru/~vitus/catdoc/ In doc2html.pl, edit the line: my $RTF2HTML = ''; to set $RTF2HTML to the full pathname of rtf2html. rtf2html converts Rich Text Font documents into HTML. It uses the input filename as the title, doc2html.pl replaces this with the original filename from the URL within square brackets. UTILITY PS2ASCII ================ Ps2ascii is a PostScript to text converter. In doc2html.pl, edit the line: my $CATPS = ''; to the correct full pathname of ps2ascii. ps2ascii comes with ghostscript 3.33 (or later) package, which is pre-installed on many Unix systems. Commonly, it is a Bourne-shell script which invokes "gs", the Ghostscript binary. doc2html.pl has provision for adding the location of gs to the search path. UTILITY PDFTOTEXT ================= pdftotext converts Adobe PDF files to text. pdfinfo is a tool which displays information about the document, and is used to obtain its title, etc. Get them from the xpdf package at http://www.foolabs.com/xpdf/ In script pdf2html.pl, change the lines: my $PDFTOTEXT = "/... .../pdftotext"; my $PDFINFO = "/... .../pdfinfo"; to the correct full pathnames. Edit doc2html.pl to include the full pathname of the pdf2html.pl script. pdf2text may fail to convert PDF documents which have been truncated because htdig has max_doc_size set to smaller than the documents full size. Some PDF documents do not allow text to be extracted. UTILITY CATXLS ============== The Excel to .csv converter, xls2csv, is included with recent versions of catdoc. This is an alternative to xlhtml (see above). Edit the line: my $CATXLS = ''; to the full pathname of xls2csv. Xls2csv translates Excel spread sheets into comma-separated data. UTILITY SWFPARSE ================ swfparse (aka swfdump) extracts information from Shockwave flash files, and can be obtained from the contribs section of the Ht://Dig web site, where you obtained doc2html. Perl script swf2html.pl calls swfparse and writes HTML output containing links to the URLs found in the Shockwave file. It does NOT extract text from the file. In script swf2html.pl, change the line: my $SWFPARSE = "/... .../swfdump"; to the full pathname. Edit doc2html.pl to include the full pathname of the swf2html.pl script. LOGGING ======= Output of logging information and error messages is controlled by the environmental variable DOC2HTML_LOG, which may be set in the rundig script. If it is not set then only error messages output by doc2html.pl and by the conversion utilities it calls are returned to htdig and will appear in its STDOUT. If DOC2HTML_LOG is set to a filename, then doc2html.pl appends logging information and any error messages to the file. If DOC2HTML_LOG is set but blank, or the file cannot be opened for writing, logging information and error messages are passed back to htdig and will appear its STDOUT. In doc2html.pl, the variables $Emark and $EEmark, set in subroutine init, are used to highlight error messages. The number of lines of STDERR output from a utility which is logged or passed back to htdig is controlled by the variable $Maxerr set in routine "init" of doc2html.pl. This is provided in order to curb the large number of error messages which some utilities can produce from processing a single file. TIMEOUT ======= If possible, install Perl module Sys::AlarmCall, obtainable from CPAN if you don't already have it. This module is used by doc2html.pl to terminate a utility if it takes too long to finish. The line in doc2html.pl: $Time = 60; # allow 60 seconds for external utility to complete may be altered to suit. LIMITING INPUT AND OUTPUT ========================= The environmental variable DOC2HTML_IP_LIMIT may be set in the rundig script to limit the size of the file which doc2html.pl will attempt to convert. The default value is 20000000. Doc2html.pl will return no output to htdig if the file size is equal to or greater than this size. You are recommended to set DOC2HTML_IP_LIMIT to the same as the "max_doc_size" parameter in the htdig configuration file. Then no attempt wil be made to extract text from files which have been truncated by htdig. It is not possible to extract any text from .PDF files, for example, if they have been truncated. The environmental variable DOC2HTML_OP_LIMIT may be set in the rundig script to limit the output sent back to htdig by a single call to doc2html.pl. The default value is 10000000. Doc2html.pl will stop returning output to htdig once the DOC2HTML_OP_LIMIT has been reached. This is precaution against the unlikely event of a conversion utility returning disproportionately large amounts of data. CONTACT ======= Any queries regarding doc2html are best sent to the mailing list htdig-general@lists.sourceforge.net The author can be emailed at D.J.Adams@soton.ac.uk David Adams Information Systems Services University of Southampton 27-November-2002 htdig-3.2.0b6/contrib/doc2html/README0100644006314600127310000000215007427026534016426 0ustar angusgbhtdigReadme for doc2html External converter scripts for ht://Dig (version 3.1.4 and later), that convert Microsoft Word, Excel and Powerpoint files, and PDF, PostScript, RTF, and WordPerfect files to text (in HTML form) so they can be indexed. Uses a variety of conversion programs: wp2html - to convert Wordperfect and Word7 & 97 documents to HTML catdoc - to extract text from Word documents catwpd - to extract text from WordPerfect documents [alternative to wp2html] rtf2html - to convert RTF documents to HTML pdftotext - to extract text from Adobe PDFs ps2ascii - to extract text from PostScript pptHtml - to convert Powerpoint files to HTML xlHtml - to convert Excel spreadsheets to HTML xls2csv - to extract data from Excel spreadsheets [alternative to xlHtml] swfparse - to extract links from Shockwave flash files. The main script, doc2html.pl, is easily edited to include the available utlitities, and new utilities are easily incorporated. Written by David Adams (University of Southampton), and based on the conv_doc.pl script by Gilles Detillieux. For more information see the DETAILS file. htdig-3.2.0b6/contrib/doc2html/doc2html.pl0100755006314600127310000004420110061573563017622 0ustar angusgbhtdig#!/usr/bin/perl use strict; # # Version 3.0.1 19-September-2002 # # External converter for htdig 3.1.4 or later (Perl5 or later) # Usage: (in htdig.conf) # #external_parsers: application/rtf->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # text/rtf->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/pdf->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/postscript->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/msword->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/wordperfect5.1->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/wordperfect6.0->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/msexcel->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/vnd.ms-excel->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/vnd.ms-powerpoint->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl # application/x-shockwave-flash->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl \ # application/x-shockwave-flash2-preview->text/html /opt/local/htdig-3.1.6/scripts/doc2html.pl # # Uses wp2html to convert Word and WordPerfect documents into HTML, and # falls back to using Catdoc for Word and Catwpd for WordPerfect if # Wp2html is unavailable or unable to convert. # # Uses range of other converters as available. # # If all else fails, attempts to read file without conversion. # ######################################################################################## # Written by David Adams . # Based on conv_doc.pl written by Gilles Detillieux , # which in turn was based on the parse_word_doc.pl script, written by # Jesse op den Brouw . ######################################################################################## # Install Sys::AlarmCall if you can eval "use Sys::AlarmCall"; ######## Full paths of conversion utilities ########## ######## YOU MUST SET THESE ########## ######## (leave null those you don't have) ########## # Wp2html converts Word & Wordperfect to HTML # (get it from: http://www.res.bbsrc.ac.uk/wp2html/): my $WP2HTML = ''; #Catwpd for WordPerfect to text conversion # (you don't need this if you have wp2html) # (get it from htdig site) my $CATWPD = ''; # rtf2html converts Rich Text Font documents to HTML # (get it from http://www.ice.ru/~vitus/catdoc/): my $RTF2HTML = ''; # Catdoc converts Word (MicroSoft) to plain text # (get it from: http://www.ice.ru/~vitus/catdoc/): #version of catdoc for Word6, Word7 & Word97 files: my $CATDOC = ''; #version of catdoc for Word2 files: my $CATDOC2 = $CATDOC; #version of catdoc for Word 5.1 for MAC: my $CATDOCM = $CATDOC; # PostScript to text converter # (get it from the ghostscript 3.33 (or later) package): my $CATPS = ''; # add to search path the directory which contains gs: #$ENV{PATH} .= ":/usr/freeware/bin"; # PDF to HTML conversion script: my $PDF2HTML = ''; # full pathname of pdf2html/pl script # Excel (MicroSoft) to HTML converter # (get it from www.xlhtml.org) my $XLS2HTML = ''; # Excel (MicroSoft) to .CSV converter # (you don't need this if you have xlhtml) # (if you do want it, you can get it with catdoc) my $CATXLS = ''; # Powerpoint (MicroSoft) to HTML converter # (get it from www.xlhtml.org) my $PPT2HTML = ''; # Shockwave Flash # (extracts links from file) my $SWF2HTML = ''; # full pathname of swf2html.pl script # OpenOffice.org files #my $OpenOffice2XML = '/usr/bin/unzip'; my $OpenOffice2XML = ''; # (remove multi-byte unicode from XML in OOo documents) #my $strip_unicode = '| /usr/bin/iconv -c -s -f UTF-8 -t ISO-8859-1'; my $strip_unicode = ''; ######################################################################## # Other Global Variables my ($Success, $LOG, $Verbose, $CORE_MESS, $TMP, $RM, $ED, $Magic, $Time, $Count, $Prog, $Input, $MIME_type, $URL, $Name, $Efile, $Maxerr, $Redir, $Emark, $EEmark, $Method, $OP_Limit, $IP_Limit); my (%HTML_Method, %TEXT_Method, %BAD_type); &init; # initialise my $size = -s $Input; &quit("Input file size of $size at or above $IP_Limit limit" ) if $size >= $IP_Limit; &store_methods; # &read_magic; # Magic reveals type &error_setup; # re-route standard error o/p from utilities # see if a document -> HTML converter will work: &run('&try_html'); if ($Success) { &quit(0) } # try a document -> text converter: &run('&try_text'); if ($Success) { &quit(0) } # see if a known problem my $fail = &cannot_do; if ($fail) { &quit($fail) } # last-ditch attempt, try copying document &try_plain; if ($Success) {&quit(0)} &quit("UNABLE to convert"); #------------------------------------------------------------------------------ sub init { # Doc2html log file $LOG = $ENV{'DOC2HTML_LOG'} || ''; # if ($LOG) { open(STDERR,">>$LOG"); # ignore possible failure to open } # else O/P really does go to STDERR # Set to 1 for O/P to STDERR or Log file $Verbose = exists($ENV{'DOC2HTML_LOG'}) ? 1 : 0; # Limiting size of file doc2html.pl will try to process (default 20Mbyte) $IP_Limit = $ENV{'DOC2HTML_IP_LIMIT'} || 20000000; # Limit for O/P returned to htdig (default 10Mbyte) $OP_Limit = $ENV{'DOC2HTML_OP_LIMIT'} || 10000000; # Mark error message produced within doc2html script $Emark = "!\t"; # Mark error message produced by conversion utility $EEmark = "!!\t"; # Message to STDERR if core dump detected $CORE_MESS = "CORE DUMPED"; # Directory for temporary files $TMP = "/tmp/htdig"; if (! -d $TMP) { mkdir($TMP,0700) or die "Unable to create directory \"$TMP\": $!"; } # Current directory during run of script: chdir $TMP or warn "Cannot change directory to $TMP\n"; # File for error output from utility $Efile = 'doc_err.' . $$; # Max. number of lines of error output from utility copied $Maxerr = 10; # System command to delete a file $RM = "/bin/rm -f"; # Line editor to do substitution $ED = "/bin/sed -e"; if ($^O eq "MSWin32") {$ED = "$^X -pe"} $Time = 60; # allow 60 seconds for external utility to complete $Success = 0; $Count = 0; $Method = ''; $Prog = $0; $Prog =~ s#^.*/##; $Prog =~ s/\..*?$//; $Input = $ARGV[0] or die "No filename given\n"; $MIME_type = $ARGV[1] or die "No MIME-type given"; $URL = $ARGV[2] || '?'; $Name = $URL; $Name =~ s#^.*/##; $Name =~ s/%([A-F0-9][A-F0-9])/pack("C", hex($1))/gie; if ($Verbose and not $LOG) { print STDERR "\n$Prog: [$MIME_type] " } if ($LOG) { print STDERR "$URL [$MIME_type] " } } #------------------------------------------------------------------------------ sub store_methods { # The method of dealing with each file type is set up here. # Edit as necessary my ($mime_type,$magic,$cmd,$cmdl,$type,$description); my $name = quotemeta($Name); ####Document -> HTML converters#### # WordPerfect documents if ($WP2HTML) { $mime_type = "application/wordperfect|application/msword"; $cmd = $WP2HTML; $cmdl = "($cmd -q -DTitle=\"[$name]\" -c doc2html.cfg -s doc2html.sty -i $Input -O; $RM CmdLine.ovr)"; $magic = '\377WPC'; &store_html_method('WordPerfect (wp2html)',$cmd,$cmdl,$mime_type,$magic); } # Word documents if ($WP2HTML) { $mime_type = "application/msword"; $cmd = $WP2HTML; $cmdl = "($cmd -q -DTitle=\"[$name]\" -c doc2html.cfg -s doc2html.sty -i $Input -O; $RM CmdLine.ovr)"; $magic = '^\320\317\021\340'; &store_html_method('Word (wp2html)',$cmd,$cmdl,$mime_type,$magic); } # RTF documents if ($RTF2HTML) { $mime_type = "application/msword|application/rtf|text/rtf"; $cmd = $RTF2HTML; # Rtf2html uses filename as title, change this: $cmdl = "$cmd $Input | $ED \"s#^$Input#[$name]#\""; $magic = '^{\134rtf'; &store_html_method('RTF (rtf2html)',$cmd,$cmdl,$mime_type,$magic); } # Microsoft Excel spreadsheet if ($XLS2HTML) { $mime_type = "application/msexcel|application/vnd.ms-excel"; $cmd = $XLS2HTML; # xlHtml uses filename as title, change this: $cmdl = "$cmd -fw $Input | $ED \"s#$Input#[$name]#\""; $magic = '^\320\317\021\340'; &store_html_method('Excel (xlHtml)',$cmd,$cmdl,$mime_type,$magic); } # Microsoft Powerpoint Presentation if ($PPT2HTML) { $mime_type = "application/vnd.ms-powerpoint"; $cmd = $PPT2HTML; # xlHtml uses filename as title, change this: $cmdl = "$cmd $Input | $ED \"s#$Input#[$name]#\""; $magic = '^\320\317\021\340'; &store_html_method('Powerpoint (pptHtml)',$cmd,$cmdl,$mime_type,$magic); } # Adobe PDF file using Perl script if ($PDF2HTML) { $mime_type = "application/pdf"; $cmd = $PDF2HTML; # Replace default title (if used) with filename: $cmdl = "$cmd $Input $mime_type $name"; $magic = '%PDF-|\0PDF CARO\001\000\377'; &store_html_method('PDF (pdf2html)',$cmd,$cmdl,$mime_type,$magic); } # Shockwave Flash file using Perl script if ($SWF2HTML) { $mime_type = "application/x-shockwave-flash"; $cmd = $SWF2HTML; $cmdl = "$cmd $Input"; $magic = '^FWS[\001-\010]'; # versions 1 to 5, perhaps some later versions &store_html_method('Shockwave-Flash (swf2html)',$cmd,$cmdl,$mime_type,$magic); } # OpenOffice Documents if ($OpenOffice2XML) { $mime_type = "application/vnd.sun.xml.writer|application/vnd.sun.xml.impress|application/vnd.sun.xml.calc|application/vnd.sun.xml.draw|application/vnd.sun.xml.math"; $cmd = $OpenOffice2XML; $cmdl = "$cmd -p -qq $Input content.xml | /bin/sed -r 's/<[^>]*>/ /gi' $strip_unicode"; $magic = 'PK'; &store_html_method('OpenOffice XML (oo2xml)',$cmd,$cmdl,$mime_type,$magic); } ####Document -> Text converters#### # Word6, Word7 & Word97 documents if ($CATDOC) { $mime_type = "application/msword"; $cmd = $CATDOC; # -b option increases chance of success: $cmdl = "$cmd -a -b -w $Input"; $magic = '^\320\317\021\340'; &store_text_method('Word (catdoc)',$cmd,$cmdl,$mime_type,$magic); } # Word2 documents if ($CATDOC2) { $mime_type = "application/msword"; $cmd = $CATDOC2; $cmdl = "$cmd -a -b -w $Input"; $magic = '^\333\245-\000'; &store_text_method('Word2 (catdoc)',$cmd,$cmdl,$mime_type,$magic); } # Word 5.1 for MAC documents if ($CATDOCM) { $mime_type = "application/msword"; $cmd = $CATDOCM; $cmdl = "$cmd -a -b -w $Input"; $magic = '^\3767\000#\000\000\000\000'; &store_text_method('MACWord (catdoc)',$cmd,$cmdl,$mime_type,$magic); } # PostScript files if ($CATPS) { $mime_type = "application/postscript"; $cmd = $CATPS; # allow PS interpreter to give error messages $cmdl = "($cmd; $RM _temp_.???) < $Input"; $magic = '^.{0,20}?%!|^\033%-12345.*\n%!'; &store_text_method('PostScript (ps2ascii)',$cmd,$cmdl,$mime_type,$magic); } # Microsoft Excel file if ($CATXLS) { $mime_type = "application/vnd.ms-excel"; $cmd = $CATXLS; $cmdl = "$cmd $Input"; $magic = '^\320\317\021\340'; &store_text_method('MS Excel (xls2csv)',$cmd,$cmdl,$mime_type,$magic); } # WordPerfect document if ($CATWPD) { $mime_type = "application/wordperfect|application/msword"; $cmd = $CATWPD; $cmdl = "$cmd $Input"; $magic = '\377WPC'; &store_text_method('WordPerfect (catwpd)',$cmd,$cmdl,$mime_type,$magic); } ####Documents that cannot be converted#### # wrapped encapsulated Postscript $type = "EPS"; $magic = '^\305\320\323\306 \0'; $description = 'wrapped Encapsulated Postscript'; &store_cannot_do($type,$magic,$description); # Shockwave Flash version 6 $type = "SWF6"; $description = 'Shockwave-Flash Version 6'; $magic = '^CWS\006'; &store_cannot_do($type,$magic,$description); #### Binary (data or whatever) ###$type = "BIN"; ###$magic = '[\000-\007\016-\037\177]'; # rather crude test! ###$description = 'apparently binary'; ###&store_cannot_do($type,$magic,$description); return; } #------------------------------------------------------------------------------ sub read_magic { # Read first bytes of file to check for file type open(FILE, "< $Input") || die "Can't open file $Input\n"; read FILE,$Magic,256; close FILE; return; } #------------------------------------------------------------------------------ sub error_setup { if ($Efile) { open SAVERR, ">&STDERR"; if (open STDERR, "> $Efile") { print SAVERR " Overwriting $Efile\n" if (-s $Efile); $Redir = 1; } else { close SAVERR } } } #------------------------------------------------------------------------------ sub run { my $routine = shift; my $return; if (defined &alarm_call) { $return = alarm_call($Time, $routine); } else { eval $routine; $return = $@ if $@; } if ($return) { &quit($return) } } #------------------------------------------------------------------------------ sub try_html { my($set,$cmnd,$type); $Success = 0; foreach $type (keys %HTML_Method) { $set = $HTML_Method{$type}; if (($MIME_type =~ m/$set->{'mime'}/i) and ($Magic =~ m/$set->{'magic'}/s)) { # found the method to use $Method = $type; my $cmnd = $set->{'cmnd'}; if (! -x $cmnd) { warn "Unable to execute $cmnd for $type document\n"; return; } if (not open(CAT, "$set->{'command'} |")) { warn "$cmnd doesn't want to be opened using pipe\n"; return; } while () { # getting something, so it is working $Success = 1; if ($_ !~ m/^//g; $value =~ s/<([^>]|\n)*>//g; $tags{$name} = $value; } $squery = $tags{'search'}; # Set search query $page = $tags{'page'}; if (not($page)) { $page=1; } $squery =~ s/\+//g; $squery =~ s/\-//g; $squery =~ s/the//g; $squery =~ s/not//g; $squery =~ s/what//g; # If someone puts "and" or "or" in the query, # then it should be a boolean query if (($squery =~ " and ") || ($squery =~ " or ")) { $method = "boolean"; } # Count the number of words in the query @words = split(/ /,$squery); foreach $word (@words) { $xwd++; } # If there are quotes in the query, we have to # turn them into parantheses and make it boolean if (($squery =~ "\"")) { $oo = (index($squery,"\""))+1; $od = (index($squery,"\"",$oo))-1; $op = $od - $oo +1; $yty = substr($squery,$oo,$op); @wrds = split(/ /,$yty); foreach $wrd (@wrds) { $xww++; } if ($xww eq 2) { # Right now, can only handle 2-word phrases $oi = (index($yty," ")); if ($oi > -1) { $ytt = substr($yty,0,$oi); $john = $od - $oi +1; $yte = substr($yty,$oi+1,$john); $james = substr($squery,$od+2); $james =~ s/ and//g; $james =~ s/ / and /g; $squery = "($ytt and $yte) $james"; # We turn it into a $method = "boolean"; # boolean query } # More than 2 words in quotes (phrase), just # turn it into one big string of words and set method to "and" } else { $squery =~ s/\"//g; $squery =~ s/ and//g; $method = "and"; $yty = ""; } } # Set the environmental variables $ENV{'REQUEST_METHOD'} = 'GET'; $ENV{'QUERY_STRING'} = "config=$config&restrict=$restrict&exclude=$exclude&words=$squery&method=$method&format=$format&page=$page"; # Run htsearch system("$dir/htsearch"); 1; htdig-3.2.0b6/contrib/ewswrap/README0100644006314600127310000000023206607134173016377 0ustar angusgbhtdigewswrap.cgi = Excite for Web Servers (EWS) to htsearch wrapper htwrap.cgi = htsearch wrapper to do some basic sanity checking on the query htdig-3.2.0b6/contrib/ewswrap/htwrap.cgi0100755006314600127310000000670606606163123017523 0ustar angusgbhtdig#!/usr/bin/perl -w # htwrap.cgi # # by John Grohol (grohol@cmhc.com) # Freeware # v1.00 - 5 Oct 1998 # # Simple wrapper script for htsearch to # do some basic sanity checking on the query # and tries to re-form it into a valid htsearch query. # # This script must be called using the GET method! # #_______________________________________________________ # Set some defaults here # These can be overridden in the calling form $config = "htdig"; # htDig config file $exclude = ""; # exclude this url $restrict = ""; # restrict to this url $format = "builtin-long"; # results format $method = "and"; # default method $dir = "/usr/httpd/cgi-bin"; # Set cgi-bin dir #_______________________________________________________ # Rest of program $| = 1; # Get the form variables &ParseTags($ENV{'PATH_INFO'}); &ParseTags($ENV{'QUERY_STRING'}); $squery = $tags{'words'}; $restrict = $tags{'restrict'}; $method = $tags{'method'}; $format = $tags{'format'}; $page = $tags{'page'}; if (not($page)) { $page=1; } $squery =~ s/\+//g; $squery =~ s/\-//g; $squery =~ s/the//g; $squery =~ s/not//g; $squery =~ s/what//g; # If someone puts "and" or "or" in the query, # then it should be a boolean query if (($squery =~ " and ") || ($squery =~ " or ")) { $method = "boolean"; } # How many words are there in the query? @words = split(/ /,$squery); foreach $word (@words) { $xwd++; } # If there are quotes in the query, we have to # turn them into parantheses and make it boolean if (($squery =~ "\"")) { $oo = (index($squery,"\""))+1; $od = (index($squery,"\"",$oo))-1; $op = $od - $oo +1; $yty = substr($squery,$oo,$op); @wrds = split(/ /,$yty); foreach $wrd (@wrds) { $xww++; } if ($xww eq 2) { # Right now, can only handle 2-word phrases $oi = (index($yty," ")); if ($oi > -1) { $ytt = substr($yty,0,$oi); $john = $od - $oi +1; $yte = substr($yty,$oi+1,$john); $james = substr($squery,$od+2); $james =~ s/ and//g; $james =~ s/ / and /g; $squery = "($ytt and $yte) $james"; # We turn it into a $method = "boolean"; # boolean query } # More than 2 words in quotes (phrase), just # turn it into one big string of words and set method to "and" } else { $squery =~ s/\"//g; # Dump quotes $squery =~ s/ and//g; # Dump and's $squery =~ s/ or//g; # Dump or's $method = "and"; $yty = ""; } } # Set the environmental variables $ENV{'REQUEST_METHOD'} = 'GET'; $ENV{'QUERY_STRING'} = "config=$config&restrict=$restrict&exclude=$exclude&words=$squery&method=$method&format=$format&page=$page" ; # Run htsearch system("$dir/htsearch"); exit; sub ParseTags { local($_) = @_; local(@terms, $tag, $val); s|^/||; @terms = split('&'); foreach $term (@terms) { ($tag,$val) = split('=',$term,2); $val =~ tr/+/ /; $val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $val =~ s///g; $val =~ s/<([^>]|\n)*>//g; # may override previous value $tags{$tag} = $val; } } 1; htdig-3.2.0b6/contrib/examples/0040755006314600127310000000000010063260367015647 5ustar angusgbhtdightdig-3.2.0b6/contrib/examples/xmlsearch/0040755006314600127310000000000010063260367017635 5ustar angusgbhtdightdig-3.2.0b6/contrib/examples/badwords0100644006314600127310000000415306647256611017411 0ustar angusgbhtdiga above about according across actually adj after afterwards again against all almost alone along already also although always among amongst an and another any anyhow anyone anything anywhere are aren arent around as at be became because become becomes becoming been before beforehand begin beginning behind being below beside besides between beyond billion both but by can cant cannot caption co could couldnt did didnt do does doesnt dont down during each eg eight eighty either else elsewhere end ending enough etc even ever every everyone everything everywhere except few fifty first five for former formerly forty found four from further had has hasnt have havent he hence her here hereafter hereby herein heres hereupon hers herself hes him himself his how however hundred ie if in inc indeed instead into is isnt it its itself last later latter latterly least less let like likely ltd made make makes many may maybe me meantime meanwhile might million miss more moreover most mostly mr mrs much must my myself namely neither never nevertheless next nine ninety no nobody none nonetheless noone nor not nothing now nowhere of off often on once one only onto or others otherwise our ours ourselves out over overall own page per perhaps rather re recent recently same seem seemed seeming seems seven seventy several she shes should shouldnt since six sixty so some somehow someone something sometime sometimes somewhere still stop such taking ten than that the their them themselves then thence there thereafter thereby therefore therein thereupon these they thirty this those though thousand three through throughout thru thus tips to together too toward towards trillion twenty two under unless unlike unlikely until up update updated updates upon us used using ve very via want wanted wants was wasnt way ways we wed well were werent what whats whatever when whence whenever where whereafter whereas whereby wherein whereupon wherever wheres whether which while whither who whoever whole whom whomever whose why will with within without wont work worked works working would wouldnt yes yet you youd youll your youre yours yourself yourselves youve htdig-3.2.0b6/contrib/examples/rundig.sh0100644006314600127310000000524007426615570017502 0ustar angusgbhtdig#! /bin/sh # rundig.sh # a script to drive ht://Dig updates # Copyright (c) 1998 Colin Viebrock # Copyright (c) 1998-1999 Geoff Hutchison # Updated for ht://Dig 3.2.0b3 Feb 2001, Copyright (c) 2001 Geoff Hutchison # Distributed under the GNU GPL version 2 or later if [ "$1" = "-v" ]; then verbose="-v" fi # This is the directory where htdig lives BASEDIR=/export/htdig # This is the db dir DBDIR=$BASEDIR/db/ # This is the name of a temporary report file REPORT=/tmp/htdig.report # This is who gets the report REPORT_DEST="webmaster@yourdomain.com" export REPORT_DEST # This is the subject line of the report SUBJECT="cron: htdig report for domain" # This is the name of the conf file to use CONF=htdig.conf # This is the directory htdig will use for temporary sort files TMPDIR=$DBDIR export TMPDIR # This is the PATH used by this script. Change it if you have problems # with not finding wc or grep. PATH=/usr/local/bin:/usr/bin:/bin ##### Dig phase STARTTIME=`date` echo Start time: $STARTTIME echo rundig: Start time: $STARTTIME > $REPORT $BASEDIR/bin/htdig $verbose -s -a -c $BASEDIR/conf/$CONF >> $REPORT TIME=`date` echo Done Digging: $TIME echo rundig: Done Digging: $TIME >> $REPORT ##### Purge Phase # (clean out broken links, etc.) $BASEDIR/bin/htpurge $verbose -a -c $BASEDIR/conf/$CONF >> $REPORT TIME=`date` echo Done Purging: $TIME echo rundig: Done Purging: $TIME >> $REPORT ##### Cleanup Phase # To enable htnotify or the soundex search, uncomment the following lines # $BASEDIR/bin/htnotify $verbose >>$REPORT # $BASEDIR/bin/htfuzzy $verbose soundex # To get additional statistics, uncomment the following line # $BASEDIR/bin/htstat $verbose >>$REPORT # Move 'em into place. Since these are only used by htdig for update digs # and we always use -a, we just leave them as .work # mv $DBDIR/db.docs.index.work $DBDIR/db.docs.index # (this is just a mapping from a URL to a DocID) # We need the .work for next time as an update dig, plus the copy for searching cp $DBDIR/db.docdb.work $DBDIR/db.docdb cp $DBDIR/db.excerpts.work $DBDIR/db.excerpts cp $DBDIR/db.words.db.work $DBDIR/db.words.db test -f $DBDIR/db.words.db.work_weakcmpr && cp $DBDIR/db.words.db.work_weakcmpr $DBDIR/db.words.db_weakcmpr END=`date` echo End time: $END echo rundig: End time: $END >> $REPORT echo # Grab the important statistics from the report file # All lines begin with htdig: or htmerge: fgrep "htdig:" $REPORT echo fgrep "htmerge:" $REPORT echo fgrep "rundig:" $REPORT echo WC=`wc -l $REPORT` echo Total lines in $REPORT: $WC # Send out the report ... mail -s "$SUBJECT - $STARTTIME" $REPORT_DEST < $REPORT # ... and clean up rm $REPORT htdig-3.2.0b6/contrib/examples/updatedig0100755006314600127310000000350506650451411017542 0ustar angusgbhtdig#! /bin/sh # # updatedig # # This is a script to update the search database for ht://Dig. # Copyright (c) 1998 David Robley webmaster@www.nisu.flinders.edu.au # if [ "$1" = "-v" ]; then verbose=-v fi # -a: run using alternate work files so search can still be done during index run # -t: create an ASCII version of document database in doc_list as specified # in the config file # -s: print stats after completion /web/webdocs/htdig/bin/htdig -a -t $verbose -s /web/webdocs/htdig/bin/htmerge -a $verbose -s /web/webdocs/htdig/bin/htnotify $verbose # Because the -a switch creates alternate work files, but doesn't seem to move # them into the correct place, we will do it here. mv /web/webdocs/htdig/db/db.docdb /web/webdocs/htdig/db/db.docdb.old mv /web/webdocs/htdig/db/db.docdb.work /web/webdocs/htdig/db/db.docdb mv /web/webdocs/htdig/db/db.docs.index /web/webdocs/htdig/db/db.docs.index.old mv /web/webdocs/htdig/db/db.docs.index.work /web/webdocs/htdig/db/db.docs.index mv /web/webdocs/htdig/db/db.wordlist /web/webdocs/htdig/db/db.wordlist.old mv /web/webdocs/htdig/db/db.wordlist.work /web/webdocs/htdig/db/db.wordlist mv /web/webdocs/htdig/db/db.words.gdbm /web/webdocs/htdig/db/db.words.gdbm.old mv /web/webdocs/htdig/db/db.words.gdbm.work /web/webdocs/htdig/db/db.words.gdbm # # Only create the endings database if it doesn't already exist. # This database is static, so even if pages change, this database will not # need to be rebuilt. # if [ ! -f /web/webdocs/htdig/common/word2root.gdbm ] then /web/webdocs/htdig/bin/htfuzzy $verbose endings fi # This next needs to be run if synonyms are added/modified/removed # Guess the best way would be to delete synonyms.gdbm before # running this script?? if [ ! -f /web/webdocs/htdig/common/synonyms.gdbm ] then /web/webdocs/htdig/bin/htfuzzy $verbose synonyms fi # end updatedig htdig-3.2.0b6/contrib/htparsedoc/0040755006314600127310000000000010063260367016165 5ustar angusgbhtdightdig-3.2.0b6/contrib/htparsedoc/catdoc.c0100644006314600127310000001752006575122205017571 0ustar angusgbhtdig From VDiGiampietro@sansalvo.marelli.it Fri Jul 3 09:52:34 1998 Date: Fri, 3 Jul 1998 17:20:50 +0200 (MET DST) From: Valerio Di Giampietro To: htdig@sdsu.edu Subject: htdig: Searching Word files /* catdoc.c version 0.3 */ #include #include #include #define TEXT_WIDTH 72 /* #define LATIN1 */ /* enable this define, if you don't want cyrillic code page translations */ unsigned char specs[]={7, /* tab columns separator - handled specially*/ '\n',/* hook to handle end of line in tables */ 0x1E,/* unbreakable defis */ 0x1F,/* soft hyphen */ 0x85,/* dots */ 0x91,/* opening single quote */ 0x92,/* closing single quote */ 0x93,/* opening double quote */ 0x94,/* closing double quote */ 0x96,/* em-dash (or em-space)*/ 0x97,/* en-dash */ 0x99,/* Trade Mark sign */ 0xA0,/* unbreakable space */ 0xA9,/* Copyright sign */ 0xAE,/* Reserved sign */ 0xAB,/* opening << quote*/ 0xBB,/* closing >> quote*/ /* The rest is translated into itself unless TeX mode is selected */ '%','$','_','{','}','\\', }; char *ascii_specs[]={"\t","\n","-","","...","`","'","``","''","-","-","tm", " ","(c)","(R)","\"","\"","%","$","_","{","}","\\"}; char *TeX_specs[]={"\t&","\\\\\n","-","\\-","\\dots{}","`","'","``","''","---","--", "${}^{\\scriptscriptstyle\\mathrm{TM}}$",/* this is my idea about tm sign*/ "~", "{\\copyright}", "(R)",/* to be replaced with correct command */ "<",">","\\%","\\$","$\\{$","$\\}$","$\\backslash$",}; #ifndef LATIN1 #ifdef unix unsigned char table[256]={ /* Windows cyrillic code page to KOI-8 */ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0D,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x2D,0x20, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F, 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F, 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F, 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F, 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F, 0x80,0x81,0x82,0xAA,0x8F,0x90,0xA9,0x93,0x84,0x92,0x91,0x94,0x83,0x95,0x99,0x8B, 0x98,0x60,0x27,0x22,0x22,0x9A,0x2D,0x2D,0x9E,0xA6,0x87,0xB0,0x8D,0x97,0x86,0xA2, 0x20,0xA7,0xA5,0x88,0xA4,0x8E,0x96,0x85,0xB3,0xA1,0x9F,0x22,0xAB,0xAC,0xAD,0xAE, 0xAF,0xB2,0xB1,'i',0xB5,0xB6,0xB7,0xB8,0xA3,0xB9,0xBA,0x22,0xBC,0xBD,0xBE,0x9B, 0xE1,0xE2,0xF7,0xE7,0xE4,0xE5,0xF6,0xFA,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0, 0xF2,0xF3,0xF4,0xF5,0xE6,0xE8,0xE3,0xFE,0xFB,0xFD,0xFF,0xF9,0xF8,0xFC,0xE0,0xF1, 0xC1,0xC2,0xD7,0xC7,0xC4,0xC5,0xD6,0xDA,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0, 0xD2,0xD3,0xD4,0xD5,0xC6,0xC8,0xC3,0xDE,0xDB,0xDD,0xDF,0xD9,0xD8,0xDC,0xC0,0xD1}; #else unsigned char table[256]={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0D,0x0c,0x0d,0x0e,0x0f, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x2D,0x20, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, 0x90,0x60,0x27,0x22,0x22,0x95,0x2D,0x2D,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, 0x20,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0x22,0xac,0xad,0xae,0xaf, 0xb0,0xb1,0xb2,0xb3,'i',0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0x22,0xbc,0xbd,0xbe,0xbf, 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, 0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xeb,0xec,0xed,0xee,0xef}; #endif #define recode_char(x) table[x] #else #define recode_char(x) x #endif char *map_char(char **map,int c) {unsigned char *ptr; static char buffer[2]="a"; if ((ptr=strchr(specs,c))) return map[ptr-specs]; else { buffer[0]=recode_char(c); return buffer; } } void format(char *buf,char **map) { unsigned char outstring[128]=""; unsigned char *sp=buf,*dp;int table=0; while (*sp) { if (*sp==7&&table) { printf("%s%s",outstring,map_char(map,'\n')); outstring[0]=0; table=0;sp++; } else { if (strlen(strcat(outstring,map_char(map,*sp)))>TEXT_WIDTH) { dp=strrchr(outstring,' '); if (dp) { *(dp++)=0; printf("%s\n",outstring); strcpy(outstring,dp); } else { int i; for(i=0;i<72;i++) putc(outstring[i],stdout); putc('\n',stdout); strcpy(outstring,outstring+72); } } table=*(sp++)==7; } } if (outstring[0]==0) putc('\n',stdout); else printf("%s\n\n",outstring); } void help(void) { printf("catdoc - exctract text from MS-Word files and catenate it to stdout\n" "Copyright (c) by Victor B. Wagner, 1996\n" "Usage catdoc [-ast] files ...\n" "\t-a - converts non-standard printable chars into readable form (default)\n" "\t-t - converts them into TeX control sequences\n" "\t-s - exits with code 1 if MSWordDoc signature not found before\n" "\t\tfirst printable paragraph\n\n" "All options affects only files, specified AFTER them\n"); exit(2); } char buf[8192]; void do_file(FILE *f,char **map,int search_sign) { int ok=!search_sign; int bufptr,c; while(!feof(f)) {bufptr=-1; do { c=getc(f); /* Special printable symbols 7- table separator \r - paragraph end 0x1E - short defis */ if ((c<=255&&c>=32)||c==7||c=='\t'||c=='\r'||c==0x1E) buf[++bufptr]=c; else if (c==0x0b) buf[++bufptr]='\r'; else { if (!c) {buf[++bufptr]=0; if(!strcmp(buf,"MSWordDoc")) { ok=1; } } if (c!=2) bufptr=-1;/* \002 is Word's footnote mark */ } } while (c!='\r'&&c!=EOF); if (bufptr>0&&buf[bufptr]=='\r') { if (!ok) exit( 1); buf[bufptr]=0; format(buf,map); } } } int main(int argc,char **argv) { int search_sign =0; /* Must program exit with exit code 1 if MSWordDoc signature is not found? */ char **sequences=ascii_specs;/* pointer to array of character sequences to represent special characters of Word */ int i=1,stdin_processed=0; if (argc<2) help(); for(;i Subject: htdig: HTDIG: Searching Word files > To: htdig@sdsu.edu > From: Richard Jones > Date: Tue, 15 Jul 1997 12:44:03 +0100 > > I'm currently trying to hack together a script to search > Word files. I have a little program called `catdoc' (attached) > which takes Word files and turns them into passable text files. > What I did was write a shell script around this called > `htparsedoc' (also attached) and add it as an external > parser: > > --- /usr/local/lib/htdig/conf/htdig.conf --- > > # External parser for Word documents. > external_parsers: "applications/msword" > "/usr/local/lib/htdig/bin/htparsedoc" > > This script produces output like this: > > t Word document http://annexia.imcl.com/test/comm.doc > w INmEDIA 1 - > w Investment 2 - > w Ltd 3 - > w Applications 4 - > w Subproject 5 - > w Terms 6 - > w of 7 - > [...] > w Needed 994 - > w Tbd 995 - > w Resources 996 - > w Needed 997 - > w Tbd 998 - > w i 1000 - > htdig-3.2.0b6/contrib/htparsedoc/htparsedoc0100755006314600127310000000400106752175064020250 0ustar angusgbhtdig#!/bin/sh - #-- # External parser for HTDIG that parses Word files so they can # be indexed. #-- # Written by Richard W.M. Jones . Distributed freely # under the terms of the GNU General Public License (GPL). # Modified by Andrew M. Bishop #-- #---------------------------------------------------------------------- # Configurable stuff here: # The program that converts Word files into text. I use ``catdoc'' # by Victor Wagner . You may wish to just use # ``strings''. CATDOC=/usr/local/bin/catdoc #CATDOC=strings # End of configurable stuff. #---------------------------------------------------------------------- # Arguments are: # $1 = input file # $2 = content type (ignored) # $3 = base URL # $4 = HTDIG config file (ignored) # HTDIG expects us to print out: # w WORD LOCATION HEADING Word at location 0-1000 under heading # u URL DESCRIPTION URL with description # t TITLE Title of document # h HEAD Heading # a ANCHOR Anchor (ie. like ) # i IMAGE_URL Image pointer #---------------------------------------------------------------------- # Format input to word per line. wordPerLine () { tr '[ \010]' '\012' | awk 'NF==1 {print;}' } # Change non-alphabetical/numeric characters in space. removeNonAlNum () { tr -c '[a-zA-Z0-9\015]' ' ' } #---------------------------------------------------------------------- # Parse input file to linear list of words. $CATDOC $1 | removeNonAlNum | wordPerLine > /tmp/htparsedoc.$$ # Compute length of list. filelen=`wc -l < /tmp/htparsedoc.$$` # We can't find the title from the document, so make one up. echo "t Binary Document $3" # We can't make an excerpt so we make one up. echo "h No excerpt available" # Pass words to htdig. if [ $filelen -gt 0 ]; then awk "{printf (\"w\t%s\t%d\t-\t\n\", \$1, 1000*NR/$filelen);}" \ < /tmp/htparsedoc.$$ fi # Remove temporary file. rm /tmp/htparsedoc.$$ htdig-3.2.0b6/contrib/htwrapper/0040755006314600127310000000000010063260367016045 5ustar angusgbhtdightdig-3.2.0b6/contrib/htwrapper/.sniffdir/0040755006314600127310000000000010063260367017727 5ustar angusgbhtdightdig-3.2.0b6/contrib/multidig/0040755006314600127310000000000010063260367015647 5ustar angusgbhtdightdig-3.2.0b6/contrib/multidig/Makefile0100644006314600127310000000311107426615570017311 0ustar angusgbhtdig# # Makefile for the multidig system # # Copyright (c) 1998-2000 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # # You probably want to change some or all of these. # BASH = location of bash or other Bourne-like shell with 'source' builtin # BASEDIR = directory of ht://Dig installation # These should probably be OK. # BINDIR = directory of ht://Dig binaries. Also destination for these scripts. # CONFIG_DIR = directory of ht://Dig config files. # DB_BASE = base directory for ht://Dig / multidig databases BASH= /bin/bash BASEDIR= /opt/htdig BINDIR= $(BASEDIR)/bin CONFIG_DIR= $(BASEDIR)/conf DB_BASE= $(BASEDIR)/db # # You shouldn't need to change any of this... # SCRIPTS= add-collect add-urls multidig \ new-collect new-db gen-collect CONF= db.conf multidig.conf all: clean: rm -f *~ install: @echo "Installing scripts..." @for i in $(SCRIPTS); do \ sed -e s%@BASH@%$(BASH)% \ -e s%@CONFIG_DIR@%$(CONFIG_DIR)% $$i >$(BINDIR)/$$i; \ chmod a+x $(BINDIR)/$$i; \ echo $(BINDIR)/$$i; \ done && test -z "$$fail" @echo @echo "Installing config files..." @echo @for i in $(CONF); do \ sed -e s%@BASH@%$(BASH)% -e s%@BASEDIR@%$(BASEDIR)% \ -e s%@BINDIR@%$(BINDIR)% -e s%@CONFIG_DIR@%$(CONFIG_DIR)% \ -e s%@DB_BASE@%$(DB_BASE)% $$i >$(CONFIG_DIR)/$$i; \ echo $(CONFIG_DIR)/$$i; \ done && test -z "$$fail" @echo @echo "Done with installation." @echo htdig-3.2.0b6/contrib/multidig/README0100644006314600127310000001170306711215600016521 0ustar angusgbhtdigREADME for multidig 1.1 by Geoff Hutchison Copyright (c) 1998-1999 The ht://Dig Group Distributed under the terms of the GNU General Public License (GPL) version 2 or later. -------------------------------- This document is part of the "multidig script system" a system of shell scripts and some modified conf files that makes dealing with multiple databases easier for ht://Dig. It assumes that you know what ht://Dig is. If you don't know, see the website at This README is a bit rough around the edges. I don't know what people really want or need to know about the scripts. I expect a lot of questions. Hey, maybe I'm wrong. I'm always open to suggestions, criticisms, corrections, etc. E-mail me at -------------------------------- INTRODUCTION: * Why write multidig? There are many reasons I started the multidig system. The biggest were the complaints that ht://Dig didn't have much of an administration interface. If you're looking for one, multidig isn't it. Yet. The next biggest is that people wanted me to make dealing with multiple databases easier. If you're looking for this, you're in the right place. * Why should I bother with multidig? If you already have a multiple-database setup and it's working smoothly, you probably don't want to bother. It was written the way *I* would organize a multiple-database setup. Not suprisingly, it might be more pain to convert to multidig than it's worth. If you're planning a multiple-database setup or you have one and it's not working well, this will help. It hides most of the pain and suffering behind some shell scripts and generally automates life. :-) -------------------------------- SETTING UP: * How do I install it? It's pretty easy to install. It requires bash, or at least a Bourne-shell that supports the "source" builtin. Obviously, it also requires ht://Dig. :-) Change any paths in the Makefile. D a "make install" to install the scripts in the right place and the config files in the right place. The Makefile edits the scripts for you so the paths are consistent. * Now that it's in, how does it work? The multidig script will replace the rundig script that comes with ht://Dig. Use it through a cron job or some other means of automating updates. It will run through all the db that multidig knows about, run htdig, htmerge, move the databases around, etc. As written it tries to index with the least disk space in the least time. Thus it keeps only the minimum files and does "update" digs. After indexing all the db, it merges all the collections, trying to do the same thing, fastest speed, smallest disk and RAM requirements. It spits out a short status to STDOUT and a more complete report to the file referened with the $REPORT option in multidig.conf. Adding a "-v" to the command-line makes everything more verbose. * Can I convert my previous multiple-db setup? Yes. I'm assuming you have a config file for each database you've set up. In that case, put the databases into a directory with the same name as the .conf file and tack the name onto the db.list file in your config directory. This is multidig's list of all databases, so adding a line here will ensure it's indexed using multidig. * How do I add new URLs to databases or add new databases? 1) New URLs: Run 'add-urls ' and either paste in URLs or redirect a file or program. 2) New DB: Run 'new-db ' to set up everything for that database. -------------------------------- COLLECTIONS: * What's a collection? Version 3.1.0 of ht://Dig added support for merging multiple databases together. Technically, you merge one database into another. Multidig makes this a bit easier. You set up a "collection" of other databases and the multidig script will merge them all together. * Fantastic! How do I define a collection? ./new-collect ./add-collect The add-collect script will go through the list of dbs and make sure the multidig system actually knows about them. If not, it complains. * Can I just generate the collections from my databases? Yup, run gen-collect. This is what the main multidig script runs. -------------------------------- DIRECTORY LAYOUT: Here are the locations of files used by multidig: $BASEDIR/bin add-collect script for adding db to a collection add-urls script for adding URLs to a db gen-collect script for generating all collections from their db (called by multidig) multidig script for generating all db and collections new-collect script for making a new collection new-db script for making a new db $BASEDIR/conf db.conf template database config used by new-collect and new-db foo.conf database config for db foo multidig.conf config for multidig paths and options db.list list of all db, one per line collect.list list of all collections, one per line $BASEDIR/db foo/foo.urls URLs used by foo db foo/db.* actual foo databases htdig-3.2.0b6/contrib/multidig/add-collect0100644006314600127310000000250406711135132017737 0ustar angusgbhtdig#!@BASH@ # # add-collect 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # syntax: # add-collect # # Reads new DB in from the standard input (either redirect or paste) # Ensures the DB actually exist before adding them to the collection # # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # Catch people who don't supply an argument if [ "$1" = "" ]; then echo Syntax: add-colect \ exit fi # Do we actually have a collection named as specified? TEST=`grep $1 $COLLECT_LIST` if [ "$TEST" = "" ]; then # This may become annoying. If so, comment it out! echo The collection $1 does not exist. Sorry. echo The existing collections are: cat $COLLECT_LIST else # OK, now we have to make sure these are legal db for db in `cat /dev/stdin`; do DBTEST=`grep $db $DB_LIST` if [ "$DBTEST" != "" ]; then echo $db >>$DB_BASE/$1/$1.collect else # This may become annoying. If so, comment it out! echo The database $db does not exist. Sorry. echo The existing databases are: cat $DB_LIST fi done fi htdig-3.2.0b6/contrib/multidig/add-urls0100644006314600127310000000161206711135132017276 0ustar angusgbhtdig#!@BASH@ # # add-urls 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # syntax: # add-urls # # Reads new URLs in from the standard input (either redirect or paste) # # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # Catch people who don't supply an argument if [ "$1" = "" ]; then echo Syntax: add-urls \ exit fi # Do we actually have a database named as specified? TEST=`grep $1 $DB_LIST` if [ "$TEST" = "" ]; then # This may become annoying. If so, comment it out! echo The database $1 does not exist. Sorry. echo The existing databases are: cat $DB_LIST else cat /dev/stdin >>$DB_BASE/$1/$1.urls fi htdig-3.2.0b6/contrib/multidig/db.conf0100644006314600127310000000166507426615570017121 0ustar angusgbhtdig# # db.conf file for the multidig system # (copied for each database used) # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # Change this if you use a different global config file # Put most of your configuration options in this file # the db.conf files only define the URL list used and the directory for # storing the databases include: ${config_dir}/htdig.conf # Changed for each database. Places the databases in separate directories # for convenience and organization database_dir: @DB_BASE@/@DATABASE@ # Each database has a separate list of starting URLs # This makes it easier to index a variety of categories start_url: `${database_dir}/@DATABASE@.urls` # Any database-specific config options should go here... htdig-3.2.0b6/contrib/multidig/gen-collect0100644006314600127310000000734507426615570020005 0ustar angusgbhtdig#!@BASH@ # # gen-collect 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # Part of the "multidig script system" # a system of shell scripts and some modified conf files # that makes dealing with multiple databases easier for ht://Dig # # Syntax: # gen-collect [-v] # # Merges multiple databases into ``collected'' db # (This is done by multidig too, but this script lets you *just* # generate the collections.) # # This is useful for debugging info if [ "$1" = "-v" ]; then verbose=-v fi # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # We may be called inside multidig, so we don't want to mess with the report. for collect in `cat $COLLECT_LIST`; do # What's the conf file for this database? CONF=$CONFIG_DIR/$collect.conf echo Generating $collect at: `date` # We want to replace the old .work files with the first database # This ensures that we *only* get documents from the merged db # and not old ones left around in our previous collected db firstdb=`head -n 1 $DB_BASE/$collect/$collect.collect` cp $DB_BASE/$firstdb/db.docdb $DB_BASE/$collect/db.docdb.work cp $DB_BASE/$firstdb/db.docs.index $DB_BASE/$collect/db.docs.index.work cp $DB_BASE/$firstdb/db.wordlist.work $DB_BASE/$collect/db.wordlist.work cp $DB_BASE/$firstdb/db.words.db $DB_BASE/$collect/db.words.db.work # Now we need to work out the number of remaining db in the collection LENGTH=`wc -l $DB_BASE/$collect/$collect.collect | awk '{print $1;}'` let NUM=LENGTH-1 for db in `tail -n $NUM $DB_BASE/$collect/$collect.collect`; do if [ "$1" = "-v" ]; then echo Merging db $db of collect $collect fi MERGE_CONF=$CONFIG_DIR/$db.conf # There's a slight bug in the merge function. # It's looking for db.wordlist, not .work. So lets copy it temporarily cp $DB_BASE/$db/db.wordlist.work $DB_BASE/$db/db.wordlist # Do the merging, using -d and -w to prevent normal merging # (it would be a waste of time, we'd repeat it multiple times) $BINDIR/htmerge $verbose -s -d -w -m $MERGE_CONF -a -c $CONF >>$REPORT # And now remove the copy rm $DB_BASE/$db/db.wordlist done # Now after merging in all of those databases # we need to do the usual htmerge run $BINDIR/htmerge -a $verbose -s -c $CONF >>$REPORT if [ "$1" = "-v" ]; then echo Moving files $collect at: `date` fi # If you don't have the space for backups, this step can be omitted if [ $BACKUPS = "true" ]; then cp $DB_BASE/$collect/db.docdb $DB_BASE/$collect/db.docdb.bak cp $DB_BASE/$collect/db.docs.index $DB_BASE/$collect/db.docs.index.bak # cp $DB_BASE/$collect/db.wordlist $DB_BASE/$collect/db.wordlist.bak cp $DB_BASE/$collect/db.words.db $DB_BASE/$collect/db.words.db.bak fi # Move them because we don't want .work files around # (Remember, we're generating using merging, # so we want to make sure we don't have old stuff to gum up the works... mv $DB_BASE/$collect/db.docdb.work $DB_BASE/$collect/db.docdb mv $DB_BASE/$collect/db.docs.index.work $DB_BASE/$collect/db.docs.index # mv $DB_BASE/$collect/db.wordlist.work $DB_BASE/$collect/db.wordlist mv $DB_BASE/$collect/db.words.db.work $DB_BASE/$collect/db.words.db # Make them world readable! chmod 644 $DB_BASE/$collect/db.docdb chmod 644 $DB_BASE/$collect/db.docs.index # chmod 644 $DB_BASE/$collect/db.wordlist chmod 644 $DB_BASE/$collect/db.words.db if [ "$1" = "-v" ]; then echo Done with $collect at: `date` fi done # That's it! htdig-3.2.0b6/contrib/multidig/multidig0100644006314600127310000000561206711135132017405 0ustar angusgbhtdig#!@BASH@ # # multidig 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # Part of the "multidig script system" # a system of shell scripts and some modified conf files # that makes dealing with multiple databases easier for ht://Dig # # Syntax: # multidig [-v] # # Performs all the digging, merging and so on needed # for indexing and updating multiple db # Merges multiple databases into ``collected'' db # # This is useful for debugging info if [ "$1" = "-v" ]; then verbose=-v fi # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # Start indexing. rm $REPORT for db in `cat $DB_LIST`; do echo Digging $db at: `date` # What's the conf file for this database? CONF=$CONFIG_DIR/$db.conf if [ "$1" = "-v" ]; then echo " Indexing $db at: `date`" fi $BINDIR/htdig -a $verbose -s -c $CONF >>$REPORT if [ "$1" = "-v" ]; then echo " Merging $db at: `date`" fi $BINDIR/htmerge -a $verbose -s -c $CONF >>$REPORT if [ "$1" = "-v" ]; then echo " Moving files $db at: `date`" fi # If you don't have the space for backups, this step can be omitted if [ $BACKUPS = "true" ]; then cp $DB_BASE/$db/db.docdb $DB_BASE/$db/db.docdb.bak cp $DB_BASE/$db/db.docs.index $DB_BASE/$db/db.docs.index.bak # cp $DB_BASE/$db/db.wordlist $DB_BASE/$db/db.wordlist.bak cp $DB_BASE/$db/db.words.db $DB_BASE/$db/db.words.db.bak fi # Copy the db.docdb file, the .work file is needed for update digs cp $DB_BASE/$db/db.docdb.work $DB_BASE/$db/db.docdb # We don't do anything with the db.wordlist file because the # .work file is needed for update digs and the non-work file isn't needed # cp $DB_BASE/$db/db.wordlist.work $DB_BASE/$db/db.wordlist # These .work files are never used, so let's just keep the active copy mv $DB_BASE/$db/db.docs.index.work $DB_BASE/$db/db.docs.index mv $DB_BASE/$db/db.words.db.work $DB_BASE/$db/db.words.db # Make them world readable! chmod 644 $DB_BASE/$db/db.docdb chmod 644 $DB_BASE/$db/db.docdb.work chmod 644 $DB_BASE/$db/db.docs.index # chmod 644 $DB_BASE/$db/db.wordlist chmod 644 $DB_BASE/$db/db.words.db if [ "$1" = "-v" ]; then echo " Done with $db at: `date`" fi done # Now generate the collections by merging their component databases # We do this in our gen-collect script, so we won't do that here. $BINDIR/gen-collect $1 if [ "$1" = "-v" ]; then echo fgrep "htdig:" $REPORT echo fgrep "htmerge:" $REPORT echo echo Total lines in $REPORT: `wc -l $REPORT` fi # You probably don't need to do this since the script will remove it next # time it's run. But you can do it anyway # rm $REPORT htdig-3.2.0b6/contrib/multidig/multidig.conf0100644006314600127310000000230707426615570020344 0ustar angusgbhtdig#!@BASH@ # # multidig config 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # You may wish to set some of these: # BASEDIR = base directory for ht://Dig installation # BINDIR = directory with ht://Dig binaries (i.e. htdig, htmerge) # DB_BASE = base directory for ht://Dig DB # (i.e. each DB gets its own directory off of this) # CONFIG_DIR = directory with ht://Dig config files # DB_LIST = file with list of databases # COLLECT_LIST = file with list of "collections" databases merged from others # DB_CONF = file copied by new-db and new-collect for .conf files # REPORT = temporary file used to generate a report for the dig # TMPDIR = a directory with lots of temporary space for the merging export BASEDIR=@BASEDIR@ export BINDIR=@BINDIR@ export DB_BASE=@DB_BASE@ export CONFIG_DIR=@CONFIG_DIR@ export DB_LIST=$CONFIG_DIR/db.list export COLLECT_LIST=$CONFIG_DIR/collect.list export DB_CONF=$CONFIG_DIR/db.conf export REPORT=$BASEDIR/multidig.report export TMPDIR=$DB_BASE export BACKUPS=true htdig-3.2.0b6/contrib/multidig/new-collect0100644006314600127310000000213007426615570020010 0ustar angusgbhtdig#!@BASH@ # # new-collect 1.1 # # Copyright (c) 1998-2000 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # syntax: # new-collect # # Creates a new database directory and conf file with given name # Updates the global collect.list file # # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # Catch people who don't supply an argument if [ "$1" = "" ]; then echo Syntax: new-collect \ exit fi # Add the new collection to the collect.list file echo ${1:?You need to specify a collection} >>$COLLECT_LIST # Now make the appropriate database directory mkdir $DB_BASE/$1 # And make a copy of the default (db.conf) conf file for the DB # Use sed to replace @DATABASE@ with the name of the database sed -e s%@DATABASE@%$1% $DB_CONF >$CONFIG_DIR/$1.conf # And make a blank file for the ${start_urls} directive touch $DB_BASE/$1/$1.collect htdig-3.2.0b6/contrib/multidig/new-db0100644006314600127310000000204306711135132016736 0ustar angusgbhtdig#!@BASH@ # # new-db 1.1 # # Copyright (c) 1998-1999 The ht://Dig Group # Distributed under the terms of the GNU General Public License (GPL) # version 2 or later. # for the ht://Dig search system http://www.htdig.org/ # and the multidig script system http://www.htdig.org/contrib/scripts/ # # syntax: # new-db # # Creates a new database directory and conf file with given name # Updates the global db.list file # # You may need to set the following: MULTIDIG_CONF=@CONFIG_DIR@/multidig.conf source $MULTIDIG_CONF # Catch people who don't supply an argument if [ "$1" = "" ]; then echo Syntax: new-db \ exit fi # Add the new database to the db.list file echo ${1:?You need to specify a database} >>$DB_LIST # Now make the appropriate database directory mkdir $DB_BASE/$1 # And make a copy of the default (db.conf) conf file for the DB # Use sed to replace @DATABASE@ with the name of the database sed -e s%@DATABASE@%$1% $DB_CONF >$CONFIG_DIR/$1.conf # And make a blank file for the ${start_urls} directive touch $DB_BASE/$1/$1.urls htdig-3.2.0b6/contrib/php-wrapper/0040755006314600127310000000000010063260367016276 5ustar angusgbhtdightdig-3.2.0b6/contrib/php-wrapper/conf/0040755006314600127310000000000010063260367017223 5ustar angusgbhtdightdig-3.2.0b6/contrib/rtf2html/0040755006314600127310000000000010063260367015573 5ustar angusgbhtdightdig-3.2.0b6/contrib/rtf2html/Makefile0100644006314600127310000000024010057404360017220 0ustar angusgbhtdigCC= gcc CFLAGS= -O2 -Wall rtf2html: rtf2html.c $(CC) $(CFLAGS) -o rtf2html rtf2html.c install: rtf2html cp rtf2html /usr/local/bin clean: rm -f rtf2html htdig-3.2.0b6/contrib/rtf2html/COPYING0100644006314600127310000004311010057404360016616 0ustar angusgbhtdig 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. htdig-3.2.0b6/contrib/rtf2html/charsetmac.h0100644006314600127310000001362610057404360020057 0ustar angusgbhtdigunsigned char* mac[256] = { "", /* 1 - 1 */ "", /* 2 - 2 */ "", /* 3 - 3 */ "", /* 4 - 4 */ "", /* 5 - 5 */ "", /* 6 - 6 */ "", /* 7 - 7 */ "", /* 8 - 8 */ "\t", /* 9 - 9 */ "\n", /* 10 - a */ " ", /* 11 - b */ " ", /* 12 - c */ "\r", /* 13 - d */ "", /* 14 - e */ "", /* 15 - f */ "", /* 16 - 10 */ "", /* 17 - 11 */ "", /* 18 - 12 */ "", /* 19 - 13 */ "", /* 20 - 14 */ "", /* 21 - 15 */ "", /* 22 - 16 */ "", /* 23 - 17 */ "", /* 24 - 18 */ "", /* 25 - 19 */ "", /* 26 - 1a */ "", /* 27 - 1b */ "", /* 28 - 1c */ "", /* 29 - 1d */ "", /* 30 - 1e */ "", /* 31 - 1f */ " ", /* 32 - 20 */ "!", /* 33 - 21 */ "\"", /* 34 - 22 */ "#", /* 35 - 23 */ "$", /* 36 - 24 */ "%", /* 37 - 25 */ "&", /* 38 - 26 */ "'", /* 39 - 27 */ "(", /* 40 - 28 */ ")", /* 41 - 29 */ "*", /* 42 - 2a */ "+", /* 43 - 2b */ ",", /* 44 - 2c */ "-", /* 45 - 2d */ ".", /* 46 - 2e */ "/", /* 47 - 2f */ "0", /* 48 - 30 */ "1", /* 49 - 31 */ "2", /* 50 - 32 */ "3", /* 51 - 33 */ "4", /* 52 - 34 */ "5", /* 53 - 35 */ "6", /* 54 - 36 */ "7", /* 55 - 37 */ "8", /* 56 - 38 */ "9", /* 57 - 39 */ ":", /* 58 - 3a */ ";", /* 59 - 3b */ "<", /* 60 - 3c */ "=", /* 61 - 3d */ ">", /* 62 - 3e */ "?", /* 63 - 3f */ "@", /* 64 - 40 */ "A", /* 65 - 41 */ "B", /* 66 - 42 */ "C", /* 67 - 43 */ "D", /* 68 - 44 */ "E", /* 69 - 45 */ "F", /* 70 - 46 */ "G", /* 71 - 47 */ "H", /* 72 - 48 */ "I", /* 73 - 49 */ "J", /* 74 - 4a */ "K", /* 75 - 4b */ "L", /* 76 - 4c */ "M", /* 77 - 4d */ "N", /* 78 - 4e */ "O", /* 79 - 4f */ "P", /* 80 - 50 */ "Q", /* 81 - 51 */ "R", /* 82 - 52 */ "S", /* 83 - 53 */ "T", /* 84 - 54 */ "U", /* 85 - 55 */ "V", /* 86 - 56 */ "W", /* 87 - 57 */ "X", /* 88 - 58 */ "Y", /* 89 - 59 */ "Z", /* 90 - 5a */ "[", /* 91 - 5b */ "\\", /* 92 - 5c */ "]", /* 93 - 5d */ "^", /* 94 - 5e */ "_", /* 95 - 5f */ "`", /* 96 - 60 */ "a", /* 97 - 61 */ "b", /* 98 - 62 */ "c", /* 99 - 63 */ "d", /* 100 - 64 */ "e", /* 101 - 65 */ "f", /* 102 - 66 */ "g", /* 103 - 67 */ "h", /* 104 - 68 */ "i", /* 105 - 69 */ "j", /* 106 - 6a */ "k", /* 107 - 6b */ "l", /* 108 - 6c */ "m", /* 109 - 6d */ "n", /* 110 - 6e */ "o", /* 111 - 6f */ "p", /* 112 - 70 */ "q", /* 113 - 71 */ "r", /* 114 - 72 */ "s", /* 115 - 73 */ "t", /* 116 - 74 */ "u", /* 117 - 75 */ "v", /* 118 - 76 */ "w", /* 119 - 77 */ "x", /* 120 - 78 */ "y", /* 121 - 79 */ "z", /* 122 - 7a */ "{", /* 123 - 7b */ "¦", /* 124 - 7c */ "}", /* 125 - 7d */ "~", /* 126 - 7e */ " ", /* 127 - 7f */ "€", /* 128 - 80 */ "Å", /* 129 - 81 */ "‚", /* 130 - 82 */ "ƒ", /* 131 - 83 */ "„", /* 132 - 84 */ "…", /* 133 - 85 */ "†", /* 134 - 86 */ "‡", /* 135 - 87 */ "á", /* 136 - 88 */ "‰", /* 137 - 89 */ "Š", /* 138 - 8a */ "‹", /* 139 - 8b */ "Œ", /* 140 - 8c */ "ç", /* 141 - 8d */ "é", /* 142 - 8e */ "è ", /* 143 - 8f */ "ê", /* 144 - 90 */ "‘", /* 145 - 91 */ "’", /* 146 - 92 */ "ì", /* 147 - 93 */ "\"", /* 148 - 94 */ "•", /* 149 - 95 */ " ", /* 150 - 96 */ " ", /* 151 - 97 */ "˜", /* 152 - 98 */ "™", /* 153 - 99 */ "š", /* 154 - 9a */ "›", /* 155 - 9b */ "œ", /* 156 - 9c */ "ù", /* 157 - 9d */ "ž", /* 158 - 9e */ "Ÿ", /* 159 - 9f */ " ", /* 160 - a0 */ "º", /* 161 - a1 */ "¢", /* 162 - a2 */ "£", /* 163 - a3 */ "§", /* 164 - a4 */ "¥", /* 165 - a5 */ "¦", /* 166 - a6 */ "§", /* 167 - a7 */ "¨", /* 168 - a8 */ "©", /* 169 - a9 */ "ª", /* 170 - aa */ "«", /* 171 - ab */ "¬", /* 172 - ac */ "­", /* 173 - ad */ "®", /* 174 - ae */ "¯", /* 175 - af */ "°", /* 176 - b0 */ "±", /* 177 - b1 */ "²", /* 178 - b2 */ "³", /* 179 - b3 */ "´", /* 180 - b4 */ "µ", /* 181 - b5 */ "¶", /* 182 - b6 */ "·", /* 183 - b7 */ "ç", /* 184 - b8 */ "¹", /* 185 - b9 */ "º", /* 186 - ba */ "»", /* 187 - bb */ "¼", /* 188 - bc */ "½", /* 189 - bd */ "¾", /* 190 - be */ "¿", /* 191 - bf */ "À", /* 192 - c0 */ "Á", /* 193 - c1 */ "Â", /* 194 - c2 */ "Ã", /* 195 - c3 */ "Ä", /* 196 - c4 */ "Å", /* 197 - c5 */ "Æ", /* 198 - c6 */ "Ç", /* 199 - c7 */ "È", /* 200 - c8 */ "É", /* 201 - c9 */ "Ê", /* 202 - ca */ "À", /* 203 - cb */ "Ì", /* 204 - cc */ "Í", /* 205 - cd */ "Î", /* 206 - ce */ "Ï", /* 207 - cf */ "Ð", /* 208 - d0 */ "Ñ", /* 209 - d1 */ "\"", /* 210 - d2 */ "\"", /* 211 - d3 */ "&Oring;", /* 212 - d4 */ "Õ", /* 213 - d5 */ "Ö", /* 214 - d6 */ "×", /* 215 - d7 */ "Ø", /* 216 - d8 */ "Ù", /* 217 - d9 */ "Ú", /* 218 - da */ "Û", /* 219 - db */ "Ü", /* 220 - dc */ "Ý", /* 221 - dd */ "Þ", /* 222 - de */ "ß", /* 223 - df */ "à", /* 224 - e0 */ "á", /* 225 - e1 */ "â", /* 226 - e2 */ "ã", /* 227 - e3 */ "ä", /* 228 - e4 */ "å", /* 229 - e5 */ "æ", /* 230 - e6 */ "ç", /* 231 - e7 */ "è", /* 232 - e8 */ "é", /* 233 - e9 */ "ê", /* 234 - ea */ "ë", /* 235 - eb */ "ì", /* 236 - ec */ "í", /* 237 - ed */ "î", /* 238 - ee */ "ï", /* 239 - ef */ "ð", /* 240 - f0 */ "ñ", /* 241 - f1 */ "ò", /* 242 - f2 */ "ó", /* 243 - f3 */ "ô", /* 244 - f4 */ "õ", /* 245 - f5 */ "ö", /* 246 - f6 */ "÷", /* 247 - f7 */ "ø", /* 248 - f8 */ "ù", /* 249 - f9 */ "ú", /* 250 - fa */ "û", /* 251 - fb */ "ü", /* 252 - fc */ "ý", /* 253 - fd */ "þ", /* 254 - fe */ "ÿ" /* 255 - ff */ }; htdig-3.2.0b6/contrib/rtf2html/README0100644006314600127310000000123110057404360016441 0ustar angusgbhtdigrtf2html - a RTF to HTML conversion program This version of rtf2html has been developed by David Lippi and Gabriele Bartolini , based on an earlier work by Chuck Shotton (see http://www.w3.org/Tools/HTMLGeneration/rtf2html.html) and Dmitry Porapov . This version can handle character set recognition at run-time: currently, the ANSI Windows 1252 code and the Macintosh's are supported. For copyright details, see the file COPYING in your distribution or the GNU General Public License (GPL) version 2 or later htdig-3.2.0b6/contrib/rtf2html/charset1252.h0100644006314600127310000001361610057404360017707 0ustar angusgbhtdigunsigned char* charset1252[256] = { "", /* 1 - 1 */ "", /* 2 - 2 */ "", /* 3 - 3 */ "", /* 4 - 4 */ "", /* 5 - 5 */ "", /* 6 - 6 */ "", /* 7 - 7 */ "", /* 8 - 8 */ "\t", /* 9 - 9 */ "\n", /* 10 - a */ " ", /* 11 - b */ " ", /* 12 - c */ "\r", /* 13 - d */ "", /* 14 - e */ "", /* 15 - f */ "", /* 16 - 10 */ "", /* 17 - 11 */ "", /* 18 - 12 */ "", /* 19 - 13 */ "", /* 20 - 14 */ "", /* 21 - 15 */ "", /* 22 - 16 */ "", /* 23 - 17 */ "", /* 24 - 18 */ "", /* 25 - 19 */ "", /* 26 - 1a */ "", /* 27 - 1b */ "", /* 28 - 1c */ "", /* 29 - 1d */ "", /* 30 - 1e */ "", /* 31 - 1f */ " ", /* 32 - 20 */ "!", /* 33 - 21 */ "\"", /* 34 - 22 */ "#", /* 35 - 23 */ "$", /* 36 - 24 */ "%", /* 37 - 25 */ "&", /* 38 - 26 */ "'", /* 39 - 27 */ "(", /* 40 - 28 */ ")", /* 41 - 29 */ "*", /* 42 - 2a */ "+", /* 43 - 2b */ ",", /* 44 - 2c */ "-", /* 45 - 2d */ ".", /* 46 - 2e */ "/", /* 47 - 2f */ "0", /* 48 - 30 */ "1", /* 49 - 31 */ "2", /* 50 - 32 */ "3", /* 51 - 33 */ "4", /* 52 - 34 */ "5", /* 53 - 35 */ "6", /* 54 - 36 */ "7", /* 55 - 37 */ "8", /* 56 - 38 */ "9", /* 57 - 39 */ ":", /* 58 - 3a */ ";", /* 59 - 3b */ "<", /* 60 - 3c */ "=", /* 61 - 3d */ ">", /* 62 - 3e */ "?", /* 63 - 3f */ "@", /* 64 - 40 */ "A", /* 65 - 41 */ "B", /* 66 - 42 */ "C", /* 67 - 43 */ "D", /* 68 - 44 */ "E", /* 69 - 45 */ "F", /* 70 - 46 */ "G", /* 71 - 47 */ "H", /* 72 - 48 */ "I", /* 73 - 49 */ "J", /* 74 - 4a */ "K", /* 75 - 4b */ "L", /* 76 - 4c */ "M", /* 77 - 4d */ "N", /* 78 - 4e */ "O", /* 79 - 4f */ "P", /* 80 - 50 */ "Q", /* 81 - 51 */ "R", /* 82 - 52 */ "S", /* 83 - 53 */ "T", /* 84 - 54 */ "U", /* 85 - 55 */ "V", /* 86 - 56 */ "W", /* 87 - 57 */ "X", /* 88 - 58 */ "Y", /* 89 - 59 */ "Z", /* 90 - 5a */ "[", /* 91 - 5b */ "\\", /* 92 - 5c */ "]", /* 93 - 5d */ "^", /* 94 - 5e */ "_", /* 95 - 5f */ "`", /* 96 - 60 */ "a", /* 97 - 61 */ "b", /* 98 - 62 */ "c", /* 99 - 63 */ "d", /* 100 - 64 */ "e", /* 101 - 65 */ "f", /* 102 - 66 */ "g", /* 103 - 67 */ "h", /* 104 - 68 */ "i", /* 105 - 69 */ "j", /* 106 - 6a */ "k", /* 107 - 6b */ "l", /* 108 - 6c */ "m", /* 109 - 6d */ "n", /* 110 - 6e */ "o", /* 111 - 6f */ "p", /* 112 - 70 */ "q", /* 113 - 71 */ "r", /* 114 - 72 */ "s", /* 115 - 73 */ "t", /* 116 - 74 */ "u", /* 117 - 75 */ "v", /* 118 - 76 */ "w", /* 119 - 77 */ "x", /* 120 - 78 */ "y", /* 121 - 79 */ "z", /* 122 - 7a */ "{", /* 123 - 7b */ "¦", /* 124 - 7c */ "}", /* 125 - 7d */ "~", /* 126 - 7e */ " ", /* 127 - 7f */ "€", /* 128 - 80 */ " ", /* 129 - 81 */ "‚", /* 130 - 82 */ "ƒ", /* 131 - 83 */ "„", /* 132 - 84 */ "…", /* 133 - 85 */ "†", /* 134 - 86 */ "‡", /* 135 - 87 */ "ˆ", /* 136 - 88 */ "‰", /* 137 - 89 */ "Š", /* 138 - 8a */ "‹", /* 139 - 8b */ "Œ", /* 140 - 8c */ " ", /* 141 - 8d */ "Ž", /* 142 - 8e */ " ", /* 143 - 8f */ " ", /* 144 - 90 */ "‘", /* 145 - 91 */ "’", /* 146 - 92 */ "“", /* 147 - 93 */ "”", /* 148 - 94 */ "•", /* 149 - 95 */ " ", /* 150 - 96 */ " ", /* 151 - 97 */ "˜", /* 152 - 98 */ "™", /* 153 - 99 */ "š", /* 154 - 9a */ "›", /* 155 - 9b */ "œ", /* 156 - 9c */ " ", /* 157 - 9d */ "ž", /* 158 - 9e */ "Ÿ", /* 159 - 9f */ " ", /* 160 - a0 */ "¡", /* 161 - a1 */ "¢", /* 162 - a2 */ "£", /* 163 - a3 */ "¤", /* 164 - a4 */ "¥", /* 165 - a5 */ "¦", /* 166 - a6 */ "§", /* 167 - a7 */ "¨", /* 168 - a8 */ "©", /* 169 - a9 */ "ª", /* 170 - aa */ "«", /* 171 - ab */ "¬", /* 172 - ac */ "­", /* 173 - ad */ "®", /* 174 - ae */ "¯", /* 175 - af */ "°", /* 176 - b0 */ "±", /* 177 - b1 */ "²", /* 178 - b2 */ "³", /* 179 - b3 */ "´", /* 180 - b4 */ "µ", /* 181 - b5 */ "¶", /* 182 - b6 */ "·", /* 183 - b7 */ "ç", /* 184 - b8 */ "¹", /* 185 - b9 */ "º", /* 186 - ba */ "»", /* 187 - bb */ "¼", /* 188 - bc */ "½", /* 189 - bd */ "¾", /* 190 - be */ "¿", /* 191 - bf */ "À", /* 192 - c0 */ "Á", /* 193 - c1 */ "Â", /* 194 - c2 */ "Ã", /* 195 - c3 */ "Ä", /* 196 - c4 */ "Å", /* 197 - c5 */ "Æ", /* 198 - c6 */ "Ç", /* 199 - c7 */ "È", /* 200 - c8 */ "É", /* 201 - c9 */ "Ê", /* 202 - ca */ "Ë", /* 203 - cb */ "Ì", /* 204 - cc */ "Í", /* 205 - cd */ "Î", /* 206 - ce */ "Ï", /* 207 - cf */ "Ð", /* 208 - d0 */ "Ñ", /* 209 - d1 */ "Ò", /* 210 - d2 */ "Ó", /* 211 - d3 */ "&Oring;", /* 212 - d4 */ "Õ", /* 213 - d5 */ "Ö", /* 214 - d6 */ "×", /* 215 - d7 */ "Ø", /* 216 - d8 */ "Ù", /* 217 - d9 */ "Ú", /* 218 - da */ "Û", /* 219 - db */ "Ü", /* 220 - dc */ "Ý", /* 221 - dd */ "Þ", /* 222 - de */ "ß", /* 223 - df */ "à", /* 224 - e0 */ "á", /* 225 - e1 */ "â", /* 226 - e2 */ "ã", /* 227 - e3 */ "ä", /* 228 - e4 */ "å", /* 229 - e5 */ "æ", /* 230 - e6 */ "ç", /* 231 - e7 */ "è", /* 232 - e8 */ "é", /* 233 - e9 */ "ê", /* 234 - ea */ "ë", /* 235 - eb */ "ì", /* 236 - ec */ "í", /* 237 - ed */ "î", /* 238 - ee */ "ï", /* 239 - ef */ "ð", /* 240 - f0 */ "ñ", /* 241 - f1 */ "ò", /* 242 - f2 */ "ó", /* 243 - f3 */ "ô", /* 244 - f4 */ "õ", /* 245 - f5 */ "ö", /* 246 - f6 */ "÷", /* 247 - f7 */ "ø", /* 248 - f8 */ "ù", /* 249 - f9 */ "ú", /* 250 - fa */ "û", /* 251 - fb */ "ü", /* 252 - fc */ "ý", /* 253 - fd */ "þ", /* 254 - fe */ "ÿ" /* 255 - ff */ }; htdig-3.2.0b6/contrib/rtf2html/rtf2html.c0100644006314600127310000004240610057404360017500 0ustar angusgbhtdig/* RTF2HTML.c, Chuck Shotton - 6/21/93 */ /************************************************************************ * This program takes a stab at converting RTF (Rich Text Format) files * into HTML. There are some limitations that keep RTF from being able to * easily represent things like in-line images and anchors as styles. In * particular, RTF styles apply to entire "paragraphs", so anchors or * images in the middle of a text stream can't easily be represented by * styles. The intent is to ultimately use something like embedded text * color changes to represent these constructs. * * In the meantime, you can take existing Word documents, apply the * correct style sheet, and convert them to HTML with this tool. * * AUTHOR: Chuck Shotton, UT-Houston Academic Computing, * cshotton@oac.hsc.uth.tmc.edu * * Dmitry Potapov, CapitalSoft * dpotapov@capitalsoft.com * * David Lippi, Comune di Prato, Italy * d.lippi@comune.prato.it * * Gabriele Bartolini, Comune di Prato, Italy * g.bartolini@comune.prato.it * * USAGE: rtf2html [rtf_filename] * * BEHAVIOR: * rtf2html will open the specified RTF input file or read from * standard input, writing converted HTML to standard output. * * NOTES: * The RTF document must be formatted with a style sheet that has * style numberings that conform to the style_mappings table * defined in this source file. Characters are converted according * to the ANSI Windows 1252 code or Macintosh. * * MODIFICATIONS: * 6/21/93 : Chuck Shotton - created version 1.0. * 11/26/98 : Dmitry Potapov - version 1.1 beta * 05/07/04 : David Lippi, Gabriele Bartolini - version 1.2 * * Copyright (C) 2004 Comune di Prato * * For copyright details, see the file COPYING in your distribution * or the GNU General Public License (GPL) version 2 or later * * ************************************************************************/ /* Note, the source is formated with 4 character tabs */ #include #include #include #include #include "charset1252.h" #include "charsetmac.h" #ifdef _MSC_VER # define strcasecmp _stricmp #endif #ifndef TRUE #define TRUE -1 #define FALSE 0 #endif #define MAX_LEVELS 40 /*defines the # of nested in-line styles (pairs of {})*/ #define MAX_RTF_TOKEN 40 #define MAX_INLINE_STYLES 5 /*defines # of in-line styles, bold, italic, etc.*/ typedef struct tag_StyleState { unsigned char s: MAX_INLINE_STYLES; } TStyleState; typedef enum { s_plain, s_bold, s_italic, s_underline, s_hidden, /*in-line styles*/ s_para, s_br, /*pseudo style*/ s_h0, s_h1, s_h2, s_h3, s_h4, s_h5, s_h6 /*heading styles*/ } StyleState; char *styles[][2] = { /*HTML Start and end tags for styles*/ {"", ""}, {"", ""}, {"", ""}, {"", ""}, {""}, {"\n", "\n"}, /* {"\n

", "

\n"}, */ {"
\n",""}, {"", ""}, {"

", "

"}, {"

", "

"}, {"

", "

"}, {"

", "

"}, {"
", "
"}, {"
", "
"} }; /* style_mappings maps the style numbers in a RTF style sheet into one of the*/ /* (currently) six paragraph-oriented HTML styles (i.e. heading 1 through 6.)*/ /* Additional styles for lists, etc. should be added here. Style info */ /* ultimately should be read from some sort of config file into these tables.*/ #define MAX_NAME_LEN 40 char style_name[MAX_NAME_LEN]; #define STYLE_NUMBER 7 char *style_namings[STYLE_NUMBER] = { "", "heading 1", "heading 2", "heading 3", "heading 4", "heading 5", "heading 6" }; char style_mappings[STYLE_NUMBER][MAX_RTF_TOKEN]; char style_number[MAX_RTF_TOKEN]; /* RTF tokens that mean something to the parser. All others are ignored. */ typedef enum { t_start, t_fonttbl, t_colortbl, t_stylesheet, t_info, t_s, t_b, t_ul, t_ulw, t_uld, t_uldb, t_i, t_v, t_plain, t_par, t_pict, t_tab, t_bullet, t_cell, t_row, t_line, t_endash, t_emdash, t_rquote, t_end } TokenIndex; char *tokens[] = { "###", "fonttbl", "colortbl", "stylesheet", "info", "s", "b", "ul", "ulw", "uld", "uldb", "i", "v", "plain", "par", "pict", "tab", "bullet", "cell", "row", "line", "endash", "emdash", "rquote", "###" }; TStyleState style_state[MAX_LEVELS], curr_style; short curr_heading; void (*RTF_DoControl)(FILE*,char*,char*); char isBody; char* title; //FILE* f; short level, /*current {} nesting level*/ skip_to_level,/*{} level to which parsing should skip (used to skip */ /* font tables, style sheets, color tables, etc.) */ gobble, /*Flag set to indicate all input should be discarded */ ignore_styles;/*Set to ignore inline style expansions after style use*/ /* Charset */ unsigned char** charset_table; #define CHARSET_DEFAULT 0 // Index of the default charset to use #define CHARSET_NUMBER 2 // Number of charset used #define CHARSET_MAX_LENGTH 20 // Max numbero of char in the charset // metadata used in rtf standard for the charset definition unsigned char *charset[CHARSET_NUMBER] = { "ansi", "mac" }; // variable with the charset definition unsigned char **charset_variablename[CHARSET_NUMBER] = { charset1252, mac }; /**************************************/ int openfile (char * filename, FILE ** f) { int rv = 1; if (filename) { if (!(*f = fopen (filename, "r"))) { fprintf (stderr, "\nError: Input file %s not found.\n", filename); rv = 0; } else { title = filename; } } else { *f = stdin; title="STDIN"; } return rv; } /**************************************/ int closefile (FILE * f) { return fclose (f); } /**************************************/ char RTF_GetChar( FILE* f ) { char ch; do { ch = fgetc( f ); } while ((ch=='\r')||(ch=='\n')); return ch; } /**************************************/ char RTF_UnGetChar(FILE* f, char ch) { return ungetc(ch, f); } /**************************************/ void RTF_PutStr(char* s) { if (gobble) return; fputs(s, stdout); } /**************************************/ void RTF_PutHeader() { RTF_PutStr("\n"); RTF_PutStr(title); RTF_PutStr("\n"); RTF_PutStr("\n"); RTF_PutStr("\n"); } /**************************************/ void RTF_PutChar(char ch) { if (gobble) return; if (!isBody) { RTF_PutHeader(); RTF_PutStr("\n"); isBody=TRUE; } switch (ch) { case '<': RTF_PutStr("<"); break; case '>': RTF_PutStr(">"); break; case '&': RTF_PutStr("&"); break; default: fputc(ch, stdout); } } /**************************************/ void RTF_PlainStyle (TStyleState* s) { int i; for(i=0;is & (1<s=0; } /**************************************/ void RTF_SetStyle(TStyleState* s, StyleState style) { if( (!ignore_styles||(style==s_hidden)) && ((s->s&(1<s|=(1<=MAX_LEVELS) { fprintf(stderr,"Exceed maximum level\n"); exit(-1); } style_state[*level]=curr_style; (*level)++; } /**************************************/ void RTF_PopState(short* level) { int j; TStyleState new_style; if(*level<1) { fprintf(stderr,"RTF parse error: unexpected '}'\n"); exit(-1); } new_style = style_state[*level-1]; /*close off any in-line styles*/ for (j=0;j=MAX_NAME_LEN-1) return; if (is_string) { for (p = ch; p && *p; ++p) { token[len]=*p; ++len; } } else { token[len] = *ch; ++len; } token[len]='\0'; } /**************************************/ void RTF_ClearName(char* token) { token[0]=0; } /**************************************/ TokenIndex GetTokenIndex(char* control) { TokenIndex i; for (i=t_start; i='0')&&(ch<='9')) return ch-'0'; if((ch>='A')&&(ch<='Z')) return ch-'A'+10; if((ch>='a')&&(ch<='z')) return ch-'a'+10; return -1; } /**************************************/ void RTF_BuildArg (FILE * f, char ch, char* arg) { int i=0; if(feof(f)) { arg[0]=0; return; } if(ch=='-') { arg[i++]='-'; ch = RTF_GetChar( f ); if(feof(f)) { arg[0]=0; return; } } for(;isdigit(ch);i++) { arg[i]=ch; if(i>=MAX_RTF_TOKEN-1) { arg[MAX_RTF_TOKEN-1]=0; while(isdigit(ch)) { ch = RTF_GetChar( f ); if(feof(f)) return; } break; } ch = RTF_GetChar( f ); if(feof(f)) { arg[i+1]=0; return; } } arg[i]=0; if(!isspace(ch)) { RTF_UnGetChar(f, ch); } } /**************************************/ void RTF_BuildToken (FILE* f, char ch) { int i; for(i=1;;i++) { char token[MAX_RTF_TOKEN], arg[MAX_RTF_TOKEN]; token[i-1]=ch; if(i>=MAX_RTF_TOKEN-1) { do { ch = RTF_GetChar( f ); if(feof(f)) return; } while (isalpha(ch)); RTF_BuildArg(f, ch,arg); return; } ch = RTF_GetChar( f ); if(feof(f)) { token[i]=0; RTF_DoControl(f,token,""); return; } if( !isalpha(ch) ) { token[i]=0; RTF_BuildArg(f, ch,arg); RTF_DoControl(f,token,arg); return; } } } /**************************************/ void RTF_backslash(FILE* f, char** pch, char* pf) { int ch; *pf=FALSE; ch = RTF_GetChar( f ); if(feof(f)) { fprintf(stderr,"Unexpected end of file\n"); return; } switch (ch) { case '\\': *pch=charset_table[92]; *pf=TRUE; break; case '{': *pch=charset_table[123]; *pf=TRUE; break; case '}': *pch=charset_table[125]; *pf=TRUE; break; case '*': gobble = TRUE; /*perform no output, ignore commands 'til level-1*/ if(skip_to_level>level-1||skip_to_level==-1) skip_to_level = level-1; break; case '\'': { char ch1, ch2; ch1 = RTF_GetChar( f ); ch2 = RTF_GetChar( f ); if(!feof(f)) { if(isxdigit(ch1)&&isxdigit(ch2)) { ch = chartoi(ch1)*16+chartoi(ch2); *pch = charset_table[ch-1]; *pf=TRUE; } else { fprintf(stderr,"RTF Error: unexpected '%c%c' after \\\'\n",ch1,ch2); } } break; } default: if (isalpha(ch)) { RTF_BuildToken(f, ch); } else { fprintf(stderr, "\nRTF Error: unexpected '%c' after \\.\n", ch); } break; } } /**************************************/ void RTF_ParseStyle(FILE * f) { char ch, pf; char *code; int level0; void (*PrevDoControl)(FILE*,char*,char*); level0=level; PrevDoControl=RTF_DoControl; RTF_DoControl=RTF_DoStyleControl; RTF_ClearName(style_name); style_number[0]=0; while (1) { ch = RTF_GetChar( f ); if(feof(f)) break; switch (ch) { case '\\': RTF_backslash(f, &code, &pf); if(pf) { RTF_BuildName(style_name, code, 1); } else { RTF_ClearName(style_name); } break; case '{': level++; RTF_ClearName(style_name); break; case '}': if(level0+1==level) { if(style_number[0]!=0) { RTF_AddStyleMap(style_name,style_number); style_number[0]=0; } } else if(level0==level) { RTF_DoControl=PrevDoControl; RTF_UnGetChar(f, ch); return; } level--; RTF_ClearName(style_name); break; default: RTF_BuildName(style_name, &ch, 0); break; } } /* while */ } /**************************************/ /* Perform actions for RTF control words */ void RTF_DoBodyControl (FILE * f, char* control,char* arg) { short style; if (gobble) return; switch (GetTokenIndex(control)) { case t_stylesheet: gobble = TRUE; /*perform no output, ignore commands 'til level-1*/ skip_to_level = level-1; RTF_ParseStyle( f ); break; case t_fonttbl: /*skip all of these and their contents!*/ case t_colortbl: case t_info: gobble = TRUE; /*perform no output, ignore commands 'til level-1*/ skip_to_level = level-1; break; case t_pict: gobble = TRUE; /*perform no output, ignore commands 'til level-1*/ if(skip_to_level>=level || skip_to_level==-1) skip_to_level = level-1; break; case t_s: /*Style*/ if (!curr_heading) { style = RTF_MapStyle (arg); if(style) { curr_heading = s_h0 + style; RTF_PutStr(styles[curr_heading][0]); ignore_styles = TRUE; } } break; case t_b: /*Bold*/ RTF_SetStyle(&curr_style,s_bold); break; case t_ulw: case t_uld: case t_uldb: case t_ul: /*Underline, maps to "emphasis" HTML style*/ RTF_SetStyle(&curr_style,s_underline); break; case t_i: /*Italic*/ RTF_SetStyle(&curr_style,s_italic); break; case t_v: /* Hidden*/ RTF_SetStyle(&curr_style,s_hidden); break; case t_par: /*Paragraph*/ if (curr_heading!=s_plain) { RTF_PutStr(styles[curr_heading][1]); curr_heading = s_plain; } else { RTF_PutStr(styles[s_para][0]); } ignore_styles = FALSE; break; case t_plain: /*reset inline styles*/ RTF_PlainStyle(&curr_style); break; case t_cell: case t_tab: RTF_PutChar(' '); break; case t_endash: case t_emdash: RTF_PutChar('-'); break; case t_line: case t_row: RTF_PutStr(styles[s_br][0]); break; case t_bullet: RTF_PutChar('\xb7'); break; case t_start: case t_end: break; case t_rquote: //RTF_PutStr("’"); RTF_PutStr("'"); break; } } /**************************************/ /* RTF_Parse is a crude, ugly state machine that understands enough of */ /* the RTF syntax to be dangerous. */ void RTF_ParseBody( FILE* f ) { char ch, pf; char* code; RTF_DoControl=RTF_DoBodyControl; level = 0; skip_to_level = -1; gobble = FALSE; ignore_styles = FALSE; while (1) { ch = RTF_GetChar( f ); if (feof(f)) { break; } switch (ch) { case '\\': RTF_backslash(f, &code,&pf); if(pf && code) RTF_PutStr(code); break; case '{': RTF_PushState(&level); break; case '}': RTF_PopState(&level); break; default: RTF_PutChar(ch); break; } }/*while*/ } /**************************************/ int RTF_Parse (FILE* f) { RTF_PutStr("\n\n"); isBody=FALSE; RTF_ParseBody(f); if (isBody) RTF_PutStr("\n"); RTF_PutStr("\n"); return 0; } /**************************************/ void Initialize() { int i; for (i=0;i 2 ) { code[i] = '\0'; break; } } for ( i = 0; i < CHARSET_NUMBER ; i++) { if ( strcmp( (const char *)charset[i], (const char *) code ) == 0 ) { charset_table = charset_variablename[i]; break; }; } if ( i == CHARSET_NUMBER ) { charset_table = charset_variablename[CHARSET_DEFAULT]; } return 1; // always true! } /**************************************/ int main(int argc,char** argv) { int rv = 0; FILE *f = NULL; Initialize(); if ( argc > 1) { if( strcmp(argv[1],"--help")==0 || strcmp(argv[1],"-H")==0 ) { printf("Use: %s [rtf_filename]\n",argv[0]); rv = 0; } else if ( strcmp(argv[1],"--version")==0 || strcmp(argv[1],"-V")==0 ) { printf("rtf2html version 1.2\n"); rv = 0; } else { rv = openfile(argv[1], &f); if ( rv ) rv = RTF_FindCharset(f); if ( rv ) { rewind(f); rv = RTF_Parse(f); } if ( rv ) rv = closefile(f); } } else { printf("Use: %s [rtf_filename]\n",argv[0]); } return rv; } htdig-3.2.0b6/contrib/scriptname/0040755006314600127310000000000010063260367016176 5ustar angusgbhtdightdig-3.2.0b6/contrib/scriptname/search.html0100644006314600127310000000255706742220211020330 0ustar angusgbhtdig ht://Dig WWW Search

ht://Dig WWW Site Search


This search will allow you to search the contents of all the publicly available WWW documents at this site.

Match: Format: Sort by:
Search:

htdig-3.2.0b6/contrib/scriptname/README0100644006314600127310000000071606742220211017050 0ustar angusgbhtdigThis is a small example to demonstrate the script_name attribute. Assuming that these files are located within your server's "search" directory, just add the following line to your htdig configuration file: script_name: /search/results.shtml You may also have to override the standard template files, using the search_results_header, search_results_footer, syntax_error_file and nothing_found_file attributes. (c) 1999, Hanno Mueller, http://www.hanno.de htdig-3.2.0b6/contrib/scriptname/templates/0040755006314600127310000000000010063260367020174 5ustar angusgbhtdightdig-3.2.0b6/contrib/scriptname/templates/footer.html0100644006314600127310000000006206742220211022344 0ustar angusgbhtdig$(PAGEHEADER) $(PREVPAGE) $(PAGELIST) $(NEXTPAGE) htdig-3.2.0b6/contrib/scriptname/templates/NOTE0100644006314600127310000000020406742220211020646 0ustar angusgbhtdigThese are the standard template files, minus the standard start and ending of the HTML that is already in the dynamic results page. htdig-3.2.0b6/contrib/scriptname/templates/header.html0100644006314600127310000000121106742220211022273 0ustar angusgbhtdigSearch results for '$(LOGICAL_WORDS)'

Match: $(METHOD) Format: $(FORMAT) Sort by: $(SORT)
Refine search:

Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches. More *'s indicate a better match.
htdig-3.2.0b6/contrib/scriptname/templates/long.html0100644006314600127310000000027206742220211022010 0ustar angusgbhtdig
$(TITLE)$(STARSLEFT)
$(EXCERPT)
$(URL) $(MODIFIED), $(SIZE) bytes
htdig-3.2.0b6/contrib/scriptname/templates/nomatch.html0100644006314600127310000000172606742220211022507 0ustar angusgbhtdigSearch results

No matches were found for '$(LOGICAL_WORDS)'

Check the spelling of the search word(s) you used. If the spelling is correct and you only used one word, try using one or more similar search words with "Any."

If the spelling is correct and you used more than one word with "Any," try using one or more similar search words with "Any."

If the spelling is correct and you used more than one word with "All," try using one or more of the same words with "Any."


Match: $(METHOD) Format: $(FORMAT) Sort by: $(SORT)
Refine search:
htdig-3.2.0b6/contrib/scriptname/templates/short.html0100644006314600127310000000010106742220211022177 0ustar angusgbhtdig$(STARSRIGHT) $(TITLE)
htdig-3.2.0b6/contrib/scriptname/templates/syntax.html0100644006314600127310000000151506742220211022400 0ustar angusgbhtdigError in Boolean search for '$(LOGICAL_WORDS)'
Boolean expressions need to be 'correct' in order for the search system to use them. The expression you entered has errors in it.

Examples of correct expressions are: cat and dog, cat not dog, cat or (dog not nose).
Note that the operator not has the meaning of 'without'.

$(SYNTAXERROR)

Match: $(METHOD) Format: $(FORMAT) Sort: $(SORT)
Refine search:
htdig-3.2.0b6/contrib/scriptname/results.shtml0100644006314600127310000000074106742515440020753 0ustar angusgbhtdig Search results (SHTML)


ht://Dig htdig-3.2.0b6/contrib/urlindex/0040755006314600127310000000000010063260367015663 5ustar angusgbhtdightdig-3.2.0b6/contrib/urlindex/urlindex.pl0100755006314600127310000001437606656361041020071 0ustar angusgbhtdig#!/usr/local/bin/perl ## ## urlindex.pl (C) 1995 Andrew Scherpbier ## ## This program will build an index of all the URLs in the ## htdig document database. ## use GDBM_File; require('SDSU_www.pl'); $dbfile = "/gopher/www/htdig/sdsu3d.docdb"; $dbfile = "/tmp/db.docdb"; $exclude = "rohan.sdsu.edu\\/home\\/"; tie(%docdb, GDBM_File, $dbfile, GDBM_READER, 0) || die "Unable to open $dbfile: $!"; print "Reading...\n"; ## ## Read in all the relevant data. ## while (($key, $value) = each %docdb) { next if $key =~ /^nextDocID/; %record = parse_ref_record($value); next if $record{"STATE"} eq 1; next if $key =~ /$exclude/; $title = $record{"TITLE"}; ## ## Get rid of starting and trailing whitespace junk ## $title =~ s/^[ \t\n\r]*//; $title =~ s/[ \t\n\r]*$//; ## ## If the title starts with 'the', it will be taken out and added ## to the end of the title. This means that a title like "The ## Homepage of X" will become "Homepage of X, The" ## if ($title =~ /^the /i) { $title = substr($title, 4) . ", " . substr($title, 0, 3); } if ($title =~ /^SDSU /) { $title = substr($title, 5) . ", " . substr($title, 0, 4); } if ($title =~ /^San Diego State University /i) { $title = substr($title, 27) . ", " . substr($title, 0, 26); } $value = $title; $value =~ tr/A-Z/a-z/; $titles{$value} = "$title\001$key"; push(@unsorted, $value); } $current = " "; open(M, ">index.html"); print M "Index of all documents at SDSU\n"; print M "\n"; print M &www_logo_2("Index of all documents at SDSU"); print M "

This is a list of WWW documents that were found while indexing all\n"; print M "the publicly available WWW servers at San Diego State University.\n"; print M "The documents are indexed by their titles.\n"; print M "

\n"; $previous = ""; print "Writing...\n"; foreach $value (sort @unsorted) { next if $value eq $previous; $previous = $value; next if !($value =~ /^[a-zA-Z]/); ($title, $url) = split('\001', $titles{$value}, 2); $first = substr($title, 0, 1); if ($current =~ /$first/i) { print F "
  • $title
  • \n"; } else { ## ## New letter. Open a new file for it ## $current = $first; $current =~ tr/a-z/A-Z/; print F "\n"; close(F); open(F, ">index$current.html"); print F "Index for $current\n"; print F "\n"; print F &www_logo_2("Index for $current"); print F "
      \n"; print F "
    • $title
    • \n"; ## ## Add a reference to the main index for this letter ## print M " $current\n"; print "Index of $current\n"; } } close(F); print M "

    \n"; close(M); sub parse_ref_record { local($value) = @_; local(%rec, $length, $count, $result); while (length($value) > 0) { $what = unpack("C", $value); $value = substr($value, 1); if ($what == 0) { # ID $rec{"ID"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 1) { # TIME $rec{"TIME"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 2) { # ACCESSED $rec{"ACCESSED"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 3) { # STATE $rec{"STATE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 4) { # SIZE $rec{"SIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 5) { # LINKS $rec{"LINKS"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 6) { # IMAGESIZE $rec{"IMAGESIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 7) { # HOPCOUNT $rec{"HOPCOUNT"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 8) { # URL $length = unpack("i", $value); $rec{"URL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 9) { # HEAD $length = unpack("i", $value); $rec{"HEAD"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 10) { # TITLE $length = unpack("i", $value); $rec{"TITLE"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 11) { # DESCRIPTIONS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"DESCRIPTIONS"} = $result; } elsif ($what == 12) { # ANCHORS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"ANCHORS"} = $result; } elsif ($what == 13) { # EMAIL $length = unpack("i", $value); $rec{"EMAIL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 14) { # NOTIFICATION $length = unpack("i", $value); $rec{"NOTIFICATION"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 15) { # SUBJECT $length = unpack("i", $value); $rec{"SUBJECT"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 16) { # STRING (ignore, but unpack) $length = unpack("i", $value); $rec{"STRING"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 17) { # METADSC $length = unpack("i", $value); $rec{"METADSC"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 18) { # BACKLINKS $rec{"BACKLINKS"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 19) { # SIGNATURE $rec{"SIG"} = unpack("i", $value); $value = substr($value, 4); } } print "title = $rec{'TITLE'}\n"; return %rec; } htdig-3.2.0b6/contrib/whatsnew/0040755006314600127310000000000010063260367015671 5ustar angusgbhtdightdig-3.2.0b6/contrib/whatsnew/whatsnew.pl0100755006314600127310000001765406656361042020110 0ustar angusgbhtdig#!/usr/local/bin/perl # # whatsnew.pl v1.1 (C) 1996 Iain Lea # modified 26 Oct 1998 (c) 1998 Jacques Reynes # # ChangeLog # 960321 IL Reversed sorting to show newest documents first # 981026 JR Modified to work with Berkeley DB2. # 980204 GRH Modified to work with changes in ht://Dig db format # # Produces a HTML 'Whats New' page with custom header and footer. # # Title # Descriptions # URL # Last modification date (in ctime format) # # The date is specified as yyyymmdd # # Usage: whatsnew.pl [options] # -h help # -d date base date [default: $DefDate] # -n days list documents newer than days old [default: $DefDays] # -f file database index [default: $DefIndex] # -F file HTML footer # -H file HTML header # -o file HTML generated file # -v verbose use BerkeleyDB; require 'timelocal.pl'; require 'getopts.pl'; $DefIndex = ' your data base .docdb'; $DefOutputFile = ' your result file URL created in your web server whatsnew.html'; $TmpFile = "/tmp/whatsnew.$$"; $DefFooter = ''; $DefHeader = ''; $Verbose = 0; $NewNum = 0; $DefDays = 3; chop (($DefDate = '19'.`date +%y%m%d`)); &ParseCmdLine; $DefDate =~ /([0-9]{4})([0-9]{2})([0-9]{2})/; $When = timelocal (0, 0, 0, $3, $2 - 1, $1 - 1900)- ($DefDays * 86400); $NewDate = localtime ($When); $dbfile = $DefIndex; print "Generating 'Whats New' for documents newer than '$NewDate'...\n" if $Verbose; &ReadDatabase ($DefIndex, $TmpFile); &WriteWhatsNew ($TmpFile, $DefOutputFile, $DefHeader, $DefFooter); exit 1; ############################################################################# # Subroutines # sub ParseCmdLine { &Getopts ('d:f:F:hH:n:o:v'); if ($opt_h ne "") { print < $Index, -Flags => DB_RDONLY || die "Error: $Index - $!"; open (TMP, ">$TmpFile") || die "Error: $TmpFile - $!\n"; while (($key, $value) = each %docdb) { next if $key =~ /^nextDocID/; %rec = parse_ref_record ($value); if ($rec{'TIME'} >= $When) { $Line = "$rec{'TIME'}|$rec{'URL'}|$rec{'TITLE'}|$rec{'DESCRIPTIONS'}\n"; print $Line if $Verbose; print TMP $Line; $NewNum++; } } close (TMP); } sub WriteWhatsNew { my ($InFile, $OutFile, $Header, $Footer) = @_; open (URLS, "sort -r $InFile |") || die "Error: $InFile - $!\n"; open (HTML, ">$OutFile") || die "Error: $OutFile - $!\n"; &PrintBoilerPlate ($Header, 1); while () { chop; ($Time, $URL, $Title, $Description) = split ('\|'); $Ctime = localtime ($Time); if ($Verbose) { print <Title: $Title Description: $Description URL: $URL Modified: $Ctime EOT ; } &PrintBoilerPlate ($Footer, 0); close (HTML); close (URLS); unlink ($InFile); } sub PrintBoilerPlate { my ($File, $IsHeader) = @_; if ($File ne "" && -e $File) { open (FILE, $File) || die "Error: $File - $!\n"; while () { print HTML; } close (FILE); } else { if ($IsHeader) { print HTML < Whats New!

    Whats New!


    Found $NewNum documents newer than '$NewDate'
    EOT
    ;
    		} else {
    			print HTML <
    
    EOT ; } } } sub parse_ref_record { local($value) = @_; local(%rec, $length, $count, $result); while (length($value) > 0) { $what = unpack("C", $value); $value = substr($value, 1); if ($what == 0) { # ID $rec{"ID"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 1) { # TIME $rec{"TIME"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 2) { # ACCESSED $rec{"ACCESSED"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 3) { # STATE $rec{"STATE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 4) { # SIZE $rec{"SIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 5) { # LINKS $rec{"LINKS"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 6) { # IMAGESIZE $rec{"IMAGESIZE"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 7) { # HOPCOUNT $rec{"HOPCOUNT"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 8) { # URL $length = unpack("i", $value); $rec{"URL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 9) { # HEAD $length = unpack("i", $value); $rec{"HEAD"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 10) { # TITLE $length = unpack("i", $value); $rec{"TITLE"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 11) { # DESCRIPTIONS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"DESCRIPTIONS"} = $result; } elsif ($what == 12) { # ANCHORS $count = unpack("i", $value); $value = substr($value, 4); $result = ""; foreach (1 .. $count) { $length = unpack("i", $value); $result = $result . unpack("x4 A$length", $value) . ""; $value = substr($value, 4 + $length); } chop $result; $rec{"ANCHORS"} = $result; } elsif ($what == 13) { # EMAIL $length = unpack("i", $value); $rec{"EMAIL"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 14) { # NOTIFICATION $length = unpack("i", $value); $rec{"NOTIFICATION"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 15) { # SUBJECT $length = unpack("i", $value); $rec{"SUBJECT"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 16) { # STRING (ignore, but unpack) $length = unpack("i", $value); $rec{"STRING"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 17) { # METADSC $length = unpack("i", $value); $rec{"METADSC"} = unpack("x4 A$length", $value); $value = substr($value, 4 + $length); } elsif ($what == 18) { # BACKLINKS $rec{"BACKLINKS"} = unpack("i", $value); $value = substr($value, 4); } elsif ($what == 19) { # SIGNATURE $rec{"SIG"} = unpack("i", $value); $value = substr($value, 4); } } return %rec; } htdig-3.2.0b6/contrib/wordfreq/0040755006314600127310000000000010063260367015662 5ustar angusgbhtdightdig-3.2.0b6/contrib/wordfreq/wordfreq.html0100644006314600127310000000047306275416054020410 0ustar angusgbhtdig


    Andrew Scherpbier <andrew@sdsu.edu>
    Last modified: Wed Jul 5 10:26:36 PDT 1995 htdig-3.2.0b6/contrib/wordfreq/wordfreq.pl0100755006314600127310000000256506624445235020067 0ustar angusgbhtdig#!/usr/local/bin/perl use GDBM_File; use BerkeleyDB; ## ## wordfreq.pl ## (C) 1995 Andrew Scherpbier ## ## Will generate a list of words and how frequently they are used ## ## updated to deal with Berkeley db files 1998 Iosif Fettich ## $filetype = 'DB'; if (not defined $ARGV[0] or defined ($ARGV[1]) and $ARGV[1] !~ /g/i) { print "\n\nThis program is used in conjunction with ht://Dig \n"; print "to determine the frequency of words in a database containing word references.\n\n"; print "Usage: $0 filename (to use a Berkeley db2 wordlist)\n"; print " $0 filename g[dbm] (to use a GDBM wordlist)\n\n\n"; exit; } $filename = $ARGV[0]; if ($filename =~ /gdbm$/i or $ARGV[1] =~ /g/i) { $filetype = 'GDBM'; } if ($filetype eq 'GDBM') { tie %worddb, 'GDBM_File', $ARGV[0], GDBM_READER, 0 or die "Unable to open $ARGV[0] $!"; } else { tie %worddb, 'BerkeleyDB::Btree', -Filename => $filename, -Flags => DB_RDONLY or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ; } while (($key, $value) = each %worddb) { $length = length($value) / 20; $total = 0; foreach $i (0 .. $length - 1) { ($count, $id, $weight, $anchor, $location) = unpack("i i i i i", substr($value, $i * 20, 20)); $total += $count; } print "$total\t$key\n"; } htdig-3.2.0b6/contrib/xmlsearch/0040755006314600127310000000000010063260367016017 5ustar angusgbhtdightdig-3.2.0b6/.cvsignore0100644006314600127310000000011307556777142014402 0ustar angusgbhtdigdb-* Makefile config.log config.status config.cache libtool autom4te.cache htdig-3.2.0b6/.version0100644006314600127310000000001010054062231014031 0ustar angusgbhtdig3.2.0b6 htdig-3.2.0b6/COPYING0100644006314600127310000006314707676127651013452 0ustar angusgbhtdigAs decided by the HtDig Board Members and ratified by the HtDig Membership in October of 2002 the HtDig codebase is now licensed under the LGPL. The primary reason for doing this is to promote wider usage of HtDig by allowing more liberal use of the code as a library while preserving the "all changes/improvements must be given back" philosophy of the GPL. Here's a quote from the FSF site [http://www.gnu.org/philosophy/why-not-lgpl.html] "Using the ordinary GPL is not advantageous for every library. There are reasons that can make it better to use the Library GPL in certain cases. The most common case is when a free library's features are readily available for proprietary software through other alternative libraries. In that case, the library cannot give free software any particular advantage, so it is better to use the Library GPL for that library." ----------------------------------------------------------------------- GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! htdig-3.2.0b6/ChangeLog0100644006314600127310000122131410063260173014137 0ustar angusgbhtdigMon Jun 14 10:08:01 CEST 2004 Gabriele Bartolini * Tagged release htdig-3-2-0b6 Sun 13 Jun 2004 Lachlan Andrew * db/os_abs.c, (db/os_abs.c.win32 removed): Re-fix Cygwin bug (#814268, fixed 25 Apr) so that it won't be clobbered by autotools. Sat 12 Jun 2004 Lachlan Andrew * htdoc/RELEASE.html: Separated bug fixes from new features * htdoc/{htdig,htfuzzy}.html, installdir/{htdig,htfuzzy}.1.in: Added list of database files used * htdoc/{htdump,htmerge,htnotify,htpurge,hts_general,htstat,rundig}.html: Hyperlinked COMMON_DIR, BIN_DIR, DATABASE_DIR to attrs.html. * htcommon/defaults.cc, htdoc/attrs.html.in: Remove reference to deprecated '-l' option (generate URL log) of htdig. Fri Jun 11 11:48:40 2004 Gilles Detillieux * htsearch/parser.cc (phrase): Applied Lachlan's patch to prevent endless loop when boolean keywords appear in a phrase in boolean match method. Fri Jun 11 11:26:56 2004 Gilles Detillieux * db/hash.c (CDB___ham_open): Applied Red Hat's h_hash patch, to ensure that hash function always set to something valid. Fri Jun 11 10:53:49 2004 Gilles Detillieux * installdir/HtFileType: Added -f to rm command. * htsearch/parser.cc (perform_or): Added missing & in if clause. * contrib/htdig-3.2.0.spec: Updated for 3.2.0b6. * installdir/Makefile.{am,in}: Don't stick $(DESTDIR) in HtFileType. Thu Jun 10 16:39:36 CEST 2004 Gabriele Bartolini * htcommon/conf_(lexer.lxx,parser.yxx): applied Gilles' patch (April 22) which features: - improved error handling, gives file name and correct line number, even if using include files - allows space before comment, because otherwise it would just complain about the "#" character and go on to parse the text after it as a definition - allows config file with an unterminated line at end of file, by pushing an extra newline token to the parser at EOF - parser correctly handles extra newline tokens, by moving this handling out of simple_expression, and into simple_expression_list and block, as simple_expression must return a new ConfigDefaults object and a newline token doesn't cut it (caused segfaults when dealing with fix above) * htcommon/conf_lexer.cxx: Regenerate using flex 2.5.31. * htcommon/conf_parser.cxx: Regenerate using bison 1.875a. Wed Jun 9 12:32:47 2004 Gilles Detillieux * htdig/HTML.cc (do_tag): Fixed meta date handling fix of June 3 to ensure null byte gets put in by get() call. Wed 9 Jun 2004 Lachlan Andrew * contrib/doc2html/doc2html.pl, installdir/mime.types: Add support for OpenOffice.org documents (#957305) Sat 5 Jun 2004 Lachlan Andrew * test/t_htdig, test/t_factors: fix tests for non-gnu/linux systems. Sat 5 Jun 2004 Lachlan Andrew * htdoc/cf_generate.pl: Hyperlink to simplify finding the defaults of attributes defined in terms of others (e.g., accents_db->database_base->database_dir). * htdoc/attrs.html.in: regenerated using cf_generate.pl Sat 5 Jun 2004 Lachlan Andrew * htcommon/defaults.cc: Escaped new-line in "allow_spaces_in_url" entry. Set no_next_page_text to ${next_page_text}; likewise no_prev_page_text. Fri Jun 4 10:23:53 CEST 2004 Gabriele Bartolini * htcommon/URL.cc: added "allow_space_in_url" (from fileSpace.1 patch) * htcommon/defaults.[cc,xml]: added documentation of allow_space_in_url * htdoc/attrs.html.in: regenerated using cf_generate.pl * htdoc/cf_byname.html: ditto * htdoc/cf_byprog.html: ditto * htdoc/RELEASE.html: updated with info regarding this attribute Thu Jun 3 16:04:23 2004 Gilles Detillieux * htdig/HTML.cc (do_tag): Fixed meta date handling to avoid inadvertently matching names like DC.Date.Review. Thu Jun 3 10:01:50 CEST 2004 Gabriele Bartolini * htdoc/RELEASE.html: updated release notes and changes * htdoc/THANKS.html: updated the 'thanks' section Thu Jun 3 09:32:52 CEST 2004 Gabriele Bartolini * global: updated with 'autoreconf -if' (autoconf 2.59, libtool 1.5.6 and automake 1.7.9) Wed Jun 2 19:03:14 CEST 2004 Gabriele Bartolini * contrib/rtf2html: added the rtf2html.c source as modified by David Lippi and Gabriele Bartolini of the Comune di Prato. The source code is now released under GNU GPL and included in the ht://Dig package. Tue Jun 1 20:23:40 CEST 2004 Gabriele Bartolini * htcommon/HtSGMLCodec.cc: changed ¤ to € Fri 28 May 2004 Lachlan Andrew * Most files: Update copyright to 2004 Sun 23 May 2004 Lachlan Andrew * htdocs/FAQ.html: Sync with maindocs Sun 23 May 2004 Lachlan Andrew * configure, configure.in: Resolve variables (e.g., BINDIR) copied into attrs.html, without introducing "NONE" prefix detected by Gabriele. Sun 23 May 2004 Lachlan Andrew * .version, htdoc/RELEASE.html, htdoc/where.html, htdoc/attrs.html.in, htdoc/cf_byname.html, htdoc/cf_byprog.html: Prepare docs for release of 3.2.0b6. Mon Apr 26 15:12:22 2004 Gilles Detillieux * htfuzzy/Soundex.cc (generateKey): Applied Alex Kiesel's fix to prevent segfaults when word has no letters. Sun 25 Apr 2004 Lachlan Andrew * htdig/HTML.cc: Handle empty noindex_start/noindex_end lists. * htlib/StringList.{cc,h}: const-correctness of Add/Insert/Assign(char*) * redo mistakenly backed out patch... Sun 25 Apr 2004 Lachlan Andrew * htsearch/parser.cc: Address (but not fix) bug #934739 If collection->getDocumentRef() on line 889 returns NULL, don't crash. I'm still trying to work out why it does return NULL -- I don't think it ever should. * mistakenly back out previous patch :( Sun 25 Apr 2004 Lachlan Andrew * htdig/Retriever.{h,cc}, htcommon/defaults.cc, htdoc/FAQ.html: Add store_phrases attribute. If it is false, htdig only stores the first occurrence of each word in a document. This reduces the database size dramatically, and slightly increases digging speed. Sun 25 Apr 2004 Lachlan Andrew * db/{aclocal.m4,configure,os_abs.c.win32}, STATUS, htdoc/THANKS.html: Correctly dected paths beginning C: as absolute paths in cygwin/Win32. Fixes bug #814268. Sun 25 Apr 2004 Lachlan Andrew * htdig/Retriever.cc: Gilles's patch to avoid regex compile for every URL encountered. Sun 25 Apr 2004 Lachlan Andrew * contrib/htdig-3.2.0.spec: Karl Eichwalder's patch to use mktemp to create safe temp file. Wed Apr 7 17:12:33 2004 Gilles Detillieux * htdig/Retriever.cc (IsValidURL): Fixed bug #931377 so bad_extensions and valid_extensions not thrown off by periods in query strings. Mon Mar 15 11:56:04 CET 2004 Gabriele Bartolini * htsearch/Display.cc: changed (and fixed) the date factor formula as Lachlan and David Lippi suggested, in order not to give negative results. Fri Mar 12 09:13:28 CET 2004 Gabriele Bartolini * configure.in: removed 'eval' expressions which caused the 'NONE' prefix path to be instantiated and the make script to hang * acinclude.in: fixed AC_DEFINEs for SSL and ZLIB check macros, which prevented autoheader (and therefore autoreconf) to correctly work * moved manual pages from htdoc to installdir * htdoc/[manpages].in: removed * installdir/*.[1,8]: removed man pages (htdig-pdfparser.1, htdig.1, htdump.1, htfuzzy.1, htload.1, htmerge.1, htnotify.1, htpurge.1, htsearch.1, htstat.1, rundig.1, htdigconfig.8) * installdir/*.[1,8].in: added pre-configure man pages (htdig-pdfparser.1.in, htdig.1.in, htdump.1.in, htfuzzy.1.in, htload.1.in, htmerge.1.in, htnotify.1.in, htpurge.1.in, htsearch.1.in, htstat.1.in, rundig.1.in, htdigconfig.8.in) * regenerated configure scripts with autoreconf * fixes bug #909674 Sat 21 Feb 2004 Lachlan Andrew * installdir/HtFileType: Use mktemp to create safe temp file (bug #901555) Wed Feb 25 11:14:45 CET 2004 Gabriele Bartolini * htdocs/THANKS.html: added Robert Ribnitz to the 'thanks' page and fixed Nenciarini's position (it was not in alphabetical order - sorry!). Wed Feb 25 11:02:37 CET 2004 Gabriele Bartolini * installdir/*.[1,8]: added man pages (htdig-pdfparser.1, htdig.1, htdump.1, htfuzzy.1, htload.1, htmerge.1, htnotify.1, htpurge.1, htsearch.1, htstat.1, rundig.1, htdigconfig.8) provided by Robert Ribnitz of the Debian Project * installdir/Makefile.am: prepared the automake script for correctly handling the man pages Sat 21 Feb 2004 Lachlan Andrew * htsearch/htsearch.cc: Back out change of 21 December, as it causes problems with characters which *should* be unencded, like / Thu 19 Feb 2004 Lachlan Andrew * aclocal.m4, acinclude.m4, configure.in: Remove duplicate tests for zlib Fix tests for SSL (Fixes bug #829081) Fix configure --help formatting * htdoc/*.[18].in, htdoc/Makefile.am, configure.in: Added man pages * htdoc/attrs.html.in, htdoc/cf_generate.pl, htdoc/Makefile.am: Fill in #define'd attribs (Fixes bug #692125) * test/Makefile.am: Incorporate new tests in make check * test/t_htdig, test/t_parsing: suppress unwanted diagnostics * STATUS: list Cygwin bug (#814268) * htcommon/default.cc: added wordlist_cache_inserts, remove worlist_cache_dirty_level * configure, */Makefile.in, */Makefile, htdoc/cf_by{name,prog}.html: regenerated Fri 13 Feb 2004 Lachlan Andrew * db/mp_cmpr.c: Fix bug with --without-zlib Sun 8 Feb 2004 Lachlan Andrew * htcommon/URL.cc: Make server_alias case insensitive. * htdig/Document.cc: Don't hex-decode twice. (Caused problems with names like file%20name) * htdig/Retriever.cc: Test validity of URL value *before* calling signature(), as that implictly normalises, and confuses limit_normalised vs limit_urls_to * htdig/htdig.cc: Remove stale md5_db if -i specified * installdir/htdig.conf: Set common_url_parts to contain all strings which *must* be in a valid URL. Probably contains whole domain name, so more compression than using standard strings. * htcommon/defaults.cc: Update docs. Remove default "bad_extensions" from common_url_parts, and add .shtml * test/t_htdig, test/t_htdig_local: Update self-tests Tue Feb 3 18:06:38 CET 2004 Gabriele Bartolini * htcommon/HtConfiguration.cc: changed the Find method in order not to ignore empty string results for string attributes whenever they are defined in the configuration file by the user * htdig/Document.cc: fixed bugs in handling the http_proxy, http_proxy_authorization, authorization attributes * htlib/Configuration.[h,cc]: added the Exists method in order to query whether an attribute's definition is present in the configuration dictionary (before it was checked against its string's length which prevented empty attributes to be correctly used) * these changes fix bug #887552 Sun 18 Jan 2004 Lachlan Andrew * htcommon/URL.cc, test/url.cc: Rename "allow_dbl_slash" to "allow_double_slash", to match defaults.cc * htcommon/default.cc, htdoc/{hts_temlates,attrs}.html: Explain that keywords_factor applies to meta keywords. Fix old typo. * test/t_{factors,templates}, test/htdocs/set1/{title.html,bad_local.htm} * test/conf/entry-template: Expanded test suite. Sat 17 Jan 2004 Lachlan Andrew * test/t_{parsing,htdig_local,factors,templates}, * test/htdocs/set1/title.html: Expanded test suite. Sat 17 Jan 2004 Lachlan Andrew * htcommon/DocumentRef.cc: Fix old-style use of HtConfiguration, so defaults are read correctly. Causes max_descriptions to be treated correctly. * htcommon/default.cc, htdoc/{hts_temlates,attrs,cf_byname,cf_byprog}.html: Explain that max_description{s,_length} don't affect indexing -- only text used to fill in template variables. Mon 12 Jan 2004 Lachlan Andrew * Very many files: Fix bug #873965 Replace C++ style comments with C style comments in all C files, and .h files they include. Also, change //_WIN32 to /* _WIN32 */ in .cc files for uniformity. Mon 12 Jan 2004 Lachlan Andrew * test/t_parsing, test/test_functions.in: Add new tests * htcommon/default.cc, htdoc/hts_templates.html: Cross-ref documentation. Mon Dec 29 2003 Lachlan Andrew * htdig/Retriever.cc: Fix bug in which validity of first URL from each server was not checked. Mon Dec 29 2003 Lachlan Andrew * htdig/htdig.cc, htdoc/htdig.html: Fix bug #845054 Fix behaviour of -m and additional list of urls at the end of a command. In either case, "-" denotes stdin. Mon Dec 29 2003 Lachlan Andrew * installdir/rundig, installdir/Makefile.{in,am}: Address bug #860708 Make bin/rundig -a handle multiple database directories Sun Dec 21 2003 Lachlan Andrew * htsearch/htsearch.cc: Improve handling of restrict/exclude URLs with spaces or encoded chars Sun Dec 21 2003 Lachlan Andrew * htsearch/HtURLSeedScore.cc, htsearch/SplitMatches.cc: Fix bug #863860 Split patterns at "|". For SplitMatches, make "*" only match if all other patterns fail. Sun Dec 14 2003 Lachlan Andrew * htdig/Server.cc: Fix bug #851303. Allow indexing if robots.txt has an empty "disallow". * test/t_htdig, test/t_htsearch, test/htdocs/robots.txt: Tests for the above. Sun Dec 14 2003 Lachlan Andrew * htdig/htdig.cc, test/t_factors: Warn if config file has obsolete fields. Sun Dec 14 2003 Lachlan Andrew * htsearch/Display.cc: Apply Gilles's patch for ellipses bug #844828. Sun Dec 14 2003 Lachlan Andrew * test/{t_validwords,t_templates,t_fuzzy,t_factors} * test/{set_attr,synonym_dict,dummy.stems,dummy.affixes,bad_word_list} * test/conf/main-template test/htdocs/set1/{site2.html,site4.html}: Added four new tests to test suite. Not included in "make check", but can be run explicitly by "make TESTS=t_... check". Sun Dec 14 2003 Lachlan Andrew * htcommon/conf_lexer.{lxx,cxx}: Back out changes to try to accept files without EOL :( Sat Dec 13 2003 Lachlan Andrew * htcommon/defaults.{cc,xml}, htdoc/{attrs,cf_byprog}.html: Fix "used by" for max_excerpts, and resulting hyperlinks. Sat Nov 22 2003 Lachlan Andrew * htcommon/conf_lexer.{lxx,cxx}, htcommon/conf_parser.{yxx,cxx}: Partially address bug #823455. Don't complain if config file doesn't end in EOL. Should the grammar be fixed not to need EOL? Report errors to stderr, not stdout, as they confuse the web server. Sun Nov 9 14:44:02 EST 2003 Gabriele Bartolini * Tagged release htdig-3-2-0b5 Sat Nov 8 2003 Lachlan Andrew * htcommon/default.cc, htsearch/parser.cc: Fix bug #825877 Reduce backlink_factor to comparable with other factors, and interpret multimatch_factor as the *bonus* given for multiple matches. Sat Nov 1 2003 Lachlan Andrew * htsearch/parser.cc: Fix bug #806419. Ignore bad words at start of phrase. Tue Oct 28 11:58:06 EST 2003 Gabriele Bartolini * htdig/htdig.cc: set the debug level when we are importing a cookie file. Fix bug #831478. Mon Oct 27 17:13:02 2003 Gilles Detillieux * htdig/Server.cc: Fix bug #831407. Make sure time properly reset after delay completed, so that it doesn't allow 2 connections per delay. Mon Oct 27 15:57:38 2003 Gilles Detillieux * htdoc/THANKS.html: Added Lachlan, Jim and Neal to the active developers list. Sun Oct 26 2003 Lachlan Andrew * htdoc/hts_templates.html: Clarify that PREV/NEXTPAGE template variables are empty if there is only one page, ignoring no_{prev,next}_page_text. Sun Oct 26 2003 Lachlan Andrew * htcommon/defaults.cc: Fixed documentation to close bug #829767 Clarified that noindex_start/end do not get replaced by whitespace. Also removed spurious '>' from start of boolean_syntax_errors, and added missing '#' to many local tags. Sun Oct 26 12:42:27 EST 2003 Gabriele Bartolini * htcommon/defaults.cc: Fixed description of 'head_before_get' after Lachlan fixes. * htdoc/attrs.html: rerun cf_generate.pl Sat Oct 25 2003 Lachlan Andrew * htsearch/Display.cc: Fix #829761. If last component of the URL is used as a title, URL-decode it. Sat Oct 25 2003 Lachlan Andrew * htdig/Server.cc: Fix #829754. Avoid calculations with negative time Fri Oct 24 17:17:15 2003 Gilles Detillieux * htdoc/htdig.html, htdoc/meta.html, htdoc/require.html: Update URL for the Standard for Robot Exclusion. * htdoc/htmerge.html: Added two clarifications to -m option description. * htdoc/cf_types.html: Make clear distinction between String List and Quoted String List. Fri Oct 24 15:30:08 2003 Gilles Detillieux * htsearch/Display.cc: Fix bug #829746. Applied Niel Kohl's fix for this, to check if words input given before trying to use it, to avoid NULL argument to syslog(). Fri Oct 24 15:15:53 2003 Gilles Detillieux * htsearch/Display.cc: Fix bug #578570. The enddate handling now works correctly for a large, negative startday value. Fri Oct 24 12:47:51 2003 Gilles Detillieux * htdig/HTML.cc (ctor): Fix obvious typo in metadatetags.Pattern setting. Thu Oct 23 10:27:18 2003 Lachlan Andrew * htcommon/default.cc: Fix bug #828808. Default startyear to empty Document "startyear defaults to 1970 if a start/end date set". Thu Oct 23 12:14:30 EST 2003 Gabriele Bartolini * htdig/htdig.cc: restored the code before Oct 21 (fixes ##828628) Thu Oct 23 11:41:15 EST 2003 Gabriele Bartolini * htdig/Retriever.[h,cc]: removed 'head_before_get' overriding by restoring the code before Oct 21. * htdig/Document.[h,cc]: ditto, with the exception of detaching the HEAD before GET mechanism from the persistent connections'. * htcommon/defaults.cc: improved documentation (even though it needs corrections by an english-speaking developer). * These changes fix bug #828628 Wed Oct 22 2003 Lachlan Andrew * htsearch/parser.cc: Applied Neal's patch to fix bug #823403 Documents only added to search list if they were successfully dug. Lines 237-238 of htsearch/Display.cc if (!ref || ref->DocState() != Reference_normal) continue; should now be redundant. (Left in to be defensive.) Tue Oct 21 11:04:56 EST 2003 Gabriele Bartolini * htdig/Retriever.h: added the 'RetrieverType' enum and an object variable for storing the type of dig we are performing (default initial); * htdig/Retriever.cc: changed constructor in order to handle the type, added some debugging explanation regarding the override of the 'head_before_get' attribute, added checks regarding an empty database of URLs to be updated (set the type to initial). * htdig/Document.h: added the attribute 'is_initial' which stores the information regarding the type of indexing (initial or incremental) we are currently performing. Added access methods (get-and-set-like) * htdig/Document.cc: modified the logic of the HeadBeforeGet settings during the retrieval phase, in order to always override user's settings in an incremental dig and automatically set the 'HEAD' call in this case. * htcommon/defaults.cc: modified the default value of 'head_before_get' and a bit of its explanation. * htnet/HtHTTP.cc: detached the HEAD before GET mechanism to the persistent connections one * htdig/Server.cc: added one level of debugging to the display of the server settings in the server constructor Fri Oct 17 2003 Lachlan Andrew * htword/WordType.cc, htcommon/defaults.cc: Patched to fix bug #823083 Don't assume IsStrictChar returns false for digits. Clarify behaviour of allow_numbers in the documentation. Fri Oct 17 2003 Lachlan Andrew * htcommon/defaults.cc: Patched to fix bug #823455 Escaped "$" in valid_punctuation, and add warnings about $, \ and `. Wed Oct 15 11:12:52 2003 Gilles Detillieux * htdig/Server.cc (robotstxt): Patched to fix bug #765726. Don't block paths with subpaths excluded by robots.txt, and make sure any regex meta characters are properly escaped. Tue Oct 14 11:54:07 EST 2003 Gabriele Bartolini * htnet/HtHTTP.cc: add an empty Accept-Encoding header - this inform the server that htdig is only able to manage documents that are not encoded (if no Accept-Encoding is sent, the server assumes that the client is capable of handling every content encoding - i.e. zipped documents with Apache's mod_gzip module). Partial fix of bug #594790 (which now becomes a feature request) Mon Oct 13 2003 Lachlan Andrew * htfuzzy/Regex.cc: Search for regular expression. (Used to ignore it!) * htfuzzy/Speling.cc, htword/{WordList.cc,WordList.h,WordKey.cc,WordKey.h}: When looking in word database for misspelt words, don't ask to match trailing numeric fields in database key. * htcommon/defaults.cc, htdoc/htfuzzy.cc: Update docs. Sun Oct 12 2003 Lachlan Andrew * htsearch/htsearch.cc: Fix bug if fuzzy algorithms produced no search words. Send all debugging output to cerr not cout. More debugging output. Sun Oct 12 2003 Lachlan Andrew * htdig/{Retriever,Server}.cc: Back out the previous. Gilles pointed out inconsistency with Retriever::IsValidURL(). Sun Oct 5 2003 Lachlan Andrew * htdig/{Retriever,Server}.cc: Jim Cole's patch to bug #765726. Don't block paths with subpaths excluded by robots.txt. Sun Oct 5 2003 Lachlan Andrew * htsearch/htsearch.cc: Highlight phrases containing stop words * test/t_htsearch, test/conf/htdig.conf.in: Tests for the above Sat Sep 27 2003 Lachlan Andrew * test/{test_functions.in,t_htdig,t_htdig_local,t_htnet}: Don't assume shell "." command passes arguments. (Doesn't on FreeBSD.) Sat Sep 27 2003 Lachlan Andrew * htlib/HtDateTime.h, htnet/HtCookie.cc: Avoid ambiguous function call on systems (HP-UX) where time_t=int Fri Aug 29 09:35:46 MDT 2003 Neal Richter * removed references to CDB___mp_dirty_level ,CDB_set_mp_diry_level() & CDB_get_mp_diry_level() * The config verb 'wordlist_cache_dirty_level' was left for possible use in the future. Thu Aug 28 15:11:21 MDT 2003 Neal Richter * Changed db/LICENSE file to new LGPL compatible license from Sleepycat Software -- Thanks Sleepycat! * Reverted to Revision 1.2 or db/mp_alloc.c The recent changed cuased large DB growth. Strangely the files contained no 'new' data, they were just much larger. Looks like the pages were being flushed too often???? Thu Aug 28 12:41:22 EST 2003 Gabriele Bartolini * global: updated with 'autoreconf -if' (autoconf 2.57, libtool 1.5.0a and automake 1.7.6) * 'make check' successful on: AMD64 Linux 2.4, Alpha Linux 2.2, RedHat Linux 7.3 (2.4), SPARC Ultra60 Linux 2.4, Sparc R220 Sun Solaris (5.8). * README.developer: added further info Thu Aug 28 12:00:10 EST 2003 Gabriele Bartolini * db/[config.guess,config.sub,install-sh,ltmain.sh,missing]: added in the database directory (this way 'make dist' goes on); I have not been able to tell the db/configure script to get the 'top_srcdir' ones (which should be the default behaviour). Maybe in the future we'll look for this. Thu Aug 28 11:53:48 EST 2003 Gabriele Bartolini * db/configure.in: changed AC_PROG_INSTALL() to AC_PROG_INSTALL and removed AC_CONFIG_AUX_DIR; this implies that autotools copies will be made for the db directory as well. Thu Aug 28 11:36:42 EST 2003 Gabriele Bartolini * [htcommon,htdb,htdig,htfuzzy,htlib,htnet,htsearch,httools,htword,test]/Makefile.am: added the option above to every *_LDFLAGS Thu Aug 28 11:30:39 EST 2003 Gabriele Bartolini * Makefile.am: removed acconfig.h from the EXTRA_DIST list Thu Aug 28 11:25:07 EST 2003 Gabriele Bartolini * configure.in: removed portability checks for error, stat and lstat that caused a compile errors on Solaris. Added the '-mimpure-text' extra ld flag for GCC on solaris systems (a linkage error occurs when libstdc++ is not shared) Thu Aug 28 11:22:57 EST 2003 Gabriele Bartolini * include/Makefile.am: changed htconfig.h.in into config.h.in Thu Aug 28 11:16:19 EST 2003 Gabriele Bartolini * htlib/error.[h,c]: removed for now, until replacement functions will be correctly performed. Thu Aug 28 11:11:32 EST 2003 Gabriele Bartolini * htdoc/cf_generate.pl: fixed an error when opening tail and head files * Makefile.am: enabled rebuild from a different directory (it is used my 'make dist') Thu Aug 28 10:46:35 EST 2003 Gabriele Bartolini * htlib/malloc.c: modified according to autoconf specifications as far as replacement functions are regarded * htlib/[lstat, stat].c: removed for now Thu Aug 28 10:40:58 EST 2003 Gabriele Bartolini * htdoc/cf_generate.pl: accept an optional parameter (top source directory) * htcommon/defaults.cc: fixed some broken lines which prevented cf_generate.pl from correctly working * htdoc/Makefile.am: modified the automake file for passing the top source directory to cf_generate.pl * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. Tue Aug 26 12:25:40 EST 2003 Gabriele Bartolini * configure.in: removed AC_FUNC_MKTIME because it may not work properly and added default replacement directory (htlib) for future uses * htlib/Makefile.am: back-step with re-inclusion of mktime.c in the list of files to be always compiled (caused linking errors for the __mktime_internal function) * global: updated with 'autoreconf -if' Sun Aug 24 12:44:29 EST 2003 Gabriele Bartolini * updated with 'autoreconf -if': autoconf 2.57, automake 1.7.6 and libtool 1.5.0a (autotools that come with Debian SID) Sun Aug 24 12:39:34 EST 2003 Gabriele Bartolini * configure.in: moved AC_PROG_LEX to AM_PROG_LEX * db/configure.in: enabled AM_MAINTAINER_MODE which prevented users without autotools to configure and compile the program (relatively to the db directory) * include/htconfig.h: previously excluded from the branch (severe error!) Mon Jul 21 20:54:47 CEST 2003 Gabriele Bartolini * htlib/(malloc|error|lstat|stat|realloc).c: added for cross-compiling reasons (as suggested by automake) * htlib/error.h: ditto * db/acconfig.h: removed as suggested by autotools' new versions * configure.in: removed AC_PROG_RANLIB (overriden by AC_PROG_LIBTOOL) * updated as of rerun 'autoreconf -if' Mon Jul 21 10:08:24 CEST 2003 Gabriele Bartolini * Patch provided by Marco Nenciarini has been completely applied; the patch adds support for detection of standard C++ library * all sources using : modified to use standard ISO C++ library, if present * db/configure scripts: modified for autoconf 2.57 Mon Jul 21 09:59:16 CEST 2003 Gabriele Bartolini * [.,*]/Makefile.in: regenerated by new automake against new configure.in * Makefile.config: now looking for the global configuration file in the source directory Mon Jul 21 09:49:22 CEST 2003 Gabriele Bartolini * configure.in: completely rewritten, deprecated directives have been removed and now version 2.57 is a prerequisite. * acinclude.m4: moved all the macros here * aclocal.m4, configure: regenerated by aclocal and autoconf * acconfig.h: removed as now it is deprecated * include/htconfig.h.in: removed, as 'config.h.in' is preferred and auto-generated * config.[guess,sub]: updated with newer versions Tue Jul 8 16:29:44 2003 Gilles Detillieux * htsearch/parser.cc (checkSyntax): Fixed boolean_syntax_errors handling to work over multiple config files. Mon Jul 7 00:41:55 CEST 2003 Gabriele Bartolini * Updated to autoconf 2.57, libtool 1.5 and automake 1.7.5 * removed acconfig.h files * autoconf include file is now include/config.h (for autoheader) * include/htconfig.h.in renamed in include/htconfig.h: now includes config.h and redefines the bool types * htlib/HtRegexList.cc, htdig/(Document.cc|ExternalParser.cc): removed TRUE and FALSE and converted to C++ standard values Sat Jul 5 2003 Lachlan Andrew * test/test_functions.in: Fix bugs starting/killing apache Sat Jul 5 2003 Lachlan Andrew * htcommon/defaults.cc: Disable cache flushing to avoid "page leak". Tue Jun 24 2003 Neal Richter * Update Copyright Notices in code & documentation to 2003 * Changed License Notice GPL -> LGPL License change (Decided by HtDig Board & Membership October 2002 Mon Jun 23 2003 Neal Richter * Raft of changes. Most todo with Native Win32 support * TODO: ExternalTranport & ExternalParser are effectively dissabled with #ifdefs for Native WIN32 * remove global CDB___mp_dirty_level variable and subsitute functions to set/get variable * Added local copies of GNU LGPL regex, POSIX-like dirent routines, getopt library and filecopy routines - mainly for Native WIN32 support * improve IsValidURL with return codes (htdig/Retriever.cc) * lots of improvements/new-features to libhtdig Sun Jun 22 2003 Lachlan Andrew * db/mp_cmpr.c (CDB___memp_cmpr_open): Make weak compression database standalone to avoid recursion This *should* fix all of the recent problems with dirty cache etc. * test/search.cc: Don't take sizeof zero sized array Fri Jun 20 2003 Lachlan Andrew * configure,aclocal.m4,acinclude.m4: --with-ssl set CPPFLAGS, not CFLAGS Fri Jun 20 2003 Lachlan Andrew * db/configure: Hack which should allow select to be detected on HP/UX * db/db.c: Replace HAVE_ZLIB with HAVE_LIBZ (as set by configure) * htword/wordKey.cc: More descriptive error message (Changes to compile with Sun's C++) * htnet/{HtCookie.cc,HtFTP.cc,Transport.cc}: Assign substring of const string to const pointer. * htsearch/ResultMatch.h: Allow use of SortType in ResultMatch::setSortType() * test/search.cc: Don't take sizeof(variable size array) * htdb/htdb_stat.cc: avoid name clash for global var internal * htcommon/URL.h, htlib/HtTime.h, htlib/htString.h, htnet/Connection.h, htword/WordBitCompress.h: Cast default args of type string literal to type (char*) * htdocs/require.html: Remove email address. * htlib/gregex.h: Avoid warning if __restrict_arr already defined Sun Jun 14 2003 Lachlan Andrew * htcommon/defaults.cc: Set wordlist_cache_dirty_level to 1 (it most conservative value). Miscellaneous reformatting. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. * htdoc/{require.html,meta.html,all.html,meta.html}: Update disk usage for phrase searching. Updated list of supported platforms. More hyperlinks. Fri Jun 13 2003 Lachlan Andrew * htsearch/Display.cc (setVariables), htdocs/hts_template.html: Set MATCH_MESSAGE from method_names (for internationalisability). Removed all trace of hack for config attribute... Thu Jun 12 14:16:05 2003 Gilles Detillieux * htsearch/htsearch.cc (main): Fixed boolean_keywords handling to work over multiple config files (must destroy old list before creating new one). * htcommon/defaults.cc, htsearch/Display.cc (setVariables): Removed incorrect default value for "config" attribute, and removed hack that attempted to correct it. * htdoc/attrs.html: Regenerated using cf_generate.pl. Thu Jun 12 13:28:01 2003 Gilles Detillieux * htcommon/defaults.cc, htcommon/HtSGMLCodec.cc (ctor): Added translate_latin1 option to allow disable Latin 1 specific SGML translations. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. Mon Jun 9 2003 Lachlan Andrew * htsearch/htsearch.cc: Fixed setupWords loop for junk at end of query Mon Jun 9 2003 Lachlan Andrew * htsearch/Display.cc: Set CONFIG template variable to the base name of the config file (no directory or .conf), as expected by htsearch Mon Jun 9 2003 Lachlan Andrew * test/test_functions.in: avoid trying killing apache multiple times * configure,configure.in: Reformat --help output * htdoc/FAQ.html: Brought up-to-date with main docs * htdoc/hts_templates.html: added hyperlinks. * installdir/search.html: Display version Sun Jun 8 2003 Lachlan Andrew * configure: Hack to set --disable-bigfile for Solaris (with Sun cc) and --disable-shared --enable-static for Mac OS X * test/{test_functions.in,t_htdig,t_htdig_local,t_htnet}: Only start Apache for tests which need it, and kill it after the test * contrib/parse_doc.pl: Allow file names containing spaces (from .deb) Mon Jun 2 2003 Lachlan Andrew * db/mp_cmpr.c: Add default zlib setting to default_cmpr_info * htcommon/defaults.cc, htword/WordDBCompress.cc: Fix docs to say default compression by 8 (not by 3, which I had "fixed" it to...) * htcommon/conf_lexer.{cxx,lxx}: Avoid warnings, and document hack. Thu May 29 2003 Lachlan Andrew * db/mp_cmpr.c: Fix comparison of -1 and unsigned which broke SunOS cc * htdoc/install.html: Warn SunOS cc users to --disable-bigfile * htcommon/conf_lexer.cxx: Suppress warnings of unused identifiers * test/con/htdig.conf2.in: Disable testing of content_classifier attribute, as didn't work until after installation Tue May 27 2003 Lachlan Andrew * db/configure, db/ac{local,include}.m4: Stop test for zlib from adding -I/default/path (*this* time...) * htword/DBPage.h: Fix bug introduce in previous patch * test/Makefile.{in,am}: Replace non-portable make -C X by cd X; make Tue May 27 2003 Lachlan Andrew * {,db/}configure, {,db/}ac{local,include}.m4: Stop test for zlib from adding -I/default/path (broke SunOS cc) Fix -Wall test if CCC is g++ but CC is not gcc * test/dbbench.cc: #include later, to avoid #define open causing problems * includedir/synonyms: Remove trailing blank line which caused warning * htnet/HtCookieInFileJar.cc,htfuzzy/Synonym.cc: .get() to stop warnings * htlib/mhash_md5.c: char -> unsigned char to stop warnings * test/search.cc, htword/WordDBPage.h: Casts to (int) to stop printf warnings. ALLIGN -> ALIGN Sat May 24 2003 Lachlan Andrew * htcommon/defaults.cc: Keep more wordlist cache pages clean * {,db/}configure{,.in}, {,db/}ac{local,include}.m4: Patch by Richard Munroe to test if -Wno-deprecated needed. Many bug fixes / extra search paths added. * include/htconfig.h.in, db/db_config.h.in: Only '#define const' if not C++ (htword/WordDB.cc uses db_config.h) * test/dbbench.cc: check for alloca even if gcc * test/t_url: used grep -C instead of grep -c (for portability) * db/mp_{alloc,cmpr}.c: Removed/replaced C++ style comments * htdoc/require.html: Revised list of supported platforms Thu May 22 2003 Lachlan Andrew * htnet/HtFile.cc: Fix previous .get() patch... Thu May 22 2003 Lachlan Andrew * htlib/DB_2.cc: Set wordlist_cache_dirty_level before opening database, to avoid database memory allocation problem. * db/db_err.c: Make 'fatal' errors actually exit. * htdig/Document.cc, htsearch/parser.cc, htdig/htdig.cc, * htnet/Ht{HTTP,File}.cc: Add .get() to use of strings to avoid compiler warnings (FreeBSD). Thu May 22 2003 Lachlan Andrew * ltmain.sh, test/Makefile.in: Hack to list library dependencies multiple times in g++ command, to get MacOS X to 'make check'. * test/{search,word}.cc: cast sizeof() to (int) to avoid warnings. * htdoc/install.html: Documented MacOS X's shared libraries problem. Sun May 18 2003 Lachlan Andrew * db/mp_alloc.c: Hopefully the *last* fix for this morning's patch... * configure, aclocal.m4, acinclude.m4: Look for httpd modules in .../libexec/httpd for OS X * test/conf/httpd.conf: Disabled mod_auth_db, mod_log{agent,referer}. Sun May 18 2003 Lachlan Andrew * db/db.h.in: Declare variable introduced in db/mp_cmpr.c patch Sun May 18 2003 Lachlan Andrew * db/mp.h, db/mp_{alloc,bh,cmpr,region}.c, * htword/WordDB.cc, htdig/htdig.cc: Avoid infinite loop if memp_alloc has only dirty, "weakly compressed" (i.e. overflow) pages. * htcommon/defaults.cc: Document the above, plus misc updates. * htword/WordDBPage.h: Cast sizeof() to (int) in printf()s to avoid compiler warnings. Sun APR 20 2003 Lachlan Andrew * htdig/htdig.cc: delete db.words.db_weakcmpr if -i specified. Wed Feb 26 22:10:40 CET 2003 Gabriele Bartolini * htnet/HtHTTP.cc: fixed colon (':') problem with HTTP header parsing, as Frank Passek, Gilles and others suggested, as space is not mandatory between the field declaration and the field value returned by the server Sun Feb 23 10:20:58 CET 2003 Gabriele Bartolini * htcommon/defaults.[cc,xml]: added the 'cookies_input_file' configuration attribute for pre-loading cookies in memory * htdig/htdig.cc: added the feature above; the code automatically loads the cookies from the input file into the 'jar' that will be used during the crawl. Sun Feb 23 10:16:08 CET 2003 Gabriele Bartolini * htnet/HtHTTP.h: removed the NULL pointer check before assigning a new jar to the HTTP code Tue Feb 11 2003 Lachlan Andrew * htcommon/defaults.cc: Set default compression_level to 6, which enables Neal's wordlist_compression_zlib flag. Tue Feb 11 2003 Lachlan Andrew * htcommon/{DocumentRef.h, HtWordReference.h}, htsearch/WeightWord.{cc,h}, htsearch/parser.{cc,h}, htsearch/htsearch.cc: Added field-restricted searching, by title:word or author:word * htdig/ExternalParser.cc, htdig/HTML.{cc,h}, htdig/Parsable.{cc,h}, htdig/Retriever.{cc,h}: Parse author from tags. Also moved some common functionality from HTML/ExternalParser into Parsable. * test/t_htsearch, htcommon/defaults.cc, htdoc/{TODO.html,hts_general.html,hts_method.html}: Test and document the above Sun Feb 9 2003 Lachlan Andrew * htdig/HTML.cc: fix bug in detection of deprecated noindex_start/end * htsearch/Display.cc: try harder to find value for DBL_MAX #680836 * htcommon/defaults.cc: fixed typos. Sat Feb 1 13:57:17 CET 2003 Gabriele Bartolini * htnet/HtCookie.[h,cc]: allowed printDebug to be passed an ostream object * htnet/HtCookieMemJar.cc: removed a debug call Thu Jan 30 19:28:32 CET 2003 Gabriele Bartolini * configure.in: used AC_LIBOBJ instead of deprecated LTLIBOBJS's workaround * ltconfig: removed as not needed anymore since libtool 1.4 * db/configure.in: added AC_CONFIG_AUX_DIR(../) for letting automake know to use the main ltmain.sh file * configure, aclocal.m4, Makefile.in, */Makefile.in, config.guess, config.sub, install-sh, ltmain.sh, missing, mkinstalldirs: re-generated by autotools: aclocal, autoconf 2.57, automake 1.6.3 and libtool 1.4.3 * db/aclocal.m4, db/configure, db/mkinstalldirs: ditto Thu Jan 30 00:16:51 CET 2003 Gabriele Bartolini * htsearch/htsearch.cc: removed a warning due to a not-initialized pointer Wed Jan 29 22:53:25 CET 2003 Gabriele Bartolini * acinclude.m4: included the function for checking against SSL, as found in the ac-archive. Tue Jan 28 12:23:16 CET 2003 Gabriele Bartolini * htnet/Makefile.am: added HtCookieInFileJar.[h,cc] files * installdir/cookies.txt: example file for pre-loading HTTP cookies * installdir/Makefile.am: added cookies.txt Tue Jan 28 12:16:28 CET 2003 Gabriele Bartolini * htnet/HtCookieMemJar.[h,cc]: performed deep copy of the jar in the copy constructor Tue Jan 28 12:13:44 CET 2003 Gabriele Bartolini * htnet/HtCookie.[h,cc]: added the constructor of a cookie object from a line of a cookie input file (Netscape's way): if an expiration value of '0' is set through the cookies input file, the cookie is managed as a session cookie. Improved copy constructor, solving a bug related to the expires field. Tue Jan 28 12:11:27 CET 2003 Gabriele Bartolini * htnet/HtCookieInFileJar.[h,cc]: class for importing cookies from a text file Tue Jan 28 12:08:20 CET 2003 Gabriele Bartolini * htlib/HtDateTime.h: added the constructor HtDateTime(const int) Sat Jan 25 2003 Lachlan Andrew * htsearch/Display.cc: Convert "
    \n" in $(DESCRIPTION) to "
    " so it can be used in Javascript (feature request #529926). Tue Jan 21 2003 Lachlan Andrew * HTML.cc (HTML, parse): Handle noindex_start/end as string lists. * test/{t_htsearch,htdocs/set1/script}: Test the above * htcomon/defaults.cc: Add "> (istream&,String&) ): Exit loop when getline fails for reasons other than a full buffer. * htnet/HtFile.cc (File2Mime), installdir/HtFileType: Allow file names containing spaces. Sat Jan 11 2003 Lachlan Andrew * htnet/HtFile.cc (Request), htdig/Document.cc (RetrieveLocal), htcommon/URL.h htcommon/URLTrans.cc: Decode URL paths before use as local filenames (file:/// & local_urls). * test/{t_htdig,t_htdig_local,t_htsearch}, test/conf/htdig.conf2.in, test/htdocs/set1/{index.html,site 1,sub%20dir/empty file.html}: Tests for the above. * htcommon/HtConfiguration.cc: brackets around assignment in 'if'. * test/search.cc (LocationCompare): Only specify default arg once. Fri Jan 10 2003 Lachlan Andrew * htlib/String.cc (operator>> (istream&,String&) ): Check status of stream, no return value of get(). Fixes bug (for some C++ libs) where reading stops at a blank line. Fri Jan 1 2003 Lachlan Andrew * htnet/HtFile.cc(Ext2Mime,Request), htdig/Document.cc(RetrieveLocal): Determine local files' MIME types from mime.types, not hard-coded. URLs matching attribute "bad_local_extensions" must use their true transport protocol (HTTP for http://, filesystem for file:///). * htnet/HtFile.cc (File2Mime, Request): For file:/// URLs only, files without (or with unrecognised) extensions are checked by the program specfied by the "content_classifier" attribute. * htnet/htFile.cc (Request): Symbolic links are treated as redirects, to avoid problems with relative references. * htcommon/defaults.cc: Documented the above (and added crossrefs). * test/t_ht{dig,dig_local,search}, test/htdocs/set1/*, test/conf/htdig.conf2.in: Add tests for bad_local_extensions. Mon Dec 31 2002 Lachlan Andrew * configure.in,htfuzzy/EndingsDB.cc,htlib/{HtR,r}egex.h,Makefile.am: Renamed regex.h to gregex.h and allow use of rx instead. * htcommon/defaults.cc,htdocs/{attrs,cf_byprog,cf_byname}.html: Fixed typo in cross-references to restrict and limit_urls_to. * test/t_htmerge: Re-enabled htmerge command (discarding output). * test/Makefile,test/conf/htdig.conf3.in: Added conf3 and fixed db path. Mon Dec 30 2002 Lachlan Andrew * contrib/doc2html/*: Incorporated David Adams' latest version, 3.0.1. Mon Dec 30 2002 Lachlan Andrew Forward-ported several patches from 3.1.6: * htdig/ExternalParser.cc: Added "description_meta_tag_names" attrib. Added "dc.date|dc.date.created|dc.date.modified" synonyms for "date". Allow spaces between "url" and "=" in refresh. Fixed bug in flag positions. Added "use_doc_date" attribute. * htdig/HTML.cc: Added "description \_meta_tag_names" attribute. Added "dc.date|..." synonyms. Added "ignore_alt_text" attribute. * htdig/Retriever.cc: Added "ignore_dead_servers" attribute. Added call to "url.rewrite() in got_href(). * htdig/FAQ.html: Latest version now 3.1.6. Mention old security hole. Describe external converters for PostScript etc. Mention pdf_parser not supported in 3.2. * htdoc/{attrs,cf_byname,cf_byprog}.html: New attributes added (automatically from defaults.cc). * htdoc/htmerge.html: Update for multiple database support. * htdoc/hts_form.html: Describe relative/incomplete dates. * htdoc/require.html: Describe phrase searching, external parsers, external transports. Added some new supported systems. (Commented out as testing incomplete.) * htfuzzy/Synonym.cc: Protect against "synonym" entries with one word. * htlib/String.cc: Protect against negative string lengths. * htsearch/Display.{cc,h}: Added "search_result_contenttype" attribute, and corresponding displayHTTPheaders() function. Rewrite URLs. Remove old "ANCHOR" variable. Handle relative dates. Added "max_excerpts" attribute and buildExcerpts() function. Added "anchor_target" attribute. * htsearch/DocMatch.h: Added "orMatches" * htsearch/htsearch.cc: Added "boolean_keywords" attribute. Rewrite URLs. * htsearch/parser.cc: Added "boolean_syntax_errors" attribute. Added wildcard search. Fixed bug in perform_phrase() so it now handles "bad words" and short words properly. Added "multimatch_factor" to give greater weight to documents matching multiple "OR" terms. * htsearch/htparser.h: Added boolean_keywords support. * htcommon/defaults.{cc,xml}: New attributes added, and enhanced descriptions Cleaned code to remove some compiler warnings/errors: * htcommon/HtConfiguration.cc: Brackets around assignment 'path=' inside 'if' * htdig/Server.cc, htsearch/Display.cc: Added ".get()" when strings passed as arguments. * htlib/StringMatch.h, htword/WordBitCompress.h: Explicit cast of NULL to (char*)NULL for broken C++ compilers. Also: * STATUS: Removed "not all htsearch input parameters handled properly", "Return all URLs", "Turn on URL parser test", "htsearch phrase support tests". Reduced list of things to do for "require.html". * test/t_htsearch, test/conf/htdig.conf3.in: Added testing of phrases and boolean_keywords / boolean_syntax_errors. Thu Nov 28 09:02:46 2002 Gilles Detillieux * installdir/english.0: Removed S flag from birth, because it doesn't do what we want (birthes, not births). Tue Nov 26 23:16:08 2002 Gilles Detillieux * htdoc/hts_form.html: Fixed typo in link & description for restrict. Tue Nov 26 22:30:06 2002 Gilles Detillieux * installdir/english.0: Patched with Lachlan Andrew's changes, fixing lots of dubious uses of suffixes to get more appropriate and correct fuzzy endings expansions. * installdir/synonyms: Updated with the version contributed by David Adams, with minor changes. Kept old one as synonyms.original. Mon Nov 4 10:44:35 CET 2002 Gabriele Bartolini * htcommon/URL.[h,cc]: added the assignment operator Sun Oct 27 09:29:02 2002 Geoffrey Hutchison Merge in word DB zlib patch from Neal Richter. * db/db.h.in, db/mp_cmpr.c, htword/WordList.cc, htword/WordDBCompress.h, htword/WordDBCompress.cc: Add support for using the zlib compression (and compression level) if specified by the new wordlist_compress_zlib, which is "true" by default. * htcommon/defaults.cc: Add attribute wordlist_compress_zlib as above. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Update using cf_generate.pl. Sat Oct 26 21:59:01 2002 Geoffrey Hutchison Merge in fixes from Lachlan Andrew * test/Makefile.am, test/Makefile.in, test/t_url, test/url.cc, test/url.children, test/url.parents, test/url.output: Add URL tests to the automatic test suite (rather than requiring them to be run manually). * */Makefile.in: Regenerate using automake-1.4p6. * htcommon/URL.cc, htcommon/URL.h: Add new configuration attribute allow_double_slash to only remove // marks when requested (since some server-side code uses them), handle initial protocols without double slashes, and only remove the default doc string from appropriate protocol URLs (e.g. not file), treat ".//" as a relative path, and collapse /../ *after* // and /./ handling. * htcommon/defaults.cc: Add documentation for allow_double_slash, as well as various documentation cleanups. * htdig/ExternalTransport.cc: Fix minor bug--recognize service specified as https:// rather than https. * htdoc/hts_form.html, htdoc/hts_templates.html: Documentation fixes. * htsearch/htsearch.cc: Create valid boolean query if "exact" not specified in search_algorithms by adding the exact word with low weight. Solves PR#405294. Fri Oct 4 17:05:06 2002 Geoff Hutchison * htcommon/defaults.xml: Added first-draft XML version of defaults file. This will eventually be used to generate defaults.cc and documentation automatically. (As pointed out by Brian White, this will make the binaries smaller.) Wed Sep 25 13:56:31 2002 Gilles Detillieux * htdig/HTML.cc (parse): Fixed handling of JavaScript skipping so it doesn't get confused by "<" in code. Thu Sep 19 09:04:50 CEST 2002 Gabriele Bartolini * htnet/HtHTTP.cc : another check for cookie jar's null pointer Tue Sep 17 17:41:51 2002 Gilles Detillieux * htcommon/defaults.cc (external_protocols): Fixed table formatting as suggested by Lachlan Andrew. Thu Aug 29 21:21:34 CEST 2002 Soeren Vejrup Carlsen * htdig/Document.[h,cc]: first steps in FTP handling. HtFTP.h included and we now test for the 'ftp' protocol in the Document::Retrieve function. Has not yet been tested! * htnet/HtFTP.[h,cc]: added class to handle the FTP-protocol. Very experimental (has not been tested yet). Fri Aug 9 13:01:05 2002 Gilles Detillieux * httools/htnotify.cc (readPreAndPostamble): Check for empty strings in file names, not just NULL, as suggested by Martin Kraemer. Wed Aug 7 12:11:31 2002 Gilles Detillieux * htdig/ExternalParser.cc (parse): Fixed to impose max_doc_size restriction on external converter output which it reads in. Tue Aug 6 18:21:11 CEST 2002 Gabriele Bartolini * these changes were suggested by David Reed (thanks) * htdig/Document.cc: manage cookies via SSL * htnet/HtCookie.[h,cc]: features both RFC2109 and Netscape version * htnet/HtCookieJar.cc: ditto Tue Aug 6 17:12:22 CEST 2002 Gabriele Bartolini * htcommon/defaults.cc: added the 'http_proxy_authorization' attribute. Needs revision due to my usual *spaghetti* english. :-) * htdig/Document.[h,cc]: proxy authorization is now enabled Tue Aug 6 09:28:39 CEST 2002 Gabriele Bartolini * htnet/Connection.[h,cc]: IP address storing as string (sync with ht://Check) * htnet/Transport.[h,cc]: HTTP Proxy and Basic credentials handling moved here (ditto) through the use of a protected static method * htnet/HtHTTP.h: SetCredentials declared to be virtual (unnecessary because inherited, but gives better understanding); new method SetProxyCredentials for proxy authorization. * htnet/HtHTTP.cc: HTTP header Proxy-Authorization is now handled. The SetCredentials and SetProxyCredentials methods now make use of the Transport::SetHTTPBasicAccessAuthorizationString method, in order to write the string for negotiating the access. Fri Aug 2 15:40:18 2002 Gilles Detillieux * htdig/Document.cc (Retrieve): Allow redirects from HTTPSConnect. Tue Jul 30 12:46:56 2002 Gilles Detillieux * htlib/md5.cc: Added missing include of stdlib.h, as Geoff suggested. Sat Jul 27 11:57:25 2002 Geoff Hutchison * htnet/SSLConnection.cc: Add fix for segfault on SSL connections noticed by several users. Fix contributed by Andy Bach . Tue Jun 18 10:22:01 2002 Geoff Hutchison * htdig/Retriever.cc (got_word): Check that the word length meets the minimum word length before doing any processing. Fri Jun 14 17:26:21 2002 Gilles Detillieux * htsearch/Display.cc (buildMatchList), htsearch/HtURLSeedScore.cc (Match), htsearch/SplitMatches.cc (Match): Added Jim Cole's fix to bugs in handling of search_results_order. Wed May 15 09:45:40 CEST 2002 Gabriele Bartolini * htnet/Retriever.cc: fixed the bug regarding the server_wait_time feature after the maximum number of requests per connection has been reached. Tue Apr 9 16:41:33 CEST 2002 Gabriele Bartolini * htnet/HtCookie*.[h,cc]: RFC2109 compliant. * htlib/HtDateTime.[h,cc]: Add const-ness to the DiffTime static method Tue Apr 9 12:52:30 CEST 2002 Gabriele Bartolini * htnet/HtCookie.cc: fixed a bug regarding expiry date recognition Fri Apr 5 14:08:39 2002 Gilles Detillieux * htdig/ExternalTransport.cc (Request): Fixed to strip CR from header lines, output header lines with -vvv. Tue Mar 19 08:40:54 CET 2002 Gabriele Bartolini * htnet/HtCookie.cc: enhanced controls regarding the expires setting when no expires is returned. Prevents NULL pointer exceptions to be arisen. Mon Mar 18 11:28:02 CET 2002 Gabriele Bartolini * htlib/HtDateTime.h: added the copy constructor * htnet/HtCookie.cc: fixed a NULL pointer bug regarding 'datestring' management and HtDateTime copy constructor is now used Tue Mar 12 18:19:49 2002 Gilles Detillieux * htlib/HtDateTime.cc (Parse, SetFTime): Added Parse method for more flexible parsing of LOOSE/SHORT formats, use it in SetFTime. Also skip unexpected leading spaces in SetFTime, as these frequently cause problems with some strptime() implementations. Mon Feb 11 23:28:37 2002 Geoff Hutchison * htdig/Retriever.h (got_redirect): Add referer to properly handle broken links through a redirect as reported by Joe Jah. * htdig/Retriever.cc: As above. * htdig/Document.cc (Retrieve): Fix bug that prevented external transport methods from reporting redirects as reported by Jamie Anstice . * htlib/Dictionary.cc (hashCode): Trial of hash function suggested by Jamie Anstice. Sat Feb 9 18:06:29 2002 Geoff Hutchison * htsearch/DocMatch.[h,cc]: Add scoring code for the new htsearch framework. Thu Feb 7 11:32:14 2002 Gabriele Bartolini * htnet/HtHTTP.cc (ReadChunkedBody): gets control of Read_Line methods (return error when they fail). Fri Feb 1 17:12:31 2002 Geoff Hutchison * Merged htdig-3-2-x branch back into CVS mainline. * ChangeLog.0: Update with current 3.1.6 ChangeLog. Thu Jan 24 18:06:04 2002 Geoff Hutchison * configure.in, aclocal.m4: Use new CHECK_SSL macro from the autoconf archive. * configure: Generate via autoconf. Fri Jan 18 11:15:29 2002 Geoff Hutchison * htnet/Transport.h (class Transport): Add const to SetCredentials method declaration as pointed out by Roman Maeder. Wed Jan 16 13:35:26 2002 Geoff Hutchison * db/db.h.in: Add #include which seems to help problems of stat64 conflicts on Solaris as suggested by Gilles. Sat Jan 12 16:19:55 2002 Gilles Detillieux * htcommon/defaults.cc: A few changes to the wording and formatting of the 'accept_language' attribute description. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jan 11 21:18:00 CET 2002 Gabriele Bartolini * htcommon/defaults.cc: added the 'accept_language' attribute Fri Jan 11 20:53:36 CET 2002 Gabriele Bartolini * htnet/HtHTTP.[h,cc]: management of the accept-language directive added * htcommon/URL.[h,cc]: const-ness in copy constructor and other cosmetic changes * htlib/Server.[h,cc]: management of the 'accept_language' attribute as a server block configuration directive. * htlib/Document.cc: set of the attribute above for the HTTP layer Fri Jan 11 13:25:49 2002 Gilles Detillieux * htdig/ExternalTransport.cc (Request): Fixed to allocate access_time object before setting it. Fri Jan 4 12:31:34 2002 Gilles Detillieux * htnet/HtCookie.cc, htword/WordKeyInfo.cc, htword/WordMonitor.cc, test/search.cc: changed all uses of strcasecmp to mystrcasecmp for consistency and portability. Fri Jan 4 12:17:10 2002 Gilles Detillieux * htnet/HtHTTP.cc (HTTPRequest): make the second comparison of the transfer-encoding header the same as the first, i.e. case insensitive and limited to 7 characters. Fri Jan 4 15:13:13 CET 2002 Gabriele Bartolini * htnet/HtHTTP.cc: parse the transfer-encoding header as case insens. [fix htdig-Bugs-499388 by Matthias Emmert ] Sun Dec 30 15:47:35 CET 2001 Gabriele Bartolini * HtHTTP.[h,cc]: management of the Content-Language directive for the response Sat Dec 29 13:07:08 CET 2001 Gabriele Bartolini * htnet/HtCookie.[h,cc]: new fields (srcURL and isDomainValid) and a more robust class with initialization list and copy constructor * htnet/HtCookieJar.[h,cc]: method for calculating the minimum number of periods that a domain specification of a cookie must have. Depending on what the Netscape cookies specification says. * htnet/HtCookieMemJar.cc: Management of the domain field of the cookie Mon Dec 17 06:45:02 CET 2001 Gabriele Bartolini * htdig/htdig.cc: fixed bug about cookie jar creation. It is done in here, because there is only one jar for the whole process. However it can be moved anywhere else. :-) Mon Dec 17 06:40:25 CET 2001 Gabriele Bartolini * htnet/HtHTTP.cc: check for null pointer of cookie jar Sun Dec 16 19:55:07 CET 2001 Gabriele Bartolini * htnet/Connection.[h,cc]: default constructor is changed and accepts a socket value (by default is -1) * htnet/HtCookieJar.[h,cc]: added a simple iterator * htnet/HtCookieMemJar.[h,cc]: ditto * htnet/HtFile: removed the management of modification_time (constructor) * htnet/HtHTTP.[h,cc]: constructor with initilization list and without a default constructor (the construction is now forced to pass a valid connection object). Removed any memory deletion from the destructor. The class is now abstract (see the virtual pure destructor). * htnet/HtHTTPBasic.cc: creates a Connection object in the initialization and the destructor has no responsability * htnet/HtHTTPSecure.cc: creates an SSLConnection object in the initialization and the destructor has no responsability * htnet/HtNNTP.cc: creates a Connection object in the initialization and the destructor has no responsability * htnet/Transport.[h,cc]: default constructor accepts a pointer to a Connection object and the destructor carries out the deletion of it Thu Dec 6 13:24:30 2001 Gilles Detillieux * contrib/examples/rundig.sh: Fixed to make use of DBDIR variable, and to test for and copy db.words.db.work_weakcmpr if it's there. Fri Oct 19 11:07:33 2001 Gilles Detillieux * htdig/Retriever.cc (IsValidURL): Fixed discrepancies in debug levels for messages giving cause of rejection, inadvertantly changed when regex support added. Wed Oct 17 15:48:23 2001 Gilles Detillieux * htdig/ExternalTransport.h: Added missing class keyword on friend declaration. Tue Oct 16 14:35:16 2001 Gilles Detillieux * htcommon/default.cc (external_parsers): Documented external converter chaining to same content-type, e.g. text/html->text/html-internal. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Oct 15 22:25:55 2001 Geoff Hutchison * htdig/Document.cc, htdig/htdig.cc, htdig/Retriever.cc: Make sure setEscaped is called with the current value of case_sensitive. Fixes bug pointed out by Phil Glatz. Fri Oct 12 17:14:08 2001 Gilles Detillieux * htdoc/htdump.html, htdoc/htload.html: Fixed 3 little typos. Fri Oct 12 15:11:45 2001 Gilles Detillieux * htnet/HtHTTP.cc (ParseHeader): Show header lines in debugging output at verbosity level 3, not 4, for consistency with 3.1.x. * htcommon/URL.cc (removeIndex): Fixed to make sure the matched file name is at the end of the URL. Fri Oct 12 10:39:54 2001 Gilles Detillieux * htlib/HtRegexList.cc (setEscaped): Fixed to set compiled flag to FALSE when there's no pattern, so match() can detect this condition. Fixes handling of empty lists in bad_querystr, exclude_urls, etc. * htdig/Retriever.cc (IsValidURL): Fixed bad_querystr matching to look at right part of URL, not whole URL. Mon Sep 24 11:47:15 2001 Gilles Detillieux * htnet/HtHTTP.cc (SetRequestCommand): Put If-Modified-Since header out in GMT, not local time, and only put it out if existing document time > 0. * htsearch/parser.cc (perform_phrase): Optimized phrase search handling to use linear algorithm with Dictionary lookups instead of n**2 alg., as suggested by Toivo Pedaste. Tue Sep 18 10:50:40 2001 Gilles Detillieux * htdoc/running.html: New documentation on how to run after configuring. * htdoc/rundig.html: New manual page for rundig script. * htdoc/install.html: Added link to running.html. * htdoc/contents.html: Added link to running.html, rundig.html, related projects. Updated links to contrib and developer site. Fri Sep 14 22:12:56 2001 Gilles Detillieux * htcommon/URL.h: Moved DefaultPort() from private to public for use in HtHTTP.cc. Fri Sep 14 09:25:20 2001 Gilles Detillieux * htnet/HtHTTP.cc (SetRequestCommand): Add port to Host: header when port is not default, as per RFC2616(14.23). Fixes bug #459969. Sat Sep 8 22:15:33 2001 Geoff Hutchison * acconfig.h, include/htconfig.h.in: Add undef for ALLOW_INSECURE_CGI_CONFIG, which if defined does about what you'd expect. (This is for any wrapper authors who don't want to rewrite but are willing to run insecure.) * htsearch/htsearch.cc: Only allow the -c flag to work when REQUEST_METHOD is undefined. Fixes PR#458013. Tue Sep 4 18:58:31 2001 Geoff Hutchison * htsearch/DocMatch.cc: Add scoring for Quim's new parser framework. Only the normal word scoring is currently done, not backlink_factor or other "Document" methods. Fri Aug 31 15:34:28 2001 Gilles Detillieux * htdig/HTML.h, htdig/HTML.cc (ctor, parse, do_tag): Fixed buggy handling of nested tags that independently turn off indexing, so doesn't cancel tag. Add handling of tag. Added <> delim. to tag debugging output. Fixed a few typos. Wed Aug 29 10:33:01 2001 Gilles Detillieux * htcommon/defaults.cc (url_part_aliases): Added clarification explaining how to use example. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Aug 27 15:05:09 2001 Gilles Detillieux * installdir/search.html: Add DTD tag for HTML 4 compliance. * installdir/htdig.conf: Added .css to bad_extensions default, added missing closing ">". * htdoc/config.html: Updated with sample of latest htdig.conf and installdir/*.html. Wed Jul 25 22:16:06 2001 Gilles Detillieux * htcommon/defaults.cc: Put new htnotify_* entries in alphabetical order. Removed superfluous quotes from htnotify_webmaster example (htnotify.cc adds in the quotes). * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Tue Jul 24 16:07:01 2001 Gilles Detillieux * htcommon/defaults.cc: Changed references in (no_)page_number_text entries from maximum_pages to maximum_page_buttons. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Tue Jul 24 14:38:22 2001 Gilles Detillieux * htdoc/hts_templates.html: Document Quim Sanmarti's URL decoding feature for template variables. Thu Jul 12 14:12:02 2001 Gilles Detillieux * htnet/HtFile.cc (Request): Fixed so it doesn't remove newlines from documents, and so it only tries to open mime.types once even if the open fails. Thu Jul 12 11:40:07 2001 Gilles Detillieux * contrib/conv_doc.pl, contrib/parse_doc.pl: Fixed EOF handling in dehyphenation, fixed to handle %xx codes in title made from URL. * contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Fixed to handle %xx codes in URL title. Wed Jul 11 15:05:47 2001 Gilles Detillieux * htsearch/Display.cc (readFile): Added missing fclose() call, and debugging message for when file can't be opened. Wed Jul 11 14:26:28 2001 Gilles Detillieux * htsearch/Display.cc (displayParsedFile): Added debugging message when file can't be opened. * htseach/Display.cc (buildMatchList): Fixed while loop to avoid warning. * htsearch/htsearch.cc (main): Fixed handling of syntax error message to use String class instead of strdup(). * htsearch/parser.cc (setError): Added debugging message when error is set. * htsearch/parser.cc (parse): Fixed not to clear error message after it's set. Sat Jul 7 22:19:18 2001 Geoff Hutchison * */Makefile.in: Update using current production automake (1.4-p4). * htfuzzy/Regexp.[cc,h]: Change class name to Regexp to prevent further namespace clashes. * htfuzzy/Fuzzy.c: #include "Regexp.h" now and make sure we create the right class when needed. * htlib/mktime.c: Change included mktime declaration to mymktime to avoid conflict on Mac OS X. (For some reason, autoconf's AC_FUNC_MKTIME doesn't work for Mac OS X. So this is a hack in the meantime.) * htfuzzy/Makefile.am: Rename Regex files. Oops! Fri Jul 6 18:38:58 2001 Geoff Hutchison * htfuzzy/Regexp.cc, htfuzzy/Regexp.h: Rename Regex class to prevent problems on case-insensitive systems. * htlib/HtRegexReplaceList.cc, htlib/String.cc, htdig/htdig.cc: Change #include of to modern standard of iostream.h. * htlib/Configuration.cc (Read): Make sure we never reference a negative position when trimming off whitespace. * config.guess, config.sub: Update with new versions from GNU to recognize various flavors of Mac OS X/Rhapsody. * htlib/strptime.cc: Make sure len is initialized. Fri Jul 6 12:04:52 2001 Gilles Detillieux * htlib/HtRegexList.cc (setEscaped): Fixed a potential problem with list building. When we go back a step, we still have to compile the new pattern in case it's the last one. Wed Jul 4 23:39:19 2001 Gilles Detillieux * htcommon/URL.cc (parse, ServerAlias): Fixed two problems that caused incorrect signatures to be generated. Wed Jul 4 13:52:54 2001 Gilles Detillieux * test/document.cc (dodoc), test/url.cc (dourl), test/testnet.cc (Retrieve): Fixed up handling of config to match David Graff's changes of May 16, and handling of HtHTTPBasic class to match Joshua Gerth's changes of Mar 17. Tue Jul 3 16:20:56 2001 Gilles Detillieux * htdig/Retriever.cc (GetLocal): Fixed to use URL class on given URL, so that default port numbers are stripped off. This was needed to allow local fetching of robots.txt. * htnet/Connection.cc (ctors, dtor, Assign_Server, Get_Peername), htnet/Connection.h: Got rid of strdup stuff, used String class for peer & server_name. * htnet/Connection.cc (Get_PeerIP): Used unambiguous name for structure. * htnet/HtHTTP.cc (ctor, dtor): Don't allocate a 2nd Connection, as child classes already do this, and set pointer to null when connection is deleted, so we don't try to delete it twice. This was messing up the heap and causing segfaults. Call Transport::CloseConnection before deleting connection. * htnet/HtHTTPBasic.cc (dtor), htnet/HtHTTPSecure.cc (dtor), * htnet/HtNNTP.cc (dtor): Only delete connection if non-null, & set to null after deleting. Call Transport::CloseConnection before deleting connection. * htnet/Transport.cc (CloseConnection): Don't exit if connection pointer is null, as this may be normal when called from destructor. Fri Jun 29 11:14:36 2001 Gilles Detillieux * htfuzzy/Endings.cc (getWords): Undid change introduced in 3.1.3, in part. It now gets permutations of word whether or not it has a root, but it also gets permutations of one or more roots that the word has, based on a suggestion by Alexander Lebedev. * htfuzzy/EndingsDB.cc (createRoot): Fixed to handle words that have more than one root. * installdir/english.0: Removed P flag from wit, like and high, so they're not treated as roots of witness, likeness and highness, which are already in the dictionary. Mon Jun 25 12:50:47 2001 Gilles Detillieux * htsearch/htsearch.cc (main): Got rid of last remnants of 'urllist' and used the 'l' StringList as was used in the code before, to make restrict and exclude handling work properly. Mon Jun 25 15:52:19 CEST 2001 Gabriele Bartolini * htsearch/htsearch.cc: defined 'urllist' in order to remove the compilation error (as Jesse suggested). Fri Jun 22 16:28:13 2001 Gilles Detillieux * htsearch/Display.cc (buildMatchList): Fix date_factor calculation to avoid 32-bit int overflow after multiplication by 1000, and avoid repetitive time(0) call, as contributed by Marc Pohl. Also move the localtime() call up before gmtime() call, to avoid clobbering gmtime's returned static structure (my thinko). * htdig/htdig.cc (main): Use .work file for md5_db, if -a given, as contributed by Marc Pohl. * htcommon/URL.cc (constructURL): Ensure that the _host is set if we are constructing non-file urls, as contributed by Marc Pohl. * htdoc/THANKS.html: Credit Marc Pohl for patches. Tue Jun 19 17:14:05 2001 Gilles Detillieux * README: Bump up to 3.2.0b4, fix note about bug report submissions. Tue Jun 19 17:01:16 2001 Gilles Detillieux * htsearch/Display.cc (setVariables): Fixed handling of build_select_lists attribute, to deal with new restrict & exclude attributes. Mon Jun 18 12:16:27 2001 Gilles Detillieux * configure.in, configure: Fix "hdig" typo in help. Fri Jun 15 17:57:19 2001 Gilles Detillieux * htcommon/defaults.cc: Noted effect of locale setting on floating point numbers in search_algorithm and locale descriptions. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jun 15 15:36:51 2001 Gilles Detillieux * htdoc/cf_generate.pl: Fixed to handle new defaults.cc format with trailing backslashes. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jun 15 14:57:21 2001 Gilles Detillieux * htdb/htdb_dump.cc, htdb/htdb_load.cc, htdb/htdb_stat.cc: Added a conditional include of if HAVE_GETOPT_H is defined. Fri Jun 15 11:25:24 2001 Gilles Detillieux * htsearch/htsearch.cc (main), htcommon/defaults.cc, htdoc/hts_form.html: two new attributes, used by htsearch, have been added: restrict and exclude. They can now give more control to template customisation through configuration files, allowing to restrict or exclude URLs from search without passing any CGI variables (although this specification overrides the configuration one). Fri Jun 15 09:34:23 2001 Gilles Detillieux * htsearch/htsearch.cc (main): Changed ridiculously outdated question "Did you run htmerge?" to "Did you run htdig?". Fri Jun 8 11:07:04 2001 Geoff Hutchison * htsearch/Display.cc: Add header, now needed for RH 7.1. Thu Jun 7 12:05:09 2001 Gilles Detillieux * contrib/htdig-3.2.0.spec: Updated to 3.2.0b4. * contrib/README: Mention acroconv.pl script. Thu Jun 7 10:46:19 2001 Gilles Detillieux * htsearch/Display.cc (expandVariables): Use isalnum() instead of isalpha() to allow digits in variable names, allow '-' in variable names too for consistency with attribute name handling. Wed Jun 6 16:14:06 2001 Gilles Detillieux * httools/htpurge.cc (main): Added missing "u:" declaration in getopt() call. Wed Jun 6 15:24:04 2001 Gilles Detillieux * contrib/doc2html/DETAILS, contrib/doc2html/README, contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Update to version 3.0 of doc2html, contributed by David Adams . Wed May 16 11:23:04 2001 Geoff Hutchison Added a pile of changes contributed by David Graff fixing compilation problems with non-gcc/g++ compilers (i.e. Sun's compiler). * Makefile.config, db/Makefile.am: Added no-dependencies to AUTOMAKE_OPTIONS for those not on GNU C/C++ * configure.in: Changed AM_PROG_YACC to AC_PROG_YACC as autoconf and autoreconf both complain that AM_PROG_YACC is not in the library. * htcommon/DocumentDB.cc: Removed default parameters as they are already declared in the header * htcommon/HtConfiguration.cc: Changed some of the loop declarations so that Sparc C 4.2 is happy. Removed default parameters as they are already declared in the header Moved inline ParseString to header where it belongs. Added initialization for HtConfiguration::_config static member variable. Added implementation of HtConfiguration::config() static class member. * htcommon/HtConfiguration.h: Added include for ParsedString.h. Added declaration of static member function ::config(). Added private static member variable _config;. Added inline ParseString from implementation. * htcommon/HtURLCodec.cc, htcommon/HtURLRewriter.cc, htcommon/HtZlibCodec.cc, htcommon/URL.cc, htcommon/conf_lexer.lxx, htdig/Document.cc, htdig/ExternalParser.cc, htdig/ExternalTransport.cc, htdig/HTML.cc, htdig/Parsable.cc, htdig/Plaintext.cc, htdig/Retriever.cc, : Changed to use new global configuration semantics. * htcommon/conf_parser.yxx: Added a return to yyerror to quiet Sparc C 4.2. Should really return a value here. Is it normal to return a YY_something or just -1, 0, ? * htcommon/defaults.cc: Added line continuation characters at the end of all the string lines that did not completed by a quote. * htcommon/defaults.h, htdig/htdig.h: Removed extern HtConfiguation config in favor of HtConfiguration::config(). * htdig/ExternalTransport.h Changed return type of GetResponse to match superclass. * htdig/Server.cc, htdig/htdig.cc, htfuzzy/htfuzzy.cc, htnet/HtFile.cc, htsearch/Display.cc, htsearch/QueryLexer.cc, htsearch/WordSearcher.cc, htsearch/htsearch.cc, htsearch/parser.cc, htsearch/qtest.cc, httools/htdump.cc, httools/htload.cc, httools/htmerge.cc, httools/htnotify.cc, httools/htpurge.cc, httools/htstat.cc htlib/Configuration.cc, htlib/HtRegex.cc: Changed constructor to use initializers * htlib/HtDateTime.cc: Moved inlines to header * htlib/HtDateTime.h: Added inlines from implementation * htlib/HtHeap.cc, htlib/HtHeap.h, htlib/HtVector.cc, htlib/HtVector.h, htlib/HtVectorGeneric.h, htlib/HtVectorGenericCode.h: Changed Copy member to return same type as superclass * htlib/HtRegexReplace.cc, htlib/HtRegexReplaceList.cc: Removed default parameters as they are declared already in the header * htlib/myqsort.h: Changed comment in header to use C-style comments as it's compiled using a C. * htlib/regex.h: Changed #if __STDC__ to #if defined(__STDC__) * htword/WordKey.h: Corrected const'ness Wed May 9 07:50:19 CEST 2001 Gabriele Bartolini * htnet/HtCookieJar.h: ShowSummary makes the class abstract Sat May 5 20:51:00 2001 Geoff Hutchison * htdoc/cf_blocks.html: Add colon in example and description of blocks to match code for the moment. The parser can be changed later if we like. Sat May 5 20:38:44 2001 Geoff Hutchison * htlib/ParsedString.cc (get): Use isalnum() instead of isalpha() for looking up--allows names that contain digits too. Sat May 5 20:36:29 2001 Geoff Hutchison * htlib/htString.h (class String): Remove now-obsolete and confusing int() casting operator. This was previously used to make a string of a certain length. Use String(int) as a ctor instead. Sat May 5 20:30:18 2001 Geoff Hutchison * htword/WordContext.[h,cc]: Change Initialize to supply a config that can be modified (i.e. if we don't have ZLIB_H). Sat May 5 23:30:55 CEST 2001 Gabriele Bartolini * htnet/HtCookieJar.h: ShowSummary, printing cookies (to be derived) * htnet/HtCookieMemJar.[h,cc]: ShowSummary, printing cookies Thu May 3 23:14:14 CEST 2001 Gabriele Bartolini * htnet/HtHTTP[h,cc]: connection object is now created and destroyed. NULL pointers converted to C++ standard (0). * htnet/Transport[h,cc]: NULL pointers converted to C++ standard (0). * htnet/Connection[h,cc]: ditto Thu May 3 23:09:33 CEST 2001 Gabriele Bartolini * htlib/HtDateTime.[h,cc]: Timestamp format added (used by ht://Check for MySQL interfacing) - keeping them equal helps me maintaining both of them! Thu May 3 10:28:56 2001 Gilles Detillieux * htsearch/parser.cc (perform_and): Add missing return statement, as suggested by Quim Sanmarti. Fri Mar 30 15:50:42 2001 Gilles Detillieux * htsearch/ResultMatch.h, htsearch/ResultMatch.cc (setTitle): Changed argument type to char * to fix problem with sort by title not working, as reported by Adam Lewenberg. Fri Mar 30 14:08:51 2001 Gilles Detillieux * htdig/Document.h, htdig/Retriever.cc (parse_url): Define and use Document::StoredLength() method to get actual length of data retrieved and given to md5(), which may be less than original length. Fixes bug reported by Michael Haggerty. Wed Mar 21 22:22:55 2001 Geoff Hutchison * htsearch/Display.cc (generateStars): Add NSTARS variable for template output as suggested by Caleb Crome (except here precision is 0). Fixes feature request #405787. * htdoc/hts_templates.html: Add description of NSTARS variable above. * htlib/HtRegex.cc (set): Make sure we free memory if we've already compiled a pattern. * htdig/Retriever.cc (got_href): Fix bug pointed out by Gilles with hopcounts and don't bother to update the DocURL unless we have a new doc. Mon Mar 19 18:00:18 2001 Geoff Hutchison * htcommon/URL.cc (URL): Make sure even absolute relative URLs are run through normalizePath() as pointed out by Gilles. Allows backout of previous fix of #408586, which does extra re-parsing of URL. * htdig/Retriever.cc (Need2Get): Back out change of Mar. 17 for above. * htcommon/conf_lexer.[cxx, lxx]: Apply change suggested by Jesse to remove empty statements. Mon Mar 19 11:33:25 2001 Geoff Hutchison * htlib/HtRegexList.cc (setEscaped): Fix assorted bugs, including obvious segfault, incorrect creation of limits, and failure to set "compiled" flag before return(). * htdig/Retriever.cc (IsValidURL): Make sure the tmpList is cleared before attempting to parse the bad_querystr config--otherwise we'll just Add to the end of the list. Sun Mar 18 14:01:56 CET 2001 Gabriele Bartolini * htnet/Transport.[h,cc], htnet/HtHTTP.cc: In order to modularize the net code the default parser string for the content-type has been added to the Transport class. * htdig/Document.cc: modified for the changes above. Sat Mar 17 16:38:27 2001 Geoff Hutchison * configure.in, configure, include/htconfig.h.in: Add tests for libssl, libcrypto, and ssl.h. * htnet/SSLConnection.[cc,h], htnet/HtHTTPBasic.[cc,h], htnet/HTTPSecure.[cc,h]: New files. Contributed by Joshua Gerth . * htnet/Transport.[cc,h], htnet/HtNTTP.cc, htnet/HtHTTP.cc, htnet/Connection.h: Changes needed to support SSLConnection class. * htdig/Document.cc, htdig/Document.h: Ditto. * htnet/Makefile.am, htnet/Makefile.in: Add above for compilation. * htdoc/THANKS.html: Updated with new contributors. Sat Mar 17 15:28:20 2001 Geoff Hutchison * htword/WordContext.cc (Initialize): If HAVE_LIBZ or HAVE_ZLIB_H are not defined, make sure wordlist_compress is set to false. This semi-hack will not be necessary with new mifluz code which does not necessary need zlib. Fixes bug #405761. Sat Mar 17 14:39:17 2001 Geoff Hutchison * htdig/HTML.cc (do_tag): Fixed problems with META descriptions containing newlines, returns or tabs. They are now replaced with spaces. Fixes bug #405771. Sat Mar 17 14:26:55 2001 Geoff Hutchison * htdig/HTML.cc (do_tag): Improve handling of whitespace in META refresh handling. Fixes bug #406244. * htlib/HtRegexList.cc (setEscaped): Make this more efficient by building up larger and larger patterns--when we fail, go back a step and add the pattern in the next loop. This ensures we have a list of the maximum allowable length regexp. * htdig/Retriever.cc (Need2Get): Add change suggested by Yariv Tal to run URLs through the URL parser for cleanup before comparing to the visited list. Fixes bug #408586. Mon Mar 12 13:28:56 2001 Michael Haggerty * htdig/Retriever.cc, htdig/Retriever.h: Fixed two off-by-one errors related to Retriever::factor table. Mon Mar 12 11:25:31 2001 Geoff Hutchison * htlib/Dictionary.cc (Add): Fix comments about add method--it will replace existing keys. Fixes report #407940. Thu Mar 8 15:31:45 2001 Gabriele Bartolini * htnet/HtHTTP.cc: removed an unuseful Tue Mar 6 11:42:10 2001 Geoff Hutchison * htlib/regex.[c,h]: Update with versions from glibc 2.2.2. Mon Mar 5 13:47:30 2001 Geoff Hutchison * ltconfig (host_os): Add test to solve problems building C++ shared libraries on some platforms. Currently should only make --enable-shared the default on Linux and *BSD* unless specified explicitly by the user. Mon Mar 5 12:52:57 2001 Geoff Hutchison * htlib/String.cc (operator =): Add fix contributed by Yariv Tal , fixed bug #406075. Mon Mar 5 12:06:26 2001 Geoff Hutchison * htlib/HtRegexList.cc (match): Ignore rearrangement code for the moment--may or may not be the culprit for bug #405277, but is a start to debugging the problem. * htlib/List.[cc,h]: Remove *prev pointer from listnode structure and add a *prev pointer to the cursor structure. Saves one pointer per item in the list, plus overhead. Mon Mar 5 11:56:16 2001 Geoff Hutchison * htcommon/defaults.cc (bad_extensions): Add .css to ignore CSS docs. * htdig/Document.cc (getParsable): Ignore CSS documents -- they aren't very useful to parse. Solves bug report #405772. Sun Mar 04 11:32:43 2001 Gabriele Bartolini * htnet/HtHTTP.cc: fixed a bug regarding with persistent connections enabled, but head call before the get one disabled. Sourceforge.net's bug reference: 405275 - fixed. Sat Mar 3 21:09:55 2001 Geoff Hutchison * .version: Bump to 3.2.0b4 so snapshots have right versioning. Thu Mar 1 16:51:09 2001 Geoff Hutchison * configure.in: Added test for alloca.h, which is needed for the regex.c code. Wed Feb 28 12:54:43 CEST 2001 Gabriele Bartolini * htcommon/defaults.cc: 'disable_cookies' option has been added, with a 'server' scope. By default it is set to 'false'. * htdig/Server.h, cc: management of the option above has been enhanced. * htnet/HtHTTP.h, cc: now an HTTP connection can disable/enable cookies through the configuration attribute 'disable_cookies'. * htdig/Document.cc: management of cookies enabling/disabling is here. * Cookies classes: now support the expiration time. Need only the subdomain treatment. Mon Feb 26 16:37:30 2001 Geoff Hutchison * htcommon/conf_lexer.lxx: Don't directly call exit(1) on an error condition! Seems a harsh problem for an unknown character. * htcommon/conf_parser.yxx: Ditto. (Running out of memory is a much more fatal condition, of course.) * htcommon/conf_lexer.cxx: Regenerate using flex 2.5.4. * htcommon/conf_parser.cxx: Regenerate using bison 1.28. Sun Feb 25 19:46:01 CEST 2001 Gabriele Bartolini * htnet/HtHTTP.h, cc: support for cookies enabled * htnet/Makefile.am: files for cookies have been added to make. Sun Feb 25 19:27:18 CEST 2001 Gabriele Bartolini * htnet/HtCookie.h,cc: class HTTP cookie * htnet/HtCookieJar.h,cc: abstract class for managing the 'jar' of cookies. In this way, we can use different methods for the storage of them. * htnet/HtCookieMemJar.h,cc: class for managing the 'jar' of cookies in memory, without persistent storage (no db or file). * Many thanks to Robert LaFerla for his coding on this! Yeah, really really thanks Robert! Thu Feb 22 16:43:18 2001 Geoff Hutchison * htdoc/ChangeLog, htdig/RELEASE.html, README: Update to roll the release of 3.2.0b3. Thu Feb 22 16:22:05 2001 Gilles Detillieux * htsearch/htsearch.cc (main), htsearch/Display.cc (setVariables, createURL, buildMatchList), htdoc/hts_form.html, htdoc/hts_templates.html: Add Mike Grommet's date range search feature. Mon Feb 19 18:24:42 2001 Geoff Hutchison * htfuzzy/Synonym.cc (createDB): Create database in a temporary directory before we move it into place, much like the endings code. This should prevent problems when we just append to the DB instead of making a new one. * htdig/htdig.cc (main): Fix bug discovered by Gilles--htword should be initialized *after* we are finished modifying config attributes based on flags and unlink with -i. * installdir/rundig: Fix bug with calling htpurge with -s option. Thu Feb 15 11:03:42 2001 Geoff Hutchison * htdoc/*.html: Update with 2001 copyrights and various changes with the website move for the pending 3.2.0b3 release. Thu Feb 15 10:41:47 2001 Geoff Hutchison * htlib/HtRegexList.cc (match): Fix thinko with logic for matching and add code to rearrange matching nodes for hopefully better performance. Sun Feb 11 16:42:11 2001 Geoff Hutchison * htlib/HtRegexList.h, htlib/HtRegexList.cc (class HtRegexList): Simple List(HtRegex) object with similar calling conventions to HtRegex class. This version is not as sophisticated as it could be, but it's not likely to drop objects when reorganizing. * htlib/Makefile.[in,am]: Add HtRegexList files to list for compilation. * htdig/htdig.h, htdig/htdig.cc, htdig/Retriever.cc: Use HtRegexList instead of HtRegex for setting escaped values--should never fail (since each String item is short). * htlib/HtDateTime.cc: Put back timezone specs into the output formats so we give everything even if we ignore it when reading input. Mon Feb 5 11:47:07 2001 Geoff Hutchison * htlib/HtDateTime.cc: Remove the timezone specs in the date formats--these are not required in the RFCs because many dates are in GMT anyway. Wed Jan 17 08:48:30 2001 Gilles Detillieux * htdig/ExternalTransport.cc (Request): Oops, fixed a holdover from code borrowed from ExternalParser.cc's fork handling. Mon Jan 15 23:09:37 2001 Geoff Hutchison * htnet/Connection.cc: Back out previous change--this should not in any way be needed since the configure script should set FD_SET_T. * configure.in, configure: Add more lenient prototyping for select() test--now allows "const struct timeval" for compilation on BSDI. * htdoc/RELEASE.html: Update with Gilles's changes. * htdoc/cf_blocks.html: New file describing and blocks. * htdoc/cf_general.html, htdoc/confmenu.html: Refer to the above. Mon Jan 15 17:46:07 2001 Gilles Detillieux * htsearch/TemplateList.cc (createFromString), htcommon/defaults.cc: Treat template_map as a _quoted_ string list. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Jan 15 17:40:45 2001 Gilles Detillieux * htdoc/hts_templates.html: Add METADESCRIPTION variable. * htsearch/Display.cc (displayMatch): Add METADESCRIPTION variable. * htdig/ExternalParser.cc (parse): Fix up handling of arguments. * htdig/ExternalTransport.cc (Request): Fix up handling of fork/exec and command arguments, add wait() call. Wed Jan 10 19:23:36 2001 Gilles Detillieux * installdir/rundig: Fix -a handling to move db.words.db.work_weakcmpr into place if it exists Sat Jan 6 21:50:58 2001 Geoff Hutchison * configure.in: Add checks for and for ExternalParser. * include/htconfig.h.in: Regenerate using autoheader. * configure: Regenerate using configure. * htnet/Connection.cc: Add definition for FD_SET_T to fix problems compiling on BSDI mentioned by Joe. * htdig/ExternalParser.cc: Use or as appropriate. Should fix problems with compiliation mentioned by Jesse on HP/UX. * README, htdoc/RELEASE.html: Adjust dates for the new year. * htdoc/upgrade.html: A few "remaining features" have been implemented. Sun Dec 06 19:46:15 CEST 2000 Gabriele Bartolini * htnet/HtHTTP.cc: Fixed bug for Read_Line function call in ReadChunkedBody method. Many thanks to Robert LaFerla. ;-) Tue Dec 12 13:24:49 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Fixed to properly handle binary output from an external converter. Fixed some compilation errors. Tue Dec 12 12:52:14 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Handle parser command string as a string list again to allow arguments, build up argv and use execv instead of execl. Tue Dec 12 12:25:04 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Add call to wait for child process, to avoid zombie buildup. Mon Dec 11 23:57:43 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Fix up handling of fds in child process, more fault-tolerant handling of pipe or fork errors. Mon Dec 11 23:30:55 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Fix up handling of creation of temporary file, check for proper return code, give error if appropriate. Mon Dec 11 23:19:28 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Lowercase content-types and strip off any trailing semicolons, at one last spot. This reinserts code added Sep 11, which was dropped Oct 9, probably inadvertantly during mifluz back-out. Sun Dec 10 15:28:44 2000 Geoff Hutchison * htdig/ExternalTransport.cc: Use fork/exec instead of calling popen, which bypasses any shell escape problems. * htdig/ExternalParser.cc: Ditto, plus use of mkstemp where available to pick the filename. * configure, configure.in: Check for mkstemp where available. * include/htconfig.h.in: Define it as above. * htlib/Makefile.am: Omit regex.c from SOURCES--this is included when necessary by the configure script. Otherwise this produces duplicate declarations, etc. * htlib/Makefile.in: Regenerate using automake --foreign. * htcommon/URL.cc: Fix bug with ports of 0 showing up in URLs like mailto: or other less-common protocols. Fri Dec 1 14:45:33 2000 Gilles Detillieux * contrib/htdig-3.2.0.spec: Updated to 3.2.0b3. Fri Dec 1 13:59:09 2000 Gilles Detillieux * htlib/Makefile.am: Fix pkginclude_HEADERS to list missing headers ber.h, libdefs.h, myqsort.h, mhash_md5.h, omit unneeded langinfo.h; fix libht_la_SOURCES to list missing sources regex.c, myqsort.c. * htlib/Makefile.in: Regenerate using automake --foreign * htlib/langinfo.h, htlib/nl_types.h: Removed as they're now unused. Fri Dec 1 13:22:47 2000 Gilles Detillieux * htlib/strptime.cc (mystrptime): make ptr const and use cast on return value to avoid warnings. * htlib/Makefile.am: Fix pkginclude_HEADERS to list HtRegexReplace*.h rather than .cc. * htlib/Makefile.in: Regenerate using automake --foreign Fri Dec 1 11:58:21 2000 Gilles Detillieux * Makefile.in, [hit]*/Makefile.in: Regenerate using automake --foreign after fixing bug with cp -pr in automake. Thu Nov 30 14:41:58 2000 Gilles Detillieux * htdoc/Makefile.am: Removed howitworks.html from EXTRA_DIST. * Makefile.in (distdir): Added missing variable name 'd' to cp -pr. Thu Nov 30 14:01:48 2000 Gilles Detillieux * htlib/strptime.cc, htlib/lib.h: make first 2 args to strptime const to avoid warnings, use cast in asizeof to avoid warnings. * htsearch/qtest.cc: Change include from iostream to iostream.h * htsearch/DocMatch.cc: Change include from iostream to iostream.h * htsearch/Display.cc (createURL, buildMatchList, excerpt, hilight): Clean up code to get rid of warnings, especially resulting from NULLs in ternary operators. Thu Nov 30 10:55:09 2000 Gilles Detillieux * htlib/String_fmt.cc (form, vform): Use vsnprintf rather than vsprintf, for buffer overflow prevention if vsnprintf available. * htdig/Retriever.cc: Remove unused strptime declaration. * htlib/HtDateTime.cc: Use mystrptime if HAVE_STRPTIME not set. Wed Nov 29 23:31:10 2000 Geoff Hutchison * htdb/htdb_stat.cc, htdb_load.cc, htdb_dump.cc: Make sure we include htconfig.h to include proper declarations. * htlib/strptime.cc: Change to strptime.cc, from htdig-3.1 series hopefully more portable until I can find a more suitable replacement. * htlib/Makefile.am, htlib/Makefile.in: As above. * htlib/clib.h, htlib/lib.h: Ditto. * htdoc/all.html: Add a first draft of program summaries. Wed Nov 29 18:00:15 2000 Gilles Detillieux * htdig/Retriever.cc (parse_url): Remove undeclared "dup" variable, add missing calls to words.Skip(). Wed Nov 29 17:44:56 2000 Gilles Detillieux * htdig/htdig.html: Add description of -v output. Mon Nov 27 12:03:34 2000 Gilles Detillieux * htlib/md5.cc: Added missing include of time.h Fri Nov 24 00:56:01 2000 Toivo Pedaste * htsearch/Display.cc: Some extra debugging for scoring Sun Nov 19 00:56:01 2000 Geoff Hutchison * htnet/HtFile.cc (Request): Use opendir/readdir instead of scandir for generating directory listings on-the-fly. * htdoc/RELEASE.html: Write up release notes for 3.2.0b3. * htdoc/THANKS.html: Update list of contributors for 3.2.0b3 as current. Fri Nov 17 14:52:37 2000 Gilles Detillieux * contrib/acroconv.pl: Added external converter script to convert PDFs with acroread. Mon Nov 6 12:13:13 2000 Gilles Detillieux * htdig/Retriever.cc (GetLocal, GetLocalUser): move String definition out of while statement for AIX xlC compiler. Mon Oct 30 21:50:02 2000 Geoff Hutchison * htdig/Server.h, htdig/Server.cc (push): Add newDoc paramter that will allow redirects (old docs) to be followed and not count against the maxDoc restrictions. * htdig/Retriever.cc (got_redirect): Use new parameter so we don't count against a server's max documents since it's a redirect. * htlib/nl_types.h: Add for systems missing this header file. Sun Oct 29 21:36:51 2000 Geoff Hutchison * htcommon/defaults.cc: Updated per-server and per-URL fields to match code. I still have a "wish list" of additional attributes that should work this way eventually. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Sun Oct 22 17:13:08 2000 Geoff Hutchison * htcommon/HtWordList.h: Add missing include for stdlib.h needed for abort(). * htsearch/BooleanQueryParser.cc (ParseAnd): Fix problems with RH7 compiler -- shouldn't use "not" as a variable name! Thu Oct 19 22:19:16 2000 Geoff Hutchison * ltmain.sh, ltconfig: Update with versions from libtool 1.3.5. which may fix some problems building libraries. Mon Oct 9 21:59:11 2000 Geoff Hutchison * */* [many, many files]: Backed out mifluz merge by going back on modified files to 091000 snapshot. * configure: Regenerated from configure.in. * */Makefile.in: Regenerated using automake. Fri Oct 6 11:03:14 2000 Gilles Detillieux * htdig/HTML.cc (do_tag): Parse tags properly, looking for data= attribute rather than src=. * htcommon/defaults.cc (server_aliases): Additional clarification to server_aliases description of port numbers. Wed Oct 4 12:12:31 2000 Gilles Detillieux * htcommon/defaults.cc (limit_normalized, server_aliases, server_max_docs, server_wait_time): Added clarification to server_aliases description. Changed word "directive" to "attribute" where appropriate. Added cross-link to server_aliases from limit_normalized. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Wed Sep 27 00:05:41 2000 Geoff Hutchison * htdb/mifluz[dict, dump, load].cc, htdb/util_sig.h, htdb/util_sig.cc: New files from mifluz merge. (Whoops, missed a directory). * htdb/*.cc: Change config.h references to htconfig.h. * htlib/myqsort.c: Ditto. * htcommon/HtWordReference.h, htcommon/HtWordReference.cc: Ensure we keep the WordContext object around--unfortunately this also requires that callers initialize us with a WordContext (e.g. from the HtWordList class). * htlib/StringMatch.h, htlib/StringMatch.cc: Changes to use WordType directly instead of HtWordType. * htfuzzy/*: Ditto. Additionally make sure HtWordReference objects are intstantiated properly. * htcommon/DocumentRef.cc, htcommon/HtWordList.cc: As above. * htdig/*: As above. * htsearch/*: As above. * httools/*: Don't bother initializing WordContext--this is done in the HtWordList class now. * htdig/htdig.cc: Ditto. * htsearch/htsearch.cc, htsearch/qtest.cc: Ditto. * htfuzzy/htfuzzy.cc: Ditto. * db/Makefile.am, db/Makefile.in: Update to build libhtdb instead of libdb to prevent conflicts. Sun Sep 24 22:50:22 2000 Geoff Hutchison * htword/HtWordList.h, htword/HtWordList.cc: Keep a WordContext object private that is associated with this word database and provide accessor. * htword/WordType.h, htword/WordType.cc: Add WordToken function, migrated from HtWordType class. * htcommon/HtWordType.cc: WordType class no longer has Instance() method, so just pass along the calls. * htlib/DB2_db.cc (db_init): Remove unnecessary NULL parameter. * htlib/Makefile.am, htlib/Makefile.in: Remove HtVectorGeneric and derived files as well as HtWordType as these are depreciated. Wed Sep 20 22:47:01 2000 Geoff Hutchison * aclocal.m4: Add in missing autoconf macros that somehow didn't make the merge before. (No idea why I didn't catch this earlier.) * acinclude.m4: Use newer CHECK_ZLIB macro. * */Makefile.in: Updated with automake for new build changes. * configure, include/htconfig.h.in: Updated using autoconf. * test/dbbench.cc, test/word.cc, test/search.cc: Fix #include to point to htconfig.h not non-existant config.h. * htlib/Configuration.h: Fix copy ctor, removing code in header file. * htword/*.cc: Ditto. * htword/Makefile.am: Update from mifluz version. * htlib/myqsort.h, htlib/myqsort.c: Additional system library replacement code. Sat Sep 16 20:14:32 2000 Geoff Hutchison * configure.in, configure, acinclude.m4, aclocal.m4, acconfig.h, include/htconfig.h.in: Merged with mifluz versions. Main difference is that top-level configure script now also configures db/ directory as well. * Makefile.am, */Makefile.in: Updated with automake for new build environment (with db/ run through top-level configure). * db/*.c: Updated to use htconfig.h instead of config.h. Wed Sep 13 22:05:33 2000 Geoff Hutchison * Merged in mifluz-0.19 branch. Everything will break temporarily. Loic and I will clean up tomorrow. * htdoc/RELEASE.html, htdoc/THANKS.html, htdoc/TODO.html: Get a start on updting these files for the next release. * htdoc/cf_generate.pl: Revert change of Sep. 9 to ignore links to all.html in cf_byprog.html file. * htdoc/all.html: New file, moved from howitworks.html and not updated yet. * htdoc/contents.html: Change link from howitworks.html to all.html Tue Sep 12 17:00:00 CEST 2000 Quim Sanmarti * htsearch: added AndQuery.cc BooleanLexer.cc BooleanQueryParser.cc ExactWordQuery.cc GParser.cc NearQuery.cc NotQuery.cc OperatorQuery.cc OrFuzzyExpander.cc OrQuery.cc PhraseQuery.cc Query.cc QueryLexer.cc QueryParser.cc SimpleQueryParser.cc VolatileCache.cc WordSearcher.cc qtest.cc WordSearcher.h AndQuery.h AndQueryParser.h BooleanLexer.h BooleanQueryParser.h ExactWordQuery.h FuzzyExpander.h GParser.h NearQuery.h NotQuery.h OperatorQuery.h OrFuzzyExpander.h OrQuery.h OrQueryParser.h PhraseQuery.h Query.h QueryCache.h QueryLexer.h QueryParser.h SimpleLexer.h SimpleQueryParser.h VolatileCache.h. This is the new query parsing/evaluation framework. * Modified DocMatch.{cc,h} and ResultList.{cc,h} for compatibility. * Removed the previous {And,Or,Exact,}ParseTree.{cc,h} files. * Modified Makefile.{am,in} consequently. Mon Sep 11 11:56:44 2000 Gilles Detillieux * htdig/ExternalParser.cc (parse): Lowercase content-types and strip off any trailing semicolons, at one last spot which Geoff missed. Sat Sep 9 21:28:29 2000 Geoff Hutchison * htdig/Document.cc (getParsable): Fix a bug with earlier change--if no parser is found and the MIME type is not text/* then return a NULL parser. * htdig/Retriever.cc (RetrievedDocument): If a NULL parser is returned, mark the document as noindex and move on. * configure.in, configure (enable-tests): Fix bug that would run the 'yes' program inside the configure script if --enable-tests was set. Sat Sep 9 17:50:11 2000 Geoff Hutchison * htcommon/defaults.cc: Add "all" program listing for common attributes--seems more logical esp. now with many httool programs. * htdoc/cf_generate.pl (cf_byprog): Do not output a link when 'prog' is 'all.' * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Sat Sep 9 11:44:47 2000 Geoff Hutchison * aclocal.m4 (AM_CHECK_YACC): New macro to check for bison/yacc and use "missing yacc" if not found. * configure.in (enable_tests): Fix buglet where --enable-tests=no or --disable-tests would not work and set the default to enabled tests. Since the tests do not build unless the user does a "make check" this should not be confusing and should help debugging. Also use AM_CHECK_YACC instead of AC_CHECK_YACC. * configure: Regenerate using autoconf. Sat Sep 9 11:01:03 2000 Geoff Hutchison * htdig/ExternalParser.cc (canParse): Lowercase content-types and strip off any trailing semicolons. Should prevent problems with combined content-type; charset values. (ctor): As above. * htdig/Document.cc (getParsable): Only assume plain text if MIME code starts with text/. Should prevent problems with retrieving things like image/png or application/postscript as text. Fri Sep 8 22:59:10 2000 Geoff Hutchison * htcommon/defaults.cc: Add new attributes htnotify_replyto, htnotify_webmaster, htnotify_prefix_file, htnotify_suffix_file. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. * httools/htnotify.cc: Added in code from Richard Beton to collect multiple URLs per e-mail address and allow customization of notification messages by reading in header/footer text as designated by the new attributes above. Fri Sep 8 15:15:00 2000 Quim Sanmarti * htsearch/Display.cc: Fixed tiny date_format bug; added url-decoding template variable expansion. Thu Sep 7 23:45:25 2000 Geoff Hutchison * htdig/Retriever.cc (Retriever): Only open up md5 database if check_unique_md5 attribute is set. Thu Sep 7 22:56:19 2000 Geoff Hutchison * htcommon/URL.cc (DefaultPort): Add file default port of 0. * htnet/HtFile.cc (Request): Handle directory listings by using scandir and generating minimal HTML file with appropriate noindex listing. Wed Sep 06 10:00:50 CEST 2000 Gabriele Bartolini * htlib/URL.h, htlib/URL.cc: Restored corrected versions of URL.* * htnet/HtNNTP.h: Removed the error in the NNTP class declaration Mon Sep 04 13:43:40 CEST 2000 Gabriele Bartolini * htnet/HtHTTP.cc: Restored previous version of HtHTTP. I removed an initialization in the constructor (_modification_time). Sorry. Sun Sep 3 16:51:24 2000 Geoff Hutchison * htdig/Retriever.cc, htdig/Server.cc: Fix compiler warnings about String conversions. * configure, configure.in, db/configure, db/configure.in, db/acinclude.m4, db/aclocal.m4: Ensure --enable-bigfile is handled correctly by the configure scripts as pointed out by Jesse. Fri Sep 01 23:28:43 CEST 2000 Gabriele Bartolini * URL.cc: added DefaultPort() method and changed NNTP default port from 523 to 119. * Document.cc: management of NNTP documents retrieval. Fri Sep 01 19:05:02 CEST 2000 Gabriele Bartolini * htnet/HtNNTP.* : just created them ... * htnet/HtHTTP.cc : removed modification_time deletion in the class destructor. Thu Sep 01 12:00:00 2000 Toivo Pedaste * htdig/Retriever.cc: Allow for modify time being set to current time if not available. Thu Aug 31 13:21:12 2000 Gilles Detillieux * htcommon/defaults.cc (allow_in_form, build_select_lists): Add clearer instructions to allow_in_form description, add cross-links between these two sections. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Wed Aug 30 10:01:59 CEST 2000 Gabriele Bartolini * substition of char * returned types to const String & in URL and Server classes. This change made me do lots of changes in other files: HtFile.cc, HtHTTP.cc, HtConfiguration.*, Document.*, ExternalParser.*, Retriever.*. Tue Aug 30 12:00:00 2000 Toivo Pedaste * htlibs/md5.cc, htlibs/md5.h: Generate md5 hash of a page and also optionally the modify date. * htlibs/mhash_md5.h, htlibs/mhash_md5.c, htlibs/libdefs.h: Md5 hash code from libmhash * htdig/Retriever.cc: Allow storing m5 hashes of pages in order to reject aliases. * htcommon/defaults.cc: Options "check_unique_md5" and "check_unique_date" Tue Aug 29 08:51:39 2000 Geoff Hutchison * htdoc/upgrade.html: Add description of the difference between htmerge and htpurge. Mention other httools. * htsearch/parser.cc, htsearch/parser.h: Merge in patch by Quim Sanmarti to fix problems with phrase searching and AND searches and improve performance. Sun Aug 27 22:41:10 2000 Geoff Hutchison * htsearch/AndParseTree.cc, htsearch/OrParseTree.cc (Parse): Rewrote using new WordToken inherited method. Fixes a bug where user input two phrases next to each other. * htsearch/ParseTree.cc (Parse): Fix bug where phrases would "adsorb" prior query words. Also fix bug where operators were incorrectly popped off the stack. Should (hopefully) solve all parsing problems. * htsearch/*ParseTree.cc (GetLogicalWords): Test for empty list of children to prevent potential segfault. Sat Aug 26 18:40:50 2000 Geoff Hutchison * installdir/{syntax, header, footer, wrapper, nomatch}.html: Add DTD tags, ALT attributes and remove bogus tags to fix invalid HTML pointed out in PR#901. Wed Aug 23 23:39:18 2000 Geoff Hutchison * htsearch/ParseTree.cc (Parse): Get rid of compiler warnings, use new private tokenizer to ensure parens and quote aren't removed. Also, when popping an operator off the parens stack, make sure it's adopted by a new ParseTree object so we get the parens back in the tree heirarchy. Wed Aug 23 23:34:44 2000 Geoff Hutchison * htsearch/AndParseTree.cc (Parse): Fix nasty infinite loop when phrases hit in AND searches. * htsearch/OrParseTree.cc (Parse): Ditto. Wed Aug 23 13:24:31 CEST 2000 Gabriele Bartolini * htnet/HtHTTP.*, htnet/Transport.h: all 'char *', when possibile, have been changed into 'const String &' types. Sun Aug 20 23:25:01 2000 Geoff Hutchison * httools/htpurge.cc (purgeDocs): Add error message when document database is completely empty. Should take care of PR#672 (and others). Sun Aug 20 20:37:53 2000 Geoff Hutchison * htlib/HtRegex.h, htlib/HtRegex.cc: Made destructor virtual, added lastError() and associated support. Changed return type of set*() to int. They now return the value of |compiled|. * htcommon/defaults.cc (url_rewrite_rules): Add new attribute to support patch by Andy Armstrong for permanent URL rewriting. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. * htlib/HtRegexReplace.cc, htlib/HtRegexReplaceList.cc, htlib/HtRegexReplace.h, htlib/HtRegexReplaceList.h, htcommon/HtURLRewriter.cc, htcommon/HtURLRewriter.h: New classes. * htcommon/Makefile.am, htcommon/Makefile.in: Add compilation for HtURLRewriter. * htlib/Makefile.am, htcommon/Makefile.in: Ditto for HtRegexReplace* * htcommon/URL.h, htcommon/URL.cc (rewrite): New method for transforming URLs based on HtURLRewriter. * htdig/Retriever.cc (got_href): Rewrite the URL before we do anything with it. * htdig/htdig.cc: Include HtURLRewriter headers and check rewrite rules for errors. Sat Aug 19 17:01:36 2000 Gilles Detillieux * htcommon/conf_lexer.lxx: Patched to fix the bug with relative filename includes. Keeps a separate stack with the filenames and adjusts accordingly. * htcommon/conf_lexer.cxx: Updated using flex 2.5.4. Thu Aug 17 23:59:26 2000 Gilles Detillieux * htcommon/conf_lexer.lxx: Patched to fix a bug reported by Abel Deuring -- config filename stack was decremented too many times. * htcommon/conf_lexer.cxx: Updated using flex 2.5.4. Thu Aug 17 23:40:08 2000 Geoff Hutchison * htword/WordType.h (WordToken): Add non-destructive version of HtWordToken using a passed int as a pointer into the string. Add virtual destructor so class can be sub-classed. * htword/WordType.cc (WordToken): Implement it. * httools/htmerge.cc (mergeDB): Back out change of Aug. 9th -- WordSearchDescription has disappeared from htword interfaces. Should be restored when Loic comes back and can suggest an alternative. Thu Aug 17 16:59:05 2000 Gilles Detillieux * htsearch/Display.cc (createURL): Get rid of extra "config=" parameter that was inserted before collections stuff. Thu Aug 17 15:47:58 CEST 2000 Gabriele Bartolini * htnet/HtHTTP.cc: ask again for a document after a response is given by the HTTPRequest() method. Thu Aug 17 12:25:33 CEST 2000 Gabriele Bartolini * htnet/HtHTTP.*, htnet/Transport.* : fixed bug with HTTP/1.1 management. Now the "Connection: close" directive is handled and force the connection to be closed. So the bug has now been fixed. Fixed other minor bugs and strings initializations. Tue Aug 15 00:24:33 2000 Geoff Hutchison * contrib/multidig/Makefile, gen-collect, db.conf, multidig.conf: Add missing trailing newlines as pointed out by Doug Moran . * contrib/multidig/Makefile (install): Make sure scripts have a+x permissions. Pointed out by Doug Moran. * contrib/multidig/new-collect: Fix typo to ensure MULTIDIG_CONF is set correctly. Sun Aug 13 23:17:30 2000 Geoff Hutchison * htdig/Server.h, htdig/Server.cc (Server): Add support for per-server user_agent configuration. * htdig/Document.cc (Retrieve): Ditto. * httools/htpurge.cc (purgeDocs): Set remove_* attributes on a per-server basis. * htcommon/defaults.cc: Fix remove_bad_urls and remove_unretrieved_urls to point to htpurge and not htmerge. Sat Aug 12 23:03:32 2000 Geoff Hutchison * htdoc/cf_generate.pl (html_escape): Fix mindless thinko with perl stringwise-equal operator. Documentation is now generated with block: portion appropriate to defaults.cc. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Aug 11 16:03:18 2000 Gilles Detillieux * htdig/HTML.cc (parse): fix problem with & not being translated. Fri Aug 11 10:48:54 2000 Gilles Detillieux * htsearch/Display.cc (setVariables), htcommon/defaults.cc: Added maximum_page_buttons attribute, to limit buttons to less than maximum_pages. Fixes PR#731 & PR#781. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Aug 9 23:04:39 2000 Geoff Hutchison * httools/htmerge.cc (mergeDB): Add fix to prevent duplicate documents when you merge a database with a copy of itself contributed by Lorenzo. Wed Aug 9 22:58:39 2000 Geoff Hutchison * htsearch/parser.cc (score): Merged in patch contributed by Lorenzo Campedelli and Arthur Prokosch to fix problems with AND operators and phrase matches. Wed Aug 2 11:44:11 2000 Gilles Detillieux * htsearch/Display.cc (setVariables), htcommon/defaults.cc: Enhanced build_select_lists attribute, to generate not only single-choice select lists, but also select multiple lists, radio button lists and checkbox lists. Added explanation and examples in documentation. * htdoc/hts_selectors.html: Added detailed explanation of new feature. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Tue Aug 1 21:50:22 2000 Geoff Hutchison * htsearch/ParseTree.cc (Parse): Fix problems with token comparisons and fix thinko with HtWordToken parsing--previously didn't advance the parse step at all. * htsearch/*ParseTree.cc (Parse): Fix thinko with HtWordToken as above--here it acted as an infinite loop. * htdig/ExternalParser.cc (parse): Add shell quoting around content-type. Hard to exploit, but a server could potentially return a strange value that could then be exectuted locally. Thu Jun 29 23:33:51 2000 Geoff Hutchison * htsearch/ParseTree.h, htsearch/ParseTree.cc: New parent class for the new htsearch framework. Still needs work. * htsearch/*ParseTree.*: Derived classes appropriate to the method indicated. * htsearch/parsetest.cc: New program to alllow initial command-line testing of ParseTree classes. * htsearch/Makefile.am, htsearch/Makefile.in: Build parsetest in addition to htsearch. Eventually, parsetest is probably best modified slightly and moved into the tests directory. Tue Jun 20 22:29:57 2000 Geoff Hutchison * httools/htmerge.cc (mergeDB): Merge in patch contributed by Lorenzo Campedelli to greatly reduce memory usage. Sun Jun 18 13:15:43 2000 Geoff Hutchison * htlib/Object.h (class Object): Fix problems with retrieval order by insuring the compare() method is declared const. Tue Jun 13 22:57:10 2000 Geoff Hutchison * htdig/Retriever.cc (GetLocal): Fix bug that would cause a coredump when local_urls was used and local_default_docs was needed. The list of default filenames was freed before it should have been. Tue Jun 13 19:30:28 2000 Geoff Hutchison * htcommon/HtWordReference.h, htcommon/HtWordReference.cc (Load, LoadHeaders): New methods to check the header of an ASCII representation and read it in. * htcommon/HtWordList.h, htcommon/HtWordList.cc (Load): Add load method to read in data. Calls the new methods above. * httools/htload.cc: Open word databases read-write and call HtWordList::Load(). Sun Jun 11 14:39:28 2000 Geoff Hutchison * htsearch/Display.cc (generateStars): Fix problem when maxScore == minScore as reported by Rajendra. Fixed problem PR#858. (displayMatch): Ditto. * htsearch/htsearch.cc: Fix memory corruption problem in reporting syntax errors pointed out by Rajendra. Fixes PR#860. Thu Jun 8 09:31:15 2000 Gilles Detillieux * htfuzzy/Accents.h, htfuzzy/Accents.cc: Apply Robert Marchand's patch to his algorithm. Gets rid of writeDB function (falls back on default one in Fuzzy.cc), changes addWord, and adds a new getWords function to override default. These avoid overhead of unaccented forms of words in accents database, but ensure that unaccented form of search word is always searched. Thu Jun 8 09:00:02 2000 Gilles Detillieux * htcommon/DocumentRef.h(DocScore, docScore), htsearch/ResultMatch.cc(ScoreMatch::compare), htsearch/ResultMatch.h(setScore, getScore, score), htsearch/Display.cc(displayMatch, generateStars, buildMatchList): Apply Terry Luedtke's patch for score calculations, to calculate min & max from log(score). Thu Jun 8 08:47:03 2000 Gilles Detillieux * contrib/doc2html/doc2html.pl: Apply David Adams' fix for missing quote. Wed Jun 07 10:53:53 2000 Loic Dachary * db/db.c (CDB___db_dbenv_setup): open mode is 0666 instead of 0 otherwise the weakcmpr file is not open with the proper mode. Tue Jun 6 23:48:48 2000 Geoff Hutchison * httools/htpurge.cc: Fix coredump problems by passing dictionaries as pointers rather than full objects (this is preferred anyway). Sun Jun 4 22:17:14 2000 Geoff Hutchison * test/t_htdig_local: Added test for local filesystem support. * test/config/htdig.conf2.in: Change to be a config file for local_urls testing. * test/Makefile.am: Add t_htdig_local to list. Tue May 30 23:52:45 2000 Geoff Hutchison * httools/htmerge.cc: Move to httools directory, remove "cleanup" functionality now in htpurge and merge in htmerge.h and db.cc files. * httools/Makefile.am: Add htmerge now moved to this directory. * */Makefile.in: Update with automake. * Makefile.am (SUBDIRS): Remove htmerge, now found in httools. * configure.in: Ditto. * configure: Update with autoconf. * test/test_functions.in: Add paths for htpurge, htstat, htload, htdump and update path for htmerge. * test/t_htdig: Change htmerge to htpurge to clean out incorrect URLs. * installdir/rundig: Change htmerge to htpurge. This needs serious additional cleanup for use in 3.2 since many conventions have changed! Tue May 23 22:21:14 2000 Geoff Hutchison * README: Fix for 3.2.0b3 and clean up organization a bit for new directory structure. Wed May 17 23:22:31 2000 Geoff Hutchison * htdig/HTML.cc (do_tag): Add support for TITLE attributes in anchor and related tags. Fri May 12 17:54:09 2000 Loic Dachary * db/acinclude.m4: bigfile support is disabled by default. * db/mp_region.c (CDB___memp_close): clear weakcmpr pointer when closing region so that memory pool files are not released twice. Wed May 10 22:26:21 2000 Loic Dachary * */*.cc: all include htconfig.h * htlib/HtTime.h: remove htconfig.h inclusion (never in headers) * htlib/*.h,*.cc: Fix copyright GNU Public -> Gnu General Public and 1999, 2000 instead of 1999. Tue May 09 16:38:07 2000 Loic Dachary * htsearch/Collection.cc (Collection): set searchWords and searchWordsPattern to null in constructor. Delete in destructor. Also delete matches in destructor. * test/word.cc (doskip_harness): free cursor after use. * test/word.cc (doskip_overflow): free cursor after use. * test/dbbench.cc (find): free cursor after use. * htsearch/htsearch.cc (main): free searchWords and searchWordsPattern after usage. * htdb/htdb_{load,dump,stat}.cc (main): call WordContext::Finish to free global context for inverted index. * htdb/htdb_stat.cc (btree_stats): free stat structure. * htlib/List.h (class List): Add Shift/Unshift/Push/Pop methods. * htlib/List.h (class List): Add Remove(int position) method. Tue May 09 00:22:33 2000 Loic Dachary * htsearch/htsearch.cc (main): kill useless call to StringList::Release * htsearch/HtURLSeedScore.cc (ScoreAdjustItem): remove useless call to StringList::Destroy. * htlib/HtWordCodec.cc (HtWordCodec): Fix usage of StringList that was inserting pointers to volatile strings instead of permanent copies. I suspect that the tweak on StringList was primarily done to satisfy this piece of code. After reviewing all the usage of StringList, it's the only one to use it in this fashion. * htlib/QuotedStringList.h (class QuotedStringList): remove noop destructor to enable Destroy of the underlying StringList when deleted. Mon May 08 18:17:02 2000 Loic Dachary * htlib/StringList.h (class StringList): change methods Add/Insert/Assign that were copying the String* given in argument. This behaviour is confusing since it has a different semantic than the base class List. Mon May 08 17:16:00 2000 Loic Dachary * htdig/Retriever.cc (GetLocal): fix leaked defaultdocs Mon May 08 04:27:47 2000 Loic Dachary * htlib/StringList.cc (Create): remove SRelease. Deleting the strings is taken care of by the destructor thru Destroy. If destruction of the Strings is not desirable Release should be used. SRelease was added apparently after a virtual constructor doing nothing was added to hide the default call to Destroy therefore leaking memory. Mon May 08 01:28:25 2000 Loic Dachary * test/txt2mifluz.cc,word.cc,search.cc: fix minor memory leaks. Sun May 07 19:24:12 2000 Loic Dachary * Makefile.config (HTLIBS): add libht at end because htdb now depends on htlib. * configure.in,htlib/Makefile.am: use LTLIBOBJS as suggested by the libtool documentation. Sun May 07 17:09:22 2000 Loic Dachary * test/Makefile.am (clean-local): clean conf to prevent inconsistencies when re-configuring in a directory that is not the source directory. Sun May 07 05:07:23 2000 Loic Dachary * db/mkinstalldir,test/benchmark: Add for installation purpose Sun May 07 02:17:03 2000 Loic Dachary * Makefile.am (distclean-local): Xtest instead of test that confuse some shells. Sun May 07 02:02:46 2000 Loic Dachary * htword/WordDB.cc: Move Open to WordDB.cc. Sun May 07 01:32:47 2000 Loic Dachary * test/t_*: check/fix scripts. All regression tests pass on RedHat-6.2. Sun May 07 00:54:30 2000 Loic Dachary * */*.cc: fix warnings and large file support inclusion files on Solaris. Sat May 06 21:55:58 2000 Loic Dachary * test/: import regression tests from mifluz * htlib/DB2_db.cc (db_init): fix flags used when creating the environment to include a memory pool. * htcommon/defaults.cc: change wordkey_description format. update all wordlist_* attributes Sat May 06 04:46:03 2000 Loic Dachary * htmerge/words.cc (mergeWords): WordSearchDescription becomes WordCursor. * httools/htpurge.cc (purgeWords): WordSearchDescription becomes WordCursor. Sat May 06 02:01:40 2000 Loic Dachary * htdb/*: upgrade to Berkeley DB 3.0.55. Very different. * htlib/getcwd.c,memcmp.c,memcpy.c,memmove.c,raise.c,snprintf.c, strerror.c,vsnprintf.c,clib.h: Add compatibility support * htcommon/DocumentDB.cc (LoadDB): remove unused variable * htlib/DB2_db.cc: adapt to Berkeley DB 3.0.55 syntax. * htlib/Database.h (class Database): remove DB_INFO, does not exist in Berkeley DB 3.0.55 * htlib/*: run ../db/prefix-symbols.sh * Makefile.config (INCLUDES): fix db include dirs * acconfig.h: Big file support + replacement functions * acinclude.m4,configure.in : db instead of db/dist + bug fixes Fri May 5 08:33:59 2000 Geoff Hutchison * db/*: Merge in changes from Loic's mifluz tree. This will break everything, but Loic promises he'll fix it ASAP after I make this change. Mon Apr 24 21:58:22 2000 Geoff Hutchison * htdig/htdig.cc (main): Make the -l stop & restart mode the default. This will catch signals and quit gracefully. The command-line parser will still accept -l, it will just ignore it. (usage): Remove -l portion. (main): Fix -m option to read in a file as it's supposed to do! Also set max_hops correctly so really only indexes the URLs in that file. * htdoc/htdig.html: Remove -l from documentation since it's now the default. Mon Apr 24 21:22:53 2000 Geoff Hutchison * htdig/Server.cc (push): Fix bug where changes in the robots.txt would be ignored. If a URL was indexed and later the robots.txt changed to forbid it, the URL would still be updated. Wed Apr 19 22:13:02 2000 Geoff Hutchison * Merging in changes from mifluz 0.14 from Loic. * htlib/Configuration.cc (Read): Removed dependency on fstream.h, use fopen, fprintf, fgets, fclose instead of iostream. * htlib/HtPack.cc, htlib/HtVectorGeneric.h, htlib/Object.h, htlib/ParsedString.cc, htlib/String.cc: Remove use of cerr, instead use fprintf(stderr ...). * htlib/Dictionary.cc, htlib/HtVectorGeneric.cc, htlib/List.cc, htlib/Object.cc, htlib/StringList.cc, htlib/htString.h, htlib/strcasecmp.cc: Add #ifdef blocks for htconfig.h Wed Apr 12 19:09:40 2000 Geoff Hutchison * .version: Bump to 3.2.0b3. * htdoc/htload.html, htdoc/htpurge.html, htdoc/htstat.html: Fix typos in headers. * htdoc/main.html: Fix link to download to actually point to 3.2.0b2. Tue Apr 11 00:21:48 2000 Geoff Hutchison * htsearch/htsearch.cc (setupWords): Does not apply fuzzy algorithms to phrase queries. This helps prevent the infinite loops described on the mailing list. * htcommon/conf_parser.yxx (list): Add conditions for lists starting with string-number, number-string, and number-number. * htcommon/conf_parser.cxx: Regenerate using bison. * htdoc/RELEASE.html: Update release notes for recent bug fixes and likely release date for 3.2.0b2. * htdoc/main.html: Add a blurb about the 3.2.0b2 release. * htdoc/*.html: Remove author notes in the footer as requested by Andrew. To balance it out, the copyright notice at the top links to THANKS.html. Sun Apr 9 15:21:12 2000 Geoff Hutchison * htcommon/conf_parser.yxx (list): Fix problem with build_select_lists--parser didn't support lists including numbers. * htcommon/conf_parser.cxx: Regenerate using bison. Sun Apr 9 12:53:02 2000 Geoff Hutchison * htdoc/RELEASE.html: Add a first draft of 3.2.0b2 release notes. Sun Apr 9 12:31:13 2000 Geoff Hutchison * httools/Makefile.am, httools/Makefile.in: Add htload to compilation list. * htcommon/DocumentDB.h: Add optional verbose options to DumpDB and LoadDB. * htcommon/DocumentDB.cc (LoadDB): Implement loading and parsing an ASCII version of the document database. Records on disk will replace any matching records in the db. (DumpDB): Add all fields in the DocumentRef to ensure the entire database is written out. * htcommon/DocumentRef.h: Add new method for setting DocStatus from an int type. * htcommon/DocumentRef.cc (DocStatus): Set it using a switch statement. (It's not pretty, but it works.) * httools/htload.cc: New file. Loads in ASCII versions of the databases, replacing existing records if found. * httools/htdump.cc: Pass verbose flags to DumpDB method. Make sure to close the document DB before quitting. * httools/htpurge.cc: Add -u option to specify a URL to purge from the command-line. * httools/htstat.cc: Add -u option to output the list of URLs in the document DB as well. Sat Apr 8 16:35:55 2000 Geoff Hutchison * htcommon/defaults.cc: Change all , , and tags to the HTML-4.0 compliant , , and tags. * installdir/long.html, installdir/header.html, installdir/nomatch.html, installdir/syntax.html, installdir/wrapper.html: Ditto. * htdoc/*.html: Ditto. (Don't you just love sed?) * htsearch/TemplateList.cc (createFromString): Ditto. * htdoc/htpurge.html, htdoc/htdump.html, htdoc/htload.html, htdoc/htstat.html: New files documenting usage of httools programs. * htdoc/contents.html: Add links to above. * htdoc/htdig.html: Update table with -t format to match htdump. Fri Apr 7 00:30:01 2000 Geoff Hutchison * README: Update to mention 3.2.0b2 and use correct copyright. (It is 2000 after all!) * htdoc/FAQ.html, htdoc/where.html, htdoc/uses.html, htdoc/isp.html: Update with most recent versions from maindocs. * htdoc/RELEASE.html: Add release notes for 3.1.5 to the top. (It's out of version ordering, but it is in correct chronological order.) Fri Apr 7 00:11:29 2000 Geoff Hutchison * httools/htpurge.cc (main): Read in URLs from STDIN for purging, one per line. Pass them along to purgeDocs for removal. Also, make discard_list into a local variable and pass it from purgeDocs to purgeWords. (purgeDocs): Accept a hash of URLs to delete (user input) and return the list of doc IDs deleted. (usage): Note the - option to read in URLs to be deleted from STDIN. Thu Apr 6 00:10:23 2000 Geoff Hutchison * htdig/Retriever.cc (got_redirect): Allow the redirect to accept relative redirects instead of just full URLs. Wed Apr 5 15:07:52 2000 Gilles Detillieux * htsearch/Display.cc: Added #if test to make sure DBL_MAX is defined on Solaris, as reported by Terry Luedtke. Tue Apr 4 12:46:37 2000 Gilles Detillieux * contrib/doc2html/*: Added parser submitted by D.J.Adams at soton.ac.uk Mon Apr 3 13:48:59 2000 Gilles Detillieux * htcommon/defaults.cc: Fix error in description of new attribute plural_suffix. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Mar 31 21:48:02 2000 Geoff Hutchison * configure.in, configure: Add test using AC_TRY_RUN to compile against the htlib/regex.c and attempt to compile a regexp. This should allow us to find out if the included regex code causes problems. * acconfig.h: Add HAVE_BROKEN_REGEX as a result of the configure script to conditionally include the appropriate regex.h file. * include/htconfig.h.in: Regenerate using autoheader. * htlib/regex.c: Move #include "htconfig.h" inside HAVE_CONFIG_H tests. This file is only created when this is true anyway. This prevents problems with the configure test. * htlib/HtRegex.h, htfuzzy/EndingsDB.cc: Use HAVE_BROKEN_REGEX switch to use the system include instead of the local include where appropriate. * htlib/Makefile.am, htlib/Makefile.in: Only compile regex.lo if the configure script added it to LIBOBJS. Thu Mar 30 22:41:38 2000 Geoff Hutchison * htcommon/URL.cc (normalizePath): Remove Gilles's loop to add back ../ components to a path that would go above the top level. Now we simply discard them. Both are allowed under the RFC, but this should have fewer "surprises." Tue Mar 28 21:57:49 2000 Geoff Hutchison * htnet/Connection.cc (Read_Partial): Fix bug reported by Valdas where a zero value returned by select would result in an infinite loop. * htcommon/defaults.cc: Add new attribute plural_suffix to set the language-dependent suffix for PLURAL_MATCHES contributed by Jesse. * htsearch/Display.cc (setVariables): Use it. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Mon Mar 27 22:28:20 2000 Geoff Hutchison * htcommon/DocumentRef.cc (Deserialize): Add back stub for DOC_IMAGESIZE to prevent decoding errors. This just throws away that field. * htcommon/HtSGMLCodec.h (class HtSGMLCodec): Differentiate between codec used for &foo; and numeric form &#nnn; Make sure encoding goes through both but decoding only goes through the preferred text form. * htcommon/HtSGMLCodec.cc (HtSGMLCodec): When constructing the private HtWordCodec objects, create separate lists for the number and text codecs. Mon Mar 27 21:25:27 2000 Geoff Hutchison * htsearch/HtURLSeedScore.cc (ScoreAdjustItem): Change to use HtRegex for flexibility and to get around const char * -> char * problems. * htsearch/SplitMatches.cc (MatchArea): Ditto. * htsearch/Makefile.am, htsearch/Makefile.in: Add SplitMatches.cc and HtURLSeedScore.cc to compilation list! Mon Mar 27 21:03:12 2000 Hans-Peter Nilsson * htcommon/defaults.cc (defaults): Add default for search_results_order, url_seed_score. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. * htlib/List.h (List): New method AppendList. * htlib/List.cc (List::AppendList): Implement it. * htsearch/SplitMatches.h, htsearch/SplitMatches.cc: New. * htsearch/HtURLSeedScore.cc, HtURLSeedScore.h: New. * htsearch/Display.h (class Display: Add member minScore. Change maxScore type to double. * htsearch/Display.cc: Include SplitMatches.h and HtURLSeedScore.h (ctor): Initialize minScore, change init value for maxScore to -DBL_MAX. (buildMatchList): Use a SplitMatches to hold search results and interate over its parts when sorting scores. Ignore Count() of matches when setting minScore and maxScore. Use an URLSeedScore to adjust the score after other calculations. Calculate minScore. Correct maxScore adjustment for change to double. (displayMatch): Use minScore in calculation of score to adjust for negative scores. (sort): Calculation of maxScore moved to buildMatchList. Mon Mar 27 20:22:24 2000 Geoff Hutchison * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Remove DocImageSize field since it is not used anywhere and is never updated. * htdig/Retriever.h (class Retriever): Remove references to Images class. * htcommon/DocumentDB.cc (DumpDB): Ignore DocImageSize field. * htdig/Makefile.am, htdig/Makefile.in: Remove Images.cc since this is no longer used. * htdig/Plaintext.cc: Do not insert SGML equivalents into the excerpt, these are decoded by HtSGMLCodec automatically. Sat Mar 25 21:58:36 2000 Geoff Hutchison * htdoc/cf_generate.pl (html_escape): Changed and tags to HTML 4.0 and tags. Sat Mar 25 17:23:46 2000 Geoff Hutchison * htdb/Makefile.am, htdb/Makefile.in: Change the names of the htdb utility programs to escape name conflicts with httool programs. * htdb/htdb_load.cc: Rename htload.cc to escape name conflict and more closely match orignal db_load program name. * htdb/htdb_dump.cc, htdb/htdb_stat.cc: Ditto. * htfuzzy/Prefix.cc (getWords): Add code to "weed out" duplicates returned from WordList::Prefix. We only want to add unique words to the search list. Fri Mar 24 22:33:20 2000 Geoff Hutchison * htdig/Document.cc (Document): Fix bug reported by Mentos Hoffman, contributed by Atlee Gordy . Mon Mar 20 23:14:26 2000 Geoff Hutchison * htcommon/DocumentDB.cc (Delete): Fix bug reported by Valdas where duplicate document records could "sneak in" because the doc_index entry was removed incorrectly. Mon Mar 20 19:08:14 2000 Geoff Hutchison * htcommon/defaults.cc: Added block field and added appropriate blocks. * htlib/Configuration.h (struct ConfigDefaults): Add block field. * htdoc/cf_generate.pl: Parse the new block field. * htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/attrs.html: Regenerate using above. * htcommon/DocumentDB.cc (DumpDB): Make sure we decompress the DocHead field before we write it to disk! * httools/htdump.cc, httools/htstat.cc: Call WordContext::Initialize() before doing any htword calls. Mon Mar 20 14:10:30 2000 Geoff Hutchison * httools/htpurge.cc: Whoops! Left some references to htmerge in the error messages and usage message. * httools/htstat.cc: New program. Simply spits up the total number of documents, words and unique words in the databases. * httools/htdump.cc: New program. Simply dumps the contents of the document DB and the word DB to doc_list and word_dump files respectively. Also has flags -w and -d to pick one or the other. * httools/Makefile.am, httools/Makefile.in: Add htdump and htstat programs to compilation list. * htcommon/DocumentDB.cc (DumpDB): Change name of CreateSearchDB and add fields for DocBackLinks, DocSig, DocHopCount, DocEmail, DocNotification, and DocSubject. This should now export every portion of the document DB. * htcommon/DocumentDB.h: Change name of CreateSearchDB and add stub for LoadDB, to be written shortly. * htdig/htdig.cc: Call DumpDB instead of CreateSearchDB when creating an ASCII version of the DB. Sat Mar 18 22:57:02 2000 Geoff Hutchison * httools/Makefile.am, httools/Makefile.in: New directory for useful database utilities. * httools/htnotify.cc: Moved htnotify to httools directory. * httools/htpurge.cc: New program--currently just purges documents (and corresponding words) in the databases. Will shortly also allow deletion of specified URLs. * Makefile.am, configure.in: Remove htnotify directory in favor of httools directory. * configure: Regenerate using autoconf. * Makefile.in: Regenerate using automake --foreign. Fri Mar 17 16:47:37 2000 Gilles Detillieux * htsearch/Display.cc (excerpt, hilight): Correctly handle case where there is no pattern to highlight. * htsearch/htsearch.cc (addRequiredWords), htcommon/defaults.cc: Add any_keywords attribute, to OR keywords rather than ANDing, fix addRequiredWords not to mess up expression when there are no search words, but required words are given. * htdoc/hts_form.html: Mention new attribute, add links to all mentioned attributes. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Mar 17 15:48:12 2000 Gilles Detillieux * htfuzzy/Accents.cc (generateKey): Truncate words to maximum_word_length, for consistency with what's found in word DB. Fri Mar 17 10:56:17 2000 Gilles Detillieux * htdig/HTML.cc (do_tag): Use case insensitive parsing of META robots tag content. * htlib/String.cc (uppercase): Fix misplaced cast for islower(). Mon Mar 6 17:31:37 2000 Gilles Detillieux * htsearch/htsearch.cc (setupWords): Don't allow comma as string list separator, as it can be a decimal point in some locales. Mon Mar 06 00:58:00 2000 Loic Dachary * db/mp/mp_bh.c (__memp_bhfree): always free the chain, if any. The bh is reset to null after free and we loose the pointer anyway, finally filling the pool with it. * db/mp/mp_cmpr.c (__memp_cmpr_write): i < CMPR_MAX - 1 instead of i < CMPR_MAX otherwise go beyond array limits. This fixes a major problem when handling large files. Sat Mar 04 19:41:49 2000 Loic Dachary * db/mp/mp_cmpr.c (__memp_cmpr_free_chain): clear BH_CMPR flag. Was causing core dumps, thanks to Peter Marelas maral at phase-one.com.au for providing a simple case to reproduce the error. Fri Mar 3 11:32:34 2000 CEST Gabriele Bartolini * Fixed bugs regarding yesterday's changes. Even Leonardo da Vinci used to commit errors, so ... Fri Mar 3 11:25:42 2000 CEST Gabriele Bartolini * testnet.cc: added the -r and -w options in order to set how many times it retries to re-connect after a timeout occurs, and how long it should wait after it. Thu Mar 2 18:45:15 2000 CEST Gabriele Bartolini * htnet/Connection.*: management of wait_time and number of retries after a timeout occurs. * htnet/Transport.*: Management of connection attributes above. * htdig/Server.*: Set members for managing timeout retries taken from the configuration file ("timeout", "tcp_max_retries", "tcp_wait_time"). * htdig/Document.cc: Added the chance to configure on a server basis "persistent_connections", "head_before_get", "timeout", "tcp_max_retries", "tcp_wait_time". Changed Retrieve method accepting now a server object pointer: Retrieve (server*, HtDateTime). * htdig/Retriever.cc: Added the chance to configure on a server basis "max_connection_requests" attribute. * htcommon/defaults.cc: Added "tcp_max_retries", "tcp_wait_time" -- Need to be go over by someone who speaks english better than me. Not a hard work !!! ;-) Wed Mar 1 17:01:09 2000 Gilles Detillieux * htsearch/Display.cc (excerpt, hilight): move SGML encoding into hilight() function, because when it's done earlier it breaks highlighting of accented characters. Wed Mar 1 16:02:49 2000 Gilles Detillieux * htfuzzy/htfuzzy.cc (main): Correctly test return value on Open() of word database, include db name in error message if Open() fails, do a WordContext::Initialize() before we need htword functions. (Obviously I'm the first to test htfuzzy in 3.2!) * htfuzzy/Accents.cc (generateKey): cast characters to unsigned char before using as array subscripts. Wed Mar 1 13:27:26 2000 Gilles Detillieux * htcommon/defaults.cc: Added accents_db attribute, mentioned accents algorithm in search_algorithms section. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * installdir/htdig.conf: Added mentions of accents, speling & substring, fixed a couple typos in comments. * htdoc/htfuzzy.html: Added blurb on accents algorithm. * htdoc/require.html: Added mentions of accents, speling, substring, prefix & regex. * htdoc/config.html: Updated with sample of latest htdig.conf and installdir/*.html, added blurb on wrapper.html. Wed Mar 1 00:30:19 2000 Geoff Hutchison * configure.in, configure: Add test for FD_SET_T, the second (also third and fourth) argument in calls to select(). Should solve PR#739. * acconfig.h, include/htconfig.h.in: Add declaration for FD_SET_T. * htnet/Connection.cc (ReadPartial): Change declaration of fds to use FD_SET_T define set by the configure script. Tue Feb 29 23:11:49 2000 Geoff Hutchison * htlib/DB2_db.cc (Error): Simply fprint the error message on stderr. This is not a method since the db.h interface expects a C function. (db_init): Don't set db_errfile, instead set errcall to point to the new Error function. Tue Feb 29 15:09:41 2000 Gilles Detillieux * htfuzzy/Accents.h, htfuzzy/Accents.cc: Adapted writeDB() for 3.2. Tue Feb 29 14:29:37 2000 Gilles Detillieux * htfuzzy/Accents.h, htfuzzy/Accents.cc: Added these, as contributed by Robert Marchand, to implement accents fuzzy match. Adapted to 3.2. * htfuzzy/Fuzzy.cc, htfuzzy/htfuzzy.cc, htfuzzy/Makefile.am, htfuzzy/Makefile.in: Added in accents algorithm, as for soundex. Tue Feb 29 11:31:53 2000 Loic Dachary * test/testnet.cc (Listen): Add -b port to listen to a specific port. This is to test connect timeout conditions. * htnet/Connection.cc (Connect): Added SIGALRM signal handler, Connect() always allow EINTR to occur. Mon Feb 28 15:32:46 2000 Loic Dachary * htword/WordKey.h (class WordKey): explicitly add inline keyword for all inline functions. Mon Feb 28 13:10:34 2000 Loic Dachary * htword/WordKey.h (class WordKey): nfields data member caches result of NFields() method. * htword/WordDBPage.h (class WordDBPage): nfields data member caches result of WordKey::NFields() method. * acinclude.m4 (APACHE): check in lib/apache for modules Sat Feb 26 22:05:03 2000 Geoff Hutchison * htsearch/Collection.h, htsearch/Collection.cc: New files contributed by Rajendra Inamdar . * htsearch/Makefile.am, htsearch/Makefile.in: Compile them. * htcommon/defaults.cc: Add new collection_names attribute as described by Rajendra. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * htsearch/Display.h, htsearch/Display.cc: Loop through collections as we are assembling results. (buildMatchList): Use 1.0 as minimum score and take log(score) as the final score. This requires an increase in magnitude in weight to correspond to a factor of increase in score. * htsearch/DocMatch.h, htsearch/DocMatch.cc: Keep track of the collection we're in. * htsearch/ResultMatch.h: Ditto. * htsearch/htsearch.h, htsearch/htsearch.cc: Wrap results in collections. * htsearch/parser.h, htsearch/parser.cc: Set the collection for the results--we use this to get to the appropriate word DB. (score): Divide word weights by word frequency to calibrate for expected Zipf's law. Rare words should count more. Fri Feb 25 11:19:47 2000 Gilles Detillieux * htcommon/defaults.cc (maximum_pages): Describe new bahaviour (as of 3.1.4), where this limits total matches shown. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Thu Feb 24 14:43:06 2000 Gilles Detillieux * htnet/HtFile.cc (Request): Fix silly typo. * htlib/DB2_db.cc: Remove include of malloc.h, as it causes problems on some systems (e.g. Mac OS X), and all we need should be in stdlib.h. Thu Feb 24 13:11:15 2000 Gilles Detillieux * htnet/HtFile.cc (Request): Don't append more than _max_document_size bytes to _contents string, set _content_length to size returned by stat(). * htnet/HtHTTP.cc (HTTPRequest): Extra tests in case Content-Length not given for non-chunked input, and not to close persistent connection when chunked input exceeds _max_document_size. (ReadChunkedBody): Don't append more than _max_document_size bytes to _contents string. Thu Feb 24 11:40:24 2000 Gilles Detillieux * htdig/HTML.cc (do_tag): Fix handling of img alt text to be consistent with body text, rather than keywords. * htdig/Retriever.cc (ctor): Treat alt text as plain text, until it has its own FLAG and factor. Thu Feb 24 11:16:37 2000 Gilles Detillieux * htcommon/defaults.cc (version): Moved example over to correct field. (defaults[] terminator): Padded zeros to new number of fields. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Thu Feb 24 19:08:41 2000 Loic Dachary * htmerge/words.cc: only display Word in verbose message instead of complete key if verbosity < 3. Thu Feb 24 10:43:12 2000 Gilles Detillieux * htcommon/defaults.cc (external_protocols, external_parser): Swapped these two entries to put them in alphabetical order. (star_blank): Fixed old typo (incorrect reference to image_star). * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 23 16:53:40 2000 Gilles Detillieux * htcommon/defaults.cc (backlink_factor, external_parser, local_default_doc, local_urls, local_urls_only, local_user_urls): Add some updates from 3.1.5's attrs.html. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 23 15:11:51 2000 Gilles Detillieux [ Improve htsearch's HTML 4.0 compliance ] * htsearch/TemplateList.cc (createFromString): Use file name rather than internal name to select builtin-* templates, use $&(TITLE) and $&(URL) in templates and quote HTML tag parameters. * installdir/long.html, installdir/short.html: Use $&(TITLE) and $&(URL) in templates and quote HTML tag parameters. * htsearch/Display.cc (setVariables): quote all HTML tag parameters in generated select lists. * installdir/footer.html, installdir/header.html, installdir/nomatch.html, installdir/search.html, installdir/syntax.html, installdir/wrapper.html: Use $&(var) where appropriate, and quote HTML tag parameters. * installdir/htdig.conf: quote all HTML tag parameters. Wed Feb 23 13:40:27 2000 Gilles Detillieux * htcommon/URL.h (encodeURL): Change list of valid characters to include only unreserved ones. * htcommon/cgi.cc (init): Allow "&" and ";" as input param. separators. * htsearch/Display.cc (createURL): Encode each parameter separately, using new unreserved list, before piecing together query string, to allow characters like "?=&" within parameters to be encoded. Wed Feb 23 13:22:29 2000 Gilles Detillieux * htlib/URL.cc (ServerAlias): Fix server_aliases processing to prevent infinite loop (as for local_urls in PR#688). Wed Feb 23 12:49:52 2000 Gilles Detillieux * htlib/HtDateTime.h, htlib/HtDateTime.cc: change Httimegm() method to HtTimeGM(), to avoid conflict with Httimegm() C function, so we don't need "::" override, for Mac OS X. * htlib/htString.h, htlib/String.cc: change write() method to Write(), to avoid conflict with write() function, so we don't need "::" override, for Mac OS X. Wed Feb 23 12:17:46 2000 Gilles Detillieux * htlib/Configuration.cc(Read): Fixed to allow final line without terminating newline character, rather than ignoring it. Wed Feb 23 12:01:01 2000 Gilles Detillieux * htdig/Retriever.cc (GetLocal, GetLocalUser): Add URL-decoding enhancements to local_urls, local_default_urls & local_default_doc, to allow hex encoding of special characters. Wed Feb 23 19:14:29 2000 Loic Dachary * htcommon/conf_parser.cxx: regenerated from conf_parser.yxx Wed Feb 23 19:04:16 2000 Loic Dachary * test/test_functions.in: inconditionaly remove existing test/var directory before runing tests to prevent accidents. * htcommon/URL.cc (URL): fixed String->char warning * htcommon/defaults.cc (wordlist_compress): defaults to true Tue Feb 22 17:09:10 2000 Gilles Detillieux * htdig/HTML.cc(parse, do_tag): Fix handling of ... text and parsing of words in meta tags, to to proper word separation. * htlib/HtWordType.h, htlib/HtWordType.cc: Add HtWordToken() function, to replace strtok() in HTML parser. Tue Feb 22 16:21:25 2000 Gilles Detillieux * htlib/URL.cc (ctor, normalizePath): Fix PR#779, to handle relative URLs correctly when there's a trailing ".." or leading "//". Tue Feb 22 14:09:26 2000 Gilles Detillieux * htdig/Document.cc (RetrieveLocal): Handle common extensions for text/plain, application/pdf & application/postscript. Mon Feb 21 17:25:21 2000 Gilles Detillieux * contrib/htdig-3.2.0.spec: Fixed %post script to add more descriptive entries in htdig.conf, made cron script a config file, updated to 3.2.0b2. * contrib/conv_doc.pl, contrib/parse_doc.pl: Added comments to show Warren Jones's updates in change history. Mon Feb 21 17:09:13 2000 Gilles Detillieux * htcommon/HtConfiguration.h, htcommon/conf_parser.yxx, htlib/Configuration.h, htlib/Configuration.cc: split Add() method into Add() and AddParsed(), so that only config attributes get parsed. Use AddParsed() only in Read() and Defaults(). Fri Feb 18 22:50:54 2000 Geoff Hutchison * htnet/Connection.h, htnet/Connection.cc: Renamed methods with capitals to remove the need to use ::-escaped library calls. * htnet/Transport.h, htnet/Transport.cc, htnet/HtHTTP.cc, htdig/Images.cc: Fix code using Connection to use the newly capitalized methods. Fri Feb 18 14:40:50 2000 Loic Dachary * test/conf/access.conf.in: removed cookies. Not used and some httpd are not compiled with usertrack. Wed Feb 16 12:15:08 2000 Vadim Chekan * htcommon/Makefile.am replaced conf.tab.cc.h by conf_parser.h in noinst_HEADERS * htcommon/conf_parser.yxx,conf_parser.lxx,HtConfiguration.cc, HtConfiguration.h: added copyright and Id: * htcommon/cgi.cc(init): fixed bug: array must be free by delete [] buf, not just delete buf; Tue Feb 15 23:16:14 2000 Geoff Hutchison * htnet/HtHTTP.cc (isParsable): Remove application/pdf as a default type--it is now handled through the ExternalParser interface if at all. * htcommon/defaults.cc: Remove pdf_parser attribute. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * htdig/Document.cc (getParsable): Remove PDF once and for all (hopefully). * htdig/ExternalParser.cc (parse): Ditto. * configure.in: Remove check for PDF_PARSER. * configure: Regenerate using autoconf * htdig/Makefile.am: Remove PDF.cc and PDF.h. * Makefile.in, */Makefile.in: Regenerate using automake --foreign Tue Feb 15 12:02:39 EET 2000 Vadim Chekan * htcommon/HtConfiguration.cc,HtConfiguration.h: fixed bug discovered by Gilles. HtConfiguration was able to get info only from "url" and "server" block. * htcommon/conf_parser.yxx: deleted 1st parameter for new char[], lefted when realloc was replaced by new char[]. Removed a few unused variable declaration. * htcommon/Makefile.am: added -d flag to bison to generate conf_parser.h template from conf_parser.yxx; conf_lexer.lxx uses #include conf_parser.h; conf.tab.cc.h removed. Sun Feb 13 21:19:04 2000 Geoff Hutchison * htcommon/defaults.cc: Get rid of uncoded_db_compatible since the current DB format has clearly broken backwards compatibility. * htsearch/Display.cc (Display), htnotify/htnotify.cc (main), htmerge/docs.cc (convertDocs), htmerge/db.cc (mergeDB), htdig/htdig.cc (main): Remove call to DocumentDB::setCompatibility(). * htcommon/DocumentDB.h (class DocumentDB): Remove setCompatibility and related private variable. * htcommon/DocumentDB.cc ([], Delete): Don't bother checking for an unencoded URL, at this point all URLs will be encoded using HtURLCodec. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Sat Feb 12 21:29:20 2000 Geoff Hutchison * htcommon/HtSGMLCodec.cc (HtSGMLCodec): Always translate " & < and > * htcommon/defaults.cc: Remove translate_* and word_list attributes since they're now no longer used. * htdig/PDF.cc (parseNonTextLine): Fix bogus escape sequences around Title parsing. Fixes PR#740. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Feb 11 11:41:36 2000 Loic Dachary * htlib/Makefile.am: removed CFLAGS=-g (use make CXXFLAGS=-g all instead). * htdoc/install.html: specify header/lib install directory now is prefix/include/htdig and prefix/lib/htdig. * Makefile.am (distclean-local): use TESTDIR instead of deprecated HTDIGDIRS. * */Makefile.am: install libraries in prefix/lib/htdig and includes in prefix/include/htdig. Just prepend pkg in front of automake targets. * include/Makefile.am: install htconfig.h Thu Feb 10 23:18:37 2000 Loic Dachary * Connection.cc (Connection): set retry_value to 1 instead of 0 as suggested by Geoff. Thu Feb 10 17:36:09 2000 Loic Dachary * htdig/Document.cc: fix (String)->(char*) conversion warnings. * htword/WordList.cc: kill Collect(WordSearchDescription) which was useless and error prone. * htword/WordDB.h (WordDBCursor::Get): small performance improvement by copying values only if key found. * htword/WordDB.h,WordList.cc: fix reference counting bug when using Override (+1 even if entry existed). Turn WordDB.h return values to be std Berkeley DB fashion instead of the mixture with OK/NOTOK that was a stupid idea. This allows to detect Put errors and handle them properly to fix the Override bug without performance loss. * test/conf/httpd.conf.in: comment out loading of mod_rewrite since not everyone has it. Thu Feb 10 00:26:02 2000 Geoff Hutchison * htcommon/defaults.cc: Add new attribute "nph" to send out non-parsed headers for servers that do not supply HTTP headers on CGI output (e.g. IIS). * htsearch/Display.cc (display): If nph is set, send out HTTP OK header as suggested by Matthew Daniel (displaySyntaxError): Ditto. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate from current defaults.cc file. Thu Feb 10 00:21:58 2000 Geoff Hutchison * htdig/HTML.cc (do_tag): Treat tags as noindex tags, much like as suggested by Torsten. Thu Feb 10 00:02:41 2000 Geoff Hutchison * .version: Bump for 3.2.0b2. * htcommon/defaults.cc: Add category fields for each attribute. Though these are currently unused, they could allow the documentation to be split into multiple files based on logical categories and subcategories. Wed Feb 9 23:52:55 2000 Geoff Hutchison * htnet/Connection.cc (connect): Add alarm(timeout) ... alarm(0) around ::connect() call to ensure this does timeout as appropriate as suggested by Russ Lentini to resolve PR#762 (and probably others as well). (connect): Add a retry loop as suggested by Wilhelm Schnell to resolve PR#754. * htnet/HtHTTP.cc (HTTPRequest): Add CloseConnection() when the connection fails on open before returning from the method. Should take care of PR#670 for htdig-3-2-x. Wed Feb 09 17:20:50 2000 Loic Dachary * db/dist/Makefile.in (libhtdb.so): move dependent libraries *after* the list of objects, otherwise it's useless. * htword/WordKey.h (class WordKey): move #if SWIG around to please swig (www.swig.org). * htword/WordList.h (class WordList): allow SWIG to see Walk* functions (#if SWIG). Wed Feb 9 09:21:00 2000 Gilles Detillieux * htdig/Server.cc (robotstxt): apply more rigorous parsing of multiple user-agent fields, and use only the first one. * htlib/HtRegex.cc (set): apply the fix from Valdas Andrulis, to properly compile case_sensitive expressions. Mon Feb 09 09:43:59 2000 CEST Gabriele Bartolini * htnet/HtHTTP.cc: changed "<<" to append() for content_length assignment in ReadChunkedBody() function (as Gilles suggested) Tue Feb 08 10:54:08 2000 Loic Dachary * db/dist/configure.in: Added AC_PREFIX_DEFAULT(/opt/www) so that headers and libraries are installed in the proper directory when no --prefix is given. Tue Feb 08 10:32:48 2000 Loic Dachary * test/t_wordskip: copy $srcdir/skiptest_db.txt to allow running outside the source tree. * configure.in: use '${prefix}/...' instead of "$ac_default_prefix/..." that did not carry the --prefix value. * configure.in: run CHECK_USER and AC_PROG_APACHE if --enable-tests Mon Feb 07 17:40:47 2000 Loic Dachary * htlib/htString.h (last): turn to const Mon Feb 07 14:05:37 2000 CEST Gabriele Bartolini * htnet/HtHTTP.cc: fixed a bug in ReadChunkedBody() function regarding document size assignment (raised by Valdas Andrulis) Sun Feb 06 19:11:05 2000 Loic Dachary * configure.in: Fix inconsistencies between default values shown by ./configure and actual defaults. * htdoc/install.html: change example version 3.1 to 3.2 Commented out warning about libguile. Replace CONFIG variables by configure.in options. Specify default value for each of them. Replace (and move) make depend by automake (distributed Makefiles do not include dependency generation) Added section for running tests. Added section on shared libraries. * configure.in: use AM_CONDITIONAL for --enable-tests * Makefile.am: use automake conditionals for subdir so that make dist knows what to distribution --enable-tests specified or not. * db/Makefile.in: allow make dist to work outside the source tree. Sat Feb 05 18:31:04 2000 Loic Dachary * test/word.cc (SkipTestEntries): The fix of WordList::SkipUselessSequentialWalking actually saves us a few hops when walking lists of words. Fri Feb 04 17:28:32 2000 Loic Dachary * htword/WordKey.cc,WordReference.cc,WordRecord.cc (Print): use cerr instead of cout for immediate printing under debugger. Thu Feb 3 16:06:45 2000 Gilles Detillieux * htdig/Document.cc (RetrieveLocal): fix bug that prevented local filesystem digging, because max_doc_size was initialized to 0. Now sets it to max_doc_size for current url. Thu Feb 3 12:36:56 2000 Gilles Detillieux * installdir/Makefile.{am,in}: install mime.types as mime.types, not as htdig.conf. * htfuzzy/EndingsDB.cc (createDB): fix code to use MV macro in system() command, not hard-coded "MV" string literal, and use get() on config objects to avoid passing String objects to form(). Wed Feb 2 19:44:33 2000 Geoff Hutchison * htlib/HtDateTime.cc (SetRFC1123): Strip off weekday, if present and use LOOSE format. (SetRFC850): Ditto. * configure.in, configure: Add configure check for "mv." * htfuzzy/Makefile.am: Use it. * */Makefile.in: Regenerate using automake. * htfuzzy/EndingsDB.cc (createDB): Use the detected mv, or whatever is in the path to move the endings DB when they're finished. Wed Feb 2 15:49:14 2000 Gilles Detillieux * htdig/Document.cc (RetrieveLocal), htdig/Retriever.cc (GetLocal): Fix compilation errors. Oops! Wed Feb 2 13:53:27 2000 Gilles Detillieux * htdig/Retriever.cc (IsValidURL): fix problem with valid_extensions matching failure when URL parameters follow extension. Wed Feb 2 13:29:48 2000 Gilles Detillieux * htlib/QuotedStringList.cc (Create): fix PR#743, where quoted string lists didn't allow embedded quotes of opposite sort in strings (e.g. "'" or '"'), and fix to avoid overrunning end of string if it ends with backslash. Wed Feb 2 13:23:16 2000 Gilles Detillieux * htdig/HTML.cc (ctor, parse, do_tag), htcommon/defaults.cc: Add max_keywords attribute to limit meta keyword spamming. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 2 12:57:40 2000 Gilles Detillieux * htdig/Document.cc (RetrieveLocal), htdig/Document.h, htdig/Retriever.cc (Initial, parse_url, GetLocal, GetLocalUser, IsLocalURL, got_href, got_redirect), htdig/Retriever.h, htdig/Server.cc (ctor), htdig/Server.h: Add in Paul Henson's enhancements to local_urls, local_default_urls & local_default_doc. * htcommon/defaults.cc: Document these. Wed Feb 02 10:14:57 2000 Loic Dachary * htword/WordKeyInfo.h,WordKey.{cc,h}: fix overflow bug when 32 bits. For that purpose implement Outbound/Overflow/Underflow methods in WordKey, MaxValue in WordKey/WordKeyInfo. (WordKey::SetToFollowing) was FUBAR : overflow of field1 tested with number of bits in next field, do not handle overflow, Re-implemented. (WordKey::Set) Change atoi to strtoul. (WordList::SkipUselessSequentialWalking) was much to fucked up to explain. Re-implement (WordKey::Diff) Added as a support function of SkipUselessSequentialWalking. implement consistent verbosity. * htword/WordList.cc (operator >>): explicit error message when insert failed, with line number. Wed Feb 2 00:11:03 2000 Geoff Hutchison * htdoc/RELEASE.html: Finish up with notes on all significant new attributes. * htdoc/FAQ.html, htdoc/where.html: Mention new 3.2.0b1 release as a beta. * contrib/README: Update to mention new scripts. * installdir/mime.types: Add default Apache mime.types file for systems that do not already have one. * installdir/Makefile.am: Make sure it is installed by default. * installdir/Makefile.in: Regenerate using automake. * htcommon/defaults.cc: Add documentation for mime_types attribute, remove currently unused image_alt_factor, and add documentation for external_protocols. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Tue Feb 1 10:24:19 2000 Gilles Detillieux * htsearch/parser.cc (score): fix up score calculations for correctness and efficiency. Mon Jan 31 16:29:20 2000 Marcel Bosc * htword/WordBitCompress.cc: fixed endian bug in compression Sat Jan 29 21:14:03 2000 Geoff Hutchison * htsearch/parser.cc (score): Change config.Value (which returns int) to config.Double to preserve accuracy of attributes. * htcommon/defaults.cc: Updated documentation for attributes now allowing regex, search_algorithms (for new fuzzy) and added documentation for the overlooked remove_unretrieved_urls. * htdoc/*.html: Updated copyright notice for 2000, changed footer to use CVS's magic Date keyword. Regenerated documentation from defaults changes. Sat Jan 29 16:32:08 2000 Geoff Hutchison * contrib/htdig-3.1.4.spec, contrib/htdig-3.1.4-conf.patch: Remove these since they don't apply to the 3.2.x releases. * htfuzzy/Synonym.cc (openIndex): Change database format from DB_BTREE to DB_HASH--no reason for the synonym database to be a btree. This was probably overlooked when I switched the rest of the fuzzy databases over to DB_HASH. Sat Jan 29 05:34:26 2000 Loic Dachary * htword/WordKey.h (UnpackNumber): Very nasty bug. Optimization dated Dec 29 broke endianess on Solaris. Restore previous version. Fri Jan 28 18:17:08 2000 Geoff Hutchison * htlib/Configuration.h (struct ConfigDefaults): Add version and category fields for more accurate documentation. * htcommon/defaults.cc: Add blank category fields and start filling in version field. Killed modification_time_is_now_attribute. * htdig/Document.cc (Document): Kill attribute modification_time_is_now since it can cause more harm than good. * htnet/HtHTTP.cc (ParseHeader): Ditto. * htdoc/cf_generate.pl: Added support for new version and category fields. Currently category does nothing, but it could split the documentation into categories. Sat Jan 29 01:37:45 2000 Loic Dachary * .version: remove the trailing -dev Thu Jan 27 12:22:57 2000 Loic Dachary * htword/WordList.cc: cdebug replaced by cerr. replace lverbose by verbose > 2. Remove shutup. (WordList): monitor = 0 (Open): create monitor only if wordlist_monitor = true (Close): delete monitor if set, delete compressor if set * htword/WordDBCompress.cc,WordList.cc: only activate monitoring code if monitor is set. No interaction with the monitor is therefore possible if wordlist_monitor is false. * htword/WordMonitor.cc: remove useless test of wordlist_monitor (done by WordList now). * htword/WordDBCompress.cc (TestCompress): remove redundant debuglevel argument. * htword/WordDBCompress.cc (WordDBCompress): init cmprInfo to 0 * db/include/db_cxx.h: Add get_mp_cmpr_info method * htword/WordDBCompress.cc (WordDBCompress): set default debug level to 0 * htword/WordDB.h: CmprInfo returns current CmprInfo and non static, overload to set CmprInfo if argument given. * htword/WordDBCompress.h: new CmprInfo() method returns DB_CMPR_INFO object for Berkeley DB database. * htword/WordList.h: add compressor member, kill cmprInfo member. * htword/WordList.cc: Wed Jan 26 20:05:33 2000 Loic Dachary * htword/WordList.cc,htword/WordList.h: get rid of obsolete WordBenchmarking Wed Jan 26 9:14:32 2000 CEST Gabriele Bartolini * htcommon/defaults.cc: added "max_connection_requests". * htdig/Retriever.cc: now manages the attribute above. Tue Jan 25 12:59:01 2000 Loic Dachary * htsearch/Display.cc (setVariables): fixed Display.cc:505: warning: multiline `//' comment Tue Jan 25 8:37:15 2000 CEST Gabriele Bartolini * htdig/Document.h: Added the "HtHTTP *GetHTTPHandler()" method, in order to be able to control an HTTP object outside the Document class. This is useful for the Server class, after the request for robots.txt. We can control the response of a server and check if it supports persistent connections. * htdig/Server.cc: inside the constructor, persistent_connections var is initialized to the configuration parameter value, instead of . Besides, after the request of the robots.txt, it controls and set the attribute for persistent connections, depending on whether the server supports them or not. * htdig/Retriever.cc: modified the Start() method. Now the loop manage HTTP persistent connections "on a server" basis. Indeed, it's a Server object that decides if persisent connections are allowed on that server or not (depending on configuration or capabilities of the remote http server). Mon Jan 24 12:57:45 2000 Gilles Detillieux * htsearch/Display.cc(setVariables): Added double quotes around default selection value in build_select_lists handling. Mon Jan 24 12:37:22 2000 Gilles Detillieux * htsearch/Display.cc(setVariables), htcommon/defaults.cc: Added build_select_lists attribute, to generate selector menus in forms. Added relevant explanations and links to selectors documentation. * htdoc/hts_selectors.html: Added this page to explain this new feature, plus other details on select lists in general. * htdoc/hts_templates.html: Added relevant links to related attributes and selectors documentation. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Fri Jan 21 18:57:58 EET 2000 Vadim Chekan * htcommon/HtConfiguration.cc: added HtConfiguration::ParseString(char*) method to allow lexer handle "include: ${var}/file.inc" construction * htcommon/conf_lexer.lxx: fixed handling "include: ${var}file.inc" bug. Fri Jan 21 17:04:28 2000 Loic Dachary * htword/WordList.cc (WalkFinish,WalkInit,WalkNextStep): fix typos in error messages and misleading comment. * htword/WordList.h,WordList.cc: move part of WalkInit in WalkRewind so that we have a function to go back to the beginning of possible matches. Wed Jan 19 21:49:57 2000 Geoff Hutchison * htdig/HTML.cc (do_tag): Only add words for META descriptions, keywords, and IMG ALT attributes if doindex is set. * htcommon/DocumentRef.h: Added Reference_obsolete for documents that should be removed (but haven't). * htdig/Retriever.cc (parse_url): Flag documents that have been modified as Reference_obsolete and update the database. Flag all documents with various errors as something other than Reference_normal, as appropriate--these probably should be pruned. * htdig/Retriever.h: Get rid of GetRef() method--it's only used once! * htsearch/Display.cc (display): Don't show DocumentRefs with states other than Reference_normal--these documents have various errors. * htmerge/docs.cc: If a document has a state of Reference_obsolete, ignore it. * htcommon/HtWordList.h, htcommon/HtWordList.cc (Skip): Change MarkGone() to Skip() to emphasize that this document should be ignored. Wed Jan 19 14:11:51 2000 Loic Dachary * htword/WordList.cc (SkipUselessSequentialWalking): return OK if skipping, NOTOK if not skipping. * htword/WordReference.h: remove useless Clear in WordReference(key, record) constructor. * htword/WordList.h,WordList.cc: Split Walk in three separate functions WalkInit, WalkNext and WalkFinish. Much clearer. Fill the status field of WordSearchDescription to have more information about the error condition. Add found field to WordSearchDescription for WalkNext result. Add cursor_get_flags and searchKeyIsSamePrefix fields to WordSearchDescription as internal state information. * htword/WordList.h,WordList.cc: WalkInit to create and prepare cursor, WalkNext to move to next match WalkNextStep to move to next index entry, be it a match or not WalkFinish to release cursor. * htword/WordList.h: WordSearchDescription::ModifyKey add to jump while walking. * htword/WordList.cc (WalkNext) : it is now legal to step without collection or callback because search contains the last match (found field) and it s therefore not useless. Mon Jan 17 12:15:45 2000 Gilles Detillieux * contrib/htdig-3.2.0.spec: added sample RPM spec file for 3.2 Sat Jan 15 11:53:35 2000 Loic Dachary * htdb/htstat.cc,htdb/htdump.cc: remove useless -S option since the page size is found in the header of the file. * htdb/htstat.cc,htdump.cc,htload.cc: only call WordContext::Initialize if -W flag specified. Fri Jan 14 18:39:12 2000 Marcel Bosc * htword/WordBitCompress.cc: speedup, VlengthCoder::code() finds appropriate coding interval much faster Fri Jan 14 11:30:41 2000 Gilles Detillieux * htdig/Retriver.cc(IsValidURL): Fix problem with valid_extensions, which got lost in the shuffle yesterday. Fri Jan 14 15:56:49 2000 Loic Dachary * htword/WordType.cc,WordRecord.cc,WordKeyInfo.cc (Initialize): change inverted test on instance (== instead of !=). * htword/WordRecord.cc (WordRecordInfo): change inverted test on compare Fri Jan 14 14:24:39 2000 Loic Dachary * htdig/htdig.cc,htmerge/htmerge.cc,htsearch/htsearch.cc: Use Initialize(defaults) to load configuration file if provided. * htword/WordDBCompress.cc (Compress): initialize monitor to null in constructor and check if null before usage. Core dumped in htdb/htload. * htword/WordContext.h (class WordContext): Add Initialize(const ConfigDefaults* config_defaults = 0) that probe configuration files. Usefull when htword is used as a standalone library. Thu Jan 13 19:52:27 2000 Geoff Hutchison * htdig/Retriver.cc: Fix problem with valid_extensions when an "extension" would include part of a directory path or server name, as contributed by Warren Jones. Thu Jan 13 19:22:25 2000 Geoff Hutchison * htnet/Makefile.am, htnet/Makefile.in: Add HtFile to the build process. Thu Jan 13 18:58:03 2000 Geoff Hutchison * htnet/HtFile.h, htnet/HtFile.cc: New Transport classes contributed by Alexis Mikhailov to allow file:// access. * htdig/Document.h, htdig/Document.cc: Add logic to call HtFile objects for URLs. * htcommon/URL.cc: Don't remove a trailing index.html (removeIndex) if the URL is a file://URL. Thu Jan 13 18:49:41 2000 Geoff Hutchison * contrib/conv_doc.pl, contrib/parse_doc.pl: Replace "break" by "last" for correct Perl syntax and additional cleanups and simplifications as contributed by Warren Jones. Thu Jan 13 18:42:29 2000 Geoff Hutchison * htword/WordType.h, htword/WordType.cc: Implementation of new methods IsDigit() and IsCntrl() as contributed by Marc Pohl . Fixes some problems with 8-bit characters. Thu Jan 13 17:17:47 2000 Geoff Hutchison * ChangeLog.0, configure, configure.in, htfuzzy/Endings.cc, htlib/String.cc, htlib/Configuration.cc, htlib/QuotedStringList.cc, htlib/regex.c, htcommon/defaults.cc, htdig/ExternalParser.cc, htdig/Retriever.h, htsearch/Display.cc, include/htconfig.h.in installdir/htdig.conf: Merge in changes from 3.1.x releases. * htdoc/: Merge in documentation changes from 3.1.x releases. Thu Jan 13 20:12:42 2000 Loic Dachary * htword/WordList.cc (Walk): close the cursor before returning. If not doing that the cursor might be closed after the database is closed, leading to double free of the cursor. Bad bug. Thu Jan 13 13:23:17 2000 Loic Dachary * htword/WordContext.h (class WordContext): simplifies a lot. WordContext is no longer a repository for pointers of class instances. Only a place to call Initialize for classes that have a single instance. * htlib/HtWordType.cc: added to include definition of functions shortcuts for WordType. * htword/WordRecord.h,WordType.h,WordKeyInfo.h: implement homogeneous scheme to handle unique instance of the class. - constructor takes const Configuration& argument and init object with config values - static member instance - static method Initialize the static member instance - static method Instance returns the pointer in instance data member * htword/WordRecord.cc: add constructor for WordRecordInfo, and Instance static function. Add WORD_RECORD_INVALID to depict uninitialize WordRecordInfo object. * htword/WordKeyInfo.h: rename SetKeyDescriptionFromFile and SetKeyDescriptionFromString to InitializeFromFile and InitializeFromString and implement them by calling Initialize. rename SetKeyDescriptionRandom to InitializeRandom rename Initialize(String& line) to GetNFields(String& line) rename Initialize(int nfields) to Alloc(int nfields) * htdig/htdig.cc,htmerge/htmerge.cc,htsearch/htsearch.cc,test/word.cc: replace WordList::Initialize with WordContext::Initialize and run immediately after config is read. Otherwise WordType fails to work and configuration value extraction will fail. * htmerge/htmerge.cc: move initialization * test/conf/htdig.conf2.in: reorder so that it looks as much as possible as conf.in Thu Jan 13 12:33:46 2000 Loic Dachary * htdb/htstat.cc,htdump.cc,htload.cc: set proper progname Wed Jan 12 20:02:26 2000 Loic Dachary * htcommon/HtWordList.cc (Dump): Use Walk instead of Collect otherwise does not work. Wed Jan 12 19:38:33 2000 Loic Dachary * htlib/HtDateTime.h (class HtDateTime): killed void SetDateTime(const int t) because they cause problems when time_t is an int and were useless anyway. Wed Jan 12 13:31:45 2000 Loic Dachary * htword/WordBitCompress.h: remove inline qualifier on check_tag1: its not inline * htword/WordKey.h: #define WORD_KEY_UNKNOWN_POSITION to -1. Remove default argument to SetToFollowing so that its more explicit when used with WORD_KEY_UNKNOWN_POSITION. * htword/WordKey.cc: change name of variable info0 to info * htword/WordList.cc: use WordKey::Info instead of WordKeyInfo::Get as done in WordKey.cc for consistency. * htword/WordList.{cc,h},htword/WordDB.h: rename WordCursor to WordDBCursor for consistency. * htword/WordList.h: Kill the WordSearchDescription::Setup useless function * htword/WordList.h: WordSearchDescription constructor now have a straightforward semantics. * htword/WordList.h: Rename Search into Collect since it already existed, just with a different prototype. Wed Jan 12 12:36:46 2000 Loic Dachary * htword/WordList.h (class WordSearchDescription): add cursor member Tue Jan 11 19:33:44 2000 Marcel Bosc * htlib/HtVectorGeneric,htword: Fixed some warnings found when compiling under FreeBSD Tue Jan 11 18:22:58 2000 Marcel Bosc * htlib/HtVectorGeneric.h: inlined functions Add and Allocate which are critical to performance Tue Jan 11 12:18:47 2000 Marcel Bosc * htword/WordKey.h: fixed uninitialized memory read * htword/WordBitCompress.cc: Fixed big number BUG Fixed memeory leak Tue Jan 11 09:37:36 2000 Loic Dachary * htword/WordList.h: move operator << and operator >> to end of functions declarations instead of data members. * htword/WordList.h: added more comments on functions behaviour. * htword/WordList.h: added #if SWIG for Perl interface Mon Jan 10 17:55:05 2000 Marcel Bosc * htword/WordDBPage: enhanced compression debugging output Mon Jan 10 09:07:19 2000 Loic Dachary * WordContext.h,WordKey.h,WordList.h: Added #if SWIG for perl interfaces. Remove InSortOrder, useless now that everything is manipulated in sort order as far as the interface is concerned. * WordKey.cc,WordList.cc: remove InSortOrder * WordKey.h,WordRecord.h,WordReference.h: commented out Set/Get for ascii Set/Get for SWIG. * WordKey.h: turn CopyFrom to public for those who dont want to use operator =. * WordKey.h: rename info -> Info and nfields NFields * WordKey.h: remove int IsFullyDefined() const redundant with Filled Thu Jan 06 14:41:15 2000 Marcel Bosc * htword,all: Changed interface to overloaded Walk function that was ambigous on some compilers... Thu Jan 06 14:00:01 2000 Loic Dachary * htword/WordList.h (class WordSearchDescription): rename setup to Setup * htword/WordList.h (class WordBenchmarking): rename show to Show * htword/WordRecord.{h,cc}, htword/WordReference.h, htword/WordList.h: add comments, reorganize member functions for clarity. Thu Jan 06 12:01:47 2000 Marcel Bosc * htword/compression: Split WordDBCompress.* to WordDBCompress + WordDBPage.* * htword/WordBitCompress: renamed put/get to put_uint/get_uint. added get/put_uint_vl * htword/compression: modified slightly the compression: this makes old databases OBSOLETE: headers compress better. Chaged Flags compress better and faster. * htword/WordKey: added operator [] and Get/Set accessors * htword: removed the obsolete --with_key configure option (KEYDESC) * htword/WordMonitor: addded monitor input Wed Jan 05 14:32:31 2000 Loic Dachary * htword/WordKeyInfo.h (class WordKeyInfo ): if(encode) was if(sort) * htword/WordKeyInfo.h: rename show to Show an nprint to Nprint * htword/WordKeyInfo.h: move WORD_ISA from WordKey.h to WordKeyInfo.h, rename WORD_ISA_String to WORD_ISA_STRING. * htword/WordKey.h: rename FATAL_ABORT to WORD_FATAL_ABORT and errr to word_errr * htword/WordKey.h: move private functions at bottom of class above data members rename show_packed to ShowPacked * htword/WordKey.cc: move WordKeyInfo::SetKeyDescriptionRandom from WordKey.cc to WordKeyInfo.cc * htword/WordKeyInfo.cc: add include htconfig.h Wed Jan 05 13:26:16 2000 Loic Dachary * htdig/ExternalParser.cc (parse): use nocase_compare instead of mystrcasecmp to suppress warnings. (char*)String for mystrncasecmp that has no equivalent in the String class. * htdig/Retriever.cc (IsValidURL): remove warning by (char*)url Wed Jan 05 11:54:19 2000 Loic Dachary * htword/WordKey.h: kill obsolete comment and add suffix explanation at the beginning of the file. * htword/WordKey.h (class WordKey): rename copy_from and initialize to CopyFrom and Initialize to fit naming conventions. Reorganize the methods to group them in logical sets. Fix indenting. Comment each method. * htword/WordKey.h (Clear): add kword.trunc() * htword/WordKey.h: protect SetWord(const char *str,int len) because it opens the door to all kind of specific derivations. Should be SetWord(String(foo, foo_length)) if not performance critical. Wed Dec 29 18:41:14 1999 Marcel Bosc * htlib/HtMaxMin: added max/min of arrays, added comments to HtMaxMin. Added HtMaxMin.cc all these are used in htword * htlib/HtTime.h: added comments. included portable time.h * htlib/HtVectorGeneric.cc: added HtVector_double, HtVector_String * htlib/HtVectorGeneric.h: inlined several methods, disactivated CheckBounds * htlib/StringMatch.cc: removed #include"WordType.h", this made htlib dependant on htword, which is not acceptable for a library * htlib/HtWordType.h: this replaces the macros used in StringMatch.cc * htlib/HtRandom.h: added tools for using random number (this is used currently in tests) * htword/WordBitCompress.cc: transfered max_v/min_v to htlib * htword/WordBitCompress.cc: optimized put/get for better performance * htword/WordMonitor: system for detailed monitoring of operation and performance within htword * htword/WordDBCompress: fixed compression for case of empty WordRecord * htword/WordDBCompress: cleaned up some code added some comments * htword/WordKeyInfo: split WordKey files into WordKey and WordKeyInfo files * htword/WordContext: centralized global configuration into one class * htword/WordKey: inserted randomized key/keydescription into WordKey classes (this was previously used in several tests) * htword/WordKey: optimized Compare, UnpackNumber for speed (these are really speed critical) * htword/WordRecord: is now configurable, type can be configured to "DATA" (htdig) or "NONE" (for other uses) * htword/WordType: changed macros to global functions to make it compatible with cleanup in StringMatch. Integrated WordType to WordContext configuration/Initialization * htword/WordKeyInfo: fixed initialization from key descrition file Tue Dec 28 18:58:21 EET 1999 Vadim Chekan * htlib/String.cc: String::lowercase(), String::uppercase() support for national character added. * htfuzzy/Prefix.cc: method "prefix" works now. Mon Dec 27 22:17:48 1999 Loic Dachary * htdig/htdig.cc (main): change '\r\n' to "\r\n" * Makefile.config,db/dist/Makefile.in: rename libdb to libhtdb to prevent conflicts with installed libdb. * db/dist/Makefile.in: do not install documentation nor binary utilities (db_dump & al) since they are replaced by htdb binaries (htdump & al). * db/dist/Makefile.in (prefix): prepend $(DESTDIR) to prefix to support make DESTDIR=/staging install for binary distribution packages generation. * configure.in: use AC_FUNC_ALLOCA to check for alloca. Used in regex and test/dbbench.cc only but definitely a usefull feature to have. Thu Dec 23 11:10:24 1999 Marcel Bosc * htcommon/defaults.cc: set wordlist_cache_size default to 10Meg * db/mp: removed some debuging messages * htword/WordList.cc: added warning if no cache * test/word.cc: added cache * htlib/HtTime.h: added ifdefs for portable time.h sys/time.h Tue Dec 21 23:33:06 1999 Loic Dachary * htdoc/attrs.html,cf_by*.html: regenerate to include wordlist_wordkey_description attribute * htcommon/Makefile.am: Add AM_LFLAGS = -L and AM_YFLAGS = -l to prevent #line generation because it confuses the dependencies generator of GCC if configure run out of source tree. * configure.in: remove --with-key option. Not needed since word description now dynamic. Destroyed WordKey.h if specified. * htword/Makefile.am: remove commented lines for WordKey.h generation. Tue Dec 21 18:18:01 1999 Marcel Bosc * htword: added code for benchmarking Mon Dec 20 17:59:15 1999 Marcel Bosc * WordKey: Made the key structure dynamic: Changing the key structure used to imply recompiling the htword library. This should not change anything in htdig. * WordKey: numerical key fields are stored in an array of unsigned ints instead of compile-time defined pools. * WordKey.h: WordKey now needs copy opreators. Setbits are stored in sort order (used to be in encoding order) * htword: word_key_info is now a pointer, had to change all references * word.cc: Rewrote wordkey test for new dynamically set key structure. The test randomly creates key structures and tests them. * test: adapted test files (simplifies things a lot) 1999-12-21 Toivo Pedaste * htlib/Dictionary.cc: Fix memory leak when destroying dictionary * htlib/StringList.cc, htdig/Retriever.cc: Fix memory leak, not the most elegent way but I'm not sure about the exact semantics of StringList Mon Dec 20 21:59:03 1999 Loic Dachary * htdb/{Makefile.am,err.c,getlong.c}: Fix mistake: err.c and getlong.c contain C functions (declared in clib_ext) and must be C compiled otherwise the prototype won't fit. Checking db Makefiles, getlong.c and err.c are added to the list of objects for each utility program. This guaranties that they won't conflict with objects included in libdb.a. Sun Dec 19 20:04:42 1999 Loic Dachary * htdb/{Makefile.am, err.cc}: add err.cc for portability purposes. Fri Dec 17 18:04:09 1999 Loic Dachary * Makefile.config: add PROFILING variable and document it. Designed to enable profiling of htdig easily. * */Makefile.am: add *_LDFLAGS = $(PROFILING) for every binary to enable profiling, if specified. Thu Dec 16 17:16:33 1999 Loic Dachary * htdb/*.cc: add -W option to activate htword specific compression. Keep compatibility with zlib compression (-z only). Thu Dec 16 11:56:02 1999 Loic Dachary * test/dbbench.cc: change wrong strcpy with memcpy Wed Dec 15 15:04:39 1999 Gilles Detillieux * htdig/htdig.cc(main): Handle list of URLs given on stdin, if optional "-" argument given. (Uses >> operator below.) * htlib/htString.h, htlib/String.cc: Added Alexis Mikhailov's String input methods, readLine() and >> operator. Wed Dec 15 13:59:34 1999 Gilles Detillieux * htdig/Retriever.cc: remove include of sys/stat.h, which is no longer needed after hack removed from Need2Get(), and could pose a problem on systems that need sys/types.h included first. Wed Dec 15 17:00:04 1999 Loic Dachary * htword/WordDB.h: add inline keyword for portability * htword/WordDB.h: add CmprInfo method to get object describing compression scheme for Berkeley DB * htdb: Add htdump, htload, htstat equivalent of db_dump db_load and db_stat that know about htword specific compression strategy. * htword/WordDBCompress: add static to localy defined functions and variables, remove unecessary #define and #include from header. Tue Dec 14 21:56:57 EET 1999 Vadim Chekan * htcommon/conf_parser.lxx, htcommon/conf_lexer.cxx: bcopy on Solaris is in strings.h, not in string.h. Added check for #ifdef HAVE_STRINGS_H Tue Dec 14 19:18:22 1999 Marcel Bosc * WordBitCompress: code cleaned up and commented Tue Dec 14 18:32:21 1999 Loic Dachary * htword/Word{Record,Reference,Key}: added a Get method to convert the structure into it's ascii string representation. operator << now uses Get. Tue Dec 14 17:46:33 1999 Loic Dachary * db/dist/Makefile.in (install): fix bugous test for libshared Tue Dec 14 14:10:28 1999 Loic Dachary * htword/{WordKey,WordReference,WordRecord}: rework the input methods (operator >>). Each class now has a Set function to initialize itself from an ascii description and a Get function to retrieve an ascii description of the object. * htword/WordList: operator >> has a better and cleaner input loop using StringList and String instead of char*. Tue Dec 14 12:06:24 1999 Marcel Bosc * WordDBCompress.cc : Added compression version checking Mon Dec 13 21:09:31 EET 1999 Vadim Chekan * htcommon/conf_parser.lxx, htcommon/conf_lexer.cxx: Added #include Without it failed to compile on Solaris. Mon Dec 13 16:31:27 1999 Marcel Bosc * htword/WordBitCompress.cc : fixed bug that made compression fail on big documents or big number of url's ... Mon Dec 13 13:49:35 1999 Loic Dachary * htword/WordKey.h.tmpl: Added *_POSITION macro generation Mon Dec 13 11:51:50 1999 Marcel Bosc * htcommon/conf_parser.yxx: fixed several delete that should be delete [] Sun Dec 12 17:14:00 EET 1999 Vadim Chekan * htcommon/conf_lexer.lxx, htcommon/conf_lexer.cxx: national symbols are allowed in right part of expressions (noted by Marcel Bosc). Changed default behavior of flex from print unknown chars on stdout to exit with error message. Sat Dec 11 17:34:03 EET 1999 Vadim Chekan * htdig/Retriever.cc,htdig/htdig.cc: "exclude_urls","bad_querystr" "bad_extensions","valid_extensions","local_default_doc" changed for new config. * htdig/Server.cc: "server_max_docs","server_wait_time" changed for new config. * check for "limit_normalized" moved from Retriever::got_href and Retriever::got_redirect to more appropriate Retriever::IsValidUrl Fri Dec 10 18:05:48 1999 Marcel Bosc * htword: checked for failed memory allocations in compression code Fri Dec 10 18:03:42 1999 Marcel Bosc * htword/WordList,htcommon/HtWordList.cc,htmerge/words.cc: cleaned up WordList::Walk() function, change two occurences of WordList::Walk in htdig files Fri Dec 10 17:40:22 1999 Marcel Bosc * htword/WordKey.cc (Compare): Fixed bug: compare used to compare chars and not unsigned chars, this failed when non-ascii caracters were used Fri Dec 10 11:54:36 1999 Marcel Bosc * htcommon/defaults.cc : doc for wordlist_cache_size Thu Dec 09 17:07:47 1999 Marcel Bosc * htcommon/defaults.cc: added defaults for compression and DB configuration parameters Thu Dec 09 16:47:54 1999 Loic Dachary * db/dist/configure.in,Makefile.in: Added shared lib support for linux only. Not enabled if not on linux. Thu Dec 09 15:07:11 1999 Loic Dachary * acinclude.m4,db/dist/acinclude.mr: CHECK_ZLIB now fails if either zlib.h or libz is not found. * configure.in: do not test zlib.h * db/db/db.c,db/mp/mp_fopen.c: added #ifdef HAVE_ZLIB so that compilation works if zlib is not found * htlib/.cvsignore: remove wrong *.cxx * test/dbbench.cc: added #ifdef HAVE_ZLIB so that compilation works if zlib is not found Thu Dec 09 13:25:45 1999 Marcel Bosc * test/Word.cc,t_wordlist,Makefile.am: upgraded tests * htcommon/HtWordList.h: fixed Configuration/HtConfiguration problem Thu Dec 09 12:10:32 1999 Marcel Bosc * htword: Added the compression code: * WordDBCompress: Classes for page specific compression code * WordBitCompress: Classes for bitstreams and non-specific compression Thu Dec 9 12:09:51 EET 1999 Vadim Chekan * htcommon/HtConfiguration.cc: bug fix: sometimes htConfiguration::Find(url,char*) retuned empty values even if there was something to return. Thu Dec 09 11:15:30 1999 Marcel Bosc * htlib/Configuration.cc (Read): Read is now a virtual function: the old one for Configuration the new one (Vadim's ... with the parser) in HtConfiguration Thu Dec 09 11:01:22 1999 Loic Dachary * acinclude.m4: upgrade AC_PROG_APACHE macro for modules detection. * test/conf/httpd.conf,test/test_functions.in,test/conf/Makefile: use @APACHE_MODULES@ to accomodate various apache modules directory flavors. Tue Dec 07 20:32:34 1999 Marcel Bosc * htdig: Split the Configuration class into Configuration and HtConfiguration. All the HtConfiguration and the configuration parsing (lex..) was woved to htcommon. Configuration was replaced by HtConfiguration as needed Tue Dec 07 16:21:13 1999 Loic Dachary * configure.in: added AM_PROG_LEX and AC_PROG_YACC * htlib/Makefile.am: simply set conf_lexer.lxx and conf_parser.yxx, automake knows how to handle these. The renaming is needed to avoid conflicts in automake generated rules. Mon Dec 6 16:23:39 CST 1999 Gilles Detillieux * htdoc/cf_generate.pl: added a bit of error checking for when it can't fetch the config info, and made it more flexible for what it allows as terminator. * htcommon/defaults.cc: add default and description for authorization attribute, and clean up external_protocols entry for cf_generate.pl. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl * htdig/htdig.cc(main): set authorization parameter before Retriever constuctor is called, as it may initialize a Server. (Should complete fix of PR#490.) Mon Dec 6 21:34:29 EET 1999 Vadim Chekan * htdig/Document.cc htdig/htdig.cc: "authorization" parameter in config is added and is new config compatible. New code has'n got PR#490 bug (don't authentificate robot.txt) Mon Dec 06 11:58:56 1999 Marcel Bosc * HtVectorGeneric.h: generic vectors, stl-free: this was originally a copy of HtVector.h with Object * replaced by GType and some small changes. It has been modified and checked to see if it all works ok. You can build vectors of any type that has an empty constructor. * HtVectorGenericCode.h: generic vectors, stl-free: implementation (modified "copy" of HtVector.cc) * HtVectorGeneric.cc: generic vectors: implementation for common types * HtVector_int.h: generic vectors: declaration for the most common type (and example of howto use) Sat Dec 4 23:49:18 1999 Geoff Hutchison * htfuzzy/Synonym.cc (createDB): Change declaration to match Fuzzy::createDB(config), allowing the method to be called by htfuzzy. * htfuzzy/htfuzzy.cc (main): Add an error message if fuzzy->createDB() comes back with an error. Sat Dec 4 15:38:34 EET 1999 Vadim Chekan * htnet/HtHTTP.cc, htnet/HtHTTP.h, htdig/Document.cc fixed proxy bug. GET command in HtHTTP included only path of url insead full url when use proxy. HtHTTP::UseProxy(int) added. * htdig/Document.cc: make "http_proxy" parameter url-depended for new configuration. Fri Dec 03 14:57:13 1999 Marcel Bosc * BerkelyDB: Compression code: added possibility to use user-defined compression routines (the goal is to enable the mifluz-specific DB page compression that obtains higher compression ratios than generic zlib compression) this envolves the following changes in BerkeleyDB: * BerkelyDB/CompressionEnvironment: Adding a structure db_cmpr_info in db_env that permits db user to specify the external compression routines and other information related to compression * BerkelyDB/CompressionEnvironment: Adding a cmpr_context structure to DB_MPOOLFILE that stores information that compression needs (the _weacmpr DB and the db_cmpr_info) * BerkelyDB/Compression: Needed to modify the compression system (that is implemented in the BerkelyDB memory pool) to permit higher compression ratios and to use the compression environment Thu Dec 2 16:47:30 1999 Geoff Hutchison * htdig/Retriever.cc(parse_url): Use a static int to avoid re-fetching local_urls_only from the config object. (Initial, got_href, got_redirect): Try to get the local filename for a server's robots.txt file and pass it along to the newly generated server. * htdig/Server.cc(ctor): Retrieve the robots.txt file from the filesystem when possible and respect the local_urls_only option. * htdig/Server.h: Change type of local_robots_file to String* to better match Retriever::GetLocal(). Thu Dec 02 16:24:27 1999 Loic Dachary * htword/WordReference.cc,WordKey.cc,WordRecord.cc (Print): Add function to ease printing from Perl. Thu Dec 02 16:06:29 1999 Loic Dachary * htword/WordReference.h (WORD_FILLED): remove unused WORD_FILLED and WORD_PARTIAL macros Wed Dec 01 19:18:42 1999 Loic Dachary * htword/WordKey.h.tmpl,WordRecord.h,WordReference.h, WordList.h: Added #ifndef SWIG for www.swig.org sake. Wed Dec 1 19:47:20 1999 Geoff Hutchison * htlib/HtRegex.cc, htlib/HtRegex.h (set*): Add a case_sensitive flag which defaults to insensitive. This better mirrors the StringMatch class. * htcommon/URL.cc(signature): Make the signature a proper URL to the base of the server. * htdig/Server.h: Add IsDead() methods to query the status of the server, as well as an IsDisallowed() method to query whether a URL is forbidden by the robots.txt rules. Change _disallow to HtRegex. * htdig/Server.cc(ctor): Only retrieve the robots.txt file if this is an http or https server. (robotstxt): Use the proper HtRegex method for setting the pattern. (push): Remove logic checking the _disallow patterns. This is now done by the Retriever object. * htcommon/defaults.cc: Add new attribute "local_urls_only" which defaults to false, which dictates whether retrieval should revert to another method if RetrieveLocal() fails. * htdig/Retriever.cc(parse_url): Check to see if the server is dead before calling the Retrieve() method. Notify the server object if a connection fails. Also respects the new local_urls_only attribute as described above. (IsValidURL): Check the server's IsDisallowed() method to see if the robots.txt forbids this URL. * htdoc/THANKS.html: Updated to reflect current contributions, etc. * README: Update to mention version 3.2.0b1. Wed Dec 1 17:05:48 1999 Gilles Detillieux * htdig/Retriever.cc(GetLocal): Fix error in GetLocalUser() return value check, as suggested by Vadim. Wed Dec 1 15:57:09 1999 Gilles Detillieux * contrib/conv_doc.pl: Added a sample external converter script. Mon Nov 29 23:19:35 1999 Geoff Hutchison * htdig/Retriver.cc, htdig/Retriver.h, htdig/Server.cc, htdig/Server.h: forward-ported patch provided by Alexis Mikhailov and Gilles's for cleaning up IsLocal/GetLocal. Makes local digging persistent, even when HTTP server is down. Mon Nov 29 22:35:06 1999 Geoff Hutchison * test/url.cc: New test for URL class. * test/url.parents: Base URLs for parsing. * test/url.children: Derived relative URLs for testing. * test/Makefile.am, test/Makefile.in: Add the above for building. * htcommon/URL.cc: A variety of bug fixes (some hacks), especially for file:// and user@host URLs. Sun Nov 28 00:35:59 1999 Geoff Hutchison * .version: Bump to 3.2.0b1-dev. Sat Nov 27 20:23:14 1999 Geoff Hutchison * htdig/ExternalTransport.h, htdig/ExternalTransport.cc: New class to allow external scripts to handle transport methods. * contrib/handler.pl: Example handler using the program 'curl' to handle HTTP or HTTPS transactions. * htcommon/defaults.cc: Add new configuration option 'external_protocols' as a list of protocols and scripts to handle them. Documentation currently needs to be written. * htdig/Document.h, htdig/Document.cc(Retrieve): Call ExternalTransport::canHandle to establish which protocols are supported by handler scripts and then create an appropriate transport object. * Makefile.in, htdig/Makefile.am, htdig/Makefile.in: Add dependencies for ExternalTransport class. * htnet/HtHTTP.h, htnet/HtHTTP.cc, htnet/Transport.h, htnet/Transport.cc: Move _location field from HtHTTP_Response to Transport_Response to allow other subclasses to use it. Similarly, move NewDate and RecognizeDateFormat to Transport. Fri Nov 26 17:07:52 1999 Gilles Detillieux * htdig/HTML.cc(HTML & do_tag): add code to turn off indexing between tags. Fri Nov 26 15:56:47 1999 Gilles Detillieux * htsearch/Display.cc(setVariables): added Alexis Mikhailov's fix to check the number of pages against maximum_pages at the right time. * htlib/String.cc(write): added Alexis Mikhailov's fix to bump up pointer after writing a block. Wed Nov 24 15:10:05 1999 Geoff Hutchison * installdir/htdig.conf: Add bad_extensions to make it more obvious to users how to exclude certain document types. Tue Nov 23 19:29:37 CST 1999 Gilles Detillieux * htnotify/htnotify.cc(send_notification): apply Jason Haar's fix to quote the sender name "ht://Dig Notification Service". Tue Nov 23 19:46:00 EET 1999 Vadim Chekan * conf.tab.cc.h conf.l.cc conf.tab.cc Added files pre-generated from conf.y, conf.l Sun Nov 21 18:26:21 EET 1999 Vadim Chekan *htdig/Document.cc: "max_doc_size" supports new configuration and is url-depended now. Sun Nov 21 17:06:50 EET 1999 Vadim Chekan * New config parser commited. htlib/(Makefile.am,Makefile.in), htlib/Configuration.cc, htlib/Configuration.h htlib/(conf.y, conf.l) added. Fri Nov 12 14:17:37 1999 Gilles Detillieux * htcommon/cgi.cc(init): Fix bug in reading long queries via POST method (PR#668). Wed Nov 10 15:34:04 1999 Gilles Detillieux * htsearch/Display.cc(setVariables & createURL), htsearch/htsearch.cc(main), htdoc/hts_templates.html: handle keywords input parameter like others, and make it propagate to followups. Wed Nov 10 15:16:57 1999 Gilles Detillieux * htdig/Retriever.cc: Fix PR#688, where htdig goes into an infinite loop if an entry in local_urls (or local_user_urls) is missing a '=' (or a ','). * htcommon/defaults.cc: removed vestigial references to MAX_MATCHES template variables in search_results_{header,footer}. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl * htdoc/hts_form.html: add disclaimer about keywords parameter not being limited to meta keywords. * htdoc/meta.html: add description of "keywords" meta tag property. add links to keywords_factor & meta_description_factor attributes. 1999-11-10 Toivo Pedaste * htdig/Retriever.cc : Ignore SIGPIPEs with persistant connections * htnet/HtHTTP.cc : Fix buffer overrun reading chunks * htdig/Document.cc : Make redirects work * htdig/Retriever.cc : Make valid URL checks apply to initial URL's particularly those from a previous run * htlib/Dictionary.cc : Fix memory deallocation error Tue Nov 02 13:44:57 1999 Marcel Bosc * htsearch/Display.cc (setVariables): parentheses missing around ternary operator : confusion in priority with <<. Tue Nov 02 13:33:50 1999 Marcel Bosc * htsearch/Display.cc (hilight): changed static char * (!!) to const string, static char evaluated before configuration is loaded so config had no effect + unnecesary conversion Tue Nov 02 11:45:49 1999 Marcel Bosc * htword/WordKey.cc : Cleaned up obsolete code now using *InSortOrder fcts and WordKeyInfo.sort[] * htword/WordKey : Added FirstSkipField : find first field that must be checked for skip * htword/WordKey (PrefixOnly): now returns OK/NOTOK, fixed bug which made Walk loop over the whole db if the searchkey just had a the "word" field defined * htword/WordKey.cc (Unpack): had forgten to: SetDefinedWordSuffix * htword/WordKey.cc (operator >>): added check for very very long words (even if this should never happen) * htword/WordKey.cc (operators << >>): added word suffix handling * htword/WordKey.h : Filled() did not check for WordSuffix * htword/WordKey.h : added WordKey::ExactEqual * htword/WordKey.h (IsDefinedWordSuffix): fixed bad flag check * htword/WordList : Removed all obsolete HTDIG_WORDLIST flags: only two remain : COLLECTOR and WALKER the rest is now specified by the searchKey removed action arg to WordList::Collect() * htcommon/HtWordList.cc,htmerge/words.cc : changed flags in calls to WordList::Walk * htword/WordList.cc : skip now deals with the SuffixUndefined case Fri Oct 29 17:13:21 1999 Gilles Detillieux * htdoc/cf_generate.pl: now updates last modified date in attrs.html * htdoc/attrs.html: reran cf_generate.pl Fri Oct 29 15:28:22 1999 Gilles Detillieux * htsearch/Display.cc(setVariables & hilight): added Sergey's idea for start_highlight, end_highlight & page_number_separator attributes. * htcommon/defaults.cc: added & documented these. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Thu Oct 28 13:06:23 1999 Gilles Detillieux * htdig/ExternalParser.cc: added support for external converters as extension to external_parsers attribute. * htcommon/defaults.cc: Updated external_parsers with new description and examples of external converters. Thu Oct 28 12:52:28 1999 Gilles Detillieux * htcommon/defaults.cc: Updated programs lists for *_factor, so they all refer to htsearch and not htdig. Added htsearch to programs lists for translate_*. img_alt_factor & url_factor not defined yet because they're still not used in htdig/htsearch. Wed Oct 27 15:53:36 1999 Gilles Detillieux * htcommon/defaults.cc: added descriptions & examples for doc_excerpt, heading_factor, max_descriptions, minimum_speling_length, regex_max_words, use_doc_date, valid_extensions. Added references to these elsewhere in document as appropriate. Removed -pairs option from pdf_parser default (again). Minor changes to noindex_start & end, and changed example for modification_time_is_now. Corrected references to heading_factor_[1-6]. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Oct 27 13:32:50 1999 Gilles Detillieux * htdoc/cf_generate.pl: changed formatting of output to more closely match format of old attrs.html (to make diff'ing easier), and fixed handling of pdf_parser default to strip quotes. * htcommon/defaults.cc: oops, fixed typo in url_part_aliases example. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Oct 27 18:24:36 1999 Loic Dachary * htdoc/cf_generate.pl: fixed wrong target for cf_byprog, escape HTML chars <>&'" for default values. Wed Oct 27 10:21:18 1999 Gilles Detillieux * htcommon/defaults.cc: restored 2nd example for url_part_aliases Tue Oct 26 16:28:29 1999 Gilles Detillieux * htcommon/defaults.cc: corrected descriptions for allow_in_form, search_results_header, noindex_start, noindex_end. Also fixed a few small typos & formatting errors here & there in descriptions and examples. Tue Oct 26 16:01:22 1999 Loic Dachary * htword/Makefile.am: rm Wordkey.h instead of chmod to copy with non existent WordKey.h Tue Oct 26 10:54:52 1999 Loic Dachary * htcommon/default.cc: fixed all inconsistencies reported by Gilles. Mon Oct 25 11:42:13 1999 Marcel Bosc * htword/ word.cc,t_wordskip,skip_db.txt: Added test for *Skip Speedup* * htword/ WordList: Added tracing of Walk() for debuging purposes Fri Oct 22 18:22:00 1999 Marcel Bosc * htword/ WordList.cc,WordKey: Added a defined/undefined flag for saying if a search key's word is a prefix or not: WORD_KEY_WORDSUFFIX_DEFINED reduces code size and makes it much easier to undertand * htword/ WordList,WordReference,WordKey: Added input output streams for WordList,WordReference,WordKey Wed Oct 20 16:47:52 1999 Marcel Bosc * htword/ WordKey,Makefile.am,WordCaseIsAStatements.h: for readability replaced the switch ... #ifdef ..STATEMENT().... sequence that apeared many times with an include file :WordCaseIsAStatements.h * htword/ WordKey: WordKeyInfo: duplicated all of the fields structure into sort structure, for fast acces without cross referencing and for simplifying code (required change of perl in template WordKey.h.tmpl) * htword/ WordList: *Skip Speedup* added a speedup to avoid wasting time by sequentialy walking through useless entries. see function: SkipUselessSequentialWalking() for an example and more info * htword/ WordKey.h,WordKey.cc: Changed Set,Unset,IsSet Wordkey accesors' names to: SetDefined,Undefined,IsDefined. (easier to read and avoids naming conflicts) * htword/ WordKey: added generic numerical accesors for accesing numerical fields in WordKey (in sorted order):GetInSortOrder,SetInSortOrder * htword/ WordKey,word_builder.pl: added a MAX_NFIELDS constant, that specifies a maximum number of fields that a WordKey can have. Sanity check in word_builder.pl. * htword/ word_builder.pl: enforced word sort order to ascending * htword/ WordList: added a verbose flag using config."wordlist_verbose" Tue Oct 19 18:36:42 1999 Loic Dachary * htword/WordType.h: const accessors to wtype and config Tue Oct 19 13:10:47 1999 Loic Dachary * acconfig.h: remove uncessary VERSION (redundant) Tue Oct 19 11:32:38 1999 Loic Dachary * db/Makefile.in,db/dist/Makefile.in: install db library so that external applications can be linked. Tue Oct 19 10:57:27 1999 Loic Dachary * configure.in: add --with-key to specify alternate to htword/word.desc * configure.in: htword is done before htcommon to prevent unecessary recompilation because WordKey.h changes. * htword/Makefile.am: use @KEYDESC@ Tue Oct 19 10:38:41 1999 Loic Dachary * test/word.cc use TypeA instead of DocID and the like Mon Oct 18 17:21:34 1999 Loic Dachary * Makefile.config: AUTOMAKE_OPTIONS = foreign Mon Oct 18 11:40:17 1999 Marcel Bosc * htword/ WordList.cc (Walk): fixed bug in Walk: if flag HTDIG_WORDLIST was set then data was uninitialized in loop Fri Oct 15 18:52:03 1999 Marcel Bosc * htdig/Document.h (class Document): added const to: Transport::DocStatus RetrieveLocal(HtDateTime date, const String filename); Fri Oct 15 17:46:23 1999 Loic Dachary * acinclude.m4,configure.in: modified AC_APACHE_PROG to detect version number and control it. * test/conf/*.in: patch to fit module loading or not, accomodate various installation configurations. * test/test_functions.in: More portable call to apache. Fri Oct 15 12:55:47 1999 CEST Gabriele Bartolini * htdig/Document: added the management of 'persistent_connections', 'head_before_get', 'max_retries' configuration attributes. Fri Oct 15 12:54:11 1999 CEST Gabriele Bartolini * test/testnet.cc: added the option '-m' for setting the max size of the document. Fri Oct 15 12:48:49 1999 CEST Gabriele Bartolini * htdig/Server: added a flag for persistent connections. It's set to true if the Server allows persistent connections. It should be used when retrieving a document. Fri Oct 15 12:45:42 1999 CEST Gabriele Bartolini * defaults.cc: added the configuration attributes 'persistent_connections', 'max_retries' and 'head_before_get'. Their default values are respectively true, 3, false. Fri Oct 15 12:35:51 1999 CEST Gabriele Bartolini * HtHTTP.cc: managing of uncompleted stream reading with persistent connections (it occurs when max_doc_size is lower than the real content length of the document, or when a document is not parsable and we asked for it with a GET call). * Transport: _host variable is treated as a String, as Loic suggested. Fri Oct 15 12:11:23 1999 Marcel Bosc * Added README to htword Thu Oct 14 11:29:35 1999 Geoff Hutchison * htlib/mktime.c, htlib/regex.c, htlib/regex.h, htlib/strptime.c: Updated with latest glibc versions. Merging from glibc sources may have introduced bugs, so this is the last merge before htdig-3.2.0b1. Thu Oct 14 13:09:32 1999 CEST Gabriele Bartolini * htnet/Transport: added statistics for open and close of connections and changes of servers. Fixed a bug in the SetConnection method, regarding the host comparison. Added a method for showing the statistics on a given channel. * htnet/HtHTTP: More debug info available. Added a method for showing the statistics on a given channel. * test/testnet.cc: now receives changes above. Wed Oct 13 13:35:42 1999 CEST Gabriele Bartolini * htdig/Document.h: added an HtHTTP pointer to the class. * htdig/Document.cc: Transport and HtHTTP initialization methods inside the Document constructur. The class destructor now calls only the HtHTTP destructor (not the Transport destructor). Modified the Retrieve method. * htdig/Server.h: _last_connection is now an HtDateTime object. * htdig/Server.cc: _modified the constructor and the delay method. * htdig/Retriever.cc: modified the parse_url function in order to manage all the Document status messages coming from the Transport class. Also modified the method for not found URLs for managing the no_port status. Tue Oct 12 10:12:10 1999 Loic Dachary * install headers and libraries so that htdig libraries may be used by external programs * htword/WordList.cc,WordType.cc: add comments about config parameters used. Fri Oct 8 09:35:30 1999 Geoff Hutchison * htlib/HtDateTime.cc (SetFTime): Change buffer argument to const char* to prevent problems passing in const buffers. * htnet/HtHTTP.h: Change SetUserAgent to take a const char* to prevent problems passing in const parameters. * htdig/Document.h, htdig/Document.cc(): Use Transport class for obtaining documents. Remove duplication of declarations (e.g. DocStatus). * htdig/Retriever.cc: Adapt switch statements from Document::DocStatus to Transport::DocStatus. * htdig/Server.cc: Use Document::Retrieve instead of RetrieveHTTP. Fri Oct 08 16:35:16 1999 Loic Dachary * test/t_htnet: succeed if timeout occurs. It was the opposite. * configure.in: AC_MSG_CHECKING(how to call getpeername?) add missing comma at end for header spec block. Fri Oct 08 14:42:47 1999 Loic Dachary * Fix all warnings reported by gcc-2.95.1 related to string cast to char*. Fri Oct 08 14:04:21 1999 Loic Dachary * htlib/Configuration,ParsedString,Dictionary: change char* to String where possible. * Fix a lot of warnings reported by gcc-2.95.1 related to string cast to char*. * Completely disable exception code from db. Fri Oct 08 13:44:32 1999 CEST Gabriele Bartolini * HtHTTP.cc: fixed a little bug in setting the modification time if not returned by the server. Fri Oct 08 11:30:53 1999 CEST Gabriele Bartolini * HtHTTP.cc: better management of connection failures return values. * Transport.h: added Document_no_connection and Document_connection_no_port enum values. * testnet.cc: management of above changes. Fri Oct 08 11:27:31 1999 CEST Gabriele Bartolini * configure.in: modified getpeername() test. Fri Oct 08 10:28:15 1999 Loic Dachary * htdig/Retriever.cc (IsValidURL): test return value of ext = strrchr(url, '.'); * htword/WordRecord.h: initialize info member to 0 in constructor and Clear. * htlib/Configuration: char* -> String to all functions. Resolve warnings. Thu Oct 07 16:19:46 1999 Loic Dachary * htnet/HtHTTP.cc (ReadChunkedBody): use append instead of << because buffer is *not* null terminated. * htnet/Transport.cc (Transport): initialize _port and _max_document_size otherwise comparison with undefined value occurs. Thu Oct 07 16:34:21 1999 CEST Gabriele Bartolini * HtHTTP.cc: call FinishRequest everytime in HTTPRequest() a value is returned. * testnet.cc: improved with more statistics and connections timeouts control. Thu Oct 07 12:53:12 1999 CEST Gabriele Bartolini * configure.in: modified getpeername() test function with AC_LANG_CPLUSPLUS instead of AC_LANG_C. Thu Oct 07 11:56:52 1999 CEST Gabriele Bartolini * HtHTTP.cc : fixed bug of double deleting _access_time and _modification_time objects in ~HtHTTP(). Thu Oct 07 10:17:22 1999 Loic Dachary * htword/WordRecord.h: change (const char*) cast to (char*) * htword/WordKey.h.tmp: fix constness of accessors, const accessor returns const ref. Prevents unecessary copies. Wed Oct 6 23:31:50 1999 Geoff Hutchison * htnet/Connection.h, htnet/Connection.cc: Merge in io class. Connection class was the only subclass of io. * Makefile.in, htlib/Makefile.am, htlib/Makefile.in: Update for removed io class. * htdig/ExternalParser.cc: Add more verbose flags for errors. Wed Oct 06 14:56:34 1999 Loic Dachary * htnet/Connection.cc (assign_server): use free, not delete on strdup allocated memory. * htcommon/URL.cc (URL): set _port to 0 in constructors. Wed Oct 06 12:08:38 1999 Loic Dachary * Move htlib/HtSGMLCodec.* to htcommon to prevent crossed interdependencies between htlib and htcommon Wed Oct 06 12:07:32 1999 Gabriele Bartolini * HtHTTP.cc: patch from Michal Hirohama regarding the SetBodyReadingController() method Wed Oct 06 11:49:15 1999 Loic Dachary * Move htlib/HtZlibCodec.* htlib/cgi.* to htcommon to prevent crossed interdependencies between htlib and htcommon Wed Oct 06 11:40:48 1999 Gabriele Bartolini * HtHTTP: stores the server info correctly and removed some debug info in chunk managing Wed Oct 06 11:39:12 1999 Loic Dachary * Move htlib/*URL* to htcommon Wed Oct 06 10:09:19 1999 Loic Dachary * README: add htword * test/t_htnet: fix variable set problem & return code problem Wed Oct 06 08:53:52 1999 Gabriele Bartolini * Written t_htnet test Tue Oct 5 12:24:43 1999 Geoff Hutchison * db/*: Import of Sleepycat's Berkeley DB 2.7.7. * db/db/db.c, db/include/db.h, db/include/db_cxx.h, db/mp/mp_bh.c: Resolve conflicts created in merge. Tue Oct 05 18:53:13 1999 Loic Dachary * htdig/Display.cc, htword/*.cc: add inclusion of htconfig.h Tue Oct 05 14:54:17 1999 Loic Dachary * htlib/htString.h (class String): add set(char*) * htword/WordKey.cc: define typedefs for key components. Leads to more regular code and no dependency on a predefined set of known types. All types must still be castable to unsigned int. Assume Word of type String always exists. Generic Get/Set/Unset methods made simpler. Added const and ref for Get in both forms. * htword/WordList.cc: enable word reference counting only if wordlist_extend configuration parameter is set. This parameter is hidden because no code uses per word statistics at present. It is only activated in the test directory. * htword/word_list.pl: add mapping to symbolic type names, force and check to have exactly one String field named Word. Mon Oct 04 20:05:35 1999 Loic Dachary * test: add thingies to make test work when doing ./configure outside the source directory. * htword/WordList: Add Ref and Unref to update statistics. Fix walking to start from the end of statistics. All statistics words start with \001, therefore at the beginning of the file and all clustered together. * htword/WordStat: derived from WordReference to implement uniq word statistics. * test/word.cc: test statistics updating. * htword/WordKey.cc: fix bugous compare (returned length diff if key of different length). Mon Oct 04 18:43:56 1999 Gabriele Bartolini * test/testnet.cc: added the option for HEAD before GET control Mon Oct 04 17:33:24 1999 Gabriele Bartolini * htnet/Transport.h .cc: added the FlushConnection() method * htnet/HtHTTP.h .cc: now the Request() method can make a HEAD request precede a GET request. This is made by default, and can be changed by using the methods Enable/DisableHeadBeforeGet(). A configuration option can be raised to manage it. Mon Oct 04 12:43:41 1999 Gabriele Bartolini * htlib/io.h .cc: added a flush() method. * htnet/HtHTTP.cc: manage the chunk correctly, by calling the flush() method after reading it. Mon Oct 04 12:02:24 1999 Loic Dachary * htlib/htString.h: move null outside inline operator [] functions. Fri Oct 01 14:55:56 1999 Loic Dachary * htword/WordRecord: mutable, can also contain uniq word statistics. * htword/WordReference: remove all dependencies related to the actual structure of the key. * htcommon/HtWordReference: derived from WordReference, explicit accessors. * htcommon/HtWordList: derived from WordList, only handles the word cache (Flush, MarkGone). * htdig/HTML.cc (do_tag): add wordindex to have location set in tags * htcommon/DocumentRef.cc (AddDescription): add Location calculation * htword/WordList.cc: add dberror to map Berkeley DB error codes * htsearch/Display.cc (display): initialize good_sort to get rid of strange warning. Fri Oct 01 09:02:11 1999 Loic Dachary * Makefile.config: duplicate library lines to resolve interdependencies. Thu Sep 30 17:56:55 1999 Loic Dachary * htmerge/words.cc (delete_word): Upgrade to use WordCursor. * htword/WordList: Walk now uses a local WordCursor. Many concurent Walk can happen at the same time. * htword/WordList: Walk callback now take the current WordCursor. Added a Delete method that takes the WordCursor. Allows to delete the current record while walking. * db/include/db_cxx.h (DB_ENV): add int return type to operator = * db/dist/configure.in (CXXFLAGS): disable adding obsolete g++ option. * configure.in: enable C++ support when configuring Berkeley DB * htword: create. move Word* from htcommon. move HtWordType from htlib and rename WordType. * htword/WordList: use db_cxx interface instead of Database. Less interface overhead. Get access to full capabilities of Berkeley DB. Much more error checking done. Create WordCursor private class to use String instead of Dbt. Wed Sep 29 20:03:31 1999 Loic Dachary * htlib/lib.h: AIX xlC does is confused by overloaded mystrcasestr that only differ in constness. Only keep const form and use cast where approriate. *sigh* * htlib/htString.h: accomodate new form of Object::compare and Copy. Explicitly convert compare arg to String&, prevent hiding and therefore missing the underlying compare function. * htlib/HtVector.cc (Copy): make it const * htlib/HtHeap.cc: accomodate new form of Object::compare * htcommon/List.h,cc: Add ListCursor to allow many pointers that walk the list to exist in the same program. * htlib/Object.h (class Object): kill unused Serialize + Deserialize. Change unused Copy to const and bark on stderr if called because it is clearly not was is wanted. If Copy is called and the derived class does not implement Copy we are in trouble. Alternatives are to make it pure virtual but it will break things all over the code or to abort but this will be considered to violent. Change compare to take a const reference and be a const. Wed Sep 29 16:51:58 1999 Loic Dachary * acinclude.m4,configure.in,Makefile.config: remove -Wall from Makefile.conf, add the AC_COMPILE_WARNINGS macro in acinclude.m4 and use it in configure.in. * htdoc/default_check.pl: remove, unused Wed Sep 29 13:07:58 1999 Gabriele Bartolini * htnet/Transport: fixed some bugs on construction and destruction * htnet/HtHTTP: the most important add is the decoding of chunked encoded responses, as reported on RFC2616 (HTTP/1.1). It needs to be developed, because it timeouts at the end of the request. Added a function pointer in order to dynamically handle the function that reads the body of a response (for now, normal and chunked, but other encoding ways exist, so ...). Fixed some bugs on construction and added some features like Server and Transfer-encoding headers. Wed Sep 29 13:54:59 1999 Loic Dachary * fix all inline method declarations so that they are always declared inline in the class declaration if an inline definition follows. * acinclude.m4: also search apache in /usr/local/apache/bin by default. * fix various warnings of gcc-2.95, now compiles ok without warnings and with -Wall. * htlib/htString.h: removed commented out inline get * test/testnet.cc: add includes for optarg Tue Sep 28 18:56:36 1999 Loic Dachary * Makefile.config (HTLIBS): libhtnet at the beginning of the list. It matters on Solaris-2.6 for instance. * test/testnet.cc: change times to timesvar to avoid conflict with function (was warning only on Solaris-2.6). * htdig,htsearch,htmerge,test/word are purify clean when running make check. Tue Sep 28 18:23:49 1999 Loic Dachary * htmerge/words.cc (mergeWords): use WordList::Walk to avoid loading ALL the words into memory. * htlib/DB2_db.cc (Open): we don't want duplicates. Big mistake. If DUP is on, every put for update will insert a new entry. * htcommon/WordList.cc (Delete): separate Delete (straight Delete and WalkDelete) to avoid accessing dbf from outside WordList. * htcommon/WordList.cc (Walk): now promoted to public. Tue Sep 28 16:34:56 1999 Loic Dachary * test/word.cc (dolist): Add regression tests for Delete. * htcommon/WordList.cc (Delete): Reimplement from scratch. Use Walk to find records to delete. This allows to say delete all occurence of this word, delete all words in this document (slow), delete all occurences of this word in this document etc. * htcommon/WordList.cc (Walk): extend so that it handles walk for partially specified keys, remains fully backward compatible. It allows to extract all the words in a specific document (slow) or all occurences of a word in a specific document etc. Tue Sep 28 12:56:12 1999 Loic Dachary * htcommon/DocumentDB.cc (Open): report errors on stderr * htmerge/docs.cc (convertDocs): rely on error reporting from DocumentDB instead of implementing a custom one. Tue Sep 28 11:36:28 1999 Gabriele Bartolini * htnet/Transport.h: added the status code and the reason phrase * htnet/HtHTTP.cc .h: removed the attributes above. Read the body of a response if the code is 2xx. Issues the GetLocation() method. Tue Sep 28 10:32:47 1999 Loic Dachary * test/htdocs/set3: create and populate with cgi scripts have bad behaviour (time out and, slow connection). Tue Sep 28 10:20:23 1999 Loic Dachary * test/htdocs: move html files in set1/set2 subdirectories to allows tests that use different set of files. Change htdig.conf accordingly. Tue Sep 28 09:31:12 1999 Loic Dachary * test/Makefile.am: comment test options, add LONG_TEST='y' for lengthy tests, by default run quick tests. * installdir/bad_words: removed it an of : since the minimum word length is by default 3, these words are ignored anyway. Mon Sep 27 20:37:38 1999 Loic Dachary * htlib/HtWordType.h,cc: concentrate knowledge about word definition in this class. Rename the class WordType (think WordReference etc...). Change Initialize to use an external default object. A WordType object may be allocated on its own. Drag functionalities from BadWordFile, Replace and IsValid of WordList, and concentrate them in the WordType::Normalize function. * htcommon/WordList: use the new WordList semantic. WordType is now a member of WordList, opening the possibility to have many WordList object with different configurations within the same program since the constructor takes * htsearch/htsearch.cc (setupWords): Use HtNormalize to find out if word should be ignored in query. Formerly using IsValid. * htlib/String.cc (operator []): fix big mistake, operator [] was indeed last() ! * htlib/String.cc(uppercase, lowercase): return the number of converted chars. * htlib/String.cc(remove): return the number of chars removed. Mon Sep 27 17:43:23 1999 Gabriele Bartolini * Created testnet.cc under test dir for trying the htnet library It's a simple program that retrieves an URL. * htnet/HtHTTP.cc, .h: added a 'int (*) (char *)' function pointer. This attribute is static and it is used under the isParsable method in order to determine if a document is parsable. It must be set outside this class by using the SetParsingController static method. The classic use is to set it to 'ExternalParser::canParse' . Mon Sep 27 10:52:51 1999 Loic Dachary * htmerge/db.cc (mergeDB): delete words instead of words->Destroy() because the words object itself was not freed. Mon Sep 27 10:38:37 1999 Gabriele Bartolini * Created 'htnet' library Mon Sep 27 12:39:24 1999 Loic Dachary * test/word.cc (dolist): don't deal with upper case at present and prevent warning. Mon Sep 27 10:38:37 1999 Gabriele Bartolini * htlib/String.cc: removed compiler warnings * htdig/HtHTTP.h: corrected cvs Id property Mon Sep 27 10:29:58 1999 Loic Dachary * htlib/String.cc (String): make sure *all* constructors set the Data member to 0. * htsearch/parser.cc (score): add missing dm->id = wr->DocID(); strange it did not make search fail horribly. Mon Sep 27 09:46:34 1999 Loic Dachary * test/conf/htdig.conf.in (common_dir): add common_dir so that templates are found in compile directory. * htsearch/parser.cc (phrase): free wordList at end and only allocate if needed. Fri Sep 24 16:35:47 1999 Loic Dachary * htcommon/DocumentDB.ccf (Open): change mode to 666 instead of 664, it's the bizness of umask to remove permission bits. * htlib/URL.cc (removeIndex): Memory leak. do not use l.Release since standard Destroy called by destructor is ok. * htdig/htdig.cc (main): Memory leak. Use l.Destroy instead of l.Release. * htlib/StringList.cc (Join): Memory leak (new String str + return *str). Also change to const fct. * htlib/List.cc (Nth): add const version to help StringList::Join save memory. * htdig/HTML.cc (parse): delete [] text (was missing []) * htlib/HtVector.cc: Most of the boundary tests with element_count (but not all of them) were wrong (> instead of >= for instance). * htlib/HtVector.cc (Previous): limit test cut and pasted from Next and obviously completely wrong. Fix. * htlib/HtVector.cc (Remove): use RemoveFrom, avoid code duplication. * htcommon/DocumentRef.cc (Clear): set all numerical fields to 0, and truncate strings to 0. Some were missing. * htlib/Connection.cc (Connection): free(server_name) because allocated by strdup not new. Fri Sep 24 14:30:21 1999 Loic Dachary * */.cvsignore: update to include .pure, *.la, *.lo, .purify * htlib/String.cc (String): add Data = 0 * htlib/htString.h (class String): add Data = 0 * htlib/String.cc (String): init set to MinimumAllocationSize at least prevents leaking if init = 0. * htlib/String.cc (nocase_compare): use get() instead of direct pointer to Data so that the trailing null will be added. * htlib/Dictionary.cc (DictionaryEntry): free(key) instead of delete [] key because obtained with strdup. * htlib/DB2_db.cc (Close): free(dbenv) because db_appexit does not free this although it free everything else. Thu Sep 23 18:18:40 1999 Loic Dachary * configure.in: add PERL detection & use in Makefile.am Thu Sep 23 14:29:29 1999 Loic Dachary * configure.in: removed unused alloca.h * htcommon/DocumentDB.cc: test isopen in Close instead of before calling Close. Add some const in functions arguments. (Read): change char* args to const String&, changed tests for null pointers to empty(). (Add): Delete the temp class member, use function local temp. (operator []): change char* args to const String& (CreateSearchDB): change char* args to const String& * htcommon/DocumentRef.cc:(AddDescription): Add some const in functions arguments. Use a WordReference as insertion context instead of merely the docid: it contains the insertion context. (AddAnchor): Add some const in functions arguments. * htcommon/DocumentRef.h: Add some const in inline functions arguments. * htcommon/Makefile.am: add WordKey + WordKey.h generation * htcommon/word_builder.pl, word.desc, WordKey.h.tmpl: generate WordKey.h from WordKey.h.tmpl and word.desc * htcommon/WordList.cc: In general remove code that belongs to WordReference rather than WordList and cleanup const + String. (WordList) the constructor takes a Configuration object in argument. (Word -> Replace): Word method replaced by Replace method because more explicit. Now taks a WordReference in argument instead of the list of fields values. (valid_word deleted, IsValid only): Add some const in functions arguments. (BadWordFile): change char* args to const String& (Open + Read -> Open): Open and Read merge into Open with mode argument. change char* args to const String&. (Add): use WordReference::Pack and simply do Put. (operator[], Prefix ...) now take WordReference instead of Word. Autmatic Conversion from Word for compatibility thru WordReference(const Word& w). (Dump): change char* args to const String& (Walk): use WordReference member functions instead of hard coded packing * htcommon/WordRecord.h: move flag definitions to WordReference.h only keep anchor, the reste moved to key. * htdig/Document.cc: change all config[""] manipulations from char* to String or const String (setUsernamePassword): Add some const in functions arguments. * htdig/HTML.cc: change all config[""] manipulations from char* to String or const String. Change null pointer tests to empty(). (transSGML): change char* args to const String& * htdig/HtHTTP.cc: Add error messages for default cases in every switch. * htdig/PDF.cc: (parse) change char* to const String& for config[""] * htdig/Plaintext.cc: (parse) remove unused variable * htdig/Retriever.cc: use WordReference word_context instead of simple docid to hold the insertion context. (Retriever) pass config to WordList initializer. (setUsernamePassword): Add some const in functions arguments. (Initial): change char* args to const String& (parse_url): use WordReference word_context, add debug information. (RetrievedDocument): set anchor in word_context. (got_word): use Replace instead of Word (got_*): Add some const in functions arguments. * htdig/htdig.cc: change all config[""] manipulations from char* to String * htdoc/cf_generate.pl: compute attrs.html, cf_byprog.html and cf_byname.html from ../htlib/default.cc and attrs_head.html attrs_tail.html cf_byname_head.html cf_byname_tail.html cf_byprog_head.html cf_byprog_tail.html Add rules in Makefile.am * htfuzzy: In every programs I changed the constructor to take a Configuration agrument. The openIndex and writeDB had this argument sometime used it, sometimes used the global config. Having it in the contructor is cleaner and safer, there is no more reference to the global config. I also changed some char* to String and const. Most of the program look the same, I won't go into details here :-} * htlib/Configuration.cc: changed separators from String* to String. Simpler. (~Configuration): removed because not needed. (Add): change to String, remove new String + delete for local var. (Find, operator[]): make it const fct, add some const in functions arguments. (Value + Double): killed, replaced by as_integer + as_double from String (Boolean): use String methods + string objects (Defaults): Add some const in functions arguments. * htlib/Configuration.h: add char *type; // Type of the value (string, integer, boolean) char *programs; // White separated list of programs/modules using this attribute char *example; // Example usage of the attribute (HTML) char *description; // Long description of the attribute (HTML) to the ConfigDefaults type. * htlib/Connection.cc: (assign_server) change char* args to const String& * htlib/DB2_db.cc: Merge with DB2_hash. Add compare and prefix functions pointers. Merge OpenRead & OpenReadWrite into Open, keep for compatibility. skey and data are now strings instead of DBT. Remove Get_Next_Seq. Get_Next now returns key and value in arguments. Remove all other Get_Next interfaces. * htlib/Database.h: Compatibility functions for Get_Next Put, Get, Exists, Delete take String args and are inline Add SetPrefix and SetCompare * htlib/Dictionary.cc: Add copy constructor. Add DictionaryCursor that holds the traversal context. Use DictionaryCursor object for traversal without explicit cursor specified. Add constness where meaningfull. * htlib/HtPack.cc: (htPack) format is const, change strtol call to use temporary variable to cope with constness. (htUnpack) dataref argument is not a reference anymore. Not used anywhere and kind of hidden argument nobody wants. * htlib/HtRegex.cc: set, match, HtRegex have const args. * htlib/HtWordCodec.cc: (code) orig is const * htlib/HtWordType.cc,h: statics is made of String instead of char*. Remove static String punct_and_extra from Initialize. * htlib/HtZlibCodec.cc: len is unsigned int * htlib/ParsedString.cc: add constness to function args (get) use String instead of char * htlib/QuotedStringList.cc: inline functions argument variations and add constness. * htlib/String.cc: add constness whereever possible. * htlib/htString.h: Add const get, char* cast, operator []. Add as_double conversion. * htlib/StringList.cc: inline functions argument variations and add constness. * htlib/StringMatch.cc: add constness to function args. * htlib/URL.cc: add constness to function args. (URL): fct arg was used as temp. Change, clearer. * htlib/lib.h: add const declaration of string manipulation functions. Two forms for mystrcasestsr: const and not const. * htlib/strcasecmp.cc: add constness to function args. * htlib/timegm.c: add declaration for __mktime_internal * htmerge/db.cc: change *doc* vars from char* to const String, use new WordList + WordReference interface. * htmerge/docs.cc: change *doc* vars from char* to const String. * htmerge/words.cc: use new WordList + WordReference interface. * htsearch/Display.cc: use empty method on String where appropriate. use String instead of char* where config[""] used. (includeURL): change char* args to const String& * htsearch/ResultMatch.cc: (setTitle, setSortType) change char* args to const String& * htsearch/Template.cc: (createFromFile) change char* args to const String& * htsearch/Template.h: accessors return const String& or take const char* * htsearch/TemplateList.cc: (get) use const String for internalNames. * htsearch/htsearch.cc: use String instead of char* where config[""] used. * htsearch/parser.cc: Initialize WordList member with config global. (perform_push): free the result list after calling score. (score, phrase): use new WordList + WordReference interface. Thu Sep 23 14:29:29 1999 Loic Dachary * htcommon/WordKey.h.tmpl, WordKey.cc: new, describe the key of the word database. * htcommon/word.desc: new, abstract description of the key structure of the word database. * htcommon/word_builder.pl: new, generate WordKey.h from WordKey.h.tmpl * htcommon/WordReference.cc: move key manipulation to WordKey.cc Add Unpack/Pack functions. Add accessors for fields and move fields to private. Add constness where possible. Mon Sep 20 14:50:47 1999 Loic Dachary * Everywhere config["string"] is used, check that it's *not* converted to char* for later use. Keep String object so that there is no chance to use a char* that has been deallocated. Using a String as return for config["string"] is also *much* safer for the great number of calls that did not check for a possible 0 pointer return. * htfuzzy/*.{cc,h}: const Configuration& config member. Constructor sets it. Remove config argument from openIndex & writeDB. The idea (as it was initialy, I guess) is to be able to have a standalone fuzzy library using a specify configuration file. It is now possible and consistent. * htlib/htString.cc: more constness where appropriate. Changed compare to have const String& arg instead of const Object* because useless and potential source of bugous code. * htfuzzy/Regex.cc (getWords): fix bugous setting of extra_word_chars configuration value. It is set to change the behaviour of HtStripPunctuation but this function get the extra_word_chars from a static array initialized at program start by static void Initialize(Configuration & config). Use straight s.remove() instead. Besides, the string was anchored by prepending a ^ that was removed because part of the reserved chars. Mon Sep 20 11:47:05 1999 Loic Dachary * htlib/Configuration.cc (operator []): changed return type to String to solve memory leak. When char* the string was malloced from ParsedString after substitution and never freed. In fact it was even worse : it was free before use in some cases. Sun Sep 19 19:12:44 1999 Loic Dachary * htdoc/cf_generate.pl, htcommon/defaults.cc, htlib/Configuration.h: Change the structure of the configuration defaults. Move description, examples, types, used_by information from attrs.html. Write cf_generate.pl to build attrs.html, cf_byname, cf_byprog from defaults.cc. Makes it easier to maintain an up to date description of existing attributes. About 10 attributes existed in defaults.cc and were not describted in the HTML pages. Add rules in htdoc/Makefile.am to generate the pages if a source changes. Fri Sep 17 19:34:48 1999 Loic Dachary * Makefile.config: add -Wall to all compilation and fix all resulting warnings. * htlib/Connection.cc (assign_server): remove redundant test and cast litteral value to unsigned * htlib/String.cc: add const qualifier where possible. Helps dealing with const objects at an upper level. Fri Sep 17 18:27:57 1999 Alexander Bergolth A few changes so that it compiles with xlC on AIX: * configure.in, include/htconfig.h.in: Add check for sys/select.h. Add "long unsigned int" to the possible getpeername_length types. * htdig/htdig.cc: Moved variable declaration out of case block. * htlib/Connection.cc: Include sys/select.h. * htcommon/WordList.cc: just a type cast * htlib/regex.c: define true and false only if they aren't already * htdig/Transport.{h,cc}: removed inline keywords (inline functions have to be defined and declared simultaneously) * htlib/{mktime.c,regex.h,strptime.c,timegm.c}: change // comments to /* ... */ Tue Sep 14 01:15:48 1999 Geoff Hutchison * htmerge/db.cc: Rewrite to use the WordList functions to merge the two word databases. Also make sure to load the document excerpt when adding in DocumentRefs. * htmerge/docs.cc: Fix bug where ids were not added to the discard list correctly. * htmerge/words.cc: Fix bug where ids were not checked for existance in the discard list correctly. Sun Sep 12 12:27:16 1999 Geoff Hutchison * htcommon/defaults.cc: Remove word_list since that file is no longer used. * htdig/htdig.cc: Ensure -a and -i are followed for the word_db file. Fixes PR #638. Sat Sep 11 00:11:28 1999 Geoff Hutchison * htlib/StringMatch.h: Add back mistakenly deleted #ifndef/#define. Fri Sep 10 23:07:43 1999 Geoff Hutchison * htmerge/*, htcommon/*, htdig/*, htlib/*: Add copyright information. Fri Sep 10 11:33:50 1999 Geoff Hutchison * htnotify/htnotify.cc: Add copyright information. * htsearch/* htfuzzy/*: Ditto. Fri Sep 10 15:24:44 1999 Loic Dachary * htdig/Retriever.cc: change static WordList words to object member. words.Close() at end of Start function to make sure data is flushed by database. * htcommon/WordList.cc (Close): test isopen to prevent ugly crash. Remove isopen test in calling functions. Fri Sep 10 13:45:53 1999 Loic Dachary * htcommon/WordList.h htcommon/WordList.cc: methods Collect and Walk that factorise the behaviour of operator [], Prefix and WordRefs. * htcommon/WordList.h htcommon/WordList.cc: method Dump to dump an ascii version of the word database. * htcommon/WordReference.h,htcommon/WordReference.cc: method Dump to write an ascii version of a word. * htdig/htdig.cc: -t now also dump word database in ascii as well. * htdoc/attrs.html,cf_byprog.html,cf_byname.html: added doc for word_dump Thu Sep 9 20:30:18 1999 Geoff Hutchison * htfuzzy/Fuzzy.h, htfuzzy/Fuzzy.cc, htfuzzy/Prefix.cc, htfuzzy/Regex.cc, htfuzzy/Speling.cc, htfuzzy/Substring.cc, htfuzzy/htfuzzy.cc, htfuzzy.h: Change to use WordList code instead of direct access to the database. Thu Sep 9 14:55:59 1999 Gilles Detillieux * contrib/parse_doc.pl: fix bug in pdf title extraction. Tue Sep 7 23:49:41 1999 Geoff Hutchison * htdig/ExternalParser.h, htdig/ExternalParser.cc (parse): Change parsing of location to allow phrase searching -- location is *not* just 0-1000. * htdig/Plaintext.h, htdig/Plaintext.cc, htdig/PDF.cc: Ditto. * htdig/Retriever.h, htdig/Retriever.cc: Don't call HtStripPunctuation. This is now done in the WordList::Word method. * htcommon/WordList.h htcommon/WordList.cc (Prefix): New method to do prefix retrievals. Essentially the same as [], except the loop is broken only in the unlikely event that we retrieve something beyond the range set. (Exists): New method for checking the existance of a string--attempt to retrieve it and determine if anything's actually there. (Word): Call HtStripPunctuation as part of the cleanup. Tue Sep 7 21:37:44 1999 Geoff Hutchison * htcommon/defaults.cc: Add new configuration option removed_unretrieved_urls to remove docs that have not been accessed. * htmerge/docs.cc (convertDocs): Use it. * htcommon/defaults.h, htcommon/WordRecord.h, htcommon/WordReference.h: Add copyright notice to head of file. Mon Sep 6 10:32:59 1999 Geoff Hutchison * htlib/HtZlibCodec.h, htlib/HtZlibCodec.cc(instance): New method as used in other codecs. (encode, decode): Fix compilation errors. * htlib/Makefile.am: Added HtZlibCodec.cc to the compilation list. * htcommon/DocumentDB.cc (ReadExcerpt): Call HtZlibCodec to decompress the excerpt. (Add): Call HtZlibCodec to compress the excerpt before storing. (Open, Read): If the databases are already open, close them first in case we're opening under a different filename. (CreateSearchDB): Remove call to external sort program. Database is already sorted by DocID. * configure.in, configure: Remove check for external sort program. No longer necessary. * */Makefile.in: Regenerate using automake. Sun Sep 5 13:50:34 1999 Geoff Hutchison * htmerge/docs.cc: Ensure a document with empty excerpt has actually been retrieved. Otherwise document stubs are always removed. * htlib/String.cc: Implement the nocase_compare method. * htcommon/WordReference.cc: Implement a compare method for WordRefs to use in sorting. Uses the above. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Update the headers. * htcommon/DocumentDB.h: Ditto. Sun Sep 5 01:37:27 1999 Geoff Hutchison * htcommon/WordList.cc(Flush): Call Add() instead of storing the data ourselves. Additionally, don't open the database ourself (and then close it), instead call Open() if it's not open already. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc(AddDescription): Pass in a WordList to use when adding link text words. Ensures that the word db is never opened twice for writing. * htdig/Retriever.cc: Call AddDescription as above. * htdig/Server.cc(ctor): If debugging, write out an entry for the robots.txt file. * htlib/HtHeap.cc(percolateUp): Fix a bug where the parent was not updated when moving up more than once. (pushDownRoot): Fix a bug where the root was inproperly pushed down when it required looping. Fri Sep 3 16:23:23 1999 Geoff Hutchison * htlib/HtHeap.cc(Remove): Correct bug where after a removal, the structure was not "re-heapified" correctly. The last item should be moved to the top and pushed down. (pushDownRoot): Don't move items past the size of the underlying array. * htdig/Server.h, htdig/Server.cc: Change _paths to work on a heap, based on the hopcount. Ensures on a given server that the indexing will be done in level-order by hopcount. Wed Sep 01 15:40:37 1999 Loic Dachary * test: implement minimal tests for htsearch and htdig Tue Aug 31 02:17:04 1999 Geoff Hutchison * htcommon/WordRecord.h: Change back to struct to ensure integrity when compressed and stored in the word database. * htcommon/WordList.cc (Flush): Use HtPack to compress the WordRecord before storage. ([], WordRefs): Use HtUnpack to decompress the WordRecord after storage. Sun Aug 29 00:42:07 1999 Geoff Hutchison * htsearch/htsearch.cc (convertToBoolean): Remove debugging strings. * htsearch/parser.h: Add new method score(List) to merge scoring for both standard and phrase searching. * htsearch/parser.cc(phrase): Keep the current list of successful matched words around to pass to score and perform_phrase. (perform_phrase): Naively (and slowly, but correctly) loop through past words to make sure they match DocID as well as successive locations. Move scoring to score(). (perform_push): Move scoring to score(). (score): Loop through a list of WordReferences and create a list of scored DocMatches. Sun Aug 29 00:33:17 1999 Geoff Hutchison * htsearch/htsearch.cc(createLogicalWords): Hack to produce correct output with phrase searching (e.g. anything in quotes is essentially left alone). Ensure the StringMatch pattern includes the phrase with correct spacing as well. (setupWords): Add a " token whenever it occurs in the query. (convertToBoolean): Make sure booleans are not inserted into phrases. * htsearch/parser.h: Add new methods phrase and perfor_phrase to take care of parsing phrases and performing the actual matching. * htsearch/parser.cc(lexan): Return a '"' when present for phrase searching. (factor): Call phrase() before parsing a factor--phrases are the highest priority, so ("RedHat Linux" & Debian) ! Windows makes sense. (phrase): New method--slurps up the rest of a phrase and calls perform_phrase to do the matching. (perform_phrase): New method--currently just calls perform_and to give the simulation of a phrase match. Sat Aug 28 15:57:53 1999 Geoff Hutchison * htdig/Server.h, htdig/Server.cc: Undo yesterdays change -- still very buggy and shouldn't be used yet. * htdig/Retriever.cc (parse_url): Change default index to 1 to more closely match DocIDs shown with verbose output. * htsearch/DocMatch.h: Change score to double and clean up headers. * htcommon/WordRecord.h: Change unnecessary long ints (id and flags) to plain ints. * htdig/HTML.cc (parse): Call got_word with actual word sequence (i.e. 1, 2, 3...) rather than scaling to 1-1000 by character offset. * htlib/Database.h, htlib/DB2_db.h, htlib/DB2_hash.h: Change Get_Item to Get_Next(String item) to return the data as a reference. This makes it easier to use in a loop and cuts the database calls in half. * htlib/DB2_db.cc, htlib/DB2_hash.cc: Implement it, making sure we keep the possibly useful data around, rather than tossing it! * htsearch/htsearch.cc(htsearch): Don't attempt to open the word db ourselves. Instead, pass the filename off to the parser, which will do it through WordList. * htsearch/parser.h: Use a WordList instead of a generic Database. * htsearch/parser.cc(perform_push): Use the WordList[] operator to return a list of all matching WordRefs and loop through, summing the score. * htcommon/WordList.cc (Flush): Don't use HtPack on the data--somehow when unpacking, there's a mismatch of sizes. (Read): Fix thinko where we attempted to open the database as a DB_HASH. ([]): Don't use HtUnpack since we get mismatches. Use the new Get_Next(data) call instead of calling Get_Item separately. (WordRefs): Same as above. Fri Aug 27 09:44:09 1999 Geoff Hutchison * htdig/Retriever.cc (Need2Get): Remove duplicate detection code for local_urls. The code is somewhat buggy and should be replaced by more general code shortly. * htdig/Server.h, htdig/Server.cc (push, pop): Change _paths to a HtHeap sorted on hopcount first (and order placed on heap second). Ensures that on each server, the order indexed is guaranteed to be level-order by hopcount. * htdig/URLRef.h, htdig/URLRef.cc (compare): Add comparison method to enable sorting by hopcount. Fri Aug 27 09:36:35 1999 Geoff Hutchison * htcommon/WordList.h, htcommon/WordList.cc (WordList): Change words to a list instead of a dictionary for minor speed improvement. Thu Aug 26 11:18:20 1999 Gilles Detillieux * htcommon/defaults.cc, htdoc/attrs.html: increase default maximum_word_length to 32. Wed Aug 25 16:50:16 1999 Gilles Detillieux * htdig/Retriever.cc(got_word): add code to check for compound words and add their component parts to the word database. * htdig/PDF.cc(parseString), htdig/Plaintext.cc(parse): Don't strip punctuation or lowercase the word before calling got_word. That should be left up to got_word & Word methods. * htlib/StringMatch.h, htlib/StringMatch.cc(Pattern, IgnoreCase): Add an IgnorePunct() method, which allows matches to skip over valid punctuation, change Pattern() and IgnoreCase() to accomodate this. * htsearch/htsearch.cc(main, createLogicalWords): use IgnorePunct() to highlight matching words in excerpts regardless of punctuation, toss out old origPattern, and don't add short or bad words to logicalPattern. * htlib/HtWordType.h, htlib/HtWordType.cc(Initialize): set up and use a lookup table to speed up HtIsWordChar() and HtIsStrictWordChar(). Mon Aug 23 10:13:05 1999 Gilles Detillieux * htdig/HTML.cc(parse): fix problems with null pointer when attempting SGML entity decoding on bare &, as reported by Vadim Chekan. Thu Aug 19 11:52:06 1999 Gilles Detillieux * htsearch/htsearch.cc(main): Fix to allow multiple keywords input parameter definitions. * contrib/parse_doc.pl: make spaces optional in LANGUAGE = POSTSCRIPT PJL test. Wed Aug 18 11:27:46 1999 Gilles Detillieux * htdig/PDF.cc(parse): Fixed wrong variable name in new code. Double-Oops! (It was Friday the 13th, after all...) Tue Aug 17 16:26:46 1999 Gilles Detillieux * htlib/HtHeap.cc(Remove): apply Geoff's patch to fix Remove. * htlib/HtVector.h, htlib/HtVector.cc(Index): various bounds overrun bug fixes and checking in Last(), Nth() & Index(). Mon Aug 16 13:55:10 1999 Gilles Detillieux * htsearch/Display.cc(expandVariables): fix up test for & Mon Aug 16 12:08:57 1999 Gilles Detillieux * Makefine.am, Makefile.in, installdir/Makefile.am, installdir/Makefile.in: change all remaining INSTALL_ROOT to DESTDIR. Fri Aug 13 15:44:31 1999 Gilles Detillieux * htdig/PDF.cc(parse): added missing ')' in new code. Oops! * htlib/strptime.c, htlib/mktime.c: added #include "htconfig.h" to pick up definitions from configure program. Let's try to remember that config.h != htconfig.h! Fri Aug 13 14:49:07 1999 Loic Dachary * configure.in: removed unused HTDIG_TOP, changed AM_WITH_ZLIB by CHECK_ZLIB Fri Aug 13 14:00:16 1999 Gilles Detillieux * htdig/PDF.cc(parse), htcommon/defaults.cc, htdoc/attrs.html (pdf_parser): Removed -pairs option from default arguments, added special test for acroread to decide whether to use output file or directory as last argument (also adds -toPostScript if missing). Program now tries to test for existance of parser before trying to call it. Fri Aug 13 10:10:16 1999 Gilles Detillieux * htdoc/attrs.html(pdf_parser): updated xpdf version number. Thu Aug 12 17:09:37 1999 Gilles Detillieux * contrib/parse_doc.pl: updated for xpdf 0.90, plus other fixes. Thu Aug 12 11:12:07 1999 Gilles Detillieux * htdoc/attrs.html(logging): added Geoff's description of log lines. Thu Aug 12 11:21:12 1999 Loic Dachary * strptime fixes : AC_FUNC_STRPTIME defined in acinclude.m4 and used in configure.in, conditional compilation of strptime.c (only if HAVE_STRPTIME not defined), removed Htstrptime (strptime.c now defines strptime), changed all calls to Htstrptime to calls to strptime. Wed Aug 11 16:59:41 1999 Loic Dachary * */Makefile.am: use -release instead of -version-info because nobody wants to bother with published shared lib interfaces version numbers at present. * htlib/Makefile.am: added langinfo.h Wed Aug 11 15:00:07 1999 Loic Dachary * acconfig.h: removed MAX_WORD_LENGTH * re-run auto* to make sure chain is consistent * Makefile.am: improve distclean for tests Wed Aug 11 13:46:22 1999 Loic Dachary * configure.in: change --enable-test to --enable-tests so that Berkeley DB tests are not activated. Since they depend on tcl this can be a pain. * acinclude.m4: AM_PROG_TIME locate time command + find out if verbose output is -l (freebsd) or -v (linux) Wed Aug 11 13:13:39 1999 Loic Dachary * acinclude.m4 : AM_WITH_ZLIB autoconf macro for zlib detection that allows --with-zlib=DIR to specify the install root of zlib, --without-zlib to prevent inclusion of zlib. If nothing specified zlib is searched in /usr and /usr/local. --disable-zlib is replaced with --without-zlib. * configure.in,configure,aclocal.m4,db/dist/acinclude.m4, db/dist/aclocal.m4,db/dist/configure,db/dist/configure.in: changed to use AM_WITH_ZLIB Tue Aug 10 21:14:34 1999 Geoff Hutchison * htsearch/Display.cc (outputVariable): Fix compilation error with assignment between char * and char *. * htsearch/htsearch.cc (main): Use cleaner trick to sidestep discarding const char * as suggested by Gilles. Tue Aug 10 17:24:12 1999 Gilles Detillieux * htsearch/Display.cc(expandVariables): clean up, simplify and label lexical analyzer states. Tue Aug 10 17:04:54 1999 Gilles Detillieux * htsearch/Display.cc(expandVariables, outputVariable): add handling for $%(var) and $&(var) in templates. Still to be documented. Tue Aug 10 20:13:52 1999 Loic Dachary * db/mp/mp_bh.c: fixed HAVE_ZLIB -> HAVE_LIBZ Tue Aug 10 17:58:01 1999 Loic Dachary * configure,configure.in,db/dist/configure.in,db/dist/configure: added --with-zlib configure flag for htdig to specify zlib installation path. Motivated to have compatible tests between htdig and db as far as zlib is concerned. Otherwise configuration is confused and miss an existing libz. Tue Aug 10 17:44:49 1999 Loic Dachary * db/mp/mp_fopen.c: fixed cmpr_open called even if libz not here Tue Aug 10 17:40:53 1999 Loic Dachary * htlib/langinfo.h: header missing on FreeBSD-3.2, needed by strptime.c Tue Aug 10 11:43:14 1999 Gilles Detillieux * htdig/HTML.h, htdig/HTML.cc(parse, do_tag): fix problems with SGML entity decoding, add decoding of entities within tag attributes. Mon Aug 9 21:13:50 1999 Geoff Hutchison * htdig/HtHTTP.h(SetRequestMethod): Fix declaration to be void. * htdig/Transport.h(GetRequestMaxDocumentSize): Fix declaration to return int. * htdig/Retriever.cc(got_href): Fix mistake in hopcount calculations. Now returns the correct hopcount even for pages when a faster path is found. (Still need to change indexing to sort on hopcount). * htsearch/htsearch.cc(main): Fix compiler error in gcc-2.95 when discarding const by using strcpy. It's a hack, hopefully there's a better way. Mon Aug 9 17:23:15 1999 Gilles Detillieux * htlib/URL.cc(ServerAlias): fix small memory leak in new default path code (don't need to allocate new from string each time). * htlib/cgi.cc(init): Fix PR#572, where htsearch crashed if CONTENT_LENGTH was not set but REQUEST_METHOD was. * htfuzzy/Fuzzy.cc(getWords), htfuzzy/Metaphone.cc(vscode): Fix Geoff's change of May 15 to Fuzzy.cc, add test to vscode macro to stay in array bounds, so non-ASCII letters to cause segfault. Should fix PR#514. Mon Aug 9 17:03:45 1999 Gilles Detillieux * include/htconfig.h.in, htcommon/WordList.cc(Word,Flush&BadWordFile), htcommon/DocumentRef.cc(AddDescription), htcommon/defaults.cc, htsearch/parser.cc(perform_push), htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Convert the MAX_WORD_LENGTH compile-time option into the run-time configuration attribute maximum_word_length. This required reinserting word truncation code that had been taken out of WordList.cc. Mon Aug 9 16:34:14 1999 Gilles Detillieux * htdig/HtHTTP.cc (isParsable): allow application/pdf as parsable, to use builtin PDF code. * htdig/HtHTTP.cc (ParseHeader), htdig/Document.cc (readHeader): clean up header parsing. * htdig/Document.cc (getdate): make tm static, so it's initialized to zeros. Should fix PR#81 & PR#472, where strftime() would crash on some systems. Idea submitted by benoit.sibaud at cnet.francetelecom.fr * htlib/URL.cc (parse): fix PR#348, to make sure a missing or invalid port number will get set correctly. Mon Aug 9 15:42:41 1999 Gilles Detillieux * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Added descriptions for attributes that were missing, added a few clarifications, and corrected a few defaults and typos. Covers PR#558, PR#626, and then some. * configure.in, configure, include/htconfig.h.in, htlib/regex.c: PR#545 fixed - configure tests for presence of alloca.h for regex.c Sat Aug 07 13:40:17 1999 Loic Dachary * configure.in: remove test for strptime. Run autoconf + autoheader. * htlib/HtDateTime.cc: always use htdig strptime, do not try to use existing function in libc. * htlib/HtDateTime.h: move inclusion of htconfig.h on top of file, change #ifdef HAVE_CONFIG to HAVE_CONFIG_H Fri Aug 6 16:37:33 1999 Gilles Detillieux * htdig/Document.cc (UseProxy): fix call to match() and test of return value to work as documented for http_proxy_exclude (PR#603). Fri Aug 06 15:06:23 1999 * db/dist/config.hin, db/mp/mp_cmpr.c db/db/db.c, db/mp/mp_fopen.c: disable compression if zlib not found by configure. Thu Aug 05 12:27:15 1999 * test/dbbench.cc: invert -z and -Z for consistency * test/Makefile.am: add dbbench call examples Thu Aug 05 11:38:58 1999 Loic Dachary * test/Makefile.am: all .html go in distribution, compile dbbench that tests Berkeley DB performances. * configure.in/Makefile.am: conditional inclusion of the test directory in the list of subdirs (--enable-test). The list of subdirs is now @HTDIGDIRS@ in configure.in & Makefile.am * db/*: Transparent I/O compression implementation. Defines the DB_COMPRESS flag. For instance DB_CREATE | DB_COMPRESS. * db/db_dump/load: add -C option to specify cache size to db_dump/db_load Wed Aug 4 22:57:27 1999 Geoff Hutchison * db/*: Import of Sleepycat's Berkeley DB 2.7.5. Wed Aug 4 22:40:49 1999 Geoff Hutchison * contrib/htparsedoc/htparsedoc: Add in contributed bug fixes from Andrew Bishop to work on SunOS 4.x machines. Wed Aug 4 01:58:52 1999 Geoff Hutchison * COPYING, htdoc/COPYING, configure.in, Makefile.am, Makefile.in: Update information to use canonical version of the GPL from the FSF. In particular, this version has the correct mailing address of the FSF. Mon Aug 02 11:28:00 1999 Gabriele Bartolini * htlib/htString.h, htlib/String.cc : added the possibility to insert an unsigned int into a string. * htdig.cc : with verbose mode shows start and end time. Thu Jul 22 18:10:00 1999 Gabriele Bartolini * htdig/Transport.cc, htdig/HtHTTP.cc : modified the destructors. Thu Jul 22 13:10:00 1999 Gabriele Bartolini * htdig/Transport.cc, htdig/Transport.h, htdig/HtHTTP.cc, htdig/HtHTTP.h: Re-analyzed inheritance methods and attributes of the 2 classes. This is a first step, not definitive ... cos it still doesn't work as I hope. Tue Jul 20 11:21:52 1999 * configure.in : added AM_MAINTAINER_MODE to prevent unwanted dependencies check by default. * db/Makefile.in : remove Makefile when distclean Mon Jul 19 13:23:53 1999 * Makefile.config (INCLUDES): added -I$(top_srcdir)/include because automatically -I../include is not good, added -I$(top_builddir)/db/dist because some db headers are configure generated (if building in a directory that is not the source directory). * rename db/Makefile db/Makefile.in: otherwise it does not show up if if building in a directory that is not the source directory. Mon Jul 19 13:02:22 1999 * .cvsignore: do not ignore Makefile.config Sun Jul 18 22:47:49 1999 Geoff Hutchison * htsearch/parser.cc: Eliminated compiler errors. Currently returns no matches until bugs in the WordList code are fixed. Sun Jul 18 22:42:04 1999 Geoff Hutchison * htmerge/htmerge.h: Cleanup, including WordRecord and WordReference as needed. * htmerge/htmerge.cc: Update for files necessary for merge calls. Call convertDocs before mergeWords so that the discardList gets the list of documents deleted. * htmerge/docs.cc: Update for difference in calling order. * htmerge/words.cc: Update (and significant cleanup) since WordList writes directly to db.words.db. Iterate over the stored words, deleting those from deleted documents. * htmerge/db.cc: Update to eliminate compiler errors. Currently disabled until bugs in the words code are fixed. Sun Jul 18 22:33:49 1999 Geoff Hutchison * htcommon/defaults.cc: Collapse the multiple heading_factors into one. (It's prohibitive to define a flag for each h* tag). Add a new url_factor for the text of URLs (presently unused). * htcommon/DocumentRef.cc(AddDescription): Use FLAG_LINK_TEXT as defined in htcommon/WordRecord.h. * htdig/Retriever.h: Change factor to accomodate flags instead of weighting factors. * htdig/Retriever.cc: Update to use flags, and define the indexed flags in factor as appropriate. * htdig/HTML.cc: Update calls to got_word with appropriate new offsets into factor[]. Sun Jul 18 22:18:16 1999 Geoff Hutchison * htcommon/WordReference.h, htcommon/WordRecord.h: Update to use flags instead of weight. * htcommon/WordList.h, htcommon/WordList.cc: Add database access routines to match DocumentDB.cc. (Word): Recognize flags instead of weight, simply add the word. (Duplicates expected!) (mark*): Simply delete the list of words. (flush): Rather than dump to a text file, dump directly to the db. Sun Jul 18 21:50:04 1999 Geoff Hutchison * htlib/Database.h, htlib/DB2_db.h, htlib/DB2_hash.h: Add new method Get_Item to access the data of the current item when using Get_Next() or Get_Next_Seq(). * htlib/DB2_db.h, htlib/DB2_hash.cc: Implement Get_Item() using cursor access. Sat Jul 17 12:59:01 1999 Geoff Hutchison * test/*.html: Added various HTML files as the beginnings of a testing suite. Fri Jul 16 16:06:27 1999 Loic Dachary * All libraries (except db) use libtools. Shared libraries are generated by default. --disable-shared to get old behaviour. Libraries are installed in all cases. * Change structure of default installation directory (match standard). database : var/htdig programs : bin libraries : lib Like default apache: conf : conf htdocs : htdocs/htdig cgi-bin : cgi-bin * Switch all Makefile.in into Makefile.am * CONFIG.in CONFIG : removed. Replaced with --with- arguments in configure.in * Makefile.config.in removed, only keep Makefile.config : automake automatically defines variables for each AC_SUBST variables. Makefile.config has HTLIBS + DEFINES * db/Makefile : added to forward (clean all distclean) targets to db/dist and implement distdir target. * acconfig.h : created to allow autoheader to work (contains GETPEERNAME_LENGTH_T HAVE_BOOL, HAVE_TRUE, HAVE_FALSE, NEED_PROTO_GETHOSTNAME). Extra definitions added before @TOP@ (TRUE, FALSE, VERSION, MAX_WORD_LENGTH, LOG_LEVEL, LOG_FACILITY). * installdir/Makefile.am : installation rules moved from Makefile.am to installdir/Makefile.am * include/Makefile.am : distribute htconfig.h.in and stamp-h.in * Makefile.am : do not pre-create the directories, creation is done during the installation * configure.in: CF_MAKE_INCLUDE not needed anymore : automake handles the include itself. Fri Jul 16 13:04:27 1999 Gilles Detillieux * htdig/HTML.cc(parse): fix to prevent closing ">" from being passed to do_tag(). Thu Jul 15 21:25:12 1999 Geoff Hutchison * htdig/Document.cc (readHeader, getParsable): Add back application/pdf to use builtin PDF code. * htdig/Makefile.in: Remove broken Postscript parser as it never worked. * htlib/URL.cc (normalizePath, path): Use config.Boolean as pointed out by Gilles. Thu Jul 15 15:54:30 1999 Gilles Detillieux * htdoc/attrs.html(pdf_parser & external_parsers): add corrections & clarifications, links to relevant FAQ entries. Thu Jul 15 18:00:00 1999 CEST Gabriele Bartolini * htlib/HtDateTime.cc, htlib/HtDateTime.h : added the possibility to initialize and compares HtDateTime with integers. Added the constructor HtDateTime (int) and various operator overloading methods. Wed Jul 14 22:57:14 1999 Geoff Hutchison * htlib/URL.cc (normalizePath, path): If not case_sensitive, lowercase the URL. Should ensure that all URLs are appropriately lowercased, regardless of where they're generated. Wed Jul 14 22:37:47 1999 Geoff Hutchison * htlib/DB2_db.cc (OpenReadWrite, OpenRead): Add flag DB_DUP to database to allow storage of duplicate keys (in this case, words). Tue Jul 13 15:36:40 1999 Gilles Detillieux * htdig/HTML.cc (do_tag): Fix handling of and , to use href= instead of src=. Mon Jul 12 22:31:48 1999 Hanno Mueller * contrib/scriptname/results.shtml: Remove unintentional $(VERSION). Mon Jul 12 22:20:40 1999 Geoff Hutchison * htdig/HTML.cc (do_tag): Cleanups suggested by Gilles, combining and , and and moving to a separate case. Sun Jul 11 19:32:38 1999 Hanno Mueller * contrib/README: Add scriptname directory. * contrib/scriptname/*: An example of using htsearch within dynamic SSI pages * htcommon/defaults.cc: Add script_name attribute to override SCRIPT_NAME CGI environment variable. * htdoc/FAQ.html: Update question 4.7 based on including htsearch as a CGI in SSI markup. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: Update based on behavior of script_name attribute. * htsearch/Display.cc: Set SCRIPT_NAME variable to attribute script_name if set and CGI environment variable if undefined. Sat Jul 10 00:22:34 1999 Geoff Hutchison * htfuzzy/Regex.cc (getWords): Anchor the match to the beginning of string, add regex-interpeted characters to extra_word_chars temporarily, and strip remaining punctuation before making a match. Fri Jul 9 22:35:57 1999 Geoff Hutchison * htsearch/Display.cc: Back out change of June 24. * htsearch/htsearch.cc: Ditto. * htsearch/htsearch.cc (setupWords): Remove HtStripPunctuation in favor of requiring Fuzzy classes to strip whatever punctuation is necessary. * htfuzzy/Fuzzy.h: Add HtWordType.h to #includes and update comments. * htfuzzy/Synonym.cc, htfuzzy/Substring.cc, htfuzzy/Speling.cc, htfuzzy/Prefix.cc, htfuzzy/Exact.cc, htfuzzy/Endings.cc, htfuzzy/Fuzzy.cc (getWords): Call HtStripPunctuation on input before performing fuzzy matching. Thu Jul 8 21:28:44 1999 Geoff Hutchison * htdig/HTML.cc (do_tag): Add support for parsing tags. Mon Jul 5 16:53:23 1999 Geoff Hutchison * htdig/htdig.cc (main): Insert '*' instead of username/password combination to hide credentials in process accounting. Sat Jul 3 17:35:52 1999 Geoff Hutchison * htdig/Transport.h(ConnectionWrite): Return value from Connection::write call. * htdig/URLRef.h, htdig/URLRef.cc: Cleanup and made hopcount default consistent with 7/3 change to DocumentRef.cc * htdig/Server.h, htdig/Server.cc, htdig/Retriever.cc: Cleanup and fixes to match URLRef calling interface. Sat Jul 3 16:37:29 1999 Geoff Hutchison * htdig/HTML.cc (do_tag): Fix robots parsing to allow multiple directives to work correctly. Fixes PR#578, as provided by Chris Liddiard . Sat Jul 3 00:47:51 1999 Geoff Hutchison * htdig/Makefile.in: Remove old SGMLEntities code. Sat Jul 3 00:26:55 1999 Geoff Hutchison * htcommon/DocumentRef.cc (Clear): Change default value of docHopCount to 0 to fix several hopcount bugs. * htdig/Transport.h, htdig/Transport.cc: Changes to support URL referers as well as authentication credentials. * htdig/HtHTTP.h, htdig/HtHTTP.cc(SetCredentials): Implement HTTP Basic Authentication credentials. (SetRequestCommand): Use Referer and Authentication headers if supplied. Sun Jun 30 11:26:00 1999 Gabriele Bartolini * htdig/Transport.h: Inserted the methods declarations regarding the connection management. The code has been moved out from the HtHTTP.h code. Also moved here the static variable 'debug'. * htdig/Transport.cc: Definition of the connection management code. The code has been moved out from the HtHTTP.cc code. * htdig/HtHTTP.h: Eliminated the connection management code and the static variable 'debug'. Inserted the 'modification_time_is_now' as a static variable, in order to respect the encapsulation principle. * htdig/HtHTTP.cc: Eliminated the connection management code and the static variable 'debug' initialization. Inserted the 'modification_time_is_now' initialization. Sun Jun 27 16:29:49 1999 Geoff Hutchison * htdig/HTML.h: Cleanup. * htcommon/defaults.cc: Added default for img_alt_factor for text weighting on ...' in string passed to do_tag. (do_tag): Index IMG ALT text. Fri Jun 25 17:58:44 1999 Geoff Hutchison * htdig/Transport.h: Fix virtual methods for Transport_Response to have defaults. * htdig/HtHTTP.h: Fix class declaration of HtHTTP class to prevent syntax error. Pointed out by Gabriele. * htdig/Transport.cc: Add (empty) ctor and dtor functions for Transport_Response. Thu Jun 24 22:28:44 1999 Geoff Hutchison * htsearch/htsearch.cc (main): Add support for form inputs configdir and commondir as contributed by Herbert Martin Dietze . * htsearch/Display.cc (createURL): If configdir and commondir are defined, add them to URLs sent for other pages. Wed Jun 23 23:00:18 1999 Geoff Hutchison * htdig/HtHTTP.h, htdig/HtHTTP.cc: Make a subclass of Transport. Wed Jun 23 22:08:20 1999 Geoff Hutchison * htlib/Configuration.cc (Add): Handle single-quoted values for attributes. Tue Jun 22 23:35:39 1999 Geoff Hutchison * htdig/Transport.h, htdig/Transport.cc: Virtual classes to handle transport protocols such as HTTP, FTP, WAIS, gopher, etc. * htdig/Makefile.in: Make sure they're compiled (not that there's much!) * htdig/HtHTTP.h: Add htdig.h to ensure config is defined. Mon Jun 21 14:33:10 1999 Gilles Detillieux * htdig/Document.cc(readHeader), htdig/HtHTTP.cc(ParseHeader): fix handling of modification_time_is_now in readHeader, add similar code to ParseHeader. Sun Jun 20 21:25:15 1999 Geoff Hutchison * htdig/Retriever.h: Add hop parameter to got_href method. Defaults to 1. * htdig/Retriever.cc(got_href): Use it instead of constant 1. * htdig/HTML.cc (do_tag): Use new hop parameter to keep the same hopcount for frame, embed and object tags. * htdig/Makefile.in: Make sure HtHTTP.cc is compiled. * htdig/HtHTTP.cc (ctor): Add default value for _server to make prevent strange segmentation faults. Fri Jun 18 09:53:30 1999 Gilles Detillieux * htcommon/DocumentRef.h, htcommon/DocumentRef.cc(Clear, Deserialize): add docHeadIsSet field, code for setting and getting it. * htcommon/DocumentDB.cc(Add): only put out excerpt record if DocHead is really set. * htmerge/doc.cc(convertDocs): add missing else after code to delete documents with no excerpts. (All these changes fix the disappearing excerpts problem in 3.2.) Wed Jun 16 23:04:38 1999 Geoff Hutchison * htdig/Document.cc (UseProxy): Change http_proxy_exclude to an escaped regex string. Allows for much more complicated rules. Wed Jun 16 16:04:07 1999 Gilles Detillieux * Makefile.config.in: fix typo in name IMAGE_URL_PREFIX. * htdig/Retriever.cc(IsValidURL): change handling of valids to only reject if list is not empty, give different error message. Wed Jun 16 14:40:56 1999 Gilles Detillieux * htsearch/htsearch.cc(main): pass StringList args to setEscaped() instead of unprocessed input[] char *'s. * htsearch/Display.cc(buildMatchList): cast score to (int) in maxScore calculation, to avoid compiler warnings. * htdig/htdig.cc(main): change comparison on minimalFile to avoid compiler warnings. Wed Jun 16 11:30:23 1999 Gilles Detillieux * htlib/HtRegex.cc(setEscaped): Fix appending of substring to avoid compiler warnings. * htlib/HtDateTime.cc(SettoNow): Strip out all the nonsense that doesn't work, set Ht_t directly instead. Wed Jun 16 09:58:12 1999 Gilles Detillieux * configure.in, configure, Makefile.config.in: Correct handling of SEARCH_FORM variable, as Gabriele recommended. Wed Jun 16 09:32:06 1999 Gilles Detillieux * htlib/cgi.h, htlib/cgi.cc(cgi & init), htsearch/htsearch.cc (main & usage): allow a query string to be passed as an argument. Wed Jun 16 08:43:09 1999 Gilles Detillieux * htcommon/Makefile.in, htdig/Makefile.in, htfuzzy/Makefile.in, htmerge/Makefile.in, htnotify/Makefile.in: Use standard $(bindir) variable instead of $(BIN_DIR). Allows for standard configure flags to set this. (Completes Geoff's change on May 15.) Tue Jun 15 14:31:50 1999 Gilles Detillieux * htdig/PDF.cc(parseNonTextLine): move line that clears _parsedString, so title cleared even if rejected. * htsearch/Display.cc(buildMatchList & sort): move maxScore calculation from sort to buildMatchList, so it's done even if there's only 1 match. Mon Jun 14 15:01:07 1999 Gilles Detillieux * htdig/Document.cc(RetrieveHTTP): Show "Unknown host" message if Connection::assign_server() fails (due to gethostbyname() failure). Mon Jun 14 13:52:34 1999 Gilles Detillieux * htcommon/defaults.cc, htsearch/Display.h, htsearch/Display.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: add template_patterns attribute, to select result templates based on URL patterns. Sun Jun 13 16:29:19 1999 Geoff Hutchison * htdig/Retriever.cc (IsValidURL): Add valid_extension list, as requested numerous times. * htcommon/defaults.cc: Add config attribute valid_extensions, with default as empty. Sat Jun 12 23:10:39 1999 Geoff Hutchison * htcommon/DocumentRef.h: Fix thinkos introduced in change earlier today. Actually compiles correctly now. Sat Jun 12 22:37:22 1999 Geoff Hutchison * htdig/HtHTTP.cc (ParseHeader): Fix parsing to take empty headers into account. Fixes PR#557. * htsearch/Display.h, htsearch/Display.cc (excerpt): Fix declaration to refer to first as reference--ensures ANCHOR is properly set. Fixes PR#541 as suggested by . * htfuzzy/Endings.cc (getWords): Fixed PR#560 as suggested by Steve Arlow . Solves problems with fuzzy matching on words like -ness: witness, highness, likeness... Tries to interpret words as root words before attempting stemming. * installdir/search.html (Match): Add Boolean to default search form, as suggested by PR#561. * htlib/URL.cc (URL): Fix PR#566 by setting the correct length of the string being matched. 'http://' is 7 characters... Sat Jun 12 19:06:36 1999 Geoff Hutchison * htlib/HtZlibCodec.h, htlib/HtZlibCodec.cc: New files. Provide general access to zlib compression routines when available. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Remove compression access and restore DocHead access through default methods. Compression of excerpts will occur through the HtZlibCodec classes and through the DocumentDB excerpt access. Sat Jun 12 15:25:08 1999 Geoff Hutchison * htmerge/docs.cc (convertDocs): Load excerpt from external database before considering it empty. Sat Jun 12 14:41:54 1999 Geoff Hutchison * htsearch/Display.cc (displayMatch): Added patch from Torsten Neuer to fix PR# 554. * htdig/HTML.cc (do_tag): Add parsing for and , including suggestions from Gilles as to condensing cases with parsing. Sat Jun 12 14:00:39 1999 Geoff Hutchison * htdig/ExternalParser.cc (parse): Quote the filename before passing it to the command-line to prevent shell escapes. Fixes PR#542. Fri Jun 11 15:59:10 1999 Gilles Detillieux * htlib/URL.cc(removeIndex): use CompareWord instead of FindFirstWord, to avoid substring matches. Wed Jun 2 15:51:00 1999 Gilles Detillieux * htlib/URLTrans.cc(encodeURL): Fix to ensure that non-ASCII letters get URL-encoded. Mon May 31 22:40:29 1999 Geoff Hutchison * htcommon/DocumentDB.cc(ReadExcerpt): Fix silly typos with methods, thinko with docID. (Add): Add the excerpt *before* the URL index is written. * htdig/Retriever.cc(isValidURL): Remove code restricting URLs to relative and http://. * htdig/htdig.cc(main): Unlink the doc_excerpt file when doing an initial dig. (main): Fix silly typo with minimumFile. * htmerge/db.cc(mergeDB): Call DocumentDB::Open() with doc_excerpt for consistency--doesn't actually do anything with it. * htmerge/docs.cc(convertDocs): Ditto. Also don't delete a document simply because it has an empty DocHead. Excerpts are now stored in a separate database! * htmerge/htmerge.h: Call mergeDB and convertDocs with doc_excerpt parameter. * htmerge/htmerge.cc(main): Ditto. * htsearch/Display.h: Call ctor with all three doc db filenames. * htsearch/Display.cc(Display): Call DocumentDB::Open with above. (excerpt): Retrieve the excerpt from the excerpt database. * htsearch/htsearch.cc: Call Display::Display with all three doc db filenames. Mon May 31 15:08:30 1999 Geoff Hutchison * htcommon/DocumentDB.h: Add new method ReadExcerpt to read the excerpt from the separate (new) excerpt database. Change Open() and Read() methods to account for this new database. * htcommon/DocumentDB.cc (Open): Open the excerpt database too. (Read): Ditto. (Close): Close it if it exists. (ReadExcerpt): Explicitly read the DocHead of this DocumentRef. (Add): Make sure DocHeads go into the excerpt database. (Delete): Make sure we delete the associated excerpt too. (CreateSearchDB): Make sure we grab the excerpt from the database. * htcommon/DocumentRef.cc(Serialize): Don't serialize the DocHead field, this is done in the DocumentDB code. * htcommon/defaults.cc(modification_time_is_now): Set to true to avoid problems with not setting dates when no Last-Modified: header appears. (doc_excerpt): Add new attribute for the filename of the excerpt database. * htdig/HtHTTP.h: Remove incorrect virtual declarations from Request and EstablishConnection methods. Assign void return value to ResetStatistics since it doesn't return a value. * htdig/htdig.cc (main): Add new "minimal" flag '-m' to only index the URLs in the supplied file. Sets hopcount to ignore links. Sun May 30 19:36:15 1999 Alexander Bergolth * htlib/URL.cc (normalizePath): Fix bug that caused endless loops and core dumps when normalizing URLs with more than one of ( "/../" | "/./" | "//" | "%7E" ) * htlib/HtDateTime.cc (Httimegm): Call Httimegm in timegm.c unless HAVE_TIMEGM. Wed May 26 23:15:46 1999 Geoff Hutchison * htmerge/db.cc (mergeDB): Add patch contributed by Roman Dimov to fix problems with confusing docIDs, resulting in documents in main db removed when the corresponding DocID was supposed to be removed from the merged db. Wed May 26 11:30:22 1999 Geoff Hutchison * htsearch/Display.h, htsearch/Display.cc, htsearch/htsearch.cc: Switch restrict and excludes to use HtRegex instead of StringMatch. * htdig/htdig.cc (main): Fix typo clobbering setting of excludes. Obviously fixes problems with badquerystr and excludes! * htdig/HtHTTP.cc (ParseHeader): Change parsing to skip extra whitespace, as in 5/19 Document.cc(readHeader) change. Wed May 19 22:17:49 1999 Geoff Hutchison * htdig/HtHTTP.cc, htdig/HtHTTP.h: Add new files, contributed by Gabriele. A start at an HTTP/1.1 implementation. * htdig/Document.cc (readHeader): Fix change of 5/16 to actually work! :-) * htsearch/Display.cc (expandVariables): Change end-of-expansion test to include states 2 and 5 to ensure templates ending in } are still properly expanded, as suggested by Gilles. Mon May 17 14:31:31 1999 Geoff Hutchison * htlib/HtRegex.cc (setEscaped): Use full list of characters to escape as suggested by Gilles. Sun May 16 17:27:51 1999 Geoff Hutchison * htdig/Document.cc (readHeader): Since multiple whitespace characters are allowed after headers, don't use strtok. (readHeader): We no longer pretend to parse Word, PostScript, or PDF files internally. (getParsable): Don't generate PostScript or PDF objects since we no longer recommend using them. Sun May 16 17:07:19 1999 Geoff Hutchison * htlib/HtRegex.cc (setEscaped): Ensure escaping does not loop beyond the end of a string. * htdig/Retriever.cc (IsValidURL): Fix badquerystr parsing to use HtRegex as expected. (Oops!) * htdig/HTML.cc (parse): Use HtSGMLCodec during parsing, rather than encoding the whole document at the beginning. More consistent with previous use of SGMLEntities. Sat May 15 12:57:40 1999 Geoff Hutchison * htlib/URL.cc (normalizePath): Remove extra (useless) variable declarations. * htlib/htString.h, htlib/String.cc: Add new method Nth to solve problems with (String *)->[]. * htlib/HtRegex.h, htlib/HtRegex.cc: Added new method setEscaped(StringList) to produce a pattern connected with '|' of possibly escaped strings. Strings are not escaped if enclosed in [] and the brackets are removed from unescaped regex. * htdig/htdig.h: Use HtRegex instead of StringMatch for limiting by default. * htdig/Retriever.cc: As above. * htdig/htdig.cc(main): As above. Use setEscaped to set limits correctly (i.e. in a backwards-compatible way). Sat May 15 11:24:26 1999 Geoff Hutchison * htfuzzy/Speling.h, htfuzzy/Speling.cc: New files for simple spelling corection. Currently limited to transpostion and added character errors. Missing character errors to be added soon. * htfuzzy/Makefile.in: Compile it. * htfuzzy/Fuzzy.cc (getFuzzyByName): Use it. * htcommon/defaults.cc: Add new option minimum_speling_length for the shortest query word to receive speling fuzzy modifications. Should prevent problems with valid words generating unrelated "corrections" of words. Default is 5 chars. Sat May 15 11:18:27 1999 Geoff Hutchison * htfuzzy/Fuzzy.cc (getWords): Ensure word is not an empty or null string. * htfuzzy/Metaphone.cc (generateKey): Ditto. Should solve PR#514. * htdig/Document.cc (Reset): Do not use modification_time_is_now attribute. Simply reset modtime to 0, time is set elsewhere. * Makefile.config.in: Add options from separate CONFIG files. * configure.in, configure: Add configure-level switches for --with-image-url-prefix= and --with-search-form=. Do not generate CONFIG file (hopefully to be phased out soon). * */Makefile.in: Make linking CONFIG-dependent files depend on Makefile.config, not CONFIG. * Makefile.in: Use standard $(bindir) variable instead of $(BIN_DIR). Allows for standard configure flags to set this. Tue May 11 11:15:08 1999 Geoff Hutchison * htlib/HtDateTime.h, htlib/HtDateTime.cc: Updates from Gabriele, fixing SetToNow() and adding GetDiff to return the difference in time_t between two objects. * htdig/Retriever.cc (Need2Get): Add patch from Warren Jones to keep track of inodes on local files to eliminate duplicates. Hopefully this will serve for a first-try at a signature method for HTTP as well. Tue May 4 20:20:40 1999 Geoff Hutchison * htfuzzy/Regex.h, htfuzzy/Regex.cc: Add new regex fuzzy algorithm, based on Substring and Prefix. * htfuzzy/Fuzzy.cc (getFuzzyByName): Add it. * htfuzzy/Makefile.in: Compile it. * htcommon/defaults.cc: Add new attribute regex_max_words, same concept as substring_max_words. * htfuzzy/Exact.cc, htfuzzy/Substring.cc, htfuzzy/Prefix.cc: Define names attribute for debugging purposes. * installdir/htdig.conf: Fix the comments for search_algorithm to refer to all the current possibilities. * htlib/HtRegex.cc (match): Slight cleanup of how to return. Tue May 4 15:28:38 1999 Geoff Hutchison * htsearch/htsearch.cc (reportError): Add e-mail of maintainer to error message. Should help direct people to the correct place. * htdig/Retriever.cc (IsValidURL): Lowercase all extensions from bad_extensions as well as all extensions used in comparisons. Ensures we're using case-insenstive matching. Mon May 3 23:20:22 1999 Geoff Hutchison * htdig/Retriever.cc (IsValidURL): Fix typo with #else statement for REGEX. * htdig/htdig.cc: Add conditionals for REGEX to use HtRegex instead of StringMatch methods when defined. * htlib/HtDateTime.h: Update to remove definitions of true and false, established by May 2 change in include/htconfig.h.in as contributed by Gabriele. * htlib/HtDateTime.cc: Replace call to mktime internal function to Httimegm in timegm.c, contributed by Leo. * htlib/timegm.c: Declare my_mktime_gmtime_r to prevent compiler errors with incompatible gmtime structures, contributed by Leo. * configure.in: Rearrange date/time checks for clarity. * configure: Regenerate using autoconf. * include/htconfig.in: Add HAVE_STRFTIME flag. Sun May 2 18:49:04 1999 Alexander Bergolth * configure.in, include/htconfig.h.in: Added a configure test for the availability of the bool type. Fri Apr 30 20:00:09 1999 Geoff Hutchison * htlib/HtDateTime.h, htlib/HtDateTime.cc: Update with new versions sent by Gabriele. Fri Apr 30 19:30:42 1999 Geoff Hutchison * htlib/HtRegex.h, htlib/HtRegex.cc: New class, contributed by Peter D. Gray as a small wrapper for system regex calls. * htlib/Makefile.in: Build it. * htdig/htdig.h: Use it if REGEX is defined. * htdig/htdig.cc: Ditto. * htdig/Retriever.cc: Ditto. * htsearch/Display.cc(generateStars): Remove extra newline after STARSRIGHT and STARSLEFT variables, noted by Torsten Neuer . Fri Apr 30 18:52:56 1999 Alexander Bergolth * htlib/URL.cc(ServerAlias): port for server_aliases entries now defaults to 80 if omitted. Wed Apr 28 19:57:38 1999 Geoff Hutchison * htlib/HtDateTime.h, htlib/HtDateTime.cc: New class, contributed by Gabriele. * htlib/Makefile.in: Compile it. * README: Update message from 3.1.0 (oops!) to 3.2.0, remove rx directory. * installdir/htdig.conf: Add example of no_excerpt_show_top attribute in line with most user's expectations. * contrib/README: Mention contributed section of the website. * Makefile.in: Ignore mailarchive directory--now removed from CVS. Wed Apr 28 10:46:31 1999 Gilles Detillieux * htmerge/db.cc(mergeDB): fix a few errors in how the merge index name is obtained. Tue Apr 27 23:00:39 1999 Geoff Hutchison * Makefile.config.in: Remove now-useless LIBDIRS variable. * mailarchive/Split.java, mailarchive/htdig: Remove ancient mailarchive stuff. Tue Apr 27 18:01:52 1999 Gilles Detillieux * htsearch/Display.cc(setupImages): Remove code setting URLimage to a bogus pattern (remnant left over after merge). Tue Apr 27 16:43:08 1999 Gilles Detillieux * htdig/Document.cc(RetrieveHTTP): Show "Unable to build connection" message at lower debug level. Tue Apr 27 11:24:19 1999 Geoff Hutchison * htsearch/Display.h: Remove sort, compare functions re-introduced in merge. Moved to ResultMatch by Hans-Peter's April 19th chnages. * htsearch/Display.cc: Remove bogus call to ResultMatch:setRef, removed by Hans-Pater's April 19th changes. Sat Apr 24 21:08:35 1999 Geoff Hutchison * Merge in changes from 3.1.2 (see below). * htcommon/WordList.cc: Change valid_word to use iscntl(). * htdig/Plaintext.cc: Remove CVS Log. * htdig/Retriever.cc: Fix ancient bug with empty excludes list. * htlib/List.cc: Remove CVS Log, use more succinct test for out-of-bounds. * htsearch/Display.cc: Fix logic with starPatterns, only show top of META description. * htsearch/Display.h: Introduce headers needed for sort functionality. * installdir/htdig.conf: Add example max_doc_size attribute as well as example for including start_url from a file. * htdoc/ChangeLog, htdoc/RELEASE.html, htdoc/FAQ.html, htdoc/where.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/uses.html, htdoc/contents.html, htdoc/mailarchive.html: Merge in documentation updates from 3.1.2. Sat Apr 24 15:18:45 1999 Hans-Peter Nilsson * htsearch/Display.cc (sort): Return immediately if <= 1 items to sort. Mon Apr 19 00:53:06 1999 Hans-Peter Nilsson * htsearch/ResultMatch.h (create): New. All (the only) ctor caller changed to use this. (setRef, getRef): Removed. Callers changed to use nearby data. (incomplete): Removed. (setIncompleteScore): Renamed to... (setScore): ...this. All callers changed. (setSortType): New. (getTitle, getTime, setTitle, setTime, getSortFun): New virtual functions. (enum SortType): Moved from Display, private. (mySortType): New static member. * htsearch/ResultMatch.cc (mySortType): Define static member variable. (getScore): Remove handling of "incomplete". Moved to ResultMatch.h (getTitle, getTime, setTitle, setTime): New dummy functions. (class ScoreMatch, class TimeMatch, class IDMatch, class TitleMatch): Derived classes with compare functions (from Display) and extra sort-method-related members, as needed. (setSortType): New, mostly moved from Display. (create): New. * htsearch/Display.h: Changed first argument from ResultMatch * to DocumentRef *. (compare, compareTime, compareID, compareTitle, enum SortType, sortType): Removed. * htsearch/Display.cc (display): Call ResultMatch::setSortType and output syntax error page for invalid sort methods. (displayMatch): Change first argument from ResultMatch * to DocumentRef *ref. All callers changed. (buildMatchList): Remove call to sortType and typ variable. Always call (ResultMatch::)setTime and setTitle. Remove extra call to setID. (sort): Call (ResultMatch::)getSortFun for qsort compare function. (compare, compareTime, compareID, compareTitle, sortType): Removed. Wed Apr 14 21:21:35 1999 Alexander Bergolth * htlib/regex.c: fixed compile problem with AIX xlc compiler * htlib/HtHeap.h: fixed compile problem with AIX xlc compiler (bool) * htlib/HtVector.h: ditto * htsearch/Display.cc: fixed typo Wed Apr 14 00:17:06 1999 Geoff Hutchison * htsearch/Display.h: Add compareID for sorting results by DocID. * htsearch/Display.cc: As above. Tue Apr 13 23:50:28 1999 Geoff Hutchison * htcommon/defaults.cc: Add new config option use_doc_date to use document meta information for the DocTime() field. * htdig/HTML.cc(do_tag): Call Retriever::got_time if use_doc_date is set and we run across a META date tag. * htdig/Retriever.h, htdig/Retriver.cc: Add new got_date function. When called, sets the DocTime field of the DocumentRef after parsing is completed. Currently assumes ISO 8601 format for the date tag. Sun Apr 11 12:51:39 1999 Hans-Peter Nilsson * htsearch/Display.cc (buildMatchList): Delete thisRef if excluded by URL. Call setRef(NULL), not setRef(thisRef). Wed Apr 7 19:35:42 1999 Geoff Hutchison * htsearch/htsearch.cc(usage): Remove bogus -w flag. Thu Apr 1 12:05:11 1999 Gilles Detillieux * htsearch/htsearch.cc(main): Apply Gabriele's patch to avoid using an invalid matchesperpage CGI input variable. * htsearch/Display.cc(display) & (setVariables): Correct any invalid values for matches_per_page attribute to avoid div. by 0 error. Wed Mar 31 15:19:25 1999 Gilles Detillieux * htfuzzy/Synonym.cc: Fix previous fix of minor memory leak. (db pointer wasn't properly set) Mon Mar 29 10:31:09 1999 Geoff Hutchison * htsearch/Display.cc(excerpt): Added patch from Gabriele to improve display of excerpts--show top of description always, otherwise try to find the excerpt. Sun Mar 28 19:45:02 1999 Hans-Peter Nilsson * htlib/HtWordType.h (HtIsWordChar): Avoid matching 0 when using strchr. (HtIsStrictWordChar): Ditto. * htdig/ExternalParser.cc (parse): Before got_href call, set hopcount of URL to that of base plus 1. Add URL to external parser error output. * htlib/URL.cc (URL(char *ref, URL &parent) ): Move call to constructURL call inside previous else-clause. (parse): Reset _normal, _signature, _user initially. Commence parsing, even if no "//" is found. Do not set _normal here. (normalizePath): Call removeIndex finally. * htcommon/WordRecord.h (WORD_RECORD_COMPRESSED_FORMAT) [!NO_WORD_COUNT]: Change to "cu4". * htlib/HtPack.cc (htPack): Correct handling at end of code-string and end of encoding-byte. Add code 'c' for often-1 unsigned ints. (htUnpack): Add handling of code 'c'. Thu Mar 25 12:18:05 1999 Gilles Detillieux * installdir/long.html, installdir/short.html: Remove backslashes before quotes in HTML versions of the builtin templates. * Makefile.in: Add long.html & short.html to COMMONHTML list, so they get installed in common_dir. Thu Mar 25 11:56:50 1999 Gilles Detillieux * htsearch/Display.cc(displayMatch), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add date_format attribute suggested by Marc Pohl. Thu Mar 25 09:46:07 1999 Gilles Detillieux * htsearch/Display.cc(displayMatch): Avoid segfault when DocAnchors list has too few entries for current anchor number. Tue Mar 23 15:08:40 1999 Gilles Detillieux * htsearch/Display.cc(displayMatch): Fix problem when documents did not have descriptions. Tue Mar 23 14:17:14 1999 Gilles Detillieux * htdig/PDF.cc(parseString): Use minimum_word_length instead of hardcoded constant. Tue Mar 23 14:02:40 1999 Gilles Detillieux * htdig/HTML.cc: Fix bug where noindex_start was empty, allow case insensitive matching of noindex_start & noindex_end. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Fix inconsistencies in documentation for noindex_start & noindex_end. Tue Mar 23 14:01:16 1999 Gilles Detillieux * htdig/HTML.cc: Add check for tag that is missing a closing tag, terminating it at next href. Tue Mar 23 13:57:35 1999 Gilles Detillieux * htdig/Document.cc: Fix check of Content-type header in readHeader(), correcting bug introduced Jan 10 (for PR#91), and check against allowed external parsers. Tue Mar 23 13:54:35 1999 Gilles Detillieux * htdig/HTML.cc: More lenient comment parsing, allows extra dashes. Tue Mar 23 12:22:53 1999 Gilles Detillieux * htlib/Configuration.cc(Add): Fix function to avoid infinite loop on some systems, which don't allow all the letters in isalnum() that isalpha() does, e.g. accented ones. * htdig/HTML.cc: Fix three reported bugs about inconsistent handling of space and punctuation in title, href description & head. Now makes destinction between tags that cause word breaks and those that don't, and which of the latter add space. Tue Mar 23 12:15:48 1999 Gilles Detillieux * htdig/Plaintext.cc(parse): Use minimum_word_length instead of hardcoded constant. Tue Mar 23 12:11:04 1999 Gilles Detillieux * htmerge/words.cc(mergeWords): Fix to prevent description text words from clobbering anchor number of merged anchor text words. Tue Mar 23 12:02:00 1999 Gilles Detillieux * htsearch/Display.cc(generateStars): Add in support for use_star_image which was lost when template support was put in way back when. Tue Mar 23 11:47:52 1999 Gilles Detillieux * Makefile.in: add missing ';' in for loops, between fi & done Mon Mar 22 16:06:15 1999 Gilles Detillieux * htdig/HTML.cc: Check for presence of more than one tag. Mon Mar 22 15:32:15 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/parse_doc.pl: Fix handling of minimum word length. Sun Mar 21 15:19:00 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtPack.cc (htPack): New. * htlib/HtPack.h: New. * htsearch/parser.cc (perform_push): Unpack WordRecords using htUnpack. * htsearch/htsearch.h: Add "debug" declaration. * htmerge/words.cc (mergeWords): Pack WordRecords using htPack. * htlib/Makefile.in (OBJS): Add HtPack.o * htcommon/WordRecord.h: Add WORD_RECORD_COMPRESSED_FORMAT * htdig/HTML.cc (parse): Keep contents in String variable textified_contents while using its "char *". * htsearch/Display.cc (excerpt): Similar for head_string. Thu Mar 18 20:01:24 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * installdir/long.html, installdir/short.html: Write out HTML versions of the builtin templates. * installdir/htdig.conf: Add commented-out template_map and template_name attributes to use the on-disk versions. Tue Mar 16 03:06:06 1999 Hans-Peter Nilsson <hp at bitrange.com> * htcommon/DocumentDB.cc (Delete): Fix bad parameter to Get: use key, not DocID. Tue Mar 16 01:50:16 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtWordType.h (class HtWordType): New. * htlib/HtWordType.cc: New. * htlib/Makefile.in (OBJS): Add HtWordType.o * htdoc/attrs.html: Document attribute extra_word_characters. * htdoc/cf_byprog.html: Ditto. * htdoc/cf_byname.html: Ditto. * htcommon/defaults.cc (defaults): Add extra_word_characters. * htsearch/htsearch.h: Lose spurious extern declaration of unused variable valid_punctuation. * htsearch/htsearch.cc (main): Call HtWordType::Initialize. (setupWords): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htsearch/Display.cc (excerpt): Use HtIsStrictWordChar. * htlib/StringMatch.cc (FindFirstWord): Ditto. (CompareWord): Ditto. * htdig/htdig.cc (main): Call HtWordType::Initialize. * htdig/Retriever.h (class Retriever): Lose member valid_punctuation. * htdig/Retriever.cc (Retriever): Lose its initialization. * htdig/Postscript.h (class Postscript): Lose member valid_punctuation. * htdig/Postscript.cc (Postscript): Lose its initialization. (flush_word): Use HtStripPunctuation. (parse_string): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. * htdig/Parsable.h (class Parsable): Lose member valid_punctuation. * htdig/Parsable.cc (Parsable): Lose its initilization. * htcommon/WordList.cc (valid_word): Use HtIsStrictWordChar. (BadWordFile): Use HtStripPunctuation. Do not read valid_punctuation. * htcommon/DocumentRef.cc (AddDescription): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htdig/PDF.cc (parseString): Similar.. * htdig/HTML.cc (parse): Similar. * htdig/Plaintext.cc (parse): Similar. Sun Mar 14 14:04:31 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Makefile.in: Add HtSGMLEntites.o to OBJS. Sat Mar 13 21:29:38 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentDB.cc(Open, Read): Switch to DB_HASH for faster access. Most important for very quick URL lookups! * htcommon/DocumentRef.cc(AddDescription): Check to see that description isn't a null string or contains only whitespace before doing anything. * htlib/HtSGMLCodec.h, htlib/HtSGMLCodec.cc: Add new class to convert between SGML entities and high-bit characters. * htdig/HTML.cc(parse): Use it instead of SGMLEntities. * htsearch/Display.cc(excerpt): Use HtSGMLCodec to covert *back* to SGML entities before displaying. * htlib/HtHeap.cc: Cleaned up comments, use more efficient procedure to build from a vector. * htlib/HtWordCodec.cc(HtWordCodec): Fix bug with constructing from uninitialized variables! * htlib/URL.h, htlib/URL.cc: Initial support for multiple schemes and user@host URLs. * htlib/List.cc(Nth): Check for out-of-bounds requests before doing anything. Fri Mar 12 00:31:03 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/mktime.c (__mon_yday): Correct size to number of initializers (2). * htsearch/htsearch.cc (main): Remove doc_index handling. * htsearch/ResultMatch.h (setURL): Change to setID, use int. All callers changed. (getURL): Change to getID. All callers changed. (String url): Change to "int id". * htsearch/Display.h: (Display): Second parameter removed. (docIndex) removed. * htsearch/Display.cc (Display, ~Display): Do not handle docIndex. (display): Use DocumentDB::operator [](int), not DocumentDB::operator [] (char *). (buildMatchList): Changed to handle ResultMatch as DocID int, instead of URL string: use DocumentDB::operator [](int), not DocumentDB::operator [] (char *). Get DocumentRef directly, then filter the URL by includeURL(). * htnotify/htnotify.cc (main): Use DocIDs(), not DocURLs(). Handle the change from String * to IntObject *. * htmerge/htmerge.cc (main): Do not delete doc_index. * htmerge/docs.cc (convertDocs): Test doc_index access as read-only. Pass as parameter for docdb, do not handle separately. * htmerge/docs.cc (convertDocs): Add debug messages about cause when deleting documents. If verbose > 1, write id/URL for every URL. * htmerge/db.cc (mergeDB): Handle doc_index, test accessibility. * htlib/IntObject.h (class IntObject): Add int-constructor. * htdoc/attrs.html (doc_index): Say that mapping is from document URLs to numbers. (doc_db): Say that indexing is on document number. * htdoc/cf_byprog.html (doc_index): Move from htsearch to htdig entry. * htdig/htdig.cc (main): Add .work suffix to doc_index too. Unlink doc_index if initial. * htcommon/DocumentDB.h (Open): New second argument. (Read): New second argument, default to 0. (operator [](int)): New. (Exists(char *), Delete(char *)): Change to int parameter. (DocIDs, i_dbf): New. * htcommon/DocumentDB.cc (operator [](int)): New. (Exists(char *), Delete(char *)): Changed to DocID int parameter. All callers changed. (URLs): Assume keys are ok without probing for documents with each key. (DocIDs): New. (Open): Take an index database file name as second argument. All callers changed. (Read): Similar, accept 0. (all): Change to index on DocID. Wed Mar 10 02:25:24 1999 Hans-Peter Nilsson <hp at bitrange.com> * htdoc/attrs.html (template_name): Typo; used by htsearch, not htdig. Mon Mar 8 13:30:44 1999 Hans-Peter Nilsson <hp at bitrange.com> * htdig/Retriever.cc (got_href): Check if the ref is for the current document before adding it to the db. Mon Mar 8 01:36:38 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/DB2_db.cc: Remove errno. * htlib/DB2_hash.cc: Ditto. Sun Mar 7 20:50:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/EndingsDB.cc(createDB): Use link and unlink to move, rather than a non-portable system call. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Fix #ifdef problems with zlib. Sun Mar 7 09:39:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/timegm.c: Fix problems compiling on libc5 systems noted by Hans-Peter. * htlib/Makefile.in, Makefile.in, Makefile.config.in: Use regex.c instead of rx. * htfuzzy/EndingsDB.cc: Ditto. * configure.in, configure: Don't bother to config rx directory. Fri Mar 5 08:09:20 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrig/parse_doc.pl: uses pdftotext to handle PDF files, generates a head record with punctuation intact, extra checks for file "wrappers" & check for MS Word signature (no longer defaults to catdoc), strip extra punct. from start & end of words, rehyphenate text from PDFs. Tue Mar 2 23:18:20 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/htdig.cc: Renamed main.cc for consistency with other programs. * htlib/DB2_hash.h, htlib/DB2_hash.cc: Added interface to Berkeley hash database format. * htlib/Makefile.in: Use them! * htlib/Database.h: Define database types, allowing a choice between different formats. * htlib/Database.cc(getDatabaseInstance): Use passed type to pick between subclasses. Currently only uses Hash and B-Tree formats of Berkeley DB. * htcommon/DocumentDB.cc, htfuzzy/Endings.cc, htfuzzy/EndingsDB.cc, htfuzzy/Fuzzy.cc, htfuzzy/Prefix.cc, htfuzzy/Substring.cc, htfuzzy/Synonym.cc, htfuzzy/htfuzzy.cc, htmerge/docs.cc, htmerge/words.cc, htsearch/Display.cc, htsearch/htsearch.cc: Use new form of getDatabaseInstance(), currently with DB_BTREE option (for compatibility). Mon Mar 1 22:53:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/regex.c, htlib/striptime.c: Import new versions from glibc. * htlib/Makefile.in, htlib/mktime.c, htlib/timegm.c, htlib/lib.h: Changes to use glibc timegm() function instead of buggy mytimegm(). * htdig/Document.cc(getdate): Use it. Tue Mar 2 02:35:50 1999 Hans-Peter Nilsson <hp at bitrange.com> * attrs.html: Rephrase and clarify entry for url_part_aliases. Sun Feb 28 23:25:40 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtURLCodec.cc (~HtURLCodec): Add missing deletion of myWordCodec. Fri Feb 26 19:03:58 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * configure, configure.in: Fix typo on timegm test. * htlib/mytimegm.cc: Fix Y2K problems. Wed Feb 24 21:09:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc(main): Remember to delete the parser! * htlib/String.cc(String(char *s, int len)): Remove redundant copy. * htsearch/Display.cc(display): Free DocumentRef memory after displaying them. (displayMatch): Fix memory leak when documents did not have anchors. Wed Feb 24 15:18:26 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Configuration.cc(Add): Fix small leak in locale code. * htlib/String.cc: Fix up code to be cleaner with memory allocation, inline next_power_of_2. Mon Feb 22 22:13:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/String.cc, htlib/htString.h: Fix some memory leaks. Mon Feb 22 08:52:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Dictionary.h, htlib/Dictionary.cc(hashCode): Check if key can be converted to an integer using strtol. If so, use the integer as the hash code. * htlib/HtVector.h, htlib/HtVector.cc: Implement Release() method and make sure delete calls are done properly. * htsearch/ResultList.h, htsearch/ResultList.cc(elements): Use HtVector instead of List. * htsearch/parser.cc: Ditto. Sun Feb 21 16:13:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtHeap.h, htlib/HtHeap.cc: Add new class. * htlib/Makefile.in: Compile it. * htlib/HtVector.h, htlib/HtVector.cc: Add Assign() to assign to elements of vectors. Sun Feb 21 14:45:26 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc: Add patch from Jerome Alet <alet at unice.fr> to allow '.' in config field but NOT './' for security reasons. * htdig/HTML.cc: Add patch from Gabriele to ensure META descriptions are parsed, even if 'description' is added to the keyword list. Sun Feb 21 14:43:44 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.h, htsearch/parser.cc: Clean up patch made for error messages, made on Feb 16. Thu Feb 18 20:19:30 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtVector.h, htlib/HtVector.cc: Added new Vector class. * htlib/Makefile.in: Compile it. * htlib/strptime.c: Add new version from glibc-2.1, replacing strptime.cc. * htdig/Document.cc: Use it. * htlib/regex.h, htlib/regex.c: Add new files from glibc-2.1. * htlib/mktime.c: Update from glibc-2.1. Wed Feb 17 23:44:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure, aclocal.m4: Add autoconf macro to detect syntax of makefile includes. * Makefile.in, Makefile.config.in, */Makefile.in: Change include syntax to use it. Wed Feb 17 12:36:42 1999 Hans-Peter Nilsson <hp at bitrange.com> * htcommon/defaults.cc (defaults): locale: change to "C". Local Variables: add-log-time-format: current-time-string End: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/ChangeLog.0���������������������������������������������������������������������������0100644�0063146�0012731�00000473146�07427026534�014323� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Thu Jan 31 17:32:33 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * Release of 3.1.6. * htdoc/confindex.html, htdoc/htsearch.html, htdoc/index.html, htdoc/mailarchive.html: Remove CSS link, not needed in these frameset pages. * htdoc/howto-mirror.html: Update with Jesse's latest version. Thu Jan 31 15:13:07 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * Makefile.in: Fixed install-strip target to properly handle relative paths in INSTALL_PROGRAM when passing it to subdirectories. Thu Jan 31 11:41:39 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: Updated questions 4.8 & 4.9 to emphasize use of doc2html over parse_doc.pl. Further clarified question 2.1. Thu Jan 31 10:14:23 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/parse_doc.pl: Added comments explaining why you should not be using this script. Wed Jan 30 17:20:51 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html: Updated to mention 3.1.6 as the newest version and --with-rx as a fix for regex problems on BSDI. Wed Jan 30 17:15:49 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/synonyms: Updated with the version contributed by David Adams, with minor changes. Kept old one as synonyms.original. * installdir/english.0: Changed lots more dubious uses of suffixes to get more appropriate and correct fuzzy endings expansions. Wed Jan 30 12:30:16 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/Connection.cc (connect): Fixed bug with allow_EINTR and add support for looping when the connection returns EAGAIN (no more free local ports). Thanks to Ahmon Dancy <dancy@franz.com> for pointing out the EAGAIN issue. Tue Jan 29 09:59:58 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: Updated with today's changes to maindocs FAQ. Mon Jan 28 16:54:15 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/README: Added mentions of examples & xmlsearch, fixed typo. Sun Jan 27 23:13:11 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/*.html: Final batch of documentation updates. Sat Jan 26 23:28:25 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/*: More documentation updates from merging with the current maindocs CVS. Fri Jan 25 21:36:21 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * acconfig.h, include/htconfig.h.in: Add USE_RX to potential configure #include macros. * htlib/gregex.h: Rename regex.h to prevent conflicts with system version. * htlib/regex.c, htlib/HtRegex.h: Ditto. * htfuzzy/EndingsDB.cc: Use same tests as HtRegex.h for rxposix.h, gregex.h or regex.h depending on configure results. * configure.in: Implement more flexible test for rx/regex, which will check for rxposix.h if --with-rx is supplied, will "fall back" to regex test if rxposix.h isn't available and will only use the htlib/ code and header for regex compile. * configure: Update using autoconf. Fri Jan 25 12:14:26 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/whatsnew/README, contrib/whatsnew/whatsnew.html: Added an example of how to get a what's new listing from the new features in htsearch. Thu Jan 24 22:43:28 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Add ignore_dead_servers attribute to control whether indexing will continue to try to contact a dead server. * htdig/Retriever.cc: Only mark a server as dead if the ignore_dead_servers attribute is set. * htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/attrs.html: Documentation updates. Thu Jan 24 15:32:59 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * configure, configure.in: Add --with-rx option to switch to system rx code (e.g. on BSDI). Needs some touchups still, including checking that rxposix.h exists and if --without-rx was supplied for some reason. * htlib/HtRegex.h: Add conditional <rxposix.h> header for systems where rx is better than regex. * htlib/Makefile.in: Make sure regex.o is only compiled if it works on a given system via LIBOBJS as supplied by the configure script. Mon Jan 21 22:33:30 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/RELEASE.html: Add first shot at the release notes for 3.1.6. Still need to finish some of the htdoc/ merges, including the SF icons and such. * htdoc/*.html: First stab at many of the htdoc/merges including the new Copyright line. (It is 2002, after all.) Fri Jan 18 18:17:34 2002 Geoff Hutchison <ghutchis@wso.williams.edu> * htmerge/docs.cc: Add a test if the DB database has no URLs before proceeding. * htmerge/words.cc: Add a slightly more user-friendly error message if the word list file doesn't exist. Remove exit() statements since reportError does this for us. Fri Jan 18 16:47:50 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Rewrote description of prefix_match_character to make it more clear, with crosslinks to related attributes, and described new wildcard matching feature. Added more explanations for relative days & months in startday et al. to make it clearer. Added more notes about to-strings in the url_part_aliases description and explained the example even more, as well as adding crosslinks to the new *_rewrite_rules. Fri Jan 18 15:56:11 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/htsearch.cc (setupWords), htsearch/parser.cc (perform_push): Added support for a wildcard word of "*" (or prefix_match_character if set and not empty) which returns all documents. Wed Jan 16 17:21:26 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html, htdoc/hts_form.html: Described how to use relative dates for startyear et al. Wed Jan 16 16:58:05 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (buildMatchList): Fixed startday et al. to allow relative days, month & years if values are negative. Fri Jan 11 20:57:51 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Updated descriptions for translate_* attributes to match the new default behavior. Fri Jan 11 17:48:54 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/SGMLEntities.cc (translateAndUpdate): Added support for translate_latin1 attribute, to turn off ISO-8859-1-specific entities. * htcommon/defaults.cc: Added translate_latin1 attribute. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Fri Jan 11 17:14:54 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/xmlsearch.{README,tar.gz}: Removed older xmlsearch package. Fri Jan 11 17:06:09 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/xmlsearch/*: Added files contributed by Nathan Hand and me to implement XML output from htsearch, including DTD, templates and config file. Wed Jan 9 22:08:21 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * CONFIG.in: Fixed to allow setting BIN_DIR by configure option. * contrib/htdig-3.1.6.spec: Fixed to make use of new ./configure options for pathnames, do away with patch file. Used variables for many pathnames to allow easy changes. Wed Jan 9 16:22:32 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Added support for max_keywords attribute. Wed Jan 9 16:10:44 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc (HTML, do_tag), htdig/ExternalParser.cc (parse): Added support for description_meta_tag_names attribute. Ensure external parser interface accepts META descriptions even if 'description' is added to the keyword list. * htcommon/defaults.cc: Added description_meta_tag_names attribute. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Tue Jan 8 17:39:24 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Added support for use_doc_date attribute. Thu Jan 3 17:10:50 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Makefile.in, htlib/lib.h: Removed references to timegm, mytimegm and strptime functions. Removed C source for these. Thu Jan 3 16:43:31 2002 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/htmerge.html: Added extra description for -m option to clear up common points of confusion, added note about LC_COLLATE environment variable. Fri Dec 21 18:52:32 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc: Added parsedcdate function, used by got_time, to parse DC date meta tags without requiring strptime or timegm. Thu Dec 20 12:25:47 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc: Added parsedate function, used by getdate, to parse date headers without requiring strptime or timegm, which have caused problems on some systems. Thu Dec 20 11:51:26 CET 2001 Gabriele Bartolini <angusgb@users.sourceforge.net> * configure.in: reviewed directory settings * Makefile.in: ditto (for 'make install' of htdig.conf and rundig) Wed Dec 19 23:05:09 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in: Add tests for ostream.h and iostream.h. * htlib/htString.h: Add HAVE_OSTREAM_H and HAVE_IOSTREAM_H preprocessor statements to deal with portability issues around the C++ header files. Wed Dec 19 13:33:55 2001 Gabriele Bartolini <angusgb@users.sourceforge.net> * configure.in: fixed bug in customisation of configure paramters * CONFIG.in: ditto * configure: re-generated with autoconf Tue Dec 18 16:12:17 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (displayMatch): Fixed to clear out old values of ANCHOR template variable for each result. Thu Dec 6 13:14:22 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/examples/rundig.sh: Fixed to make use of DBDIR variable. Wed Nov 21 12:54:42 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/rundig.html: Added note about effect of changing database_base. * htmerge/docs.cc (convertDocs): Changed confusing message about total doc db size in stats. Wed Nov 21 11:37:52 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/TemplateList.cc (createFromString), htdoc/attrs.html: Treat template_map as a _quoted_ string list. Change <i> tags to the HTML-4.0 compliant <em> tags in builtin-long template. Tue Nov 20 17:13:27 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/String.cc (String, append, sub): Added checks for negative lengths or start position to make code more fault-tolerant. Tue Nov 20 16:37:26 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Synonym.cc (createDB): Check for lines with less than 2 words, to avoid segfault caused by calling Database::Put() with negative length for data field. Sat Nov 3 23:55:00 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/htString.h: Add #include for ostream.h to solve compile problems with gcc3. * htlib/Connection.h, htlib/Connection.cc: Backport Connection class from 3.2 code--installs alarm() call to timeout connections and will retry connections a few times before giving up. Fri Nov 2 12:28:35 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc, htdoc/attrs.html: Added support for dc.date, dc.date.created and dc.date.modified to use_doc_date handling. Fri Nov 2 12:12:59 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/xmlsearch.README, contrib/xmlsearch.tar.gz: Added files contributed by Nathan Hand and me to implement XML output from htsearch, including DTD, templates and config file. Fri Nov 2 12:05:49 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc (do_tag), htcommon/defaults.cc: Added ignore_alt_text attribute to avoid indexing alt text in img tags. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Thu Nov 1 14:43:13 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/htsearch.cc (main): Fixed to only show file names in error messages when REQUEST_METHOD not set and -v option given, for security. Thu Nov 1 10:19:27 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc, htsearch/Display.h: Added a localized method for outputing HTTP headers, added support for a new search_results_contenttype attribute to control that header. * htcommon/defaults.cc: Added default for it. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Wed Oct 31 13:31:18 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/english.0: Changed lots of dubious uses of suffixes to get more appropriate and correct fuzzy endings expansions. Tue Oct 23 14:06:37 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc (RetrievedDocument): Fixed handling of null return from getParsable(), to avoid segfault problem introduced by text/css conditional added Jul 25. Fri Oct 19 17:24:19 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (hilight): Added Stefan Nehlsen's idea for anchor_target attribute. * htcommon/defaults.cc: Added default for it. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Sun Oct 14 22:05:30 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (external_parsers): Documented external converter chaining to same content-type, e.g. text/html->text/html-internal. Sun Oct 14 21:54:24 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html, htdoc/cf_byprog.html, htdoc/cf_byname.html, htcommon/defaults.cc: Documented and declared startyear, etc. attributes used by htsearch. Sun Oct 14 21:16:19 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/htdump.html, htdoc/htload.html, htdoc/attrs.html, htdoc/cf_byprog.html, htdoc/contents.html: Documented htdump and htload, indicating which attributes are used by them. Fri Oct 12 14:58:15 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/URL.cc (removeIndex): Fixed to make sure the matched file name is at the end of the URL. Tue Oct 2 09:34:43 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (start_url): Added a reference and link to limit_urls_to, explaining how the two are tied together. Fri Sep 28 17:19:45 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/htdig-3.1.6.spec: Fixed %install to make symlinks for htdump & htload, added these to %files list. Fri Sep 28 15:38:00 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (displayMatch): Save rewritten URL in DocumentRef so it'll be used for star_patterns and template_patterns matching. Fri Sep 28 14:25:29 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (buildMatchList, displayMatch), htsearch/htsearch.cc (main): Added calls to pass search_rewrite_rules to HtURLRewriter class and use it to rewrite URLs in results. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htcommon/defaults.cc: Added search_rewrite_rules attribute. Thu Sep 27 16:34:51 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Makefile.in, htlib/HtRegex.cc, htlib/HtRegex.h, htlib/HtRegexReplace.cc, htlib/HtRegexReplace.h, htlib/HtRegexReplaceList.cc, htlib/HtRegexReplaceList.h, htlib/HtURLRewriter.cc, htlib/HtURLRewriter.h: Added new classes to support regular expressions and implement url_rewrite_rules attribute, using Geoff's variation of Andy Armstrong's implementation of this. * htlib/URL.h, htlib/URL.cc: Added URL::rewrite() method. * htlib/htString.h: Added Nth() method for HtRegex class. * htdig/Retriever.cc (got_href, got_redirect): Added calls to url.rewrite(), and debugging output for this. * htdig/htdig.cc (main): Added calls to make instance of HtURLRewriter class. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htcommon/defaults.cc: Added url_rewrite_rules attribute. Mon Sep 17 16:52:07 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/running.html: New documentation on how to run after configuring. * htdoc/rundig.html: New manual page for rundig script. * htdoc/install.html: Added link to running.html. * htdoc/contents.html: Added link to running.html, rundig.html, related projects. Updated links to contrib and developer site. Got rid of link to web site stats. Fri Sep 14 09:18:38 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc (RetrieveHTTP): Add port to Host: header when port is not default, as per RFC2616(14.23). Fixes bug #459969. Sat Sep 8 22:04:47 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * acconfig.h, include/htconfig.h.in: Add undef for ALLOW_INSECURE_CGI_CONFIG, which if defined does about what you'd expect. (This is for any wrapper authors who don't want to rewrite but are willing to run insecure.) * htsearch/htsearch.cc: Only allow the -c flag to work when REQUEST_METHOD is undefined. Fixes PR#458013. Fri Aug 31 16:00:37 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/URL.cc (URL): Fixed to call normalizePath() even if URL is relative but with absolute path. Should fix bug #408586. Fri Aug 31 15:21:49 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.h, htdig/HTML.cc (HTML, parse, do_tag): Fixed buggy handling of nested tags that independently turn off indexing, so </script> doesn't cancel <meta name=robots ...> tag. Add handling of <noindex follow> tag. Fri Aug 31 14:33:41 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> [ Backport some 3.2.0b4 HTML parser changes. ] * htdig/HTML.cc (do_tag): Rewrite using Configuration class to separate tag attributes. Parse <object> tags properly, looking for data= attribute rather than src=. Add support for TITLE attributes in anchor and related tags. Treat <script></script> tags as noindex tags, much like <style></style> as suggested by Torsten. * htdig/HTML.cc(parse): Fix to prevent closing ">" from being passed to do_tag(). Wed Aug 29 10:20:55 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (allow_in_form, build_select_lists, limit_normalized, server_aliases, server_max_docs, server_wait_time, url_part_aliases): Added clarifications to allow_in_form, server_aliases and url_part_aliases descriptions. Changed word "directive" to "attribute" where appropriate. Added cross-link to server_aliases from limit_normalized, and to allow_in_form from build_select_lists. Mon Aug 27 17:22:56 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Improve handling of whitespace in META refresh handling. Fixes bug #406244. Mon Aug 27 16:38:43 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc (parse): Fixed delete [] text (was missing []), added simple optimizations for comment & noindex_start skipping, handle decoded < entity correctly. Mon Aug 27 15:31:01 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> [ Backport 3.2.0b4 config files. ] * installdir/htdig.conf: Added .css to bad_extensions default, added missing closing ">", added mentions of accents & substring, fixed a couple typos in comments. * installdir/search.html: Add DTD tag for HTML 4 compliance. * installdir/{long, syntax, header, footer, wrapper, nomatch}.html: Add DTD tags, ALT attributes and remove bogus </select> tags to fix invalid HTML pointed out in PR#901. Change all <b> and <i> tags to the HTML-4.0 compliant <strong> and <em> tags. * htdoc/config.html: Updated with sample of latest htdig.conf and installdir/*.html, added blurb on wrapper.html. Thu Jul 26 15:05:29 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc, htsearch/parser.cc (perform_or), htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Added new attribute multimatch_method and used it to boost score on 'or' method with multiple matches. Thu Jul 26 14:25:01 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc, htsearch/parser.cc, htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Added new attribute boolean_syntax_errors and used it to generate syntax error messages for boolean method. Wed Jul 25 23:39:00 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htnotify/htnotify.cc: Changed calls to EmailNotification class to avoid compiler warnings. Wed Jul 25 23:15:24 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc, htsearch/htsearch.cc, htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Added new attribute boolean_keywords and used it to make LOGICAL_WORDS and parse "words" using boolean method. Wed Jul 25 22:31:19 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Dictionary.cc (Remove): Fixed so it doesn't clobber rest of chain when removing an entry, as suggested by Yariv Tal. Wed Jul 25 22:06:08 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Add new attributes htnotify_replyto, htnotify_webmaster, htnotify_prefix_file, htnotify_suffix_file. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Document them. * htnotify/htnotify.cc, htnotify/EmailNotification.{h,cc}, htnotify/Makefile.in: Added in code from Richard Beton <richard.beton@roke.co.uk> to collect multiple URLs per e-mail address and allow customization of notification messages by reading in header/footer text as designated by the new attributes above. * htdoc/THANKS.html: Credit where due. Wed Jul 25 21:38:21 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Added .css to bad_extensions, for consistency with 3.2. * htdoc/attrs.html: Ditto for default value. Also set examples for translate_* and modification_time_is_now to false so the example is different than default. Wed Jul 25 17:26:07 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc (getParsable): Add conditional to catch text/css files to prevent these from being parsed as Plaintext. * htdig/htdig.cc: Quick fix to make the logging -l flag the default behavior. (Set to Retriever_logUrl from the start.) * htcommon/defaults.cc: Set modification_time_is_now to default to true (now that it works correctly). Also set translate_* attributes to true. * htdoc/htdig.html: Remove documentation for -l flag--now no longer used. * htdoc/attrs.html: Correct new default values for modification_time_is_now and translate_* attributes. Tue Jul 24 16:12:45 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Added reference to maximum_page_buttons in the section on maximum_pages. Tue Jul 24 15:38:39 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (generateStars): Add NSTARS variable for template output as suggested by Caleb Crome <ccrome@users.sourceforge.net> (except here precision is 0). Fixes feature request #405787. * htdoc/hts_templates.html: Add description of NSTARS variable above. (Actually copied hts_templates.html from 3.2.0b4.) Tue Jul 24 14:21:53 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (expandVariables, outputVariable), htdoc/hts_templates.html: Add support for $=(var) template variable references, as suggested by Quim Sanmarti. Tue Jul 24 14:12:06 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (readFile): Added missing fclose() call, and debugging message for when file can't be opened. * htsearch/Display.cc (displayParsedFile): Added debugging message for when file can't be opened. Tue Jul 24 14:03:12 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (setVariables), htcommon/defaults.cc: Added maximum_page_buttons attribute, to limit buttons to less than maximum_pages. Fixes PR#731 & PR#781. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Documented it. Tue Jul 24 13:42:56 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/hts_templates.html, htsearch/Display.cc (displayMatch): Add METADESCRIPTION variable. Tue Jul 24 13:20:24 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/DocumentDB.{h,cc}: Added FindCoded() method to lookup docdb record with URL that's still encoded. * htsearch/Display.cc (display, displayMatch, buildMatchList): Use new method to avoid problems with URLs that are decoded and reencoded with another, more ambiguous url_part_aliases setting. Also fixed a problem with date range checking looking at ref before checking if it's null. Thu Jul 12 11:45:05 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/conv_doc.pl, contrib/parse_doc.pl: Fixed EOF handling in dehyphenation, fixed to handle %xx codes in title made from URL. * contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Fixed to handle %xx codes in URL title. Thu Jul 5 11:23:40 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * db/dist/config.guess: Update with more recent GNU version that recognizes various flavors of Mac OS X automatically. * htlib/DB2_db.cc: Only #include <malloc.h> if we have it. Fixes compilation problems on Mac OS X. * htlib/String.cc: Include <iostream.h> instead of depreciated <stream.h>. Fixes compilation problems with Mac OS X. * htlib/Configuration.cc: Make sure we never try to operate on strings of no length--accessing string[-1] is a bug--exposed on Mac OS X. Fri Jun 29 11:56:25 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc (got_redirect): Allow the redirect to accept relative redirects instead of just full URLs. Fri Jun 22 16:25:21 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/THANKS.html: Credit Marc Pohl and Robert Marchand. * htsearch/Display.cc (buildMatchList): Fix date_factor calculation to avoid 32-bit int overflow after multiplication by 1000, and avoid repetitive time(0) call, as contributed by Marc Pohl. Also move the localtime() call up before gmtime() call, to avoid clobbering gmtime's returned static structure (my thinko). Tue Jun 19 17:07:01 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (setVariables): Fixed handling of build_select_lists attribute, to deal with new restrict & exclude attributes. Fri Jun 15 17:45:40 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/require.html: Added mentions of accents, prefix & substring, taken from 3.2.0b4. * htdoc/htfuzzy: Added blurb on accents algorithm, taken from 3.2.0b4. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Added entry for accents_db attribute for htfuzzy and htsearch. Mentioned accents algorithm in description of search_algorithm. Noted effect of locale setting on floating point numbers in search_algorithm and locale descriptions. Fri Jun 15 16:47:09 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Accents.{h,cc}, htfuzzy/Fuzzy.c (getFuzzyByName), htfuzzy/htfuzzy.cc (main, usage), htfuzzy/Makefile.in: Added latest version of Robert Marchand's accents fuzzy match algorithm. * htcommon/defaults.cc: Added accents_db attribute for this. * htsearch/htsearch.cc: Fixed parsing of search_algorithm not to use comma as separator, because it may be needed as decimal point in some locales. Fri Jun 15 16:30:19 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Endings.cc (getWords): Undid change introduced in 3.1.3, in part. It now gets permutations of word whether or not it has a root, but it also gets permutations of one or more roots that the word has, based on a suggestion by Alexander Lebedev. * htfuzzy/EndingsDB.cc (createRoot): Fixed to handle words that have more than one root. * installdir/english.0: Removed P flag from wit, like and high, so they're not treated as roots of witness, likeness and highness, which are already in the dictionary. Thu Jun 7 17:09:46 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Add new attribute use_doc_date to use document meta information for the DocTime() field. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Document it. * htdig/HTML.cc(do_tag): Call Retriever::got_time if use_doc_date is set and we run across a META date tag. * htdig/Retriever.h, htdig/Retriver.cc: Add new got_date function. When called, sets the DocTime field of the DocumentRef after parsing is completed. Currently assumes ISO 8601 format for the date tag. Thu Jun 7 16:48:13 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Add new attribute any_keywords to allow ORing of keywords input parameter. * htsearch/htsearch.cc (addRequiredWords): Use it. Fix handling of empty search word list. * htsearch/Display.cc (excerpt, highlight): Fix handling of case where "words" is empty but "keywords" isn't. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Document any_keywords. Thu Jun 7 16:34:41 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Add new attribute plural_suffix to set the language-dependent suffix for PLURAL_MATCHES contributed by Jesse. * htsearch/Display.cc (setVariables): Use it. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Document it. Thu Jun 7 16:03:17 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.{h,cc}, htcommon/defaults.cc: Added multi-excerpt feature and max_excerpts attribute, as contributed by Jim Cole. * htdoc/THANKS.html, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Credit where due, and document attribute. Thu Jun 7 15:27:33 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc: Backported from 3.2.0b3, fixing these problems: no longer confused by "; charset=..." in Content-Type, avoids security problems with popen() and shell parsing untrusted URL (PR#542, PR#951), avoids predictable temporary file name if mkstemp() exists, binary output from external converter no longer mangled, less ambiguous error messages, opens temp. file in binary mode on non-Unix systems. Thu Jun 7 15:10:14 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/DocumentDB.{h,cc}: Replace CreateSearchDB() with DumpDB(), add LoadDB(), both backported from 3.2.0b3. * htdig/htdig.cc (main, usage), htdig/Makefile.in, htdoc/htdig.html: Add handling of -m (minimal) option, file input for URLs, and arg 0 handling for htdump & htload. * htdig/HTML.cc (do_tag): Change all white space to blanks in meta description tag, for proper ASCII record dumps by htdump, and to fix bug #405771. * htlib/String.cc (= operator), htlib/htString.cc: change handling of 0 length strings. Add readLine() for htload support. Thu Jun 7 14:41:42 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc (got_href): Fix hop count mishandling. Thu Jun 7 14:23:47 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htmerge/db.cc (mergeDB), htmerge/words.cc (mergeWords), installdir/rundig: Fix various htmerge bugs. Quotes the temp. directory name and word_list name (PR#872). Correctly handles words beginning with +, - and ! when in extra_word_characters (PR#952). Corrects problems with bad wordlists generated by htmerge -m causing it to lose entries in words.db and problems with the sort program using non-ASCII collating having a similar effect. Thu Jun 7 14:13:56 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/htsearch.cc (main), htsearch/Display.cc (setVariables, createURL, buildMatchList), htdoc/THANKS.html, htdoc/hts_form.html, htdoc/hts_templates.html: Add Mike Grommet's date range search feature. Thu Jun 7 13:57:06 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc (GetLocal, GetLocalUser): Fix to allow compiling on AIX & other non-GNU compilers. Thu Jun 7 13:52:20 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (setVariables): Extend the handling of build_select_lists to handle select multiple, radio buttons and checkboxes. * htdoc/attrs.html, htdoc/hts_selectors.html: Describe this. Thu Jun 7 13:40:13 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Exact.cc (Exact), htfuzzy/Prefix.cc (Prefix): Set the name field to the class name, as suggested by Jesse. Thu Jun 7 13:27:35 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/htdig-3.1.6.spec, contrib/htdig-3.1.6-conf.patch, htdoc/where.html, .version, README: Bump to version 3.1.6. Thu Jun 7 11:58:28 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/multidig/*: Backport from 3.2.0b3, including fixes below. * contrib/multidig/Makefile, gen-collect, db.conf, multidig.conf: Add missing trailing newlines as pointed out by Doug Moran <dmoran@dougmoran.com>. * contrib/multidig/Makefile (install): Make sure scripts have a+x permissions. Pointed out by Doug Moran. * contrib/multidig/new-collect: Fix typo to ensure MULTIDIG_CONF is set correctly. Thu Jun 7 11:37:52 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/README: Add in descriptions for web site contrib directory, acroconv.pl & conv_doc.pl. * contrib/examples/rundig.sh: Update to most recent version for 3.1.x. * contrib/htparsedoc/htparsedoc: Add in contributed bug fixes from Andrew Bishop to work on SunOS 4.x machines. * contrib/acroconv.pl: Added external converter script to convert PDFs with acroread. Thu Jun 7 10:41:05 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/ParsedString.cc (get), htsearch/Display.cc (expandVariables): Use isalnum() instead of isalpha() to allow digits in attribute and variable names, allow '-' in variable names too for consistency. Wed Jun 6 17:13:49 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Make parsing of meta robots tag case insensitive. Wed Jun 6 15:31:00 2001 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/doc2html/DETAILS, contrib/doc2html/README, contrib/doc2html/doc2html.cfg, contrib/doc2html/doc2html.sty, contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Added version 3.0 of doc2html, contributed by David Adams <D.J.Adams@soton.ac.uk>. Mon Jun 4 10:31:45 CEST 2001 Gabriele Bartolini <angusgb@users.sourceforge.net> * htdoc/cf_byname.html: I forgot to insert the 'restrict' attribute. Wed May 30 11:30:43 2001 Gabriele Bartolini <angusgb@users.sourceforge.net> * htsearch/htsearch.cc: two new attributes, used by htsearch, have been added: restrict and exclude. They can now give more control to template customisation through configuration files, allowing to restrict or exclude URLs from search without passing any CGI variables (although this specification overrides the configuration one). * htcommon/defaults.cc: ditto * htdoc/attrs.html: ditto * htdoc/cf_byname.html: ditto * htdoc/cf_byprog.html: ditto * htdoc/hts_form.html: ditto Sat May 5 21:43:32 2001 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in, configure: Add tests for wait.h, sys/wait.h, mkstemp() and malloc.h. * acconfig.h, include/htconfig.h.in: Update with autoheader for new tests. * htlib/regex.[h,c]: Update with backports from 3.2.0b4 development. Tue Feb 29 23:04:04 2000 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/DB2_db.cc (Error): Simply fprint the error message on stderr. This is not a method since the db.h interface expects a C function. (db_init): Don't set db_errfile, instead set errcall to point to the new Error function. Fri Feb 25 10:11:50 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (maximum_pages): Describe new bahaviour (as of 3.1.4), where this limits total matches shown. Thu Feb 24 20:24:24 2000 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html: Update to refer to 3.1.5 and edit comments about 3.2. Thu Feb 24 15:20:08 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/RELEASE.html, htdoc/main.html: Updated notes for 3.1.5 release. Thu Feb 24 10:37:45 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (external_parsers): Add references to FAQ 4.8 & 4.9. (local_default_doc): Give an expanded example. (logging): Explain log entry format. (star_blank): Fix some old typos (incorrect references to other attrs.) Wed Feb 23 13:58:24 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/cgi.cc(init): Fixed bug: array must be free by delete [] buf, not just delete buf; (from Vadim). * installdir/syntax.html: Fixed a $(WORDS) I'd missed earlier. Tue Feb 22 12:40:22 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/RELEASE.html, htdoc/main.html: Updated notes for 3.1.5 release. * htlib/URL.cc (URL, normalizePath): Fix PR#779, to handle relative URLs correctly when there's a trailing ".." or leading "//". Thu Feb 17 15:58:53 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/RELEASE.html, htdoc/main.html: Add notes for 3.1.5 release. * htdoc/TODO.html, htdoc/author.html, htdoc/bugs.html, htdoc/cf_general.html, htdoc/cf_types.html, htdoc/cf_variables.html, htdoc/config.html, htdoc/howitworks.html, htdoc/htdig.html, htdoc/htfuzzy.html, htdoc/htmerge.html, htdoc/htnotify.html, htdoc/hts_form.html, htdoc/hts_general.html, htdoc/hts_method.html, htdoc/install.html, htdoc/isp.html, htdoc/mailing.html, htdoc/meta.html, htdoc/notification.html, htdoc/require.html, htdoc/uses.html, htdoc/where.html: Update copyright date and fix last modified date for automatic CVS update. Thu Feb 17 14:37:18 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/htdig.conf: quote all HTML tag parameters. * htsearch/TemplateList.cc (createFromString), installdir/long.html, installdir/short.html: Use $&(URL) in templates. Thu Feb 17 14:01:34 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/htdig-3.1.5.spec: Fix silly typos in %post script, make cron script a %config file. Thu Feb 17 10:34:05 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> [ Improve htsearch's HTML 4.0 compliance ] * htsearch/TemplateList.cc (createFromString): Use file name rather than internal name to select builtin-* templates, use $&(TITLE) in templates and quote HTML tag parameters. * installdir/long.html, installdir/short.html: Use $&(TITLE) in templates and quote HTML tag parameters. * htsearch/Display.cc (setVariables): quote all HTML tag parameters in generated select lists. * installdir/footer.html, installdir/header.html, installdir/nomatch.html, installdir/search.html, installdir/syntax.html, installdir/wrapper.html: Use $&(var) where appropriate, and quote HTML tag parameters. Thu Feb 17 10:00:26 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/htdig-3.1.5.spec: Fix %post script to add more descriptive htdig.conf entries. Wed Feb 16 16:26:05 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/htdig-3.1.5.spec, contrib/htdig-3.1.5-conf.patch, htdoc/where.html, .version, README: Bump to version 3.1.5. * htdoc/THANKS.html: Added new contributors. * htdoc/FAQ.html, htdoc/main.html: Updated to versions from web site. Wed Feb 16 15:49:28 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Configuration.h, htlib/Configuration.cc: split Add() method into Add() and AddParsed(), so that only config attributes get parsed. Use AddParsed() only in Read() and Defaults(). Wed Feb 16 15:02:47 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/URL.h (encodeURL): Change list of valid characters to include only unreserved ones. * htlib/cgi.cc (init): Allow "&" and ";" as input parameter separators. * htsearch/Display.cc (createURL): Encode each parameter separately, using new unreserved list, before piecing together query string, to allow characters like "?=&" within parameters to be encoded. Wed Feb 16 14:42:02 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (encodeSGML, excerpt): Add encoding for characters that could pose problems in HTML output. * htsearch/Display.cc (expandVariables, outputVariables): Add support for $&(var) and $%(var) template variable references. This should fix PR#750, once we use this in common/*.html. Tue Feb 15 17:21:08 2000 Gilles Detillieux <grdetil@scrc.umanitoba.ca> [ Applied a whole collection of patches and fixes from the archives ] * htdig/Server.cc (robotstxt): apply more rigorous parsing of multiple user-agent fields, and use only the first one. * htdig/Retriever.cc(GetLocal, GetLocalUser): Add URL-decoding enhancements to local_urls, local_default_urls & local_default_doc, to allow hex encoding of special characters. * htdoc/attrs.html: Document these. * htdig/Retriever.cc (IsValidURL): Fix problem with valid_extensions when an "extension" would include part of a directory path or server name, as contributed by Warren Jones. Also fix problem with valid_extensions matching failure when URL parameters follow extension, as reported by fxbois@cybercable.fr. * htdig/Document.cc (RetrieveLocal), htdig/Document.h, htdig/Retriever.cc(Initial, parse_url, GetLocal, GetLocalUser, IsLocalURL, got_href, got_redirect), htdig/Retriever.h, htdig/Server.cc(Server), htdig/Server.h: Apply Paul B. Henson's enhancements to local_urls, local_user_urls & local_default_doc. * htdoc/attrs.html: Document these. * htsearch/htsearch.cc (setupWords): Fix problem reported by D.J. Adams, in which bad_words removal failed on upper-case search words. * htsearch/Display.cc(setVariables), htcommon/defaults.cc: Added build_select_lists attribute, to generate selector menus in forms. * htdoc/hts_selectors.html: Added this page to explain this new feature, plus other details on select lists in general. * htdoc/hts_templates.html: Added relevant links to related attributes and selectors documentation. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Added relevant explanations and links to selectors documentation. * htlib/QuotedStringList.cc (Create): fix PR#743, where quoted string lists didn't allow embedded quotes of opposite sort in strings (e.g. "'" or '"'), and fix to avoid overrunning end of string if it ends with backslash. * htcommon/WordList.cc (valid_word): Applied Marc Pohl's fix to make this 8-bit clean on Solaris. * contrib/conv_doc.pl, contrib/parse_doc.pl: Applied Warren Jones's changes to these scripts. * htdig/PDF.cc (parseNonTextLine): Fix bogus escape sequences around Title parsing. (Fixes PR#740) * htsearch/Display.cc (display, displaySyntaxError), htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htcommon/defaults.cc: Add new attribute "nph" to send out non-parsed headers for servers that do not supply HTTP headers on CGI output (e.g. IIS). If nph is set, send out HTTP OK header, as suggested by Matthew Daniel <mdaniel@scdi.com> (PR#727) * htdig/Document.cc (getdate): avoid strftime() altogether on filled-in tm structure, to avoid recurring segfault problems. (PR#734) * htlib/strptime.cc (mystrptime): Use Warren Jones's fix to deal with a web server that returns dates with a two digit year field. (Fixes PR#770) * htdig/HTML.cc (HTML, parse, do_tag), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add max_keywords attribute to limit meta keyword spamming. Wed Dec 8 18:19:32 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html, htdoc/bugs.html: Update to refer to latest versions. (Update for 3.1.4 release.) Wed Dec 8 18:10:27 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/QuotedStringList.cc (Create): Make sure that an empty token isn't ignored. Tue Dec 7 10:26:58 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc (setVariables): Fix a compilation error by making a statment with '?' an explicit if-else statment. * htdoc/RELEASE.html: Change case_sensitive fix to a bug-fix, update release date for 12/9/99. (We certainly didn't release yesterday!) Mon Dec 6 22:17:21 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(Display): Add missing call to setupTemplates(), for handling template_patterns. Oops! * htdoc/attrs.html: Fixed a couple typos in new attributes. * htdoc/ChangeLog: Update to latest version. Mon Dec 6 16:41:04 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/main.html: Update news with latest version. * htdig/htdig.cc(main), htdig/Document.cc(Document), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add authorization attribute, settable by htdig -u. Also fixes PR#490, by setting authentication before robots.txt fetched. * htdoc/RELEASE.html: Update with latest fix. Fri Dec 3 17:31:47 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/DocumentRef.cc(Clear): Set docHopCount & docSig to 0, and clear docEmail, docNotification & docSubject strings to have a clean slate for Deserialize(), which assume 0/empty for these. Fixes problem with hop counts getting clobbered. * htdoc/RELEASE.html: Update with latest fix. * htdoc/ChangeLog: Update to latest version. Fri Dec 3 12:12:19 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc: removed vestiges of internal Postscript support that never worked, and removed test for application/msword, which is handled only by external parser. * htdig/Makefile.in: removed Postscript.o from list. * htdig/Retriever.cc(parse_url): Fix compilation error; (Initial, got_href, got_redirect): Try to get the local filename for a server's robots.txt file and pass it along to the newly generated server. * htdig/Server.cc(Server): Retrieve the robots.txt file from the filesystem when possible; fix compilation error. * htdig/Server.h(Server): Add local_robots_file parameter to Server(). * htlib/HtWordType.h, htlib/HtWordType.cc: fix compilation errors. Fri Dec 3 10:52:57 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc(parse, do_tag): Add handling of <img alt=...> text, fix parsing of words in meta tags, disable indexing of meta tags when "noindex" state in effect, fix calculations of word positions to more accurately reflect relative positions. * htlib/HtWordType.h, htlib/HtWordType.cc: Add HtWordToken() function, to replace strtok() in HTML parser. * htdoc/RELEASE.html: Update with latest fixes. Fri Dec 3 09:02:55 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Configuration(Add): handle strings in single quotes, as in parm='value'. Thu Dec 2 16:14:28 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Add Tom Metro's suggested revisions for pdf_parser and external_parsers. Thu Dec 2 15:15:03 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/mailing.html: Updated to version from htdig.org web site. * htcommon/defaults.cc: Add missing no_page_number_text and page_number_text attribute definitions. * htdoc/attrs.html(modification_time_is_now): Make the description a bit clearer as to how it may cut down on reindexing. Thu Dec 2 13:46:11 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(parse_url), htdig/Server.cc(Server), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add support for local_urls_only attribute. * htdoc/RELEASE.html: Update with latest feature. Thu Dec 2 11:02:07 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/URL.cc(ServerAlias): Fix server_aliases processing to prevent infinite loop (as for local_urls in PR#688). Wed Dec 1 17:23:24 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(parse_url), htdig/Server.h: add IsDead() methods to query and set server status, use them in Retriever to avoid repeated HTTP request to a dead server. (Needed for persistent local stuff.) Wed Dec 1 16:56:28 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(GetLocal): Fix error in GetLocalUser() return value check, as suggested by Vadim. * contrib/conv_doc.pl: Added a sample external converter script. * htdoc/THANKS.html: A couple more additions. Tue Nov 30 15:02:25 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(IsValidURL): Fix compilation error in valid_extensions list handling. * contrib/htdig-3.1.4.spec, contrib/htdig-3.1.4-conf.patch: Added sample RPM spec file and config patch for it. Tue Nov 30 14:01:51 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/where.html: Bump to version 3.1.4. * htdoc/THANKS.html: Added new contributors. * htdoc/isp.html, htdoc/uses.html, htdoc/main.html, htdoc/mailing.html: Updated to versions from htdig.org web site. Tue Nov 30 13:01:20 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/RELEASE.html: Add release notes for 3.1.4 release. * .version, README: Bump for 3.1.4. Tue Nov 30 11:03:34 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html(backlink_factor): Added Geoff's clarification of what this attribute does. Tue Nov 30 09:47:05 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc(RetrieveLocal): Handle common extensions for text/plain, application/pdf & application/postscript. * htdig/Retriever.cc(IsValidURL): Add valid_extensions list handling, make it and bad_extensions case insensitive. * htcommon/defaults.cc: Add config attribute valid_extensions, with default as empty. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: Document it. Tue Nov 30 09:02:02 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(got_href & got_redirect): remove all of Patrick's case insensitive server code, to replace it with Geoff's fix to URL.cc * htlib/URL.cc(normalizePath, path): If not case_sensitive, lowercase the URL. Should ensure that all URLs are appropriately lowercased, regardless of where they're generated. Mon Nov 29 20:25:01 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc, htdig/Retriever.h, htdig/Server.cc(push), htdig/Server.h: added Alexis's patch for persistent local digging even if HTTP server is down. Also made new GetLocal() method call GetLocalUser() itself, to simplify its use, and made it non-private, for eventual use by Server code. Mon Nov 29 19:18:20 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(got_href & got_redirect): corrections to case insensitive server fix, to handle redirects, to make more thorough use of mapped URL, and to update it after normalization. Fri Nov 26 17:14:46 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc(RetrieveHTTP): always c.close() the connection when returning. * htdig/HTML.cc(HTML & do_tag): add code to turn off indexing between <style> and </style> tags. Fri Nov 26 16:31:06 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Configuration.cc(Read): fixed to allow final line without terminating newline character, rather than ignoring it. * htlib/String.cc(write): added Alexis Mikhailov's fix to bump up pointer after writing a block. * htsearch/Display.cc(setVariables): added Alexis Mikhailov's fix to check the number of pages against maximum_pages at the right time. (Put it even earlier, to make sure nPages is at least 1.) * htsearch/Display.cc(generateStars): Remove extra newline after STARSRIGHT and STARSLEFT variables, noted by Torsten Neuer <tneuer@inwise.de>. Wed Nov 24 20:33:13 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/htdig.conf: Add bad_extensions to make it more obvious to users how to exclude certain document types. Fix the comments for search_algorithm to refer to all the current possibilities. Add example of no_excerpt_show_top attribute in line with most user's expectations. (Geoff's changes) Wed Nov 24 20:02:32 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/search.html (Match): Add Boolean to default search form, as suggested by PR#561. Tue Nov 23 23:03:45 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(setupTemplates), htsearch/Display.h: fixed a couple of compilation errors in template_patterns code. Tue Nov 23 22:16:31 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(got_href): Applied Patrick's case insensitive server fix, to lowercase all URLs if case_sensitive is false. Tue Nov 23 22:08:22 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/StringList.cc(Join): Applied Loic's patch to fix memory leak. Tue Nov 23 21:52:18 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> [Applied patch from Hanno Mueller <kontakt@hanno.de>, which includes...] * contrib/README: Add scriptname directory. * contrib/scriptname/*: An example of using htsearch within dynamic SSI pages * htcommon/defaults.cc: Add script_name attribute to override SCRIPT_NAME CGI environment variable. * htdoc/FAQ.html: Update question 4.7 based on including htsearch as a CGI in SSI markup. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: Update based on behavior of script_name attribute. * htsearch/Display.cc: Set SCRIPT_NAME variable to attribute script_name if set and CGI environment variable if undefined. Tue Nov 23 21:29:03 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: Added the past few month's updates to the FAQ. Tue Nov 23 21:20:35 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc, htsearch/Display.h, htsearch/Display.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: add template_patterns attribute, to select result templates based on URL patterns. Tue Nov 23 20:52:38 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/cgi.h, htlib/cgi.cc(cgi & init), htsearch/htsearch.cc (main & usage): allow a query string to be passed as an argument. Tue Nov 23 20:35:05 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(setVariables & createURL), htsearch/htsearch.cc(main), htdoc/hts_templates.html: handle keywords input parameter like others, and make it propagate to followups. Tue Nov 23 20:25:45 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: removed vestigial references to MAX_MATCHES template variables in search_results_{header,footer}. * htdoc/hts_form.html: add disclaimer about keywords parameter not being limited to meta keywords. * htdoc/meta.html: add description of "keywords" meta tag property. add links to keywords_factor & meta_description_factor attributes. Tue Nov 23 20:07:20 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(setVariables & hilight): added Sergey's idea for start_highlight, end_highlight & page_number_separator attributes. * htcommon/defaults.cc: added defaults for these. * htdoc/attrs.html, htdoc/cf_by{name,prog}.html: documented them. Tue Nov 23 19:58:28 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc: added support for external converters as extension to external_parsers attribute. * htdoc/attrs.html: Updated external_parsers with new description and examples of external converters. Tue Nov 23 19:52:27 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc(transSGML), htdig/SGMLEntities.cc(translateAndUpdate): Fix the infamous problem in htdig 3.1.3 of mangling URL parameters that contain bare ampersands (&), and not converting & entities in URLs. * htdig/Retriever.cc(IsLocal & IsLocalUser): Fix PR#688, where htdig goes into an infinite loop if an entry in local_urls (or local_user_urls) is missing a '=' (or a ','). * htcommon/cgi.cc(cgi): Fix bug in reading long queries via POST method (PR#668). * htnotify/htnotify.cc(send_notification): apply Jason Haar's fix to quote the sender name "ht://Dig Notification Service". Wed Sep 22 11:12:38 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/ChangeLog, htdoc/isp.html, htdoc/FAQ.html, htdoc/RELEASE.html, htdoc/THANKS.html, htdoc/attrs.html, htdoc/bugs.html, htdoc/contents.html, htdoc/main.html, htdoc/require.html, htdoc/uses.html, htdoc/where.html: Update for 3.1.3 release and synch with latest versions from the website. Wed Sep 15 17:54:31 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> A few changes to satisfy the AIX xlC compiler: * htdig/htdig.cc: Moved variable declaration out of case block. * configure.in, htconfig.in: Add check for sys/select.h. Add "long unsigned int" to the possible getpeername_length types. * htlib/Connection.cc: Include sys/select.h. Sun Sep 12 15:02:19 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * .version: Bump for 3.1.3. * README: Bump first line for 3.1.3 release, remove mention of rx directory. * htdoc/ChangeLog: Update with latest version. * htdoc/RELEASE.html: Add release notes for 3.1.3 release. Thu Sep 9 14:52:19 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/parse_doc.pl: fix bug in pdf title extraction. Wed Sep 1 15:58:14 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc(got_word): add code to check for compound words and add their component parts to the word database. * htdig/PDF.cc(parseString), htdig/Plaintext.cc(parse): Don't strip punctuation or lowercase the word before calling got_word. That should be left up to got_word & Word methods. * htlib/StringMatch.h, htlib/StringMatch.cc(Pattern, IgnoreCase): Add an IgnorePunct() method, which allows matches to skip over valid punctuation, change Pattern() and IgnoreCase() to accomodate this. * htsearch/htsearch.cc(main, createLogicalWords): use IgnorePunct() to highlight matching words in excerpts regardless of punctuation, toss out old origPattern, and don't add short or bad words to logicalPattern. * htlib/HtWordType.h, htlib/HtWordType.cc(Initialize): set up and use a lookup table to speed up HtIsWordChar() and HtIsStrictWordChar(). Wed Sep 1 15:48:13 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/PDF.cc(parse), htcommon/defaults.cc, htdoc/attrs.html: Fix PDF.cc to handle acroread in Acrobat 4, which has a bug with the -pairs option. It turns out that even without the -pairs option, acroread 4 is still prone to segmentation violations when generating PostScript, so acroread 3 is a better choice anyway. * htdoc/FAQ.html: Added the past few month's updates to the FAQ. * contrib/parse_doc.pl: Updated to latest version, adapted for xpdf 0.90. Wed Sep 1 15:39:41 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> Applied "bugfixes" patch collection, which I had posted to htdig@htdig.org mailing list in August. Changes include... * htsearch/Display.cc(expandVariables): Fix problem with $(VAR) at end of template string not being expanded. * htlib/URL.cc(URL): Fix PR#566 by setting the correct length of the string being matched. 'http://' is 7 characters. Submitted by <wolfgang.pichler@creditanstalt.co.at>. * htdig/HTML.h, htdig/HTML.cc(do_tag, transSGML): Fix the HTML parser to decode SGML entities within tag attributes. * htlib/URL.cc(ServerAlias): Fix server_aliases entries so port defaults to 80 if omitted. * htlib/URL.cc(removeIndex): Fix the infamous problem with files like left_index.html not getting indexed. PR#543 & PR#585. * htdig/PDF.cc(parseNonTextLine): Fixed a bug in the PDF parser: when the Title header was just the temporary file name, it wouldn't be used, but it also wouldn't be cleared from the _parsedString variable, so it ended up polluting the document excerpt. * htdig/Document.cc(RetrieveHTTP): Added error messages for unknown hosts. * htlib/cgi.cc(cgi): Fix PR#572, where htsearch crashed if CONTENT_LENGTH was not set but REQUEST_METHOD was. * htdig/HTML.cc(do_tag): Fix <meta> robots parsing to allow multiple directives to work correctly. Fixes PR#578, as provided by Chris Liddiard <c.h.liddiard@qmw.ac.uk>. * htsearch/htsearch.cc(main): Allow multiple keywords input parameters in search forms. * htdig/Document.cc(Reset, readHeader): Fix the bug in the handling of modification_time_is_now. * htfuzzy/Fuzzy.cc(getWords), htfuzzy/Metaphone.cc(vscode,generateKey): Should fix PR#514 in the bug database. It's Geoff's first attempt, with a minor correction, plus an added test in the vscode macro, which is where the problem seemed to be happening. This won't map accented vowels to their unaccented counterparts, but it should hopefully put an end to the segmentation faults. * include/htconfig.h.in, htcommon/WordReference.h, htcommon/WordList.cc(Word, Flush, BadWordFile), htcommon/DocumentRef.cc(AddDescription), htcommon/defaults.cc, htsearch/parser.cc(perform_push), htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Change the maximum word length into a run-time option, rather than compile-time. * htsearch/Display.cc(displayMatch): Applied Torsten Neuer's <tneuer@inwise.de> fix for PR#554. * htdig/HTML.cc(HTML, do_tag): Added support for <embed>, <object> and <link> tags. * htdig/htdig.cc(main): Applied Geoff's patch to hide the username/password in the command line arguments. * htdig/Document.cc(readHeader): Fixed a few problems with header parsing, including PR#535 & PR#557. * htdig/Document.cc(getdate): This should help with PR#81 & PR#472, where strftime() would crash on some systems. Idea submitted by benoit.sibaud@cnet.francetelecom.fr. * COPYING, htdoc/COPYING, Makefile.in: Updated the FSF address in COPYING & Makefile.in. PR#595. * htdig/Retriever.cc(IsValidURL): Fix PR#493, to avoid rejecting a valid URL with ".." in it. * htlib/URL.cc(parse): Fix PR#348, to make sure a missing or invalid port number will get set correctly. * htsearch/Display.h, htsearch/Display.cc(excerpt): Fix declaration to refer to "first" as reference--ensures ANCHOR is properly set. Fixes PR#541 as suggested by <pmb1@york.ac.uk>. * htdig/ExternalParser.cc(parse): Quote the filename before passing it to the command-line to prevent shell escapes. Fixes PR#542. Also make error messages more useful. * htfuzzy/Endings.cc(getWords): Suffix-handling improvement (PR#560), to prevent inappropriate suffix stripping in endings fuzzy matches. * htlib/URLTrans.cc(encodeURL): Fix encoding so all non-ascii characters get hex-encoded. I think this is what PR#339 was all about. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Added descriptions for attributes that were missing, added a few clarifications, and corrected a few defaults and typos. Covers PR#558, PR#626, and then some. * configure.in, configure, include/htconfig.h.in, htlib/regex.c: Fix PR#545, to test for presence of alloca.h Wed Apr 21 22:45:16 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * .version: Bump for final 3.1.2 release. * htdoc/where.html, htdoc/FAQ.html: Update to mention the new release. Tue Apr 20 13:34:22 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/RELEASE.html: Fixed a few typos, updated modification date. Tue Apr 20 10:54:59 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/RELEASE.html: Add notes on changes in the 3.1.2 release. * htdoc/contents.html, htdoc/mailarchive.html, htdoc/where.html, htdoc/uses.html: Update with versions from maindocs. * installdir/htdig.conf: Add example max_doc_size attribute to cut down on FAQ, also add comment on including a file for start_url. Mon Apr 19 15:40:24 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/WordList.cc(valid_word): fixed to avoid having the new HtIsStrictWordChar() test circumvent the allow_numbers option by allowing numbers all the time. Also fixed to allow HtIsStrictWordChar() to override iscntrl(), so extra_word_characters can define characters that a broken locale would define as control characters. Mon Apr 19 15:17:12 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/WordList.cc(valid_word): fixed bug introduced Jan 9, where it stopped scanning for control characters prematurely. Now also use iscntrl() to detect all control characters. Fri Apr 16 10:30:42 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: fixed typo - use_meta_description was plural. Wed Apr 14 20:22:31 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> * htlib/regex.h: fixed compile problem with AIX xlc compiler Tue Apr 13 13:01:04 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(generateStars): Set status to -1 if URLimage.hasPattern() fails, to avoid empty URLimageList. (Fix to Mar 31 change.) Tue Apr 13 11:27:45 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.h(class Display): move enum SortType up to public section, to avoid problem compiling on IBM AIX C++ compiler. Mon Apr 12 17:36:20 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: added sections on indexing docs in other languages, practical & theoretical limits of ht://Dig. Fri Apr 9 16:47:34 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: Fixed a few typos. Fri Apr 9 16:24:21 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc(RetrieveHTTP): Show "Unable to build connection" message at lower debug level. Fri Apr 9 15:17:53 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/FAQ.html: Added changes in maindocs from Mar 18, a few clarifications, and four new questions. Wed Apr 7 19:41:12 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc (usage): Remove bogus -w flag. Thu Apr 1 11:58:20 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/htsearch.cc(main): Apply Gabriele's patch to avoid using an invalid matchesperpage CGI input variable. * htsearch/Display.cc(display) & (setVariables): Correct any invalid values for matches_per_page attribute to avoid div. by 0 error. Wed Mar 31 18:21:21 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/htdig.cc: Undo March 30 change. * htdig/Retriever.cc: Use excludes.hasPattern before using the exclude list. (More elegant solution to problem, as pointed out by Gilles.) * htsearch/Display.cc: Remove code setting URLimage to a bogus pattern. Instead, check that URLimage.hasPattern() before using it. Wed Mar 31 15:16:36 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Synonym.cc: Fix previous fix of minor memory leak. (db pointer wasn't properly set) Tue Mar 30 20:08:18 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/htdig.cc: If exclude_urls attribute is set to empty, set it to something that will never match a URL to ensure nothing is excluded. * Makefile.config.in: Fix typo leading to HTLIBS referring to itself. Mon Mar 29 16:47:48 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(excerpt): Added patch from Gabriele to improve display of excerpts--show top of description always, otherwise try to find the excerpt. Mon Mar 29 15:57:06 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/htdig.cc: Rename main.cc for consistency with other directories. * htdig/Makefile.in: Use it. Mon Mar 29 12:53:17 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/HtWordType.h (HtIsWordChar): Avoid matching 0 when using strchr. (HtIsStrictWordChar): Ditto. (Patch from Hans-Peter Nilsson) Mon Mar 29 10:51:54 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/regex.h, htlib/regex.c: Include glibc versions of the regex functions to override possibly buggy system versions. * htlib/Makefile.in: Use them. * htfuzzy/EndingsDB.cc: Use glibc regex functions instead of rx for massive speedups on non-English affix files. * configure, configure.in: Use the system timegm function if present. Don't configure rx since we don't use it any more. Don't worry about tsort since that was only needed for rx. * Makefile.in, Makefile.config.in: Ignore the rx directory if present. Thu Mar 25 12:24:18 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * installdir/long.html, installdir/short.html: Remove backslashes before quotes in HTML versions of the builtin templates. * Makefile.in: Add long.html & short.html to COMMONHTML list, so they get installed in common_dir. Thu Mar 25 11:45:59 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(displayMatch), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add date_format attribute suggested by Marc Pohl. Thu Mar 25 09:49:33 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(displayMatch): Avoid segfault when DocAnchors list has too few entries for current anchor number. Wed Mar 24 12:20:02 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/main.cc (main): Call HtWordType::Initialize. (Missed this one yesterday. Oops!) Tue Mar 23 17:11:46 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * backport Hans-Peter Nilsson's suite of changes for HtWordType and extra_word_characters support, to 3.1.2... * htlib/HtWordType.h (class HtWordType): New. * htlib/HtWordType.cc: New. * htlib/Makefile.in (OBJS): Add HtWordType.o * htdoc/attrs.html: Document attribute extra_word_characters. * htdoc/cf_byprog.html: Ditto. * htdoc/cf_byname.html: Ditto. * htcommon/defaults.cc (defaults): Add extra_word_characters. * htsearch/htsearch.h: Lose spurious extern declaration of unused variable valid_punctuation. * htsearch/htsearch.cc (main): Call HtWordType::Initialize. (setupWords): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htsearch/Display.cc (excerpt): Use HtIsStrictWordChar. * htlib/StringMatch.cc (FindFirstWord): Ditto. (CompareWord): Ditto. * htdig/Retriever.h (class Retriever): Lose member valid_punctuation. * htdig/Retriever.cc (Retriever): Lose its initialization. * htdig/Postscript.h (class Postscript): Lose member valid_punctuation. * htdig/Postscript.cc (Postscript): Lose its initialization. (flush_word): Use HtStripPunctuation. (parse_string): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. * htdig/Parsable.h (class Parsable): Lose member valid_punctuation. * htdig/Parsable.cc (Parsable): Lose its initilization. * htcommon/WordList.cc (valid_word): Use HtIsStrictWordChar. (BadWordFile): Use HtStripPunctuation. Do not read valid_punctuation. * htcommon/DocumentRef.cc (AddDescription): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htdig/PDF.cc (parseString): Similar.. * htdig/HTML.cc (parse): Similar. * htdig/Plaintext.cc (parse): Similar. Tue Mar 23 15:52:33 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * .version: Bump to 3.1.2-dev. Tue Mar 23 14:50:37 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/String.cc: Fix up code to be cleaner with memory allocation, inline next_power_of_2, fix some memory leaks. (Geoff's changes of Feb 22-25) Tue Mar 23 14:35:37 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/HtWordCodec.cc(HtWordCodec): Fix bug with constructing from uninitialized variables! * htlib/HtURLCodec.cc (~HtURLCodec): Add missing deletion of myWordCodec. Tue Mar 23 14:18:16 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/PDF.cc(parseString): Use minimum_word_length instead of hardcoded constant. Tue Mar 23 12:02:00 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(generateStars): Add in support for use_star_image which was lost when template support was put in way back when. Tue Mar 23 11:47:52 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * Makefile.in: add missing ';' in for loops, between fi & done Mon Mar 22 19:26:56 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/DocumentRef.cc(AddDescription): Check to see that description isn't a null string or contains only whitespace before doing anything. Mon Mar 22 19:21:16 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Fix #ifdef problems with zlib. Mon Mar 22 19:14:40 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html (template_name): Typo; used by htsearch, not htdig. Mon Mar 22 19:10:56 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Retriever.cc (got_href): Check if the ref is for the current document before adding it to the db. (From H-P Nilsson, Mar 8) Mon Mar 22 19:03:23 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Rephrase and clarify entry for url_part_aliases. (From Hans-Peter Nilsson, Mar 2) Mon Mar 22 18:48:10 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htfuzzy/Synonym.cc: Fix minor memory leak. * htlib/Dictionary.h, htlib/Dictionary.cc(hashCode): Check if key can be converted to an integer using strtol. If so, use the integer as the hash code. (Geoff's patch) Mon Mar 22 18:23:11 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/List.cc(Nth): Check for out-of-bounds requests before doing anything. Mon Mar 22 17:50:47 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc(display): Free DocumentRef memory after displaying them. (displayMatch): Fix memory leak when documents did not have anchors, fix problems when documents did not have descriptions. Mon Mar 22 17:32:14 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htmerge/docs.cc(convertDocs): Replace previous verbose patch with H-P Nilsson's. Mon Mar 22 17:13:35 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Plaintext.cc, htmerge/words.cc: removed Log lines. Mon Mar 22 16:11:31 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/htsearch.cc: Add patch from Jerome Alet <alet@unice.fr> to allow '.' in config field but NOT './' for security reasons. Mon Mar 22 15:56:55 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/long.html, installdir/short.html: Write out HTML versions of the builtin templates. (committed to 3.1.2 by Gilles) * installdir/htdig.conf: Add commented-out template_map and template_name attributes to use the on-disk versions. Mon Mar 22 15:13:33 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc, htdoc/attrs.html: Change default locale to "C", as H-P Nilsson recommended. * htlib/Configuration.cc(Add): Fix small memory leak in locale code, as Geoff discovered. Mon Mar 22 15:03:10 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/parse_doc.pl: uses pdftotext to handle PDF files, generates a head record with punctuation intact, extra checks for file "wrappers" & check for MS Word signature (no longer defaults to catdoc), strip extra punct. from start & end of words, rehyphenate text from PDFs, fix handling of minimum word length. Mon Mar 22 14:38:01 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Plaintext.cc(parse): Use minimum_word_length instead of hardcoded constant. Mon Mar 22 14:33:45 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Configuration.cc(Add): Fix function to avoid infinite loop on some systems, which don't allow all the letters in isalnum() that isalpha() does, e.g. accented ones. * htdig/HTML.cc: Fix three reported bugs about inconsistent handling of space and punctuation in title, href description & head. Now makes destinction between tags that cause word breaks and those that don't, and which of the latter add space. Mon Mar 22 14:25:34 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htmerge/docs.cc: Make htmerge -vv report reasons for deleting docs. * htmerge/words.cc(mergeWords): Fix to prevent description text words from clobbering anchor number of merged anchor text words. Fri Mar 19 17:09:21 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc: Fix bug where noindex_start was empty, allow case insensitive matching of noindex_start & noindex_end. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Fix inconsistencies in documentation for noindex_start & noindex_end. Fri Mar 19 17:05:16 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc: Add check for <a href=...> tag that is missing a closing </a> tag, terminating it at next href. Fri Mar 19 17:00:18 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Document.cc: Fix check of Content-type header in readHeader(), correcting bug introduced Jan 10 (for PR#91), and check against allowed external parsers. * htdig/HTML.cc: More lenient comment parsing, allows extra dashes. Fri Mar 19 16:52:51 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc: Check for presence of more than one <title> tag. * htlib/mytimegm.cc: Fix Y2K problems. Fri Mar 19 16:43:28 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc: Add patch from Gabriele to ensure META descriptions are parsed, even if 'description' is added to the keyword list. Fri Mar 19 16:37:08 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/parser.h, htsearch/parser.cc: Clean up patch made for error messages, made on Feb 16. Tue Feb 16 23:48:09 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in, configure: Default to 'int' when we cannot establish type used by getpeername. * htdoc/RELEASE.html: Additional notes on everything fixed in 3.1.1. Tue Feb 16 23:45:26 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * contrib/parse_doc.pl: Add replacement for less-capable (and buggy) parse_word_doc.pl script. Handles Word, PS, RTF, and WordPerfect files, with appropriate file->text converters. * htsearch/parser.cc, htsearch/parser.h: Add more error messages when the boolean expression is invalid. Mon Feb 15 21:02:24 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc(RetrieveLocal): Fix to ensure we report reading only max_doc_size bytes, even when the document is larger. * configure.in, configure: Add 'socklen_t' to getpeername check to prevent problems configuring on Solaris 7. * htdoc/RELEASE.html: Minor changes for 3.1.1 release. Sun Feb 14 16:29:48 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc(retrieveHTTP, retrieveLocal): Fix document size when the document is larger than max_doc_size. Size should be that sent by the server or as given by stat(). * htdoc/*.html: More cleanups from Marjolein. Sat Feb 13 20:53:34 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc(got_word): Ensure heading is in a normal range. * htdoc/RELEASE.html: Added information on the bugs fixed in 3.1.1. * htdoc/attrs.html: Added info on the changed syntax of the pdf_parser attribute in 3.1.0 and later. Sat Feb 13 20:29:26 1999 Marjolein Katsma <webmaster@javawoman.com> * htdoc/*.html: Cleaned up HTML, fixed typos, added appropriate HTML 4.0 syntax, added DTDs to files, other minor fixed. Fri Feb 12 19:58:28 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * .version: Bump for version 3.1.1. * configure.in, configure: Fix problems determining getpeername syntax under IRIX. * db/os/os_map.c: Fixed problems on AlphaLinux pointed out by Paul J. Meyer. Fri Feb 12 12:00:25 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc: Fix crashes noted by Frank Richter. * contrib/htparsedoc/parse_word_doc.pl: Use updated version (with fixed line breaks). * htnotify/htnotify.cc: Add patch mentioned in Feb 8 documentation change. Thu Feb 11 00:29:42 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/DocumentRef.cc (NUM_ASSIGN): Expand from unsigned types. (getnum): Use temporary for "unsigned short", and memcpy data into it instead of assignment. Tue Feb 9 19:21:55 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html, htdoc/where.html: Update for 3.1.0 release. * htdoc/uses.html: Added remaining backlog. * htdoc/RELEASE.html: Finish up release notes for 3.1.0. Tue Feb 9 19:19:13 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc: Ensure we remove the temporary file. Mon Feb 8 20:28:07 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/ma_menu: Change relative URLs to absolute URLs to www.htdig.org to reflect the changing mail archive. * htdoc/install.html: Add notes on new configure flags to set CONFIG variables. * htdoc/*.html: Ensure Last Modifed date stamps are up-to-date. Mon Feb 8 20:26:40 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/meta.html, htdoc/notification.html: Add info on date formats for the htnotify-date tag, esp. in relation to ISO 8601. Sat Feb 6 23:24:19 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.cc: Fixed compile problem when zlib is disabled. * htdoc/cf_byname, htdoc/cf_byprog.html, htdoc/attrs.html: Added entries for url_log, compression_level, noindex_start, noindex_end, allow_in_form, bad_querystr, no_title_text. * htdoc/THANKS.html: Added Gabriele Bartolini. * htdoc/uses.html, htdoc/FAQ.html, htdoc/bugs.html: Synch with the latest versions from the website tree. Fri Feb 5 19:57:39 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htnotify/htnotify.cc: Add function parse_date() to parse date strings from htnotify-date tags. It tries to be as flexible as possible about formatting and will report invalid dates. Based in part from code contributed by Gabriele Bartolini. Fri Feb 5 19:28:24 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * configure, configure.in: Add a test to ensure the zlib.h header file exists. * include/htconfig.h.in: Added definition for HAVE_ZLIB_H. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Add checks for HAVE_ZLIB_H in addition to HAVE_LIBZ. Ensures the library is actually accessible, not just present. * htfuzzy/Soundex.cc: Fix typo. Thu Feb 4 22:51:37 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * Makefile.in: Clean up previous patch and tidy up HTML and dictionary installation. Thu Feb 4 22:31:35 1999 Ric Klaren <klaren@telin.nl> * Makefile.in, */Makefile.in: Add support for $INSTALL_ROOT, making it easier to build packages (e.g. RPMs) into directories for later processing. * htsearch/Display.cc: Tiny patch to silence a compiler warning. Thu Feb 4 13:03:44 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htfuzzy/Soundex.cc(generateKey): Skip initial non-alphabetic characters and explicitly skip characters without values. * htfuzzy/Metaphone.cc(generateKey): General bug-fixing, fixing a bug that corrupted the string to be processed, fixing typos, and ensuring keys generated fit the metaphone algorithm. * htfuzzy/Fuzzy.cc(getWords): Add debugging output of the fuzzy key used. * contrib/doclist/doclist.pl, contrib/doclist/listafter.pl, contrib/whatsnew/whatsnew.pl, contribu/urlindex.pl: Change to support additions to ht://Dig database format. Thu Feb 4 02:09:22 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc: Add debugging information on words returned from fuzzy matching. * htfuzzy/Metaphone.cc(addWord): Fix bug where only one word would be stored per key in the database. * htfuzzy/Soundex.cc(addWord): Ditto. (generateKey): Rewrite to generate keys correctly. Wed Feb 3 19:24:36 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/htdig.html: Added documentation on the -l log and restart feature. * htdoc/htmerge.html: Added documentation on the -m merge database feature. * htdig/main.cc: Added documentation on the -l flag to the usage message. * .version: Bump to 3.1.0. Wed Feb 3 19:09:31 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc: Add check for URLs with no / in the no_title code. * htdig/Document.cc: Fix problems with dates returned from servers with incorrect formats. Those simply missing the day of week are parsed correctly, otherwise output an error, use the current date, and keep going. Wed Feb 3 09:57:14 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/nomatch.html: Fix small typo. * htdoc/RELEASE.html: Finish up 3.1.0 release notes. * htdoc/TODO.html: Update with status and new directions. Wed Feb 3 14:22:11 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> * htsearch/Display.cc(setVariables): Removed some of yesterdays changes. Thanks to Gilles! Tue Feb 2 17:26:06 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/PDF.h, htdig/PDF.cc: Fix problems with PDFs generated by CorelDraw. * htdoc/attrs.html: Fixed small typo. Tue Feb 2 21:02:25 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> * htsearch/Display.cc(setVariables,createURL): As pointed out by Gilles, append allow_in_form variables to the query strings only if they are given as input parameters. Tue Feb 2 10:29:09 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * configure, configure.in: Rewrite getpeername_length_t detection to use prototypes to eliminate type conversion. * htsearch/Display.cc(buildMatchList): Ensure scores are always positive or zero. Mon Feb 1 22:54:02 1999 Hans-Peter Nilsson <hp@axis.se> * htdoc/attrs.html: Correct "default" for "nothing_found_file". Mon Feb 1 14:44:32 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc(displayMatch): Remove compiler warnings. * */Makefile.in: Define INSTALL_PROGRAM from configure script. Mon Feb 1 14:04:18 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/ExternalParser.cc: Add checks to prevent wayward parsers from bringing down the dig. Sun Jan 31 23:15:36 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/WeightWord.cc(set): Ensure word is lowercased for accurate fuzzy comparisons. * htfuzzy/Fuzzy.cc(openIndex): Destroy the database reference if we cannot open the database. Fixes a coredump in classes that inherit this method. * Makefile.config.in: Remove bogus definitions of INSTALL. * Makefile.in: Define INSTALL, INSTALL_PROGRAM, INSTALL_SCRIPT, and INSSTALL_DATA as defined by configure. Use them. * htdoc/RELEASE.html: Started release notes for version 3.1.0. Mon Feb 1 04:36:29 1999 Hans-Peter Nilsson <hp@axis.se> * htsearch/Display.cc (displayMatch): Fix leaking user of String(String *). * htfuzzy/Prefix.cc (getWords): Ditto. * htlib/htString.h, htlib/String.cc (String(const String &)): New. * htlib/htString.h, htlib/String.cc (String(const String &, int)): No default argument. * htlib/htString.cc, htlib/String.cc (String(String *)): Removed. Sun Jan 31 21:46:52 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> * htlib/Connection.cc: Include sys/time.h needed by select, fixes PR #322. Sun Jan 31 20:50:38 1999 Hans-Peter Nilsson <hp@axis.se> * htdig/Retriever.cc (Initial, GetRef, Need2Get, IsValidURL, got_href, got_redirect): Do not lowercase URLs. * htlib/HtURLCodec.h (class HtURLCodec): Fake a friend function. Sat Jan 30 22:29:50 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * configure, configure.in: Add support for program name transformations. * */Makefile.in: Do it. Sat Jan 30 21:16:50 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htmerge/docs.cc: Added translation of Dutch comment for us ignorant Americans. ;-) * installdir/rundig: As mentioned by Gilles, use sed with ls -t test. Add more comments for FAQs. * configure.in, configure: Add --disable-zlib to turn off compiling compression entirely. Add --with-cgi-bin-dir, --with-image-dir and --with-search-dir flags to set CONFIG variables. * CONFIG.in: Use them. Sat Jan 30 21:05:35 1999 Randy Winch <gumby@cafes.net> * htcommon/DocumentRef.h: If using compressed document databases, declare compress and decompress functions and the current state of the head (excerpt). * htcommon/DocumentRef.cc: Change document compression to only compress the DocHead field and only decompress when necessary. Sat Jan 30 03:49:21 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/DocumentRef.h: Add #ifdef around declaration of c_buffer. * htcommon/DocumentRef.cc: Remove spurious extra "static" from c_buffer definition. Add #ifdef HAVE_LIBZ around it. Fri Jan 29 13:30:11 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc: Construct the StringMatch used for finding excerpts in two pieces--user input and post-fuzzy matching. Fixes problems with matching searches with punctuation. * htlib/StringMatch.cc(IgnoreCase): Fix small memory leak pointed out by Gilles. Thu Jan 28 21:36:03 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/*.html: Changed copyright information to mention the ht://Dig group, removing Andrew's name. * README, configure.in, Makefile.in: Ditto. * configure: Change mention of libg++ -> libstdc++. Thu Jan 28 12:53:40 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Document new remove_default_doc attribute. * Makefile.in: Make sure we put the wrapper file in the right place. Make sure dictionaries are installed with the correct permissions. * installdir/rundig: Use a portable test for testing the endings and synonym databases. Also enhanced support for flags (-a, -s, -vvv, -c config). * htsearch/Display.cc: Fix bug when sorting results would cause a coredump. Wed Jan 27 20:00:40 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/HTML.cc, htdig/SGMLEntities.cc, htdig/ExternalParser.cc, htcommon/WordList.cc, htcommon/DocumentRef.cc: Speedup by converting many config lookups into static variables. * htdoc/attrs.html, htdoc/hts_templates.cc, htdoc/cf_byname.html, htdoc/cf_byprog.html: Various minor fixes. * htsearch/Display.cc: Fix problems with star_patterns attribute. Wed Jan 27 13:02:39 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/SGMLEntities.cc: Use StringMatch class for matching " & < and > as defined by config options. Should speed up translation. * htdoc/THANKS.html: Minor updates for contributions towards 3.1.0. Tue Jan 26 19:29:08 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * include/htconfig.h.in: Define TRUE and FALSE if not defined. Change default of NO_WORD_COUNT (now undefined) for compatibility. * htdig/htdig.h: Remove definition of TRUE and FALSE (for consistency). * htcommon/DocumentDB.cc(Add, Delete, Exists, []): Do not lowercase the URL before storing it. URLs can be case-sensitive. Tue Jan 26 19:07:03 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htcommon/defaults.cc: Define remove_default_doc as option of default document to strip off URLs (e.g. /index.html -> /). * htlib/URL.cc(removeIndex): Use it. (normalizePath): Fix bug with stripping double slashes and the like from a query string. * htdig/Document.h, htdig/Document.cc: Add new variable contentLength and consider content-length headers when reading in documents. * htdig/PDF.cc: Fix broken code calling acroread. * htsearch/Display.cc: Allow braces in wrapper file. * htdoc/hts_general.html, htdoc/hts_templates.html: Add info on the wrapper alternative to separate header and footer files. * htdoc/config.html, installdir/header.html, installdir/nomatch.html, installdir/wrapper.html, installdir/search.html: Change sort option to be more grammatically correct. Tue Jan 26 21:19:02 1999 Hans-Peter Nilsson <hp@axis.se> * htmerge/docs.cc (convertDocs): Use HtURLCodec to encode URLs going into the doc_index database. * htsearch/Display.cc (buildMatchList): Use HtURLCodec to decode URLs from docIndex. * htcommon/defaults.cc (defaults): Fix typo with "case_sensitive". Tue Jan 26 18:08:19 1999 Alexander Bergolth <leo@leo.wu-wien.ac.at> * include/htconfig.h.in: Added HAVE_STRINGS_H. (I forgot that when added the configure check.) * htdig/Retriever.h: Fix small compiler error. Removed Log-lines. Tue Jan 26 02:22:45 1999 Hans-Peter Nilsson <hp@axis.se> * htdig/main.cc (main): Fix typo "uncoded_db_compatbile". Mon Jan 25 19:38:31 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/Configuration(Find): Make error message for missing entries conditional to DEBUG symbol. Removes odd error messages under normal use. Sun Jan 24 23:55:57 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htmerge/db.cc, htmerge/docs.cc: Fix compiler errors. * htnotify/htnotify.cc: Similar. Sun Jan 24 14:13:37 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/WordRecord.h (struct WordRecord): Remove member count if NO_WORD_COUNT defined. * htmerge/db.cc (mergeDB): Remove handling. * htmerge/words.cc (mergeWords): Similar. * include/htconfig.h.in: Define NO_WORD_COUNT by default. Sun Jan 24 14:13:37 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc(logSearch): Added fix from Gilles in case REMOTE_ADDR is NULL as well. * htnotify/htnotify.cc: Fix compiler warnings. * htlib/String.cc(indexOf): Use autoconf check for strstr, fix compiler warnings. * htlib/Configuration.cc(Find): Complain when option is not in the list. * htdig/HTML.cc(parse): Move declarations out of the loop. (parse): Don't add non-word characters to the excerpt if they're in the title. Fixes PR #80. Mon Jan 25 02:17:58 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/defaults.cc (defaults): New option "uncoded_db_compatible", default true. * htcommon/DocumentDB.h (DocumentDB::SetCompatibility): New function. (DocumentDB::myTryUncoded): New member. * htcommon/DocumentDB.cc (Constructor, Add(), operator[], Exists(), Delete()): Handle uncoded URL in database if myTryUncoded. * htdig/main.cc (main): Call (DocumentDB::)SetCompatibility() with option "uncoded_db_compatible". * htsearch/Display.cc (Display): Likewise. * htnotify/htnotify.cc (main): Likewise. * htmerge/docs.cc (convertDocs): Likewise. * htmerge/db.cc (mergeDB): Likewise. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Document option "uncoded_db_compatible". Sun Jan 24 15:21:02 1999 Hans-Peter Nilsson <hp@axis.se> * htlib/HtWordCodec.cc (HtWordCodec(StringList &, etc)): Check limits separately for "to" and "from". Do not calculate string-lengths separately for limit-checking; use methods Count() and length() on data near the final result. * htlib/HtWordCodec.cc (HtWordCodec constructors): Do not explicitly add '\0' to the pattern strings. * htlib/HtWordCodec.cc (code): Check for zero-length replacement list. Sat Jan 23 22:18:18 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc(parse_url): If a server ignores the If-Modified-Since request, still compare the retrieved date to the stored date to see if it has been modified. Sat Jan 23 13:09:03 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htmerge/htmerge.cc: Unlink the db.docs.index file before we build it again. This ensures we have a clean copy and don't duplicate URLs. Fri Jan 22 23:12:12 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * include/htconfig.h.in: Cleaned up preprocessor definitions. * configure.in, configure: Fix NEED_PROTO_GETHOSTNAME check and make check for GETPEERNAME_LENGTH_T more flexible. * htlib/Connection.cc: Change __sun__ to NEED_PROTO_GETHOSTNAME since we prefer feature tests. Sat Jan 23 02:38:08 1999 Hans-Peter Nilsson <hp@axis.se> * htsearch/Display.cc (logSearch): Fix simple typo in last change. Sat Jan 23 01:18:05 1999 Hans-Peter Nilsson <hp@axis.se> * htlib/String.cc (operator =): Add const modifier: const String &. * htlib/htString.h (String::operator=(const String &)): Ditto. * htlib/DB2_db.h (class DB2_db): Make Put(), Get(), Exists() and Delete() use const modifiers on appropriate parameters. * htlib/DB2_db.cc: Ditto. * htlib/GDBM_db.h (class GDBM_db): Ditto. * htlib/GDBM_db.cc: Ditto. * htlib/Database.h (class Database): Ditto. * htlib/Database.cc (Put): Similar. * htlib/BTree.h (class BTree): Make Put(), Get() and Exists() use const modifiers on appropriate parameters. * htlib/BTree.cc: Ditto. * htcommon/DocumentDB.cc (Add, operator[], Exists, Delete): Remove needless temporary String. * htcommon/DocumentRef.cc (Deserialize): Ditto. Fri Jan 22 21:10:12 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/Configuration.cc: Add support for keyword "include" to include other config files. * htdoc/cf_general.html: Document it. Thu Jan 21 23:25:37 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc(logSearch): Check if HTTP_REFERER is NULL, if so, use a dash. (Otherwise we'll kill some syslog() services). Thu Jan 21 05:30:40 1999 Hans-Peter Nilsson <hp@axis.se> * htlib/HtURLCodec.h, htlib/HtURLCodec.cc, htlib/HtWordCodec.cc, htlib/HtWordCodec.h, htlib/HtCodec.cc, htlib/HtCodec.h: New files. * htlib/Makefile.in (OBJS): Add the corresponding *.o files * htcommon/DocumentDB.cc (Open, Read, Add, operator[], Exists, Delete, CreateSearchDB, URLs): Use HtURLCodec; ::encode() and ::decode() the URL used as a key. * htcommon/DocumentRef.cc (Serialize): Encode the URL using HtURLCodec. (Deserialize): Decode it. * htmerge/htmerge.h: #include <HtURLCodec.h> * htmerge/htmerge.cc (main): Check HtURLCodec for errors. * htnotify/htnotify.cc (main): Ditto. * htsearch/htsearch.cc (main): Ditto. * htdig/main.cc (main): Ditto. * htcommon/defaults.cc (defaults): Add common_url_parts and url_part_aliases. * htdoc/cf_byprog.html, htdoc/cf_byname.html, htdoc/attrs.html: Document url_part_aliases and common_url_parts. * htlib/StringMatch.h (StringMatch::Pattern): Add default parameter sep = '|'. * htlib/StringMatch.cc (Pattern): Similar. Wed Jan 20 20:20:35 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc(logSearch): Use REMOTE_ADDR when REMOTE_HOST is unavailable (otherwise we silently dump core). Fixes PR #138. * htcommon/WordList.cc(valid_word): Words cannot be valid if they're shorter than minimum_word_length! Fixes PR #139. * htsearch/Display.cc(expandVariables): Allow variables of the form ${VAR}, fixes PR #121. Wed Jan 20 17:21:33 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htmerge/docs.cc: Fix logic to remove documents--missing else statements allow some "deleted" documents to not be removed. Wed Jan 20 11:52:18 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/good_strtok.h, htlib/good_strtok.cc: Added fixes and speed improvements contributed by Andrew Bishop. * htdig/ExternalParser.cc, htdig/Server.cc, htlib/cgi.cc, htmerge/db.cc, htmerge/words.cc: Call good_strtok with appropriate parameters (explicitly include NULL first parameter, second param is char, not char *). * htcommon/WordList.cc(Word): Added check for adding words with weight zero. * htsearch/Display.h, htsearch/Display.cc: Revised setting ANCHOR variable: it will be empty if there is no excerpt which matches the search formula. Fixes problems with META descriptions. Based on a patch contributed by Marjolein. Wed Jan 20 00:30:12 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/SGMLEntities.cc: Declare extern config, since we now use config options. * htsearch/Display.cc: Fix typo causing compile problems. Tue Jan 19 23:51:38 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Added options translate_amp, _lt_gt, _quot as suggested by Marjolein to control SGML translation of these entities. * htdig/SGMLEntities.cc: Use them as contributed by Marjolein. Tue Jan 19 12:55:36 1999 Hans-Peter Nilsson <hp@axis.se> * htlib/StringMatch.cc (Pattern): Always set PreviousState before checking PreviousValue. * htlib/StringMatch.cc (FindFirst): Be "greedy"; match longest. (Compare): Ditto. * htcommon/DocumentRef.cc (MEMCPY_ASSIGN, NUM_ASSIGN): New macros for assigning portably to some possibly-enum numeric type. (getnum): Use them. * htlib/StringMatch.cc (FINAL): Remove. (MATCH_INDEX_MASK): Include highest bit. (Pattern, FindFirst, Compare, FindFirstWord, CompareWord): Do not use FINAL. (FindFirst, Compare, FindFirstWord, CompareWord): When shifting by INDEX_SHIFT, cast to unsigned. Mon Jan 18 17:43:29 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Added no_title_text option to allow configuration of the text when no title is available. Default is the filename. * htsearch/Display.cc: Use no_title_text to set the title appropriately, as contributed by Marjolein. * htsearch/Display.cc: Ensure PERCENT variable has a minimum of 1. Mon Jan 18 17:41:44 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdig/Server.cc: Use max_doc_size when retrieving robots.txt files instead of a hard-coded 10k limit. * htdig/Document.cc: When reading chunks of document, if a chunk puts us over the max_doc_size limit, take everything up to that limit (rather than discarding the entire chunk). * htcommon/DocumentRef.cc: Fix thinko with compression_level. Sun Jan 17 21:48:05 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/(attrs.html, cf_byname.html, cf_byprog.html, config.html, hts_form.html, hts_templates.html): Add documentation for "sort" config and form input. * htcommon/defaults.cc: Added options "sort" and "sort_names" to pick result sorting order and text names for sort options. * htsearch/Display.cc: Added variable SORT to render a form menu for sort options, based on "sort" and "sort_names" options. * installdir/(wrapper.html, header.html, nomatch.html, footer.html, search.html, syntax.html): Add in sort option to form. Sun Jan 17 14:03:54 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/TemplateList.h htsearch/TemplateList.cc(createFromString): Ensure template_map config has three members for each template we add, contributed by Gabriele Bartolini <tlm@mbox.comune.prato.it>. * htsearch/Display.cc(Display): Take advantage of createFromString returning an error value to bail out of poorly-constructed template_maps, based on code contributed by <tlm@mbox.comune.prato.it>. * htdig/PDF.cc: Add debugging output of URLs causing problems. Also, switch system call to make it easier to call xpdf instead of acroread. * htcommon/defaults.cc: Change default pdf_parser attribute to include acrobat-specific flags. Fix mismatched naming of compression_level (was compression_factor). * htdig/Retriever.cc: Fix compiler warnings. * contrib/examples/updatedig: Added contributed rundig-type script from David Robley <webmaster@www.nisu.flinders.edu.au>. Sun Jan 17 13:42:43 1999 didier Gautheron <dgautheron@magic.fr> * htcommon/defaults.cc: add url_log parameter for save and restart function. * htdig/Retriever.cc, htdig/Retriever.h: Add save and restart function. * htdig/main.cc: Add option -l for save and restart function. * htdig/PDF.cc: Check to see if we have acroread before copying the pdf into TMPDIR! Fri Jan 15 07:23:30 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/DocumentRef.cc(Serialize): Save space when lengths can fit in an unsigned char or unsigned short. * htcommon/DocumentRef.cc(Deserialize): Handle expansion. Thu Jan 14 23:37:29 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Added options noindex_start and noindex_end to enable NOT indexing some sections of HTML. Contributed by Marjolein. * htdig/HTML.cc: Use them. * contrib/examples/rundig.sh: Add rundig example from Colin Viebrock with a few modifications for using less disk space. Thu Jan 14 23:27:24 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htlib/URL.cc: Fix parent path logic to ignore slashes in query string. Noted by Adam Coyne <adam@criticalmass.com>. Thu Jan 14 00:04:03 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * README: Fix for upcoming 3.1.0 release. * htcommon/defaults.cc: Set compression_factor to 0 for default (no compression). Thu Jan 14 03:16:15 1999 Hans-Peter Nilsson <hp@axis.se> * htdig/ExternalParser.cc (parse): Added support for 'm': meta element. * htdoc/attrs.html: Document it. Wed Jan 13 21:31:38 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.in(install): Add wrapper.html to the common directory when installing. * contrib/examples: Added directory for example common files (e.g. badwords, dictionaries, templates, etc.) * contrib/examples/badwords: Added example bad_words file by Marjolein. * .version: Bump to 3.1.0dev. * htdig/HTML.cc(parse): Added slight fixes to the comment parsing code, contributed by Marjolein. Wed Jan 13 20:11:26 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Fix typo with META example. * htdig/Document.cc: Use new StringList::Join function for http_proxy_exclude. * htnotify/htnotify.cc: Bring latest security patch from 3.1.0b4 onto the mainline source. * installdir/wrapper.html: New file to merge header and footer files. * htcommon/defaults.cc: Added search_results_wrapper for the location of the wrapper file, if used. (The default is empty, which uses header.html and footer.html) * htsearch/Display.cc: Added support for using the wrapper instead of header and footer if search_results_wrapper is set. * htsearch/htsearch.cc: Added check for sort config. * htsearch/Display.cc, htsearch/Display.h: Added support for sorting and reverse sorting by date, time, and score. Wed Jan 13 18:45:17 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Removed use_document_compression (redundant) and fixed problem with missing comma. Setting compression_factor to 0 is the equivalent of turning off use_document_compression. * htcommon/DocumentRef.cc(Serialize, Deserialize): Update from Randy Winch to eliminate use_document_compression and fix compilation problems noted by Hans-Peter. * htmerge/db.cc: Fixed problem with db.NextDocID() being set incorrectly, reported by Roman Dimov <roman@mark-itt.ru>. * htcommon/DocumentDB.h: Added IncNextDocID to allow big changes in db.NextDocID(), such as those above. * htdoc/THANKS.html: Added Akos Domotor. Wed Jan 13 07:07:35 1999 Hans-Peter Nilsson <hp@axis.se> * htsearch/htsearch.cc (setupWords): Remove parsedWords parameter with accociated processing of original words - deletion of bad_words, spacing and on-the-fly modifiers. (main): Create originalWords from input, not via setupWords(). Tue Jan 12 09:16:49 1999 didier Gautheron <dgautheron@magic.fr> * htcommon/WordList.cc, htmerge/words.cc: Changed field order in db.wordlist. With the old order, words from HTML body and words from links to that url weren't merged sometimes. * htdig/Document.cc, htmerge/words.cc: Small speed improvements. * htdig/HTML.cc: Fixed small memory leak with bogus HTML and small speedups. * htdig/Retriever.cc(got_href) : if ref exists we have to call AddDescription even if max_hop_count is reached. It's important for wwwoffle (urls in the cache are restricted by max_hop_count) * htcommon/DocumentDB.cc, htcommon/DocumentDB.h, htdig/Retriever.cc, htlib/Dictionary.cc, htlib/Dictionary.h, htlib/Object.cc, htlib/Object.h, htlib/String.cc, htlib/htString.h, htcommon/WordList.cc: Speedups after gprof data. Tue Jan 12 07:23:35 1999 didier Gautheron <dgautheron@magic.fr> * htlib/Configuration.cc: Fixed time format to standard to avoid sending If-Modified-Since http headers in native format (which would be incorrect behavior). Use C locale. * htlib/Dictionary.h, htlib/Dictionary.cc: Add new method GetNextElement to directly return next object when iterating. Tue Jan 12 12:56:26 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.h, htcommon/DocumentRef.cc(serialize, deserialize): Added support for compressing data using zlib if available, contributed by Randy Winch <gumby@cafes.net>. * htcommon/defaults.cc: Added config options use_document_compression and compression_factor for zlib support. * configure.in, include/htconfig.h.in: Added autoconf check for libz and deflate function. * configure: Generated from above change. Mon Jan 11 22:48:17 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htmerge/db.cc: Fixed thinko with setting the docIDs of new words in the destination wordlist. * htdoc/FAQ.html, htdoc/THANKS.html, htdoc/contents.html: Minor cleanups. * htdoc/RELEASE.html: Added release info from 3.1.0b4. * htdoc/uses.html: Alphabetized, added a form for requests, and added in lots of new sites. Mon Jan 11 02:42:51 1999 Hans-Peter Nilsson <hp@axis.se> * htsearch/htsearch.cc (setupWords): Do not skip words if "boolean" search. Mon Jan 11 00:42:51 1999 Hans-Peter Nilsson <hp@axis.se> * htdoc/hts_method.html: Add explanation of operator "not". * installdir/syntax.html: Added examples of correct logical expressions. Mon Jan 11 00:23:58 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/attrs.html(search_algorithm): Added prefix and substring matching--somehow slipped through the cracks! * htdoc/THANKS.html: Update to be more accurate as far as recent contributions. Sun Jan 10 00:06:59 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc(readHeader): Added check for header status when considering content-types. Fixed PR #91. Sat Jan 9 20:52:49 1999 didier Gautheron <dgautheron@magic.fr> * htcommon/WordList.cc(valid_word): Break out of looping once we're sure the word is invalid. * htlib/Dictionary.cc(Remove, Exists): Remember special case of an empty dictionary. Sat Jan 9 20:16:25 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc(parse): Don't capitalize headers--this creates problems with non-ASCII values, since String::uppercase doesn't know how to capitalize them. Fixes PR #100. Sat Jan 9 14:47:17 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc(getdate): Strip off weekday before calling strptime since some servers return invalid weekdays. Fixes PR #79. * htmerge/htmerge.h: Declare new mergeDB code. * htmerge/htmerge.cc: Set up merge_config file and add options for mergeDB code. * htmerge/db.cc: New file. Implements merging of two database sets specified by the merge_config and config variables. * htmerge/Makefile.in: Add db.o as an object to be compiled. Fri Jan 8 20:11:56 1999 Alexander Bergolth <bergolth@ariel.wu-wien.ac.at> * htdig/Plaintext.cc: fixed bug that inhibited compressing of whitespace * htlib/URL.cc: fixed problem in stripping anchors from URLs Thu Jan 7 23:29:32 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc(parse): Corrected problems with parsing comments, as contributed by Marjolein Katsma <webmaster@javawoman.com> and Gilles. * htsearch/Display.cc, htsearch/Display.h: Implement add_anchors_to_excerpt option and new variable ANCHOR as contributed by Marjolein. * htdoc/THANKS.html: Added new contributors. * README: Update for 1999 copyright, version, etc. Thu Jan 7 17:29:52 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/(attrs.html, cf_byname.html, cf_byprog.html): Fix typo noted by Joe Jah: keyword_factor -> keywords_factor. Thu Jan 7 14:32:34 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htsearch/Display.cc (display): The start template, if provided, should come out after the header, not before. * htcommon/defaults.cc, installdir/footer.html: Use the no_page_list_header stuff. Thu Jan 7 11:09:08 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/*.png: Add PNG versions of the default GIF graphics. Wed Jan 6 22:03:54 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htfuzzy/Synonym.cc, htfuzzy/htfuzzy.cc, htmerge/docs.cc, htmerge/words.cc, htdig/SGMLEntities.cc: Fix minor memory leaks. * htcommon/defaults.cc: Add .bin, .tgz, .rpm, .mov, .mpg, .avi to bad_extensions. * htdoc/attrs.html: Update documentation on default. * installdir/rundig: Removed check for age of synonym and endings DB. Nice feature, but it broke under too many shells. * htlib/DB2_db.cc: Change allocation of database cursors to match API in new version. * htdig/Retriever.cc(got_word): Skip changing to lowercase, we do it in WordList::Word. Wed Jan 6 14:49:47 1999 Gilles Detillieux <grdetil@scrc.umanitoba.ca> * htdoc/attrs.html: Added four new attributes, fixed defaults & typos. * htdoc/cf_byname.html: Added four new attributes. * htdoc/cf_byprog.html: Added four new attributes. Wed Jan 6 14:37:06 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in: Changed to require Autoconf 2.13 to eliminate bugs obeserved by users with older autoconf versions. * configure: Regenerated using Autoconf 2.13. Wed Jan 6 13:08:26 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.cc: Applied fix from Dave Alden <alden@math.ohio-state.edu> to compile under SunPRO compilers by eliminating trailing comma in enum. Wed Jan 6 17:50:55 1999 Alexander Bergolth <bergolth@ariel.wu-wien.ac.at> * {.,htcommon,htdig,htfuzzy,htlib,htmerge,htnotify,htsearch}/ Makefile.in, Makefile.config.in: fixed relative path problem if install-sh is used. Wed Jan 6 17:12:04 1999 Alexander Bergolth <bergolth@ariel.wu-wien.ac.at> * htlib/StringList.cc: fixed bug in StringList::Join (oops!) Wed Jan 6 10:34:45 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.cc(AddDescription): Remove delete instruction that fouls up everything (it was removing descriptions as we add them!). Wed Jan 6 14:52:11 1999 Hans-Peter Nilsson <hp@axis.se> * htlib/String.cc (allocate_space): Add missing [] to delete. Wed Jan 6 05:53:02 1999 Hans-Peter Nilsson <hp@axis.se> * htcommon/DocumentRef.cc(AddDescription): Do not add non-word characters to the wordlist. Wed Jan 6 00:28:19 1999 Hans-Peter Nilsson <hp@axis.se> * htdoc/cf_byname.html: Fixed html syntax "<br" and "/a>". Tue Jan 5 22:40:58 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Check if we need to do backlink and date factoring (e.g. we don't if they're zero!), from a patch by Gilles. Tue Jan 5 20:57:02 1999 Alexander Bergolth <bergolth@ariel.wu-wien.ac.at> * configure.in, htlib/Connection.cc: Check for strings.h for those platforms that don't have it. Tue Jan 5 14:24:52 1999 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.h: Added comments on the members (fields) of DocumentRef objects. * htcommon/defaults.cc: Added new option max_descriptions for limit on the number of descriptions to store (default 5, matches behavior pre 3.1.0b3). * htcommon/DocumentRef.cc: Support restriction of max_descriptions. * .version: Bump to 3.1.0b5dev. Tue Jan 5 20:07:05 1999 Alexander Bergolth <bergolth@ariel.wu-wien.ac.at> * htdig/Retriever.cc: fixed bug in bad_querystring detection Sat Jan 2 16:39:34 1999 Alexander Bergolth <leo@strike.wu-wien.ac.at> * htdig/main.cc, htlib/Configuration.cc: Added warning message if the locale selection was not successful. (e.g. because the locale definition is not installed) config["locale"] is now set to the return string of setlocale. * {.,htcommon,htdig,htfuzzy,htlib,htmerge,htnotify,htsearch}/ Makefile.in, Makefile.config.in, configure.in: Changed to allow compiling in seperate build directories. Fri Jan 1 05:49:19 1999 Hans-Peter Nilsson <hp@axis.se> * htdoc/attrs.html: Describe more thoroughly how "pdf_parser" is used. * htdoc/attrs.html: Fix typo for anchor/attribute "allow_virtual_hosts". * htdoc/attrs.html: Correct and add more verbose description of external parser program parameters and fields. Sun Dec 27 14:52:45 1998 Alexander Bergolth <leo@strike.wu-wien.ac.at> * htlib/URL.cc: Small change in URL::removeIndex so that URLs are not stripped if a query string ends with /index.html * htsearch/Display.cc, htnotify/htnotify.cc: Added patches from Gilles Detillieux <grdetil@scrc.umanitoba.ca> to fix memory leaks. Sat Dec 19 17:53:44 1998 Alexander Bergolth <leo@strike.wu-wien.ac.at> * htdig/main.cc, htdig/htdig.h, htdig/Retriever.cc: Added new option bad_querystr. Allows exclusion when digging CGI-Scripts. * htsearch/htsearch.cc, htsearch/Display.cc: Added new option allow_in_form. Does currently not work with some special variable names! * htcommon/defaults.cc: Added the two new options. Sat Dec 19 11:21:38 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * contrib/htparsedoc/parse_word_doc.pl: Update from Jesse. * .version: Bump for 3.1.0b4. * README: Ditto. * Makefile.in: Remove references to version number. * htnotify/htnotify.cc: Fix nasty security hole found by Werner Hett <hett@isbiel.ch>. Sat Dec 19 15:22:38 1998 Alexander Bergolth <leo@strike.wu-wien.ac.at> * htlib/StringList.cc, htlib/StringList.h: Added StringList::Join to simplify the creation of patterns for StringMatch. * htlib/String.cc: lastIndexOf(char ch) added * htlib/URL.cc: Changed URL::removeIndex to use local_default_doc. (index.html was hardcoded) local_default_doc can be a list. * htdig/main.cc, htlib/URL.cc: Use StringList::Join. Sun Dec 13 23:06:35 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Fix potential coredump when calculating date_factor and backlink_factor on docs that aren't in the database. Sat Dec 12 23:17:56 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/attrs.html: Added docs for new options since version 3.1.0b2. * htdoc/RELEASE.html: Added notes on changes since 3.1.0b2 (we should keep this up rather than all-at-once). * htdoc/hts_templates: Include documentation on using CGI environment variables in templates with this version. * htdig/Retriever.cc(got_href): Added check to prevent currenthopcount from becoming -1. * htcommon/WordList.cc: Change undefined minimumWordLength to config("minimum_word_length"). Sat Dec 12 12:01:55 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.in, Makefile.config.in, */Makefile.in: Added target mostlyclean to clean up, but leave compile-intensive targets (e.g. db, rx code). General cleanup too. * htdoc/where.html: Updated for eventual 3.1.0b3 release. * htcommon/WordList.cc: Added additional cleanups for the words in the bad word file, in case they have invalid punctuation, etc. Sat Dec 12 18:41:29 1998 Alexander Bergolth <leo@strike.wu-wien.ac.at> * htmerge/words.cc: Fix last update so that it compiles on AIX. Fri Dec 11 10:40:48 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc: Added additional debugging info on the reason for excluding a URL, based on a patch by Benoit Majeau <Benoit.Majeau@nrc.ca>. * htmerge/words.cc: Fixed a bug where pointer, rather than strings were assigned. Silly references... * htsearch/Display.cc, htsearch/Display.h: Added patch from Gilles to allow CGI environment variables in templates. * htdig/HTML.cc: Fix core dump when META refresh tags don't have content portions. Thu Dec 10 22:28:44 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc, htdig/Server.cc, htdig/Server.h: Changed support for server_wait_time to use delay() method in Server. Delay is from beginning of last connection to this one. Currently this also delays local digging, which may not be ideal. * htcommon/defaults.cc: Added option for server_max_docs as a limit on the number of docs returned from a server. * contrib/htparsedoc/parse_word_doc.pl: New version from Jesse. New code speedups and better matching of punctuation. * htdig/Document.cc: Check http_proxy_exclude to see if it's empty. If so, use the proxy. Mon Dec 7 21:46:34 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc: Fix thinko with multiple excludes and restricts. Pointed out by Gilles. * htcommon/defaults.cc: Add new option server_wait_time for the number of seconds to wait between requests. * htdig/Retriever.cc: Use server_wait_time to call sleep() before requests. Should help prevent server abuse. :-) * htcommon/WordList.cc(valid_word): Remove unnecessary code. * htcommon/DocumentRef.cc: Fix typo that added description text that contained punctuation or was too short. Sun Dec 6 13:12:55 1998 Geoff Hutchison <ghutchis@ethel.williams.edu> * htsearch/parser.cc: Check for empty boolean searches and report an error. Fixes bug reported by Chuck O'Donnell <cao@bus.net>. * install-sh, mkinstalldirs: Import latest version from autoconf. * htcommon/DocumentRef.cc: Add the text of descriptions to the word database with weight description_factor. * htcommon/WordList.cc: Ensure duplicate words have minimum location and anchor attributes. * htcommon/WordRecord.h: Ensure blank WordRecords have a default count of 1 since a word has to exist to have a WordRecord! * htdig/ExternalParser.cc, htdig/PDF.cc, htfuzzy/EndingsDB.cc: Ensure temporary files are placed in TMPDIR if it's set. * htdig/Retriever.cc: Don't add the text of descriptions to the word db here, it's better to do it in the DocumentRef itself. * htmerge/words.cc: Check for word entries that are essentially duplicates and compact them. Sat Dec 5 01:10:46 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/THANKS.html: Updated for recent submissions. * htdoc/FAQ.html: Cleaned up title. * htdoc/uses.html: Added more sites and cleaned up the HTML. Fri Dec 4 20:15:41 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * db/os/os_fsync.c, db/mutex/mutex.c: Patch from Klaus Mueller <K.Mueller@intershop.de> to compile under CygWinB20. * htdig/HTML.cc: Fix mistake in last update--file was included twice. * htdig/Retriever.cc: Do a check for blank URLs before adding them to the list to be retrieved. Fri Dec 4 19:21:17 1998 Didier Gautheron <dgautheron@magic.fr> * htdig/HTML.cc: Fix parser bug with < becoming a tag. * htlib/Dictionary.cc: Added check for empty dictionaries. * htlib/URL.cc: Allow server_aliases to work under virtual hosts. * htmerge/htmerge.cc: Remove previous db.words.db file before doing a word merging. Fixes bug with deleted documents keeping entries. * htdig/main.cc, htdig/Retriever.h, htdig/Retriever.cc: Added parameter to Initial function to prevent URLs from being checked twice during an update dig. * htcommon/WordList.cc, htmerge/words.cc: Don't store c:1 and a:0 entries in db.wordlist to save space. Fri Dec 4 19:08:28 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in, Makefile.in, Makefile.config.in: Remove DB_DIR and RX_DIR. * configure: Regenerated for configure.in changes. * htsearch/htsearch.cc: Added usage message for the command line. Fri Dec 4 18:52:55 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html: Added question about phrase matching. Fri Dec 4 21:21:00 1998 Alexander Bergolth <leo@leo.wu-wien.ac.at> * configure.in: Check if the third argument of getpeername is a size_t* or an unsigned int*. * include/htconfig.h.in: Define GETPEERNAME_LENGTH_T. * htlib/Connection.cc: Use GETPEERNAME_LENGTH_T as the type of the third getpeername argument. Included strings.h which is needed for FD_ZERO on AIX. Thu Dec 3 23:03:15 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in: Check for getopt.h for those platforms that don't have it. Fix checks for db and rx dirs since these names won't change. * include/htconfig.h.in: Define HAVE_GETOPT_H. * configure: Generate from configure.in with latest autoconf (2.12.2). * htdig/Plaintext.cc: Removed compiler warnings. * htdig/main.cc, htfuzzy/htfuzzy.cc, htmerge/htmerge.cc, htnotify/htnotify.cc, htsearch/htsearch.cc: Use configure check to only include getopt.h when it exists. * htcommon/defaults.cc: Add new option http_proxy_exclude for servers that shouldn't use the proxy, from a patch by Gilles Detillieux. * htdig/Document.h, htdig/Document.cc: Use it, from a patch by Gilles. Tue Dec 1 21:36:37 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.in: Fixed bug with "make depend," noted by Morgan Davis <mdavis@cts.com>. * htdig/main.cc, htfuzzy/htfuzzy.cc, htmerge/htmerge.cc, htnotify/htnotify.cc, htsearch/htsearch.cc: Add include <getopt.h> to help compiling under Win32 with CygWinB20. * htdig/Retriever.cc: Update hopcount correctly by taking the shortest paths to documents. * htlib/DB2_db.cc: Added fix from Alexander Bergolth for Berkeley DB under AIX. * htlib/StringMatch.cc: Added fix from Christian Schneider <cschneid@relog.ch>, discovered from behavior with limit_urls_to. Tue Dec 1 18:06:33 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/hts_form.html: Explained why config fields reject periods. * htdoc/FAQ.html: Added information about Internal Server Errors. * htdoc/uses.html: Updated with more sites, change e-mail to Geoff. Sun Nov 29 21:26:56 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc: Fix last update so it compiles (oops!). * htdig/Document.cc: As above! Sun Nov 29 20:06:58 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/htsearch.cc: Improved support for multiple restrict and exclude patterns, based on code from Gilles Detillieux and William Rhee <willrhee@umich.edu>. * htdig/Document.cc, htdig/PDF.cc: Fixed problems under FreeBSD where <sys/types.h> needed to be before <sys/stat.h>, noted by Gilles. * htdig/Server.cc: Fixed bug with robots.txt files containing tabs, based on patch from Christian Schneider <cschneid@relog.ch>. * htdig/Document.cc: Fixed core dumps caused by mystrptime returning NULL. Instead, we'll use the current timestamp. Noted by Michael Hauber <mhauber@datacore.ch> and <MARK_ALLEYNE@Non-HP-UnitedKingdom-om8.om.hp.com>. Fri Nov 27 19:09:33 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * db/*: Import of Sleepycat's Berkely DB 2.5.9 * rx/*: Import of FSF rx 1.5 * configure, configure.in: Updated to deal with changes in db, rx directories. * Attic/db-2.4.14.tar.gz: Removed old db package for update. * htsearch/parser.cc: Removed bogus code with "%01" -> "|" * htlib/URL.cc: Considers URLs with "%7E" to be equivalent to "~" * htlib/String.cc: Changed MinimumAllocationSize to cut down on memory usage on small strings. * htdig/Retriever.h, htdig/Retriever.cc, htdig/HTML.cc: Changed Retriever::got_word to check for small words, valid_punctuation to remove bugs in HTML.cc. * htcommon/defaults.cc: Changed backlink_factor to 1000, description_factor to 150, match_method to and, and meta_description factor to 50. Should produce more accurate search results. * htcommon/WordList.cc: Fixed bug with bad_words and MAX_WORD_LENGTH, noted by Jeff Breidenbach <jeff@alum.mit.edu>. * README: Updated to reflect bug-tracking system. Tue Nov 24 15:57:28 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc: Added patch to use local_default doc with local_user_urls from Gilles Detillieux <grdetil@scrc.umanitoba.ca>. Mon Nov 23 18:57:16 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/RELEASE.html, htdoc/bugs.html, htdoc/contents.html, htdoc/where.html: Updated for new bug reporting system. * htdoc/TODO.html: Updated To Do w/ current status. Sun Nov 22 14:03:06 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/rundig: Added checks for synonym databases older than the synonym files. * htcommon/defaults.cc: New config options "description_factor" for weighting words added as link descriptions, and "no_excerpt_show_top" to show the top of an excerpt instead of the "no_excerpt_text". * htdig/Retriever.cc: Use "description_factor" to weight link descriptions with the documents at the end of the link. * htsearch/Display.cc: Adjust date_factor and backlink_factor rankings to produce better results. * htsearch/Display.cc: Use "no_excerpt_show_top." * htsearch/htsearch.cc: Don't remove boolean operators from boolean search strings! Thu Nov 19 01:31:37 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html: Update for -ldb problem on Digital UNIX. Wed Nov 18 05:14:53 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/FAQ.html: Update FAQ w/ new questions, better responses. * htdoc/mailing.html: Mention additional archive at www.mail-archive.com. * htdoc/require.html: Update requirements (libstc++ instead of libg++). Tue Nov 17 23:13:04 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * contrib/wordfreq/wordfreq.pl: Added changes by Isoif. * htsearch/Display.cc: Added HTTP_REFERER to htsearch logging * htdig/Document.cc: Fixed memory leak as a result of thinko. * htcommon/DocumentRef.cc: Removed limit on number of link descriptions. Mon Nov 16 22:30:07 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Declare new config options backlink_factor and date_factor for counting document backlink counts and modifed dates in rankings. * htsearch/Display.cc: Use above factors. * htsearch/ResultMatch.cc: Clarify getScore() comments. * htlib/mktime.c: Import new version. * installdir/htdig.conf: Add max_doc_size example (to help w/FAQ). Mon Nov 16 10:46:15 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/ExternalParser.cc: Add checks for null tokens, adapted from patch by Vadim Checkan. * htdig/Retriever.cc: Count docBackLinks accurately (previously all docs had count of 2!). Sun Nov 15 17:04:34 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc(do_tag): Fix for refresh tags w/o URLs. * htmerge/docs.cc, htmerge/words.cc: Change \r to \n, as mentioned by Andrew Bishop. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Define new fields docBackLinks (backlink count) and docSig (document signature). * htdig/Retriever.cc: Keep track of docBackLinks. * htsearch/Display.cc: Add variable BACKLINKS to display the count. Sat Nov 14 20:30:18 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc(parse, do_tag): Ensure links respect META robot settings. Patch contributed by Michael Spann <mikes@mail.sv.dialogic.com>. * htdig/HTML.cc(do_tag): Eliminate bug that ignores "?" in URLs * htdig/HTML.cc(do_tag): Add support for META refresh tags as "redirects", submitted by Aidas Kasparas <kaspar@dobilas.infosistema.lt>. Thu Nov 12 04:13:26 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/contents.html: Added link to jitterbug bug db. Sun Nov 8 21:10:19 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/ChangeLog, htdoc/RELEASE.html, htdoc/THANKS.html: Correct spelling error with Rene' Seindal's name. * htdoc/hts_templates.html: Update to improve clarity. Sun Nov 8 20:33:22 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Document.cc: Changed reset to keep proxy settings--fixes bug noted by Didier Gautheron <dgautheron@magic.fr> Fri Nov 6 17:07:00 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * contrib/wordfreq/wordfreq.pl: Updated with patch from Isoif Fettich <ifettich@netsoft.ro> to use Berkeley DB. * contrib/whatsnew/whatsnew.pl: Fixed mistake from Oct 26 change. * contrib/htparsedoc/parse_word_doc.pl: Added file contributed by Jesse. * contrib/README: Updated to include short descriptions of the scripts. * contrib/multidig/*: New scripts to make working with multiple DB a little easier. * configure, configure.in: Added changes to support snapshots. * .version: Resurrected to automate snapshot versions. Wed Nov 4 20:13:10 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdoc/contents.html: Added "Contributors" for THANKS.html * htdoc/THANKS.html: Added acknowledgement to contributors. Wed Nov 4 15:02:43 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htnotify/htnotify.cc: Fixed buglet with -F flag to sendmail. * htdig/Plaintext.cc: Added patch from Vadim Chekan to change char to unsigned char to fix reading Cyrillic plaintext files. Mon Nov 2 15:34:53 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htnotify/htnotify.cc, Makefile.config.in, README: Changed "HTDig" to "ht://Dig." Sun Nov 1 20:34:14 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.in: Fixed buglet with dist target. * htdig/Makefile.in: Fixed buglet with distclean target. * htdoc/FAQ.html, htdoc/RELEASE.html, htdoc/attrs.html htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/htdig.html htdoc/hts_templates.html: Updated documentation for new features, bug-fixes in ht://Dig 3.1.0b2. * htlib/Makefile.in, htlib/lib.h: Call mytimegm.cc instead of timegm.c. * Attic/makedp: Remove file generated by configure * htdig/Document.cc: Remove const from *ext to fix compiler warning. Sun Nov 1 00:17:08 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Added template var DESCRIPTION as first item in DESCRIPTIONS, as requested by Ryan Scott <test@netcreations.com>. * htlib/mytimegm.cc: Resurrected mytimegm() until problems with glibc version can be solved. * htdig/Document.cc, htdig/Retriever.cc, htfuzzy/Prefix.cc, htsearch/WeightWord.cc, htsearch/htsearch.cc: Replaced system calls with htlib/my* functions. Sat Oct 31 23:58:22 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/URL.cc: Fixed compiler warning. * rx-1.5/Attic/Makefile, rx-1.5/Attic/config.log: Removed useless Makefile and config.log file. Tue Oct 27 22:53:03 1998 Andrew Scherpbier <andrew@contigo.com> * */Makefile.in (depend): Fixed so that 'make depend' works again. (Not sure exactly how long it was broken!) Tue Oct 27 20:00:16 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.in: Fix buglet with distclean target * configure configure.in: Added check for LOCALTIME_R, removed test for timegm replacement, changed compiler for most tests to $CC. * include/htconfig.in: Added option for LOCALTIME_R. * htlib/timegm.c, htlib/mktime.c: Fixed some compilation problems. * htlib/Makefile.in: Remove mktime.o since source is included in timegm.o. Tue Oct 27 13:31:25 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/mktime.c: Imported new version from glibc-2.0.99. * htcommon/DocumentDB.cc: Fixed bug noted by Vadim Chekan with CreateSearchDB. Mon Oct 26 15:27:28 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * Makefile.config.in, configure.in, configure: Fixed problem with -ldb, -lrx, etc. not being declared in $LIBS * htdoc/install.html: Added remarks about using ./configure --prefix= * README: Cleaned up for new URLs, version numbers, etc. * htsearch/htsearch.cc: Added patch by Esa Ahola fixing bug with not ingoring bad_words properly. * contrib/whatsnew/whatsnew.pl: Added fix from Jacques Reynes <Jacques.Reynes@cict.fr> to get whatsnew to work with Berkeley DB. * htdig/Retriever.cc, htdig/Document.cc: Fixed bug introduced by Oct 18 change. Authorization will not be cleared. * htlib/URL.cc: Fixed new -Wall warnings. Wed Oct 21 13:30:05 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/timegm.c: Corrected Oct 17 change. Should now work. :-) * htcommon/defaults.cc: Added defaults for new directives server_aliases and limit_normalized. * htdig/HTML.cc: Cleaned up HTML parsing based on patch by Rene' Seindal. Wed Oct 21 18:31:00 1998 Alexander Bergolth <leo@leo.wu-wien.ac.at> * htlib/URL.cc, htlib/URL.h: Added patch to support translation of server names. (Configuration directive: server_aliases) * htdig/Retriever.cc, htdig/htdig.h, htdig/main.cc: Additional limiting after normalization of the URL. (Configuration directive: limit_normalized) Sun Oct 18 17:19:51 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/Connection.h, htlib/Connection.cc: Define new function timeout() as adapted from a patch by Rene' Seindal. * htdig/Document.cc: Use it as adapted from a patch by Rene' Seindal. Sun Oct 18 16:33:58 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentDB.cc: Changed deserialize function to explicitly delete DocumentRef. * htcommon/DocumentRef.cc: Added trap for DOC_STRING value. * htdig/Retriever.cc: Delete and reallocate Document variable before retrieving. (Fixes database corruption bug) Removed code to add a "/" to every URL with a 404--servers should send a redirect in this case. Sat Oct 17 20:15:44 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/timegm.c: Declare __gmtime_r if not defined Sat Oct 17 10:15:57 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * configure.in: Fixed problem with configuring DB_DIR introduced by Oct 11 change. * configure: Regenerated by autoconf for above fix. * htlib/Connection.h, htlib/Connection.cc: Included fixes sent by Paul J. Meyer <pmeyer@rimeice.msfc.nasa.gov> to fix connections on Dec Alpha environments. * htsearch/Display.cc, htsearch/Display.h, htdoc/hts_templates.html: Added variable CURRENT as the number of the current match, adapted from a patch by Rene' Seindal <seindal@webadm.kb.dk> * htcommon/defaults.cc: Changed htdig.sdsu.edu to www.htdig.org in start_urls Wed Oct 14 03:43:22 1998 turtle <turtle@kiwi> * installdir/htdig.conf: fixed broken link pointed out by chris@impulsedata.net, moved maintainer stuff up in the file Sun Oct 11 22:16:27 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/DB2_db.cc: Added fix suggested by Domotor Akos <dome@impulzus.sch.bme.hu> with (char *)NULL cast. * htlib/Attic/mytimegm.cc: Removed old mytimegm function. * installdir/syntax.html: Improved boolean method error message. It now gives examples of boolean expressions. * htcommon/defaults.cc, htsearch/Display.cc, htsearch/Display.h, htsearch/parser.cc: Added htsearch logging patch from Alexander Bergolth. * */Makefile.in, include/htconfig.h.in, htdig/Document.cc, htdig/Images.cc, Attic/.version, Makefile.config.in, Makefile.in, configure, configure.in, mkinstalldirs: Updated Makefiles and configure variables. * htfuzzy/Endings.cc, htfuzzy/Fuzzy.cc, htfuzzy/Prefix.cc, htfuzzy/htfuzzy.cc, htlib/DB2_db.cc, htcommon/DocumentDB.cc: Removed more -Wall warnings. Fri Oct 9 00:29:18 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc: Fixed typo with "meta_desription_factor". * htdig/Images.cc: Use user_agent config in GET request. Thu Oct 8 09:05:41 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/syntax.html: Improved Boolean search description. Mon Oct 5 11:30:16 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * contrib/ewswrap/ewswrap.cgi, contrib/ewswrap/htwrap.cgi, contrib/ewswrap/README: New scripts, contributed by John Grohol PsyD <johngr@cmhcsys.com>. Fri Oct 2 13:11:24 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc: Added check for docs removed with noindex. Now words in these docs should be ignored for the word db. Fri Oct 2 13:09:04 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * CONFIG Makefile.config.in Makefile.in */Makefile.in, htcommon/defaults.cc htdig/main.cc, htfuzzy/htfuzzy.cc, htmerge/htmerge.cc, htnotify/htnotify.cc include/htconfig.h.in: More configure improvements--use top_srcdir instead of HTDIG_TOP, use PACKAGE, VERSION, etc. Fri Oct 2 11:32:59 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/StringList.cc: Added patch by Alexander Bergolth for bug with multiple delimeter characters Fri Oct 2 15:22:06 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * installdir/rundig, configure.in, CONFIG, CONFIG.in, aclocal.m4, configure: Improvements in configure.in, notably using --prefix= and --exec-prefix= Tue Sep 29 19:26:11 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc: Added patch from Tim Frost <tim@nz.eds.com> for single quotes around URLs. * htfuzzy/Prefix.cc: Added patch from Esa to fix Prefix matching for capitalization. * htcommon/defaults.cc: Added modification_time_is_now config * htdig/Document.cc:, htdig/Retriever.cc: Added patch from Andrew Bishop <amb@gedanken.demon.co.uk> for above to use modification times when servers do not supply them. * htsearch/htsearch.cc: Added patch from Andrew Bishop for -c switch. Wed Sep 23 14:46:34 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc, htdig/Server.cc: Added case_sensitive attribute to work on case insensitive servers. Wed Sep 23 11:58:22 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: re-fixed bug noted by Alexander Bergolth * htlib/Attic/timegm.cc, htlib/Makefile.in, htlib/mktime.c, htlib/mytimegm.cc, htlib/timegm.c: Switched to using glibc timegm replacement. * configure, configure.in, Makefile.config.in: Add configure searches for acroread and sendmail programs. * htnotify/Makefile.in, htnotify/htnotify.cc, htcommon/Makefile.in, htcommon/defaults.cc: Use them. * htdig/HTML.cc: Fix thinko in META robots tag. * htcommon/defaults.cc: Define iso_8601 date formatting option * htsearch/Display.cc, htnotify/htnotify.cc: Use it as suggested by Knut A. Syed <Knut.Syed@nhh.no> Fri Sep 18 14:35:02 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Fixed bug noted by Alexander Bergolth <leo@strike.wu-wien.ac.at> in exclude logic * htdig/HTML.cc: Fixed bug in comma-separated keywords noted by <C.H.Liddiard@qmw.ac.uk> * installdir/synonyms: New version contributed by John Banbury <lijab@flinders.edu.au> Fri Sep 18 00:38:09 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * .version: Bump to 3.1.0b2 * htsearch/Makefile.in, htdig/Makefile.in, htfuzzy/Makefile.in, htlib/Makefile.in, htmerge/Makefile.in, htnotify/Makefile.in, htcommon/Makefile.in: Remove include .sniffdir directive. * htdig/HTML.cc: Fix horrible META description coding. * htfuzzy/EndingsDB.cc, htfuzzy/Fuzzy.cc htfuzzy/Synonym.cc, htfuzzy/htfuzzy.cc: Change "\r" to "\n" in statistics on suggestion of Andrew M. Bishop <amb@gedanken.demon.co.uk> * Makefile.config.in: Remove -ggdb from LDFLAGS. Tue Sep 15 22:31:48 1998 turtle <turtle@kiwi> * Makefile.in: add substitution for @DATABASE_DIR@ Thu Sep 10 00:06:58 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/HTML.cc: Change debug level of META tags. * htsearch/TemplateList.cc, htsearch/htsearch.cc, htsearch/Display.cc, htsearch/Display.h: Backed out builtin-long default from Monday, now use error handler Mon Sep 7 23:19:12 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * contrib/htparsedoc: Added contributed external parser for MS Word documents by Richard Jones <rjones@imcl.com>. * htdig/Document.cc: Added fix to use htparsedoc. * htdoc/*.html: Merged in new documentation for htdig-3.1.0b1. * htdig/HTML.cc: Extended "noindex" behavior in previous patch. * htcommon/defaults.cc: Added user_agent config option. * htdig/Document.cc: Use it. Mon Sep 7 00:34:19 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/DocumentRef.h: Added DocState for documents marked as "noindex". * htdig/HTML.cc, htdig/Retriever.h, htdig/Retriever.cc, htmerge/docs.cc: Use it to remove them. * htsearch/TemplateList.cc: Add default template of builtin-long to slot 0 in case of an error. * htsearch/Display.cc: Use it. Sun Sep 6 21:36:16 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htcommon/defaults.cc: Sorted the current list of defaults, added "pdf_parser" for the program to use in PDF.cc. * htdig/PDF.cc: Use it, checking for the file before calling system to fail gracefully. * htlib/URL.cc: Bug fix for http:/ v. http:// Sat Sep 5 23:11:48 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/String.cc: Added patch by Zvi Har'El <rl@math.technion.ac.il> to indexOf function to prevent "false positive" matches. * installdir/nomatch.html, installdir/syntax.html: Fixed reference to ht://Dig 3.0. * htdig/Document.cc: Use robotstxt_name as user-agent as a more consistent approach. * htsearch/parser.cc: Convert "%01" to "|" to support <SELECT ... MULTIPLE> tags. Thu Sep 3 20:53:51 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Makefile.in: Remove reference to -lgdbm * htsearch/Display.cc: Send Content-type header after all variable expansion is completed. * htcommon/WordList.cc: Removed warning under egcs-1.1 Tue Aug 11 08:58:34 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc, htdig/Retriever.h, htdig/Retriever.cc, htdig/Parsable.h, htdig/Parsable.cc, htdig/HTML.h, htdig/HTML.cc, htcommon/defaults.cc, htcommon/DocumentRef.h, htcommon/DocumentRef.cc, htcommon/DocumentDB.cc: Second patch for META description tags. New field in DocDB for the desc., space in word DB w/ proper factor. * htmerge/docs.cc: Added statistic for total size of docs in DB. Thu Aug 6 10:15:22 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Retriever.cc: Added "local_dir_doc" config option, the default filename in a directory. * htcommon/defaults.cc: Fixed "elipses" spelling mistake, local_dir_doc as above Tue Aug 4 11:34:46 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htlib/Configuration.cc: Added fix by Philippe Rochat <prochat@lbdsun.epfl.ch> to remove whitespace after config options. * htdig/HTML.cc, htdig/HTML.h: Added support for META robots tags. Mon Aug 3 16:50:46 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/ResultList.cc, htnotify/htnotify.cc, htmerge/htmerge.cc, htmerge/docs.cc, htlib/String.cc, htlib/ParsedString.cc, htfuzzy/Substring.cc, htfuzzy/Prefix.cc, htfuzzy/Exact.cc, htdig/SGMLEntities.cc, htdig/Retriever.cc, htdig/PDF.cc, htdig/HTML.cc, htdig/Document.cc: Fixed compiler warnings under -Wall Mon Aug 3 05:56:23 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Spelling correction for "ellipses" Thu Jul 23 12:14:34 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/PDF.cc, htdig/PDF.h, htdig/Document.cc: Added files (and patch) from Sylvain Wallez for PDF parsing. Incorporates fix for non-Adobe PDFs. * htcommon/defaults.cc: Removed .pdf extension from bad_extensions. Wed Jul 22 10:04:31 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Added patch from Sylvain Wallez <s.wallez.alcatel@e-mail.com> to use the filename if no title is found. * htnotify/htnotify.cc: Added patch from Chris Jason Richards <richards@cs.tamu.edu> to fix problems with sendmail. Tue Jul 21 09:56:58 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htsearch/Display.cc: Added patch by Rob Stone <rob@psych.york.ac.uk> to create new environment variables to htsearch: SELECTED_FORMAT and SELECTED_METHOD. Sun Jul 19 09:51:47 1998 Andrew Scherpbier <andrew@contigo.com> * configure.in (berkeley db stuff): Added the berkeley db .tar.gz to the distribution and modified configure.in to extract it if it needs to. Thu Jul 9 09:39:01 1998 Geoff Hutchison <ghutchis@wso.williams.edu> * htdig/Server.cc, htdig/Retriever.h, htdig/Retriever.cc, htdig/Document.h, htdig/Document.cc, htcommon/defaults.cc: Added support for local file digging using patches by Pasi Eronen <pe@iki.fi>. Patches include support for local user (~username) digging. * htdig/HTML.h, htdig/HTML.cc, htcommon/defaults.cc: Added support for META name=description tags. Uses new config-file option "use_meta_description" which is off by default. Mon Jun 22 05:02:01 1998 turtle <turtle@kiwi> * configure.in: Added test to make sure that the berkeley db library is present * .cvsignore: Ignore the berkeley db library * configure: changed * Makefile.config.in: Removed GDBM references * Makefile.in: Removed GDMB references * .version: updated version to 3.1.0b1 * README: Updated version # and website location * htdig/HTML.cc: Applied patch that prevented SGML entities that translate to valid_punctuation characters from becoming part of words * configure.in: Removed references to GDBM * htcommon/defaults.cc: Got rid of my email address as the default maintainer * htdig/htdig.conf: simple config file for development * htlib/String.cc, htlib/Attic/SDSU.h, htlib/Attic/SDSU.cc, htlib/DB2_db.cc, htlib/Connection.cc, htlib/Configuration.cc, htlib/BTree.cc: New Berkeley database stuff * htlib/.sniffdir/ofiles.incl: removed SDSU.* * installdir/syntax.html, installdir/search.html, installdir/rundig, installdir/nomatch.html, installdir/htdig.conf, installdir/footer.html: Changed to use the new http://www.htdig.org/ instead of the sdsu site Sun Jun 21 23:20:14 1998 turtle <turtle@kiwi> * rx-1.5/rx/Attic/config.log, htsearch/htsearch.cc, htsearch/Attic/display.cc, htsearch/Display.cc, htmerge/docs.cc, htlib/.sniffdir/ofiles.incl, htlib/Database.h, htlib/DB2_db.cc, htlib/DB2_db.h, htlib/Database.cc, htfuzzy/.sniffdir/ofiles.incl, htfuzzy/Prefix.cc, htfuzzy/Prefix.h, htfuzzy/Makefile.in, htfuzzy/Fuzzy.cc, htcommon/defaults.cc, configure.in, Makefile.in, Makefile.config.in: patches by Esa and Jesse to add BerkeleyDB and Prefix searching Mon Jun 15 18:15:50 1998 turtle <turtle@kiwi> * htdig/HTML.cc: Added suggestion by Chris Liddiard to add ',' to the list of separator characters for meta keyword parsing Tue May 26 03:58:14 1998 turtle <turtle@kiwi> * rx-1.5/rx/Attic/config.log, htlib/htString.h, htlib/cgi.cc, htlib/URL.cc, htlib/String.cc, htlib/ParsedString.cc, htlib/Database.cc, htlib/Connection.cc: Got rid of compiler warnings. * rx-1.5/rx/.cvsignore: added config.log Fri Apr 3 17:10:44 1998 turtle <turtle@kiwi> * htsearch/Display.cc: Patch to make excludes work Tue Mar 10 16:02:32 1998 turtle <turtle@kiwi> * htlib/strcasecmp.cc: Applied patch by Bernhard Griener to add arguments checks in the mystrncasecmp() function Sun Feb 22 17:43:49 1998 turtle <turtle@kiwi> * htdoc/mailing.html: New mailing list archive location Tue Feb 17 18:05:40 1998 turtle <turtle@kiwi> * htdoc/uses.html: added new one Thu Feb 12 22:22:15 1998 turtle <turtle@kiwi> * htdoc/uses.html: Added more sites Mon Jan 5 06:14:11 1998 turtle <turtle@kiwi> * configure, configure.in: Added check for fstream.h to get rid of the annoying emails about ht://Dig not compiling... * Makefile.config.in: Added include of the GDBM library back * .version: Now at version 3.0.9 * include/htconfig.h.in: Changed refs to time related stuff * htmerge/htmerge.cc, htmerge/docs.cc: format changes * htdig/Document.cc: Changed tm from pointer to real structure * htlib/.sniffdir/ofiles.incl, htlib/timegm.cc: Our own timegm function * rx-1.5/rx/.cvsignore, rx-1.5/rx/Attic/Makefile: cvs cleanup * htmerge/docs.cc: Fixed memory leak * htlib/lib.h: Added own replacement of timegm() * htlib/Dictionary.cc: Fixed memory leaks * htlib/Connection.cc: Fix by Pontus Borg for AIX. Changed 'size_t' to 'unsigned long' for the length parameter for getpeername() * htfuzzy/Metaphone.cc: formatting changes * htdig/Retriever.cc: fixed memory leak * htdig/Document.cc: * Alarm was not cancelled if readHeader returned anything but OK * Use our own timegm() replacement if necessary * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: format changes * htcommon/DocumentDB.h: reformatting * htcommon/DocumentDB.cc: Fixed major memory leak * include/.cvsignore, include/Attic/htconfig.h, rx-1.5/.cvsignore, rx-1.5/Attic/config.cache, rx-1.5/Attic/config.status, rx-1.5/rx/.cvsignore, rx-1.5/rx/Attic/config.status, htlib/Attic/htlib.proj, htmerge/.cvsignore, htmerge/Attic/htmerge.proj, htnotify/.cvsignore, htnotify/Attic/htnotify.proj, htsearch/.cvsignore, htsearch/Attic/htsearch.proj, Attic/config.cache, htcommon/Attic/htcommon.proj, htfuzzy/.cvsignore, htfuzzy/Attic/htfuzzy.proj, lookfor: General cleanup of archived stuff * .cvsignore: config.cache added * htdig/.cvsignore: Added htdig Tue Dec 16 15:57:22 1997 turtle <turtle@kiwi> * htdig/Document.cc: Added little patch by Tobias Oetiker <oetiker@ee.ethz.ch> that should fix problems with timeouts. Thu Dec 11 00:28:59 1997 turtle <turtle@kiwi> * htlib/URL.h, htlib/URL.cc: Added double slash removal code. These were causing loops. Thu Oct 23 18:01:10 1997 turtle <turtle@kiwi> * htlib/Connection.cc: Fix by Pontus Borg for AIX. Changed 'size_t' to 'unsigned long' for the length parameter for getpeername() Mon Oct 13 02:13:52 1997 turtle <turtle@kiwi> * htdig/Attic/Makefile, htdig/Attic/htdig.proj: remove files that shouldn't be in the repository * htdig/.cvsignore: Ignore Makefile * htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/attrs.html, htdoc/ChangeLog: Added documentation for the external_parsers attribute. Mon Jul 14 15:32:22 1997 turtle <turtle@kiwi> * htdoc/uses.html: added cambridge Wed Jul 9 15:57:30 1997 turtle <turtle@kiwi> * htdoc/uses.html: added the rhodos project Mon Jul 7 22:15:45 1997 turtle <turtle@kiwi> * htdig/Document.cc: Removed old getdate() code that replaced '-' with ' '. * htlib/URL.cc: Sequences of "/./" are now replaced with "/" to reduce the chance of infinite loops * htdig/Document.cc: Added better date parsing. Now also supports the old RFC 850 format Thu Jul 3 17:44:39 1997 turtle <turtle@kiwi> * htdoc/cf_byname.html, htdoc/cf_byprog.html, htcommon/defaults.cc, htdig/htdig.h, htdoc/attrs.html, htlib/Configuration.h, htlib/URL.cc, htdig/Attic/Makefile, htdig/Document.cc: Added support for virtual hosts Mon Jun 30 17:07:49 1997 turtle <turtle@kiwi> * htdoc/uses.html: Added Depaul university Tue Jun 24 14:59:45 1997 turtle <turtle@kiwi> * Makefile.in: Fixed syntax error in the installation target. Mon Jun 23 17:33:14 1997 turtle <turtle@kiwi> * htdig/Attic/teamball.conf, htdig/Attic/tsdsu.conf, htdig/Attic/rohan.conf, htdig/Attic/sdsu.conf, htdig/Attic/t.conf, htdig/Attic/nsdsu.conf, htdig/Attic/daztec.conf, htdig/Attic/max.conf, htdig/htdig.conf, htdig/Attic/Makefile, htdig/Attic/catalog.conf: Removed old config files * htdoc/FAQ.html: FAQ initial * htdoc/contents.html: Added link to the new FAQ * htdoc/FAQ.html: *** empty log message *** * htnotify/htnotify.cc: Added version info to the usage output * htfuzzy/htfuzzy.cc: Added version info the usage output * htmerge/htmerge.cc: Added version info to usage message * htdig/main.cc: Added version info to the usage message Mon Jun 16 15:35:56 1997 turtle <turtle@kiwi> * installdir/footer.html: Changed the hardcoded version number to the new VERSION variable * htdoc/hts_templates.html: Added docs for the VERSION and PERCENT variables * htsearch/Display.cc: Added PERCENT and VERSION variables for the output templates Sat Jun 14 18:52:42 1997 turtle <turtle@kiwi> * htdig/Document.cc: Made redirect detection code more general Fri Jun 13 05:31:17 1997 turtle <turtle@kiwi> * htdoc/cf_general.html: Fixed typo Thu Jun 5 15:00:53 1997 turtle <turtle@kiwi> * htdoc/uses.html: added VG Gas Analysis Systems Tue Jun 3 17:49:05 1997 turtle <turtle@kiwi> * installdir/english.0.original, installdir/english.0: Added new english dictionary for the endings algorithm Thu May 29 14:56:40 1997 turtle <turtle@kiwi> * htdoc/uses.html: Added Indiana University Computer Security Office Wed May 28 14:47:25 1997 turtle <turtle@kiwi> * htdoc/main.html: Fixed typo Mon May 19 15:23:18 1997 turtle <turtle@kiwi> * htdoc/uses.html: Added daily californian online Tue May 13 19:28:32 1997 turtle <turtle@kiwi> * htdoc/uses.html: Added The Reohr Group * htdoc/uses.html: Added the Linux Documentation Project Sun May 11 17:52:05 1997 turtle <turtle@kiwi> * htdoc/index.html: Made the contents frame a little wider so that text doesn't wrap * htdoc/uses.html: Added NOVA and Gajo & Associati Fri May 2 23:35:56 1997 turtle <turtle@kiwi> * htdoc/uses.html: added www.bajan.org Wed Apr 30 22:28:28 1997 turtle <turtle@kiwi> * htdoc/uses.html: Added Caldera, Inc. Sun Apr 27 14:43:31 1997 turtle <turtle@kiwi> * htsearch/parser.cc, htsearch/parser.h, include/Attic/htconfig.h, htdoc/RELEASE.html, htdoc/uses.html, htdoc/where.html, htlib/URL.cc, htlib/strcasecmp.cc, htsearch/htsearch.cc, .version, README, htdig/Attic/Makefile, htdoc/ChangeLog: changes Mon Apr 21 15:44:39 1997 turtle <turtle@kiwi> * htsearch/htsearch.cc: Added code to check the search words against the minimum_word_length attribute Sun Apr 20 15:27:37 1997 turtle <turtle@kiwi> * CONFIG: Made paths more generic * htdig/Document.cc: Added include for ctype.h * htdig/Plaintext.cc: Fixed bug Tue Apr 1 17:56:57 1997 turtle <turtle@kiwi> * htdoc/uses.html: added ukc Sun Mar 30 01:18:16 1997 turtle <turtle@kiwi> * htdig/Attic/Makefile, htdoc/uses.html, Attic/Makefile.config, Attic/config.log, Attic/config.status, .cvsignore, Attic/Makefile, htsearch/Attic/Makefile, htsearch/.cvsignore, htnotify/Attic/Makefile, htnotify/.cvsignore, htmerge/.cvsignore, htmerge/Attic/Makefile, htlib/.cvsignore, htlib/Attic/Makefile, htfuzzy/.cvsignore, htfuzzy/Attic/Makefile, htcommon/.cvsignore, htcommon/Attic/Makefile: update Thu Mar 27 00:06:05 1997 turtle <turtle@kiwi> * htdig/Plaintext.cc: Applied patch supplied by Peter Enderborg <pme@ufh.se> to fix a problem with a pointer running off the end of a string. Mon Mar 24 04:33:26 1997 turtle <turtle@kiwi> * rx-1.5/rx/Attic/config.log, rx-1.5/rx/Attic/config.status, htsearch/htsearch.h, htsearch/parser.h, include/Attic/htconfig.h, rx-1.5/Attic/config.status, htsearch/Attic/Makefile, htsearch/ResultList.cc, htsearch/ResultMatch.h, htsearch/Template.h, htsearch/WeightWord.h, htlib/cgi.cc, htlib/htString.h, htlib/io.cc, htmerge/Attic/Makefile, htmerge/htmerge.h, htnotify/Attic/Makefile, htlib/StringList.cc, htlib/StringList.h, htlib/String_fmt.cc, htlib/URL.h, htlib/URLTrans.cc, htlib/Attic/SDSU.cc, htlib/Attic/String.h, htlib/ParsedString.h, htlib/String.cc, htfuzzy/htfuzzy.cc, htlib/Attic/Makefile, htlib/Configuration.cc, htlib/Connection.cc, htlib/Database.h, htdig/URLRef.h, htfuzzy/Attic/Makefile, htfuzzy/Exact.cc, htfuzzy/Fuzzy.h, htfuzzy/Substring.cc, htfuzzy/SuffixEntry.h, htdig/Plaintext.cc, htdig/Postscript.cc, htdig/SGMLEntities.cc, htdig/Server.cc, htdig/Server.h, htdig/Attic/Makefile, htdig/ExternalParser.cc, htdig/ExternalParser.h, htdig/Parsable.h, htcommon/Attic/Makefile, htcommon/DocumentRef.h, htcommon/WordList.cc, htcommon/WordList.h, htcommon/WordReference.h, htdig/Document.h, Attic/config.status, configure, configure.in, Attic/Makefile, Attic/Makefile.config, Attic/config.cache, Attic/config.log, Makefile.config.in: Renamed the String.h file to htString.h to help compiling under win32 * Makefile.in: Updated "make dist" to remove CVS stuff Fri Mar 14 17:15:32 1997 turtle <turtle@kiwi> * htcommon/defaults.cc: Changed default value for remove_bad_urls to true Thu Mar 13 18:37:50 1997 turtle <turtle@kiwi> * htnotify/htnotify.cc, Attic/Makefile.config, htdig/SGMLEntities.cc, htdoc/uses.html: Changes Thu Feb 27 00:52:52 1997 turtle <turtle@kiwi> * htdoc/uses.html: new uses Mon Feb 24 17:52:55 1997 turtle <turtle@kiwi> * htsearch/htsearch.cc, htnotify/Attic/Makefile, htsearch/Attic/Makefile, htlib/strcasecmp.cc, htmerge/Attic/Makefile, htlib/Attic/Makefile, htlib/String.cc, htlib/StringMatch.cc, htdig/SGMLEntities.cc, htfuzzy/Attic/Makefile, htdig/Attic/Makefile, htcommon/Attic/Makefile, htcommon/WordList.cc: Applied patches supplied by "Jan P. Sorensen" <japs@garm.adm.ku.dk> to make ht://Dig run on 8-bit text without the global unsigned-char option to gcc. Sun Feb 23 17:29:38 1997 turtle <turtle@kiwi> * htdoc/uses.html: *** empty log message *** Tue Feb 18 15:03:03 1997 turtle <turtle@kiwi> * htdoc/uses.html: New uses of ht://Dig Tue Feb 11 00:38:48 1997 turtle <turtle@kiwi> * htsearch/htsearch.cc: Renamed the very bad wordlist variable to badWords Mon Feb 10 17:32:47 1997 turtle <turtle@kiwi> * htlib/Connection.cc, htdig/Document.h, htdig/Document.cc, htcommon/DocumentRef.cc, htcommon/DocumentRef.h: Applied AIX specific patches supplied by Lars-Owe Ivarsson <lars-owe.ivarsson@its.uu.se> Fri Feb 7 18:04:13 1997 turtle <turtle@kiwi> * htlib/URL.cc: Fixed problem with anchors without a URL Mon Feb 3 17:37:59 1997 turtle <turtle@kiwi> * .version, README: updated stuff to 3.0.8 * Many files: Initial CVS Local Variables: add-log-time-format: current-time-string End: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/Makedefs.win32������������������������������������������������������������������������0100644�0063146�0012731�00000026001�07677125130�014775� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ---------------------------------------------------------------------------- # HtDig Win32 Makefile # # TODO: Fix up this file. There is lots of stuff in here that can be tossed. # ifeq ($(PRODUCT),htdig) #BUILD_VER = 3.2.2 #BUILD_NUM = b5 BUILD_VER = 3.2.0b5 endif #CMN_BUILD_VER = 3.2.0.0 #ifeq ($(RNT_PRODUCT),common) #BUILD_VER = $(CMN_BUILD_VER) #BUILD_NUM = 2 #endif #BUILD_CE_VER = 0 BUILD_DATE =`date "+%m/%d/%Y"` BUILD_TIME =`date "+%H:%M"` # ---------------------------------------------------------------------------- ifndef RNTBASE RNTBASE = .. endif # ---------------------------------------------------------------------------- # Need to set arch based upon host system ifdef WINDIR # Win32 (includes Win2000) --------------------------------- ARCH = win32 DLLSFX = .$(BUILD_VER).dll CDLLSFX = .$(CMN_BUILD_VER).dll EXESFX = .exe LIBSFX = .lib OBJSFX = .obj ROSFX = .xxx CC = cl CXX = cl EXELD = link DLLLD = link LD = lib CCDEBUG = -Yd -ZI -FD -D_DEBUG -Fd"./" LDDEBUG = -debug /pdbtype:sept YACC = bison -y LEX = flex CFLAGS = -nologo -W3 -DZLIB_DLL CXXFLAGS = -GX ifdef DEBUG CFLAGS += -MDd # The MDd is to link with the debug multithread dynamic library LDDEBUG += /NODEFAULTLIB:LIBCMD else ifdef RNM CFLAGS += -MT # The MT is to link with the multithread library else CFLAGS += -MD # The MD is to link with the multithread dynamic library endif endif AR = lib ARFLAGS = /nologo /out:$@ CCDLLFLAGS = -DCOMPILE_DL=1 LDFLAGS = -nologo /out:$@ LDLLFLAGS = -dll -machine:x86 -subsystem:windows LDROFLAGS = $(ARFLAGS) OTHERLIBS = ws2_32.lib advapi32.lib else # Unix ----------------------------------------------------- DLLSFX = .so CDLLSFX = .so EXESFX = LIBSFX = .a OBJSFX = .o ROSFX = .o SYS = $(shell uname -s) CC = gcc CXX = g++ EXELD = gcc DLLLD = gcc LD = ld CCDLLFLAGS = -DCOMPILE_DL=1 LDLLFLAGS = -Xlinker -h -Xlinker $(notdir $(TARGET)).$(BUILD_VER) LDROFLAGS = -r CCDEBUG = -g LDDEBUG = -g YACC = bison -y LEX = flex AR = ar ARFLAGS = rcs $@ COPY = cp -f RM = rm -f CCVERS = $(shell $(CC) -v 2>&1 | sed -e '/^R.*$$/d' -e 's/gcc version [a-zA-Z-]*\([0-9\.]*\).*$$/\1/) # begin platform dependent settings --------------------------- ifeq ($(SYS), Linux) ARCH = linux CCOPT = -O2 CCDLLFLAGS += -fPIC CDEFS += -DLINUX -DUNIX LDLLFLAGS += -shared OTHERLIBS += -lstdc++ -lm -ldl ifeq ($(findstring $(DLLSFX), $(TARGET)),) OTHERLIBS += -lpthread endif # newer versions have the resolver in libc ifeq ($(shell ls /usr/lib/libresolv.a > /dev/null 2>&1 && echo y), y) OTHERLIBS += -lresolv else OTHERLIBS += -lfl endif ifdef INSURE CC = insure gcc CXX = insure g++ EXELD = insure gcc DLLLD = insure gcc DEBUG = y endif BASIS_LIB_VERS = RH62-gcc-$(CCVERS) endif ifeq ($(SYS), SunOS) ARCH = sunos ifeq ($(shell uname -n), boulder) ifneq ($(TARGET), $(BINDIR)/olpp$(EXESFX)) ifeq ($(findstring $(DLLSFX), $(TARGET)),) PURIFY = purify -log-file=/home/httpd/cgi-bin/$(LOGNAME).cfg/purify -chain-length=14 -thread-report-at-exit=no -windows=no -fds-inuse-at-exit=no #PURIFY = quantify -record-system-calls=yes endif endif endif ifdef DEBUG EXELD = $(PURIFY) gcc endif CCOPT = -O2 CCDLLFLAGS += -fPIC CDEFS += -DSOLARIS -DUNIX LDLLFLAGS += -G OTHERLIBS = -lsocket -lnsl -lstdc++ -ldl ifeq ($(findstring $(DLLSFX), $(TARGET)),) OTHERLIBS += -lpthread endif # newer versions have the resolver in libc ifeq ($(shell ls /usr/lib/libresolv.*[oa] > /dev/null 2>&1 && echo y), y) OTHERLIBS += -lresolv -lm endif BASIS_LIB_VERS = sol-gcc-$(CCVERS) endif LDFLAGS = -o $@ endif # Unix # end of platform specific settings ------------------------------- ifneq ($(findstring $(DLLSFX),$(TARGET)),) CFLAGS += $(CCDLLFLAGS) LDFLAGS += $(LDLLFLAGS) endif ifneq ($(findstring $(ROSFX),$(TARGET)),) CFLAGS += $(CCDLLFLAGS) LDFLAGS += $(LDROFLAGS) ifeq ($(SYS), SunOS) LDDEBUG = endif endif # ---------------------------------------------------------------------------- ifeq ($(CC), gcc) CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations ifndef NOWERROR CFLAGS += -Werror endif endif # compile with ElectricFence malloc debugging library (man efence) ifdef EFENCE OTHERLIBS += -lefence DEBUG = 1 endif ifdef DEBUG CFLAGS += $(CCDEBUG) LDFLAGS += $(LDDEBUG) else CFLAGS += $(CCOPT) endif # ---------------------------------------------------------------------------- # Set appropriate database defines ifndef RNTDB ifdef WINDIR RNTDB = else RNTDB = mysql endif endif ifeq ($(RNTDB),mysql) # ---------------------------------------------- ifndef MYSQLLIB MYSQLLIB = /home/mysql/current/lib endif ifndef MYSQLINC MYSQLINC = /home/mysql/current/include endif CDEFS += -DMY_SQL CPPFLAGS += -I$(MYSQLINC) LIBS = $(RNTLIBS) DBLIBS = $(MYSQLLIB)/libmysqlclient.a # DBLIBS = -L$(MYSQLLIB) -lmysqlclient endif ifeq ($(RNTDB),ib) # InterBase -------------------------------------- ifndef INTERBASE_LIB INTERBASE_LIB = /home/interbase/lib endif ifndef INTERBASE_INC INTERBASE_INC = /home/interbase/include endif CDEFS += -DINTERBASE CPPFLAGS += -I$(INTERBASE_INC) LIBS = $(RNTLIBS) DBLIBS = -L$(INTERBASE_LIB) -lgds -ldl -lcrypt endif ifeq ($(RNTDB),odbc) # ----------------------------------------------- CDEFS += -DODBC LIBS = $(RNTLIBS) DBLIBS = odbc32.lib endif ifneq ($(findstring $(RNTDB),oci oracle),) # ------------------------- RNTDB = oci ifdef WINDIR ifndef ORACLE_HOME ORACLE_HOME = l:/oracle/win32ora816 endif # LDFLAGS += /LIBPATH:/rnt/oraclent/lib DBLIBS = $(ORACLE_HOME)/lib/oci.lib CPPFLAGS += -I $(ORACLE_HOME)/include else ifndef ORACLE_HOME ORACLE_HOME = /home/oracle endif LDFLAGS += -L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib \ -L$(ORACLE_HOME)/network/lib CPPFLAGS += -I$(ORACLE_HOME)/rdbms/demo \ -I$(ORACLE_HOME)/rdbms/public \ -I$(ORACLE_HOME)/plsql/public \ -I$(ORACLE_HOME)/network/public endif ifeq ($(ARCH),sunos) DBLIBS = -lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh endif # 8.1.5 ifeq ($(shell ls $(ORACLE_HOME)/lib/libsql8.a > /dev/null 2>&1 && echo y), y) DBLIBS = -lclntsh endif ifndef DBLIBS DBLIBS = -lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh endif CDEFS += -DORACLE LIBS = $(RNTLIBS) endif # ---------------------------------------------------------------------------- # PHP specific ifdef WINDIR ifndef PHP_INCLUDE PHP_INCLUDE = L:/win32/include/php-4.1.2 endif ifndef PHP_LIBPATH PHP_LIBPATH = L:/win32/lib endif PHP_LIB = $(PHP_LIBPATH)/php-4.1.2ts.lib else # Unix ifndef PHP_INCLUDE PHP_INCLUDE = $(NFSDIR)/$(ARCH)/include/php-4.1.2 endif endif # ---------------------------------------------------------------------------- # check whether we are building for a hosted environment or not. ifdef HOSTED CDEFS += -DHOSTED endif # ---------------------------------------------------------------------------- # check whether we are building for a Metrics environment or not. ifdef RNM CDEFS += -DRNM endif # --------------------------------------------------------------------------- # check whether we are building for production environment or not. ifdef PRODUCT CDEFS += -DPRODUCT endif # ---------------------------------------------------------------------------- # compile eval version BUILDTARGET = $(ARCH) ifdef EVAL CDEFS += -DEVAL BUILDTARGET = $(ARCH)_$(RNTDB)_eval endif # ---------------------------------------------------------------------------- ifdef WINDIR ROOTDIR = $(RNTBASE) else ROOTDIR = $(shell cd $(RNTBASE); pwd) endif BINDIR = $(ROOTDIR)/bin/$(BUILDTARGET) LIBDIR = $(ROOTDIR)/lib/$(BUILDTARGET) OBJDIR = $(BUILDTARGET) DEPDIR := makefiles/$(BUILDTARGET) CXREFDIR = $(RNTBASE)/cxrefs ifndef WINDIR export LD_LIBRARY_PATH = $(LIBDIR) endif .PRECIOUS: $(DEPDIR)/.CREATED %/.CREATED: @echo Creating directory $(@D)... @mkdir -p $(@D) @touch $@ OBJDIRDEP = $(OBJDIR)/.CREATED BINDIRDEP = $(BINDIR)/.CREATED LIBDIRDEP = $(LIBDIR)/.CREATED DEPDIRDEP = $(DEPDIR)/.CREATED CXREFDIRDEP = $(CXREFDIR)/.CREATED # ---------------------------------------------------------------------------- OBJS = $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c,%$(OBJSFX), $(SRC)) \ $(patsubst %.cc,%$(OBJSFX), $(CXXSRC)) \ $(patsubst %.yxx,%$(OBJSFX), $(YXXSRC)) \ $(patsubst %.lxx,%$(OBJSFX), $(LXXSRC)) \ $(patsubst %.y,%$(OBJSFX), $(YSRC)) \ $(patsubst %.l,%$(OBJSFX), $(LSRC)))) DEPLIBS = $(addprefix $(LIBDIR)/lib, $(addsuffix $(LIBSFX), $(LIBS)) \ $(addsuffix $(DLLSFX), $(RNWDLLS)) \ $(addsuffix $(CDLLSFX), $(CMNDLLS))) ifeq ($(findstring $(DLLSFX), $(TARGET)),) LDLIBS = $(OBJDIR)/cmdline$(OBJSFX) endif ifdef WINDIR LDLIBS += /LIBPATH:$(LIBDIR) $(subst dll,lib,$(addprefix lib, $(addsuffix $(LIBSFX), $(LIBS)) $(addsuffix $(CDLLSFX), $(CMNDLLS)) $(addsuffix $(DLLSFX), $(RNWDLLS)))) else LDLIBS += -L$(LIBDIR) $(addprefix -l, $(LIBS)) $(addprefix -l, $(RNWDLLS) $(CMNDLLS)) endif # ---------------------------------------------------------------------------- ifndef BASIS_INSTALL ifdef WINDIR BASIS_INSTALL=L:/win32/basis/version_4 else BASIS_INSTALL=/nfs/local/$(ARCH)/basis/version_4 endif endif #ROSETTE_VER = 3.0.7 ROSETTE_LIBS = -L $(BASIS_INSTALL)/rosette/lib/$(BASIS_LIB_VERS) -lbtunicode # CPPFLAGS += -I$(BASIS_INSTALL)/rosette/include \ # -I$(BASIS_INSTALL)/euclid/include #ifdef WINDIR # LDLIBS += $(BASIS_INSTALL)/jma/lib/w32-msvc-60/btjma.lib # LDLIBS += $(BASIS_INSTALL)/xma/lib/w32-msvc-60/btxma.lib # LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/bttrie.lib # LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/btutilities.lib # LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/btopts.lib # LDLIBS += $(BASIS_INSTALL)/euclid/bin/w32-msvc-60/bteuclid.lib # LDLIBS += $(BASIS_INSTALL)/rosette/bin/w32-msvc-60/btuc.lib #else # LDFLAGS += -L$(BASIS_INSTALL)/rosette/lib \ # -L$(BASIS_INSTALL)/euclid/lib # LDLIBS += -lbtunicode -lpthread -ldl #endif CFLAGS += -I../include -DDBUG_OFF -D_WIN32 -DWIN32 -D__WIN32__ # ZLIB CFLAGS += -IL:/win32/include/zlib #HtDig default defines CFLAGS += -DDEFAULT_CONFIG_FILE=\"c:\htdig\demo.conf\" -DCOMMON_DIR=\"c:\htdig\demo.db\templates\" -DBIN_DIR=\"c:\htdig\demo.db\bin\" -DCONFIG_DIR=\"c:\htdig\" -DIMAGE_URL_PREFIX=\"/rnt/rnm/img\" -DDATABASE_DIR=\"c:\htdig\demo.db\" ifdef TARGET all: $(TARGET) endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/Makefile.am���������������������������������������������������������������������������0100644�0063146�0012731�00000001752�10055635536�014434� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Main Makefile for ht://Dig # Copyright (c) 1995-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # <http://www.gnu.org/copyleft/lgpl.html> include $(top_srcdir)/Makefile.config if TESTS TESTDIR = test endif SUBDIRS = db htlib htword htcommon htnet htfuzzy htdb htdig htsearch httools installdir include htdoc $(TESTDIR) EXTRA_DIST = .version Makefile.config ChangeLog.0 contrib dist-hook: find $(distdir) -depth -name CVS -print | xargs rm -fr # # If --enable-tests is not specified, should remove # the test/Makefile anyway # distclean-local: if test "X$(TESTDIR)" = "Xtest" ; \ then \ rm -f test/Makefile test/test_functions ; \ fi install-data-hook: @echo "" @echo "Installation done." @echo "" @echo "Before you can start searching, you will need to create a" @echo "search database. A sample script to do this has been" @echo "installed as " $(DESTDIR)$(bindir)/rundig ����������������������htdig-3.2.0b6/Makefile.config�����������������������������������������������������������������������0100644�0063146�0012731�00000001725�10055635536�015304� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������## ## This file is part of ht://Dig ## ## Copyright (c) 1995-2004 The ht://Dig Group ## For copyright details, see the file COPYING in your distribution ## or the GNU Library General Public License version 2 or later ## <http://www.gnu.org/copyleft/lgpl.html> # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES= -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS= $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la �������������������������������������������htdig-3.2.0b6/Makefile.in���������������������������������������������������������������������������0100644�0063146�0012731�00000046353�10063260372�014442� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # Main Makefile for ht://Dig # Copyright (c) 1995-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # <http://www.gnu.org/copyleft/lgpl.html> # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la @TESTS_TRUE@TESTDIR = test SUBDIRS = db htlib htword htcommon htnet htfuzzy htdb htdig htsearch httools installdir include htdoc $(TESTDIR) EXTRA_DIST = .version Makefile.config ChangeLog.0 contrib subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure \ $(top_srcdir)/Makefile.config COPYING ChangeLog Makefile.am \ acinclude.m4 aclocal.m4 config.guess config.sub configure \ configure.in install-sh ltmain.sh missing mkinstalldirs DIST_SUBDIRS = db htlib htword htcommon htnet htfuzzy htdb htdig \ htsearch httools installdir include htdoc test all: all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # 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. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/htdoc $(distdir)/installdir $(distdir)/test @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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 $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(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 ../.. && $(mkinstalldirs) "$$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-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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 clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-local distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-info: install-info-recursive install-man: 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 mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-generic clean-libtool clean-recursive ctags \ ctags-recursive dist dist-all dist-gzip distcheck distclean \ distclean-generic distclean-libtool distclean-local \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive dist-hook: find $(distdir) -depth -name CVS -print | xargs rm -fr # # If --enable-tests is not specified, should remove # the test/Makefile anyway # distclean-local: if test "X$(TESTDIR)" = "Xtest" ; \ then \ rm -f test/Makefile test/test_functions ; \ fi install-data-hook: @echo "" @echo "Installation done." @echo "" @echo "Before you can start searching, you will need to create a" @echo "search database. A sample script to do this has been" @echo "installed as " $(DESTDIR)$(bindir)/rundig # 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/Makefile.win32������������������������������������������������������������������������0100644�0063146�0012731�00000002141�07675642172�015002� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Makefile - makefile for Win32 Native HtDig # # TODO: Clean up remove references to RNT & OLPP # RNTBASE = . LIBDIRS = db htlib htcommon htnet htword htfuzzy EXEDIRS = htdig htsearch httools MAKE += -f Makefile.win32 all: $(addsuffix .build, $(OLPPDIR) $(LIBDIRS) $(EXEDIRS) $(MODDIRS)) %.build: $(MAKE) -C $* clean: $(addsuffix .clean, $(OLPPDIR) $(LIBDIRS) $(EXEDIRS) $(MODDIRS)) $(RM) -r bin/$(BUILDTARGET) $(RM) -r lib/$(BUILDTARGET) %.clean: $(MAKE) -C $* clean ctags: -rm -f tags -(find `abspath $(LIBDIRS) $(EXEDIRS) $(INCLDIRS)` -name '*.[chly]' -o -name '*.cpp' | grep -v ' ' | xargs $@ -a; sort -o tags tags) etags: -rm -f TAGS -(find ../ -name "*.[ch]" | xargs $@ -a) -(find ../ -name "*.cpp" | xargs $@ -a) -(find ../ -name "*.php" | xargs $@ -a) -(find ../ -name "*.phph" | xargs $@ -a) cxref: $(CXREFDIRDEP) $(addsuffix .cxref, $(EXEDIRS) $(LIBDIRS)) @echo Indexing @(cxref -index-all -O$(CXREFDIR) -Nrnw -html) %.cxref: $(MAKE) -C $* cxref lint: $(addsuffix .lint, $(LIBDIRS) $(EXEDIRS)) %.lint: $(MAKE) -C $* lint depend: -(find $(RNTBASE) -name "*.d" -exec rm {} \;) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/Makerules.win32�����������������������������������������������������������������������0100644�0063146�0012731�00000006722�07675642172�015226� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ---------------------------------------------------------------------------- # Rules to create object ifdef HOSTED VER_DEFS = -DBUILD_VER=\"$(BUILD_VER)\" -DBUILD_NUM=\"$(BUILD_NUM)h\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DBUILD_TIME=\"$(BUILD_TIME)\" else VER_DEFS = -DBUILD_VER=\"$(BUILD_VER)\" -DBUILD_NUM=\"$(BUILD_NUM)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DBUILD_TIME=\"$(BUILD_TIME)\" endif ifneq ($(BUILD_CE_VER), 0) VER_DEFS += -DBUILD_CE_VER=\"$(BUILD_CE_VER)\" endif # New (non-beta) version of cygwin requires extra quotes (like unix) # New version of cygwin is 2.04 so check bash -version ifneq (,$(findstring 2.04,$(shell bash -version))) VER_DEFS += -DAPP_NAME="\"$(APP_NAME)\"" ifdef EXTRA_INFO VER_DEFS += -DEXTRA_INFO="\"$(EXTRA_INFO)\"" endif else VER_DEFS += -DAPP_NAME=\"$(APP_NAME)\" ifdef EXTRA_INFO VER_DEFS += -DEXTRA_INFO=\"$(EXTRA_INFO)\" endif endif VER_BUILD_CMD = $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) $(VER_DEFS) -c $(RNTBASE)/common/libutil/cmdline.c -Fo$(OBJDIR)/cmdline$(OBJSFX) CXX_BUILD_CMD = $(strip $(CXX) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) $(CDEFS) -Fo$(OBJDIR)/$(@F) -c /Tp $<) SAFE_CXX_BUILD_CMD = $(strip $(CXX) $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) $(CDEFS) -Fo$(OBJDIR)/$(@F) -c $<) $(OBJDIR)/%$(OBJSFX): %.cc $(CXX_BUILD_CMD) C_BUILD_CMD = $(strip $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -Fo$(OBJDIR)/$(@F) -c $<) SAFE_C_BUILD_CMD = $(strip $(CC) $(CPPFLAGS) $(CFLAGS) $(CDEFS) -Fo$(OBJDIR)/$(@F) -c $<) $(OBJDIR)/%$(OBJSFX): %.c $(C_BUILD_CMD) # echo $< NEAL $(OBJS) # echo $< NEAL $(DBSRC) .INTERMEDIATE: $(OBJDIR)/temp.cpp $(OBJDIR)/temp.c # ---------------------------------------------------------------------------- # Source processing rules # lint rule ---------------------------------------------------------- ifndef WINDIR lint: $(LINT) $(CPPFLAGS) $(CDEFS) +posixlib $(SRC) endif # Replace default lex rule to elimnate warnings caused by flex ------- ifdef WINDIR %.c: %.l $(LEX) -t $< | sed -e 's/register char \*yy_cp, \*yy_bp;/register char *yy_cp = NULL, *yy_bp = NULL;/' | sed -e 's/#include <unistd.h>//g' > $@ %.cc: %.lxx $(LEX) -t $< | sed -e 's/register char \*yy_cp, \*yy_bp;/register char *yy_cp = NULL, *yy_bp = NULL;/'| sed -e 's/#include <unistd.h>//g' > $@ else %.c: %.l $(LEX) -t $< | sed -e 's/register char \*yy_cp, \*yy_bp;/register char *yy_cp = NULL, *yy_bp = NULL;/' > $@ %.cc: %.lxx $(LEX) -t $< | sed -e 's/register char \*yy_cp, \*yy_bp;/register char *yy_cp = NULL, *yy_bp = NULL;/' > $@ endif %.cc: %.yxx $(YACC) -o $@ $< # ---------------------------------------------------------------------------- clean: - $(RM) -r $(OBJDIR) $(RM) $(TARGET) # ---------------------------------------------------------------------------- # cxref cxref: $(CXREFDIRDEP) $(addprefix $(CXREFDIR)/, $(addsuffix .html, $(SRC))) $(CXREFDIR)/%.c.html: %.c @echo Cross referencing $? cxref -xref -O$(CXREFDIR) -Nrnw $(CPPFLAGS) $(CDEFS) $? @echo Documenting $? cxref -warn-xref -xref -O$(CXREFDIR) -Nrnw -html $(CPPFLAGS) $(CDEFS) $? # ---------------------------------------------------------------------------- # Makefile dependencies depend: -(find . -name "*.d" -exec rm {} \;) ifndef WINDIR D_BUILD_CMD = @$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $(CDEFS) $< \ | sed -e "s!$*\\.o!$(BUILDTARGET)/& $@!g" > $@' $(DEPDIR)/%.d: %.c $(DEPDIRDEP) $(D_BUILD_CMD) ifndef RNT_INCLUDE ifdef SRC -include $(addprefix $(DEPDIR)/, $(notdir $(SRC:.c=.d) $(CXXSRC:.cpp=.d))) endif endif endif ����������������������������������������������htdig-3.2.0b6/README��������������������������������������������������������������������������������0100644�0063146�0012731�00000003074�10057404710�013245� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ht://Dig 3.2.0b6 README Copyright (c) 1995-2004 The ht://Dig Group Contributions from many, see htdoc/THANKS.html ht://Dig is distributed under the GNU Library General Public License (LGPL). See the COPYING file for license information. ht://Dig is a world-wide-web search system for an intranet or small internet. See the htdoc/install.html file for compilation and installation instructions. This distribution includes: * htdig - A www information gathering and indexing system * htfuzzy - A fuzzy search database creation program * htsearch - A search engine. * httools - An assortment of tools for operating on the databases * htlib - A small general purpose C++ class library * htnet - Net stuff classes * htword - word occurences list handling, aka inverted index * htcommon - ht://Dig specific classes * db - The latest Berkeley DB package from Sleepycat Software * htdoc - ht://Dig documentation in HTML ht://Dig has been tested extensively under Linux using gcc/g++ If you use g++, make absolutely sure you have libstdc++ installed as well. (libstdc++ has superceded the older libg++ package.) To build, first read the htdoc/install.html document Questions and discussion should be directed to the ht://Dig mailing list at htdig-general@lists.sourceforge.net Find subscription instructions at http://www.htdig.org/mailing.html Suggestions and bug reports can be made on our bug tracking database (see http://www.htdig.org/bugs.html) For the most up-to-date documentation, use http://www.htdig.org/ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/README.developer����������������������������������������������������������������������0100644�0063146�0012731�00000006463�10055635536�015250� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ht://Dig 3.2.0b4 README.developer Copyright (c) 2002-2004 The ht://Dig Group -- This README file is for newbie developers like myself. As I learn stuff, I'm putting it here. If anyone wants to write a better guide, please do! Lachlan lha@users.sourceforge.net -- I follow Lachlan's initiative, and post some new things here as well. :-) Gabriele angusgb@users.sourceforge.net AUTOMATICALLY GENERATED FILES ============================= Many files, such as attrs.html, are automatically generated from a "master" documents, such as defaults.cc. The procedure for generating these files is as follows. To generate From Use =========== ==== === htdoc/attrs.html, htcommon/defaults.cc, htdoc/cf_generate.pl htdoc/cf_byprog.html, htdoc/attrs_head.html, htdoc/cf_byname.html htdoc/attrs_tail.html, htdoc/cf_byprog_head.html htdoc/cf_byprog_tail.html htdoc/cf_byname_head.html htdoc/cf_byname_tail.html Many files are automatically overwritten by the configuration process from their "*.in" variants. These include: */Makefile db/db.h db/configure db/db_config.h db/stamp-h include/config.h include/stamp.h test/test_functions test/conf/access.conf test/conf/htdig.conf test/conf/htdig.conf2 test/conf/htdig.conf3 test/conf/httpd.conf test/conf/mime.types.in test/conf/srm.conf.in AUTO{CONF,MAKE} =============== First, I suggest you to give a look at the 'GNU autoconf, automake and libtool' book by Gary V. Vaughan, Ben Elliston, Tom Tromey and Ian Lance Taylor. It is freely downloadable from the net at http://sources.redhat.com/autobook/ - if you have a Debian Linux station, just type 'apt-get install autobook'. It is a great source of information. Don't change the Makefiles or configure directly. They are generated automatically by a 'bootstrapping application' from the Makefile.in and configure.in files. Although the book above suggest to use a specific bootstrapping script (see chapter 8 'Bootstrapping'), we just use the latest autoconf version. The Makefile.in files are in turn generated from Makefile.am and configure.in is manually modified (initial suggestion came from autoscan). The file called aclocal.m4 is generated by aclocal according to the macros that are present on the developer's machine and to the contents of the acinclude.m4 file: if you want to add some specific macros (you can get some from the 'autoconf archive' project by GNU) you have to do it here not in aclocal. According to configure.in and aclocal.m4, configure script is then generated, by autoconf. The dependencies seem to be: configure <-- configure.in | |- aclocal.m4 <-- *** acinclude.m4 (change this) *** Make changes to Makefile.am or acinclude.m4 and then type: autoreconf -if Current source files have been generated by using: autoconf 2.57, libtool 1.5.0a and automake 1.7.6 See <http://www.murrayc.com/learning/linux/automake/automake.shtml>. THINGS TO DO WHEN MAKING A CHANGE: ================================== - Add any new attributes to defaults.cc and run cf_generate.pl - Add any new dependencies to */Makefile.am and run aclocal etc., as above. - Add new tests in test/ to test the new functionality - Test by (at least!) "./configure --enable-tests" then "make check" - Write a Changelog entry. - Update STATUS if appropriate �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/STATUS��������������������������������������������������������������������������������0100644�0063146�0012731�00000004344�10042733773�013344� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������STATUS of ht://Dig branch 3-2-x RELEASES: 3.2.0b6: Scheduled: 31 May 2004. 3.2.0b5: Released: 10 Nov 2003. 3.2.0b4: Cancelled. 3.2.0b3: Released: 22 Feb 2001. 3.2.0b2: Released: 11 Apr 2000. 3.2.0b1: Released: 4 Feb 2000. (Please note that everything added here should have a tracker PR# so we can be sure they're fixed. Geoff is currently trying to add PR#s for what's currently here.) SHOWSTOPPERS: KNOWN BUGS: (none serious. See <http://sourceforge.net/tracker/?atid=104593&group_id=4593&func=browse>.) PENDING PATCHES (available but need work): * Gilles's configuration parsing patches need testing before committing. * Memory improvements to htmerge. (Backed out b/c htword API changed.) * Mifluz merge. (Is this still pending??) NEEDED FEATURES: * Quim's new htsearch/qtest query parser framework. * File/Database locking. PR#405764. TESTING: * httools programs: (htload a test file, check a few characteristics, htdump and compare) * Tests for new config file parser * Duplicate document detection while indexing * Major revisions to ExternalParser.cc, including fork/exec instead of popen, argument handling for parser/converter, allowing binary output from an external converter. * ExternalTransport needs testing of changes similar to ExternalParser. DOCUMENTATION: * List of supported platforms/compilers is ancient. (PR#405279) * Document all of htsearch's mappings of input parameters to config attributes to template variables. (Relates to PR#405278.) Should we make sure these config attributes are all documented in defaults.cc, even if they're only set by input parameters and never in the config file? * Split attrs.html into categories for faster loading. * Turn defaults.cc into an XML file for generating documentation and defaults.cc. * require.html is not updated to list new features and disk space requirements of 3.2.x (e.g. regex matching, database compression.) PRs# 405280 #405281. * Htfuzzy could use more documentation on what each fuzzy algorithm does. PR#405714. * Document the list of all installed files and default locations. PR#405715. OTHER ISSUES: * Can htsearch actually search while an index is being created? * The code needs a security audit, esp. htsearch. PR#405765. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/acinclude.m4��������������������������������������������������������������������������0100644�0063146�0012731�00000033425�10055635536�014573� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl dnl Part of the ht://Dig package <http://www.htdig.org/> dnl Copyright (c) 1999-2004 The ht://Dig Group dnl For copyright details, see the file COPYING in your distribution dnl or the GNU Library General Public License (LGPL) version 2 or later dnl <http://www.gnu.org/copyleft/lgpl.html> dnl dnl Local autoconf definitions. Try to follow the guidelines of the autoconf dnl macro repository so that integration in the repository is easy. dnl To submit a macro to the repository send the macro (one macro per mail) dnl to Peter Simons <simons@cys.de>. dnl The repository itself is at http://peti.cys.de/autoconf-archive/ dnl dnl @synopsis CHECK_USER() dnl dnl Defines the USER symbol from LOGNAME or USER environment variable, dnl depending on which one is filled. dnl dnl Usage example in Makefile.am: dnl dnl program $(USER) dnl dnl or in Makefile.in: dnl dnl program @USER@ dnl dnl @version $Id: acinclude.m4,v 1.19 2004/05/28 13:15:10 lha Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_USER, [AC_MSG_CHECKING(user name) test -n "$LOGNAME" && USER=$LOGNAME AC_SUBST(USER) AC_MSG_RESULT($USER) ]) dnl dnl Prevent accidental use of Run Time Type Information g++ builtin dnl functions. dnl AC_DEFUN(NO_RTTI, [AC_MSG_CHECKING(adding -fno-rtti to g++) if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-rtti" AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,,,CXXFLAGS="$CXXFLAGS_save") AC_LANG_RESTORE fi fi AC_MSG_RESULT(ok) ]) dnl dnl Prevent accidental use of Exceptions g++ builtin dnl functions. dnl AC_DEFUN(NO_EXCEPTIONS, [AC_MSG_CHECKING(adding -fno-exceptions to g++) if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,,,CXXFLAGS="$CXXFLAGS_save") AC_LANG_RESTORE fi fi AC_MSG_RESULT(ok) ]) dnl @synopsis AC_COMPILE_WARNINGS dnl dnl Set the maximum warning verbosity according to compiler used. dnl Currently supports g++ and gcc. dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in dnl configure.in dnl dnl @version $Id: acinclude.m4,v 1.19 2004/05/28 13:15:10 lha Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_COMPILE_WARNINGS, [AC_MSG_CHECKING(maximum warning verbosity option) if test -n "$CXX" then if test "$GXX" = "yes" then ac_compile_warnings_opt='-Wall' fi CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" fi ac_compile_warnings_opt= if test -n "$CC" then if test "$GCC" = "yes" then ac_compile_warnings_opt='-Wall' fi CFLAGS="$CFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" fi AC_MSG_RESULT($ac_compile_warnings_msg) unset ac_compile_warnings_msg unset ac_compile_warnings_opt ]) dnl @synopsis CHECK_ZLIB() dnl dnl This macro searches for an installed zlib library. If nothing dnl was specified when calling configure, it searches first in /usr/local dnl and then in /usr. If the --with-zlib=DIR is specified, it will try dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib dnl is specified, the library is not searched at all. dnl dnl If either the header file (zlib.h) or the library (libz) is not dnl found, the configuration exits on error, asking for a valid dnl zlib installation directory or --without-zlib. dnl dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should dnl use autoheader to include a definition for this symbol in a config.h dnl file. Sample usage in a C/C++ source is as follows: dnl dnl #ifdef HAVE_LIBZ dnl #include <zlib.h> dnl #endif /* HAVE_LIBZ */ dnl dnl @version $Id: acinclude.m4,v 1.19 2004/05/28 13:15:10 lha Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_ZLIB, # # Handle user hints # [AC_MSG_CHECKING(if zlib is wanted) AC_ARG_WITH(zlib, [ --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely], [if test "$withval" = no ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi], [ AC_MSG_RESULT(yes) ZLIB_HOME="default path" ]) # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then AC_LANG_SAVE AC_LANG_C AC_MSG_CHECKING(for zlib in $ZLIB_HOME) AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) dnl Only check for library if header is found. This check sets HAVE_LIBZ if test "$zlib_cv_zlib_h" = yes; then AC_DEFINE([HAVE_ZLIB_H],,[Define if Zlib is enabled]) AC_CHECK_LIB(z, inflateEnd) fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # AC_MSG_RESULT(failed) AC_MSG_ERROR(Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib.) fi AC_LANG_RESTORE fi ]) dnl @synopsis AC_PROG_APACHE([version]) dnl dnl This macro searches for an installed apache server. If nothing dnl was specified when calling configure or just --with-apache, it searches in dnl /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin dnl The argument of --with-apache specifies the full pathname of the dnl httpd argument. For instance --with-apache=/usr/sbin/httpd. dnl dnl If the version argument is given, AC_PROG_APACHE checks that the dnl apache server is this version number or higher. dnl dnl If the apache server is not found, abort configuration with error dnl message. dnl dnl It defines the symbol APACHE if the server is found. dnl dnl Files using apache should do the following: dnl dnl @APACHE@ -d /etc/httpd dnl dnl It defines the symbol APACHE_MODULES if a directory containing mod_env.* dnl is found in the default server root directory (obtained with httpd -V). dnl dnl The httpd.conf file listing modules to be loaded dynamicaly can use dnl @APACHE_MODULES@ to grab them in the appropriate sub directory. For dnl instance: dnl ... dnl <IfModule mod_so.c> dnl LoadModule env_module @APACHE_MODULES@/mod_env.so dnl LoadModule config_log_module @APACHE_MODULES@/mod_log_config.so dnl ... dnl dnl @version $Id: acinclude.m4,v 1.19 2004/05/28 13:15:10 lha Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_PROG_APACHE, # # Handle user hints # [ AC_MSG_CHECKING(if apache is wanted) AC_ARG_WITH(apache, [ --with-apache=PATH absolute path name of apache server (default is to search httpd in /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin), --without-apache to disable apache detection], [ # # Run this if -with or -without was specified # if test "$withval" != no ; then AC_MSG_RESULT(yes) APACHE_WANTED=yes if test "$withval" != yes ; then APACHE="$withval" fi else APACHE_WANTED=no AC_MSG_RESULT(no) fi ], [ # # Run this if nothing was said # APACHE_WANTED=yes AC_MSG_RESULT(yes) ]) # # Now we know if we want apache or not, only go further if # it's wanted. # if test "$APACHE_WANTED" = yes ; then # # If not specified by caller, search in standard places # if test -z "$APACHE" ; then AC_PATH_PROGS(APACHE, httpd apache, , /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/apache/bin) fi AC_SUBST(APACHE) if test -z "$APACHE" ; then AC_MSG_ERROR("apache server executable not found"); fi # # Collect apache version number. If for nothing else, this # guaranties that httpd is a working apache executable. # (Want at least 3 chars in version, to skip "(Mandrake Linux/4mdk)") # changequote(<<, >>)dnl APACHE_READABLE_VERSION=`$APACHE -v | grep 'Server version' | sed -e 's;.*/\([0-9\.][0-9\.][0-9\.][0-9\.]*\).*;\1;'` changequote([, ])dnl APACHE_VERSION=`echo $APACHE_READABLE_VERSION | sed -e 's/\.//g'` if test -z "$APACHE_VERSION" ; then AC_MSG_ERROR("could not determine apache version number"); fi APACHE_MAJOR=`expr $APACHE_VERSION : '\(..\)'` APACHE_MINOR=`expr $APACHE_VERSION : '..\(.*\)'` # # Check that apache version matches requested version or above # if test -n "$1" ; then AC_MSG_CHECKING(apache version >= $1) APACHE_REQUEST=`echo $1 | sed -e 's/\.//g'` APACHE_REQUEST_MAJOR=`expr $APACHE_REQUEST : '\(..\)'` APACHE_REQUEST_MINOR=`expr $APACHE_REQUEST : '..\(.*\)'` if test "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" -o "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" ; then AC_MSG_RESULT(no) AC_MSG_ERROR(apache version is $APACHE_READABLE_VERSION) else AC_MSG_RESULT(yes) fi fi # # Find out if .so modules are in libexec/module.so or modules/module.so # HTTP_ROOT=`$APACHE -V | grep HTTPD_ROOT | sed -e 's/.*"\(.*\)"/\1/'` AC_MSG_CHECKING(apache modules) for dir in libexec modules lib/apache libexec/httpd lib/apache/1.3 do if test -f $HTTP_ROOT/$dir/mod_env.* then APACHE_MODULES=$dir fi done if test -z "$APACHE_MODULES" then AC_MSG_RESULT(not found) else AC_MSG_RESULT(in $HTTP_ROOT/$APACHE_MODULES) fi AC_SUBST(APACHE_MODULES) fi ]) ## ----------------------------------------------- ## ## Check time prog path library and options. ## ## ----------------------------------------------- ## AC_DEFUN(AM_PROG_TIME, [ AC_PATH_PROG(TIME, time, time) # # Try various flags for verbose time information, # if none works TIMEV is the same as TIME # AC_MSG_CHECKING(verbose time flag) for timev in "$TIME -v" "$TIME -l" $TIME do if $timev echo >/dev/null 2>&1 then TIMEV=$timev break fi done AC_MSG_RESULT($TIMEV) AC_SUBST(TIMEV) ]) dnl @synopsis AC_FUNC_STRPTIME() dnl dnl This macro checks that the function strptime exists and that dnl it is declared in the time.h header. dnl dnl Here is an example of its use: dnl dnl strptime.c replacement: dnl dnl #ifndef HAVE_STRPTIME dnl .... dnl #endif /* HAVE_STRPTIME */ dnl dnl In sources using strptime dnl dnl #ifndef HAVE_STRPTIME_DECL dnl extern char *strptime(const char *__s, const char *__fmt, struct tm *__tp); dnl #endif /* HAVE_STRPTIME_DECL */ dnl dnl @author Loic Dachary <loic@senga.org> dnl @version 1.0 dnl AC_DEFUN(AC_FUNC_STRPTIME, [ AC_CHECK_FUNCS(strptime) AC_MSG_CHECKING(for strptime declaration in time.h) AC_EGREP_HEADER(strptime, time.h, [ AC_DEFINE([HAVE_STRPTIME_DECL],,[Define if the function strptime is declared in <time.h>]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) ]) ]) dnl @synopsis Checks if OpenSSL library is available. dnl dnl This macro will check various standard spots for OpenSSL including dnl a user-supplied directory. dnl The user uses '--with-ssl' or '--with-ssl=/path/to/ssl' as arguments dnl to configure. dnl dnl If OpenSSL is found the include directory gets added to CPPFLAGS and dnl '-lssl' & '-lcrypto' get added to LIBS, and dnl the libraries location gets added to LDFLAGS. dnl Finally 'HAVE_SSL' gets set to 'yes' for use in your Makefile.in dnl I use it like so (valid for gmake): dnl dnl HAVE_SSL = @HAVE_SSL@ dnl ifeq ($(HAVE_SSL),yes) dnl SRCS+= @srcdir@/my_file_that_needs_ssl.c dnl endif dnl dnl For bsd 'bmake' use: dnl dnl .if ${HAVE_SSL} == "yes" dnl SRCS+= @srcdir@/my_file_that_needs_ssl.c dnl .endif dnl dnl @version $Id: acinclude.m4,v 1.19 2004/05/28 13:15:10 lha Exp $ dnl @author Mark Ethan Trostler <trostler@juniper.net> dnl AC_DEFUN([CHECK_SSL], [AC_MSG_CHECKING(if ssl is wanted) AC_ARG_WITH(ssl, [AC_HELP_STRING([--with-ssl=DIR], [ enable ssl @<:@ default paths, then /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg @:>@])], [ AC_MSG_RESULT(yes) if test "$withval" = "yes" ; then dnl Don't check the directory "yes"... withval="" AC_CHECK_HEADER(openssl/ssl.h, [ssldir="default paths"; found_ssl=yes]) fi if test "$found_ssl" = "" ;then for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg ; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl=yes; CPPFLAGS="$CPPFLAGS -I$ssldir/include"; LDFLAGS="$LDFLAGS -L$ssldir/lib"; break; fi done fi if test x_$found_ssl != x_yes; then AC_MSG_ERROR(Cannot find ssl libraries) else printf "OpenSSL found in $ssldir\n"; LIBS="$LIBS -lssl -lcrypto"; HAVE_SSL=yes fi AC_SUBST(HAVE_SSL) AC_DEFINE([HAVE_SSL_H],, [Define if SSL is enabled]) ], [ AC_MSG_RESULT(no) ]) ]) dnl If the compiler supports ISO C++ standard library (i.e., can include the dnl files iostream, map, iomanip and cmath), define HAVE_STD. AC_DEFUN([AC_CXX_HAVE_STD], [AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library, ac_cv_cxx_have_std, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <iostream> #include <map> #include <iomanip> #include <cmath> #ifdef HAVE_NAMESPACES using namespace std; #endif],[return 0;], ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_std" = yes; then AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library]) fi ]) dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/aclocal.m4����������������������������������������������������������������������������0100644�0063146�0012731�00000764336�10057557625�014262� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.7.9 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. dnl dnl Part of the ht://Dig package <http://www.htdig.org/> dnl Copyright (c) 1999-2004 The ht://Dig Group dnl For copyright details, see the file COPYING in your distribution dnl or the GNU Library General Public License (LGPL) version 2 or later dnl <http://www.gnu.org/copyleft/lgpl.html> dnl dnl Local autoconf definitions. Try to follow the guidelines of the autoconf dnl macro repository so that integration in the repository is easy. dnl To submit a macro to the repository send the macro (one macro per mail) dnl to Peter Simons <simons@cys.de>. dnl The repository itself is at http://peti.cys.de/autoconf-archive/ dnl dnl @synopsis CHECK_USER() dnl dnl Defines the USER symbol from LOGNAME or USER environment variable, dnl depending on which one is filled. dnl dnl Usage example in Makefile.am: dnl dnl program $(USER) dnl dnl or in Makefile.in: dnl dnl program @USER@ dnl dnl @version $Id: aclocal.m4,v 1.39 2004/06/03 08:21:41 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_USER, [AC_MSG_CHECKING(user name) test -n "$LOGNAME" && USER=$LOGNAME AC_SUBST(USER) AC_MSG_RESULT($USER) ]) dnl dnl Prevent accidental use of Run Time Type Information g++ builtin dnl functions. dnl AC_DEFUN(NO_RTTI, [AC_MSG_CHECKING(adding -fno-rtti to g++) if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-rtti" AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,,,CXXFLAGS="$CXXFLAGS_save") AC_LANG_RESTORE fi fi AC_MSG_RESULT(ok) ]) dnl dnl Prevent accidental use of Exceptions g++ builtin dnl functions. dnl AC_DEFUN(NO_EXCEPTIONS, [AC_MSG_CHECKING(adding -fno-exceptions to g++) if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions" AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE(,,,CXXFLAGS="$CXXFLAGS_save") AC_LANG_RESTORE fi fi AC_MSG_RESULT(ok) ]) dnl @synopsis AC_COMPILE_WARNINGS dnl dnl Set the maximum warning verbosity according to compiler used. dnl Currently supports g++ and gcc. dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in dnl configure.in dnl dnl @version $Id: aclocal.m4,v 1.39 2004/06/03 08:21:41 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_COMPILE_WARNINGS, [AC_MSG_CHECKING(maximum warning verbosity option) if test -n "$CXX" then if test "$GXX" = "yes" then ac_compile_warnings_opt='-Wall' fi CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" fi ac_compile_warnings_opt= if test -n "$CC" then if test "$GCC" = "yes" then ac_compile_warnings_opt='-Wall' fi CFLAGS="$CFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" fi AC_MSG_RESULT($ac_compile_warnings_msg) unset ac_compile_warnings_msg unset ac_compile_warnings_opt ]) dnl @synopsis CHECK_ZLIB() dnl dnl This macro searches for an installed zlib library. If nothing dnl was specified when calling configure, it searches first in /usr/local dnl and then in /usr. If the --with-zlib=DIR is specified, it will try dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib dnl is specified, the library is not searched at all. dnl dnl If either the header file (zlib.h) or the library (libz) is not dnl found, the configuration exits on error, asking for a valid dnl zlib installation directory or --without-zlib. dnl dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should dnl use autoheader to include a definition for this symbol in a config.h dnl file. Sample usage in a C/C++ source is as follows: dnl dnl #ifdef HAVE_LIBZ dnl #include <zlib.h> dnl #endif /* HAVE_LIBZ */ dnl dnl @version $Id: aclocal.m4,v 1.39 2004/06/03 08:21:41 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_ZLIB, # # Handle user hints # [AC_MSG_CHECKING(if zlib is wanted) AC_ARG_WITH(zlib, [ --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely], [if test "$withval" = no ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi], [ AC_MSG_RESULT(yes) ZLIB_HOME="default path" ]) # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then AC_LANG_SAVE AC_LANG_C AC_MSG_CHECKING(for zlib in $ZLIB_HOME) AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) dnl Only check for library if header is found. This check sets HAVE_LIBZ if test "$zlib_cv_zlib_h" = yes; then AC_DEFINE([HAVE_ZLIB_H],,[Define if Zlib is enabled]) AC_CHECK_LIB(z, inflateEnd) fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # AC_MSG_RESULT(failed) AC_MSG_ERROR(Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib.) fi AC_LANG_RESTORE fi ]) dnl @synopsis AC_PROG_APACHE([version]) dnl dnl This macro searches for an installed apache server. If nothing dnl was specified when calling configure or just --with-apache, it searches in dnl /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin dnl The argument of --with-apache specifies the full pathname of the dnl httpd argument. For instance --with-apache=/usr/sbin/httpd. dnl dnl If the version argument is given, AC_PROG_APACHE checks that the dnl apache server is this version number or higher. dnl dnl If the apache server is not found, abort configuration with error dnl message. dnl dnl It defines the symbol APACHE if the server is found. dnl dnl Files using apache should do the following: dnl dnl @APACHE@ -d /etc/httpd dnl dnl It defines the symbol APACHE_MODULES if a directory containing mod_env.* dnl is found in the default server root directory (obtained with httpd -V). dnl dnl The httpd.conf file listing modules to be loaded dynamicaly can use dnl @APACHE_MODULES@ to grab them in the appropriate sub directory. For dnl instance: dnl ... dnl <IfModule mod_so.c> dnl LoadModule env_module @APACHE_MODULES@/mod_env.so dnl LoadModule config_log_module @APACHE_MODULES@/mod_log_config.so dnl ... dnl dnl @version $Id: aclocal.m4,v 1.39 2004/06/03 08:21:41 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_PROG_APACHE, # # Handle user hints # [ AC_MSG_CHECKING(if apache is wanted) AC_ARG_WITH(apache, [ --with-apache=PATH absolute path name of apache server (default is to search httpd in /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin), --without-apache to disable apache detection], [ # # Run this if -with or -without was specified # if test "$withval" != no ; then AC_MSG_RESULT(yes) APACHE_WANTED=yes if test "$withval" != yes ; then APACHE="$withval" fi else APACHE_WANTED=no AC_MSG_RESULT(no) fi ], [ # # Run this if nothing was said # APACHE_WANTED=yes AC_MSG_RESULT(yes) ]) # # Now we know if we want apache or not, only go further if # it's wanted. # if test "$APACHE_WANTED" = yes ; then # # If not specified by caller, search in standard places # if test -z "$APACHE" ; then AC_PATH_PROGS(APACHE, httpd apache, , /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/apache/bin) fi AC_SUBST(APACHE) if test -z "$APACHE" ; then AC_MSG_ERROR("apache server executable not found"); fi # # Collect apache version number. If for nothing else, this # guaranties that httpd is a working apache executable. # (Want at least 3 chars in version, to skip "(Mandrake Linux/4mdk)") # changequote(<<, >>)dnl APACHE_READABLE_VERSION=`$APACHE -v | grep 'Server version' | sed -e 's;.*/\([0-9\.][0-9\.][0-9\.][0-9\.]*\).*;\1;'` changequote([, ])dnl APACHE_VERSION=`echo $APACHE_READABLE_VERSION | sed -e 's/\.//g'` if test -z "$APACHE_VERSION" ; then AC_MSG_ERROR("could not determine apache version number"); fi APACHE_MAJOR=`expr $APACHE_VERSION : '\(..\)'` APACHE_MINOR=`expr $APACHE_VERSION : '..\(.*\)'` # # Check that apache version matches requested version or above # if test -n "$1" ; then AC_MSG_CHECKING(apache version >= $1) APACHE_REQUEST=`echo $1 | sed -e 's/\.//g'` APACHE_REQUEST_MAJOR=`expr $APACHE_REQUEST : '\(..\)'` APACHE_REQUEST_MINOR=`expr $APACHE_REQUEST : '..\(.*\)'` if test "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" -o "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" ; then AC_MSG_RESULT(no) AC_MSG_ERROR(apache version is $APACHE_READABLE_VERSION) else AC_MSG_RESULT(yes) fi fi # # Find out if .so modules are in libexec/module.so or modules/module.so # HTTP_ROOT=`$APACHE -V | grep HTTPD_ROOT | sed -e 's/.*"\(.*\)"/\1/'` AC_MSG_CHECKING(apache modules) for dir in libexec modules lib/apache libexec/httpd lib/apache/1.3 do if test -f $HTTP_ROOT/$dir/mod_env.* then APACHE_MODULES=$dir fi done if test -z "$APACHE_MODULES" then AC_MSG_RESULT(not found) else AC_MSG_RESULT(in $HTTP_ROOT/$APACHE_MODULES) fi AC_SUBST(APACHE_MODULES) fi ]) AC_DEFUN(AM_PROG_TIME, [ AC_PATH_PROG(TIME, time, time) # # Try various flags for verbose time information, # if none works TIMEV is the same as TIME # AC_MSG_CHECKING(verbose time flag) for timev in "$TIME -v" "$TIME -l" $TIME do if $timev echo >/dev/null 2>&1 then TIMEV=$timev break fi done AC_MSG_RESULT($TIMEV) AC_SUBST(TIMEV) ]) dnl @synopsis AC_FUNC_STRPTIME() dnl dnl This macro checks that the function strptime exists and that dnl it is declared in the time.h header. dnl dnl Here is an example of its use: dnl dnl strptime.c replacement: dnl dnl #ifndef HAVE_STRPTIME dnl .... dnl #endif /* HAVE_STRPTIME */ dnl dnl In sources using strptime dnl dnl #ifndef HAVE_STRPTIME_DECL dnl extern char *strptime(const char *__s, const char *__fmt, struct tm *__tp); dnl #endif /* HAVE_STRPTIME_DECL */ dnl dnl @author Loic Dachary <loic@senga.org> dnl @version 1.0 dnl AC_DEFUN(AC_FUNC_STRPTIME, [ AC_CHECK_FUNCS(strptime) AC_MSG_CHECKING(for strptime declaration in time.h) AC_EGREP_HEADER(strptime, time.h, [ AC_DEFINE([HAVE_STRPTIME_DECL],,[Define if the function strptime is declared in <time.h>]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) ]) ]) dnl @synopsis Checks if OpenSSL library is available. dnl dnl This macro will check various standard spots for OpenSSL including dnl a user-supplied directory. dnl The user uses '--with-ssl' or '--with-ssl=/path/to/ssl' as arguments dnl to configure. dnl dnl If OpenSSL is found the include directory gets added to CPPFLAGS and dnl '-lssl' & '-lcrypto' get added to LIBS, and dnl the libraries location gets added to LDFLAGS. dnl Finally 'HAVE_SSL' gets set to 'yes' for use in your Makefile.in dnl I use it like so (valid for gmake): dnl dnl HAVE_SSL = @HAVE_SSL@ dnl ifeq ($(HAVE_SSL),yes) dnl SRCS+= @srcdir@/my_file_that_needs_ssl.c dnl endif dnl dnl For bsd 'bmake' use: dnl dnl .if ${HAVE_SSL} == "yes" dnl SRCS+= @srcdir@/my_file_that_needs_ssl.c dnl .endif dnl dnl @version $Id: aclocal.m4,v 1.39 2004/06/03 08:21:41 angusgb Exp $ dnl @author Mark Ethan Trostler <trostler@juniper.net> dnl AC_DEFUN([CHECK_SSL], [AC_MSG_CHECKING(if ssl is wanted) AC_ARG_WITH(ssl, [AC_HELP_STRING([--with-ssl=DIR], [ enable ssl @<:@ default paths, then /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg @:>@])], [ AC_MSG_RESULT(yes) if test "$withval" = "yes" ; then dnl Don't check the directory "yes"... withval="" AC_CHECK_HEADER(openssl/ssl.h, [ssldir="default paths"; found_ssl=yes]) fi if test "$found_ssl" = "" ;then for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg ; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl=yes; CPPFLAGS="$CPPFLAGS -I$ssldir/include"; LDFLAGS="$LDFLAGS -L$ssldir/lib"; break; fi done fi if test x_$found_ssl != x_yes; then AC_MSG_ERROR(Cannot find ssl libraries) else printf "OpenSSL found in $ssldir\n"; LIBS="$LIBS -lssl -lcrypto"; HAVE_SSL=yes fi AC_SUBST(HAVE_SSL) AC_DEFINE([HAVE_SSL_H],, [Define if SSL is enabled]) ], [ AC_MSG_RESULT(no) ]) ]) dnl If the compiler supports ISO C++ standard library (i.e., can include the dnl files iostream, map, iomanip and cmath), define HAVE_STD. AC_DEFUN([AC_CXX_HAVE_STD], [AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library, ac_cv_cxx_have_std, [AC_REQUIRE([AC_CXX_NAMESPACES]) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([#include <iostream> #include <map> #include <iomanip> #include <cmath> #ifdef HAVE_NAMESPACES using namespace std; #endif],[return 0;], ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_have_std" = yes; then AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard library]) fi ]) dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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. # serial 10 AC_PREREQ([2.54]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # 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], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])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) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. 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([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # 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_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright 2002 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 # 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. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.7.9])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 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. # serial 2 # _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], [AC_FOREACH([_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])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 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. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file 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 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)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 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. # serial 3 # 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 supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 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. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 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. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 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. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # -*- Autoconf -*- # Copyright (C) 2003 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. # serial 1 # 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])]) # serial 5 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 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. # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$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'. 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 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 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. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _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. FIXME. This creates each `.P' file that we will # 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" ac_aux_dir="$ac_aux_dir"]) ]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 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. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 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. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) 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])]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 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. AC_PREREQ([2.52]) # serial 6 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001, 2002 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. # serial 2 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Copyright 1998, 1999, 2000, 2001, 2002 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. # serial 3 AC_PREREQ(2.50) # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # Debian $Rev: 203 $ # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF [$]* EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ])# AC_PROG_LD # AC_PROG_LD_GNU # -------------- AC_DEFUN([AC_PROG_LD_GNU], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$lt_cv_prog_gnu_ld ])# AC_PROG_LD_GNU # AC_PROG_LD_RELOAD_FLAG # ---------------------- # find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' ])# AC_PROG_LD_RELOAD_FLAG # AC_DEPLIBS_CHECK_METHOD # ----------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext <<EOF int a; void foo (void) { a = 0; } EOF ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; EOF ],[$1],[F77],[cat > conftest.$ac_ext <<EOF subroutine foo implicit none integer*4 a a=0 return end EOF ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF public class foo { private int a; public void bar (void) { a = 0; } }; EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then _LT_AC_TAGVAR(predep_objects, $1)="$p" else _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then _LT_AC_TAGVAR(postdep_objects, $1)="$p" else _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $rm -f confest.$objext case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # -------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat <<EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <<EOF >> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | knetbsd*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux*) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include <windows.h> # #undef WIN32_LEAN_AND_MEAN # #include <stdio.h> # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include <cygwin/cygwin_dll.h> # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/config.guess��������������������������������������������������������������������������0100755�0063146�0012731�00000125131�10057557626�014723� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner <per@bothner.com>. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pegasos:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <features.h> #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <features.h> #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> # include <sys/utsname.h> #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include <sys/param.h> # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from ftp://ftp.gnu.org/pub/gnu/config/ If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/config.sub����������������������������������������������������������������������������0100755�0063146�0012731�00000074670�10057557626�014401� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-12' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ������������������������������������������������������������������������htdig-3.2.0b6/configure�����������������������������������������������������������������������������0100755�0063146�0012731�00003417500�10063260373�014304� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 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 Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF $* EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="htdig/htdig.cc" ac_config_libobj_dir=htlib ac_default_prefix=/opt/www # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif #if STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # if HAVE_STDLIB_H # include <stdlib.h> # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #if HAVE_STRINGS_H # include <strings.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif #if HAVE_UNISTD_H # include <unistd.h> #endif" ac_subdirs_all="$ac_subdirs_all db" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS HTDIG_MAJOR_VERSION HTDIG_MINOR_VERSION HTDIG_MICRO_VERSION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CONFIG_DIR DEFAULT_CONFIG_FILE COMMON_DIR DATABASE_DIR CGIBIN_DIR SEARCH_DIR SEARCH_FORM IMAGE_DIR IMAGE_URL_PREFIX TESTS_TRUE TESTS_FALSE CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LEX LEXLIB LEX_OUTPUT_ROOT YACC LN_S build build_cpu build_vendor build_os host host_cpu host_vendor host_os ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SED PERL FIND GUNZIP RRDTOOL TAR MV SENDMAIL TIME TIMEV HAVE_SSL ALLOCA LIBOBJS extra_ldflags USER APACHE APACHE_MODULES subdirs LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -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 ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # 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 this package 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-tests do build a version with run-time tests. --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-bigfile enable Linux, AIX, HP/UX, Solaris big files. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-config-dir=DIR where your config directory is [PREFIX/conf] --with-default-config-file=FILE where the various programs will look for a configuration file [PREFIX/conf/htdig.conf] --with-common-dir=DIR where your .html templates are stored [PREFIX/share/htdig] --with-database-dir=DIR where your database directory is [PREFIX/var/htdig] --with-cgi-bin-dir=DIR where your web server cgi-bin directory is [PREFIX/cgi-bin] --with-search-dir=DIR where the sample search form should be installed [PREFIX/htdocs/htdig] --with-search-form=FILE the name for the sample search form [search.html] --with-image-dir=DIR where the ht://Dig images are installed [PREFIX/htdocs/htdig] --with-image-url-prefix=LOCATION the URL path to the installed images [/htdig] --with-rx with system rx instead of regex [no] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-ssl=DIR enable ssl [ default paths, then /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg ] --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely --with-apache=PATH absolute path name of apache server (default is to search httpd in /usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin), --without-apache to disable apache detection Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&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_sep= 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # ht://Dig's version # VERSION=`cat ${srcdir}/.version` HTDIG_MAJOR_VERSION=`expr $VERSION : '\([0-9][0-9]*\)'` HTDIG_MINOR_VERSION=`expr $VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\)'` HTDIG_MICRO_VERSION=`expr $VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'` am__api_version="1.7" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # 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=htdig VERSION=$VERSION 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_config_headers="$ac_config_headers include/config.h" # Initialize maintainer mode echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-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; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$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 # Check whether --with-config-dir or --without-config-dir was given. if test "${with_config_dir+set}" = set; then withval="$with_config_dir" CONFIG_DIR="$withval" else CONFIG_DIR='${prefix}/conf' fi; # In the below, the strings [ and ] expand to [ and ] # Check whether --with-default-config-file or --without-default-config-file was given. if test "${with_default_config_file+set}" = set; then withval="$with_default_config_file" DEFAULT_CONFIG_FILE="$withval" else DEFAULT_CONFIG_FILE='${CONFIG_DIR}/htdig.conf' fi; # Check whether --with-common-dir or --without-common-dir was given. if test "${with_common_dir+set}" = set; then withval="$with_common_dir" COMMON_DIR="$withval" else COMMON_DIR='${datadir}/htdig' fi; # Check whether --with-database-dir or --without-database-dir was given. if test "${with_database_dir+set}" = set; then withval="$with_database_dir" DATABASE_DIR="$withval" else DATABASE_DIR='${localstatedir}/htdig' fi; # Check whether --with-cgi-bin-dir or --without-cgi-bin-dir was given. if test "${with_cgi_bin_dir+set}" = set; then withval="$with_cgi_bin_dir" CGIBIN_DIR="$withval" else CGIBIN_DIR='${prefix}/cgi-bin' fi; # Check whether --with-search-dir or --without-search-dir was given. if test "${with_search_dir+set}" = set; then withval="$with_search_dir" SEARCH_DIR="$withval" else SEARCH_DIR='${prefix}/htdocs/htdig' fi; # Check whether --with-search-form or --without-search-form was given. if test "${with_search_form+set}" = set; then withval="$with_search_form" SEARCH_FORM="$withval" else SEARCH_FORM='search.html' fi; # Check whether --with-image-dir or --without-image-dir was given. if test "${with_image_dir+set}" = set; then withval="$with_image_dir" IMAGE_DIR="$withval" else IMAGE_DIR='${prefix}/htdocs/htdig' fi; # Check whether --with-image-url-prefix or --without-image-url-prefix was given. if test "${with_image_url_prefix+set}" = set; then withval="$with_image_url_prefix" IMAGE_URL_PREFIX="$withval" else IMAGE_URL_PREFIX='/htdig' fi; # Check whether --with-rx or --without-rx was given. if test "${with_rx+set}" = set; then withval="$with_rx" WITH_RX="$withval" else WITH_RX='no' fi; # If the user doesn't want tests # Check whether --enable-tests or --disable-tests was given. if test "${enable_tests+set}" = set; then enableval="$enable_tests" htdig_cv_tests="$enable_tests" else htdig_cv_tests="no" fi; if test x$htdig_cv_tests = xyes; then TESTS_TRUE= TESTS_FALSE='#' else TESTS_TRUE='#' TESTS_FALSE= fi # Checks for programs. ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h 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" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-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='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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'. 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_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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_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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* 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 -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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'. 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 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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 echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do 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 <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4926 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5795:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat <<EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <<EOF >> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6827: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6831: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7060: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7064: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7120: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7124: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" fi link_all_deplibs=no else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 9296 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 9394 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_CXX='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <<EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | knetbsd*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11571: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11575: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11631: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11635: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 12988 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 13086 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13913: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13917: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13973: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13977: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_F77="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_F77='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16006: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16010: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16239: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16243: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16299: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16303: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_GCJ="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_GCJ='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes else ld_shlibs_GCJ=no fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 18475 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 18573 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking maximum warning verbosity option" >&5 echo $ECHO_N "checking maximum warning verbosity option... $ECHO_C" >&6 if test -n "$CXX" then if test "$GXX" = "yes" then ac_compile_warnings_opt='-Wall' fi CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" fi ac_compile_warnings_opt= if test -n "$CC" then if test "$GCC" = "yes" then ac_compile_warnings_opt='-Wall' fi CFLAGS="$CFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" fi echo "$as_me:$LINENO: result: $ac_compile_warnings_msg" >&5 echo "${ECHO_T}$ac_compile_warnings_msg" >&6 unset ac_compile_warnings_msg unset ac_compile_warnings_opt echo "$as_me:$LINENO: checking adding -fno-rtti to g++" >&5 echo $ECHO_N "checking adding -fno-rtti to g++... $ECHO_C" >&6 if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-rtti" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="$CXXFLAGS_save" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 echo "$as_me:$LINENO: checking adding -fno-exceptions to g++" >&5 echo $ECHO_N "checking adding -fno-exceptions to g++... $ECHO_C" >&6 if test -n "$CXX" then if test "$GXX" = "yes" then CXXFLAGS_save="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -fno-exceptions" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="$CXXFLAGS_save" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi fi echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SHELL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SHELL in [\\/]* | ?:[\\/]*) ac_cv_path_SHELL="$SHELL" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SHELL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SHELL" && ac_cv_path_SHELL="/bin/sh" ;; esac fi SHELL=$ac_cv_path_SHELL if test -n "$SHELL"; then echo "$as_me:$LINENO: result: $SHELL" >&5 echo "${ECHO_T}$SHELL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SED" && ac_cv_path_SED="/bin/sed" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_FIND+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $FIND in [\\/]* | ?:[\\/]*) ac_cv_path_FIND="$FIND" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="/bin/find" ;; esac fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then echo "$as_me:$LINENO: result: $FIND" >&5 echo "${ECHO_T}$FIND" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gunzip", so it can be a program name with args. set dummy gunzip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GUNZIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GUNZIP in [\\/]* | ?:[\\/]*) ac_cv_path_GUNZIP="$GUNZIP" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GUNZIP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GUNZIP" && ac_cv_path_GUNZIP="/bin/gunzip" ;; esac fi GUNZIP=$ac_cv_path_GUNZIP if test -n "$GUNZIP"; then echo "$as_me:$LINENO: result: $GUNZIP" >&5 echo "${ECHO_T}$GUNZIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi for ac_prog in rrdtool do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RRDTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RRDTOOL"; then ac_cv_prog_RRDTOOL="$RRDTOOL" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RRDTOOL="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RRDTOOL=$ac_cv_prog_RRDTOOL if test -n "$RRDTOOL"; then echo "$as_me:$LINENO: result: $RRDTOOL" >&5 echo "${ECHO_T}$RRDTOOL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$RRDTOOL" && break done for ac_prog in tar gtar gnutar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_TAR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TAR"; then ac_cv_prog_TAR="$TAR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TAR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi TAR=$ac_cv_prog_TAR if test -n "$TAR"; then echo "$as_me:$LINENO: result: $TAR" >&5 echo "${ECHO_T}$TAR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$TAR" && break done test -n "$TAR" || TAR="tar" # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sendmail", so it can be a program name with args. set dummy sendmail; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SENDMAIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SENDMAIL in [\\/]* | ?:[\\/]*) ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/libexec:/usr/sbin:/usr/lib:/usr/etc:etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SENDMAIL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail" ;; esac fi SENDMAIL=$ac_cv_path_SENDMAIL if test -n "$SENDMAIL"; then echo "$as_me:$LINENO: result: $SENDMAIL" >&5 echo "${ECHO_T}$SENDMAIL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "time", so it can be a program name with args. set dummy time; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_TIME+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TIME in [\\/]* | ?:[\\/]*) ac_cv_path_TIME="$TIME" # Let the user override the test with a path. ;; *) 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_TIME" && ac_cv_path_TIME="time" ;; esac fi TIME=$ac_cv_path_TIME if test -n "$TIME"; then echo "$as_me:$LINENO: result: $TIME" >&5 echo "${ECHO_T}$TIME" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # # Try various flags for verbose time information, # if none works TIMEV is the same as TIME # echo "$as_me:$LINENO: checking verbose time flag" >&5 echo $ECHO_N "checking verbose time flag... $ECHO_C" >&6 for timev in "$TIME -v" "$TIME -l" $TIME do if $timev echo >/dev/null 2>&1 then TIMEV=$timev break fi done echo "$as_me:$LINENO: result: $TIMEV" >&5 echo "${ECHO_T}$TIMEV" >&6 # Checks for libraries. #AC_CHECK_LIB([z], [main]) echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi echo "$as_me:$LINENO: checking for t_accept in -lnsl" >&5 echo $ECHO_N "checking for t_accept in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_t_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char t_accept (); int main () { t_accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_t_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_accept" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_t_accept" >&6 if test $ac_cv_lib_nsl_t_accept = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi echo "$as_me:$LINENO: checking if ssl is wanted" >&5 echo $ECHO_N "checking if ssl is wanted... $ECHO_C" >&6 # Check whether --with-ssl or --without-ssl was given. if test "${with_ssl+set}" = set; then withval="$with_ssl" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 if test "$withval" = "yes" ; then withval="" if test "${ac_cv_header_openssl_ssl_h+set}" = set; then echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6 if test "${ac_cv_header_openssl_ssl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5 echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <openssl/ssl.h> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5 echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <openssl/ssl.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: openssl/ssl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5 echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6 if test "${ac_cv_header_openssl_ssl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_openssl_ssl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5 echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6 fi if test $ac_cv_header_openssl_ssl_h = yes; then ssldir="default paths"; found_ssl=yes fi fi if test "$found_ssl" = "" ;then for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg ; do ssldir="$dir" if test -f "$dir/include/openssl/ssl.h"; then found_ssl=yes; CPPFLAGS="$CPPFLAGS -I$ssldir/include"; LDFLAGS="$LDFLAGS -L$ssldir/lib"; break; fi done fi if test x_$found_ssl != x_yes; then { { echo "$as_me:$LINENO: error: Cannot find ssl libraries" >&5 echo "$as_me: error: Cannot find ssl libraries" >&2;} { (exit 1); exit 1; }; } else printf "OpenSSL found in $ssldir\n"; LIBS="$LIBS -lssl -lcrypto"; HAVE_SSL=yes fi cat >>confdefs.h <<\_ACEOF #define HAVE_SSL_H _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi; # # Handle user hints # echo "$as_me:$LINENO: checking if zlib is wanted" >&5 echo $ECHO_N "checking if zlib is wanted... $ECHO_C" >&6 # Check whether --with-zlib or --without-zlib was given. if test "${with_zlib+set}" = set; then withval="$with_zlib" if test "$withval" = no ; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 ZLIB_HOME="default path" fi; # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for zlib in $ZLIB_HOME" >&5 echo $ECHO_N "checking for zlib in $ZLIB_HOME... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <zlib.h> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <zlib.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 fi if test $ac_cv_header_zlib_h = yes; then zlib_cv_zlib_h=yes else zlib_cv_zlib_h=no fi if test "$zlib_cv_zlib_h" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_H _ACEOF echo "$as_me:$LINENO: checking for inflateEnd in -lz" >&5 echo $ECHO_N "checking for inflateEnd in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_inflateEnd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char inflateEnd (); int main () { inflateEnd (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_inflateEnd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateEnd=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateEnd" >&5 echo "${ECHO_T}$ac_cv_lib_z_inflateEnd" >&6 if test $ac_cv_lib_z_inflateEnd = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 { { echo "$as_me:$LINENO: error: Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib." >&5 echo "$as_me: error: Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi # Checks for header files. echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdbool.h> #ifndef bool # error bool is not defined #endif #ifndef false # error false is not defined #endif #if false # error false is not 0 #endif #ifndef true # error true is not defined #endif #if true != 1 # error true is not 1 #endif #ifndef __bool_true_false_are_defined # error __bool_true_false_are_defined is not defined #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; int main () { return !a + !b + !c + !d + !e + !f + !g + !h + !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((_Bool *) 0) return 0; if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/time.h> #include <time.h> int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <alloca.h> int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include <malloc.h> # define alloca _alloca # else # if HAVE_ALLOCA_H # include <alloca.h> # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/wait.h> #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(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 rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi for ac_header in arpa/inet.h fcntl.h float.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h wchar.h wctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done #AC_CHECK_HEADERS([zlib.h sys/wait.h wait.h alloca.h]) for ac_header in sys/wait.h wait.h alloca.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done #AC_CHECK_HEADERS(ssl.h) # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdbool.h> #ifndef bool # error bool is not defined #endif #ifndef false # error false is not defined #endif #if false # error false is not 0 #endif #ifndef true # error true is not defined #endif #if true != 1 # error true is not 1 #endif #ifndef __bool_true_false_are_defined # error __bool_true_false_are_defined is not defined #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; int main () { return !a + !b + !c + !d + !e + !f + !g + !h + !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((_Bool *) 0) return 0; if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 if test $ac_cv_member_struct_stat_st_blksize = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/time.h> #include <time.h> int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <time.h> int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for unsigned long long int" >&5 echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned long long int *) 0) return 0; if (sizeof (unsigned long long int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6 echo "$as_me:$LINENO: checking size of unsigned long long int" >&5 echo $ECHO_N "checking size of unsigned long long int... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_long_long_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long_long_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long long int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned long long int)); } unsigned long ulongval () { return (long) (sizeof (unsigned long long int)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned long long int))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned long long int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned long long int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long_long_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long long int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_long_long_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_LONG_INT $ac_cv_sizeof_unsigned_long_long_int _ACEOF echo "$as_me:$LINENO: checking for unsigned long int" >&5 echo $ECHO_N "checking for unsigned long int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned long int *) 0) return 0; if (sizeof (unsigned long int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_int" >&6 echo "$as_me:$LINENO: checking size of unsigned long int" >&5 echo $ECHO_N "checking size of unsigned long int... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_long_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned long int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned long int)); } unsigned long ulongval () { return (long) (sizeof (unsigned long int)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned long int))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned long int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned long int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_long_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned long int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_long_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_INT $ac_cv_sizeof_unsigned_long_int _ACEOF echo "$as_me:$LINENO: checking for unsigned int" >&5 echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned int *) 0) return 0; if (sizeof (unsigned int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 echo "$as_me:$LINENO: checking size of unsigned int" >&5 echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned int)); } unsigned long ulongval () { return (long) (sizeof (unsigned int)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned int))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF echo "$as_me:$LINENO: checking for unsigned short int" >&5 echo $ECHO_N "checking for unsigned short int... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_short_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned short int *) 0) return 0; if (sizeof (unsigned short int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_short_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_short_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short_int" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_short_int" >&6 echo "$as_me:$LINENO: checking size of unsigned short int" >&5 echo $ECHO_N "checking size of unsigned short int... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_short_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_short_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned short int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_short_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned short int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned short int)); } unsigned long ulongval () { return (long) (sizeof (unsigned short int)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned short int))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned short int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned short int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_short_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned short int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_short_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_short_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_SHORT_INT $ac_cv_sizeof_unsigned_short_int _ACEOF echo "$as_me:$LINENO: checking for unsigned char" >&5 echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6 if test "${ac_cv_type_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((unsigned char *) 0) return 0; if (sizeof (unsigned char)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_char=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_char=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6 echo "$as_me:$LINENO: checking size of unsigned char" >&5 echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6 if test "${ac_cv_sizeof_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_unsigned_char" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_char=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (unsigned char)); } unsigned long ulongval () { return (long) (sizeof (unsigned char)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (unsigned char))) < 0) { long i = longval (); if (i != ((long) (sizeof (unsigned char)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (unsigned char)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_char=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (unsigned char), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_unsigned_char=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char _ACEOF # Checks for library functions. echo "$as_me:$LINENO: checking whether closedir returns void" >&5 echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 if test "${ac_cv_func_closedir_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_closedir_void=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header_dirent> #ifndef __cplusplus int closedir (); #endif int main () { exit (closedir (opendir (".")) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_closedir_void=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_closedir_void=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 if test $ac_cv_func_closedir_void = yes; then cat >>confdefs.h <<\_ACEOF #define CLOSEDIR_VOID 1 _ACEOF fi #AC_FUNC_ERROR_AT_LINE #AC_FUNC_LSTAT #AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include <stdlib.h> #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6 if test "${ac_cv_func_mbrtowc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <wchar.h> int main () { mbstate_t state; return ! (sizeof state && mbrtowc); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mbrtowc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_mbrtowc=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_mbrtowc" >&5 echo "${ECHO_T}$ac_cv_func_mbrtowc" >&6 if test $ac_cv_func_mbrtowc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBRTOWC 1 _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (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) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include <fcntl.h> #include <sys/mman.h> #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include <sys/param.h> # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include <stdlib.h> #else char *realloc (); #endif int main () { exit (realloc (0, 0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_realloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF case $LIBOBJS in "realloc.$ac_objext" | \ *" realloc.$ac_objext" | \ "realloc.$ac_objext "* | \ *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi for ac_header in sys/select.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking types of arguments for select" >&5 echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #if HAVE_SYS_SELECT_H # include <sys/select.h> #endif #if HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 echo "${ECHO_T}$ac_cv_func_select_args" >&6 ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <signal.h> #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF #AC_FUNC_STAT for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strftime (); int main () { strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done for ac_func in strptime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for strptime declaration in time.h" >&5 echo $ECHO_N "checking for strptime declaration in time.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <time.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strptime" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRPTIME_DECL _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in alarm btowc bzero ftime getcwd gettimeofday localtime_r memcmp memcpy memmove memset mkstemp munmap pstat_getdynamic raise re_comp regcomp select setlocale strchr strcspn strdup strerror strrchr strstr strtol strtoul timegm do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in snprintf vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case $LIBOBJS in "$ac_func.$ac_objext" | \ *" $ac_func.$ac_objext" | \ "$ac_func.$ac_objext "* | \ *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done # More header checks--here use C++ ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 echo $ECHO_N "checking whether the compiler implements namespaces... $ECHO_C" >&6 if test "${ac_cv_cxx_namespaces+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ namespace Outer { namespace Inner { int i = 0; }} int main () { using namespace Outer::Inner; return i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_cxx_namespaces=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_cxx_namespaces=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 echo "${ECHO_T}$ac_cv_cxx_namespaces" >&6 if test "$ac_cv_cxx_namespaces" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NAMESPACES _ACEOF fi echo "$as_me:$LINENO: checking whether the compiler supports ISO C++ standard library" >&5 echo $ECHO_N "checking whether the compiler supports ISO C++ standard library... $ECHO_C" >&6 if test "${ac_cv_cxx_have_std+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <iostream> #include <map> #include <iomanip> #include <cmath> #ifdef HAVE_NAMESPACES using namespace std; #endif int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_cxx_have_std=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_cxx_have_std=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std" >&5 echo "${ECHO_T}$ac_cv_cxx_have_std" >&6 if test "$ac_cv_cxx_have_std" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STD _ACEOF fi echo "$as_me:$LINENO: checking whether we need gethostname() prototype?" >&5 echo $ECHO_N "checking whether we need gethostname() prototype?... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/ioctl.h> #include <sys/uio.h> #include <sys/file.h> #include <fcntl.h> #include <netdb.h> #include <stdlib.h> extern "C" int gethostname(char *, int); int main () { gethostname("sdsu.edu", (int) 8); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_PROTO_GETHOSTNAME _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # We're still using the C++ compiler for this test echo "$as_me:$LINENO: checking how to call getpeername?" >&5 echo $ECHO_N "checking how to call getpeername?... $ECHO_C" >&6 for sock_t in 'struct sockaddr' 'void'; do for getpeername_length_t in 'size_t' 'int' 'unsigned int' 'long unsigned int' 'socklen_t' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> extern "C" int getpeername(int, $sock_t *, $getpeername_length_t *); $sock_t s; $getpeername_length_t l; int main () { getpeername(0, &s, &l); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_found=yes ; break 2 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_found=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done if test "$ac_found" = no then { echo "$as_me:$LINENO: WARNING: can't determine, using size_t" >&5 echo "$as_me: WARNING: can't determine, using size_t" >&2;} getpeername_length_t="size_t" else echo "$as_me:$LINENO: result: $getpeername_length_t" >&5 echo "${ECHO_T}$getpeername_length_t" >&6 fi cat >>confdefs.h <<_ACEOF #define GETPEERNAME_LENGTH_T $getpeername_length_t _ACEOF echo "$as_me:$LINENO: checking how to call select?" >&5 echo $ECHO_N "checking how to call select?... $ECHO_C" >&6 for fd_set_t in 'fd_set' 'int' do for timeval_t in 'struct timeval' 'const struct timeval' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/time.h> #include <sys/types.h> #include <unistd.h> extern "C" int select(int, $fd_set_t *, $fd_set_t *, $fd_set_t *, $timeval_t *); $fd_set_t fd; int main () { select(0, &fd, 0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_found=yes ; break 2 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_found=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done if test "$ac_found" = no then { echo "$as_me:$LINENO: WARNING: can't determine argument type using int" >&5 echo "$as_me: WARNING: can't determine argument type using int" >&2;} fd_set_t="int" else echo "$as_me:$LINENO: result: $fd_set_t" >&5 echo "${ECHO_T}$fd_set_t" >&6 fi cat >>confdefs.h <<_ACEOF #define FD_SET_T $fd_set_t _ACEOF # Replacements for the library functions (i.e. regex) # Regex is compiled by the C compiler so we need to do it before we switch if test $WITH_RX = yes; then if test "${ac_cv_header_rxposix_h+set}" = set; then echo "$as_me:$LINENO: checking for rxposix.h" >&5 echo $ECHO_N "checking for rxposix.h... $ECHO_C" >&6 if test "${ac_cv_header_rxposix_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_rxposix_h" >&5 echo "${ECHO_T}$ac_cv_header_rxposix_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking rxposix.h usability" >&5 echo $ECHO_N "checking rxposix.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <rxposix.h> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking rxposix.h presence" >&5 echo $ECHO_N "checking rxposix.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <rxposix.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: rxposix.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: rxposix.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: rxposix.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: rxposix.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: rxposix.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: rxposix.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: rxposix.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: rxposix.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: rxposix.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: rxposix.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: rxposix.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for rxposix.h" >&5 echo $ECHO_N "checking for rxposix.h... $ECHO_C" >&6 if test "${ac_cv_header_rxposix_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_rxposix_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_rxposix_h" >&5 echo "${ECHO_T}$ac_cv_header_rxposix_h" >&6 fi if test $ac_cv_header_rxposix_h = yes; then cat >>confdefs.h <<\_ACEOF #define USE_RX _ACEOF else WITH_RX='no' fi fi if test $WITH_RX = no; then echo "$as_me:$LINENO: checking if we should use the included regex?" >&5 echo $ECHO_N "checking if we should use the included regex?... $ECHO_C" >&6 OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -I${srcdir}/htlib" if test "$cross_compiling" = yes; then echo "$as_me:$LINENO: result: unknown" >&5 echo "${ECHO_T}unknown" >&6; cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_REGEX _ACEOF else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include "${srcdir}/htlib/regex.c" int main() { regex_t re; return regcomp(&re, "ht.*Dig", REG_ICASE); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6;case $LIBOBJS in "regex.$ac_objext" | \ *" regex.$ac_objext" | \ "regex.$ac_objext "* | \ *" regex.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS regex.$ac_objext" ;; esac else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_REGEX _ACEOF fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS=$OLD_CFLAGS fi # Enable big files? echo "$as_me:$LINENO: checking if --enable-bigfile option specified" >&5 echo $ECHO_N "checking if --enable-bigfile option specified... $ECHO_C" >&6 # Check whether --enable-bigfile or --disable-bigfile was given. if test "${enable_bigfile+set}" = set; then enableval="$enable_bigfile" db_cv_bigfile="$enable_bigfile" else db_cv_bigfile="yes" fi; echo "$as_me:$LINENO: result: $db_cv_bigfile" >&5 echo "${ECHO_T}$db_cv_bigfile" >&6 # Vendors are doing 64-bit lseek in different ways. # Linux, AIX, HP/UX and Solaris all use _FILE_OFFSET_BITS to specify a "big-file" # environment. if test "$db_cv_bigfile" = yes; then case "$host_os" in bsdi*|aix*|hpux*|solaris*) cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OFFSET_BITS _ACEOF ;; linux*) cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_OFFSET_BITS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_LARGEFILE_SOURCE _ACEOF ;; esac fi # Add the -mimpure-text option on Solaris with GCC and libstc++ that is not shared if test "$GXX" = "yes" then case "$host" in *-sun-solaris* ) extra_ldflags="-mimpure-text";; esac fi # Define to the syslog level for htsearch logging cat >>confdefs.h <<\_ACEOF #define LOG_LEVEL LOG_INFO _ACEOF # Define to the syslog facility for htsearch logging cat >>confdefs.h <<\_ACEOF #define LOG_FACILITY LOG_LOCAL5 _ACEOF # Any remaining tests probably want the C compiler 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 ! -d "./db"; then mkdir db fi if test x$htdig_cv_tests = xyes then echo "$as_me:$LINENO: checking user name" >&5 echo $ECHO_N "checking user name... $ECHO_C" >&6 test -n "$LOGNAME" && USER=$LOGNAME echo "$as_me:$LINENO: result: $USER" >&5 echo "${ECHO_T}$USER" >&6 # # Handle user hints # echo "$as_me:$LINENO: checking if apache is wanted" >&5 echo $ECHO_N "checking if apache is wanted... $ECHO_C" >&6 # Check whether --with-apache or --without-apache was given. if test "${with_apache+set}" = set; then withval="$with_apache" # # Run this if -with or -without was specified # if test "$withval" != no ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 APACHE_WANTED=yes if test "$withval" != yes ; then APACHE="$withval" fi else APACHE_WANTED=no echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else # # Run this if nothing was said # APACHE_WANTED=yes echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi; # # Now we know if we want apache or not, only go further if # it's wanted. # if test "$APACHE_WANTED" = yes ; then # # If not specified by caller, search in standard places # if test -z "$APACHE" ; then for ac_prog in httpd apache do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_APACHE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $APACHE in [\\/]* | ?:[\\/]*) ac_cv_path_APACHE="$APACHE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="/usr/local/apache/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/apache/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_APACHE="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi APACHE=$ac_cv_path_APACHE if test -n "$APACHE"; then echo "$as_me:$LINENO: result: $APACHE" >&5 echo "${ECHO_T}$APACHE" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$APACHE" && break done fi if test -z "$APACHE" ; then { { echo "$as_me:$LINENO: error: \"apache server executable not found\"" >&5 echo "$as_me: error: \"apache server executable not found\"" >&2;} { (exit 1); exit 1; }; }; fi # # Collect apache version number. If for nothing else, this # guaranties that httpd is a working apache executable. # (Want at least 3 chars in version, to skip "(Mandrake Linux/4mdk)") # APACHE_READABLE_VERSION=`$APACHE -v | grep 'Server version' | sed -e 's;.*/\([0-9\.][0-9\.][0-9\.][0-9\.]*\).*;\1;'` APACHE_VERSION=`echo $APACHE_READABLE_VERSION | sed -e 's/\.//g'` if test -z "$APACHE_VERSION" ; then { { echo "$as_me:$LINENO: error: \"could not determine apache version number\"" >&5 echo "$as_me: error: \"could not determine apache version number\"" >&2;} { (exit 1); exit 1; }; }; fi APACHE_MAJOR=`expr $APACHE_VERSION : '\(..\)'` APACHE_MINOR=`expr $APACHE_VERSION : '..\(.*\)'` # # Check that apache version matches requested version or above # if test -n "1.3.1" ; then echo "$as_me:$LINENO: checking apache version >= 1.3.1" >&5 echo $ECHO_N "checking apache version >= 1.3.1... $ECHO_C" >&6 APACHE_REQUEST=`echo 1.3.1 | sed -e 's/\.//g'` APACHE_REQUEST_MAJOR=`expr $APACHE_REQUEST : '\(..\)'` APACHE_REQUEST_MINOR=`expr $APACHE_REQUEST : '..\(.*\)'` if test "$APACHE_MAJOR" -lt "$APACHE_REQUEST_MAJOR" -o "$APACHE_MINOR" -lt "$APACHE_REQUEST_MINOR" ; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: apache version is $APACHE_READABLE_VERSION" >&5 echo "$as_me: error: apache version is $APACHE_READABLE_VERSION" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi fi # # Find out if .so modules are in libexec/module.so or modules/module.so # HTTP_ROOT=`$APACHE -V | grep HTTPD_ROOT | sed -e 's/.*"\(.*\)"/\1/'` echo "$as_me:$LINENO: checking apache modules" >&5 echo $ECHO_N "checking apache modules... $ECHO_C" >&6 for dir in libexec modules lib/apache libexec/httpd lib/apache/1.3 do if test -f $HTTP_ROOT/$dir/mod_env.* then APACHE_MODULES=$dir fi done if test -z "$APACHE_MODULES" then echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6 else echo "$as_me:$LINENO: result: in $HTTP_ROOT/$APACHE_MODULES" >&5 echo "${ECHO_T}in $HTTP_ROOT/$APACHE_MODULES" >&6 fi fi fi echo configuring ht://Dig version $VERSION subdirs="$subdirs db" ### HACK: copied from autoconf output, to ensure the expansion below works test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # expand variables which appear in attrs.html and the man pages while echo $bindir | grep '\$' >/dev/null ; do eval "bindir=$bindir" done while echo $COMMON_DIR | grep '\$' >/dev/null ; do eval "COMMON_DIR=$COMMON_DIR" done while echo $CONFIG_DIR | grep '\$' >/dev/null ; do eval "CONFIG_DIR=$CONFIG_DIR" done while echo $DEFAULT_CONFIG_FILE | grep '\$' >/dev/null ; do eval "DEFAULT_CONFIG_FILE=$DEFAULT_CONFIG_FILE" done while echo $DATABASE_DIR | grep '\$' >/dev/null ; do eval "DATABASE_DIR=$DATABASE_DIR" done while echo $IMAGE_URL_PREFIX | grep '\$' >/dev/null ; do eval "IMAGE_URL_PREFIX=$IMAGE_URL_PREFIX" done while echo $VERSION | grep '\$' >/dev/null ; do eval "VERSION=$VERSION" done ac_config_files="$ac_config_files Makefile htcommon/Makefile htdb/Makefile htdig/Makefile htdoc/Makefile htdoc/attrs.html installdir/htdig.1 installdir/htdig-pdfparser.1 installdir/htfuzzy.1 installdir/htmerge.1 installdir/htpurge.1 installdir/htstat.1 installdir/htdigconfig.8 installdir/htdump.1 installdir/htload.1 installdir/htnotify.1 installdir/htsearch.1 installdir/rundig.1 htfuzzy/Makefile htlib/Makefile htnet/Makefile htsearch/Makefile httools/Makefile htword/Makefile include/Makefile installdir/Makefile test/Makefile test/test_functions" 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, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H 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_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${TESTS_TRUE}" && test -z "${TESTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet 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 <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "htcommon/Makefile" ) CONFIG_FILES="$CONFIG_FILES htcommon/Makefile" ;; "htdb/Makefile" ) CONFIG_FILES="$CONFIG_FILES htdb/Makefile" ;; "htdig/Makefile" ) CONFIG_FILES="$CONFIG_FILES htdig/Makefile" ;; "htdoc/Makefile" ) CONFIG_FILES="$CONFIG_FILES htdoc/Makefile" ;; "htdoc/attrs.html" ) CONFIG_FILES="$CONFIG_FILES htdoc/attrs.html" ;; "installdir/htdig.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htdig.1" ;; "installdir/htdig-pdfparser.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htdig-pdfparser.1" ;; "installdir/htfuzzy.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htfuzzy.1" ;; "installdir/htmerge.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htmerge.1" ;; "installdir/htpurge.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htpurge.1" ;; "installdir/htstat.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htstat.1" ;; "installdir/htdigconfig.8" ) CONFIG_FILES="$CONFIG_FILES installdir/htdigconfig.8" ;; "installdir/htdump.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htdump.1" ;; "installdir/htload.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htload.1" ;; "installdir/htnotify.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htnotify.1" ;; "installdir/htsearch.1" ) CONFIG_FILES="$CONFIG_FILES installdir/htsearch.1" ;; "installdir/rundig.1" ) CONFIG_FILES="$CONFIG_FILES installdir/rundig.1" ;; "htfuzzy/Makefile" ) CONFIG_FILES="$CONFIG_FILES htfuzzy/Makefile" ;; "htlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES htlib/Makefile" ;; "htnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES htnet/Makefile" ;; "htsearch/Makefile" ) CONFIG_FILES="$CONFIG_FILES htsearch/Makefile" ;; "httools/Makefile" ) CONFIG_FILES="$CONFIG_FILES httools/Makefile" ;; "htword/Makefile" ) CONFIG_FILES="$CONFIG_FILES htword/Makefile" ;; "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "installdir/Makefile" ) CONFIG_FILES="$CONFIG_FILES installdir/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/test_functions" ) CONFIG_FILES="$CONFIG_FILES test/test_functions" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@HTDIG_MAJOR_VERSION@,$HTDIG_MAJOR_VERSION,;t t s,@HTDIG_MINOR_VERSION@,$HTDIG_MINOR_VERSION,;t t s,@HTDIG_MICRO_VERSION@,$HTDIG_MICRO_VERSION,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CONFIG_DIR@,$CONFIG_DIR,;t t s,@DEFAULT_CONFIG_FILE@,$DEFAULT_CONFIG_FILE,;t t s,@COMMON_DIR@,$COMMON_DIR,;t t s,@DATABASE_DIR@,$DATABASE_DIR,;t t s,@CGIBIN_DIR@,$CGIBIN_DIR,;t t s,@SEARCH_DIR@,$SEARCH_DIR,;t t s,@SEARCH_FORM@,$SEARCH_FORM,;t t s,@IMAGE_DIR@,$IMAGE_DIR,;t t s,@IMAGE_URL_PREFIX@,$IMAGE_URL_PREFIX,;t t s,@TESTS_TRUE@,$TESTS_TRUE,;t t s,@TESTS_FALSE@,$TESTS_FALSE,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@LN_S@,$LN_S,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@SED@,$SED,;t t s,@PERL@,$PERL,;t t s,@FIND@,$FIND,;t t s,@GUNZIP@,$GUNZIP,;t t s,@RRDTOOL@,$RRDTOOL,;t t s,@TAR@,$TAR,;t t s,@MV@,$MV,;t t s,@SENDMAIL@,$SENDMAIL,;t t s,@TIME@,$TIME,;t t s,@TIMEV@,$TIMEV,;t t s,@HAVE_SSL@,$HAVE_SSL,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@extra_ldflags@,$extra_ldflags,;t t s,@USER@,$USER,;t t s,@APACHE@,$APACHE,;t t s,@APACHE_MODULES@,$APACHE_MODULES,;t t s,@subdirs@,$subdirs,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: 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 || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= for ac_arg in $ac_configure_args; do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -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=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d $srcdir/$ac_dir || continue { echo "$as_me:$LINENO: configuring in $ac_dir" >&5 echo "$as_me: configuring in $ac_dir" >&6;} { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" elif test -f $ac_srcdir/configure; then ac_sub_configure="$SHELL '$ac_srcdir/configure'" elif test -f $ac_srcdir/configure.in; then ac_sub_configure=$ac_configure else { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative path. ac_sub_cache_file=$ac_top_builddir$cache_file ;; esac { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval $ac_sub_configure $ac_sub_configure_args \ --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd "$ac_popdir" done fi echo "" echo "" echo "Now you must run 'make' followed by 'make install'" echo "" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/configure.in��������������������������������������������������������������������������0100644�0063146�0012731�00000027330�10063260372�014700� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Configuration for ht://Dig 3.x # # Part of the ht://Dig package <http://www.htdig.org/> # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # <http://www.gnu.org/copyleft/lgpl.html> AC_PREREQ(2.57) AC_INIT # # ht://Dig's version # VERSION=`cat ${srcdir}/.version` HTDIG_MAJOR_VERSION=[`expr $VERSION : '\([0-9][0-9]*\)'`] AC_SUBST(HTDIG_MAJOR_VERSION) HTDIG_MINOR_VERSION=[`expr $VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\)'`] AC_SUBST(HTDIG_MINOR_VERSION) HTDIG_MICRO_VERSION=[`expr $VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'`] AC_SUBST(HTDIG_MICRO_VERSION) AM_INIT_AUTOMAKE([htdig], $VERSION) AC_CONFIG_SRCDIR([htdig/htdig.cc]) AM_CONFIG_HEADER([include/config.h]) AC_CONFIG_LIBOBJ_DIR([htlib]) AC_PREFIX_DEFAULT([/opt/www]) # Initialize maintainer mode AM_MAINTAINER_MODE AC_ARG_WITH(config-dir, [AC_HELP_STRING([--with-config-dir=DIR], [where your config directory is @<:@PREFIX/conf@:>@])], CONFIG_DIR="$withval", CONFIG_DIR='${prefix}/conf') AC_SUBST(CONFIG_DIR) # In the below, the strings @<:@ and @:>@ expand to [ and ] AC_ARG_WITH(default-config-file, [AC_HELP_STRING([--with-default-config-file=FILE], [where the various programs will look for a configuration file @<:@PREFIX/conf/htdig.conf@:>@])], DEFAULT_CONFIG_FILE="$withval", DEFAULT_CONFIG_FILE='${CONFIG_DIR}/htdig.conf') AC_SUBST(DEFAULT_CONFIG_FILE) AC_ARG_WITH(common-dir, [AC_HELP_STRING([--with-common-dir=DIR], [where your .html templates are stored @<:@PREFIX/share/htdig@:>@])], COMMON_DIR="$withval", COMMON_DIR='${datadir}/htdig') AC_SUBST(COMMON_DIR) AC_ARG_WITH(database-dir, [AC_HELP_STRING([--with-database-dir=DIR], [where your database directory is @<:@PREFIX/var/htdig@:>@])], DATABASE_DIR="$withval", DATABASE_DIR='${localstatedir}/htdig') AC_SUBST(DATABASE_DIR) AC_ARG_WITH(cgi-bin-dir, [AC_HELP_STRING([--with-cgi-bin-dir=DIR], [where your web server cgi-bin directory is @<:@PREFIX/cgi-bin@:>@])], CGIBIN_DIR="$withval", CGIBIN_DIR='${prefix}/cgi-bin') AC_SUBST(CGIBIN_DIR) AC_ARG_WITH(search-dir, [AC_HELP_STRING([--with-search-dir=DIR], [where the sample search form should be installed @<:@PREFIX/htdocs/htdig@:>@])], SEARCH_DIR="$withval", SEARCH_DIR='${prefix}/htdocs/htdig') AC_SUBST(SEARCH_DIR) AC_ARG_WITH(search-form, [AC_HELP_STRING([--with-search-form=FILE], [the name for the sample search form @<:@search.html@:>@])], SEARCH_FORM="$withval", SEARCH_FORM='search.html') AC_SUBST(SEARCH_FORM) AC_ARG_WITH(image-dir, [AC_HELP_STRING([--with-image-dir=DIR], [where the ht://Dig images are installed @<:@PREFIX/htdocs/htdig@:>@])], IMAGE_DIR="$withval", IMAGE_DIR='${prefix}/htdocs/htdig') AC_SUBST(IMAGE_DIR) AC_ARG_WITH(image-url-prefix, [AC_HELP_STRING([--with-image-url-prefix=LOCATION], [the URL path to the installed images @<:@/htdig@:>@])], IMAGE_URL_PREFIX="$withval", IMAGE_URL_PREFIX='/htdig') AC_SUBST(IMAGE_URL_PREFIX) AC_ARG_WITH(rx, [AC_HELP_STRING([--with-rx], [with system rx instead of regex @<:@no@:>@])], WITH_RX="$withval", WITH_RX='no') # If the user doesn't want tests AC_ARG_ENABLE(tests, [AC_HELP_STRING([--enable-tests], [do build a version with run-time tests.])], [htdig_cv_tests="$enable_tests"], [htdig_cv_tests="no"]) AM_CONDITIONAL(TESTS, test x$htdig_cv_tests = xyes) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_AIX AM_PROG_LEX AC_PROG_YACC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_COMPILE_WARNINGS NO_RTTI NO_EXCEPTIONS AC_PATH_PROG(AR, ar, ar) AC_PATH_PROG(SHELL, sh, /bin/sh) AC_PATH_PROG(SED, sed, /bin/sed) AC_PATH_PROG(PERL, perl, /usr/bin/perl) AC_PATH_PROG(FIND, find, /bin/find) AC_PATH_PROG(GUNZIP, gunzip, /bin/gunzip) AC_CHECK_PROGS(RRDTOOL, rrdtool) AC_CHECK_PROGS(TAR, tar gtar gnutar, tar) AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail, $PATH:/usr/libexec:/usr/sbin:/usr/lib:/usr/etc:etc) AM_PROG_TIME # Checks for libraries. #AC_CHECK_LIB([z], [main]) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, t_accept) CHECK_SSL CHECK_ZLIB AC_SUBST(CXXFLAGS) AC_SUBST(LDFLAGS) # Checks for header files. AC_HEADER_STDBOOL AC_HEADER_TIME AC_FUNC_ALLOCA AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h wchar.h wctype.h]) #AC_CHECK_HEADERS([zlib.h sys/wait.h wait.h alloca.h]) AC_CHECK_HEADERS([sys/wait.h wait.h alloca.h]) #AC_CHECK_HEADERS(ssl.h) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_HEADER_TIME AC_STRUCT_TM AC_CHECK_SIZEOF(unsigned long long int, 8) AC_CHECK_SIZEOF(unsigned long int, 4) AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned short int, 2) AC_CHECK_SIZEOF(unsigned char, 1) # Checks for library functions. AC_FUNC_CLOSEDIR_VOID #AC_FUNC_ERROR_AT_LINE #AC_FUNC_LSTAT #AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MALLOC AC_FUNC_MBRTOWC AC_FUNC_MEMCMP AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL #AC_FUNC_STAT AC_FUNC_STRFTIME AC_FUNC_STRPTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS([alarm btowc bzero ftime getcwd gettimeofday localtime_r memcmp memcpy memmove memset mkstemp munmap pstat_getdynamic raise re_comp regcomp select setlocale strchr strcspn strdup strerror strrchr strstr strtol strtoul timegm]) AC_REPLACE_FUNCS(snprintf vsnprintf) # More header checks--here use C++ AC_LANG([C++]) AC_CXX_HAVE_STD AC_MSG_CHECKING(whether we need gethostname() prototype?) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/ioctl.h> #include <sys/uio.h> #include <sys/file.h> #include <fcntl.h> #include <netdb.h> #include <stdlib.h> extern "C" int gethostname(char *, int); ]],[[ gethostname("sdsu.edu", (int) 8); ]])],[AC_MSG_RESULT(yes);AC_DEFINE([NEED_PROTO_GETHOSTNAME],,[Define if you need a prototype for gethostname()])],[AC_MSG_RESULT(no)]) # We're still using the C++ compiler for this test AC_MSG_CHECKING(how to call getpeername?) for sock_t in 'struct sockaddr' 'void'; do for getpeername_length_t in 'size_t' 'int' 'unsigned int' 'long unsigned int' 'socklen_t' do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> #include <sys/socket.h> extern "C" int getpeername(int, $sock_t *, $getpeername_length_t *); $sock_t s; $getpeername_length_t l; ]], [[ getpeername(0, &s, &l); ]])],[ac_found=yes ; break 2],[ac_found=no]) done done if test "$ac_found" = no then AC_MSG_WARN([can't determine, using size_t]) getpeername_length_t="size_t" else AC_MSG_RESULT($getpeername_length_t) fi AC_DEFINE_UNQUOTED([GETPEERNAME_LENGTH_T],[$getpeername_length_t],[Define this to the type of the third argument of getpeername()]) AC_MSG_CHECKING(how to call select?) for fd_set_t in 'fd_set' 'int' do for timeval_t in 'struct timeval' 'const struct timeval' do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h> #include <sys/types.h> #include <unistd.h> extern "C" int select(int, $fd_set_t *, $fd_set_t *, $fd_set_t *, $timeval_t *); $fd_set_t fd; ]], [[ select(0, &fd, 0, 0, 0); ]])],[ac_found=yes ; break 2],[ac_found=no]) done done if test "$ac_found" = no then AC_MSG_WARN([can't determine argument type using int]) fd_set_t="int" else AC_MSG_RESULT($fd_set_t) fi AC_DEFINE_UNQUOTED([FD_SET_T],[$fd_set_t],[Define this to the type of the second argument of select()]) # Replacements for the library functions (i.e. regex) # Regex is compiled by the C compiler so we need to do it before we switch if test $WITH_RX = yes; then AC_CHECK_HEADER(rxposix.h, AC_DEFINE(USE_RX,,[Use posix regexp]), WITH_RX='no') fi if test $WITH_RX = no; then AC_MSG_CHECKING(if we should use the included regex?) OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -I${srcdir}/htlib" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "${srcdir}/htlib/regex.c" int main() { regex_t re; return regcomp(&re, "ht.*Dig", REG_ICASE); } ]])], [AC_MSG_RESULT(yes);AC_LIBOBJ([regex])], [AC_MSG_RESULT(no);AC_DEFINE(HAVE_BROKEN_REGEX,,[Broken regexp])], [AC_MSG_RESULT(unknown);AC_DEFINE(HAVE_BROKEN_REGEX,,[Unknown regexp])]) CFLAGS=$OLD_CFLAGS fi # Enable big files? AC_MSG_CHECKING(if --enable-bigfile option specified) AC_ARG_ENABLE(bigfile, [AC_HELP_STRING([--enable-bigfile], [enable Linux, AIX, HP/UX, Solaris big files.])], [db_cv_bigfile="$enable_bigfile"], [db_cv_bigfile="yes"]) AC_MSG_RESULT($db_cv_bigfile) # Vendors are doing 64-bit lseek in different ways. # Linux, AIX, HP/UX and Solaris all use _FILE_OFFSET_BITS to specify a "big-file" # environment. if test "$db_cv_bigfile" = yes; then case "$host_os" in bsdi*|aix*|hpux*|solaris*) AC_DEFINE(HAVE_FILE_OFFSET_BITS,,['big-file' environment]);; linux*) AC_DEFINE(HAVE_FILE_OFFSET_BITS,,['big-file' environment]) AC_DEFINE(HAVE_LARGEFILE_SOURCE,,[large file sources]) ;; esac fi # Add the -mimpure-text option on Solaris with GCC and libstc++ that is not shared if test "$GXX" = "yes" then case "$host" in *-sun-solaris* ) extra_ldflags="-mimpure-text";; esac fi AC_SUBST(extra_ldflags) # Define to the syslog level for htsearch logging AC_DEFINE([LOG_LEVEL],[LOG_INFO],[Define to the syslog level for htsearch logging]) # Define to the syslog facility for htsearch logging AC_DEFINE([LOG_FACILITY],[LOG_LOCAL5],[Define to the syslog facility for htsearch logging]) # Any remaining tests probably want the C compiler AC_LANG_C if test ! -d "./db"; then mkdir db fi if test x$htdig_cv_tests = xyes then CHECK_USER AC_PROG_APACHE(1.3.1) fi echo configuring ht://Dig version $VERSION AC_CONFIG_SUBDIRS(db) ### HACK: copied from autoconf output, to ensure the expansion below works test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # expand variables which appear in attrs.html and the man pages while echo $bindir | grep '\$' >/dev/null ; do eval "bindir=$bindir" done while echo $COMMON_DIR | grep '\$' >/dev/null ; do eval "COMMON_DIR=$COMMON_DIR" done while echo $CONFIG_DIR | grep '\$' >/dev/null ; do eval "CONFIG_DIR=$CONFIG_DIR" done while echo $DEFAULT_CONFIG_FILE | grep '\$' >/dev/null ; do eval "DEFAULT_CONFIG_FILE=$DEFAULT_CONFIG_FILE" done while echo $DATABASE_DIR | grep '\$' >/dev/null ; do eval "DATABASE_DIR=$DATABASE_DIR" done while echo $IMAGE_URL_PREFIX | grep '\$' >/dev/null ; do eval "IMAGE_URL_PREFIX=$IMAGE_URL_PREFIX" done while echo $VERSION | grep '\$' >/dev/null ; do eval "VERSION=$VERSION" done AC_CONFIG_FILES([Makefile htcommon/Makefile htdb/Makefile htdig/Makefile htdoc/Makefile htdoc/attrs.html installdir/htdig.1 installdir/htdig-pdfparser.1 installdir/htfuzzy.1 installdir/htmerge.1 installdir/htpurge.1 installdir/htstat.1 installdir/htdigconfig.8 installdir/htdump.1 installdir/htload.1 installdir/htnotify.1 installdir/htsearch.1 installdir/rundig.1 htfuzzy/Makefile htlib/Makefile htnet/Makefile htsearch/Makefile httools/Makefile htword/Makefile include/Makefile installdir/Makefile test/Makefile test/test_functions]) AC_OUTPUT echo "" echo "" echo "Now you must run 'make' followed by 'make install'" echo "" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/install-sh����������������������������������������������������������������������������0100755�0063146�0012731�00000015722�07722023470�014401� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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 "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : 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 : 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 : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; 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 : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # 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 :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } ����������������������������������������������htdig-3.2.0b6/lookfor�������������������������������������������������������������������������������0100755�0063146�0012731�00000000075�06454024367�014000� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh egrep "$1" `find $2 -name "*.cc" -or -name "*.h"` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/ltmain.sh�����������������������������������������������������������������������������0100755�0063146�0012731�00000547010�10057557631�014226� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.6 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 203 $" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF $* EOF exit $EXIT_SUCCESS fi default_mode= help="Try \`$progname --help' for more information." magic="%%%MAGIC variable%%%" mkdir="mkdir" mv="mv -f" rm="rm -f" # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # test EBCDIC or ASCII case `echo A|tr A '\301'` in A) # EBCDIC based system SP2NL="tr '\100' '\n'" NL2SP="tr '\r\n' '\100\100'" ;; *) # Assume ASCII based system SP2NL="tr '\040' '\012'" NL2SP="tr '\015\012' '\040\040'" ;; esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. if test "${LC_ALL+set}" = set; then save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL fi if test "${LANG+set}" = set; then save_LANG="$LANG"; LANG=C; export LANG fi # Make sure IFS has a sensible default : ${IFS=" "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then $echo "$modename: not configured to build any kind of library" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $EXIT_SUCCESS ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T <<EOF # $libobj - a libtool object file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # Name of the PIC object. EOF # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $srcfile $pic_flag" else # Don't build PIC code command="$base_compile $srcfile" fi if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir status=$? if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then exit $status fi fi if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi $run $rm "$lobj" "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit $EXIT_FAILURE fi if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <<EOF pic_object='$objdir/$objname' EOF # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi else # No PIC object so indicate it doesn't exist in the libtool # object file. test -z "$run" && cat >> ${libobj}T <<EOF pic_object=none EOF fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else command="$base_compile $srcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$obj" "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit $EXIT_FAILURE fi if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <<EOF # Name of the non-PIC object. non_pic_object='$objname' EOF else # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <<EOF # Name of the non-PIC object. non_pic_object=none EOF fi $run $mv "${libobj}T" "${libobj}" # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit $EXIT_SUCCESS ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" base_compile="$nonopt $@" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c <<EOF int main() { return 0; } EOF $rm conftest $LTCC -o conftest conftest.c $deplibs if test "$?" -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" -ne "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) newdeplibs="$newdeplibs $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches deplib_match=$2 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then newdeplibs="$newdeplibs $i" else droppeddeps=yes $echo $echo "*** Warning: dynamic linker does not accept needed library $i." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which I believe you do not have" $echo "*** because a test_compile did reveal that the linker did not use it for" $echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi else newdeplibs="$newdeplibs $i" fi done else # Error occurred in the first compile. Let's try to salvage # the situation: Compile a separate program for each library. for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then $rm conftest $LTCC -o conftest conftest.c $i # Did it work? if test "$?" -eq 0 ; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) newdeplibs="$newdeplibs $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches deplib_match=$2 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then newdeplibs="$newdeplibs $i" else droppeddeps=yes $echo $echo "*** Warning: dynamic linker does not accept needed library $i." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because a test_compile did reveal that the linker did not use this one" $echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes $echo $echo "*** Warning! Library $i is needed by this library but I was not able to" $echo "*** make it link in! You will probably need to install it or some" $echo "*** library that it depends on before this library will be fully" $echo "*** functional. Installing it before continuing would be even better." fi else newdeplibs="$newdeplibs $i" fi done fi ;; file_magic*) set dummy $deplibs_check_method file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 </dev/null >/dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <<EOF /* $cwrappersource - temporary wrapper executable for $objdir/$outputname Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP The $output program cannot be directly executed until all the libtool libraries that it depends on are installed. This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. Currently, it simply execs the wrapper *script* "/bin/sh $output", but could eventually absorb all of the scripts functionality and exec $objdir/$outputname directly. */ EOF cat >> $cwrappersource<<"EOF" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <malloc.h> #include <stdarg.h> #include <assert.h> #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <<EOF newargz[0] = "$SHELL"; EOF cat >> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <<EOF execv("$SHELL",newargz); EOF cat >> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to <bug-libtool@gnu.org>." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/missing�������������������������������������������������������������������������������0100755�0063146�0012731�00000024032�10057557631�013774� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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 case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; 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]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - 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 missing on your system. 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 missing on your system. 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 missing on your system. 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 missing on your system. 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, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. 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' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; 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 missing on your system. 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 missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; 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 you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed 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 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/mkinstalldirs�������������������������������������������������������������������������0100755�0063146�0012731�00000003704�07706720511�015202� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <friedman@prep.ai.mit.edu> # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here ������������������������������������������������������������htdig-3.2.0b6/db/�����������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�012756� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/btree/�����������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014057� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/.cvsignore�������������������������������������������������������������������������0100644�0063146�0012731�00000000161�07616271764�014766� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Makefile .deps .libs *.lo *.la Makefile config.log config.status stamp-h libtool db_config.h db.h autom4te.cache ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/68K.gcc����������������������������������������������������������������������������0100644�0063146�0012731�00000000623�07427026535�014011� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)68K.gcc 11.1 (Sleepycat) 7/25/99 * * For gcc/68K, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile("tas %1; \n \ seq %0" \ : "=dm" (__r), "=m" (*__l) \ : "1" (*__l) \ ); \ __r & 1; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) �������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/LICENSE����������������������������������������������������������������������������0100644�0063146�0012731�00000015564�07723466250�014003� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������The following is the license that applies to this copy of the Berkeley DB software, version 3.3.11. For a license to use the Berkeley DB software under conditions other than those described here, or to purchase support for this software, please contact Sleepycat Software at one of the following addresses: Sleepycat Software info@sleepycat.com 118 Tower Road +1 (617) 876-0858 Lincoln, MA 01773 877-SLEEPYCAT (toll-free, USA only) USA =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= /* * Copyright (c) 1990-2003 * Sleepycat Software. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. This license grant extends only to use of Berkeley DB version 3.3.11, * modified or unmodified, in conjunction with the HtDig document * indexing package, and only when the HtDig software is distributed * under the GNU Lesser General Public License (LGPL) as published at * http://www.fsf.org/licenses/lgpl.html. * Any use or redistribution of Berkeley DB version 3.3.11, modified or * unmodified, with HtDig requires compliance with the terms of the LGPL * with respect to the HtDig software, and with the terms of this license * grant with respect to the Berkeley DB software and any modifications. * 4. The HtDig software may only be used for document indexing, including * the indexing of document contents and metadata such as titles, * locations, authors and other document attributes. * 5. Only the HtDig library may call any Berkeley DB API directly. Third- * party software must use HtDig interfaces, and may not make direct * calls to Berkeley DB APIs. * 6. This version of Berkeley DB, whether modified or unmodified, may not * be used or redistributed separately from the HtDig software. * 7. Redistributions in any form must be accompanied by information on * how to obtain complete source code for the Berkeley DB software, * including any modifications, and complete source code for the HtDig * software. The source code must either be included in the distribution * or be available for no more than the cost of distribution plus a * nominal fee, and must be freely redistributable under reasonable * conditions. * 8. Nothing of this license grant, and nothing of the bundling of Berkeley * DB version 3.3.11 with HtDig, shall permit redistribution of Berkeley * DB under the terms of the LGPL. * * THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR * NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL SLEEPYCAT SOFTWARE * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ ��������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/Makefile.am������������������������������������������������������������������������0100644�0063146�0012731�00000005214�07427026535�015020� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������INCLUDES = -I$(top_srcdir)/../htlib AUTOMAKE_OPTIONS = foreign no-dependencies EXTRA_DIST = db_config.h.in db.h.in \ 68K.gcc alpha.gcc sparc.gcc x86.gcc \ hash.src log.src qam.src txn.src prefix-symbols.sh \ LICENSE pkglib_LTLIBRARIES = libhtdb.la libhtdb_la_SOURCES = \ bt_compare.c \ bt_conv.c \ bt_curadj.c \ bt_cursor.c \ bt_delete.c \ bt_method.c \ bt_open.c \ bt_put.c \ bt_rec.c \ bt_reclaim.c \ bt_recno.c \ bt_rsearch.c \ bt_search.c \ bt_split.c \ bt_stat.c \ bt_upgrade.c \ btree_auto.c \ crdel_auto.c \ crdel_rec.c \ db.c \ db_am.c \ db_auto.c \ db_byteorder.c \ db_conv.c \ db_dispatch.c \ db_dup.c \ db_err.c \ db_getlong.c \ db_iface.c \ db_join.c \ db_log2.c \ db_meta.c \ db_method.c \ db_overflow.c \ db_pr.c \ db_rec.c \ db_reclaim.c \ db_ret.c \ db_salloc.c \ db_shash.c \ db_upgrade.c \ env_method.c \ env_open.c \ env_recover.c \ env_region.c \ hash.c \ hash_auto.c \ hash_conv.c \ hash_dup.c \ hash_func.c \ hash_meta.c \ hash_method.c \ hash_page.c \ hash_rec.c \ hash_reclaim.c \ hash_stat.c \ hash_upgrade.c \ lock.c \ lock_conflict.c \ lock_deadlock.c \ lock_region.c \ lock_util.c \ log.c \ log_archive.c \ log_auto.c \ log_compare.c \ log_findckp.c \ log_get.c \ log_method.c \ log_put.c \ log_rec.c \ log_register.c \ mp_alloc.c \ mp_bh.c \ mp_cmpr.c \ mp_fget.c \ mp_fopen.c \ mp_fput.c \ mp_fset.c \ mp_method.c \ mp_region.c \ mp_register.c \ mp_stat.c \ mp_sync.c \ mp_trickle.c \ mut_fcntl.c \ mut_pthread.c \ mut_tas.c \ mutex.c \ os_abs.c \ os_alloc.c \ os_dir.c \ os_errno.c \ os_fid.c \ os_finit.c \ os_fsync.c \ os_handle.c \ os_map.c \ os_method.c \ os_oflags.c \ os_open.c \ os_region.c \ os_rename.c \ os_root.c \ os_rpath.c \ os_rw.c \ os_seek.c \ os_sleep.c \ os_spin.c \ os_stat.c \ os_tmpdir.c \ os_unlink.c \ qam.c \ qam_auto.c \ qam_conv.c \ qam_method.c \ qam_open.c \ qam_rec.c \ qam_stat.c \ txn.c \ txn_auto.c \ txn_rec.c \ txn_region.c \ xa.c \ xa_db.c \ xa_map.c libhtdb_la_LDFLAGS = -release $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) pkginclude_HEADERS = \ btree.h \ btree_auto.h \ btree_ext.h \ common_ext.h \ crdel_auto.h \ db.h \ db_am.h \ db_auto.h \ db_config.h \ db_dispatch.h \ db_ext.h \ db_int.h \ db_join.h \ db_page.h \ db_shash.h \ db_swap.h \ debug.h \ env_ext.h \ hash.h \ hash_auto.h \ hash_ext.h \ lock.h \ lock_ext.h \ log.h \ log_auto.h \ log_ext.h \ mp.h \ mp_ext.h \ mutex.h \ mutex_ext.h \ os.h \ os_ext.h \ os_jump.h \ qam.h \ qam_auto.h \ qam_ext.h \ queue.h \ region.h \ shqueue.h \ txn.h \ txn_auto.h \ txn_ext.h \ xa.h \ xa_ext.h ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/Makefile.in������������������������������������������������������������������������0100644�0063146�0012731�00000052512�10063260372�015021� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MICRO_VERSION = @MICRO_VERSION@ MINOR_VERSION = @MINOR_VERSION@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ int16_decl = @int16_decl@ int32_decl = @int32_decl@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ ssize_t_decl = @ssize_t_decl@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ u_char_decl = @u_char_decl@ u_int16_decl = @u_int16_decl@ u_int32_decl = @u_int32_decl@ u_int8_decl = @u_int8_decl@ u_int_decl = @u_int_decl@ u_long_decl = @u_long_decl@ u_short_decl = @u_short_decl@ INCLUDES = -I$(top_srcdir)/../htlib AUTOMAKE_OPTIONS = foreign no-dependencies EXTRA_DIST = db_config.h.in db.h.in \ 68K.gcc alpha.gcc sparc.gcc x86.gcc \ hash.src log.src qam.src txn.src prefix-symbols.sh \ LICENSE pkglib_LTLIBRARIES = libhtdb.la libhtdb_la_SOURCES = \ bt_compare.c \ bt_conv.c \ bt_curadj.c \ bt_cursor.c \ bt_delete.c \ bt_method.c \ bt_open.c \ bt_put.c \ bt_rec.c \ bt_reclaim.c \ bt_recno.c \ bt_rsearch.c \ bt_search.c \ bt_split.c \ bt_stat.c \ bt_upgrade.c \ btree_auto.c \ crdel_auto.c \ crdel_rec.c \ db.c \ db_am.c \ db_auto.c \ db_byteorder.c \ db_conv.c \ db_dispatch.c \ db_dup.c \ db_err.c \ db_getlong.c \ db_iface.c \ db_join.c \ db_log2.c \ db_meta.c \ db_method.c \ db_overflow.c \ db_pr.c \ db_rec.c \ db_reclaim.c \ db_ret.c \ db_salloc.c \ db_shash.c \ db_upgrade.c \ env_method.c \ env_open.c \ env_recover.c \ env_region.c \ hash.c \ hash_auto.c \ hash_conv.c \ hash_dup.c \ hash_func.c \ hash_meta.c \ hash_method.c \ hash_page.c \ hash_rec.c \ hash_reclaim.c \ hash_stat.c \ hash_upgrade.c \ lock.c \ lock_conflict.c \ lock_deadlock.c \ lock_region.c \ lock_util.c \ log.c \ log_archive.c \ log_auto.c \ log_compare.c \ log_findckp.c \ log_get.c \ log_method.c \ log_put.c \ log_rec.c \ log_register.c \ mp_alloc.c \ mp_bh.c \ mp_cmpr.c \ mp_fget.c \ mp_fopen.c \ mp_fput.c \ mp_fset.c \ mp_method.c \ mp_region.c \ mp_register.c \ mp_stat.c \ mp_sync.c \ mp_trickle.c \ mut_fcntl.c \ mut_pthread.c \ mut_tas.c \ mutex.c \ os_abs.c \ os_alloc.c \ os_dir.c \ os_errno.c \ os_fid.c \ os_finit.c \ os_fsync.c \ os_handle.c \ os_map.c \ os_method.c \ os_oflags.c \ os_open.c \ os_region.c \ os_rename.c \ os_root.c \ os_rpath.c \ os_rw.c \ os_seek.c \ os_sleep.c \ os_spin.c \ os_stat.c \ os_tmpdir.c \ os_unlink.c \ qam.c \ qam_auto.c \ qam_conv.c \ qam_method.c \ qam_open.c \ qam_rec.c \ qam_stat.c \ txn.c \ txn_auto.c \ txn_rec.c \ txn_region.c \ xa.c \ xa_db.c \ xa_map.c libhtdb_la_LDFLAGS = -release $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) pkginclude_HEADERS = \ btree.h \ btree_auto.h \ btree_ext.h \ common_ext.h \ crdel_auto.h \ db.h \ db_am.h \ db_auto.h \ db_config.h \ db_dispatch.h \ db_ext.h \ db_int.h \ db_join.h \ db_page.h \ db_shash.h \ db_swap.h \ debug.h \ env_ext.h \ hash.h \ hash_auto.h \ hash_ext.h \ lock.h \ lock_ext.h \ log.h \ log_auto.h \ log_ext.h \ mp.h \ mp_ext.h \ mutex.h \ mutex_ext.h \ os.h \ os_ext.h \ os_jump.h \ qam.h \ qam_auto.h \ qam_ext.h \ queue.h \ region.h \ shqueue.h \ txn.h \ txn_auto.h \ txn_ext.h \ xa.h \ xa_ext.h subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = db_config.h CONFIG_CLEAN_FILES = db.h LTLIBRARIES = $(pkglib_LTLIBRARIES) libhtdb_la_LIBADD = am_libhtdb_la_OBJECTS = bt_compare.lo bt_conv.lo bt_curadj.lo \ bt_cursor.lo bt_delete.lo bt_method.lo bt_open.lo bt_put.lo \ bt_rec.lo bt_reclaim.lo bt_recno.lo bt_rsearch.lo bt_search.lo \ bt_split.lo bt_stat.lo bt_upgrade.lo btree_auto.lo \ crdel_auto.lo crdel_rec.lo db.lo db_am.lo db_auto.lo \ db_byteorder.lo db_conv.lo db_dispatch.lo db_dup.lo db_err.lo \ db_getlong.lo db_iface.lo db_join.lo db_log2.lo db_meta.lo \ db_method.lo db_overflow.lo db_pr.lo db_rec.lo db_reclaim.lo \ db_ret.lo db_salloc.lo db_shash.lo db_upgrade.lo env_method.lo \ env_open.lo env_recover.lo env_region.lo hash.lo hash_auto.lo \ hash_conv.lo hash_dup.lo hash_func.lo hash_meta.lo \ hash_method.lo hash_page.lo hash_rec.lo hash_reclaim.lo \ hash_stat.lo hash_upgrade.lo lock.lo lock_conflict.lo \ lock_deadlock.lo lock_region.lo lock_util.lo log.lo \ log_archive.lo log_auto.lo log_compare.lo log_findckp.lo \ log_get.lo log_method.lo log_put.lo log_rec.lo log_register.lo \ mp_alloc.lo mp_bh.lo mp_cmpr.lo mp_fget.lo mp_fopen.lo \ mp_fput.lo mp_fset.lo mp_method.lo mp_region.lo mp_register.lo \ mp_stat.lo mp_sync.lo mp_trickle.lo mut_fcntl.lo mut_pthread.lo \ mut_tas.lo mutex.lo os_abs.lo os_alloc.lo os_dir.lo os_errno.lo \ os_fid.lo os_finit.lo os_fsync.lo os_handle.lo os_map.lo \ os_method.lo os_oflags.lo os_open.lo os_region.lo os_rename.lo \ os_root.lo os_rpath.lo os_rw.lo os_seek.lo os_sleep.lo \ os_spin.lo os_stat.lo os_tmpdir.lo os_unlink.lo qam.lo \ qam_auto.lo qam_conv.lo qam_method.lo qam_open.lo qam_rec.lo \ qam_stat.lo txn.lo txn_auto.lo txn_rec.lo txn_region.lo xa.lo \ xa_db.lo xa_map.lo libhtdb_la_OBJECTS = $(am_libhtdb_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libhtdb_la_SOURCES) HEADERS = $(pkginclude_HEADERS) DIST_COMMON = README $(pkginclude_HEADERS) $(srcdir)/Makefile.in \ $(srcdir)/configure Makefile.am acinclude.m4 aclocal.m4 \ config.guess config.sub configure configure.in db.h.in \ db_config.h.in install-sh ltmain.sh missing mkinstalldirs SOURCES = $(libhtdb_la_SOURCES) all: db_config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) db_config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/db_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status db_config.h $(srcdir)/db_config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/db_config.h.in distclean-hdr: -rm -f db_config.h stamp-h1 db.h: $(top_builddir)/config.status db.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhtdb.la: $(libhtdb_la_OBJECTS) $(libhtdb_la_DEPENDENCIES) $(LINK) -rpath $(pkglibdir) $(libhtdb_la_LDFLAGS) $(libhtdb_la_OBJECTS) $(libhtdb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f"; \ $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \ rm -f $(DESTDIR)$(pkgincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) db_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) db_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) db_config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) db_config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__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 $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(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 ../.. && $(mkinstalldirs) "$$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-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { 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-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) db_config.h installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkgincludedir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -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-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS \ uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags dist dist-all \ dist-gzip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-pkgincludeHEADERS \ install-pkglibLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES # 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: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/Makefile.win32���������������������������������������������������������������������0100644�0063146�0012731�00000003624�07675642172�015376� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ TARGET = $(LIBDIR)/libhtdb$(LIBSFX) # ---------------------------------------------------------------------------- # add new library members to this list SRC = bt_compare.c bt_conv.c bt_curadj.c bt_cursor.c bt_delete.c \ bt_method.c bt_open.c bt_put.c bt_rec.c bt_reclaim.c bt_recno.c \ bt_rsearch.c bt_search.c bt_split.c bt_stat.c bt_upgrade.c \ btree_auto.c crdel_auto.c crdel_rec.c db.c db_am.c db_auto.c \ db_byteorder.c db_conv.c db_dispatch.c db_dup.c db_err.c \ db_getlong.c db_iface.c db_join.c db_log2.c db_meta.c db_method.c \ db_overflow.c db_pr.c db_rec.c db_reclaim.c db_ret.c db_salloc.c \ db_shash.c db_upgrade.c env_method.c env_open.c env_recover.c \ env_region.c hash.c hash_auto.c hash_conv.c hash_dup.c hash_func.c \ hash_meta.c hash_method.c hash_page.c hash_rec.c hash_reclaim.c \ hash_stat.c hash_upgrade.c lock.c lock_conflict.c lock_deadlock.c \ lock_region.c lock_util.c log.c log_archive.c log_auto.c \ log_compare.c log_findckp.c log_get.c log_method.c log_put.c \ log_rec.c log_register.c mp_alloc.c mp_bh.c mp_cmpr.c mp_fget.c \ mp_fopen.c mp_fput.c mp_fset.c mp_method.c mp_region.c \ mp_register.c mp_stat.c mp_sync.c mp_trickle.c mut_fcntl.c \ mut_pthread.c mut_tas.c mutex.c os_abs.c os_alloc.c os_dir.c \ os_errno.c os_fid.c os_finit.c os_fsync.c os_handle.c os_map.c \ os_method.c os_oflags.c os_open.c os_region.c os_rename.c \ os_root.c os_rpath.c os_rw.c os_seek.c os_sleep.c os_spin.c \ os_stat.c os_tmpdir.c os_unlink.c qam.c qam_auto.c qam_conv.c \ qam_method.c qam_open.c qam_rec.c qam_stat.c txn.c txn_auto.c \ txn_rec.c txn_region.c xa.c xa_db.c xa_map.c ifdef WINDIR SRC += dirent_local.c endif # ---------------------------------------------------------------------------- include ../Makedefs.win32 $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) include ../Makerules.win32 ������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/README�����������������������������������������������������������������������������0100644�0063146�0012731�00000000407�07426615570�013645� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Berkeley DB-3.0.55 in a single directory Contains a patch to compress pages on the fly. The prefix-symbols.sh script was run to prefix all external symbols with CDB_ so that no conflict with an original library can occur. Tested on RedHat-6.2 and Solaris-2.6 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/acinclude.m4�����������������������������������������������������������������������0100644�0063146�0012731�00000052663�07706720511�015162� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl @(#)mutex.m4 11.9 (Sleepycat) 10/15/99 dnl Figure out mutexes for this compiler/architecture. AC_DEFUN(AM_DEFINE_MUTEXES, [ AC_CACHE_CHECK([for mutexes], db_cv_mutex, [dnl db_cv_mutex=no orig_libs=$LIBS dnl User-specified POSIX mutexes. dnl dnl Assume that -lpthread exists when the user specifies POSIX mutexes. (I dnl only expect this option to be used on Solaris, which has -lpthread.) if test "$db_cv_posixmutexes" = yes; then db_cv_mutex="POSIX/pthreads/library" fi dnl User-specified UI mutexes. dnl dnl Assume that -lthread exists when the user specifies UI mutexes. (I only dnl expect this option to be used on Solaris, which has -lthread.) if test "$db_cv_uimutexes" = yes; then db_cv_mutex="UI/threads/library" fi dnl LWP threads: _lwp_XXX dnl dnl Test for LWP threads before testing for UI/POSIX threads, we prefer them dnl on Solaris. There are two reasons: the Solaris C library has UI/POSIX dnl interface stubs, but they're broken, configuring them for inter-process dnl mutexes doesn't return an error, but it doesn't work either. Second, dnl there's a bug in SunOS 5.7 where applications get pwrite, not pwrite64, dnl if they load the C library before the appropriate threads library, e.g., dnl tclsh using dlopen to load the DB library. Anyway, by using LWP threads dnl we avoid answering lots of user questions, not to mention the bugs. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <synch.h> main(){ static lwp_mutex_t mi = SHAREDMUTEX; static lwp_cond_t ci = SHAREDCV; lwp_mutex_t mutex = mi; lwp_cond_t cond = ci; exit ( _lwp_mutex_lock(&mutex) || _lwp_mutex_unlock(&mutex));} ]])], [db_cv_mutex="Solaris/lwp"], [:]) fi dnl UI threads: thr_XXX dnl dnl Try with and without the -lthread library. if test "$db_cv_mutex" = no; then LIBS="-lthread $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); }]])], [db_cv_mutex="UI/threads/library"], [:]) LIBS="$orig_libs" fi if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); }]])], [db_cv_mutex="UI/threads"], [:]) fi dnl POSIX.1 pthreads: pthread_XXX dnl dnl Try with and without the -lpthread library. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); }]])], [db_cv_mutex="POSIX/pthreads"], [:]) fi if test "$db_cv_mutex" = no; then LIBS="-lpthread $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); }]])], [db_cv_mutex="POSIX/pthreads/library"], [:]) LIBS="$orig_libs" fi dnl msemaphore: HPPA only dnl Try HPPA before general msem test, it needs special alignment. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <sys/mman.h> main(){ #if defined(__hppa) typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); #else exit(1); #endif }]])], [db_cv_mutex="HP/msem_init"], [:]) fi dnl msemaphore: OSF/1 if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <sys/types.h> #include <sys/mman.h>; main(){ typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); }]])], [db_cv_mutex="UNIX/msem_init"], [:]) fi dnl ReliantUNIX if test "$db_cv_mutex" = no; then LIBS="$LIBS -lmproc" AC_TRY_LINK([#include <ulocks.h>], [typedef spinlock_t tsl_t; spinlock_t x; initspin(&x, 1); cspinlock(&x); spinunlock(&x);], [db_cv_mutex="ReliantUNIX/initspin"]) LIBS="$orig_libs" fi dnl SCO: UnixWare has threads in libthread, but OpenServer doesn't. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__USLC__) exit(0); #endif exit(1); }]])], [db_cv_mutex="SCO/x86/cc-assembly"], [:]) fi dnl abilock_t: SGI if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <abi_mutex.h>], [typedef abilock_t tsl_t; abilock_t x; init_lock(&x); acquire_lock(&x); release_lock(&x);], [db_cv_mutex="SGI/init_lock"]) fi dnl sema_t: Solaris dnl The sema_XXX calls do not work on Solaris 5.5. I see no reason to ever dnl turn this test on, unless we find some other platform that uses the old dnl POSIX.1 interfaces. (I plan to move directly to pthreads on Solaris.) if test "$db_cv_mutex" = DOESNT_WORK; then AC_TRY_LINK([#include <synch.h>], [typedef sema_t tsl_t; sema_t x; sema_init(&x, 1, USYNC_PROCESS, NULL); sema_wait(&x); sema_post(&x);], [db_cv_mutex="UNIX/sema_init"]) fi dnl _lock_try/_lock_clear: Solaris if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <sys/machlock.h>], [typedef lock_t tsl_t; lock_t x; _lock_try(&x); _lock_clear(&x);], [db_cv_mutex="Solaris/_lock_try"]) fi dnl _check_lock/_clear_lock: AIX if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <sys/atomic_op.h>], [int x; _check_lock(x,0,1); _clear_lock(x,0);], [db_cv_mutex="AIX/_check_lock"]) fi dnl Alpha/gcc: OSF/1 if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__alpha) #if defined(__GNUC__) exit(0); #endif #endif exit(1);}]])], [db_cv_mutex="ALPHA/gcc-assembly"], [:], [:]) fi dnl PaRisc/gcc: HP/UX if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__hppa) #if defined(__GNUC__) exit(0); #endif #endif exit(1);}]])], [db_cv_mutex="HPPA/gcc-assembly"], [:], [:]) fi dnl Sparc/gcc: SunOS, Solaris dnl The sparc/gcc code doesn't always work, specifically, I've seen assembler dnl failures from the stbar instruction on SunOS 4.1.4/sun4c and gcc 2.7.2.2. if test "$db_cv_mutex" = DOESNT_WORK; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__sparc__) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="Sparc/gcc-assembly"], [:], [:]) fi dnl 68K/gcc: SunOS if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if (defined(mc68020) || defined(sun3)) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="68K/gcc-assembly"], [:], [:]) fi dnl x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(i386) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="x86/gcc-assembly"], [:], [:]) fi dnl: uts/cc: UTS if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(_UTS) exit(0); #endif exit(1); }]])], [db_cv_mutex="UTS/cc-assembly"], [:], [:]) fi ]) if test "$db_cv_mutex" = no; then AC_MSG_WARN( [THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE.]) AC_DEFINE(HAVE_MUTEX_FCNTL,,[Mutex FCNTL]) else AC_DEFINE(HAVE_MUTEX_THREADS,,[Mutex Threads]) fi case "$db_cv_mutex" in 68K/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY,,[Mutex]);; AIX/_check_lock) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK,,[Mutex]);; ALPHA/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY,,[Mutex]);; HP/msem_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT,,[Mutex]);; HPPA/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY,,[Mutex]);; POSIX/pthreads) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_PTHREADS,,[Mutex]);; POSIX/pthreads/library) LIBS="-lpthread $LIBS" AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex pthreads]) AC_DEFINE(HAVE_MUTEX_PTHREADS,,[Mutex pthreads]);; ReliantUNIX/initspin) LIBS="$LIBS -lmproc" AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN,,[Mutex]);; SCO/x86/cc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY,,[Mutex]);; SGI/init_lock) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK,,[Mutex]);; Solaris/_lock_try) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY,,[Mutex]);; Solaris/lwp) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP,,[Mutex]);; Sparc/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY,,[Mutex]);; UI/threads) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_UI_THREADS,,[Mutex]);; UI/threads/library) LIBS="-lthread $LIBS" AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_UI_THREADS,,[Mutex]);; UNIX/msem_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_MSEM_INIT,,[Mutex]);; UNIX/sema_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SEMA_INIT,,[Mutex]);; UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}" AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY,,[Mutex]);; x86/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY,,[Mutex]);; esac ])dnl dnl @(#)options.m4 11.5 (Sleepycat) 10/15/99 dnl Process user-specified options. AC_DEFUN(AM_OPTIONS_SET, [ AC_MSG_CHECKING(if --enable-bigfile option specified) AC_ARG_ENABLE(bigfile, [ --enable-bigfile Enable Linux, AIX, HP/UX, Solaris big files.], [db_cv_bigfile="$enable_bigfile"], [db_cv_bigfile="yes"]) AC_MSG_RESULT($db_cv_bigfile) AC_MSG_CHECKING(if --enable-debug option specified) AC_ARG_ENABLE(debug, [ --enable-debug Build a debugging version.], [db_cv_debug="$enable_debug"], [db_cv_debug="no"]) AC_MSG_RESULT($db_cv_debug) AC_MSG_CHECKING(if --enable-debug_rop option specified) AC_ARG_ENABLE(debug_rop, [ --enable-debug_rop Build a version that logs read operations.], [db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"]) AC_MSG_RESULT($db_cv_debug_rop) AC_MSG_CHECKING(if --enable-debug_wop option specified) AC_ARG_ENABLE(debug_wop, [ --enable-debug_wop Build a version that logs write operations.], [db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"]) AC_MSG_RESULT($db_cv_debug_wop) AC_MSG_CHECKING(if --enable-diagnostic option specified) AC_ARG_ENABLE(diagnostic, [ --enable-diagnostic Build a version with run-time diagnostics.], [db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"]) AC_MSG_RESULT($db_cv_diagnostic) AC_MSG_CHECKING(if --enable-posixmutexes option specified) AC_ARG_ENABLE(posixmutexes, [ --enable-posixmutexes Use POSIX standard mutexes.], [db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"]) AC_MSG_RESULT($db_cv_posixmutexes) AC_MSG_CHECKING(if --enable-uimutexes option specified) AC_ARG_ENABLE(uimutexes, [ --enable-uimutexes Use Unix International mutexes.], [db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"]) AC_MSG_RESULT($db_cv_uimutexes) ])dnl dnl @(#)programs.m4 11.7 (Sleepycat) 9/3/99 dnl Check for programs used in building/installation. AC_DEFUN(AM_PROGRAMS_SET, [ AC_PATH_PROG(db_cv_path_ar, ar, missing_ar) if test "$db_cv_path_ar" = missing_ar; then AC_MSG_ERROR([No ar utility found.]) fi AC_PATH_PROG(db_cv_path_chmod, chmod, missing_chmod) if test "$db_cv_path_chmod" = missing_chmod; then AC_MSG_ERROR([No chmod utility found.]) fi AC_PATH_PROG(db_cv_path_cp, cp, missing_cp) if test "$db_cv_path_cp" = missing_cp; then AC_MSG_ERROR([No cp utility found.]) fi AC_PATH_PROG(db_cv_path_ln, ln, missing_ln) if test "$db_cv_path_ln" = missing_ln; then AC_MSG_ERROR([No ln utility found.]) fi AC_PATH_PROG(db_cv_path_mkdir, mkdir, missing_mkdir) if test "$db_cv_path_mkdir" = missing_mkdir; then AC_MSG_ERROR([No mkdir utility found.]) fi AC_PATH_PROG(db_cv_path_ranlib, ranlib, missing_ranlib) AC_PATH_PROG(db_cv_path_rm, rm, missing_rm) if test "$db_cv_path_rm" = missing_rm; then AC_MSG_ERROR([No rm utility found.]) fi AC_PATH_PROG(db_cv_path_sh, sh, missing_sh) if test "$db_cv_path_sh" = missing_sh; then AC_MSG_ERROR([No sh utility found.]) fi AC_PATH_PROG(db_cv_path_strip, strip, missing_strip) if test "$db_cv_path_strip" = missing_strip; then AC_MSG_ERROR([No strip utility found.]) fi dnl Check for programs used in testing. if test "$db_cv_test" = "yes"; then AC_PATH_PROG(db_cv_path_cmp, cmp, missing_cmp) if test "$db_cv_path_cmp" = missing_cmp; then AC_MSG_ERROR([No cmp utility found.]) fi AC_PATH_PROG(db_cv_path_grep, grep, missing_grep) if test "$db_cv_path_grep" = missing_grep; then AC_MSG_ERROR([No grep utility found.]) fi AC_PATH_PROG(db_cv_path_kill, kill, missing_kill) if test "$db_cv_path_kill" = missing_kill; then AC_MSG_ERROR([No kill utility found.]) fi AC_PATH_PROG(db_cv_path_mv, mv, missing_mv) if test "$db_cv_path_mv" = missing_mv; then AC_MSG_ERROR([No mv utility found.]) fi AC_PATH_PROG(db_cv_path_sed, sed, missing_sed) if test "$db_cv_path_sed" = missing_sed; then AC_MSG_ERROR([No sed utility found.]) fi AC_PATH_PROG(db_cv_path_sleep, sleep, missing_sleep) if test "$db_cv_path_sleep" = missing_sleep; then AC_MSG_ERROR([No sleep utility found.]) fi AC_PATH_PROG(db_cv_path_sort, sort, missing_sort) if test "$db_cv_path_sort" = missing_sort; then AC_MSG_ERROR([No sort utility found.]) fi AC_PATH_PROG(db_cv_path_tr, tr, missing_tr) if test "$db_cv_path_tr" = missing_tr; then AC_MSG_ERROR([No tr utility found.]) fi dnl Programs we want, but don't necessarily have to have. AC_PATH_PROG(db_cv_path_diff, diff) AC_PATH_PROG(db_cv_path_perl5, perl5) fi ])dnl dnl @(#)types.m4 11.2 (Sleepycat) 10/5/99 dnl Check for the standard shorthand types. AC_DEFUN(AM_SHORTHAND_TYPES, [dnl AC_SUBST(ssize_t_decl) AC_CACHE_CHECK([for ssize_t], db_cv_ssize_t, [dnl AC_TRY_COMPILE([#include <sys/types.h>], ssize_t foo;, [db_cv_ssize_t=yes], [db_cv_ssize_t=no], [:])]) if test "$db_cv_ssize_t" = no; then ssize_t_decl="typedef int ssize_t;" fi AC_SUBST(u_char_decl) AC_CACHE_CHECK([for u_char], db_cv_uchar, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_char foo;, [db_cv_uchar=yes], [db_cv_uchar=no], [:])]) if test "$db_cv_uchar" = no; then u_char_decl="typedef unsigned char u_char;" fi AC_SUBST(u_short_decl) AC_CACHE_CHECK([for u_short], db_cv_ushort, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_short foo;, [db_cv_ushort=yes], [db_cv_ushort=no], [:])]) if test "$db_cv_ushort" = no; then u_short_decl="typedef unsigned short u_short;" fi AC_SUBST(u_int_decl) AC_CACHE_CHECK([for u_int], db_cv_uint, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int foo;, [db_cv_uint=yes], [db_cv_uint=no], [:])]) if test "$db_cv_uint" = no; then u_int_decl="typedef unsigned int u_int;" fi AC_SUBST(u_long_decl) AC_CACHE_CHECK([for u_long], db_cv_ulong, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_long foo;, [db_cv_ulong=yes], [db_cv_ulong=no])]) if test "$db_cv_ulong" = no; then u_long_decl="typedef unsigned long u_long;" fi dnl DB/Vi use specific integer sizes. AC_SUBST(u_int8_decl) AC_CACHE_CHECK([for u_int8_t], db_cv_uint8, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int8_t foo;, [db_cv_uint8=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned char) != 1);}]])], [db_cv_uint8="unsigned char"], [db_cv_uint8=no], [:]))]) if test "$db_cv_uint8" = no; then AC_MSG_ERROR(No unsigned 8-bit integral type.) fi if test "$db_cv_uint8" != yes; then u_int8_decl="typedef $db_cv_uint8 u_int8_t;" fi AC_SUBST(u_int16_decl) AC_CACHE_CHECK([for u_int16_t], db_cv_uint16, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int16_t foo;, [db_cv_uint16=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned short) != 2);}]])], [db_cv_uint16="unsigned short"], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned int) != 2);}]])], [db_cv_uint16="unsigned int"], [db_cv_uint16=no], [:])))], [:]) if test "$db_cv_uint16" = no; then AC_MSG_ERROR([No unsigned 16-bit integral type.]) fi if test "$db_cv_uint16" != yes; then u_int16_decl="typedef $db_cv_uint16 u_int16_t;" fi AC_SUBST(int16_decl) AC_CACHE_CHECK([for int16_t], db_cv_int16, [dnl AC_TRY_COMPILE([#include <sys/types.h>], int16_t foo;, [db_cv_int16=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(short) != 2);}]])], [db_cv_int16="short"], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(int) != 2);}]])], [db_cv_int16="int"], [db_cv_int16=no], [:])))], [:]) if test "$db_cv_int16" = no; then AC_MSG_ERROR([No signed 16-bit integral type.]) fi if test "$db_cv_int16" != yes; then int16_decl="typedef $db_cv_int16 int16_t;" fi AC_SUBST(u_int32_decl) AC_CACHE_CHECK([for u_int32_t], db_cv_uint32, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int32_t foo;, [db_cv_uint32=yes], AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 4);}], [db_cv_uint32="unsigned int"], AC_TRY_RUN([main(){exit(sizeof(unsigned long) != 4);}], [db_cv_uint32="unsigned long"], [db_cv_uint32=no], [:])))], [:]) if test "$db_cv_uint32" = no; then AC_MSG_ERROR([No unsigned 32-bit integral type.]) fi if test "$db_cv_uint32" != yes; then u_int32_decl="typedef $db_cv_uint32 u_int32_t;" fi AC_SUBST(int32_decl) AC_CACHE_CHECK([for int32_t], db_cv_int32, [dnl AC_TRY_COMPILE([#include <sys/types.h>], int32_t foo;, [db_cv_int32=yes], AC_TRY_RUN([main(){exit(sizeof(int) != 4);}], [db_cv_int32="int"], AC_TRY_RUN([main(){exit(sizeof(long) != 4);}], [db_cv_int32="long"], [db_cv_int32=no], [:])))], [:]) if test "$db_cv_int32" = no; then AC_MSG_ERROR([No signed 32-bit integral type.]) fi if test "$db_cv_int32" != yes; then int32_decl="typedef $db_cv_int32 int32_t;" fi ])dnl dnl @synopsis CHECK_ZLIB() dnl dnl This macro searches for an installed zlib library. If nothing dnl was specified when calling configure, it searches first in /usr/local dnl and then in /usr. If the --with-zlib=DIR is specified, it will try dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib dnl is specified, the library is not searched at all. dnl dnl If either the header file (zlib.h) or the library (libz) is not dnl found, the configuration exits on error, asking for a valid dnl zlib installation directory or --without-zlib. dnl dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should dnl use autoheader to include a definition for this symbol in a config.h dnl file. Sample usage in a C/C++ source is as follows: dnl dnl #ifdef HAVE_LIBZ dnl #include <zlib.h> dnl #endif /* HAVE_LIBZ */ dnl dnl @version $Id: acinclude.m4,v 1.5 2003/07/21 08:16:09 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_ZLIB, # # Handle user hints # [AC_MSG_CHECKING(if zlib is wanted) AC_ARG_WITH(zlib, [ --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely], [if test "$withval" = no ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi], [ AC_MSG_RESULT(yes) ZLIB_HOME="default path" ]) # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then AC_LANG_SAVE AC_LANG_C AC_MSG_CHECKING(for zlib in $ZLIB_HOME) AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) dnl Only check for library if header is found. This check sets HAVE_LIBZ if test "$zlib_cv_zlib_h" = yes; then AC_CHECK_LIB(z, inflateEnd) fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # AC_MSG_ERROR(Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib.) fi AC_LANG_RESTORE fi ]) dnl @synopsis AC_COMPILE_WARNINGS dnl dnl Set the maximum warning verbosity according to compiler used. dnl Currently supports g++ and gcc. dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in dnl configure.in dnl dnl @version $Id: acinclude.m4,v 1.5 2003/07/21 08:16:09 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_COMPILE_WARNINGS, [AC_MSG_CHECKING(maximum warning verbosity option) if test -n "$CXX" then if test "$GXX" = "yes" then ac_compile_warnings_opt='-Wall' fi CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" fi ac_compile_warnings_opt= if test -n "$CC" then if test "$GCC" = "yes" then ac_compile_warnings_opt='-Wall' fi CFLAGS="$CFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" fi AC_MSG_RESULT($ac_compile_warnings_msg) unset ac_compile_warnings_msg unset ac_compile_warnings_opt ]) �����������������������������������������������������������������������������htdig-3.2.0b6/db/aclocal.m4�������������������������������������������������������������������������0100644�0063146�0012731�00001001721�10057557631�014623� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.7.9 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. dnl @(#)mutex.m4 11.9 (Sleepycat) 10/15/99 dnl Figure out mutexes for this compiler/architecture. AC_DEFUN(AM_DEFINE_MUTEXES, [ AC_CACHE_CHECK([for mutexes], db_cv_mutex, [dnl db_cv_mutex=no orig_libs=$LIBS dnl User-specified POSIX mutexes. dnl dnl Assume that -lpthread exists when the user specifies POSIX mutexes. (I dnl only expect this option to be used on Solaris, which has -lpthread.) if test "$db_cv_posixmutexes" = yes; then db_cv_mutex="POSIX/pthreads/library" fi dnl User-specified UI mutexes. dnl dnl Assume that -lthread exists when the user specifies UI mutexes. (I only dnl expect this option to be used on Solaris, which has -lthread.) if test "$db_cv_uimutexes" = yes; then db_cv_mutex="UI/threads/library" fi dnl LWP threads: _lwp_XXX dnl dnl Test for LWP threads before testing for UI/POSIX threads, we prefer them dnl on Solaris. There are two reasons: the Solaris C library has UI/POSIX dnl interface stubs, but they're broken, configuring them for inter-process dnl mutexes doesn't return an error, but it doesn't work either. Second, dnl there's a bug in SunOS 5.7 where applications get pwrite, not pwrite64, dnl if they load the C library before the appropriate threads library, e.g., dnl tclsh using dlopen to load the DB library. Anyway, by using LWP threads dnl we avoid answering lots of user questions, not to mention the bugs. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <synch.h> main(){ static lwp_mutex_t mi = SHAREDMUTEX; static lwp_cond_t ci = SHAREDCV; lwp_mutex_t mutex = mi; lwp_cond_t cond = ci; exit ( _lwp_mutex_lock(&mutex) || _lwp_mutex_unlock(&mutex));} ]])], [db_cv_mutex="Solaris/lwp"], [:]) fi dnl UI threads: thr_XXX dnl dnl Try with and without the -lthread library. if test "$db_cv_mutex" = no; then LIBS="-lthread $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); }]])], [db_cv_mutex="UI/threads/library"], [:]) LIBS="$orig_libs" fi if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); }]])], [db_cv_mutex="UI/threads"], [:]) fi dnl POSIX.1 pthreads: pthread_XXX dnl dnl Try with and without the -lpthread library. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); }]])], [db_cv_mutex="POSIX/pthreads"], [:]) fi if test "$db_cv_mutex" = no; then LIBS="-lpthread $LIBS" AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); }]])], [db_cv_mutex="POSIX/pthreads/library"], [:]) LIBS="$orig_libs" fi dnl msemaphore: HPPA only dnl Try HPPA before general msem test, it needs special alignment. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <sys/mman.h> main(){ #if defined(__hppa) typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); #else exit(1); #endif }]])], [db_cv_mutex="HP/msem_init"], [:]) fi dnl msemaphore: OSF/1 if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <sys/types.h> #include <sys/mman.h>; main(){ typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); }]])], [db_cv_mutex="UNIX/msem_init"], [:]) fi dnl ReliantUNIX if test "$db_cv_mutex" = no; then LIBS="$LIBS -lmproc" AC_TRY_LINK([#include <ulocks.h>], [typedef spinlock_t tsl_t; spinlock_t x; initspin(&x, 1); cspinlock(&x); spinunlock(&x);], [db_cv_mutex="ReliantUNIX/initspin"]) LIBS="$orig_libs" fi dnl SCO: UnixWare has threads in libthread, but OpenServer doesn't. if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__USLC__) exit(0); #endif exit(1); }]])], [db_cv_mutex="SCO/x86/cc-assembly"], [:]) fi dnl abilock_t: SGI if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <abi_mutex.h>], [typedef abilock_t tsl_t; abilock_t x; init_lock(&x); acquire_lock(&x); release_lock(&x);], [db_cv_mutex="SGI/init_lock"]) fi dnl sema_t: Solaris dnl The sema_XXX calls do not work on Solaris 5.5. I see no reason to ever dnl turn this test on, unless we find some other platform that uses the old dnl POSIX.1 interfaces. (I plan to move directly to pthreads on Solaris.) if test "$db_cv_mutex" = DOESNT_WORK; then AC_TRY_LINK([#include <synch.h>], [typedef sema_t tsl_t; sema_t x; sema_init(&x, 1, USYNC_PROCESS, NULL); sema_wait(&x); sema_post(&x);], [db_cv_mutex="UNIX/sema_init"]) fi dnl _lock_try/_lock_clear: Solaris if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <sys/machlock.h>], [typedef lock_t tsl_t; lock_t x; _lock_try(&x); _lock_clear(&x);], [db_cv_mutex="Solaris/_lock_try"]) fi dnl _check_lock/_clear_lock: AIX if test "$db_cv_mutex" = no; then AC_TRY_LINK([#include <sys/atomic_op.h>], [int x; _check_lock(x,0,1); _clear_lock(x,0);], [db_cv_mutex="AIX/_check_lock"]) fi dnl Alpha/gcc: OSF/1 if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__alpha) #if defined(__GNUC__) exit(0); #endif #endif exit(1);}]])], [db_cv_mutex="ALPHA/gcc-assembly"], [:], [:]) fi dnl PaRisc/gcc: HP/UX if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__hppa) #if defined(__GNUC__) exit(0); #endif #endif exit(1);}]])], [db_cv_mutex="HPPA/gcc-assembly"], [:], [:]) fi dnl Sparc/gcc: SunOS, Solaris dnl The sparc/gcc code doesn't always work, specifically, I've seen assembler dnl failures from the stbar instruction on SunOS 4.1.4/sun4c and gcc 2.7.2.2. if test "$db_cv_mutex" = DOESNT_WORK; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(__sparc__) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="Sparc/gcc-assembly"], [:], [:]) fi dnl 68K/gcc: SunOS if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if (defined(mc68020) || defined(sun3)) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="68K/gcc-assembly"], [:], [:]) fi dnl x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(i386) #if defined(__GNUC__) exit(0); #endif #endif exit(1); }]])], [db_cv_mutex="x86/gcc-assembly"], [:], [:]) fi dnl: uts/cc: UTS if test "$db_cv_mutex" = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ main(){ #if defined(_UTS) exit(0); #endif exit(1); }]])], [db_cv_mutex="UTS/cc-assembly"], [:], [:]) fi ]) if test "$db_cv_mutex" = no; then AC_MSG_WARN( [THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE.]) AC_DEFINE(HAVE_MUTEX_FCNTL,,[Mutex FCNTL]) else AC_DEFINE(HAVE_MUTEX_THREADS,,[Mutex Threads]) fi case "$db_cv_mutex" in 68K/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_68K_GCC_ASSEMBLY,,[Mutex]);; AIX/_check_lock) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_AIX_CHECK_LOCK,,[Mutex]);; ALPHA/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_ALPHA_GCC_ASSEMBLY,,[Mutex]);; HP/msem_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_HPPA_MSEM_INIT,,[Mutex]);; HPPA/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_HPPA_GCC_ASSEMBLY,,[Mutex]);; POSIX/pthreads) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_PTHREADS,,[Mutex]);; POSIX/pthreads/library) LIBS="-lpthread $LIBS" AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex pthreads]) AC_DEFINE(HAVE_MUTEX_PTHREADS,,[Mutex pthreads]);; ReliantUNIX/initspin) LIBS="$LIBS -lmproc" AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN,,[Mutex]);; SCO/x86/cc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY,,[Mutex]);; SGI/init_lock) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SGI_INIT_LOCK,,[Mutex]);; Solaris/_lock_try) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SOLARIS_LOCK_TRY,,[Mutex]);; Solaris/lwp) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SOLARIS_LWP,,[Mutex]);; Sparc/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SPARC_GCC_ASSEMBLY,,[Mutex]);; UI/threads) AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_UI_THREADS,,[Mutex]);; UI/threads/library) LIBS="-lthread $LIBS" AC_DEFINE(HAVE_MUTEX_PTHREAD,,[Mutex]) AC_DEFINE(HAVE_MUTEX_UI_THREADS,,[Mutex]);; UNIX/msem_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_MSEM_INIT,,[Mutex]);; UNIX/sema_init) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_SEMA_INIT,,[Mutex]);; UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}" AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY,,[Mutex]);; x86/gcc-assembly) AC_DEFINE(HAVE_MUTEX_TAS,,[Mutex]) AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY,,[Mutex]);; esac ])dnl dnl @(#)options.m4 11.5 (Sleepycat) 10/15/99 dnl Process user-specified options. AC_DEFUN(AM_OPTIONS_SET, [ AC_MSG_CHECKING(if --enable-bigfile option specified) AC_ARG_ENABLE(bigfile, [ --enable-bigfile Enable Linux, AIX, HP/UX, Solaris big files.], [db_cv_bigfile="$enable_bigfile"], [db_cv_bigfile="yes"]) AC_MSG_RESULT($db_cv_bigfile) AC_MSG_CHECKING(if --enable-debug option specified) AC_ARG_ENABLE(debug, [ --enable-debug Build a debugging version.], [db_cv_debug="$enable_debug"], [db_cv_debug="no"]) AC_MSG_RESULT($db_cv_debug) AC_MSG_CHECKING(if --enable-debug_rop option specified) AC_ARG_ENABLE(debug_rop, [ --enable-debug_rop Build a version that logs read operations.], [db_cv_debug_rop="$enable_debug_rop"], [db_cv_debug_rop="no"]) AC_MSG_RESULT($db_cv_debug_rop) AC_MSG_CHECKING(if --enable-debug_wop option specified) AC_ARG_ENABLE(debug_wop, [ --enable-debug_wop Build a version that logs write operations.], [db_cv_debug_wop="$enable_debug_wop"], [db_cv_debug_wop="no"]) AC_MSG_RESULT($db_cv_debug_wop) AC_MSG_CHECKING(if --enable-diagnostic option specified) AC_ARG_ENABLE(diagnostic, [ --enable-diagnostic Build a version with run-time diagnostics.], [db_cv_diagnostic="$enable_diagnostic"], [db_cv_diagnostic="no"]) AC_MSG_RESULT($db_cv_diagnostic) AC_MSG_CHECKING(if --enable-posixmutexes option specified) AC_ARG_ENABLE(posixmutexes, [ --enable-posixmutexes Use POSIX standard mutexes.], [db_cv_posixmutexes="$enable_posixmutexes"], [db_cv_posixmutexes="no"]) AC_MSG_RESULT($db_cv_posixmutexes) AC_MSG_CHECKING(if --enable-uimutexes option specified) AC_ARG_ENABLE(uimutexes, [ --enable-uimutexes Use Unix International mutexes.], [db_cv_uimutexes="$enable_uimutexes"], [db_cv_uimutexes="no"]) AC_MSG_RESULT($db_cv_uimutexes) ])dnl dnl @(#)programs.m4 11.7 (Sleepycat) 9/3/99 dnl Check for programs used in building/installation. AC_DEFUN(AM_PROGRAMS_SET, [ AC_PATH_PROG(db_cv_path_ar, ar, missing_ar) if test "$db_cv_path_ar" = missing_ar; then AC_MSG_ERROR([No ar utility found.]) fi AC_PATH_PROG(db_cv_path_chmod, chmod, missing_chmod) if test "$db_cv_path_chmod" = missing_chmod; then AC_MSG_ERROR([No chmod utility found.]) fi AC_PATH_PROG(db_cv_path_cp, cp, missing_cp) if test "$db_cv_path_cp" = missing_cp; then AC_MSG_ERROR([No cp utility found.]) fi AC_PATH_PROG(db_cv_path_ln, ln, missing_ln) if test "$db_cv_path_ln" = missing_ln; then AC_MSG_ERROR([No ln utility found.]) fi AC_PATH_PROG(db_cv_path_mkdir, mkdir, missing_mkdir) if test "$db_cv_path_mkdir" = missing_mkdir; then AC_MSG_ERROR([No mkdir utility found.]) fi AC_PATH_PROG(db_cv_path_ranlib, ranlib, missing_ranlib) AC_PATH_PROG(db_cv_path_rm, rm, missing_rm) if test "$db_cv_path_rm" = missing_rm; then AC_MSG_ERROR([No rm utility found.]) fi AC_PATH_PROG(db_cv_path_sh, sh, missing_sh) if test "$db_cv_path_sh" = missing_sh; then AC_MSG_ERROR([No sh utility found.]) fi AC_PATH_PROG(db_cv_path_strip, strip, missing_strip) if test "$db_cv_path_strip" = missing_strip; then AC_MSG_ERROR([No strip utility found.]) fi dnl Check for programs used in testing. if test "$db_cv_test" = "yes"; then AC_PATH_PROG(db_cv_path_cmp, cmp, missing_cmp) if test "$db_cv_path_cmp" = missing_cmp; then AC_MSG_ERROR([No cmp utility found.]) fi AC_PATH_PROG(db_cv_path_grep, grep, missing_grep) if test "$db_cv_path_grep" = missing_grep; then AC_MSG_ERROR([No grep utility found.]) fi AC_PATH_PROG(db_cv_path_kill, kill, missing_kill) if test "$db_cv_path_kill" = missing_kill; then AC_MSG_ERROR([No kill utility found.]) fi AC_PATH_PROG(db_cv_path_mv, mv, missing_mv) if test "$db_cv_path_mv" = missing_mv; then AC_MSG_ERROR([No mv utility found.]) fi AC_PATH_PROG(db_cv_path_sed, sed, missing_sed) if test "$db_cv_path_sed" = missing_sed; then AC_MSG_ERROR([No sed utility found.]) fi AC_PATH_PROG(db_cv_path_sleep, sleep, missing_sleep) if test "$db_cv_path_sleep" = missing_sleep; then AC_MSG_ERROR([No sleep utility found.]) fi AC_PATH_PROG(db_cv_path_sort, sort, missing_sort) if test "$db_cv_path_sort" = missing_sort; then AC_MSG_ERROR([No sort utility found.]) fi AC_PATH_PROG(db_cv_path_tr, tr, missing_tr) if test "$db_cv_path_tr" = missing_tr; then AC_MSG_ERROR([No tr utility found.]) fi dnl Programs we want, but don't necessarily have to have. AC_PATH_PROG(db_cv_path_diff, diff) AC_PATH_PROG(db_cv_path_perl5, perl5) fi ])dnl dnl @(#)types.m4 11.2 (Sleepycat) 10/5/99 dnl Check for the standard shorthand types. AC_DEFUN(AM_SHORTHAND_TYPES, [dnl AC_SUBST(ssize_t_decl) AC_CACHE_CHECK([for ssize_t], db_cv_ssize_t, [dnl AC_TRY_COMPILE([#include <sys/types.h>], ssize_t foo;, [db_cv_ssize_t=yes], [db_cv_ssize_t=no], [:])]) if test "$db_cv_ssize_t" = no; then ssize_t_decl="typedef int ssize_t;" fi AC_SUBST(u_char_decl) AC_CACHE_CHECK([for u_char], db_cv_uchar, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_char foo;, [db_cv_uchar=yes], [db_cv_uchar=no], [:])]) if test "$db_cv_uchar" = no; then u_char_decl="typedef unsigned char u_char;" fi AC_SUBST(u_short_decl) AC_CACHE_CHECK([for u_short], db_cv_ushort, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_short foo;, [db_cv_ushort=yes], [db_cv_ushort=no], [:])]) if test "$db_cv_ushort" = no; then u_short_decl="typedef unsigned short u_short;" fi AC_SUBST(u_int_decl) AC_CACHE_CHECK([for u_int], db_cv_uint, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int foo;, [db_cv_uint=yes], [db_cv_uint=no], [:])]) if test "$db_cv_uint" = no; then u_int_decl="typedef unsigned int u_int;" fi AC_SUBST(u_long_decl) AC_CACHE_CHECK([for u_long], db_cv_ulong, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_long foo;, [db_cv_ulong=yes], [db_cv_ulong=no])]) if test "$db_cv_ulong" = no; then u_long_decl="typedef unsigned long u_long;" fi dnl DB/Vi use specific integer sizes. AC_SUBST(u_int8_decl) AC_CACHE_CHECK([for u_int8_t], db_cv_uint8, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int8_t foo;, [db_cv_uint8=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned char) != 1);}]])], [db_cv_uint8="unsigned char"], [db_cv_uint8=no], [:]))]) if test "$db_cv_uint8" = no; then AC_MSG_ERROR(No unsigned 8-bit integral type.) fi if test "$db_cv_uint8" != yes; then u_int8_decl="typedef $db_cv_uint8 u_int8_t;" fi AC_SUBST(u_int16_decl) AC_CACHE_CHECK([for u_int16_t], db_cv_uint16, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int16_t foo;, [db_cv_uint16=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned short) != 2);}]])], [db_cv_uint16="unsigned short"], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(unsigned int) != 2);}]])], [db_cv_uint16="unsigned int"], [db_cv_uint16=no], [:])))], [:]) if test "$db_cv_uint16" = no; then AC_MSG_ERROR([No unsigned 16-bit integral type.]) fi if test "$db_cv_uint16" != yes; then u_int16_decl="typedef $db_cv_uint16 u_int16_t;" fi AC_SUBST(int16_decl) AC_CACHE_CHECK([for int16_t], db_cv_int16, [dnl AC_TRY_COMPILE([#include <sys/types.h>], int16_t foo;, [db_cv_int16=yes], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(short) != 2);}]])], [db_cv_int16="short"], AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){exit(sizeof(int) != 2);}]])], [db_cv_int16="int"], [db_cv_int16=no], [:])))], [:]) if test "$db_cv_int16" = no; then AC_MSG_ERROR([No signed 16-bit integral type.]) fi if test "$db_cv_int16" != yes; then int16_decl="typedef $db_cv_int16 int16_t;" fi AC_SUBST(u_int32_decl) AC_CACHE_CHECK([for u_int32_t], db_cv_uint32, [dnl AC_TRY_COMPILE([#include <sys/types.h>], u_int32_t foo;, [db_cv_uint32=yes], AC_TRY_RUN([main(){exit(sizeof(unsigned int) != 4);}], [db_cv_uint32="unsigned int"], AC_TRY_RUN([main(){exit(sizeof(unsigned long) != 4);}], [db_cv_uint32="unsigned long"], [db_cv_uint32=no], [:])))], [:]) if test "$db_cv_uint32" = no; then AC_MSG_ERROR([No unsigned 32-bit integral type.]) fi if test "$db_cv_uint32" != yes; then u_int32_decl="typedef $db_cv_uint32 u_int32_t;" fi AC_SUBST(int32_decl) AC_CACHE_CHECK([for int32_t], db_cv_int32, [dnl AC_TRY_COMPILE([#include <sys/types.h>], int32_t foo;, [db_cv_int32=yes], AC_TRY_RUN([main(){exit(sizeof(int) != 4);}], [db_cv_int32="int"], AC_TRY_RUN([main(){exit(sizeof(long) != 4);}], [db_cv_int32="long"], [db_cv_int32=no], [:])))], [:]) if test "$db_cv_int32" = no; then AC_MSG_ERROR([No signed 32-bit integral type.]) fi if test "$db_cv_int32" != yes; then int32_decl="typedef $db_cv_int32 int32_t;" fi ])dnl dnl @synopsis CHECK_ZLIB() dnl dnl This macro searches for an installed zlib library. If nothing dnl was specified when calling configure, it searches first in /usr/local dnl and then in /usr. If the --with-zlib=DIR is specified, it will try dnl to find it in DIR/include/zlib.h and DIR/lib/libz.a. If --without-zlib dnl is specified, the library is not searched at all. dnl dnl If either the header file (zlib.h) or the library (libz) is not dnl found, the configuration exits on error, asking for a valid dnl zlib installation directory or --without-zlib. dnl dnl The macro defines the symbol HAVE_LIBZ if the library is found. You should dnl use autoheader to include a definition for this symbol in a config.h dnl file. Sample usage in a C/C++ source is as follows: dnl dnl #ifdef HAVE_LIBZ dnl #include <zlib.h> dnl #endif /* HAVE_LIBZ */ dnl dnl @version $Id: aclocal.m4,v 1.13 2004/06/03 08:21:45 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(CHECK_ZLIB, # # Handle user hints # [AC_MSG_CHECKING(if zlib is wanted) AC_ARG_WITH(zlib, [ --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely], [if test "$withval" = no ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi], [ AC_MSG_RESULT(yes) ZLIB_HOME="default path" ]) # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then AC_LANG_SAVE AC_LANG_C AC_MSG_CHECKING(for zlib in $ZLIB_HOME) AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no]) dnl Only check for library if header is found. This check sets HAVE_LIBZ if test "$zlib_cv_zlib_h" = yes; then AC_CHECK_LIB(z, inflateEnd) fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # AC_MSG_ERROR(Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib.) fi AC_LANG_RESTORE fi ]) dnl @synopsis AC_COMPILE_WARNINGS dnl dnl Set the maximum warning verbosity according to compiler used. dnl Currently supports g++ and gcc. dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in dnl configure.in dnl dnl @version $Id: aclocal.m4,v 1.13 2004/06/03 08:21:45 angusgb Exp $ dnl @author Loic Dachary <loic@senga.org> dnl AC_DEFUN(AC_COMPILE_WARNINGS, [AC_MSG_CHECKING(maximum warning verbosity option) if test -n "$CXX" then if test "$GXX" = "yes" then ac_compile_warnings_opt='-Wall' fi CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" fi ac_compile_warnings_opt= if test -n "$CC" then if test "$GCC" = "yes" then ac_compile_warnings_opt='-Wall' fi CFLAGS="$CFLAGS $ac_compile_warnings_opt" ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" fi AC_MSG_RESULT($ac_compile_warnings_msg) unset ac_compile_warnings_msg unset ac_compile_warnings_opt ]) # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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. # serial 10 AC_PREREQ([2.54]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # 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], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])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) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. 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([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # 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_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright 2002 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 # 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. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.7.9])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 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. # serial 2 # _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], [AC_FOREACH([_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])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 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. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file 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 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)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 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. # serial 3 # 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 supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 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. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 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. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 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. # 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="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # -*- Autoconf -*- # Copyright (C) 2003 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. # serial 1 # 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])]) # serial 5 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 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. # 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", "GCJ", or "OBJC". # 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 ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$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'. 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 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 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. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _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. FIXME. This creates each `.P' file that we will # 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" ac_aux_dir="$ac_aux_dir"]) ]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 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. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 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. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) 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])]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 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. AC_PREREQ([2.52]) # serial 6 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001, 2002 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. # serial 2 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 47 AC_PROG_LIBTOOL # Debian $Rev: 203 $ # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF [$]* EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ])# AC_PROG_LD # AC_PROG_LD_GNU # -------------- AC_DEFUN([AC_PROG_LD_GNU], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac]) with_gnu_ld=$lt_cv_prog_gnu_ld ])# AC_PROG_LD_GNU # AC_PROG_LD_RELOAD_FLAG # ---------------------- # find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' ])# AC_PROG_LD_RELOAD_FLAG # AC_DEPLIBS_CHECK_METHOD # ----------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext <<EOF int a; void foo (void) { a = 0; } EOF ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; EOF ],[$1],[F77],[cat > conftest.$ac_ext <<EOF subroutine foo implicit none integer*4 a a=0 return end EOF ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF public class foo { private int a; public void bar (void) { a = 0; } }; EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then _LT_AC_TAGVAR(predep_objects, $1)="$p" else _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then _LT_AC_TAGVAR(postdep_objects, $1)="$p" else _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $rm -f confest.$objext case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # -------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat <<EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <<EOF >> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | knetbsd*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $CC in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux*) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds" fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi4*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include <windows.h> # #undef WIN32_LEAN_AND_MEAN # #include <stdio.h> # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include <cygwin/cygwin_dll.h> # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED ]) AC_MSG_RESULT([$SED]) ]) �����������������������������������������������htdig-3.2.0b6/db/alpha.gcc��������������������������������������������������������������������������0100644�0063146�0012731�00000001173�07427026535�014527� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)alpha.gcc 11.1 (Sleepycat) 8/30/99 * * For gcc/alpha, 0 is clear, 1 is set. */ #ifdef __GNUC__ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile( \ "1: ldl_l %0,%1\n" \ " blbs %0,2f\n" \ " mov 1,%0\n" \ " stl_c %0,%1\n" \ " bne %0,1b\n" \ " mb\n" \ "2:" \ : "=&r"(__r), "=m"(*__l) : "m"(*__l) : "memory"); \ __r; \ }) #endif #ifdef __DECC #include <alpha/builtins.h> #define MUTEX_SET(tsl) (__LOCK_LONG_RETRY((tsl), 1) != 0) #endif #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_compare.c�����������������������������������������������������������������������0100644�0063146�0012731�00000012627�07427026535�015251� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_compare.c 11.2 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" #ifdef DEBUG #include "WordMonitor.h" #endif /* DEBUG */ /* * CDB___bam_cmp -- * Compare a key to a given record. * * PUBLIC: int CDB___bam_cmp __P((DB *, const DBT *, * PUBLIC: PAGE *, u_int32_t, int (*)(const DBT *, const DBT *))); */ int CDB___bam_cmp(dbp, dbt, h, indx, func) DB *dbp; const DBT *dbt; PAGE *h; u_int32_t indx; int (*func)__P((const DBT *, const DBT *)); { BINTERNAL *bi; BKEYDATA *bk; BOVERFLOW *bo; DBT pg_dbt; int ret; #ifdef DEBUG word_monitor_add(WORD_MONITOR_CMP, 1); #endif /* DEBUG */ /* * Returns: * < 0 if dbt is < page record * = 0 if dbt is = page record * > 0 if dbt is > page record * * !!! * We do not clear the pg_dbt DBT even though it's likely to contain * random bits. That should be okay, because the app's comparison * routine had better not be looking at fields other than data/size. * We don't clear it because we go through this path a lot and it's * expensive. */ if (TYPE(h) == P_LBTREE || TYPE(h) == P_DUPLICATE) { bk = GET_BKEYDATA(h, indx); if (B_TYPE(bk->type) == B_OVERFLOW) bo = (BOVERFLOW *)bk; else { pg_dbt.data = bk->data; pg_dbt.size = bk->len; return (func(dbt, &pg_dbt)); } } else { /* * The following code guarantees that the left-most key on an * internal page at any level of the btree is less than any * user specified key. This saves us from having to update the * leftmost key on an internal page when the user inserts a new * key in the tree smaller than anything we've seen before. */ if (indx == 0 && h->prev_pgno == PGNO_INVALID) return (1); bi = GET_BINTERNAL(h, indx); if (B_TYPE(bi->type) == B_OVERFLOW) bo = (BOVERFLOW *)(bi->data); else { pg_dbt.data = bi->data; pg_dbt.size = bi->len; return (func(dbt, &pg_dbt)); } } /* * Overflow. * * XXX * We ignore CDB___db_moff() errors, because we have no way of returning * them. */ (void)CDB___db_moff(dbp, dbt, bo->pgno, bo->tlen, func == CDB___bam_defcmp ? NULL : func, &ret); return (ret); } /* * CDB___bam_defcmp -- * Default comparison routine. * * PUBLIC: int CDB___bam_defcmp __P((const DBT *, const DBT *)); */ int CDB___bam_defcmp(a, b) const DBT *a, *b; { size_t len; u_int8_t *p1, *p2; /* * Returns: * < 0 if a is < b * = 0 if a is = b * > 0 if a is > b * * XXX * If a size_t doesn't fit into a long, or if the difference between * any two characters doesn't fit into an int, this routine can lose. * What we need is a signed integral type that's guaranteed to be at * least as large as a size_t, and there is no such thing. */ len = a->size > b->size ? b->size : a->size; for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2) if (*p1 != *p2) return ((long)*p1 - (long)*p2); return ((long)a->size - (long)b->size); } /* * CDB___bam_defpfx -- * Default prefix routine. * * PUBLIC: size_t CDB___bam_defpfx __P((const DBT *, const DBT *)); */ size_t CDB___bam_defpfx(a, b) const DBT *a, *b; { size_t cnt, len; u_int8_t *p1, *p2; cnt = 1; len = a->size > b->size ? b->size : a->size; for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2, ++cnt) if (*p1 != *p2) return (cnt); /* * We know that a->size must be <= b->size, or they wouldn't be * in this order. */ return (a->size < b->size ? a->size + 1 : a->size); } ���������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_conv.c��������������������������������������������������������������������������0100644�0063146�0012731�00000003401�07427026535�014556� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_conv.c 11.2 (Sleepycat) 11/8/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" /* * CDB___bam_pgin -- * Convert host-specific page layout from the host-independent format * stored on disk. * * PUBLIC: int CDB___bam_pgin __P((db_pgno_t, void *, DBT *)); */ int CDB___bam_pgin(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; PAGE *h; pginfo = (DB_PGINFO *)cookie->data; if (!pginfo->needswap) return (0); h = pp; return (h->type == P_BTREEMETA ? CDB___bam_mswap(pp) : CDB___db_byteswap(pg, pp, pginfo->db_pagesize, 1)); } /* * CDB___bam_pgout -- * Convert host-specific page layout to the host-independent format * stored on disk. * * PUBLIC: int CDB___bam_pgout __P((db_pgno_t, void *, DBT *)); */ int CDB___bam_pgout(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; PAGE *h; pginfo = (DB_PGINFO *)cookie->data; if (!pginfo->needswap) return (0); h = pp; return (h->type == P_BTREEMETA ? CDB___bam_mswap(pp) : CDB___db_byteswap(pg, pp, pginfo->db_pagesize, 0)); } /* * CDB___bam_mswap -- * Swap the bytes on the btree metadata page. * * PUBLIC: int CDB___bam_mswap __P((PAGE *)); */ int CDB___bam_mswap(pg) PAGE *pg; { u_int8_t *p; CDB___db_metaswap(pg); p = (u_int8_t *)pg + sizeof(DBMETA); SWAP32(p); /* maxkey */ SWAP32(p); /* minkey */ SWAP32(p); /* re_len */ SWAP32(p); /* re_pad */ SWAP32(p); /* root */ return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_curadj.c������������������������������������������������������������������������0100644�0063146�0012731�00000016557�07427026535�015101� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_curadj.c 11.5 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" #ifdef DEBUG /* * CDB___bam_cprint -- * Display the current cursor list. * * PUBLIC: int CDB___bam_cprint __P((DB *)); */ int CDB___bam_cprint(dbp) DB *dbp; { BTREE_CURSOR *cp; DBC *dbc; MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; fprintf(stderr, "%#0x->%#0x: page: %lu index: %lu dpage %lu dindex: %lu recno: %lu", (u_int)dbc, (u_int)cp, (u_long)cp->pgno, (u_long)cp->indx, (u_long)cp->dpgno, (u_long)cp->dindx, (u_long)cp->recno); if (F_ISSET(cp, C_DELETED)) fprintf(stderr, " (deleted)"); fprintf(stderr, "\n"); } MUTEX_THREAD_UNLOCK(dbp->mutexp); return (0); } #endif /* DEBUG */ /* * CDB___bam_ca_delete -- * Update the cursors when items are deleted and when already deleted * items are overwritten. Return the number of relevant cursors found. * * PUBLIC: int CDB___bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int)); */ int CDB___bam_ca_delete(dbp, pgno, indx, delete) DB *dbp; db_pgno_t pgno; u_int32_t indx; int delete; { BTREE_CURSOR *cp; DBC *dbc; int count; /* !!!: Has to contain max number of cursors. */ /* Recno is responsible for its own adjustments. */ if (dbp->type == DB_RECNO) return (0); /* * Adjust the cursors. We don't have to review the cursors for any * thread of control other than the current one, because we have the * page write locked at this point, and any other thread of control * had better be using a different locker ID, meaning only cursors in * our thread of control can be on the page. * * It's possible for multiple cursors within the thread to have write * locks on the same page, but, cursors within a thread must be single * threaded, so all we're locking here is the cursor linked list. */ MUTEX_THREAD_LOCK(dbp->mutexp); for (count = 0, dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; if ((cp->pgno == pgno && cp->indx == indx) || (cp->dpgno == pgno && cp->dindx == indx)) { if (delete) F_SET(cp, C_DELETED); else F_CLR(cp, C_DELETED); ++count; } } MUTEX_THREAD_UNLOCK(dbp->mutexp); return (count); } /* * CDB___bam_ca_di -- * Adjust the cursors during a delete or insert. * * PUBLIC: void CDB___bam_ca_di __P((DB *, db_pgno_t, u_int32_t, int)); */ void CDB___bam_ca_di(dbp, pgno, indx, adjust) DB *dbp; db_pgno_t pgno; u_int32_t indx; int adjust; { BTREE_CURSOR *cp; DBC *dbc; /* Recno is responsible for its own adjustments. */ if (dbp->type == DB_RECNO) return; /* * Adjust the cursors. See the comment in CDB___bam_ca_delete(). */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; if (cp->pgno == pgno && cp->indx >= indx) { /* Cursor indices should never be negative. */ DB_ASSERT(cp->indx != 0 || adjust > 0); cp->indx += adjust; } if (cp->dpgno == pgno && cp->dindx >= indx) { /* Cursor indices should never be negative. */ DB_ASSERT(cp->dindx != 0 || adjust > 0); cp->dindx += adjust; } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___bam_ca_dup -- * Adjust the cursors when moving items from a leaf page to a duplicates * page. * * PUBLIC: void CDB___bam_ca_dup __P((DB *, * PUBLIC: db_pgno_t, u_int32_t, u_int32_t, db_pgno_t, u_int32_t)); */ void CDB___bam_ca_dup(dbp, fpgno, first, fi, tpgno, ti) DB *dbp; db_pgno_t fpgno, tpgno; u_int32_t first, fi, ti; { BTREE_CURSOR *cp; DBC *dbc; /* Recno is responsible for its own adjustments. */ if (dbp->type == DB_RECNO) return; /* * Adjust the cursors. See the comment in CDB___bam_ca_delete(). */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; /* * Ignore matching entries that have already been moved, * we move from the same location on the leaf page more * than once. */ if (cp->dpgno == PGNO_INVALID && cp->pgno == fpgno && cp->indx == fi) { cp->indx = first; cp->dpgno = tpgno; cp->dindx = ti; } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___bam_ca_rsplit -- * Adjust the cursors when doing reverse splits. * * PUBLIC: void CDB___bam_ca_rsplit __P((DB *, db_pgno_t, db_pgno_t)); */ void CDB___bam_ca_rsplit(dbp, fpgno, tpgno) DB *dbp; db_pgno_t fpgno, tpgno; { BTREE_CURSOR *cp; DBC *dbc; /* Recno is responsible for its own adjustments. */ if (dbp->type == DB_RECNO) return; /* * Adjust the cursors. See the comment in CDB___bam_ca_delete(). */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; if (cp->pgno == fpgno) cp->pgno = tpgno; } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___bam_ca_split -- * Adjust the cursors when splitting a page. * * PUBLIC: void CDB___bam_ca_split __P((DB *, * PUBLIC: db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int)); */ void CDB___bam_ca_split(dbp, ppgno, lpgno, rpgno, split_indx, cleft) DB *dbp; db_pgno_t ppgno, lpgno, rpgno; u_int32_t split_indx; int cleft; { BTREE_CURSOR *cp; DBC *dbc; /* Recno is responsible for its own adjustments. */ if (dbp->type == DB_RECNO) return; /* * Adjust the cursors. See the comment in CDB___bam_ca_delete(). * * If splitting the page that a cursor was on, the cursor has to be * adjusted to point to the same record as before the split. Most * of the time we don't adjust pointers to the left page, because * we're going to copy its contents back over the original page. If * the cursor is on the right page, it is decremented by the number of * records split to the left page. */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; if (cp->pgno == ppgno) { if (cp->indx < split_indx) { if (cleft) cp->pgno = lpgno; } else { cp->pgno = rpgno; cp->indx -= split_indx; } } if (cp->dpgno == ppgno) { if (cp->dindx < split_indx) { if (cleft) cp->dpgno = lpgno; } else { cp->dpgno = rpgno; cp->dindx -= split_indx; } } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___bam_ca_repl -- * Adjust the cursors when when doing a replace. * * PUBLIC: void CDB___bam_ca_repl __P((DB *, * PUBLIC: db_pgno_t, u_int32_t, db_pgno_t, u_int32_t)); */ void CDB___bam_ca_repl(dbp, dpgno, dindx, newpgno, newindx) DB *dbp; db_pgno_t dpgno, newpgno; u_int32_t dindx, newindx; { BTREE_CURSOR *cp; DBC *dbc; MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (BTREE_CURSOR *)dbc->internal; if (cp->dpgno == dpgno && cp->dindx == dindx) { cp->dpgno = newpgno; cp->dindx = newindx; } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } �������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_cursor.c������������������������������������������������������������������������0100644�0063146�0012731�00000142704�07427026535�015140� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_cursor.c 11.21 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "lock.h" #include "qam.h" static int CDB___bam_c_close __P((DBC *)); static int CDB___bam_c_del __P((DBC *, u_int32_t)); static int CDB___bam_c_destroy __P((DBC *)); static int CDB___bam_c_first __P((DBC *)); static int CDB___bam_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___bam_c_getstack __P((DBC *)); static int CDB___bam_c_last __P((DBC *)); static int CDB___bam_c_next __P((DBC *, int)); static int CDB___bam_c_physdel __P((DBC *)); static int CDB___bam_c_prev __P((DBC *)); static int CDB___bam_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); static void CDB___bam_c_reset __P((BTREE_CURSOR *)); static int CDB___bam_c_rget __P((DBC *, DBT *, u_int32_t)); static int CDB___bam_c_search __P((DBC *, const DBT *, u_int32_t, int *)); static int CDB___bam_dsearch __P((DBC *, DBT *, u_int32_t *)); static int CDB___bam_dup __P((DBC *, u_int32_t, int)); /* * Acquire a new page/lock for the cursor. If we hold a page/lock, discard * the page, and lock-couple the lock. * * !!! * We have to handle both where we have a lock to lock-couple and where we * don't -- we don't duplicate locks when we duplicate cursors if we are * running in a transaction environment as there's no point if locks are * never discarded. This means that the cursor may or may no hold a lock. */ #undef ACQUIRE #define ACQUIRE(dbc, pgno, mode, ret) { \ BTREE_CURSOR *__cp = (dbc)->internal; \ if (__cp->page != NULL) { \ ret = CDB_memp_fput((dbc)->dbp->mpf, __cp->page, 0); \ __cp->page = NULL; \ } else \ ret = 0; \ if (ret == 0 && mode != DB_LOCK_NG && \ (ret = CDB___db_lget(dbc, \ __cp->lock.off == LOCK_INVALID ? 0 : 1, \ pgno, mode, 0, &__cp->lock)) != 0) \ __cp->lock_mode = mode; \ if (ret == 0) \ ret = CDB_memp_fget( \ (dbc)->dbp->mpf, &(pgno), 0, &__cp->page); \ } /* * Acquire a write lock if we don't already have one. * * !!! * See ACQUIRE macro on why we handle cursors that don't have locks. */ #undef ACQUIRE_WRITE_LOCK #define ACQUIRE_WRITE_LOCK(dbc, ret) { \ BTREE_CURSOR *__cp = (dbc)->internal; \ if (F_ISSET((dbc)->dbp->dbenv, DB_ENV_LOCKING) && \ __cp->lock_mode != DB_LOCK_WRITE && \ ((ret) = CDB___db_lget(dbc, \ __cp->lock.off == LOCK_INVALID ? 0 : 1, \ __cp->pgno, DB_LOCK_WRITE, 0, &__cp->lock)) == 0) \ __cp->lock_mode = DB_LOCK_WRITE; \ } /* Discard the current page/lock held by a cursor. */ #undef DISCARD #define DISCARD(dbc, ret) { \ BTREE_CURSOR *__cp = (dbc)->internal; \ int __t_ret; \ if (__cp->page != NULL) { \ ret = CDB_memp_fput((dbc)->dbp->mpf, __cp->page, 0); \ __cp->page = NULL; \ } else \ ret = 0; \ if (__cp->lock.off != LOCK_INVALID) { \ if ((__t_ret = \ __TLPUT((dbc), __cp->lock)) != 0 && (ret) == 0) \ ret = __t_ret; \ __cp->lock.off = LOCK_INVALID; \ __cp->lock_mode = DB_LOCK_NG; \ } \ } /* If the cursor references a deleted record. */ #undef IS_CUR_DELETED #define IS_CUR_DELETED(cp) \ (((cp)->dpgno == PGNO_INVALID && \ B_DISSET(GET_BKEYDATA((cp)->page, \ (cp)->indx + O_INDX)->type)) || \ ((cp)->dpgno != PGNO_INVALID && \ B_DISSET(GET_BKEYDATA((cp)->page, (cp)->dindx)->type))) /* If the cursor and index combination references a deleted record. */ #undef IS_DELETED #define IS_DELETED(cp, indx) \ (((cp)->dpgno == PGNO_INVALID && \ B_DISSET(GET_BKEYDATA((cp)->page, (indx) + O_INDX)->type)) || \ ((cp)->dpgno != PGNO_INVALID && \ B_DISSET(GET_BKEYDATA((cp)->page, (indx))->type))) /* * Test to see if two cursors could point to duplicates of the same key, * whether on-page or off-page. The leaf page numbers must be the same * in both cases. In the case of off-page duplicates, the key indices * on the leaf page will be the same. In the case of on-page duplicates, * the duplicate page number must not be set, and the key index offsets * must be the same. For the last test, as the saved copy of the cursor * will not have a valid page pointer, we use the cursor's. */ #undef POSSIBLE_DUPLICATE #define POSSIBLE_DUPLICATE(cursor, copy) \ ((cursor)->pgno == (copy)->pgno && \ ((cursor)->indx == (copy)->indx || \ ((cursor)->dpgno == PGNO_INVALID && \ (copy)->dpgno == PGNO_INVALID && \ (cursor)->page->inp[(cursor)->indx] == \ (cursor)->page->inp[(copy)->indx]))) /* * CDB___bam_c_reset -- * Initialize internal cursor structure. */ static void CDB___bam_c_reset(cp) BTREE_CURSOR *cp; { cp->sp = cp->csp = cp->stack; cp->esp = cp->stack + sizeof(cp->stack) / sizeof(cp->stack[0]); cp->page = NULL; cp->pgno = PGNO_INVALID; cp->indx = 0; cp->dpgno = PGNO_INVALID; cp->dindx = 0; cp->lock.off = LOCK_INVALID; cp->lock_mode = DB_LOCK_NG; cp->recno = RECNO_OOB; cp->flags = 0; } /* * CDB___bam_c_init -- * Initialize the access private portion of a cursor * * PUBLIC: int CDB___bam_c_init __P((DBC *)); */ int CDB___bam_c_init(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; int ret; dbp = dbc->dbp; /* Allocate the internal structure. */ if ((ret = CDB___os_calloc(1, sizeof(BTREE_CURSOR), &cp)) != 0) return (ret); /* * Logical record numbers are always the same size, and we don't want * to have to check for space every time we return one. Allocate it * in advance. */ if (dbp->type == DB_RECNO || F_ISSET(dbp, DB_BT_RECNUM)) { if ((ret = CDB___os_malloc(sizeof(db_recno_t), NULL, &dbc->rkey.data)) != 0) { CDB___os_free(cp, sizeof(BTREE_CURSOR)); return (ret); } dbc->rkey.ulen = sizeof(db_recno_t); } /* Initialize methods. */ dbc->internal = cp; if (dbp->type == DB_BTREE) { dbc->c_am_close = CDB___bam_c_close; dbc->c_am_destroy = CDB___bam_c_destroy; dbc->c_del = CDB___bam_c_del; dbc->c_get = CDB___bam_c_get; dbc->c_put = CDB___bam_c_put; } else { dbc->c_am_close = CDB___bam_c_close; dbc->c_am_destroy = CDB___bam_c_destroy; dbc->c_del = CDB___ram_c_del; dbc->c_get = CDB___ram_c_get; dbc->c_put = CDB___ram_c_put; } /* Initialize dynamic information. */ CDB___bam_c_reset(cp); return (0); } /* * CDB___bam_c_dup -- * Duplicate a btree cursor, such that the new one holds appropriate * locks for the position of the original. * * PUBLIC: int CDB___bam_c_dup __P((DBC *, DBC *)); */ int CDB___bam_c_dup(orig_dbc, new_dbc) DBC *orig_dbc, *new_dbc; { BTREE_CURSOR *orig, *new; orig = orig_dbc->internal; new = new_dbc->internal; CDB___bam_c_reset(new); new->pgno = orig->pgno; new->indx = orig->indx; new->dpgno = orig->dpgno; new->dindx = orig->dindx; new->recno = orig->recno; new->lock_mode = orig->lock_mode; if (orig->lock.off == LOCK_INVALID) return (0); /* * If we are in a transaction, then we do not need to reacquire * a lock, because we automatically hold all locks until transaction * completion. */ if (orig_dbc->txn == NULL) return (CDB___db_lget(new_dbc, 0, new->pgno, new->lock_mode, 0, &new->lock)); return (0); } /* * CDB___bam_c_close -- * Close down the cursor from a single use. */ static int CDB___bam_c_close(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; int ret, t_ret; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* * If a cursor deleted a btree key, perform the actual deletion. * (Recno keys are either deleted immediately or never deleted.) */ if (dbp->type == DB_BTREE && F_ISSET(cp, C_DELETED)) ret = CDB___bam_c_physdel(dbc); /* Discard any locks not acquired inside of a transaction. */ if (cp->lock.off != LOCK_INVALID) { if ((t_ret = __TLPUT(dbc, cp->lock)) != 0 && ret == 0) ret = t_ret; cp->lock.off = LOCK_INVALID; } /* Confirm that the stack has been emptied. */ DB_ASSERT(cp->csp == cp->stack); /* Initialize dynamic information. */ CDB___bam_c_reset(cp); return (ret); } /* * CDB___bam_c_destroy -- * Close a single cursor -- internal version. */ static int CDB___bam_c_destroy(dbc) DBC *dbc; { /* Discard the structures. */ CDB___os_free(dbc->internal, sizeof(BTREE_CURSOR)); return (0); } /* * CDB___bam_c_del -- * Delete using a cursor. */ static int CDB___bam_c_del(dbc, flags) DBC *dbc; u_int32_t flags; { BTREE_CURSOR *cp; DB *dbp; PAGE *h; db_pgno_t pgno; db_indx_t indx; int ret; dbp = dbc->dbp; cp = dbc->internal; h = NULL; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cdelchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY), cp->pgno != PGNO_INVALID)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "bam_c_del", NULL, NULL, flags); /* If already deleted, return failure. */ if (F_ISSET(cp, C_DELETED)) return (DB_KEYEMPTY); /* * If we are running CDB, this had better be either a write * cursor or an immediate writer. If it's a regular writer, * that means we have an IWRITE lock and we need to upgrade * it to a write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EPERM); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } /* * We don't physically delete the record until the cursor moves, so * we have to have a long-lived write lock on the page instead of a * a long-lived read lock. * * We have to have a read lock to even get here. We lock-couple so * that we don't lose our read lock on failure. That's probably not * necessary, our only failure mode is deadlock and once we deadlock * the cursor shouldn't have to support further operations. */ ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) goto err; /* * Acquire the underlying page and set the on-page and in-cursor * delete flags. */ if (cp->dpgno == PGNO_INVALID) { pgno = cp->pgno; indx = cp->indx; } else { pgno = cp->dpgno; indx = cp->dindx; } if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; /* Log the change. */ if (DB_LOGGING(dbc) && (ret = CDB___bam_cdel_log(dbp->dbenv, dbc->txn, &LSN(h), 0, dbp->log_fileid, PGNO(h), &LSN(h), indx)) != 0) goto err; /* Set the intent-to-delete flag on the page and update all cursors. */ if (cp->dpgno == PGNO_INVALID) B_DSET(GET_BKEYDATA(h, indx + O_INDX)->type); else B_DSET(GET_BKEYDATA(h, indx)->type); (void)CDB___bam_ca_delete(dbp, pgno, indx, 1); if ((ret = CDB_memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) goto err; h = NULL; /* * If the tree has record numbers, we have to adjust the counts. * * !!! * This test is right -- we don't yet support duplicates and record * numbers in the same tree, so ignore duplicates if DB_BT_RECNUM * set. */ if (F_ISSET(dbp, DB_BT_RECNUM)) { if ((ret = CDB___bam_c_getstack(dbc)) != 0) goto err; if ((ret = CDB___bam_adjust(dbc, -1)) != 0) goto err; (void)CDB___bam_stkrel(dbc, 0); } err: if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); /* Release the upgraded lock. */ if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___bam_c_get -- * Get using a cursor (btree). */ static int CDB___bam_c_get(dbc_orig, key, data, flags) DBC *dbc_orig; DBT *key, *data; u_int32_t flags; { BTREE_CURSOR *cp, *orig, start; DB *dbp; DBC *dbc; PAGE *h; u_int32_t tmp_rmw; int exact, ret; dbp = dbc_orig->dbp; orig = dbc_orig->internal; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cgetchk(dbp, key, data, flags, orig->pgno != PGNO_INVALID)) != 0) return (ret); /* Clear OR'd in additional bits so we can check for flag equality. */ tmp_rmw = LF_ISSET(DB_RMW); LF_CLR(DB_RMW); DEBUG_LREAD(dbc_orig, dbc_orig->txn, "bam_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); /* * Return a cursor's record number. It has nothing to do with the * cursor get code except that it's been rammed into the interface. */ if (flags == DB_GET_RECNO) return (CDB___bam_c_rget(dbc_orig, data, flags | tmp_rmw)); /* Get a copy of the original cursor, including position. */ if ((ret = dbc_orig->c_dup(dbc_orig, &dbc, DB_POSITIONI)) != 0) return (ret); if (tmp_rmw) F_SET(dbc, DBC_RMW); cp = dbc->internal; switch (flags) { case DB_CURRENT: /* It's not possible to return a deleted record. */ if (F_ISSET(orig, C_DELETED)) { ret = DB_KEYEMPTY; goto err; } /* * Acquire the current page. We have at least a read-lock * already. The caller may have set DB_RMW asking for a * write lock, but any upgrade to a write lock has no better * chance of succeeding now instead of later, so we don't try. */ if ((ret = CDB_memp_fget(dbp->mpf, cp->dpgno == PGNO_INVALID ? &cp->pgno : &cp->dpgno, 0, &cp->page)) != 0) goto err; break; case DB_NEXT_DUP: if (cp->pgno == PGNO_INVALID) { ret = EINVAL; goto err; } if ((ret = CDB___bam_c_next(dbc, 1)) != 0) goto err; /* Make sure we didn't go past the end of the duplicates. */ if (!POSSIBLE_DUPLICATE(cp, orig)) { ret = DB_NOTFOUND; goto err; } break; case DB_NEXT: if (cp->pgno != PGNO_INVALID) { if ((ret = CDB___bam_c_next(dbc, 1)) != 0) goto err; break; } /* FALLTHROUGH */ case DB_FIRST: if ((ret = CDB___bam_c_first(dbc)) != 0) goto err; break; case DB_PREV: if (cp->pgno != PGNO_INVALID) { if ((ret = CDB___bam_c_prev(dbc)) != 0) goto err; break; } /* FALLTHROUGH */ case DB_LAST: if ((ret = CDB___bam_c_last(dbc)) != 0) goto err; break; case DB_SET: if ((ret = CDB___bam_c_search(dbc, key, flags, &exact)) != 0) goto err; /* * We cannot be referencing a non-existent or deleted record * because we specified an exact match. We may be referencing * off-page duplicates. * * If we're referencing off-page duplicates, move off-page. * If we moved off-page, move to the next non-deleted record. * If we moved to the next non-deleted record, check to make * sure we didn't switch records because our current record * had no non-deleted data items. */ start = *cp; if ((ret = CDB___bam_dup(dbc, cp->indx, 0)) != 0) goto err; if (cp->dpgno != PGNO_INVALID && IS_CUR_DELETED(cp)) { if ((ret = CDB___bam_c_next(dbc, 0)) != 0) goto err; if (!POSSIBLE_DUPLICATE(cp, &start)) { ret = DB_NOTFOUND; goto err; } } break; case DB_SET_RECNO: if ((ret = CDB___bam_c_search(dbc, key, flags, &exact)) != 0) goto err; break; case DB_GET_BOTH: if (F_ISSET(dbc, DBC_CONTINUE)) { /* Acquire the current page. */ if ((ret = CDB_memp_fget(dbp->mpf, cp->dpgno == PGNO_INVALID ? &cp->pgno : &cp->dpgno, 0, &cp->page)) != 0) goto err; /* Move to the next item. */ start = *cp; if ((ret = CDB___bam_c_next(dbc, 1)) != 0) goto err; /* Verify that we haven't moved to a new key. */ if (!POSSIBLE_DUPLICATE(cp, &start)) { ret = DB_NOTFOUND; goto err; } } else { if ((ret = CDB___bam_c_search(dbc, key, flags, &exact)) != 0) goto err; /* * We cannot be referencing a non-existent or deleted * record because we specified an exact match. We may * be referencing off-page duplicates. */ if ((ret = CDB___bam_dup(dbc, cp->indx, 0)) != 0) goto err; } /* Search for a matching entry. */ if ((ret = CDB___bam_dsearch(dbc, data, NULL)) != 0) goto err; /* Ignore deleted entries. */ if (IS_CUR_DELETED(cp)) { ret = DB_NOTFOUND; goto err; } break; case DB_SET_RANGE: if ((ret = CDB___bam_c_search(dbc, key, flags, &exact)) != 0) goto err; /* * As we didn't require an exact match, the search function * may have returned an entry past the end of the page. Or, * we may be referencing a deleted record. If so, move to * the next entry. */ if (cp->indx == NUM_ENT(cp->page) || IS_CUR_DELETED(cp)) if ((ret = CDB___bam_c_next(dbc, 0)) != 0) goto err; /* * If we're referencing off-page duplicates, move off-page. * If we moved off-page, move to the next non-deleted record. */ if ((ret = CDB___bam_dup(dbc, cp->indx, 0)) != 0) goto err; if (cp->dpgno != PGNO_INVALID && IS_CUR_DELETED(cp)) if ((ret = CDB___bam_c_next(dbc, 0)) != 0) goto err; break; } /* * Return the key if the user didn't give us one. If we've moved to * a duplicate page, we may no longer have a pointer to the main page, * so we have to go get it. We know that it's already read-locked, * however, so we don't have to acquire a new lock. */ if (flags != DB_SET) { if (cp->dpgno != PGNO_INVALID) { if ((ret = CDB_memp_fget(dbp->mpf, &cp->pgno, 0, &h)) != 0) goto err; } else h = cp->page; ret = CDB___db_ret(dbp, h, cp->indx, key, &dbc->rkey.data, &dbc->rkey.ulen); if (cp->dpgno != PGNO_INVALID) (void)CDB_memp_fput(dbp->mpf, h, 0); if (ret) goto err; } /* Return the data. */ if ((ret = CDB___db_ret(dbp, cp->page, cp->dpgno == PGNO_INVALID ? cp->indx + O_INDX : cp->dindx, data, &dbc->rdata.data, &dbc->rdata.ulen)) != 0) goto err; /* Release the current page. */ if ((ret = CDB_memp_fput(dbp->mpf, cp->page, 0)) != 0) goto err; cp->page = NULL; /* Release the temporary lock upgrade. */ if (tmp_rmw) F_CLR(dbc, DBC_RMW); /* * Swap the cursors so we are left with the new position inside of * the original DBCs structure, and close the dup'd cursor once it * references the old position. * * The close can fail, but we only expect DB_LOCK_DEADLOCK failures. * This violates our "the cursor is unchanged on error" semantics, * but since all you can do with a DB_LOCK_DEADLOCK failure is close * the cursor, I believe that's OK. */ orig = dbc_orig->internal; dbc_orig->internal = dbc->internal; dbc->internal = orig; ret = dbc->c_close(dbc); if (0) { err: /* Discard any page we acquired. */ if (cp->page != NULL) (void)CDB_memp_fput(dbp->mpf, cp->page, 0); /* Close the newly dup'd cursor. */ (void)dbc->c_close(dbc); } return (ret); } /* * CDB___bam_dsearch -- * Search for a matching data item (or the first data item that's * equal to or greater than the one we're searching for). */ static int CDB___bam_dsearch(dbc, data, iflagp) DBC *dbc; DBT *data; u_int32_t *iflagp; /* Non-NULL if we're doing an insert. */ { BTREE_CURSOR *cp, copy, last; DB *dbp; int cmp, ret; dbp = dbc->dbp; cp = dbc->internal; /* If the duplicates are off-page, use the duplicate search routine. */ if (cp->dpgno != PGNO_INVALID) { if ((ret = CDB___db_dsearch(dbc, iflagp != NULL, data, cp->dpgno, &cp->dindx, &cp->page, &cmp)) != 0) return (ret); cp->dpgno = cp->page->pgno; if (iflagp == NULL) { if (cmp != 0) return (DB_NOTFOUND); return (0); } *iflagp = DB_BEFORE; return (0); } /* Otherwise, do the search ourselves. */ copy = *cp; for (;;) { /* Save the last interesting cursor position. */ last = *cp; /* See if the data item matches the one we're looking for. */ if ((cmp = CDB___bam_cmp(dbp, data, cp->page, cp->indx + O_INDX, dbp->dup_compare == NULL ? CDB___bam_defcmp : dbp->dup_compare)) == 0) { if (iflagp != NULL) *iflagp = DB_AFTER; return (0); } /* * If duplicate entries are sorted, we're done if we find a * page entry that sorts greater than the application item. * If doing an insert, return success, otherwise DB_NOTFOUND. */ if (dbp->dup_compare != NULL && cmp < 0) { if (iflagp == NULL) return (DB_NOTFOUND); *iflagp = DB_BEFORE; return (0); } /* * Move to the next item. If we reach the end of the page and * we're doing an insert, set the cursor to the last item and * set the referenced memory location so callers know to insert * after the item, instead of before it. If not inserting, we * return DB_NOTFOUND. */ if ((cp->indx += P_INDX) >= NUM_ENT(cp->page)) { if (iflagp == NULL) return (DB_NOTFOUND); goto use_last; } /* * Make sure we didn't go past the end of the duplicates. The * error conditions are the same as above. */ if (!POSSIBLE_DUPLICATE(cp, ©)) { if (iflagp == NULL) return (DB_NOTFOUND); use_last: *cp = last; *iflagp = DB_AFTER; return (0); } } /* NOTREACHED */ } /* * CDB___bam_c_rget -- * Return the record number for a cursor. */ static int CDB___bam_c_rget(dbc, data, flags) DBC *dbc; DBT *data; u_int32_t flags; { BTREE_CURSOR *cp; DB *dbp; DBT dbt; db_recno_t recno; int exact, ret; COMPQUIET(flags, 0); dbp = dbc->dbp; cp = dbc->internal; /* Get the page with the current item on it. */ if ((ret = CDB_memp_fget(dbp->mpf, &cp->pgno, 0, &cp->page)) != 0) return (ret); /* Get a copy of the key. */ memset(&dbt, 0, sizeof(DBT)); dbt.flags = DB_DBT_MALLOC | DB_DBT_INTERNAL; if ((ret = CDB___db_ret(dbp, cp->page, cp->indx, &dbt, NULL, NULL)) != 0) goto err; exact = 1; if ((ret = CDB___bam_search(dbc, &dbt, F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND, 1, &recno, &exact)) != 0) goto err; ret = CDB___db_retcopy(dbp, data, &recno, sizeof(recno), &dbc->rdata.data, &dbc->rdata.ulen); /* Release the stack. */ CDB___bam_stkrel(dbc, 0); err: (void)CDB_memp_fput(dbp->mpf, cp->page, 0); CDB___os_free(dbt.data, dbt.size); return (ret); } /* * CDB___bam_c_put -- * Put using a cursor. */ static int CDB___bam_c_put(dbc_orig, key, data, flags) DBC *dbc_orig; DBT *key, *data; u_int32_t flags; { BTREE_CURSOR *cp, *orig; DB *dbp; DBC *dbc; DBT dbt; db_indx_t indx; db_pgno_t pgno; u_int32_t iiop; int exact, needkey, ret, ret_ignore, stack; void *arg; dbp = dbc_orig->dbp; orig = dbc_orig->internal; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cputchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), orig->pgno != PGNO_INVALID)) != 0) return (ret); DEBUG_LWRITE(dbc_orig, dbc_orig->txn, "bam_c_put", flags == DB_KEYFIRST || flags == DB_KEYLAST ? key : NULL, data, flags); /* * If we are running CDB, this had better be either a write * cursor or an immediate writer. If it's a regular writer, * that means we have an IWRITE lock and we need to upgrade * it to a write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { if (!F_ISSET(dbc_orig, DBC_WRITECURSOR | DBC_WRITER)) return (EPERM); if (F_ISSET(dbc_orig, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc_orig->locker, DB_LOCK_UPGRADE, &dbc_orig->lock_dbt, DB_LOCK_WRITE, &dbc_orig->mylock)) != 0) return (ret); } if (0) { split: /* * To split, we need a valid key for the page, and since it's * a cursor, we may have to build one. Get a copy of a key * from the page. */ if (needkey) { memset(&dbt, 0, sizeof(DBT)); if ((ret = CDB___db_ret(dbp, cp->page, indx, &dbt, &dbc->rkey.data, &dbc->rkey.ulen)) != 0) goto err; arg = &dbt; } else arg = key; /* * Discard any locks and pinned pages (the locks are discarded * even if we're running with transactions, as they lock pages * that we're sorry we ever acquired). If stack is set and the * cursor entries are valid, they point to the same entries as * the stack, don't free them twice. */ if (stack) { (void)CDB___bam_stkrel(dbc, 1); stack = 0; } else { DISCARD(dbc, ret); if (ret != 0) goto err; } /* Close the newly dup'd cursor. */ (void)dbc->c_close(dbc); /* Split the tree. */ if ((ret = CDB___bam_split(dbc_orig, arg)) != 0) return (ret); } /* Get a copy of the original cursor, including position. */ if ((ret = dbc_orig->c_dup(dbc_orig, &dbc, DB_POSITIONI)) != 0) return (ret); cp = dbc->internal; needkey = ret = stack = 0; switch (flags) { case DB_AFTER: case DB_BEFORE: case DB_CURRENT: needkey = 1; if (cp->dpgno == PGNO_INVALID) { pgno = cp->pgno; indx = cp->indx; } else { pgno = cp->dpgno; indx = cp->dindx; } /* * !!! * This test is right -- we don't yet support duplicates and * record numbers in the same tree, so ignore duplicates if * DB_BT_RECNUM set. */ if (F_ISSET(dbp, DB_BT_RECNUM) && (flags != DB_CURRENT || F_ISSET(orig, C_DELETED))) { /* Acquire a complete stack. */ if ((ret = CDB___bam_c_getstack(dbc)) != 0) goto err; cp->page = cp->csp->page; stack = 1; } else { /* Acquire the current page with a write lock. */ ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &cp->page)) != 0) goto err; } iiop = flags; break; case DB_KEYFIRST: case DB_KEYLAST: /* * If we have a duplicate comparison function, we position to * the first of any on-page duplicates, and use CDB___bam_dsearch * to search for the right slot. Otherwise, we position to * the first/last of any on-page duplicates based on the flag * value. */ if ((ret = CDB___bam_c_search(dbc, key, flags == DB_KEYFIRST || dbp->dup_compare != NULL ? DB_KEYFIRST : DB_KEYLAST, &exact)) != 0) goto err; stack = 1; /* * If an exact match: * If duplicates aren't supported, replace the current * item. (When implementing the DB->put function, our * caller has already checked the DB_NOOVERWRITE flag.) * * If there's a duplicate comparison function, find the * correct slot for this duplicate item. * * If there's no duplicate comparison function, set the * insert flag based on the argument flags. * * If there's no match, the search function returned the * smallest slot greater than the key, use it. */ if (exact) { if (F_ISSET(dbp, DB_AM_DUP)) { /* * If at off-page duplicate page, move to the * first or last entry -- if a comparison * function was specified, start searching at * the first entry. Otherwise, move based on * the DB_KEYFIRST/DB_KEYLAST flags. */ if ((ret = CDB___bam_dup(dbc, cp->indx, dbp->dup_compare == NULL && flags != DB_KEYFIRST)) != 0) goto err; /* * If there's a comparison function, search for * the correct slot. Otherwise, set the insert * flag based on the argment flag. */ if (dbp->dup_compare == NULL) iiop = flags == DB_KEYFIRST ? DB_BEFORE : DB_AFTER; else if ((ret = CDB___bam_dsearch( dbc, data, &iiop)) != 0) goto err; } else iiop = DB_CURRENT; } else iiop = DB_KEYFIRST; if (cp->dpgno == PGNO_INVALID) { pgno = cp->pgno; indx = cp->indx; } else { pgno = cp->dpgno; indx = cp->dindx; } break; } ret = CDB___bam_iitem(dbc, &cp->page, &indx, key, data, iiop, 0); if (ret == DB_NEEDSPLIT) goto split; if (ret != 0) goto err; /* * Discard any pages pinned in the tree and their locks, except for * the leaf page, for which we only discard the pin, not the lock. * * Note, the leaf page participated in the stack we acquired, and so * we have to adjust the stack as necessary. If there was only a * single page on the stack, we don't have to free further stack pages. */ if (stack && BT_STK_POP(cp) != NULL) (void)CDB___bam_stkrel(dbc, 0); /* Release the current page. */ if ((ret = CDB_memp_fput(dbp->mpf, cp->page, 0)) != 0) goto err; /* * Swap the cursors so we are left with the new position inside of * the original DBCs structure, and close the dup'd cursor once it * references the old position. * * The close can fail, but we only expect DB_LOCK_DEADLOCK failures. * This violates our "the cursor is unchanged on error" semantics, * but since all you can do with a DB_LOCK_DEADLOCK failure is close * the cursor, I believe that's OK. */ orig = dbc_orig->internal; dbc_orig->internal = dbc->internal; dbc->internal = orig; ret = dbc->c_close(dbc); if (0) { err: /* Discard any page(s) we acquired. */ if (stack) (void)CDB___bam_stkrel(dbc, 0); else DISCARD(dbc, ret_ignore); /* Close the newly dup'd cursor. */ (void)dbc->c_close(dbc); } /* Release the upgraded lock. */ if (F_ISSET(dbc_orig, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc_orig->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___bam_c_first -- * Return the first record. */ static int CDB___bam_c_first(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; db_pgno_t pgno; int ret; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* Walk down the left-hand side of the tree. */ for (pgno = ((BTREE *)dbp->bt_internal)->bt_root;;) { ACQUIRE(dbc, pgno, DB_LOCK_READ, ret); if (ret != 0) return (ret); /* If we find a leaf page, we're done. */ if (ISLEAF(cp->page)) break; pgno = GET_BINTERNAL(cp->page, 0)->pgno; } /* If we want a write lock instead of a read lock, get it now. */ if (F_ISSET(dbc, DBC_RMW)) { ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) return (ret); } cp->pgno = cp->page->pgno; cp->indx = 0; cp->dpgno = PGNO_INVALID; /* * If we're referencing off-page duplicates, move off-page. * If on an empty page or a deleted record, move to the next one. */ if (NUM_ENT(cp->page) > 0) if ((ret = CDB___bam_dup(dbc, cp->indx, 0)) != 0) return (ret); if (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(cp)) if ((ret = CDB___bam_c_next(dbc, 0)) != 0) return (ret); return (0); } /* * CDB___bam_c_last -- * Return the last record. */ static int CDB___bam_c_last(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; db_pgno_t pgno; int ret; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* Walk down the right-hand side of the tree. */ for (pgno = ((BTREE *)dbp->bt_internal)->bt_root;;) { ACQUIRE(dbc, pgno, DB_LOCK_READ, ret); if (ret != 0) return (ret); /* If we find a leaf page, we're done. */ if (ISLEAF(cp->page)) break; pgno = GET_BINTERNAL(cp->page, NUM_ENT(cp->page) - O_INDX)->pgno; } /* If we want a write lock instead of a read lock, get it now. */ if (F_ISSET(dbc, DBC_RMW)) { ACQUIRE_WRITE_LOCK(dbc, ret); if (ret != 0) return (ret); } cp->pgno = cp->page->pgno; cp->indx = NUM_ENT(cp->page) == 0 ? 0 : NUM_ENT(cp->page) - P_INDX; cp->dpgno = PGNO_INVALID; /* * If we're referencing off-page duplicates, move off-page. * If on an empty page or a deleted record, move to the previous one. */ if (NUM_ENT(cp->page) > 0) if ((ret = CDB___bam_dup(dbc, cp->indx, 1)) != 0) return (ret); if (NUM_ENT(cp->page) == 0 || IS_CUR_DELETED(cp)) if ((ret = CDB___bam_c_prev(dbc)) != 0) return (ret); return (0); } /* * CDB___bam_c_next -- * Move to the next record. */ static int CDB___bam_c_next(dbc, initial_move) DBC *dbc; int initial_move; { BTREE_CURSOR *cp; DB *dbp; db_indx_t adjust, indx; db_lockmode_t lock_mode; db_pgno_t pgno; int ret; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* * We're either moving through a page of duplicates or a btree leaf * page. */ if (cp->dpgno == PGNO_INVALID) { adjust = dbp->type == DB_BTREE ? P_INDX : O_INDX; pgno = cp->pgno; indx = cp->indx; lock_mode = F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } else { adjust = O_INDX; pgno = cp->dpgno; indx = cp->dindx; lock_mode = DB_LOCK_NG; } if (cp->page == NULL) { ACQUIRE(dbc, pgno, lock_mode, ret); if (ret != 0) return (ret); } /* * If at the end of the page, move to a subsequent page. * * !!! * Check for >= NUM_ENT. If we're here as the result of a search that * landed us on NUM_ENT, we'll increment indx before we test. * * !!! * This code handles empty pages and pages with only deleted entries. */ if (initial_move) indx += adjust; for (;;) { if (indx >= NUM_ENT(cp->page)) { /* * If we're in a btree leaf page, we've reached the end * of the tree. If we've reached the end of a page of * duplicates, continue from the btree leaf page where * we found this page of duplicates. */ pgno = cp->page->next_pgno; if (pgno == PGNO_INVALID) { /* If in a btree leaf page, it's EOF. */ if (cp->dpgno == PGNO_INVALID) return (DB_NOTFOUND); /* Continue from the last btree leaf page. */ cp->dpgno = PGNO_INVALID; adjust = P_INDX; pgno = cp->pgno; indx = cp->indx + P_INDX; lock_mode = F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } else indx = 0; ACQUIRE(dbc, pgno, lock_mode, ret); if (ret != 0) return (ret); continue; } /* Ignore deleted records. */ if (IS_DELETED(cp, indx)) { indx += adjust; continue; } /* * If we're not in a duplicates page, check to see if we've * found a page of duplicates, in which case we move to the * first entry. */ if (cp->dpgno == PGNO_INVALID) { cp->pgno = cp->page->pgno; cp->indx = indx; if ((ret = CDB___bam_dup(dbc, indx, 0)) != 0) return (ret); if (cp->dpgno != PGNO_INVALID) { indx = cp->dindx; adjust = O_INDX; continue; } } else { cp->dpgno = cp->page->pgno; cp->dindx = indx; } break; } return (0); } /* * CDB___bam_c_prev -- * Move to the previous record. */ static int CDB___bam_c_prev(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; db_indx_t indx, adjust; db_lockmode_t lock_mode; db_pgno_t pgno; int ret, set_indx; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* * We're either moving through a page of duplicates or a btree leaf * page. */ if (cp->dpgno == PGNO_INVALID) { adjust = dbp->type == DB_BTREE ? P_INDX : O_INDX; pgno = cp->pgno; indx = cp->indx; lock_mode = F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } else { adjust = O_INDX; pgno = cp->dpgno; indx = cp->dindx; lock_mode = DB_LOCK_NG; } if (cp->page == NULL) { ACQUIRE(dbc, pgno, lock_mode, ret); if (ret != 0) return (ret); } /* * If at the beginning of the page, move to any previous one. * * !!! * This code handles empty pages and pages with only deleted entries. */ for (;;) { if (indx == 0) { /* * If we're in a btree leaf page, we've reached the * beginning of the tree. If we've reached the first * of a page of duplicates, continue from the btree * leaf page where we found this page of duplicates. */ pgno = cp->page->prev_pgno; if (pgno == PGNO_INVALID) { /* If in a btree leaf page, it's SOF. */ if (cp->dpgno == PGNO_INVALID) return (DB_NOTFOUND); /* Continue from the last btree leaf page. */ cp->dpgno = PGNO_INVALID; adjust = P_INDX; pgno = cp->pgno; indx = cp->indx; set_indx = 0; lock_mode = F_ISSET(dbc, DBC_RMW) ? DB_LOCK_WRITE : DB_LOCK_READ; } else set_indx = 1; ACQUIRE(dbc, pgno, lock_mode, ret); if (ret != 0) return (ret); if (set_indx) indx = NUM_ENT(cp->page); if (indx == 0) continue; } /* Ignore deleted records. */ indx -= adjust; if (IS_DELETED(cp, indx)) continue; /* * If we're not in a duplicates page, check to see if we've * found a page of duplicates, in which case we move to the * last entry. */ if (cp->dpgno == PGNO_INVALID) { cp->pgno = cp->page->pgno; cp->indx = indx; if ((ret = CDB___bam_dup(dbc, indx, 1)) != 0) return (ret); if (cp->dpgno != PGNO_INVALID) { indx = cp->dindx + O_INDX; adjust = O_INDX; continue; } } else { cp->dpgno = cp->page->pgno; cp->dindx = indx; } break; } return (0); } /* * CDB___bam_c_search -- * Move to a specified record. */ static int CDB___bam_c_search(dbc, key, flags, exactp) DBC *dbc; const DBT *key; u_int32_t flags; int *exactp; { BTREE *t; BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; PAGE *h; db_recno_t recno; db_indx_t indx; u_int32_t sflags; int cmp, ret; dbp = dbc->dbp; cp = dbc->internal; t = dbp->bt_internal; ret = 0; /* Discard any previously held position. */ DISCARD(dbc, ret); if (ret != 0) return (ret); /* Find an entry in the database. */ switch (flags) { case DB_SET_RECNO: if ((ret = CDB___ram_getno(dbc, key, &recno, 0)) != 0) return (ret); sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND) | S_EXACT; ret = CDB___bam_rsearch(dbc, &recno, sflags, 1, exactp); break; case DB_SET: case DB_GET_BOTH: sflags = (F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND) | S_EXACT; goto search; case DB_SET_RANGE: sflags = (F_ISSET(dbc, DBC_RMW) ? S_WRITE : S_READ) | S_DUPFIRST; goto search; case DB_KEYFIRST: sflags = S_KEYFIRST; goto fast_search; case DB_KEYLAST: sflags = S_KEYLAST; fast_search: /* * If the application has a history of inserting into the first * or last pages of the database, we check those pages first to * avoid doing a full search. * * Record numbers can't be fast-tracked, the entire tree has to * be locked. */ h = NULL; lock.off = LOCK_INVALID; if (F_ISSET(dbp, DB_BT_RECNUM)) goto search; /* Check if the application has a history of sorted input. */ if (t->bt_lpgno == PGNO_INVALID) goto search; /* * Lock and retrieve the page on which we did the last insert. * It's okay if it doesn't exist, or if it's not the page type * we expected, it just means that the world changed. */ cp->lock_mode = DB_LOCK_WRITE; if (CDB___db_lget(dbc, 0, t->bt_lpgno, cp->lock_mode, 0, &lock)) goto fast_miss; if (CDB_memp_fget(dbp->mpf, &t->bt_lpgno, 0, &h)) goto fast_miss; if (TYPE(h) != P_LBTREE) goto fast_miss; if (NUM_ENT(h) == 0) goto fast_miss; /* * What we do here is test to see if we're at the beginning or * end of the tree and if the new item sorts before/after the * first/last page entry. We don't try and catch inserts into * the middle of the tree (although we could, as long as there * were two keys on the page and we saved both the index and * the page number of the last insert). */ if (h->next_pgno == PGNO_INVALID) { indx = NUM_ENT(h) - P_INDX; if ((cmp = CDB___bam_cmp(dbp, key, h, indx, t->bt_compare)) < 0) goto try_begin; if (cmp > 0) { indx += P_INDX; goto fast_hit; } /* * Found a duplicate. If doing DB_KEYLAST, we're at * the correct position, otherwise, move to the first * of the duplicates. */ if (flags == DB_KEYLAST) goto fast_hit; for (; indx > 0 && h->inp[indx - P_INDX] == h->inp[indx]; indx -= P_INDX) ; goto fast_hit; } try_begin: if (h->prev_pgno == PGNO_INVALID) { indx = 0; if ((cmp = CDB___bam_cmp(dbp, key, h, indx, t->bt_compare)) > 0) goto fast_miss; if (cmp < 0) goto fast_hit; /* * Found a duplicate. If doing DB_KEYFIRST, we're at * the correct position, otherwise, move to the last * of the duplicates. */ if (flags == DB_KEYFIRST) goto fast_hit; for (; indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && h->inp[indx] == h->inp[indx + P_INDX]; indx += P_INDX) ; goto fast_hit; } goto fast_miss; fast_hit: /* Set the exact match flag, we may have found a duplicate. */ *exactp = cmp == 0; /* Enter the entry in the stack. */ BT_STK_CLR(cp); BT_STK_ENTER(cp, h, indx, lock, cp->lock_mode, ret); break; fast_miss: if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); /* * This is not the right page, so logically we do not need to * retain the lock. */ if (lock.off != LOCK_INVALID) (void)__LPUT(dbc, lock); search: ret = CDB___bam_search(dbc, key, sflags, 1, NULL, exactp); break; default: /* XXX: Impossible. */ abort(); /* NOTREACHED */ } if (ret != 0) return (ret); /* Initialize the cursor to reference the returned page. */ cp->page = cp->csp->page; cp->pgno = cp->csp->page->pgno; cp->indx = cp->csp->indx; cp->dpgno = PGNO_INVALID; cp->lock = cp->csp->lock; cp->lock_mode = cp->csp->lock_mode; /* * If we inserted a key into the first or last slot of the tree, * remember where it was so we can do it more quickly next time. */ if (flags == DB_KEYFIRST || flags == DB_KEYLAST) t->bt_lpgno = ((cp->page->next_pgno == PGNO_INVALID && cp->indx >= NUM_ENT(cp->page)) || (cp->page->prev_pgno == PGNO_INVALID && cp->indx == 0)) ? cp->pgno : PGNO_INVALID; return (0); } /* * CDB___bam_dup -- * Check for an off-page duplicates entry, and if found, move to the * first or last entry. */ static int CDB___bam_dup(dbc, indx, last_dup) DBC *dbc; u_int32_t indx; int last_dup; { BOVERFLOW *bo; BTREE_CURSOR *cp; DB *dbp; db_pgno_t pgno; int ret; dbp = dbc->dbp; cp = dbc->internal; /* We should be referencing a valid entry on the page. */ DB_ASSERT(NUM_ENT(cp->page) > 0); /* * It's possible that the entry is deleted, in which case it doesn't * have duplicates. */ if (IS_CUR_DELETED(cp)) return (0); /* * Check for an overflow entry. If we find one, move to the * duplicates page, and optionally move to the last record on * that page. * * !!! * We don't lock duplicates pages, we've already got the correct * lock on the main page. */ bo = GET_BOVERFLOW(cp->page, indx + O_INDX); if (B_TYPE(bo->type) != B_DUPLICATE) return (0); pgno = bo->pgno; if ((ret = CDB_memp_fput(dbp->mpf, cp->page, 0)) != 0) return (ret); cp->page = NULL; if (last_dup) { if ((ret = CDB___db_dend(dbc, pgno, &cp->page)) != 0) return (ret); indx = NUM_ENT(cp->page) - O_INDX; } else { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &cp->page)) != 0) return (ret); indx = 0; } /* Update the cursor's duplicate information. */ cp->dpgno = cp->page->pgno; cp->dindx = indx; return (0); } /* * CDB___bam_c_physdel -- * Actually do the cursor deletion. */ static int CDB___bam_c_physdel(dbc) DBC *dbc; { enum { DELETE_ITEM, DELETE_PAGE, NOTHING_FURTHER } cmd; BOVERFLOW bo; BTREE_CURSOR *cp; DB *dbp; DBT dbt; DB_LOCK lock; PAGE *h; db_indx_t indx; db_pgno_t pgno, next_pgno, prev_pgno, root_pgno; int delete_page, local_page, ret; dbp = dbc->dbp; cp = dbc->internal; delete_page = ret = 0; /* Figure out what we're deleting. */ if (cp->dpgno == PGNO_INVALID) { pgno = cp->pgno; indx = cp->indx; } else { pgno = cp->dpgno; indx = cp->dindx; } /* * If the item is referenced by another cursor, make sure that * cursor's delete flag is set and leave it up to it to do the * delete. * * !!! * This test for > 0 is tricky. This code is called when we close * a cursor. In this case, we've already removed the cursor from * the active queue, so we won't see it in CDB___bam_ca_delete. */ if (CDB___bam_ca_delete(dbp, pgno, indx, 1) > 0) return (0); /* * If this is concurrent DB, upgrade the lock if necessary. */ if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); /* * Lock and retrieve the current page. We potentially have to acquire * a new lock here if the cursor that did the original logical deletion * and which already has a write lock is not the cursor that is doing * the physical deletion and which may only have a read lock. */ if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); local_page = 1; /* * If we're deleting a duplicate entry and there are other duplicate * entries remaining, call the common code to do the work and fix up * the parent page as necessary. Otherwise, do a normal btree delete. * * There are 5 possible cases: * * 1. It's not a duplicate item: do a normal btree delete. * 2. It's a duplicate item: * 2a: We delete an item from a page of duplicates, but there are * more items on the page. * 2b: We delete the last item from a page of duplicates, deleting * the last duplicate. * 2c: We delete the last item from a page of duplicates, but there * is a previous page of duplicates. * 2d: We delete the last item from a page of duplicates, but there * is a following page of duplicates. * * In the case of: * * 1: There's nothing further to do. * 2a: There's nothing further to do. * 2b: Do the normal btree delete instead of a duplicate delete, as * that deletes both the duplicate chain and the parent page's * entry. * 2c: There's nothing further to do. * 2d: Delete the duplicate, and update the parent page's entry. */ if (TYPE(h) == P_DUPLICATE) { pgno = PGNO(h); prev_pgno = PREV_PGNO(h); next_pgno = NEXT_PGNO(h); if (NUM_ENT(h) == 1 && prev_pgno == PGNO_INVALID && next_pgno == PGNO_INVALID) cmd = DELETE_PAGE; else { cmd = DELETE_ITEM; /* Delete the duplicate. */ if ((ret = CDB___db_drem(dbc, &h, indx)) != 0) goto err; /* * Update the cursors. * * !!! * The page referenced by h may have been modified, * don't use its page number. */ CDB___bam_ca_di(dbp, pgno, indx, -1); /* * 2a: h != NULL, h->pgno == pgno * 2b: We don't reach this clause, as the above test * was true. * 2c: h == NULL, prev_pgno != PGNO_INVALID * 2d: h != NULL, next_pgno != PGNO_INVALID * * Test for 2a and 2c: if we didn't empty the current * page or there was a previous page of duplicates, we * don't need to touch the parent page. */ if ((h != NULL && pgno == h->pgno) || prev_pgno != PGNO_INVALID) cmd = NOTHING_FURTHER; } /* * Release any page we're holding and its lock. * * !!! * If there is no subsequent page in the duplicate chain, then * CDB___db_drem will have put page "h" and set it to NULL. */ if (local_page) { if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); local_page = 0; } if (cmd == NOTHING_FURTHER) goto done; /* Acquire the parent page and switch the index to its entry. */ if ((ret = CDB___db_lget(dbc, 0, cp->pgno, DB_LOCK_WRITE, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &cp->pgno, 0, &h)) != 0) { (void)__TLPUT(dbc, lock); goto err; } local_page = 1; indx = cp->indx; if (cmd == DELETE_PAGE) goto btd; /* * Copy, delete, update, add-back the parent page's data entry. * * XXX * This may be a performance/logging problem. We should add a * log message which simply logs/updates a random set of bytes * on a page, and use it instead of doing a delete/add pair. */ indx += O_INDX; bo = *GET_BOVERFLOW(h, indx); if ((ret = CDB___db_ditem(dbc, h, indx, BOVERFLOW_SIZE)) != 0) goto err; bo.pgno = next_pgno; memset(&dbt, 0, sizeof(dbt)); dbt.data = &bo; dbt.size = BOVERFLOW_SIZE; if ((ret = CDB___db_pitem(dbc, h, indx, BOVERFLOW_SIZE, &dbt, NULL)) != 0) goto err; if ((ret = CDB_memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) goto err; goto done; } btd: /* * If the page is going to be emptied, delete it. To delete a leaf * page we need a copy of a key from the page. We use the 0th page * index since it's the last key that the page held. * * We malloc the page information instead of using the return key/data * memory because we've already set them -- the reason we've already * set them is because we're (potentially) about to do a reverse split, * which would make our saved page information useless. * * !!! * The following operations to delete a page might deadlock. I think * that's OK. The problem is if we're deleting an item because we're * closing cursors because we've already deadlocked and want to call * CDB_txn_abort(). If we fail due to deadlock, we leave a locked empty * page in the tree, which won't be empty long because we're going to * undo the delete. */ root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; if (!F_ISSET(dbp, DB_BT_REVSPLIT) && NUM_ENT(h) == 2 && h->pgno != root_pgno) { memset(&dbt, 0, sizeof(DBT)); dbt.flags = DB_DBT_MALLOC | DB_DBT_INTERNAL; if ((ret = CDB___db_ret(dbp, h, 0, &dbt, NULL, NULL)) != 0) goto err; delete_page = 1; } /* * Do a normal btree delete. * * !!! * Delete the key item first, otherwise the duplicate checks in * CDB___bam_ditem() won't work! */ if ((ret = CDB___bam_ditem(dbc, h, indx)) != 0) goto err; if ((ret = CDB___bam_ditem(dbc, h, indx)) != 0) goto err; /* Discard any remaining locks/pages. */ if (local_page) { (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); local_page = 0; } /* Delete the page if it was emptied. */ if (delete_page) ret = CDB___bam_dpage(dbc, &dbt); err: done: if (delete_page) CDB___os_free(dbt.data, dbt.size); if (local_page) { /* * It's possible for h to be NULL, as CDB___db_drem may have * been relinking pages by the time that it deadlocked. */ if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); } if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___bam_c_getstack -- * Acquire a full stack for a cursor. */ static int CDB___bam_c_getstack(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; DBT dbt; PAGE *h; db_pgno_t pgno; int exact, ret; dbp = dbc->dbp; cp = dbc->internal; memset(&dbt, 0, sizeof(DBT)); h = NULL; ret = 0; /* Get the page with the current item on it. */ pgno = cp->pgno; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); /* Get a copy of a key from the page. */ dbt.flags = DB_DBT_MALLOC | DB_DBT_INTERNAL; if ((ret = CDB___db_ret(dbp, h, 0, &dbt, NULL, NULL)) != 0) goto err; /* Get a write-locked stack for that page. */ exact = 0; ret = CDB___bam_search(dbc, &dbt, S_KEYFIRST, 1, NULL, &exact); /* We no longer need the key or the page. */ err: if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); if (dbt.data != NULL) CDB___os_free(dbt.data, dbt.size); return (ret); } ������������������������������������������������������������htdig-3.2.0b6/db/bt_delete.c������������������������������������������������������������������������0100644�0063146�0012731�00000037747�07427026535�015077� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_delete.c 11.6 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "lock.h" /* * CDB___bam_delete -- * Delete the items referenced by a key. * * PUBLIC: int CDB___bam_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); */ int CDB___bam_delete(dbp, txn, key, flags) DB *dbp; DB_TXN *txn; DBT *key; u_int32_t flags; { DBC *dbc; DBT lkey; DBT data; u_int32_t f_init, f_next; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del"); /* Check for invalid flags. */ if ((ret = CDB___db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) return (ret); /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "bam_delete", key, NULL, flags); /* * Walk a cursor through the key/data pairs, deleting as we go. Set * the DB_DBT_USERMEM flag, as this might be a threaded application * and the flags checking will catch us. We don't actually want the * keys or data, so request a partial of length 0. */ memset(&lkey, 0, sizeof(lkey)); F_SET(&lkey, DB_DBT_USERMEM | DB_DBT_PARTIAL); memset(&data, 0, sizeof(data)); F_SET(&data, DB_DBT_USERMEM | DB_DBT_PARTIAL); /* If locking, set read-modify-write flag. */ f_init = DB_SET; f_next = DB_NEXT_DUP; if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { f_init |= DB_RMW; f_next |= DB_RMW; } /* Walk through the set of key/data pairs, deleting as we go. */ if ((ret = dbc->c_get(dbc, key, &data, f_init)) != 0) goto err; for (;;) { if ((ret = dbc->c_del(dbc, 0)) != 0) goto err; if ((ret = dbc->c_get(dbc, &lkey, &data, f_next)) != 0) { if (ret == DB_NOTFOUND) { ret = 0; break; } goto err; } } err: /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___bam_ditem -- * Delete one or more entries from a page. * * PUBLIC: int CDB___bam_ditem __P((DBC *, PAGE *, u_int32_t)); */ int CDB___bam_ditem(dbc, h, indx) DBC *dbc; PAGE *h; u_int32_t indx; { BINTERNAL *bi; BKEYDATA *bk; BOVERFLOW *bo; DB *dbp; u_int32_t nbytes; int ret; dbp = dbc->dbp; switch (TYPE(h)) { case P_IBTREE: bi = GET_BINTERNAL(h, indx); switch (B_TYPE(bi->type)) { case B_DUPLICATE: case B_OVERFLOW: nbytes = BINTERNAL_SIZE(bi->len); bo = (BOVERFLOW *)bi->data; goto offpage; case B_KEYDATA: nbytes = BINTERNAL_SIZE(bi->len); break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } break; case P_IRECNO: nbytes = RINTERNAL_SIZE; break; case P_LBTREE: /* * If it's a duplicate key, discard the index and don't touch * the actual page item. * * XXX * This works because no data item can have an index matching * any other index so even if the data item is in a key "slot", * it won't match any other index. */ if ((indx % 2) == 0) { /* * Check for a duplicate after us on the page. NOTE: * we have to delete the key item before deleting the * data item, otherwise the "indx + P_INDX" calculation * won't work! */ if (indx + P_INDX < (u_int32_t)NUM_ENT(h) && h->inp[indx] == h->inp[indx + P_INDX]) return (CDB___bam_adjindx(dbc, h, indx, indx + O_INDX, 0)); /* * Check for a duplicate before us on the page. It * doesn't matter if we delete the key item before or * after the data item for the purposes of this one. */ if (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) return (CDB___bam_adjindx(dbc, h, indx, indx - P_INDX, 0)); } /* FALLTHROUGH */ case P_LRECNO: bk = GET_BKEYDATA(h, indx); switch (B_TYPE(bk->type)) { case B_DUPLICATE: case B_OVERFLOW: nbytes = BOVERFLOW_SIZE; bo = GET_BOVERFLOW(h, indx); offpage: /* Delete duplicate/offpage chains. */ if (B_TYPE(bo->type) == B_DUPLICATE) { if ((ret = CDB___db_ddup(dbc, bo->pgno)) != 0) return (ret); } else if ((ret = CDB___db_doff(dbc, bo->pgno)) != 0) return (ret); break; case B_KEYDATA: nbytes = BKEYDATA_SIZE(bk->len); break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } /* Delete the item and update the cursors. */ if ((ret = CDB___db_ditem(dbc, h, indx, nbytes)) != 0) return (ret); CDB___bam_ca_di(dbp, PGNO(h), indx, -1); /* Mark the page dirty. */ return (CDB_memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)); } /* * CDB___bam_adjindx -- * Adjust an index on the page. * * PUBLIC: int CDB___bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int)); */ int CDB___bam_adjindx(dbc, h, indx, indx_copy, is_insert) DBC *dbc; PAGE *h; u_int32_t indx, indx_copy; int is_insert; { DB *dbp; db_indx_t copy; int ret; dbp = dbc->dbp; /* Log the change. */ if (DB_LOGGING(dbc) && (ret = CDB___bam_adj_log(dbp->dbenv, dbc->txn, &LSN(h), 0, dbp->log_fileid, PGNO(h), &LSN(h), indx, indx_copy, (u_int32_t)is_insert)) != 0) return (ret); if (is_insert) { copy = h->inp[indx_copy]; if (indx != NUM_ENT(h)) memmove(&h->inp[indx + O_INDX], &h->inp[indx], sizeof(db_indx_t) * (NUM_ENT(h) - indx)); h->inp[indx] = copy; ++NUM_ENT(h); } else { --NUM_ENT(h); if (indx != NUM_ENT(h)) memmove(&h->inp[indx], &h->inp[indx + O_INDX], sizeof(db_indx_t) * (NUM_ENT(h) - indx)); } /* Mark the page dirty. */ ret = CDB_memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY); /* Adjust the cursors. */ CDB___bam_ca_di(dbp, h->pgno, indx, is_insert ? 1 : -1); return (0); } /* * CDB___bam_dpage -- * Delete a page from the tree. * * PUBLIC: int CDB___bam_dpage __P((DBC *, const DBT *)); */ int CDB___bam_dpage(dbc, key) DBC *dbc; const DBT *key; { BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; PAGE *h; db_pgno_t pgno, root_pgno; int level; /* !!!: has to hold number of tree levels. */ int exact, ret; dbp = dbc->dbp; cp = dbc->internal; ret = 0; /* * The locking protocol is that we acquire locks by walking down the * tree, to avoid the obvious deadlocks. * * Call CDB___bam_search to reacquire the empty leaf page, but this time * get both the leaf page and it's parent, locked. Walk back up the * tree, until we have the top pair of pages that we want to delete. * Once we have the top page that we want to delete locked, lock the * underlying pages and check to make sure they're still empty. If * they are, delete them. */ root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; for (level = LEAFLEVEL;; ++level) { /* Acquire a page and its parent, locked. */ if ((ret = CDB___bam_search(dbc, key, S_WRPAIR, level, NULL, &exact)) != 0) return (ret); /* * If we reach the root or the page isn't going to be empty * when we delete one record, quit. */ h = cp->csp[-1].page; if (h->pgno == root_pgno || NUM_ENT(h) != 1) break; /* Release the two locked pages. */ (void)CDB_memp_fput(dbp->mpf, cp->csp[-1].page, 0); (void)__TLPUT(dbc, cp->csp[-1].lock); (void)CDB_memp_fput(dbp->mpf, cp->csp[0].page, 0); (void)__TLPUT(dbc, cp->csp[0].lock); } /* * Leave the stack pointer one after the last entry, we may be about * to push more items on the stack. */ ++cp->csp; /* * cp->csp[-2].page is the top page, which we're not going to delete, * and cp->csp[-1].page is the first page we are going to delete. * * Walk down the chain, acquiring the rest of the pages until we've * retrieved the leaf page. If we find any pages that aren't going * to be emptied by the delete, someone else added something while we * were walking the tree, and we discontinue the delete. */ for (h = cp->csp[-1].page;;) { if (ISLEAF(h)) { if (NUM_ENT(h) != 0) goto release; break; } else if (NUM_ENT(h) != 1) goto release; /* * Get the next page, write lock it and push it onto the stack. * We know it's index 0, because it can only have one element. */ pgno = TYPE(h) == P_IBTREE ? GET_BINTERNAL(h, 0)->pgno : GET_RINTERNAL(h, 0)->pgno; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &lock)) != 0) goto release; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto release; BT_STK_PUSH(cp, h, 0, lock, DB_LOCK_WRITE, ret); } /* Adjust back to reference the last page on the stack. */ BT_STK_POP(cp); /* Delete the pages. */ return (CDB___bam_dpages(dbc)); release: /* Adjust back to reference the last page on the stack. */ BT_STK_POP(cp); /* Discard any locked pages and return. */ CDB___bam_stkrel(dbc, 0); return (ret); } /* * CDB___bam_dpages -- * Delete a set of locked pages. * * PUBLIC: int CDB___bam_dpages __P((DBC *)); */ int CDB___bam_dpages(dbc) DBC *dbc; { BTREE_CURSOR *cp; DB *dbp; DBT a, b; DB_LOCK c_lock, p_lock; EPG *epg; PAGE *child, *parent; db_indx_t nitems; db_pgno_t pgno, root_pgno; db_recno_t rcnt; int done, ret; dbp = dbc->dbp; cp = dbc->internal; root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; epg = cp->sp; /* * !!! * There is an interesting deadlock situation here. We have to relink * the leaf page chain around the leaf page being deleted. Consider * a cursor walking through the leaf pages, that has the previous page * read-locked and is waiting on a lock for the page we're deleting. * It will deadlock here. This is a problem, because if our process is * selected to resolve the deadlock, we'll leave an empty leaf page * that we can never again access by walking down the tree. So, before * we unlink the subtree, we relink the leaf page chain. */ if ((ret = CDB___db_relink(dbc, DB_REM_PAGE, cp->csp->page, NULL, 1)) != 0) goto release; /* * We have the entire stack of deletable pages locked. * * Delete the highest page in the tree's reference to the underlying * stack of pages. Then, release that page, letting the rest of the * tree get back to business. */ if ((ret = CDB___bam_ditem(dbc, epg->page, epg->indx)) != 0) { release: (void)CDB___bam_stkrel(dbc, 0); return (ret); } pgno = epg->page->pgno; nitems = NUM_ENT(epg->page); (void)CDB_memp_fput(dbp->mpf, epg->page, 0); (void)__TLPUT(dbc, epg->lock); /* * Free the rest of the stack of pages. * * !!! * Don't bother checking for errors. We've unlinked the subtree from * the tree, and there's no possibility of recovery outside of doing * TXN rollback. */ while (++epg <= cp->csp) { /* * Delete page entries so they will be restored as part of * recovery. */ if (NUM_ENT(epg->page) != 0) (void)CDB___bam_ditem(dbc, epg->page, epg->indx); (void)CDB___db_free(dbc, epg->page); (void)__TLPUT(dbc, epg->lock); } BT_STK_CLR(cp); /* * Try and collapse the tree a level -- this is only applicable * if we've deleted the next-to-last element from the root page. * * There are two cases when collapsing a tree. * * If we've just deleted the last item from the root page, there is no * further work to be done. The code above has emptied the root page * and freed all pages below it. */ if (pgno != root_pgno || nitems != 1) return (0); /* * If we just deleted the next-to-last item from the root page, the * tree can collapse one or more levels. While there remains only a * single item on the root page, write lock the last page referenced * by the root page and copy it over the root page. If we can't get a * write lock, that's okay, the tree just stays deeper than we'd like. */ for (done = 0; !done;) { /* Initialize. */ parent = child = NULL; p_lock.off = c_lock.off = LOCK_INVALID; /* Lock the root. */ pgno = root_pgno; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &p_lock)) != 0) goto stop; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &parent)) != 0) goto stop; if (NUM_ENT(parent) != 1 || (TYPE(parent) != P_IBTREE && TYPE(parent) != P_IRECNO)) goto stop; pgno = TYPE(parent) == P_IBTREE ? GET_BINTERNAL(parent, 0)->pgno : GET_RINTERNAL(parent, 0)->pgno; /* Lock the child page. */ if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &c_lock)) != 0) goto stop; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &child)) != 0) goto stop; /* Log the change. */ if (DB_LOGGING(dbc)) { memset(&a, 0, sizeof(a)); a.data = child; a.size = dbp->pgsize; memset(&b, 0, sizeof(b)); b.data = P_ENTRY(parent, 0); b.size = BINTERNAL_SIZE(((BINTERNAL *)b.data)->len); CDB___bam_rsplit_log(dbp->dbenv, dbc->txn, &child->lsn, 0, dbp->log_fileid, child->pgno, &a, RE_NREC(parent), &b, &parent->lsn); } /* * Make the switch. * * One fixup -- if the tree has record numbers and we're not * converting to a leaf page, we have to preserve the total * record count. Note that we are about to overwrite everything * on the parent, including its LSN. This is actually OK, * because the above log message, which describes this update, * stores its LSN on the child page. When the child is copied * to the parent, the correct LSN is going to copied into * place in the parent. */ COMPQUIET(rcnt, 0); if (TYPE(child) == P_IRECNO || (TYPE(child) == P_IBTREE && F_ISSET(dbp, DB_BT_RECNUM))) rcnt = RE_NREC(parent); memcpy(parent, child, dbp->pgsize); parent->pgno = root_pgno; if (TYPE(child) == P_IRECNO || (TYPE(child) == P_IBTREE && F_ISSET(dbp, DB_BT_RECNUM))) RE_NREC_SET(parent, rcnt); /* Mark the pages dirty. */ CDB_memp_fset(dbp->mpf, parent, DB_MPOOL_DIRTY); CDB_memp_fset(dbp->mpf, child, DB_MPOOL_DIRTY); /* Adjust the cursors. */ CDB___bam_ca_rsplit(dbp, child->pgno, root_pgno); /* * Free the page copied onto the root page and discard its * lock. (The call to CDB___db_free() discards our reference * to the page.) */ (void)CDB___db_free(dbc, child); child = NULL; if (0) { stop: done = 1; } if (p_lock.off != LOCK_INVALID) (void)__TLPUT(dbc, p_lock); if (parent != NULL) CDB_memp_fput(dbp->mpf, parent, 0); if (c_lock.off != LOCK_INVALID) (void)__TLPUT(dbc, c_lock); if (child != NULL) CDB_memp_fput(dbp->mpf, child, 0); } return (0); } �������������������������htdig-3.2.0b6/db/bt_method.c������������������������������������������������������������������������0100644�0063146�0012731�00000017017�07427026535�015101� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_method.c 11.8 (Sleepycat) 10/27/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" #include "qam.h" static int CDB___bam_set_bt_compare __P((DB *, int (*)(const DBT *, const DBT *))); static int CDB___bam_set_bt_maxkey __P((DB *, u_int32_t)); static int CDB___bam_set_bt_minkey __P((DB *, u_int32_t)); static int CDB___bam_set_bt_prefix __P((DB *, size_t(*)(const DBT *, const DBT *))); static int CDB___ram_set_re_delim __P((DB *, int)); static int CDB___ram_set_re_len __P((DB *, u_int32_t)); static int CDB___ram_set_re_pad __P((DB *, int)); static int CDB___ram_set_re_source __P((DB *, const char *)); /* * CDB___bam_db_create -- * Btree specific initialization of the DB structure. * * PUBLIC: int CDB___bam_db_create __P((DB *)); */ int CDB___bam_db_create(dbp) DB *dbp; { BTREE *t; int ret; /* Allocate and initialize the private btree structure. */ if ((ret = CDB___os_calloc(1, sizeof(BTREE), &t)) != 0) return (ret); dbp->bt_internal = t; t->bt_minkey = DEFMINKEYPAGE; /* Btree */ t->bt_compare = CDB___bam_defcmp; t->bt_prefix = CDB___bam_defpfx; dbp->set_bt_compare = CDB___bam_set_bt_compare; dbp->set_bt_maxkey = CDB___bam_set_bt_maxkey; dbp->set_bt_minkey = CDB___bam_set_bt_minkey; dbp->set_bt_prefix = CDB___bam_set_bt_prefix; t->re_delim = '\n'; /* Recno */ t->re_pad = ' '; dbp->set_re_delim = CDB___ram_set_re_delim; dbp->set_re_len = CDB___ram_set_re_len; dbp->set_re_pad = CDB___ram_set_re_pad; dbp->set_re_source = CDB___ram_set_re_source; return (0); } /* * CDB___bam_db_close -- * Btree specific discard of the DB structure. * * PUBLIC: int CDB___bam_db_close __P((DB *)); */ int CDB___bam_db_close(dbp) DB *dbp; { BTREE *t; t = dbp->bt_internal; /* Recno */ /* Close any underlying mmap region. */ if (t->re_smap != NULL) (void)CDB___os_unmapfile(dbp->dbenv, t->re_smap, t->re_msize); /* Close any backing source file descriptor. */ if (F_ISSET(&t->re_fh, DB_FH_VALID)) (void)CDB___os_closehandle(&t->re_fh); /* Free any backing source file name. */ if (t->re_source != NULL) CDB___os_freestr(t->re_source); CDB___os_free(t, sizeof(BTREE)); dbp->bt_internal = NULL; return (0); } /* * CDB___bam_set_flags -- * Set Btree specific flags. * * PUBLIC: int CDB___bam_set_flags __P((DB *, u_int32_t *flagsp)); */ int CDB___bam_set_flags(dbp, flagsp) DB *dbp; u_int32_t *flagsp; { u_int32_t flags; flags = *flagsp; if (LF_ISSET(DB_DUP | DB_DUPSORT | DB_RECNUM | DB_REVSPLITOFF)) { DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_flags"); /* * The DB_DUP and DB_DUPSORT flags are shared by the Hash * and Btree access methods. */ if (LF_ISSET(DB_DUP | DB_DUPSORT)) DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH); if (LF_ISSET(DB_RECNUM | DB_REVSPLITOFF)) DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); /* * DB_DUP and DB_RECNUM are mutually incompatible. Handle * the case where one or more flags have already been set. */ if ((LF_ISSET(DB_DUP) || F_ISSET(dbp, DB_AM_DUP)) && (LF_ISSET(DB_RECNUM) || F_ISSET(dbp, DB_BT_RECNUM))) return (CDB___db_ferr(dbp->dbenv, "DB->set_flags", 1)); if (LF_ISSET(DB_DUP)) { F_SET(dbp, DB_AM_DUP); LF_CLR(DB_DUP); } if (LF_ISSET(DB_DUPSORT)) { if (dbp->dup_compare == NULL) dbp->dup_compare = CDB___bam_defcmp; LF_CLR(DB_DUPSORT); } if (LF_ISSET(DB_RECNUM)) { F_SET(dbp, DB_BT_RECNUM); LF_CLR(DB_RECNUM); } if (LF_ISSET(DB_REVSPLITOFF)) { F_SET(dbp, DB_BT_REVSPLIT); LF_CLR(DB_REVSPLITOFF); } *flagsp = flags; } return (0); } /* * CDB___bam_set_bt_compare -- * Set the comparison function. */ static int CDB___bam_set_bt_compare(dbp, func) DB *dbp; int (*func) __P((const DBT *, const DBT *)); { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_bt_compare"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); t = dbp->bt_internal; /* * Can't default the prefix routine if the user supplies a comparison * routine; shortening the keys can break their comparison algorithm. */ t->bt_compare = func; if (t->bt_prefix == CDB___bam_defpfx) t->bt_prefix = NULL; return (0); } /* * CDB___bam_set_bt_maxkey -- * Set the maximum keys per page. */ static int CDB___bam_set_bt_maxkey(dbp, bt_maxkey) DB *dbp; u_int32_t bt_maxkey; { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_bt_maxkey"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); t = dbp->bt_internal; if (bt_maxkey < 1) { CDB___db_err(dbp->dbenv, "minimum bt_maxkey value is 1"); return (EINVAL); } t->bt_maxkey = bt_maxkey; return (0); } /* * CDB___bam_set_bt_minkey -- * Set the minimum keys per page. */ static int CDB___bam_set_bt_minkey(dbp, bt_minkey) DB *dbp; u_int32_t bt_minkey; { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_bt_minkey"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); t = dbp->bt_internal; if (bt_minkey < 2) { CDB___db_err(dbp->dbenv, "minimum bt_minkey value is 2"); return (EINVAL); } t->bt_minkey = bt_minkey; return (0); } /* * CDB___bam_set_bt_prefix -- * Set the prefix function. */ static int CDB___bam_set_bt_prefix(dbp, func) DB *dbp; size_t (*func) __P((const DBT *, const DBT *)); { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_bt_prefix"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); t = dbp->bt_internal; t->bt_prefix = func; return (0); } /* * CDB___ram_set_flags -- * Set Recno specific flags. * * PUBLIC: int CDB___ram_set_flags __P((DB *, u_int32_t *flagsp)); */ int CDB___ram_set_flags(dbp, flagsp) DB *dbp; u_int32_t *flagsp; { u_int32_t flags; flags = *flagsp; if (LF_ISSET(DB_RENUMBER | DB_SNAPSHOT)) { DB_ILLEGAL_AFTER_OPEN(dbp, "DB->set_flags"); DB_ILLEGAL_METHOD(dbp, DB_OK_RECNO); if (LF_ISSET(DB_RENUMBER)) { F_SET(dbp, DB_RE_RENUMBER); LF_CLR(DB_RENUMBER); } if (LF_ISSET(DB_SNAPSHOT)) { F_SET(dbp, DB_RE_SNAPSHOT); LF_CLR(DB_SNAPSHOT); } *flagsp = flags; } return (0); } /* * CDB___ram_set_re_delim -- * Set the variable-length input record delimiter. */ static int CDB___ram_set_re_delim(dbp, re_delim) DB *dbp; int re_delim; { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_re_delim"); DB_ILLEGAL_METHOD(dbp, DB_OK_RECNO); t = dbp->bt_internal; t->re_delim = re_delim; F_SET(dbp, DB_RE_DELIMITER); return (0); } /* * CDB___ram_set_re_len -- * Set the variable-length input record length. */ static int CDB___ram_set_re_len(dbp, re_len) DB *dbp; u_int32_t re_len; { BTREE *t; QUEUE *q; DB_ILLEGAL_AFTER_OPEN(dbp, "set_re_len"); DB_ILLEGAL_METHOD(dbp, DB_OK_QUEUE | DB_OK_RECNO); t = dbp->bt_internal; t->re_len = re_len; q = dbp->q_internal; q->re_len = re_len; F_SET(dbp, DB_RE_FIXEDLEN); return (0); } /* * CDB___ram_set_re_pad -- * Set the fixed-length record pad character. */ static int CDB___ram_set_re_pad(dbp, re_pad) DB *dbp; int re_pad; { BTREE *t; QUEUE *q; DB_ILLEGAL_AFTER_OPEN(dbp, "set_re_pad"); DB_ILLEGAL_METHOD(dbp, DB_OK_QUEUE | DB_OK_RECNO); t = dbp->bt_internal; t->re_pad = re_pad; q = dbp->q_internal; q->re_pad = re_pad; F_SET(dbp, DB_RE_PAD); return (0); } /* * CDB___ram_set_re_source -- * Set the backing source file name. */ static int CDB___ram_set_re_source(dbp, re_source) DB *dbp; const char *re_source; { BTREE *t; DB_ILLEGAL_AFTER_OPEN(dbp, "set_re_source"); DB_ILLEGAL_METHOD(dbp, DB_OK_RECNO); t = dbp->bt_internal; return (CDB___os_strdup(re_source, &t->re_source)); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_open.c��������������������������������������������������������������������������0100644�0063146�0012731�00000026732�07427026535�014566� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_open.c 11.13 (Sleepycat) 10/21/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" #include "db_shash.h" #include "lock.h" #include "mp.h" /* * CDB___bam_open -- * Open a btree. * * PUBLIC: int CDB___bam_open __P((DB *, const char *, db_pgno_t)); */ int CDB___bam_open(dbp, name, base_pgno) DB *dbp; const char *name; db_pgno_t base_pgno; { BTREE *t; t = dbp->bt_internal; /* Initialize the remaining fields/methods of the DB. */ dbp->del = CDB___bam_delete; dbp->stat = CDB___bam_stat; /* * We don't permit the user to specify a prefix routine if they didn't * also specify a comparison routine, they can't know enough about our * comparison routine to get it right. */ if (t->bt_compare == CDB___bam_defcmp && t->bt_prefix != CDB___bam_defpfx) { CDB___db_err(dbp->dbenv, "prefix comparison may not be specified for default comparison routine"); return (EINVAL); } /* Set the overflow page size. */ CDB___bam_setovflsize(dbp); /* Start up the tree. */ return (CDB___bam_read_root(dbp, name, base_pgno)); } /* * CDB___bam_setovflsize -- * * PUBLIC: void CDB___bam_setovflsize __P((DB *)); */ void CDB___bam_setovflsize(dbp) DB *dbp; { BTREE *t; t = dbp->bt_internal; /* * !!! * Correction for recno, which doesn't know anything about minimum * keys per page. */ if (t->bt_minkey == 0) t->bt_minkey = DEFMINKEYPAGE; /* * The btree data structure requires that at least two key/data pairs * can fit on a page, but other than that there's no fixed requirement. * Translate the minimum number of items into the bytes a key/data pair * can use before being placed on an overflow page. We calculate for * the worst possible alignment by assuming every item requires the * maximum alignment for padding. * * Recno uses the btree bt_ovflsize value -- it's close enough. */ t->bt_ovflsize = (dbp->pgsize - P_OVERHEAD) / (t->bt_minkey * P_INDX) - (BKEYDATA_PSIZE(0) + ALIGN(1, 4)); } /* * CDB___bam_metachk -- * * PUBLIC: int CDB___bam_metachk __P((DB *, const char *, BTMETA *)); */ int CDB___bam_metachk(dbp, name, btm) DB *dbp; const char *name; BTMETA *btm; { DB_ENV *dbenv; u_int32_t vers; int ret; dbenv = dbp->dbenv; /* * At this point, all we know is that the magic number is for a Btree. * Check the version, the database may be out of date. */ vers = btm->dbmeta.version; if (F_ISSET(dbp, DB_AM_SWAP)) M_32_SWAP(vers); switch (vers) { case 6: CDB___db_err(dbenv, "%s: btree version %lu requires a version upgrade", name, (u_long)vers); return (DB_OLD_VERSION); case 7: break; default: CDB___db_err(dbenv, "%s: unsupported btree version: %lu", name, (u_long)vers); return (EINVAL); } /* Swap the page if we need to. */ if (F_ISSET(dbp, DB_AM_SWAP) && (ret = CDB___bam_mswap((PAGE *)btm)) != 0) return (ret); /* * Check application info against metadata info, and set info, flags, * and type based on metadata info. */ if ((ret = CDB___db_fchk(dbenv, "DB->open", btm->dbmeta.flags, BTM_MASK)) != 0) return (ret); if (F_ISSET(&btm->dbmeta, BTM_RECNO)) { if (dbp->type == DB_BTREE) goto wrong_type; dbp->type = DB_RECNO; DB_ILLEGAL_METHOD(dbp, DB_OK_RECNO); } else { if (dbp->type == DB_RECNO) goto wrong_type; dbp->type = DB_BTREE; DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE); } if (F_ISSET(&btm->dbmeta, BTM_DUP)) F_SET(dbp, DB_AM_DUP); else if (F_ISSET(dbp, DB_AM_DUP)) { CDB___db_err(dbenv, "%s: DB_DUP specified to open method but not set in database", name); return (EINVAL); } if (F_ISSET(&btm->dbmeta, BTM_RECNUM)) { if (dbp->type != DB_BTREE) goto wrong_type; F_SET(dbp, DB_BT_RECNUM); if ((ret = CDB___db_fcchk(dbenv, "DB->open", dbp->flags, DB_AM_DUP, DB_BT_RECNUM)) != 0) return (ret); } else if (F_ISSET(dbp, DB_BT_RECNUM)) { CDB___db_err(dbenv, "%s: DB_RECNUM specified to open method but not set in database", name); return (EINVAL); } if (F_ISSET(&btm->dbmeta, BTM_FIXEDLEN)) { if (dbp->type != DB_RECNO) goto wrong_type; F_SET(dbp, DB_RE_FIXEDLEN); } else if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { CDB___db_err(dbenv, "%s: DB_FIXEDLEN specified to open method but not set in database", name); return (EINVAL); } if (F_ISSET(&btm->dbmeta, BTM_RENUMBER)) { if (dbp->type != DB_RECNO) goto wrong_type; F_SET(dbp, DB_RE_RENUMBER); } else if (F_ISSET(dbp, DB_RE_RENUMBER)) { CDB___db_err(dbenv, "%s: DB_RENUMBER specified to open method but not set in database", name); return (EINVAL); } if (F_ISSET(&btm->dbmeta, BTM_SUBDB)) F_SET(dbp, DB_AM_SUBDB); else if (F_ISSET(dbp, DB_AM_SUBDB)) { CDB___db_err(dbenv, "%s: subdatabase specified but not supported in database", name); return (EINVAL); } /* Set the page size. */ dbp->pgsize = btm->dbmeta.pagesize; F_CLR(dbp, DB_AM_PGDEF); /* Copy the file's ID. */ memcpy(dbp->fileid, btm->dbmeta.uid, DB_FILE_ID_LEN); return (0); wrong_type: if (dbp->type == DB_BTREE) CDB___db_err(dbenv, "open method type is Btree, database type is Recno"); else CDB___db_err(dbenv, "open method type is Recno, database type is Btree"); return (EINVAL); } /* * CDB___bam_read_root -- * Check (and optionally create) a tree. * * PUBLIC: int CDB___bam_read_root __P((DB *, const char *, db_pgno_t)); */ int CDB___bam_read_root(dbp, name, base_pgno) DB *dbp; const char *name; db_pgno_t base_pgno; { BTMETA *meta; BTREE *t; DBC *dbc; DB_LSN orig_lsn; DB_LOCK metalock; PAGE *root; int ret, t_ret; ret = 0; t = dbp->bt_internal; meta = NULL; root = NULL; metalock.off = LOCK_INVALID; /* Get a cursor. */ if ((ret = dbp->cursor(dbp, dbp->open_txn, &dbc, 0)) != 0) return (ret); /* Get, and optionally create the metadata page. */ if ((ret = CDB___db_lget(dbc, 0, base_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; if ((ret = CDB_memp_fget( dbp->mpf, &base_pgno, DB_MPOOL_CREATE, (PAGE **)&meta)) != 0) goto err; /* * If the magic number is correct, we're not creating the tree. * Correct any fields that may not be right. Note, all of the * local flags were set by DB->open. */ if (meta->dbmeta.magic != 0) { t->bt_maxkey = meta->maxkey; t->bt_minkey = meta->minkey; t->re_pad = meta->re_pad; t->re_len = meta->re_len; t->bt_meta = base_pgno; t->bt_root = meta->root; (void)CDB_memp_fput(dbp->mpf, (PAGE *)meta, 0); meta = NULL; goto done; } /* Initialize the tree structure metadata information. */ orig_lsn = meta->dbmeta.lsn; memset(meta, 0, sizeof(BTMETA)); ZERO_LSN(meta->dbmeta.lsn); meta->dbmeta.pgno = base_pgno; meta->dbmeta.magic = DB_BTREEMAGIC; meta->dbmeta.version = DB_BTREEVERSION; meta->dbmeta.pagesize = dbp->pgsize; meta->dbmeta.type = P_BTREEMETA; meta->dbmeta.free = PGNO_INVALID; if (F_ISSET(dbp, DB_AM_DUP)) F_SET(&meta->dbmeta, BTM_DUP); if (F_ISSET(dbp, DB_RE_FIXEDLEN)) F_SET(&meta->dbmeta, BTM_FIXEDLEN); if (F_ISSET(dbp, DB_BT_RECNUM)) F_SET(&meta->dbmeta, BTM_RECNUM); if (F_ISSET(dbp, DB_RE_RENUMBER)) F_SET(&meta->dbmeta, BTM_RENUMBER); if (F_ISSET(dbp, DB_AM_SUBDB)) F_SET(&meta->dbmeta, BTM_SUBDB); if (dbp->type == DB_RECNO) F_SET(&meta->dbmeta, BTM_RECNO); memcpy(meta->dbmeta.uid, dbp->fileid, DB_FILE_ID_LEN); meta->maxkey = t->bt_maxkey; meta->minkey = t->bt_minkey; meta->re_len = t->re_len; meta->re_pad = t->re_pad; /* If necessary, log the meta-data and root page creates. */ if ((ret = CDB___db_log_page(dbp, name, &orig_lsn, base_pgno, (PAGE *)meta)) != 0) goto err; /* Create and initialize a root page. */ if ((ret = CDB___db_new(dbc, dbp->type == DB_RECNO ? P_LRECNO : P_LBTREE, &root)) != 0) goto err; root->level = LEAFLEVEL; if (dbp->open_txn != NULL && (ret = CDB___bam_root_log(dbp->dbenv, dbp->open_txn, &meta->dbmeta.lsn, 0, dbp->log_fileid, meta->dbmeta.pgno, root->pgno, &meta->dbmeta.lsn)) != 0) goto err; meta->root = root->pgno; DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOGMETA, ret, name); if ((ret = CDB___db_log_page(dbp, name, &root->lsn, root->pgno, root)) != 0) goto err; DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOG, ret, name); t->bt_meta = base_pgno; t->bt_root = root->pgno; /* Release the metadata and root pages. */ if ((ret = CDB_memp_fput(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY)) != 0) goto err; meta = NULL; if ((ret = CDB_memp_fput(dbp->mpf, root, DB_MPOOL_DIRTY)) != 0) goto err; root = NULL; /* * Flush the metadata and root pages to disk. * * !!! * It's not useful to return not-yet-flushed here -- convert it to * an error. */ if ((ret = CDB_memp_fsync(dbp->mpf)) == DB_INCOMPLETE) ret = EINVAL; DB_TEST_RECOVERY(dbp, DB_TEST_POSTSYNC, ret, name); done: /* * XXX * We already did an insert and so the last-page-inserted has been * set. I'm not sure where the *right* place to clear this value * is, it's not intuitively obvious that it belongs here. */ t->bt_lpgno = PGNO_INVALID; err: DB_TEST_RECOVERY_LABEL /* Put any remaining pages back. */ if (meta != NULL) if ((t_ret = CDB_memp_fput(dbp->mpf, (PAGE *)meta, 0)) != 0 && ret == 0) ret = t_ret; if (root != NULL) if ((t_ret = CDB_memp_fput(dbp->mpf, (PAGE *)root, 0)) != 0 && ret == 0) ret = t_ret; /* We can release the metapage lock when we are done. */ if (metalock.off != LOCK_INVALID) (void)__LPUT(dbc, metalock); if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } ��������������������������������������htdig-3.2.0b6/db/bt_put.c���������������������������������������������������������������������������0100644�0063146�0012731�00000057760�07427026535�014442� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_put.c 11.20 (Sleepycat) 10/28/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" static int CDB___bam_ndup __P((DBC *, PAGE *, u_int32_t)); static int CDB___bam_ovput __P((DBC *, PAGE *, u_int32_t, DBT *)); /* * CDB___bam_iitem -- * Insert an item into the tree. * * PUBLIC: int CDB___bam_iitem __P((DBC *, * PUBLIC: PAGE **, db_indx_t *, DBT *, DBT *, u_int32_t, u_int32_t)); */ int CDB___bam_iitem(dbc, hp, indxp, key, data, op, flags) DBC *dbc; PAGE **hp; db_indx_t *indxp; DBT *key, *data; u_int32_t op, flags; { BKEYDATA *bk; BTREE *t; BTREE_CURSOR *cp; DB *dbp; DBT tdbt; PAGE *h; db_indx_t indx; db_pgno_t pgno; u_int32_t data_size, have_bytes, need_bytes, needed; int bigkey, bigdata, dupadjust, padrec, replace, ret, was_deleted; COMPQUIET(bk, NULL); dbp = dbc->dbp; t = dbp->bt_internal; h = *hp; indx = *indxp; dupadjust = replace = was_deleted = 0; /* * Fixed-length records with partial puts: it's an error to specify * anything other simple overwrite. */ if (F_ISSET(dbp, DB_RE_FIXEDLEN) && F_ISSET(data, DB_DBT_PARTIAL) && data->dlen != data->size) return (EINVAL); /* * Figure out how much space the data will take, including if it's a * partial record. * * Fixed-length records: it's an error to specify a record that's * longer than the fixed-length, and we never require less than * the fixed-length record size. */ data_size = F_ISSET(data, DB_DBT_PARTIAL) ? CDB___bam_partsize(op, data, h, indx) : data->size; padrec = 0; if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { if (data_size > t->re_len) return (EINVAL); if (data_size < t->re_len) { padrec = 1; data_size = t->re_len; } } /* * Handle partial puts or short fixed-length records: build the * real record. * * XXX * I'd much rather wait until after we figure out if we need to do * a split or not, but there are currently too many places that need * the real record before we get there. Revisit this decision after * we move off-page duplicates into their own Btree. */ if (padrec || F_ISSET(data, DB_DBT_PARTIAL)) { tdbt = *data; if ((ret = CDB___bam_build(dbc, op, &tdbt, h, indx, data_size)) != 0) return (ret); data = &tdbt; } /* * If the user has specified a duplicate comparison function, return * an error if DB_CURRENT was specified and the replacement data * doesn't compare equal to the current data. This stops apps from * screwing up the duplicate sort order. We have to do this after * we build the real record so that we're comparing the real items. */ if (op == DB_CURRENT && dbp->dup_compare != NULL && CDB___bam_cmp(dbp, data, h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0), dbp->dup_compare) != 0) return (EINVAL); /* * If it's a page of duplicates, call the common code to do the work. * * !!! * Here's where hp and indxp are important. The duplicate code may * decide to rework/rearrange the pages and indices we're using, so * the caller must understand that the page stack may change. */ if (TYPE(h) == P_DUPLICATE) { /* If appending a new entry adjust the index for the item. */ if (op == DB_AFTER || op == DB_CURRENT) ++*indxp; /* * Put the new/replacement item onto the page. * * !!! * *hp and *indxp may be changed after the return. */ if ((ret = CDB___db_dput(dbc, data, hp, indxp)) != 0) return (ret); /* * XXX * If this is CURRENT, we do an append followed by a delete, * because the underlying duplicate code doesn't support the * replace operation. The tricky part is to make sure we * delete the proper row. The append may have caused the row * to move, in which case, the cursor will be updated to point * at it. This code ASSUMES that the cursor passed in is * pointing at the current record. */ cp = dbc->internal; if (op == DB_CURRENT) { /* * The append may have allocated a new page, in which * case it discarded the page we held -- re-acquire * that page. */ if (PGNO(*hp) != cp->dpgno) { if ((ret = CDB_memp_fget( dbp->mpf, &cp->dpgno, 0, &h)) != 0) return (ret); } else h = *hp; /* Delete the original item. */ if ((ret = CDB___db_drem(dbc, &h, cp->dindx)) != 0) return (ret); /* * Clear the deleted flag on any cursors referencing * the item. */ (void)CDB___bam_ca_delete(dbp, cp->dpgno, cp->dindx, 0); /* * If the insert and delete are on different pages, we * have to adjust cursors on both pages. */ if (PGNO(*hp) != cp->dpgno) { indx = cp->dindx; pgno = cp->dpgno; CDB___bam_ca_di(dbp, PGNO(*hp), *indxp, 1); CDB___bam_ca_repl(dbp, pgno, indx, PGNO(*hp), *indxp); CDB___bam_ca_di(dbp, pgno, indx + 1, -1); if ((ret = CDB_memp_fput( dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); } } else { h = *hp; indx = *indxp; CDB___bam_ca_di(dbp, PGNO(h), indx, 1); cp->dindx = indx; cp->dpgno = PGNO(h); } goto done; } /* * If the key or data item won't fit on a page, we'll have to store * them on overflow pages. */ needed = 0; bigdata = data_size > t->bt_ovflsize; switch (op) { case DB_KEYFIRST: /* We're adding a new key and data pair. */ bigkey = key->size > t->bt_ovflsize; if (bigkey) needed += BOVERFLOW_PSIZE; else needed += BKEYDATA_PSIZE(key->size); if (bigdata) needed += BOVERFLOW_PSIZE; else needed += BKEYDATA_PSIZE(data_size); break; case DB_AFTER: case DB_BEFORE: case DB_CURRENT: /* * We're either overwriting the data item of a key/data pair * or we're adding the data item only, i.e. a new duplicate. */ bigkey = 0; if (op == DB_CURRENT) { bk = GET_BKEYDATA(h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); if (B_TYPE(bk->type) == B_KEYDATA) have_bytes = BKEYDATA_PSIZE(bk->len); else have_bytes = BOVERFLOW_PSIZE; need_bytes = 0; } else { have_bytes = 0; need_bytes = sizeof(db_indx_t); } if (bigdata) need_bytes += BOVERFLOW_PSIZE; else need_bytes += BKEYDATA_PSIZE(data_size); if (have_bytes < need_bytes) needed += need_bytes - have_bytes; break; default: return (EINVAL); } /* * If there's not enough room, or the user has put a ceiling on the * number of keys permitted in the page, split the page. * * XXX * The t->bt_maxkey test here may be insufficient -- do we have to * check in the btree split code, so we don't undo it there!?!? */ if (P_FREESPACE(h) < needed || (t->bt_maxkey != 0 && NUM_ENT(h) > t->bt_maxkey)) return (DB_NEEDSPLIT); /* * The code breaks it up into five cases: * * 1. Insert a new key/data pair. * 2. Append a new data item (a new duplicate). * 3. Insert a new data item (a new duplicate). * 4. Delete and re-add the data item (overflow item). * 5. Overwrite the data item. */ switch (op) { case DB_KEYFIRST: /* 1. Insert a new key/data pair. */ if (bigkey) { if ((ret = CDB___bam_ovput(dbc, h, indx, key)) != 0) return (ret); } else if ((ret = CDB___db_pitem(dbc, h, indx, BKEYDATA_SIZE(key->size), NULL, key)) != 0) return (ret); CDB___bam_ca_di(dbp, PGNO(h), indx, 1); ++indx; break; case DB_AFTER: /* 2. Append a new data item. */ if (TYPE(h) == P_LBTREE) { /* * Adjust the cursor and copy in the key for the * duplicate. */ if ((ret = CDB___bam_adjindx(dbc, h, indx + P_INDX, indx, 1)) != 0) return (ret); indx += 3; dupadjust = 1; *indxp += 2; } else { ++indx; CDB___bam_ca_di(dbp, PGNO(h), indx, 1); *indxp += 1; } break; case DB_BEFORE: /* 3. Insert a new data item. */ if (TYPE(h) == P_LBTREE) { /* * Adjust the cursor and copy in the key for the * duplicate. */ if ((ret = CDB___bam_adjindx(dbc, h, indx, indx, 1)) != 0) return (ret); ++indx; dupadjust = 1; } else CDB___bam_ca_di(dbp, PGNO(h), indx, 1); break; case DB_CURRENT: if (TYPE(h) == P_LBTREE) { ++indx; dupadjust = 1; /* * In a Btree deleted records aren't counted (deleted * records are counted in a Recno because all accesses * are based on record number). If it's a Btree and * it's a DB_CURRENT operation overwriting a previously * deleted record, increment the record count. */ was_deleted = B_DISSET(bk->type); } /* * 4. Delete and re-add the data item. * * If we're dealing with offpage items, we have to delete and * then re-add the item. */ if (bigdata || B_TYPE(bk->type) != B_KEYDATA) { if ((ret = CDB___bam_ditem(dbc, h, indx)) != 0) return (ret); break; } /* 5. Overwrite the data item. */ replace = 1; break; default: return (EINVAL); } /* Add the data. */ if (bigdata) { if ((ret = CDB___bam_ovput(dbc, h, indx, data)) != 0) return (ret); } else { BKEYDATA __bk; DBT __hdr; if (LF_ISSET(BI_DELETED)) { B_TSET(__bk.type, B_KEYDATA, 1); __bk.len = data->size; __hdr.data = &__bk; __hdr.size = SSZA(BKEYDATA, data); ret = CDB___db_pitem(dbc, h, indx, BKEYDATA_SIZE(data->size), &__hdr, data); } else if (replace) ret = CDB___bam_ritem(dbc, h, indx, data); else ret = CDB___db_pitem(dbc, h, indx, BKEYDATA_SIZE(data->size), NULL, data); if (ret != 0) return (ret); } if ((ret = CDB_memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); /* * Adjust the cursors in general. After that's done, reset the current * cursor to point to the new item. */ if (op == DB_CURRENT) (void)CDB___bam_ca_delete(dbp, PGNO(h), TYPE(h) == P_LBTREE ? indx - O_INDX : indx, 0); else { CDB___bam_ca_di(dbp, PGNO(h), indx, 1); ((BTREE_CURSOR *)dbc->internal)->indx = TYPE(h) == P_LBTREE ? indx - O_INDX : indx; } /* * If we've changed the record count, update the tree. Record counts * need to be updated in Recno databases and in Btree databases where * we are supporting records. In both cases, adjust the count if the * operation wasn't performed on the current record or when the record * was previously deleted. */ if ((op != DB_CURRENT || was_deleted) && (F_ISSET(dbp, DB_BT_RECNUM) || dbp->type == DB_RECNO)) if ((ret = CDB___bam_adjust(dbc, 1)) != 0) return (ret); /* * If a Btree leaf page is at least 50% full and we may have added or * modified a duplicate data item, see if the set of duplicates takes * up at least 25% of the space on the page. If it does, move it off * int its own page. */ if (dupadjust && P_FREESPACE(h) <= dbp->pgsize / 2) { --indx; if ((ret = CDB___bam_ndup(dbc, h, indx)) != 0) return (ret); } /* If we've modified a recno file, set the flag. */ done: if (dbp->type == DB_RECNO) F_SET(t, RECNO_MODIFIED); return (ret); } /* * CDB___bam_partsize -- * Figure out how much space a partial data item is in total. * * PUBLIC: u_int32_t CDB___bam_partsize __P((u_int32_t, DBT *, PAGE *, u_int32_t)); */ u_int32_t CDB___bam_partsize(op, data, h, indx) u_int32_t op, indx; DBT *data; PAGE *h; { BKEYDATA *bk; u_int32_t nbytes; /* * If the record doesn't already exist, it's simply the data we're * provided. */ if (op != DB_CURRENT) return (data->doff + data->size); /* * Otherwise, it's the data provided plus any already existing data * that we're not replacing. */ bk = GET_BKEYDATA(h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); nbytes = B_TYPE(bk->type) == B_OVERFLOW ? ((BOVERFLOW *)bk)->tlen : bk->len; /* * There are really two cases here: * * Case 1: We are replacing some bytes that do not exist (i.e., they * are past the end of the record). In this case the number of bytes * we are replacing is irrelevant and all we care about is how many * bytes we are going to add from offset. So, the new record length * is going to be the size of the new bytes (size) plus wherever those * new bytes begin (doff). * * Case 2: All the bytes we are replacing exist. Therefore, the new * size is the oldsize (nbytes) minus the bytes we are replacing (dlen) * plus the bytes we are adding (size). */ if (nbytes < data->doff + data->dlen) /* Case 1 */ return (data->doff + data->size); return (nbytes + data->size - data->dlen); /* Case 2 */ } /* * CDB___bam_build -- * Build the real record for a partial put, or short fixed-length record. * * PUBLIC: int CDB___bam_build __P((DBC *, u_int32_t, * PUBLIC: DBT *, PAGE *, u_int32_t, u_int32_t)); */ int CDB___bam_build(dbc, op, dbt, h, indx, nbytes) DBC *dbc; u_int32_t op, indx, nbytes; DBT *dbt; PAGE *h; { BKEYDATA *bk, tbk; BOVERFLOW *bo; BTREE *t; DB *dbp; DBT copy; u_int32_t len, tlen; u_int8_t *p; int ret; COMPQUIET(bo, NULL); dbp = dbc->dbp; t = dbp->bt_internal; /* We use the record data return memory, it's only a short-term use. */ if (dbc->rdata.ulen < nbytes) { if ((ret = CDB___os_realloc(nbytes, NULL, &dbc->rdata.data)) != 0) { dbc->rdata.ulen = 0; dbc->rdata.data = NULL; return (ret); } dbc->rdata.ulen = nbytes; } /* * We use nul or pad bytes for any part of the record that isn't * specified; get it over with. */ memset(dbc->rdata.data, F_ISSET(dbp, DB_RE_FIXEDLEN) ? t->re_pad : 0, nbytes); /* * In the next clauses, we need to do three things: a) set p to point * to the place at which to copy the user's data, b) set tlen to the * total length of the record, not including the bytes contributed by * the user, and c) copy any valid data from an existing record. If * it's not a partial put (this code is called for both partial puts * and fixed-length record padding) or it's a new key, we can cut to * the chase. */ if (!F_ISSET(dbt, DB_DBT_PARTIAL) || op != DB_CURRENT) { p = (u_int8_t *)dbc->rdata.data + dbt->doff; tlen = dbt->doff; goto user_copy; } /* Find the current record. */ if (indx < NUM_ENT(h)) { bk = GET_BKEYDATA(h, indx + (TYPE(h) == P_LBTREE ? O_INDX : 0)); bo = (BOVERFLOW *)bk; } else { bk = &tbk; B_TSET(bk->type, B_KEYDATA, 0); bk->len = 0; } if (B_TYPE(bk->type) == B_OVERFLOW) { /* * In the case of an overflow record, we shift things around * in the current record rather than allocate a separate copy. */ memset(©, 0, sizeof(copy)); if ((ret = CDB___db_goff(dbp, ©, bo->tlen, bo->pgno, &dbc->rdata.data, &dbc->rdata.ulen)) != 0) return (ret); /* Skip any leading data from the original record. */ tlen = dbt->doff; p = (u_int8_t *)dbc->rdata.data + dbt->doff; /* * Copy in any trailing data from the original record. * * If the original record was larger than the original offset * plus the bytes being deleted, there is trailing data in the * original record we need to preserve. If we aren't deleting * the same number of bytes as we're inserting, copy it up or * down, into place. * * Use memmove(), the regions may overlap. */ if (bo->tlen > dbt->doff + dbt->dlen) { len = bo->tlen - (dbt->doff + dbt->dlen); if (dbt->dlen != dbt->size) memmove(p + dbt->size, p + dbt->dlen, len); tlen += len; } } else { /* Copy in any leading data from the original record. */ memcpy(dbc->rdata.data, bk->data, dbt->doff > bk->len ? bk->len : dbt->doff); tlen = dbt->doff; p = (u_int8_t *)dbc->rdata.data + dbt->doff; /* Copy in any trailing data from the original record. */ len = dbt->doff + dbt->dlen; if (bk->len > len) { memcpy(p + dbt->size, bk->data + len, bk->len - len); tlen += bk->len - len; } } user_copy: /* * Copy in the application provided data -- p and tlen must have been * initialized above. */ memcpy(p, dbt->data, dbt->size); tlen += dbt->size; /* Set the DBT to reference our new record. */ dbc->rdata.size = F_ISSET(dbp, DB_RE_FIXEDLEN) ? t->re_len : tlen; dbc->rdata.dlen = 0; dbc->rdata.doff = 0; dbc->rdata.flags = 0; *dbt = dbc->rdata; return (0); } /* * OVPUT -- * Copy an overflow item onto a page. */ #undef OVPUT #define OVPUT(h, indx, bo) do { \ DBT __hdr; \ memset(&__hdr, 0, sizeof(__hdr)); \ __hdr.data = &bo; \ __hdr.size = BOVERFLOW_SIZE; \ if ((ret = CDB___db_pitem(dbc, \ h, indx, BOVERFLOW_SIZE, &__hdr, NULL)) != 0) \ return (ret); \ } while (0) /* * CDB___bam_ovput -- * Build an overflow item and put it on the page. */ static int CDB___bam_ovput(dbc, h, indx, item) DBC *dbc; PAGE *h; u_int32_t indx; DBT *item; { BOVERFLOW bo; int ret; UMRW(bo.unused1); B_TSET(bo.type, B_OVERFLOW, 0); UMRW(bo.unused2); if ((ret = CDB___db_poff(dbc, item, &bo.pgno)) != 0) return (ret); bo.tlen = item->size; OVPUT(h, indx, bo); return (0); } /* * CDB___bam_ritem -- * Replace an item on a page. * * PUBLIC: int CDB___bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *)); */ int CDB___bam_ritem(dbc, h, indx, data) DBC *dbc; PAGE *h; u_int32_t indx; DBT *data; { BKEYDATA *bk; DB *dbp; DBT orig, repl; db_indx_t cnt, lo, ln, min, off, prefix, suffix; int32_t nbytes; int ret; u_int8_t *p, *t; dbp = dbc->dbp; /* * Replace a single item onto a page. The logic figuring out where * to insert and whether it fits is handled in the caller. All we do * here is manage the page shuffling. */ bk = GET_BKEYDATA(h, indx); /* Log the change. */ if (DB_LOGGING(dbc)) { /* * We might as well check to see if the two data items share * a common prefix and suffix -- it can save us a lot of log * message if they're large. */ min = data->size < bk->len ? data->size : bk->len; for (prefix = 0, p = bk->data, t = data->data; prefix < min && *p == *t; ++prefix, ++p, ++t) ; min -= prefix; for (suffix = 0, p = (u_int8_t *)bk->data + bk->len - 1, t = (u_int8_t *)data->data + data->size - 1; suffix < min && *p == *t; ++suffix, --p, --t) ; /* We only log the parts of the keys that have changed. */ orig.data = (u_int8_t *)bk->data + prefix; orig.size = bk->len - (prefix + suffix); repl.data = (u_int8_t *)data->data + prefix; repl.size = data->size - (prefix + suffix); if ((ret = CDB___bam_repl_log(dbp->dbenv, dbc->txn, &LSN(h), 0, dbp->log_fileid, PGNO(h), &LSN(h), (u_int32_t)indx, (u_int32_t)B_DISSET(bk->type), &orig, &repl, (u_int32_t)prefix, (u_int32_t)suffix)) != 0) return (ret); } /* * Set references to the first in-use byte on the page and the * first byte of the item being replaced. */ p = (u_int8_t *)h + HOFFSET(h); t = (u_int8_t *)bk; /* * If the entry is growing in size, shift the beginning of the data * part of the page down. If the entry is shrinking in size, shift * the beginning of the data part of the page up. Use memmove(3), * the regions overlap. */ lo = BKEYDATA_SIZE(bk->len); ln = BKEYDATA_SIZE(data->size); if (lo != ln) { nbytes = lo - ln; /* Signed difference. */ if (p == t) /* First index is fast. */ h->inp[indx] += nbytes; else { /* Else, shift the page. */ memmove(p + nbytes, p, t - p); /* Adjust the indices' offsets. */ off = h->inp[indx]; for (cnt = 0; cnt < NUM_ENT(h); ++cnt) if (h->inp[cnt] <= off) h->inp[cnt] += nbytes; } /* Clean up the page and adjust the item's reference. */ HOFFSET(h) += nbytes; t += nbytes; } /* Copy the new item onto the page. */ bk = (BKEYDATA *)t; B_TSET(bk->type, B_KEYDATA, 0); bk->len = data->size; memcpy(bk->data, data->data, data->size); return (0); } /* * CDB___bam_ndup -- * Check to see if the duplicate set at indx should have its own page. * If it should, create it. */ static int CDB___bam_ndup(dbc, h, indx) DBC *dbc; PAGE *h; u_int32_t indx; { BKEYDATA *bk; BOVERFLOW bo; DB *dbp; DBT hdr; PAGE *cp; db_indx_t cnt, cpindx, first, sz; int ret; dbp = dbc->dbp; /* * Count the duplicate records and calculate how much room they're * using on the page. */ while (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) indx -= P_INDX; for (cnt = 0, sz = 0, first = indx;; ++cnt, indx += P_INDX) { if (indx >= NUM_ENT(h) || h->inp[first] != h->inp[indx]) break; bk = GET_BKEYDATA(h, indx); sz += B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE; bk = GET_BKEYDATA(h, indx + O_INDX); sz += B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_PSIZE(bk->len) : BOVERFLOW_PSIZE; } /* * We have to do these checks when the user is replacing the cursor's * data item -- if the application replaces a duplicate item with a * larger data item, it can increase the amount of space used by the * duplicates, requiring this check. But that means it may not be a * duplicate after all. */ if (cnt == 1) return (0); /* * If this set of duplicates is using more than 25% of the page, move * them off. The choice of 25% is a WAG, but it has to be small enough * that we can always split regardless of the presence of duplicates. */ if (sz < dbp->pgsize / 4) return (0); /* Get a new page. */ if ((ret = CDB___db_new(dbc, P_DUPLICATE, &cp)) != 0) return (ret); /* * Move this set of duplicates off the page. First points to the first * key of the first duplicate key/data pair, cnt is the number of pairs * we're dealing with. */ memset(&hdr, 0, sizeof(hdr)); for (indx = first + O_INDX, cpindx = 0;; ++cpindx) { /* Copy the entry to the new page. */ bk = GET_BKEYDATA(h, indx); hdr.data = bk; hdr.size = B_TYPE(bk->type) == B_KEYDATA ? BKEYDATA_SIZE(bk->len) : BOVERFLOW_SIZE; if ((ret = CDB___db_pitem(dbc, cp, cpindx, hdr.size, &hdr, NULL)) != 0) goto err; /* Move cursors referencing the old entry to the new entry. */ CDB___bam_ca_dup(dbp, PGNO(h), first, indx - O_INDX, PGNO(cp), cpindx); /* Delete the data item. */ if ((ret = CDB___db_ditem(dbc, h, indx, hdr.size)) != 0) goto err; CDB___bam_ca_di(dbp, PGNO(h), indx, -1); /* Delete all but the first reference to the key. */ if (--cnt == 0) break; if ((ret = CDB___bam_adjindx(dbc, h, indx, first, 0)) != 0) goto err; } /* Put in a new data item that points to the duplicates page. */ UMRW(bo.unused1); B_TSET(bo.type, B_DUPLICATE, 0); UMRW(bo.unused2); bo.pgno = cp->pgno; bo.tlen = 0; OVPUT(h, indx, bo); return (CDB_memp_fput(dbp->mpf, cp, DB_MPOOL_DIRTY)); err: (void)CDB___db_free(dbc, cp); return (ret); } ����������������htdig-3.2.0b6/db/bt_rec.c���������������������������������������������������������������������������0100644�0063146�0012731�00000063721�07427026535�014375� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_rec.c 11.5 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "hash.h" #include "btree.h" #include "log.h" /* * CDB___bam_pg_alloc_recover -- * Recovery function for pg_alloc. * * PUBLIC: int CDB___bam_pg_alloc_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_pg_alloc_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_pg_alloc_args *argp; DB *file_dbp; DBC *dbc; DBMETA *meta; DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t pgno; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_pg_alloc_print); REC_INTRO(CDB___bam_pg_alloc_read, 0); /* * Fix up the allocated page. If we're redoing the operation, we have * to get the page (creating it if it doesn't exist), and update its * LSN. If we're undoing the operation, we have to reset the page's * LSN and put it on the free list. * * Fix up the metadata page. If we're redoing the operation, we have * to get the metadata page and update its LSN and its free pointer. * If we're undoing the operation and the page was ever created, we put * it on the freelist. */ pgno = PGNO_BASE_MD; if ((ret = CDB_memp_fget(mpf, &pgno, 0, &meta)) != 0) { /* The metadata page must always exist on redo. */ if (redo) { (void)CDB___db_pgerr(file_dbp, pgno); goto out; } else goto done; } if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) { /* * We specify creation and check for it later, because this * operation was supposed to create the page, and even in * the undo case it's going to get linked onto the freelist * which we're also fixing up. */ (void)CDB___db_pgerr(file_dbp, argp->pgno); (void)CDB_memp_fput(mpf, meta, 0); goto out; } /* Fix up the allocated page. */ modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->page_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ P_INIT(pagep, file_dbp->pgsize, argp->pgno, PGNO_INVALID, PGNO_INVALID, 0, argp->ptype); pagep->lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ P_INIT(pagep, file_dbp->pgsize, argp->pgno, PGNO_INVALID, meta->free, 0, P_INVALID); pagep->lsn = argp->page_lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) { (void)CDB_memp_fput(mpf, meta, 0); goto out; } /* Fix up the metadata page. */ modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(meta)); cmp_p = CDB_log_compare(&LSN(meta), &argp->meta_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ meta->lsn = *lsnp; meta->free = argp->next; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ meta->lsn = argp->meta_lsn; meta->free = argp->pgno; modified = 1; } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___bam_pg_free_recover -- * Recovery function for pg_free. * * PUBLIC: int CDB___bam_pg_free_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_pg_free_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_pg_free_args *argp; DB *file_dbp; DBC *dbc; DBMETA *meta; DB_LSN copy_lsn; DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t pgno; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_pg_free_print); REC_INTRO(CDB___bam_pg_free_read, 1); /* * Fix up the freed page. If we're redoing the operation we get the * page and explicitly discard its contents, then update its LSN. If * we're undoing the operation, we get the page and restore its header. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { /* * We don't automatically create the page. The only way the * page might not exist is if the alloc never happened, and * the only way the alloc might never have happened is if we * are undoing, in which case there's no reason to create the * page. */ if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; CDB___ua_memcpy(©_lsn, &LSN(argp->header.data), sizeof(DB_LSN)); cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), ©_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ P_INIT(pagep, file_dbp->pgsize, pagep->pgno, PGNO_INVALID, argp->next, 0, P_INVALID); pagep->lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ memcpy(pagep, argp->header.data, argp->header.size); modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; /* * Fix up the metadata page. If we're redoing or undoing the operation * we get the page and update its LSN and free pointer. */ pgno = PGNO_BASE_MD; if ((ret = CDB_memp_fget(mpf, &pgno, 0, &meta)) != 0) { /* The metadata page must always exist. */ (void)CDB___db_pgerr(file_dbp, pgno); goto out; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(meta)); cmp_p = CDB_log_compare(&LSN(meta), &argp->meta_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ meta->free = argp->pgno; meta->lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ meta->free = argp->next; meta->lsn = argp->meta_lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___bam_split_recover -- * Recovery function for split. * * PUBLIC: int CDB___bam_split_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_split_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_split_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *_lp, *lp, *np, *pp, *_rp, *rp, *sp; db_pgno_t pgno, root_pgno; int l_update, p_update, r_update, ret, rootsplit, t_ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_split_print); mpf = NULL; _lp = lp = np = pp = _rp = rp = NULL; sp = NULL; REC_INTRO(CDB___bam_split_read, 1); /* * There are two kinds of splits that we have to recover from. The * first is a root-page split, where the root page is split from a * leaf page into an internal page and two new leaf pages are created. * The second is where a page is split into two pages, and a new key * is inserted into the parent page. * * DBTs are not aligned in log records, so we need to copy the page * so that we can access fields within it throughout this routine. * Although we could hardcode the unaligned copies in this routine, * we will be calling into regular btree functions with this page, * so it's got to be aligned. Copying it into allocated memory is * the only way to guarantee this. */ if ((ret = CDB___os_malloc(argp->pg.size, NULL, &sp)) != 0) goto out; memcpy(sp, argp->pg.data, argp->pg.size); pgno = PGNO(sp); root_pgno = ((BTREE *)file_dbp->bt_internal)->bt_root; rootsplit = pgno == root_pgno; if (CDB_memp_fget(mpf, &argp->left, 0, &lp) != 0) lp = NULL; if (CDB_memp_fget(mpf, &argp->right, 0, &rp) != 0) rp = NULL; if (redo) { l_update = r_update = p_update = 0; /* * Decide if we need to resplit the page. * * If this is a root split, then the root has to exist, it's * the page we're splitting and it gets modified. If this is * not a root split, then the left page has to exist, for the * same reason. */ if (rootsplit) { if ((ret = CDB_memp_fget(mpf, &pgno, 0, &pp)) != 0) { (void)CDB___db_pgerr(file_dbp, pgno); pp = NULL; goto out; } p_update = CDB_log_compare(&LSN(pp), &LSN(argp->pg.data)) == 0; } else if (lp == NULL) { (void)CDB___db_pgerr(file_dbp, argp->left); goto out; } if (lp == NULL || CDB_log_compare(&LSN(lp), &argp->llsn) == 0) l_update = 1; if (rp == NULL || CDB_log_compare(&LSN(rp), &argp->rlsn) == 0) r_update = 1; if (!p_update && !l_update && !r_update) goto done; /* Allocate and initialize new left/right child pages. */ if ((ret = CDB___os_malloc(file_dbp->pgsize, NULL, &_lp)) != 0 || (ret = CDB___os_malloc(file_dbp->pgsize, NULL, &_rp)) != 0) goto out; if (rootsplit) { P_INIT(_lp, file_dbp->pgsize, argp->left, PGNO_INVALID, ISINTERNAL(sp) ? PGNO_INVALID : argp->right, LEVEL(sp), TYPE(sp)); P_INIT(_rp, file_dbp->pgsize, argp->right, ISINTERNAL(sp) ? PGNO_INVALID : argp->left, PGNO_INVALID, LEVEL(sp), TYPE(sp)); } else { P_INIT(_lp, file_dbp->pgsize, PGNO(sp), ISINTERNAL(sp) ? PGNO_INVALID : PREV_PGNO(sp), ISINTERNAL(sp) ? PGNO_INVALID : argp->right, LEVEL(sp), TYPE(sp)); P_INIT(_rp, file_dbp->pgsize, argp->right, ISINTERNAL(sp) ? PGNO_INVALID : sp->pgno, ISINTERNAL(sp) ? PGNO_INVALID : NEXT_PGNO(sp), LEVEL(sp), TYPE(sp)); } /* Split the page. */ if ((ret = CDB___bam_copy(file_dbp, sp, _lp, 0, argp->indx)) != 0 || (ret = CDB___bam_copy(file_dbp, sp, _rp, argp->indx, NUM_ENT(sp))) != 0) goto out; /* If the left child is wrong, update it. */ if (lp == NULL && (ret = CDB_memp_fget(mpf, &argp->left, DB_MPOOL_CREATE, &lp)) != 0) { (void)CDB___db_pgerr(file_dbp, argp->left); lp = NULL; goto out; } if (l_update) { memcpy(lp, _lp, file_dbp->pgsize); lp->lsn = *lsnp; if ((ret = CDB_memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) goto out; lp = NULL; } /* If the right child is wrong, update it. */ if (rp == NULL && (ret = CDB_memp_fget(mpf, &argp->right, DB_MPOOL_CREATE, &rp)) != 0) { (void)CDB___db_pgerr(file_dbp, argp->right); rp = NULL; goto out; } if (r_update) { memcpy(rp, _rp, file_dbp->pgsize); rp->lsn = *lsnp; if ((ret = CDB_memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) goto out; rp = NULL; } /* * If the parent page is wrong, update it. This is of interest * only if it was a root split, since root splits create parent * pages. All other splits modify a parent page, but those are * separately logged and recovered. */ if (rootsplit && p_update) { if (file_dbp->type == DB_BTREE) P_INIT(pp, file_dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, _lp->level + 1, P_IBTREE); else P_INIT(pp, file_dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, _lp->level + 1, P_IRECNO); RE_NREC_SET(pp, file_dbp->type == DB_RECNO || F_ISSET(file_dbp, DB_BT_RECNUM) ? CDB___bam_total(_lp) + CDB___bam_total(_rp) : 0); pp->lsn = *lsnp; if ((ret = CDB_memp_fput(mpf, pp, DB_MPOOL_DIRTY)) != 0) goto out; pp = NULL; } /* * Finally, redo the next-page link if necessary. This is of * interest only if it wasn't a root split -- inserting a new * page in the tree requires that any following page have its * previous-page pointer updated to our new page. The next * page must exist because we're redoing the operation. */ if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) { if ((ret = CDB_memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { (void)CDB___db_pgerr(file_dbp, argp->npgno); np = NULL; goto out; } if (CDB_log_compare(&LSN(np), &argp->nlsn) == 0) { PREV_PGNO(np) = argp->right; np->lsn = *lsnp; if ((ret = CDB_memp_fput(mpf, np, DB_MPOOL_DIRTY)) != 0) goto out; np = NULL; } } } else { /* * If the split page is wrong, replace its contents with the * logged page contents. If the page doesn't exist, it means * that the create of the page never happened, nor did any of * the adds onto the page that caused the split, and there's * really no undo-ing to be done. */ if ((ret = CDB_memp_fget(mpf, &pgno, 0, &pp)) != 0) { pp = NULL; goto lrundo; } if (CDB_log_compare(lsnp, &LSN(pp)) == 0) { memcpy(pp, argp->pg.data, argp->pg.size); if ((ret = CDB_memp_fput(mpf, pp, DB_MPOOL_DIRTY)) != 0) goto out; pp = NULL; } /* * If it's a root split and the left child ever existed, update * its LSN. (If it's not a root split, we've updated the left * page already -- it's the same as the split page.) If the * right child ever existed, root split or not, update its LSN. * The undo of the page allocation(s) will restore them to the * free list. */ lrundo: if ((rootsplit && lp != NULL) || rp != NULL) { if (rootsplit && lp != NULL && CDB_log_compare(lsnp, &LSN(lp)) == 0) { lp->lsn = argp->llsn; if ((ret = CDB_memp_fput(mpf, lp, DB_MPOOL_DIRTY)) != 0) goto out; lp = NULL; } if (rp != NULL && CDB_log_compare(lsnp, &LSN(rp)) == 0) { rp->lsn = argp->rlsn; if ((ret = CDB_memp_fput(mpf, rp, DB_MPOOL_DIRTY)) != 0) goto out; rp = NULL; } } /* * Finally, undo the next-page link if necessary. This is of * interest only if it wasn't a root split -- inserting a new * page in the tree requires that any following page have its * previous-page pointer updated to our new page. Since it's * possible that the next-page never existed, we ignore it as * if there's nothing to undo. */ if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) { if ((ret = CDB_memp_fget(mpf, &argp->npgno, 0, &np)) != 0) { np = NULL; goto done; } if (CDB_log_compare(lsnp, &LSN(np)) == 0) { PREV_PGNO(np) = argp->left; np->lsn = argp->nlsn; if (CDB_memp_fput(mpf, np, DB_MPOOL_DIRTY)) goto out; np = NULL; } } } done: *lsnp = argp->prev_lsn; ret = 0; out: /* Free any pages that weren't dirtied. */ if (pp != NULL && (t_ret = CDB_memp_fput(mpf, pp, 0)) != 0 && ret == 0) ret = t_ret; if (lp != NULL && (t_ret = CDB_memp_fput(mpf, lp, 0)) != 0 && ret == 0) ret = t_ret; if (np != NULL && (t_ret = CDB_memp_fput(mpf, np, 0)) != 0 && ret == 0) ret = t_ret; if (rp != NULL && (t_ret = CDB_memp_fput(mpf, rp, 0)) != 0 && ret == 0) ret = t_ret; /* Free any allocated space. */ if (_lp != NULL) CDB___os_free(_lp, file_dbp->pgsize); if (_rp != NULL) CDB___os_free(_rp, file_dbp->pgsize); if (sp != NULL) CDB___os_free(sp, argp->pg.size); REC_CLOSE; } /* * CDB___bam_rsplit_recover -- * Recovery function for a reverse split. * * PUBLIC: int CDB___bam_rsplit_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_rsplit_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_rsplit_args *argp; DB *file_dbp; DBC *dbc; DB_LSN copy_lsn; DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t pgno, root_pgno; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_rsplit_print); REC_INTRO(CDB___bam_rsplit_read, 1); /* Fix the root page. */ pgno = root_pgno = ((BTREE *)file_dbp->bt_internal)->bt_root; if ((ret = CDB_memp_fget(mpf, &pgno, 0, &pagep)) != 0) { /* The root page must always exist. */ CDB___db_pgerr(file_dbp, pgno); goto out; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->rootlsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ memcpy(pagep, argp->pgdbt.data, argp->pgdbt.size); pagep->pgno = root_pgno; pagep->lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ P_INIT(pagep, file_dbp->pgsize, root_pgno, argp->nrec, PGNO_INVALID, pagep->level + 1, file_dbp->type == DB_BTREE ? P_IBTREE : P_IRECNO); if ((ret = CDB___db_pitem(dbc, pagep, 0, argp->rootent.size, &argp->rootent, NULL)) != 0) goto out; pagep->lsn = argp->rootlsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; /* * Fix the page copied over the root page. It's possible that the * page never made it to disk, so if we're undo-ing and the page * doesn't exist, it's okay and there's nothing further to do. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; CDB___ua_memcpy(©_lsn, &LSN(argp->pgdbt.data), sizeof(DB_LSN)); cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), ©_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ pagep->lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ memcpy(pagep, argp->pgdbt.data, argp->pgdbt.size); modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___bam_adj_recover -- * Recovery function for adj. * * PUBLIC: int CDB___bam_adj_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_adj_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_adj_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_adj_print); REC_INTRO(CDB___bam_adj_read, 1); /* Get the page; if it never existed and we're undoing, we're done. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ if ((ret = CDB___bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, argp->is_insert)) != 0) goto err; LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ if ((ret = CDB___bam_adjindx(dbc, pagep, argp->indx, argp->indx_copy, !argp->is_insert)) != 0) goto err; LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; if (0) { err: (void)CDB_memp_fput(mpf, pagep, 0); } out: REC_CLOSE; } /* * CDB___bam_cadjust_recover -- * Recovery function for the adjust of a count change in an internal * page. * * PUBLIC: int CDB___bam_cadjust_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_cadjust_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_cadjust_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t root_pgno; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_cadjust_print); REC_INTRO(CDB___bam_cadjust_read, 1); /* Get the page; if it never existed and we're undoing, we're done. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; root_pgno = ((BTREE *)file_dbp->bt_internal)->bt_root; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ if (file_dbp->type == DB_BTREE && F_ISSET(file_dbp, DB_BT_RECNUM)) { GET_BINTERNAL(pagep, argp->indx)->nrecs += argp->adjust; if (argp->total && PGNO(pagep) == root_pgno) RE_NREC_ADJ(pagep, argp->adjust); } if (file_dbp->type == DB_RECNO) { GET_RINTERNAL(pagep, argp->indx)->nrecs += argp->adjust; if (argp->total && PGNO(pagep) == root_pgno) RE_NREC_ADJ(pagep, argp->adjust); } LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ if (file_dbp->type == DB_BTREE && F_ISSET(file_dbp, DB_BT_RECNUM)) { GET_BINTERNAL(pagep, argp->indx)->nrecs -= argp->adjust; if (argp->total && PGNO(pagep) == root_pgno) RE_NREC_ADJ(pagep, argp->adjust); } if (file_dbp->type == DB_RECNO) { GET_RINTERNAL(pagep, argp->indx)->nrecs -= argp->adjust; if (argp->total && PGNO(pagep) == root_pgno) RE_NREC_ADJ(pagep, -(argp->adjust)); } LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___bam_cdel_recover -- * Recovery function for the intent-to-delete of a cursor record. * * PUBLIC: int CDB___bam_cdel_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_cdel_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_cdel_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_cdel_print); REC_INTRO(CDB___bam_cdel_read, 1); /* Get the page; if it never existed and we're undoing, we're done. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ if (pagep->type == P_DUPLICATE) B_DSET(GET_BKEYDATA(pagep, argp->indx)->type); else B_DSET(GET_BKEYDATA(pagep, argp->indx + O_INDX)->type); LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ if (pagep->type == P_DUPLICATE) B_DCLR(GET_BKEYDATA(pagep, argp->indx)->type); else B_DCLR(GET_BKEYDATA(pagep, argp->indx + O_INDX)->type); LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___bam_repl_recover -- * Recovery function for page item replacement. * * PUBLIC: int CDB___bam_repl_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_repl_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_repl_args *argp; BKEYDATA *bk; DB *file_dbp; DBC *dbc; DBT dbt; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, modified, ret; u_int8_t *p; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_repl_print); REC_INTRO(CDB___bam_repl_read, 1); /* Get the page; if it never existed and we're undoing, we're done. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) goto done; (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } bk = GET_BKEYDATA(pagep, argp->indx); modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { /* * Need to redo update described. * * Re-build the replacement item. */ memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->repl.size; if ((ret = CDB___os_malloc(dbt.size, NULL, &dbt.data)) != 0) goto err; p = dbt.data; memcpy(p, bk->data, argp->prefix); p += argp->prefix; memcpy(p, argp->repl.data, argp->repl.size); p += argp->repl.size; memcpy(p, bk->data + (bk->len - argp->suffix), argp->suffix); ret = CDB___bam_ritem(dbc, pagep, argp->indx, &dbt); CDB___os_free(dbt.data, dbt.size); if (ret != 0) goto err; LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* * Need to undo update described. * * Re-build the original item. */ memset(&dbt, 0, sizeof(dbt)); dbt.size = argp->prefix + argp->suffix + argp->orig.size; if ((ret = CDB___os_malloc(dbt.size, NULL, &dbt.data)) != 0) goto err; p = dbt.data; memcpy(p, bk->data, argp->prefix); p += argp->prefix; memcpy(p, argp->orig.data, argp->orig.size); p += argp->orig.size; memcpy(p, bk->data + (bk->len - argp->suffix), argp->suffix); ret = CDB___bam_ritem(dbc, pagep, argp->indx, &dbt); CDB___os_free(dbt.data, dbt.size); if (ret != 0) goto err; /* Reset the deleted flag, if necessary. */ if (argp->isdeleted) B_DSET(GET_BKEYDATA(pagep, argp->indx)->type); LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; if (0) { err: (void)CDB_memp_fput(mpf, pagep, 0); } out: REC_CLOSE; } /* * CDB___bam_root_recover -- * Recovery function for setting the root page on the meta-data page. * * PUBLIC: int CDB___bam_root_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___bam_root_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __bam_root_args *argp; BTMETA *meta; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___bam_root_print); REC_INTRO(CDB___bam_root_read, 0); if ((ret = CDB_memp_fget(mpf, &argp->meta_pgno, 0, &meta)) != 0) { /* The metadata page must always exist on redo. */ if (redo) { (void)CDB___db_pgerr(file_dbp, argp->meta_pgno); goto out; } else goto done; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(meta)); cmp_p = CDB_log_compare(&LSN(meta), &argp->meta_lsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ meta->root = argp->root_pgno; meta->dbmeta.lsn = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Nothing to undo except lsn. */ meta->dbmeta.lsn = argp->meta_lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } �����������������������������������������������htdig-3.2.0b6/db/bt_reclaim.c�����������������������������������������������������������������������0100644�0063146�0012731�00000001777�07427026535�015243� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_reclaim.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "btree.h" /* * CDB___bam_reclaim -- * Free a database. * * PUBLIC: int CDB___bam_reclaim __P((DB *, DB_TXN *)); */ int CDB___bam_reclaim(dbp, txn) DB *dbp; DB_TXN *txn; { BTREE *t; DBC *dbc; int ret, t_ret; /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) return (ret); /* Walk the tree, freeing pages. */ t = dbp->bt_internal; ret = CDB___bam_traverse(dbc, DB_LOCK_WRITE, t->bt_root, CDB___db_reclaim_callback, dbc); /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } �htdig-3.2.0b6/db/bt_recno.c�������������������������������������������������������������������������0100644�0063146�0012731�00000075615�07427026535�014737� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_recno.c 11.9 (Sleepycat) 10/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" #include "db_ext.h" #include "db_shash.h" #include "lock.h" #include "lock_ext.h" #include "qam.h" static int CDB___ram_add __P((DBC *, db_recno_t *, DBT *, u_int32_t, u_int32_t)); static int CDB___ram_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); static int CDB___ram_fmap __P((DBC *, db_recno_t)); static int CDB___ram_i_delete __P((DBC *)); static int CDB___ram_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); static int CDB___ram_source __P((DB *)); static int CDB___ram_update __P((DBC *, db_recno_t, int)); static int CDB___ram_vmap __P((DBC *, db_recno_t)); /* * In recno, there are two meanings to the on-page "deleted" flag. If we're * re-numbering records, it means the record was implicitly created. We skip * over implicitly created records if doing a cursor "next" or "prev", and * return DB_KEYEMPTY if they're explicitly requested.. If not re-numbering * records, it means that the record was implicitly created, or was deleted. * We skip over implicitly created or deleted records if doing a cursor "next" * or "prev", and return DB_KEYEMPTY if they're explicitly requested. * * If we're re-numbering records, then we have to detect in the cursor that * a record was deleted, and adjust the cursor as necessary on the next get. * If we're not re-numbering records, then we can detect that a record has * been deleted by looking at the actual on-page record, so we completely * ignore the cursor's delete flag. This is different from the B+tree code. * It also maintains whether the cursor references a deleted record in the * cursor, and it doesn't always check the on-page value. */ #define CD_SET(dbp, cp) { \ if (F_ISSET(dbp, DB_RE_RENUMBER)) \ F_SET(cp, C_DELETED); \ } #define CD_CLR(dbp, cp) { \ if (F_ISSET(dbp, DB_RE_RENUMBER)) \ F_CLR(cp, C_DELETED); \ } #define CD_ISSET(dbp, cp) \ (F_ISSET(dbp, DB_RE_RENUMBER) && F_ISSET(cp, C_DELETED)) /* * CDB___ram_open -- * Recno open function. * * PUBLIC: int CDB___ram_open __P((DB *, const char *, db_pgno_t)); */ int CDB___ram_open(dbp, name, base_pgno) DB *dbp; const char *name; db_pgno_t base_pgno; { BTREE *t; DBC *dbc; int ret, t_ret; t = dbp->bt_internal; /* Initialize the remaining fields/methods of the DB. */ dbp->del = CDB___ram_delete; dbp->put = CDB___ram_put; dbp->stat = CDB___bam_stat; /* Set the overflow page size. */ CDB___bam_setovflsize(dbp); /* Start up the tree. */ if ((ret = CDB___bam_read_root(dbp, name, base_pgno)) != 0) goto err; /* * If the user specified a source tree, open it and map it in. * * !!! * We don't complain if the user specified transactions or threads. * It's possible to make it work, but you'd better know what you're * doing! */ if (t->re_source == NULL) F_SET(t, RECNO_EOF); else if ((ret = CDB___ram_source(dbp)) != 0) goto err; /* If we're snapshotting an underlying source file, do it now. */ if (F_ISSET(dbp, DB_RE_SNAPSHOT)) { /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) goto err; /* Do the snapshot. */ if ((ret = CDB___ram_update(dbc, DB_MAX_RECORDS, 0)) != 0 && ret == DB_NOTFOUND) ret = 0; /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; if (ret != 0) goto err; } return (0); err: /* If we mmap'd a source file, discard it. */ if (t->re_smap != NULL) (void)CDB___os_unmapfile(dbp->dbenv, t->re_smap, t->re_msize); /* If we opened a source file, discard it. */ if (F_ISSET(&t->re_fh, DB_FH_VALID)) (void)CDB___os_closehandle(&t->re_fh); if (t->re_source != NULL) CDB___os_freestr(t->re_source); return (ret); } /* * CDB___ram_delete -- * Recno db->del function. */ static int CDB___ram_delete(dbp, txn, key, flags) DB *dbp; DB_TXN *txn; DBT *key; u_int32_t flags; { BTREE_CURSOR *cp; DBC *dbc; db_recno_t recno; int ret, t_ret; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) return (ret); /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "ram_delete", key, NULL, flags); /* Check the user's record number and fill in as necessary. */ if ((ret = CDB___ram_getno(dbc, key, &recno, 0)) != 0) goto err; /* Do the delete. */ cp = dbc->internal; cp->recno = recno; ret = CDB___ram_i_delete(dbc); /* Release the cursor. */ err: if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___ram_i_delete -- * Internal version of recno delete, called by CDB___ram_delete and * CDB___ram_c_del. */ static int CDB___ram_i_delete(dbc) DBC *dbc; { BKEYDATA bk; BTREE *t; BTREE_CURSOR *cp; DB *dbp; DBT hdr, data; PAGE *h; db_indx_t indx; int exact, ret, stack; dbp = dbc->dbp; cp = dbc->internal; t = dbp->bt_internal; stack = 0; /* * If this is CDB and this isn't a write cursor, then it's an error. * If it is a write cursor, but we don't yet hold the write lock, then * we need to upgrade to the write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { /* Make sure it's a valid update cursor. */ if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EINVAL); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } /* Search the tree for the key; delete only deletes exact matches. */ if ((ret = CDB___bam_rsearch(dbc, &cp->recno, S_DELETE, 1, &exact)) != 0) goto err; if (!exact) { ret = DB_NOTFOUND; goto err; } stack = 1; h = cp->csp->page; indx = cp->csp->indx; /* * If re-numbering records, the on-page deleted flag can only mean * that this record was implicitly created. Applications aren't * permitted to delete records they never created, return an error. * * If not re-numbering records, the on-page deleted flag means that * this record was implicitly created, or, was deleted at some time. * The former is an error because applications aren't permitted to * delete records they never created, the latter is an error because * if the record was "deleted", we could never have found it. */ if (B_DISSET(GET_BKEYDATA(h, indx)->type)) { ret = DB_KEYEMPTY; goto err; } if (F_ISSET(dbp, DB_RE_RENUMBER)) { /* Delete the item, adjust the counts, adjust the cursors. */ if ((ret = CDB___bam_ditem(dbc, h, indx)) != 0) goto err; CDB___bam_adjust(dbc, -1); CDB___ram_ca(dbp, cp->recno, CA_DELETE); /* * If the page is empty, delete it. The whole tree is locked * so there are no preparations to make. */ if (NUM_ENT(h) == 0 && h->pgno != t->bt_root) { stack = 0; ret = CDB___bam_dpages(dbc); } } else { /* Use a delete/put pair to replace the record with a marker. */ if ((ret = CDB___bam_ditem(dbc, h, indx)) != 0) goto err; B_TSET(bk.type, B_KEYDATA, 1); bk.len = 0; memset(&hdr, 0, sizeof(hdr)); hdr.data = &bk; hdr.size = SSZA(BKEYDATA, data); memset(&data, 0, sizeof(data)); data.data = (void *)""; data.size = 0; if ((ret = CDB___db_pitem(dbc, h, indx, BKEYDATA_SIZE(0), &hdr, &data)) != 0) goto err; } F_SET(t, RECNO_MODIFIED); err: if (stack) CDB___bam_stkrel(dbc, 0); /* If we upgraded the CDB lock upon entry; downgrade it now. */ if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___ram_put -- * Recno db->put function. */ static int CDB___ram_put(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { DBC *dbc; db_recno_t recno; int ret, t_ret; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_putchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), 0)) != 0) return (ret); /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "ram_put", key, data, flags); /* * If we're appending to the tree, make sure we've read in all of * the backing source file. Otherwise, check the user's record * number and fill in as necessary. */ if (flags == DB_APPEND) { if ((ret = CDB___ram_update( dbc, DB_MAX_RECORDS, 0)) != 0 && ret == DB_NOTFOUND) ret = 0; } else ret = CDB___ram_getno(dbc, key, &recno, 1); /* Add the record. */ if (ret == 0) ret = CDB___ram_add(dbc, &recno, data, flags, 0); /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; /* Return the record number if we're appending to the tree. */ if (ret == 0 && flags == DB_APPEND) *(db_recno_t *)key->data = recno; return (ret); } /* * CDB___ram_c_del -- * Recno cursor->c_del function. * * PUBLIC: int CDB___ram_c_del __P((DBC *, u_int32_t)); */ int CDB___ram_c_del(dbc, flags) DBC *dbc; u_int32_t flags; { BTREE_CURSOR *cp; DB *dbp; int ret; dbp = dbc->dbp; cp = dbc->internal; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cdelchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY), cp->recno != RECNO_OOB)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "ram_c_del", NULL, NULL, flags); /* * The semantics of cursors during delete are as follows: if record * numbers are mutable (DB_RE_RENUMBER is set), deleting a record * causes the cursor to automatically point to the record immediately * following. In this case it is possible to use a single cursor for * repeated delete operations, without intervening operations. * * If record numbers are not mutable, then records are replaced with * a marker containing a delete flag. If the record referenced by * this cursor has already been deleted, we will detect that as part * of the delete operation, and fail. */ return (CDB___ram_i_delete(dbc)); } /* * CDB___ram_c_get -- * Recno cursor->c_get function. * * PUBLIC: int CDB___ram_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); */ int CDB___ram_c_get(dbc, key, data, flags) DBC *dbc; DBT *key, *data; u_int32_t flags; { BTREE_CURSOR *cp, copy; DB *dbp; PAGE *h; db_indx_t indx; int exact, ret, stack, tmp_rmw; dbp = dbc->dbp; cp = dbc->internal; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cgetchk(dbc->dbp, key, data, flags, cp->recno != RECNO_OOB)) != 0) return (ret); /* Clear OR'd in additional bits so we can check for flag equality. */ tmp_rmw = 0; if (LF_ISSET(DB_RMW)) { tmp_rmw = 1; F_SET(dbc, DBC_RMW); LF_CLR(DB_RMW); } DEBUG_LREAD(dbc, dbc->txn, "ram_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); /* Initialize the cursor for a new retrieval. */ copy = *cp; retry: /* Update the record number. */ stack = 0; switch (flags) { case DB_CURRENT: /* * If record numbers are mutable: if we just deleted a record, * there is no action necessary, we return the record following * the deleted item by virtue of renumbering the tree. */ break; case DB_NEXT: /* * If record numbers are mutable: if we just deleted a record, * we have to avoid incrementing the record number so that we * return the right record by virtue of renumbering the tree. */ if (CD_ISSET(dbp, cp)) break; if (cp->recno != RECNO_OOB) { ++cp->recno; break; } /* FALLTHROUGH */ case DB_FIRST: flags = DB_NEXT; cp->recno = 1; break; case DB_PREV: if (cp->recno != RECNO_OOB) { if (cp->recno == 1) { ret = DB_NOTFOUND; goto err; } --cp->recno; break; } /* FALLTHROUGH */ case DB_LAST: flags = DB_PREV; if (((ret = CDB___ram_update(dbc, DB_MAX_RECORDS, 0)) != 0) && ret != DB_NOTFOUND) goto err; if ((ret = CDB___bam_nrecs(dbc, &cp->recno)) != 0) goto err; if (cp->recno == 0) { ret = DB_NOTFOUND; goto err; } break; case DB_SET: case DB_SET_RANGE: if ((ret = CDB___ram_getno(dbc, key, &cp->recno, 0)) != 0) goto err; break; } /* * For DB_PREV, DB_LAST, DB_SET and DB_SET_RANGE, we have already * called CDB___ram_update() to make sure sufficient records have been * read from the backing source file. Do it now for DB_CURRENT (if * the current record was deleted we may need more records from the * backing file for a DB_CURRENT operation), DB_FIRST and DB_NEXT. */ if (flags == DB_NEXT && ((ret = CDB___ram_update(dbc, cp->recno, 0)) != 0) && ret != DB_NOTFOUND) goto err; /* Search the tree for the record. */ if ((ret = CDB___bam_rsearch(dbc, &cp->recno, F_ISSET(dbc, DBC_RMW) ? S_FIND_WR : S_FIND, 1, &exact)) != 0) goto err; stack = 1; if (!exact) { ret = DB_NOTFOUND; goto err; } h = cp->csp->page; indx = cp->csp->indx; /* * If re-numbering records, the on-page deleted flag means this record * was implicitly created. If not re-numbering records, the on-page * deleted flag means this record was implicitly created, or, it was * deleted at some time. Regardless, we skip such records if doing * cursor next/prev operations, and fail if the application requested * them explicitly. */ if (B_DISSET(GET_BKEYDATA(h, indx)->type)) { if (flags == DB_NEXT || flags == DB_PREV) { (void)CDB___bam_stkrel(dbc, 0); goto retry; } ret = DB_KEYEMPTY; goto err; } /* Return the key if the user didn't give us one. */ if (flags != DB_SET && flags != DB_SET_RANGE && (ret = CDB___db_retcopy(dbp, key, &cp->recno, sizeof(cp->recno), &dbc->rkey.data, &dbc->rkey.ulen)) != 0) goto err; /* Return the data item. */ if ((ret = CDB___db_ret(dbp, h, indx, data, &dbc->rdata.data, &dbc->rdata.ulen)) != 0) goto err; /* The cursor was reset, no further delete adjustment is necessary. */ CD_CLR(dbp, cp); err: if (stack) (void)CDB___bam_stkrel(dbc, 0); /* Release temporary lock upgrade. */ if (tmp_rmw) F_CLR(dbc, DBC_RMW); if (ret != 0) *cp = copy; return (ret); } /* * CDB___ram_c_put -- * Recno cursor->c_put function. * * PUBLIC: int CDB___ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); */ int CDB___ram_c_put(dbc, key, data, flags) DBC *dbc; DBT *key, *data; u_int32_t flags; { BTREE_CURSOR *cp, copy; DB *dbp; int exact, ret; void *arg; dbp = dbc->dbp; cp = dbc->internal; PANIC_CHECK(dbp->dbenv); if ((ret = CDB___db_cputchk(dbc->dbp, key, data, flags, F_ISSET(dbc->dbp, DB_AM_RDONLY), cp->recno != RECNO_OOB)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "ram_c_put", NULL, data, flags); /* * If we are running CDB, this had better be either a write * cursor or an immediate writer. If it's a regular writer, * that means we have an IWRITE lock and we need to upgrade * it to a write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EINVAL); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } /* Initialize the cursor for a new retrieval. */ copy = *cp; /* * To split, we need a valid key for the page. * * The split code discards all short-term locks and stack pages. */ if (0) { split: arg = &cp->recno; if ((ret = CDB___bam_split(dbc, arg)) != 0) goto err; } if ((ret = CDB___bam_rsearch(dbc, &cp->recno, S_INSERT, 1, &exact)) != 0) goto err; if (!exact) { ret = DB_NOTFOUND; goto err; } if ((ret = CDB___bam_iitem(dbc, &cp->csp->page, &cp->csp->indx, key, data, flags, 0)) == DB_NEEDSPLIT) { if ((ret = CDB___bam_stkrel(dbc, 0)) != 0) goto err; goto split; } if ((ret = CDB___bam_stkrel(dbc, 0)) != 0) goto err; switch (flags) { case DB_AFTER: /* Adjust the cursors. */ CDB___ram_ca(dbp, cp->recno, CA_IAFTER); /* Set this cursor to reference the new record. */ cp->recno = copy.recno + 1; break; case DB_BEFORE: /* Adjust the cursors. */ CDB___ram_ca(dbp, cp->recno, CA_IBEFORE); /* Set this cursor to reference the new record. */ cp->recno = copy.recno; break; } /* Return the key if we've created a new record. */ if ((flags == DB_AFTER || flags == DB_BEFORE) && (ret = CDB___db_retcopy(dbp, key, &cp->recno, sizeof(cp->recno), &dbc->rkey.data, &dbc->rkey.ulen)) != 0) goto err; /* The cursor was reset, no further delete adjustment is necessary. */ CD_CLR(dbp, cp); err: if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); if (ret != 0) *cp = copy; return (ret); } /* * CDB___ram_ca -- * Adjust cursors. * * PUBLIC: void CDB___ram_ca __P((DB *, db_recno_t, ca_recno_arg)); */ void CDB___ram_ca(dbp, recno, op) DB *dbp; db_recno_t recno; ca_recno_arg op; { BTREE_CURSOR *cp; DBC *dbc; db_recno_t nrecs; /* * Adjust the cursors. See the comment in CDB___bam_ca_delete(). */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = dbc->internal; switch (op) { case CA_DELETE: if (recno < cp->recno) --cp->recno; if (recno == cp->recno) { if (CDB___bam_nrecs( dbc, &nrecs) == 0 && recno > nrecs) --cp->recno; else CD_SET(dbp, cp); } break; case CA_IAFTER: if (recno < cp->recno) ++cp->recno; break; case CA_IBEFORE: if (recno <= cp->recno) ++cp->recno; break; } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___ram_getno -- * Check the user's record number, and make sure we've seen it. * * PUBLIC: int CDB___ram_getno __P((DBC *, const DBT *, db_recno_t *, int)); */ int CDB___ram_getno(dbc, key, rep, can_create) DBC *dbc; const DBT *key; db_recno_t *rep; int can_create; { DB *dbp; db_recno_t recno; dbp = dbc->dbp; /* Check the user's record number. */ if ((recno = *(db_recno_t *)key->data) == 0) { CDB___db_err(dbp->dbenv, "illegal record number of 0"); return (EINVAL); } if (rep != NULL) *rep = recno; /* * Btree can neither create records nor read them in. Recno can * do both, see if we can find the record. */ return (dbp->type == DB_RECNO ? CDB___ram_update(dbc, recno, can_create) : 0); } /* * CDB___ram_update -- * Ensure the tree has records up to and including the specified one. */ static int CDB___ram_update(dbc, recno, can_create) DBC *dbc; db_recno_t recno; int can_create; { BTREE *t; DB *dbp; db_recno_t nrecs; int ret; dbp = dbc->dbp; t = dbp->bt_internal; /* * If we can't create records and we've read the entire backing input * file, we're done. */ if (!can_create && F_ISSET(t, RECNO_EOF)) return (0); /* * If we haven't seen this record yet, try to get it from the original * file. */ if ((ret = CDB___bam_nrecs(dbc, &nrecs)) != 0) return (ret); if (!F_ISSET(t, RECNO_EOF) && recno > nrecs) { if ((ret = t->re_irec(dbc, recno)) != 0) return (ret); if ((ret = CDB___bam_nrecs(dbc, &nrecs)) != 0) return (ret); } /* * If we can create records, create empty ones up to the requested * record. */ if (!can_create || recno <= nrecs + 1) return (0); dbc->rdata.dlen = 0; dbc->rdata.doff = 0; dbc->rdata.flags = 0; if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { if (dbc->rdata.ulen < t->re_len) { if ((ret = CDB___os_realloc(t->re_len, NULL, &dbc->rdata.data)) != 0) { dbc->rdata.ulen = 0; dbc->rdata.data = NULL; return (ret); } dbc->rdata.ulen = t->re_len; } dbc->rdata.size = t->re_len; memset(dbc->rdata.data, t->re_pad, t->re_len); } else dbc->rdata.size = 0; while (recno > ++nrecs) if ((ret = CDB___ram_add(dbc, &nrecs, &dbc->rdata, 0, BI_DELETED)) != 0) return (ret); return (0); } /* * CDB___ram_source -- * Load information about the backing file. */ static int CDB___ram_source(dbp) DB *dbp; { BTREE *t; size_t size; u_int32_t bytes, mbytes; int ret; t = dbp->bt_internal; /* * !!! * The caller has full responsibility for cleaning up on error -- * (it has to anyway, in case it fails after this routine succeeds). */ if ((ret = CDB___db_appname(dbp->dbenv, DB_APP_DATA, NULL, t->re_source, 0, NULL, &t->re_source)) != 0) return (ret); /* * !!! * It's possible that the backing source file is read-only. We don't * much care other than we'll complain if there are any modifications * when it comes time to write the database back to the source. */ ret = CDB___os_open(t->re_source, F_ISSET(dbp, DB_AM_RDONLY) ? DB_OSO_RDONLY : 0, 0, &t->re_fh); if (ret != 0 && !F_ISSET(dbp, DB_AM_RDONLY)) ret = CDB___os_open(t->re_source, DB_OSO_RDONLY, 0, &t->re_fh); if (ret != 0) { CDB___db_err(dbp->dbenv, "%s: %s", t->re_source, CDB_db_strerror(ret)); return (ret); } /* * XXX * We'd like to test to see if the file is too big to mmap. Since we * don't know what size or type off_t's or size_t's are, or the largest * unsigned integral type is, or what random insanity the local C * compiler will perpetrate, doing the comparison in a portable way is * flatly impossible. Hope that mmap fails if the file is too large. */ if ((ret = CDB___os_ioinfo(t->re_source, &t->re_fh, &mbytes, &bytes, NULL)) != 0) { CDB___db_err(dbp->dbenv, "%s: %s", t->re_source, CDB_db_strerror(ret)); return (ret); } if (mbytes == 0 && bytes == 0) { F_SET(t, RECNO_EOF); return (0); } size = mbytes * MEGABYTE + bytes; if ((ret = CDB___os_mapfile(dbp->dbenv, t->re_source, &t->re_fh, (size_t)size, 1, &t->re_smap)) != 0) return (ret); t->re_cmap = t->re_smap; t->re_emap = (u_int8_t *)t->re_smap + (t->re_msize = size); t->re_irec = F_ISSET(dbp, DB_RE_FIXEDLEN) ? CDB___ram_fmap : CDB___ram_vmap; return (0); } /* * CDB___ram_writeback -- * Rewrite the backing file. * * PUBLIC: int CDB___ram_writeback __P((DB *)); */ int CDB___ram_writeback(dbp) DB *dbp; { BTREE *t; DBC *dbc; DBT key, data; DB_FH fh; db_recno_t keyno; ssize_t nw; int ret, t_ret; u_int8_t delim, *pad; t = dbp->bt_internal; /* If the file wasn't modified, we're done. */ if (!F_ISSET(t, RECNO_MODIFIED)) return (0); /* If there's no backing source file, we're done. */ if (t->re_source == NULL) { F_CLR(t, RECNO_MODIFIED); return (0); } /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); /* * Read any remaining records into the tree. * * !!! * This is why we can't support transactions when applications specify * backing (re_source) files. At this point we have to read in the * rest of the records from the file so that we can write all of the * records back out again, which could modify a page for which we'd * have to log changes and which we don't have locked. This could be * partially fixed by taking a snapshot of the entire file during the * DB->open as DB->open is transaction protected. But, if a checkpoint * occurs then, the part of the log holding the copy of the file could * be discarded, and that would make it impossible to recover in the * face of disaster. This could all probably be fixed, but it would * require transaction protecting the backing source file, i.e. mpool * would have to know about it, and we don't want to go there. */ if ((ret = CDB___ram_update(dbc, DB_MAX_RECORDS, 0)) != 0 && ret != DB_NOTFOUND) return (ret); /* * !!! * Close any underlying mmap region. This is required for Windows NT * (4.0, Service Pack 2) -- if the file is still mapped, the following * open will fail. */ if (t->re_smap != NULL) { (void)CDB___os_unmapfile(dbp->dbenv, t->re_smap, t->re_msize); t->re_smap = NULL; } /* Get rid of any backing file descriptor, just on GP's. */ if (F_ISSET(&t->re_fh, DB_FH_VALID)) (void)CDB___os_closehandle(&t->re_fh); /* Open the file, truncating it. */ if ((ret = CDB___os_open( t->re_source, DB_OSO_SEQ | DB_OSO_TRUNC, 0, &fh)) != 0) { CDB___db_err(dbp->dbenv, "%s: %s", t->re_source, CDB_db_strerror(ret)); goto err; } /* * We step through the records, writing each one out. Use the record * number and the dbp->get() function, instead of a cursor, so we find * and write out "deleted" or non-existent records. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.size = sizeof(db_recno_t); key.data = &keyno; /* * We'll need the delimiter if we're doing variable-length records, * and the pad character if we're doing fixed-length records. */ delim = t->re_delim; if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { if ((ret = CDB___os_malloc(t->re_len, NULL, &pad)) != 0) goto err; memset(pad, t->re_pad, t->re_len); } else COMPQUIET(pad, NULL); for (keyno = 1;; ++keyno) { switch (ret = dbp->get(dbp, NULL, &key, &data, 0)) { case 0: if ((ret = CDB___os_write(&fh, data.data, data.size, &nw)) != 0) goto err; if (nw != (ssize_t)data.size) { ret = EIO; goto err; } break; case DB_KEYEMPTY: if (F_ISSET(dbp, DB_RE_FIXEDLEN)) { if ((ret = CDB___os_write( &fh, pad, t->re_len, &nw)) != 0) goto err; if (nw != (ssize_t)t->re_len) { ret = EIO; goto err; } } break; case DB_NOTFOUND: ret = 0; goto done; } if (!F_ISSET(dbp, DB_RE_FIXEDLEN)) { if ((ret = CDB___os_write(&fh, &delim, 1, &nw)) != 0) goto err; if (nw != 1) { ret = EIO; goto err; } } } err: done: /* Close the file descriptor. */ if (F_ISSET(&fh, DB_FH_VALID) && (t_ret = CDB___os_closehandle(&fh)) != 0 && ret == 0) ret = t_ret; /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; if (ret == 0) F_CLR(t, RECNO_MODIFIED); return (ret); } /* * CDB___ram_fmap -- * Get fixed length records from a file. */ static int CDB___ram_fmap(dbc, top) DBC *dbc; db_recno_t top; { BTREE *t; DB *dbp; DBT data; db_recno_t recno; u_int32_t len; u_int8_t *sp, *ep, *p; int is_modified, ret; dbp = dbc->dbp; t = dbp->bt_internal; if ((ret = CDB___bam_nrecs(dbc, &recno)) != 0) return (ret); if (dbc->rdata.ulen < t->re_len) { if ((ret = CDB___os_realloc(t->re_len, NULL, &dbc->rdata.data)) != 0) { dbc->rdata.ulen = 0; dbc->rdata.data = NULL; return (ret); } dbc->rdata.ulen = t->re_len; } is_modified = F_ISSET(t, RECNO_MODIFIED); memset(&data, 0, sizeof(data)); data.data = dbc->rdata.data; data.size = t->re_len; sp = (u_int8_t *)t->re_cmap; ep = (u_int8_t *)t->re_emap; while (recno < top) { if (sp >= ep) { F_SET(t, RECNO_EOF); ret = DB_NOTFOUND; goto err; } len = t->re_len; for (p = dbc->rdata.data; sp < ep && len > 0; *p++ = *sp++, --len) ; /* * Another process may have read this record from the input * file and stored it into the database already, in which * case we don't need to repeat that operation. We detect * this by checking if the last record we've read is greater * or equal to the number of records in the database. * * XXX * We should just do a seek, since the records are fixed * length. */ if (t->re_last >= recno) { if (len != 0) memset(p, t->re_pad, len); ++recno; if ((ret = CDB___ram_add(dbc, &recno, &data, 0, 0)) != 0) goto err; } ++t->re_last; } t->re_cmap = sp; err: if (!is_modified) F_CLR(t, RECNO_MODIFIED); return (0); } /* * CDB___ram_vmap -- * Get variable length records from a file. */ static int CDB___ram_vmap(dbc, top) DBC *dbc; db_recno_t top; { BTREE *t; DBT data; db_recno_t recno; u_int8_t *sp, *ep; int delim, is_modified, ret; t = dbc->dbp->bt_internal; if ((ret = CDB___bam_nrecs(dbc, &recno)) != 0) return (ret); delim = t->re_delim; is_modified = F_ISSET(t, RECNO_MODIFIED); memset(&data, 0, sizeof(data)); sp = (u_int8_t *)t->re_cmap; ep = (u_int8_t *)t->re_emap; while (recno < top) { if (sp >= ep) { F_SET(t, RECNO_EOF); ret = DB_NOTFOUND; goto err; } for (data.data = sp; sp < ep && *sp != delim; ++sp) ; /* * Another process may have read this record from the input * file and stored it into the database already, in which * case we don't need to repeat that operation. We detect * this by checking if the last record we've read is greater * or equal to the number of records in the database. */ if (t->re_last >= recno) { data.size = sp - (u_int8_t *)data.data; ++recno; if ((ret = CDB___ram_add(dbc, &recno, &data, 0, 0)) != 0) goto err; } ++t->re_last; ++sp; } t->re_cmap = sp; err: if (!is_modified) F_CLR(t, RECNO_MODIFIED); return (ret); } /* * CDB___ram_add -- * Add records into the tree. */ static int CDB___ram_add(dbc, recnop, data, flags, bi_flags) DBC *dbc; db_recno_t *recnop; DBT *data; u_int32_t flags, bi_flags; { BKEYDATA *bk; BTREE_CURSOR *cp; PAGE *h; db_indx_t indx; int exact, ret, stack; cp = dbc->internal; retry: /* Find the slot for insertion. */ if ((ret = CDB___bam_rsearch(dbc, recnop, S_INSERT | (flags == DB_APPEND ? S_APPEND : 0), 1, &exact)) != 0) return (ret); h = cp->csp->page; indx = cp->csp->indx; stack = 1; /* * If re-numbering records, the on-page deleted flag means this record * was implicitly created. If not re-numbering records, the on-page * deleted flag means this record was implicitly created, or, it was * deleted at some time. * * If DB_NOOVERWRITE is set and the item already exists in the tree, * return an error unless the item was either marked for deletion or * only implicitly created. */ if (exact) { bk = GET_BKEYDATA(h, indx); if (!B_DISSET(bk->type) && flags == DB_NOOVERWRITE) { ret = DB_KEYEXIST; goto err; } } /* * Select the arguments for CDB___bam_iitem() and do the insert. If the * key is an exact match, or we're replacing the data item with a * new data item, replace the current item. If the key isn't an exact * match, we're inserting a new key/data pair, before the search * location. */ switch (ret = CDB___bam_iitem(dbc, &h, &indx, NULL, data, exact ? DB_CURRENT : DB_BEFORE, bi_flags)) { case 0: /* * Don't adjust anything. * * If we inserted a record, no cursors need adjusting because * the only new record it's possible to insert is at the very * end of the tree. The necessary adjustments to the internal * page counts were made by CDB___bam_iitem(). * * If we overwrote a record, no cursors need adjusting because * future DBcursor->get calls will simply return the underlying * record (there's no adjustment made for the DB_CURRENT flag * when a cursor get operation immediately follows a cursor * delete operation, and the normal adjustment for the DB_NEXT * flag is still correct). */ break; case DB_NEEDSPLIT: /* Discard the stack of pages and split the page. */ (void)CDB___bam_stkrel(dbc, 0); stack = 0; if ((ret = CDB___bam_split(dbc, recnop)) != 0) goto err; goto retry; /* NOTREACHED */ default: goto err; } err: if (stack) CDB___bam_stkrel(dbc, 0); return (ret); } �������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_rsearch.c�����������������������������������������������������������������������0100644�0063146�0012731�00000025200�07427026535�015241� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_rsearch.c 11.8 (Sleepycat) 10/21/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" /* * CDB___bam_rsearch -- * Search a btree for a record number. * * PUBLIC: int CDB___bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, int *)); */ int CDB___bam_rsearch(dbc, recnop, flags, stop, exactp) DBC *dbc; db_recno_t *recnop; u_int32_t flags; int stop, *exactp; { BINTERNAL *bi; BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; PAGE *h; RINTERNAL *ri; db_indx_t indx, top; db_lockmode_t lock_mode; db_pgno_t pg; db_recno_t i, recno, total; int ret, stack; dbp = dbc->dbp; cp = dbc->internal; BT_STK_CLR(cp); /* * There are several ways we search a btree tree. The flags argument * specifies if we're acquiring read or write locks and if we are * locking pairs of pages. In addition, if we're adding or deleting * an item, we have to lock the entire tree, regardless. See btree.h * for more details. * * If write-locking pages, we need to know whether or not to acquire a * write lock on a page before getting it. This depends on how deep it * is in tree, which we don't know until we acquire the root page. So, * if we need to lock the root page we may have to upgrade it later, * because we won't get the correct lock initially. * * Retrieve the root page. */ pg = ((BTREE *)dbp->bt_internal)->bt_root; stack = LF_ISSET(S_STACK); lock_mode = stack ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); } /* * Decide if we need to save this page; if we do, write lock it. * We deliberately don't lock-couple on this call. If the tree * is tiny, i.e., one page, and two threads are busily updating * the root page, we're almost guaranteed deadlocks galore, as * each one gets a read lock and then blocks the other's attempt * for a write lock. */ if (!stack && ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__LPUT(dbc, lock); lock_mode = DB_LOCK_WRITE; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); } stack = 1; } /* * If appending to the tree, set the record number now -- we have the * root page locked. * * Delete only deletes exact matches, read only returns exact matches. * Note, this is different from CDB___bam_search(), which returns non-exact * matches for read. * * The record may not exist. We can only return the correct location * for the record immediately after the last record in the tree, so do * a fast check now. */ total = RE_NREC(h); if (LF_ISSET(S_APPEND)) { *exactp = 0; *recnop = recno = total + 1; } else { recno = *recnop; if (recno <= total) *exactp = 1; else { *exactp = 0; if (!LF_ISSET(S_PAST_EOF) || recno > total + 1) { /* * Keep the page locked for serializability. * * XXX * This leaves the root page locked, which will * eliminate any concurrency. A possible fix * would be to lock the last leaf page instead. */ (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); return (DB_NOTFOUND); } } } /* * !!! * Record numbers in the tree are 0-based, but the recno is * 1-based. All of the calculations below have to take this * into account. */ for (total = 0;;) { switch (TYPE(h)) { case P_LBTREE: recno -= total; /* * There may be logically deleted records on the page, * walk the page correcting for them. The record may * not exist if there are enough deleted records in the * page. */ if (recno <= (db_recno_t)NUM_ENT(h) / P_INDX) for (i = recno - 1;; --i) { if (B_DISSET(GET_BKEYDATA(h, i * P_INDX + O_INDX)->type)) ++recno; if (i == 0) break; } if (recno > (db_recno_t)NUM_ENT(h) / P_INDX) { *exactp = 0; if (!LF_ISSET(S_PAST_EOF) || recno > (db_recno_t)(NUM_ENT(h) / P_INDX + 1)) { ret = DB_NOTFOUND; goto err; } } /* Correct from 1-based to 0-based for a page offset. */ --recno; BT_STK_ENTER(cp, h, recno * P_INDX, lock, lock_mode, ret); return (ret); case P_IBTREE: for (indx = 0, top = NUM_ENT(h);;) { bi = GET_BINTERNAL(h, indx); if (++indx == top || total + bi->nrecs >= recno) break; total += bi->nrecs; } pg = bi->pgno; break; case P_LRECNO: recno -= total; /* Correct from 1-based to 0-based for a page offset. */ --recno; BT_STK_ENTER(cp, h, recno, lock, lock_mode, ret); return (ret); case P_IRECNO: for (indx = 0, top = NUM_ENT(h);;) { ri = GET_RINTERNAL(h, indx); if (++indx == top || total + ri->nrecs >= recno) break; total += ri->nrecs; } pg = ri->pgno; break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } --indx; if (stack) { /* Return if this is the lowest page wanted. */ if (LF_ISSET(S_PARENT) && stop == h->level) { BT_STK_ENTER(cp, h, indx, lock, lock_mode, ret); return (ret); } BT_STK_PUSH(cp, h, indx, lock, lock_mode, ret); if (ret != 0) goto err; lock_mode = DB_LOCK_WRITE; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) goto err; } else { /* * Decide if we want to return a pointer to the next * page in the stack. If we do, write lock it and * never unlock it. */ if ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= (u_int8_t)(h->level - 1)) || (h->level - 1) == LEAFLEVEL) stack = 1; (void)CDB_memp_fput(dbp->mpf, h, 0); lock_mode = stack && LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = CDB___db_lget(dbc, 1, pg, lock_mode, 0, &lock)) != 0) { /* * If we fail, discard the lock we held. This * is OK because this only happens when we are * descending the tree holding read-locks. */ __LPUT(dbc, lock); goto err; } } if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) goto err; } /* NOTREACHED */ err: BT_STK_POP(cp); CDB___bam_stkrel(dbc, 0); return (ret); } /* * CDB___bam_adjust -- * Adjust the tree after adding or deleting a record. * * PUBLIC: int CDB___bam_adjust __P((DBC *, int32_t)); */ int CDB___bam_adjust(dbc, adjust) DBC *dbc; int32_t adjust; { BTREE_CURSOR *cp; DB *dbp; EPG *epg; PAGE *h; db_pgno_t root_pgno; int ret; dbp = dbc->dbp; cp = dbc->internal; root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; /* Update the record counts for the tree. */ for (epg = cp->sp; epg <= cp->csp; ++epg) { h = epg->page; if (TYPE(h) == P_IBTREE || TYPE(h) == P_IRECNO) { if (DB_LOGGING(dbc) && (ret = CDB___bam_cadjust_log(dbp->dbenv, dbc->txn, &LSN(h), 0, dbp->log_fileid, PGNO(h), &LSN(h), (u_int32_t)epg->indx, adjust, 1)) != 0) return (ret); if (TYPE(h) == P_IBTREE) GET_BINTERNAL(h, epg->indx)->nrecs += adjust; else GET_RINTERNAL(h, epg->indx)->nrecs += adjust; if (PGNO(h) == root_pgno) RE_NREC_ADJ(h, adjust); if ((ret = CDB_memp_fset(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); } } return (0); } /* * CDB___bam_nrecs -- * Return the number of records in the tree. * * PUBLIC: int CDB___bam_nrecs __P((DBC *, db_recno_t *)); */ int CDB___bam_nrecs(dbc, rep) DBC *dbc; db_recno_t *rep; { DB *dbp; DB_LOCK lock; PAGE *h; db_pgno_t pgno; int ret; dbp = dbc->dbp; pgno = ((BTREE *)dbp->bt_internal)->bt_root; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); *rep = RE_NREC(h); (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); return (0); } /* * CDB___bam_total -- * Return the number of records below a page. * * PUBLIC: db_recno_t CDB___bam_total __P((PAGE *)); */ db_recno_t CDB___bam_total(h) PAGE *h; { db_recno_t nrecs; db_indx_t indx, top; nrecs = 0; top = NUM_ENT(h); switch (TYPE(h)) { case P_LBTREE: /* Check for logically deleted records. */ for (indx = 0; indx < top; indx += P_INDX) if (!B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type)) ++nrecs; break; case P_IBTREE: for (indx = 0; indx < top; indx += O_INDX) nrecs += GET_BINTERNAL(h, indx)->nrecs; break; case P_LRECNO: nrecs = NUM_ENT(h); break; case P_IRECNO: for (indx = 0; indx < top; indx += O_INDX) nrecs += GET_RINTERNAL(h, indx)->nrecs; break; } return (nrecs); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_search.c������������������������������������������������������������������������0100644�0063146�0012731�00000025531�07427026535�015066� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_search.c 11.8 (Sleepycat) 10/21/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "lock.h" /* * CDB___bam_search -- * Search a btree for a key. * * PUBLIC: int CDB___bam_search __P((DBC *, * PUBLIC: const DBT *, u_int32_t, int, db_recno_t *, int *)); */ int CDB___bam_search(dbc, key, flags, stop, recnop, exactp) DBC *dbc; const DBT *key; u_int32_t flags; int stop, *exactp; db_recno_t *recnop; { BTREE *t; BTREE_CURSOR *cp; DB *dbp; DB_LOCK lock; PAGE *h; db_indx_t base, i, indx, lim; db_lockmode_t lock_mode; db_pgno_t pg; db_recno_t recno; int cmp, jump, ret, stack; dbp = dbc->dbp; cp = dbc->internal; t = dbp->bt_internal; recno = 0; BT_STK_CLR(cp); /* * There are several ways we search a btree tree. The flags argument * specifies if we're acquiring read or write locks, if we position * to the first or last item in a set of duplicates, if we return * deleted items, and if we are locking pairs of pages. In addition, * if we're modifying record numbers, we have to lock the entire tree * regardless. See btree.h for more details. * * If write-locking pages, we need to know whether or not to acquire a * write lock on a page before getting it. This depends on how deep it * is in tree, which we don't know until we acquire the root page. So, * if we need to lock the root page we may have to upgrade it later, * because we won't get the correct lock initially. * * Retrieve the root page. */ pg = ((BTREE *)dbp->bt_internal)->bt_root; stack = F_ISSET(dbp, DB_BT_RECNUM) && LF_ISSET(S_STACK); lock_mode = stack ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); } /* * Decide if we need to save this page; if we do, write lock it. * We deliberately don't lock-couple on this call. If the tree * is tiny, i.e., one page, and two threads are busily updating * the root page, we're almost guaranteed deadlocks galore, as * each one gets a read lock and then blocks the other's attempt * for a write lock. */ if (!stack && ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= h->level) || (LF_ISSET(S_WRITE) && h->level == LEAFLEVEL))) { (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__LPUT(dbc, lock); lock_mode = DB_LOCK_WRITE; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) { /* Did not read it, so we can release the lock */ (void)__LPUT(dbc, lock); return (ret); } stack = 1; } for (;;) { /* * Do a binary search on the current page. If we're searching * a leaf page, we have to manipulate the indices in groups of * two. If we're searching an internal page, they're an index * per page item. If we find an exact match on a leaf page, * we're done. */ jump = TYPE(h) == P_LBTREE ? P_INDX : O_INDX; for (base = 0, lim = NUM_ENT(h) / (db_indx_t)jump; lim != 0; lim >>= 1) { indx = base + ((lim >> 1) * jump); if ((cmp = CDB___bam_cmp(dbp, key, h, indx, t->bt_compare)) == 0) { if (TYPE(h) == P_LBTREE) goto match; goto next; } if (cmp > 0) { base = indx + jump; --lim; } } /* * No match found. Base is the smallest index greater than * key and may be zero or a last + O_INDX index. * * If it's a leaf page, return base as the "found" value. * Delete only deletes exact matches. */ if (TYPE(h) == P_LBTREE) { *exactp = 0; if (LF_ISSET(S_EXACT)) goto notfound; /* * !!! * Possibly returning a deleted record -- DB_SET_RANGE, * DB_KEYFIRST and DB_KEYLAST don't require an exact * match, and we don't want to walk multiple pages here * to find an undeleted record. This is handled by the * calling routine. */ BT_STK_ENTER(cp, h, base, lock, lock_mode, ret); return (ret); } /* * If it's not a leaf page, record the internal page (which is * a parent page for the key). Decrement the base by 1 if it's * non-zero so that if a split later occurs, the inserted page * will be to the right of the saved page. */ indx = base > 0 ? base - O_INDX : base; /* * If we're trying to calculate the record number, sum up * all the record numbers on this page up to the indx point. */ next: if (recnop != NULL) for (i = 0; i < indx; ++i) recno += GET_BINTERNAL(h, i)->nrecs; pg = GET_BINTERNAL(h, indx)->pgno; if (stack) { /* Return if this is the lowest page wanted. */ if (LF_ISSET(S_PARENT) && stop == h->level) { BT_STK_ENTER(cp, h, indx, lock, lock_mode, ret); return (ret); } BT_STK_PUSH(cp, h, indx, lock, lock_mode, ret); if (ret != 0) goto err; lock_mode = DB_LOCK_WRITE; if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &lock)) != 0) goto err; } else { /* * Decide if we want to return a reference to the next * page in the return stack. If so, lock it and never * unlock it. */ if ((LF_ISSET(S_PARENT) && (u_int8_t)(stop + 1) >= (u_int8_t)(h->level - 1)) || (h->level - 1) == LEAFLEVEL) stack = 1; (void)CDB_memp_fput(dbp->mpf, h, 0); lock_mode = stack && LF_ISSET(S_WRITE) ? DB_LOCK_WRITE : DB_LOCK_READ; if ((ret = CDB___db_lget(dbc, 1, pg, lock_mode, 0, &lock)) != 0) { /* * If we fail, discard the lock we held. This * is OK because this only happens when we are * descending the tree holding read-locks. */ __LPUT(dbc, lock); goto err; } } if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &h)) != 0) goto err; } /* NOTREACHED */ match: *exactp = 1; /* * If we're trying to calculate the record number, add in the * offset on this page and correct for the fact that records * in the tree are 0-based. */ if (recnop != NULL) *recnop = recno + (indx / P_INDX) + 1; /* * If we got here, we know that we have a btree leaf page. * * If there are duplicates, go to the first/last one. This is * safe because we know that we're not going to leave the page, * all duplicate sets that are not on overflow pages exist on a * single leaf page. */ if (LF_ISSET(S_DUPLAST)) while (indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && h->inp[indx] == h->inp[indx + P_INDX]) indx += P_INDX; else while (indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) indx -= P_INDX; /* * Now check if we are allowed to return deleted items; if not, then * find the next (or previous) non-deleted duplicate entry. (We do * not move from the original found key on the basis of the S_DELNO * flag.) */ if (LF_ISSET(S_DELNO)) { if (LF_ISSET(S_DUPLAST)) while (B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type) && indx > 0 && h->inp[indx] == h->inp[indx - P_INDX]) indx -= P_INDX; else while (B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type) && indx < (db_indx_t)(NUM_ENT(h) - P_INDX) && h->inp[indx] == h->inp[indx + P_INDX]) indx += P_INDX; /* * If we weren't able to find a non-deleted duplicate, return * DB_NOTFOUND. */ if (B_DISSET(GET_BKEYDATA(h, indx + O_INDX)->type)) goto notfound; } BT_STK_ENTER(cp, h, indx, lock, lock_mode, ret); return (ret); notfound: /* Keep the page locked for serializability. */ (void)CDB_memp_fput(dbp->mpf, h, 0); (void)__TLPUT(dbc, lock); ret = DB_NOTFOUND; err: if (cp->csp > cp->sp) { BT_STK_POP(cp); CDB___bam_stkrel(dbc, 0); } return (ret); } /* * CDB___bam_stkrel -- * Release all pages currently held in the stack. * * The caller must be sure that setting nolocks will not effect either * serializability or recoverability. * * PUBLIC: int CDB___bam_stkrel __P((DBC *, int)); */ int CDB___bam_stkrel(dbc, nolocks) DBC *dbc; int nolocks; { BTREE_CURSOR *cp; DB *dbp; EPG *epg; dbp = dbc->dbp; cp = dbc->internal; /* Release inner pages first. */ for (epg = cp->sp; epg <= cp->csp; ++epg) { if (epg->page != NULL) (void)CDB_memp_fput(dbp->mpf, epg->page, 0); if (epg->lock.off != LOCK_INVALID) { if (nolocks) (void)__LPUT(dbc, epg->lock); else (void)__TLPUT(dbc, epg->lock); } } /* Clear the stack, all pages have been released. */ BT_STK_CLR(cp); return (0); } /* * CDB___bam_stkgrow -- * Grow the stack. * * PUBLIC: int CDB___bam_stkgrow __P((BTREE_CURSOR *)); */ int CDB___bam_stkgrow(cp) BTREE_CURSOR *cp; { EPG *p; size_t entries; int ret; entries = cp->esp - cp->sp; if ((ret = CDB___os_calloc(entries * 2, sizeof(EPG), &p)) != 0) return (ret); memcpy(p, cp->sp, entries * sizeof(EPG)); if (cp->sp != cp->stack) CDB___os_free(cp->sp, entries * sizeof(EPG)); cp->sp = p; cp->csp = p + entries; cp->esp = p + entries * 2; return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_split.c�������������������������������������������������������������������������0100644�0063146�0012731�00000076557�07427026535�014772� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_split.c 11.8 (Sleepycat) 10/21/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "btree.h" #ifdef DEBUG #include "WordMonitor.h" #endif /* DEBUG */ static int CDB___bam_broot __P((DBC *, PAGE *, PAGE *, PAGE *)); static int CDB___bam_page __P((DBC *, EPG *, EPG *)); static int CDB___bam_pinsert __P((DBC *, EPG *, PAGE *, PAGE *, int)); static int CDB___bam_psplit __P((DBC *, EPG *, PAGE *, PAGE *, db_indx_t *)); static int CDB___bam_root __P((DBC *, EPG *)); static int CDB___ram_root __P((DBC *, PAGE *, PAGE *, PAGE *)); /* * CDB___bam_split -- * Split a page. * * PUBLIC: int CDB___bam_split __P((DBC *, void *)); */ int CDB___bam_split(dbc, arg) DBC *dbc; void *arg; { BTREE *t; BTREE_CURSOR *cp; DB *dbp; enum { UP, DOWN } dir; db_pgno_t root_pgno; int exact, level, ret; dbp = dbc->dbp; cp = dbc->internal; root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; /* * The locking protocol we use to avoid deadlock to acquire locks by * walking down the tree, but we do it as lazily as possible, locking * the root only as a last resort. We expect all stack pages to have * been discarded before we're called; we discard all short-term locks. * * When CDB___bam_split is first called, we know that a leaf page was too * full for an insert. We don't know what leaf page it was, but we * have the key/recno that caused the problem. We call XX_search to * reacquire the leaf page, but this time get both the leaf page and * its parent, locked. We then split the leaf page and see if the new * internal key will fit into the parent page. If it will, we're done. * * If it won't, we discard our current locks and repeat the process, * only this time acquiring the parent page and its parent, locked. * This process repeats until we succeed in the split, splitting the * root page as the final resort. The entire process then repeats, * as necessary, until we split a leaf page. * * XXX * A traditional method of speeding this up is to maintain a stack of * the pages traversed in the original search. You can detect if the * stack is correct by storing the page's LSN when it was searched and * comparing that LSN with the current one when it's locked during the * split. This would be an easy change for this code, but I have no * numbers that indicate it's worthwhile. */ t = dbp->bt_internal; for (dir = UP, level = LEAFLEVEL;; dir == UP ? ++level : --level) { /* * Acquire a page and its parent, locked. */ if ((ret = (dbp->type == DB_BTREE ? CDB___bam_search(dbc, arg, S_WRPAIR, level, NULL, &exact) : CDB___bam_rsearch(dbc, (db_recno_t *)arg, S_WRPAIR, level, &exact))) != 0) return (ret); /* * Split the page if it still needs it (it's possible another * thread of control has already split the page). If we are * guaranteed that two items will fit on the page, the split * is no longer necessary. */ if (t->bt_ovflsize * 2 <= (db_indx_t)P_FREESPACE(cp->csp[0].page)) { CDB___bam_stkrel(dbc, 1); return (0); } ret = cp->csp[0].page->pgno == root_pgno ? CDB___bam_root(dbc, &cp->csp[0]) : CDB___bam_page(dbc, &cp->csp[-1], &cp->csp[0]); BT_STK_CLR(cp); switch (ret) { case 0: /* Once we've split the leaf page, we're done. */ if (level == LEAFLEVEL) return (0); /* Switch directions. */ if (dir == UP) dir = DOWN; break; case DB_NEEDSPLIT: /* * It's possible to fail to split repeatedly, as other * threads may be modifying the tree, or the page usage * is sufficiently bad that we don't get enough space * the first time. */ if (dir == DOWN) dir = UP; break; default: return (ret); } } /* NOTREACHED */ } /* * CDB___bam_root -- * Split the root page of a btree. */ static int CDB___bam_root(dbc, cp) DBC *dbc; EPG *cp; { DB *dbp; PAGE *lp, *rp; db_indx_t split; int ret; dbp = dbc->dbp; /* Yeah, right. */ if (cp->page->level >= MAXBTREELEVEL) { ret = ENOSPC; goto err; } /* Create new left and right pages for the split. */ lp = rp = NULL; if ((ret = CDB___db_new(dbc, TYPE(cp->page), &lp)) != 0 || (ret = CDB___db_new(dbc, TYPE(cp->page), &rp)) != 0) goto err; P_INIT(lp, dbp->pgsize, lp->pgno, PGNO_INVALID, ISINTERNAL(cp->page) ? PGNO_INVALID : rp->pgno, cp->page->level, TYPE(cp->page)); P_INIT(rp, dbp->pgsize, rp->pgno, ISINTERNAL(cp->page) ? PGNO_INVALID : lp->pgno, PGNO_INVALID, cp->page->level, TYPE(cp->page)); /* Split the page. */ if ((ret = CDB___bam_psplit(dbc, cp, lp, rp, &split)) != 0) goto err; /* Log the change. */ if (DB_LOGGING(dbc)) { DBT __a; DB_LSN __lsn; memset(&__a, 0, sizeof(__a)); __a.data = cp->page; __a.size = dbp->pgsize; ZERO_LSN(__lsn); if ((ret = CDB___bam_split_log(dbp->dbenv, dbc->txn, &LSN(cp->page), 0, dbp->log_fileid, PGNO(lp), &LSN(lp), PGNO(rp), &LSN(rp), (u_int32_t)NUM_ENT(lp), 0, &__lsn, &__a)) != 0) goto err; LSN(lp) = LSN(rp) = LSN(cp->page); } /* Clean up the new root page. */ if ((ret = (dbp->type == DB_RECNO ? CDB___ram_root(dbc, cp->page, lp, rp) : CDB___bam_broot(dbc, cp->page, lp, rp))) != 0) goto err; /* Adjust any cursors. Do it last so we don't have to undo it. */ CDB___bam_ca_split(dbp, cp->page->pgno, lp->pgno, rp->pgno, split, 1); /* Success -- write the real pages back to the store. */ (void)CDB_memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY); (void)__TLPUT(dbc, cp->lock); (void)CDB_memp_fput(dbp->mpf, lp, DB_MPOOL_DIRTY); (void)CDB_memp_fput(dbp->mpf, rp, DB_MPOOL_DIRTY); return (0); err: if (lp != NULL) (void)CDB___db_free(dbc, lp); if (rp != NULL) (void)CDB___db_free(dbc, rp); (void)CDB_memp_fput(dbp->mpf, cp->page, 0); (void)__TLPUT(dbc, cp->lock); return (ret); } /* * CDB___bam_page -- * Split the non-root page of a btree. */ static int CDB___bam_page(dbc, pp, cp) DBC *dbc; EPG *pp, *cp; { DB *dbp; DB_LOCK tplock; DB_LSN save_lsn; PAGE *lp, *rp, *alloc_rp, *tp; db_indx_t split; int ret, t_ret; dbp = dbc->dbp; alloc_rp = lp = rp = tp = NULL; tplock.off = LOCK_INVALID; ret = -1; /* * Create a new right page for the split, and fill in everything * except its LSN and page number. * * We malloc space for both the left and right pages, so we don't get * a new page from the underlying buffer pool until we know the split * is going to succeed. The reason is that we can't release locks * acquired during the get-a-new-page process because metadata page * locks can't be discarded on failure since we may have modified the * free list. So, if you assume that we're holding a write lock on the * leaf page which ran out of space and started this split (e.g., we * have already written records to the page, or we retrieved a record * from it with the DB_RMW flag set), failing in a split with both a * leaf page locked and the metadata page locked can potentially lock * up the tree badly, because we've violated the rule of always locking * down the tree, and never up. */ if ((ret = CDB___os_malloc(dbp->pgsize, NULL, &rp)) != 0) goto err; P_INIT(rp, dbp->pgsize, 0, ISINTERNAL(cp->page) ? PGNO_INVALID : PGNO(cp->page), ISINTERNAL(cp->page) ? PGNO_INVALID : NEXT_PGNO(cp->page), cp->page->level, TYPE(cp->page)); /* * Create new left page for the split, and fill in everything * except its LSN and next-page page number. */ if ((ret = CDB___os_malloc(dbp->pgsize, NULL, &lp)) != 0) goto err; P_INIT(lp, dbp->pgsize, PGNO(cp->page), ISINTERNAL(cp->page) ? PGNO_INVALID : PREV_PGNO(cp->page), ISINTERNAL(cp->page) ? PGNO_INVALID : 0, cp->page->level, TYPE(cp->page)); /* * Split right. * * Only the indices are sorted on the page, i.e., the key/data pairs * aren't, so it's simpler to copy the data from the split page onto * two new pages instead of copying half the data to a new right page * and compacting the left page in place. Since the left page can't * change, we swap the original and the allocated left page after the * split. */ if ((ret = CDB___bam_psplit(dbc, cp, lp, rp, &split)) != 0) goto err; /* * Test to see if we are going to be able to insert the new pages into * the parent page. The interesting failure here is that the parent * page can't hold the new keys, and has to be split in turn, in which * case we want to release all the locks we can. */ if ((ret = CDB___bam_pinsert(dbc, pp, lp, rp, 1)) != 0) goto err; /* * Fix up the previous pointer of any leaf page following the split * page. * * There's interesting deadlock situations here as we try to write-lock * a page that's not in our direct ancestry. Consider a cursor walking * backward through the leaf pages, that has our following page locked, * and is waiting on a lock for the page we're splitting. In that case * we're going to deadlock here . It's probably OK, stepping backward * through the tree isn't a common operation. */ if (ISLEAF(cp->page) && NEXT_PGNO(cp->page) != PGNO_INVALID) { if ((ret = CDB___db_lget(dbc, 0, NEXT_PGNO(cp->page), DB_LOCK_WRITE, 0, &tplock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &NEXT_PGNO(cp->page), 0, &tp)) != 0) goto err; } /* * We've got everything locked down we need, and we know the split * is going to succeed. Go and get the additional page we'll need. */ if ((ret = CDB___db_new(dbc, TYPE(cp->page), &alloc_rp)) != 0) goto err; /* * Fix up the page numbers we didn't have before. We have to do this * before calling CDB___bam_pinsert because it may copy a page number onto * the parent page and it takes the page number from its page argument. */ PGNO(rp) = NEXT_PGNO(lp) = PGNO(alloc_rp); /* Actually update the parent page. */ if ((ret = CDB___bam_pinsert(dbc, pp, lp, rp, 0)) != 0) goto err; /* Log the change. */ if (DB_LOGGING(dbc)) { DBT __a; DB_LSN __lsn; memset(&__a, 0, sizeof(__a)); __a.data = cp->page; __a.size = dbp->pgsize; if (tp == NULL) ZERO_LSN(__lsn); if ((ret = CDB___bam_split_log(dbp->dbenv, dbc->txn, &LSN(cp->page), 0, dbp->log_fileid, PGNO(cp->page), &LSN(cp->page), PGNO(alloc_rp), &LSN(alloc_rp), (u_int32_t)NUM_ENT(lp), tp == NULL ? 0 : PGNO(tp), tp == NULL ? &__lsn : &LSN(tp), &__a)) != 0) goto err; /* Update the LSNs for all involved pages. */ LSN(alloc_rp) = LSN(lp) = LSN(rp) = LSN(cp->page); if (tp != NULL) LSN(tp) = LSN(cp->page); } /* * Copy the left and right pages into place. There are two paths * through here. Either we are logging and we set the LSNs in the * logging path. However, if we are not logging, then we do not * have valid LSNs on lp or rp. The correct LSNs to use are the * ones on the page we got from CDB___db_new or the one that was * originally on cp->page. In both cases, we save the LSN from the * real database page (not a malloc'd one) and reapply it after we * do the copy. */ save_lsn = alloc_rp->lsn; memcpy(alloc_rp, rp, LOFFSET(rp)); memcpy((u_int8_t *)alloc_rp + HOFFSET(rp), (u_int8_t *)rp + HOFFSET(rp), dbp->pgsize - HOFFSET(rp)); alloc_rp->lsn = save_lsn; save_lsn = cp->page->lsn; memcpy(cp->page, lp, LOFFSET(lp)); memcpy((u_int8_t *)cp->page + HOFFSET(lp), (u_int8_t *)lp + HOFFSET(lp), dbp->pgsize - HOFFSET(lp)); cp->page->lsn = save_lsn; /* Fix up the next-page link. */ if (tp != NULL) PREV_PGNO(tp) = PGNO(rp); /* Adjust any cursors. Do it last so we don't have to undo it. */ CDB___bam_ca_split(dbp, PGNO(cp->page), PGNO(cp->page), PGNO(rp), split, 0); CDB___os_free(lp, dbp->pgsize); CDB___os_free(rp, dbp->pgsize); /* * Success -- write the real pages back to the store. As we never * acquired any sort of lock on the new page, we release it before * releasing locks on the pages that reference it. We're finished * modifying the page so it's not really necessary, but it's neater. */ if ((t_ret = CDB_memp_fput(dbp->mpf, alloc_rp, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB_memp_fput(dbp->mpf, pp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, pp->lock); if ((t_ret = CDB_memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, cp->lock); if (tp != NULL) { if ((t_ret = CDB_memp_fput(dbp->mpf, tp, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; (void)__TLPUT(dbc, tplock); } return (ret); err: if (lp != NULL) CDB___os_free(lp, dbp->pgsize); if (rp != NULL) CDB___os_free(rp, dbp->pgsize); if (alloc_rp != NULL) (void)CDB___db_free(dbc, alloc_rp); if (tp != NULL) (void)CDB_memp_fput(dbp->mpf, tp, 0); if (tplock.off != LOCK_INVALID) /* We never updated the next page, we can release it. */ (void)__LPUT(dbc, tplock); (void)CDB_memp_fput(dbp->mpf, pp->page, 0); if (ret == DB_NEEDSPLIT) (void)__LPUT(dbc, pp->lock); else (void)__TLPUT(dbc, pp->lock); (void)CDB_memp_fput(dbp->mpf, cp->page, 0); if (ret == DB_NEEDSPLIT) (void)__LPUT(dbc, cp->lock); else (void)__TLPUT(dbc, cp->lock); return (ret); } /* * CDB___bam_broot -- * Fix up the btree root page after it has been split. */ static int CDB___bam_broot(dbc, rootp, lp, rp) DBC *dbc; PAGE *rootp, *lp, *rp; { BINTERNAL bi, *child_bi; BKEYDATA *child_bk; DB *dbp; DBT hdr, data; db_pgno_t root_pgno; int ret; dbp = dbc->dbp; /* * If the root page was a leaf page, change it into an internal page. * We copy the key we split on (but not the key's data, in the case of * a leaf page) to the new root page. */ root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; P_INIT(rootp, dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, lp->level + 1, P_IBTREE); #ifdef DEBUG word_monitor_set(WORD_MONITOR_LEVEL, LEVEL(rootp)); #endif /* DEBUG */ memset(&data, 0, sizeof(data)); memset(&hdr, 0, sizeof(hdr)); /* * The btree comparison code guarantees that the left-most key on any * level of the tree is never used, so it doesn't need to be filled in. */ memset(&bi, 0, sizeof(bi)); bi.len = 0; B_TSET(bi.type, B_KEYDATA, 0); bi.pgno = lp->pgno; if (F_ISSET(dbp, DB_BT_RECNUM)) { bi.nrecs = CDB___bam_total(lp); RE_NREC_SET(rootp, bi.nrecs); } hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); if ((ret = CDB___db_pitem(dbc, rootp, 0, BINTERNAL_SIZE(0), &hdr, NULL)) != 0) return (ret); switch (TYPE(rp)) { case P_IBTREE: /* Copy the first key of the child page onto the root page. */ child_bi = GET_BINTERNAL(rp, 0); bi.len = child_bi->len; B_TSET(bi.type, child_bi->type, 0); bi.pgno = rp->pgno; if (F_ISSET(dbp, DB_BT_RECNUM)) { bi.nrecs = CDB___bam_total(rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); data.data = child_bi->data; data.size = child_bi->len; if ((ret = CDB___db_pitem(dbc, rootp, 1, BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) return (ret); /* Increment the overflow ref count. */ if (B_TYPE(child_bi->type) == B_OVERFLOW) if ((ret = CDB___db_ovref(dbc, ((BOVERFLOW *)(child_bi->data))->pgno, 1)) != 0) return (ret); break; case P_LBTREE: /* Copy the first key of the child page onto the root page. */ child_bk = GET_BKEYDATA(rp, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: bi.len = child_bk->len; B_TSET(bi.type, child_bk->type, 0); bi.pgno = rp->pgno; if (F_ISSET(dbp, DB_BT_RECNUM)) { bi.nrecs = CDB___bam_total(rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); data.data = child_bk->data; data.size = child_bk->len; if ((ret = CDB___db_pitem(dbc, rootp, 1, BINTERNAL_SIZE(child_bk->len), &hdr, &data)) != 0) return (ret); break; case B_DUPLICATE: case B_OVERFLOW: bi.len = BOVERFLOW_SIZE; B_TSET(bi.type, child_bk->type, 0); bi.pgno = rp->pgno; if (F_ISSET(dbp, DB_BT_RECNUM)) { bi.nrecs = CDB___bam_total(rp); RE_NREC_ADJ(rootp, bi.nrecs); } hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); data.data = child_bk; data.size = BOVERFLOW_SIZE; if ((ret = CDB___db_pitem(dbc, rootp, 1, BINTERNAL_SIZE(BOVERFLOW_SIZE), &hdr, &data)) != 0) return (ret); /* Increment the overflow ref count. */ if (B_TYPE(child_bk->type) == B_OVERFLOW) if ((ret = CDB___db_ovref(dbc, ((BOVERFLOW *)child_bk)->pgno, 1)) != 0) return (ret); break; default: return (CDB___db_pgfmt(dbp, rp->pgno)); } break; default: return (CDB___db_pgfmt(dbp, rp->pgno)); } return (0); } /* * CDB___ram_root -- * Fix up the recno root page after it has been split. */ static int CDB___ram_root(dbc, rootp, lp, rp) DBC *dbc; PAGE *rootp, *lp, *rp; { DB *dbp; DBT hdr; RINTERNAL ri; db_pgno_t root_pgno; int ret; dbp = dbc->dbp; root_pgno = ((BTREE *)dbp->bt_internal)->bt_root; /* Initialize the page. */ P_INIT(rootp, dbp->pgsize, root_pgno, PGNO_INVALID, PGNO_INVALID, lp->level + 1, P_IRECNO); /* Initialize the header. */ memset(&hdr, 0, sizeof(hdr)); hdr.data = &ri; hdr.size = RINTERNAL_SIZE; /* Insert the left and right keys, set the header information. */ ri.pgno = lp->pgno; ri.nrecs = CDB___bam_total(lp); if ((ret = CDB___db_pitem(dbc, rootp, 0, RINTERNAL_SIZE, &hdr, NULL)) != 0) return (ret); RE_NREC_SET(rootp, ri.nrecs); ri.pgno = rp->pgno; ri.nrecs = CDB___bam_total(rp); if ((ret = CDB___db_pitem(dbc, rootp, 1, RINTERNAL_SIZE, &hdr, NULL)) != 0) return (ret); RE_NREC_ADJ(rootp, ri.nrecs); return (0); } /* * CDB___bam_pinsert -- * Insert a new key into a parent page, completing the split. */ static int CDB___bam_pinsert(dbc, parent, lchild, rchild, space_check) DBC *dbc; EPG *parent; PAGE *lchild, *rchild; int space_check; { BINTERNAL bi, *child_bi; BKEYDATA *child_bk, *tmp_bk; BTREE *t; DB *dbp; DBT a, b, hdr, data; PAGE *ppage; RINTERNAL ri; db_indx_t off; db_recno_t nrecs; u_int32_t n, nbytes, nksize; int ret; dbp = dbc->dbp; t = dbp->bt_internal; ppage = parent->page; /* If handling record numbers, count records split to the right page. */ nrecs = !space_check && (dbp->type == DB_RECNO || F_ISSET(dbp, DB_BT_RECNUM)) ? CDB___bam_total(rchild) : 0; /* * Now we insert the new page's first key into the parent page, which * completes the split. The parent points to a PAGE and a page index * offset, where the new key goes ONE AFTER the index, because we split * to the right. * * XXX * Some btree algorithms replace the key for the old page as well as * the new page. We don't, as there's no reason to believe that the * first key on the old page is any better than the key we have, and, * in the case of a key being placed at index 0 causing the split, the * key is unavailable. */ off = parent->indx + O_INDX; /* * Calculate the space needed on the parent page. * * Prefix trees: space hack used when inserting into BINTERNAL pages. * Retain only what's needed to distinguish between the new entry and * the LAST entry on the page to its left. If the keys compare equal, * retain the entire key. We ignore overflow keys, and the entire key * must be retained for the next-to-leftmost key on the leftmost page * of each level, or the search will fail. Applicable ONLY to internal * pages that have leaf pages as children. Further reduction of the * key between pairs of internal pages loses too much information. */ switch (TYPE(rchild)) { case P_IBTREE: child_bi = GET_BINTERNAL(rchild, 0); nbytes = BINTERNAL_PSIZE(child_bi->len); if (P_FREESPACE(ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); /* Add a new record for the right page. */ memset(&bi, 0, sizeof(bi)); bi.len = child_bi->len; B_TSET(bi.type, child_bi->type, 0); bi.pgno = rchild->pgno; bi.nrecs = nrecs; memset(&hdr, 0, sizeof(hdr)); hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); memset(&data, 0, sizeof(data)); data.data = child_bi->data; data.size = child_bi->len; if ((ret = CDB___db_pitem(dbc, ppage, off, BINTERNAL_SIZE(child_bi->len), &hdr, &data)) != 0) return (ret); /* Increment the overflow ref count. */ if (B_TYPE(child_bi->type) == B_OVERFLOW) if ((ret = CDB___db_ovref(dbc, ((BOVERFLOW *)(child_bi->data))->pgno, 1)) != 0) return (ret); break; case P_LBTREE: child_bk = GET_BKEYDATA(rchild, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: nbytes = BINTERNAL_PSIZE(child_bk->len); nksize = child_bk->len; if (t->bt_prefix == NULL) goto noprefix; if (ppage->prev_pgno == PGNO_INVALID && off <= 1) goto noprefix; tmp_bk = GET_BKEYDATA(lchild, NUM_ENT(lchild) - P_INDX); if (B_TYPE(tmp_bk->type) != B_KEYDATA) goto noprefix; memset(&a, 0, sizeof(a)); a.size = tmp_bk->len; a.data = tmp_bk->data; memset(&b, 0, sizeof(b)); b.size = child_bk->len; b.data = child_bk->data; nksize = t->bt_prefix(&a, &b); if ((n = BINTERNAL_PSIZE(nksize)) < nbytes) nbytes = n; else noprefix: nksize = child_bk->len; if (P_FREESPACE(ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); memset(&bi, 0, sizeof(bi)); bi.len = nksize; B_TSET(bi.type, child_bk->type, 0); bi.pgno = rchild->pgno; bi.nrecs = nrecs; memset(&hdr, 0, sizeof(hdr)); hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); memset(&data, 0, sizeof(data)); data.data = child_bk->data; data.size = nksize; if ((ret = CDB___db_pitem(dbc, ppage, off, BINTERNAL_SIZE(nksize), &hdr, &data)) != 0) return (ret); break; case B_DUPLICATE: case B_OVERFLOW: nbytes = BINTERNAL_PSIZE(BOVERFLOW_SIZE); if (P_FREESPACE(ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); memset(&bi, 0, sizeof(bi)); bi.len = BOVERFLOW_SIZE; B_TSET(bi.type, child_bk->type, 0); bi.pgno = rchild->pgno; bi.nrecs = nrecs; memset(&hdr, 0, sizeof(hdr)); hdr.data = &bi; hdr.size = SSZA(BINTERNAL, data); memset(&data, 0, sizeof(data)); data.data = child_bk; data.size = BOVERFLOW_SIZE; if ((ret = CDB___db_pitem(dbc, ppage, off, BINTERNAL_SIZE(BOVERFLOW_SIZE), &hdr, &data)) != 0) return (ret); /* Increment the overflow ref count. */ if (B_TYPE(child_bk->type) == B_OVERFLOW) if ((ret = CDB___db_ovref(dbc, ((BOVERFLOW *)child_bk)->pgno, 1)) != 0) return (ret); break; default: return (CDB___db_pgfmt(dbp, rchild->pgno)); } break; case P_IRECNO: case P_LRECNO: nbytes = RINTERNAL_PSIZE; if (P_FREESPACE(ppage) < nbytes) return (DB_NEEDSPLIT); if (space_check) return (0); /* Add a new record for the right page. */ memset(&hdr, 0, sizeof(hdr)); hdr.data = &ri; hdr.size = RINTERNAL_SIZE; ri.pgno = rchild->pgno; ri.nrecs = nrecs; if ((ret = CDB___db_pitem(dbc, ppage, off, RINTERNAL_SIZE, &hdr, NULL)) != 0) return (ret); break; default: return (CDB___db_pgfmt(dbp, rchild->pgno)); } /* Adjust the parent page's left page record count. */ if (dbp->type == DB_RECNO || F_ISSET(dbp, DB_BT_RECNUM)) { /* Log the change. */ if (DB_LOGGING(dbc) && (ret = CDB___bam_cadjust_log(dbp->dbenv, dbc->txn, &LSN(ppage), 0, dbp->log_fileid, PGNO(ppage), &LSN(ppage), (u_int32_t)parent->indx, -(int32_t)nrecs, (int32_t)0)) != 0) return (ret); /* Update the left page count. */ if (dbp->type == DB_RECNO) GET_RINTERNAL(ppage, parent->indx)->nrecs -= nrecs; else GET_BINTERNAL(ppage, parent->indx)->nrecs -= nrecs; } return (0); } /* * CDB___bam_psplit -- * Do the real work of splitting the page. */ static int CDB___bam_psplit(dbc, cp, lp, rp, splitret) DBC *dbc; EPG *cp; PAGE *lp, *rp; db_indx_t *splitret; { DB *dbp; PAGE *pp; db_indx_t half, nbytes, off, splitp, top; int adjust, cnt, isbigkey, ret; dbp = dbc->dbp; pp = cp->page; adjust = TYPE(pp) == P_LBTREE ? P_INDX : O_INDX; /* * If we're splitting the first (last) page on a level because we're * inserting (appending) a key to it, it's likely that the data is * sorted. Moving a single item to the new page is less work and can * push the fill factor higher than normal. If we're wrong it's not * a big deal, we'll just do the split the right way next time. */ off = 0; if (NEXT_PGNO(pp) == PGNO_INVALID && ((ISINTERNAL(pp) && cp->indx == NUM_ENT(cp->page) - 1) || (!ISINTERNAL(pp) && cp->indx == NUM_ENT(cp->page)))) off = NUM_ENT(cp->page) - adjust; else if (PREV_PGNO(pp) == PGNO_INVALID && cp->indx == 0) off = adjust; if (off != 0) goto sort; /* * Split the data to the left and right pages. Try not to split on * an overflow key. (Overflow keys on internal pages will slow down * searches.) Refuse to split in the middle of a set of duplicates. * * First, find the optimum place to split. * * It's possible to try and split past the last record on the page if * there's a very large record at the end of the page. Make sure this * doesn't happen by bounding the check at the next-to-last entry on * the page. * * Note, we try and split half the data present on the page. This is * because another process may have already split the page and left * it half empty. We don't try and skip the split -- we don't know * how much space we're going to need on the page, and we may need up * to half the page for a big item, so there's no easy test to decide * if we need to split or not. Besides, if two threads are inserting * data into the same place in the database, we're probably going to * need more space soon anyway. */ top = NUM_ENT(pp) - adjust; half = (dbp->pgsize - HOFFSET(pp)) / 2; for (nbytes = 0, off = 0; off < top && nbytes < half; ++off) switch (TYPE(pp)) { case P_IBTREE: if (B_TYPE(GET_BINTERNAL(pp, off)->type) == B_KEYDATA) nbytes += BINTERNAL_SIZE(GET_BINTERNAL(pp, off)->len); else nbytes += BINTERNAL_SIZE(BOVERFLOW_SIZE); break; case P_LBTREE: if (B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) nbytes += BKEYDATA_SIZE(GET_BKEYDATA(pp, off)->len); else nbytes += BOVERFLOW_SIZE; ++off; if (B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) nbytes += BKEYDATA_SIZE(GET_BKEYDATA(pp, off)->len); else nbytes += BOVERFLOW_SIZE; break; case P_IRECNO: nbytes += RINTERNAL_SIZE; break; case P_LRECNO: nbytes += BKEYDATA_SIZE(GET_BKEYDATA(pp, off)->len); break; default: return (CDB___db_pgfmt(dbp, pp->pgno)); } sort: splitp = off; /* * Splitp is either at or just past the optimum split point. If * it's a big key, try and find something close by that's not. */ if (TYPE(pp) == P_IBTREE) isbigkey = B_TYPE(GET_BINTERNAL(pp, off)->type) != B_KEYDATA; else if (TYPE(pp) == P_LBTREE) isbigkey = B_TYPE(GET_BKEYDATA(pp, off)->type) != B_KEYDATA; else isbigkey = 0; if (isbigkey) for (cnt = 1; cnt <= 3; ++cnt) { off = splitp + cnt * adjust; if (off < (db_indx_t)NUM_ENT(pp) && ((TYPE(pp) == P_IBTREE && B_TYPE(GET_BINTERNAL(pp,off)->type) == B_KEYDATA) || B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA)) { splitp = off; break; } if (splitp <= (db_indx_t)(cnt * adjust)) continue; off = splitp - cnt * adjust; if (TYPE(pp) == P_IBTREE ? B_TYPE(GET_BINTERNAL(pp, off)->type) == B_KEYDATA : B_TYPE(GET_BKEYDATA(pp, off)->type) == B_KEYDATA) { splitp = off; break; } } /* * We can't split in the middle a set of duplicates. We know that * no duplicate set can take up more than about 25% of the page, * because that's the point where we push it off onto a duplicate * page set. So, this loop can't be unbounded. */ if (F_ISSET(dbp, DB_AM_DUP) && TYPE(pp) == P_LBTREE && pp->inp[splitp] == pp->inp[splitp - adjust]) for (cnt = 1;; ++cnt) { off = splitp + cnt * adjust; if (off < NUM_ENT(pp) && pp->inp[splitp] != pp->inp[off]) { splitp = off; break; } if (splitp <= (db_indx_t)(cnt * adjust)) continue; off = splitp - cnt * adjust; if (pp->inp[splitp] != pp->inp[off]) { splitp = off + adjust; break; } } /* We're going to split at splitp. */ if ((ret = CDB___bam_copy(dbp, pp, lp, 0, splitp)) != 0) return (ret); if ((ret = CDB___bam_copy(dbp, pp, rp, splitp, NUM_ENT(pp))) != 0) return (ret); *splitret = splitp; return (0); } /* * CDB___bam_copy -- * Copy a set of records from one page to another. * * PUBLIC: int CDB___bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t)); */ int CDB___bam_copy(dbp, pp, cp, nxt, stop) DB *dbp; PAGE *pp, *cp; u_int32_t nxt, stop; { db_indx_t nbytes, off; /* * Copy the rest of the data to the right page. Nxt is the next * offset placed on the target page. */ for (off = 0; nxt < stop; ++nxt, ++NUM_ENT(cp), ++off) { switch (TYPE(pp)) { case P_IBTREE: if (B_TYPE(GET_BINTERNAL(pp, nxt)->type) == B_KEYDATA) nbytes = BINTERNAL_SIZE(GET_BINTERNAL(pp, nxt)->len); else nbytes = BINTERNAL_SIZE(BOVERFLOW_SIZE); break; case P_LBTREE: /* * If we're on a key and it's a duplicate, just copy * the offset. */ if (off != 0 && (nxt % P_INDX) == 0 && pp->inp[nxt] == pp->inp[nxt - P_INDX]) { cp->inp[off] = cp->inp[off - P_INDX]; continue; } /* FALLTHROUGH */ case P_LRECNO: if (B_TYPE(GET_BKEYDATA(pp, nxt)->type) == B_KEYDATA) nbytes = BKEYDATA_SIZE(GET_BKEYDATA(pp, nxt)->len); else nbytes = BOVERFLOW_SIZE; break; case P_IRECNO: nbytes = RINTERNAL_SIZE; break; default: return (CDB___db_pgfmt(dbp, pp->pgno)); } cp->inp[off] = HOFFSET(cp) -= nbytes; memcpy(P_ENTRY(cp, off), P_ENTRY(pp, nxt), nbytes); } return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_stat.c��������������������������������������������������������������������������0100644�0063146�0012731�00000015556�07427026535�014602� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_stat.c 11.4 (Sleepycat) 10/18/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "btree.h" static int CDB___bam_stat_callback __P((DB *, PAGE *, void *, int *)); /* * CDB___bam_stat -- * Gather/print the btree statistics * * PUBLIC: int CDB___bam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); */ int CDB___bam_stat(dbp, spp, db_malloc, flags) DB *dbp; void *spp; void *(*db_malloc) __P((size_t)); u_int32_t flags; { BTMETA *meta; BTREE *t; DBC *dbc; DB_BTREE_STAT *sp; DB_LOCK lock; PAGE *h; db_pgno_t pgno; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat"); meta = NULL; t = dbp->bt_internal; sp = NULL; lock.off = LOCK_INVALID; h = NULL; ret = 0; /* Check for invalid flags. */ if ((ret = CDB___db_statchk(dbp, flags)) != 0) return (ret); if (spp == NULL) return (0); /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); DEBUG_LWRITE(dbc, NULL, "bam_stat", NULL, NULL, flags); /* Allocate and clear the structure. */ if ((ret = CDB___os_malloc(sizeof(*sp), db_malloc, &sp)) != 0) goto err; memset(sp, 0, sizeof(*sp)); /* If the app just wants the record count, make it fast. */ if (flags == DB_RECORDCOUNT) { if ((ret = CDB___db_lget(dbc, 0, t->bt_root, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &t->bt_root, 0, (PAGE **)&h)) != 0) goto err; sp->bt_nrecs = RE_NREC(h); goto done; } /* Get the metadata page for the entire database. */ pgno = PGNO_BASE_MD; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) goto err; /* Walk the metadata free list, counting pages. */ for (sp->bt_free = 0, pgno = meta->dbmeta.free; pgno != PGNO_INVALID;) { ++sp->bt_free; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; pgno = h->next_pgno; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) goto err; h = NULL; } /* * Get the subdatabase metadata page if it's not the same as the * one we already have. */ if (t->bt_meta != PGNO_BASE_MD) { if ((ret = CDB_memp_fput(dbp->mpf, meta, 0)) != 0) goto err; meta = NULL; __LPUT(dbc, lock); if ((ret = CDB___db_lget(dbc, 0, t->bt_meta, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &t->bt_meta, 0, (PAGE **)&meta)) != 0) goto err; } /* Get metadata page statistics. */ sp->bt_metaflags = meta->dbmeta.flags; sp->bt_maxkey = meta->maxkey; sp->bt_minkey = meta->minkey; sp->bt_re_len = meta->re_len; sp->bt_re_pad = meta->re_pad; sp->bt_pagesize = meta->dbmeta.pagesize; sp->bt_magic = meta->dbmeta.magic; sp->bt_version = meta->dbmeta.version; /* Discard the metadata page. */ if ((ret = CDB_memp_fput(dbp->mpf, meta, 0)) != 0) goto err; meta = NULL; __LPUT(dbc, lock); /* Get the root page. */ pgno = t->bt_root; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; /* Get the levels from the root page. */ sp->bt_levels = h->level; /* Discard the root page. */ if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) goto err; h = NULL; __LPUT(dbc, lock); /* Walk the tree. */ if ((ret = CDB___bam_traverse(dbc, DB_LOCK_READ, t->bt_root, CDB___bam_stat_callback, sp)) != 0) goto err; done: *(DB_BTREE_STAT **)spp = sp; if (0) { err: if (sp != NULL) CDB___os_free(sp, sizeof(*sp)); } if (h != NULL && (t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) ret = t_ret; if (meta != NULL && (t_ret = CDB_memp_fput(dbp->mpf, meta, 0)) != 0 && ret == 0) ret = t_ret; if (lock.off != LOCK_INVALID) __LPUT(dbc, lock); if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___bam_traverse -- * Walk a Btree database. * * PUBLIC: int CDB___bam_traverse __P((DBC *, db_lockmode_t, * PUBLIC: db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); */ int CDB___bam_traverse(dbc, mode, root_pgno, callback, cookie) DBC *dbc; db_lockmode_t mode; db_pgno_t root_pgno; int (*callback)__P((DB *, PAGE *, void *, int *)); void *cookie; { BINTERNAL *bi; BOVERFLOW *bo; DB *dbp; DB_LOCK lock; PAGE *h; RINTERNAL *ri; int already_put, i, ret, t_ret; dbp = dbc->dbp; if ((ret = CDB___db_lget(dbc, 0, root_pgno, mode, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &root_pgno, 0, &h)) != 0) goto err; switch (TYPE(h)) { case P_IBTREE: for (i = 0; i < NUM_ENT(h); i++) { bi = GET_BINTERNAL(h, i); if ((ret = CDB___bam_traverse(dbc, mode, bi->pgno, callback, cookie)) != 0) break; switch (B_TYPE(bi->type)) { case B_DUPLICATE: bo = (BOVERFLOW *)bi->data; if ((ret = CDB___db_traverse_big( dbp, bo->pgno, callback, cookie)) != 0) goto err; break; case B_OVERFLOW: bo = (BOVERFLOW *)bi->data; if ((ret = CDB___db_traverse_dup( dbp, bo->pgno, callback, cookie)) != 0) goto err; break; case B_KEYDATA: break; default: goto pgerr; } } break; case P_IRECNO: for (i = 0; i < NUM_ENT(h); i++) { ri = GET_RINTERNAL(h, i); if ((ret = CDB___bam_traverse( dbc, mode, ri->pgno, callback, cookie)) != 0) break; } break; case P_DUPLICATE: case P_LBTREE: case P_LRECNO: case P_OVERFLOW: case P_CMPR_FREE: case P_CMPR_INTERNAL: break; default: pgerr: return (CDB___db_pgfmt(dbc->dbp, h->pgno)); } already_put = 0; if ((ret = callback(dbp, h, cookie, &already_put)) != 0) goto err; err: if (!already_put && (t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0 && ret != 0) ret = t_ret; __LPUT(dbc, lock); return (ret); } /* * CDB___bam_stat_callback -- * Statistics callback. */ static int CDB___bam_stat_callback(dbp, h, cookie, putp) DB *dbp; PAGE *h; void *cookie; int *putp; { DB_BTREE_STAT *sp; *putp = 0; sp = cookie; switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: ++sp->bt_int_pg; sp->bt_int_pgfree += P_FREESPACE(h); break; case P_LBTREE: ++sp->bt_leaf_pg; sp->bt_leaf_pgfree += P_FREESPACE(h); sp->bt_nrecs += NUM_ENT(h) / P_INDX; break; case P_LRECNO: ++sp->bt_leaf_pg; sp->bt_leaf_pgfree += P_FREESPACE(h); sp->bt_nrecs += NUM_ENT(h); break; case P_DUPLICATE: ++sp->bt_dup_pg; sp->bt_dup_pgfree += P_FREESPACE(h); break; case P_OVERFLOW: ++sp->bt_over_pg; sp->bt_over_pgfree += P_OVFLSPACE(dbp->pgsize, h); break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_upgrade.c�����������������������������������������������������������������������0100644�0063146�0012731�00000007206�07427026535�015247� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)bt_upgrade.c 11.5 (Sleepycat) 10/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" #include "db_am.h" static int CDB___bam_upgrade6 __P((DB *, int, char *, DB_FH *)); /* * CDB___bam_upgrade -- * Upgrade Btree databases. * * PUBLIC: int CDB___bam_upgrade __P((DB *, int, char *, DB_FH *, char *)); */ int CDB___bam_upgrade(dbp, swapped, real_name, fhp, mbuf) DB *dbp; int swapped; char *real_name, *mbuf; DB_FH *fhp; { DB_ENV *dbenv; int ret; dbenv = dbp->dbenv; /* Check the version. */ switch (((DBMETA *)mbuf)->version) { case 6: if ((ret = CDB___bam_upgrade6(dbp, swapped, real_name, fhp)) != 0) return (ret); /* FALLTHROUGH */ case 7: break; default: CDB___db_err(dbenv, "%s: unsupported btree version: %lu", real_name, (u_long)((DBMETA *)mbuf)->version); return (DB_OLD_VERSION); } return (0); } /* * CDB___bam_upgrade6 -- * Upgrade the database from version 6 to version 7. */ static int CDB___bam_upgrade6(dbp, swapped, real_name, fhp) DB *dbp; int swapped; char *real_name; DB_FH *fhp; { DB_ENV *dbenv; ssize_t n; u_int32_t tmp; int ret; u_int8_t buf[256], *p; dbenv = dbp->dbenv; if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 0); /* * Seek to the beginning of the file and read the metadata page. We * read 256 bytes, which is larger than any access method's metadata * page. */ if ((ret = CDB___os_seek(fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) return (ret); if ((ret = CDB___os_read(fhp, buf, sizeof(buf), &n)) != 0) return (ret); /* * Upgrade a Btree meta-data page. * Version 6: byte range: Version 7: byte range: * lsn 00-07 lsn 00-07 * pgno 08-11 pgno 08-11 * magic 12-15 magic 12-15 * version 16-19 version 16-19 * pagesize 20-23 pagesize 20-23 * maxkey 24-27 unused 24 * type 25 * unused 26-27 * minkey 28-31 free 28-31 * free 32-35 flags 32-35 * flags 36-39 uid 36-55 * re_len 40-43 maxkey 56-59 * re_pad 44-47 minkey 60-63 * uid 48-63 re_len 64-67 * re_pad 68-71 * root 72-75 */ /* * We are going to create a new uid, so we can move the stuff * at the end of the structure first, overwriting the uid. */ /* 64-71 done: Move re_len and re_pad */ memmove(buf + 64, buf + 40, 8); /* 56-63 done: Move maxkey and minkey */ memmove(buf + 56, buf + 24, 8); /* 16-19 done: Update the version. */ tmp = 7; if (swapped) M_32_SWAP(tmp); memcpy(buf + 16, &tmp, sizeof(u_int32_t)); /* 0-23 done: Bytes 0-24 are unchanged. */ p = buf + 24; /* 24-27 done: Add type. */ *p++ = '\0'; *p++ = P_BTREEMETA; *p++ = '\0'; *p = '\0'; /* 28-35 done: Move free and flags */ memmove(buf + 28, buf + 32, 8); /* 36-55 done: Replace the unique ID. */ if ((ret = CDB___os_fileid(dbenv, real_name, 1, buf + 36)) != 0) return (ret); /* 72-75 done: Set the root page. */ tmp = 1; if (swapped) M_32_SWAP(tmp); memcpy(buf + 72, &tmp, sizeof(u_int32_t)); /* Write the metadata page out. */ if ((ret = CDB___os_seek(fhp, 0, 0, 0, 1, DB_OS_SEEK_SET)) != 0) return (ret); if ((ret = CDB___os_write(fhp, buf, 128, &n)) != 0) return (ret); if ((ret = CDB___os_fsync(fhp)) != 0) return (ret); if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 100); return (0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/bt_verify.c������������������������������������������������������������������������0100644�0063146�0012731�00000155660�07427026535�015134� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999, 2000 * Sleepycat Software. All rights reserved. * * $Id: bt_verify.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: bt_verify.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_verify.h" #include "btree.h" static int __bam_safe_getdata __P((DB *, PAGE *, u_int32_t, int, DBT *, int *)); static int __bam_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, db_indx_t *, u_int32_t)); static int __bam_vrfy_treeorder __P((DB *, db_pgno_t, PAGE *, BINTERNAL *, BINTERNAL *, u_int32_t)); static int __ram_vrfy_inp __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, db_indx_t *, u_int32_t)); #define OKFLAGS (DB_AGGRESSIVE | DB_NOORDERCHK | DB_SALVAGE) /* * CDB___bam_vrfy_meta -- * Verify the btree-specific part of a metadata page. * * PUBLIC: int CDB___bam_vrfy_meta __P((DB *, VRFY_DBINFO *, BTMETA *, * PUBLIC: db_pgno_t, u_int32_t)); */ int CDB___bam_vrfy_meta(dbp, vdp, meta, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; BTMETA *meta; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int isbad, t_ret, ret; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); isbad = 0; /* * If VRFY_INCOMPLETE is not set, then we didn't come through * __db_vrfy_pagezero and didn't incompletely * check this page--we haven't checked it at all. * Thus we need to call CDB___db_vrfy_meta and check the common fields. * * If VRFY_INCOMPLETE is set, we've already done all the same work * in __db_vrfy_pagezero, so skip the check. */ if (!F_ISSET(pip, VRFY_INCOMPLETE) && (ret = CDB___db_vrfy_meta(dbp, vdp, &meta->dbmeta, pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* bt_minkey: must be >= 2, < (pagesize / BKEYDATA_PSIZE(0) */ if (meta->minkey < 2 || meta->minkey > (dbp->pgsize / BKEYDATA_PSIZE(0))) { pip->bt_minkey = 0; isbad = 1; EPRINT((dbp->dbenv, "Nonsensical bt_minkey value %lu on metadata page %lu", meta->minkey, pgno)); } else pip->bt_minkey = meta->minkey; /* bt_maxkey: no constraints (XXX: right?) */ pip->bt_maxkey = meta->maxkey; /* re_len: no constraints on this (may be zero or huge--we make rope) */ pip->re_len = meta->re_len; /* * The root must not be current page or 0 and it must be within * database. If this metadata page is the master meta data page * of the file, then the root page had better be page 1. */ pip->root = 0; if (meta->root == PGNO_INVALID || meta->root == pgno || !IS_VALID_PGNO(meta->root) || (pgno == PGNO_BASE_MD && meta->root != 1)) { isbad = 1; EPRINT((dbp->dbenv, "Nonsensical root page %lu on metadata page %lu", meta->root, vdp->last_pgno)); } else pip->root = meta->root; /* Flags. */ if (F_ISSET(&meta->dbmeta, BTM_RENUMBER)) F_SET(pip, VRFY_IS_RRECNO); if (F_ISSET(&meta->dbmeta, BTM_SUBDB)) { /* * If this is a master db meta page, it had better not have * duplicates. */ if (F_ISSET(&meta->dbmeta, BTM_DUP) && pgno == PGNO_BASE_MD) { isbad = 1; EPRINT((dbp->dbenv, "Btree metadata page %lu has both duplicates and multiple databases", pgno)); } F_SET(pip, VRFY_HAS_SUBDBS); } if (F_ISSET(&meta->dbmeta, BTM_DUP)) F_SET(pip, VRFY_HAS_DUPS); if (F_ISSET(&meta->dbmeta, BTM_DUPSORT)) F_SET(pip, VRFY_HAS_DUPSORT); if (F_ISSET(&meta->dbmeta, BTM_RECNUM)) F_SET(pip, VRFY_HAS_RECNUMS); if (F_ISSET(pip, VRFY_HAS_RECNUMS) && F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, "Btree metadata page %lu illegally has both recnums and dups", pgno)); isbad = 1; } if (F_ISSET(&meta->dbmeta, BTM_RECNO)) { F_SET(pip, VRFY_IS_RECNO); dbp->type = DB_RECNO; } else if (F_ISSET(pip, VRFY_IS_RRECNO)) { isbad = 1; EPRINT((dbp->dbenv, "Metadata page %lu has renumber flag set but is not recno", pgno)); } if (F_ISSET(pip, VRFY_IS_RECNO) && F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, "Recno metadata page %lu specifies duplicates", pgno)); isbad = 1; } if (F_ISSET(&meta->dbmeta, BTM_FIXEDLEN)) F_SET(pip, VRFY_IS_FIXEDLEN); else if (pip->re_len > 0) { /* * It's wrong to have an re_len if it's not a fixed-length * database */ isbad = 1; EPRINT((dbp->dbenv, "re_len of %lu in non-fixed-length database", pip->re_len)); } /* * We do not check that the rest of the page is 0, because it may * not be and may still be correct. */ err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___ram_vrfy_leaf -- * Verify a recno leaf page. * * PUBLIC: int CDB___ram_vrfy_leaf __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, * PUBLIC: u_int32_t)); */ int CDB___ram_vrfy_leaf(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { BKEYDATA *bk; VRFY_PAGEINFO *pip; db_indx_t i; int ret, t_ret, isbad; u_int32_t re_len_guess, len; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); if ((ret = CDB___db_fchk(dbp->dbenv, "CDB___ram_vrfy_leaf", flags, OKFLAGS)) != 0) goto err; if (TYPE(h) != P_LRECNO) { /* We should not have been called. */ TYPE_ERR_PRINT(dbp->dbenv, "CDB___ram_vrfy_leaf", pgno, TYPE(h)); DB_ASSERT(0); ret = EINVAL; goto err; } /* * Verify (and, if relevant, save off) page fields common to * all PAGEs. */ if ((ret = CDB___db_vrfy_datapage(dbp, vdp, h, pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * Verify inp[]. Return immediately if it returns DB_VERIFY_BAD; * further checks are dangerous. */ if ((ret = __bam_vrfy_inp(dbp, vdp, h, pgno, &pip->entries, flags)) != 0) goto err; if (F_ISSET(pip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, "Recno database has dups on page %lu", pgno)); ret = DB_VERIFY_BAD; goto err; } /* * Walk through inp and see if the lengths of all the records are the * same--if so, this may be a fixed-length database, and we want to * save off this value. We know inp to be safe if we've gotten this * far. */ re_len_guess = 0; for (i = 0; i < NUM_ENT(h); i++) { bk = GET_BKEYDATA(h, i); /* KEYEMPTY. Go on. */ if (B_DISSET(bk->type)) continue; if (bk->type == B_OVERFLOW) len = ((BOVERFLOW *)bk)->tlen; else if (bk->type == B_KEYDATA) len = bk->len; else { isbad = 1; EPRINT((dbp->dbenv, "Nonsensical type for item %lu, page %lu", i, pgno)); continue; } if (re_len_guess == 0) re_len_guess = len; /* * Is this item's len the same as the last one's? If not, * reset to 0 and break--we don't have a single re_len. * Otherwise, go on to the next item. */ if (re_len_guess != len) { re_len_guess = 0; break; } } pip->re_len = re_len_guess; /* Save off record count. */ pip->rec_cnt = NUM_ENT(h); err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : 0); } /* * CDB___bam_vrfy -- * Verify a btree leaf or internal page. * * PUBLIC: int CDB___bam_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, * PUBLIC: u_int32_t)); */ int CDB___bam_vrfy(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int ret, t_ret, isbad; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LDUP: break; default: TYPE_ERR_PRINT(dbp->dbenv, "CDB___bam_vrfy", pgno, TYPE(h)); DB_ASSERT(0); ret = EINVAL; goto err; } /* * Verify (and, if relevant, save off) page fields common to * all PAGEs. */ if ((ret = CDB___db_vrfy_datapage(dbp, vdp, h, pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * The record count is, on internal pages, stored in an overloaded * next_pgno field. Save it off; we'll verify it when we check * overall database structure. We could overload the field * in VRFY_PAGEINFO, too, but this seems gross, and space * is not at such a premium. */ pip->rec_cnt = RE_NREC(h); /* * Verify inp[]. */ if (TYPE(h) == P_IRECNO) { if ((ret = __ram_vrfy_inp(dbp, vdp, h, pgno, &pip->entries, flags)) != 0) goto err; } else if ((ret = __bam_vrfy_inp(dbp, vdp, h, pgno, &pip->entries, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; EPRINT((dbp->dbenv, "item order check on page %lu unsafe: skipping", pgno)); } else if (!LF_ISSET(DB_NOORDERCHK) && (ret = CDB___bam_vrfy_itemorder(dbp, vdp, h, pgno, 0, 0, 0, flags)) != 0) { /* * We know that the elements of inp are reasonable. * * Check that elements fall in the proper order. */ if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : 0); } /* * __ram_vrfy_inp -- * Verify that all entries in a P_IRECNO inp[] array are reasonable, * and count them. Note that P_LRECNO uses __bam_vrfy_inp; * P_IRECNOs are a special, and simpler, case, since they have * RINTERNALs rather than BKEYDATA/BINTERNALs. */ static int __ram_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; db_indx_t *nentriesp; u_int32_t flags; { RINTERNAL *ri; VRFY_CHILDINFO child; VRFY_PAGEINFO *pip; int ret, t_ret, isbad; db_indx_t himark, i, offset, nentries; u_int8_t *pagelayout, *p; isbad = 0; memset(&child, 0, sizeof(VRFY_CHILDINFO)); nentries = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); if (TYPE(h) != P_IRECNO) { TYPE_ERR_PRINT(dbp->dbenv, "__ram_vrfy_inp", pgno, TYPE(h)); DB_ASSERT(0); ret = EINVAL; goto err; } himark = dbp->pgsize; if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &pagelayout)) != 0) goto err; memset(pagelayout, 0, dbp->pgsize); for (i = 0; i < NUM_ENT(h); i++) { if ((u_int8_t *)h->inp + i >= (u_int8_t *)h + himark) { EPRINT((dbp->dbenv, "Page %lu entries listing %lu overlaps data", pgno, i)); ret = DB_VERIFY_BAD; goto err; } offset = h->inp[i]; /* * Check that the item offset is reasonable: it points * somewhere after the inp array and before the end of the * page. */ if (offset <= ((u_int8_t *)h->inp + i - (u_int8_t *)h) || offset > dbp->pgsize - RINTERNAL_SIZE) { isbad = 1; EPRINT((dbp->dbenv, "Bad offset %lu at page %lu index %lu", offset, pgno, i)); continue; } /* Update the high-water mark (what HOFFSET should be) */ if (offset < himark) himark = offset; nentries++; /* Make sure this RINTERNAL is not multiply referenced. */ ri = GET_RINTERNAL(h, i); if (pagelayout[offset] == 0) { pagelayout[offset] = 1; child.pgno = ri->pgno; child.type = V_RECNO; child.nrecs = ri->nrecs; if ((ret = CDB___db_vrfy_childput(vdp, pgno, &child)) != 0) goto err; } else { EPRINT((dbp->dbenv, "RINTERNAL structure at offset %lu, page %lu referenced twice", offset, pgno)); isbad = 1; } } for (p = pagelayout + himark; p < pagelayout + dbp->pgsize; p += RINTERNAL_SIZE) if (*p != 1) { EPRINT((dbp->dbenv, "Gap between items at offset %lu, page %lu", p - pagelayout, pgno)); isbad = 1; } if (himark != HOFFSET(h)) { EPRINT((dbp->dbenv, "Bad HOFFSET %lu, appears to be %lu", HOFFSET(h), himark)); isbad = 1; } *nentriesp = nentries; err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * __bam_vrfy_inp -- * Verify that all entries in inp[] array are reasonable; * count them. */ static int __bam_vrfy_inp(dbp, vdp, h, pgno, nentriesp, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; db_indx_t *nentriesp; u_int32_t flags; { BKEYDATA *bk; BOVERFLOW *bo; VRFY_CHILDINFO child; VRFY_PAGEINFO *pip; int isbad, initem, isdupitem, ret, t_ret; u_int32_t himark, offset; /* These would be db_indx_ts but for algnmt.*/ db_indx_t i, endoff, nentries; u_int8_t *pagelayout; isbad = isdupitem = 0; nentries = 0; memset(&child, 0, sizeof(VRFY_CHILDINFO)); if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); switch (TYPE(h)) { case P_IBTREE: case P_LBTREE: case P_LDUP: case P_LRECNO: break; default: /* * In the salvager, we might call this from a page which * we merely suspect is a btree page. Otherwise, it * shouldn't get called--if it is, that's a verifier bug. */ if (LF_ISSET(DB_SALVAGE)) break; TYPE_ERR_PRINT(dbp->dbenv, "__bam_vrfy_inp", pgno, TYPE(h)); DB_ASSERT(0); ret = EINVAL; goto err; } /* * Loop through inp[], the array of items, until we either * run out of entries or collide with the data. Keep track * of h_offset in himark. * * For each element in inp[i], make sure it references a region * that starts after the end of the inp array (as defined by * NUM_ENT(h)), ends before the beginning of the page, doesn't * overlap any other regions, and doesn't have a gap between * it and the region immediately after it. */ himark = dbp->pgsize; if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &pagelayout)) != 0) goto err; memset(pagelayout, 0, dbp->pgsize); for (i = 0; i < NUM_ENT(h); i++) { ret = CDB___db_vrfy_inpitem(dbp, h, pgno, i, 1, flags, &himark, &offset); if (ret == DB_VERIFY_BAD) { isbad = 1; continue; } else if (ret == DB_VERIFY_FATAL) { isbad = 1; goto err; } else if (ret != 0) DB_ASSERT(0); /* * We now have a plausible beginning for the item, and we know * its length is safe. * * Mark the beginning and end in pagelayout so we can make sure * items have no overlaps or gaps. */ bk = GET_BKEYDATA(h, i); #define ITEM_BEGIN 1 #define ITEM_END 2 if (pagelayout[offset] == 0) pagelayout[offset] = ITEM_BEGIN; else if (pagelayout[offset] == ITEM_BEGIN) { /* * Having two inp entries that point at the same patch * of page is legal if and only if the page is * a btree leaf and they're onpage duplicate keys-- * that is, if (i % P_INDX) == 0. */ if ((i % P_INDX == 0) && (TYPE(h) == P_LBTREE)) { /* Flag for later. */ F_SET(pip, VRFY_HAS_DUPS); /* Bump up nentries so we don't undercount. */ nentries++; /* * We'll check to make sure the end is * equal, too. */ isdupitem = 1; } else { isbad = 1; EPRINT((dbp->dbenv, "Duplicated item %lu on page %lu", i, pgno)); } } /* * Mark the end. Its location varies with the page type * and the item type. * * If the end already has a sign other than 0, do nothing-- * it's an overlap that we'll catch later. */ switch(B_TYPE(bk->type)) { case B_KEYDATA: if (TYPE(h) == P_IBTREE) /* It's a BINTERNAL. */ endoff = offset + BINTERNAL_SIZE(bk->len) - 1; else endoff = offset + BKEYDATA_SIZE(bk->len) - 1; break; case B_DUPLICATE: /* * Flag that we have dups; we'll check whether * that's okay during the structure check. */ F_SET(pip, VRFY_HAS_DUPS); /* FALLTHROUGH */ case B_OVERFLOW: /* * Overflow entries on internal pages are stored * as the _data_ of a BINTERNAL; overflow entries * on leaf pages are stored as the entire entry. */ endoff = offset + ((TYPE(h) == P_IBTREE) ? BINTERNAL_SIZE(BOVERFLOW_SIZE) : BOVERFLOW_SIZE) - 1; break; default: /* * We'll complain later; for now, just mark * a minimum. */ endoff = offset + BKEYDATA_SIZE(0) - 1; break; } /* * If this is an onpage duplicate key we've seen before, * the end had better coincide too. */ if (isdupitem && pagelayout[endoff] != ITEM_END) { EPRINT((dbp->dbenv, "Duplicated item %lu on page %lu", i, pgno)); isbad = 1; } else if (pagelayout[endoff] == 0) pagelayout[endoff] = ITEM_END; isdupitem = 0; /* * There should be no deleted items in a quiescent tree, * except in recno. */ if (B_DISSET(bk->type) && TYPE(h) != P_LRECNO) { isbad = 1; EPRINT((dbp->dbenv, "Item %lu on page %lu marked deleted", i, pgno)); } /* * Check the type and such of bk--make sure it's reasonable * for the pagetype. */ switch (B_TYPE(bk->type)) { case B_KEYDATA: /* * This is a normal, non-overflow BKEYDATA or BINTERNAL. * The only thing to check is the len, and that's * already been done. */ break; case B_DUPLICATE: if (TYPE(h) == P_IBTREE) { isbad = 1; EPRINT((dbp->dbenv, "Duplicate page referenced by internal btree page %lu at item %lu", pgno, i)); break; } else if (TYPE(h) == P_LRECNO) { isbad = 1; EPRINT((dbp->dbenv, "Duplicate page referenced by recno page %lu at item %lu", pgno, i)); break; } /* FALLTHROUGH */ case B_OVERFLOW: bo = (TYPE(h) == P_IBTREE) ? (BOVERFLOW *)(((BINTERNAL *)bk)->data) : (BOVERFLOW *)bk; if (B_TYPE(bk->type) == B_OVERFLOW) /* Make sure tlen is reasonable. */ if (bo->tlen > dbp->pgsize * vdp->last_pgno) { isbad = 1; EPRINT((dbp->dbenv, "Impossible tlen %lu, item %lu, page %lu", bo->tlen, i, pgno)); /* Don't save as a child. */ break; } if (!IS_VALID_PGNO(bo->pgno) || bo->pgno == pgno || bo->pgno == PGNO_INVALID) { isbad = 1; EPRINT((dbp->dbenv, "Offpage item %lu, page %lu has bad pgno", i, pgno)); /* Don't save as a child. */ break; } child.pgno = bo->pgno; child.type = (B_TYPE(bk->type) == B_OVERFLOW ? V_OVERFLOW : V_DUPLICATE); child.tlen = bo->tlen; if ((ret = CDB___db_vrfy_childput(vdp, pgno, &child)) != 0) goto err; break; default: isbad = 1; EPRINT((dbp->dbenv, "Item %lu on page %lu of invalid type %lu", i, pgno)); break; } } /* * Now, loop through and make sure the items are contiguous and * non-overlapping. */ initem = 0; for (i = himark; i < dbp->pgsize; i++) if (initem == 0) switch (pagelayout[i]) { case 0: /* May be just for alignment. */ if (i != ALIGN(i, 4)) continue; isbad = 1; EPRINT((dbp->dbenv, "Gap between items, page %lu offset %lu", pgno, i)); /* Find the end of the gap */ for ( ; pagelayout[i + 1] == 0 && (size_t)(i + 1) < dbp->pgsize; i++) ; break; case ITEM_BEGIN: /* We've found an item. Check its alignment. */ if (i != ALIGN(i, 4)) { isbad = 1; EPRINT((dbp->dbenv, "Offset %lu page %lu unaligned", i, pgno)); } initem = 1; nentries++; break; case ITEM_END: /* * We've hit the end of an item even though * we don't think we're in one; must * be an overlap. */ isbad = 1; EPRINT((dbp->dbenv, "Overlapping items, page %lu offset %lu", pgno, i)); break; default: /* Should be impossible. */ DB_ASSERT(0); ret = EINVAL; goto err; } else switch (pagelayout[i]) { case 0: /* In the middle of an item somewhere. Okay. */ break; case ITEM_END: /* End of an item; switch to out-of-item mode.*/ initem = 0; break; case ITEM_BEGIN: /* * Hit a second item beginning without an * end. Overlap. */ isbad = 1; EPRINT((dbp->dbenv, "Overlapping items, page %lu offset %lu", pgno, i)); break; } (void)CDB___os_free(pagelayout, dbp->pgsize); /* Verify HOFFSET. */ if (himark != HOFFSET(h)) { EPRINT((dbp->dbenv, "Bad HOFFSET %lu, appears to be %lu", HOFFSET(h), himark)); isbad = 1; } err: if (nentriesp != NULL) *nentriesp = nentries; if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); } /* * CDB___bam_vrfy_itemorder -- * Make sure the items on a page sort correctly. * * Assumes that NUM_ENT(h) and inp[0]..inp[NUM_ENT(h) - 1] are * reasonable; be sure that __bam_vrfy_inp has been called first. * * If ovflok is set, it also assumes that overflow page chains * hanging off the current page have been sanity-checked, and so we * can use CDB___bam_cmp to verify their ordering. If it is not set, * and we run into an overflow page, carp and return DB_VERIFY_BAD; * we shouldn't be called if any exist. * * PUBLIC: int CDB___bam_vrfy_itemorder __P((DB *, VRFY_DBINFO *, PAGE *, * PUBLIC: db_pgno_t, u_int32_t, int, int, u_int32_t)); */ int CDB___bam_vrfy_itemorder(dbp, vdp, h, pgno, nentries, ovflok, hasdups, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t nentries; int ovflok, hasdups; u_int32_t flags; { DBT dbta, dbtb, dup1, dup2, *p1, *p2, *tmp; BTREE *bt; BINTERNAL *bi; BKEYDATA *bk; BOVERFLOW *bo; VRFY_PAGEINFO *pip; db_indx_t i; int cmp, freedup1, freedup2, isbad, ret, t_ret; int (*dupfunc) __P((const DBT *, const DBT *)); int (*func) __P((const DBT *, const DBT *)); void *buf1, *buf2, *tmpbuf; /* * We need to work in the ORDERCHKONLY environment where we might * not have a pip, but we also may need to work in contexts where * NUM_ENT isn't safe. */ if (vdp != NULL) { if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); nentries = pip->entries; } else pip = NULL; ret = isbad = 0; bo = NULL; /* Shut up compiler. */ memset(&dbta, 0, sizeof(DBT)); F_SET(&dbta, DB_DBT_REALLOC); memset(&dbtb, 0, sizeof(DBT)); F_SET(&dbtb, DB_DBT_REALLOC); buf1 = buf2 = NULL; DB_ASSERT(!LF_ISSET(DB_NOORDERCHK)); dupfunc = (dbp->dup_compare == NULL) ? CDB___bam_defcmp : dbp->dup_compare; if (TYPE(h) == P_LDUP) func = dupfunc; else { func = CDB___bam_defcmp; if (dbp->bt_internal != NULL) { bt = (BTREE *)dbp->bt_internal; if (bt->bt_compare != NULL) func = bt->bt_compare; } } /* * We alternate our use of dbta and dbtb so that we can walk * through the page key-by-key without copying a dbt twice. * p1 is always the dbt for index i - 1, and p2 for index i. */ p1 = &dbta; p2 = &dbtb; /* * Loop through the entries. nentries ought to contain the * actual count, and so is a safe way to terminate the loop; whether * we inc. by one or two depends on whether we're a leaf page-- * on a leaf page, we care only about keys. On internal pages * and LDUP pages, we want to check the order of all entries. * * Note that on IBTREE pages, we start with item 1, since item * 0 doesn't get looked at by CDB___bam_cmp. */ for (i = (TYPE(h) == P_IBTREE) ? 1 : 0; i < nentries; i += (TYPE(h) == P_LBTREE) ? P_INDX : O_INDX) { /* * Put key i-1, now in p2, into p1, by swapping DBTs and bufs. */ tmp = p1; p1 = p2; p2 = tmp; tmpbuf = buf1; buf1 = buf2; buf2 = tmpbuf; /* * Get key i into p2. */ switch (TYPE(h)) { case P_IBTREE: bi = GET_BINTERNAL(h, i); if (B_TYPE(bi->type) == B_OVERFLOW) { bo = (BOVERFLOW *)(bi->data); goto overflow; } else { p2->data = bi->data; p2->size = bi->len; } /* * The leftmost key on an internal page must be * len 0, since it's just a placeholder and * automatically sorts less than all keys. * * XXX * This criterion does not currently hold! * See todo list item #1686. Meanwhile, it's harmless * to just not check for it. */ #if 0 if (i == 0 && bi->len != 0) { isbad = 1; EPRINT((dbp->dbenv, "Lowest key on internal page %lu of nonzero length", pgno)); } #endif break; case P_LBTREE: case P_LDUP: bk = GET_BKEYDATA(h, i); if (B_TYPE(bk->type) == B_OVERFLOW) { bo = (BOVERFLOW *)bk; goto overflow; } else { p2->data = bk->data; p2->size = bk->len; } break; default: /* * This means our caller screwed up and sent us * an inappropriate page. */ TYPE_ERR_PRINT(dbp->dbenv, "CDB___bam_vrfy_itemorder", pgno, TYPE(h)) DB_ASSERT(0); ret = EINVAL; goto err; /* NOTREACHED */ } if (0) { /* * If ovflok != 1, we can't safely go chasing * overflow pages with the normal routines now; * they might be unsafe or nonexistent. Mark this * page as incomplete and return. * * Note that we don't need to worry about freeing * buffers, since they can't have been allocated * if overflow items are unsafe. */ overflow: if (!ovflok) { F_SET(pip, VRFY_INCOMPLETE); goto err; } /* * Overflow items are safe to chase. Do so. * Fetch the overflow item into p2->data, * NULLing it or reallocing it as appropriate. * * (We set p2->data to buf2 before the call * so we're sure to realloc if we can and if p2 * was just pointing at a non-overflow item.) */ p2->data = buf2; if ((ret = CDB___db_goff(dbp, p2, bo->tlen, bo->pgno, NULL, NULL)) != 0) { isbad = 1; EPRINT((dbp->dbenv, "Error %lu in fetching overflow item %lu, page %lu", ret, i, pgno)); } /* In case it got realloc'ed and thus changed. */ buf2 = p2->data; } /* Compare with the last key. */ if (p1->data != NULL && p2->data != NULL) { cmp = func(p1, p2); /* comparison succeeded */ if (cmp > 0) { isbad = 1; EPRINT((dbp->dbenv, "Out-of-order key, page %lu item %lu", pgno, i)); /* proceed */ } else if (cmp == 0) { /* * If they compared equally, this * had better be a (sub)database with dups. * Mark it so we can check during the * structure check. */ if (pip != NULL) F_SET(pip, VRFY_HAS_DUPS); else if (hasdups == 0) { isbad = 1; EPRINT((dbp->dbenv, "Database with no duplicates has duplicated keys on page %lu", pgno)); } /* * If we're a btree leaf, check to see * if the data items of these on-page dups are * in sorted order. If not, flag this, so * that we can make sure during the * structure checks that the DUPSORT flag * is unset. * * At this point i points to a duplicate key. * Compare the datum before it (same key) * to the datum after it, i.e. i-1 to i+1. */ if (TYPE(h) == P_LBTREE) { /* * Unsafe; continue and we'll pick * up the bogus nentries later. */ if (i + 1 >= (db_indx_t)nentries) continue; /* * We don't bother with clever memory * management with on-page dups, * as it's only really a big win * in the overflow case, and overflow * dups are probably (?) rare. */ if (((ret = __bam_safe_getdata(dbp, h, i - 1, ovflok, &dup1, &freedup1)) != 0) || ((ret = __bam_safe_getdata(dbp, h, i + 1, ovflok, &dup2, &freedup2)) != 0)) goto err; /* * If either of the data are NULL, * it's because they're overflows and * it's not safe to chase them now. * Mark an incomplete and return. */ if (dup1.data == NULL || dup2.data == NULL) { DB_ASSERT(!ovflok); F_SET(pip, VRFY_INCOMPLETE); goto err; } /* * If the dups are out of order, * flag this. It's not an error * until we do the structure check * and see whether DUPSORT is set. */ if (dupfunc(&dup1, &dup2) > 0) F_SET(pip, VRFY_DUPS_UNSORTED); if (freedup1) CDB___os_free(dup1.data, 0); if (freedup2) CDB___os_free(dup2.data, 0); } } } } err: if (pip != NULL && ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) && ret == 0) ret = t_ret; if (buf1 != NULL) CDB___os_free(buf1, 0); if (buf2 != NULL) CDB___os_free(buf2, 0); return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___bam_vrfy_structure -- * Verify the tree structure of a btree database (including the master * database containing subdbs). * * PUBLIC: int CDB___bam_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, * PUBLIC: u_int32_t)); */ int CDB___bam_vrfy_structure(dbp, vdp, meta_pgno, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t meta_pgno; u_int32_t flags; { DB *pgset; VRFY_PAGEINFO *mip, *rip; db_pgno_t root, p; int t_ret, ret; u_int32_t nrecs, level, relen, stflags; mip = rip = 0; pgset = vdp->pgset; if ((ret = CDB___db_vrfy_getpageinfo(vdp, meta_pgno, &mip)) != 0) return (ret); if ((ret = CDB___db_vrfy_pgset_get(pgset, meta_pgno, (int *)&p)) != 0) goto err; if (p != 0) { EPRINT((dbp->dbenv, "Btree metadata page number %lu observed twice", meta_pgno)); ret = DB_VERIFY_BAD; goto err; } if ((ret = CDB___db_vrfy_pgset_inc(pgset, meta_pgno)) != 0) goto err; root = mip->root; if (root == 0) { EPRINT((dbp->dbenv, "Btree metadata page %lu has no root", meta_pgno)); ret = DB_VERIFY_BAD; goto err; } if ((ret = CDB___db_vrfy_getpageinfo(vdp, root, &rip)) != 0) goto err; switch (rip->type) { case P_IBTREE: case P_LBTREE: stflags = flags | ST_TOPLEVEL; if (F_ISSET(mip, VRFY_HAS_DUPS)) stflags |= ST_DUPOK; if (F_ISSET(mip, VRFY_HAS_DUPSORT)) stflags |= ST_DUPSORT; if (F_ISSET(mip, VRFY_HAS_RECNUMS)) stflags |= ST_RECNUM; ret = CDB___bam_vrfy_subtree(dbp, vdp, root, NULL, NULL, stflags, NULL, NULL, NULL); break; case P_IRECNO: case P_LRECNO: stflags = flags | ST_RECNUM | ST_IS_RECNO | ST_TOPLEVEL; if (mip->re_len > 0) stflags |= ST_RELEN; if ((ret = CDB___bam_vrfy_subtree(dbp, vdp, root, NULL, NULL, stflags, &level, &nrecs, &relen)) != 0) goto err; /* * Even if mip->re_len > 0, re_len may come back zero if the * tree is empty. It should be okay to just skip the check in * this case, as if there are any non-deleted keys at all, * that should never happen. */ if (mip->re_len > 0 && relen > 0 && mip->re_len != relen) { EPRINT((dbp->dbenv, "Recno database with meta page %lu has bad re_len %lu", meta_pgno, relen)); ret = DB_VERIFY_BAD; goto err; } ret = 0; break; case P_LDUP: EPRINT((dbp->dbenv, "Duplicate tree referenced from metadata page %lu", meta_pgno)); ret = DB_VERIFY_BAD; break; default: EPRINT((dbp->dbenv, "%s%s", "Btree root of incorrect type ", "%lu specified on meta page %lu", rip->type, meta_pgno)); ret = DB_VERIFY_BAD; break; } err: if (mip != NULL && ((t_ret = CDB___db_vrfy_putpageinfo(vdp, mip)) != 0) && ret == 0) t_ret = ret; if (rip != NULL && ((t_ret = CDB___db_vrfy_putpageinfo(vdp, rip)) != 0) && ret == 0) t_ret = ret; return (ret); } /* * CDB___bam_vrfy_subtree-- * Verify a subtree (or entire) btree with specified root. * * Note that this is public because it must be called to verify * offpage dup trees, including from hash. * * PUBLIC: int CDB___bam_vrfy_subtree __P((DB *, VRFY_DBINFO *, db_pgno_t, void *, * PUBLIC: void *, u_int32_t, u_int32_t *, u_int32_t *, u_int32_t *)); */ int CDB___bam_vrfy_subtree(dbp, vdp, pgno, l, r, flags, levelp, nrecsp, relenp) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; void *l, *r; u_int32_t flags, *levelp, *nrecsp, *relenp; { BINTERNAL *li, *ri, *lp, *rp; DB *pgset; PAGE *h; VRFY_CHILDINFO *child; VRFY_PAGEINFO *pip; db_recno_t nrecs, child_nrecs; db_indx_t i; int ret, t_ret, isbad, toplevel, p; u_int32_t level, child_level, stflags, child_relen, relen; DBC *cc; ret = isbad = 0; nrecs = 0; h = NULL; relen = 0; rp = (BINTERNAL *)r; lp = (BINTERNAL *)l; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); cc = NULL; level = pip->bt_level; toplevel = LF_ISSET(ST_TOPLEVEL); LF_CLR(ST_TOPLEVEL); /* * We are recursively descending a btree, starting from the root * and working our way out to the leaves. * * There are four cases we need to deal with: * 1. pgno is a recno leaf page. Any children are overflows. * 2. pgno is a duplicate leaf page. Any children * are overflow pages; traverse them, and then return * level and nrecs. * 3. pgno is an ordinary leaf page. Check whether dups are * allowed, and if so, traverse any off-page dups or * overflows. Then return nrecs and level. * 4. pgno is a recno internal page. Recursively check any * child pages, making sure their levels are one lower * and their nrecs sum to ours. * 5. pgno is a btree internal page. Same as #4, plus we * must verify that for each pair of BINTERNAL entries * N and N+1, the leftmost item on N's child sorts * greater than N, and the rightmost item on N's child * sorts less than N+1. * * Furthermore, in any sorted page type (P_LDUP, P_LBTREE, P_IBTREE), * we need to verify the internal sort order is correct if, * due to overflow items, we were not able to do so earlier. */ switch (pip->type) { case P_LRECNO: case P_LDUP: case P_LBTREE: /* * Cases 1, 2 and 3 (overflow pages are common to all three); * traverse child list, looking for overflows. */ if ((ret = CDB___db_vrfy_childcursor(vdp, &cc)) != 0) goto err; for (ret = CDB___db_vrfy_ccset(cc, pgno, &child); ret == 0; ret = CDB___db_vrfy_ccnext(cc, &child)) if (child->type == V_OVERFLOW && (ret = CDB___db_vrfy_ovfl_structure(dbp, vdp, child->pgno, child->tlen, flags | ST_OVFL_LEAF)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto done; } if ((ret = CDB___db_vrfy_ccclose(cc)) != 0) goto err; cc = NULL; /* Case 1 */ if (pip->type == P_LRECNO) { if (!LF_ISSET(ST_IS_RECNO) && !(LF_ISSET(ST_DUPOK) && !LF_ISSET(ST_DUPSORT))) { isbad = 1; EPRINT((dbp->dbenv, "Recno leaf page %lu in non-recno tree", pgno)); goto done; } goto leaf; } else if (LF_ISSET(ST_IS_RECNO)){ /* * It's a non-recno leaf. Had better not be a recno * subtree. */ isbad = 1; EPRINT((dbp->dbenv, "Non-recno leaf page %lu in recno tree", pgno)); goto done; } /* Case 2--no more work. */ if (pip->type == P_LDUP) goto leaf; /* Case 3 */ /* Check if we have any dups. */ if (F_ISSET(pip, VRFY_HAS_DUPS)) { /* If dups aren't allowed in this btree, trouble. */ if (!LF_ISSET(ST_DUPOK)) { isbad = 1; EPRINT((dbp->dbenv, "Duplicates on page %lu in non-dup btree", pgno)); } else { /* * We correctly have dups. If any are off-page, * traverse those btrees recursively. */ if ((ret = CDB___db_vrfy_childcursor(vdp, &cc)) != 0) goto err; for (ret = CDB___db_vrfy_ccset(cc, pgno, &child); ret == 0; ret = CDB___db_vrfy_ccnext(cc, &child)) { stflags = flags | ST_RECNUM; /* Skip any overflow entries. */ if (child->type == V_DUPLICATE) { if ((ret = CDB___db_vrfy_duptype( dbp, vdp, child->pgno, stflags)) != 0) { isbad = 1; /* Next child. */ continue; } if ((ret = CDB___bam_vrfy_subtree( dbp, vdp, child->pgno, NULL, NULL, stflags, NULL, NULL, NULL)) != 0) { if (ret != DB_VERIFY_BAD) goto err; else isbad = 1; } } } if ((ret = CDB___db_vrfy_ccclose(cc)) != 0) goto err; cc = NULL; /* * If VRFY_DUPS_UNSORTED is set, * ST_DUPSORT had better not be. */ if (F_ISSET(pip, VRFY_DUPS_UNSORTED) && LF_ISSET(ST_DUPSORT)) { EPRINT((dbp->dbenv, "Unsorted duplicate set at page %lu in sorted-dup database", pgno)); isbad = 1; } } } goto leaf; break; case P_IBTREE: case P_IRECNO: /* We handle these below. */ break; default: /* This should never get called if there's any doubt. */ TYPE_ERR_PRINT(dbp->dbenv, "CDB___bam_vrfy_subtree", pgno, pip->type); DB_ASSERT(0); ret = EINVAL; goto done; /* NOTREACHED */ } /* * Cases 4 & 5: This is a btree or recno internal page. For each child, * recurse, keeping a running count of nrecs and making sure the level * is always reasonable. */ if ((ret = CDB___db_vrfy_childcursor(vdp, &cc)) != 0) goto err; for (ret = CDB___db_vrfy_ccset(cc, pgno, &child); ret == 0; ret = CDB___db_vrfy_ccnext(cc, &child)) if (child->type == V_RECNO) { if (pip->type != P_IRECNO) { TYPE_ERR_PRINT(dbp->dbenv, "CDB___bam_vrfy_subtree", pgno, pip->type); DB_ASSERT(0); ret = EINVAL; goto err; } if ((ret = CDB___bam_vrfy_subtree(dbp, vdp, child->pgno, NULL, NULL, flags, &child_level, &child_nrecs, &child_relen)) != 0) { if (ret != DB_VERIFY_BAD) goto done; else isbad = 1; } if (LF_ISSET(ST_RELEN)) { if (relen == 0) relen = child_relen; /* * child_relen may be zero if the child subtree * is empty. */ else if (child_relen > 0 && relen != child_relen) { isbad = 1; EPRINT((dbp->dbenv, "Recno page %lu returned bad re_len", child->pgno)); } if (relenp) *relenp = relen; } if (LF_ISSET(ST_RECNUM)) nrecs += child_nrecs; if (level != child_level + 1) { isbad = 1; EPRINT((dbp->dbenv, "%s%lu%s%lu%s%lu", "Recno level incorrect on page ", child->pgno, ": got ", child_level, ", expected ", level - 1)); } } else if (child->type == V_OVERFLOW && (ret = CDB___db_vrfy_ovfl_structure(dbp, vdp, child->pgno, child->tlen, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto done; } if ((ret = CDB___db_vrfy_ccclose(cc)) != 0) goto err; cc = NULL; /* We're done with case 4. */ if (pip->type == P_IRECNO) goto done; /* * Case 5. Btree internal pages. * As described above, we need to iterate through all the * items on the page and make sure that our children sort appropriately * with respect to them. * * For each entry, li will be the "left-hand" key for the entry * itself, which must sort lower than all entries on its child; * ri will be the key to its right, which must sort greater. */ if (h == NULL && (ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; for (i = 0; i < pip->entries; i += O_INDX) { li = GET_BINTERNAL(h, i); ri = (i + O_INDX < pip->entries) ? GET_BINTERNAL(h, i + O_INDX) : NULL; /* * The leftmost key is forcibly sorted less than all entries, * so don't bother passing it. */ if ((ret = CDB___bam_vrfy_subtree(dbp, vdp, li->pgno, i == 0 ? NULL : li, ri, flags, &child_level, &child_nrecs, NULL)) != 0) { if (ret != DB_VERIFY_BAD) goto done; else isbad = 1; } if (LF_ISSET(ST_RECNUM)) { /* * Keep a running tally on the actual record count so * we can return it to our parent (if we have one) or * compare it to the NRECS field if we're a root page. */ nrecs += child_nrecs; /* * Make sure the actual record count of the child * is equal to the value in the BINTERNAL structure. */ if (li->nrecs != child_nrecs) { isbad = 1; EPRINT((dbp->dbenv, "Item %lu page %lu has incorrect record count of %lu, should be %lu", i, pgno, li->nrecs, child_nrecs)); } } if (level != child_level + 1) { isbad = 1; EPRINT((dbp->dbenv, "%s%lu%s%lu%s%lu", "Btree level incorrect on page ", li->pgno, ": got ", child_level, ", expected ", level - 1)); } } if (0) { leaf: level = LEAFLEVEL; if (LF_ISSET(ST_RECNUM)) nrecs = pip->rec_cnt; /* XXX * We should verify that the record count on a leaf page * is the sum of the number of keys and the number of * records in its off-page dups. This requires looking * at the page again, however, and it may all be changing * soon, so for now we don't bother. */ if (LF_ISSET(ST_RELEN) && relenp) *relenp = pip->re_len; } done: if (F_ISSET(pip, VRFY_INCOMPLETE) && isbad == 0 && ret == 0) { /* * During the page-by-page pass, item order verification was * not finished due to the presence of overflow items. If * isbad == 0, though, it's now safe to do so, as we've * traversed any child overflow pages. Do it. */ if (h == NULL && (ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; if ((ret = CDB___bam_vrfy_itemorder(dbp, vdp, h, pgno, 0, 1, 0, flags)) != 0) goto err; F_CLR(pip, VRFY_INCOMPLETE); } /* * Our parent has sent us BINTERNAL pointers to parent records * so that we can verify our place with respect to them. If it's * appropriate--we have a default sort function--verify this. */ if (isbad == 0 && ret == 0 && !LF_ISSET(DB_NOORDERCHK) && lp != NULL) { if (h == NULL && (ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; if ((ret = __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } } /* * This is guaranteed to succeed for leaf pages, but no harm done. * * Internal pages below the top level do not store their own * record numbers, so we skip them. */ if (LF_ISSET(ST_RECNUM) && nrecs != pip->rec_cnt && toplevel) { isbad = 1; EPRINT((dbp->dbenv, "Bad record count on page %lu: got %lu, expected %lu", pgno, nrecs, pip->rec_cnt)); } if (levelp) *levelp = level; if (nrecsp) *nrecsp = nrecs; pgset = vdp->pgset; if ((ret = CDB___db_vrfy_pgset_get(pgset, pgno, &p)) != 0) goto err; if (p != 0) { isbad = 1; EPRINT((dbp->dbenv, "Page %lu linked twice", pgno)); } else if ((ret = CDB___db_vrfy_pgset_inc(pgset, pgno)) != 0) goto err; err: if (h != NULL && (t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; if (cc != NULL && ((t_ret = CDB___db_vrfy_ccclose(cc)) != 0) && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * __bam_vrfy_treeorder -- * Verify that the lowest key on a page sorts greater than the * BINTERNAL which points to it (lp), and the highest key * sorts less than the BINTERNAL above that (rp). * * If lp is NULL, this means that it was the leftmost key on the * parent, which (regardless of sort function) sorts less than * all keys. No need to check it. * * If rp is NULL, lp was the highest key on the parent, so there's * no higher key we must sort less than. */ static int __bam_vrfy_treeorder(dbp, pgno, h, lp, rp, flags) DB *dbp; db_pgno_t pgno; PAGE *h; BINTERNAL *lp, *rp; u_int32_t flags; { BOVERFLOW *bo; BTREE *t; DBT dbt; db_indx_t last; int (*func)__P((const DBT *, const DBT *)); int ret, cmp; memset(&dbt, 0, sizeof(DBT)); F_SET(&dbt, DB_DBT_MALLOC); t = dbp->bt_internal; func = (t->bt_compare != NULL) ? t->bt_compare : CDB___bam_defcmp; ret = 0; switch (TYPE(h)) { case P_IBTREE: case P_LDUP: last = NUM_ENT(h) - O_INDX; break; case P_LBTREE: last = NUM_ENT(h) - P_INDX; break; default: TYPE_ERR_PRINT(dbp->dbenv, "__bam_vrfy_treeorder", pgno, TYPE(h)); DB_ASSERT(0); return (EINVAL); } /* * The key on page h, the child page, is more likely to be * an overflow page, so we pass its offset, rather than lp/rp's, * into CDB___bam_cmp. This will take advantage of CDB___db_moff. */ /* * Skip first-item check if we're an internal page--the first * entry on an internal page is treated specially by CDB___bam_cmp, * so what's on the page shouldn't matter. (Plus, since we're passing * our page and item 0 as to CDB___bam_cmp, we'll sort before our * parent and falsely report a failure.) */ if (lp != NULL && TYPE(h) != P_IBTREE) { if (lp->type == B_KEYDATA) { dbt.data = lp->data; dbt.size = lp->len; } else if (lp->type == B_OVERFLOW) { bo = (BOVERFLOW *)lp->data; if ((ret = CDB___db_goff(dbp, &dbt, bo->tlen, bo->pgno, NULL, NULL)) != 0) return (ret); } else { DB_ASSERT(0); EPRINT((dbp->dbenv, "Unknown type for internal record")); return (EINVAL); } /* On error, fall through, free if neeeded, and return. */ if ((ret = CDB___bam_cmp(dbp, &dbt, h, 0, func, &cmp)) == 0) { if (cmp > 0) { EPRINT((dbp->dbenv, "First item on page %lu sorted greater than parent entry", PGNO(h))); ret = DB_VERIFY_BAD; } } else EPRINT((dbp->dbenv, "First item on page %lu had comparison error", PGNO(h))); if (dbt.data != lp->data) CDB___os_free(dbt.data, 0); if (ret != 0) return (ret); } if (rp != NULL) { if (rp->type == B_KEYDATA) { dbt.data = rp->data; dbt.size = rp->len; } else if (rp->type == B_OVERFLOW) { bo = (BOVERFLOW *)rp->data; if ((ret = CDB___db_goff(dbp, &dbt, bo->tlen, bo->pgno, NULL, NULL)) != 0) return (ret); } else { DB_ASSERT(0); EPRINT((dbp->dbenv, "Unknown type for internal record")); return (EINVAL); } /* On error, fall through, free if neeeded, and return. */ if ((ret = CDB___bam_cmp(dbp, &dbt, h, last, func, &cmp)) == 0) { if (cmp < 0) { EPRINT((dbp->dbenv, "Last item on page %lu sorted greater than parent entry", PGNO(h))); ret = DB_VERIFY_BAD; } } else EPRINT((dbp->dbenv, "Last item on page %lu had comparison error", PGNO(h))); if (dbt.data != rp->data) CDB___os_free(dbt.data, 0); } return (ret); } /* * CDB___bam_salvage -- * Safely dump out anything that looks like a key on an alleged * btree leaf page. * * PUBLIC: int CDB___bam_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, * PUBLIC: PAGE *, void *, int (*)(void *, const void *), DBT *, * PUBLIC: u_int32_t)); */ int CDB___bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, key, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; u_int32_t pgtype; PAGE *h; void *handle; int (*callback) __P((void *, const void *)); DBT *key; u_int32_t flags; { DBT dbt, unkdbt; BKEYDATA *bk; BOVERFLOW *bo; db_indx_t i, beg, end; u_int32_t himark; u_int8_t *pgmap; void *ovflbuf; int t_ret, ret, err_ret; /* Shut up lint. */ COMPQUIET(end, 0); ovflbuf = pgmap = NULL; err_ret = ret = 0; memset(&dbt, 0, sizeof(DBT)); dbt.flags = DB_DBT_REALLOC; memset(&unkdbt, 0, sizeof(DBT)); unkdbt.size = strlen("UNKNOWN") + 1; unkdbt.data = "UNKNOWN"; /* * Allocate a buffer for overflow items. Start at one page; * CDB___db_safe_goff will realloc as needed. */ if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &ovflbuf)) != 0) return (ret); if (LF_ISSET(DB_AGGRESSIVE)) { if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &pgmap)) != 0) goto err; memset(pgmap, 0, dbp->pgsize); } /* * Loop through the inp array, spitting out key/data pairs. * * If we're salvaging normally, loop from 0 through NUM_ENT(h). * If we're being aggressive, loop until we hit the end of the page-- * NUM_ENT() may be bogus. */ i = 0; himark = dbp->pgsize; for (;;) { /* If we're not aggressive, break when we hit NUM_ENT(h). */ if (!LF_ISSET(DB_AGGRESSIVE) && i >= NUM_ENT(h)) break; /* Verify the current item. */ ret = CDB___db_vrfy_inpitem(dbp, h, pgno, i, 1, flags, &himark, NULL); /* If this returned a fatality, it's time to break. */ if (ret == DB_VERIFY_FATAL) break; /* * If this returned 0, it's safe to print or (carefully) * try to fetch. */ if (ret == 0) { /* * We're going to go try to print the next item. If * key is non-NULL, we're a dup page, so we've got to * print the key first, unless SA_SKIPFIRSTKEY is set * and we're on the first entry. */ if (key != NULL && (i != 0 || !LF_ISSET(SA_SKIPFIRSTKEY))) if ((ret = CDB___db_prdbt(key, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; bk = GET_BKEYDATA(h, i); beg = h->inp[i]; switch (bk->type) { case B_DUPLICATE: end = beg + BOVERFLOW_SIZE - 1; /* * If we're not on a normal btree leaf page, * there shouldn't be off-page * dup sets. Something's confused; just * drop it, and the code to pick up unlinked * offpage dup sets will print it out * with key "UNKNOWN" later. */ if (pgtype != P_LBTREE) break; bo = (BOVERFLOW *)bk; /* * If the page number is unreasonable, or * if this is supposed to be a key item, * just spit out "UNKNOWN"--the best we * can do is run into the data items in the * unlinked offpage dup pass. */ if (!IS_VALID_PGNO(bo->pgno) || (i % P_INDX == 0)) { /* Not much to do on failure. */ if ((ret = CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; } if ((ret = CDB___db_salvage_duptree(dbp, vdp, bo->pgno, &dbt, handle, callback, flags | SA_SKIPFIRSTKEY)) != 0) err_ret = ret; break; default: /* * If we're being aggressive, fall through * and treat as a B_KEYDATA. Seems unlikely * that the length would be okay and the type * bogus, but we can never be sure. */ if (!LF_ISSET(DB_AGGRESSIVE)) break; /* FALLTHROUGH */ case B_KEYDATA: end = ALIGN(beg + bk->len, 4) - 1; dbt.data = bk->data; dbt.size = bk->len; if ((ret = CDB___db_prdbt(&dbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; case B_OVERFLOW: end = beg + BOVERFLOW_SIZE - 1; bo = (BOVERFLOW *)bk; if ((ret = CDB___db_safe_goff(dbp, vdp, bo->pgno, &dbt, &ovflbuf, flags)) != 0) { err_ret = ret; /* We care about err_ret more. */ (void)CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL); break; } if ((ret = CDB___db_prdbt(&dbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; } /* * If we're being aggressive, mark the beginning * and end of the item; we'll come back and print * whatever "junk" is in the gaps in case we had * any bogus inp elements and thereby missed stuff. */ if (LF_ISSET(DB_AGGRESSIVE)) { pgmap[beg] = ITEM_BEGIN; pgmap[end] = ITEM_END; } } i += O_INDX; } /* * If i is odd and this is a btree leaf, we've printed out a key but not * a datum; fix this imbalance by printing an "UNKNOWN". */ if (pgtype == P_LBTREE && (i % P_INDX == 1) && ((ret = CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL)) != 0)) err_ret = ret; err: if (pgmap != NULL) CDB___os_free(pgmap, 0); CDB___os_free(ovflbuf, 0); /* Mark this page as done. */ if ((t_ret = CDB___db_salvage_markdone(vdp, pgno)) != 0) return (t_ret); return ((err_ret != 0) ? err_ret : ret); } /* * CDB___bam_salvage_walkdupint -- * Walk a known-good btree or recno internal page which is part of * a dup tree, calling CDB___db_salvage_duptree on each child page. * * PUBLIC: int CDB___bam_salvage_walkdupint __P((DB *, VRFY_DBINFO *, PAGE *, * PUBLIC: DBT *, void *, int (*)(void *, const void *), u_int32_t)); */ int CDB___bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; DBT *key; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { RINTERNAL *ri; BINTERNAL *bi; int ret, t_ret; db_indx_t i; ret = 0; for (i = 0; i < NUM_ENT(h); i++) { switch (TYPE(h)) { case P_IBTREE: bi = GET_BINTERNAL(h, i); if ((t_ret = CDB___db_salvage_duptree(dbp, vdp, bi->pgno, key, handle, callback, flags)) != 0) ret = t_ret; case P_IRECNO: ri = GET_RINTERNAL(h, i); if ((t_ret = CDB___db_salvage_duptree(dbp, vdp, ri->pgno, key, handle, callback, flags)) != 0) ret = t_ret; break; default: CDB___db_err(dbp->dbenv, "CDB___bam_salvage_walkdupint called on non-int. page"); DB_ASSERT(0); return (EINVAL); } /* Pass SA_SKIPFIRSTKEY, if set, on to the 0th child only. */ flags &= ~LF_ISSET(SA_SKIPFIRSTKEY); } return (ret); } /* * CDB___bam_meta2pgset -- * Given a known-good meta page, return in pgsetp a 0-terminated list of * db_pgno_t's corresponding to the pages in the btree. * * We do this by a somewhat sleazy method, to avoid having to traverse the * btree structure neatly: we walk down the left side to the very * first leaf page, then we mark all the pages in the chain of * NEXT_PGNOs (being wary of cycles and invalid ones), then we * consolidate our scratch array into a nice list, and return. This * avoids the memory management hassles of recursion and the * trouble of walking internal pages--they just don't matter, except * for the left branch. * * PUBLIC: int CDB___bam_meta2pgset __P((DB *, VRFY_DBINFO *, BTMETA *, * PUBLIC: u_int32_t, DB *)); */ int CDB___bam_meta2pgset(dbp, vdp, btmeta, flags, pgset) DB *dbp; VRFY_DBINFO *vdp; BTMETA *btmeta; u_int32_t flags; DB *pgset; { BINTERNAL *bi; PAGE *h; RINTERNAL *ri; db_pgno_t current, p; int err_ret, ret; h = NULL; ret = err_ret = 0; DB_ASSERT(pgset != NULL); for (current = btmeta->root;;) { if (!IS_VALID_PGNO(current) || current == PGNO(btmeta)) { err_ret = DB_VERIFY_BAD; goto err; } if ((ret = CDB_memp_fget(dbp->mpf, ¤t, 0, &h)) != 0) { err_ret = ret; goto err; } switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: if ((ret = CDB___bam_vrfy(dbp, vdp, h, current, flags | DB_NOORDERCHK)) != 0) { err_ret = ret; goto err; } if (TYPE(h) == P_IBTREE) { bi = GET_BINTERNAL(h, 0); current = bi->pgno; } else { /* P_IRECNO */ ri = GET_RINTERNAL(h, 0); current = ri->pgno; } break; case P_LBTREE: case P_LRECNO: goto traverse; /* NOTREACHED */ default: err_ret = DB_VERIFY_BAD; goto err; } if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) err_ret = ret; h = NULL; } /* * At this point, current is the pgno of leaf page h, the 0th in the * tree we're concerned with. */ traverse: while (IS_VALID_PGNO(current) && current != PGNO_INVALID) { if (h == NULL && (ret = CDB_memp_fget(dbp->mpf, ¤t, 0, &h) != 0)) { err_ret = ret; break; } if ((ret = CDB___db_vrfy_pgset_get(pgset, current, (int *)&p)) != 0) goto err; if (p != 0) { /* * We've found a cycle. Return success anyway-- * our caller may as well use however much of * the pgset we've come up with. */ break; } if ((ret = CDB___db_vrfy_pgset_inc(pgset, current)) != 0) goto err; current = NEXT_PGNO(h); if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) err_ret = ret; h = NULL; } err: if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); return (ret == 0 ? err_ret : ret); } /* * __bam_safe_getdata -- * * Utility function for CDB___bam_vrfy_itemorder. Safely gets the datum at * index i, page h, and sticks it in DBT dbt. If ovflok is 1 and i's an * overflow item, we do a safe_goff to get the item and signal that we need * to free dbt->data; if ovflok is 0, we leaves the DBT zeroed. */ static int __bam_safe_getdata(dbp, h, i, ovflok, dbt, freedbtp) DB *dbp; PAGE *h; u_int32_t i; int ovflok; DBT *dbt; int *freedbtp; { BKEYDATA *bk; BOVERFLOW *bo; memset(dbt, 0, sizeof(DBT)); *freedbtp = 0; bk = GET_BKEYDATA(h, i); if (B_TYPE(bk->type) == B_OVERFLOW) { if (!ovflok) return(0); bo = (BOVERFLOW *)bk; F_SET(dbt, DB_DBT_MALLOC); *freedbtp = 1; return (CDB___db_goff(dbp, dbt, bo->tlen, bo->pgno, NULL, NULL)); /* NOTREACHED */ } else { dbt->data = bk->data; dbt->size = bk->len; } return (0); } ��������������������������������������������������������������������������������htdig-3.2.0b6/db/btree.h����������������������������������������������������������������������������0100644�0063146�0012731�00000020615�07427026535�014240� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)btree.h 11.8 (Sleepycat) 9/20/99 */ /* Forward structure declarations. */ struct __btree; typedef struct __btree BTREE; struct __cursor; typedef struct __cursor BTREE_CURSOR; struct __epg; typedef struct __epg EPG; struct __recno; typedef struct __recno RECNO; #define DEFMINKEYPAGE (2) #define ISINTERNAL(p) (TYPE(p) == P_IBTREE || TYPE(p) == P_IRECNO) #define ISLEAF(p) (TYPE(p) == P_LBTREE || TYPE(p) == P_LRECNO) /* * Flags to CDB___bam_search() and CDB___bam_rsearch(). * * Note, internal page searches must find the largest record less than key in * the tree so that descents work. Leaf page searches must find the smallest * record greater than key so that the returned index is the record's correct * position for insertion. * * The flags parameter to the search routines describes three aspects of the * search: the type of locking required (including if we're locking a pair of * pages), the item to return in the presence of duplicates and whether or not * to return deleted entries. To simplify both the mnemonic representation * and the code that checks for various cases, we construct a set of bitmasks. */ #define S_READ 0x00001 /* Read locks. */ #define S_WRITE 0x00002 /* Write locks. */ #define S_APPEND 0x00040 /* Append to the tree. */ #define S_DELNO 0x00080 /* Don't return deleted items. */ #define S_DUPFIRST 0x00100 /* Return first duplicate. */ #define S_DUPLAST 0x00200 /* Return last duplicate. */ #define S_EXACT 0x00400 /* Exact items only. */ #define S_PARENT 0x00800 /* Lock page pair. */ #define S_STACK 0x01000 /* Need a complete stack. */ #define S_PAST_EOF 0x02000 /* If doing insert search (or keyfirst * or keylast operations), or a split * on behalf of an insert, it's okay to * return an entry one past end-of-page. */ #define S_DELETE (S_WRITE | S_DUPFIRST | S_DELNO | S_EXACT | S_STACK) #define S_FIND (S_READ | S_DUPFIRST | S_DELNO) #define S_FIND_WR (S_WRITE | S_DUPFIRST | S_DELNO) #define S_INSERT (S_WRITE | S_DUPLAST | S_PAST_EOF | S_STACK) #define S_KEYFIRST (S_WRITE | S_DUPFIRST | S_PAST_EOF | S_STACK) #define S_KEYLAST (S_WRITE | S_DUPLAST | S_PAST_EOF | S_STACK) #define S_WRPAIR (S_WRITE | S_DUPLAST | S_PAST_EOF | S_PARENT) /* * Flags to CDB___bam_iitem(). */ #define BI_DELETED 0x01 /* Key/data pair only placeholder. */ /* * Various routines pass around page references. A page reference is * a pointer to the page, and the indx indicates an item on the page. * Each page reference may include a lock. */ struct __epg { PAGE *page; /* The page. */ db_indx_t indx; /* The index on the page. */ DB_LOCK lock; /* The page's lock. */ db_lockmode_t lock_mode; /* The lock mode. */ }; /* * We maintain a stack of the pages that we're locking in the tree. Btree's * (currently) only save two levels of the tree at a time, so the default * stack is always large enough. Recno trees have to lock the entire tree to * do inserts/deletes, however. Grow the stack as necessary. */ #define BT_STK_CLR(c) \ ((c)->csp = (c)->sp) #define BT_STK_ENTER(c, pagep, page_indx, lock, mode, ret) do { \ if ((ret = \ (c)->csp == (c)->esp ? CDB___bam_stkgrow(c) : 0) == 0) { \ (c)->csp->page = pagep; \ (c)->csp->indx = page_indx; \ (c)->csp->lock = lock; \ (c)->csp->lock_mode = mode; \ } \ } while (0) #define BT_STK_PUSH(c, pagep, page_indx, lock, mode, ret) do { \ BT_STK_ENTER(c, pagep, page_indx, lock, mode, ret); \ ++(c)->csp; \ } while (0) #define BT_STK_POP(c) \ ((c)->csp == (c)->stack ? NULL : --(c)->csp) /* * Arguments passed to __bam_ca_replace(). */ typedef enum { REPLACE_SETUP, REPLACE_SUCCESS, REPLACE_FAILED } ca_replace_arg; /* Arguments passed to CDB___ram_ca(). */ typedef enum { CA_DELETE, CA_IAFTER, CA_IBEFORE } ca_recno_arg; /* Btree/Recno cursor. */ struct __cursor { /* Per-thread information: shared by btree/recno. */ EPG *sp; /* Stack pointer. */ EPG *csp; /* Current stack entry. */ EPG *esp; /* End stack pointer. */ EPG stack[5]; /* Per-thread information: btree private. */ PAGE *page; /* Cursor page. */ db_pgno_t pgno; /* Page. */ db_indx_t indx; /* Page item ref'd by the cursor. */ db_pgno_t dpgno; /* Duplicate page. */ db_indx_t dindx; /* Page item ref'd by the cursor. */ DB_LOCK lock; /* Cursor lock. */ db_lockmode_t lock_mode; /* Lock mode. */ /* Per-thread information: recno private. */ db_recno_t recno; /* Current record number. */ /* * Btree: * We set a flag in the cursor structure if the underlying object has * been deleted. It's not strictly necessary, we could get the same * information by looking at the page itself. * * Recno: * When renumbering recno databases during deletes, cursors referencing * "deleted" records end up positioned between two records, and so must * be specially adjusted on the next operation. */ #define C_DELETED 0x0001 /* Record was deleted. */ u_int32_t flags; }; /* * The in-memory, per-tree btree/recno data structure. */ struct __btree { /* Btree access method. */ db_pgno_t bt_lpgno; /* Last insert location. */ db_indx_t bt_ovflsize; /* Maximum key/data on-page size. */ db_pgno_t bt_meta; /* Database meta-data page. */ db_pgno_t bt_root; /* Database root page. */ u_int32_t bt_maxkey; /* Maximum keys per page. */ u_int32_t bt_minkey; /* Minimum keys per page. */ /* Btree comparison function. */ int (*bt_compare) __P((const DBT *, const DBT *)); /* Prefix function. */ size_t (*bt_prefix) __P((const DBT *, const DBT *)); /* Recno access method. */ int re_pad; /* Fixed-length padding byte. */ int re_delim; /* Variable-length delimiting byte. */ u_int32_t re_len; /* Length for fixed-length records. */ char *re_source; /* Source file name. */ /* * !!! * These fields are ignored as far as multi-threading is concerned. * There are no transaction semantics associated with backing files, * nor is there any thread protection. */ DB_FH re_fh; /* Source file handle. */ db_recno_t re_last; /* Last record number read. */ void *re_cmap; /* Current point in mapped space. */ void *re_smap; /* Start of mapped space. */ void *re_emap; /* End of mapped space. */ size_t re_msize; /* Size of mapped region. */ /* Recno input function. */ int (*re_irec) __P((DBC *, db_recno_t)); #define RECNO_EOF 0x01 /* EOF on backing source file. */ #define RECNO_MODIFIED 0x02 /* Tree was modified. */ u_int32_t flags; }; #include "btree_auto.h" #include "btree_ext.h" #include "db_am.h" �������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/btree_auto.c�����������������������������������������������������������������������0100644�0063146�0012731�00000117073�07427026535�015270� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "btree.h" #include "txn.h" int CDB___bam_pg_alloc_log(dbenv, txnid, ret_lsnp, flags, fileid, meta_lsn, page_lsn, pgno, ptype, next) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; DB_LSN * meta_lsn; DB_LSN * page_lsn; db_pgno_t pgno; u_int32_t ptype; db_pgno_t next; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_pg_alloc; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(*meta_lsn) + sizeof(*page_lsn) + sizeof(pgno) + sizeof(ptype) + sizeof(next); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (meta_lsn != NULL) memcpy(bp, meta_lsn, sizeof(*meta_lsn)); else memset(bp, 0, sizeof(*meta_lsn)); bp += sizeof(*meta_lsn); if (page_lsn != NULL) memcpy(bp, page_lsn, sizeof(*page_lsn)); else memset(bp, 0, sizeof(*page_lsn)); bp += sizeof(*page_lsn); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &ptype, sizeof(ptype)); bp += sizeof(ptype); memcpy(bp, &next, sizeof(next)); bp += sizeof(next); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_pg_alloc_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_pg_alloc_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_pg_alloc_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_pg_alloc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tmeta_lsn: [%lu][%lu]\n", (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); printf("\tpage_lsn: [%lu][%lu]\n", (u_long)argp->page_lsn.file, (u_long)argp->page_lsn.offset); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tptype: %lu\n", (u_long)argp->ptype); printf("\tnext: %lu\n", (u_long)argp->next); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_pg_alloc_read(recbuf, argpp) void *recbuf; __bam_pg_alloc_args **argpp; { __bam_pg_alloc_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_pg_alloc_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); bp += sizeof(argp->meta_lsn); memcpy(&argp->page_lsn, bp, sizeof(argp->page_lsn)); bp += sizeof(argp->page_lsn); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->ptype, bp, sizeof(argp->ptype)); bp += sizeof(argp->ptype); memcpy(&argp->next, bp, sizeof(argp->next)); bp += sizeof(argp->next); *argpp = argp; return (0); } int CDB___bam_pg_free_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, meta_lsn, header, next) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * meta_lsn; const DBT *header; db_pgno_t next; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_pg_free; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*meta_lsn) + sizeof(u_int32_t) + (header == NULL ? 0 : header->size) + sizeof(next); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (meta_lsn != NULL) memcpy(bp, meta_lsn, sizeof(*meta_lsn)); else memset(bp, 0, sizeof(*meta_lsn)); bp += sizeof(*meta_lsn); if (header == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &header->size, sizeof(header->size)); bp += sizeof(header->size); memcpy(bp, header->data, header->size); bp += header->size; } memcpy(bp, &next, sizeof(next)); bp += sizeof(next); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_pg_free_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_pg_free_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_pg_free_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_pg_free: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tmeta_lsn: [%lu][%lu]\n", (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); printf("\theader: "); for (i = 0; i < argp->header.size; i++) { ch = ((u_int8_t *)argp->header.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tnext: %lu\n", (u_long)argp->next); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_pg_free_read(recbuf, argpp) void *recbuf; __bam_pg_free_args **argpp; { __bam_pg_free_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_pg_free_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); bp += sizeof(argp->meta_lsn); memset(&argp->header, 0, sizeof(argp->header)); memcpy(&argp->header.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->header.data = bp; bp += argp->header.size; memcpy(&argp->next, bp, sizeof(argp->next)); bp += sizeof(argp->next); *argpp = argp; return (0); } int CDB___bam_split_log(dbenv, txnid, ret_lsnp, flags, fileid, left, llsn, right, rlsn, indx, npgno, nlsn, pg) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t left; DB_LSN * llsn; db_pgno_t right; DB_LSN * rlsn; u_int32_t indx; db_pgno_t npgno; DB_LSN * nlsn; const DBT *pg; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_split; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(left) + sizeof(*llsn) + sizeof(right) + sizeof(*rlsn) + sizeof(indx) + sizeof(npgno) + sizeof(*nlsn) + sizeof(u_int32_t) + (pg == NULL ? 0 : pg->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &left, sizeof(left)); bp += sizeof(left); if (llsn != NULL) memcpy(bp, llsn, sizeof(*llsn)); else memset(bp, 0, sizeof(*llsn)); bp += sizeof(*llsn); memcpy(bp, &right, sizeof(right)); bp += sizeof(right); if (rlsn != NULL) memcpy(bp, rlsn, sizeof(*rlsn)); else memset(bp, 0, sizeof(*rlsn)); bp += sizeof(*rlsn); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &npgno, sizeof(npgno)); bp += sizeof(npgno); if (nlsn != NULL) memcpy(bp, nlsn, sizeof(*nlsn)); else memset(bp, 0, sizeof(*nlsn)); bp += sizeof(*nlsn); if (pg == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &pg->size, sizeof(pg->size)); bp += sizeof(pg->size); memcpy(bp, pg->data, pg->size); bp += pg->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_split_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_split_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_split_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_split: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tleft: %lu\n", (u_long)argp->left); printf("\tllsn: [%lu][%lu]\n", (u_long)argp->llsn.file, (u_long)argp->llsn.offset); printf("\tright: %lu\n", (u_long)argp->right); printf("\trlsn: [%lu][%lu]\n", (u_long)argp->rlsn.file, (u_long)argp->rlsn.offset); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\tnpgno: %lu\n", (u_long)argp->npgno); printf("\tnlsn: [%lu][%lu]\n", (u_long)argp->nlsn.file, (u_long)argp->nlsn.offset); printf("\tpg: "); for (i = 0; i < argp->pg.size; i++) { ch = ((u_int8_t *)argp->pg.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_split_read(recbuf, argpp) void *recbuf; __bam_split_args **argpp; { __bam_split_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_split_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->left, bp, sizeof(argp->left)); bp += sizeof(argp->left); memcpy(&argp->llsn, bp, sizeof(argp->llsn)); bp += sizeof(argp->llsn); memcpy(&argp->right, bp, sizeof(argp->right)); bp += sizeof(argp->right); memcpy(&argp->rlsn, bp, sizeof(argp->rlsn)); bp += sizeof(argp->rlsn); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->npgno, bp, sizeof(argp->npgno)); bp += sizeof(argp->npgno); memcpy(&argp->nlsn, bp, sizeof(argp->nlsn)); bp += sizeof(argp->nlsn); memset(&argp->pg, 0, sizeof(argp->pg)); memcpy(&argp->pg.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->pg.data = bp; bp += argp->pg.size; *argpp = argp; return (0); } int CDB___bam_rsplit_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, pgdbt, nrec, rootent, rootlsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; const DBT *pgdbt; db_pgno_t nrec; const DBT *rootent; DB_LSN * rootlsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_rsplit; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(u_int32_t) + (pgdbt == NULL ? 0 : pgdbt->size) + sizeof(nrec) + sizeof(u_int32_t) + (rootent == NULL ? 0 : rootent->size) + sizeof(*rootlsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (pgdbt == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &pgdbt->size, sizeof(pgdbt->size)); bp += sizeof(pgdbt->size); memcpy(bp, pgdbt->data, pgdbt->size); bp += pgdbt->size; } memcpy(bp, &nrec, sizeof(nrec)); bp += sizeof(nrec); if (rootent == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &rootent->size, sizeof(rootent->size)); bp += sizeof(rootent->size); memcpy(bp, rootent->data, rootent->size); bp += rootent->size; } if (rootlsn != NULL) memcpy(bp, rootlsn, sizeof(*rootlsn)); else memset(bp, 0, sizeof(*rootlsn)); bp += sizeof(*rootlsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_rsplit_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_rsplit_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_rsplit_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_rsplit: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tpgdbt: "); for (i = 0; i < argp->pgdbt.size; i++) { ch = ((u_int8_t *)argp->pgdbt.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tnrec: %lu\n", (u_long)argp->nrec); printf("\trootent: "); for (i = 0; i < argp->rootent.size; i++) { ch = ((u_int8_t *)argp->rootent.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\trootlsn: [%lu][%lu]\n", (u_long)argp->rootlsn.file, (u_long)argp->rootlsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_rsplit_read(recbuf, argpp) void *recbuf; __bam_rsplit_args **argpp; { __bam_rsplit_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_rsplit_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memset(&argp->pgdbt, 0, sizeof(argp->pgdbt)); memcpy(&argp->pgdbt.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->pgdbt.data = bp; bp += argp->pgdbt.size; memcpy(&argp->nrec, bp, sizeof(argp->nrec)); bp += sizeof(argp->nrec); memset(&argp->rootent, 0, sizeof(argp->rootent)); memcpy(&argp->rootent.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->rootent.data = bp; bp += argp->rootent.size; memcpy(&argp->rootlsn, bp, sizeof(argp->rootlsn)); bp += sizeof(argp->rootlsn); *argpp = argp; return (0); } int CDB___bam_adj_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, lsn, indx, indx_copy, is_insert) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; u_int32_t indx; u_int32_t indx_copy; u_int32_t is_insert; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_adj; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(indx) + sizeof(indx_copy) + sizeof(is_insert); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &indx_copy, sizeof(indx_copy)); bp += sizeof(indx_copy); memcpy(bp, &is_insert, sizeof(is_insert)); bp += sizeof(is_insert); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_adj_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_adj_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_adj_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_adj: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\tindx_copy: %lu\n", (u_long)argp->indx_copy); printf("\tis_insert: %lu\n", (u_long)argp->is_insert); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_adj_read(recbuf, argpp) void *recbuf; __bam_adj_args **argpp; { __bam_adj_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_adj_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->indx_copy, bp, sizeof(argp->indx_copy)); bp += sizeof(argp->indx_copy); memcpy(&argp->is_insert, bp, sizeof(argp->is_insert)); bp += sizeof(argp->is_insert); *argpp = argp; return (0); } int CDB___bam_cadjust_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, lsn, indx, adjust, total) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; u_int32_t indx; int32_t adjust; int32_t total; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_cadjust; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(indx) + sizeof(adjust) + sizeof(total); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &adjust, sizeof(adjust)); bp += sizeof(adjust); memcpy(bp, &total, sizeof(total)); bp += sizeof(total); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_cadjust_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_cadjust_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_cadjust_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_cadjust: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\tadjust: %ld\n", (long)argp->adjust); printf("\ttotal: %ld\n", (long)argp->total); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_cadjust_read(recbuf, argpp) void *recbuf; __bam_cadjust_args **argpp; { __bam_cadjust_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_cadjust_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->adjust, bp, sizeof(argp->adjust)); bp += sizeof(argp->adjust); memcpy(&argp->total, bp, sizeof(argp->total)); bp += sizeof(argp->total); *argpp = argp; return (0); } int CDB___bam_cdel_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, lsn, indx) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; u_int32_t indx; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_cdel; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(indx); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_cdel_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_cdel_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_cdel_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_cdel: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_cdel_read(recbuf, argpp) void *recbuf; __bam_cdel_args **argpp; { __bam_cdel_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_cdel_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); *argpp = argp; return (0); } int CDB___bam_repl_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, lsn, indx, isdeleted, orig, repl, prefix, suffix) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; u_int32_t indx; u_int32_t isdeleted; const DBT *orig; const DBT *repl; u_int32_t prefix; u_int32_t suffix; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_repl; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(indx) + sizeof(isdeleted) + sizeof(u_int32_t) + (orig == NULL ? 0 : orig->size) + sizeof(u_int32_t) + (repl == NULL ? 0 : repl->size) + sizeof(prefix) + sizeof(suffix); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &isdeleted, sizeof(isdeleted)); bp += sizeof(isdeleted); if (orig == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &orig->size, sizeof(orig->size)); bp += sizeof(orig->size); memcpy(bp, orig->data, orig->size); bp += orig->size; } if (repl == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &repl->size, sizeof(repl->size)); bp += sizeof(repl->size); memcpy(bp, repl->data, repl->size); bp += repl->size; } memcpy(bp, &prefix, sizeof(prefix)); bp += sizeof(prefix); memcpy(bp, &suffix, sizeof(suffix)); bp += sizeof(suffix); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_repl_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_repl_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_repl_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_repl: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\tisdeleted: %lu\n", (u_long)argp->isdeleted); printf("\torig: "); for (i = 0; i < argp->orig.size; i++) { ch = ((u_int8_t *)argp->orig.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\trepl: "); for (i = 0; i < argp->repl.size; i++) { ch = ((u_int8_t *)argp->repl.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tprefix: %lu\n", (u_long)argp->prefix); printf("\tsuffix: %lu\n", (u_long)argp->suffix); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_repl_read(recbuf, argpp) void *recbuf; __bam_repl_args **argpp; { __bam_repl_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_repl_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->isdeleted, bp, sizeof(argp->isdeleted)); bp += sizeof(argp->isdeleted); memset(&argp->orig, 0, sizeof(argp->orig)); memcpy(&argp->orig.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->orig.data = bp; bp += argp->orig.size; memset(&argp->repl, 0, sizeof(argp->repl)); memcpy(&argp->repl.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->repl.data = bp; bp += argp->repl.size; memcpy(&argp->prefix, bp, sizeof(argp->prefix)); bp += sizeof(argp->prefix); memcpy(&argp->suffix, bp, sizeof(argp->suffix)); bp += sizeof(argp->suffix); *argpp = argp; return (0); } int CDB___bam_root_log(dbenv, txnid, ret_lsnp, flags, fileid, meta_pgno, root_pgno, meta_lsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t meta_pgno; db_pgno_t root_pgno; DB_LSN * meta_lsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_bam_root; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(meta_pgno) + sizeof(root_pgno) + sizeof(*meta_lsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &meta_pgno, sizeof(meta_pgno)); bp += sizeof(meta_pgno); memcpy(bp, &root_pgno, sizeof(root_pgno)); bp += sizeof(root_pgno); if (meta_lsn != NULL) memcpy(bp, meta_lsn, sizeof(*meta_lsn)); else memset(bp, 0, sizeof(*meta_lsn)); bp += sizeof(*meta_lsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___bam_root_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __bam_root_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___bam_root_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]bam_root: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno); printf("\troot_pgno: %lu\n", (u_long)argp->root_pgno); printf("\tmeta_lsn: [%lu][%lu]\n", (u_long)argp->meta_lsn.file, (u_long)argp->meta_lsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___bam_root_read(recbuf, argpp) void *recbuf; __bam_root_args **argpp; { __bam_root_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__bam_root_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->meta_pgno, bp, sizeof(argp->meta_pgno)); bp += sizeof(argp->meta_pgno); memcpy(&argp->root_pgno, bp, sizeof(argp->root_pgno)); bp += sizeof(argp->root_pgno); memcpy(&argp->meta_lsn, bp, sizeof(argp->meta_lsn)); bp += sizeof(argp->meta_lsn); *argpp = argp; return (0); } int CDB___bam_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_pg_alloc_print, DB_bam_pg_alloc)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_pg_free_print, DB_bam_pg_free)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_split_print, DB_bam_split)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_rsplit_print, DB_bam_rsplit)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_adj_print, DB_bam_adj)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_cadjust_print, DB_bam_cadjust)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_cdel_print, DB_bam_cdel)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_repl_print, DB_bam_repl)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_root_print, DB_bam_root)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___bam_init_recover __P((DB_ENV *)); */ int CDB___bam_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_pg_alloc_recover, DB_bam_pg_alloc)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_pg_free_recover, DB_bam_pg_free)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_split_recover, DB_bam_split)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_rsplit_recover, DB_bam_rsplit)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_adj_recover, DB_bam_adj)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_cadjust_recover, DB_bam_cadjust)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_cdel_recover, DB_bam_cdel)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_repl_recover, DB_bam_repl)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___bam_root_recover, DB_bam_root)) != 0) return (ret); return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/btree_auto.h�����������������������������������������������������������������������0100644�0063146�0012731�00000011361�07427026535�015266� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef bam_AUTO_H #define bam_AUTO_H #define DB_bam_pg_alloc (DB_bam_BEGIN + 1) typedef struct _bam_pg_alloc_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; DB_LSN meta_lsn; DB_LSN page_lsn; db_pgno_t pgno; u_int32_t ptype; db_pgno_t next; } __bam_pg_alloc_args; int CDB___bam_pg_alloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t)); int CDB___bam_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_pg_alloc_read __P((void *, __bam_pg_alloc_args **)); #define DB_bam_pg_free (DB_bam_BEGIN + 2) typedef struct _bam_pg_free_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN meta_lsn; DBT header; db_pgno_t next; } __bam_pg_free_args; int CDB___bam_pg_free_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, const DBT *, db_pgno_t)); int CDB___bam_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_pg_free_read __P((void *, __bam_pg_free_args **)); #define DB_bam_split (DB_bam_BEGIN + 3) typedef struct _bam_split_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t left; DB_LSN llsn; db_pgno_t right; DB_LSN rlsn; u_int32_t indx; db_pgno_t npgno; DB_LSN nlsn; DBT pg; } __bam_split_args; int CDB___bam_split_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, const DBT *)); int CDB___bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_split_read __P((void *, __bam_split_args **)); #define DB_bam_rsplit (DB_bam_BEGIN + 4) typedef struct _bam_rsplit_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DBT pgdbt; db_pgno_t nrec; DBT rootent; DB_LSN rootlsn; } __bam_rsplit_args; int CDB___bam_rsplit_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, const DBT *, db_pgno_t, const DBT *, DB_LSN *)); int CDB___bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_rsplit_read __P((void *, __bam_rsplit_args **)); #define DB_bam_adj (DB_bam_BEGIN + 5) typedef struct _bam_adj_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; u_int32_t indx; u_int32_t indx_copy; u_int32_t is_insert; } __bam_adj_args; int CDB___bam_adj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t)); int CDB___bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_adj_read __P((void *, __bam_adj_args **)); #define DB_bam_cadjust (DB_bam_BEGIN + 6) typedef struct _bam_cadjust_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; u_int32_t indx; int32_t adjust; int32_t total; } __bam_cadjust_args; int CDB___bam_cadjust_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, int32_t)); int CDB___bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_cadjust_read __P((void *, __bam_cadjust_args **)); #define DB_bam_cdel (DB_bam_BEGIN + 7) typedef struct _bam_cdel_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; u_int32_t indx; } __bam_cdel_args; int CDB___bam_cdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t)); int CDB___bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_cdel_read __P((void *, __bam_cdel_args **)); #define DB_bam_repl (DB_bam_BEGIN + 8) typedef struct _bam_repl_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; u_int32_t indx; u_int32_t isdeleted; DBT orig; DBT repl; u_int32_t prefix; u_int32_t suffix; } __bam_repl_args; int CDB___bam_repl_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t)); int CDB___bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_repl_read __P((void *, __bam_repl_args **)); #define DB_bam_root (DB_bam_BEGIN + 9) typedef struct _bam_root_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t meta_pgno; db_pgno_t root_pgno; DB_LSN meta_lsn; } __bam_root_args; int CDB___bam_root_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, db_pgno_t, DB_LSN *)); int CDB___bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_root_read __P((void *, __bam_root_args **)); int CDB___bam_init_print __P((DB_ENV *)); #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/btree_ext.h������������������������������������������������������������������������0100644�0063146�0012731�00000007532�07427026535�015123� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _btree_ext_h_ #define _btree_ext_h_ int CDB___bam_cmp __P((DB *, const DBT *, PAGE *, u_int32_t, int (*)(const DBT *, const DBT *))); int CDB___bam_defcmp __P((const DBT *, const DBT *)); size_t CDB___bam_defpfx __P((const DBT *, const DBT *)); int CDB___bam_pgin __P((db_pgno_t, void *, DBT *)); int CDB___bam_pgout __P((db_pgno_t, void *, DBT *)); int CDB___bam_mswap __P((PAGE *)); int CDB___bam_cprint __P((DB *)); int CDB___bam_ca_delete __P((DB *, db_pgno_t, u_int32_t, int)); void CDB___bam_ca_di __P((DB *, db_pgno_t, u_int32_t, int)); void CDB___bam_ca_dup __P((DB *, db_pgno_t, u_int32_t, u_int32_t, db_pgno_t, u_int32_t)); void CDB___bam_ca_rsplit __P((DB *, db_pgno_t, db_pgno_t)); void CDB___bam_ca_split __P((DB *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int)); void CDB___bam_ca_repl __P((DB *, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t)); int CDB___bam_c_init __P((DBC *)); int CDB___bam_c_dup __P((DBC *, DBC *)); int CDB___bam_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); int CDB___bam_ditem __P((DBC *, PAGE *, u_int32_t)); int CDB___bam_adjindx __P((DBC *, PAGE *, u_int32_t, u_int32_t, int)); int CDB___bam_dpage __P((DBC *, const DBT *)); int CDB___bam_dpages __P((DBC *)); int CDB___bam_db_create __P((DB *)); int CDB___bam_db_close __P((DB *)); int CDB___bam_set_flags __P((DB *, u_int32_t *flagsp)); int CDB___ram_set_flags __P((DB *, u_int32_t *flagsp)); int CDB___bam_open __P((DB *, const char *, db_pgno_t)); void CDB___bam_setovflsize __P((DB *)); int CDB___bam_metachk __P((DB *, const char *, BTMETA *)); int CDB___bam_read_root __P((DB *, const char *, db_pgno_t)); int CDB___bam_iitem __P((DBC *, PAGE **, db_indx_t *, DBT *, DBT *, u_int32_t, u_int32_t)); u_int32_t CDB___bam_partsize __P((u_int32_t, DBT *, PAGE *, u_int32_t)); int CDB___bam_build __P((DBC *, u_int32_t, DBT *, PAGE *, u_int32_t, u_int32_t)); int CDB___bam_ritem __P((DBC *, PAGE *, u_int32_t, DBT *)); int CDB___bam_pg_alloc_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_pg_free_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_split_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_rsplit_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_adj_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_cadjust_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_cdel_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_repl_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_root_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___bam_reclaim __P((DB *, DB_TXN *)); int CDB___ram_open __P((DB *, const char *, db_pgno_t)); int CDB___ram_c_del __P((DBC *, u_int32_t)); int CDB___ram_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); int CDB___ram_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); void CDB___ram_ca __P((DB *, db_recno_t, ca_recno_arg)); int CDB___ram_getno __P((DBC *, const DBT *, db_recno_t *, int)); int CDB___ram_writeback __P((DB *)); int CDB___bam_rsearch __P((DBC *, db_recno_t *, u_int32_t, int, int *)); int CDB___bam_adjust __P((DBC *, int32_t)); int CDB___bam_nrecs __P((DBC *, db_recno_t *)); db_recno_t CDB___bam_total __P((PAGE *)); int CDB___bam_search __P((DBC *, const DBT *, u_int32_t, int, db_recno_t *, int *)); int CDB___bam_stkrel __P((DBC *, int)); int CDB___bam_stkgrow __P((BTREE_CURSOR *)); int CDB___bam_split __P((DBC *, void *)); int CDB___bam_copy __P((DB *, PAGE *, PAGE *, u_int32_t, u_int32_t)); int CDB___bam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); int CDB___bam_traverse __P((DBC *, db_lockmode_t, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); int CDB___bam_upgrade __P((DB *, int, char *, DB_FH *, char *)); int CDB___bam_init_recover __P((DB_ENV *)); #endif /* _btree_ext_h_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/common_ext.h�����������������������������������������������������������������������0100644�0063146�0012731�00000002124�07427026535�015302� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _common_ext_h_ #define _common_ext_h_ int CDB___db_byteorder __P((DB_ENV *, int)); int CDB___db_fchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t)); int CDB___db_fcchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t, u_int32_t)); int CDB___db_ferr __P((const DB_ENV *, const char *, int)); int CDB___db_pgerr __P((DB *, db_pgno_t)); int CDB___db_pgfmt __P((DB *, db_pgno_t)); #ifdef DIAGNOSTIC void __db_assert __P((const char *, const char *, int)); #endif int CDB___db_panic_msg __P((DB_ENV *)); int CDB___db_panic __P((DB_ENV *, int)); #ifdef __STDC__ void CDB___db_err __P((const DB_ENV *, const char *, ...)); #else void CDB___db_err(); #endif void CDB___db_real_err __P((const DB_ENV *, int, int, int, const char *, va_list)); #ifdef __STDC__ int CDB___db_logmsg __P((DB_ENV *, DB_TXN *, const char *, u_int32_t, const char *, ...)); #else int CDB___db_logmsg(); #endif int CDB___db_getlong __P((DB *, const char *, char *, long, long, long *)); u_int32_t CDB___db_log2 __P((u_int32_t)); #endif /* _common_ext_h_ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/config.guess�����������������������������������������������������������������������0100755�0063146�0012731�00000125131�10057557632�015305� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-12' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner <per@bothner.com>. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pegasos:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <features.h> #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <features.h> #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c <<EOF #ifdef _SEQUENT_ # include <sys/types.h> # include <sys/utsname.h> #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include <sys/param.h> # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from ftp://ftp.gnu.org/pub/gnu/config/ If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/config.sub�������������������������������������������������������������������������0100755�0063146�0012731�00000074670�10057557632�014763� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-12' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to <config-patches@gnu.org>. Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ������������������������������������������������������������������������htdig-3.2.0b6/db/configure��������������������������������������������������������������������������0100755�0063146�0012731�00003106456�10063260373�014676� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 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 Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF $* EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="db_byteorder.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif #if STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # if HAVE_STDLIB_H # include <stdlib.h> # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #if HAVE_STRINGS_H # include <strings.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif #if HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAJOR_VERSION MINOR_VERSION MICRO_VERSION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ssize_t_decl u_char_decl u_short_decl u_int_decl u_long_decl u_int8_decl u_int16_decl int16_decl u_int32_decl int32_decl LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -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 ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # 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 echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # 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 this package 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-bigfile Enable Linux, AIX, HP/UX, Solaris big files. --enable-debug Build a debugging version. --enable-debug_rop Build a version that logs read operations. --enable-debug_wop Build a version that logs write operations. --enable-diagnostic Build a version with run-time diagnostics. --enable-posixmutexes Use POSIX standard mutexes. --enable-uimutexes Use Unix International mutexes. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-zlib=DIR root directory path of zlib installation --without-zlib to disable zlib usage completely Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&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_sep= 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$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 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # 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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu VERSION=`cat ${srcdir}/../.version` MAJOR_VERSION=`expr $VERSION : '\([0-9][0-9]*\)'` MINOR_VERSION=`expr $VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\)'` MICRO_VERSION=`expr $VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'` am__api_version="1.7" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # 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=htdig_db VERSION=$VERSION # 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. ac_config_headers="$ac_config_headers db_config.h" # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Initialize maintainer mode echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-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; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$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. ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out 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. echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h 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" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-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='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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'. 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_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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_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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* 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 -std1 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 -std1. */ int osf4_cc_array ['\x00' == 0 ? 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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'. 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 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 : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in 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 ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} 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 # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' 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 echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$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 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && break cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done SED=$lt_cv_path_SED fi echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4083 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do 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 <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5187:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` 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 # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$CONFIG_SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat <<EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <<EOF >> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6219: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6223: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6452: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6456: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6512: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6516: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds="$tmp_archive_cmds" fi link_all_deplibs=no else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi4*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ test "X$hardcode_automatic"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 8688 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 8786 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; darwin* | rhapsody*) if test "$GCC" = yes; then archive_cmds_need_lc=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag='-undefined dynamic_lookup' ;; esac fi ;; esac output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='-all_load $convenience' link_all_deplibs=yes else ld_shlibs=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && test "X$CXX" != "Xno"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) if test "$GXX" = yes; then archive_cmds_need_lc_CXX=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_CXX='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='-all_load $convenience' link_all_deplibs_CXX=yes else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd12*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc) # Intel C++ with_gnu_ld=yes archive_cmds_need_lc_CXX=no archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; cxx) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; osf3*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.0-5 | solaris2.0-5.*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <<EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; cxx) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | knetbsd*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:10963: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:10967: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11023: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11027: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ test "X$hardcode_automatic_CXX"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 12380 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 12478 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13305: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13309: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13365: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13369: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_F77="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_F77="$tmp_archive_cmds" fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi4*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_F77=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_F77='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='-all_load $convenience' link_all_deplibs_F77=yes else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ test "X$hardcode_automatic_F77"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15398: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15402: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $CC in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15631: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15635: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s conftest.err; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15691: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15695: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test ! -s out/conftest.err; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <<EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <<EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_cmds_GCJ="$tmp_archive_cmds" supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else archive_expsym_cmds_GCJ="$tmp_archive_cmds" fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.012|aix4.012.*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi4*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) if test "$GXX" = yes ; then archive_cmds_need_lc_GCJ=no case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='-undefined suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='-flat_namespace -undefined suppress' ;; 10.*) allow_undefined_flag_GCJ='-undefined dynamic_lookup' ;; esac fi ;; esac lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='-all_load $convenience' link_all_deplibs_GCJ=yes else ld_shlibs_GCJ=no fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | knetbsd*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.01* | freebsdelf3.01*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=yes library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ test "X$hardcode_automatic_GCJ"="Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* 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_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* 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_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 17867 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF #line 17965 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include <dlfcn.h> #endif #include <stdio.h> #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi 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 CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # 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. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Checks for libraries. # # Handle user hints # echo "$as_me:$LINENO: checking if zlib is wanted" >&5 echo $ECHO_N "checking if zlib is wanted... $ECHO_C" >&6 # Check whether --with-zlib or --without-zlib was given. if test "${with_zlib+set}" = set; then withval="$with_zlib" if test "$withval" = no ; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 if test "$withval" = yes ; then ZLIB_HOME="default path" else LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" ZLIB_HOME="$withval" fi fi else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 ZLIB_HOME="default path" fi; # # Locate zlib, if wanted # if test -n "${ZLIB_HOME}" then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for zlib in $ZLIB_HOME" >&5 echo $ECHO_N "checking for zlib in $ZLIB_HOME... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <zlib.h> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <zlib.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 fi if test $ac_cv_header_zlib_h = yes; then zlib_cv_zlib_h=yes else zlib_cv_zlib_h=no fi if test "$zlib_cv_zlib_h" = yes; then echo "$as_me:$LINENO: checking for inflateEnd in -lz" >&5 echo $ECHO_N "checking for inflateEnd in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_inflateEnd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char inflateEnd (); int main () { inflateEnd (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_inflateEnd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateEnd=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateEnd" >&5 echo "${ECHO_T}$ac_cv_lib_z_inflateEnd" >&6 if test $ac_cv_lib_z_inflateEnd = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi fi if test "${ac_cv_lib_z_inflateEnd:+yes}" != yes then # # If either header or library was not found, bomb # { { echo "$as_me:$LINENO: error: Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib." >&5 echo "$as_me: error: Either specify a valid zlib installation with --with-zlib=DIR or disable zlib usage with --without-zlib." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in fcntl.h limits.h stddef.h stdlib.h string.h sys/select.h sys/time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/time.h> #include <time.h> int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_blksize) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_blksize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 if test $ac_cv_member_struct_stat_st_blksize = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 _ACEOF fi echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${db_cv_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { ssize_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 db_cv_ssize_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_ssize_t" >&5 echo "${ECHO_T}$db_cv_ssize_t" >&6 if test "$db_cv_ssize_t" = no; then ssize_t_decl="typedef int ssize_t;" fi echo "$as_me:$LINENO: checking for u_char" >&5 echo $ECHO_N "checking for u_char... $ECHO_C" >&6 if test "${db_cv_uchar+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_char foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uchar=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 db_cv_uchar=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_uchar" >&5 echo "${ECHO_T}$db_cv_uchar" >&6 if test "$db_cv_uchar" = no; then u_char_decl="typedef unsigned char u_char;" fi echo "$as_me:$LINENO: checking for u_short" >&5 echo $ECHO_N "checking for u_short... $ECHO_C" >&6 if test "${db_cv_ushort+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_short foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_ushort=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 db_cv_ushort=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_ushort" >&5 echo "${ECHO_T}$db_cv_ushort" >&6 if test "$db_cv_ushort" = no; then u_short_decl="typedef unsigned short u_short;" fi echo "$as_me:$LINENO: checking for u_int" >&5 echo $ECHO_N "checking for u_int... $ECHO_C" >&6 if test "${db_cv_uint+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_int foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 db_cv_uint=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_uint" >&5 echo "${ECHO_T}$db_cv_uint" >&6 if test "$db_cv_uint" = no; then u_int_decl="typedef unsigned int u_int;" fi echo "$as_me:$LINENO: checking for u_long" >&5 echo $ECHO_N "checking for u_long... $ECHO_C" >&6 if test "${db_cv_ulong+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_long foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_ulong=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 db_cv_ulong=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_ulong" >&5 echo "${ECHO_T}$db_cv_ulong" >&6 if test "$db_cv_ulong" = no; then u_long_decl="typedef unsigned long u_long;" fi echo "$as_me:$LINENO: checking for u_int8_t" >&5 echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6 if test "${db_cv_uint8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_int8_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(unsigned char) != 1);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint8="unsigned char" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) db_cv_uint8=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_uint8" >&5 echo "${ECHO_T}$db_cv_uint8" >&6 if test "$db_cv_uint8" = no; then { { echo "$as_me:$LINENO: error: No unsigned 8-bit integral type." >&5 echo "$as_me: error: No unsigned 8-bit integral type." >&2;} { (exit 1); exit 1; }; } fi if test "$db_cv_uint8" != yes; then u_int8_decl="typedef $db_cv_uint8 u_int8_t;" fi echo "$as_me:$LINENO: checking for u_int16_t" >&5 echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 if test "${db_cv_uint16+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_int16_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint16=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(unsigned short) != 2);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint16="unsigned short" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(unsigned int) != 2);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint16="unsigned int" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) db_cv_uint16=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_uint16" >&5 echo "${ECHO_T}$db_cv_uint16" >&6 if test "$db_cv_uint16" = no; then { { echo "$as_me:$LINENO: error: No unsigned 16-bit integral type." >&5 echo "$as_me: error: No unsigned 16-bit integral type." >&2;} { (exit 1); exit 1; }; } fi if test "$db_cv_uint16" != yes; then u_int16_decl="typedef $db_cv_uint16 u_int16_t;" fi echo "$as_me:$LINENO: checking for int16_t" >&5 echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 if test "${db_cv_int16+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { int16_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int16=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(short) != 2);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int16="short" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(int) != 2);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int16="int" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) db_cv_int16=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_int16" >&5 echo "${ECHO_T}$db_cv_int16" >&6 if test "$db_cv_int16" = no; then { { echo "$as_me:$LINENO: error: No signed 16-bit integral type." >&5 echo "$as_me: error: No signed 16-bit integral type." >&2;} { (exit 1); exit 1; }; } fi if test "$db_cv_int16" != yes; then int16_decl="typedef $db_cv_int16 int16_t;" fi echo "$as_me:$LINENO: checking for u_int32_t" >&5 echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 if test "${db_cv_uint32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { u_int32_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint32=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(unsigned int) != 4);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint32="unsigned int" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(unsigned long) != 4);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_uint32="unsigned long" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) db_cv_uint32=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_uint32" >&5 echo "${ECHO_T}$db_cv_uint32" >&6 if test "$db_cv_uint32" = no; then { { echo "$as_me:$LINENO: error: No unsigned 32-bit integral type." >&5 echo "$as_me: error: No unsigned 32-bit integral type." >&2;} { (exit 1); exit 1; }; } fi if test "$db_cv_uint32" != yes; then u_int32_decl="typedef $db_cv_uint32 u_int32_t;" fi echo "$as_me:$LINENO: checking for int32_t" >&5 echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 if test "${db_cv_int32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { int32_t foo; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int32=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(int) != 4);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int32="int" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){exit(sizeof(long) != 4);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_int32="long" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) db_cv_int32=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $db_cv_int32" >&5 echo "${ECHO_T}$db_cv_int32" >&6 if test "$db_cv_int32" = no; then { { echo "$as_me:$LINENO: error: No signed 32-bit integral type." >&5 echo "$as_me: error: No signed 32-bit integral type." >&2;} { (exit 1); exit 1; }; } fi if test "$db_cv_int32" != yes; then int32_decl="typedef $db_cv_int32 int32_t;" fi # Process all options before using them. This is necessary because there # are dependencies among them. echo "$as_me:$LINENO: checking if --enable-bigfile option specified" >&5 echo $ECHO_N "checking if --enable-bigfile option specified... $ECHO_C" >&6 # Check whether --enable-bigfile or --disable-bigfile was given. if test "${enable_bigfile+set}" = set; then enableval="$enable_bigfile" db_cv_bigfile="$enable_bigfile" else db_cv_bigfile="yes" fi; echo "$as_me:$LINENO: result: $db_cv_bigfile" >&5 echo "${ECHO_T}$db_cv_bigfile" >&6 echo "$as_me:$LINENO: checking if --enable-debug option specified" >&5 echo $ECHO_N "checking if --enable-debug option specified... $ECHO_C" >&6 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" db_cv_debug="$enable_debug" else db_cv_debug="no" fi; echo "$as_me:$LINENO: result: $db_cv_debug" >&5 echo "${ECHO_T}$db_cv_debug" >&6 echo "$as_me:$LINENO: checking if --enable-debug_rop option specified" >&5 echo $ECHO_N "checking if --enable-debug_rop option specified... $ECHO_C" >&6 # Check whether --enable-debug_rop or --disable-debug_rop was given. if test "${enable_debug_rop+set}" = set; then enableval="$enable_debug_rop" db_cv_debug_rop="$enable_debug_rop" else db_cv_debug_rop="no" fi; echo "$as_me:$LINENO: result: $db_cv_debug_rop" >&5 echo "${ECHO_T}$db_cv_debug_rop" >&6 echo "$as_me:$LINENO: checking if --enable-debug_wop option specified" >&5 echo $ECHO_N "checking if --enable-debug_wop option specified... $ECHO_C" >&6 # Check whether --enable-debug_wop or --disable-debug_wop was given. if test "${enable_debug_wop+set}" = set; then enableval="$enable_debug_wop" db_cv_debug_wop="$enable_debug_wop" else db_cv_debug_wop="no" fi; echo "$as_me:$LINENO: result: $db_cv_debug_wop" >&5 echo "${ECHO_T}$db_cv_debug_wop" >&6 echo "$as_me:$LINENO: checking if --enable-diagnostic option specified" >&5 echo $ECHO_N "checking if --enable-diagnostic option specified... $ECHO_C" >&6 # Check whether --enable-diagnostic or --disable-diagnostic was given. if test "${enable_diagnostic+set}" = set; then enableval="$enable_diagnostic" db_cv_diagnostic="$enable_diagnostic" else db_cv_diagnostic="no" fi; echo "$as_me:$LINENO: result: $db_cv_diagnostic" >&5 echo "${ECHO_T}$db_cv_diagnostic" >&6 echo "$as_me:$LINENO: checking if --enable-posixmutexes option specified" >&5 echo $ECHO_N "checking if --enable-posixmutexes option specified... $ECHO_C" >&6 # Check whether --enable-posixmutexes or --disable-posixmutexes was given. if test "${enable_posixmutexes+set}" = set; then enableval="$enable_posixmutexes" db_cv_posixmutexes="$enable_posixmutexes" else db_cv_posixmutexes="no" fi; echo "$as_me:$LINENO: result: $db_cv_posixmutexes" >&5 echo "${ECHO_T}$db_cv_posixmutexes" >&6 echo "$as_me:$LINENO: checking if --enable-uimutexes option specified" >&5 echo $ECHO_N "checking if --enable-uimutexes option specified... $ECHO_C" >&6 # Check whether --enable-uimutexes or --disable-uimutexes was given. if test "${enable_uimutexes+set}" = set; then enableval="$enable_uimutexes" db_cv_uimutexes="$enable_uimutexes" else db_cv_uimutexes="no" fi; echo "$as_me:$LINENO: result: $db_cv_uimutexes" >&5 echo "${ECHO_T}$db_cv_uimutexes" >&6 echo "$as_me:$LINENO: checking for mutexes" >&5 echo $ECHO_N "checking for mutexes... $ECHO_C" >&6 if test "${db_cv_mutex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else db_cv_mutex=no orig_libs=$LIBS if test "$db_cv_posixmutexes" = yes; then db_cv_mutex="POSIX/pthreads/library" fi if test "$db_cv_uimutexes" = yes; then db_cv_mutex="UI/threads/library" fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <synch.h> main(){ static lwp_mutex_t mi = SHAREDMUTEX; static lwp_cond_t ci = SHAREDCV; lwp_mutex_t mutex = mi; lwp_cond_t cond = ci; exit ( _lwp_mutex_lock(&mutex) || _lwp_mutex_unlock(&mutex));} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="Solaris/lwp" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then LIBS="-lthread $LIBS" if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="UI/threads/library" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$orig_libs" fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <thread.h> #include <synch.h> main(){ mutex_t mutex; cond_t cond; int type = USYNC_PROCESS; exit ( mutex_init(&mutex, type, NULL) || cond_init(&cond, type, NULL) || mutex_lock(&mutex) || mutex_unlock(&mutex)); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="UI/threads" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="POSIX/pthreads" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then LIBS="-lpthread $LIBS" if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <pthread.h> main(){ pthread_cond_t cond; pthread_mutex_t mutex; pthread_condattr_t condattr; pthread_mutexattr_t mutexattr; exit ( pthread_condattr_init(&condattr) || pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) || pthread_mutexattr_init(&mutexattr) || pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) || pthread_cond_init(&cond, &condattr) || pthread_mutex_init(&mutex, &mutexattr) || pthread_mutex_lock(&mutex) || pthread_mutex_unlock(&mutex) || pthread_mutex_destroy(&mutex) || pthread_cond_destroy(&cond) || pthread_condattr_destroy(&condattr) || pthread_mutexattr_destroy(&mutexattr)); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="POSIX/pthreads/library" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$orig_libs" fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/mman.h> main(){ #if defined(__hppa) typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); #else exit(1); #endif } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="HP/msem_init" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/mman.h>; main(){ typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); msem_lock(&x, 0); msem_unlock(&x, 0); exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="UNIX/msem_init" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then LIBS="$LIBS -lmproc" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ulocks.h> int main () { typedef spinlock_t tsl_t; spinlock_t x; initspin(&x, 1); cspinlock(&x); spinunlock(&x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="ReliantUNIX/initspin" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$orig_libs" fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(__USLC__) exit(0); #endif exit(1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="SCO/x86/cc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <abi_mutex.h> int main () { typedef abilock_t tsl_t; abilock_t x; init_lock(&x); acquire_lock(&x); release_lock(&x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="SGI/init_lock" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$db_cv_mutex" = DOESNT_WORK; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <synch.h> int main () { typedef sema_t tsl_t; sema_t x; sema_init(&x, 1, USYNC_PROCESS, NULL); sema_wait(&x); sema_post(&x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="UNIX/sema_init" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$db_cv_mutex" = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/machlock.h> int main () { typedef lock_t tsl_t; lock_t x; _lock_try(&x); _lock_clear(&x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="Solaris/_lock_try" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$db_cv_mutex" = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/atomic_op.h> int main () { int x; _check_lock(x,0,1); _clear_lock(x,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="AIX/_check_lock" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(__alpha) #if defined(__GNUC__) exit(0); #endif #endif exit(1);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="ALPHA/gcc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(__hppa) #if defined(__GNUC__) exit(0); #endif #endif exit(1);} _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="HPPA/gcc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = DOESNT_WORK; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(__sparc__) #if defined(__GNUC__) exit(0); #endif #endif exit(1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="Sparc/gcc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if (defined(mc68020) || defined(sun3)) #if defined(__GNUC__) exit(0); #endif #endif exit(1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="68K/gcc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(i386) #if defined(__GNUC__) exit(0); #endif #endif exit(1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="x86/gcc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi if test "$db_cv_mutex" = no; then if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ main(){ #if defined(_UTS) exit(0); #endif exit(1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then db_cv_mutex="UTS/cc-assembly" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) : fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $db_cv_mutex" >&5 echo "${ECHO_T}$db_cv_mutex" >&6 if test "$db_cv_mutex" = no; then { echo "$as_me:$LINENO: WARNING: THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE." >&5 echo "$as_me: WARNING: THREAD MUTEXES NOT AVAILABLE FOR THIS COMPILER/ARCHITECTURE." >&2;} cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_FCNTL _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_THREADS _ACEOF fi case "$db_cv_mutex" in 68K/gcc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_68K_GCC_ASSEMBLY _ACEOF ;; AIX/_check_lock) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_AIX_CHECK_LOCK _ACEOF ;; ALPHA/gcc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_ALPHA_GCC_ASSEMBLY _ACEOF ;; HP/msem_init) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_HPPA_MSEM_INIT _ACEOF ;; HPPA/gcc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_HPPA_GCC_ASSEMBLY _ACEOF ;; POSIX/pthreads) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREAD _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREADS _ACEOF ;; POSIX/pthreads/library) LIBS="-lpthread $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREAD _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREADS _ACEOF ;; ReliantUNIX/initspin) LIBS="$LIBS -lmproc" cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_RELIANTUNIX_INITSPIN _ACEOF ;; SCO/x86/cc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SCO_X86_CC_ASSEMBLY _ACEOF ;; SGI/init_lock) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SGI_INIT_LOCK _ACEOF ;; Solaris/_lock_try) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SOLARIS_LOCK_TRY _ACEOF ;; Solaris/lwp) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREAD _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SOLARIS_LWP _ACEOF ;; Sparc/gcc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SPARC_GCC_ASSEMBLY _ACEOF ;; UI/threads) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREAD _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_UI_THREADS _ACEOF ;; UI/threads/library) LIBS="-lthread $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_PTHREAD _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_UI_THREADS _ACEOF ;; UNIX/msem_init) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_MSEM_INIT _ACEOF ;; UNIX/sema_init) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_SEMA_INIT _ACEOF ;; UTS/cc-assembly) ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}" cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_UTS_CC_ASSEMBLY _ACEOF ;; x86/gcc-assembly) cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_TAS _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_MUTEX_X86_GCC_ASSEMBLY _ACEOF ;; esac # This is where we handle stuff that autoconf can't handle: compiler, # preprocessor and load flags, libraries that the standard tests don't # look for. The default optimization is -O. # # There are additional libraries we need for some compiler/architecture # combinations. # # Some architectures require DB to be compiled with special flags and/or # libraries for threaded applications # # The makefile CC may be different than the CC used in config testing, # because the makefile CC may be set to use $(LIBTOOL). # # XXX # Don't override anything if it's already set from the environment. optimize_def="-O" case "$host_os" in aix4.*) optimize_def="-O2" CC=${CC-"xlc_r"} CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS";; bsdi3*) CC=${CC-"shlicc2"} optimize_def="-O2" LIBS="-lipc $LIBS";; bsdi*) optimize_def="-O2";; freebsd*) optimize_def="-O2" CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS";; hpux*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; irix*) optimize_def="-O2" CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";; linux*) optimize_def="-O2" CPPFLAGS="-D_REENTRANT $CPPFLAGS";; mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS" LIBS="-lsocket -lsvipc $LIBS";; osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; sco3.2v4*) CC=${CC-"cc -belf"} LIBS="-lsocket -lnsl_s $LIBS";; sco*) CC=${CC-"cc -belf"} LIBS="-lsocket -lnsl $LIBS";; solaris*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; esac CFLAGS=${CFLAGS-$optimize_def} CXXFLAGS=${CXXFLAGS-"$CFLAGS"} # If the user wants a debugging environment, add -g to the CFLAGS value. # # XXX # Some compilers can't mix optimizing and debug flags. The only way to # handle this is to specify CFLAGS in the environment before configuring. if test "$db_cv_debug" = yes; then cat >>confdefs.h <<\_ACEOF #define DEBUG _ACEOF CFLAGS="$CFLAGS -g" CXXFLAGS="$CXXFLAGS -g" fi if test "$db_cv_diagnostic" = yes; then cat >>confdefs.h <<\_ACEOF #define DIAGNOSTIC _ACEOF fi if test "$db_cv_debug_rop" = yes; then cat >>confdefs.h <<\_ACEOF #define DEBUG_ROP _ACEOF fi if test "$db_cv_debug_wop" = yes; then cat >>confdefs.h <<\_ACEOF #define DEBUG_WOP _ACEOF fi # Checks for library functions. echo "$as_me:$LINENO: checking whether closedir returns void" >&5 echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 if test "${ac_cv_func_closedir_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_closedir_void=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header_dirent> #ifndef __cplusplus int closedir (); #endif int main () { exit (closedir (opendir (".")) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_closedir_void=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_closedir_void=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 if test $ac_cv_func_closedir_void = yes; then cat >>confdefs.h <<\_ACEOF #define CLOSEDIR_VOID 1 _ACEOF fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include <stdlib.h> #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (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) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include <fcntl.h> #include <sys/mman.h> #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include <sys/param.h> # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include <stdlib.h> #else char *realloc (); #endif int main () { exit (realloc (0, 0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_realloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF case $LIBOBJS in "realloc.$ac_objext" | \ *" realloc.$ac_objext" | \ "realloc.$ac_objext "* | \ *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi for ac_header in sys/select.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking types of arguments for select" >&5 echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #if HAVE_SYS_SELECT_H # include <sys/select.h> #endif #if HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 echo "${ECHO_T}$ac_cv_func_select_args" >&6 ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then ac_cv_func_lstat_dereferences_slashed_symlink=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_lstat_dereferences_slashed_symlink=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then case $LIBOBJS in "lstat.$ac_objext" | \ *" lstat.$ac_objext" | \ "lstat.$ac_objext "* | \ *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6 if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_stat_empty_string_bug=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; exit (stat ("", &sbuf) ? 1 : 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_stat_empty_string_bug=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_stat_empty_string_bug=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6 if test $ac_cv_func_stat_empty_string_bug = yes; then case $LIBOBJS in "stat.$ac_objext" | \ *" stat.$ac_objext" | \ "stat.$ac_objext "* | \ *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* 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__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in getcwd getuid memmove memset munmap pstat_getdynamic sched_yeeld select strchr strerror strstr strtol sysconf yeld do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer <limits.h> to <assert.h> if __STDC__ is defined, since <limits.h> exists even on freestanding compilers. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile db.h" 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, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H 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_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # 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'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet 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 <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "db.h" ) CONFIG_FILES="$CONFIG_FILES db.h" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "db_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS db_config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@MAJOR_VERSION@,$MAJOR_VERSION,;t t s,@MINOR_VERSION@,$MINOR_VERSION,;t t s,@MICRO_VERSION@,$MICRO_VERSION,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@ssize_t_decl@,$ssize_t_decl,;t t s,@u_char_decl@,$u_char_decl,;t t s,@u_short_decl@,$u_short_decl,;t t s,@u_int_decl@,$u_int_decl,;t t s,@u_long_decl@,$u_long_decl,;t t s,@u_int8_decl@,$u_int8_decl,;t t s,@u_int16_decl@,$u_int16_decl,;t t s,@int16_decl@,$int16_decl,;t t s,@u_int32_decl@,$u_int32_decl,;t t s,@int32_decl@,$int32_decl,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: 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 || { (exit 1); exit 1; } fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/configure.in�����������������������������������������������������������������������0100644�0063146�0012731�00000007612�10063260372�015266� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT VERSION=`cat ${srcdir}/../.version` MAJOR_VERSION=[`expr $VERSION : '\([0-9][0-9]*\)'`] AC_SUBST(MAJOR_VERSION) MINOR_VERSION=[`expr $VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\)'`] AC_SUBST(MINOR_VERSION) MICRO_VERSION=[`expr $VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'`] AC_SUBST(MICRO_VERSION) AM_INIT_AUTOMAKE(htdig_db, $VERSION,nosubst) AC_CONFIG_SRCDIR([db_byteorder.c]) AM_CONFIG_HEADER([db_config.h]) AC_CANONICAL_HOST # Initialize maintainer mode AM_MAINTAINER_MODE # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_INSTALL # Checks for libraries. CHECK_ZLIB # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdlib.h string.h sys/select.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN AC_C_CONST AC_HEADER_STAT AC_HEADER_TIME AC_TYPE_OFF_T AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_blksize]) dnl Define any short-hand types we're missing. AM_SHORTHAND_TYPES # Process all options before using them. This is necessary because there # are dependencies among them. AM_OPTIONS_SET dnl Check for mutexes. We do this here because it changes $LIBS. AM_DEFINE_MUTEXES # This is where we handle stuff that autoconf can't handle: compiler, # preprocessor and load flags, libraries that the standard tests don't # look for. The default optimization is -O. # # There are additional libraries we need for some compiler/architecture # combinations. # # Some architectures require DB to be compiled with special flags and/or # libraries for threaded applications # # The makefile CC may be different than the CC used in config testing, # because the makefile CC may be set to use $(LIBTOOL). # # XXX # Don't override anything if it's already set from the environment. optimize_def="-O" case "$host_os" in aix4.*) optimize_def="-O2" CC=${CC-"xlc_r"} CPPFLAGS="-D_THREAD_SAFE $CPPFLAGS";; bsdi3*) CC=${CC-"shlicc2"} optimize_def="-O2" LIBS="-lipc $LIBS";; bsdi*) optimize_def="-O2";; freebsd*) optimize_def="-O2" CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS";; hpux*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; irix*) optimize_def="-O2" CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";; linux*) optimize_def="-O2" CPPFLAGS="-D_REENTRANT $CPPFLAGS";; mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS" LIBS="-lsocket -lsvipc $LIBS";; osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; sco3.2v4*) CC=${CC-"cc -belf"} LIBS="-lsocket -lnsl_s $LIBS";; sco*) CC=${CC-"cc -belf"} LIBS="-lsocket -lnsl $LIBS";; solaris*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; esac CFLAGS=${CFLAGS-$optimize_def} CXXFLAGS=${CXXFLAGS-"$CFLAGS"} # If the user wants a debugging environment, add -g to the CFLAGS value. # # XXX # Some compilers can't mix optimizing and debug flags. The only way to # handle this is to specify CFLAGS in the environment before configuring. if test "$db_cv_debug" = yes; then AC_DEFINE(DEBUG,,[degbug environment enabled]) CFLAGS="$CFLAGS -g" CXXFLAGS="$CXXFLAGS -g" fi dnl Set some #defines based on configuration options. if test "$db_cv_diagnostic" = yes; then AC_DEFINE(DIAGNOSTIC,,[Enables diagnostic]) fi if test "$db_cv_debug_rop" = yes; then AC_DEFINE(DEBUG_ROP,,[Log operations that read the database]) fi if test "$db_cv_debug_wop" = yes; then AC_DEFINE(DEBUG_WOP,,[Log operations that write to the database]) fi # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([getcwd getuid memmove memset munmap pstat_getdynamic sched_yeeld select strchr strerror strstr strtol sysconf yeld]) AC_CONFIG_FILES([Makefile db.h]) AC_OUTPUT ����������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/crdel_auto.c�����������������������������������������������������������������������0100644�0063146�0012731�00000037062�07427026535�015257� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "txn.h" int CDB___crdel_fileopen_log(dbenv, txnid, ret_lsnp, flags, name, mode) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; const DBT *name; u_int32_t mode; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_crdel_fileopen; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) + sizeof(mode); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); if (name == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &name->size, sizeof(name->size)); bp += sizeof(name->size); memcpy(bp, name->data, name->size); bp += name->size; } memcpy(bp, &mode, sizeof(mode)); bp += sizeof(mode); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___crdel_fileopen_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __crdel_fileopen_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___crdel_fileopen_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]crdel_fileopen: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tname: "); for (i = 0; i < argp->name.size; i++) { ch = ((u_int8_t *)argp->name.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tmode: %o\n", argp->mode); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___crdel_fileopen_read(recbuf, argpp) void *recbuf; __crdel_fileopen_args **argpp; { __crdel_fileopen_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__crdel_fileopen_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memset(&argp->name, 0, sizeof(argp->name)); memcpy(&argp->name.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->name.data = bp; bp += argp->name.size; memcpy(&argp->mode, bp, sizeof(argp->mode)); bp += sizeof(argp->mode); *argpp = argp; return (0); } int CDB___crdel_metasub_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, page, lsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t fileid; db_pgno_t pgno; const DBT *page; DB_LSN * lsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_crdel_metasub; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(u_int32_t) + (page == NULL ? 0 : page->size) + sizeof(*lsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (page == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &page->size, sizeof(page->size)); bp += sizeof(page->size); memcpy(bp, page->data, page->size); bp += page->size; } if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___crdel_metasub_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __crdel_metasub_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___crdel_metasub_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]crdel_metasub: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %d\n", argp->pgno); printf("\tpage: "); for (i = 0; i < argp->page.size; i++) { ch = ((u_int8_t *)argp->page.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___crdel_metasub_read(recbuf, argpp) void *recbuf; __crdel_metasub_args **argpp; { __crdel_metasub_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__crdel_metasub_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memset(&argp->page, 0, sizeof(argp->page)); memcpy(&argp->page.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->page.data = bp; bp += argp->page.size; memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); *argpp = argp; return (0); } int CDB___crdel_metapage_log(dbenv, txnid, ret_lsnp, flags, fileid, name, pgno, page) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t fileid; const DBT *name; db_pgno_t pgno; const DBT *page; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_crdel_metapage; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) + sizeof(pgno) + sizeof(u_int32_t) + (page == NULL ? 0 : page->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (name == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &name->size, sizeof(name->size)); bp += sizeof(name->size); memcpy(bp, name->data, name->size); bp += name->size; } memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (page == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &page->size, sizeof(page->size)); bp += sizeof(page->size); memcpy(bp, page->data, page->size); bp += page->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___crdel_metapage_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __crdel_metapage_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___crdel_metapage_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]crdel_metapage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tname: "); for (i = 0; i < argp->name.size; i++) { ch = ((u_int8_t *)argp->name.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tpgno: %d\n", argp->pgno); printf("\tpage: "); for (i = 0; i < argp->page.size; i++) { ch = ((u_int8_t *)argp->page.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___crdel_metapage_read(recbuf, argpp) void *recbuf; __crdel_metapage_args **argpp; { __crdel_metapage_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__crdel_metapage_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memset(&argp->name, 0, sizeof(argp->name)); memcpy(&argp->name.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->name.data = bp; bp += argp->name.size; memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memset(&argp->page, 0, sizeof(argp->page)); memcpy(&argp->page.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->page.data = bp; bp += argp->page.size; *argpp = argp; return (0); } int CDB___crdel_delete_log(dbenv, txnid, ret_lsnp, flags, name) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; const DBT *name; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_crdel_delete; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(u_int32_t) + (name == NULL ? 0 : name->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); if (name == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &name->size, sizeof(name->size)); bp += sizeof(name->size); memcpy(bp, name->data, name->size); bp += name->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___crdel_delete_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __crdel_delete_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___crdel_delete_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]crdel_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tname: "); for (i = 0; i < argp->name.size; i++) { ch = ((u_int8_t *)argp->name.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___crdel_delete_read(recbuf, argpp) void *recbuf; __crdel_delete_args **argpp; { __crdel_delete_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__crdel_delete_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memset(&argp->name, 0, sizeof(argp->name)); memcpy(&argp->name.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->name.data = bp; bp += argp->name.size; *argpp = argp; return (0); } int CDB___crdel_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_fileopen_print, DB_crdel_fileopen)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_metasub_print, DB_crdel_metasub)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_metapage_print, DB_crdel_metapage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_delete_print, DB_crdel_delete)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___crdel_init_recover __P((DB_ENV *)); */ int CDB___crdel_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_fileopen_recover, DB_crdel_fileopen)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_metasub_recover, DB_crdel_metasub)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_metapage_recover, DB_crdel_metapage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___crdel_delete_recover, DB_crdel_delete)) != 0) return (ret); return (0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/crdel_auto.h�����������������������������������������������������������������������0100644�0063146�0012731�00000003670�07427026535�015262� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef crdel_AUTO_H #define crdel_AUTO_H #define DB_crdel_fileopen (DB_crdel_BEGIN + 1) typedef struct _crdel_fileopen_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; DBT name; u_int32_t mode; } __crdel_fileopen_args; int CDB___crdel_fileopen_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t)); int CDB___crdel_fileopen_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_fileopen_read __P((void *, __crdel_fileopen_args **)); #define DB_crdel_metasub (DB_crdel_BEGIN + 2) typedef struct _crdel_metasub_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t fileid; db_pgno_t pgno; DBT page; DB_LSN lsn; } __crdel_metasub_args; int CDB___crdel_metasub_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *)); int CDB___crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_metasub_read __P((void *, __crdel_metasub_args **)); #define DB_crdel_metapage (DB_crdel_BEGIN + 3) typedef struct _crdel_metapage_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t fileid; DBT name; db_pgno_t pgno; DBT page; } __crdel_metapage_args; int CDB___crdel_metapage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, db_pgno_t, const DBT *)); int CDB___crdel_metapage_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_metapage_read __P((void *, __crdel_metapage_args **)); #define DB_crdel_delete (DB_crdel_BEGIN + 4) typedef struct _crdel_delete_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; DBT name; } __crdel_delete_args; int CDB___crdel_delete_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *)); int CDB___crdel_delete_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_delete_read __P((void *, __crdel_delete_args **)); int CDB___crdel_init_print __P((DB_ENV *)); #endif ������������������������������������������������������������������������htdig-3.2.0b6/db/crdel_rec.c������������������������������������������������������������������������0100644�0063146�0012731�00000026560�07427026535�015061� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)crdel_rec.c 11.17 (Sleepycat) 11/15/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "log.h" #include "hash.h" #include "mp.h" #include "db_dispatch.h" /* * CDB___crdel_fileopen_recover -- * Recovery function for fileopen. * * PUBLIC: int CDB___crdel_fileopen_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___crdel_fileopen_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __crdel_fileopen_args *argp; DBMETA ondisk; DB_FH fh; ssize_t nr; int do_unlink, ret; u_int32_t b, mb, io; char *real_name; COMPQUIET(info, NULL); real_name = NULL; REC_PRINT(CDB___crdel_fileopen_print); if ((ret = CDB___crdel_fileopen_read(dbtp->data, &argp)) != 0) goto out; /* * If this is an in-memory database, then the name is going to * be NULL, which looks like a 0-length name in recovery. */ if (argp->name.size == 0) goto done; if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, argp->name.data, 0, NULL, &real_name)) != 0) goto out; if (redo) { /* * The create commited, so we need to make sure that the file * exists. A simple open should suffice. */ if ((ret = CDB___os_open(real_name, DB_OSO_CREATE, argp->mode, &fh)) != 0) goto out; if ((ret = CDB___os_closehandle(&fh)) != 0) goto out; } else if (!redo) { /* * If the file is 0-length then it was in the process of being * created, so we should unlink it. If it is non-0 length, then * either someone else created it and we need to leave it * untouched or we were in the process of creating it, allocated * the first page on a system that requires you to actually * write pages as you allocate them, but never got any data * on it. * If the file doesn't exist, we never got around to creating * it, so that's fine. */ if (CDB___os_exists(real_name, NULL) != 0) goto done; if ((ret = CDB___os_open(real_name, 0, 0, &fh)) != 0) goto out; if ((ret = CDB___os_ioinfo(real_name, &fh, &mb, &b, &io)) != 0) goto out; do_unlink = 0; if (mb != 0 || b != 0) { /* * We need to read the first page to see if its got * valid data on it. */ if ((ret = CDB___os_read(&fh, &ondisk, sizeof(ondisk), &nr)) != 0 || nr != sizeof(ondisk)) goto out; if (ondisk.magic == 0) do_unlink = 1; } if ((ret = CDB___os_closehandle(&fh)) != 0) goto out; /* Check for 0-length and if it is, delete it. */ if (do_unlink || (mb == 0 && b == 0)) if ((ret = CDB___os_unlink(real_name)) != 0) goto out; } done: *lsnp = argp->prev_lsn; ret = 0; out: if (argp != NULL) CDB___os_free(argp, sizeof(*argp)); if (real_name != NULL) CDB___os_freestr(real_name); return (ret); } /* * CDB___crdel_metasub_recover -- * Recovery function for metasub. * * PUBLIC: int CDB___crdel_metasub_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___crdel_metasub_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __crdel_metasub_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___crdel_metasub_print); REC_INTRO(CDB___crdel_metasub_read, 0); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (redo) { if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } else { *lsnp = argp->prev_lsn; ret = 0; goto out; } } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { memcpy(pagep, argp->page.data, argp->page.size); LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* * We want to undo this page creation. The page creation * happened in two parts. First, we called __bam_new which * was logged separately. Then we wrote the meta-data onto * the page. So long as we restore the LSN, then the recovery * for __bam_new will do everything else. */ LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___crdel_metapage_recover -- * Recovery function for metapage. * * PUBLIC: int CDB___crdel_metapage_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___crdel_metapage_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __crdel_metapage_args *argp; DB *dbp; DBMETA *meta, ondisk; DB_FH fh; ssize_t nr; u_int32_t b, io, mb, pagesize; int is_done, ret; char *real_name; COMPQUIET(info, NULL); real_name = NULL; memset(&fh, 0, sizeof(fh)); REC_PRINT(CDB___crdel_metapage_print); if ((ret = CDB___crdel_metapage_read(dbtp->data, &argp)) != 0) goto out; /* * If this is an in-memory database, then the name is going to * be NULL, which looks like a 0-length name in recovery. */ if (argp->name.size == 0) goto done; meta = (DBMETA *)argp->page.data; CDB___ua_memcpy(&pagesize, &meta->pagesize, sizeof(pagesize)); if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, argp->name.data, 0, NULL, &real_name)) != 0) goto out; if (redo) { /* * We simply read the first page and if the LSN is 0, we * write the meta-data page. */ if ((ret = CDB___os_open(real_name, 0, 0, &fh)) != 0) goto out; if ((ret = CDB___os_seek(&fh, pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) goto out; /* * If the read succeeds then the page exists, then we need * to vrify that the page has actually been written, because * on some systems (e.g., Windows) we preallocate pages because * files aren't allowed to have holes in them. If the page * looks good then we're done. */ if ((ret = CDB___os_read(&fh, &ondisk, sizeof(ondisk), &nr)) == 0 && nr == sizeof(ondisk)) { if (ondisk.magic != 0) goto done; if ((ret = CDB___os_seek(&fh, pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) goto out; } /* * Page didn't exist, update the LSN and write a new one. * (seek pointer shouldn't have moved) */ CDB___ua_memcpy(&meta->lsn, lsnp, sizeof(DB_LSN)); if ((ret = CDB___os_write(&fh, argp->page.data, argp->page.size, &nr)) != 0) goto out; if (nr != (ssize_t)argp->page.size) { CDB___db_err(dbenv, "Write failed during recovery"); ret = EIO; goto out; } /* Handle will be closed on exit. */ } else if (!redo) { is_done = 0; /* If file does not exist, there is nothing to undo. */ if (CDB___os_exists(real_name, NULL) != 0) goto done; /* * Before we can look at anything on disk, we have to check * if there is a valid dbp for this, and if there is, we'd * better flush it. */ if ((ret = CDB___db_fileid_to_db(dbenv, &dbp, argp->fileid, 0)) == 0) (void)dbp->sync(dbp, 0); /* * We need to make sure that we do not remove a file that * someone else created. If the file is 0-length, then we * can assume that we created it and remove it. If it is * not 0-length, then we need to check the LSN and make * sure that it's the file we created. */ if ((ret = CDB___os_open(real_name, 0, 0, &fh)) != 0) goto out; if ((ret = CDB___os_ioinfo(real_name, &fh, &mb, &b, &io)) != 0) goto out; if (mb != 0 || b != 0) { /* The file has something in it. */ if ((ret = CDB___os_seek(&fh, pagesize, argp->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) goto out; if ((ret = CDB___os_read(&fh, &ondisk, sizeof(ondisk), &nr)) != 0) goto out; if (CDB_log_compare(&ondisk.lsn, lsnp) != 0) is_done = 1; } /* * Must close here, because unlink with the file open fails * on some systems. */ if ((ret = CDB___os_closehandle(&fh)) != 0) goto out; if (!is_done) { /* * On some systems, you cannot unlink an open file so * we close the fd in the dbp here and make sure we * don't try to close it again. First, check for a * saved_open_fhp, then close down the mpool. */ if (dbp->saved_open_fhp != NULL && F_ISSET(dbp->saved_open_fhp, DB_FH_VALID) && (ret = CDB___os_closehandle(dbp->saved_open_fhp)) != 0) goto out; if (dbp->mpf != NULL) { (void)CDB___memp_fremove(dbp->mpf); if ((ret = CDB_memp_fclose(dbp->mpf)) != 0) goto out; F_SET(dbp, DB_AM_DISCARD); dbp->mpf = NULL; } if ((ret = CDB___os_unlink(real_name)) != 0) goto out; } } done: *lsnp = argp->prev_lsn; ret = 0; out: if (argp != NULL) CDB___os_free(argp, sizeof(*argp)); if (real_name != NULL) CDB___os_freestr(real_name); if (F_ISSET(&fh, DB_FH_VALID)) (void)CDB___os_closehandle(&fh); return (ret); } /* * CDB___crdel_delete_recover -- * Recovery function for delete. * * PUBLIC: int CDB___crdel_delete_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___crdel_delete_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __crdel_delete_args *argp; int ret; char *backup, *real_back, *real_name; REC_PRINT(CDB___crdel_delete_print); backup = real_back = real_name = NULL; if ((ret = CDB___crdel_delete_read(dbtp->data, &argp)) != 0) goto out; if (redo) { /* * On a recovery, as we recreate what was going on, we * recreate the creation of the file. And so, even though * it committed, we need to delete it. Try to delete it, * but it is not an error if that delete fails. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, argp->name.data, 0, NULL, &real_name)) != 0) goto out; (void)CDB___os_unlink(real_name); /* * The transaction committed, so the only thing that might * be true is that the backup file is still around. Try * to delete it, but it's not an error if that delete fails. */ if ((ret = CDB___db_backup_name(argp->name.data, &backup, lsnp)) != 0) goto out; if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) goto out; (void)CDB___os_unlink(real_back); if ((ret = CDB___db_txnlist_delete(info, argp->name.data, TXNLIST_INVALID_ID, 1)) != 0) goto out; } else if (!redo) { /* * Trying to undo. File may or may not have been deleted. * Try to move the backup to the original. If the backup * exists, then this is right. If it doesn't exist, then * nothing will happen and that's OK. */ if ((ret = CDB___db_backup_name(argp->name.data, &backup, lsnp)) != 0) goto out; if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) goto out; if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, argp->name.data, 0, NULL, &real_name)) != 0) goto out; (void)CDB___os_rename(real_back, real_name); } *lsnp = argp->prev_lsn; ret = 0; out: if (argp != NULL) CDB___os_free(argp, sizeof(*argp)); if (backup != NULL) CDB___os_freestr(backup); if (real_back != NULL) CDB___os_freestr(real_back); if (real_name != NULL) CDB___os_freestr(real_name); return (ret); } ������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db.c�������������������������������������������������������������������������������0100644�0063146�0012731�00000127265�07674536241�013534� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db.c 11.31 (Sleepycat) 11/12/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_swap.h" #include "btree.h" #include "db_am.h" #include "hash.h" #include "lock.h" #include "log.h" #include "mp.h" #include "qam.h" static int CDB___db_dbopen __P((DB *, const char *, u_int32_t, int, db_pgno_t)); static int CDB___db_dbenv_setup __P((DB *, const char *, u_int32_t)); static int CDB___db_file_setup __P((DB *, const char *, u_int32_t, int, db_pgno_t, int *)); static int CDB___db_master_open __P((DB_ENV *, DB_TXN *, const char *, u_int32_t, int, DB **)); static int CDB___db_master_update __P((DB *, const char *, u_int32_t, db_pgno_t *, int, u_int32_t)); static int CDB___db_metabegin __P((DB *, DB_LOCK *)); static int CDB___db_metaend __P((DB *, DB_LOCK *, int, int (*)(DB *, void *), void *)); static int CDB___db_refresh __P((DB *)); static int CDB___db_remove_callback __P((DB *, void *)); static int CDB___db_set_pgsize __P((DB *, DB_FH *, char *)); static int CDB___db_subdb_remove __P((DB *, const char *, const char *)); #if CONFIG_TEST static void __db_makecopy __P((const char *, const char *)); #endif /* * CDB___db_open -- * Main library interface to the DB access methods. * * PUBLIC: int CDB___db_open __P((DB *, * PUBLIC: const char *, const char *, DBTYPE, u_int32_t, int)); */ int CDB___db_open(dbp, name, subdb, type, flags, mode) DB *dbp; const char *name, *subdb; DBTYPE type; u_int32_t flags; int mode; { DB_ENV *dbenv; DB_LOCK open_lock; DB *mdbp; db_pgno_t meta_pgno; u_int32_t ok_flags; int ret, t_ret; dbenv = dbp->dbenv; mdbp = NULL; /* Validate arguments. */ #define OKFLAGS \ (DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING | \ DB_NOMMAP | DB_RDONLY | DB_THREAD | DB_TRUNCATE | DB_COMPRESS) if ((ret = CDB___db_fchk(dbenv, "DB->open", flags, OKFLAGS)) != 0) return (ret); if (LF_ISSET(DB_EXCL) && !LF_ISSET(DB_CREATE)) return (CDB___db_ferr(dbenv, "DB->open", 1)); if (LF_ISSET(DB_RDONLY) && LF_ISSET(DB_CREATE)) return (CDB___db_ferr(dbenv, "DB->open", 1)); /* * Transparent I/O compression does not work on mmap'd files. */ if(LF_ISSET(DB_COMPRESS)) LF_SET(DB_NOMMAP); switch (type) { case DB_UNKNOWN: ok_flags = 0; break; case DB_BTREE: ok_flags = DB_OK_BTREE; break; case DB_HASH: ok_flags = DB_OK_HASH; break; case DB_QUEUE: ok_flags = DB_OK_QUEUE; break; case DB_RECNO: ok_flags = DB_OK_RECNO; break; default: CDB___db_err(dbp->dbenv, "unknown type: %lu", type); return (EINVAL); } if (ok_flags) DB_ILLEGAL_METHOD(dbp, ok_flags); /* The environment may have been created, but never opened. */ if (!F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_OPEN_CALLED)) { CDB___db_err(dbenv, "environment not yet opened"); return (EINVAL); } /* * Historically, you could pass in an environment that didn't have a * mpool, and DB would create a private one behind the scenes. This * no longer works. */ if (!F_ISSET(dbenv, DB_ENV_DBLOCAL) && dbenv->mp_handle == NULL) { CDB___db_err(dbenv, "environment did not include a memory pool."); return (EINVAL); } /* * You can't specify threads during DB->open if subsystems in the * environment weren't configured with them. */ if (LF_ISSET(DB_THREAD) && !F_ISSET(dbenv, DB_ENV_DBLOCAL | DB_ENV_THREAD)) { CDB___db_err(dbenv, "environment not created using DB_THREAD"); return (EINVAL); } /* DB_TRUNCATE is not transaction recoverable. */ if (LF_ISSET(DB_TRUNCATE) && F_ISSET(dbenv, DB_ENV_TXN)) { CDB___db_err(dbenv, "DB_TRUNCATE illegal in a transaction protected environment"); return (EINVAL); } /* Subdatabase checks. */ if (subdb != NULL) { /* Subdatabases must be created in named files. */ if (name == NULL) { CDB___db_err(dbenv, "subdatabases cannot be created in temporary files"); return (EINVAL); } /* QAM can't be done as a subdatabase. */ if (type == DB_QUEUE) { CDB___db_err(dbenv, "subdatabases cannot be queue files"); return (EINVAL); } } /* Convert any DB->open flags. */ if (LF_ISSET(DB_RDONLY)) F_SET(dbp, DB_AM_RDONLY); if (LF_ISSET(DB_COMPRESS)) F_SET(dbp, DB_AM_CMPR); /* Fill in the type. */ dbp->type = type; /* * If we're potentially creating a database, wrap the open inside of * a transaction. */ if (F_ISSET(dbenv, DB_ENV_TXN) && LF_ISSET(DB_CREATE)) if ((ret = CDB___db_metabegin(dbp, &open_lock)) != 0) return (ret); /* * If we're opening a subdatabase, we have to open (and potentially * create) the main database, and then get (and potentially store) * our base page number in that database. Then, we can finally open * the subdatabase. */ if (subdb == NULL) meta_pgno = PGNO_BASE_MD; else { /* * Open the master database, optionally updating it, and * retrieving the metadata page number. */ if ((ret = CDB___db_master_open(dbp->dbenv, dbp->open_txn, name, flags, mode, &mdbp)) != 0) goto err; /* Copy the page size and file id from the master. */ dbp->pgsize = mdbp->pgsize; F_SET(dbp, DB_AM_SUBDB); memcpy(dbp->fileid, mdbp->fileid, DB_FILE_ID_LEN); if ((ret = CDB___db_master_update(mdbp, subdb, type, &meta_pgno, 0, flags)) != 0) goto err; /* * Clear the exclusive open and truncation flags, they only * apply to the open of the master database. */ LF_CLR(DB_EXCL | DB_TRUNCATE); } ret = CDB___db_dbopen(dbp, name, flags, mode, meta_pgno); /* * You can open the database that describes the subdatabases in the * rest of the file read-only. The content of each key's data is * unspecified and applications should never be adding new records * or updating existing records. However, during recovery, we need * to open these databases R/W so we can redo/undo changes in them. */ if (subdb == NULL && (dbenv->lg_handle == NULL || !F_ISSET((DB_LOG *)(dbenv->lg_handle), DBC_RECOVER)) && !LF_ISSET(DB_RDONLY) && F_ISSET(dbp, DB_AM_SUBDB)) { CDB___db_err(dbenv, "databases containing subdatabase lists may only be opened read-only"); ret = EINVAL; goto err; } err: /* * End any transaction, committing if we were successful, aborting * otherwise. */ if (F_ISSET(dbenv, DB_ENV_TXN) && LF_ISSET(DB_CREATE)) if ((t_ret = CDB___db_metaend(dbp, &open_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) ret = t_ret; /* If we were successful, don't discard the file on close. */ if (ret == 0) F_CLR(dbp, DB_AM_DISCARD); /* If we were unsuccessful, destroy the DB handle. */ if (ret != 0) CDB___db_refresh(dbp); if (mdbp != NULL) { /* If we were successful, don't discard the file on close. */ if (ret == 0) F_CLR(mdbp, DB_AM_DISCARD); if ((t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) ret = t_ret; } return (ret); } /* * CDB___db_dbopen -- * Open a database. */ static int CDB___db_dbopen(dbp, name, flags, mode, meta_pgno) DB *dbp; const char *name; u_int32_t flags; int mode; db_pgno_t meta_pgno; { DB_ENV *dbenv; int ret; int zero_length; dbenv = dbp->dbenv; /* Set up the underlying file. */ if ((ret = CDB___db_file_setup(dbp, name, flags, mode, meta_pgno, &zero_length)) != 0) return (ret); /* Set up the underlying environment. */ if ((ret = CDB___db_dbenv_setup(dbp, name, flags)) != 0) return (ret); /* * Do access method specific initialization. * * !!! * Set the open flag. (The underlying access method open functions * may want to do things like acquire cursors, so the open flag has * to be set before calling them.) */ F_SET(dbp, DB_OPEN_CALLED); if (zero_length) return (0); switch (dbp->type) { case DB_BTREE: ret = CDB___bam_open(dbp, name, meta_pgno); break; case DB_HASH: ret = CDB___ham_open(dbp, name, meta_pgno); break; case DB_RECNO: ret = CDB___ram_open(dbp, name, meta_pgno); break; case DB_QUEUE: ret = CDB___qam_open(dbp, name, meta_pgno); break; case DB_UNKNOWN: ret = EINVAL; /* Shouldn't be possible. */ break; } return (ret); } /* * CDB___db_master_open -- * Open up a handle on a master database. */ static int CDB___db_master_open(dbenv, txn, name, flags, mode, dbpp) DB_ENV *dbenv; DB_TXN *txn; const char *name; u_int32_t flags; int mode; DB **dbpp; { DB *dbp; int ret; /* * Open up a handle on the main database. */ if ((ret = CDB_db_create( &dbp, F_ISSET(dbenv, DB_ENV_DBLOCAL) ? NULL : dbenv, 0)) != 0) return (ret); dbp->open_txn = txn; /* * It's always a btree; flag that we're creating a database with * subdatabases. */ dbp->type = DB_BTREE; F_SET(dbp, DB_AM_SUBDB); ret = CDB___db_dbopen(dbp, name, flags, mode, PGNO_BASE_MD); *dbpp = dbp; return (ret); } /* * CDB___db_master_update -- * Add/Remove a subdatabase from a master database. */ static int CDB___db_master_update(mdbp, subdb, type, meta_pgnop, is_remove, flags) DB *mdbp; const char *subdb; u_int32_t type; db_pgno_t *meta_pgnop; /* !NULL if creating/reading. */ int is_remove; u_int32_t flags; { DBC *dbc; DBT key, data; PAGE *p; int ret, t_ret; dbc = NULL; p = NULL; /* Open up a cursor. */ if ((ret = mdbp->cursor(mdbp, mdbp->open_txn, &dbc, 0)) != 0) goto err; /* * Try to point the cursor at the record. * * If we're removing or potentially creating an entry, lock the page * with DB_RMW. * * !!! * We don't include the name's nul termination in the database. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); key.data = (char *)subdb; key.size = strlen(subdb); ret = dbc->c_get(dbc, &key, &data, DB_SET | (meta_pgnop == NULL || (F_ISSET( mdbp->dbenv, DB_ENV_LOCKING) && LF_ISSET(DB_CREATE)) ? DB_RMW : 0)); if (is_remove) { /* We should have found something if we're removing it. */ if (ret != 0) goto err; memcpy(meta_pgnop, data.data, sizeof(db_pgno_t)); /* Delete the subdatabase entry. */ if ((ret = dbc->c_del(dbc, 0)) != 0) goto err; if ((ret = CDB_memp_fget(mdbp->mpf, meta_pgnop, 0, &p)) != 0) goto err; /* Free and put the page. */ if ((ret = CDB___db_free(dbc, p)) != 0) goto err; p = NULL; } else { /* * Get the subdatabase information. If it already exists, * copy out the page number and we're done. */ switch (ret) { case 0: memcpy(meta_pgnop, data.data, sizeof(db_pgno_t)); goto done; case DB_NOTFOUND: if (LF_ISSET(DB_CREATE)) break; ret = ENOENT; goto err; default: goto err; } if ((ret = CDB___db_new(dbc, type == DB_HASH ? P_HASHMETA : P_BTREEMETA, &p)) != 0) goto err; data.data = &PGNO(p); data.size = sizeof(db_pgno_t); if ((ret = dbc->c_put(dbc, &key, &data, DB_KEYLAST)) != 0) goto err; *meta_pgnop = PGNO(p); } err: done: /* * If we allocated a page: if we're successful, mark the page dirty * and return it to the cache, otherwise, discard/free it. */ if (p != NULL) { if (ret == 0) { if ((t_ret = CDB_memp_fput(mdbp->mpf, p, DB_MPOOL_DIRTY)) != 0) ret = t_ret; /* * Since we cannot close this file until after * transaction commit, we need to sync the dirty * pages, because we'll read these directly from * disk to open. */ if ((t_ret = mdbp->sync(mdbp, 0)) != 0 && ret == 0) ret = t_ret; } else (void)CDB___db_free(dbc, p); } /* Discard the cursor. */ if (dbc != NULL && (t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_dbenv_setup -- * Set up the underlying environment during a db_open. */ static int CDB___db_dbenv_setup(dbp, name, flags) DB *dbp; const char *name; u_int32_t flags; { DB_ENV *dbenv; DBT pgcookie; DB_MPOOL_FINFO finfo; DB_PGINFO pginfo; int ret; dbenv = dbp->dbenv; /* If the environment is local, it's time to create it. */ if (F_ISSET(dbenv, DB_ENV_DBLOCAL)) { /* Make sure we have at least DB_MINCACHE pages in our cache. */ if (dbenv->mp_gbytes == 0 && dbenv->mp_bytes < dbp->pgsize * DB_MINPAGECACHE && (ret = dbenv->set_cachesize( dbenv, 0, dbp->pgsize * DB_MINPAGECACHE, 0)) != 0) return (ret); if ((ret = dbenv->open(dbenv, NULL, NULL, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | LF_ISSET(DB_THREAD), 0)) != 0) return (ret); } /* Register DB's pgin/pgout functions. */ if ((ret = CDB_memp_register(dbenv, DB_FTYPE_SET, CDB___db_pgin, CDB___db_pgout)) != 0) return (ret); /* * Open a backing file in the memory pool. * * If we need to pre- or post-process a file's pages on I/O, set the * file type. If it's a hash file, always call the pgin and pgout * routines. This means that hash files can never be mapped into * process memory. If it's a btree file and requires swapping, we * need to page the file in and out. This has to be right -- we can't * mmap files that are being paged in and out. */ memset(&finfo, 0, sizeof(finfo)); switch (dbp->type) { case DB_BTREE: case DB_RECNO: finfo.ftype = F_ISSET(dbp, DB_AM_SWAP) ? DB_FTYPE_SET : DB_FTYPE_NOTSET; finfo.clear_len = DB_PAGE_DB_LEN; break; case DB_HASH: finfo.ftype = DB_FTYPE_SET; finfo.clear_len = DB_PAGE_DB_LEN; break; case DB_QUEUE: finfo.ftype = F_ISSET(dbp, DB_AM_SWAP) ? DB_FTYPE_SET : DB_FTYPE_NOTSET; finfo.clear_len = DB_PAGE_QUEUE_LEN; break; case DB_UNKNOWN: return (EINVAL); /* Shouldn't be possible. */ } /* * Better compression is achieved if the page does not contain random data. */ if(F_ISSET(dbp, DB_AM_CMPR)) finfo.clear_len = 0; finfo.pgcookie = &pgcookie; finfo.fileid = dbp->fileid; finfo.lsn_offset = 0; pginfo.db_pagesize = dbp->pgsize; /* * Forbiding byte swap when compression is enabled * makes things simpler for the compression. */ if(F_ISSET(dbp, DB_AM_SWAP) && LF_ISSET(DB_COMPRESS)) return (EINVAL); pginfo.needswap = F_ISSET(dbp, DB_AM_SWAP); pgcookie.data = &pginfo; pgcookie.size = sizeof(DB_PGINFO); if ((ret = CDB_memp_fopen(dbenv, name, LF_ISSET(DB_RDONLY | DB_NOMMAP | DB_COMPRESS), 0666, dbp->pgsize, &finfo, &dbp->mpf)) != 0) return (ret); /* * We may need a per-thread mutex. Allocate it from the environment * region, there's supposed to be extra space there for that purpose. */ if (LF_ISSET(DB_THREAD)) { if ((ret = CDB___db_mutex_alloc( dbenv, dbenv->reginfo, (MUTEX **)&dbp->mutexp)) != 0) return (ret); if ((ret = __db_mutex_init( dbenv, dbp->mutexp, 0, MUTEX_THREAD)) != 0) return (ret); } /* Get a log file id. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) && #if !defined(DEBUG_ROP) !F_ISSET(dbp, DB_AM_RDONLY) && #endif (ret = CDB_log_register(dbenv, dbp, name, &dbp->log_fileid)) != 0) return (ret); return (0); } /* * CDB___db_file_setup -- * Setup the file or in-memory data. * Read the database metadata and resolve it with our arguments. */ static int CDB___db_file_setup(dbp, name, flags, mode, meta_pgno, zerop) DB *dbp; const char *name; u_int32_t flags; int mode; db_pgno_t meta_pgno; int *zerop; { DBT namedbt; DB_ENV *dbenv; DB_FH *fhp, fh; DB_LSN lsn; DB_TXN *txn; ssize_t nr; u_int32_t magic, oflags; int ret, retry_cnt, t_ret; char *real_name, mbuf[256]; #define IS_SUBDB_SETUP (meta_pgno != PGNO_BASE_MD) dbenv = dbp->dbenv; txn = NULL; *zerop = 0; /* * If we open a file handle and our caller is doing fcntl(2) locking, * we can't close it because that would discard the caller's lock. * Save it until we close the DB handle. */ if (LF_ISSET(DB_FCNTL_LOCKING)) { if ((ret = CDB___os_malloc(sizeof(*fhp), NULL, &fhp)) != 0) return (ret); } else fhp = &fh; F_CLR(fhp, DB_FH_VALID); /* * If the file is in-memory, set up is simple. Otherwise, do the * hard work of opening and reading the file. * * If we have a file name, try and read the first page, figure out * what type of file it is, and initialize everything we can based * on that file's meta-data page. * * !!! * There's a reason we don't push this code down into the buffer cache. * The problem is that there's no information external to the file that * we can use as a unique ID. UNIX has dev/inode pairs, but they are * not necessarily unique after reboot, if the file was mounted via NFS. * Windows has similar problems, as the FAT filesystem doesn't maintain * dev/inode numbers across reboot. So, we must get something from the * file we can use to ensure that, even after a reboot, the file we're * joining in the cache is the right file for us to join. The solution * we use is to maintain a file ID that's stored in the database, and * that's why we have to open and read the file before calling into the * buffer cache. * * The secondary reason is that there's additional information that * we want to have before instantiating a file in the buffer cache: * the page size, file type (btree/hash), if swapping is required, * and flags (DB_RDONLY, DB_CREATE, DB_TRUNCATE). We could handle * needing this information by allowing it to be set for a file in * the buffer cache even after the file has been opened, and, of * course, supporting the ability to flush a file from the cache as * necessary, e.g., if we guessed wrongly about the page size. Given * that we have to read the file anyway to get the file ID, we might * as well get the rest, too. * * Get the real file name. */ if (name == NULL) { F_SET(dbp, DB_AM_INMEM); if (dbp->type == DB_UNKNOWN) { CDB___db_err(dbenv, "DBTYPE of unknown without existing file"); return (EINVAL); } real_name = NULL; /* * If the file is a temporary file and we're doing locking, * then we have to create a unique file ID. We can't use our * normal dev/inode pair (or whatever this OS uses in place of * dev/inode pairs) because no backing file will be created * until the mpool cache is filled forcing the buffers to disk. * Grab a random locker ID to use as a file ID. The created * ID must never match a potential real file ID -- we know it * won't because real file IDs contain a time stamp after the * dev/inode pair, and we're simply storing a 4-byte value. * * !!! * Store the locker in the file id structure -- we can get it * from there as necessary, and it saves having two copies. */ if (F_ISSET(dbenv, DB_ENV_LOCKING | DB_ENV_CDB) && (ret = CDB_lock_id(dbenv, (u_int32_t *)dbp->fileid)) != 0) return (ret); return (0); } /* Get the real backing file name. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) return (ret); /* * Open the backing file. We need to make sure that multiple processes * attempting to create the file at the same time are properly ordered * so that only one of them creates the "unique" file ID, so we open it * O_EXCL and O_CREAT so two simultaneous attempts to create the region * will return failure in one of the attempts. If we're the one that * fails, simply retry without the O_CREAT flag, which will require the * meta-data page exist. */ /* Fill in the default file mode. */ if (mode == 0) mode = CDB___db_omode("rwrw--"); oflags = 0; if (LF_ISSET(DB_RDONLY)) oflags |= DB_OSO_RDONLY; if (LF_ISSET(DB_TRUNCATE)) oflags |= DB_OSO_TRUNC; retry_cnt = 0; open_retry: *zerop = 0; ret = 0; if (LF_ISSET(DB_CREATE)) { if (dbp->open_txn != NULL) { /* * Start a child transaction to wrap this individual * create. */ if ((ret = CDB_txn_begin(dbenv, dbp->open_txn, &txn, 0)) != 0) goto err_msg; memset(&namedbt, 0, sizeof(namedbt)); namedbt.data = (char *)name; namedbt.size = strlen(name) + 1; if ((ret = CDB___crdel_fileopen_log(dbenv, txn, &lsn, DB_FLUSH, &namedbt, mode)) != 0) goto err_msg; } DB_TEST_RECOVERY(dbp, DB_TEST_PREOPEN, ret, name); if ((ret = CDB___os_open(real_name, oflags | DB_OSO_CREATE | DB_OSO_EXCL, mode, fhp)) == 0) { DB_TEST_RECOVERY(dbp, DB_TEST_POSTOPEN, ret, name); /* Commit the file create. */ if (dbp->open_txn != NULL) { if ((ret = CDB_txn_commit(txn, DB_TXN_SYNC)) != 0) goto err_msg; txn = NULL; } /* * We created the file. This means that if we later * fail, we need to delete the file and if we're going * to do that, we need to trash any pages in the * memory pool. Since we only know here that we * created the file, we're going to set the flag here * and clear it later if we commit successfully. */ F_SET(dbp, DB_AM_DISCARD); } else { /* * Abort the file create. If the abort fails, report * the error returned by CDB_txn_abort(), rather than the * open error, for no particular reason. */ if (dbp->open_txn != NULL) { if ((t_ret = CDB_txn_abort(txn)) != 0) { ret = t_ret; goto err_msg; } txn = NULL; } /* * If we were not doing an exclusive open, try again * without the create flag. */ if (ret == EEXIST && !LF_ISSET(DB_EXCL)) { LF_CLR(DB_CREATE); DB_TEST_RECOVERY(dbp, DB_TEST_POSTOPEN, ret, name); goto open_retry; } } } else ret = CDB___os_open(real_name, oflags, mode, fhp); /* * Be quiet if we couldn't open the file because it didn't exist, * the customers don't like those messages appearing in the logs. * Otherwise, complain loudly. */ if (ret != 0) { if (ret == ENOENT) goto err; goto err_msg; } /* Set the page size if we don't have one yet. */ if (dbp->pgsize == 0 && (ret = CDB___db_set_pgsize(dbp, fhp, real_name)) != 0) goto err; /* * Seek to the metadata offset; if it's a master database open or a * database without subdatabases, we're seeking to 0, but that's OK. */ if ((ret = CDB___os_seek(fhp, dbp->pgsize, meta_pgno, 0, 0, DB_OS_SEEK_SET)) != 0) goto err_msg; /* * Read the metadata page. We read 256 bytes, which is larger than * any access method's metadata page and smaller than any disk sector. */ if ((ret = CDB___os_read(fhp, mbuf, sizeof(mbuf), &nr)) != 0) goto err_msg; if (nr == sizeof(mbuf)) { /* * Figure out what access method we're dealing with, and then * call access method specific code to check error conditions * based on conflicts between the found file and application * arguments. A found file overrides some user information -- * we don't consider it an error, for example, if the user set * an expected byte order and the found file doesn't match it. */ F_CLR(dbp, DB_AM_SWAP); magic = ((DBMETA *)mbuf)->magic; swap_retry: switch (magic) { case DB_BTREEMAGIC: if ((ret = CDB___bam_metachk(dbp, name, (BTMETA *)mbuf)) != 0) goto err; break; case DB_HASHMAGIC: if ((ret = CDB___ham_metachk(dbp, name, (HMETA *)mbuf)) != 0) goto err; break; case DB_QAMMAGIC: if ((ret = CDB___qam_metachk(dbp, name, (QMETA *)mbuf)) != 0) goto err; break; case 0: /* * There are two ways we can get a 0 magic number. * If we're creating a subdatabase, then the magic * number will be 0. We allocate a page as part of * finding out what the base page number will be for * the new subdatabase, but it's not initialized in * any way. * * The second case happens if we are in recovery * and we are going to recreate a database, it's * possible that it's page was created (on systems * where pages must be created explicitly to avoid * holes in files) but is still 0. */ if (IS_SUBDB_SETUP) /* Case 1 */ goto empty; if (!LF_ISSET(DB_CREATE | DB_TRUNCATE)) { /* Case 2 */ *zerop = 1; goto empty; } goto bad_format; default: if (F_ISSET(dbp, DB_AM_SWAP)) goto bad_format; M_32_SWAP(magic); F_SET(dbp, DB_AM_SWAP); goto swap_retry; } } else { /* * Only newly created files are permitted to fail magic * number tests. */ if (nr != 0 || IS_SUBDB_SETUP) goto bad_format; /* Let the caller know that we had a 0-length file. */ if (!LF_ISSET(DB_CREATE | DB_TRUNCATE)) *zerop = 1; /* * The only way we can reach here with the DB_CREATE flag set * is if we created the file. If that's not the case, then * either (a) someone else created the file but has not yet * written out the metadata page, or (b) we truncated the file * (DB_TRUNCATE) leaving it zero-length. In the case of (a), * we want to sleep and give the file creator time to write * the metadata page. In the case of (b), we want to continue. * * !!! * There's a race in the case of two processes opening the file * with the DB_TRUNCATE flag set at roughly the same time, and * they could theoretically hurt each other. Sure hope that's * unlikely. */ if (!LF_ISSET(DB_CREATE | DB_TRUNCATE) && (dbenv->lg_handle == NULL || !F_ISSET((DB_LOG *)dbenv->lg_handle, DBC_RECOVER))) { if (retry_cnt++ < 3) { CDB___os_sleep(1, 0); goto open_retry; } bad_format: CDB___db_err(dbenv, "%s: unexpected file type or format", name); ret = EINVAL; goto err; } if (dbp->type == DB_UNKNOWN) { CDB___db_err(dbenv, "%s: DB_UNKNOWN type specified with empty file", name); ret = EINVAL; goto err; } empty: /* * The file is empty, and that's OK. If it's not a subdatabase, * though, we do need to generate a unique file ID for it. The * unique file ID includes a timestampe so that we can't collide * with any other files, even when the file IDs (dev/inode pair) * are reused. */ if (*zerop == 1) memset(dbp->fileid, 0, DB_FILE_ID_LEN); else if (!IS_SUBDB_SETUP && (ret = CDB___os_fileid(dbenv, real_name, 1, dbp->fileid)) != 0) goto err_msg; } if (0) { err_msg: CDB___db_err(dbenv, "%s: %s", name, CDB_db_strerror(ret)); } /* * Abort any running transaction -- it can only exist if something * went wrong. */ err: if (txn != NULL) (void)CDB_txn_abort(txn); DB_TEST_RECOVERY_LABEL /* * If we opened a file handle and our caller is doing fcntl(2) locking, * then we can't close it because that would discard the caller's lock. * Otherwise, close the handle. */ if (F_ISSET(fhp, DB_FH_VALID)) { if (ret == 0 && LF_ISSET(DB_FCNTL_LOCKING)) dbp->saved_open_fhp = fhp; else if ((t_ret = CDB___os_closehandle(fhp)) != 0 && ret == 0) ret = t_ret; } if (real_name != NULL) CDB___os_freestr(real_name); return (ret); } /* * CDB___db_set_pgsize -- * Set the page size based on file information. */ static int CDB___db_set_pgsize(dbp, fhp, name) DB *dbp; DB_FH *fhp; char *name; { DB_ENV *dbenv; u_int32_t iopsize; int ret; dbenv = dbp->dbenv; /* * Use the filesystem's optimum I/O size as the pagesize if a pagesize * not specified. Some filesystems have 64K as their optimum I/O size, * but as that results in fairly large default caches, we limit the * default pagesize to 16K. */ if ((ret = CDB___os_ioinfo(name, fhp, NULL, NULL, &iopsize)) != 0) { CDB___db_err(dbenv, "%s: %s", name, CDB_db_strerror(ret)); return (ret); } if (iopsize < 512) iopsize = 512; if (iopsize > 16 * 1024) iopsize = 16 * 1024; /* * If compression is on, the minimum page size must be multiplied * by the compression factor. */ #ifdef HAVE_LIBZ if(F_ISSET(dbp, DB_AM_CMPR)) { if(iopsize < DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE)) iopsize = DB_CMPR_MULTIPLY(dbenv, DB_MIN_PGSIZE); } #endif /* HAVE_LIBZ */ /* * Sheer paranoia, but we don't want anything that's not a power-of-2 * (we rely on that for alignment of various types on the pages), and * we want a multiple of the sector size as well. */ OS_ROUNDOFF(iopsize, 512); dbp->pgsize = iopsize; F_SET(dbp, DB_AM_PGDEF); return (0); } /* * CDB___db_close -- * DB destructor. * * PUBLIC: int CDB___db_close __P((DB *, u_int32_t)); */ int CDB___db_close(dbp, flags) DB *dbp; u_int32_t flags; { DB_ENV *dbenv; DBC *dbc; int ret, t_ret; ret = 0; PANIC_CHECK(dbp->dbenv); /* Validate arguments. */ if ((ret = CDB___db_closechk(dbp, flags)) != 0) return (ret); /* If never opened, or not currently open, it's easy. */ if (!F_ISSET((dbp), DB_OPEN_CALLED)) goto never_opened; /* Sync the underlying access method. */ if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && (t_ret = dbp->sync(dbp, 0)) != 0 && ret == 0) ret = t_ret; /* * Go through the active cursors and call the cursor recycle routine, * which resolves pending operations and moves the cursors onto the * free list. Then, walk the free list and call the cursor destroy * routine. */ while ((dbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; while ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL) if ((t_ret = CDB___db_c_destroy(dbc)) != 0 && ret == 0) ret = t_ret; /* Sync the memory pool. */ if (!LF_ISSET(DB_NOSYNC) && !F_ISSET(dbp, DB_AM_DISCARD) && (t_ret = CDB_memp_fsync(dbp->mpf)) != 0 && t_ret != DB_INCOMPLETE && ret == 0) ret = t_ret; /* Close any handle we've been holding since the open. */ if (dbp->saved_open_fhp != NULL && F_ISSET(dbp->saved_open_fhp, DB_FH_VALID) && (t_ret = CDB___os_closehandle(dbp->saved_open_fhp)) != 0 && ret == 0) ret = t_ret; never_opened: /* * Call the access specific close function. * * !!! * Because of where the function is called in the close process, * these routines can't do anything that would dirty pages or * otherwise affect closing down the database. */ if ((t_ret = CDB___ham_db_close(dbp)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB___bam_db_close(dbp)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB___qam_db_close(dbp)) != 0 && ret == 0) ret = t_ret; /* Refresh the structure and close any local environment. */ dbenv = dbp->dbenv; if ((t_ret = CDB___db_refresh(dbp)) != 0 && ret == 0) ret = t_ret; if (F_ISSET(dbenv, DB_ENV_DBLOCAL) && (t_ret = dbenv->close(dbenv, 0)) != 0 && ret == 0) ret = t_ret; memset(dbp, CLEAR_BYTE, sizeof(*dbp)); CDB___os_free(dbp, sizeof(*dbp)); return (ret); } /* * CDB___db_refresh -- * Refresh the DB structure, releasing any allocated resources. */ static int CDB___db_refresh(dbp) DB *dbp; { DB_ENV *dbenv; int ret, t_ret; ret = 0; dbenv = dbp->dbenv; dbp->type = 0; /* Close the memory pool file handle. */ if (dbp->mpf != NULL) { if (F_ISSET(dbp, DB_AM_DISCARD)) (void)CDB___memp_fremove(dbp->mpf); if ((t_ret = CDB_memp_fclose(dbp->mpf)) != 0 && ret == 0) ret = t_ret; dbp->mpf = NULL; } /* Discard the thread mutex. */ if (dbp->mutexp != NULL) { CDB___db_mutex_free(dbenv, dbenv->reginfo, dbp->mutexp); dbp->mutexp = NULL; } /* Discard the log file id. */ if (dbp->log_fileid != DB_LOGFILEID_INVALID) { (void)CDB_log_unregister(dbenv, dbp->log_fileid); dbp->log_fileid = DB_LOGFILEID_INVALID; } TAILQ_INIT(&dbp->free_queue); TAILQ_INIT(&dbp->active_queue); F_CLR(dbp, DB_AM_DISCARD); F_CLR(dbp, DB_AM_INMEM); F_CLR(dbp, DB_AM_RDONLY); F_CLR(dbp, DB_AM_SWAP); F_CLR(dbp, DB_DBM_ERROR); F_CLR(dbp, DB_OPEN_CALLED); return (ret); } /* * CDB___db_remove * Remove method for DB. * * PUBLIC: int CDB___db_remove __P((DB *, const char *, const char *, u_int32_t)); */ int CDB___db_remove(dbp, name, subdb, flags) DB *dbp; const char *name, *subdb; u_int32_t flags; { DBT namedbt; DB_ENV *dbenv; DB_LOCK remove_lock; DB_LSN newlsn; int ret, t_ret; char *backup, *real_back, *real_name; dbenv = dbp->dbenv; ret = 0; backup = real_back = real_name = NULL; PANIC_CHECK(dbenv); DB_ILLEGAL_AFTER_OPEN(dbp, "remove"); /* Validate arguments. */ if ((ret = CDB___db_removechk(dbp, flags)) != 0) return (ret); /* * Subdatabases. */ if (subdb != NULL) { /* Subdatabases must be created in named files. */ if (name == NULL) { CDB___db_err(dbenv, "subdatabases cannot be created in temporary files"); return (EINVAL); } return (CDB___db_subdb_remove(dbp, name, subdb)); } /* Start the transaction and log the delete. */ if (F_ISSET(dbenv, DB_ENV_TXN)) { if ((ret = CDB___db_metabegin(dbp, &remove_lock)) != 0) return (ret); memset(&namedbt, 0, sizeof(namedbt)); namedbt.data = (char *)name; namedbt.size = strlen(name) + 1; if ((ret = CDB___crdel_delete_log(dbenv, dbp->open_txn, &newlsn, DB_FLUSH, &namedbt)) != 0) { CDB___db_err(dbenv, "%s: %s", name, CDB_db_strerror(ret)); goto err; } } /* * XXX * We need to open the file and call CDB___memp_fremove on the mpf. I'm * not sure that we need to do this. Is it our responsibility or the * application's responsibility to make sure someone else isn't busily * deleting pages behind our backs? */ /* Find the real name of the file. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) goto err; /* Create name for backup file. */ if ((ret = CDB___db_backup_name(name, &backup, &newlsn)) != 0) goto err; if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, backup, 0, NULL, &real_back)) != 0) goto err; DB_TEST_RECOVERY(dbp, DB_TEST_PRERENAME, ret, name); ret = CDB___os_rename(real_name, real_back); DB_TEST_RECOVERY(dbp, DB_TEST_POSTRENAME, ret, name); err: DB_TEST_RECOVERY_LABEL /* * End the transaction, committing the transaction if we were * successful, aborting otherwise. */ if (dbp->open_txn != NULL && (t_ret = CDB___db_metaend(dbp, &remove_lock, ret == 0, CDB___db_remove_callback, real_back)) != 0 && ret == 0) ret = t_ret; if (real_name != NULL) CDB___os_freestr(real_name); if (backup != NULL) CDB___os_freestr(backup); return (ret); } /* * CDB___db_subdb_remove -- * Remove a subdatabase. */ static int CDB___db_subdb_remove(dbp, name, subdb) DB *dbp; const char *name, *subdb; { DB *mdbp; DBC *dbc; DB_ENV *dbenv; DB_LOCK remove_lock; db_pgno_t meta_pgno; int ret, t_ret; mdbp = NULL; dbc = NULL; dbenv = dbp->dbenv; /* Start the transaction. */ if (F_ISSET(dbenv, DB_ENV_TXN) && (ret = CDB___db_metabegin(dbp, &remove_lock)) != 0) return (ret); /* * Open the subdatabase. We can use the user's DB handle for this * purpose, I think. */ if ((ret = CDB___db_open(dbp, name, subdb, DB_UNKNOWN, 0, 0)) != 0) goto err; /* Free up the pages in the subdatabase. */ switch (dbp->type) { case DB_BTREE: case DB_RECNO: if ((ret = CDB___bam_reclaim(dbp, dbp->open_txn)) != 0) goto err; break; case DB_HASH: if ((ret = CDB___ham_reclaim(dbp, dbp->open_txn)) != 0) goto err; break; default: ret = EINVAL; /* Shouldn't be possible. */ goto err; } /* * Remove the entry from the main database and free the subdatabase * metadata page. */ if ((ret = CDB___db_master_open(dbp->dbenv, dbp->open_txn, name, 0, 0, &mdbp)) != 0) goto err; if ((ret = CDB___db_master_update(mdbp, subdb, dbp->type, &meta_pgno, 1, 0)) != 0) goto err; err: /* * End the transaction, committing the transaction if we were * successful, aborting otherwise. */ if (dbp->open_txn != NULL && (t_ret = CDB___db_metaend(dbp, &remove_lock, ret == 0, NULL, NULL)) != 0 && ret == 0) ret = t_ret; /* * Close the user's DB handle -- do this LAST to avoid smashing the * the transaction information. */ if ((t_ret = dbp->close(dbp, 0)) != 0 && ret == 0) ret = t_ret; if (mdbp != NULL && (t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_metabegin -- * * Begin a meta-data operation. This involves doing any required locking, * potentially beginning a transaction and then telling the caller if you * did or did not begin the transaction. * * The writing flag indicates if the caller is actually allowing creates * or doing deletes (i.e., if the caller is opening and not creating, then * we don't need to do any of this). */ static int CDB___db_metabegin(dbp, lockp) DB *dbp; DB_LOCK *lockp; { DB_ENV *dbenv; DBT dbplock; u_int32_t locker, lockval; int ret; dbenv = dbp->dbenv; lockp->off = LOCK_INVALID; /* * There is no single place where we can know that we are or are not * going to be creating any files and/or subdatabases, so we will * always begin a tranasaction when we start creating one. If we later * discover that this was unnecessary, we will abort the transaction. * Recovery is written so that if we log a file create, but then * discover that we didn't have to do it, we recover correctly. The * file recovery design document has details. * * We need to single thread all create and delete operations, so if we * are running with locking, we must obtain a lock. We use CDB_lock_id to * generate a unique locker id and use a handcrafted DBT as the object * on which we are locking. */ if (F_ISSET(dbenv, DB_ENV_LOCKING | DB_ENV_CDB)) { if ((ret = CDB_lock_id(dbenv, &locker)) != 0) return (ret); lockval = 0; dbplock.data = &lockval; dbplock.size = sizeof(lockval); if ((ret = CDB_lock_get(dbenv, locker, 0, &dbplock, DB_LOCK_WRITE, lockp)) != 0) return(ret); } return (CDB_txn_begin(dbenv, NULL, &dbp->open_txn, 0)); } /* * CDB___db_metaend -- * End a meta-data operation. */ static int CDB___db_metaend(dbp, lockp, commit, callback, cookie) DB *dbp; DB_LOCK *lockp; int commit, (*callback) __P((DB *, void *)); void *cookie; { DB_ENV *dbenv; int ret, t_ret; dbenv = dbp->dbenv; /* End the transaction. */ if (commit) { if ((ret = CDB_txn_commit(dbp->open_txn, DB_TXN_SYNC)) == 0) { /* * Unlink any underlying file, we've committed the * transaction. */ if (callback != NULL) ret = callback(dbp, cookie); } } else ret = CDB_txn_abort(dbp->open_txn); /* Release our lock. */ if (lockp->off != LOCK_INVALID && (t_ret = CDB_lock_put(dbenv, lockp)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_backup_name * Create the backup file name for a given file. * * PUBLIC: int CDB___db_backup_name __P((const char *, char **, DB_LSN *)); */ #undef BACKUP_PREFIX #define BACKUP_PREFIX "__db." #undef MAX_LSN_TO_TEXT #define MAX_LSN_TO_TEXT 21 int CDB___db_backup_name(name, backup, lsn) const char *name; char **backup; DB_LSN *lsn; { size_t len; int ret; char *retp; len = strlen(name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT + 1; if ((ret = CDB___os_malloc(len, NULL, &retp)) != 0) return (ret); /* * Create the name. Backup file names are of the form: * * __db.name.0x[lsn-file].0x[lsn-offset] * * which guarantees uniqueness. */ snprintf(retp, len, "%s%s.0x%x0x%x", BACKUP_PREFIX, name, lsn->file, lsn->offset); *backup = retp; return (0); } /* * CDB___db_remove_callback -- * Callback function -- on file remove commit, it unlinks the backing * file. */ static int CDB___db_remove_callback(dbp, cookie) DB *dbp; void *cookie; { COMPQUIET(dbp, NULL); return (CDB___os_unlink(cookie)); } #if CONFIG_TEST /* * __db_testcopy * Create a copy of all backup files and our "main" DB. * * PUBLIC: int __db_testcopy __P((DB *, const char *)); */ int __db_testcopy(dbp, name) DB *dbp; const char *name; { size_t len; int dircnt, i, ret; char **namesp, *backup, *copy, *dir, *p, *real_name; real_name = NULL; /* Get the real backing file name. */ if ((ret = CDB___db_appname(dbp->dbenv, DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) return (ret); /* * Maximum size of file, including adding a ".afterop". */ len = strlen(real_name) + strlen(BACKUP_PREFIX) + MAX_LSN_TO_TEXT + 9; if ((ret = CDB___os_malloc(len, NULL, ©)) != 0) goto out; if ((ret = CDB___os_malloc(len, NULL, &backup)) != 0) goto out; /* * First copy the file itself. */ snprintf(copy, len, "%s.afterop", real_name); __db_makecopy(real_name, copy); if ((ret = CDB___os_strdup(real_name, &dir)) != 0) goto out; CDB___os_freestr(real_name); real_name = NULL; /* * Create the name. Backup file names are of the form: * * __db.name.0x[lsn-file].0x[lsn-offset] * * which guarantees uniqueness. We want to look for the * backup name, followed by a '.0x' (so that if they have * files named, say, 'a' and 'abc' we won't match 'abc' when * looking for 'a'. */ snprintf(backup, len, "%s%s.0x", BACKUP_PREFIX, name); /* * We need the directory path to do the CDB___os_dirlist. */ p = CDB___db_rpath(dir); if (p != NULL) *p = '\0'; ret = CDB___os_dirlist(dir, &namesp, &dircnt); #if DIAGNOSTIC /* * XXX * To get the memory guard code to work because * it uses strlen and we just moved the end of the * string somewhere sooner. This causes the guard * code to fail as it looks at one byte past the end * of the string. * XXX */ *p = '/'; #endif CDB___os_freestr(dir); if (ret != 0) goto out; for (i = 0; i < dircnt; i++) { /* * Need to check if it is a backup file for this. * No idea what namesp[i] may be or how long, so * must use strncmp and not memcmp. We don't want * to use strcmp either because we are only matching * the first part of the real file's name. We don't * know its LSN's. */ if (strncmp(namesp[i], backup, strlen(backup)) == 0) { if ((ret = CDB___db_appname(dbp->dbenv, DB_APP_DATA, NULL, namesp[i], 0, NULL, &real_name)) != 0) goto out; /* * This should not happen. Check that old * .afterop files aren't around. * If so, just move on. */ if (strstr(real_name, ".afterop") != NULL) { CDB___os_freestr(real_name); real_name = NULL; continue; } snprintf(copy, len, "%s.afterop", real_name); __db_makecopy(real_name, copy); CDB___os_freestr(real_name); real_name = NULL; } } out: if (real_name) CDB___os_freestr(real_name); return (ret); } static void __db_makecopy(src, dest) const char *src, *dest; { DB_FH rfh, wfh; ssize_t rcnt, wcnt; char *buf; memset(&rfh, 0, sizeof(rfh)); memset(&wfh, 0, sizeof(wfh)); if (CDB___os_malloc(1024, NULL, &buf) != 0) return; if (CDB___os_open(src, DB_OSO_RDONLY, CDB___db_omode("rw----"), &rfh) != 0) goto err; if (CDB___os_open(dest, DB_OSO_CREATE | DB_OSO_TRUNC, CDB___db_omode("rw----"), &wfh) != 0) goto err; for (;;) if (CDB___os_read(&rfh, buf, 1024, &rcnt) < 0 || rcnt == 0 || CDB___os_write(&wfh, buf, rcnt, &wcnt) < 0 || wcnt != rcnt) break; err: CDB___os_free(buf, 1024); if (F_ISSET(&rfh, DB_FH_VALID)) CDB___os_closehandle(&rfh); if (F_ISSET(&wfh, DB_FH_VALID)) CDB___os_closehandle(&wfh); } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db.h.in����������������������������������������������������������������������������0100644�0063146�0012731�00000131007�07723671643�014134� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db.src 11.20 (Sleepycat) 10/28/99 */ #ifndef _DB_H_ #define _DB_H_ #ifndef __NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #endif /* * XXX * MacOS: ensure that Metrowerks C makes enumeration types int sized. */ #ifdef __MWERKS__ #pragma enumsalwaysint on #endif /* * XXX * Handle function prototypes and the keyword "const". This steps on name * space that DB doesn't control, but all of the other solutions are worse. * * XXX * While Microsoft's compiler is ANSI C compliant, it doesn't have _STDC_ * defined by default, you specify a command line flag or #pragma to turn * it on. Don't do that, however, because some of Microsoft's own header * files won't compile. */ #undef __P #if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) #define __P(protos) protos /* ANSI C prototypes */ #else #define const #define __P(protos) () /* K&R C preprocessor */ #endif /* * !!! * DB needs basic information about specifically sized types. If they're * not provided by the system, typedef them here. * * We protect them against multiple inclusion using __BIT_TYPES_DEFINED__, * as does BIND and Kerberos, since we don't know for sure what #include * files the user is using. * * !!! * We also provide the standard u_int, u_long etc., if they're not provided * by the system. */ #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ @u_int8_decl@ @int16_decl@ @u_int16_decl@ @int32_decl@ @u_int32_decl@ #endif @u_char_decl@ @u_short_decl@ @u_int_decl@ @u_long_decl@ @ssize_t_decl@ #define DB_VERSION_MAJOR 3 #define DB_VERSION_MINOR 0 #define DB_VERSION_PATCH 55 #define DB_VERSION_STRING "Sleepycat Software: Berkeley DB 3.0.55: (February 28, 2000)" typedef u_int32_t db_pgno_t; /* Page number type. */ typedef u_int16_t db_indx_t; /* Page offset type. */ #define DB_MAX_PAGES 0xffffffff /* >= # of pages in a file */ typedef u_int32_t db_recno_t; /* Record number type. */ #define DB_MAX_RECORDS 0xffffffff /* >= # of records in a tree */ /* Forward structure declarations, so applications get type checking. */ struct __db; typedef struct __db DB; #ifdef DB_DBM_HSEARCH typedef struct __db DBM; #endif struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT; struct __db_dbt; typedef struct __db_dbt DBT; struct __db_env; typedef struct __db_env DB_ENV; struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT; struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK; struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT; struct __db_lock_u; typedef struct __db_lock_u DB_LOCK; struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ; struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT; struct __db_lsn; typedef struct __db_lsn DB_LSN; struct __db_mpool_finfo;typedef struct __db_mpool_finfo DB_MPOOL_FINFO; struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT; struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT; struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE; struct __db_qam_stat; typedef struct __db_qam_stat DB_QUEUE_STAT; struct __db_txn; typedef struct __db_txn DB_TXN; struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE; struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT; struct __dbc; typedef struct __dbc DBC; struct __fh_t; typedef struct __fh_t DB_FH; struct __db_cmpr_info; typedef struct __db_cmpr_info DB_CMPR_INFO; /* Key/data structure -- a Data-Base Thang. */ struct __db_dbt { void *data; /* key/data */ u_int32_t size; /* key/data length */ u_int32_t ulen; /* RO: length of user buffer. */ u_int32_t dlen; /* RO: get/put record length. */ u_int32_t doff; /* RO: get/put record offset. */ #define DB_DBT_INTERNAL 0x001 /* Ignore user's malloc (internal). */ #define DB_DBT_MALLOC 0x002 /* Return in malloc'd memory. */ #define DB_DBT_PARTIAL 0x004 /* Partial put/get. */ #define DB_DBT_REALLOC 0x008 /* Return in realloc'd memory. */ #define DB_DBT_USERMEM 0x010 /* Return in user's memory. */ u_int32_t flags; }; /* * Information from user specified page compression */ struct __db_cmpr_info { int (*compress) /* Compression function */ __P((const u_int8_t*, int, u_int8_t**, int*,void *)); int (*uncompress) /* Uncompression function */ __P((const u_int8_t*, int, u_int8_t*, int,void *)); u_int8_t coefficient; /* Compression factor is 1<<coefficient */ u_int8_t max_npages; /* Max number of pages worst case */ u_int8_t zlib_flags; /* Zlib Compresson Level */ void *user_data; /* Persistent information for compression functions */ }; /* * Flags understood by both CDB_db_create and CDB_db_env_create. */ #define DB_CXX_NO_EXCEPTIONS 0x000001 /* C++: return error values. */ /* * Flags understood by only CDB_db_create. */ #define DB_XA_CREATE 0x000002 /* Open in an XA environment. */ /* * Flags understood by both DBENV->open and DB->open. */ #define DB_CREATE 0x000001 /* Create file as necessary. */ #define DB_NOMMAP 0x000002 /* Don't mmap underlying file. */ #define DB_THREAD 0x000004 /* Applications are threaded. */ /* * Flags understood by both DBENV->open and DBENV->remove. */ #define DB_FORCE 0x000008 /* Force (anything). */ #define DB_INIT_CDB 0x000010 /* Concurrent Access Methods. */ #define DB_INIT_LOCK 0x000020 /* Initialize locking. */ #define DB_INIT_LOG 0x000040 /* Initialize logging. */ #define DB_INIT_MPOOL 0x000080 /* Initialize mpool. */ #define DB_INIT_TXN 0x000100 /* Initialize transactions. */ #define DB_RECOVER 0x000200 /* Run normal recovery. */ #define DB_RECOVER_FATAL 0x000400 /* Run catastrophic recovery. */ #define DB_SYSTEM_MEM 0x000800 /* Use system-backed memory. */ #define DB_TXN_NOSYNC 0x001000 /* Do not sync log on commit. */ #define DB_USE_ENVIRON 0x002000 /* Use the environment. */ #define DB_USE_ENVIRON_ROOT 0x004000 /* Use the environment if root. */ /* * Flags understood by only DBENV->open. */ #define DB_LOCKDOWN 0x008000 /* Lock memory into physical core. */ #define DB_PRIVATE 0x010000 /* DB_ENV is process local. */ /* * Flags understood by DBENV->CDB_txn_begin. */ /* DB_TXN_NOSYNC 0x001000 Do not sync log on commit. */ #define DB_TXN_SYNC 0x000001 /* Always sync log on commit. */ #define DB_TXN_NOWAIT 0x000002 /* Do not wait for locks in this TXN. */ /* * Flags understood by only DB->open. */ #define DB_EXCL 0x000008 /* Exclusive open (O_EXCL). */ #define DB_RDONLY 0x000010 /* Read-only (O_RDONLY). */ #define DB_TRUNCATE 0x000020 /* Discard existing DB (O_TRUNC). */ #define DB_FCNTL_LOCKING 0x000040 /* Undocumented: fcntl(2) locking. */ #define DB_COMPRESS 0x000080 /* Transparent I/O compression */ /* * Flags understood by only DB->set_feedback's callback. */ /* DB_RECOVER 0x000200 Running recovery. */ #define DB_UPGRADE 0x000001 /* Upgrading. */ /* * Deadlock detector modes; used in the DBENV structure to configure the * locking subsystem. */ #define DB_LOCK_NORUN 0 #define DB_LOCK_DEFAULT 1 /* Default policy. */ #define DB_LOCK_OLDEST 2 /* Abort oldest transaction. */ #define DB_LOCK_RANDOM 3 /* Abort random transaction. */ #define DB_LOCK_YOUNGEST 4 /* Abort youngest transaction. */ /* * Flags understood by only DB->set_flags. */ #define DB_DUP 0x0001 /* Btree, Hash: duplicate keys. */ #define DB_DUPSORT 0x0002 /* Btree, Hash: duplicate keys. */ #define DB_RECNUM 0x0004 /* Btree: record numbers. */ #define DB_RENUMBER 0x0008 /* Recno: renumber on insert/delete. */ #define DB_REVSPLITOFF 0x0010 /* Btree: turn off reverse splits. */ #define DB_SNAPSHOT 0x0020 /* Recno: snapshot the input. */ struct __db_env { /******************************************************* * Public: owned by the application. *******************************************************/ FILE *db_errfile; /* Error message file stream. */ const char *db_errpfx; /* Error message prefix. */ /* Callbacks. */ void (*db_errcall) __P((const char *, char *)); void (*db_feedback) __P((DB_ENV *, int, int)); void (*db_paniccall) __P((DB_ENV *, int)); int (*db_recovery_init) __P((DB_ENV *)); /* * Currently, the verbose list is a bit field with room for 32 * entries. There's no reason that it needs to be limited, if * there are ever more than 32 entries, convert to a bit array. */ #define DB_VERB_CHKPOINT 0x0001 /* List checkpoints. */ #define DB_VERB_DEADLOCK 0x0002 /* Deadlock detection information. */ #define DB_VERB_RECOVERY 0x0004 /* Recovery information. */ #define DB_VERB_WAITSFOR 0x0008 /* Dump waits-for table. */ u_int32_t verbose; /* Verbose output. */ /* Locking. */ u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ u_int32_t lk_modes; /* Number of lock modes in table. */ u_int32_t lk_max; /* Maximum number of locks. */ u_int32_t lk_detect; /* Deadlock detect on all conflicts. */ /* Logging. */ u_int32_t lg_bsize; /* Buffer size. */ u_int32_t lg_max; /* Maximum file size. */ /* Memory pool. */ u_int32_t mp_gbytes; /* Cachesize: GB. */ u_int32_t mp_bytes; /* Cachesize: Bytes. */ size_t mp_size; /* DEPRECATED: Cachesize: bytes. */ int mp_ncache; /* Number of cache regions. */ size_t mp_mmapsize; /* Maximum file size for mmap. */ DB_CMPR_INFO * mp_cmpr_info; /* Compression info. */ /* Transactions. */ u_int32_t tx_max; /* Maximum number of transactions. */ int (*tx_recover) /* Dispatch function for recovery. */ __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); /******************************************************* * Private: owned by DB. *******************************************************/ int db_panic; /* Panic causing errno. */ /* User files, paths. */ char *db_home; /* Database home. */ char *db_log_dir; /* Database log file directory. */ char *db_tmp_dir; /* Database tmp file directory. */ char **db_data_dir; /* Database data file directories. */ int data_cnt; /* Database data file slots. */ int data_next; /* Next Database data file slot. */ int db_mode; /* Default open permissions. */ void *reginfo; /* REGINFO structure reference. */ DB_FH *lockfhp; /* Fcntl(2) locking file handle. */ void *lg_handle; /* Log handle. */ void *lk_handle; /* Lock handle. */ void *mp_handle; /* Mpool handle. */ void *tx_handle; /* Txn handle. */ int (**dtab) /* Dispatch table */ __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); size_t dtab_size; /* Slots in the dispatch table. */ /* * XA support. * * !!! * Explicit representations of structures in queue.h. * * TAILQ_ENTRY(__db_env); */ struct { struct __db_env *tqe_next; struct __db_env **tqe_prev; } links; int xa_rmid; /* XA Resource Manager ID. */ DB_TXN *xa_txn; /* XA Current transaction. */ void *cj_internal; /* C++/Java private. */ /* Methods. */ int (*close) __P((DB_ENV *, u_int32_t)); void (*err) __P((const DB_ENV *, int, const char *, ...)); void (*errx) __P((const DB_ENV *, const char *, ...)); int (*open) __P((DB_ENV *, const char *, char * const *, u_int32_t, int)); int (*remove) __P((DB_ENV *, const char *, char * const *, u_int32_t)); void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *))); void (*set_errfile) __P((DB_ENV *, FILE *)); void (*set_errpfx) __P((DB_ENV *, const char *)); void (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*set_recovery_init) __P((DB_ENV *, int (*)(DB_ENV *))); int (*set_mutexlocks) __P((DB_ENV *, int)); int (*set_pageyield) __P((DB_ENV *, int)); int (*set_panic) __P((DB_ENV *, int)); void (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); int (*set_region_init) __P((DB_ENV *, int)); int (*set_tas_spins) __P((DB_ENV *, u_int32_t)); int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); int (*set_lg_max) __P((DB_ENV *, u_int32_t)); int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); int (*set_lk_max) __P((DB_ENV *, u_int32_t)); int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); int (*set_tx_max) __P((DB_ENV *, u_int32_t)); int (*set_tx_recover) __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, int, void *))); int (*set_func_close) __P((DB_ENV *, int (*)(int))); int (*set_func_dirfree) __P((DB_ENV *, void (*)(char **, int))); int (*set_func_dirlist) __P((DB_ENV *, int (*)(const char *, char ***, int *))); int (*set_func_exists) __P((DB_ENV *, int (*)(const char *, int *))); int (*set_func_free) __P((DB_ENV *, void (*)(void *))); int (*set_func_fsync) __P((DB_ENV *, int (*)(int))); int (*set_func_ioinfo) __P((DB_ENV *, int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *))); int (*set_func_malloc) __P((DB_ENV *, void *(*)(size_t))); int (*set_func_map) __P((DB_ENV *, int (*)(char *, size_t, int, int, void **))); int (*set_func_open) __P((DB_ENV *, int (*)(const char *, int, ...))); int (*set_func_read) __P((DB_ENV *, ssize_t (*)(int, void *, size_t))); int (*set_func_realloc) __P((DB_ENV *, void *(*)(void *, size_t))); int (*set_func_rename) __P((DB_ENV *, int (*)(const char *, const char *))); int (*set_func_seek) __P((DB_ENV *, int (*)(int, size_t, db_pgno_t, u_int32_t, int, int))); int (*set_func_sleep) __P((DB_ENV *, int (*)(u_long, u_long))); int (*set_func_unlink) __P((DB_ENV *, int (*)(const char *))); int (*set_func_unmap) __P((DB_ENV *, int (*)(void *, size_t))); int (*set_func_write) __P((DB_ENV *, ssize_t (*)(int, const void *, size_t))); int (*set_func_yield) __P((DB_ENV *, int (*)(void))); #ifdef CONFIG_TEST #define DB_TEST_PREOPEN 1 /* before CDB___os_open */ #define DB_TEST_POSTOPEN 2 /* after CDB___os_open */ #define DB_TEST_POSTLOGMETA 3 /* after logging meta in btree */ #define DB_TEST_POSTLOG 4 /* after logging all pages */ #define DB_TEST_POSTSYNC 5 /* after syncing the log */ #define DB_TEST_PRERENAME 6 /* before CDB___os_rename */ #define DB_TEST_POSTRENAME 7 /* after CDB___os_rename */ int test_abort; /* Abort value for testing. */ int test_copy; /* Copy value for testing. */ #endif #define DB_ENV_CDB 0x00001 /* DB_INIT_CDB. */ #define DB_ENV_CREATE 0x00002 /* DB_CREATE set. */ #define DB_ENV_DBLOCAL 0x00004 /* DB_ENV allocated for private DB. */ #define DB_ENV_LOCKDOWN 0x00008 /* DB_LOCKDOWN set. */ #define DB_ENV_LOCKING 0x00010 /* Locking initialized. */ #define DB_ENV_LOGGING 0x00020 /* Logging initialized. */ #define DB_ENV_NOMMAP 0x00040 /* DB_NOMMAP set. */ #define DB_ENV_OPEN_CALLED 0x00080 /* DBENV->open called (paths valid). */ #define DB_ENV_PRIVATE 0x00100 /* DB_PRIVATE set. */ #define DB_ENV_STANDALONE 0x00200 /* Test: freestanding environment. */ #define DB_ENV_SYSTEM_MEM 0x00400 /* DB_SYSTEM_MEM set. */ #define DB_ENV_THREAD 0x00800 /* DB_THREAD set. */ #define DB_ENV_TXN 0x01000 /* DB_TXN_NOSYNC set. */ #define DB_ENV_TXN_NOSYNC 0x02000 /* DB_TXN_NOSYNC set. */ #define DB_ENV_USER_ALLOC 0x04000 /* User allocated the structure. */ u_int32_t flags; /* Flags. */ }; /******************************************************* * Access methods. *******************************************************/ /* * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_BTREE=1, DB_HASH, DB_RECNO, DB_QUEUE, DB_UNKNOWN /* Figure it out on open. */ } DBTYPE; #define DB_BTREEVERSION 7 /* Current btree version. */ #define DB_BTREEOLDVER 6 /* Oldest btree version supported. */ #define DB_BTREEMAGIC 0x053162 #define DB_HASHVERSION 6 /* Current hash version. */ #define DB_HASHOLDVER 4 /* Oldest hash version supported. */ #define DB_HASHMAGIC 0x061561 #define DB_QAMVERSION 1 /* Current queue version. */ #define DB_QAMOLDVER 1 /* Oldest queue version supported. */ #define DB_QAMMAGIC 0x042253 #define DB_LOGVERSION 2 /* Current log version. */ #define DB_LOGOLDVER 2 /* Oldest log version supported. */ #define DB_LOGMAGIC 0x040988 /* * DB access method and cursor operation values. Each value is an operation * code to which additional bit flags are added. */ #define DB_AFTER 1 /* c_put() */ #define DB_APPEND 2 /* put() */ #define DB_BEFORE 3 /* c_put() */ #define DB_CHECKPOINT 4 /* CDB_log_put(), CDB_log_get() */ #define DB_CONSUME 5 /* c_get() */ #define DB_CURLSN 6 /* CDB_log_put() */ #define DB_CURRENT 7 /* c_get(), c_put(), CDB_log_get() */ #define DB_DUPCURSOR 8 /* cursor() (internal) */ #define DB_FIRST 9 /* c_get(), CDB_log_get() */ #define DB_FLUSH 10 /* CDB_log_put() */ #define DB_GET_BOTH 11 /* get(), c_get() */ #define DB_GET_RECNO 12 /* c_get() */ #define DB_JOIN_ITEM 13 /* c_get(); do not do primary lookup */ #define DB_KEYFIRST 14 /* c_put() */ #define DB_KEYLAST 15 /* c_put() */ #define DB_LAST 16 /* c_get(), CDB_log_get() */ #define DB_NEXT 17 /* c_get(), CDB_log_get() */ #define DB_NEXT_DUP 18 /* c_get() */ #define DB_NEXT_NODUP 19 /* c_get() */ #define DB_NOOVERWRITE 20 /* put() */ #define DB_NOSYNC 21 /* close() */ #define DB_POSITION 22 /* c_dup() */ #define DB_POSITIONI 23 /* c_dup() (internal) */ #define DB_PREV 24 /* c_get(), CDB_log_get() */ #define DB_RECORDCOUNT 25 /* stat() */ #define DB_SET 26 /* c_get(), CDB_log_get() */ #define DB_SET_RANGE 27 /* c_get() */ #define DB_SET_RECNO 28 /* get(), c_get() */ #define DB_WRITECURSOR 29 /* cursor() */ #define DB_WRITELOCK 30 /* cursor() (internal) */ /* This has to change when the max opcode above hits 32. */ #define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags. */ #define DB_RMW 0x80000000 /* Acquire write flag immediately. */ /* * DB (user visible) error return codes. * * !!! * Changes to any of the user visible error return codes must be reflected * in java/src/com/sleepycat/db/Db.java. * * !!! * For source compatibility with DB 2.X deadlock return (EAGAIN), use the * following: * #include <errno.h> * #define DB_LOCK_DEADLOCK EAGAIN * * !!! * We don't want our error returns to conflict with other packages where * possible, so pick a base error value that's hopefully not common. */ #define DB_INCOMPLETE (-30999)/* Sync didn't finish. */ #define DB_KEYEMPTY (-30998)/* Key/data deleted or never created. */ #define DB_KEYEXIST (-30997)/* The key/data pair already exists. */ #define DB_LOCK_DEADLOCK (-30996)/* Deadlock. */ #define DB_LOCK_NOTGRANTED (-30995)/* Lock unavailable. */ #define DB_NOTFOUND (-30994)/* Key/data pair not found (EOF). */ #define DB_OLD_VERSION (-30993)/* Out-of-date version. */ #define DB_RUNRECOVERY (-30992)/* Panic return. */ /* DB (private) error return codes. */ #define DB_DELETED (-30991)/* Recovery file marked deleted. */ #define DB_NEEDSPLIT (-30990)/* Page needs to be split. */ #define DB_SWAPBYTES (-30989)/* Database needs byte swapping. */ #define DB_TXN_CKP (-30988)/* Encountered ckp record in log. */ #define DB_FILE_ID_LEN 20 /* DB file ID length. */ /* DB access method description structure. */ struct __db { /******************************************************* * Public: owned by the application. *******************************************************/ size_t pgsize; /* Database logical page size. */ /* Callbacks. */ void (*db_feedback) __P((DB *, int, int)); void *(*db_malloc) __P((size_t)); void *(*db_realloc) __P((void *, size_t)); int (*dup_compare) __P((const DBT *, const DBT *)); /******************************************************* * Private: owned by DB. *******************************************************/ DB_ENV *dbenv; /* Backing environment. */ DBTYPE type; /* DB access method type. */ DB_MPOOLFILE *mpf; /* Backing buffer pool. */ void *mutexp; /* Synchronization for free threading */ u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */ #define DB_LOGFILEID_INVALID -1 int32_t log_fileid; /* File's unique ID for logging. */ DB_TXN *open_txn; /* Transaction to protect creates. */ /* * !!! * Some applications use DB but implement their own locking outside of * DB. If they're using fcntl(2) locking on the underlying database * file, and we open and close a file descriptor for that file, we will * discard their locks. The DB_FCNTL_LOCKING flag to DB->open is an * undocumented interface to support this usage which leaves any file * descriptors we open until DB->close. This will only work with the * DB->open interface and simple caches, e.g., creating a transaction * thread may open/close file descriptors this flag doesn't protect. * Locking with fcntl(2) on a file that you don't own is a very, very * unsafe thing to do. 'Nuff said. */ DB_FH *saved_open_fhp; /* Saved file handle. */ /* * Cursor queues. * * !!! * Explicit representations of structures in queue.h. * * TAILQ_HEAD(free_queue, __dbc); * TAILQ_HEAD(active_queue, __dbc); */ struct { struct __dbc *tqh_first; struct __dbc **tqh_last; } free_queue; struct { struct __dbc *tqh_first; struct __dbc **tqh_last; } active_queue; void *bt_internal; /* Btree/Recno access method private. */ void *cj_internal; /* C++/Java private. */ void *h_internal; /* Hash access method private. */ void *q_internal; /* Queue access method private. */ void *xa_internal; /* XA private. */ /* Methods. */ int (*close) __P((DB *, u_int32_t)); int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); void (*err) __P((DB *, int, const char *, ...)); void (*errx) __P((DB *, const char *, ...)); int (*fd) __P((DB *, int *)); int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*get_byteswapped) __P((DB *)); DBTYPE (*get_type) __P((DB *)); int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); int (*open) __P((DB *, const char *, const char *, DBTYPE, u_int32_t, int)); int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*remove) __P((DB *, const char *, const char *, u_int32_t)); int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); int (*set_dup_compare) __P((DB *, int (*)(const DBT *, const DBT *))); void (*set_errcall) __P((DB *, void (*)(const char *, char *))); void (*set_errfile) __P((DB *, FILE *)); void (*set_errpfx) __P((DB *, const char *)); void (*set_feedback) __P((DB *, void (*)(DB *, int, int))); int (*set_flags) __P((DB *, u_int32_t)); int (*set_lorder) __P((DB *, int)); int (*set_malloc) __P((DB *, void *(*)(size_t))); int (*set_pagesize) __P((DB *, u_int32_t)); void (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); int (*set_realloc) __P((DB *, void *(*)(void *, size_t))); int (*stat) __P((DB *, void *, void *(*)(size_t), u_int32_t)); int (*sync) __P((DB *, u_int32_t)); int (*upgrade) __P((DB *, const char *, u_int32_t)); int (*set_bt_compare) __P((DB *, int (*)(const DBT *, const DBT *))); int (*set_bt_maxkey) __P((DB *, u_int32_t)); int (*set_bt_minkey) __P((DB *, u_int32_t)); int (*set_bt_prefix) __P((DB *, size_t (*)(const DBT *, const DBT *))); int (*set_h_ffactor) __P((DB *, u_int32_t)); int (*set_h_hash) __P((DB *, u_int32_t (*)(const void *, u_int32_t))); int (*set_h_nelem) __P((DB *, u_int32_t)); int (*set_re_delim) __P((DB *, int)); int (*set_re_len) __P((DB *, u_int32_t)); int (*set_re_pad) __P((DB *, int)); int (*set_re_source) __P((DB *, const char *)); #define DB_OK_BTREE 0x01 #define DB_OK_HASH 0x02 #define DB_OK_QUEUE 0x04 #define DB_OK_RECNO 0x08 u_int32_t am_ok; /* Legal AM choices. */ #define DB_AM_DISCARD 0x00001 /* Discard any cached pages. */ #define DB_AM_DUP 0x00002 /* DB_DUP. */ #define DB_AM_INMEM 0x00004 /* In-memory; no sync on close. */ #define DB_AM_PGDEF 0x00008 /* Page size was defaulted. */ #define DB_AM_RDONLY 0x00010 /* Database is readonly. */ #define DB_AM_SUBDB 0x00020 /* Subdatabases supported. */ #define DB_AM_SWAP 0x00040 /* Pages need to be byte-swapped. */ #define DB_BT_RECNUM 0x00080 /* DB_RECNUM. */ #define DB_BT_REVSPLIT 0x00100 /* DB_REVSPLITOFF. */ #define DB_DBM_ERROR 0x00200 /* Error in DBM/NDBM database. */ #define DB_OPEN_CALLED 0x00400 /* DB->open called. */ #define DB_RE_DELIMITER 0x00800 /* Variablen length delimiter set. */ #define DB_RE_FIXEDLEN 0x01000 /* Fixed-length records. */ #define DB_RE_PAD 0x02000 /* Fixed-length record pad. */ #define DB_RE_RENUMBER 0x04000 /* DB_RENUMBER. */ #define DB_RE_SNAPSHOT 0x08000 /* DB_SNAPSHOT. */ #define DB_AM_CMPR 0x10000 /* Transparent I/O compression */ u_int32_t flags; }; /* * DB_LOCK_ILOCK -- * Internal DB access method lock. */ struct __db_ilock { db_pgno_t pgno; /* Page being locked. */ u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */ #define DB_RECORD_LOCK 1 #define DB_PAGE_LOCK 2 u_int8_t type; /* Record or Page lock */ }; /* * DB_LOCK -- * The structure is allocated by the caller and filled in during a * CDB_lock_get request (or a CDB_lock_vec/DB_LOCK_GET). */ struct __db_lock_u { size_t off; /* Offset of the lock in the region */ u_int32_t ndx; /* Index of the object referenced by * this lock; used for locking. */ u_int32_t gen; /* Generation number of this lock. */ }; /* Cursor description structure. */ struct __dbc { DB *dbp; /* Related DB access method. */ DB_TXN *txn; /* Associated transaction. */ /* * !!! * Explicit representations of structures in queue.h. * * TAILQ_ENTRY(__dbc) links; Active/free cursor queues. */ struct { struct __dbc *tqe_next; struct __dbc **tqe_prev; } links; u_int32_t lid; /* Default process' locker id. */ u_int32_t locker; /* Locker for this operation. */ DBT lock_dbt; /* DBT referencing lock. */ DB_LOCK_ILOCK lock; /* Object to be locked. */ DB_LOCK mylock; /* Lock held on this cursor. */ DBT rkey; /* Returned key. */ DBT rdata; /* Returned data. */ int (*c_close) __P((DBC *)); /* Methods: public. */ int (*c_del) __P((DBC *, u_int32_t)); int (*c_dup) __P((DBC *, DBC **, u_int32_t)); int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_am_close) __P((DBC *)); /* Methods: private. */ int (*c_am_destroy) __P((DBC *)); void *internal; /* Access method private. */ #define DBC_CONTINUE 0x001 /* Continue dup search: next item. */ #define DBC_RECOVER 0x002 /* In recovery (do not log or lock). */ #define DBC_RMW 0x004 /* Acquire write flag in read op. */ #define DBC_WRITECURSOR 0x008 /* Cursor may be used to write (CDB). */ #define DBC_WRITER 0x010 /* Cursor immediately writing (CDB). */ u_int32_t flags; }; /* Btree/Recno statistics structure. */ struct __db_bt_stat { u_int32_t bt_metaflags; /* Metadata flags. */ u_int32_t bt_maxkey; /* Maxkey value. */ u_int32_t bt_minkey; /* Minkey value. */ u_int32_t bt_re_len; /* Fixed-length record length. */ u_int32_t bt_re_pad; /* Fixed-length record pad. */ u_int32_t bt_pagesize; /* Page size. */ u_int32_t bt_levels; /* Tree levels. */ u_int32_t bt_nrecs; /* Number of records. */ u_int32_t bt_int_pg; /* Internal pages. */ u_int32_t bt_leaf_pg; /* Leaf pages. */ u_int32_t bt_dup_pg; /* Duplicate pages. */ u_int32_t bt_over_pg; /* Overflow pages. */ u_int32_t bt_free; /* Pages on the free list. */ u_int32_t bt_int_pgfree; /* Bytes free in internal pages. */ u_int32_t bt_leaf_pgfree; /* Bytes free in leaf pages. */ u_int32_t bt_dup_pgfree; /* Bytes free in duplicate pages. */ u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */ u_int32_t bt_magic; /* Magic number. */ u_int32_t bt_version; /* Version number. */ }; /* Queue statistics structure. */ struct __db_qam_stat { u_int32_t qs_magic; /* Magic number. */ u_int32_t qs_version; /* Version number. */ u_int32_t qs_metaflags; /* Metadata flags. */ u_int32_t qs_nrecs; /* Number of records. */ u_int32_t qs_pages; /* Data pages. */ u_int32_t qs_pagesize; /* Page size. */ u_int32_t qs_pgfree; /* Bytes free in data pages. */ u_int32_t qs_re_len; /* Fixed-length record length. */ u_int32_t qs_re_pad; /* Fixed-length record pad. */ u_int32_t qs_start; /* Start offset. */ u_int32_t qs_first_recno; /* First not deleted record. */ u_int32_t qs_cur_recno; /* Last allocated record number. */ }; /* Hash statistics structure. */ struct __db_h_stat { u_int32_t hash_magic; /* Magic number. */ u_int32_t hash_version; /* Version number. */ u_int32_t hash_metaflags; /* Metadata flags. */ u_int32_t hash_pagesize; /* Page size. */ u_int32_t hash_nelem; /* Original nelem specified. */ u_int32_t hash_ffactor; /* Fill factor specified at create. */ u_int32_t hash_nrecs; /* Number of records. */ u_int32_t hash_buckets; /* Number of hash buckets. */ u_int32_t hash_free; /* Pages on the free list. */ u_int32_t hash_bfree; /* Bytes free on bucket pages. */ u_int32_t hash_bigpages; /* Number of big key/data pages. */ u_int32_t hash_big_bfree; /* Bytes free on big item pages. */ u_int32_t hash_overflows; /* Number of overflow pages. */ u_int32_t hash_ovfl_free; /* Bytes free on ovfl pages. */ u_int32_t hash_dup; /* Number of dup pages. */ u_int32_t hash_dup_free; /* Bytes free on duplicate pages. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_db_create __P((DB **, DB_ENV *, u_int32_t)); int CDB_db_env_create __P((DB_ENV **, u_int32_t)); char *CDB_db_strerror __P((int)); char *CDB_db_version __P((int *, int *, int *)); #if defined(__cplusplus) } #endif /******************************************************* * Locking *******************************************************/ #define DB_LOCKVERSION 1 /* Flag values for CDB_lock_vec(), CDB_lock_get(). */ #define DB_LOCK_NOWAIT 0x01 /* Don't wait on unavailable lock. */ #define DB_LOCK_RECORD 0x02 /* Internal: record lock. */ #define DB_LOCK_UPGRADE 0x04 /* Internal: upgrade existing lock. */ /* Flag values for CDB_lock_detect(). */ #define DB_LOCK_CONFLICT 0x01 /* Run on any conflict. */ /* * Request types. * * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_LOCK_DUMP=0, /* Display held locks. */ DB_LOCK_GET, /* Get the lock. */ DB_LOCK_INHERIT, /* Pass locks to parent. */ DB_LOCK_PUT, /* Release the lock. */ DB_LOCK_PUT_ALL, /* Release locker's locks. */ DB_LOCK_PUT_OBJ /* Release locker's locks on obj. */ } db_lockop_t; /* * Simple R/W lock modes and for multi-granularity intention locking. * * !!! * These values are NOT random, as they are used as an index into the lock * conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD * must be == 4. * * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_LOCK_NG=0, /* Not granted. */ DB_LOCK_READ, /* Shared/read. */ DB_LOCK_WRITE, /* Exclusive/write. */ DB_LOCK_IWRITE, /* Intent exclusive/write. */ DB_LOCK_IREAD, /* Intent to share/read. */ DB_LOCK_IWR /* Intent to read and write. */ } db_lockmode_t; /* * Status of a lock. */ typedef enum { DB_LSTAT_ABORTED, /* Lock belongs to an aborted txn. */ DB_LSTAT_ERR, /* Lock is bad. */ DB_LSTAT_FREE, /* Lock is unallocated. */ DB_LSTAT_HELD, /* Lock is currently held. */ DB_LSTAT_NOGRANT, /* Lock was not granted. */ DB_LSTAT_PENDING, /* Lock was waiting and has been * promoted; waiting for the owner * to run and upgrade it to held. */ DB_LSTAT_WAITING /* Lock is on the wait queue. */ } db_status_t; /* Lock request structure. */ struct __db_lockreq { db_lockop_t op; /* Operation. */ db_lockmode_t mode; /* Requested mode. */ u_int32_t locker; /* Locker identity. */ DBT *obj; /* Object being locked. */ DB_LOCK lock; /* Lock returned. */ }; /* * Commonly used conflict matrices. * * Standard Read/Write (or exclusive/shared) locks. */ #define DB_LOCK_RW_N 3 extern const u_int8_t CDB_db_rw_conflicts[]; /* Multi-granularity locking. */ #define DB_LOCK_RIW_N 6 extern const u_int8_t CDB_db_riw_conflicts[]; struct __db_lock_stat { u_int32_t st_lastid; /* Last allocated locker ID. */ u_int32_t st_maxlocks; /* Maximum number of locks in table. */ u_int32_t st_nmodes; /* Number of lock modes. */ u_int32_t st_nlockers; /* Number of lockers. */ u_int32_t st_maxnlockers; /* Maximum number of lockers. */ u_int32_t st_nconflicts; /* Number of lock conflicts. */ u_int32_t st_nrequests; /* Number of lock gets. */ u_int32_t st_nreleases; /* Number of lock puts. */ u_int32_t st_ndeadlocks; /* Number of lock deadlocks. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *)); int CDB_lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)); int CDB_lock_id __P((DB_ENV *, u_int32_t *)); int CDB_lock_put __P((DB_ENV *, DB_LOCK *)); int CDB_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, void *(*)(size_t))); int CDB_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); #if defined(__cplusplus) } #endif /******************************************************* * Logging. *******************************************************/ /* Flag values for CDB_log_archive(). */ #define DB_ARCH_ABS 0x001 /* Absolute pathnames. */ #define DB_ARCH_DATA 0x002 /* Data files. */ #define DB_ARCH_LOG 0x004 /* Log files. */ /* * A DB_LSN has two parts, a fileid which identifies a specific file, and an * offset within that file. The fileid is an unsigned 4-byte quantity that * uniquely identifies a file within the log directory -- currently a simple * counter inside the log. The offset is also an unsigned 4-byte value. The * log manager guarantees the offset is never more than 4 bytes by switching * to a new log file before the maximum length imposed by an unsigned 4-byte * offset is reached. */ struct __db_lsn { u_int32_t file; /* File ID. */ u_int32_t offset; /* File offset. */ }; /* Log statistics structure. */ struct __db_log_stat { u_int32_t st_magic; /* Log file magic number. */ u_int32_t st_version; /* Log file version number. */ int st_mode; /* Log file mode. */ u_int32_t st_lg_bsize; /* Log buffer size. */ u_int32_t st_lg_max; /* Maximum log file size. */ u_int32_t st_w_bytes; /* Bytes to log. */ u_int32_t st_w_mbytes; /* Megabytes to log. */ u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */ u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint. */ u_int32_t st_wcount; /* Total writes to the log. */ u_int32_t st_wcount_fill; /* Overflow writes to the log. */ u_int32_t st_scount; /* Total syncs to the log. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_cur_file; /* Current log file number. */ u_int32_t st_cur_offset; /* Current log file offset. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_log_archive __P((DB_ENV *, char **[], u_int32_t, void *(*)(size_t))); int CDB_log_compare __P((const DB_LSN *, const DB_LSN *)); int CDB_log_file __P((DB_ENV *, const DB_LSN *, char *, size_t)); int CDB_log_flush __P((DB_ENV *, const DB_LSN *)); int CDB_log_get __P((DB_ENV *, DB_LSN *, DBT *, u_int32_t)); int CDB_log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); int CDB_log_register __P((DB_ENV *, DB *, const char *, int32_t *)); int CDB_log_stat __P((DB_ENV *, DB_LOG_STAT **, void *(*)(size_t))); int CDB_log_unregister __P((DB_ENV *, int32_t)); #if defined(__cplusplus) } #endif /******************************************************* * Mpool *******************************************************/ /* Flag values for CDB_memp_fget(). */ #define DB_MPOOL_CREATE 0x001 /* Create a page. */ #define DB_MPOOL_LAST 0x002 /* Return the last page. */ #define DB_MPOOL_NEW 0x004 /* Create a new page. */ #define DB_MPOOL_NEW_GROUP 0x008 /* Create a group of pages. */ /* Flag values for CDB_memp_fput(), CDB_memp_fset(). */ #define DB_MPOOL_CLEAN 0x001 /* Page is not modified. */ #define DB_MPOOL_DIRTY 0x002 /* Page is modified. */ #define DB_MPOOL_DISCARD 0x004 /* Don't cache the page. */ /* Mpool statistics structure. */ struct __db_mpool_stat { u_int32_t st_cache_hit; /* Pages found in the cache. */ u_int32_t st_cache_miss; /* Pages not found in the cache. */ u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_page_create; /* Pages created in the cache. */ u_int32_t st_page_in; /* Pages read in. */ u_int32_t st_page_out; /* Pages written out. */ u_int32_t st_ro_evict; /* Clean pages forced from the cache. */ u_int32_t st_rw_evict; /* Dirty pages forced from the cache. */ u_int32_t st_hash_buckets; /* Number of hash buckets. */ u_int32_t st_hash_searches; /* Total hash chain searches. */ u_int32_t st_hash_longest; /* Longest hash chain searched. */ u_int32_t st_hash_examined; /* Total hash entries searched. */ u_int32_t st_page_clean; /* Clean pages. */ u_int32_t st_page_dirty; /* Dirty pages. */ u_int32_t st_page_trickle; /* Pages written by CDB_memp_trickle. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ u_int32_t st_gbytes; /* Cache size: GB. */ u_int32_t st_bytes; /* Cache size: B. */ }; /* Mpool file open information structure. */ struct __db_mpool_finfo { int ftype; /* File type. */ DBT *pgcookie; /* Byte-string passed to pgin/pgout. */ u_int8_t *fileid; /* Unique file ID. */ int32_t lsn_offset; /* LSN offset in page. */ u_int32_t clear_len; /* Cleared length on created pages. */ }; /* Mpool file statistics structure. */ struct __db_mpool_fstat { char *file_name; /* File name. */ size_t st_pagesize; /* Page size. */ u_int32_t st_cache_hit; /* Pages found in the cache. */ u_int32_t st_cache_miss; /* Pages not found in the cache. */ u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_page_create; /* Pages created in the cache. */ u_int32_t st_page_in; /* Pages read in. */ u_int32_t st_page_out; /* Pages written out. */ }; #if defined(__cplusplus) extern "C" { #endif #if defined(__cplusplus) } #endif #if defined(__cplusplus) extern "C" { #endif int CDB_memp_fclose __P((DB_MPOOLFILE *)); int CDB_memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); int CDB_memp_fopen __P((DB_ENV *, const char *, u_int32_t, int, size_t, DB_MPOOL_FINFO *, DB_MPOOLFILE **)); int CDB_memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t)); int CDB_memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t)); int CDB_memp_fsync __P((DB_MPOOLFILE *)); int CDB_memp_register __P((DB_ENV *, int, int (*)(db_pgno_t, void *, DBT *), int (*)(db_pgno_t, void *, DBT *))); int CDB_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, void *(*)(size_t))); int CDB_memp_sync __P((DB_ENV *, DB_LSN *)); int CDB_memp_trickle __P((DB_ENV *, int, int *)); #if defined(__cplusplus) } #endif /******************************************************* * Transactions. *******************************************************/ #define DB_TXNVERSION 1 /* Operations values to the tx_recover() function. */ #define DB_TXN_BACKWARD_ROLL 1 /* Read the log backwards. */ #define DB_TXN_FORWARD_ROLL 2 /* Read the log forwards. */ #define DB_TXN_OPENFILES 3 /* Read for open files. */ #define DB_TXN_REDO 4 /* Redo the operation. */ #define DB_TXN_UNDO 5 /* Undo the operation. */ /* Internal transaction status values. */ /* Transaction statistics structure. */ struct __db_txn_active { u_int32_t txnid; /* Transaction ID */ u_int32_t parentid; /* Transaction ID of parent */ DB_LSN lsn; /* Lsn of the begin record */ }; struct __db_txn_stat { DB_LSN st_last_ckp; /* lsn of the last checkpoint */ DB_LSN st_pending_ckp; /* last checkpoint did not finish */ time_t st_time_ckp; /* time of last checkpoint */ u_int32_t st_last_txnid; /* last transaction id given out */ u_int32_t st_maxtxns; /* maximum txns possible */ u_int32_t st_naborts; /* number of aborted transactions */ u_int32_t st_nbegins; /* number of begun transactions */ u_int32_t st_ncommits; /* number of committed transactions */ u_int32_t st_nactive; /* number of active transactions */ u_int32_t st_maxnactive; /* maximum active transactions */ DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_txn_abort __P((DB_TXN *)); int CDB_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); int CDB_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t)); int CDB_txn_commit __P((DB_TXN *, u_int32_t)); u_int32_t CDB_txn_id __P((DB_TXN *)); int CDB_txn_prepare __P((DB_TXN *)); int CDB_txn_stat __P((DB_ENV *, DB_TXN_STAT **, void *(*)(size_t))); #if defined(__cplusplus) } #endif #ifndef DB_DBM_HSEARCH #define DB_DBM_HSEARCH 0 /* No historic interfaces by default. */ #endif #if DB_DBM_HSEARCH != 0 /******************************************************* * Dbm/Ndbm historic interfaces. *******************************************************/ #define DBM_INSERT 0 /* Flags to dbm_store(). */ #define DBM_REPLACE 1 /* * The DB support for ndbm(3) always appends this suffix to the * file name to avoid overwriting the user's original database. */ #define DBM_SUFFIX ".db" #if defined(_XPG4_2) typedef struct { char *dptr; size_t dsize; } datum; #else typedef struct { char *dptr; int dsize; } datum; #endif /* * Translate DBM calls into DB calls so that DB doesn't step on the * application's name space. * * The global variables dbrdonly, dirf and pagf were not retained when 4BSD * replaced the dbm interface with ndbm, and are not supported here. */ #define dbminit(a) __db_dbm_init(a) #define dbmclose __db_dbm_close #if !defined(__cplusplus) #define delete(a) __db_dbm_delete(a) #endif #define fetch(a) __db_dbm_fetch(a) #define firstkey __db_dbm_firstkey #define nextkey(a) __db_dbm_nextkey(a) #define store(a, b) __db_dbm_store(a, b) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_dbm_close __P((void)); int __db_dbm_dbrdonly __P((void)); int __db_dbm_delete __P((datum)); int __db_dbm_dirf __P((void)); datum __db_dbm_fetch __P((datum)); datum __db_dbm_firstkey __P((void)); int __db_dbm_init __P((char *)); datum __db_dbm_nextkey __P((datum)); int __db_dbm_pagf __P((void)); int __db_dbm_store __P((datum, datum)); #if defined(__cplusplus) } #endif /* * Translate NDBM calls into DB calls so that DB doesn't step on the * application's name space. */ #define dbm_clearerr(a) __db_ndbm_clearerr(a) #define dbm_close(a) __db_ndbm_close(a) #define dbm_delete(a, b) __db_ndbm_delete(a, b) #define dbm_dirfno(a) __db_ndbm_dirfno(a) #define dbm_error(a) __db_ndbm_error(a) #define dbm_fetch(a, b) __db_ndbm_fetch(a, b) #define dbm_firstkey(a) __db_ndbm_firstkey(a) #define dbm_nextkey(a) __db_ndbm_nextkey(a) #define dbm_open(a, b, c) __db_ndbm_open(a, b, c) #define dbm_pagfno(a) __db_ndbm_pagfno(a) #define dbm_rdonly(a) __db_ndbm_rdonly(a) #define dbm_store(a, b, c, d) __db_ndbm_store(a, b, c, d) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_ndbm_clearerr __P((DBM *)); void __db_ndbm_close __P((DBM *)); int __db_ndbm_delete __P((DBM *, datum)); int __db_ndbm_dirfno __P((DBM *)); int __db_ndbm_error __P((DBM *)); datum __db_ndbm_fetch __P((DBM *, datum)); datum __db_ndbm_firstkey __P((DBM *)); datum __db_ndbm_nextkey __P((DBM *)); DBM *__db_ndbm_open __P((const char *, int, int)); int __db_ndbm_pagfno __P((DBM *)); int __db_ndbm_rdonly __P((DBM *)); int __db_ndbm_store __P((DBM *, datum, datum, int)); #if defined(__cplusplus) } #endif /******************************************************* * Hsearch historic interface. *******************************************************/ typedef enum { FIND, ENTER } ACTION; typedef struct entry { char *key; char *data; } ENTRY; /* * Translate HSEARCH calls into DB calls so that DB doesn't step on the * application's name space. */ #define hcreate(a) __db_hcreate(a) #define hdestroy __db_hdestroy #define hsearch(a, b) __db_hsearch(a, b) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_hcreate __P((size_t)); void __db_hdestroy __P((void)); ENTRY *__db_hsearch __P((ENTRY, ACTION)); #if defined(__cplusplus) } #endif #endif /* DB_DBM_HSEARCH */ /* * XXX * MacOS: Reset Metrowerks C enum sizes. */ #ifdef __MWERKS__ #pragma enumsalwaysint reset #endif #endif /* !_DB_H_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db.h.win32�������������������������������������������������������������������������0100644�0063146�0012731�00000132510�10000513627�014443� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Part of the ht://Dig package <http://www.htdig.org/> */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later or later */ /* <http://www.gnu.org/copyleft/lgpl.html> */ /* BDB db.h header file for the Native WIN32 MSVC Platform */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db.src 11.20 (Sleepycat) 10/28/99 */ /* WIN32 - MSVC++ Version */ #ifndef _DB_H_ #define _DB_H_ #ifndef __NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #ifdef _MSC_VER /* _WIN32 */ #include <windows.h> #define snprintf _snprintf #define vsnprintf _vsnprintf typedef unsigned char u_int8_t; typedef short int16_t; typedef unsigned short u_int16_t; typedef int int32_t; typedef unsigned int u_int32_t; typedef long int64_t; typedef unsigned long u_int64_t; typedef int32_t register_t; typedef unsigned long ssize_t; #endif #include <stdio.h> #endif /* * XXX * MacOS: ensure that Metrowerks C makes enumeration types int sized. */ #ifdef __MWERKS__ #pragma enumsalwaysint on #endif /* * XXX * Handle function prototypes and the keyword "const". This steps on name * space that DB doesn't control, but all of the other solutions are worse. * * XXX * While Microsoft's compiler is ANSI C compliant, it doesn't have _STDC_ * defined by default, you specify a command line flag or #pragma to turn * it on. Don't do that, however, because some of Microsoft's own header * files won't compile. */ #undef __P #if defined(__STDC__) || defined(__cplusplus) || defined(_MSC_VER) #define __P(protos) protos /* ANSI C prototypes */ #else #define const #define __P(protos) () /* K&R C preprocessor */ #endif /* * !!! * DB needs basic information about specifically sized types. If they're * not provided by the system, typedef them here. * * We protect them against multiple inclusion using __BIT_TYPES_DEFINED__, * as does BIND and Kerberos, since we don't know for sure what #include * files the user is using. * * !!! * We also provide the standard u_int, u_long etc., if they're not provided * by the system. */ #ifndef _MSC_VER /* WIN32 */ #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ @u_int8_decl@ @int16_decl@ @u_int16_decl@ @int32_decl@ @u_int32_decl@ #endif @u_char_decl@ @u_short_decl@ @u_int_decl@ @u_long_decl@ @ssize_t_decl@ #endif /* _MSC_VER - WIN32 */ #define DB_VERSION_MAJOR 3 #define DB_VERSION_MINOR 0 #define DB_VERSION_PATCH 55 #define DB_VERSION_STRING "Sleepycat Software: Berkeley DB 3.0.55: (February 28, 2000)" typedef u_int32_t db_pgno_t; /* Page number type. */ typedef u_int16_t db_indx_t; /* Page offset type. */ #define DB_MAX_PAGES 0xffffffff /* >= # of pages in a file */ typedef u_int32_t db_recno_t; /* Record number type. */ #define DB_MAX_RECORDS 0xffffffff /* >= # of records in a tree */ /* Forward structure declarations, so applications get type checking. */ struct __db; typedef struct __db DB; #ifdef DB_DBM_HSEARCH typedef struct __db DBM; #endif struct __db_bt_stat; typedef struct __db_bt_stat DB_BTREE_STAT; struct __db_dbt; typedef struct __db_dbt DBT; struct __db_env; typedef struct __db_env DB_ENV; struct __db_h_stat; typedef struct __db_h_stat DB_HASH_STAT; struct __db_ilock; typedef struct __db_ilock DB_LOCK_ILOCK; struct __db_lock_stat; typedef struct __db_lock_stat DB_LOCK_STAT; struct __db_lock_u; typedef struct __db_lock_u DB_LOCK; struct __db_lockreq; typedef struct __db_lockreq DB_LOCKREQ; struct __db_log_stat; typedef struct __db_log_stat DB_LOG_STAT; struct __db_lsn; typedef struct __db_lsn DB_LSN; struct __db_mpool_finfo;typedef struct __db_mpool_finfo DB_MPOOL_FINFO; struct __db_mpool_fstat;typedef struct __db_mpool_fstat DB_MPOOL_FSTAT; struct __db_mpool_stat; typedef struct __db_mpool_stat DB_MPOOL_STAT; struct __db_mpoolfile; typedef struct __db_mpoolfile DB_MPOOLFILE; struct __db_qam_stat; typedef struct __db_qam_stat DB_QUEUE_STAT; struct __db_txn; typedef struct __db_txn DB_TXN; struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE; struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT; struct __dbc; typedef struct __dbc DBC; struct __fh_t; typedef struct __fh_t DB_FH; struct __db_cmpr_info; typedef struct __db_cmpr_info DB_CMPR_INFO; /* Key/data structure -- a Data-Base Thang. */ struct __db_dbt { void *data; /* key/data */ u_int32_t size; /* key/data length */ u_int32_t ulen; /* RO: length of user buffer. */ u_int32_t dlen; /* RO: get/put record length. */ u_int32_t doff; /* RO: get/put record offset. */ #define DB_DBT_INTERNAL 0x001 /* Ignore user's malloc (internal). */ #define DB_DBT_MALLOC 0x002 /* Return in malloc'd memory. */ #define DB_DBT_PARTIAL 0x004 /* Partial put/get. */ #define DB_DBT_REALLOC 0x008 /* Return in realloc'd memory. */ #define DB_DBT_USERMEM 0x010 /* Return in user's memory. */ u_int32_t flags; }; /* * Information from user specified page compression */ struct __db_cmpr_info { int (*compress) /* Compression function */ __P((const u_int8_t*, int, u_int8_t**, int*,void *)); int (*uncompress) /* Uncompression function */ __P((const u_int8_t*, int, u_int8_t*, int,void *)); u_int8_t coefficient; /* Compression factor is 1<<coefficient */ u_int8_t max_npages; /* Max number of pages worst case */ u_int8_t zlib_flags; /* Zlib Compresson Level */ void *user_data; /* Persistent information for compression functions */ }; /* * Flags understood by both CDB_db_create and CDB_db_env_create. */ #define DB_CXX_NO_EXCEPTIONS 0x000001 /* C++: return error values. */ /* * Flags understood by only CDB_db_create. */ #define DB_XA_CREATE 0x000002 /* Open in an XA environment. */ /* * Flags understood by both DBENV->open and DB->open. */ #define DB_CREATE 0x000001 /* Create file as necessary. */ #define DB_NOMMAP 0x000002 /* Don't mmap underlying file. */ #define DB_THREAD 0x000004 /* Applications are threaded. */ /* * Flags understood by both DBENV->open and DBENV->remove. */ #define DB_FORCE 0x000008 /* Force (anything). */ #define DB_INIT_CDB 0x000010 /* Concurrent Access Methods. */ #define DB_INIT_LOCK 0x000020 /* Initialize locking. */ #define DB_INIT_LOG 0x000040 /* Initialize logging. */ #define DB_INIT_MPOOL 0x000080 /* Initialize mpool. */ #define DB_INIT_TXN 0x000100 /* Initialize transactions. */ #define DB_RECOVER 0x000200 /* Run normal recovery. */ #define DB_RECOVER_FATAL 0x000400 /* Run catastrophic recovery. */ #define DB_SYSTEM_MEM 0x000800 /* Use system-backed memory. */ #define DB_TXN_NOSYNC 0x001000 /* Do not sync log on commit. */ #define DB_USE_ENVIRON 0x002000 /* Use the environment. */ #define DB_USE_ENVIRON_ROOT 0x004000 /* Use the environment if root. */ /* * Flags understood by only DBENV->open. */ #define DB_LOCKDOWN 0x008000 /* Lock memory into physical core. */ #define DB_PRIVATE 0x010000 /* DB_ENV is process local. */ /* * Flags understood by DBENV->CDB_txn_begin. */ /* DB_TXN_NOSYNC 0x001000 Do not sync log on commit. */ #define DB_TXN_SYNC 0x000001 /* Always sync log on commit. */ #define DB_TXN_NOWAIT 0x000002 /* Do not wait for locks in this TXN. */ /* * Flags understood by only DB->open. */ #define DB_EXCL 0x000008 /* Exclusive open (O_EXCL). */ #define DB_RDONLY 0x000010 /* Read-only (O_RDONLY). */ #define DB_TRUNCATE 0x000020 /* Discard existing DB (O_TRUNC). */ #define DB_FCNTL_LOCKING 0x000040 /* Undocumented: fcntl(2) locking. */ #define DB_COMPRESS 0x000080 /* Transparent I/O compression */ /* * Flags understood by only DB->set_feedback's callback. */ /* DB_RECOVER 0x000200 Running recovery. */ #define DB_UPGRADE 0x000001 /* Upgrading. */ /* * Deadlock detector modes; used in the DBENV structure to configure the * locking subsystem. */ #define DB_LOCK_NORUN 0 #define DB_LOCK_DEFAULT 1 /* Default policy. */ #define DB_LOCK_OLDEST 2 /* Abort oldest transaction. */ #define DB_LOCK_RANDOM 3 /* Abort random transaction. */ #define DB_LOCK_YOUNGEST 4 /* Abort youngest transaction. */ /* * Flags understood by only DB->set_flags. */ #define DB_DUP 0x0001 /* Btree, Hash: duplicate keys. */ #define DB_DUPSORT 0x0002 /* Btree, Hash: duplicate keys. */ #define DB_RECNUM 0x0004 /* Btree: record numbers. */ #define DB_RENUMBER 0x0008 /* Recno: renumber on insert/delete. */ #define DB_REVSPLITOFF 0x0010 /* Btree: turn off reverse splits. */ #define DB_SNAPSHOT 0x0020 /* Recno: snapshot the input. */ struct __db_env { /******************************************************* * Public: owned by the application. *******************************************************/ FILE *db_errfile; /* Error message file stream. */ const char *db_errpfx; /* Error message prefix. */ /* Callbacks. */ void (*db_errcall) __P((const char *, char *)); void (*db_feedback) __P((DB_ENV *, int, int)); void (*db_paniccall) __P((DB_ENV *, int)); int (*db_recovery_init) __P((DB_ENV *)); /* * Currently, the verbose list is a bit field with room for 32 * entries. There's no reason that it needs to be limited, if * there are ever more than 32 entries, convert to a bit array. */ #define DB_VERB_CHKPOINT 0x0001 /* List checkpoints. */ #define DB_VERB_DEADLOCK 0x0002 /* Deadlock detection information. */ #define DB_VERB_RECOVERY 0x0004 /* Recovery information. */ #define DB_VERB_WAITSFOR 0x0008 /* Dump waits-for table. */ u_int32_t verbose; /* Verbose output. */ /* Locking. */ u_int8_t *lk_conflicts; /* Two dimensional conflict matrix. */ u_int32_t lk_modes; /* Number of lock modes in table. */ u_int32_t lk_max; /* Maximum number of locks. */ u_int32_t lk_detect; /* Deadlock detect on all conflicts. */ /* Logging. */ u_int32_t lg_bsize; /* Buffer size. */ u_int32_t lg_max; /* Maximum file size. */ /* Memory pool. */ u_int32_t mp_gbytes; /* Cachesize: GB. */ u_int32_t mp_bytes; /* Cachesize: Bytes. */ size_t mp_size; /* DEPRECATED: Cachesize: bytes. */ int mp_ncache; /* Number of cache regions. */ size_t mp_mmapsize; /* Maximum file size for mmap. */ DB_CMPR_INFO * mp_cmpr_info; /* Compression info. */ /* Transactions. */ u_int32_t tx_max; /* Maximum number of transactions. */ int (*tx_recover) /* Dispatch function for recovery. */ __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); /******************************************************* * Private: owned by DB. *******************************************************/ int db_panic; /* Panic causing errno. */ /* User files, paths. */ char *db_home; /* Database home. */ char *db_log_dir; /* Database log file directory. */ char *db_tmp_dir; /* Database tmp file directory. */ char **db_data_dir; /* Database data file directories. */ int data_cnt; /* Database data file slots. */ int data_next; /* Next Database data file slot. */ int db_mode; /* Default open permissions. */ void *reginfo; /* REGINFO structure reference. */ DB_FH *lockfhp; /* Fcntl(2) locking file handle. */ void *lg_handle; /* Log handle. */ void *lk_handle; /* Lock handle. */ void *mp_handle; /* Mpool handle. */ void *tx_handle; /* Txn handle. */ int (**dtab) /* Dispatch table */ __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); size_t dtab_size; /* Slots in the dispatch table. */ /* * XA support. * * !!! * Explicit representations of structures in queue.h. * * TAILQ_ENTRY(__db_env); */ struct { struct __db_env *tqe_next; struct __db_env **tqe_prev; } links; int xa_rmid; /* XA Resource Manager ID. */ DB_TXN *xa_txn; /* XA Current transaction. */ void *cj_internal; /* C++/Java private. */ /* Methods. */ int (*close) __P((DB_ENV *, u_int32_t)); void (*err) __P((const DB_ENV *, int, const char *, ...)); void (*errx) __P((const DB_ENV *, const char *, ...)); int (*open) __P((DB_ENV *, const char *, char * const *, u_int32_t, int)); int (*remove) __P((DB_ENV *, const char *, char * const *, u_int32_t)); void (*set_errcall) __P((DB_ENV *, void (*)(const char *, char *))); void (*set_errfile) __P((DB_ENV *, FILE *)); void (*set_errpfx) __P((DB_ENV *, const char *)); void (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*set_recovery_init) __P((DB_ENV *, int (*)(DB_ENV *))); int (*set_mutexlocks) __P((DB_ENV *, int)); int (*set_pageyield) __P((DB_ENV *, int)); int (*set_panic) __P((DB_ENV *, int)); void (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); int (*set_region_init) __P((DB_ENV *, int)); int (*set_tas_spins) __P((DB_ENV *, u_int32_t)); int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); int (*set_lg_bsize) __P((DB_ENV *, u_int32_t)); int (*set_lg_max) __P((DB_ENV *, u_int32_t)); int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); int (*set_lk_max) __P((DB_ENV *, u_int32_t)); int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); int (*set_tx_max) __P((DB_ENV *, u_int32_t)); int (*set_tx_recover) __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, int, void *))); int (*set_func_close) __P((DB_ENV *, int (*)(int))); int (*set_func_dirfree) __P((DB_ENV *, void (*)(char **, int))); int (*set_func_dirlist) __P((DB_ENV *, int (*)(const char *, char ***, int *))); int (*set_func_exists) __P((DB_ENV *, int (*)(const char *, int *))); int (*set_func_free) __P((DB_ENV *, void (*)(void *))); int (*set_func_fsync) __P((DB_ENV *, int (*)(int))); int (*set_func_ioinfo) __P((DB_ENV *, int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *))); int (*set_func_malloc) __P((DB_ENV *, void *(*)(size_t))); int (*set_func_map) __P((DB_ENV *, int (*)(char *, size_t, int, int, void **))); int (*set_func_open) __P((DB_ENV *, int (*)(const char *, int, ...))); int (*set_func_read) __P((DB_ENV *, ssize_t (*)(int, void *, size_t))); int (*set_func_realloc) __P((DB_ENV *, void *(*)(void *, size_t))); int (*set_func_rename) __P((DB_ENV *, int (*)(const char *, const char *))); int (*set_func_seek) __P((DB_ENV *, int (*)(int, size_t, db_pgno_t, u_int32_t, int, int))); int (*set_func_sleep) __P((DB_ENV *, int (*)(u_long, u_long))); int (*set_func_unlink) __P((DB_ENV *, int (*)(const char *))); int (*set_func_unmap) __P((DB_ENV *, int (*)(void *, size_t))); int (*set_func_write) __P((DB_ENV *, ssize_t (*)(int, const void *, size_t))); int (*set_func_yield) __P((DB_ENV *, int (*)(void))); #ifdef CONFIG_TEST #define DB_TEST_PREOPEN 1 /* before CDB___os_open */ #define DB_TEST_POSTOPEN 2 /* after CDB___os_open */ #define DB_TEST_POSTLOGMETA 3 /* after logging meta in btree */ #define DB_TEST_POSTLOG 4 /* after logging all pages */ #define DB_TEST_POSTSYNC 5 /* after syncing the log */ #define DB_TEST_PRERENAME 6 /* before CDB___os_rename */ #define DB_TEST_POSTRENAME 7 /* after CDB___os_rename */ int test_abort; /* Abort value for testing. */ int test_copy; /* Copy value for testing. */ #endif #define DB_ENV_CDB 0x00001 /* DB_INIT_CDB. */ #define DB_ENV_CREATE 0x00002 /* DB_CREATE set. */ #define DB_ENV_DBLOCAL 0x00004 /* DB_ENV allocated for private DB. */ #define DB_ENV_LOCKDOWN 0x00008 /* DB_LOCKDOWN set. */ #define DB_ENV_LOCKING 0x00010 /* Locking initialized. */ #define DB_ENV_LOGGING 0x00020 /* Logging initialized. */ #define DB_ENV_NOMMAP 0x00040 /* DB_NOMMAP set. */ #define DB_ENV_OPEN_CALLED 0x00080 /* DBENV->open called (paths valid). */ #define DB_ENV_PRIVATE 0x00100 /* DB_PRIVATE set. */ #define DB_ENV_STANDALONE 0x00200 /* Test: freestanding environment. */ #define DB_ENV_SYSTEM_MEM 0x00400 /* DB_SYSTEM_MEM set. */ #define DB_ENV_THREAD 0x00800 /* DB_THREAD set. */ #define DB_ENV_TXN 0x01000 /* DB_TXN_NOSYNC set. */ #define DB_ENV_TXN_NOSYNC 0x02000 /* DB_TXN_NOSYNC set. */ #define DB_ENV_USER_ALLOC 0x04000 /* User allocated the structure. */ u_int32_t flags; /* Flags. */ }; /******************************************************* * Access methods. *******************************************************/ /* * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_BTREE=1, DB_HASH, DB_RECNO, DB_QUEUE, DB_UNKNOWN /* Figure it out on open. */ } DBTYPE; #define DB_BTREEVERSION 7 /* Current btree version. */ #define DB_BTREEOLDVER 6 /* Oldest btree version supported. */ #define DB_BTREEMAGIC 0x053162 #define DB_HASHVERSION 6 /* Current hash version. */ #define DB_HASHOLDVER 4 /* Oldest hash version supported. */ #define DB_HASHMAGIC 0x061561 #define DB_QAMVERSION 1 /* Current queue version. */ #define DB_QAMOLDVER 1 /* Oldest queue version supported. */ #define DB_QAMMAGIC 0x042253 #define DB_LOGVERSION 2 /* Current log version. */ #define DB_LOGOLDVER 2 /* Oldest log version supported. */ #define DB_LOGMAGIC 0x040988 /* * DB access method and cursor operation values. Each value is an operation * code to which additional bit flags are added. */ #define DB_AFTER 1 /* c_put() */ #define DB_APPEND 2 /* put() */ #define DB_BEFORE 3 /* c_put() */ #define DB_CHECKPOINT 4 /* CDB_log_put(), CDB_log_get() */ #define DB_CONSUME 5 /* c_get() */ #define DB_CURLSN 6 /* CDB_log_put() */ #define DB_CURRENT 7 /* c_get(), c_put(), CDB_log_get() */ #define DB_DUPCURSOR 8 /* cursor() (internal) */ #define DB_FIRST 9 /* c_get(), CDB_log_get() */ #define DB_FLUSH 10 /* CDB_log_put() */ #define DB_GET_BOTH 11 /* get(), c_get() */ #define DB_GET_RECNO 12 /* c_get() */ #define DB_JOIN_ITEM 13 /* c_get(); do not do primary lookup */ #define DB_KEYFIRST 14 /* c_put() */ #define DB_KEYLAST 15 /* c_put() */ #define DB_LAST 16 /* c_get(), CDB_log_get() */ #define DB_NEXT 17 /* c_get(), CDB_log_get() */ #define DB_NEXT_DUP 18 /* c_get() */ #define DB_NEXT_NODUP 19 /* c_get() */ #define DB_NOOVERWRITE 20 /* put() */ #define DB_NOSYNC 21 /* close() */ #define DB_POSITION 22 /* c_dup() */ #define DB_POSITIONI 23 /* c_dup() (internal) */ #define DB_PREV 24 /* c_get(), CDB_log_get() */ #define DB_RECORDCOUNT 25 /* stat() */ #define DB_SET 26 /* c_get(), CDB_log_get() */ #define DB_SET_RANGE 27 /* c_get() */ #define DB_SET_RECNO 28 /* get(), c_get() */ #define DB_WRITECURSOR 29 /* cursor() */ #define DB_WRITELOCK 30 /* cursor() (internal) */ /* This has to change when the max opcode above hits 32. */ #define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags. */ #define DB_RMW 0x80000000 /* Acquire write flag immediately. */ /* * DB (user visible) error return codes. * * !!! * Changes to any of the user visible error return codes must be reflected * in java/src/com/sleepycat/db/Db.java. * * !!! * For source compatibility with DB 2.X deadlock return (EAGAIN), use the * following: * #include <errno.h> * #define DB_LOCK_DEADLOCK EAGAIN * * !!! * We don't want our error returns to conflict with other packages where * possible, so pick a base error value that's hopefully not common. */ #define DB_INCOMPLETE (-30999)/* Sync didn't finish. */ #define DB_KEYEMPTY (-30998)/* Key/data deleted or never created. */ #define DB_KEYEXIST (-30997)/* The key/data pair already exists. */ #define DB_LOCK_DEADLOCK (-30996)/* Deadlock. */ #define DB_LOCK_NOTGRANTED (-30995)/* Lock unavailable. */ #define DB_NOTFOUND (-30994)/* Key/data pair not found (EOF). */ #define DB_OLD_VERSION (-30993)/* Out-of-date version. */ #define DB_RUNRECOVERY (-30992)/* Panic return. */ /* DB (private) error return codes. */ #define DB_DELETED (-30991)/* Recovery file marked deleted. */ #define DB_NEEDSPLIT (-30990)/* Page needs to be split. */ #define DB_SWAPBYTES (-30989)/* Database needs byte swapping. */ #define DB_TXN_CKP (-30988)/* Encountered ckp record in log. */ #define DB_FILE_ID_LEN 20 /* DB file ID length. */ /* DB access method description structure. */ struct __db { /******************************************************* * Public: owned by the application. *******************************************************/ size_t pgsize; /* Database logical page size. */ /* Callbacks. */ void (*db_feedback) __P((DB *, int, int)); void *(*db_malloc) __P((size_t)); void *(*db_realloc) __P((void *, size_t)); int (*dup_compare) __P((const DBT *, const DBT *)); /******************************************************* * Private: owned by DB. *******************************************************/ DB_ENV *dbenv; /* Backing environment. */ DBTYPE type; /* DB access method type. */ DB_MPOOLFILE *mpf; /* Backing buffer pool. */ void *mutexp; /* Synchronization for free threading */ u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */ #define DB_LOGFILEID_INVALID -1 int32_t log_fileid; /* File's unique ID for logging. */ DB_TXN *open_txn; /* Transaction to protect creates. */ /* * !!! * Some applications use DB but implement their own locking outside of * DB. If they're using fcntl(2) locking on the underlying database * file, and we open and close a file descriptor for that file, we will * discard their locks. The DB_FCNTL_LOCKING flag to DB->open is an * undocumented interface to support this usage which leaves any file * descriptors we open until DB->close. This will only work with the * DB->open interface and simple caches, e.g., creating a transaction * thread may open/close file descriptors this flag doesn't protect. * Locking with fcntl(2) on a file that you don't own is a very, very * unsafe thing to do. 'Nuff said. */ DB_FH *saved_open_fhp; /* Saved file handle. */ /* * Cursor queues. * * !!! * Explicit representations of structures in queue.h. * * TAILQ_HEAD(free_queue, __dbc); * TAILQ_HEAD(active_queue, __dbc); */ struct { struct __dbc *tqh_first; struct __dbc **tqh_last; } free_queue; struct { struct __dbc *tqh_first; struct __dbc **tqh_last; } active_queue; void *bt_internal; /* Btree/Recno access method private. */ void *cj_internal; /* C++/Java private. */ void *h_internal; /* Hash access method private. */ void *q_internal; /* Queue access method private. */ void *xa_internal; /* XA private. */ /* Methods. */ int (*close) __P((DB *, u_int32_t)); int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); void (*err) __P((DB *, int, const char *, ...)); void (*errx) __P((DB *, const char *, ...)); int (*fd) __P((DB *, int *)); int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*get_byteswapped) __P((DB *)); DBTYPE (*get_type) __P((DB *)); int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); int (*open) __P((DB *, const char *, const char *, DBTYPE, u_int32_t, int)); int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*remove) __P((DB *, const char *, const char *, u_int32_t)); int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); int (*set_dup_compare) __P((DB *, int (*)(const DBT *, const DBT *))); void (*set_errcall) __P((DB *, void (*)(const char *, char *))); void (*set_errfile) __P((DB *, FILE *)); void (*set_errpfx) __P((DB *, const char *)); void (*set_feedback) __P((DB *, void (*)(DB *, int, int))); int (*set_flags) __P((DB *, u_int32_t)); int (*set_lorder) __P((DB *, int)); int (*set_malloc) __P((DB *, void *(*)(size_t))); int (*set_pagesize) __P((DB *, u_int32_t)); void (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); int (*set_realloc) __P((DB *, void *(*)(void *, size_t))); int (*stat) __P((DB *, void *, void *(*)(size_t), u_int32_t)); int (*sync) __P((DB *, u_int32_t)); int (*upgrade) __P((DB *, const char *, u_int32_t)); int (*set_bt_compare) __P((DB *, int (*)(const DBT *, const DBT *))); int (*set_bt_maxkey) __P((DB *, u_int32_t)); int (*set_bt_minkey) __P((DB *, u_int32_t)); int (*set_bt_prefix) __P((DB *, size_t (*)(const DBT *, const DBT *))); int (*set_h_ffactor) __P((DB *, u_int32_t)); int (*set_h_hash) __P((DB *, u_int32_t (*)(const void *, u_int32_t))); int (*set_h_nelem) __P((DB *, u_int32_t)); int (*set_re_delim) __P((DB *, int)); int (*set_re_len) __P((DB *, u_int32_t)); int (*set_re_pad) __P((DB *, int)); int (*set_re_source) __P((DB *, const char *)); #define DB_OK_BTREE 0x01 #define DB_OK_HASH 0x02 #define DB_OK_QUEUE 0x04 #define DB_OK_RECNO 0x08 u_int32_t am_ok; /* Legal AM choices. */ #define DB_AM_DISCARD 0x00001 /* Discard any cached pages. */ #define DB_AM_DUP 0x00002 /* DB_DUP. */ #define DB_AM_INMEM 0x00004 /* In-memory; no sync on close. */ #define DB_AM_PGDEF 0x00008 /* Page size was defaulted. */ #define DB_AM_RDONLY 0x00010 /* Database is readonly. */ #define DB_AM_SUBDB 0x00020 /* Subdatabases supported. */ #define DB_AM_SWAP 0x00040 /* Pages need to be byte-swapped. */ #define DB_BT_RECNUM 0x00080 /* DB_RECNUM. */ #define DB_BT_REVSPLIT 0x00100 /* DB_REVSPLITOFF. */ #define DB_DBM_ERROR 0x00200 /* Error in DBM/NDBM database. */ #define DB_OPEN_CALLED 0x00400 /* DB->open called. */ #define DB_RE_DELIMITER 0x00800 /* Variablen length delimiter set. */ #define DB_RE_FIXEDLEN 0x01000 /* Fixed-length records. */ #define DB_RE_PAD 0x02000 /* Fixed-length record pad. */ #define DB_RE_RENUMBER 0x04000 /* DB_RENUMBER. */ #define DB_RE_SNAPSHOT 0x08000 /* DB_SNAPSHOT. */ #define DB_AM_CMPR 0x10000 /* Transparent I/O compression */ u_int32_t flags; }; /* * DB_LOCK_ILOCK -- * Internal DB access method lock. */ struct __db_ilock { db_pgno_t pgno; /* Page being locked. */ u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */ #define DB_RECORD_LOCK 1 #define DB_PAGE_LOCK 2 u_int8_t type; /* Record or Page lock */ }; /* * DB_LOCK -- * The structure is allocated by the caller and filled in during a * CDB_lock_get request (or a CDB_lock_vec/DB_LOCK_GET). */ struct __db_lock_u { size_t off; /* Offset of the lock in the region */ u_int32_t ndx; /* Index of the object referenced by * this lock; used for locking. */ u_int32_t gen; /* Generation number of this lock. */ }; /* Cursor description structure. */ struct __dbc { DB *dbp; /* Related DB access method. */ DB_TXN *txn; /* Associated transaction. */ /* * !!! * Explicit representations of structures in queue.h. * * TAILQ_ENTRY(__dbc) links; Active/free cursor queues. */ struct { struct __dbc *tqe_next; struct __dbc **tqe_prev; } links; u_int32_t lid; /* Default process' locker id. */ u_int32_t locker; /* Locker for this operation. */ DBT lock_dbt; /* DBT referencing lock. */ DB_LOCK_ILOCK lock; /* Object to be locked. */ DB_LOCK mylock; /* Lock held on this cursor. */ DBT rkey; /* Returned key. */ DBT rdata; /* Returned data. */ int (*c_close) __P((DBC *)); /* Methods: public. */ int (*c_del) __P((DBC *, u_int32_t)); int (*c_dup) __P((DBC *, DBC **, u_int32_t)); int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_am_close) __P((DBC *)); /* Methods: private. */ int (*c_am_destroy) __P((DBC *)); void *internal; /* Access method private. */ #define DBC_CONTINUE 0x001 /* Continue dup search: next item. */ #define DBC_RECOVER 0x002 /* In recovery (do not log or lock). */ #define DBC_RMW 0x004 /* Acquire write flag in read op. */ #define DBC_WRITECURSOR 0x008 /* Cursor may be used to write (CDB). */ #define DBC_WRITER 0x010 /* Cursor immediately writing (CDB). */ u_int32_t flags; }; /* Btree/Recno statistics structure. */ struct __db_bt_stat { u_int32_t bt_metaflags; /* Metadata flags. */ u_int32_t bt_maxkey; /* Maxkey value. */ u_int32_t bt_minkey; /* Minkey value. */ u_int32_t bt_re_len; /* Fixed-length record length. */ u_int32_t bt_re_pad; /* Fixed-length record pad. */ u_int32_t bt_pagesize; /* Page size. */ u_int32_t bt_levels; /* Tree levels. */ u_int32_t bt_nrecs; /* Number of records. */ u_int32_t bt_int_pg; /* Internal pages. */ u_int32_t bt_leaf_pg; /* Leaf pages. */ u_int32_t bt_dup_pg; /* Duplicate pages. */ u_int32_t bt_over_pg; /* Overflow pages. */ u_int32_t bt_free; /* Pages on the free list. */ u_int32_t bt_int_pgfree; /* Bytes free in internal pages. */ u_int32_t bt_leaf_pgfree; /* Bytes free in leaf pages. */ u_int32_t bt_dup_pgfree; /* Bytes free in duplicate pages. */ u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */ u_int32_t bt_magic; /* Magic number. */ u_int32_t bt_version; /* Version number. */ }; /* Queue statistics structure. */ struct __db_qam_stat { u_int32_t qs_magic; /* Magic number. */ u_int32_t qs_version; /* Version number. */ u_int32_t qs_metaflags; /* Metadata flags. */ u_int32_t qs_nrecs; /* Number of records. */ u_int32_t qs_pages; /* Data pages. */ u_int32_t qs_pagesize; /* Page size. */ u_int32_t qs_pgfree; /* Bytes free in data pages. */ u_int32_t qs_re_len; /* Fixed-length record length. */ u_int32_t qs_re_pad; /* Fixed-length record pad. */ u_int32_t qs_start; /* Start offset. */ u_int32_t qs_first_recno; /* First not deleted record. */ u_int32_t qs_cur_recno; /* Last allocated record number. */ }; /* Hash statistics structure. */ struct __db_h_stat { u_int32_t hash_magic; /* Magic number. */ u_int32_t hash_version; /* Version number. */ u_int32_t hash_metaflags; /* Metadata flags. */ u_int32_t hash_pagesize; /* Page size. */ u_int32_t hash_nelem; /* Original nelem specified. */ u_int32_t hash_ffactor; /* Fill factor specified at create. */ u_int32_t hash_nrecs; /* Number of records. */ u_int32_t hash_buckets; /* Number of hash buckets. */ u_int32_t hash_free; /* Pages on the free list. */ u_int32_t hash_bfree; /* Bytes free on bucket pages. */ u_int32_t hash_bigpages; /* Number of big key/data pages. */ u_int32_t hash_big_bfree; /* Bytes free on big item pages. */ u_int32_t hash_overflows; /* Number of overflow pages. */ u_int32_t hash_ovfl_free; /* Bytes free on ovfl pages. */ u_int32_t hash_dup; /* Number of dup pages. */ u_int32_t hash_dup_free; /* Bytes free on duplicate pages. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_db_create __P((DB **, DB_ENV *, u_int32_t)); int CDB_db_env_create __P((DB_ENV **, u_int32_t)); char *CDB_db_strerror __P((int)); char *CDB_db_version __P((int *, int *, int *)); #if defined(__cplusplus) } #endif /******************************************************* * Locking *******************************************************/ #define DB_LOCKVERSION 1 /* Flag values for CDB_lock_vec(), CDB_lock_get(). */ #define DB_LOCK_NOWAIT 0x01 /* Don't wait on unavailable lock. */ #define DB_LOCK_RECORD 0x02 /* Internal: record lock. */ #define DB_LOCK_UPGRADE 0x04 /* Internal: upgrade existing lock. */ /* Flag values for CDB_lock_detect(). */ #define DB_LOCK_CONFLICT 0x01 /* Run on any conflict. */ /* * Request types. * * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_LOCK_DUMP=0, /* Display held locks. */ DB_LOCK_GET, /* Get the lock. */ DB_LOCK_INHERIT, /* Pass locks to parent. */ DB_LOCK_PUT, /* Release the lock. */ DB_LOCK_PUT_ALL, /* Release locker's locks. */ DB_LOCK_PUT_OBJ /* Release locker's locks on obj. */ } db_lockop_t; /* * Simple R/W lock modes and for multi-granularity intention locking. * * !!! * These values are NOT random, as they are used as an index into the lock * conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD * must be == 4. * * !!! * Changes here must be reflected in java/src/com/sleepycat/db/Db.java. */ typedef enum { DB_LOCK_NG=0, /* Not granted. */ DB_LOCK_READ, /* Shared/read. */ DB_LOCK_WRITE, /* Exclusive/write. */ DB_LOCK_IWRITE, /* Intent exclusive/write. */ DB_LOCK_IREAD, /* Intent to share/read. */ DB_LOCK_IWR /* Intent to read and write. */ } db_lockmode_t; /* * Status of a lock. */ typedef enum { DB_LSTAT_ABORTED, /* Lock belongs to an aborted txn. */ DB_LSTAT_ERR, /* Lock is bad. */ DB_LSTAT_FREE, /* Lock is unallocated. */ DB_LSTAT_HELD, /* Lock is currently held. */ DB_LSTAT_NOGRANT, /* Lock was not granted. */ DB_LSTAT_PENDING, /* Lock was waiting and has been * promoted; waiting for the owner * to run and upgrade it to held. */ DB_LSTAT_WAITING /* Lock is on the wait queue. */ } db_status_t; /* Lock request structure. */ struct __db_lockreq { db_lockop_t op; /* Operation. */ db_lockmode_t mode; /* Requested mode. */ u_int32_t locker; /* Locker identity. */ DBT *obj; /* Object being locked. */ DB_LOCK lock; /* Lock returned. */ }; /* * Commonly used conflict matrices. * * Standard Read/Write (or exclusive/shared) locks. */ #define DB_LOCK_RW_N 3 extern const u_int8_t CDB_db_rw_conflicts[]; /* Multi-granularity locking. */ #define DB_LOCK_RIW_N 6 extern const u_int8_t CDB_db_riw_conflicts[]; struct __db_lock_stat { u_int32_t st_lastid; /* Last allocated locker ID. */ u_int32_t st_maxlocks; /* Maximum number of locks in table. */ u_int32_t st_nmodes; /* Number of lock modes. */ u_int32_t st_nlockers; /* Number of lockers. */ u_int32_t st_maxnlockers; /* Maximum number of lockers. */ u_int32_t st_nconflicts; /* Number of lock conflicts. */ u_int32_t st_nrequests; /* Number of lock gets. */ u_int32_t st_nreleases; /* Number of lock puts. */ u_int32_t st_ndeadlocks; /* Number of lock deadlocks. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_lock_detect __P((DB_ENV *, u_int32_t, u_int32_t, int *)); int CDB_lock_get __P((DB_ENV *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)); int CDB_lock_id __P((DB_ENV *, u_int32_t *)); int CDB_lock_put __P((DB_ENV *, DB_LOCK *)); int CDB_lock_stat __P((DB_ENV *, DB_LOCK_STAT **, void *(*)(size_t))); int CDB_lock_vec __P((DB_ENV *, u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); #if defined(__cplusplus) } #endif /******************************************************* * Logging. *******************************************************/ /* Flag values for CDB_log_archive(). */ #define DB_ARCH_ABS 0x001 /* Absolute pathnames. */ #define DB_ARCH_DATA 0x002 /* Data files. */ #define DB_ARCH_LOG 0x004 /* Log files. */ /* * A DB_LSN has two parts, a fileid which identifies a specific file, and an * offset within that file. The fileid is an unsigned 4-byte quantity that * uniquely identifies a file within the log directory -- currently a simple * counter inside the log. The offset is also an unsigned 4-byte value. The * log manager guarantees the offset is never more than 4 bytes by switching * to a new log file before the maximum length imposed by an unsigned 4-byte * offset is reached. */ struct __db_lsn { u_int32_t file; /* File ID. */ u_int32_t offset; /* File offset. */ }; /* Log statistics structure. */ struct __db_log_stat { u_int32_t st_magic; /* Log file magic number. */ u_int32_t st_version; /* Log file version number. */ int st_mode; /* Log file mode. */ u_int32_t st_lg_bsize; /* Log buffer size. */ u_int32_t st_lg_max; /* Maximum log file size. */ u_int32_t st_w_bytes; /* Bytes to log. */ u_int32_t st_w_mbytes; /* Megabytes to log. */ u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */ u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint. */ u_int32_t st_wcount; /* Total writes to the log. */ u_int32_t st_wcount_fill; /* Overflow writes to the log. */ u_int32_t st_scount; /* Total syncs to the log. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_cur_file; /* Current log file number. */ u_int32_t st_cur_offset; /* Current log file offset. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_log_archive __P((DB_ENV *, char **[], u_int32_t, void *(*)(size_t))); int CDB_log_compare __P((const DB_LSN *, const DB_LSN *)); int CDB_log_file __P((DB_ENV *, const DB_LSN *, char *, size_t)); int CDB_log_flush __P((DB_ENV *, const DB_LSN *)); int CDB_log_get __P((DB_ENV *, DB_LSN *, DBT *, u_int32_t)); int CDB_log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); int CDB_log_register __P((DB_ENV *, DB *, const char *, int32_t *)); int CDB_log_stat __P((DB_ENV *, DB_LOG_STAT **, void *(*)(size_t))); int CDB_log_unregister __P((DB_ENV *, int32_t)); #if defined(__cplusplus) } #endif /******************************************************* * Mpool *******************************************************/ /* Flag values for CDB_memp_fget(). */ #define DB_MPOOL_CREATE 0x001 /* Create a page. */ #define DB_MPOOL_LAST 0x002 /* Return the last page. */ #define DB_MPOOL_NEW 0x004 /* Create a new page. */ #define DB_MPOOL_NEW_GROUP 0x008 /* Create a group of pages. */ /* Flag values for CDB_memp_fput(), CDB_memp_fset(). */ #define DB_MPOOL_CLEAN 0x001 /* Page is not modified. */ #define DB_MPOOL_DIRTY 0x002 /* Page is modified. */ #define DB_MPOOL_DISCARD 0x004 /* Don't cache the page. */ /* Mpool statistics structure. */ struct __db_mpool_stat { u_int32_t st_cache_hit; /* Pages found in the cache. */ u_int32_t st_cache_miss; /* Pages not found in the cache. */ u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_page_create; /* Pages created in the cache. */ u_int32_t st_page_in; /* Pages read in. */ u_int32_t st_page_out; /* Pages written out. */ u_int32_t st_ro_evict; /* Clean pages forced from the cache. */ u_int32_t st_rw_evict; /* Dirty pages forced from the cache. */ u_int32_t st_hash_buckets; /* Number of hash buckets. */ u_int32_t st_hash_searches; /* Total hash chain searches. */ u_int32_t st_hash_longest; /* Longest hash chain searched. */ u_int32_t st_hash_examined; /* Total hash entries searched. */ u_int32_t st_page_clean; /* Clean pages. */ u_int32_t st_page_dirty; /* Dirty pages. */ u_int32_t st_page_trickle; /* Pages written by CDB_memp_trickle. */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ u_int32_t st_gbytes; /* Cache size: GB. */ u_int32_t st_bytes; /* Cache size: B. */ }; /* Mpool file open information structure. */ struct __db_mpool_finfo { int ftype; /* File type. */ DBT *pgcookie; /* Byte-string passed to pgin/pgout. */ u_int8_t *fileid; /* Unique file ID. */ int32_t lsn_offset; /* LSN offset in page. */ u_int32_t clear_len; /* Cleared length on created pages. */ }; /* Mpool file statistics structure. */ struct __db_mpool_fstat { char *file_name; /* File name. */ size_t st_pagesize; /* Page size. */ u_int32_t st_cache_hit; /* Pages found in the cache. */ u_int32_t st_cache_miss; /* Pages not found in the cache. */ u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_page_create; /* Pages created in the cache. */ u_int32_t st_page_in; /* Pages read in. */ u_int32_t st_page_out; /* Pages written out. */ }; #if defined(__cplusplus) extern "C" { #endif #if defined(__cplusplus) } #endif #if defined(__cplusplus) extern "C" { #endif int CDB_memp_fclose __P((DB_MPOOLFILE *)); int CDB_memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, u_int32_t, void *)); int CDB_memp_fopen __P((DB_ENV *, const char *, u_int32_t, int, size_t, DB_MPOOL_FINFO *, DB_MPOOLFILE **)); int CDB_memp_fput __P((DB_MPOOLFILE *, void *, u_int32_t)); int CDB_memp_fset __P((DB_MPOOLFILE *, void *, u_int32_t)); int CDB_memp_fsync __P((DB_MPOOLFILE *)); int CDB_memp_register __P((DB_ENV *, int, int (*)(db_pgno_t, void *, DBT *), int (*)(db_pgno_t, void *, DBT *))); int CDB_memp_stat __P((DB_ENV *, DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, void *(*)(size_t))); int CDB_memp_sync __P((DB_ENV *, DB_LSN *)); int CDB_memp_trickle __P((DB_ENV *, int, int *)); #if defined(__cplusplus) } #endif /******************************************************* * Transactions. *******************************************************/ #define DB_TXNVERSION 1 /* Operations values to the tx_recover() function. */ #define DB_TXN_BACKWARD_ROLL 1 /* Read the log backwards. */ #define DB_TXN_FORWARD_ROLL 2 /* Read the log forwards. */ #define DB_TXN_OPENFILES 3 /* Read for open files. */ #define DB_TXN_REDO 4 /* Redo the operation. */ #define DB_TXN_UNDO 5 /* Undo the operation. */ /* Internal transaction status values. */ /* Transaction statistics structure. */ struct __db_txn_active { u_int32_t txnid; /* Transaction ID */ u_int32_t parentid; /* Transaction ID of parent */ DB_LSN lsn; /* Lsn of the begin record */ }; struct __db_txn_stat { DB_LSN st_last_ckp; /* lsn of the last checkpoint */ DB_LSN st_pending_ckp; /* last checkpoint did not finish */ time_t st_time_ckp; /* time of last checkpoint */ u_int32_t st_last_txnid; /* last transaction id given out */ u_int32_t st_maxtxns; /* maximum txns possible */ u_int32_t st_naborts; /* number of aborted transactions */ u_int32_t st_nbegins; /* number of begun transactions */ u_int32_t st_ncommits; /* number of committed transactions */ u_int32_t st_nactive; /* number of active transactions */ u_int32_t st_maxnactive; /* maximum active transactions */ DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */ u_int32_t st_region_wait; /* Region lock granted after wait. */ u_int32_t st_region_nowait; /* Region lock granted without wait. */ u_int32_t st_regsize; /* Region size. */ }; #if defined(__cplusplus) extern "C" { #endif int CDB_txn_abort __P((DB_TXN *)); int CDB_txn_begin __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); int CDB_txn_checkpoint __P((DB_ENV *, u_int32_t, u_int32_t)); int CDB_txn_commit __P((DB_TXN *, u_int32_t)); u_int32_t CDB_txn_id __P((DB_TXN *)); int CDB_txn_prepare __P((DB_TXN *)); int CDB_txn_stat __P((DB_ENV *, DB_TXN_STAT **, void *(*)(size_t))); #if defined(__cplusplus) } #endif #ifndef DB_DBM_HSEARCH #define DB_DBM_HSEARCH 0 /* No historic interfaces by default. */ #endif #if DB_DBM_HSEARCH != 0 /******************************************************* * Dbm/Ndbm historic interfaces. *******************************************************/ #define DBM_INSERT 0 /* Flags to dbm_store(). */ #define DBM_REPLACE 1 /* * The DB support for ndbm(3) always appends this suffix to the * file name to avoid overwriting the user's original database. */ #define DBM_SUFFIX ".db" #if defined(_XPG4_2) typedef struct { char *dptr; size_t dsize; } datum; #else typedef struct { char *dptr; int dsize; } datum; #endif /* * Translate DBM calls into DB calls so that DB doesn't step on the * application's name space. * * The global variables dbrdonly, dirf and pagf were not retained when 4BSD * replaced the dbm interface with ndbm, and are not supported here. */ #define dbminit(a) __db_dbm_init(a) #define dbmclose __db_dbm_close #if !defined(__cplusplus) #define delete(a) __db_dbm_delete(a) #endif #define fetch(a) __db_dbm_fetch(a) #define firstkey __db_dbm_firstkey #define nextkey(a) __db_dbm_nextkey(a) #define store(a, b) __db_dbm_store(a, b) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_dbm_close __P((void)); int __db_dbm_dbrdonly __P((void)); int __db_dbm_delete __P((datum)); int __db_dbm_dirf __P((void)); datum __db_dbm_fetch __P((datum)); datum __db_dbm_firstkey __P((void)); int __db_dbm_init __P((char *)); datum __db_dbm_nextkey __P((datum)); int __db_dbm_pagf __P((void)); int __db_dbm_store __P((datum, datum)); #if defined(__cplusplus) } #endif /* * Translate NDBM calls into DB calls so that DB doesn't step on the * application's name space. */ #define dbm_clearerr(a) __db_ndbm_clearerr(a) #define dbm_close(a) __db_ndbm_close(a) #define dbm_delete(a, b) __db_ndbm_delete(a, b) #define dbm_dirfno(a) __db_ndbm_dirfno(a) #define dbm_error(a) __db_ndbm_error(a) #define dbm_fetch(a, b) __db_ndbm_fetch(a, b) #define dbm_firstkey(a) __db_ndbm_firstkey(a) #define dbm_nextkey(a) __db_ndbm_nextkey(a) #define dbm_open(a, b, c) __db_ndbm_open(a, b, c) #define dbm_pagfno(a) __db_ndbm_pagfno(a) #define dbm_rdonly(a) __db_ndbm_rdonly(a) #define dbm_store(a, b, c, d) __db_ndbm_store(a, b, c, d) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_ndbm_clearerr __P((DBM *)); void __db_ndbm_close __P((DBM *)); int __db_ndbm_delete __P((DBM *, datum)); int __db_ndbm_dirfno __P((DBM *)); int __db_ndbm_error __P((DBM *)); datum __db_ndbm_fetch __P((DBM *, datum)); datum __db_ndbm_firstkey __P((DBM *)); datum __db_ndbm_nextkey __P((DBM *)); DBM *__db_ndbm_open __P((const char *, int, int)); int __db_ndbm_pagfno __P((DBM *)); int __db_ndbm_rdonly __P((DBM *)); int __db_ndbm_store __P((DBM *, datum, datum, int)); #if defined(__cplusplus) } #endif /******************************************************* * Hsearch historic interface. *******************************************************/ typedef enum { FIND, ENTER } ACTION; typedef struct entry { char *key; char *data; } ENTRY; /* * Translate HSEARCH calls into DB calls so that DB doesn't step on the * application's name space. */ #define hcreate(a) __db_hcreate(a) #define hdestroy __db_hdestroy #define hsearch(a, b) __db_hsearch(a, b) /* Prototype the DB calls. */ #if defined(__cplusplus) extern "C" { #endif int __db_hcreate __P((size_t)); void __db_hdestroy __P((void)); ENTRY *__db_hsearch __P((ENTRY, ACTION)); #if defined(__cplusplus) } #endif #endif /* DB_DBM_HSEARCH */ /* * XXX * MacOS: Reset Metrowerks C enum sizes. */ #ifdef __MWERKS__ #pragma enumsalwaysint reset #endif #endif /* !_DB_H_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_am.c����������������������������������������������������������������������������0100644�0063146�0012731�00000032622�07427026535�014175� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_am.c 11.8 (Sleepycat) 11/15/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "hash.h" #include "qam.h" #include "lock.h" #include "mp.h" #include "txn.h" #include "db_am.h" #include "db_ext.h" #ifdef DEBUG #include "WordMonitor.h" #endif /* DEBUG */ static int CDB___db_c_close __P((DBC *)); /* * CDB___db_cursor -- * Allocate and return a cursor. * * PUBLIC: int CDB___db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t)); */ int CDB___db_cursor(dbp, txn, dbcp, flags) DB *dbp; DB_TXN *txn; DBC **dbcp; u_int32_t flags; { DBC *dbc, *adbc; db_lockmode_t mode; u_int32_t op; int ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->cursor"); /* Check for invalid flags. */ if ((ret = CDB___db_cursorchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) return (ret); /* Take one from the free list if it's available. */ MUTEX_THREAD_LOCK(dbp->mutexp); if ((dbc = TAILQ_FIRST(&dbp->free_queue)) != NULL) TAILQ_REMOVE(&dbp->free_queue, dbc, links); else { MUTEX_THREAD_UNLOCK(dbp->mutexp); if ((ret = CDB___os_calloc(1, sizeof(DBC), &dbc)) != 0) return (ret); dbc->dbp = dbp; dbc->c_close = CDB___db_c_close; dbc->c_dup = CDB___db_c_dup; /* Set up locking information. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB | DB_ENV_LOCKING)) { /* * If we are not threaded, then there is no need to * create new locker ids. We know that no one else * is running concurrently using this DB, so we can * take a peek at any cursors on the active queue. */ if (!F_ISSET(dbp->dbenv, DB_ENV_THREAD) && (adbc = TAILQ_FIRST(&dbp->active_queue)) != NULL) dbc->lid = adbc->lid; else if ((ret = CDB_lock_id(dbp->dbenv, &dbc->lid)) != 0) goto err; memcpy(dbc->lock.fileid, dbp->fileid, DB_FILE_ID_LEN); if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { dbc->lock_dbt.size = DB_FILE_ID_LEN; dbc->lock_dbt.data = dbc->lock.fileid; } else { dbc->lock.type = DB_PAGE_LOCK; dbc->lock_dbt.size = sizeof(dbc->lock); dbc->lock_dbt.data = &dbc->lock; } } switch (dbp->type) { case DB_BTREE: case DB_RECNO: if ((ret = CDB___bam_c_init(dbc)) != 0) goto err; break; case DB_HASH: if ((ret = CDB___ham_c_init(dbc)) != 0) goto err; break; case DB_QUEUE: if ((ret = CDB___qam_c_init(dbc)) != 0) goto err; break; default: ret = EINVAL; goto err; } MUTEX_THREAD_LOCK(dbp->mutexp); } if ((dbc->txn = txn) == NULL) dbc->locker = dbc->lid; else dbc->locker = txn->txnid; TAILQ_INSERT_TAIL(&dbp->active_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); /* * If this is CDB, then we do all locking in the interface, which is * right here. However, if we are duplicating a cursor, then we do * not want to acquire any locks here, because we'll do that in the * dup code for the correct locker. */ op = LF_ISSET(DB_OPFLAGS_MASK); if (op != DB_DUPCURSOR && F_ISSET(dbp->dbenv, DB_ENV_CDB)) { mode = (op == DB_WRITELOCK) ? DB_LOCK_WRITE : (LF_ISSET(DB_WRITECURSOR) ? DB_LOCK_IWRITE : DB_LOCK_READ); if ((ret = CDB_lock_get(dbp->dbenv, dbc->locker, 0, &dbc->lock_dbt, mode, &dbc->mylock)) != 0) { (void)CDB___db_c_close(dbc); return (ret); } if (LF_ISSET(DB_WRITECURSOR)) F_SET(dbc, DBC_WRITECURSOR); if (op == DB_WRITELOCK) F_SET(dbc, DBC_WRITER); } *dbcp = dbc; return (0); err: CDB___os_free(dbc, sizeof(*dbc)); return (ret); } /* * CDB___db_c_close -- * Close the cursor (recycle for later use). */ static int CDB___db_c_close(dbc) DBC *dbc; { DB *dbp; int ret, t_ret; dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); ret = 0; /* * Remove the cursor from the active queue. * * !!! * This must happen before the access specific cursor close routine * is called, Btree depends on it. */ MUTEX_THREAD_LOCK(dbp->mutexp); TAILQ_REMOVE(&dbp->active_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); /* Call the access specific cursor close routine. */ if ((t_ret = dbc->c_am_close(dbc)) != 0 && ret == 0) ret = t_ret; /* * Release the lock after calling the access method specific close * routine, a Btree cursor may have had pending deletes. */ if (F_ISSET(dbc->dbp->dbenv, DB_ENV_CDB) && dbc->mylock.off != LOCK_INVALID) { ret = CDB_lock_put(dbc->dbp->dbenv, &dbc->mylock); dbc->mylock.off = LOCK_INVALID; } /* Clean up the cursor. */ dbc->flags = 0; #ifdef CLOSE_CURSOR_CHECK_FOR_LEFTOVER_LOCKS /* * Check for leftover locks, unless we're running with transactions. * * If we're running tests, display any locks currently held. It's * possible that some applications may hold locks for long periods, * e.g., conference room locks, but the DB tests should never close * holding locks. */ if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING) && dbc->lid == dbc->locker) { DB_LOCKREQ request; request.op = DB_LOCK_DUMP; if ((t_ret = CDB_lock_vec(dbp->dbenv, dbc->locker, 0, &request, 1, NULL)) != 0 && ret == 0) ret = EINVAL; } #endif /* Move the cursor to the free queue. */ MUTEX_THREAD_LOCK(dbp->mutexp); TAILQ_INSERT_TAIL(&dbp->free_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); return (ret); } /* * CDB___db_c_dup -- * Duplicate a cursor * * PUBLIC: int CDB___db_c_dup __P((DBC *, DBC **, u_int32_t)); */ int CDB___db_c_dup(orig_dbc, dbcp, flags) DBC *orig_dbc; DBC **dbcp; u_int32_t flags; { DB *dbp; DBC *dbc; int ret; PANIC_CHECK(orig_dbc->dbp->dbenv); /* * We can never have two write cursors open in CDB, so do not * allow duplication of a write cursor. */ if (F_ISSET(orig_dbc, DBC_WRITER | DBC_WRITECURSOR) && flags != DB_POSITIONI) return (EINVAL); dbp = orig_dbc->dbp; /* Allocate a new cursor. */ if ((ret = dbp->cursor(dbp, orig_dbc->txn, &dbc, DB_DUPCURSOR)) != 0) return (ret); /* Assign local locker to be the same as the original. */ dbc->locker = orig_dbc->locker; /* If the user wants the cursor positioned, do it here. */ if (flags == DB_POSITION || flags == DB_POSITIONI) { switch(dbp->type) { case DB_QUEUE: if ((ret = CDB___qam_c_dup(orig_dbc, dbc)) != 0) goto err; break; case DB_BTREE: case DB_RECNO: if ((ret = CDB___bam_c_dup(orig_dbc, dbc)) != 0) goto err; break; case DB_HASH: if ((ret = CDB___ham_c_dup(orig_dbc, dbc)) != 0) goto err; break; default: ret = EINVAL; goto err; } dbc->flags = orig_dbc->flags; } *dbcp = dbc; return (0); err: (void)dbc->c_close(dbc); return (ret); } #ifdef DEBUG /* * CDB___db_cprint -- * Display the current cursor list. * * PUBLIC: int CDB___db_cprint __P((DB *)); */ int CDB___db_cprint(dbp) DB *dbp; { static const FN fn[] = { { DBC_RECOVER, "recover" }, { DBC_RMW, "read-modify-write" }, { DBC_WRITECURSOR, "write cursor" }, { DBC_WRITER, "short-term write cursor" }, { 0, NULL } }; BTREE_CURSOR *cp; DBC *dbc; MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { fprintf(stderr, "%#0x: dbp: %#0x txn: %#0x lid: %lu locker: %lu", (u_int)dbc, (u_int)dbc->dbp, (u_int)dbc->txn, (u_long)dbc->lid, (u_long)dbc->locker); if (dbp->type == DB_BTREE) { cp = dbc->internal; fprintf(stderr, "p/i: %lu/%lu dp/di: %lu/%lu", (u_long)cp->pgno, (u_long)cp->indx, (u_long)cp->dpgno, (u_long)cp->dindx); } CDB___db_prflags(dbc->flags, fn, stderr); fprintf(stderr, "\n"); } MUTEX_THREAD_UNLOCK(dbp->mutexp); return (0); } #endif /* DEBUG */ /* * CDB___db_c_destroy -- * Destroy the cursor. * * PUBLIC: int CDB___db_c_destroy __P((DBC *)); */ int CDB___db_c_destroy(dbc) DBC *dbc; { DB *dbp; int ret; dbp = dbc->dbp; /* Remove the cursor from the free queue. */ MUTEX_THREAD_LOCK(dbp->mutexp); TAILQ_REMOVE(&dbp->free_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); /* Call the access specific cursor destroy routine. */ ret = dbc->c_am_destroy == NULL ? 0 : dbc->c_am_destroy(dbc); /* Free up allocated memory. */ if (dbc->rkey.data != NULL) CDB___os_free(dbc->rkey.data, dbc->rkey.ulen); if (dbc->rdata.data != NULL) CDB___os_free(dbc->rdata.data, dbc->rdata.ulen); CDB___os_free(dbc, sizeof(*dbc)); return (ret); } /* * db_fd -- * Return a file descriptor for flock'ing. * * PUBLIC: int CDB___db_fd __P((DB *, int *)); */ int CDB___db_fd(dbp, fdp) DB *dbp; int *fdp; { DB_FH *fhp; int ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->fd"); /* * XXX * Truly spectacular layering violation. */ if ((ret = CDB___mp_xxx_fh(dbp->mpf, &fhp)) != 0) return (ret); if (F_ISSET(fhp, DB_FH_VALID)) { *fdp = fhp->fd; return (0); } else { *fdp = -1; return (ENOENT); } } /* * CDB___db_get -- * Return a key/data pair. * * PUBLIC: int CDB___db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); */ int CDB___db_get(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { DBC *dbc; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->get"); if ((ret = CDB___db_getchk(dbp, key, data, flags)) != 0) return (ret); if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) return (ret); DEBUG_LREAD(dbc, txn, "CDB___db_get", key, NULL, flags); ret = dbc->c_get(dbc, key, data, flags == 0 || flags == DB_RMW ? flags | DB_SET : flags); if ((t_ret = CDB___db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; #ifdef DEBUG switch(flags) { case 0: word_monitor_add(WORD_MONITOR_GET, 1); break; case DB_NEXT: word_monitor_add(WORD_MONITOR_GET_NEXT, 1); break; case DB_SET_RANGE: word_monitor_add(WORD_MONITOR_GET_SET_RANGE, 1); break; default: word_monitor_add(WORD_MONITOR_GET_OTHER, 1); break; } #endif /* DEBUG */ return (ret); } /* * CDB___db_put -- * Store a key/data pair. * * PUBLIC: int CDB___db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); */ int CDB___db_put(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { DBC *dbc; DBT tdata; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->put"); if ((ret = CDB___db_putchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), F_ISSET(dbp, DB_AM_DUP))) != 0) return (ret); if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "CDB___db_put", key, data, flags); if (flags == DB_NOOVERWRITE) { /* * Set DB_DBT_USERMEM, this might be a threaded application and * the flags checking will catch us. We don't want the actual * data, so request a partial of length 0. */ memset(&tdata, 0, sizeof(tdata)); F_SET(&tdata, DB_DBT_USERMEM | DB_DBT_PARTIAL); /* * If we're locking, set the read-modify-write flag, we're * going to overwrite immediately. */ if ((ret = dbc->c_get(dbc, key, &tdata, DB_SET | (F_ISSET(dbp->dbenv, DB_ENV_LOCKING) ? DB_RMW : 0))) == 0) ret = DB_KEYEXIST; else if (ret == DB_NOTFOUND) ret = 0; } if (ret == 0) ret = dbc->c_put(dbc, key, data, DB_KEYLAST); if ((t_ret = CDB___db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; #ifdef DEBUG word_monitor_add(WORD_MONITOR_PUT, 1); #endif /* DEBUG */ return (ret); } /* * CDB___db_sync -- * Flush the database cache. * * PUBLIC: int CDB___db_sync __P((DB *, u_int32_t)); */ int CDB___db_sync(dbp, flags) DB *dbp; u_int32_t flags; { int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->sync"); if ((ret = CDB___db_syncchk(dbp, flags)) != 0) return (ret); /* Read-only trees never need to be sync'd. */ if (F_ISSET(dbp, DB_AM_RDONLY)) return (0); /* If it's a Recno tree, write the backing source text file. */ if (dbp->type == DB_RECNO) ret = CDB___ram_writeback(dbp); /* If the tree was never backed by a database file, we're done. */ if (F_ISSET(dbp, DB_AM_INMEM)) return (0); /* Flush any dirty pages from the cache to the backing file. */ if ((t_ret = CDB_memp_fsync(dbp->mpf)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_log_page * Log a meta-data or root page during a create operation. * * PUBLIC: int CDB___db_log_page __P((DB *, * PUBLIC: const char *, DB_LSN *, db_pgno_t, PAGE *)); */ int CDB___db_log_page(dbp, name, lsn, pgno, page) DB *dbp; const char *name; DB_LSN *lsn; db_pgno_t pgno; PAGE *page; { DBT name_dbt, page_dbt; DB_LSN new_lsn; int ret; if (dbp->open_txn == NULL) return (0); memset(&page_dbt, 0, sizeof(page_dbt)); page_dbt.size = dbp->pgsize; page_dbt.data = page; if (pgno == PGNO_BASE_MD) { /* * !!! * Make sure that we properly handle a null name. The old * Tcl sent us pathnames of the form ""; it may be the case * that the new Tcl doesn't do that, so we can get rid of * the second check here. */ memset(&name_dbt, 0, sizeof(name_dbt)); name_dbt.data = (char *)name; if (name == NULL || *name == '\0') name_dbt.size = 0; else name_dbt.size = strlen(name) + 1; ret = CDB___crdel_metapage_log(dbp->dbenv, dbp->open_txn, &new_lsn, DB_FLUSH, dbp->log_fileid, &name_dbt, pgno, &page_dbt); } else ret = CDB___crdel_metasub_log(dbp->dbenv, dbp->open_txn, &new_lsn, 0, dbp->log_fileid, pgno, &page_dbt, lsn); if (ret == 0) page->lsn = new_lsn; return (ret); } ��������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_am.h����������������������������������������������������������������������������0100644�0063146�0012731�00000006305�07427026535�014201� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db_am.h 11.4 (Sleepycat) 9/19/99 */ #ifndef _DB_AM_H #define _DB_AM_H #define DB_MINPAGECACHE 10 /* Min pages access methods cache. */ #define DB_ISBIG 0x01 /* DB recovery operation codes. */ #define DB_ISSUBDB 0x02 #define DB_ADD_DUP 0x10 #define DB_REM_DUP 0x20 #define DB_ADD_BIG 0x30 #define DB_REM_BIG 0x40 #define DB_SPLITOLD 0x50 #define DB_SPLITNEW 0x60 #define DB_ADD_PAGE 0x70 #define DB_REM_PAGE 0x80 #define DB_LOG_CREATE 0x90 #define DB_LOG_DELETE 0xa0 /* * This is a grotesque naming hack. We have modified the btree page * allocation and freeing functions to be generic and have therefore * moved them into the access-method independent portion of the code. * However, since we didn't want to create new log records and routines * for them, we left their logging and recovery functions over in btree. * To make the code look prettier, we macro them, but this is sure to * confuse the heck out of everyone. */ #define __db_pg_alloc_log CDB___bam_pg_alloc_log #define __db_pg_free_log CDB___bam_pg_free_log /* * Standard initialization and shutdown macros for all recovery functions. * * Requires the following local variables: * * DB *file_dbp, *mdbp; * DB_MPOOLFILE *mpf; * int ret; */ #define REC_INTRO(func, inc_count) { \ file_dbp = NULL; \ dbc = NULL; \ if ((ret = func(dbtp->data, &argp)) != 0) \ goto out; \ if ((ret = CDB___db_fileid_to_db(dbenv, \ &file_dbp, argp->fileid, inc_count)) != 0) { \ if (ret == DB_DELETED) { \ ret = 0; \ goto done; \ } \ goto out; \ } \ if (file_dbp == NULL) \ goto out; \ if ((ret = file_dbp->cursor(file_dbp, NULL, &dbc, 0)) != 0) \ goto out; \ F_SET(dbc, DBC_RECOVER); \ mpf = file_dbp->mpf; \ } #define REC_CLOSE \ if (argp != NULL) \ CDB___os_free(argp, sizeof(*argp)); \ if (dbc != NULL) \ dbc->c_close(dbc); \ return (ret); /* * No-op versions of the same macros. */ #define REC_NOOP_INTRO(func) { \ if ((ret = func(dbtp->data, &argp)) != 0) \ return (ret); \ } #define REC_NOOP_CLOSE \ if (argp != NULL) \ CDB___os_free(argp, sizeof(*argp)); \ return (ret); \ /* * Standard debugging macro for all recovery functions. */ #ifdef DEBUG_RECOVER #define REC_PRINT(func) \ (void)func(dbenv, dbtp, lsnp, redo, info); #else #define REC_PRINT(func) #endif /* * If doing transactions we have to hold the locks associated with a data item * from a page for the entire transaction. However, we don't have to hold the * locks associated with walking the tree. Distinguish between the two so that * we don't tie up the internal pages of the tree longer than necessary. */ #define __LPUT(dbc, lock) \ (F_ISSET((dbc)->dbp->dbenv, DB_ENV_LOCKING) ? \ CDB_lock_put((dbc)->dbp->dbenv, &(lock)) : 0) #define __TLPUT(dbc, lock) \ (F_ISSET((dbc)->dbp->dbenv, DB_ENV_LOCKING) && \ (dbc)->txn == NULL ? CDB_lock_put((dbc)->dbp->dbenv, &(lock)) : 0) #include "db_auto.h" #include "crdel_auto.h" #include "db_ext.h" #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_auto.c��������������������������������������������������������������������������0100644�0063146�0012731�00000107266�07427026535�014557� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "txn.h" int CDB___db_addrem_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, indx, nbytes, hdr, dbt, pagelsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; u_int32_t indx; size_t nbytes; const DBT *hdr; const DBT *dbt; DB_LSN * pagelsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_addrem; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(indx) + sizeof(nbytes) + sizeof(u_int32_t) + (hdr == NULL ? 0 : hdr->size) + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size) + sizeof(*pagelsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &nbytes, sizeof(nbytes)); bp += sizeof(nbytes); if (hdr == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &hdr->size, sizeof(hdr->size)); bp += sizeof(hdr->size); memcpy(bp, hdr->data, hdr->size); bp += hdr->size; } if (dbt == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &dbt->size, sizeof(dbt->size)); bp += sizeof(dbt->size); memcpy(bp, dbt->data, dbt->size); bp += dbt->size; } if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_addrem_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_addrem_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_addrem_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_addrem: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\tnbytes: %lu\n", (u_long)argp->nbytes); printf("\thdr: "); for (i = 0; i < argp->hdr.size; i++) { ch = ((u_int8_t *)argp->hdr.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tdbt: "); for (i = 0; i < argp->dbt.size; i++) { ch = ((u_int8_t *)argp->dbt.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_addrem_read(recbuf, argpp) void *recbuf; __db_addrem_args **argpp; { __db_addrem_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_addrem_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->nbytes, bp, sizeof(argp->nbytes)); bp += sizeof(argp->nbytes); memset(&argp->hdr, 0, sizeof(argp->hdr)); memcpy(&argp->hdr.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->hdr.data = bp; bp += argp->hdr.size; memset(&argp->dbt, 0, sizeof(argp->dbt)); memcpy(&argp->dbt.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->dbt.data = bp; bp += argp->dbt.size; memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); *argpp = argp; return (0); } int CDB___db_split_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, pageimage, pagelsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; const DBT *pageimage; DB_LSN * pagelsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_split; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(u_int32_t) + (pageimage == NULL ? 0 : pageimage->size) + sizeof(*pagelsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (pageimage == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &pageimage->size, sizeof(pageimage->size)); bp += sizeof(pageimage->size); memcpy(bp, pageimage->data, pageimage->size); bp += pageimage->size; } if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_split_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_split_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_split_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_split: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tpageimage: "); for (i = 0; i < argp->pageimage.size; i++) { ch = ((u_int8_t *)argp->pageimage.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_split_read(recbuf, argpp) void *recbuf; __db_split_args **argpp; { __db_split_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_split_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memset(&argp->pageimage, 0, sizeof(argp->pageimage)); memcpy(&argp->pageimage.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->pageimage.data = bp; bp += argp->pageimage.size; memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); *argpp = argp; return (0); } int CDB___db_big_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, prev_pgno, next_pgno, dbt, pagelsn, prevlsn, nextlsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; db_pgno_t prev_pgno; db_pgno_t next_pgno; const DBT *dbt; DB_LSN * pagelsn; DB_LSN * prevlsn; DB_LSN * nextlsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_big; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(prev_pgno) + sizeof(next_pgno) + sizeof(u_int32_t) + (dbt == NULL ? 0 : dbt->size) + sizeof(*pagelsn) + sizeof(*prevlsn) + sizeof(*nextlsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &prev_pgno, sizeof(prev_pgno)); bp += sizeof(prev_pgno); memcpy(bp, &next_pgno, sizeof(next_pgno)); bp += sizeof(next_pgno); if (dbt == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &dbt->size, sizeof(dbt->size)); bp += sizeof(dbt->size); memcpy(bp, dbt->data, dbt->size); bp += dbt->size; } if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); if (prevlsn != NULL) memcpy(bp, prevlsn, sizeof(*prevlsn)); else memset(bp, 0, sizeof(*prevlsn)); bp += sizeof(*prevlsn); if (nextlsn != NULL) memcpy(bp, nextlsn, sizeof(*nextlsn)); else memset(bp, 0, sizeof(*nextlsn)); bp += sizeof(*nextlsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_big_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_big_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_big_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_big: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tprev_pgno: %lu\n", (u_long)argp->prev_pgno); printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); printf("\tdbt: "); for (i = 0; i < argp->dbt.size; i++) { ch = ((u_int8_t *)argp->dbt.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\tprevlsn: [%lu][%lu]\n", (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); printf("\tnextlsn: [%lu][%lu]\n", (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_big_read(recbuf, argpp) void *recbuf; __db_big_args **argpp; { __db_big_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_big_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->prev_pgno, bp, sizeof(argp->prev_pgno)); bp += sizeof(argp->prev_pgno); memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); bp += sizeof(argp->next_pgno); memset(&argp->dbt, 0, sizeof(argp->dbt)); memcpy(&argp->dbt.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->dbt.data = bp; bp += argp->dbt.size; memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); bp += sizeof(argp->prevlsn); memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); bp += sizeof(argp->nextlsn); *argpp = argp; return (0); } int CDB___db_ovref_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, adjust, lsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; int32_t adjust; DB_LSN * lsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_ovref; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(adjust) + sizeof(*lsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &adjust, sizeof(adjust)); bp += sizeof(adjust); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_ovref_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_ovref_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_ovref_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_ovref: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tadjust: %ld\n", (long)argp->adjust); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_ovref_read(recbuf, argpp) void *recbuf; __db_ovref_args **argpp; { __db_ovref_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_ovref_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->adjust, bp, sizeof(argp->adjust)); bp += sizeof(argp->adjust); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); *argpp = argp; return (0); } int CDB___db_relink_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, lsn, prev, lsn_prev, next, lsn_next) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; db_pgno_t prev; DB_LSN * lsn_prev; db_pgno_t next; DB_LSN * lsn_next; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_relink; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(prev) + sizeof(*lsn_prev) + sizeof(next) + sizeof(*lsn_next); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &prev, sizeof(prev)); bp += sizeof(prev); if (lsn_prev != NULL) memcpy(bp, lsn_prev, sizeof(*lsn_prev)); else memset(bp, 0, sizeof(*lsn_prev)); bp += sizeof(*lsn_prev); memcpy(bp, &next, sizeof(next)); bp += sizeof(next); if (lsn_next != NULL) memcpy(bp, lsn_next, sizeof(*lsn_next)); else memset(bp, 0, sizeof(*lsn_next)); bp += sizeof(*lsn_next); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_relink_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_relink_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_relink_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_relink: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tprev: %lu\n", (u_long)argp->prev); printf("\tlsn_prev: [%lu][%lu]\n", (u_long)argp->lsn_prev.file, (u_long)argp->lsn_prev.offset); printf("\tnext: %lu\n", (u_long)argp->next); printf("\tlsn_next: [%lu][%lu]\n", (u_long)argp->lsn_next.file, (u_long)argp->lsn_next.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_relink_read(recbuf, argpp) void *recbuf; __db_relink_args **argpp; { __db_relink_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_relink_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->prev, bp, sizeof(argp->prev)); bp += sizeof(argp->prev); memcpy(&argp->lsn_prev, bp, sizeof(argp->lsn_prev)); bp += sizeof(argp->lsn_prev); memcpy(&argp->next, bp, sizeof(argp->next)); bp += sizeof(argp->next); memcpy(&argp->lsn_next, bp, sizeof(argp->lsn_next)); bp += sizeof(argp->lsn_next); *argpp = argp; return (0); } int CDB___db_addpage_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, lsn, nextpgno, nextlsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * lsn; db_pgno_t nextpgno; DB_LSN * nextlsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_addpage; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*lsn) + sizeof(nextpgno) + sizeof(*nextlsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &nextpgno, sizeof(nextpgno)); bp += sizeof(nextpgno); if (nextlsn != NULL) memcpy(bp, nextlsn, sizeof(*nextlsn)); else memset(bp, 0, sizeof(*nextlsn)); bp += sizeof(*nextlsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_addpage_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_addpage_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_addpage_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_addpage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tnextpgno: %lu\n", (u_long)argp->nextpgno); printf("\tnextlsn: [%lu][%lu]\n", (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_addpage_read(recbuf, argpp) void *recbuf; __db_addpage_args **argpp; { __db_addpage_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_addpage_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->nextpgno, bp, sizeof(argp->nextpgno)); bp += sizeof(argp->nextpgno); memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); bp += sizeof(argp->nextlsn); *argpp = argp; return (0); } int CDB___db_debug_log(dbenv, txnid, ret_lsnp, flags, op, fileid, key, data, arg_flags) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; const DBT *op; int32_t fileid; const DBT *key; const DBT *data; u_int32_t arg_flags; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_debug; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(u_int32_t) + (op == NULL ? 0 : op->size) + sizeof(fileid) + sizeof(u_int32_t) + (key == NULL ? 0 : key->size) + sizeof(u_int32_t) + (data == NULL ? 0 : data->size) + sizeof(arg_flags); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); if (op == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &op->size, sizeof(op->size)); bp += sizeof(op->size); memcpy(bp, op->data, op->size); bp += op->size; } memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (key == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &key->size, sizeof(key->size)); bp += sizeof(key->size); memcpy(bp, key->data, key->size); bp += key->size; } if (data == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &data->size, sizeof(data->size)); bp += sizeof(data->size); memcpy(bp, data->data, data->size); bp += data->size; } memcpy(bp, &arg_flags, sizeof(arg_flags)); bp += sizeof(arg_flags); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_debug_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_debug_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_debug_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_debug: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\top: "); for (i = 0; i < argp->op.size; i++) { ch = ((u_int8_t *)argp->op.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tkey: "); for (i = 0; i < argp->key.size; i++) { ch = ((u_int8_t *)argp->key.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tdata: "); for (i = 0; i < argp->data.size; i++) { ch = ((u_int8_t *)argp->data.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\targ_flags: %lu\n", (u_long)argp->arg_flags); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_debug_read(recbuf, argpp) void *recbuf; __db_debug_args **argpp; { __db_debug_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_debug_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memset(&argp->op, 0, sizeof(argp->op)); memcpy(&argp->op.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->op.data = bp; bp += argp->op.size; memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memset(&argp->key, 0, sizeof(argp->key)); memcpy(&argp->key.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->key.data = bp; bp += argp->key.size; memset(&argp->data, 0, sizeof(argp->data)); memcpy(&argp->data.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->data.data = bp; bp += argp->data.size; memcpy(&argp->arg_flags, bp, sizeof(argp->arg_flags)); bp += sizeof(argp->arg_flags); *argpp = argp; return (0); } int CDB___db_noop_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, prevlsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * prevlsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_db_noop; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*prevlsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (prevlsn != NULL) memcpy(bp, prevlsn, sizeof(*prevlsn)); else memset(bp, 0, sizeof(*prevlsn)); bp += sizeof(*prevlsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___db_noop_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __db_noop_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___db_noop_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]db_noop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tprevlsn: [%lu][%lu]\n", (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___db_noop_read(recbuf, argpp) void *recbuf; __db_noop_args **argpp; { __db_noop_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__db_noop_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); bp += sizeof(argp->prevlsn); *argpp = argp; return (0); } int CDB___db_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___db_addrem_print, DB_db_addrem)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_split_print, DB_db_split)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_big_print, DB_db_big)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_ovref_print, DB_db_ovref)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_relink_print, DB_db_relink)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_addpage_print, DB_db_addpage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_debug_print, DB_db_debug)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_noop_print, DB_db_noop)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___db_init_recover __P((DB_ENV *)); */ int CDB___db_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___db_addrem_recover, DB_db_addrem)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_split_recover, DB_db_split)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_big_recover, DB_db_big)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_ovref_recover, DB_db_ovref)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_relink_recover, DB_db_relink)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_addpage_recover, DB_db_addpage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_debug_recover, DB_db_debug)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___db_noop_recover, DB_db_noop)) != 0) return (ret); return (0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_auto.h��������������������������������������������������������������������������0100644�0063146�0012731�00000010135�07427026535�014550� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef db_AUTO_H #define db_AUTO_H #define DB_db_addrem (DB_db_BEGIN + 1) typedef struct _db_addrem_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; u_int32_t indx; size_t nbytes; DBT hdr; DBT dbt; DB_LSN pagelsn; } __db_addrem_args; int CDB___db_addrem_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, size_t, const DBT *, const DBT *, DB_LSN *)); int CDB___db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_addrem_read __P((void *, __db_addrem_args **)); #define DB_db_split (DB_db_BEGIN + 2) typedef struct _db_split_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; DBT pageimage; DB_LSN pagelsn; } __db_split_args; int CDB___db_split_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, const DBT *, DB_LSN *)); int CDB___db_split_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_split_read __P((void *, __db_split_args **)); #define DB_db_big (DB_db_BEGIN + 3) typedef struct _db_big_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; db_pgno_t prev_pgno; db_pgno_t next_pgno; DBT dbt; DB_LSN pagelsn; DB_LSN prevlsn; DB_LSN nextlsn; } __db_big_args; int CDB___db_big_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *)); int CDB___db_big_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_big_read __P((void *, __db_big_args **)); #define DB_db_ovref (DB_db_BEGIN + 4) typedef struct _db_ovref_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; int32_t adjust; DB_LSN lsn; } __db_ovref_args; int CDB___db_ovref_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, int32_t, DB_LSN *)); int CDB___db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_ovref_read __P((void *, __db_ovref_args **)); #define DB_db_relink (DB_db_BEGIN + 5) typedef struct _db_relink_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; db_pgno_t prev; DB_LSN lsn_prev; db_pgno_t next; DB_LSN lsn_next; } __db_relink_args; int CDB___db_relink_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *)); int CDB___db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_relink_read __P((void *, __db_relink_args **)); #define DB_db_addpage (DB_db_BEGIN + 6) typedef struct _db_addpage_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN lsn; db_pgno_t nextpgno; DB_LSN nextlsn; } __db_addpage_args; int CDB___db_addpage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *)); int CDB___db_addpage_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_addpage_read __P((void *, __db_addpage_args **)); #define DB_db_debug (DB_db_BEGIN + 7) typedef struct _db_debug_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; DBT op; int32_t fileid; DBT key; DBT data; u_int32_t arg_flags; } __db_debug_args; int CDB___db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t)); int CDB___db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_debug_read __P((void *, __db_debug_args **)); #define DB_db_noop (DB_db_BEGIN + 8) typedef struct _db_noop_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN prevlsn; } __db_noop_args; int CDB___db_noop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *)); int CDB___db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_noop_read __P((void *, __db_noop_args **)); int CDB___db_init_print __P((DB_ENV *)); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_byteorder.c���������������������������������������������������������������������0100644�0063146�0012731�00000002125�07427026535�015572� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_byteorder.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifdef HAVE_ENDIAN_H #include <endian.h> #if BYTE_ORDER == BIG_ENDIAN #define WORDS_BIGENDIAN 1 #endif #endif #include <errno.h> #endif #include "db_int.h" #include "common_ext.h" /* * CDB___db_byteorder -- * Return if we need to do byte swapping, checking for illegal * values. * * PUBLIC: int CDB___db_byteorder __P((DB_ENV *, int)); */ int CDB___db_byteorder(dbenv, lorder) DB_ENV *dbenv; int lorder; { switch (lorder) { case 0: break; case 1234: #if defined(WORDS_BIGENDIAN) return (DB_SWAPBYTES); #else break; #endif case 4321: #if defined(WORDS_BIGENDIAN) break; #else return (DB_SWAPBYTES); #endif default: CDB___db_err(dbenv, "unsupported byte order, only big and little-endian supported"); return (EINVAL); } return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_cam.c���������������������������������������������������������������������������0100644�0063146�0012731�00000057200�07427026535�014337� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000 * Sleepycat Software. All rights reserved. */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: db_cam.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "btree.h" #include "hash.h" #include "qam.h" #include "db_ext.h" static int __db_c_cleanup __P((DBC *, DBC *, int)); static int __db_c_idup __P((DBC *, DBC **, u_int32_t)); static int __db_wrlock_err __P((DB_ENV *)); #define LOCKING_INIT(dbp, dbc) \ /* \ * If we are running CDB, this had better be either a write \ * cursor or an immediate writer. If it's a regular writer, \ * that means we have an IWRITE lock and we need to upgrade \ * it to a write lock. \ */ \ if (LOCKING((dbp)->dbenv)) { \ if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) \ return(__db_wrlock_err(dbp->dbenv)); \ \ if (F_ISSET(dbc, DBC_WRITECURSOR) && \ (ret = CDB_lock_get((dbp)->dbenv, (dbc)->locker, \ DB_LOCK_UPGRADE, &(dbc)->lock_dbt, DB_LOCK_WRITE, \ &(dbc)->mylock)) != 0) \ return (ret); \ } #define LOCKING_DONE(dbp, dbc) \ /* Release the upgraded lock. */ \ if (F_ISSET(dbc, DBC_WRITECURSOR)) \ (void)CDB___lock_downgrade( \ (dbp)->dbenv, &(dbc)->mylock, DB_LOCK_IWRITE, 0); #define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID) /* * CDB___db_c_close -- * Close the cursor. * * PUBLIC: int CDB___db_c_close __P((DBC *)); */ int CDB___db_c_close(dbc) DBC *dbc; { DB *dbp; DBC *opd; DBC_INTERNAL *cp; int ret, t_ret; dbp = dbc->dbp; ret = 0; PANIC_CHECK(dbp->dbenv); /* * If the cursor is already closed we have a serious problem, and we * assume that the cursor isn't on the active queue. Don't do any of * the remaining cursor close processing. */ if (!F_ISSET(dbc, DBC_ACTIVE)) { if (dbp && dbp->dbenv) CDB___db_err(dbp->dbenv, "Closing closed cursor"); DB_ASSERT(0); return (EINVAL); } cp = dbc->internal; opd = cp->opd; /* * Remove the cursor(s) from the active queue. We may be closing two * cursors at once here, a top-level one and a lower-level, off-page * duplicate one. The acess-method specific cursor close routine must * close both of them in a single call. * * !!! * Cursors must be removed from the active queue before calling the * access specific cursor close routine, btree depends on having that * order of operations. It must also happen before any action that * can fail and cause CDB___db_c_close to return an error, or else calls * here from CDB___db_close may loop indefinitely. */ MUTEX_THREAD_LOCK(dbp->mutexp); if (opd != NULL) { F_CLR(opd, DBC_ACTIVE); TAILQ_REMOVE(&dbp->active_queue, opd, links); } F_CLR(dbc, DBC_ACTIVE); TAILQ_REMOVE(&dbp->active_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); /* Call the access specific cursor close routine. */ if ((t_ret = dbc->c_am_close(dbc, PGNO_INVALID, NULL)) != 0 && ret == 0) ret = t_ret; /* * Release the lock after calling the access method specific close * routine, a Btree cursor may have had pending deletes. */ if (LOCKING(dbc->dbp->dbenv)) { /* * If DBC_WRITEDUP is set, the cursor is an internally * duplicated write cursor and the lock isn't ours to put. */ if (!F_ISSET(dbc, DBC_WRITEDUP) && dbc->mylock.off != LOCK_INVALID) { if ((t_ret = CDB_lock_put(dbc->dbp->dbenv, &dbc->mylock)) != 0 && ret == 0) ret = t_ret; dbc->mylock.off = LOCK_INVALID; } /* For safety's sake, since this is going on the free queue. */ memset(&dbc->mylock, 0, sizeof(dbc->mylock)); F_CLR(dbc, DBC_WRITEDUP); } /* Move the cursor(s) to the free queue. */ MUTEX_THREAD_LOCK(dbp->mutexp); if (opd != NULL) { TAILQ_INSERT_TAIL(&dbp->free_queue, opd, links); opd = NULL; } TAILQ_INSERT_TAIL(&dbp->free_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); return (ret); } /* * CDB___db_c_destroy -- * Destroy the cursor, called after DBC->c_close. * * PUBLIC: int CDB___db_c_destroy __P((DBC *)); */ int CDB___db_c_destroy(dbc) DBC *dbc; { DB *dbp; DBC_INTERNAL *cp; int ret; dbp = dbc->dbp; cp = dbc->internal; /* Remove the cursor from the free queue. */ MUTEX_THREAD_LOCK(dbp->mutexp); TAILQ_REMOVE(&dbp->free_queue, dbc, links); MUTEX_THREAD_UNLOCK(dbp->mutexp); /* Free up allocated memory. */ if (dbc->rkey.data != NULL) CDB___os_free(dbc->rkey.data, dbc->rkey.ulen); if (dbc->rdata.data != NULL) CDB___os_free(dbc->rdata.data, dbc->rdata.ulen); /* Call the access specific cursor destroy routine. */ ret = dbc->c_am_destroy == NULL ? 0 : dbc->c_am_destroy(dbc); CDB___os_free(dbc, sizeof(*dbc)); return (ret); } /* * CDB___db_c_count -- * Return a count of duplicate data items. * * PUBLIC: int CDB___db_c_count __P((DBC *, db_recno_t *, u_int32_t)); */ int CDB___db_c_count(dbc, recnop, flags) DBC *dbc; db_recno_t *recnop; u_int32_t flags; { DB *dbp; int ret; /* * Cursor Cleanup Note: * All of the cursors passed to the underlying access methods by this * routine are not duplicated and will not be cleaned up on return. * So, pages/locks that the cursor references must be resolved by the * underlying functions. */ dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_ccountchk(dbp, flags, IS_INITIALIZED(dbc))) != 0) return (ret); switch (dbc->dbtype) { case DB_QUEUE: case DB_RECNO: *recnop = 1; break; case DB_HASH: if (dbc->internal->opd == NULL) { if ((ret = CDB___ham_c_count(dbc, recnop)) != 0) return (ret); break; } /* FALLTHROUGH */ case DB_BTREE: if ((ret = CDB___bam_c_count(dbc, recnop)) != 0) return (ret); break; default: return (CDB___db_unknown_type(dbp->dbenv, "CDB___db_c_count", dbp->type)); } return (0); } /* * CDB___db_c_del -- * Delete using a cursor. * * PUBLIC: int CDB___db_c_del __P((DBC *, u_int32_t)); */ int CDB___db_c_del(dbc, flags) DBC *dbc; u_int32_t flags; { DB *dbp; DBC *opd; int ret; /* * Cursor Cleanup Note: * All of the cursors passed to the underlying access methods by this * routine are not duplicated and will not be cleaned up on return. * So, pages/locks that the cursor references must be resolved by the * underlying functions. */ dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cdelchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY), IS_INITIALIZED(dbc))) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "db_c_del", NULL, NULL, flags); LOCKING_INIT(dbp, dbc); /* * Off-page duplicate trees are locked in the primary tree, that is, * we acquire a write lock in the primary tree and no locks in the * off-page dup tree. If the del operation is done in an off-page * duplicate tree, call the primary cursor's upgrade routine first. */ opd = dbc->internal->opd; if (opd == NULL) ret = dbc->c_am_del(dbc); else if ((ret = dbc->c_am_writelock(dbc)) == 0) ret = opd->c_am_del(opd); LOCKING_DONE(dbp, dbc); return (ret); } /* * CDB___db_c_dup -- * Duplicate a cursor * * PUBLIC: int CDB___db_c_dup __P((DBC *, DBC **, u_int32_t)); */ int CDB___db_c_dup(dbc_orig, dbcp, flags) DBC *dbc_orig; DBC **dbcp; u_int32_t flags; { DB_ENV *dbenv; DB *dbp; DBC *dbc_n, *dbc_nopd; int ret; dbp = dbc_orig->dbp; dbenv = dbp->dbenv; dbc_n = dbc_nopd = NULL; PANIC_CHECK(dbp->dbenv); /* * We can never have two write cursors open in CDB, so do not * allow duplication of a write cursor. */ if (flags != DB_POSITIONI && F_ISSET(dbc_orig, DBC_WRITER | DBC_WRITECURSOR)) { CDB___db_err(dbenv, "Cannot duplicate writeable cursor"); return (EINVAL); } /* Allocate a new cursor and initialize it. */ if ((ret = __db_c_idup(dbc_orig, &dbc_n, flags)) != 0) goto err; *dbcp = dbc_n; /* * If we're in CDB, and this isn't an internal duplication (in which * case we're explicitly overriding CDB locking), the duplicated * cursor needs its own read lock. (We know it's not a write cursor * because we wouldn't have made it this far; you can't dup them.) */ if (LOCKING(dbenv) && flags != DB_POSITIONI) { DB_ASSERT(!F_ISSET(dbc_orig, DBC_WRITER | DBC_WRITECURSOR)); if ((ret = CDB_lock_get(dbenv, dbc_n->locker, 0, &dbc_n->lock_dbt, DB_LOCK_READ, &dbc_n->mylock)) != 0) { (void)CDB___db_c_close(dbc_n); return (ret); } } /* * If the cursor references an off-page duplicate tree, allocate a * new cursor for that tree and initialize it. */ if (dbc_orig->internal->opd != NULL) { if ((ret = __db_c_idup(dbc_orig->internal->opd, &dbc_nopd, flags)) != 0) goto err; dbc_n->internal->opd = dbc_nopd; } return (0); err: if (dbc_n != NULL) (void)dbc_n->c_close(dbc_n); if (dbc_nopd != NULL) (void)dbc_nopd->c_close(dbc_nopd); return (ret); } /* * __db_c_idup -- * Internal version of CDB___db_c_dup. */ static int __db_c_idup(dbc_orig, dbcp, flags) DBC *dbc_orig, **dbcp; u_int32_t flags; { DB *dbp; DBC *dbc_n; DBC_INTERNAL *int_n, *int_orig; int ret; dbp = dbc_orig->dbp; dbc_n = *dbcp; if ((ret = CDB___db_icursor(dbp, dbc_orig->txn, dbc_orig->dbtype, dbc_orig->internal->root, F_ISSET(dbc_orig, DBC_OPD), &dbc_n)) != 0) return (ret); dbc_n->locker = dbc_orig->locker; /* If the user wants the cursor positioned, do it here. */ if (flags == DB_POSITION || flags == DB_POSITIONI) { int_n = dbc_n->internal; int_orig = dbc_orig->internal; dbc_n->flags = dbc_orig->flags; int_n->indx = int_orig->indx; int_n->pgno = int_orig->pgno; int_n->root = int_orig->root; switch (dbc_orig->dbtype) { case DB_QUEUE: if ((ret = CDB___qam_c_dup(dbc_orig, dbc_n)) != 0) goto err; break; case DB_BTREE: case DB_RECNO: if ((ret = CDB___bam_c_dup(dbc_orig, dbc_n)) != 0) goto err; break; case DB_HASH: if ((ret = CDB___ham_c_dup(dbc_orig, dbc_n)) != 0) goto err; break; default: ret = CDB___db_unknown_type(dbp->dbenv, "__db_c_idup", dbc_orig->dbtype); goto err; } } *dbcp = dbc_n; return (0); err: (void)dbc_n->c_close(dbc_n); return (ret); } /* * CDB___db_c_get -- * Get using a cursor. * * PUBLIC: int CDB___db_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); */ int CDB___db_c_get(dbc_arg, key, data, flags) DBC *dbc_arg; DBT *key, *data; u_int32_t flags; { DB *dbp; DBC *dbc, *dbc_n, *opd; DBC_INTERNAL *cp, *cp_n; db_pgno_t pgno; u_int32_t tmp_flags, tmp_rmw; u_int8_t type; int ret, t_ret; /* * Cursor Cleanup Note: * All of the cursors passed to the underlying access methods by this * routine are duplicated cursors. On return, any referenced pages * will be discarded, and, if the cursor is not intended to be used * again, the close function will be called. So, pages/locks that * the cursor references do not need to be resolved by the underlying * functions. */ dbp = dbc_arg->dbp; dbc_n = NULL; opd = NULL; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cgetchk(dbp, key, data, flags, IS_INITIALIZED(dbc_arg))) != 0) return (ret); /* Clear OR'd in additional bits so we can check for flag equality. */ tmp_rmw = LF_ISSET(DB_RMW); LF_CLR(DB_RMW); DEBUG_LREAD(dbc_arg, dbc_arg->txn, "db_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); /* * Return a cursor's record number. It has nothing to do with the * cursor get code except that it was put into the interface. */ if (flags == DB_GET_RECNO) return (CDB___bam_c_rget(dbc_arg, data, flags | tmp_rmw)); /* * If we have an off-page duplicates cursor, and the operation applies * to it, perform the operation. Duplicate the cursor and call the * underlying function. * * Off-page duplicate trees are locked in the primary tree, that is, * we acquire a write lock in the primary tree and no locks in the * off-page dup tree. If the DB_RMW flag was specified and the get * operation is done in an off-page duplicate tree, call the primary * cursor's upgrade routine first. */ cp = dbc_arg->internal; if (cp->opd != NULL && (flags == DB_CURRENT || flags == DB_GET_BOTHC || flags == DB_NEXT || flags == DB_NEXT_DUP || flags == DB_PREV)) { if (tmp_rmw && (ret = dbc_arg->c_am_writelock(dbc_arg)) != 0) return (ret); if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITIONI)) != 0) return (ret); /* * If we're in CDB, the newly dup'ed off-page dup cursor * may need the original outer cursor's locking info. */ if (LOCKING(dbp->dbenv)) (void)CDB___db_cdb_cdup(dbc_arg, opd); switch (ret = opd->c_am_get( opd, key, data, flags, NULL)) { case 0: goto done; case DB_NOTFOUND: /* * Translate DB_NOTFOUND failures for the DB_NEXT and * DB_PREV operations into a subsequent operation on * the parent cursor. */ if (flags == DB_NEXT || flags == DB_PREV) { if ((ret = opd->c_close(opd)) != 0) goto err; opd = NULL; break; } goto err; default: goto err; } } /* * Perform an operation on the CDB_main cursor. Duplicate the cursor, * upgrade the lock as required, and call the underlying function. */ switch (flags) { case DB_CURRENT: case DB_GET_BOTHC: case DB_NEXT: case DB_NEXT_DUP: case DB_NEXT_NODUP: case DB_PREV: case DB_PREV_NODUP: tmp_flags = DB_POSITIONI; break; default: tmp_flags = 0; break; } if ((ret = __db_c_idup(dbc_arg, &dbc_n, tmp_flags)) != 0) goto err; /* * If we're in CDB, the new cursor may need the old cursor's locking * info. */ if (LOCKING(dbp->dbenv)) (void)CDB___db_cdb_cdup(dbc_arg, dbc_n); if (tmp_rmw) F_SET(dbc_n, DBC_RMW); pgno = PGNO_INVALID; ret = dbc_n->c_am_get(dbc_n, key, data, flags, &pgno); if (tmp_rmw) F_CLR(dbc_n, DBC_RMW); if (ret != 0) goto err; cp_n = dbc_n->internal; /* * We may be referencing a new off-page duplicates tree. Acquire * a new cursor and call the underlying function. */ if (pgno != PGNO_INVALID) { if ((ret = CDB___db_icursor(dbp, dbc_arg->txn, dbp->dup_compare == NULL ? DB_RECNO : DB_BTREE, pgno, 1, &cp_n->opd)) != 0) goto err; switch (flags) { case DB_FIRST: case DB_NEXT: case DB_NEXT_NODUP: case DB_SET: case DB_SET_RECNO: case DB_SET_RANGE: tmp_flags = DB_FIRST; break; case DB_LAST: case DB_PREV: case DB_PREV_NODUP: tmp_flags = DB_LAST; break; case DB_GET_BOTH: tmp_flags = DB_GET_BOTH; break; case DB_GET_BOTHC: tmp_flags = DB_GET_BOTHC; break; default: ret = CDB___db_unknown_flag(dbp->dbenv, "CDB___db_c_get", flags); goto err; } if ((ret = cp_n->opd->c_am_get( cp_n->opd, key, data, tmp_flags, NULL)) != 0) goto err; } done: /* * Return a key/data item. The only exception is that we don't return * a key if the user already gave us one, that is, if the DB_SET flag * was set. The DB_SET flag is necessary. In a Btree, the user's key * doesn't have to be the same as the key stored the tree, depending on * the magic performed by the comparison function. As we may not have * done any key-oriented operation here, the page reference may not be * valid. Fill it in as necessary. We don't have to worry about any * locks, the cursor must already be holding appropriate locks. * * XXX * If not a Btree and DB_SET_RANGE is set, we shouldn't return a key * either, should we? */ cp_n = dbc_n == NULL ? dbc_arg->internal : dbc_n->internal; if (!F_ISSET(key, DB_DBT_ISSET)) { if (cp_n->page == NULL && (ret = CDB_memp_fget(dbp->mpf, &cp_n->pgno, 0, &cp_n->page)) != 0) goto err; if ((ret = CDB___db_ret(dbp, cp_n->page, cp_n->indx, key, &dbc_arg->rkey.data, &dbc_arg->rkey.ulen)) != 0) goto err; } dbc = opd != NULL ? opd : cp_n->opd != NULL ? cp_n->opd : dbc_n; if (!F_ISSET(data, DB_DBT_ISSET)) { type = TYPE(dbc->internal->page); ret = CDB___db_ret(dbp, dbc->internal->page, dbc->internal->indx + (type == P_LBTREE || type == P_HASH ? O_INDX : 0), data, &dbc_arg->rdata.data, &dbc_arg->rdata.ulen); } err: /* Don't pass DB_DBT_ISSET back to application level, error or no. */ F_CLR(key, DB_DBT_ISSET); F_CLR(data, DB_DBT_ISSET); /* Cleanup and cursor resolution. */ if (opd != NULL) { if ((t_ret = __db_c_cleanup(dbc_arg->internal->opd, opd, ret)) != 0 && ret == 0) ret = t_ret; } if ((t_ret = __db_c_cleanup(dbc_arg, dbc_n, ret)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_c_put -- * Put using a cursor. * * PUBLIC: int CDB___db_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); */ int CDB___db_c_put(dbc_arg, key, data, flags) DBC *dbc_arg; DBT *key, *data; u_int32_t flags; { DB *dbp; DBC *dbc_n, *opd; db_pgno_t pgno; u_int32_t tmp_flags; int ret, t_ret; /* * Cursor Cleanup Note: * All of the cursors passed to the underlying access methods by this * routine are duplicated cursors. On return, any referenced pages * will be discarded, and, if the cursor is not intended to be used * again, the close function will be called. So, pages/locks that * the cursor references do not need to be resolved by the underlying * functions. */ dbp = dbc_arg->dbp; dbc_n = NULL; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cputchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), IS_INITIALIZED(dbc_arg))) != 0) return (ret); DEBUG_LWRITE(dbc_arg, dbc_arg->txn, "db_c_put", flags == DB_KEYFIRST || flags == DB_KEYLAST || flags == DB_NODUPDATA ? key : NULL, data, flags); LOCKING_INIT(dbp, dbc_arg); /* * If we have an off-page duplicates cursor, and the operation applies * to it, perform the operation. Duplicate the cursor and call the * underlying function. * * Off-page duplicate trees are locked in the primary tree, that is, * we acquire a write lock in the primary tree and no locks in the * off-page dup tree. If the put operation is done in an off-page * duplicate tree, call the primary cursor's upgrade routine first. */ if (dbc_arg->internal->opd != NULL && (flags == DB_AFTER || flags == DB_BEFORE || flags == DB_CURRENT)) { if ((ret = dbc_arg->c_am_writelock(dbc_arg)) != 0) return (ret); if ((ret = CDB___db_c_dup(dbc_arg, &dbc_n, DB_POSITIONI)) != 0) goto err; opd = dbc_n->internal->opd; if ((ret = opd->c_am_put( opd, key, data, flags, NULL)) != 0) goto err; goto done; } /* * Perform an operation on the CDB_main cursor. Duplicate the cursor, * and call the underlying function. * * XXX: MARGO * tmp_flags = flags == DB_AFTER || flags == DB_BEFORE || flags == DB_CURRENT ? DB_POSITIONI : 0; */ tmp_flags = DB_POSITIONI; if ((ret = __db_c_idup(dbc_arg, &dbc_n, tmp_flags)) != 0) goto err; pgno = PGNO_INVALID; if ((ret = dbc_n->c_am_put(dbc_n, key, data, flags, &pgno)) != 0) goto err; /* * We may be referencing a new off-page duplicates tree. Acquire * a new cursor and call the underlying function. */ if (pgno != PGNO_INVALID) { if ((ret = CDB___db_icursor(dbp, dbc_arg->txn, dbp->dup_compare == NULL ? DB_RECNO : DB_BTREE, pgno, 1, &dbc_n->internal->opd)) != 0) goto err; opd = dbc_n->internal->opd; if ((ret = opd->c_am_put( opd, key, data, flags, NULL)) != 0) goto err; } done: err: /* Cleanup and cursor resolution. */ if ((t_ret = __db_c_cleanup(dbc_arg, dbc_n, ret)) != 0 && ret == 0) ret = t_ret; LOCKING_DONE(dbp, dbc_arg); return (ret); } /* * CDB___db_duperr() * Error message: we don't currently support sorted duplicate duplicates. * PUBLIC: int CDB___db_duperr __P((DB *, u_int32_t)); */ int CDB___db_duperr(dbp, flags) DB *dbp; u_int32_t flags; { if (flags != DB_NODUPDATA) CDB___db_err(dbp->dbenv, "Duplicate data items are not supported with sorted data"); return (DB_KEYEXIST); } /* * __db_c_cleanup -- * Clean up duplicate cursors. */ static int __db_c_cleanup(dbc, dbc_n, failed) DBC *dbc, *dbc_n; int failed; { DB *dbp; DBC *opd; DBC_INTERNAL *internal; int ret, t_ret; dbp = dbc->dbp; internal = dbc->internal; ret = 0; /* Discard any pages we're holding. */ if (internal->page != NULL) { if ((t_ret = CDB_memp_fput(dbp->mpf, internal->page, 0)) != 0 && ret == 0) ret = t_ret; internal->page = NULL; } opd = internal->opd; if (opd != NULL && opd->internal->page != NULL) { if ((t_ret = CDB_memp_fput(dbp->mpf, opd->internal->page, 0)) != 0 && ret == 0) ret = t_ret; opd->internal->page = NULL; } if (dbc_n == NULL) return (ret); if (dbc_n->internal->page != NULL) { if ((t_ret = CDB_memp_fput(dbp->mpf, dbc_n->internal->page, 0)) != 0 && ret == 0) ret = t_ret; dbc_n->internal->page = NULL; } opd = dbc_n->internal->opd; if (opd != NULL && opd->internal->page != NULL) { if ((t_ret = CDB_memp_fput(dbp->mpf, opd->internal->page, 0)) != 0 && ret == 0) ret = t_ret; opd->internal->page = NULL; } /* * If we didn't fail before entering this routine or just now when * freeing pages, swap the interesting contents of the old and new * cursors. */ if (!failed && ret == 0) { dbc->internal = dbc_n->internal; dbc_n->internal = internal; } /* * Close the cursor we don't care about anymore. The close can fail, * but we only expect DB_LOCK_DEADLOCK failures. This violates our * "the cursor is unchanged on error" semantics, but since all you can * do with a DB_LOCK_DEADLOCK failure is close the cursor, I believe * that's OK. * * XXX * There's no way to recover from failure to close the old cursor. * All we can do is move to the new position and return an error. * * XXX * We might want to consider adding a flag to the cursor, so that any * subsequent operations other than close just return an error? */ if ((t_ret = dbc_n->c_close(dbc_n)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_cdb_cdup -- * Duplicate the internal lock of a CDB write cursor. The method- * independent cursor get and put code duplicate the cursor before * performing operations on it, using the internal cursor interface, which * does no CDB locking. Under normal circumstances this is desirable; * there's no need for an additional lock, as the original cursor * is extant--and its lock is held--throughout, and there's never a * need to perform locking operations on the new cursor. * * The sole exception to this is in the case of a DBC->c_get with a * write cursor. Here, the cursor holds only an IWRITE lock when it * is duplicated; in the common case, there's never a need to * perform a write. If, however, the cursor moves away from a * deleted item in a btree, the btree close method will attempt to * upgrade the lock to a WRITE. This close happens on the _duplicated_ * cursor, so we use this function to provide it with a copy of the * lock. (The lock structure itself doesn't change on an * upgrade/downgrade, so simply copying and later discarding is * sufficient.) * * PUBLIC: int CDB___db_cdb_cdup __P((DBC *, DBC *)); */ int CDB___db_cdb_cdup(dbc_orig, dbc_n) DBC *dbc_orig, *dbc_n; { if (F_ISSET(dbc_orig, DBC_WRITECURSOR | DBC_WRITEDUP)) { memcpy(&dbc_n->mylock, &dbc_orig->mylock, sizeof(dbc_orig->mylock)); /* * dbc_n's locker may be different, since if it's an off-page * duplicate it may not be an idup'ed copy of dbc_orig. It's * not meaningful, though, so overwrite it with dbc_orig's so * we don't self-deadlock. */ dbc_n->locker = dbc_orig->locker; /* * Flag that this lock isn't ours to put; just discard it * in c_close. */ F_SET(dbc_n, DBC_WRITEDUP); } return (0); } /* * __db_wrlock_err -- do not have a write lock. */ static int __db_wrlock_err(dbenv) DB_ENV *dbenv; { CDB___db_err(dbenv, "Write attempted on read-only cursor"); return (EPERM); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_config.h.in���������������������������������������������������������������������0100644�0063146�0012731�00000015146�07706720512�015455� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* db_config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* degbug environment enabled */ #undef DEBUG /* Log operations that read the database */ #undef DEBUG_ROP /* Log operations that write to the database */ #undef DEBUG_WOP /* Enables diagnostic */ #undef DIAGNOSTIC /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the <limits.h> 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 `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Mutex */ #undef HAVE_MUTEX_68K_GCC_ASSEMBLY /* Mutex */ #undef HAVE_MUTEX_AIX_CHECK_LOCK /* Mutex */ #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY /* Mutex FCNTL */ #undef HAVE_MUTEX_FCNTL /* Mutex */ #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY /* Mutex */ #undef HAVE_MUTEX_HPPA_MSEM_INIT /* Mutex */ #undef HAVE_MUTEX_MSEM_INIT /* Mutex */ #undef HAVE_MUTEX_PTHREAD /* Mutex pthreads */ #undef HAVE_MUTEX_PTHREADS /* Mutex */ #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN /* Mutex */ #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY /* Mutex */ #undef HAVE_MUTEX_SEMA_INIT /* Mutex */ #undef HAVE_MUTEX_SGI_INIT_LOCK /* Mutex */ #undef HAVE_MUTEX_SOLARIS_LOCK_TRY /* Mutex */ #undef HAVE_MUTEX_SOLARIS_LWP /* Mutex */ #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY /* Mutex */ #undef HAVE_MUTEX_TAS /* Mutex Threads */ #undef HAVE_MUTEX_THREADS /* Mutex */ #undef HAVE_MUTEX_UI_THREADS /* Mutex */ #undef HAVE_MUTEX_UTS_CC_ASSEMBLY /* Mutex */ #undef HAVE_MUTEX_X86_GCC_ASSEMBLY /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `pstat_getdynamic' function. */ #undef HAVE_PSTAT_GETDYNAMIC /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `sched_yeeld' function. */ #undef HAVE_SCHED_YEELD /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the <stddef.h> header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the <stdlib.h> 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 `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the <sys/select.h> header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the <sys/socket.h> header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `yeld' function. */ #undef HAVE_YELD /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if <sys/types.h> does not define. */ #undef mode_t /* Define to `long' if <sys/types.h> does not define. */ #undef off_t /* Define to `int' if <sys/types.h> does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned' if <sys/types.h> does not define. */ #undef size_t ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_config.h.win32������������������������������������������������������������������0100644�0063146�0012731�00000010526�10000513627�015772� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* db_config.h. */ /* WIN32 Navtive Header File */ /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define if your struct stat has st_blksize. */ /* #define HAVE_ST_BLKSIZE 1 */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef mode_t */ /* Define to `long' if <sys/types.h> doesn't define. */ /* #undef off_t */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef pid_t */ /* Define to `unsigned' if <sys/types.h> doesn't define. */ /* #undef size_t */ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ /* #undef STAT_MACROS_BROKEN */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/time.h> and <time.h>. */ /* #define TIME_WITH_SYS_TIME 1 */ /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define if you want a debugging version. */ /* #undef DEBUG */ /* Define if you want a version that logs read operations. */ /* #undef DEBUG_ROP */ /* Define if you want a version that logs write operations. */ /* #undef DEBUG_WOP */ /* Define if you want a version with run-time diagnostic checking. */ /* #undef DIAGNOSTIC */ /* Define if fcntl/F_SETFD denies child access to file descriptors. */ /* #define HAVE_FCNTL_F_SETFD 1 */ /* Define if building big-file environment (e.g., Solaris, HP/UX). */ /* #undef HAVE_FILE_OFFSET_BITS */ /* Define if building big-file environment (Linux). */ /* #undef HAVE_LARGEFILE_SOURCE */ /* Mutex possibilities. */ /* #undef HAVE_MUTEX_FCNTL */ #define HAVE_MUTEX_TAS 1 /* #undef HAVE_MUTEX_PTHREAD */ /* #undef HAVE_MUTEX_68K_GCC_ASSEMBLY */ /* #undef HAVE_MUTEX_AIX_CHECK_LOCK */ /* #undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY */ /* #undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY */ /* #undef HAVE_MUTEX_HPPA_MSEM_INIT */ /* #undef HAVE_MUTEX_MACOS */ /* #undef HAVE_MUTEX_MSEM_INIT */ /* #undef HAVE_MUTEX_PTHREADS */ /* #undef HAVE_MUTEX_RELIANTUNIX_INITSPIN */ /* #undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY */ /* #undef HAVE_MUTEX_SEMA_INIT */ /* #undef HAVE_MUTEX_SGI_INIT_LOCK */ /* #undef HAVE_MUTEX_SOLARIS_LOCK_TRY */ /* #undef HAVE_MUTEX_SOLARIS_LWP */ /* #undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY */ #define HAVE_MUTEX_THREADS 1 /* #undef HAVE_MUTEX_UI_THREADS */ /* #undef HAVE_MUTEX_UTS_CC_ASSEMBLY */ /* #undef HAVE_MUTEX_VMS */ /* #undef HAVE_MUTEX_WIN16 */ #define HAVE_MUTEX_WIN32 1 /* #define HAVE_MUTEX_X86_GCC_ASSEMBLY 1 */ /* Define if you have the sigfillset function. */ /* #define HAVE_SIGFILLSET 1 */ /* Define if your sprintf returns a pointer, not a length. */ /* #undef SPRINTF_RET_CHARPNT */ /* Define if you have the getuid function. */ /* #define HAVE_GETUID 1 */ /* Define if you have the mlock function. */ /* #undef HAVE_MLOCK */ /* Define if you have the mmap function. */ /* #define HAVE_MMAP 1 */ /* Define if you have the munlock function. */ /* #undef HAVE_MUNLOCK */ /* Define if you have the munmap function. */ #define HAVE_MUNMAP 1 /* Define if you have the pread function. */ /* #undef HAVE_PREAD */ /* Define if you have the pstat_getdynamic function. */ /* #undef HAVE_PSTAT_GETDYNAMIC */ /* Define if you have the qsort function. */ #define HAVE_QSORT 1 /* Define if you have the sched_yield function. */ /* #undef HAVE_SCHED_YIELD */ /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the shmget function. */ /* #undef HAVE_SHMGET */ /* Define if you have the sysconf function. */ #define HAVE_SYSCONF 1 /* Define if you have the yield function. */ /* #undef HAVE_YIELD */ /* Define if you have the <dirent.h> header file. */ /* #define HAVE_DIRENT_H 1 */ /* Define if you have the <ndir.h> header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the <sys/dir.h> header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the <sys/ndir.h> header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the <sys/select.h> header file. */ /* #define HAVE_SYS_SELECT_H 1 */ /* Define if you have the <sys/time.h> header file. */ /* #define HAVE_SYS_TIME_H 1 */ /* Define if you have the z library (-lz). */ #define HAVE_LIBZ 1 /* * Big-file configuration. */ #ifdef HAVE_FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif #ifdef HAVE_LARGEFILE_SOURCE #define _LARGEFILE_SOURCE #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_conv.c��������������������������������������������������������������������������0100644�0063146�0012731�00000016462�07427026535�014551� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_conv.c 11.4 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "db_am.h" #include "btree.h" #include "hash.h" #include "qam.h" /* * CDB___db_pgin -- * Primary page-swap routine. * * PUBLIC: int CDB___db_pgin __P((db_pgno_t, void *, DBT *)); */ int CDB___db_pgin(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; pginfo = (DB_PGINFO *)cookie->data; switch (((PAGE *)pp)->type) { case P_HASH: case P_HASHMETA: case P_INVALID: return (CDB___ham_pgin(pg, pp, cookie)); case P_BTREEMETA: case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LRECNO: case P_DUPLICATE: case P_OVERFLOW: return (CDB___bam_pgin(pg, pp, cookie)); case P_QAMMETA: case P_QAMDATA: return (CDB___qam_pgin_out(pg, pp, cookie)); default: break; } return (EINVAL); } /* * CDB___db_pgout -- * Primary page-swap routine. * * PUBLIC: int CDB___db_pgout __P((db_pgno_t, void *, DBT *)); */ int CDB___db_pgout(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; pginfo = (DB_PGINFO *)cookie->data; switch (((PAGE *)pp)->type) { case P_HASH: case P_HASHMETA: case P_INVALID: return (CDB___ham_pgout(pg, pp, cookie)); case P_BTREEMETA: case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LRECNO: case P_DUPLICATE: case P_OVERFLOW: return (CDB___bam_pgout(pg, pp, cookie)); case P_QAMMETA: case P_QAMDATA: return (CDB___qam_pgin_out(pg, pp, cookie)); default: break; } return (EINVAL); } /* * CDB___db_metaswap -- * Byteswap the common part of the meta-data page. * * PUBLIC: void CDB___db_metaswap __P((PAGE *)); */ void CDB___db_metaswap(pg) PAGE *pg; { u_int8_t *p; p = (u_int8_t *)pg; /* Swap the meta-data information. */ SWAP32(p); /* lsn.file */ SWAP32(p); /* lsn.offset */ SWAP32(p); /* pgno */ SWAP32(p); /* magic */ SWAP32(p); /* version */ SWAP32(p); /* pagesize */ p += 4; /* unused, page type, unused, unused */ SWAP32(p); /* free */ SWAP32(p); /* flags */ } /* * CDB___db_byteswap -- * Byteswap a page. * * PUBLIC: int CDB___db_byteswap __P((db_pgno_t, PAGE *, size_t, int)); */ int CDB___db_byteswap(pg, h, pagesize, pgin) db_pgno_t pg; PAGE *h; size_t pagesize; int pgin; { BINTERNAL *bi; BKEYDATA *bk; BOVERFLOW *bo; RINTERNAL *ri; db_indx_t i, len, tmp; u_int8_t *p, *end; COMPQUIET(pg, 0); if (pgin) { M_32_SWAP(h->lsn.file); M_32_SWAP(h->lsn.offset); M_32_SWAP(h->pgno); M_32_SWAP(h->prev_pgno); M_32_SWAP(h->next_pgno); M_16_SWAP(h->entries); M_16_SWAP(h->hf_offset); } switch (h->type) { case P_HASH: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) M_16_SWAP(h->inp[i]); switch (HPAGE_TYPE(h, i)) { case H_KEYDATA: break; case H_DUPLICATE: len = LEN_HKEYDATA(h, pagesize, i); p = HKEYDATA_DATA(P_ENTRY(h, i)); for (end = p + len; p < end;) { if (pgin) { P_16_SWAP(p); memcpy(&tmp, p, sizeof(db_indx_t)); p += sizeof(db_indx_t); } else { memcpy(&tmp, p, sizeof(db_indx_t)); SWAP16(p); } p += tmp; SWAP16(p); } break; case H_OFFDUP: p = HOFFPAGE_PGNO(P_ENTRY(h, i)); SWAP32(p); /* pgno */ break; case H_OFFPAGE: p = HOFFPAGE_PGNO(P_ENTRY(h, i)); SWAP32(p); /* pgno */ SWAP32(p); /* tlen */ break; } } /* * The offsets in the inp array are used to determine * the size of entries on a page; therefore they * cannot be converted until we've done all the * entries. */ if (!pgin) for (i = 0; i < NUM_ENT(h); i++) M_16_SWAP(h->inp[i]); break; case P_LBTREE: case P_LRECNO: case P_DUPLICATE: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) M_16_SWAP(h->inp[i]); /* * In the case of on-page duplicates, key information * should only be swapped once. */ if (h->type == P_LBTREE && i > 1) { if (pgin) { if (h->inp[i] == h->inp[i - 2]) continue; } else { M_16_SWAP(h->inp[i]); if (h->inp[i] == h->inp[i - 2]) continue; M_16_SWAP(h->inp[i]); } } bk = GET_BKEYDATA(h, i); switch (B_TYPE(bk->type)) { case B_KEYDATA: M_16_SWAP(bk->len); break; case B_DUPLICATE: case B_OVERFLOW: bo = (BOVERFLOW *)bk; M_32_SWAP(bo->pgno); M_32_SWAP(bo->tlen); break; } if (!pgin) M_16_SWAP(h->inp[i]); } break; case P_IBTREE: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) M_16_SWAP(h->inp[i]); bi = GET_BINTERNAL(h, i); M_16_SWAP(bi->len); M_32_SWAP(bi->pgno); M_32_SWAP(bi->nrecs); switch (B_TYPE(bi->type)) { case B_KEYDATA: break; case B_DUPLICATE: case B_OVERFLOW: bo = (BOVERFLOW *)bi->data; M_32_SWAP(bo->pgno); M_32_SWAP(bo->tlen); break; } if (!pgin) M_16_SWAP(h->inp[i]); } break; case P_IRECNO: for (i = 0; i < NUM_ENT(h); i++) { if (pgin) M_16_SWAP(h->inp[i]); ri = GET_RINTERNAL(h, i); M_32_SWAP(ri->pgno); M_32_SWAP(ri->nrecs); if (!pgin) M_16_SWAP(h->inp[i]); } break; case P_OVERFLOW: case P_INVALID: /* Nothing to do. */ break; default: return (EINVAL); } if (!pgin) { /* Swap the header information. */ M_32_SWAP(h->lsn.file); M_32_SWAP(h->lsn.offset); M_32_SWAP(h->pgno); M_32_SWAP(h->prev_pgno); M_32_SWAP(h->next_pgno); M_16_SWAP(h->entries); M_16_SWAP(h->hf_offset); } return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_dispatch.c����������������������������������������������������������������������0100644�0063146�0012731�00000026527�07427026535�015406� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_dispatch.c 11.7 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "log_auto.h" #include "txn.h" #include "txn_auto.h" #include "log.h" /* * CDB___db_dispatch -- * * This is the transaction dispatch function used by the db access methods. * It is designed to handle the record format used by all the access * methods (the one automatically generated by the db_{h,log,read}.sh * scripts in the tools directory). An application using a different * recovery paradigm will supply a different dispatch function to txn_open. * * PUBLIC: int CDB___db_dispatch __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_dispatch(dbenv, db, lsnp, redo, info) DB_ENV *dbenv; /* The environment. */ DBT *db; /* The log record upon which to dispatch. */ DB_LSN *lsnp; /* The lsn of the record being dispatched. */ int redo; /* Redo this op (or undo it). */ void *info; { u_int32_t rectype, txnid; memcpy(&rectype, db->data, sizeof(rectype)); memcpy(&txnid, (u_int8_t *)db->data + sizeof(rectype), sizeof(txnid)); switch (redo) { case TXN_REDO: case TXN_UNDO: return ((dbenv->dtab[rectype])(dbenv, db, lsnp, redo, info)); case TXN_OPENFILES: if (rectype < DB_txn_BEGIN ) return ((dbenv->dtab[rectype])(dbenv, db, lsnp, redo, info)); break; case TXN_BACKWARD_ROLL: /* * Running full recovery in the backward pass. If we've * seen this txnid before and added to it our commit list, * then we do nothing during this pass. If we've never * seen it, then we call the appropriate recovery routine * in "abort mode". * * We need to always undo DB_db_noop records, so that we * properly handle any aborts before the file was closed. */ if (rectype == DB_log_register || rectype == DB_txn_ckp || rectype == DB_db_noop || (CDB___db_txnlist_find(info, txnid) == DB_NOTFOUND && txnid != 0)) return ((dbenv->dtab[rectype])(dbenv, db, lsnp, TXN_UNDO, info)); break; case TXN_FORWARD_ROLL: /* * In the forward pass, if we haven't seen the transaction, * do nothing, else recovery it. * * We need to always redo DB_db_noop records, so that we * properly handle any commits after the file was closed. */ if (rectype == DB_log_register || rectype == DB_txn_ckp || rectype == DB_db_noop || CDB___db_txnlist_find(info, txnid) != DB_NOTFOUND) return ((dbenv->dtab[rectype])(dbenv, db, lsnp, TXN_REDO, info)); break; default: abort(); } return (0); } /* * CDB___db_add_recovery -- * * PUBLIC: int CDB___db_add_recovery __P((DB_ENV *, * PUBLIC: int (*)(DB_ENV *, DBT *, DB_LSN *, int, void *), u_int32_t)); */ int CDB___db_add_recovery(dbenv, func, ndx) DB_ENV *dbenv; int (*func) __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); u_int32_t ndx; { u_int32_t i; int ret; /* Check if we have to grow the table. */ if (ndx >= dbenv->dtab_size) { if ((ret = CDB___os_realloc( (DB_user_BEGIN + dbenv->dtab_size) * sizeof(dbenv->dtab[0]), NULL, &dbenv->dtab)) != 0) return (ret); for (i = dbenv->dtab_size, dbenv->dtab_size += DB_user_BEGIN; i < dbenv->dtab_size; ++i) dbenv->dtab[i] = NULL; } dbenv->dtab[ndx] = func; return (0); } /* * CDB___db_txnlist_init -- * Initialize transaction linked list. * * PUBLIC: int CDB___db_txnlist_init __P((void *)); */ int CDB___db_txnlist_init(retp) void *retp; { DB_TXNHEAD *headp; int ret; if ((ret = CDB___os_malloc(sizeof(DB_TXNHEAD), NULL, &headp)) != 0) return (ret); LIST_INIT(&headp->head); headp->maxid = 0; headp->generation = 1; *(void **)retp = headp; return (0); } /* * CDB___db_txnlist_add -- * Add an element to our transaction linked list. * * PUBLIC: int CDB___db_txnlist_add __P((void *, u_int32_t)); */ int CDB___db_txnlist_add(listp, txnid) void *listp; u_int32_t txnid; { DB_TXNHEAD *hp; DB_TXNLIST *elp; int ret; if ((ret = CDB___os_malloc(sizeof(DB_TXNLIST), NULL, &elp)) != 0) return (ret); hp = (DB_TXNHEAD *)listp; LIST_INSERT_HEAD(&hp->head, elp, links); elp->type = TXNLIST_TXNID; elp->u.t.txnid = txnid; if (txnid > hp->maxid) hp->maxid = txnid; elp->u.t.generation = hp->generation; return (0); } /* CDB___db_txnlist_close -- * * Call this when we close a file. It allows us to reconcile whether * we have done any operations on this file with whether the file appears * to have been deleted. If you never do any operations on a file, then * we assume it's OK to appear deleted. * * PUBLIC: int CDB___db_txnlist_close __P((void *, u_int32_t, u_int32_t)); */ int CDB___db_txnlist_close(listp, lid, count) void *listp; u_int32_t lid; u_int32_t count; { DB_TXNHEAD *hp; DB_TXNLIST *p; hp = (DB_TXNHEAD *)listp; for (p = hp->head.lh_first; p != NULL; p = p->links.le_next) { if (p->type == TXNLIST_DELETE) if (lid == p->u.d.fileid && !F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED)) { p->u.d.count += count; return (0); } } return (0); } /* * CDB___db_txnlist_delete -- * * Record that a file was missing or deleted. If the deleted * flag is set, then we've encountered a delete of a file, else we've * just encountered a file that is missing. The lid is the log fileid * and is only meaningful if deleted is not equal to 0. * * PUBLIC: int CDB___db_txnlist_delete __P((void *, char *, u_int32_t, int)); */ int CDB___db_txnlist_delete(listp, name, lid, deleted) void *listp; char *name; u_int32_t lid; int deleted; { DB_TXNHEAD *hp; DB_TXNLIST *p; int ret; hp = (DB_TXNHEAD *)listp; for (p = hp->head.lh_first; p != NULL; p = p->links.le_next) { if (p->type == TXNLIST_DELETE) if (strcmp(name, p->u.d.fname) == 0) { if (deleted) F_SET(&p->u.d, TXNLIST_FLAG_DELETED); else F_CLR(&p->u.d, TXNLIST_FLAG_CLOSED); return (0); } } /* Need to add it. */ if ((ret = CDB___os_malloc(sizeof(DB_TXNLIST), NULL, &p)) != 0) return (ret); LIST_INSERT_HEAD(&hp->head, p, links); p->type = TXNLIST_DELETE; p->u.d.flags = 0; if (deleted) F_SET(&p->u.d, TXNLIST_FLAG_DELETED); p->u.d.fileid = lid; p->u.d.count = 0; ret = CDB___os_strdup(name, &p->u.d.fname); return (ret); } /* * CDB___db_txnlist_end -- * Discard transaction linked list. Print out any error messages * for deleted files. * * PUBLIC: void CDB___db_txnlist_end __P((DB_ENV *, void *)); */ void CDB___db_txnlist_end(dbenv, listp) DB_ENV *dbenv; void *listp; { DB_TXNHEAD *hp; DB_TXNLIST *p; DB_LOG *lp; hp = (DB_TXNHEAD *)listp; lp = (DB_LOG *)dbenv->lg_handle; while (hp != NULL && (p = LIST_FIRST(&hp->head)) != LIST_END(&hp->head)) { LIST_REMOVE(p, links); if (p->type == TXNLIST_DELETE) { /* * If we have a file that is not deleted and has * some operations, we flag the warning. Since * the file could still be open, we need to check * the actual log table as well. */ if ((!F_ISSET(&p->u.d, TXNLIST_FLAG_DELETED) && p->u.d.count != 0) || (!F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED) && p->u.d.fileid < lp->dbentry_cnt && lp->dbentry[p->u.d.fileid].count != 0)) CDB___db_err(dbenv, "warning: %s: %s", p->u.d.fname, CDB_db_strerror(ENOENT)); CDB___os_freestr(p->u.d.fname); } CDB___os_free(p, sizeof(DB_TXNLIST)); } CDB___os_free(listp, sizeof(DB_TXNHEAD)); } /* * CDB___db_txnlist_find -- * Checks to see if a txnid with the current generation is in the * txnid list. * * PUBLIC: int CDB___db_txnlist_find __P((void *, u_int32_t)); */ int CDB___db_txnlist_find(listp, txnid) void *listp; u_int32_t txnid; { DB_TXNHEAD *hp; DB_TXNLIST *p; if ((hp = (DB_TXNHEAD *)listp) == NULL) return (DB_NOTFOUND); for (p = hp->head.lh_first; p != NULL; p = p->links.le_next) { if (p->type != TXNLIST_TXNID) continue; if (p->u.t.txnid == txnid && hp->generation == p->u.t.generation) return (0); } return (DB_NOTFOUND); } /* * CDB___db_txnlist_gen -- * Change the current generation number. * * PUBLIC: void CDB___db_txnlist_gen __P((void *, int)); */ void CDB___db_txnlist_gen(listp, incr) void *listp; int incr; { DB_TXNHEAD *hp; /* * During recovery generation numbers keep track of how many "restart" * checkpoints we've seen. Restart checkpoints occur whenever we take * a checkpoint and there are no outstanding transactions. When that * happens, we can reset transaction IDs back to 1. It always happens * at recovery and it prevents us from exhausting the transaction IDs * name space. */ hp = (DB_TXNHEAD *)listp; hp->generation += incr; } #ifdef DEBUG /* * CDB___db_txnlist_print -- * Print out the transaction list. * * PUBLIC: void CDB___db_txnlist_print __P((void *)); */ void CDB___db_txnlist_print(listp) void *listp; { DB_TXNHEAD *hp; DB_TXNLIST *p; hp = (DB_TXNHEAD *)listp; printf("Maxid: %lu Generation: %lu\n", (u_long)hp->maxid, (u_long)hp->generation); for (p = hp->head.lh_first; p != NULL; p = p->links.le_next) { switch (p->type) { case TXNLIST_TXNID: printf("TXNID: %lu(%lu)\n", (u_long)p->u.t.txnid, (u_long)p->u.t.generation); break; case TXNLIST_DELETE: printf("FILE: %s id=%d ops=%d %s %s\n", p->u.d.fname, p->u.d.fileid, p->u.d.count, F_ISSET(&p->u.d, TXNLIST_FLAG_DELETED) ? "(deleted)" : "(missing)", F_ISSET(&p->u.d, TXNLIST_FLAG_CLOSED) ? "(closed)" : "(open)"); break; default: printf("Unrecognized type: %d\n", p->type); break; } } } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_dispatch.h����������������������������������������������������������������������0100644�0063146�0012731�00000005705�07427026535�015406� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)db_dispatch.h 11.5 (Sleepycat) 9/9/99 */ #ifndef _DB_DISPATCH_H #define _DB_DISPATCH_H struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD; struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST; /* * Declarations and typedefs for the list of transaction IDs used during * recovery. This is a generic list used to pass along whatever information * we need during recovery. */ struct __db_txnhead { LIST_HEAD(__db_headlink, __db_txnlist) head; u_int32_t maxid; int32_t generation; }; #define TXNLIST_INVALID_ID 0xffffffff struct __db_txnlist { enum { TXNLIST_DELETE, TXNLIST_TXNID } type; LIST_ENTRY(__db_txnlist) links; union { struct { u_int32_t txnid; int32_t generation; } t; struct { #define TXNLIST_FLAG_DELETED 0x1 #define TXNLIST_FLAG_CLOSED 0x2 u_int32_t flags; u_int32_t fileid; u_int32_t count; char *fname; } d; } u; }; #define DB_log_BEGIN 0 #define DB_txn_BEGIN 5 #define DB_ham_BEGIN 20 #define DB_db_BEGIN 40 #define DB_bam_BEGIN 50 #define DB_qam_BEGIN 75 #define DB_ram_BEGIN 100 #define DB_crdel_BEGIN 140 #define DB_user_BEGIN 150 #define TXN_UNDO 0 #define TXN_REDO 1 #define TXN_BACKWARD_ROLL -1 #define TXN_FORWARD_ROLL -2 #define TXN_OPENFILES -3 #endif �����������������������������������������������������������htdig-3.2.0b6/db/db_dup.c���������������������������������������������������������������������������0100644�0063146�0012731�00000057305�07427026535�014375� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_dup.c 11.11 (Sleepycat) 11/3/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "hash.h" #include "lock.h" #include "db_am.h" static int CDB___db_addpage __P((DBC *, PAGE **, db_indx_t *)); static int CDB___db_dsplit __P((DBC *, PAGE **, db_indx_t *, u_int32_t)); /* * CDB___db_dput -- * Put a duplicate item onto a duplicate page at the given index. * * PUBLIC: int CDB___db_dput __P((DBC *, DBT *, PAGE **, db_indx_t *)); */ int CDB___db_dput(dbc, dbt, pp, indxp) DBC *dbc; DBT *dbt; PAGE **pp; db_indx_t *indxp; { BOVERFLOW bo; DBT *data_dbtp, hdr_dbt, *hdr_dbtp; PAGE *pagep; db_indx_t size, isize; db_pgno_t pgno; int ret; /* * We need some access method independent threshold for when we put * a duplicate item onto an overflow page. */ if (dbt->size > 0.25 * dbc->dbp->pgsize) { if ((ret = CDB___db_poff(dbc, dbt, &pgno)) != 0) return (ret); UMRW(bo.unused1); B_TSET(bo.type, B_OVERFLOW, 0); UMRW(bo.unused2); bo.tlen = dbt->size; bo.pgno = pgno; hdr_dbt.data = &bo; hdr_dbt.size = isize = BOVERFLOW_SIZE; hdr_dbtp = &hdr_dbt; size = BOVERFLOW_PSIZE; data_dbtp = NULL; } else { size = BKEYDATA_PSIZE(dbt->size); isize = BKEYDATA_SIZE(dbt->size); hdr_dbtp = NULL; data_dbtp = dbt; } pagep = *pp; if (size > P_FREESPACE(pagep)) { if (*indxp == NUM_ENT(*pp) && NEXT_PGNO(*pp) == PGNO_INVALID) ret = CDB___db_addpage(dbc, pp, indxp); else ret = CDB___db_dsplit(dbc, pp, indxp, isize); if (ret != 0) /* * XXX * Pages not returned to free list. */ return (ret); pagep = *pp; } /* * Now, pagep references the page on which to insert and indx is the * the location to insert. */ if ((ret = CDB___db_pitem(dbc, pagep, (u_int32_t)*indxp, isize, hdr_dbtp, data_dbtp)) != 0) return (ret); (void)CDB_memp_fset(dbc->dbp->mpf, pagep, DB_MPOOL_DIRTY); return (0); } /* * CDB___db_drem -- * Remove a duplicate at the given index on the given page. * * PUBLIC: int CDB___db_drem __P((DBC *, PAGE **, u_int32_t)); */ int CDB___db_drem(dbc, pp, indx) DBC *dbc; PAGE **pp; u_int32_t indx; { PAGE *pagep; int ret; pagep = *pp; /* Check if we are freeing a big item. */ if (B_TYPE(GET_BKEYDATA(pagep, indx)->type) == B_OVERFLOW) { if ((ret = CDB___db_doff(dbc, GET_BOVERFLOW(pagep, indx)->pgno)) != 0) return (ret); ret = CDB___db_ditem(dbc, pagep, indx, BOVERFLOW_SIZE); } else ret = CDB___db_ditem(dbc, pagep, indx, BKEYDATA_SIZE(GET_BKEYDATA(pagep, indx)->len)); if (ret != 0) return (ret); if (NUM_ENT(pagep) == 0) { /* * If the page is emptied, then the page is freed and the pp * parameter is set to reference the next, locked page in the * duplicate chain, if one exists. If there was no such page, * then it is set to NULL. * * !!! * CDB___db_relink will set the dirty bit for us. */ if ((ret = CDB___db_relink(dbc, DB_REM_PAGE, pagep, pp, 0)) != 0) return (ret); if ((ret = CDB___db_free(dbc, pagep)) != 0) return (ret); } else (void)CDB_memp_fset(dbc->dbp->mpf, pagep, DB_MPOOL_DIRTY); return (0); } /* * CDB___db_dend -- * Find the last page in a set of offpage duplicates. * * PUBLIC: int CDB___db_dend __P((DBC *, db_pgno_t, PAGE **)); */ int CDB___db_dend(dbc, pgno, pp) DBC *dbc; db_pgno_t pgno; PAGE **pp; { DB *dbp; PAGE *h; int ret; dbp = dbc->dbp; /* * This implements DB_KEYLAST. The last page is returned in pp; pgno * should be the page number of the first page of the duplicate chain. * * *pp may be non-NULL -- if given a valid page use it. */ if (*pp != NULL) goto started; for (;;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, pp)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } started: h = *pp; if ((pgno = NEXT_PGNO(h)) == PGNO_INVALID) break; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); } return (0); } /* * CDB___db_dsplit -- * Split a page of duplicates, calculating the split point based * on an element of size "size" being added at "*indxp". * On entry hp contains a pointer to the page-pointer of the original * page. On exit, it returns a pointer to the page containing "*indxp" * and "indxp" has been modified to reflect the index on the new page * where the element should be added. The function returns with * the page on which the insert should happen, not yet put. */ static int CDB___db_dsplit(dbc, hp, indxp, size) DBC *dbc; PAGE **hp; db_indx_t *indxp; u_int32_t size; { PAGE *h, *np, *tp; BKEYDATA *bk; DBT page_dbt; DB *dbp; size_t pgsize; db_indx_t halfbytes, i, indx, lastsum, nindex, oindex, s, sum; int did_indx, ret, t_ret; h = *hp; indx = *indxp; ret = 0; dbp = dbc->dbp; pgsize = dbp->pgsize; /* Create a temporary page to do compaction onto. */ if ((ret = CDB___os_malloc(pgsize, NULL, &tp)) != 0) return (ret); /* Create new page for the split. */ if ((ret = CDB___db_new(dbc, P_DUPLICATE, &np)) != 0) { CDB___os_free(tp, pgsize); return (ret); } P_INIT(np, pgsize, PGNO(np), PGNO(h), NEXT_PGNO(h), 0, P_DUPLICATE); P_INIT(tp, pgsize, PGNO(h), PREV_PGNO(h), PGNO(np), 0, P_DUPLICATE); /* Figure out the split point */ halfbytes = (pgsize - HOFFSET(h)) / 2; did_indx = 0; for (sum = 0, lastsum = 0, i = 0; i < NUM_ENT(h); i++) { if (i == indx) { sum += size; did_indx = 1; if (lastsum < halfbytes && sum >= halfbytes) { /* We've crossed the halfway point. */ if ((db_indx_t)(halfbytes - lastsum) < (db_indx_t)(sum - halfbytes)) { *hp = np; *indxp = 0; } else *indxp = i; break; } *indxp = i; lastsum = sum; } if (B_TYPE(GET_BKEYDATA(h, i)->type) == B_KEYDATA) sum += BKEYDATA_SIZE(GET_BKEYDATA(h, i)->len); else sum += BOVERFLOW_SIZE; if (lastsum < halfbytes && sum >= halfbytes) { /* We've crossed the halfway point. */ if ((db_indx_t)(sum - halfbytes) < (db_indx_t)(halfbytes - lastsum)) i++; break; } } /* * Check if we have set the return values of the index pointer and * page pointer. */ if (!did_indx) { *hp = np; *indxp = indx - i; } if (DB_LOGGING(dbc)) { page_dbt.size = dbp->pgsize; page_dbt.data = h; if ((ret = CDB___db_split_log(dbp->dbenv, dbc->txn, &LSN(h), 0, DB_SPLITOLD, dbp->log_fileid, PGNO(h), &page_dbt, &LSN(h))) != 0) { CDB___os_free(tp, pgsize); return (ret); } LSN(tp) = LSN(h); } /* * If it's a btree, adjust the cursors. * * i is the index of the first element to move onto the new page. */ if (dbp->type == DB_BTREE) CDB___bam_ca_split(dbp, PGNO(h), PGNO(h), PGNO(np), i, 0); if (dbp->type == DB_HASH) CDB___ham_ca_split(dbp, PGNO(h), PGNO(h), PGNO(np), i, 0); for (nindex = 0, oindex = i; oindex < NUM_ENT(h); oindex++) { bk = GET_BKEYDATA(h, oindex); if (B_TYPE(bk->type) == B_KEYDATA) s = BKEYDATA_SIZE(bk->len); else s = BOVERFLOW_SIZE; np->inp[nindex++] = HOFFSET(np) -= s; memcpy((u_int8_t *)np + HOFFSET(np), bk, s); NUM_ENT(np)++; } /* * Now do data compaction by copying the remaining stuff onto the * temporary page and then copying it back to the real page. */ for (nindex = 0, oindex = 0; oindex < i; oindex++) { bk = GET_BKEYDATA(h, oindex); if (B_TYPE(bk->type) == B_KEYDATA) s = BKEYDATA_SIZE(bk->len); else s = BOVERFLOW_SIZE; tp->inp[nindex++] = HOFFSET(tp) -= s; memcpy((u_int8_t *)tp + HOFFSET(tp), bk, s); NUM_ENT(tp)++; } /* * This page (the temporary) should be only half full, so we do two * memcpy's, one for the top of the page and one for the bottom of * the page. This way we avoid copying the middle which should be * about half a page. */ memcpy(h, tp, LOFFSET(tp)); memcpy((u_int8_t *)h + HOFFSET(tp), (u_int8_t *)tp + HOFFSET(tp), pgsize - HOFFSET(tp)); CDB___os_free(tp, pgsize); if (DB_LOGGING(dbc)) { /* * XXX * If either of these fails, are we leaving pages pinned? * Yes, but it seems like this happens in error case. */ page_dbt.size = pgsize; page_dbt.data = h; if ((ret = CDB___db_split_log(dbp->dbenv, dbc->txn, &LSN(h), 0, DB_SPLITNEW, dbp->log_fileid, PGNO(h), &page_dbt, &LSN(h))) != 0) return (ret); page_dbt.size = pgsize; page_dbt.data = np; if ((ret = CDB___db_split_log(dbp->dbenv, dbc->txn, &LSN(np), 0, DB_SPLITNEW, dbp->log_fileid, PGNO(np), &page_dbt, &LSN(np))) != 0) return (ret); } /* * Finally, if there was a next page after the page being * split, fix its prev pointer. */ if (np->next_pgno != PGNO_INVALID) ret = CDB___db_relink(dbc, DB_ADD_PAGE, np, NULL, 1); /* * Figure out if the location we're interested in is on the new * page, and if so, reset the callers' pointer. Push the other * page back to the store. */ if (*hp == h) t_ret = CDB_memp_fput(dbp->mpf, np, DB_MPOOL_DIRTY); else t_ret = CDB_memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY); return (ret != 0 ? ret : t_ret); } /* * CDB___db_ditem -- * Remove an item from a page. * * PUBLIC: int CDB___db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t)); */ int CDB___db_ditem(dbc, pagep, indx, nbytes) DBC *dbc; PAGE *pagep; u_int32_t indx, nbytes; { DB *dbp; DBT ldbt; db_indx_t cnt, offset; int ret; u_int8_t *from; dbp = dbc->dbp; if (DB_LOGGING(dbc)) { ldbt.data = P_ENTRY(pagep, indx); ldbt.size = nbytes; if ((ret = CDB___db_addrem_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, DB_REM_DUP, dbp->log_fileid, PGNO(pagep), (u_int32_t)indx, nbytes, &ldbt, NULL, &LSN(pagep))) != 0) return (ret); } /* * If there's only a single item on the page, we don't have to * work hard. */ if (NUM_ENT(pagep) == 1) { NUM_ENT(pagep) = 0; HOFFSET(pagep) = dbp->pgsize; return (0); } /* * Pack the remaining key/data items at the end of the page. Use * memmove(3), the regions may overlap. */ from = (u_int8_t *)pagep + HOFFSET(pagep); memmove(from + nbytes, from, pagep->inp[indx] - HOFFSET(pagep)); HOFFSET(pagep) += nbytes; /* Adjust the indices' offsets. */ offset = pagep->inp[indx]; for (cnt = 0; cnt < NUM_ENT(pagep); ++cnt) if (pagep->inp[cnt] < offset) pagep->inp[cnt] += nbytes; /* Shift the indices down. */ --NUM_ENT(pagep); if (indx != NUM_ENT(pagep)) memmove(&pagep->inp[indx], &pagep->inp[indx + 1], sizeof(db_indx_t) * (NUM_ENT(pagep) - indx)); return (0); } /* * CDB___db_pitem -- * Put an item on a page. * * PUBLIC: int CDB___db_pitem * PUBLIC: __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *)); */ int CDB___db_pitem(dbc, pagep, indx, nbytes, hdr, data) DBC *dbc; PAGE *pagep; u_int32_t indx; u_int32_t nbytes; DBT *hdr, *data; { DB *dbp; BKEYDATA bk; DBT thdr; int ret; u_int8_t *p; /* * Put a single item onto a page. The logic figuring out where to * insert and whether it fits is handled in the caller. All we do * here is manage the page shuffling. We cheat a little bit in that * we don't want to copy the dbt on a normal put twice. If hdr is * NULL, we create a BKEYDATA structure on the page, otherwise, just * copy the caller's information onto the page. * * This routine is also used to put entries onto the page where the * entry is pre-built, e.g., during recovery. In this case, the hdr * will point to the entry, and the data argument will be NULL. * * !!! * There's a tremendous potential for off-by-one errors here, since * the passed in header sizes must be adjusted for the structure's * placeholder for the trailing variable-length data field. */ dbp = dbc->dbp; if (DB_LOGGING(dbc)) if ((ret = CDB___db_addrem_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, DB_ADD_DUP, dbp->log_fileid, PGNO(pagep), (u_int32_t)indx, nbytes, hdr, data, &LSN(pagep))) != 0) return (ret); if (hdr == NULL) { B_TSET(bk.type, B_KEYDATA, 0); bk.len = data == NULL ? 0 : data->size; thdr.data = &bk; thdr.size = SSZA(BKEYDATA, data); hdr = &thdr; } /* Adjust the index table, then put the item on the page. */ if (indx != NUM_ENT(pagep)) memmove(&pagep->inp[indx + 1], &pagep->inp[indx], sizeof(db_indx_t) * (NUM_ENT(pagep) - indx)); HOFFSET(pagep) -= nbytes; pagep->inp[indx] = HOFFSET(pagep); ++NUM_ENT(pagep); p = P_ENTRY(pagep, indx); memcpy(p, hdr->data, hdr->size); if (data != NULL) memcpy(p + hdr->size, data->data, data->size); return (0); } /* * CDB___db_relink -- * Relink around a deleted page. * * PUBLIC: int CDB___db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int)); */ int CDB___db_relink(dbc, add_rem, pagep, new_next, needlock) DBC *dbc; u_int32_t add_rem; PAGE *pagep, **new_next; int needlock; { DB *dbp; PAGE *np, *pp; DB_LOCK npl, ppl; DB_LSN *nlsnp, *plsnp; int ret; ret = 0; np = pp = NULL; npl.off = ppl.off = LOCK_INVALID; nlsnp = plsnp = NULL; dbp = dbc->dbp; /* * Retrieve and lock the one/two pages. For a remove, we may need * two pages (the before and after). For an add, we only need one * because, the split took care of the prev. */ if (pagep->next_pgno != PGNO_INVALID) { if (needlock && (ret = CDB___db_lget(dbc, 0, pagep->next_pgno, DB_LOCK_WRITE, 0, &npl)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pagep->next_pgno, 0, &np)) != 0) { (void)CDB___db_pgerr(dbp, pagep->next_pgno); goto err; } nlsnp = &np->lsn; } if (add_rem == DB_REM_PAGE && pagep->prev_pgno != PGNO_INVALID) { if (needlock && (ret = CDB___db_lget(dbc, 0, pagep->prev_pgno, DB_LOCK_WRITE, 0, &ppl)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pagep->prev_pgno, 0, &pp)) != 0) { (void)CDB___db_pgerr(dbp, pagep->next_pgno); goto err; } plsnp = &pp->lsn; } /* Log the change. */ if (DB_LOGGING(dbc)) { if ((ret = CDB___db_relink_log(dbp->dbenv, dbc->txn, &pagep->lsn, 0, add_rem, dbp->log_fileid, pagep->pgno, &pagep->lsn, pagep->prev_pgno, plsnp, pagep->next_pgno, nlsnp)) != 0) goto err; if (np != NULL) np->lsn = pagep->lsn; if (pp != NULL) pp->lsn = pagep->lsn; } /* * Modify and release the two pages. * * !!! * The parameter new_next gets set to the page following the page we * are removing. If there is no following page, then new_next gets * set to NULL. */ if (np != NULL) { if (add_rem == DB_ADD_PAGE) np->prev_pgno = pagep->pgno; else np->prev_pgno = pagep->prev_pgno; if (new_next == NULL) ret = CDB_memp_fput(dbp->mpf, np, DB_MPOOL_DIRTY); else { *new_next = np; ret = CDB_memp_fset(dbp->mpf, np, DB_MPOOL_DIRTY); } if (ret != 0) goto err; if (needlock) (void)__TLPUT(dbc, npl); } else if (new_next != NULL) *new_next = NULL; if (pp != NULL) { pp->next_pgno = pagep->next_pgno; if ((ret = CDB_memp_fput(dbp->mpf, pp, DB_MPOOL_DIRTY)) != 0) goto err; if (needlock) (void)__TLPUT(dbc, ppl); } return (0); err: if (np != NULL) (void)CDB_memp_fput(dbp->mpf, np, 0); if (needlock && npl.off != LOCK_INVALID) (void)__TLPUT(dbc, npl); if (pp != NULL) (void)CDB_memp_fput(dbp->mpf, pp, 0); if (needlock && ppl.off != LOCK_INVALID) (void)__TLPUT(dbc, ppl); return (ret); } /* * CDB___db_ddup -- * Delete an offpage chain of duplicates. * * PUBLIC: int CDB___db_ddup __P((DBC *, db_pgno_t)); */ int CDB___db_ddup(dbc, pgno) DBC *dbc; db_pgno_t pgno; { DB *dbp; PAGE *pagep; DBT tmp_dbt; int ret; dbp = dbc->dbp; do { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &pagep)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } if (DB_LOGGING(dbc)) { tmp_dbt.data = pagep; tmp_dbt.size = dbp->pgsize; if ((ret = CDB___db_split_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, DB_SPLITOLD, dbp->log_fileid, PGNO(pagep), &tmp_dbt, &LSN(pagep))) != 0) return (ret); } pgno = pagep->next_pgno; if ((ret = CDB___db_free(dbc, pagep)) != 0) return (ret); } while (pgno != PGNO_INVALID); return (0); } /* * CDB___db_addpage -- * Create a new page and link it onto the next_pgno field of the * current page. */ static int CDB___db_addpage(dbc, hp, indxp) DBC *dbc; PAGE **hp; db_indx_t *indxp; { DB *dbp; PAGE *newpage; int ret; dbp = dbc->dbp; if ((ret = CDB___db_new(dbc, P_DUPLICATE, &newpage)) != 0) return (ret); if (DB_LOGGING(dbc)) { if ((ret = CDB___db_addpage_log(dbp->dbenv, dbc->txn, &LSN(*hp), 0, dbp->log_fileid, PGNO(*hp), &LSN(*hp), PGNO(newpage), &LSN(newpage))) != 0) { return (ret); } LSN(newpage) = LSN(*hp); } PREV_PGNO(newpage) = PGNO(*hp); NEXT_PGNO(*hp) = PGNO(newpage); if ((ret = CDB_memp_fput(dbp->mpf, *hp, DB_MPOOL_DIRTY)) != 0) return (ret); *hp = newpage; *indxp = 0; return (0); } /* * CDB___db_dsearch -- * Search a set of duplicates for the proper position for a new duplicate. * * + pgno is the page number of the page on which to begin searching. * Since we can continue duplicate searches, it might not be the first * page. * * + If we are continuing a search, then *pp may be non-NULL in which * case we do not have to retrieve the page. * * + If we are continuing a search, then *indxp contains the first * on pgno of where we should begin the search. * * NOTE: if there is no comparison function, then continuing is * meaningless, and *pp should always be NULL and *indxp will be * ignored. * * 3 return values:: * * + pp is the returned page pointer of where this element should go. * + indxp is the returned index on that page * + cmpp is the returned final comparison result. * * PUBLIC: int CDB___db_dsearch __P((DBC *, * PUBLIC: int, DBT *, db_pgno_t, db_indx_t *, PAGE **, int *)); */ int CDB___db_dsearch(dbc, is_insert, dbt, pgno, indxp, pp, cmpp) DBC *dbc; int is_insert, *cmpp; DBT *dbt; db_pgno_t pgno; db_indx_t *indxp; PAGE **pp; { DB *dbp; PAGE *h; db_indx_t base, indx, lim; db_pgno_t save_pgno; int ret, firstpg; dbp = dbc->dbp; if (dbp->dup_compare == NULL) { /* * We may have been given a valid page, but we may not be * able to use it. The problem is that the application is * doing a join and we're trying to continue the search, * but since the items aren't sorted, we can't. Discard * the page if it's not the one we're going to start with * anyway. */ if (*pp != NULL && (*pp)->pgno != pgno) { if ((ret = CDB_memp_fput(dbp->mpf, *pp, 0)) != 0) return (ret); *pp = NULL; } /* * If no duplicate function is specified, just go to the end * of the duplicate set. */ if (is_insert) { if ((ret = CDB___db_dend(dbc, pgno, pp)) != 0) return (ret); *indxp = NUM_ENT(*pp); return (0); } /* * We are looking for a specific duplicate, so do a linear * search. */ firstpg = 1; /* Is this the first page we're searching? */ if (*pp != NULL) goto nocmp_started; for (;;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, pp)) != 0) goto pg_err; nocmp_started: h = *pp; base = (F_ISSET(dbc, DBC_CONTINUE) && (firstpg == 1)) ? *indxp : 0; for (*indxp = base; *indxp < NUM_ENT(h); ++*indxp) { if ((*cmpp = CDB___bam_cmp(dbp, dbt, h, *indxp, CDB___bam_defcmp)) != 0) continue; /* * The duplicate may have already been deleted, * if it's a btree page, in which case we skip * it. */ if (dbp->type == DB_BTREE && B_DISSET(GET_BKEYDATA(h, *indxp)->type)) continue; return (0); } if ((pgno = h->next_pgno) == PGNO_INVALID) break; /* * Moving on to another page; make sure we * search from the beginning rather than *indxp. */ firstpg = 0; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); } *cmpp = 1; /* We didn't succeed... */ return (0); } /* * We have a comparison routine, i.e., the duplicates are sorted. * Walk through the chain of duplicates, checking the last entry * on each page to decide if it's the page we want to search. * * *pp may be non-NULL -- if we were given a valid page (e.g., are * in mid-search), then use the provided page. */ if (*pp != NULL) goto cmp_started; for (;;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, pp)) != 0) goto pg_err; cmp_started: h = *pp; if ((pgno = h->next_pgno) == PGNO_INVALID || CDB___bam_cmp(dbp, dbt, h, h->entries - 1, dbp->dup_compare) <= 0) break; /* * Even when continuing a search, make sure we don't skip * entries on a new page */ *indxp = 0; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); } /* Next, do a binary search on the page. */ base = F_ISSET(dbc, DBC_CONTINUE) ? *indxp : 0; for (lim = NUM_ENT(h) - base; lim != 0; lim >>= 1) { indx = base + (lim >> 1); if ((*cmpp = CDB___bam_cmp(dbp, dbt, h, indx, dbp->dup_compare)) == 0) { /* * If DBC_CONTINUE is set, we want to make sure * we return the first duplicate duplicate * with index larger than *indxp. Search * backwards until we're sure we have such. * * XXX: For the various uses of CDB___db_dsearch * outside of joins, what's the correct behavior * in the presence of duplicate duplicates? Someone * should ponder this, and perhaps remove the * following check and/or add different ones. */ if (F_ISSET(dbc, DBC_CONTINUE)) { if (indx != 0) { for (indx--; indx >= *indxp; indx--) { if (CDB___bam_cmp(dbp, dbt, h, indx, dbp->dup_compare) != 0) break; /* * Check for exit; if indx * == 0 here, we know we * want to return 0 without * decrementing into an * overflow condition (indx * is unsigned), so jump out. */ if (indx == 0) goto postinc; } /* * We've decremented one too far; * either indx is now less than * *indxp, or it's pointing at a dup * that doesn't match. */ indx++; } } postinc: *indxp = indx; if (dbp->type != DB_BTREE || !B_DISSET(GET_BKEYDATA(h, *indxp)->type)) return (0); goto check_delete; } if (*cmpp > 0) { base = indx + 1; lim--; } } /* * Base references the smallest index larger than the supplied DBT's * data item, potentially both 0 and NUM_ENT. */ *indxp = base; return (0); check_delete: /* * The duplicate may have already been deleted, if it's a btree page, * in which case we wander around, hoping to find an entry that hasn't * been deleted. First, wander in a forwardly direction. */ save_pgno = (*pp)->pgno; for (++*indxp;;) { for (; *indxp < NUM_ENT(h); ++*indxp) { if ((*cmpp = CDB___bam_cmp(dbp, dbt, h, *indxp, dbp->dup_compare)) != 0) goto check_delete_rev; if (!B_DISSET(GET_BKEYDATA(h, *indxp)->type)) return (0); } if ((pgno = h->next_pgno) == PGNO_INVALID) break; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, pp)) != 0) goto pg_err; h = *pp; *indxp = 0; } check_delete_rev: /* Go back to where we started, and wander in a backwardly direction. */ if (h->pgno != save_pgno) { if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &save_pgno, 0, pp)) != 0) goto pg_err; h = *pp; } for (;;) { while (*indxp > 0) { --*indxp; if ((*cmpp = CDB___bam_cmp(dbp, dbt, h, *indxp, dbp->dup_compare)) != 0) goto check_delete_fail; if (!B_DISSET(GET_BKEYDATA(h, *indxp)->type)) return (0); } if ((pgno = h->prev_pgno) == PGNO_INVALID) break; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, pp)) != 0) goto pg_err; h = *pp; *indxp = NUM_ENT(h); } check_delete_fail: *cmpp = 1; /* We didn't succeed... */ return (0); pg_err: CDB___db_pgerr(dbp, pgno); return (ret); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_err.c���������������������������������������������������������������������������0100644�0063146�0012731�00000022752�10000513627�014353� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_err.c 11.10 (Sleepycat) 11/8/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef _MSC_VER /* WIN32 */ #ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif #endif #endif #include "db_int.h" #include "db_shash.h" #include "lock.h" #include "lock_ext.h" #include "log.h" #include "log_ext.h" #include "mp.h" #include "mp_ext.h" #include "txn.h" #include "txn_ext.h" #include "common_ext.h" #include "db_auto.h" static void CDB___db_errcall __P((const DB_ENV *, int, int, const char *, va_list)); static void CDB___db_errfile __P((const DB_ENV *, int, int, const char *, va_list)); /* * CDB___db_fchk -- * General flags checking routine. * * PUBLIC: int CDB___db_fchk __P((DB_ENV *, const char *, u_int32_t, u_int32_t)); */ int CDB___db_fchk(dbenv, name, flags, ok_flags) DB_ENV *dbenv; const char *name; u_int32_t flags, ok_flags; { return (LF_ISSET(~ok_flags) ? CDB___db_ferr(dbenv, name, 0) : 0); } /* * CDB___db_fcchk -- * General combination flags checking routine. * * PUBLIC: int CDB___db_fcchk * PUBLIC: __P((DB_ENV *, const char *, u_int32_t, u_int32_t, u_int32_t)); */ int CDB___db_fcchk(dbenv, name, flags, flag1, flag2) DB_ENV *dbenv; const char *name; u_int32_t flags, flag1, flag2; { return (LF_ISSET(flag1) && LF_ISSET(flag2) ? CDB___db_ferr(dbenv, name, 1) : 0); } /* * CDB___db_ferr -- * Common flag errors. * * PUBLIC: int CDB___db_ferr __P((const DB_ENV *, const char *, int)); */ int CDB___db_ferr(dbenv, name, iscombo) const DB_ENV *dbenv; const char *name; int iscombo; { CDB___db_err(dbenv, "illegal flag %sspecified to %s", iscombo ? "combination " : "", name); return (EINVAL); } /* * CDB___db_pgerr -- * Error when unable to retrieve a specified page. * * PUBLIC: int CDB___db_pgerr __P((DB *, db_pgno_t)); */ int CDB___db_pgerr(dbp, pgno) DB *dbp; db_pgno_t pgno; { /* * Three things are certain: * Death, taxes, and lost data. * Guess which has occurred. */ CDB___db_err(dbp->dbenv, "unable to create/retrieve page %lu", (u_long)pgno); return (CDB___db_panic(dbp->dbenv, EIO)); } /* * CDB___db_pgfmt -- * Error when a page has the wrong format. * * PUBLIC: int CDB___db_pgfmt __P((DB *, db_pgno_t)); */ int CDB___db_pgfmt(dbp, pgno) DB *dbp; db_pgno_t pgno; { CDB___db_err(dbp->dbenv, "page %lu: illegal page type or format", (u_long)pgno); return (CDB___db_panic(dbp->dbenv, EINVAL)); } #ifdef DIAGNOSTIC /* * __db_assert -- * Error when an assertion fails. Only checked if #DIAGNOSTIC defined. * * PUBLIC: #ifdef DIAGNOSTIC * PUBLIC: void __db_assert __P((const char *, const char *, int)); * PUBLIC: #endif */ void __db_assert(failedexpr, file, line) const char *failedexpr, *file; int line; { (void)fprintf(stderr, "__db_assert: \"%s\" failed: file \"%s\", line %d\n", failedexpr, file, line); fflush(stderr); /* We want a stack trace of how this could possibly happen. */ abort(); /* NOTREACHED */ } #endif /* * CDB___db_panic_msg -- * Just report that someone else paniced. * * PUBLIC: int CDB___db_panic_msg __P((DB_ENV *)); */ int CDB___db_panic_msg(dbenv) DB_ENV *dbenv; { CDB___db_err(dbenv, "region error detected; run recovery."); /* Hack to make fatal errors really fatal... */ fprintf(stderr,"DB_RUNRECOVERY: Fatal error, run database recovery\n"); exit(1); return (DB_RUNRECOVERY); } /* * CDB___db_panic -- * Lock out the tree due to unrecoverable error. * * PUBLIC: int CDB___db_panic __P((DB_ENV *, int)); */ int CDB___db_panic(dbenv, errval) DB_ENV *dbenv; int errval; { if (dbenv != NULL) { ((REGENV *)((REGINFO *)dbenv->reginfo)->addr)->panic = 1; dbenv->db_panic = errval; CDB___db_err(dbenv, "PANIC: %s", CDB_db_strerror(errval)); if (dbenv->db_paniccall != NULL) dbenv->db_paniccall(dbenv, errval); } /* * Chaos reigns within. * Reflect, repent, and reboot. * Order shall return. */ /* Hack to make fatal errors really fatal... */ fprintf(stderr,"DB_RUNRECOVERY: Fatal error, run database recovery\n"); exit(1); return (DB_RUNRECOVERY); } /* * CDB_db_strerror -- * ANSI C strerror(3) for DB. */ char * CDB_db_strerror(error) int error; { if (error == 0) return ("Successful return: 0"); if (error > 0) return (strerror(error)); /* * !!! * The Tcl API requires that some of these return strings be compared * against strings stored in application scripts. So, any of these * errors that do not invariably result in a Tcl exception may not be * altered. */ switch (error) { case DB_INCOMPLETE: return ("DB_INCOMPLETE: Cache flush was unable to complete"); case DB_KEYEMPTY: return ("DB_KEYEMPTY: Non-existent key/data pair"); case DB_KEYEXIST: return ("DB_KEYEXIST: Key/data pair already exists"); case DB_LOCK_DEADLOCK: return ("DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock"); case DB_LOCK_NOTGRANTED: return ("DB_LOCK_NOTGRANTED: Lock not granted"); case DB_NOTFOUND: return ("DB_NOTFOUND: No matching key/data pair found"); case DB_OLD_VERSION: return ("DB_OLDVERSION: Database requires a version upgrade"); case DB_RUNRECOVERY: return ("DB_RUNRECOVERY: Fatal error, run database recovery"); default: { /* * !!! * Room for a 64-bit number + slop. This buffer is only used * if we're given an unknown error, which should never happen. * Note, however, we're no longer thread-safe if it does. */ static char ebuf[40]; (void)snprintf(ebuf, sizeof(ebuf), "Unknown error: %d", error); return(ebuf); } } } /* * CDB___db_err -- * Standard DB error routine. The same as db_errx, except that we * don't write to stderr if no output mechanism was specified. * * PUBLIC: #ifdef __STDC__ * PUBLIC: void CDB___db_err __P((const DB_ENV *, const char *, ...)); * PUBLIC: #else * PUBLIC: void CDB___db_err(); * PUBLIC: #endif */ void #if defined( __STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___db_err(const DB_ENV *dbenv, const char *fmt, ...) #else CDB___db_err(dbenv, fmt, va_alist) const DB_ENV *dbenv; const char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif CDB___db_real_err(dbenv, 0, 0, 0, fmt, ap); va_end(ap); } /* * CDB___db_real_err -- * All the DB error routines end up here. * * PUBLIC: void CDB___db_real_err * PUBLIC: __P((const DB_ENV *, int, int, int, const char *, va_list)); */ void CDB___db_real_err(dbenv, error, error_set, stderr_default, fmt, ap) const DB_ENV *dbenv; int error, error_set, stderr_default; const char *fmt; va_list ap; { if (dbenv != NULL && dbenv->db_errcall != NULL) CDB___db_errcall(dbenv, error, error_set, fmt, ap); if (dbenv != NULL && dbenv->db_errfile != NULL) CDB___db_errfile(dbenv, error, error_set, fmt, ap); if (stderr_default && (dbenv == NULL || (dbenv->db_errcall == NULL && dbenv->db_errfile == NULL))) CDB___db_errfile(NULL, error, error_set, fmt, ap); } /* * CDB___db_errcall -- * Do the error message work for callback functions. */ static void CDB___db_errcall(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; int error, error_set; const char *fmt; va_list ap; { char *p; char __errbuf[2048]; /* XXX: END OF THE STACK DON'T TRUST SPRINTF. */ p = __errbuf; if (fmt != NULL) { p += vsnprintf(__errbuf, sizeof(__errbuf), fmt, ap); if (error_set) { *p++ = ':'; *p++ = ' '; } } if (error_set) (void)strcpy(p, CDB_db_strerror(error)); dbenv->db_errcall(dbenv->db_errpfx, __errbuf); } /* * CDB___db_errfile -- * Do the error message work for FILE *s. */ static void CDB___db_errfile(dbenv, error, error_set, fmt, ap) const DB_ENV *dbenv; int error, error_set; const char *fmt; va_list ap; { FILE *fp; fp = dbenv == NULL || dbenv->db_errfile == NULL ? stderr : dbenv->db_errfile; if (dbenv != NULL && dbenv->db_errpfx != NULL) (void)fprintf(fp, "%s: ", dbenv->db_errpfx); if (fmt != NULL) { (void)vfprintf(fp, fmt, ap); if (error_set) (void)fprintf(fp, ": "); } if (error_set) (void)fprintf(fp, "%s", CDB_db_strerror(error)); (void)fprintf(fp, "\n"); (void)fflush(fp); } /* * CDB___db_logmsg -- * Write information into the DB log. * * PUBLIC: #ifdef __STDC__ * PUBLIC: int CDB___db_logmsg __P((DB_ENV *, * PUBLIC: DB_TXN *, const char *, u_int32_t, const char *, ...)); * PUBLIC: #else * PUBLIC: int CDB___db_logmsg(); * PUBLIC: #endif */ int #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___db_logmsg(DB_ENV *dbenv, DB_TXN *txnid, const char *opname, u_int32_t flags, const char *fmt, ...) #else CDB___db_logmsg(dbenv, txnid, opname, flags, fmt, va_alist) DB_ENV *dbenv; DB_TXN *txnid; const char *opname, *fmt; u_int32_t flags; va_dcl #endif { DBT opdbt, msgdbt; DB_LSN lsn; va_list ap; char __logbuf[2048]; /* XXX: END OF THE STACK DON'T TRUST SPRINTF. */ if (!F_ISSET(dbenv, DB_ENV_LOGGING)) return (0); memset(&opdbt, 0, sizeof(opdbt)); opdbt.data = (void *)opname; opdbt.size = strlen(opname) + 1; memset(&msgdbt, 0, sizeof(msgdbt)); msgdbt.data = __logbuf; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif msgdbt.size = vsnprintf(__logbuf, sizeof(__logbuf), fmt, ap); va_end(ap); return (CDB___db_debug_log(dbenv, txnid, &lsn, flags, &opdbt, -1, &msgdbt, NULL, 0)); } ����������������������htdig-3.2.0b6/db/db_ext.h���������������������������������������������������������������������������0100644�0063146�0012731�00000012660�07427026535�014405� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _db_ext_h_ #define _db_ext_h_ int CDB___crdel_init_recover __P((DB_ENV *)); int CDB___crdel_fileopen_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_metasub_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_metapage_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___crdel_delete_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_open __P((DB *, const char *, const char *, DBTYPE, u_int32_t, int)); int CDB___db_close __P((DB *, u_int32_t)); int CDB___db_remove __P((DB *, const char *, const char *, u_int32_t)); int CDB___db_backup_name __P((const char *, char **, DB_LSN *)); int __db_testcopy __P((DB *, const char *)); int CDB___db_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t)); int CDB___db_c_dup __P((DBC *, DBC **, u_int32_t)); int CDB___db_cprint __P((DB *)); int CDB___db_c_destroy __P((DBC *)); int CDB___db_fd __P((DB *, int *)); int CDB___db_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int CDB___db_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int CDB___db_sync __P((DB *, u_int32_t)); int CDB___db_log_page __P((DB *, const char *, DB_LSN *, db_pgno_t, PAGE *)); int CDB___db_init_recover __P((DB_ENV *)); int CDB___db_pgin __P((db_pgno_t, void *, DBT *)); int CDB___db_pgout __P((db_pgno_t, void *, DBT *)); void CDB___db_metaswap __P((PAGE *)); int CDB___db_byteswap __P((db_pgno_t, PAGE *, size_t, int)); int CDB___db_dispatch __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_add_recovery __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, int, void *), u_int32_t)); int CDB___db_txnlist_init __P((void *)); int CDB___db_txnlist_add __P((void *, u_int32_t)); int CDB___db_txnlist_close __P((void *, u_int32_t, u_int32_t)); int CDB___db_txnlist_delete __P((void *, char *, u_int32_t, int)); void CDB___db_txnlist_end __P((DB_ENV *, void *)); int CDB___db_txnlist_find __P((void *, u_int32_t)); void CDB___db_txnlist_gen __P((void *, int)); void CDB___db_txnlist_print __P((void *)); int CDB___db_dput __P((DBC *, DBT *, PAGE **, db_indx_t *)); int CDB___db_drem __P((DBC *, PAGE **, u_int32_t)); int CDB___db_dend __P((DBC *, db_pgno_t, PAGE **)); int CDB___db_ditem __P((DBC *, PAGE *, u_int32_t, u_int32_t)); int CDB___db_pitem __P((DBC *, PAGE *, u_int32_t, u_int32_t, DBT *, DBT *)); int CDB___db_relink __P((DBC *, u_int32_t, PAGE *, PAGE **, int)); int CDB___db_ddup __P((DBC *, db_pgno_t)); int CDB___db_dsearch __P((DBC *, int, DBT *, db_pgno_t, db_indx_t *, PAGE **, int *)); int CDB___db_cursorchk __P((const DB *, u_int32_t, int)); int CDB___db_cdelchk __P((const DB *, u_int32_t, int, int)); int CDB___db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int)); int CDB___db_cputchk __P((const DB *, const DBT *, DBT *, u_int32_t, int, int)); int CDB___db_closechk __P((const DB *, u_int32_t)); int CDB___db_delchk __P((const DB *, DBT *, u_int32_t, int)); int CDB___db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t)); int CDB___db_joinchk __P((const DB *, u_int32_t)); int CDB___db_putchk __P((const DB *, DBT *, const DBT *, u_int32_t, int, int)); int CDB___db_statchk __P((const DB *, u_int32_t)); int CDB___db_syncchk __P((const DB *, u_int32_t)); int CDB___db_eopnotsup __P((const DB_ENV *)); int CDB___db_removechk __P((const DB *, u_int32_t)); int CDB___db_join __P((DB *, DBC **, DBC **, u_int32_t)); int CDB___db_new __P((DBC *, u_int32_t, PAGE **)); int CDB___db_free __P((DBC *, PAGE *)); int CDB___db_lt __P((DBC *)); int CDB___db_lget __P((DBC *, int, db_pgno_t, db_lockmode_t, int, DB_LOCK *)); int CDB___dbh_am_chk __P((DB *, u_int32_t)); int CDB___db_goff __P((DB *, DBT *, u_int32_t, db_pgno_t, void **, u_int32_t *)); int CDB___db_poff __P((DBC *, const DBT *, db_pgno_t *)); int CDB___db_ovref __P((DBC *, db_pgno_t, int32_t)); int CDB___db_doff __P((DBC *, db_pgno_t)); int CDB___db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t, int (*)(const DBT *, const DBT *), int *)); void CDB___db_loadme __P((void)); int CDB___db_dump __P((DB *, char *, char *)); int CDB___db_prnpage __P((DB *, db_pgno_t)); int CDB___db_prpage __P((DB *, PAGE *, u_int32_t)); int CDB___db_isbad __P((PAGE *, int)); void CDB___db_pr __P((u_int8_t *, u_int32_t)); int CDB___db_prdbt __P((DBT *, int, const char *, FILE *, int)); void CDB___db_prflags __P((u_int32_t, const FN *, FILE *)); int CDB___db_addrem_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_split_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_big_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_relink_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_addpage_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_debug_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_noop_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___db_traverse_dup __P((DB *, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); int CDB___db_traverse_big __P((DB *, db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); int CDB___db_reclaim_callback __P((DB *, PAGE *, void *, int *)); int CDB___db_ret __P((DB *, PAGE *, u_int32_t, DBT *, void **, u_int32_t *)); int CDB___db_retcopy __P((DB *, DBT *, void *, u_int32_t, void **, u_int32_t *)); int CDB___db_upgrade __P((DB *, const char *, u_int32_t)); #endif /* _db_ext_h_ */ ��������������������������������������������������������������������������������htdig-3.2.0b6/db/db_getlong.c�����������������������������������������������������������������������0100644�0063146�0012731�00000003410�07427026535�015230� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_getlong.c 11.3 (Sleepycat) 10/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" /* * CDB___db_getlong -- * Return a long value inside of basic parameters. * * PUBLIC: int CDB___db_getlong * PUBLIC: __P((DB *, const char *, char *, long, long, long *)); */ int CDB___db_getlong(dbp, progname, p, min, max, storep) DB *dbp; const char *progname; char *p; long min, max, *storep; { long val; char *end; CDB___os_set_errno(0); val = strtol(p, &end, 10); if ((val == LONG_MIN || val == LONG_MAX) && CDB___os_get_errno() == ERANGE) { if (dbp == NULL) { fprintf(stderr, "%s: %s: %s\n", progname, p, strerror(ERANGE)); exit(1); } dbp->err(dbp, ERANGE, "%s", p); return (1); } if (p[0] == '\0' || end[0] != '\0') { if (dbp == NULL) { fprintf(stderr, "%s: %s: Invalid numeric argument\n", progname, p); exit(1); } dbp->errx(dbp, "%s: Invalid numeric argument", p); return (1); } if (val < min) { if (dbp == NULL) { fprintf(stderr, "%s: %s: Less than minimum value (%ld)\n", progname, p, min); exit(1); } dbp->errx(dbp, "%s: Less than minimum value (%ld)", p, min); return (1); } if (val > max) { if (dbp == NULL) { fprintf(stderr, "%s: %s: Greater than maximum value (%ld)\n", progname, p, max); exit(1); } dbp->errx(dbp, "%s: Greater than maximum value (%ld)", p, max); exit(1); } *storep = val; return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_iface.c�������������������������������������������������������������������������0100644�0063146�0012731�00000030441�07427026535�014644� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_iface.c 11.2 (Sleepycat) 8/14/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "db_am.h" #include "btree.h" static int CDB___db_keyempty __P((const DB_ENV *)); static int CDB___db_rdonly __P((const DB_ENV *, const char *)); static int CDB___dbt_ferr __P((const DB *, const char *, const DBT *, int)); /* * CDB___db_cursorchk -- * Common cursor argument checking routine. * * PUBLIC: int CDB___db_cursorchk __P((const DB *, u_int32_t, int)); */ int CDB___db_cursorchk(dbp, flags, isrdonly) const DB *dbp; u_int32_t flags; int isrdonly; { /* Check for invalid function flags. */ switch (flags) { case 0: case DB_DUPCURSOR: break; case DB_WRITECURSOR: if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "DB->cursor")); if (!F_ISSET(dbp->dbenv, DB_ENV_CDB)) return (CDB___db_ferr(dbp->dbenv, "DB->cursor", 0)); break; case DB_WRITELOCK: if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "DB->cursor")); break; default: return (CDB___db_ferr(dbp->dbenv, "DB->cursor", 0)); } return (0); } /* * CDB___db_cdelchk -- * Common cursor delete argument checking routine. * * PUBLIC: int CDB___db_cdelchk __P((const DB *, u_int32_t, int, int)); */ int CDB___db_cdelchk(dbp, flags, isrdonly, isvalid) const DB *dbp; u_int32_t flags; int isrdonly, isvalid; { /* Check for changes to a read-only tree. */ if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "c_del")); /* Check for invalid function flags. */ switch (flags) { case 0: break; default: return (CDB___db_ferr(dbp->dbenv, "DBcursor->c_del", 0)); } /* * The cursor must be initialized, return -1 for an invalid cursor, * otherwise 0. */ return (isvalid ? 0 : EINVAL); } /* * CDB___db_cgetchk -- * Common cursor get argument checking routine. * * PUBLIC: int CDB___db_cgetchk __P((const DB *, DBT *, DBT *, u_int32_t, int)); */ int CDB___db_cgetchk(dbp, key, data, flags, isvalid) const DB *dbp; DBT *key, *data; u_int32_t flags; int isvalid; { int key_einval, key_flags, ret; key_einval = key_flags = 0; /* Check for read-modify-write validity. */ if (LF_ISSET(DB_RMW)) { if (!F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { CDB___db_err(dbp->dbenv, "the DB_RMW flag requires locking"); return (EINVAL); } LF_CLR(DB_RMW); } /* Check for invalid function flags. */ switch (flags) { case DB_NEXT_DUP: if (dbp->type == DB_RECNO || dbp->type == DB_QUEUE) goto err; /* FALLTHROUGH */ case DB_CURRENT: case DB_FIRST: case DB_LAST: case DB_NEXT: case DB_PREV: key_flags = 1; break; case DB_GET_BOTH: if (dbp->type == DB_RECNO || dbp->type == DB_QUEUE) goto err; /* FALLTHROUGH */ case DB_SET_RANGE: key_einval = key_flags = 1; break; case DB_SET: key_einval = 1; break; case DB_GET_RECNO: if (!F_ISSET(dbp, DB_BT_RECNUM)) goto err; break; case DB_SET_RECNO: if (!F_ISSET(dbp, DB_BT_RECNUM)) goto err; key_einval = key_flags = 1; break; case DB_CONSUME: if (dbp->type == DB_QUEUE) break; /* FALL THROUGH */ default: err: return (CDB___db_ferr(dbp->dbenv, "DBcursor->c_get", 0)); } /* Check for invalid key/data flags. */ if ((ret = CDB___dbt_ferr(dbp, "key", key, 0)) != 0) return (ret); if ((ret = CDB___dbt_ferr(dbp, "data", data, 0)) != 0) return (ret); /* Check for missing keys. */ if (key_einval && (key->data == NULL || key->size == 0)) return (CDB___db_keyempty(dbp->dbenv)); /* * The cursor must be initialized for DB_CURRENT or DB_NEXT_DUP, * return -1 for an invalid cursor, otherwise 0. */ return (isvalid || (flags != DB_CURRENT && flags != DB_NEXT_DUP) ? 0 : EINVAL); } /* * CDB___db_cputchk -- * Common cursor put argument checking routine. * * PUBLIC: int CDB___db_cputchk __P((const DB *, * PUBLIC: const DBT *, DBT *, u_int32_t, int, int)); */ int CDB___db_cputchk(dbp, key, data, flags, isrdonly, isvalid) const DB *dbp; const DBT *key; DBT *data; u_int32_t flags; int isrdonly, isvalid; { int key_einval, key_flags, ret; key_einval = key_flags = 0; /* Check for changes to a read-only tree. */ if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "c_put")); /* Check for invalid function flags. */ switch (flags) { case DB_AFTER: case DB_BEFORE: if (dbp->type == DB_QUEUE) goto err; if (dbp->dup_compare != NULL) goto err; if (dbp->type == DB_RECNO && !F_ISSET(dbp, DB_RE_RENUMBER)) goto err; if (dbp->type != DB_RECNO && !F_ISSET(dbp, DB_AM_DUP)) goto err; break; case DB_CURRENT: /* * If there is a comparison function, doing a DB_CURRENT * must not change the part of the data item that is used * for the comparison. */ break; case DB_KEYFIRST: case DB_KEYLAST: if (dbp->type == DB_QUEUE) goto err; if (dbp->type == DB_RECNO) goto err; key_einval = key_flags = 1; break; default: err: return (CDB___db_ferr(dbp->dbenv, "DBcursor->c_put", 0)); } /* Check for invalid key/data flags. */ if (key_flags && (ret = CDB___dbt_ferr(dbp, "key", key, 0)) != 0) return (ret); if ((ret = CDB___dbt_ferr(dbp, "data", data, 0)) != 0) return (ret); /* Check for missing keys. */ if (key_einval && (key->data == NULL || key->size == 0)) return (CDB___db_keyempty(dbp->dbenv)); /* * The cursor must be initialized for anything other than DB_KEYFIRST * and DB_KEYLAST, return -1 for an invalid cursor, otherwise 0. */ return (isvalid || flags == DB_KEYFIRST || flags == DB_KEYLAST ? 0 : EINVAL); } /* * CDB___db_closechk -- * DB->close flag check. * * PUBLIC: int CDB___db_closechk __P((const DB *, u_int32_t)); */ int CDB___db_closechk(dbp, flags) const DB *dbp; u_int32_t flags; { /* Check for invalid function flags. */ switch (flags) { case 0: case DB_NOSYNC: break; default: return (CDB___db_ferr(dbp->dbenv, "DB->close", 0)); } return (0); } /* * CDB___db_delchk -- * Common delete argument checking routine. * * PUBLIC: int CDB___db_delchk __P((const DB *, DBT *, u_int32_t, int)); */ int CDB___db_delchk(dbp, key, flags, isrdonly) const DB *dbp; DBT *key; u_int32_t flags; int isrdonly; { /* Check for changes to a read-only tree. */ if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "delete")); /* Check for invalid function flags. */ switch (flags) { case 0: break; default: return (CDB___db_ferr(dbp->dbenv, "DB->del", 0)); } /* Check for missing keys. */ if (key->data == NULL || key->size == 0) return (CDB___db_keyempty(dbp->dbenv)); return (0); } /* * CDB___db_getchk -- * Common get argument checking routine. * * PUBLIC: int CDB___db_getchk __P((const DB *, const DBT *, DBT *, u_int32_t)); */ int CDB___db_getchk(dbp, key, data, flags) const DB *dbp; const DBT *key; DBT *data; u_int32_t flags; { int ret; /* Check for read-modify-write validity. */ if (LF_ISSET(DB_RMW)) { if (!F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { CDB___db_err(dbp->dbenv, "the DB_RMW flag requires locking"); return (EINVAL); } LF_CLR(DB_RMW); } /* Check for invalid function flags. */ switch (flags) { case 0: case DB_GET_BOTH: break; case DB_SET_RECNO: if (!F_ISSET(dbp, DB_BT_RECNUM)) goto err; break; default: err: return (CDB___db_ferr(dbp->dbenv, "DB->get", 0)); } /* Check for invalid key/data flags. */ if ((ret = CDB___dbt_ferr(dbp, "key", key, flags == DB_SET_RECNO)) != 0) return (ret); if ((ret = CDB___dbt_ferr(dbp, "data", data, 1)) != 0) return (ret); /* Check for missing keys. */ if (key->data == NULL || key->size == 0) return (CDB___db_keyempty(dbp->dbenv)); return (0); } /* * CDB___db_joinchk -- * Common join argument checking routine. * * PUBLIC: int CDB___db_joinchk __P((const DB *, u_int32_t)); */ int CDB___db_joinchk(dbp, flags) const DB *dbp; u_int32_t flags; { if (flags != 0) return (CDB___db_ferr(dbp->dbenv, "DB->join", 0)); return (0); } /* * CDB___db_putchk -- * Common put argument checking routine. * * PUBLIC: int CDB___db_putchk * PUBLIC: __P((const DB *, DBT *, const DBT *, u_int32_t, int, int)); */ int CDB___db_putchk(dbp, key, data, flags, isrdonly, isdup) const DB *dbp; DBT *key; const DBT *data; u_int32_t flags; int isrdonly, isdup; { int ret; /* Check for changes to a read-only tree. */ if (isrdonly) return (CDB___db_rdonly(dbp->dbenv, "put")); /* Check for invalid function flags. */ switch (flags) { case 0: case DB_NOOVERWRITE: break; case DB_APPEND: if (dbp->type != DB_RECNO && dbp->type != DB_QUEUE) goto err; break; default: err: return (CDB___db_ferr(dbp->dbenv, "DB->put", 0)); } /* Check for invalid key/data flags. */ if ((ret = CDB___dbt_ferr(dbp, "key", key, 0)) != 0) return (ret); if ((ret = CDB___dbt_ferr(dbp, "data", data, 0)) != 0) return (ret); /* Check for missing keys. */ if (key->data == NULL || key->size == 0) return (CDB___db_keyempty(dbp->dbenv)); /* Check for partial puts in the presence of duplicates. */ if (isdup && F_ISSET(data, DB_DBT_PARTIAL)) { CDB___db_err(dbp->dbenv, "a partial put in the presence of duplicates requires a cursor operation"); return (EINVAL); } return (0); } /* * CDB___db_statchk -- * Common stat argument checking routine. * * PUBLIC: int CDB___db_statchk __P((const DB *, u_int32_t)); */ int CDB___db_statchk(dbp, flags) const DB *dbp; u_int32_t flags; { /* Check for invalid function flags. */ switch (flags) { case 0: break; case DB_RECORDCOUNT: if (dbp->type == DB_RECNO) break; if (dbp->type == DB_BTREE && F_ISSET(dbp, DB_BT_RECNUM)) break; goto err; default: err: return (CDB___db_ferr(dbp->dbenv, "DB->stat", 0)); } return (0); } /* * CDB___db_syncchk -- * Common sync argument checking routine. * * PUBLIC: int CDB___db_syncchk __P((const DB *, u_int32_t)); */ int CDB___db_syncchk(dbp, flags) const DB *dbp; u_int32_t flags; { /* Check for invalid function flags. */ switch (flags) { case 0: break; default: return (CDB___db_ferr(dbp->dbenv, "DB->sync", 0)); } return (0); } /* * CDB___dbt_ferr -- * Check a DBT for flag errors. */ static int CDB___dbt_ferr(dbp, name, dbt, check_thread) const DB *dbp; const char *name; const DBT *dbt; int check_thread; { DB_ENV *dbenv; int ret; dbenv = dbp->dbenv; /* * Check for invalid DBT flags. We allow any of the flags to be * specified to any DB or DBcursor call so that applications can * set DB_DBT_MALLOC when retrieving a data item from a secondary * database and then specify that same DBT as a key to a primary * database, without having to clear flags. */ if ((ret = CDB___db_fchk(dbenv, name, dbt->flags, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL)) != 0) return (ret); switch (F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) { case 0: case DB_DBT_MALLOC: case DB_DBT_REALLOC: case DB_DBT_USERMEM: break; default: return (CDB___db_ferr(dbenv, name, 1)); } if (check_thread && F_ISSET(dbenv, DB_ENV_THREAD) && !F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) { CDB___db_err(dbenv, "missing flag thread flag for %s DBT", name); return (EINVAL); } return (0); } /* * CDB___db_eopnotsup -- * Common operation not supported message. * * PUBLIC: int CDB___db_eopnotsup __P((const DB_ENV *)); */ int CDB___db_eopnotsup(dbenv) const DB_ENV *dbenv; { CDB___db_err(dbenv, "operation not supported"); #ifdef EOPNOTSUPP return (EOPNOTSUPP); #else return (EINVAL); #endif } /* * CDB___db_keyempty -- * Common missing or empty key value message. */ static int CDB___db_keyempty(dbenv) const DB_ENV *dbenv; { CDB___db_err(dbenv, "missing or empty key value specified"); return (EINVAL); } /* * CDB___db_rdonly -- * Common readonly message. */ static int CDB___db_rdonly(dbenv, name) const DB_ENV *dbenv; const char *name; { CDB___db_err(dbenv, "%s: attempt to modify a read-only tree", name); return (EACCES); } /* * CDB___db_removechk -- * DB->remove flag check. * * PUBLIC: int CDB___db_removechk __P((const DB *, u_int32_t)); */ int CDB___db_removechk(dbp, flags) const DB *dbp; u_int32_t flags; { /* Check for invalid function flags. */ switch (flags) { case 0: break; default: return (CDB___db_ferr(dbp->dbenv, "DB->remove", 0)); } return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_int.h���������������������������������������������������������������������������0100644�0063146�0012731�00000023505�10000513627�014357� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db_int.src 11.6 (Sleepycat) 10/1/99 */ #ifndef _DB_INTERNAL_H_ #define _DB_INTERNAL_H_ /******************************************************* * General includes. *******************************************************/ #include "db.h" #ifndef _MSC_VER /* WIN32 */ #ifndef NO_SYSTEM_INCLUDES #ifdef __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif #endif #endif #include "queue.h" #include "shqueue.h" /******************************************************* * General purpose constants and macros. *******************************************************/ #define UINT16_T_MAX 0xffff /* Maximum 16 bit unsigned. */ #define UINT32_T_MAX 0xffffffff /* Maximum 32 bit unsigned. */ #define MEGABYTE 1048576 #define GIGABYTE 1073741824 #define MS_PER_SEC 1000 /* Milliseconds in a second. */ #define USEC_PER_MS 1000 /* Microseconds in a millisecond. */ #define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */ #define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */ #define RECNO_OOB 0 /* Illegal record number. */ /* * If we are unable to determine the underlying filesystem block size, use * 8K on the grounds that most OS's use less than 8K for a VM page size. */ #define DB_DEF_IOSIZE (8 * 1024) /* * Aligning items to particular sizes or in pages or memory. ALIGNP is a * separate macro, as we've had to cast the pointer to different integral * types on different architectures. * * We cast pointers into unsigned longs when manipulating them because C89 * guarantees that u_long is the largest available integral type and further, * to never generate overflows. However, neither C89 or C9X requires that * any integer type be large enough to hold a pointer, although C9X created * the intptr_t type, which is guaranteed to hold a pointer but may or may * not exist. At some point in the future, we should test for intptr_t and * use it where available. */ #undef ALIGNTYPE #define ALIGNTYPE u_long #undef ALIGNP #define ALIGNP(value, bound) ALIGN((ALIGNTYPE)value, bound) #undef ALIGN #define ALIGN(value, bound) (((value) + (bound) - 1) & ~(((u_int)bound) - 1)) /* * There are several on-page structures that are declared to have a number of * fields followed by a variable length array of items. The structure size * without including the variable length array or the address of the first of * those elements can be found using SSZ. * * This macro can also be used to find the offset of a structure element in a * structure. This is used in various places to copy structure elements from * unaligned memory references, e.g., pointers into a packed page. * * There are two versions because compilers object if you take the address of * an array. */ #undef SSZ #define SSZ(name, field) ((int)&(((name *)0)->field)) #undef SSZA #define SSZA(name, field) ((int)&(((name *)0)->field[0])) /* Structure used to print flag values. */ typedef struct __fn { u_int32_t mask; /* Flag value. */ const char *name; /* Flag name. */ } FN; /* Set, clear and test flags. */ #define FLD_CLR(fld, f) (fld) &= ~(f) #define FLD_ISSET(fld, f) ((fld) & (f)) #define FLD_SET(fld, f) (fld) |= (f) #define F_CLR(p, f) (p)->flags &= ~(f) #define F_ISSET(p, f) ((p)->flags & (f)) #define F_SET(p, f) (p)->flags |= (f) #define LF_CLR(f) (flags &= ~(f)) #define LF_ISSET(f) (flags & (f)) #define LF_SET(f) (flags |= (f)) /* Display separator string. */ #undef DB_LINE #define DB_LINE "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" /* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */ #define COMPQUIET(n, v) (n) = (v) /* * Purify and similar run-time tools complain about unitialized reads/writes * for structure fields whose only purpose is padding. */ #define UMRW(v) (v) = 0 /******************************************************* * Files. *******************************************************/ /* * We use 1024 as the maximum path length. It's too hard to figure out what * the real path length is, as it was traditionally stored in <sys/param.h>, * and that file isn't always available. */ #undef MAXPATHLEN #define MAXPATHLEN 1024 #define PATH_DOT "." /* Current working directory. */ #define PATH_SEPARATOR "/" /* Path separator character. */ /* * Flags understood by CDB___os_open. */ #define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */ #define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */ #define DB_OSO_LOG 0x004 /* Opening a log file. */ #define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */ #define DB_OSO_SEQ 0x010 /* Expected sequential access. */ #define DB_OSO_TEMP 0x020 /* Remove after last close. */ #define DB_OSO_TRUNC 0x040 /* POSIX: O_TRUNC */ /* * Seek options understood by CDB___os_seek. */ typedef enum { DB_OS_SEEK_CUR, /* POSIX: SEEK_CUR */ DB_OS_SEEK_END, /* POSIX: SEEK_END */ DB_OS_SEEK_SET /* POSIX: SEEK_SET */ } DB_OS_SEEK; /******************************************************* * Environment. *******************************************************/ /* Type passed to CDB___db_appname(). */ typedef enum { DB_APP_NONE=0, /* No type (region). */ DB_APP_DATA, /* Data file. */ DB_APP_LOG, /* Log file. */ DB_APP_TMP /* Temporary file. */ } APPNAME; /* Most initialization methods cannot be called after open is called. */ #define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \ if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \ return (CDB___db_mi_open(dbenv, name, 1)); /* We're not actually user hostile, honest. */ #define ENV_REQUIRES_CONFIG(dbenv, handle, subsystem) \ if (handle == NULL) \ return (CDB___db_env_config(dbenv, subsystem)); /******************************************************* * Database Access Methods. *******************************************************/ /* Initialization methods are often illegal before/after open is called. */ #define DB_ILLEGAL_AFTER_OPEN(dbp, name) \ if (F_ISSET((dbp), DB_OPEN_CALLED)) \ return (CDB___db_mi_open(dbp->dbenv, name, 1)); #define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \ if (!F_ISSET((dbp), DB_OPEN_CALLED)) \ return (CDB___db_mi_open(dbp->dbenv, name, 0)); /* Some initialization methods are illegal if environment isn't local. */ #define DB_ILLEGAL_IN_ENV(dbp, name) \ if (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL)) \ return (CDB___db_mi_env(dbp->dbenv, name)); #define DB_ILLEGAL_METHOD(dbp, flags) { \ int __ret; \ if ((__ret = CDB___dbh_am_chk(dbp, flags)) != 0) \ return (__ret); \ } /******************************************************* * Mpool. *******************************************************/ /* * File types for DB access methods. Negative numbers are reserved to DB. */ #define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */ #define DB_FTYPE_NOTSET 0 /* Don't call... */ /* Structure used as the DB pgin/pgout pgcookie. */ typedef struct __dbpginfo { size_t db_pagesize; /* Underlying page size. */ int needswap; /* If swapping required. */ } DB_PGINFO; /******************************************************* * Log. *******************************************************/ /* Initialize an LSN to 'zero'. */ #define ZERO_LSN(LSN) { \ (LSN).file = 0; \ (LSN).offset = 0; \ } /* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */ #define IS_ZERO_LSN(LSN) ((LSN).file == 0) /* Test if we need to log a change. */ #define DB_LOGGING(dbc) \ (F_ISSET((dbc)->dbp->dbenv, DB_ENV_LOGGING) && \ !F_ISSET(dbc, DBC_RECOVER)) /******************************************************* * Txn. *******************************************************/ #define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT)) /******************************************************* * Global variables. *******************************************************/ /* * !!! * Initialized in env/env_method.c, don't change this without changing that. */ typedef struct __db_globals { u_int32_t db_mutexlocks; /* db_set_mutexlocks */ u_int32_t db_pageyield; /* db_set_pageyield */ u_int32_t db_panic; /* db_set_panic */ u_int32_t db_region_init; /* db_set_region_init */ u_int32_t db_tas_spins; /* db_set_tas_spins */ /* XA: list of opened environments. */ TAILQ_HEAD(__db_envq, __db_env) db_envq; } DB_GLOBALS; extern DB_GLOBALS CDB___db_global_values; #define DB_GLOBAL(v) CDB___db_global_values.v /* Forward structure declarations. */ struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO; struct __mutex_t; typedef struct __mutex_t MUTEX; /******************************************************* * More general includes. *******************************************************/ #include "debug.h" #include "mutex.h" #include "mutex_ext.h" #include "region.h" #include "env_ext.h" #include "os.h" #include "os_ext.h" #include "common_ext.h" /******************************************************* * Stuff not defined in native WIN32 Env. *******************************************************/ #ifdef _MSC_VER /* _WIN32 */ #include <windows.h> #define S_IRGRP 0 /* R for group */ #define S_IWGRP 0 /* W for group */ #define S_IROTH 0 /* R for other */ #define S_IWOTH 0 /* W for other */ #endif #ifdef _MSC_VER #ifndef S_IRUSR #if defined(_WIN32) || defined(WIN16) #define S_IRUSR S_IREAD /* R for owner */ #define S_IWUSR S_IWRITE /* W for owner */ #define S_IRGRP 0 /* R for group */ #define S_IWGRP 0 /* W for group */ #define S_IROTH 0 /* R for other */ #define S_IWOTH 0 /* W for other */ #else #define S_IRUSR 0000400 /* R for owner */ #define S_IWUSR 0000200 /* W for owner */ #define S_IRGRP 0000040 /* R for group */ #define S_IWGRP 0000020 /* W for group */ #define S_IROTH 0000004 /* R for other */ #define S_IWOTH 0000002 /* W for other */ #endif /* _WIN32 || WIN16 */ #endif #endif #endif /* !_DB_INTERNAL_H_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_join.c��������������������������������������������������������������������������0100644�0063146�0012731�00000042560�07427026535�014541� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_join.c 11.6 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_join.h" #include "db_am.h" #include "btree.h" static int CDB___db_join_close __P((DBC *)); static int CDB___db_join_del __P((DBC *, u_int32_t)); static int CDB___db_join_get __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___db_join_getnext __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); static int CDB___db_join_put __P((DBC *, DBT *, DBT *, u_int32_t)); /* * This is the duplicate-assisted join functionality. Right now we're * going to write it such that we return one item at a time, although * I think we may need to optimize it to return them all at once. * It should be easier to get it working this way, and I believe that * changing it should be fairly straightforward. * * XXX * Right now we do not maintain the number of duplicates so we do * not optimize the join. If the caller does, then best performance * will be achieved by putting the cursor with the smallest cardinality * first. * * The first cursor moves sequentially through the duplicate set while * the others search explicitly for the duplicate in question. * */ /* * CDB___db_join -- * This is the interface to the duplicate-assisted join functionality. * In the same way that cursors mark a position in a database, a cursor * can mark a position in a join. While most cursors are created by the * cursor method of a DB, join cursors are created through an explicit * call to DB->join. * * The curslist is an array of existing, intialized cursors and primary * is the DB of the primary file. The data item that joins all the * cursors in the curslist is used as the key into the primary and that * key and data are returned. When no more items are left in the join * set, the c_next operation off the join cursor will return DB_NOTFOUND. * * PUBLIC: int CDB___db_join __P((DB *, DBC **, DBC **, u_int32_t)); */ int CDB___db_join(primary, curslist, dbcp, flags) DB *primary; DBC **curslist, **dbcp; u_int32_t flags; { DBC *dbc; JOIN_CURSOR *jc; int i, ret, nslots; COMPQUIET(nslots, 0); PANIC_CHECK(primary->dbenv); if ((ret = CDB___db_joinchk(primary, flags)) != 0) return (ret); if (curslist == NULL || curslist[0] == NULL) return (EINVAL); dbc = NULL; jc = NULL; if ((ret = CDB___os_calloc(1, sizeof(DBC), &dbc)) != 0) goto err; if ((ret = CDB___os_calloc(1, sizeof(JOIN_CURSOR), &jc)) != 0) goto err; if ((ret = CDB___os_malloc(256, NULL, &jc->j_key.data)) != 0) goto err; jc->j_key.ulen = 256; F_SET(&jc->j_key, DB_DBT_USERMEM); for (jc->j_curslist = curslist; *jc->j_curslist != NULL; jc->j_curslist++) ; /* * The number of cursor slots we allocate is one greater than * the number of cursors involved in the join, because the * list is NULL-terminated. */ nslots = jc->j_curslist - curslist + 1; /* * !!! -- A note on the various lists hanging off jc. * * j_curslist is the initial NULL-terminated list of cursors passed * into CDB___db_join. The original cursors are not modified; pristine * copies are required because, in databases with unsorted dups, we * must reset all of the secondary cursors after the first each * time the first one is incremented, or else we will lose data * which happen to be sorted differently in two different cursors. * * j_workcurs is where we put those copies that we're planning to * work with. They're lazily c_dup'ed from j_curslist as we need * them, and closed when the join cursor is closed or when we need * to reset them to their original values (in which case we just * c_dup afresh). * * j_fdupcurs is an array of cursors which point to the first * duplicate in the duplicate set that contains the data value * we're currently interested in. We need this to make * CDB___db_join_get correctly return duplicate duplicates; i.e., if a * given data value occurs twice in the set belonging to cursor #2, * and thrice in the set belonging to cursor #3, and once in all * the other cursors, successive calls to CDB___db_join_get need to * return that data item six times. To make this happen, each time * cursor N is allowed to advance to a new datum, all cursors M * such that M > N have to be reset to the first duplicate with * that datum, so CDB___db_join_get will return all the dup-dups again. * We could just reset them to the original cursor from j_curslist, * but that would be a bit slower in the unsorted case and a LOT * slower in the sorted one. * * j_exhausted is a list of boolean values which represent * whether or not their corresponding cursors are "exhausted", * i.e. whether the datum under the corresponding cursor has * been found not to exist in any unreturned combinations of * later secondary cursors, in which case they are ready to be * incremented. */ /* We don't want to free regions whose callocs have failed. */ jc->j_curslist = NULL; jc->j_workcurs = NULL; jc->j_fdupcurs = NULL; jc->j_exhausted = NULL; if ((ret = CDB___os_calloc(nslots, sizeof(DBC *), &jc->j_curslist)) != 0) goto err; if ((ret = CDB___os_calloc(nslots, sizeof(DBC *), &jc->j_workcurs)) != 0) goto err; if ((ret = CDB___os_calloc(nslots, sizeof(DBC *), &jc->j_fdupcurs)) != 0) goto err; if ((ret = CDB___os_calloc(nslots, sizeof(u_int8_t), &jc->j_exhausted)) != 0) goto err; for (i = 0; curslist[i] != NULL; i++) { jc->j_curslist[i] = curslist[i]; jc->j_workcurs[i] = NULL; jc->j_fdupcurs[i] = NULL; jc->j_exhausted[i] = 0; } /* * We never need to reset the 0th cursor, so there's no * solid reason to use workcurs[0] rather than curslist[0] in * join_get. Nonetheless, it feels cleaner to do it for symmetry, * and this is the most logical place to copy it. * * !!! * There's no need to close the new cursor if we goto err only * because this is the last thing that can fail. Modifier of this * function beware! */ if ((ret = CDB___os_malloc(sizeof(DBC), NULL, jc->j_workcurs)) != 0) goto err; if ((ret = jc->j_curslist[0]->c_dup(jc->j_curslist[0], jc->j_workcurs, DB_POSITIONI)) != 0) goto err; dbc->c_close = CDB___db_join_close; dbc->c_del = CDB___db_join_del; dbc->c_get = CDB___db_join_get; dbc->c_put = CDB___db_join_put; dbc->internal = jc; dbc->dbp = primary; jc->j_primary = primary; *dbcp = dbc; return (0); err: if (jc != NULL) { if (jc->j_curslist != NULL) CDB___os_free(jc->j_curslist, nslots * sizeof(DBC *)); if (jc->j_workcurs != NULL) { if (jc->j_workcurs[0] != NULL) CDB___os_free(jc->j_workcurs[0], sizeof(DBC)); CDB___os_free(jc->j_workcurs, nslots * sizeof(DBC *)); } if (jc->j_fdupcurs != NULL) CDB___os_free(jc->j_fdupcurs, nslots * sizeof(DBC *)); if (jc->j_exhausted != NULL) CDB___os_free(jc->j_exhausted, nslots * sizeof(u_int8_t)); CDB___os_free(jc, sizeof(JOIN_CURSOR)); } if (dbc != NULL) CDB___os_free(dbc, sizeof(DBC)); return (ret); } static int CDB___db_join_put(dbc, key, data, flags) DBC *dbc; DBT *key; DBT *data; u_int32_t flags; { PANIC_CHECK(dbc->dbp->dbenv); COMPQUIET(key, NULL); COMPQUIET(data, NULL); COMPQUIET(flags, 0); return (EINVAL); } static int CDB___db_join_del(dbc, flags) DBC *dbc; u_int32_t flags; { PANIC_CHECK(dbc->dbp->dbenv); COMPQUIET(flags, 0); return (EINVAL); } static int CDB___db_join_get(dbc, key, data, flags) DBC *dbc; DBT *key, *data; u_int32_t flags; { DBT currkey; DB *dbp; DBC *cp; JOIN_CURSOR *jc; int ret, i, j; u_int32_t operation; dbp = dbc->dbp; memset(&currkey, 0, sizeof(currkey)); PANIC_CHECK(dbp->dbenv); operation = LF_ISSET(DB_OPFLAGS_MASK); if (operation != 0 && operation != DB_JOIN_ITEM) return (CDB___db_ferr(dbp->dbenv, "DBcursor->c_get", 0)); LF_CLR(DB_OPFLAGS_MASK); if ((ret = CDB___db_fchk(dbp->dbenv, "DBcursor->c_get", flags, DB_RMW)) != 0) return (ret); /* * Partial gets on join cursors don't make much sense, and the * DBT_PARTIAL flag is liable to produce some rather strange * results given the weird way the DBTs are used ("key" is used as * the datum in all the secondary cursors), so we simply * disallow it. */ if (F_ISSET(key, DB_DBT_PARTIAL) || F_ISSET(data, DB_DBT_PARTIAL)) return (EINVAL); jc = (JOIN_CURSOR *)dbc->internal; retry: ret = jc->j_workcurs[0]->c_get(jc->j_workcurs[0], &jc->j_key, key, jc->j_exhausted[0] ? DB_NEXT_DUP : DB_CURRENT); if (ret == ENOMEM) { jc->j_key.ulen <<= 1; if ((ret = CDB___os_realloc(jc->j_key.ulen, NULL, &jc->j_key.data)) != 0) goto err; goto retry; } /* * If ret == DB_NOTFOUND, we're out of elements of the first * secondary cursor. This is how we finally finish the join * if all goes well. */ if (ret != 0) goto err; /* * Copy key into currkey; this is the current duplicate data * value that we're interested in, which we will use for comparison * purposes with c_gets on all the other secondary cursors. */ if ((ret = CDB___os_realloc(key->size, NULL, &currkey.data)) != 0) goto err; memcpy(currkey.data, key->data, key->size); currkey.size = key->size; /* * If jc->j_curslist[1] == NULL, we have only one cursor in the join. * Thus, we can safely increment that one cursor on each call * to CDB___db_join_get, and we signal this by setting jc->j_exhausted[0] * right away. * * Otherwise, reset jc->j_exhausted[0] to 0, so that we don't * increment it until we know we're ready to. */ if (jc->j_curslist[1] == NULL) jc->j_exhausted[0] = 1; else jc->j_exhausted[0] = 0; /* We have the first element; now look for it in the other cursors. */ for (i = 1; jc->j_curslist[i] != NULL; i++) { if (jc->j_workcurs[i] == NULL) /* If this is NULL, we need to dup curslist into it. */ if ((ret = jc->j_curslist[i]->c_dup( jc->j_curslist[i], jc->j_workcurs + i, DB_POSITIONI)) != 0) goto err; retry2: cp = jc->j_workcurs[i]; if ((ret = CDB___db_join_getnext(cp, &jc->j_key, key, &currkey, jc->j_exhausted[i])) == DB_NOTFOUND) { /* * jc->j_workcurs[i] has no more of the datum we're * interested in. Go back one cursor and get * a new dup. We can't just move to a new * element of the outer relation, because that way * we might miss duplicate duplicates in cursor i-1. * * If this takes us back to the first cursor, * -then- we can move to a new element of the outer * relation. */ --i; jc->j_exhausted[i] = 1; if (i == 0) { for (j = 1; jc->j_workcurs[j] != NULL; j++) { /* * We're moving to a new element of * the first secondary cursor. If * that cursor is sorted, then any * other sorted cursors can be safely * reset to the first duplicate * duplicate in the current set if we * have a pointer to it (we can't just * leave them be, or we'll miss * duplicate duplicates in the outer * relation). * * If the first cursor is unsorted, or * if cursor j is unsorted, we can * make no assumptions about what * we're looking for next or where it * will be, so we reset to the very * beginning (setting workcurs NULL * will achieve this next go-round). * * XXX: This is likely to break * horribly if any two cursors are * both sorted, but have different * specified sort functions. For, * now, we dismiss this as pathology * and let strange things happen--we * can't make rope childproof. */ if ((ret = jc->j_workcurs[j]->c_close( jc->j_workcurs[j])) != 0) goto err; if ((jc->j_workcurs[0]->dbp->dup_compare == NULL) || (jc->j_workcurs[j]->dbp->dup_compare == NULL) || jc->j_fdupcurs[j] == NULL) /* * Unsafe conditions; * reset fully. */ jc->j_workcurs[j] = NULL; else /* Partial reset suffices. */ if ((jc->j_fdupcurs[j]->c_dup( jc->j_fdupcurs[j], &jc->j_workcurs[j], DB_POSITIONI)) != 0) goto err; jc->j_exhausted[j] = 0; } goto retry; /* NOTREACHED */ } /* * We're about to advance the cursor and need to * reset all of the workcurs[j] where j>i, so that * we don't miss any duplicate duplicates. */ for (j = i + 1; jc->j_workcurs[j] != NULL; j++) { if ((ret = jc->j_workcurs[j]->c_close( jc->j_workcurs[j])) != 0) goto err; if (jc->j_fdupcurs[j] != NULL) { if ((ret = jc->j_fdupcurs[j]->c_dup( jc->j_fdupcurs[j], &jc->j_workcurs[j], DB_POSITIONI)) != 0) goto err; jc->j_exhausted[j] = 0; } else jc->j_workcurs[j] = NULL; } goto retry2; /* NOTREACHED */ } if (ret == ENOMEM) { jc->j_key.ulen <<= 1; if ((ret = CDB___os_realloc(jc->j_key.ulen, NULL, &jc->j_key.data)) != 0) goto err; goto retry2; } if (ret != 0) goto err; /* * If we made it this far, we've found a matching * datum in cursor i. Mark the current cursor * unexhausted, so we don't miss any duplicate * duplicates the next go-round--unless this is the * very last cursor, in which case there are none to * miss, and we'll need that exhausted flag to finally * get a DB_NOTFOUND and move on to the next datum in * the outermost cursor. */ if (jc->j_curslist[i + 1] != NULL) jc->j_exhausted[i] = 0; else jc->j_exhausted[i] = 1; /* * If jc->j_fdupcurs[i] is NULL, this is the first * time we've gotten this far since the original * CDB___db_join. If jc->j_exhausted[0] == 1, it's the * first time we're here since advancing cursor 0. In * either case, we have a new datum of interest, and * we set jc->j_fdupcurs[i], which stores the first * duplicate duplicate of the current datum. */ if (jc->j_exhausted[0] == 1 || jc->j_fdupcurs[i] == NULL) { if (jc->j_fdupcurs[i] != NULL) if ((ret = jc->j_fdupcurs[i]->c_close( jc->j_fdupcurs[i])) != 0) goto err; if ((ret = cp->c_dup(cp, &jc->j_fdupcurs[i], DB_POSITIONI)) != 0) goto err; } } err: /* * We're done with this; free it now, before * both error and regular returns. */ if (currkey.data != NULL) CDB___os_free(currkey.data, 0); if (ret != 0) return (ret); /* * ret == 0; we have a key to return. If DB_JOIN_ITEM is * set, we return it; otherwise we do the lookup in the * primary and then return. */ if (operation == DB_JOIN_ITEM) return (0); else return ((jc->j_primary->get)(jc->j_primary, jc->j_curslist[0]->txn, key, data, 0)); } static int CDB___db_join_close(dbc) DBC *dbc; { JOIN_CURSOR *jc; int i, ret, t_ret; PANIC_CHECK(dbc->dbp->dbenv); jc = (JOIN_CURSOR *)dbc->internal; ret = t_ret = 0; /* * Close any open scratch cursors. In each case, there may * not be as many outstanding as there are cursors in * curslist, but the first NULL we hit will be after the last * of whatever's there. If one of them fails, there's no * reason not to close everything else; we'll just return the * error code of the last one to fail. There's not much the * caller can do anyway, since this cursor only exists hanging * off a db-internal data structure that they shouldn't be * mucking with. */ for (i = 0; jc->j_workcurs[i] != NULL; i++) if((t_ret = jc->j_workcurs[i]->c_close(jc->j_workcurs[i])) != 0) ret = t_ret; for (i = 0; jc->j_fdupcurs[i] != NULL; i++) if((t_ret = jc->j_fdupcurs[i]->c_close(jc->j_fdupcurs[i])) != 0) ret = t_ret; CDB___os_free(jc->j_exhausted, 0); CDB___os_free(jc->j_curslist, 0); CDB___os_free(jc->j_key.data, jc->j_key.ulen); CDB___os_free(jc, sizeof(JOIN_CURSOR)); CDB___os_free(dbc, sizeof(DBC)); return (ret); } /* * CDB___db_join_getnext-- * This function replaces the DBC_CONTINUE and DBC_KEYSET * functionality inside the various cursor get routines. * * If exhausted == 0, we're not done with the current datum; * return it if it matches "matching", otherwise search * using DBC_CONTINUE (which is faster than iteratively doing * DB_NEXT_DUP) forward until we find one that does. * * If exhausted == 1, we are done with the current datum, so just * leap forward to searching NEXT_DUPs. * * If no matching datum exists, returns DB_NOTFOUND, else 0. */ static int CDB___db_join_getnext(dbc, key, data, matching, exhausted) DBC *dbc; DBT *key, *data, *matching; u_int32_t exhausted; { int ret, cmp; DB *dbp; int (*func) __P((const DBT *, const DBT *)); dbp = dbc->dbp; func = (dbp->dup_compare == NULL) ? CDB___bam_defcmp : dbp->dup_compare; switch (exhausted) { case 0: if ((ret = dbc->c_get(dbc, key, data, DB_CURRENT)) != 0) break; cmp = func(matching, data); if (cmp == 0) return (0); /* * Didn't match--we want to fall through and search future * dups. But we've just stepped on the value of data, * so we copy matching back into it. * * We don't have to copy the data itself, because * the ensuing c_get call will take care of things for us. */ data->data = matching->data; data->size = matching->size; /* FALLTHROUGH */ case 1: F_SET(dbc, DBC_CONTINUE); ret = dbc->c_get(dbc, key, data, DB_GET_BOTH); F_CLR(dbc, DBC_CONTINUE); break; default: ret = EINVAL; break; } return (ret); } ������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_join.h��������������������������������������������������������������������������0100644�0063146�0012731�00000001463�07427026535�014543� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db_join.h 11.1 (Sleepycat) 7/25/99 */ #ifndef _DB_JOIN_H #define _DB_JOIN_H /* * Joins use a join cursor that is similar to a regular DB cursor except * that it only supports c_get and c_close functionality. Also, it does * not support the full range of flags for get. */ typedef struct __join_cursor { u_int8_t *j_exhausted; /* Array of flags; is cursor i exhausted? */ DBC **j_curslist; /* Array of cursors in the join: constant. */ DBC **j_fdupcurs; /* Cursors w/ first intances of current dup. */ DBC **j_workcurs; /* Scratch cursor copies to muck with. */ DB *j_primary; /* Primary dbp. */ DBT j_key; /* Used to do lookups. */ } JOIN_CURSOR; #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_log2.c��������������������������������������������������������������������������0100644�0063146�0012731�00000004343�07427026535�014442� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_log2.c 11.2 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "common_ext.h" /* * PUBLIC: u_int32_t CDB___db_log2 __P((u_int32_t)); */ u_int32_t CDB___db_log2(num) u_int32_t num; { u_int32_t i, limit; limit = 1; for (i = 0; limit < num; limit = limit << 1) ++i; return (i); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_meta.c��������������������������������������������������������������������������0100644�0063146�0012731�00000016217�07427026535�014530� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_meta.c 11.8 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "txn.h" #include "db_am.h" #include "btree.h" /* * CDB___db_new -- * Get a new page, preferably from the freelist. * * PUBLIC: int CDB___db_new __P((DBC *, u_int32_t, PAGE **)); */ int CDB___db_new(dbc, type, pagepp) DBC *dbc; u_int32_t type; PAGE **pagepp; { DBMETA *meta; DB *dbp; DB_LOCK metalock; PAGE *h; db_pgno_t pgno; int ret; dbp = dbc->dbp; meta = NULL; h = NULL; metalock.off = LOCK_INVALID; pgno = PGNO_BASE_MD; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) goto err; if (meta->free == PGNO_INVALID) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, DB_MPOOL_NEW, &h)) != 0) goto err; ZERO_LSN(h->lsn); h->pgno = pgno; } else { pgno = meta->free; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; meta->free = h->next_pgno; (void)CDB_memp_fset(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY); } /* Log the change. */ if (DB_LOGGING(dbc)) { if ((ret = __db_pg_alloc_log(dbp->dbenv, dbc->txn, &meta->lsn, 0, dbp->log_fileid, &meta->lsn, &h->lsn, h->pgno, (u_int32_t)type, meta->free)) != 0) goto err; LSN(h) = LSN(meta); } (void)CDB_memp_fput(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY); (void)__TLPUT(dbc, metalock); P_INIT(h, dbp->pgsize, h->pgno, PGNO_INVALID, PGNO_INVALID, 0, type); *pagepp = h; return (0); err: if (h != NULL) (void)CDB_memp_fput(dbp->mpf, h, 0); if (meta != NULL) (void)CDB_memp_fput(dbp->mpf, meta, 0); if (metalock.off != LOCK_INVALID) (void)__TLPUT(dbc, metalock); return (ret); } /* * CDB___db_free -- * Add a page to the head of the freelist. * * PUBLIC: int CDB___db_free __P((DBC *, PAGE *)); */ int CDB___db_free(dbc, h) DBC *dbc; PAGE *h; { DBMETA *meta; DB *dbp; DBT ldbt; DB_LOCK metalock; db_pgno_t pgno; u_int32_t dirty_flag; int ret, t_ret; dbp = dbc->dbp; /* * Retrieve the metadata page and insert the page at the head of * the free list. If either the lock get or page get routines * fail, then we need to put the page with which we were called * back because our caller assumes we take care of it. */ dirty_flag = 0; pgno = PGNO_BASE_MD; if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, (PAGE **)&meta)) != 0) { (void)__TLPUT(dbc, metalock); goto err; } /* Log the change. */ if (DB_LOGGING(dbc)) { memset(&ldbt, 0, sizeof(ldbt)); ldbt.data = h; ldbt.size = P_OVERHEAD; if ((ret = __db_pg_free_log(dbp->dbenv, dbc->txn, &meta->lsn, 0, dbp->log_fileid, h->pgno, &meta->lsn, &ldbt, meta->free)) != 0) { (void)CDB_memp_fput(dbp->mpf, (PAGE *)meta, 0); (void)__TLPUT(dbc, metalock); return (ret); } LSN(h) = LSN(meta); } P_INIT(h, dbp->pgsize, h->pgno, PGNO_INVALID, meta->free, 0, P_INVALID); /* Link the page on the metadata free list. */ meta->free = h->pgno; /* Discard the metadata page. */ ret = CDB_memp_fput(dbp->mpf, (PAGE *)meta, DB_MPOOL_DIRTY); if ((t_ret = __TLPUT(dbc, metalock)) != 0) ret = t_ret; /* Discard the caller's page reference. */ dirty_flag = DB_MPOOL_DIRTY; err: if ((t_ret = CDB_memp_fput(dbp->mpf, h, dirty_flag)) != 0 && ret == 0) ret = t_ret; /* * XXX * We have to unlock the caller's page in the caller! */ return (ret); } #ifdef DEBUG /* * CDB___db_lt -- * Print out the list of locks currently held by a cursor. * * PUBLIC: int CDB___db_lt __P((DBC *)); */ int CDB___db_lt(dbc) DBC *dbc; { DB *dbp; DB_LOCKREQ req; dbp = dbc->dbp; if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { req.op = DB_LOCK_DUMP; CDB_lock_vec(dbp->dbenv, dbc->locker, 0, &req, 1, NULL); } return (0); } #endif /* * CDB___db_lget -- * The standard lock get call. * * PUBLIC: int CDB___db_lget __P((DBC *, * PUBLIC: int, db_pgno_t, db_lockmode_t, int, DB_LOCK *)); */ int CDB___db_lget(dbc, do_couple, pgno, mode, flags, lockp) DBC *dbc; int do_couple, flags; db_pgno_t pgno; db_lockmode_t mode; DB_LOCK *lockp; { DB *dbp; DB_LOCKREQ couple[2]; int ret; dbp = dbc->dbp; if (!F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { lockp->off = LOCK_INVALID; return (0); } dbc->lock.pgno = pgno; if (LF_ISSET(DB_LOCK_RECORD)) dbc->lock.type = DB_RECORD_LOCK; else dbc->lock.type = DB_PAGE_LOCK; LF_CLR(DB_LOCK_RECORD); /* * If the transaction enclosing this cursor has DB_LOCK_NOWAIT set, * pass that along to the lock call. */ if (DB_NONBLOCK(dbc)) LF_SET(DB_LOCK_NOWAIT); /* * If the object not currently locked, acquire the lock and return, * otherwise, lock couple. */ if (do_couple) { couple[0].op = DB_LOCK_GET; couple[0].obj = &dbc->lock_dbt; couple[0].mode = mode; couple[1].op = DB_LOCK_PUT; couple[1].lock = *lockp; if ((ret = CDB_lock_vec(dbp->dbenv, dbc->locker, flags, couple, 2, NULL)) == 0) *lockp = couple[0].lock; } else { ret = CDB_lock_get(dbp->dbenv, dbc->locker, flags, &dbc->lock_dbt, mode, lockp); } return (ret); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_method.c������������������������������������������������������������������������0100644�0063146�0012731�00000024502�10000513627�015036� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_method.c 11.8 (Sleepycat) 9/22/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_am.h" #include "btree.h" #include "hash.h" #include "qam.h" #include "xa.h" #include "xa_ext.h" static int CDB___db_get_byteswapped __P((DB *)); static DBTYPE CDB___db_get_type __P((DB *)); static int CDB___db_init __P((DB *, u_int32_t)); static int CDB___db_set_cachesize __P((DB *, u_int32_t, u_int32_t, int)); static int CDB___db_set_dup_compare __P((DB *, int (*)(const DBT *, const DBT *))); static void CDB___db_set_errcall __P((DB *, void (*)(const char *, char *))); static void CDB___db_set_errfile __P((DB *, FILE *)); static void CDB___db_set_feedback __P((DB *, void (*)(DB *, int, int))); static int CDB___db_set_flags __P((DB *, u_int32_t)); static int CDB___db_set_lorder __P((DB *, int)); static int CDB___db_set_malloc __P((DB *, void *(*)(size_t))); static int CDB___db_set_pagesize __P((DB *, u_int32_t)); static int CDB___db_set_realloc __P((DB *, void *(*)(void *, size_t))); static void CDB___db_set_errpfx __P((DB *, const char *)); static void CDB___db_set_paniccall __P((DB *, void (*)(DB_ENV *, int))); static void CDB___dbh_err __P((DB *, int, const char *, ...)); static void CDB___dbh_errx __P((DB *, const char *, ...)); /* * CDB_db_create -- * DB constructor. */ int CDB_db_create(dbpp, dbenv, flags) DB **dbpp; DB_ENV *dbenv; u_int32_t flags; { DB *dbp; int ret; /* Check for invalid function flags. */ switch (flags) { case 0: break; case DB_XA_CREATE: if (dbenv != NULL) { CDB___db_err(dbenv, "XA applications may not specify an environment to CDB_db_create"); return (EINVAL); } /* * If it's an XA database, open it within the XA environment, * taken from the global list of environments. (When the XA * transaction manager called our xa_start() routine the * "current" environment was moved to the start of the list. */ dbenv = TAILQ_FIRST(&DB_GLOBAL(db_envq)); break; default: return (CDB___db_ferr(dbenv, "CDB_db_create", 0)); } /* Allocate the DB. */ if ((ret = CDB___os_calloc(1, sizeof(*dbp), &dbp)) != 0) return (ret); if ((ret = CDB___db_init(dbp, flags)) != 0) { CDB___os_free(dbp, sizeof(*dbp)); return (ret); } /* If we don't have an environment yet, allocate a local one. */ if (dbenv == NULL) { if ((ret = CDB_db_env_create(&dbenv, 0)) != 0) { CDB___os_free(dbp, sizeof(*dbp)); return (ret); } F_SET(dbenv, DB_ENV_DBLOCAL); } dbp->dbenv = dbenv; *dbpp = dbp; return (0); } /* * CDB___db_init -- * Initialize a DB structure. */ static int CDB___db_init(dbp, flags) DB *dbp; u_int32_t flags; { int ret; dbp->pgsize = DB_DEF_IOSIZE; dbp->log_fileid = DB_LOGFILEID_INVALID; TAILQ_INIT(&dbp->free_queue); TAILQ_INIT(&dbp->active_queue); FLD_SET(dbp->am_ok, DB_OK_BTREE | DB_OK_HASH | DB_OK_QUEUE | DB_OK_RECNO); dbp->close = CDB___db_close; dbp->cursor = CDB___db_cursor; dbp->del = NULL; /* !!! Must be set by access method. */ dbp->err = CDB___dbh_err; dbp->errx = CDB___dbh_errx; dbp->fd = CDB___db_fd; dbp->get = CDB___db_get; dbp->get_byteswapped = CDB___db_get_byteswapped; dbp->get_type = CDB___db_get_type; dbp->join = CDB___db_join; dbp->open = CDB___db_open; dbp->put = CDB___db_put; dbp->remove = CDB___db_remove; dbp->set_cachesize = CDB___db_set_cachesize; dbp->set_dup_compare = CDB___db_set_dup_compare; dbp->set_errcall = CDB___db_set_errcall; dbp->set_errfile = CDB___db_set_errfile; dbp->set_errpfx = CDB___db_set_errpfx; dbp->set_feedback = CDB___db_set_feedback; dbp->set_flags = CDB___db_set_flags; dbp->set_lorder = CDB___db_set_lorder; dbp->set_malloc = CDB___db_set_malloc; dbp->set_pagesize = CDB___db_set_pagesize; dbp->set_paniccall = CDB___db_set_paniccall; dbp->set_realloc = CDB___db_set_realloc; dbp->stat = NULL; /* !!! Must be set by access method. */ dbp->sync = CDB___db_sync; dbp->upgrade = CDB___db_upgrade; /* Access method specific. */ if ((ret = CDB___bam_db_create(dbp)) != 0) return (ret); if ((ret = CDB___ham_db_create(dbp)) != 0) return (ret); if ((ret = CDB___qam_db_create(dbp)) != 0) return (ret); /* * XA specific: must be last, as we replace methods set by the * access methods. */ if (LF_ISSET(DB_XA_CREATE) && (ret = CDB___db_xa_create(dbp)) != 0) return (ret); F_SET(dbp, DB_AM_PGDEF); return (0); } /* * CDB___dbh_am_chk -- * Error if an unreasonable method is called. * * PUBLIC: int CDB___dbh_am_chk __P((DB *, u_int32_t)); */ int CDB___dbh_am_chk(dbp, flags) DB *dbp; u_int32_t flags; { /* * We start out allowing any access methods to be called, and as the * application calls the methods the options become restricted. The * idea is to quit as soon as an illegal method combination is called. */ if ((LF_ISSET(DB_OK_BTREE) && FLD_ISSET(dbp->am_ok, DB_OK_BTREE)) || (LF_ISSET(DB_OK_HASH) && FLD_ISSET(dbp->am_ok, DB_OK_HASH)) || (LF_ISSET(DB_OK_QUEUE) && FLD_ISSET(dbp->am_ok, DB_OK_QUEUE)) || (LF_ISSET(DB_OK_RECNO) && FLD_ISSET(dbp->am_ok, DB_OK_RECNO))) { FLD_CLR(dbp->am_ok, ~flags); return (0); } CDB___db_err(dbp->dbenv, "call implies an access method which is inconsistent with previous calls"); return (EINVAL); } /* * CDB___dbh_err -- * Error message, including the standard error string. */ static void #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___dbh_err(DB *dbp, int error, const char *fmt, ...) #else CDB___dbh_err(dbp, error, fmt, va_alist) DB *dbp; int error; const char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif CDB___db_real_err(dbp->dbenv, error, 1, 1, fmt, ap); va_end(ap); } /* * CDB___dbh_errx -- * Error message. */ static void #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___dbh_errx(DB *dbp, const char *fmt, ...) #else CDB___dbh_errx(dbp, fmt, va_alist) DB *dbp; const char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif CDB___db_real_err(dbp->dbenv, 0, 0, 1, fmt, ap); va_end(ap); } /* * CDB___db_get_byteswapped -- * Return if database requires byte swapping. */ static int CDB___db_get_byteswapped(dbp) DB *dbp; { DB_ILLEGAL_BEFORE_OPEN(dbp, "get_byteswapped"); return (F_ISSET(dbp, DB_AM_SWAP) ? 1 : 0); } /* * CDB___db_get_type -- * Return type of underlying database. */ static DBTYPE CDB___db_get_type(dbp) DB *dbp; { DB_ILLEGAL_BEFORE_OPEN(dbp, "get_type"); return (dbp->type); } /* * CDB___db_set_cachesize -- * Set underlying cache size. */ static int CDB___db_set_cachesize(dbp, cache_gbytes, cache_bytes, ncache) DB *dbp; u_int32_t cache_gbytes, cache_bytes; int ncache; { DB_ILLEGAL_IN_ENV(dbp, "set_cachesize"); DB_ILLEGAL_AFTER_OPEN(dbp, "set_cachesize"); return (dbp->dbenv->set_cachesize( dbp->dbenv, cache_gbytes, cache_bytes, ncache)); } /* * CDB___db_set_dup_compare -- * Set duplicate comparison routine. */ static int CDB___db_set_dup_compare(dbp, func) DB *dbp; int (*func) __P((const DBT *, const DBT *)); { DB_ILLEGAL_AFTER_OPEN(dbp, "dup_compare"); DB_ILLEGAL_METHOD(dbp, DB_OK_BTREE | DB_OK_HASH); dbp->dup_compare = func; return (0); } static void CDB___db_set_errcall(dbp, errcall) DB *dbp; void (*errcall) __P((const char *, char *)); { dbp->dbenv->set_errcall(dbp->dbenv, errcall); } static void CDB___db_set_errfile(dbp, errfile) DB *dbp; FILE *errfile; { dbp->dbenv->set_errfile(dbp->dbenv, errfile); } static void CDB___db_set_errpfx(dbp, errpfx) DB *dbp; const char *errpfx; { dbp->dbenv->set_errpfx(dbp->dbenv, errpfx); } static void CDB___db_set_feedback(dbp, feedback) DB *dbp; void (*feedback) __P((DB *, int, int)); { dbp->db_feedback = feedback; } static int CDB___db_set_flags(dbp, flags) DB *dbp; u_int32_t flags; { int ret; /* * !!! * The hash access method only takes two flags: DB_DUP and DB_DUPSORT. * The Btree access method uses them for the same purposes, and so we * resolve them there. * * The queue access method takes no flags. */ if ((ret = CDB___bam_set_flags(dbp, &flags)) != 0) return (ret); if ((ret = CDB___ram_set_flags(dbp, &flags)) != 0) return (ret); return (flags == 0 ? 0 : CDB___db_ferr(dbp->dbenv, "DB->set_flags", 0)); } static int CDB___db_set_lorder(dbp, db_lorder) DB *dbp; int db_lorder; { int ret; DB_ILLEGAL_AFTER_OPEN(dbp, "set_lorder"); /* Flag if the specified byte order requires swapping. */ switch (ret = CDB___db_byteorder(dbp->dbenv, db_lorder)) { case 0: F_CLR(dbp, DB_AM_SWAP); break; case DB_SWAPBYTES: F_SET(dbp, DB_AM_SWAP); break; default: return (ret); /* NOTREACHED */ } return (0); } static int CDB___db_set_malloc(dbp, func) DB *dbp; void *(*func) __P((size_t)); { DB_ILLEGAL_AFTER_OPEN(dbp, "set_malloc"); dbp->db_malloc = func; return (0); } static int CDB___db_set_pagesize(dbp, db_pagesize) DB *dbp; u_int32_t db_pagesize; { DB_ILLEGAL_AFTER_OPEN(dbp, "set_pagesize"); if (db_pagesize < DB_MIN_PGSIZE) { CDB___db_err(dbp->dbenv, "page sizes may not be smaller than %lu", (u_long)DB_MIN_PGSIZE); return (EINVAL); } if (db_pagesize > DB_MAX_PGSIZE) { CDB___db_err(dbp->dbenv, "page sizes may not be larger than %lu", (u_long)DB_MAX_PGSIZE); return (EINVAL); } /* * We don't want anything that's not a power-of-2, as we rely on that * for alignment of various types on the pages. */ if ((u_int32_t)1 << CDB___db_log2(db_pagesize) != db_pagesize) { CDB___db_err(dbp->dbenv, "page sizes must be a power-of-2"); return (EINVAL); } /* * XXX * Should we be checking for a page size that's not a multiple of 512, * so that we never try and write less than a disk sector? */ F_CLR(dbp, DB_AM_PGDEF); dbp->pgsize = db_pagesize; return (0); } static int CDB___db_set_realloc(dbp, func) DB *dbp; void *(*func) __P((void *, size_t)); { DB_ILLEGAL_AFTER_OPEN(dbp, "set_realloc"); dbp->db_realloc = func; return (0); } static void CDB___db_set_paniccall(dbp, paniccall) DB *dbp; void (*paniccall) __P((DB_ENV *, int)); { dbp->dbenv->set_paniccall(dbp->dbenv, paniccall); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_overflow.c����������������������������������������������������������������������0100644�0063146�0012731�00000025000�07427026535�015433� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * Keith Bostic. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Olson. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_overflow.c 11.2 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_am.h" /* * Big key/data code. * * Big key and data entries are stored on linked lists of pages. The initial * reference is a structure with the total length of the item and the page * number where it begins. Each entry in the linked list contains a pointer * to the next page of data, and so on. */ /* * CDB___db_goff -- * Get an offpage item. * * PUBLIC: int CDB___db_goff __P((DB *, DBT *, * PUBLIC: u_int32_t, db_pgno_t, void **, u_int32_t *)); */ int CDB___db_goff(dbp, dbt, tlen, pgno, bpp, bpsz) DB *dbp; DBT *dbt; u_int32_t tlen; db_pgno_t pgno; void **bpp; u_int32_t *bpsz; { PAGE *h; db_indx_t bytes; u_int32_t curoff, needed, start; u_int8_t *p, *src; int ret; /* * Check if the buffer is big enough; if it is not and we are * allowed to malloc space, then we'll malloc it. If we are * not (DB_DBT_USERMEM), then we'll set the dbt and return * appropriately. */ if (F_ISSET(dbt, DB_DBT_PARTIAL)) { start = dbt->doff; needed = dbt->dlen; } else { start = 0; needed = tlen; } /* Allocate any necessary memory. */ if (F_ISSET(dbt, DB_DBT_USERMEM)) { if (needed > dbt->ulen) { dbt->size = needed; return (ENOMEM); } } else if (F_ISSET(dbt, DB_DBT_MALLOC)) { if ((ret = CDB___os_malloc(needed, dbp->db_malloc, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_REALLOC)) { if ((ret = CDB___os_realloc(needed, dbp->db_realloc, &dbt->data)) != 0) return (ret); } else if (*bpsz == 0 || *bpsz < needed) { if ((ret = CDB___os_realloc(needed, NULL, bpp)) != 0) return (ret); *bpsz = needed; dbt->data = *bpp; } else dbt->data = *bpp; /* * Step through the linked list of pages, copying the data on each * one into the buffer. Never copy more than the total data length. */ dbt->size = needed; for (curoff = 0, p = dbt->data; pgno != P_INVALID && needed > 0;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } /* Check if we need any bytes from this page. */ if (curoff + OV_LEN(h) >= start) { src = (u_int8_t *)h + P_OVERHEAD; bytes = OV_LEN(h); if (start > curoff) { src += start - curoff; bytes -= start - curoff; } if (bytes > needed) bytes = needed; memcpy(p, src, bytes); p += bytes; needed -= bytes; } curoff += OV_LEN(h); pgno = h->next_pgno; CDB_memp_fput(dbp->mpf, h, 0); } return (0); } /* * CDB___db_poff -- * Put an offpage item. * * PUBLIC: int CDB___db_poff __P((DBC *, const DBT *, db_pgno_t *)); */ int CDB___db_poff(dbc, dbt, pgnop) DBC *dbc; const DBT *dbt; db_pgno_t *pgnop; { DB *dbp; PAGE *pagep, *lastp; DB_LSN new_lsn, null_lsn; DBT tmp_dbt; db_indx_t pagespace; u_int32_t sz; u_int8_t *p; int ret; /* * Allocate pages and copy the key/data item into them. Calculate the * number of bytes we get for pages we fill completely with a single * item. */ dbp = dbc->dbp; pagespace = P_MAXSPACE(dbp->pgsize); lastp = NULL; for (p = dbt->data, sz = dbt->size; sz > 0; p += pagespace, sz -= pagespace) { /* * Reduce pagespace so we terminate the loop correctly and * don't copy too much data. */ if (sz < pagespace) pagespace = sz; /* * Allocate and initialize a new page and copy all or part of * the item onto the page. If sz is less than pagespace, we * have a partial record. */ if ((ret = CDB___db_new(dbc, P_OVERFLOW, &pagep)) != 0) return (ret); if (DB_LOGGING(dbc)) { tmp_dbt.data = p; tmp_dbt.size = pagespace; ZERO_LSN(null_lsn); if ((ret = CDB___db_big_log(dbp->dbenv, dbc->txn, &new_lsn, 0, DB_ADD_BIG, dbp->log_fileid, PGNO(pagep), lastp ? PGNO(lastp) : PGNO_INVALID, PGNO_INVALID, &tmp_dbt, &LSN(pagep), lastp == NULL ? &null_lsn : &LSN(lastp), &null_lsn)) != 0) return (ret); /* Move lsn onto page. */ if (lastp) LSN(lastp) = new_lsn; LSN(pagep) = new_lsn; } P_INIT(pagep, dbp->pgsize, PGNO(pagep), PGNO_INVALID, PGNO_INVALID, 0, P_OVERFLOW); OV_LEN(pagep) = pagespace; OV_REF(pagep) = 1; memcpy((u_int8_t *)pagep + P_OVERHEAD, p, pagespace); /* * If this is the first entry, update the user's info. * Otherwise, update the entry on the last page filled * in and release that page. */ if (lastp == NULL) *pgnop = PGNO(pagep); else { lastp->next_pgno = PGNO(pagep); pagep->prev_pgno = PGNO(lastp); (void)CDB_memp_fput(dbp->mpf, lastp, DB_MPOOL_DIRTY); } lastp = pagep; } (void)CDB_memp_fput(dbp->mpf, lastp, DB_MPOOL_DIRTY); return (0); } /* * CDB___db_ovref -- * Increment/decrement the reference count on an overflow page. * * PUBLIC: int CDB___db_ovref __P((DBC *, db_pgno_t, int32_t)); */ int CDB___db_ovref(dbc, pgno, adjust) DBC *dbc; db_pgno_t pgno; int32_t adjust; { DB *dbp; PAGE *h; int ret; dbp = dbc->dbp; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } if (DB_LOGGING(dbc)) if ((ret = CDB___db_ovref_log(dbp->dbenv, dbc->txn, &LSN(h), 0, dbp->log_fileid, h->pgno, adjust, &LSN(h))) != 0) return (ret); OV_REF(h) += adjust; (void)CDB_memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY); return (0); } /* * CDB___db_doff -- * Delete an offpage chain of overflow pages. * * PUBLIC: int CDB___db_doff __P((DBC *, db_pgno_t)); */ int CDB___db_doff(dbc, pgno) DBC *dbc; db_pgno_t pgno; { DB *dbp; PAGE *pagep; DB_LSN null_lsn; DBT tmp_dbt; int ret; dbp = dbc->dbp; do { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &pagep)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } /* * If it's an overflow page and it's referenced by more than * one key/data item, decrement the reference count and return. */ if (TYPE(pagep) == P_OVERFLOW && OV_REF(pagep) > 1) { (void)CDB_memp_fput(dbp->mpf, pagep, 0); return (CDB___db_ovref(dbc, pgno, -1)); } if (DB_LOGGING(dbc)) { tmp_dbt.data = (u_int8_t *)pagep + P_OVERHEAD; tmp_dbt.size = OV_LEN(pagep); ZERO_LSN(null_lsn); if ((ret = CDB___db_big_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, DB_REM_BIG, dbp->log_fileid, PGNO(pagep), PREV_PGNO(pagep), NEXT_PGNO(pagep), &tmp_dbt, &LSN(pagep), &null_lsn, &null_lsn)) != 0) return (ret); } pgno = pagep->next_pgno; if ((ret = CDB___db_free(dbc, pagep)) != 0) return (ret); } while (pgno != PGNO_INVALID); return (0); } /* * CDB___db_moff -- * Match on overflow pages. * * Given a starting page number and a key, return <0, 0, >0 to indicate if the * key on the page is less than, equal to or greater than the key specified. * We optimize this by doing chunk at a time comparison unless the user has * specified a comparison function. In this case, we need to materialize * the entire object and call their comparison routine. * * PUBLIC: int CDB___db_moff __P((DB *, const DBT *, db_pgno_t, u_int32_t, * PUBLIC: int (*)(const DBT *, const DBT *), int *)); */ int CDB___db_moff(dbp, dbt, pgno, tlen, cmpfunc, cmpp) DB *dbp; const DBT *dbt; db_pgno_t pgno; u_int32_t tlen; int (*cmpfunc) __P((const DBT *, const DBT *)), *cmpp; { PAGE *pagep; DBT local_dbt; void *buf; u_int32_t bufsize, cmp_bytes, key_left; u_int8_t *p1, *p2; int ret; /* * If there is a user-specified comparison function, build a * contiguous copy of the key, and call it. */ if (cmpfunc != NULL) { memset(&local_dbt, 0, sizeof(local_dbt)); buf = NULL; bufsize = 0; if ((ret = CDB___db_goff(dbp, &local_dbt, tlen, pgno, &buf, &bufsize)) != 0) return (ret); *cmpp = cmpfunc(&local_dbt, dbt); CDB___os_free(buf, bufsize); return (0); } /* While there are both keys to compare. */ for (*cmpp = 0, p1 = dbt->data, key_left = dbt->size; key_left > 0 && pgno != PGNO_INVALID;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &pagep)) != 0) return (ret); cmp_bytes = OV_LEN(pagep) < key_left ? OV_LEN(pagep) : key_left; tlen -= cmp_bytes; key_left -= cmp_bytes; for (p2 = (u_int8_t *)pagep + P_OVERHEAD; cmp_bytes-- > 0; ++p1, ++p2) if (*p1 != *p2) { *cmpp = (long)*p1 - (long)*p2; break; } pgno = NEXT_PGNO(pagep); if ((ret = CDB_memp_fput(dbp->mpf, pagep, 0)) != 0) return (ret); if (*cmpp != 0) return (0); } if (key_left > 0) /* DBT is longer than the page key. */ *cmpp = -1; else if (tlen > 0) /* DBT is shorter than the page key. */ *cmpp = 1; else *cmpp = 0; return (0); } htdig-3.2.0b6/db/db_page.h��������������������������������������������������������������������������0100644�0063146�0012731�00000050023�07427026535�014514� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db_page.h 11.2 (Sleepycat) 8/19/99 */ #ifndef _DB_PAGE_H_ #define _DB_PAGE_H_ /* * DB page formats. * * !!! * This implementation requires that values within the following structures * NOT be padded -- note, ANSI C permits random padding within structures. * If your compiler pads randomly you can just forget ever making DB run on * your system. In addition, no data type can require larger alignment than * its own size, e.g., a 4-byte data element may not require 8-byte alignment. * * Note that key/data lengths are often stored in db_indx_t's -- this is * not accidental, nor does it limit the key/data size. If the key/data * item fits on a page, it's guaranteed to be small enough to fit into a * db_indx_t, and storing it in one saves space. */ #define PGNO_INVALID 0 /* Invalid page number in any database. */ #define PGNO_BASE_MD 0 /* Base database: metadata page number. */ /* Page types. */ #define P_INVALID 0 /* Invalid page type. */ #define P_DUPLICATE 1 /* Duplicate. */ #define P_HASH 2 /* Hash. */ #define P_IBTREE 3 /* Btree internal. */ #define P_IRECNO 4 /* Recno internal. */ #define P_LBTREE 5 /* Btree leaf. */ #define P_LRECNO 6 /* Recno leaf. */ #define P_OVERFLOW 7 /* Overflow. */ #define P_HASHMETA 8 /* Hash metadata page. */ #define P_BTREEMETA 9 /* Btree metadata page. */ #define P_QAMMETA 10 /* Queue metadata page. */ #define P_QAMDATA 11 /* Queue data page. */ /* * These page types are artificially built by io compression * when trying to access a page number that is not the * beginning of a page compression chain. * Utilities that walk the file by incrementing the page * number can make use of these page types or safely consider * them as equivalent to P_INVALID. */ #define P_CMPR_INTERNAL 12 /* Compression internal page. */ #define P_CMPR_FREE 13 /* Compression free page. */ /* * When we create pages in mpool, we ask mpool to clear some number of bytes * in the header. This number must be at least as big as the regular page * headers and cover enough of the btree and hash meta-data pages to obliterate * the page type. */ #define DB_PAGE_DB_LEN 32 #define DB_PAGE_QUEUE_LEN 0 /************************************************************************ GENERIC METADATA PAGE HEADER * * !!! * The magic and version numbers have to be in the same place in all versions * of the metadata page as the application may not have upgraded the database. ************************************************************************/ typedef struct _dbmeta { DB_LSN lsn; /* 00-07: LSN. */ db_pgno_t pgno; /* 08-11: Current page number. */ u_int32_t magic; /* 12-15: Magic number. */ u_int32_t version; /* 16-19: Version. */ u_int32_t pagesize; /* 20-23: Pagesize. */ u_int8_t unused1[1]; /* 24: Unused. */ u_int8_t type; /* 25: Page type. */ u_int8_t unused2[2]; /* 26-27: Unused. */ u_int32_t free; /* 28-31: Free list page number. */ u_int32_t flags; /* 32-35: Flags: unique to each AM. */ /* 36-55: Unique file ID. */ u_int8_t uid[DB_FILE_ID_LEN]; } DBMETA; /************************************************************************ BTREE METADATA PAGE LAYOUT ************************************************************************/ typedef struct _btmeta { #define BTM_DUP 0x001 /* Duplicates. */ #define BTM_RECNO 0x002 /* Recno tree. */ #define BTM_RECNUM 0x004 /* Btree: maintain record count. */ #define BTM_FIXEDLEN 0x008 /* Recno: fixed length records. */ #define BTM_RENUMBER 0x010 /* Recno: renumber on insert/delete. */ #define BTM_SUBDB 0x020 /* Subdatabases. */ #define BTM_MASK 0x03f DBMETA dbmeta; /* 00-55: Generic meta-data header. */ u_int32_t maxkey; /* 56-59: Btree: Maxkey. */ u_int32_t minkey; /* 60-63: Btree: Minkey. */ u_int32_t re_len; /* 64-67: Recno: fixed-length record length. */ u_int32_t re_pad; /* 68-71: Recno: fixed-length record pad. */ u_int32_t root; /* 72-75: Root page. */ /* * Minimum page size is 128. */ } BTMETA; /************************************************************************ HASH METADATA PAGE LAYOUT ************************************************************************/ typedef struct _hashmeta { #define DB_HASH_DUP 0x01 /* Duplicates. */ #define DB_HASH_SUBDB 0x02 /* Subdatabases. */ DBMETA dbmeta; /* 00-55: Generic meta-data page header. */ u_int32_t max_bucket; /* 56-59: ID of Maximum bucket in use */ u_int32_t high_mask; /* 60-63: Modulo mask into table */ u_int32_t low_mask; /* 64-67: Modulo mask into table lower half */ u_int32_t ffactor; /* 68-71: Fill factor */ u_int32_t nelem; /* 72-75: Number of keys in hash table */ u_int32_t h_charkey; /* 76-79: Value of hash(CHARKEY) */ #define NCACHED 32 /* number of spare points */ /* 80-207: Spare pages for overflow */ u_int32_t spares[NCACHED]; /* * Minimum page size is 256. */ } HMETA; /************************************************************************ QUEUE METADATA PAGE LAYOUT ************************************************************************/ /* * QAM Meta data page structure * */ typedef struct _qmeta { DBMETA dbmeta; /* 00-55: Generic meta-data header. */ u_int32_t start; /* 56-59: Start offset. */ u_int32_t first_recno; /* 60-63: First not deleted record. */ u_int32_t cur_recno; /* 64-67: Last recno allocated. */ u_int32_t re_len; /* 68-71: Fixed-length record length. */ u_int32_t re_pad; /* 72-75: Fixed-length record pad. */ u_int32_t rec_page; /* 76-79: Records Per Page. */ /* * Minimum page size is 128. */ } QMETA; /************************************************************************ BTREE/HASH MAIN PAGE LAYOUT ************************************************************************/ /* * +-----------------------------------+ * | lsn | pgno | prev pgno | * +-----------------------------------+ * | next pgno | entries | hf offset | * +-----------------------------------+ * | level | type | index | * +-----------------------------------+ * | index | free --> | * +-----------+-----------------------+ * | F R E E A R E A | * +-----------------------------------+ * | <-- free | item | * +-----------------------------------+ * | item | item | item | * +-----------------------------------+ * * sizeof(PAGE) == 26 bytes, and the following indices are guaranteed to be * two-byte aligned. * * For hash and btree leaf pages, index items are paired, e.g., inp[0] is the * key for inp[1]'s data. All other types of pages only contain single items. */ typedef struct _db_page { DB_LSN lsn; /* 00-07: Log sequence number. */ db_pgno_t pgno; /* 08-11: Current page number. */ db_pgno_t prev_pgno; /* 12-15: Previous page number. */ db_pgno_t next_pgno; /* 16-19: Next page number. */ db_indx_t entries; /* 20-21: Number of items on the page. */ db_indx_t hf_offset; /* 22-23: High free byte page offset. */ /* * The btree levels are numbered from the leaf to the root, starting * with 1, so the leaf is level 1, its parent is level 2, and so on. * We maintain this level on all btree pages, but the only place that * we actually need it is on the root page. It would not be difficult * to hide the byte on the root page once it becomes an internal page, * so we could get this byte back if we needed it for something else. */ #define LEAFLEVEL 1 #define MAXBTREELEVEL 255 u_int8_t level; /* 24: Btree tree level. */ u_int8_t type; /* 25: Page type. */ db_indx_t inp[1]; /* Variable length index of items. */ } PAGE; /************************************************************************ QUEUE MAIN PAGE LAYOUT ************************************************************************/ typedef struct _qpage { DB_LSN lsn; /* 00-07: Log sequence number. */ db_pgno_t pgno; /* 08-11: Current page number. */ u_int32_t unused0[3]; /* 12-23: Unused. */ u_int8_t unused1[1]; /* 24: Unused. */ u_int8_t type; /* 25: Page type. */ u_int8_t unused2[2]; /* 26-27: Unused. */ } QPAGE; /* Main page element macros. */ #define LSN(p) (((PAGE *)p)->lsn) #define PGNO(p) (((PAGE *)p)->pgno) #define PREV_PGNO(p) (((PAGE *)p)->prev_pgno) #define NEXT_PGNO(p) (((PAGE *)p)->next_pgno) #define NUM_ENT(p) (((PAGE *)p)->entries) #define HOFFSET(p) (((PAGE *)p)->hf_offset) #define LEVEL(p) (((PAGE *)p)->level) #define TYPE(p) (((PAGE *)p)->type) /* * !!! * The next_pgno and prev_pgno fields are not maintained for btree and recno * internal pages. It's a minor performance improvement, and more, it's * hard to do when deleting internal pages, and it decreases the chance of * deadlock during deletes and splits. * * !!! * The btree/recno access method needs db_recno_t bytes of space on the root * page to specify how many records are stored in the tree. (The alternative * is to store the number of records in the meta-data page, which will create * a second hot spot in trees being actively modified, or recalculate it from * the BINTERNAL fields on each access.) Overload the prev_pgno field. */ #define RE_NREC(p) \ (TYPE(p) == P_LBTREE ? NUM_ENT(p) / 2 : \ TYPE(p) == P_LRECNO ? NUM_ENT(p) : PREV_PGNO(p)) #define RE_NREC_ADJ(p, adj) \ PREV_PGNO(p) += adj; #define RE_NREC_SET(p, num) \ PREV_PGNO(p) = num; /* * Initialize a page. * * !!! * Don't modify the page's LSN, code depends on it being unchanged after a * P_INIT call. */ #define P_INIT(pg, pg_size, n, pg_prev, pg_next, btl, pg_type) do { \ PGNO(pg) = n; \ PREV_PGNO(pg) = pg_prev; \ NEXT_PGNO(pg) = pg_next; \ NUM_ENT(pg) = 0; \ HOFFSET(pg) = pg_size; \ LEVEL(pg) = btl; \ TYPE(pg) = pg_type; \ } while (0) /* Page header length (offset to first index). */ #define P_OVERHEAD (SSZA(PAGE, inp)) /* First free byte. */ #define LOFFSET(pg) (P_OVERHEAD + NUM_ENT(pg) * sizeof(db_indx_t)) /* Free space on a regular page. */ #define P_FREESPACE(pg) (HOFFSET(pg) - LOFFSET(pg)) /* Get a pointer to the bytes at a specific index. */ #define P_ENTRY(pg, indx) ((u_int8_t *)pg + ((PAGE *)pg)->inp[indx]) /************************************************************************ OVERFLOW PAGE LAYOUT ************************************************************************/ /* * Overflow items are referenced by HOFFPAGE and BOVERFLOW structures, which * store a page number (the first page of the overflow item) and a length * (the total length of the overflow item). The overflow item consists of * some number of overflow pages, linked by the next_pgno field of the page. * A next_pgno field of PGNO_INVALID flags the end of the overflow item. * * Overflow page overloads: * The amount of overflow data stored on each page is stored in the * hf_offset field. * * The implementation reference counts overflow items as it's possible * for them to be promoted onto btree internal pages. The reference * count is stored in the entries field. */ #define OV_LEN(p) (((PAGE *)p)->hf_offset) #define OV_REF(p) (((PAGE *)p)->entries) /* Maximum number of bytes that you can put on an overflow page. */ #define P_MAXSPACE(psize) ((psize) - P_OVERHEAD) /* Free space on an overflow page. */ #define P_OVFLSPACE(psize, pg) (P_MAXSPACE(psize) - HOFFSET(pg)) /************************************************************************ HASH PAGE LAYOUT ************************************************************************/ /* Each index references a group of bytes on the page. */ #define H_KEYDATA 1 /* Key/data item. */ #define H_DUPLICATE 2 /* Duplicate key/data item. */ #define H_OFFPAGE 3 /* Overflow key/data item. */ #define H_OFFDUP 4 /* Overflow page of duplicates. */ /* * !!! * Items on hash pages are (potentially) unaligned, so we can never cast the * (page + offset) pointer to an HKEYDATA, HOFFPAGE or HOFFDUP structure, as * we do with B+tree on-page structures. Because we frequently want the type * field, it requires no alignment, and it's in the same location in all three * structures, there's a pair of macros. */ #define HPAGE_PTYPE(p) (*(u_int8_t *)p) #define HPAGE_TYPE(pg, indx) (*P_ENTRY(pg, indx)) /* * The first and second types are H_KEYDATA and H_DUPLICATE, represented * by the HKEYDATA structure: * * +-----------------------------------+ * | type | key/data ... | * +-----------------------------------+ * * For duplicates, the data field encodes duplicate elements in the data * field: * * +---------------------------------------------------------------+ * | type | len1 | element1 | len1 | len2 | element2 | len2 | * +---------------------------------------------------------------+ * * Thus, by keeping track of the offset in the element, we can do both * backward and forward traversal. */ typedef struct _hkeydata { u_int8_t type; /* 00: Page type. */ u_int8_t data[1]; /* Variable length key/data item. */ } HKEYDATA; #define HKEYDATA_DATA(p) (((u_int8_t *)p) + SSZA(HKEYDATA, data)) /* * The length of any HKEYDATA item. Note that indx is an element index, * not a PAIR index. */ #define LEN_HITEM(pg, pgsize, indx) \ (((indx) == 0 ? pgsize : pg->inp[indx - 1]) - pg->inp[indx]) #define LEN_HKEYDATA(pg, psize, indx) \ (((indx) == 0 ? psize : pg->inp[indx - 1]) - \ pg->inp[indx] - HKEYDATA_SIZE(0)) /* * Page space required to add a new HKEYDATA item to the page, with and * without the index value. */ #define HKEYDATA_SIZE(len) \ ((len) + SSZA(HKEYDATA, data)) #define HKEYDATA_PSIZE(len) \ (HKEYDATA_SIZE(len) + sizeof(db_indx_t)) /* Put a HKEYDATA item at the location referenced by a page entry. */ #define PUT_HKEYDATA(pe, kd, len, type) { \ ((HKEYDATA *)pe)->type = type; \ memcpy((u_int8_t *)pe + sizeof(u_int8_t), kd, len); \ } /* * Macros the describe the page layout in terms of key-data pairs. * The use of "pindex" indicates that the argument is the index * expressed in pairs instead of individual elements. */ #define H_NUMPAIRS(pg) (NUM_ENT(pg) / 2) #define H_KEYINDEX(pindx) (2 * (pindx)) #define H_DATAINDEX(pindx) ((2 * (pindx)) + 1) #define H_PAIRKEY(pg, pindx) P_ENTRY(pg, H_KEYINDEX(pindx)) #define H_PAIRDATA(pg, pindx) P_ENTRY(pg, H_DATAINDEX(pindx)) #define H_PAIRSIZE(pg, psize, pindx) \ (LEN_HITEM(pg, psize, H_KEYINDEX(pindx)) + \ LEN_HITEM(pg, psize, H_DATAINDEX(pindx))) #define LEN_HDATA(p, psize, pindx) LEN_HKEYDATA(p, psize, H_DATAINDEX(pindx)) #define LEN_HKEY(p, psize, pindx) LEN_HKEYDATA(p, psize, H_KEYINDEX(pindx)) /* * The third type is the H_OFFPAGE, represented by the HOFFPAGE structure: */ typedef struct _hoffpage { u_int8_t type; /* 00: Page type and delete flag. */ u_int8_t unused[3]; /* 01-03: Padding, unused. */ db_pgno_t pgno; /* 04-07: Offpage page number. */ u_int32_t tlen; /* 08-11: Total length of item. */ } HOFFPAGE; #define HOFFPAGE_PGNO(p) (((u_int8_t *)p) + SSZ(HOFFPAGE, pgno)) #define HOFFPAGE_TLEN(p) (((u_int8_t *)p) + SSZ(HOFFPAGE, tlen)) /* * Page space required to add a new HOFFPAGE item to the page, with and * without the index value. */ #define HOFFPAGE_SIZE (sizeof(HOFFPAGE)) #define HOFFPAGE_PSIZE (HOFFPAGE_SIZE + sizeof(db_indx_t)) /* * The fourth type is H_OFFDUP represented by the HOFFDUP structure: */ typedef struct _hoffdup { u_int8_t type; /* 00: Page type and delete flag. */ u_int8_t unused[3]; /* 01-03: Padding, unused. */ db_pgno_t pgno; /* 04-07: Offpage page number. */ } HOFFDUP; #define HOFFDUP_PGNO(p) (((u_int8_t *)p) + SSZ(HOFFDUP, pgno)) /* * Page space required to add a new HOFFDUP item to the page, with and * without the index value. */ #define HOFFDUP_SIZE (sizeof(HOFFDUP)) #define HOFFDUP_PSIZE (HOFFDUP_SIZE + sizeof(db_indx_t)) /************************************************************************ BTREE PAGE LAYOUT ************************************************************************/ /* Each index references a group of bytes on the page. */ #define B_KEYDATA 1 /* Key/data item. */ #define B_DUPLICATE 2 /* Duplicate key/data item. */ #define B_OVERFLOW 3 /* Overflow key/data item. */ /* * We have to store a deleted entry flag in the page. The reason is complex, * but the simple version is that we can't delete on-page items referenced by * a cursor -- the return order of subsequent insertions might be wrong. The * delete flag is an overload of the top bit of the type byte. */ #define B_DELETE (0x80) #define B_DCLR(t) (t) &= ~B_DELETE #define B_DSET(t) (t) |= B_DELETE #define B_DISSET(t) ((t) & B_DELETE) #define B_TYPE(t) ((t) & ~B_DELETE) #define B_TSET(t, type, deleted) { \ (t) = (type); \ if (deleted) \ B_DSET(t); \ } /* * The first type is B_KEYDATA, represented by the BKEYDATA structure: */ typedef struct _bkeydata { db_indx_t len; /* 00-01: Key/data item length. */ u_int8_t type; /* 02: Page type AND DELETE FLAG. */ u_int8_t data[1]; /* Variable length key/data item. */ } BKEYDATA; /* Get a BKEYDATA item for a specific index. */ #define GET_BKEYDATA(pg, indx) \ ((BKEYDATA *)P_ENTRY(pg, indx)) /* * Page space required to add a new BKEYDATA item to the page, with and * without the index value. */ #define BKEYDATA_SIZE(len) \ ALIGN((len) + SSZA(BKEYDATA, data), 4) #define BKEYDATA_PSIZE(len) \ (BKEYDATA_SIZE(len) + sizeof(db_indx_t)) /* * The second and third types are B_DUPLICATE and B_OVERFLOW, represented * by the BOVERFLOW structure. */ typedef struct _boverflow { db_indx_t unused1; /* 00-01: Padding, unused. */ u_int8_t type; /* 02: Page type AND DELETE FLAG. */ u_int8_t unused2; /* 03: Padding, unused. */ db_pgno_t pgno; /* 04-07: Next page number. */ u_int32_t tlen; /* 08-11: Total length of item. */ } BOVERFLOW; /* Get a BOVERFLOW item for a specific index. */ #define GET_BOVERFLOW(pg, indx) \ ((BOVERFLOW *)P_ENTRY(pg, indx)) /* * Page space required to add a new BOVERFLOW item to the page, with and * without the index value. */ #define BOVERFLOW_SIZE \ ALIGN(sizeof(BOVERFLOW), 4) #define BOVERFLOW_PSIZE \ (BOVERFLOW_SIZE + sizeof(db_indx_t)) /* * Btree leaf and hash page layouts group indices in sets of two, one * for the key and one for the data. Everything else does it in sets * of one to save space. I use the following macros so that it's real * obvious what's going on... */ #define O_INDX 1 #define P_INDX 2 /************************************************************************ BTREE INTERNAL PAGE LAYOUT ************************************************************************/ /* * Btree internal entry. */ typedef struct _binternal { db_indx_t len; /* 00-01: Key/data item length. */ u_int8_t type; /* 02: Page type AND DELETE FLAG. */ u_int8_t unused; /* 03: Padding, unused. */ db_pgno_t pgno; /* 04-07: Page number of referenced page. */ db_recno_t nrecs; /* 08-11: Subtree record count. */ u_int8_t data[1]; /* Variable length key item. */ } BINTERNAL; /* Get a BINTERNAL item for a specific index. */ #define GET_BINTERNAL(pg, indx) \ ((BINTERNAL *)P_ENTRY(pg, indx)) /* * Page space required to add a new BINTERNAL item to the page, with and * without the index value. */ #define BINTERNAL_SIZE(len) \ ALIGN((len) + SSZA(BINTERNAL, data), 4) #define BINTERNAL_PSIZE(len) \ (BINTERNAL_SIZE(len) + sizeof(db_indx_t)) /************************************************************************ RECNO INTERNAL PAGE LAYOUT ************************************************************************/ /* * The recno internal entry. * * XXX * Why not fold this into the db_indx_t structure, it's fixed length? */ typedef struct _rinternal { db_pgno_t pgno; /* 00-03: Page number of referenced page. */ db_recno_t nrecs; /* 04-07: Subtree record count. */ } RINTERNAL; /* Get a RINTERNAL item for a specific index. */ #define GET_RINTERNAL(pg, indx) \ ((RINTERNAL *)P_ENTRY(pg, indx)) /* * Page space required to add a new RINTERNAL item to the page, with and * without the index value. */ #define RINTERNAL_SIZE \ ALIGN(sizeof(RINTERNAL), 4) #define RINTERNAL_PSIZE \ (RINTERNAL_SIZE + sizeof(db_indx_t)) #endif /* _DB_PAGE_H_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_pr.c����������������������������������������������������������������������������0100644�0063146�0012731�00000054070�10000513627�014202� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_pr.c 11.9 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER /* _WIN32 */ #include <process.h> #else #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "db_page.h" #include "btree.h" #include "hash.h" #include "qam.h" #include "db_am.h" static int CDB___db_bmeta __P((DB *, FILE *, BTMETA *, u_int32_t)); static int CDB___db_hmeta __P((DB *, FILE *, HMETA *, u_int32_t)); static void CDB___db_meta __P((DB *, DBMETA *, FILE *, FN const *, u_int32_t)); static const char *CDB___db_name __P((DB *)); static void CDB___db_prdb __P((DB *, FILE *, u_int32_t)); static FILE *CDB___db_prinit __P((FILE *)); static void CDB___db_proff __P((void *)); static int CDB___db_prtree __P((DB *, u_int32_t)); static void CDB___db_psize __P((DB *)); static int CDB___db_qmeta __P((DB *, FILE *, QMETA *, u_int32_t)); /* * 64K is the maximum page size, so by default we check for offsets larger * than that, and, where possible, we refine the test. */ #define PSIZE_BOUNDARY (64 * 1024 + 1) static size_t set_psize = PSIZE_BOUNDARY; static FILE *set_fp; /* Output file descriptor. */ #define DB_PR_PAGE 0x01 /* Show page contents. */ #define DB_PR_RECOVERY 0x02 /* Recovery test. */ /* * CDB___db_loadme -- * A nice place to put a breakpoint. * * PUBLIC: void CDB___db_loadme __P((void)); */ void CDB___db_loadme() { getpid(); } /* * CDB___db_dump -- * Dump the tree to a file. * * PUBLIC: int CDB___db_dump __P((DB *, char *, char *)); */ int CDB___db_dump(dbp, op, name) DB *dbp; char *op, *name; { FILE *fp, *save_fp; u_int32_t flags; COMPQUIET(save_fp, NULL); if (set_psize == PSIZE_BOUNDARY) CDB___db_psize(dbp); if (name != NULL) { if ((fp = fopen(name, "w")) == NULL) return (CDB___os_get_errno()); save_fp = set_fp; set_fp = fp; } else fp = CDB___db_prinit(NULL); for (flags = 0; *op != '\0'; ++op) switch (*op) { case 'a': LF_SET(DB_PR_PAGE); break; case 'h': break; case 'r': LF_SET(DB_PR_RECOVERY); break; default: return (EINVAL); } CDB___db_prdb(dbp, fp, flags); fprintf(fp, "%s\n", DB_LINE); (void)CDB___db_prtree(dbp, flags); fflush(fp); if (name != NULL) { fclose(fp); set_fp = save_fp; } return (0); } /* * CDB___db_prdb -- * Print out the DB structure information. */ static void CDB___db_prdb(dbp, fp, flags) DB *dbp; FILE *fp; u_int32_t flags; { static const FN fn[] = { { DB_AM_DISCARD, "discard cached pages" }, { DB_AM_DUP, "duplicates" }, { DB_AM_INMEM, "in-memory" }, { DB_AM_PGDEF, "default page size" }, { DB_AM_RDONLY, "read-only" }, { DB_AM_SUBDB, "subdatabases" }, { DB_AM_SWAP, "needswap" }, { DB_BT_RECNUM, "btree:recnum" }, { DB_BT_REVSPLIT, "btree:no reverse split" }, { DB_DBM_ERROR, "dbm/ndbm error" }, { DB_OPEN_CALLED, "DB->open called" }, { DB_RE_DELIMITER, "recno:delimiter" }, { DB_RE_FIXEDLEN, "recno:fixed-length" }, { DB_RE_PAD, "recno:pad" }, { DB_RE_RENUMBER, "recno:renumber" }, { DB_RE_SNAPSHOT, "recno:snapshot" }, { 0, NULL } }; static const FN bfn[] = { { RECNO_EOF, "recno:eof" }, { RECNO_MODIFIED, "recno:modified" }, { 0, NULL } }; BTREE *bt; HASH *h; QUEUE *q; COMPQUIET(flags, 0); fprintf(fp, "In-memory DB structure:\n%s: %#lx", CDB___db_name(dbp), (u_long)dbp->flags); CDB___db_prflags(dbp->flags, fn, fp); fprintf(fp, "\n"); switch (dbp->type) { case DB_BTREE: case DB_RECNO: bt = dbp->bt_internal; fprintf(fp, "bt_lpgno: %lu\n", (u_long)bt->bt_lpgno); fprintf(fp, "bt_ovflsize: %lu\n", (u_long)bt->bt_ovflsize); fprintf(fp, "bt_meta: %lu: bt_root: %lu\n", (u_long)bt->bt_meta, (u_long)bt->bt_root); fprintf(fp, "bt_maxkey: %lu bt_minkey: %lu\n", (u_long)bt->bt_maxkey, (u_long)bt->bt_minkey); fprintf(fp, "bt_compare: %#lx bt_prefix: %#lx\n", (u_long)bt->bt_compare, (u_long)bt->bt_prefix); if (dbp->type == DB_RECNO) { fprintf(fp, "re_pad: %#lx re_delim: %#lx re_len: %lu re_source: %s\n", (u_long)bt->re_pad, (u_long)bt->re_delim, (u_long)bt->re_len, bt->re_source == NULL ? "" : bt->re_source); fprintf(fp, "re_last: %lu\n", (u_long)bt->re_last); fprintf(fp, "cmap: %#lx smap: %#lx emap: %#lx msize: %lu\n", (u_long)bt->re_cmap, (u_long)bt->re_smap, (u_long)bt->re_emap, (u_long)bt->re_msize); fprintf(fp, "re_irec: %#lx\n", (u_long)bt->re_irec); } fprintf(fp, "flags: %#lx", (u_long)bt->flags); CDB___db_prflags(bt->flags, bfn, fp); fprintf(fp, "\n"); break; case DB_HASH: h = dbp->h_internal; fprintf(fp, "meta_pgno: %lu\n", (u_long)h->meta_pgno); fprintf(fp, "h_ffactor: %lu\n", (u_long)h->h_ffactor); fprintf(fp, "h_nelem: %lu\n", (u_long)h->h_nelem); fprintf(fp, "h_hash: %#lx\n", (u_long)h->h_hash); break; case DB_QUEUE: q = dbp->q_internal; fprintf(fp, "q_meta: %lu\n", (u_long)q->q_meta); fprintf(fp, "q_root: %lu\n", (u_long)q->q_root); fprintf(fp, "re_pad: %#lx re_len: %lu\n", (u_long)q->re_pad, (u_long)q->re_len); fprintf(fp, "rec_page: %lu\n", (u_long)q->rec_page); break; default: break; } } /* * CDB___db_prtree -- * Print out the entire tree. */ static int CDB___db_prtree(dbp, flags) DB *dbp; u_int32_t flags; { PAGE *h; db_pgno_t i, last; int ret; if (set_psize == PSIZE_BOUNDARY) CDB___db_psize(dbp); /* Find out the page number of the last page in the database. */ if ((ret = CDB_memp_fget(dbp->mpf, &last, DB_MPOOL_LAST, &h)) != 0) return (ret); if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); /* Dump each page. */ for (i = 0; i <= last; ++i) { if ((ret = CDB_memp_fget(dbp->mpf, &i, 0, &h)) != 0) return (ret); (void)CDB___db_prpage(dbp, h, flags); if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); } (void)fflush(CDB___db_prinit(NULL)); return (0); } /* * CDB___db_meta -- * Print out common metadata information. */ static void CDB___db_meta(dbp, dbmeta, fp, fn, flags) DB *dbp; DBMETA *dbmeta; FILE *fp; FN const *fn; u_int32_t flags; { PAGE *h; int cnt; db_pgno_t pgno; u_int8_t *p; int ret; const char *sep; fprintf(fp, "\tmagic: %#lx\n", (u_long)dbmeta->magic); fprintf(fp, "\tversion: %lu\n", (u_long)dbmeta->version); fprintf(fp, "\tpagesize: %lu\n", (u_long)dbmeta->pagesize); fprintf(fp, "\ttype: %lu\n", (u_long)dbmeta->type); if (!LF_ISSET(DB_PR_RECOVERY)) { /* * If we're doing recovery testing, don't display the free * list, it may have changed and that makes the dump diff * not work. */ fprintf(fp, "\tfree list: %lu", (u_long)dbmeta->free); for (pgno = dbmeta->free, cnt = 0, sep = ", "; pgno != PGNO_INVALID;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { fprintf(fp, "Unable to retrieve free-list page: %lu: %s\n", (u_long)pgno, CDB_db_strerror(ret)); break; } pgno = h->next_pgno; (void)CDB_memp_fput(dbp->mpf, h, 0); fprintf(fp, "%s%lu", sep, (u_long)pgno); if (++cnt % 10 == 0) { fprintf(fp, "\n"); cnt = 0; sep = "\t"; } else sep = ", "; } fprintf(fp, "\n"); } if (fn != NULL) { fprintf(fp, "\tflags: %#lx", (u_long)dbmeta->flags); CDB___db_prflags(dbmeta->flags, fn, fp); fprintf(fp, "\n"); } fprintf(fp, "\tuid: "); for (p = (u_int8_t *)dbmeta->uid, cnt = 0; cnt < DB_FILE_ID_LEN; ++cnt) { fprintf(fp, "%x", *p++); if (cnt < DB_FILE_ID_LEN - 1) fprintf(fp, " "); } fprintf(fp, "\n"); } /* * CDB___db_bmeta -- * Print out the btree meta-data page. */ static int CDB___db_bmeta(dbp, fp, h, flags) DB *dbp; FILE *fp; BTMETA *h; u_int32_t flags; { static const FN mfn[] = { { BTM_DUP, "duplicates" }, { BTM_RECNO, "recno" }, { BTM_RECNUM, "btree:recnum" }, { BTM_FIXEDLEN, "recno:fixed-length" }, { BTM_RENUMBER, "recno:renumber" }, { BTM_SUBDB, "subdatabases" }, { 0, NULL } }; CDB___db_meta(dbp, (DBMETA *)h, fp, mfn, flags); fprintf(fp, "\tmaxkey: %lu minkey: %lu\n", (u_long)h->maxkey, (u_long)h->minkey); if (dbp->type == DB_RECNO) fprintf(fp, "\tre_len: %#lx re_pad: %lu\n", (u_long)h->re_len, (u_long)h->re_pad); fprintf(fp, "\troot: %lu\n", (u_long)h->root); return (0); } /* * CDB___db_hmeta -- * Print out the hash meta-data page. */ static int CDB___db_hmeta(dbp, fp, h, flags) DB *dbp; FILE *fp; HMETA *h; u_int32_t flags; { static const FN mfn[] = { { DB_HASH_DUP, "duplicates" }, { DB_HASH_SUBDB, "subdatabases" }, { 0, NULL } }; int i; CDB___db_meta(dbp, (DBMETA *)h, fp, mfn, flags); fprintf(fp, "\tmax_bucket: %lu\n", (u_long)h->max_bucket); fprintf(fp, "\thigh_mask: %#lx\n", (u_long)h->high_mask); fprintf(fp, "\tlow_mask: %#lx\n", (u_long)h->low_mask); fprintf(fp, "\tffactor: %lu\n", (u_long)h->ffactor); fprintf(fp, "\tnelem: %lu\n", (u_long)h->nelem); fprintf(fp, "\th_charkey: %#lx\n", (u_long)h->h_charkey); fprintf(fp, "\tspare points: "); for (i = 0; i < NCACHED; i++) fprintf(fp, "%lu ", (u_long)h->spares[i]); fprintf(fp, "\n"); return (0); } /* * CDB___db_qmeta -- * Print out the queue meta-data page. */ static int CDB___db_qmeta(dbp, fp, h, flags) DB *dbp; FILE *fp; QMETA *h; u_int32_t flags; { CDB___db_meta(dbp, (DBMETA *)h, fp, NULL, flags); fprintf(fp, "\tstart: %lu\n", (u_long)h->start); fprintf(fp, "\tfirst_recno: %lu\n", (u_long)h->first_recno); fprintf(fp, "\tcur_recno: %lu\n", (u_long)h->cur_recno); fprintf(fp, "\tre_len: %#lx re_pad: %lu\n", (u_long)h->re_len, (u_long)h->re_pad); fprintf(fp, "\trec_page: %lu\n", (u_long)h->rec_page); return (0); } /* * CDB___db_prnpage * -- Print out a specific page. * * PUBLIC: int CDB___db_prnpage __P((DB *, db_pgno_t)); */ int CDB___db_prnpage(dbp, pgno) DB *dbp; db_pgno_t pgno; { PAGE *h; int ret; if (set_psize == PSIZE_BOUNDARY) CDB___db_psize(dbp); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); ret = CDB___db_prpage(dbp, h, DB_PR_PAGE); (void)fflush(CDB___db_prinit(NULL)); (void)CDB_memp_fput(dbp->mpf, h, 0); return (ret); } /* * CDB___db_prpage * -- Print out a page. * * PUBLIC: int CDB___db_prpage __P((DB *, PAGE *, u_int32_t)); */ int CDB___db_prpage(dbp, h, flags) DB *dbp; PAGE *h; u_int32_t flags; { BINTERNAL *bi; BKEYDATA *bk; BTREE *t; FILE *fp; HOFFPAGE a_hkd; QAMDATA *qp, *qep; RINTERNAL *ri; db_indx_t dlen, len, i; db_pgno_t pgno; db_recno_t recno; int deleted, ret; const char *s; u_int32_t qlen; u_int8_t *ep, *hk, *p; void *sp; fp = CDB___db_prinit(NULL); switch (TYPE(h)) { case P_BTREEMETA: s = "btree metadata"; break; case P_DUPLICATE: s = "duplicate"; break; case P_HASH: s = "hash"; break; case P_HASHMETA: s = "hash metadata"; break; case P_IBTREE: s = "btree internal"; break; case P_INVALID: /* * If we're doing recovery testing, assume this is a page * that's on the free list, and don't display it. */ if (LF_ISSET(DB_PR_RECOVERY)) return (0); s = "invalid"; break; case P_IRECNO: s = "recno internal"; break; case P_LBTREE: s = "btree leaf"; break; case P_LRECNO: s = "recno leaf"; break; case P_OVERFLOW: s = "overflow"; break; case P_QAMMETA: s = "queue metadata"; break; case P_QAMDATA: s = "queue"; break; default: fprintf(fp, "ILLEGAL PAGE TYPE: page: %lu type: %lu\n", (u_long)h->pgno, (u_long)TYPE(h)); return (1); } /* Every page has a type, a page number, and an LSN. */ fprintf(fp, "page %lu: %s", (u_long)h->pgno, s); fprintf(fp, " (lsn.file: %lu lsn.offset: %lu)\n", (u_long)LSN(h).file, (u_long)LSN(h).offset); switch (TYPE(h)) { case P_BTREEMETA: return (CDB___db_bmeta(dbp, fp, (BTMETA *)h, flags)); case P_HASHMETA: return (CDB___db_hmeta(dbp, fp, (HMETA *)h, flags)); case P_QAMMETA: return (CDB___db_qmeta(dbp, fp, (QMETA *)h, flags)); case P_QAMDATA: /* Should be meta->start. */ if (!LF_ISSET(DB_PR_PAGE)) return (0); qlen = ((QUEUE *)dbp->q_internal)->re_len; recno = (h->pgno - 1) * QAM_RECNO_PER_PAGE(dbp) + 1; i = 0; qep = (QAMDATA *)((u_long) h + set_psize - qlen); for (qp = QAM_GET_RECORD(dbp, h, i); qp < qep; recno++, i++, qp = QAM_GET_RECORD(dbp, h, i)) { if (!F_ISSET(qp, QAM_SET)) continue; fprintf(fp, "%s", F_ISSET(qp, QAM_VALID) ? "\t" : " D"); fprintf(fp, "[%03lu] %4lu ", (u_long)recno, (u_long)qp - (u_long)h); CDB___db_pr(qp->data, qlen); } return (0); } t = dbp->bt_internal; if (TYPE(h) == P_IBTREE || TYPE(h) == P_IRECNO || (TYPE(h) == P_LRECNO && h->pgno == ((BTREE *)dbp->bt_internal)->bt_root)) fprintf(fp, "\ttotal records: %4lu\n", (u_long)RE_NREC(h)); if (TYPE(h) != P_IBTREE && TYPE(h) != P_IRECNO) fprintf(fp, "\tprev: %4lu next: %4lu", (u_long)PREV_PGNO(h), (u_long)NEXT_PGNO(h)); if (TYPE(h) == P_IBTREE || TYPE(h) == P_LBTREE) fprintf(fp, " level: %2lu", (u_long)h->level); if (TYPE(h) == P_OVERFLOW) { fprintf(fp, " ref cnt: %4lu ", (u_long)OV_REF(h)); CDB___db_pr((u_int8_t *)h + P_OVERHEAD, OV_LEN(h)); return (0); } fprintf(fp, " entries: %4lu", (u_long)NUM_ENT(h)); fprintf(fp, " offset: %4lu\n", (u_long)HOFFSET(h)); if (TYPE(h) == P_INVALID || !LF_ISSET(DB_PR_PAGE)) return (0); ret = 0; for (i = 0; i < NUM_ENT(h); i++) { if (P_ENTRY(h, i) - (u_int8_t *)h < P_OVERHEAD || (size_t)(P_ENTRY(h, i) - (u_int8_t *)h) >= set_psize) { fprintf(fp, "ILLEGAL PAGE OFFSET: indx: %lu of %lu\n", (u_long)i, (u_long)h->inp[i]); ret = EINVAL; continue; } deleted = 0; switch (TYPE(h)) { case P_HASH: case P_IBTREE: case P_IRECNO: sp = P_ENTRY(h, i); break; case P_LBTREE: sp = P_ENTRY(h, i); deleted = i % 2 == 0 && B_DISSET(GET_BKEYDATA(h, i + O_INDX)->type); break; case P_LRECNO: case P_DUPLICATE: sp = P_ENTRY(h, i); deleted = B_DISSET(GET_BKEYDATA(h, i)->type); break; default: fprintf(fp, "ILLEGAL PAGE ITEM: %lu\n", (u_long)TYPE(h)); ret = EINVAL; continue; } fprintf(fp, "%s", deleted ? " D" : "\t"); fprintf(fp, "[%03lu] %4lu ", (u_long)i, (u_long)h->inp[i]); switch (TYPE(h)) { case P_HASH: hk = sp; switch (HPAGE_PTYPE(hk)) { case H_OFFDUP: memcpy(&pgno, HOFFDUP_PGNO(hk), sizeof(db_pgno_t)); fprintf(fp, "%4lu [offpage dups]\n", (u_long)pgno); break; case H_DUPLICATE: /* * If this is the first item on a page, then * we cannot figure out how long it is, so * we only print the first one in the duplicate * set. */ if (i != 0) len = LEN_HKEYDATA(h, 0, i); else len = 1; fprintf(fp, "Duplicates:\n"); for (p = HKEYDATA_DATA(hk), ep = p + len; p < ep;) { memcpy(&dlen, p, sizeof(db_indx_t)); p += sizeof(db_indx_t); fprintf(fp, "\t\t"); CDB___db_pr(p, dlen); p += sizeof(db_indx_t) + dlen; } break; case H_KEYDATA: CDB___db_pr(HKEYDATA_DATA(hk), LEN_HKEYDATA(h, i == 0 ? set_psize : 0, i)); break; case H_OFFPAGE: memcpy(&a_hkd, hk, HOFFPAGE_SIZE); fprintf(fp, "overflow: total len: %4lu page: %4lu\n", (u_long)a_hkd.tlen, (u_long)a_hkd.pgno); break; } break; case P_IBTREE: bi = sp; fprintf(fp, "count: %4lu pgno: %4lu ", (u_long)bi->nrecs, (u_long)bi->pgno); switch (B_TYPE(bi->type)) { case B_KEYDATA: CDB___db_pr(bi->data, bi->len); break; case B_DUPLICATE: case B_OVERFLOW: CDB___db_proff(bi->data); break; default: fprintf(fp, "ILLEGAL BINTERNAL TYPE: %lu\n", (u_long)B_TYPE(bi->type)); ret = EINVAL; break; } break; case P_IRECNO: ri = sp; fprintf(fp, "entries %4lu pgno %4lu\n", (u_long)ri->nrecs, (u_long)ri->pgno); break; case P_LBTREE: case P_LRECNO: case P_DUPLICATE: bk = sp; switch (B_TYPE(bk->type)) { case B_KEYDATA: CDB___db_pr(bk->data, bk->len); break; case B_DUPLICATE: case B_OVERFLOW: CDB___db_proff(bk); break; default: fprintf(fp, "ILLEGAL DUPLICATE/LBTREE/LRECNO TYPE: %lu\n", (u_long)B_TYPE(bk->type)); ret = EINVAL; break; } break; } } (void)fflush(fp); return (ret); } /* * CDB___db_isbad * -- Decide if a page is corrupted. * * PUBLIC: int CDB___db_isbad __P((PAGE *, int)); */ int CDB___db_isbad(h, die) PAGE *h; int die; { BINTERNAL *bi; BKEYDATA *bk; FILE *fp; db_indx_t i; u_int type; fp = CDB___db_prinit(NULL); switch (TYPE(h)) { case P_DUPLICATE: case P_HASH: case P_IBTREE: case P_INVALID: case P_IRECNO: case P_LBTREE: case P_LRECNO: case P_OVERFLOW: break; case P_BTREEMETA: case P_HASHMETA: case P_QAMDATA: case P_QAMMETA: return (0); default: fprintf(fp, "ILLEGAL PAGE TYPE: page: %lu type: %lu\n", (u_long)h->pgno, (u_long)TYPE(h)); goto bad; } for (i = 0; i < NUM_ENT(h); i++) { if (P_ENTRY(h, i) - (u_int8_t *)h < P_OVERHEAD || (size_t)(P_ENTRY(h, i) - (u_int8_t *)h) >= set_psize) { fprintf(fp, "ILLEGAL PAGE OFFSET: indx: %lu of %lu\n", (u_long)i, (u_long)h->inp[i]); goto bad; } switch (TYPE(h)) { case P_HASH: type = HPAGE_TYPE(h, i); if (type != H_OFFDUP && type != H_DUPLICATE && type != H_KEYDATA && type != H_OFFPAGE) { fprintf(fp, "ILLEGAL HASH TYPE: %lu\n", (u_long)type); goto bad; } break; case P_IBTREE: bi = GET_BINTERNAL(h, i); if (B_TYPE(bi->type) != B_KEYDATA && B_TYPE(bi->type) != B_DUPLICATE && B_TYPE(bi->type) != B_OVERFLOW) { fprintf(fp, "ILLEGAL BINTERNAL TYPE: %lu\n", (u_long)B_TYPE(bi->type)); goto bad; } break; case P_IRECNO: case P_LBTREE: case P_LRECNO: break; case P_DUPLICATE: bk = GET_BKEYDATA(h, i); if (B_TYPE(bk->type) != B_KEYDATA && B_TYPE(bk->type) != B_DUPLICATE && B_TYPE(bk->type) != B_OVERFLOW) { fprintf(fp, "ILLEGAL DUPLICATE/LBTREE/LRECNO TYPE: %lu\n", (u_long)B_TYPE(bk->type)); goto bad; } break; default: fprintf(fp, "ILLEGAL PAGE ITEM: %lu\n", (u_long)TYPE(h)); goto bad; } } return (0); bad: if (die) { abort(); /* NOTREACHED */ } return (1); } /* * CDB___db_pr -- * Print out a data element. * * PUBLIC: void CDB___db_pr __P((u_int8_t *, u_int32_t)); */ void CDB___db_pr(p, len) u_int8_t *p; u_int32_t len; { FILE *fp; u_int lastch; int i; fp = CDB___db_prinit(NULL); fprintf(fp, "len: %3lu", (u_long)len); lastch = '.'; if (len != 0) { fprintf(fp, " data: "); for (i = len <= 20 ? len : 20; i > 0; --i, ++p) { lastch = *p; if (isprint(*p) || *p == '\n') fprintf(fp, "%c", *p); else fprintf(fp, "0x%.2x", (u_int)*p); } if (len > 20) { fprintf(fp, "..."); lastch = '.'; } } if (lastch != '\n') fprintf(fp, "\n"); } /* * CDB___db_prdbt -- * Print out a DBT data element. * * PUBLIC: int CDB___db_prdbt __P((DBT *, int, const char *, FILE *, int)); */ int CDB___db_prdbt(dbtp, checkprint, prefix, fp, is_recno) DBT *dbtp; int checkprint; const char *prefix; FILE *fp; int is_recno; { static const char hex[] = "0123456789abcdef"; db_recno_t recno; u_int32_t len; u_int8_t *p; /* * !!! * This routine is the routine that dumps out items in the format * used by db_dump(1) and db_load(1). This means that the format * cannot change. */ if (prefix != NULL && fprintf(fp, "%s", prefix) != (int)strlen(prefix)) return (EIO); if (is_recno) { /* * We're printing a record number, and this has to be done * in a platform-independent way. So we use the numeral in * straight ASCII. */ CDB___ua_memcpy(&recno, dbtp->data, sizeof(recno)); if (fprintf(fp, "%lu", (u_long)recno) == 0) return (EIO); } else if (checkprint) { for (len = dbtp->size, p = dbtp->data; len--; ++p) if (isprint(*p)) { if (*p == '\\' && fprintf(fp, "\\") != 1) return (EIO); if (fprintf(fp, "%c", *p) != 1) return (EIO); } else if (fprintf(fp, "\\%c%c", hex[(u_int8_t)(*p & 0xf0) >> 4], hex[*p & 0x0f]) != 3) return (EIO); } else for (len = dbtp->size, p = dbtp->data; len--; ++p) if (fprintf(fp, "%c%c", hex[(u_int8_t)(*p & 0xf0) >> 4], hex[*p & 0x0f]) != 2) return (EIO); return (fprintf(fp, "\n") == 1 ? 0 : EIO); } /* * CDB___db_proff -- * Print out an off-page element. */ static void CDB___db_proff(vp) void *vp; { FILE *fp; BOVERFLOW *bo; fp = CDB___db_prinit(NULL); bo = vp; switch (B_TYPE(bo->type)) { case B_OVERFLOW: fprintf(fp, "overflow: total len: %4lu page: %4lu\n", (u_long)bo->tlen, (u_long)bo->pgno); break; case B_DUPLICATE: fprintf(fp, "duplicate: page: %4lu\n", (u_long)bo->pgno); break; } } /* * CDB___db_prflags -- * Print out flags values. * * PUBLIC: void CDB___db_prflags __P((u_int32_t, const FN *, FILE *)); */ void CDB___db_prflags(flags, fn, fp) u_int32_t flags; FN const *fn; FILE *fp; { const FN *fnp; int found; const char *sep; sep = " ("; for (found = 0, fnp = fn; fnp->mask != 0; ++fnp) if (LF_ISSET(fnp->mask)) { fprintf(fp, "%s%s", sep, fnp->name); sep = ", "; found = 1; } if (found) fprintf(fp, ")"); } /* * CDB___db_prinit -- * Initialize tree printing routines. */ static FILE * CDB___db_prinit(fp) FILE *fp; { if (set_fp == NULL) set_fp = fp == NULL ? stdout : fp; return (set_fp); } /* * CDB___db_psize -- * Get the page size. */ static void CDB___db_psize(dbp) DB *dbp; { DBMETA *mp; db_pgno_t pgno; set_psize = PSIZE_BOUNDARY - 1; pgno = PGNO_BASE_MD; if (CDB_memp_fget(dbp->mpf, &pgno, 0, &mp) != 0) return; switch (mp->magic) { case DB_BTREEMAGIC: case DB_HASHMAGIC: case DB_QAMMAGIC: set_psize = mp->pagesize; break; } (void)CDB_memp_fput(dbp->mpf, mp, 0); } /* * CDB___db_name -- * Return the name of the database type. */ static const char * CDB___db_name(dbp) DB *dbp; { switch (dbp->type) { case DB_BTREE: return ("btree"); case DB_HASH: return ("hash"); break; case DB_RECNO: return ("recno"); break; case DB_QUEUE: return ("queue"); default: return ("UNKNOWN TYPE"); } /* NOTREACHED */ } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_rec.c���������������������������������������������������������������������������0100644�0063146�0012731�00000040152�07427026535�014346� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_rec.c 11.4 (Sleepycat) 9/22/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "log.h" #include "hash.h" /* * PUBLIC: int CDB___db_addrem_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); * * This log message is generated whenever we add or remove a duplicate * to/from a duplicate page. On recover, we just do the opposite. */ int CDB___db_addrem_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_addrem_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t change; int cmp_n, cmp_p, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_addrem_print); REC_INTRO(CDB___db_addrem_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); change = 0; if ((cmp_p == 0 && redo && argp->opcode == DB_ADD_DUP) || (cmp_n == 0 && !redo && argp->opcode == DB_REM_DUP)) { /* Need to redo an add, or undo a delete. */ if ((ret = CDB___db_pitem(dbc, pagep, argp->indx, argp->nbytes, argp->hdr.size == 0 ? NULL : &argp->hdr, argp->dbt.size == 0 ? NULL : &argp->dbt)) != 0) goto out; change = DB_MPOOL_DIRTY; } else if ((cmp_n == 0 && !redo && argp->opcode == DB_ADD_DUP) || (cmp_p == 0 && redo && argp->opcode == DB_REM_DUP)) { /* Need to undo an add, or redo a delete. */ if ((ret = CDB___db_ditem(dbc, pagep, argp->indx, argp->nbytes)) != 0) goto out; change = DB_MPOOL_DIRTY; } if (change) { if (redo) LSN(pagep) = *lsnp; else LSN(pagep) = argp->pagelsn; } if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * PUBLIC: int CDB___db_split_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_split_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_split_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int change, cmp_n, cmp_p, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_split_print); REC_INTRO(CDB___db_split_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } /* * There are two types of log messages here, one for the old page * and one for the new pages created. The original image in the * SPLITOLD record is used for undo. The image in the SPLITNEW * is used for redo. We should never have a case where there is * a redo operation and the SPLITOLD record is on disk, but not * the SPLITNEW record. Therefore, we only redo NEW messages * and only undo OLD messages. */ change = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); if (cmp_p == 0 && redo) { if (argp->opcode == DB_SPLITNEW) { /* Need to redo the split described. */ memcpy(pagep, argp->pageimage.data, argp->pageimage.size); } LSN(pagep) = *lsnp; change = DB_MPOOL_DIRTY; } else if (cmp_n == 0 && !redo) { if (argp->opcode == DB_SPLITOLD) { /* Put back the old image. */ memcpy(pagep, argp->pageimage.data, argp->pageimage.size); } LSN(pagep) = argp->pagelsn; change = DB_MPOOL_DIRTY; } if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * PUBLIC: int CDB___db_big_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_big_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_big_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t change; int cmp_n, cmp_p, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_big_print); REC_INTRO(CDB___db_big_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ ret = 0; goto ppage; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } /* * There are three pages we need to check. The one on which we are * adding data, the previous one whose next_pointer may have * been updated, and the next one whose prev_pointer may have * been updated. */ cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); change = 0; if ((cmp_p == 0 && redo && argp->opcode == DB_ADD_BIG) || (cmp_n == 0 && !redo && argp->opcode == DB_REM_BIG)) { /* We are either redo-ing an add, or undoing a delete. */ P_INIT(pagep, file_dbp->pgsize, argp->pgno, argp->prev_pgno, argp->next_pgno, 0, P_OVERFLOW); OV_LEN(pagep) = argp->dbt.size; OV_REF(pagep) = 1; memcpy((u_int8_t *)pagep + P_OVERHEAD, argp->dbt.data, argp->dbt.size); PREV_PGNO(pagep) = argp->prev_pgno; change = DB_MPOOL_DIRTY; } else if ((cmp_n == 0 && !redo && argp->opcode == DB_ADD_BIG) || (cmp_p == 0 && redo && argp->opcode == DB_REM_BIG)) { /* * We are either undo-ing an add or redo-ing a delete. * The page is about to be reclaimed in either case, so * there really isn't anything to do here. */ change = DB_MPOOL_DIRTY; } if (change) LSN(pagep) = redo ? *lsnp : argp->pagelsn; if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; /* Now check the previous page. */ ppage: if (argp->prev_pgno != PGNO_INVALID) { change = 0; if ((ret = CDB_memp_fget(mpf, &argp->prev_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. * That is equivalent to having a pagelsn of 0, * so we would not have to undo anything. In * this case, don't bother creating a page. */ *lsnp = argp->prev_lsn; ret = 0; goto npage; } else if ((ret = CDB_memp_fget(mpf, &argp->prev_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->prevlsn); if ((cmp_p == 0 && redo && argp->opcode == DB_ADD_BIG) || (cmp_n == 0 && !redo && argp->opcode == DB_REM_BIG)) { /* Redo add, undo delete. */ NEXT_PGNO(pagep) = argp->pgno; change = DB_MPOOL_DIRTY; } else if ((cmp_n == 0 && !redo && argp->opcode == DB_ADD_BIG) || (cmp_p == 0 && redo && argp->opcode == DB_REM_BIG)) { /* Redo delete, undo add. */ NEXT_PGNO(pagep) = argp->next_pgno; change = DB_MPOOL_DIRTY; } if (change) LSN(pagep) = redo ? *lsnp : argp->prevlsn; if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; } /* Now check the next page. Can only be set on a delete. */ npage: if (argp->next_pgno != PGNO_INVALID) { change = 0; if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. * That is equivalent to having a pagelsn of 0, * so we would not have to undo anything. In * this case, don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->nextlsn); if (cmp_p == 0 && redo) { PREV_PGNO(pagep) = PGNO_INVALID; change = DB_MPOOL_DIRTY; } else if (cmp_n == 0 && !redo) { PREV_PGNO(pagep) = argp->pgno; change = DB_MPOOL_DIRTY; } if (change) LSN(pagep) = redo ? *lsnp : argp->nextlsn; if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; } done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___db_ovref_recover -- * Recovery function for CDB___db_ovref(). * * PUBLIC: int CDB___db_ovref_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_ovref_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_ovref_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_ovref_print); REC_INTRO(CDB___db_ovref_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } modified = 0; if (CDB_log_compare(&LSN(pagep), &argp->lsn) == 0 && redo) { /* Need to redo update described. */ OV_REF(pagep) += argp->adjust; pagep->lsn = *lsnp; modified = 1; } else if (CDB_log_compare(lsnp, &LSN(pagep)) == 0 && !redo) { /* Need to undo update described. */ OV_REF(pagep) -= argp->adjust; pagep->lsn = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___db_relink_recover -- * Recovery function for relink. * * PUBLIC: int CDB___db_relink_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_relink_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_relink_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_relink_print); REC_INTRO(CDB___db_relink_read, 1); /* * There are up to three pages we need to check -- the page, and the * previous and next pages, if they existed. For a page add operation, * the current page is the result of a split and is being recovered * elsewhere, so all we need do is recover the next page. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (redo) { (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } goto next2; } modified = 0; if (argp->opcode == DB_ADD_PAGE) goto next1; if (CDB_log_compare(&LSN(pagep), &argp->lsn) == 0 && redo) { /* Redo the relink. */ pagep->lsn = *lsnp; modified = 1; } else if (CDB_log_compare(lsnp, &LSN(pagep)) == 0 && !redo) { /* Undo the relink. */ pagep->next_pgno = argp->next; pagep->prev_pgno = argp->prev; pagep->lsn = argp->lsn; modified = 1; } next1: if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; next2: if ((ret = CDB_memp_fget(mpf, &argp->next, 0, &pagep)) != 0) { if (redo) { (void)CDB___db_pgerr(file_dbp, argp->next); goto out; } goto prev; } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn_next); if ((argp->opcode == DB_REM_PAGE && cmp_p == 0 && redo) || (argp->opcode == DB_ADD_PAGE && cmp_n == 0 && !redo)) { /* Redo the remove or undo the add. */ pagep->prev_pgno = argp->prev; pagep->lsn = *lsnp; modified = 1; } else if ((argp->opcode == DB_REM_PAGE && cmp_n == 0 && !redo) || (argp->opcode == DB_ADD_PAGE && cmp_p == 0 && redo)) { /* Undo the remove or redo the add. */ pagep->prev_pgno = argp->pgno; pagep->lsn = argp->lsn_next; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; if (argp->opcode == DB_ADD_PAGE) goto done; prev: if ((ret = CDB_memp_fget(mpf, &argp->prev, 0, &pagep)) != 0) { if (redo) { (void)CDB___db_pgerr(file_dbp, argp->prev); goto out; } goto done; } modified = 0; if (CDB_log_compare(&LSN(pagep), &argp->lsn_prev) == 0 && redo) { /* Redo the relink. */ pagep->next_pgno = argp->next; pagep->lsn = *lsnp; modified = 1; } else if (CDB_log_compare(lsnp, &LSN(pagep)) == 0 && !redo) { /* Undo the relink. */ pagep->next_pgno = argp->pgno; pagep->lsn = argp->lsn_prev; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * PUBLIC: int CDB___db_addpage_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_addpage_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_addpage_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t change; int cmp_n, cmp_p, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_addpage_print); REC_INTRO(CDB___db_addpage_read, 1); /* * We need to check two pages: the old one and the new one onto * which we're going to add duplicates. Do the old one first. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) goto out; change = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { NEXT_PGNO(pagep) = argp->nextpgno; LSN(pagep) = *lsnp; change = DB_MPOOL_DIRTY; } else if (cmp_n == 0 && !redo) { NEXT_PGNO(pagep) = PGNO_INVALID; LSN(pagep) = argp->lsn; change = DB_MPOOL_DIRTY; } if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; if ((ret = CDB_memp_fget(mpf, &argp->nextpgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->nextpgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } change = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->nextlsn); if (cmp_p == 0 && redo) { PREV_PGNO(pagep) = argp->pgno; LSN(pagep) = *lsnp; change = DB_MPOOL_DIRTY; } else if (cmp_n == 0 && !redo) { PREV_PGNO(pagep) = PGNO_INVALID; LSN(pagep) = argp->nextlsn; change = DB_MPOOL_DIRTY; } if ((ret = CDB_memp_fput(mpf, pagep, change)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___db_debug_recover -- * Recovery function for debug. * * PUBLIC: int CDB___db_debug_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_debug_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_debug_args *argp; int ret; COMPQUIET(redo, 0); COMPQUIET(dbenv, NULL); COMPQUIET(info, NULL); REC_PRINT(CDB___db_debug_print); REC_NOOP_INTRO(CDB___db_debug_read); *lsnp = argp->prev_lsn; ret = 0; REC_NOOP_CLOSE; } /* * CDB___db_noop_recover -- * Recovery function for noop. * * PUBLIC: int CDB___db_noop_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___db_noop_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __db_noop_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t change; int cmp_n, cmp_p, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___db_noop_print); REC_INTRO(CDB___db_noop_read, 0); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) goto out; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->prevlsn); change = 0; if (cmp_p == 0 && redo) { LSN(pagep) = *lsnp; change = DB_MPOOL_DIRTY; } else if (cmp_n == 0 && !redo) { LSN(pagep) = argp->prevlsn; change = DB_MPOOL_DIRTY; } ret = CDB_memp_fput(mpf, pagep, change); done: *lsnp = argp->prev_lsn; out: REC_CLOSE; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_reclaim.c�����������������������������������������������������������������������0100644�0063146�0012731�00000006440�07427026535�015213� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_reclaim.c 11.2 (Sleepycat) 9/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "db_am.h" /* * Assume that we enter with a valid pgno. We traverse a set of * duplicate pages. The format of the callback routine is: * callback(dbp, page, cookie, did_put). did_put is an output * value that will be set to 1 by the callback routine if it * already put the page back. Otherwise, this routine must * put the page. * * PUBLIC: int CDB___db_traverse_dup __P((DB *, * PUBLIC: db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); */ int CDB___db_traverse_dup(dbp, pgno, callback, cookie) DB *dbp; db_pgno_t pgno; int (*callback) __P((DB *, PAGE *, void *, int *)); void *cookie; { PAGE *p; int did_put, i, opgno, ret; do { did_put = 0; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &p)) != 0) return (ret); pgno = NEXT_PGNO(p); for (i = 0; i < NUM_ENT(p); i++) { if (B_TYPE(GET_BKEYDATA(p, i)->type) == B_OVERFLOW) { opgno = GET_BOVERFLOW(p, i)->pgno; if ((ret = CDB___db_traverse_big(dbp, opgno, callback, cookie)) != 0) goto err; } } if ((ret = callback(dbp, p, cookie, &did_put)) != 0) goto err; if (!did_put) if ((ret = CDB_memp_fput(dbp->mpf, p, 0)) != 0) return (ret); } while (pgno != PGNO_INVALID); if (0) { err: if (did_put == 0) (void)CDB_memp_fput(dbp->mpf, p, 0); } return (ret); } /* * CDB___db_traverse_big * Traverse a chain of overflow pages and call the callback routine * on each one. The calling convention for the callback is: * callback(dbp, page, cookie, did_put), * where did_put is a return value indicating if the page in question has * already been returned to the mpool. * * PUBLIC: int CDB___db_traverse_big __P((DB *, * PUBLIC: db_pgno_t, int (*)(DB *, PAGE *, void *, int *), void *)); */ int CDB___db_traverse_big(dbp, pgno, callback, cookie) DB *dbp; db_pgno_t pgno; int (*callback) __P((DB *, PAGE *, void *, int *)); void *cookie; { PAGE *p; int did_put, ret; do { did_put = 0; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &p)) != 0) return (ret); pgno = NEXT_PGNO(p); if ((ret = callback(dbp, p, cookie, &did_put)) == 0 && !did_put) ret = CDB_memp_fput(dbp->mpf, p, 0); } while (ret == 0 && pgno != PGNO_INVALID); return (ret); } /* * CDB___db_reclaim_callback * This is the callback routine used during a delete of a subdatabase. * we are traversing a btree or hash table and trying to free all the * pages. Since they share common code for duplicates and overflow * items, we traverse them identically and use this routine to do the * actual free. The reason that this is callback is because hash uses * the same traversal code for statistics gathering. * * PUBLIC: int CDB___db_reclaim_callback __P((DB *, PAGE *, void *, int *)); */ int CDB___db_reclaim_callback(dbp, p, cookie, putp) DB *dbp; PAGE *p; void *cookie; int *putp; { int ret; COMPQUIET(dbp, NULL); if ((ret = CDB___db_free(cookie, p)) != 0) return (ret); *putp = 1; return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_ret.c���������������������������������������������������������������������������0100644�0063146�0012731�00000007223�07427026535�014371� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_ret.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "btree.h" #include "db_am.h" /* * CDB___db_ret -- * Build return DBT. * * PUBLIC: int CDB___db_ret __P((DB *, * PUBLIC: PAGE *, u_int32_t, DBT *, void **, u_int32_t *)); */ int CDB___db_ret(dbp, h, indx, dbt, memp, memsize) DB *dbp; PAGE *h; u_int32_t indx; DBT *dbt; void **memp; u_int32_t *memsize; { BKEYDATA *bk; HOFFPAGE ho; BOVERFLOW *bo; u_int32_t len; u_int8_t *hk; void *data; switch (TYPE(h)) { case P_HASH: hk = P_ENTRY(h, indx); if (HPAGE_PTYPE(hk) == H_OFFPAGE) { memcpy(&ho, hk, sizeof(HOFFPAGE)); return (CDB___db_goff(dbp, dbt, ho.tlen, ho.pgno, memp, memsize)); } len = LEN_HKEYDATA(h, dbp->pgsize, indx); data = HKEYDATA_DATA(hk); break; case P_DUPLICATE: case P_LBTREE: case P_LRECNO: bk = GET_BKEYDATA(h, indx); if (B_TYPE(bk->type) == B_OVERFLOW) { bo = (BOVERFLOW *)bk; return (CDB___db_goff(dbp, dbt, bo->tlen, bo->pgno, memp, memsize)); } len = bk->len; data = bk->data; break; default: return (CDB___db_pgfmt(dbp, h->pgno)); } return (CDB___db_retcopy(F_ISSET(dbt, DB_DBT_INTERNAL) ? NULL : dbp, dbt, data, len, memp, memsize)); } /* * CDB___db_retcopy -- * Copy the returned data into the user's DBT, handling special flags. * * PUBLIC: int CDB___db_retcopy __P((DB *, DBT *, * PUBLIC: void *, u_int32_t, void **, u_int32_t *)); */ int CDB___db_retcopy(dbp, dbt, data, len, memp, memsize) DB *dbp; DBT *dbt; void *data; u_int32_t len; void **memp; u_int32_t *memsize; { int ret; /* If returning a partial record, reset the length. */ if (F_ISSET(dbt, DB_DBT_PARTIAL)) { data = (u_int8_t *)data + dbt->doff; if (len > dbt->doff) { len -= dbt->doff; if (len > dbt->dlen) len = dbt->dlen; } else len = 0; } /* * Return the length of the returned record in the DBT size field. * This satisfies the requirement that if we're using user memory * and insufficient memory was provided, return the amount necessary * in the size field. */ dbt->size = len; /* * Allocate memory to be owned by the application: DB_DBT_MALLOC, * DB_DBT_REALLOC. * * !!! * We always allocate memory, even if we're copying out 0 bytes. This * guarantees consistency, i.e., the application can always free memory * without concern as to how many bytes of the record were requested. * * Use the memory specified by the application: DB_DBT_USERMEM. * * !!! * If the length we're going to copy is 0, the application-supplied * memory pointer is allowed to be NULL. */ if (F_ISSET(dbt, DB_DBT_MALLOC)) { if ((ret = CDB___os_malloc(len, dbp == NULL ? NULL : dbp->db_malloc, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_REALLOC)) { if ((ret = CDB___os_realloc(len, dbp == NULL ? NULL : dbp->db_realloc, &dbt->data)) != 0) return (ret); } else if (F_ISSET(dbt, DB_DBT_USERMEM)) { if (len != 0 && (dbt->data == NULL || dbt->ulen < len)) return (ENOMEM); } else if (memp == NULL || memsize == NULL) { return (EINVAL); } else { if (len != 0 && (*memsize == 0 || *memsize < len)) { if ((ret = CDB___os_realloc(len, NULL, memp)) != 0) { *memsize = 0; return (ret); } *memsize = len; } dbt->data = *memp; } if (len != 0) memcpy(dbt->data, data, len); return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_salloc.c������������������������������������������������������������������������0100644�0063146�0012731�00000021562�07427026535�015056� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_salloc.c 11.4 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" /* * Implement shared memory region allocation, using simple first-fit algorithm. * The model is that we take a "chunk" of shared memory store and begin carving * it up into areas, similarly to how malloc works. We do coalescing on free. * * The "len" field in the __data struct contains the length of the free region * (less the size_t bytes that holds the length). We use the address provided * by the caller to find this length, which allows us to free a chunk without * requiring that the caller pass in the length of the chunk they're freeing. */ SH_LIST_HEAD(__head); struct __data { size_t len; SH_LIST_ENTRY links; }; /* * CDB___db_shalloc_init -- * Initialize the area as one large chunk. * * PUBLIC: void CDB___db_shalloc_init __P((void *, size_t)); */ void CDB___db_shalloc_init(area, size) void *area; size_t size; { struct __data *elp; struct __head *hp; hp = area; SH_LIST_INIT(hp); elp = (struct __data *)(hp + 1); elp->len = size - sizeof(struct __head) - sizeof(elp->len); SH_LIST_INSERT_HEAD(hp, elp, links, __data); } /* * CDB___db_shalloc -- * Allocate some space from the shared region. * * PUBLIC: int CDB___db_shalloc __P((void *, size_t, size_t, void *)); */ int CDB___db_shalloc(p, len, align, retp) void *p, *retp; size_t len, align; { struct __data *elp; size_t *sp; void *rp; /* * We never allocate less than the size of a struct __data, align * to less than a size_t boundary, or align to something that's not * a multiple of a size_t. */ if (len < sizeof(struct __data)) len = sizeof(struct __data); #ifdef DIAGNOSTIC /* * XXX: * Do we want to do this when len has already been tweaked, as above? * * At worst, it costs us an extra alignment-worth of memory; it's * certainly not fatal, because we always base the location of the * guard byte upon the true end of the chunk, not upon the end as * perceived by the caller. */ ++len; #endif align = 8; /* Walk the list, looking for a slot. */ for (elp = SH_LIST_FIRST((struct __head *)p, __data); elp != NULL; elp = SH_LIST_NEXT(elp, links, __data)) { /* * Calculate the value of the returned pointer if we were to * use this chunk. * + Find the end of the chunk. * + Subtract the memory the user wants. * + Find the closest previous correctly-aligned address. */ rp = (u_int8_t *)elp + sizeof(size_t) + elp->len; rp = (u_int8_t *)rp - len; rp = (u_int8_t *)((ALIGNTYPE)rp & ~(align - 1)); /* * Rp may now point before elp->links, in which case the chunk * was too small, and we have to try again. */ if ((u_int8_t *)rp < (u_int8_t *)&elp->links) continue; *(void **)retp = rp; #ifdef DIAGNOSTIC /* * At this point, whether or not we still need to split up a * chunk, retp is the address of the region we are returning, * and (u_int8_t *)elp + sizeof(size_t) + elp->len gives us * the address of the first byte after the end of the chunk. * Make the byte immediately before that the guard byte. */ *((u_int8_t *)elp + sizeof(size_t) + elp->len - 1) = GUARD_BYTE; #endif #define SHALLOC_FRAGMENT 32 /* * If there are at least SHALLOC_FRAGMENT additional bytes of * memory, divide the chunk into two chunks. */ if ((u_int8_t *)rp >= (u_int8_t *)&elp->links + SHALLOC_FRAGMENT) { sp = rp; *--sp = elp->len - ((u_int8_t *)rp - (u_int8_t *)&elp->links); elp->len -= *sp + sizeof(size_t); return (0); } /* * Otherwise, we return the entire chunk, wasting some amount * of space to keep the list compact. However, because the * address we're returning to the user may not be the address * of the start of the region for alignment reasons, set the * size_t length fields back to the "real" length field to a * flag value, so that we can find the real length during free. */ #define ILLEGAL_SIZE 1 SH_LIST_REMOVE(elp, links, __data); for (sp = rp; (u_int8_t *)--sp >= (u_int8_t *)&elp->links;) *sp = ILLEGAL_SIZE; return (0); } return (ENOMEM); } /* * CDB___db_shalloc_free -- * Free a shared memory allocation. * * PUBLIC: void CDB___db_shalloc_free __P((void *, void *)); */ void CDB___db_shalloc_free(regionp, ptr) void *regionp, *ptr; { struct __data *elp, *lastp, *newp; struct __head *hp; size_t free_size, *sp; int merged; /* * Step back over flagged length fields to find the beginning of * the object and its real size. */ for (sp = (size_t *)ptr; sp[-1] == ILLEGAL_SIZE; --sp) ; ptr = sp; newp = (struct __data *)((u_int8_t *)ptr - sizeof(size_t)); free_size = newp->len; #ifdef DIAGNOSTIC /* * The "real size" includes the guard byte; it's just the last * byte in the chunk, and the caller never knew it existed. * * Check it to make sure it hasn't been stomped. */ if (*((u_int8_t *)ptr + free_size - 1) != GUARD_BYTE) { /* * Eventually, once we push a DB_ENV handle down to these * routines, we should use the standard output channels. */ fprintf(stderr, "Guard byte incorrect during shared memory free.\n"); abort(); /* NOTREACHED */ } /* Trash the returned memory (including guard byte). */ memset(ptr, CLEAR_BYTE, free_size); #endif /* * Walk the list, looking for where this entry goes. * * We keep the free list sorted by address so that coalescing is * trivial. * * XXX * Probably worth profiling this to see how expensive it is. */ hp = (struct __head *)regionp; for (elp = SH_LIST_FIRST(hp, __data), lastp = NULL; elp != NULL && (void *)elp < (void *)ptr; lastp = elp, elp = SH_LIST_NEXT(elp, links, __data)) ; /* * Elp is either NULL (we reached the end of the list), or the slot * after the one that's being returned. Lastp is either NULL (we're * returning the first element of the list) or the element before the * one being returned. * * Check for coalescing with the next element. */ merged = 0; if ((u_int8_t *)ptr + free_size == (u_int8_t *)elp) { newp->len += elp->len + sizeof(size_t); SH_LIST_REMOVE(elp, links, __data); if (lastp != NULL) SH_LIST_INSERT_AFTER(lastp, newp, links, __data); else SH_LIST_INSERT_HEAD(hp, newp, links, __data); merged = 1; } /* Check for coalescing with the previous element. */ if (lastp != NULL && (u_int8_t *)lastp + lastp->len + sizeof(size_t) == (u_int8_t *)newp) { lastp->len += newp->len + sizeof(size_t); /* * If we have already put the new element into the list take * it back off again because it's just been merged with the * previous element. */ if (merged) SH_LIST_REMOVE(newp, links, __data); merged = 1; } if (!merged) { if (lastp == NULL) SH_LIST_INSERT_HEAD(hp, newp, links, __data); else SH_LIST_INSERT_AFTER(lastp, newp, links, __data); } } /* * CDB___db_shalloc_count -- * Return the amount of memory on the free list. * * PUBLIC: size_t CDB___db_shalloc_count __P((void *)); */ size_t CDB___db_shalloc_count(addr) void *addr; { struct __data *elp; size_t count; count = 0; for (elp = SH_LIST_FIRST((struct __head *)addr, __data); elp != NULL; elp = SH_LIST_NEXT(elp, links, __data)) count += elp->len; return (count); } /* * CDB___db_shsizeof -- * Return the size of a shalloc'd piece of memory. * * !!! * Note that this is from an internal standpoint -- it includes not only * the size of the memory being used, but also the extra alignment bytes * in front and, #ifdef DIAGNOSTIC, the guard byte at the end. * * PUBLIC: size_t CDB___db_shsizeof __P((void *)); */ size_t CDB___db_shsizeof(ptr) void *ptr; { struct __data *elp; size_t *sp; /* * Step back over flagged length fields to find the beginning of * the object and its real size. */ for (sp = (size_t *)ptr; sp[-1] == ILLEGAL_SIZE; --sp) ; elp = (struct __data *)((u_int8_t *)sp - sizeof(size_t)); return (elp->len); } /* * CDB___db_shalloc_dump -- * * PUBLIC: void CDB___db_shalloc_dump __P((void *, FILE *)); */ void CDB___db_shalloc_dump(addr, fp) void *addr; FILE *fp; { struct __data *elp; /* Make it easy to call from the debugger. */ if (fp == NULL) fp = stderr; fprintf(fp, "%s\nMemory free list\n", DB_LINE); for (elp = SH_LIST_FIRST((struct __head *)addr, __data); elp != NULL; elp = SH_LIST_NEXT(elp, links, __data)) fprintf(fp, "%#lx: %lu\t", (u_long)elp, (u_long)elp->len); fprintf(fp, "\n"); } ����������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_shash.c�������������������������������������������������������������������������0100644�0063146�0012731�00000006476�07427026535�014716� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_shash.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" /* * Table of good hash values. Up to ~250,000 buckets, we use powers of 2. * After that, we slow the rate of increase by half. For each choice, we * then use a nearby prime number as the hash value. * * If a terabyte is the maximum cache we'll see, and we assume there are * 10 1K buckets on each hash chain, then 107374182 is the maximum number * of buckets we'll ever need. */ static const struct { u_int32_t power; u_int32_t prime; } list[] = { { 64, 67}, /* 2^6 */ { 128, 131}, /* 2^7 */ { 256, 257}, /* 2^8 */ { 512, 521}, /* 2^9 */ { 1024, 1031}, /* 2^10 */ { 2048, 2053}, /* 2^11 */ { 4096, 4099}, /* 2^12 */ { 8192, 8191}, /* 2^13 */ { 16384, 16381}, /* 2^14 */ { 32768, 32771}, /* 2^15 */ { 65536, 65537}, /* 2^16 */ { 131072, 131071}, /* 2^17 */ { 262144, 262147}, /* 2^18 */ { 393216, 393209}, /* 2^18 + 2^18/2 */ { 524288, 524287}, /* 2^19 */ { 786432, 786431}, /* 2^19 + 2^19/2 */ { 1048576, 1048573}, /* 2^20 */ { 1572864, 1572869}, /* 2^20 + 2^20/2 */ { 2097152, 2097169}, /* 2^21 */ { 3145728, 3145721}, /* 2^21 + 2^21/2 */ { 4194304, 4194301}, /* 2^22 */ { 6291456, 6291449}, /* 2^22 + 2^22/2 */ { 8388608, 8388617}, /* 2^23 */ { 12582912, 12582917}, /* 2^23 + 2^23/2 */ { 16777216, 16777213}, /* 2^24 */ { 25165824, 25165813}, /* 2^24 + 2^24/2 */ { 33554432, 33554393}, /* 2^25 */ { 50331648, 50331653}, /* 2^25 + 2^25/2 */ { 67108864, 67108859}, /* 2^26 */ { 100663296, 100663291}, /* 2^26 + 2^26/2 */ { 134217728, 134217757}, /* 2^27 */ { 201326592, 201326611}, /* 2^27 + 2^27/2 */ { 268435456, 268435459}, /* 2^28 */ { 402653184, 402653189}, /* 2^28 + 2^28/2 */ { 536870912, 536870909}, /* 2^29 */ { 805306368, 805306357}, /* 2^29 + 2^29/2 */ {1073741824, 1073741827}, /* 2^30 */ {0, 0} }; /* * CDB___db_tablesize -- * Choose a size for the hash table. * * PUBLIC: int CDB___db_tablesize __P((u_int32_t)); */ int CDB___db_tablesize(n_buckets) u_int32_t n_buckets; { int i; /* * We try to be clever about how big we make the hash tables. Use a * prime number close to the "suggested" number of elements that will * be in the hash table. Use 64 as the minimum hash table size. * * Ref: Sedgewick, Algorithms in C, "Hash Functions" */ if (n_buckets < 64) n_buckets = 64; for (i = 0;; ++i) { if (list[i].power == 0) { --i; break; } if (list[i].power >= n_buckets) break; } return (list[i].prime); } /* * CDB___db_hashinit -- * Initialize a hash table that resides in shared memory. * * PUBLIC: void CDB___db_hashinit __P((void *, u_int32_t)); */ void CDB___db_hashinit(begin, nelements) void *begin; u_int32_t nelements; { u_int32_t i; SH_TAILQ_HEAD(hash_head) *headp; headp = (struct hash_head *)begin; for (i = 0; i < nelements; i++, headp++) SH_TAILQ_INIT(headp); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_shash.h�������������������������������������������������������������������������0100644�0063146�0012731�00000007101�07427026535�014705� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)db_shash.h 11.2 (Sleepycat) 9/23/99 */ /* Hash Headers */ typedef SH_TAILQ_HEAD(__hash_head) DB_HASHTAB; /* * HASHACCESS -- * * Figure out to which bucket an item belongs and lock that bucket, * returning the bucket index. * * synch: beginning of the array of mutexes that protect the table. * elt: the item on which we're computing the hash function. * nelems: the number of buckets in the hash table. * hash: the hash function that operates on elements of the type of elt * ndx: the index into the hash/synch array that we're locking. * fh: the locking file handle. */ #define HASHACCESS(synch, elt, nelems, hash, ndx, fh) do { \ ndx = hash(elt) % (nelems); \ MUTEX_LOCK(&synch[ndx], fh); \ } while(0) /* * HASHRELEASE -- * * Release a hash bucket that we have locked. * * synch: beginning of the array of mutexes that protect the table. * ndx: the index into the hash/synch array that we're locking. * fh: the locking file handle. */ #define HASHRELEASE(synch, ndx, fh) do { \ MUTEX_UNLOCK(&synch[ndx]); \ } while(0) /* * HASHLOOKUP -- * * Look up something in a shared memory hash table. The "elt" argument * should be a key, and cmp_func must know how to compare a key to whatever * structure it is that appears in the hash table. The comparison function * * begin: address of the beginning of the hash table. * ndx: index into table for this item. * type: the structure type of the elements that are linked in each bucket. * field: the name of the field by which the "type" structures are linked. * elt: the item for which we are searching in the hash table. * res: the variable into which we'll store the element if we find it. * cmp: called as: cmp(lookup_elt, table_elt). * * If the element is not in the hash table, this macro exits with res set * to NULL. */ #define HASHLOOKUP(begin, ndx, type, field, elt, res, cmp) do { \ DB_HASHTAB *__bucket; \ \ __bucket = &begin[ndx]; \ for (res = SH_TAILQ_FIRST(__bucket, type); \ res != NULL; res = SH_TAILQ_NEXT(res, field, type)) \ if (cmp(elt, res)) \ break; \ } while(0) /* * HASHINSERT -- * * Insert a new entry into the hash table. This assumes that you already * have the bucket locked and that lookup has failed; don't call it if you * haven't already called HASHLOOKUP. If you do, you could get duplicate * entries. * * begin: the beginning address of the hash table. * ndx: the index for this element. * type: the structure type of the elements that are linked in each bucket. * field: the name of the field by which the "type" structures are linked. * elt: the item to be inserted. */ #define HASHINSERT(begin, ndx, type, field, elt) do { \ DB_HASHTAB *__bucket; \ \ __bucket = &begin[ndx]; \ SH_TAILQ_INSERT_HEAD(__bucket, elt, field, type); \ } while(0) /* * HASHREMOVE_EL -- * Given the object "obj" in the table, remove it. * * begin: address of the beginning of the hash table. * ndx: index into hash table of where this element belongs. * type: the structure type of the elements that are linked in each bucket. * field: the name of the field by which the "type" structures are linked. * obj: the object in the table that we with to delete. */ #define HASHREMOVE_EL(begin, ndx, type, field, obj) { \ DB_HASHTAB *__bucket; \ \ __bucket = &begin[ndx]; \ SH_TAILQ_REMOVE(__bucket, obj, field, type); \ } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_swap.h��������������������������������������������������������������������������0100644�0063146�0012731�00000007222�07427026535�014555� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)db_swap.h 11.2 (Sleepycat) 9/9/99 */ #ifndef _DB_SWAP_H_ #define _DB_SWAP_H_ /* * Little endian <==> big endian 32-bit swap macros. * M_32_SWAP swap a memory location * P_32_COPY copy potentially unaligned 4 byte quantities * P_32_SWAP swap a referenced memory location */ #define M_32_SWAP(a) { \ u_int32_t _tmp; \ _tmp = a; \ ((u_int8_t *)&a)[0] = ((u_int8_t *)&_tmp)[3]; \ ((u_int8_t *)&a)[1] = ((u_int8_t *)&_tmp)[2]; \ ((u_int8_t *)&a)[2] = ((u_int8_t *)&_tmp)[1]; \ ((u_int8_t *)&a)[3] = ((u_int8_t *)&_tmp)[0]; \ } #define P_32_COPY(a, b) { \ ((u_int8_t *)b)[0] = ((u_int8_t *)a)[0]; \ ((u_int8_t *)b)[1] = ((u_int8_t *)a)[1]; \ ((u_int8_t *)b)[2] = ((u_int8_t *)a)[2]; \ ((u_int8_t *)b)[3] = ((u_int8_t *)a)[3]; \ } #define P_32_SWAP(a) { \ u_int32_t _tmp; \ P_32_COPY(a, &_tmp); \ ((u_int8_t *)a)[0] = ((u_int8_t *)&_tmp)[3]; \ ((u_int8_t *)a)[1] = ((u_int8_t *)&_tmp)[2]; \ ((u_int8_t *)a)[2] = ((u_int8_t *)&_tmp)[1]; \ ((u_int8_t *)a)[3] = ((u_int8_t *)&_tmp)[0]; \ } /* * Little endian <==> big endian 16-bit swap macros. * M_16_SWAP swap a memory location * P_16_COPY copy potentially unaligned 2 byte quantities * P_16_SWAP swap a referenced memory location */ #define M_16_SWAP(a) { \ u_int16_t _tmp; \ _tmp = (u_int16_t)a; \ ((u_int8_t *)&a)[0] = ((u_int8_t *)&_tmp)[1]; \ ((u_int8_t *)&a)[1] = ((u_int8_t *)&_tmp)[0]; \ } #define P_16_COPY(a, b) { \ ((u_int8_t *)b)[0] = ((u_int8_t *)a)[0]; \ ((u_int8_t *)b)[1] = ((u_int8_t *)a)[1]; \ } #define P_16_SWAP(a) { \ u_int16_t _tmp; \ P_16_COPY(a, &_tmp); \ ((u_int8_t *)a)[0] = ((u_int8_t *)&_tmp)[1]; \ ((u_int8_t *)a)[1] = ((u_int8_t *)&_tmp)[0]; \ } #define SWAP32(p) { \ P_32_SWAP(p); \ (p) += sizeof(u_int32_t); \ } #define SWAP16(p) { \ P_16_SWAP(p); \ (p) += sizeof(u_int16_t); \ } #endif /* !_DB_SWAP_H_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_upg.c���������������������������������������������������������������������������0100644�0063146�0012731�00000017145�07427026535�014376� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999, 2000 * Sleepycat Software. All rights reserved. */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: db_upg.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" #include "hash.h" #include "qam.h" static int (* const func_31_list[P_PAGETYPE_MAX]) __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)) = { NULL, /* P_INVALID */ NULL, /* __P_DUPLICATE */ CDB___ham_31_hash, /* P_HASH */ NULL, /* P_IBTREE */ NULL, /* P_IRECNO */ CDB___bam_31_lbtree, /* P_LBTREE */ NULL, /* P_LRECNO */ NULL, /* P_OVERFLOW */ CDB___ham_31_hashmeta, /* P_HASHMETA */ CDB___bam_31_btreemeta, /* P_BTREEMETA */ }; static int __db_page_pass __P((DB *, char *, u_int32_t, int (* const []) (DB *, char *, u_int32_t, DB_FH *, PAGE *, int *), DB_FH *)); /* * CDB___db_upgrade -- * Upgrade an existing database. * * PUBLIC: int CDB___db_upgrade __P((DB *, const char *, u_int32_t)); */ int CDB___db_upgrade(dbp, fname, flags) DB *dbp; const char *fname; u_int32_t flags; { DB_ENV *dbenv; DB_FH fh; size_t n; int ret, t_ret; u_int8_t mbuf[256]; char *real_name; dbenv = dbp->dbenv; /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "DB->upgrade", flags, DB_DUPSORT)) != 0) return (ret); /* Get the real backing file name. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, fname, 0, NULL, &real_name)) != 0) return (ret); /* Open the file. */ if ((ret = CDB___os_open(dbenv, real_name, 0, 0, &fh)) != 0) { CDB___db_err(dbenv, "%s: %s", real_name, CDB_db_strerror(ret)); return (ret); } /* Initialize the feedback. */ if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 0); /* * Read the metadata page. We read 256 bytes, which is larger than * any access method's metadata page and smaller than any disk sector. */ if ((ret = CDB___os_read(dbenv, &fh, mbuf, sizeof(mbuf), &n)) != 0) goto err; switch (((DBMETA *)mbuf)->magic) { case DB_BTREEMAGIC: switch (((DBMETA *)mbuf)->version) { case 6: /* * Before V7 not all pages had page types, so we do the * single meta-data page by hand. */ if ((ret = CDB___bam_30_btreemeta(dbp, real_name, mbuf)) != 0) goto err; if ((ret = CDB___os_seek(dbenv, &fh, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) goto err; if ((ret = CDB___os_write(dbenv, &fh, mbuf, 256, &n)) != 0) goto err; /* FALLTHROUGH */ case 7: /* * We need the page size to do more. Rip it out of * the meta-data page. */ memcpy(&dbp->pgsize, mbuf + 20, sizeof(u_int32_t)); if ((ret = __db_page_pass( dbp, real_name, flags, func_31_list, &fh)) != 0) goto err; /* FALLTHROUGH */ case 8: break; default: CDB___db_err(dbenv, "%s: unsupported btree version: %lu", real_name, (u_long)((DBMETA *)mbuf)->version); ret = DB_OLD_VERSION; goto err; } break; case DB_HASHMAGIC: switch (((DBMETA *)mbuf)->version) { case 4: case 5: /* * Before V6 not all pages had page types, so we do the * single meta-data page by hand. */ if ((ret = CDB___ham_30_hashmeta(dbp, real_name, mbuf)) != 0) goto err; if ((ret = CDB___os_seek(dbenv, &fh, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) goto err; if ((ret = CDB___os_write(dbenv, &fh, mbuf, 256, &n)) != 0) goto err; /* FALLTHROUGH */ case 6: /* * We need the page size to do more. Rip it out of * the meta-data page. */ memcpy(&dbp->pgsize, mbuf + 20, sizeof(u_int32_t)); if ((ret = __db_page_pass( dbp, real_name, flags, func_31_list, &fh)) != 0) goto err; /* FALLTHROUGH */ case 7: break; default: CDB___db_err(dbenv, "%s: unsupported hash version: %lu", real_name, (u_long)((DBMETA *)mbuf)->version); ret = DB_OLD_VERSION; goto err; } break; case DB_QAMMAGIC: switch (((DBMETA *)mbuf)->version) { case 1: /* * If we're in a Queue database, the only page that * needs upgrading is the meta-database page, don't * bother with a full pass. */ if ((ret = CDB___qam_31_qammeta(dbp, real_name, mbuf)) != 0) return (ret); if ((ret = CDB___os_seek(dbenv, &fh, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) goto err; if ((ret = CDB___os_write(dbenv, &fh, mbuf, 256, &n)) != 0) goto err; /* FALLTHROUGH */ case 2: break; default: CDB___db_err(dbenv, "%s: unsupported queue version: %lu", real_name, (u_long)((DBMETA *)mbuf)->version); ret = DB_OLD_VERSION; goto err; } break; default: M_32_SWAP(((DBMETA *)mbuf)->magic); switch (((DBMETA *)mbuf)->magic) { case DB_BTREEMAGIC: case DB_HASHMAGIC: case DB_QAMMAGIC: CDB___db_err(dbenv, "%s: DB->upgrade only supported on native byte-order systems", real_name); break; default: CDB___db_err(dbenv, "%s: unrecognized file type", real_name); break; } ret = EINVAL; goto err; } ret = CDB___os_fsync(dbenv, &fh); err: if ((t_ret = CDB___os_closehandle(&fh)) != 0 && ret == 0) ret = t_ret; CDB___os_freestr(real_name); /* We're done. */ if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 100); return (ret); } /* * __db_page_pass -- * Walk the pages of the database, upgrading whatever needs it. */ static int __db_page_pass(dbp, real_name, flags, fl, fhp) DB *dbp; char *real_name; u_int32_t flags; int (* const fl[P_PAGETYPE_MAX]) __P((DB *, char *, u_int32_t, DB_FH *, PAGE *, int *)); DB_FH *fhp; { DB_ENV *dbenv; PAGE *page; db_pgno_t i, pgno_last; size_t n; int dirty, ret; dbenv = dbp->dbenv; /* Determine the last page of the file. */ if ((ret = CDB___db_lastpgno(dbp, real_name, fhp, &pgno_last)) != 0) return (ret); /* Allocate memory for a single page. */ if ((ret = CDB___os_malloc(dbenv, dbp->pgsize, NULL, &page)) != 0) return (ret); /* Walk the file, calling the underlying conversion functions. */ for (i = 0; i < pgno_last; ++i) { if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, (i * 100)/pgno_last); if ((ret = CDB___os_seek(dbenv, fhp, dbp->pgsize, i, 0, 0, DB_OS_SEEK_SET)) != 0) break; if ((ret = CDB___os_read(dbenv, fhp, page, dbp->pgsize, &n)) != 0) break; dirty = 0; if (fl[TYPE(page)] != NULL && (ret = fl[TYPE(page)] (dbp, real_name, flags, fhp, page, &dirty)) != 0) break; if (dirty) { if ((ret = CDB___os_seek(dbenv, fhp, dbp->pgsize, i, 0, 0, DB_OS_SEEK_SET)) != 0) break; if ((ret = CDB___os_write(dbenv, fhp, page, dbp->pgsize, &n)) != 0) break; } } CDB___os_free(page, dbp->pgsize); return (ret); } /* * CDB___db_lastpgno -- * Return the current last page number of the file. * * PUBLIC: int CDB___db_lastpgno __P((DB *, char *, DB_FH *, db_pgno_t *)); */ int CDB___db_lastpgno(dbp, real_name, fhp, pgno_lastp) DB *dbp; char *real_name; DB_FH *fhp; db_pgno_t *pgno_lastp; { DB_ENV *dbenv; db_pgno_t pgno_last; u_int32_t mbytes, bytes; int ret; dbenv = dbp->dbenv; if ((ret = CDB___os_ioinfo(dbenv, real_name, fhp, &mbytes, &bytes, NULL)) != 0) { CDB___db_err(dbenv, "%s: %s", real_name, CDB_db_strerror(ret)); return (ret); } /* Page sizes have to be a power-of-two. */ if (bytes % dbp->pgsize != 0) { CDB___db_err(dbenv, "%s: file size not a multiple of the pagesize", real_name); return (EINVAL); } pgno_last = mbytes * (MEGABYTE / dbp->pgsize); pgno_last += bytes / dbp->pgsize; *pgno_lastp = pgno_last; return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_upg_opd.c�����������������������������������������������������������������������0100644�0063146�0012731�00000020663�07427026535�015237� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999, 2000 * Sleepycat Software. All rights reserved. */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: db_upg_opd.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" #include "hash.h" #include "qam.h" static int __db_build_bi __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *)); static int __db_build_ri __P((DB *, DB_FH *, PAGE *, PAGE *, u_int32_t, int *)); static int __db_up_ovref __P((DB *, DB_FH *, db_pgno_t)); #define GET_PAGE(dbp, fhp, pgno, page) { \ if ((ret = CDB___os_seek(dbp->dbenv, \ fhp, (dbp)->pgsize, pgno, 0, 0, DB_OS_SEEK_SET)) != 0) \ goto err; \ if ((ret = CDB___os_read(dbp->dbenv, \ fhp, page, (dbp)->pgsize, &n)) != 0) \ goto err; \ } #define PUT_PAGE(dbp, fhp, pgno, page) { \ if ((ret = CDB___os_seek(dbp->dbenv, \ fhp, (dbp)->pgsize, pgno, 0, 0, DB_OS_SEEK_SET)) != 0) \ goto err; \ if ((ret = CDB___os_write(dbp->dbenv, \ fhp, page, (dbp)->pgsize, &n)) != 0) \ goto err; \ } /* * CDB___db_31_offdup -- * Convert 3.0 off-page duplicates to 3.1 off-page duplicates. * * PUBLIC: int CDB___db_31_offdup __P((DB *, char *, DB_FH *, int, db_pgno_t *)); */ int CDB___db_31_offdup(dbp, real_name, fhp, sorted, pgnop) DB *dbp; char *real_name; DB_FH *fhp; int sorted; db_pgno_t *pgnop; { PAGE *ipage, *page; db_indx_t indx; db_pgno_t cur_cnt, i, next_cnt, pgno, *pgno_cur, pgno_last; db_pgno_t *pgno_next, pgno_max, *tmp; db_recno_t nrecs; size_t n; int level, nomem, ret; ipage = page = NULL; pgno_cur = pgno_next = NULL; /* Allocate room to hold a page. */ if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &page)) != 0) goto err; /* * Walk the chain of 3.0 off-page duplicates. Each one is converted * in place to a 3.1 off-page duplicate page. If the duplicates are * sorted, they are converted to a Btree leaf page, otherwise to a * Recno leaf page. */ for (nrecs = 0, cur_cnt = pgno_max = 0, pgno = *pgnop; pgno != PGNO_INVALID;) { if (pgno_max == cur_cnt) { pgno_max += 20; if ((ret = CDB___os_realloc(dbp->dbenv, pgno_max * sizeof(db_pgno_t), NULL, &pgno_cur)) != 0) goto err; } pgno_cur[cur_cnt++] = pgno; GET_PAGE(dbp, fhp, pgno, page); nrecs += NUM_ENT(page); LEVEL(page) = LEAFLEVEL; TYPE_SET(page, sorted ? P_LDUP : P_LRECNO); /* * !!! * DB didn't zero the LSNs on off-page duplicates pages. */ ZERO_LSN(LSN(page)); PUT_PAGE(dbp, fhp, pgno, page); pgno = NEXT_PGNO(page); } /* If we only have a single page, it's easy. */ if (cur_cnt > 1) { /* * pgno_cur is the list of pages we just converted. We're * going to walk that list, but we'll need to create a new * list while we do so. */ if ((ret = CDB___os_malloc(dbp->dbenv, cur_cnt * sizeof(db_pgno_t), NULL, &pgno_next)) != 0) goto err; /* Figure out where we can start allocating new pages. */ if ((ret = CDB___db_lastpgno(dbp, real_name, fhp, &pgno_last)) != 0) goto err; /* Allocate room for an internal page. */ if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &ipage)) != 0) goto err; PGNO(ipage) = PGNO_INVALID; } /* * Repeatedly walk the list of pages, building internal pages, until * there's only one page at a level. */ for (level = LEAFLEVEL + 1; cur_cnt > 1; ++level) { for (indx = 0, i = next_cnt = 0; i < cur_cnt;) { if (indx == 0) { P_INIT(ipage, dbp->pgsize, pgno_last, PGNO_INVALID, PGNO_INVALID, level, sorted ? P_IBTREE : P_IRECNO, 0); ZERO_LSN(LSN(ipage)); pgno_next[next_cnt++] = pgno_last++; } GET_PAGE(dbp, fhp, pgno_cur[i], page); /* * If the duplicates are sorted, put the first item on * the lower-level page onto a Btree internal page. If * the duplicates are not sorted, create an internal * Recno structure on the page. If either case doesn't * fit, push out the current page and start a new one. */ nomem = 0; if (sorted) { if ((ret = __db_build_bi( dbp, fhp, ipage, page, indx, &nomem)) != 0) goto err; } else if ((ret = __db_build_ri( dbp, fhp, ipage, page, indx, &nomem)) != 0) goto err; if (nomem) { indx = 0; PUT_PAGE(dbp, fhp, PGNO(ipage), ipage); } else { ++indx; ++NUM_ENT(ipage); ++i; } } /* * Push out the last internal page. Set the top-level record * count if we've reached the top. */ if (next_cnt == 1) RE_NREC_SET(ipage, nrecs); PUT_PAGE(dbp, fhp, PGNO(ipage), ipage); /* Swap the current and next page number arrays. */ cur_cnt = next_cnt; tmp = pgno_cur; pgno_cur = pgno_next; pgno_next = tmp; } *pgnop = pgno_cur[0]; err: if (pgno_cur != NULL) CDB___os_free(pgno_cur, 0); if (pgno_next != NULL) CDB___os_free(pgno_next, 0); if (ipage != NULL) CDB___os_free(ipage, dbp->pgsize); if (page != NULL) CDB___os_free(page, dbp->pgsize); return (ret); } /* * __db_build_bi -- * Build a BINTERNAL entry for a parent page. */ static int __db_build_bi(dbp, fhp, ipage, page, indx, nomemp) DB *dbp; DB_FH *fhp; PAGE *ipage, *page; u_int32_t indx; int *nomemp; { BINTERNAL bi, *child_bi; BKEYDATA *child_bk; u_int8_t *p; int ret; switch (TYPE(page)) { case P_IBTREE: child_bi = GET_BINTERNAL(page, 0); if (P_FREESPACE(ipage) < BINTERNAL_PSIZE(child_bi->len)) { *nomemp = 1; return (0); } ipage->inp[indx] = HOFFSET(ipage) -= BINTERNAL_SIZE(child_bi->len); p = P_ENTRY(ipage, indx); bi.len = child_bi->len; B_TSET(bi.type, child_bi->type, 0); bi.pgno = PGNO(page); bi.nrecs = CDB___bam_total(page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bi->data, child_bi->len); /* Increment the overflow ref count. */ if (B_TYPE(child_bi->type) == B_OVERFLOW) if ((ret = __db_up_ovref(dbp, fhp, ((BOVERFLOW *)(child_bi->data))->pgno)) != 0) return (ret); break; case P_LDUP: child_bk = GET_BKEYDATA(page, 0); switch (B_TYPE(child_bk->type)) { case B_KEYDATA: if (P_FREESPACE(ipage) < BINTERNAL_PSIZE(child_bk->len)) { *nomemp = 1; return (0); } ipage->inp[indx] = HOFFSET(ipage) -= BINTERNAL_SIZE(child_bk->len); p = P_ENTRY(ipage, indx); bi.len = child_bk->len; B_TSET(bi.type, child_bk->type, 0); bi.pgno = PGNO(page); bi.nrecs = CDB___bam_total(page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bk->data, child_bk->len); break; case B_OVERFLOW: if (P_FREESPACE(ipage) < BINTERNAL_PSIZE(BOVERFLOW_SIZE)) { *nomemp = 1; return (0); } ipage->inp[indx] = HOFFSET(ipage) -= BINTERNAL_SIZE(BOVERFLOW_SIZE); p = P_ENTRY(ipage, indx); bi.len = BOVERFLOW_SIZE; B_TSET(bi.type, child_bk->type, 0); bi.pgno = PGNO(page); bi.nrecs = CDB___bam_total(page); memcpy(p, &bi, SSZA(BINTERNAL, data)); p += SSZA(BINTERNAL, data); memcpy(p, child_bk, BOVERFLOW_SIZE); /* Increment the overflow ref count. */ if ((ret = __db_up_ovref(dbp, fhp, ((BOVERFLOW *)child_bk)->pgno)) != 0) return (ret); break; default: return (CDB___db_pgfmt(dbp, PGNO(page))); } break; default: return (CDB___db_pgfmt(dbp, PGNO(page))); } return (0); } /* * __db_build_ri -- * Build a RINTERNAL entry for an internal parent page. */ static int __db_build_ri(dbp, fhp, ipage, page, indx, nomemp) DB *dbp; DB_FH *fhp; PAGE *ipage, *page; u_int32_t indx; int *nomemp; { RINTERNAL ri; COMPQUIET(dbp, NULL); COMPQUIET(fhp, NULL); if (P_FREESPACE(ipage) < RINTERNAL_PSIZE) { *nomemp = 1; return (0); } ri.pgno = PGNO(page); ri.nrecs = CDB___bam_total(page); ipage->inp[indx] = HOFFSET(ipage) -= RINTERNAL_SIZE; memcpy(P_ENTRY(ipage, indx), &ri, RINTERNAL_SIZE); return (0); } /* * __db_up_ovref -- * Increment/decrement the reference count on an overflow page. */ static int __db_up_ovref(dbp, fhp, pgno) DB *dbp; DB_FH *fhp; db_pgno_t pgno; { PAGE *page; size_t n; int ret; /* Allocate room to hold a page. */ if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &page)) != 0) return (ret); GET_PAGE(dbp, fhp, pgno, page); ++OV_REF(page); PUT_PAGE(dbp, fhp, pgno, page); err: CDB___os_free(page, dbp->pgsize); return (ret); } �����������������������������������������������������������������������������htdig-3.2.0b6/db/db_upgrade.c�����������������������������������������������������������������������0100644�0063146�0012731�00000004146�07427026535�015227� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)db_upgrade.c 11.3 (Sleepycat) 10/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "btree.h" #include "hash.h" #include "qam.h" /* * CDB___db_upgrade -- * Upgrade an existing database. * * PUBLIC: int CDB___db_upgrade __P((DB *, const char *, u_int32_t)); */ int CDB___db_upgrade(dbp, fname, flags) DB *dbp; const char *fname; u_int32_t flags; { DB_ENV *dbenv; DB_FH fh; ssize_t nr; int ret, swapped, t_ret; char *real_name, mbuf[256]; dbenv = dbp->dbenv; /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "DB->upgrade", flags, 0)) != 0) return (ret); /* Get the real backing file name. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, fname, 0, NULL, &real_name)) != 0) return (ret); /* Open the file. */ if ((ret = CDB___os_open(real_name, 0, 0, &fh)) != 0) { CDB___db_err(dbenv, "%s: %s", fname, CDB_db_strerror(ret)); return (ret); } /* * Read the metadata page. We read 256 bytes, which is larger than * any access method's metadata page and smaller than any disk sector. */ if ((ret = CDB___os_read(&fh, mbuf, sizeof(mbuf), &nr)) != 0) goto err; swapped = 0; retry: switch (((DBMETA *)mbuf)->magic) { case DB_BTREEMAGIC: if ((ret = CDB___bam_upgrade(dbp, swapped, real_name, &fh, mbuf)) != 0) goto err; break; case DB_HASHMAGIC: if ((ret = CDB___ham_upgrade(dbp, swapped, real_name, &fh, mbuf)) != 0) goto err; break; case DB_QAMMAGIC: break; default: if (swapped++) { CDB___db_err(dbenv, "%s: unrecognized file type", fname); ret = EINVAL; goto err; } M_32_SWAP(((DBMETA *)mbuf)->magic); M_32_SWAP(((DBMETA *)mbuf)->version); goto retry; } err: if ((t_ret = CDB___os_closehandle(&fh)) != 0 && ret == 0) ret = t_ret; CDB___os_freestr(real_name); return (ret); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_upgrade.h�����������������������������������������������������������������������0100644�0063146�0012731�00000012324�07427026535�015231� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999, 2000 * Sleepycat Software. All rights reserved. * * $Id: db_upgrade.h,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #ifndef _DB_UPGRADE_H_ #define _DB_UPGRADE_H_ /* * This file defines the metadata pages from the previous release. * These structures are only used to upgrade old versions of databases. */ /* Structures from the 3.0 release */ typedef struct _dbmeta30 { DB_LSN lsn; /* 00-07: LSN. */ db_pgno_t pgno; /* 08-11: Current page number. */ u_int32_t magic; /* 12-15: Magic number. */ u_int32_t version; /* 16-19: Version. */ u_int32_t pagesize; /* 20-23: Pagesize. */ u_int8_t unused1[1]; /* 24: Unused. */ u_int8_t type; /* 25: Page type. */ u_int8_t unused2[2]; /* 26-27: Unused. */ u_int32_t free; /* 28-31: Free list page number. */ u_int32_t flags; /* 32-35: Flags: unique to each AM. */ /* 36-55: Unique file ID. */ u_int8_t uid[DB_FILE_ID_LEN]; } DBMETA30; /************************************************************************ BTREE METADATA PAGE LAYOUT ************************************************************************/ typedef struct _btmeta30 { DBMETA30 dbmeta; /* 00-55: Generic meta-data header. */ u_int32_t maxkey; /* 56-59: Btree: Maxkey. */ u_int32_t minkey; /* 60-63: Btree: Minkey. */ u_int32_t re_len; /* 64-67: Recno: fixed-length record length. */ u_int32_t re_pad; /* 68-71: Recno: fixed-length record pad. */ u_int32_t root; /* 72-75: Root page. */ /* * Minimum page size is 128. */ } BTMETA30; /************************************************************************ HASH METADATA PAGE LAYOUT ************************************************************************/ typedef struct _hashmeta30 { DBMETA30 dbmeta; /* 00-55: Generic meta-data page header. */ u_int32_t max_bucket; /* 56-59: ID of Maximum bucket in use */ u_int32_t high_mask; /* 60-63: Modulo mask into table */ u_int32_t low_mask; /* 64-67: Modulo mask into table lower half */ u_int32_t ffactor; /* 68-71: Fill factor */ u_int32_t nelem; /* 72-75: Number of keys in hash table */ u_int32_t h_charkey; /* 76-79: Value of hash(CHARKEY) */ #define NCACHED30 32 /* number of spare points */ /* 80-207: Spare pages for overflow */ u_int32_t spares[NCACHED30]; /* * Minimum page size is 256. */ } HMETA30; /************************************************************************ QUEUE METADATA PAGE LAYOUT ************************************************************************/ /* * QAM Meta data page structure * */ typedef struct _qmeta30 { DBMETA30 dbmeta; /* 00-55: Generic meta-data header. */ u_int32_t start; /* 56-59: Start offset. */ u_int32_t first_recno; /* 60-63: First not deleted record. */ u_int32_t cur_recno; /* 64-67: Last recno allocated. */ u_int32_t re_len; /* 68-71: Fixed-length record length. */ u_int32_t re_pad; /* 72-75: Fixed-length record pad. */ u_int32_t rec_page; /* 76-79: Records Per Page. */ /* * Minimum page size is 128. */ } QMETA30; /* Structures from Release 2.x */ /************************************************************************ BTREE METADATA PAGE LAYOUT ************************************************************************/ /* * Btree metadata page layout: */ typedef struct _btmeta2X { DB_LSN lsn; /* 00-07: LSN. */ db_pgno_t pgno; /* 08-11: Current page number. */ u_int32_t magic; /* 12-15: Magic number. */ u_int32_t version; /* 16-19: Version. */ u_int32_t pagesize; /* 20-23: Pagesize. */ u_int32_t maxkey; /* 24-27: Btree: Maxkey. */ u_int32_t minkey; /* 28-31: Btree: Minkey. */ u_int32_t free; /* 32-35: Free list page number. */ u_int32_t flags; /* 36-39: Flags. */ u_int32_t re_len; /* 40-43: Recno: fixed-length record length. */ u_int32_t re_pad; /* 44-47: Recno: fixed-length record pad. */ /* 48-67: Unique file ID. */ u_int8_t uid[DB_FILE_ID_LEN]; } BTMETA2X; /************************************************************************ HASH METADATA PAGE LAYOUT ************************************************************************/ /* * Hash metadata page layout: */ /* Hash Table Information */ typedef struct hashhdr { /* Disk resident portion */ DB_LSN lsn; /* 00-07: LSN of the header page */ db_pgno_t pgno; /* 08-11: Page number (btree compatibility). */ u_int32_t magic; /* 12-15: Magic NO for hash tables */ u_int32_t version; /* 16-19: Version ID */ u_int32_t pagesize; /* 20-23: Bucket/Page Size */ u_int32_t ovfl_point; /* 24-27: Overflow page allocation location */ u_int32_t last_freed; /* 28-31: Last freed overflow page pgno */ u_int32_t max_bucket; /* 32-35: ID of Maximum bucket in use */ u_int32_t high_mask; /* 36-39: Modulo mask into table */ u_int32_t low_mask; /* 40-43: Modulo mask into table lower half */ u_int32_t ffactor; /* 44-47: Fill factor */ u_int32_t nelem; /* 48-51: Number of keys in hash table */ u_int32_t h_charkey; /* 52-55: Value of hash(CHARKEY) */ u_int32_t flags; /* 56-59: Allow duplicates. */ #define NCACHED2X 32 /* number of spare points */ /* 60-187: Spare pages for overflow */ u_int32_t spares[NCACHED2X]; /* 188-207: Unique file ID. */ u_int8_t uid[DB_FILE_ID_LEN]; /* * Minimum page size is 256. */ } HASHHDR; #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_verify.h������������������������������������������������������������������������0100644�0063146�0012731�00000013066�07427026535�015112� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999, 2000 * Sleepycat Software. All rights reserved. * * $Id: db_verify.h,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #ifndef _DB_VERIFY_H #define _DB_VERIFY_H_ /* * Structures and macros for the storage and retrieval of all information * needed for inter-page verification of a database. */ /* * EPRINT is the macro for error printing. Takes as an arg the arg set * for DB->err. */ #define EPRINT(x) \ do { \ if (!LF_ISSET(DB_SALVAGE)) \ CDB___db_err x; \ } while (0) #define TYPE_ERR_PRINT(dbp, func, pgno, type) \ EPRINT(((dbp), "%s called on nonsensical page %lu of type %lu", \ (func), (u_long)(pgno), (u_long)(type))); /* Is x a power of two? (Tests true for zero, which doesn't matter here.) */ #define POWER_OF_TWO(x) (((x) & ((x) - 1)) == 0) #define IS_VALID_PAGESIZE(x) \ (POWER_OF_TWO(x) && (x) >= DB_MIN_PGSIZE && ((x) <= DB_MAX_PGSIZE)) /* * Note that 0 is, in general, a valid pgno, despite equalling PGNO_INVALID; * we have to test it separately where it's not appropriate. */ #define IS_VALID_PGNO(x) ((x) <= vdp->last_pgno) /* * Flags understood by the btree structure checks (esp. CDB___bam_vrfy_subtree). * These share the same space as the global flags to CDB___db_verify, and must not * dip below 0x00010000. */ #define ST_DUPOK 0x00010000 #define ST_DUPSORT 0x00020000 #define ST_IS_RECNO 0x00040000 #define ST_OVFL_LEAF 0x00080000 /* Overflow reffed from leaf page. */ #define ST_RECNUM 0x00100000 #define ST_RELEN 0x00200000 #define ST_TOPLEVEL 0x00400000 /* subtree == entire tree */ /* * Flags understood by CDB___bam_salvage and CDB___db_salvage. These need not share * the same space with the CDB___bam_vrfy_subtree flags, but must share with * CDB___db_verify. */ #define SA_HASDUPS 0x00010000 #define SA_MARKDATAPGS 0x00020000 #define SA_PRINTHEADER 0x00040000 #define SA_SKIPFIRSTKEY 0x00080000 /* * VRFY_DBINFO is the fundamental structure; it either represents the database * of subdatabases, or the sole database if there are no subdatabases. */ struct __vrfy_dbinfo { /* Info about this database in particular. */ DBTYPE type; /* List of subdatabase meta pages, if any. */ LIST_HEAD(__subdbs, __vrfy_childinfo) subdbs; /* File-global info--stores VRFY_PAGEINFOs for each page. */ DB *pgdbp; /* Child database--stores VRFY_CHILDINFOs of each page. */ DB *cdbp; /* Page info structures currently in use. */ LIST_HEAD(__activepips, __vrfy_pageinfo) activepips; /* * DB we use to keep track of which pages are linked somehow * during verification. 0 is the default, "unseen"; 1 is seen. */ DB *pgset; /* * This is a database we use during salvaging to keep track of which * overflow and dup pages we need to come back to at the end and print * with key "UNKNOWN". Pages which print with a good key get set * to SALVAGE_IGNORE; others get set, as appropriate, to SALVAGE_LDUP, * SALVAGE_LRECNODUP, SALVAGE_OVERFLOW for normal db overflow pages, * and SALVAGE_BTREE, SALVAGE_LRECNO, and SALVAGE_HASH for subdb * pages. */ #define SALVAGE_INVALID 0 #define SALVAGE_IGNORE 1 #define SALVAGE_LDUP 2 #define SALVAGE_LRECNODUP 3 #define SALVAGE_OVERFLOW 4 #define SALVAGE_LBTREE 5 #define SALVAGE_HASH 6 #define SALVAGE_LRECNO 7 DB *salvage_pages; db_pgno_t last_pgno; /* Queue needs these to verify data pages in the first pass. */ u_int32_t re_len; u_int32_t rec_page; #define SALVAGE_PRINTHEADER 0x01 #define SALVAGE_PRINTFOOTER 0x02 u_int32_t flags; }; /* VRFY_DBINFO */ /* * The amount of state information we need per-page is small enough that * it's not worth the trouble to define separate structures for each * possible type of page, and since we're doing verification with these we * have to be open to the possibility that page N will be of a completely * unexpected type anyway. So we define one structure here with all the * info we need for inter-page verification. */ struct __vrfy_pageinfo { u_int8_t type; u_int8_t bt_level; u_int8_t unused1; u_int8_t unused2; db_pgno_t pgno; db_pgno_t prev_pgno; db_pgno_t next_pgno; /* meta pages */ db_pgno_t root; db_pgno_t free; /* Free list head. */ db_indx_t entries; /* Actual number of entries. */ u_int16_t unused; db_recno_t rec_cnt; /* Record count. */ u_int32_t re_len; /* Record length. */ u_int32_t bt_minkey; u_int32_t bt_maxkey; u_int32_t h_ffactor; u_int32_t h_nelem; /* overflow pages */ /* * Note that refcount is the refcount for an overflow page; pi_refcount * is this structure's own refcount! */ u_int32_t refcount; u_int32_t olen; #define VRFY_DUPS_UNSORTED 0x0001 /* Have to flag the negative! */ #define VRFY_HAS_DUPS 0x0002 #define VRFY_HAS_DUPSORT 0x0004 /* Has the flag set. */ #define VRFY_HAS_SUBDBS 0x0008 #define VRFY_HAS_RECNUMS 0x0010 #define VRFY_INCOMPLETE 0x0020 /* Meta or item order checks incomp. */ #define VRFY_IS_ALLZEROES 0x0040 /* Hash page we haven't touched? */ #define VRFY_IS_FIXEDLEN 0x0080 #define VRFY_IS_RECNO 0x0100 #define VRFY_IS_RRECNO 0x0200 #define VRFY_OVFL_LEAFSEEN 0x0400 u_int32_t flags; LIST_ENTRY(__vrfy_pageinfo) links; u_int32_t pi_refcount; }; /* VRFY_PAGEINFO */ struct __vrfy_childinfo { db_pgno_t pgno; #define V_DUPLICATE 1 /* off-page dup metadata */ #define V_OVERFLOW 2 /* overflow page */ #define V_RECNO 3 /* btree internal or leaf page */ u_int32_t type; db_recno_t nrecs; /* record count on a btree subtree */ u_int32_t tlen; /* ovfl. item total size */ LIST_ENTRY(__vrfy_childinfo) links; }; /* VRFY_CHILDINFO */ #endif /* _DB_VERIFY_H_ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_vrfy.c��������������������������������������������������������������������������0100644�0063146�0012731�00000156274�07427026535�014600� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000 * Sleepycat Software. All rights reserved. * * $Id: db_vrfy.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: db_vrfy.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "db_verify.h" #include "db_ext.h" #include "btree.h" #include "hash.h" #include "qam.h" static int __db_guesspgsize __P((DB_ENV *, DB_FH *)); static int __db_is_valid_magicno __P((u_int32_t, DBTYPE *)); static int __db_is_valid_pagetype __P((u_int32_t)); static int __db_meta2pgset __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t, DB *)); static int __db_salvage_subdbs __P((DB *, VRFY_DBINFO *, void *, int(*)(void *, const void *), u_int32_t, int *)); static int __db_salvage_unknowns __P((DB *, VRFY_DBINFO *, void *, int (*)(void *, const void *), u_int32_t)); static int __db_vrfy_common __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); static int __db_vrfy_freelist __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t)); static int __db_vrfy_invalid __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); static int __db_vrfy_orderchkonly __P((DB *, VRFY_DBINFO *, const char *, const char *, u_int32_t)); static int __db_vrfy_pagezero __P((DB *, VRFY_DBINFO *, DB_FH *, u_int32_t)); static int __db_vrfy_subdbs __P((DB *, VRFY_DBINFO *, char *, u_int32_t)); static int __db_vrfy_structure __P((DB *, VRFY_DBINFO *, char *, db_pgno_t, u_int32_t)); static int __db_vrfy_walkpages __P((DB *, VRFY_DBINFO *, void *, int (*)(void *, const void *), u_int32_t)); /* * This is the code for DB->verify, the DB database consistency checker. * For now, it checks all subdatabases in a database, and verifies * everything it knows how to (i.e. it's all-or-nothing, and one can't * check only for a subset of possible problems). */ /* * CDB___db_verify -- * Walk the entire file page-by-page, either verifying with or without * dumping in db_dump -d format, or DB_SALVAGE-ing whatever key/data * pairs can be found and dumping them in standard (db_load-ready) * dump format. * * (Salvaging isn't really a verification operation, but we put it * here anyway because it requires essentially identical top-level * code.) * * flags may be 0, DB_NOORDERCHK, DB_ORDERCHKONLY, or DB_SALVAGE * (and optionally DB_AGGRESSIVE). * * CDB___db_verify itself is simply a wrapper to CDB___db_verify_internal, * which lets us pass appropriate equivalents to FILE * in from the * non-C APIs. * * PUBLIC: int CDB___db_verify * PUBLIC: __P((DB *, const char *, const char *, FILE *, u_int32_t)); */ int CDB___db_verify(dbp, file, database, outfile, flags) DB *dbp; const char *file, *database; FILE *outfile; u_int32_t flags; { return (CDB___db_verify_internal(dbp, file, database, outfile, CDB___db_verify_callback, flags)); } /* * CDB___db_verify_callback -- * Callback function for using pr_* functions from C. * * PUBLIC: int CDB___db_verify_callback __P((void *, const void *)); */ int CDB___db_verify_callback(handle, str_arg) void *handle; const void *str_arg; { char *str; FILE *f; str = (char *)str_arg; f = (FILE *)handle; if (fprintf(f, str) != (int)strlen(str)) return (EIO); return (0); } /* * CDB___db_verify_internal -- * Inner meat of CDB___db_verify. * * PUBLIC: int CDB___db_verify_internal __P((DB *, const char *, * PUBLIC: const char *, void *, int (*)(void *, const void *), u_int32_t)); */ int CDB___db_verify_internal(dbp_orig, name, subdb, handle, callback, flags) DB *dbp_orig; const char *name, *subdb; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { DB *dbp; DB_ENV *dbenv; DB_FH fh, *fhp; PAGE *h; VRFY_DBINFO *vdp; db_pgno_t last; int has, ret, isbad; char *real_name; dbenv = dbp_orig->dbenv; vdp = NULL; real_name = NULL; ret = isbad = 0; memset(&fh, 0, sizeof(fh)); fhp = &fh; PANIC_CHECK(dbenv); DB_ILLEGAL_AFTER_OPEN(dbp_orig, "verify"); #define OKFLAGS (DB_AGGRESSIVE | DB_NOORDERCHK | DB_ORDERCHKONLY | DB_SALVAGE) if ((ret = CDB___db_fchk(dbenv, "DB->verify", flags, OKFLAGS)) != 0) return (ret); /* * DB_SALVAGE is mutually exclusive with the other flags except * DB_AGGRESSIVE. */ if (LF_ISSET(DB_SALVAGE) && (flags & ~DB_AGGRESSIVE) != DB_SALVAGE) return (CDB___db_ferr(dbenv, "CDB___db_verify", 1)); if (LF_ISSET(DB_ORDERCHKONLY) && flags != DB_ORDERCHKONLY) return (CDB___db_ferr(dbenv, "CDB___db_verify", 1)); if (LF_ISSET(DB_ORDERCHKONLY) && subdb == NULL) { CDB___db_err(dbenv, "DB_ORDERCHKONLY requires a database name"); return (EINVAL); } /* * Forbid working in an environment that uses transactions or * locking; we're going to be looking at the file freely, * and while we're not going to modify it, we aren't obeying * locking conventions either. */ if (TXN_ON(dbenv) || LOCKING_ON(dbenv) || LOGGING_ON(dbenv)) { dbp_orig->errx(dbp_orig, "verify may not be used with transactions, logging, or locking"); return (EINVAL); /* NOTREACHED */ } /* Create a dbp to use internally, which we can close at our leisure. */ if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) goto err; /* Copy the supplied pagesize, which we use if the file one is bogus. */ if (dbp_orig->pgsize >= DB_MIN_PGSIZE && dbp_orig->pgsize <= DB_MAX_PGSIZE) dbp->set_pagesize(dbp, dbp_orig->pgsize); /* * We don't know how large the cache is, and if the database * in question uses a small page size--which we don't know * yet!--it may be uncomfortably small for the default page * size [#2143]. However, the things we need temporary * databases for in dbinfo are largely tiny, so using a * 1024-byte pagesize is probably not going to be a big hit, * and will make us fit better into small spaces. */ if ((ret = CDB___db_vrfy_dbinfo_create(dbenv, 1024, &vdp)) != 0) goto err; /* Find the real name of the file. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, name, 0, NULL, &real_name)) != 0) goto err; /* * Our first order of business is to verify page 0, which is * the metadata page for the master database of subdatabases * or of the only database in the file. We want to do this by hand * rather than just calling CDB___db_open in case it's corrupt--various * things in CDB___db_open might act funny. * * Once we know the metadata page is healthy, I believe that it's * safe to open the database normally and then use the page swapping * code, which makes life easier. */ if ((ret = CDB___os_open(dbenv, real_name, DB_OSO_RDONLY, 0444, fhp)) != 0) goto err; /* Verify the metadata page 0; set pagesize and type. */ if ((ret = __db_vrfy_pagezero(dbp, vdp, fhp, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * We can assume at this point that dbp->pagesize and dbp->type are * set correctly, or at least as well as they can be, and that * locking, logging, and txns are not in use. Thus we can trust * the memp code not to look at the page, and thus to be safe * enough to use. * * The dbp is not open, but the file is open in the fhp, and we * cannot assume that CDB___db_open is safe. Call CDB___db_dbenv_setup, * the [safe] part of CDB___db_open that initializes the environment-- * and the mpool--manually. */ if ((ret = CDB___db_dbenv_setup(dbp, name, DB_ODDFILESIZE | DB_RDONLY)) != 0) return (ret); /* * Find out the page number of the last page in the database. * * XXX: This currently fails if the last page is of bad type, * because it calls CDB___db_pgin and that pukes. This is bad. */ if ((ret = CDB_memp_fget(dbp->mpf, &last, DB_MPOOL_LAST, &h)) != 0) goto err; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) goto err; vdp->last_pgno = last; /* * DB_ORDERCHKONLY is a special case; our file consists of * several subdatabases, which use different hash, bt_compare, * and/or dup_compare functions. Consequently, we couldn't verify * sorting and hashing simply by calling DB->verify() on the file. * DB_ORDERCHKONLY allows us to come back and check those things; it * requires a subdatabase, and assumes that everything but that * database's sorting/hashing is correct. */ if (LF_ISSET(DB_ORDERCHKONLY)) { ret = __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags); goto done; } /* * When salvaging, we use a db to keep track of whether we've seen a * given overflow or dup page in the course of traversing normal data. * If in the end we have not, we assume its key got lost and print it * with key "UNKNOWN". */ if (LF_ISSET(DB_SALVAGE)) { if ((ret = CDB___db_salvage_init(vdp)) != 0) return (ret); /* * If we're not being aggressive, attempt to crack subdbs. * "has" will indicate whether the attempt has succeeded * (even in part), meaning that we have some semblance of * subdbs; on the walkpages pass, we print out * whichever data pages we have not seen. */ has = 0; if (!LF_ISSET(DB_AGGRESSIVE) && (__db_salvage_subdbs(dbp, vdp, handle, callback, flags, &has)) != 0) isbad = 1; /* * If we have subdatabases, we need to signal that if * any keys are found that don't belong to a subdatabase, * they'll need to have an "__OTHER__" subdatabase header * printed first. Flag this. Else, print a header for * the normal, non-subdb database. */ if (has == 1) F_SET(vdp, SALVAGE_PRINTHEADER); else if ((ret = CDB___db_prheader(dbp, NULL, 0, 0, handle, callback, vdp, PGNO_BASE_MD)) != 0) goto err; } if ((ret = __db_vrfy_walkpages(dbp, vdp, handle, callback, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else if (ret != 0) goto err; } /* If we're verifying, verify inter-page structure. */ if (!LF_ISSET(DB_SALVAGE) && isbad == 0) if ((ret = __db_vrfy_structure(dbp, vdp, real_name, 0, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else if (ret != 0) goto err; } /* * If we're salvaging, output with key UNKNOWN any overflow or dup pages * we haven't been able to put in context. Then destroy the salvager's * state-saving database. */ if (LF_ISSET(DB_SALVAGE)) { if ((ret = __db_salvage_unknowns(dbp, vdp, handle, callback, flags)) != 0) isbad = 1; /* No return value, since there's little we can do. */ CDB___db_salvage_destroy(vdp); } if (0) { err: (void)CDB___db_err(dbenv, "%s: %s", name, CDB_db_strerror(ret)); } if (LF_ISSET(DB_SALVAGE) && (has == 0 || F_ISSET(vdp, SALVAGE_PRINTFOOTER))) (void)CDB___db_prfooter(handle, callback); done: if (F_ISSET(fhp, DB_FH_VALID)) (void)CDB___os_closehandle(fhp); if (dbp) (void)dbp->close(dbp, 0); if (vdp) (void)CDB___db_vrfy_dbinfo_destroy(vdp); if (real_name) CDB___os_freestr(real_name); if ((ret == 0 && isbad == 1) || ret == DB_VERIFY_FATAL) ret = DB_VERIFY_BAD; return (ret); } /* * __db_vrfy_pagezero -- * Verify the master metadata page. Use seek, read, and a local buffer * rather than the DB paging code, for safety. * * Must correctly (or best-guess) set dbp->type and dbp->pagesize. */ static int __db_vrfy_pagezero(dbp, vdp, fhp, flags) DB *dbp; VRFY_DBINFO *vdp; DB_FH *fhp; u_int32_t flags; { DBMETA *meta; DB_ENV *dbenv; VRFY_PAGEINFO *pip; db_pgno_t freelist; int t_ret, ret, nr, swapped; u_int8_t mbuf[DBMETASIZE]; swapped = ret = t_ret = 0; freelist = 0; dbenv = dbp->dbenv; meta = (DBMETA *)mbuf; dbp->type = DB_UNKNOWN; /* * Seek to the metadata page. * Note that if we're just starting a verification, dbp->pgsize * may be zero; this is okay, as we want page zero anyway and * 0*0 == 0. */ if ((ret = CDB___os_seek(dbenv, fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) goto err; if ((ret = CDB___os_read(dbenv, fhp, mbuf, DBMETASIZE, (size_t *)&nr)) != 0) goto err; if (nr != DBMETASIZE) { EPRINT((dbp->dbenv, "Incomplete metadata page %lu", PGNO_BASE_MD)); t_ret = DB_VERIFY_FATAL; goto err; } /* * Check all of the fields that we can. */ /* 08-11: Current page number. Must == pgno. */ /* Note that endianness doesn't matter--it's zero. */ if (meta->pgno != PGNO_BASE_MD) { EPRINT((dbp->dbenv, "Bad pgno: was %lu, should be %lu", meta->pgno, PGNO_BASE_MD)); ret = DB_VERIFY_BAD; } /* 12-15: Magic number. Must be one of valid set. */ if (__db_is_valid_magicno(meta->magic, &dbp->type)) swapped = 0; else { M_32_SWAP(meta->magic); if (__db_is_valid_magicno(meta->magic, &dbp->type)) swapped = 1; else { EPRINT((dbp->dbenv, "Bad magic no.: %lu", meta->magic)); ret = DB_VERIFY_BAD; } } /* * 16-19: Version. Must be current; for now, we * don't support verification of old versions. */ if (swapped) M_32_SWAP(meta->version); if ((dbp->type == DB_BTREE && meta->version != DB_BTREEVERSION) || (dbp->type == DB_HASH && meta->version != DB_HASHVERSION) || (dbp->type == DB_QUEUE && meta->version != DB_QAMVERSION)) { ret = DB_VERIFY_BAD; EPRINT((dbp->dbenv, "%s%s", "Old or incorrect DB ", "version; extraneous errors may result")); } /* * 20-23: Pagesize. Must be power of two, * greater than 512, and less than 64K. */ if (swapped) M_32_SWAP(meta->pagesize); if (IS_VALID_PAGESIZE(meta->pagesize)) dbp->pgsize = meta->pagesize; else { EPRINT((dbp->dbenv, "Bad page size: %lu", meta->pagesize)); ret = DB_VERIFY_BAD; /* * Now try to settle on a pagesize to use. * If the user-supplied one is reasonable, * use it; else, guess. */ if (!IS_VALID_PAGESIZE(dbp->pgsize)) dbp->pgsize = __db_guesspgsize(dbenv, fhp); } /* * 25: Page type. Must be correct for dbp->type, * which is by now set as well as it can be. */ /* Needs no swapping--only one byte! */ if ((dbp->type == DB_BTREE && meta->type != P_BTREEMETA) || (dbp->type == DB_HASH && meta->type != P_HASHMETA) || (dbp->type == DB_QUEUE && meta->type != P_QAMMETA)) { ret = DB_VERIFY_BAD; EPRINT((dbp->dbenv, "Bad page type: %lu", meta->type)); } /* * 28-31: Free list page number. * We'll verify its sensibility when we do inter-page * verification later; for now, just store it. */ if (swapped) M_32_SWAP(meta->free); freelist = meta->free; /* * Initialize vdp->pages to fit a single pageinfo structure for * this one page. We'll realloc later when we know how many * pages there are. */ if ((ret = CDB___db_vrfy_getpageinfo(vdp, PGNO_BASE_MD, &pip)) != 0) return (ret); pip->pgno = PGNO_BASE_MD; pip->type = meta->type; /* * Signal that we still have to check the info specific to * a given type of meta page. */ F_SET(pip, VRFY_INCOMPLETE); pip->free = freelist; if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) return (ret); if (0) { err: CDB___db_err(dbenv, "%s", CDB_db_strerror(ret)); } if (swapped == 1) F_SET(dbp, DB_AM_SWAP); if (t_ret != 0) ret = t_ret; return (ret); } /* * __db_vrfy_walkpages -- * Main loop of the verifier/salvager. Walks through, * page by page, and verifies all pages and/or prints all data pages. */ static int __db_vrfy_walkpages(dbp, vdp, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { DB_ENV *dbenv; PAGE *h; db_pgno_t i; int ret, t_ret, isbad; ret = isbad = t_ret = 0; dbenv = dbp->dbenv; if ((ret = CDB___db_fchk(dbenv, "__db_vrfy_walkpages", flags, OKFLAGS)) != 0) return (ret); for (i = 0; i <= vdp->last_pgno; i++) { /* * If DB_SALVAGE is set, we inspect our database of * completed pages, and skip any we've already printed in * the subdb pass. */ if (LF_ISSET(DB_SALVAGE) && (CDB___db_salvage_isdone(vdp, i) != 0)) continue; /* If an individual page get fails, keep going. */ if ((t_ret = CDB_memp_fget(dbp->mpf, &i, 0, &h)) != 0) { if (ret == 0) ret = t_ret; continue; } if (LF_ISSET(DB_SALVAGE)) { /* * We pretty much don't want to quit unless a * bomb hits. May as well return that something * was screwy, however. */ if ((t_ret = CDB___db_salvage(dbp, vdp, i, h, handle, callback, flags)) != 0) { if (ret == 0) ret = t_ret; isbad = 1; } } else { /* * Verify info common to all page * types. */ if (i != PGNO_BASE_MD) if ((t_ret = __db_vrfy_common(dbp, vdp, h, i, flags)) == DB_VERIFY_BAD) isbad = 1; switch (TYPE(h)) { case P_INVALID: t_ret = __db_vrfy_invalid(dbp, vdp, h, i, flags); break; case __P_DUPLICATE: isbad = 1; EPRINT((dbp->dbenv, "Old-style dup page %lu", i)); break; case P_HASH: t_ret = CDB___ham_vrfy(dbp, vdp, h, i, flags); break; case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LDUP: t_ret = CDB___bam_vrfy(dbp, vdp, h, i, flags); break; case P_LRECNO: t_ret = CDB___ram_vrfy_leaf(dbp, vdp, h, i, flags); break; case P_OVERFLOW: t_ret = CDB___db_vrfy_overflow(dbp, vdp, h, i, flags); break; case P_HASHMETA: t_ret = CDB___ham_vrfy_meta(dbp, vdp, (HMETA *)h, i, flags); break; case P_BTREEMETA: t_ret = CDB___bam_vrfy_meta(dbp, vdp, (BTMETA *)h, i, flags); break; case P_QAMMETA: t_ret = CDB___qam_vrfy_meta(dbp, vdp, (QMETA *)h, i, flags); break; case P_QAMDATA: t_ret = CDB___qam_vrfy_data(dbp, vdp, (QPAGE *)h, i, flags); break; default: EPRINT((dbp->dbenv, "Unknown page type: %lu", TYPE(h))); isbad = 1; break; } /* * Set up error return. */ if (t_ret == DB_VERIFY_BAD) isbad = 1; else if (t_ret == DB_VERIFY_FATAL) goto err; else ret = t_ret; } if ((t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) ret = t_ret; } if (0) { err: if ((t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret == 0 ? t_ret : ret); return (DB_VERIFY_BAD); } return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); } /* * __db_vrfy_structure-- * After a beginning-to-end walk through the database has been * completed, put together the information that has been collected * to verify the overall database structure. * * Should only be called if we want to do a database verification, * i.e. if DB_SALVAGE is not set. */ static int __db_vrfy_structure(dbp, vdp, dbname, meta_pgno, flags) DB *dbp; VRFY_DBINFO *vdp; char *dbname; db_pgno_t meta_pgno; u_int32_t flags; { DB *pgset; DB_ENV *dbenv; VRFY_PAGEINFO *pip; db_pgno_t i; int ret, isbad, hassubs, p; isbad = 0; pip = NULL; dbenv = dbp->dbenv; pgset = vdp->pgset; if ((ret = CDB___db_fchk(dbenv, "DB->verify", flags, OKFLAGS)) != 0) return (ret); if (LF_ISSET(DB_SALVAGE)) { CDB___db_err(dbenv, "__db_vrfy_structure called with DB_SALVAGE"); return (EINVAL); } /* * Call the appropriate function to downwards-traverse the db type. */ switch(dbp->type) { case DB_BTREE: case DB_RECNO: if ((ret = CDB___bam_vrfy_structure(dbp, vdp, 0, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * If we have subdatabases and we know that the database is, * thus far, sound, it's safe to walk the tree of subdatabases. * Do so, and verify the structure of the databases within. */ if ((ret = CDB___db_vrfy_getpageinfo(vdp, 0, &pip)) != 0) goto err; hassubs = F_ISSET(pip, VRFY_HAS_SUBDBS); if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) goto err; if (isbad == 0 && hassubs) if ((ret = __db_vrfy_subdbs(dbp, vdp, dbname, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } break; case DB_HASH: if ((ret = CDB___ham_vrfy_structure(dbp, vdp, 0, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } break; case DB_QUEUE: if ((ret = CDB___qam_vrfy_structure(dbp, vdp, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; } /* * Queue pages may be unreferenced and totally zeroed, if * they're empty; queue doesn't have much structure, so * this is unlikely to be wrong in any troublesome sense. * Skip to "err". */ goto err; /* NOTREACHED */ default: /* This should only happen if the verifier is somehow broken. */ DB_ASSERT(0); ret = EINVAL; goto err; /* NOTREACHED */ } /* Walk free list. */ if ((ret = __db_vrfy_freelist(dbp, vdp, meta_pgno, flags)) == DB_VERIFY_BAD) isbad = 1; /* * If structure checks up until now have failed, it's likely that * checking what pages have been missed will result in oodles of * extraneous error messages being EPRINTed. Skip to the end * if this is the case; we're going to be printing at least one * error anyway, and probably all the more salient ones. */ if (ret != 0 || isbad == 1) goto err; /* * Make sure no page has been missed and that no page is still marked * "all zeroes" (only certain hash pages can be, and they're unmarked * in CDB___ham_vrfy_structure). */ for (i = 0; i < vdp->last_pgno + 1; i++) { if ((ret = CDB___db_vrfy_getpageinfo(vdp, i, &pip)) != 0) goto err; if ((ret = CDB___db_vrfy_pgset_get(pgset, i, &p)) != 0) goto err; if (p == 0) { EPRINT((dbp->dbenv, "Unreferenced page %lu", i)); /* isbad = 1; */ /* XXX: this is a db bug */ if (pip->type != P_LRECNO && pip->type != P_LDUP) isbad = 1; } if (F_ISSET(pip, VRFY_IS_ALLZEROES)) { EPRINT((dbp->dbenv, "Totally zeroed page %lu", i)); isbad = 1; } if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) goto err; pip = NULL; } err: if (pip != NULL) (void)CDB___db_vrfy_putpageinfo(vdp, pip); return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret); } /* * __db_is_valid_pagetype */ static int __db_is_valid_pagetype(type) u_int32_t type; { switch (type) { case P_INVALID: /* Order matches ordinal value. */ case P_HASH: case P_IBTREE: case P_IRECNO: case P_LBTREE: case P_LRECNO: case P_OVERFLOW: case P_HASHMETA: case P_BTREEMETA: case P_QAMMETA: case P_QAMDATA: case P_LDUP: return (1); } return (0); } /* * __db_is_valid_magicno */ static int __db_is_valid_magicno(magic, typep) u_int32_t magic; DBTYPE *typep; { switch (magic) { case DB_BTREEMAGIC: *typep = DB_BTREE; return (1); case DB_HASHMAGIC: *typep = DB_HASH; return (1); case DB_QAMMAGIC: *typep = DB_QUEUE; return (1); } *typep = DB_UNKNOWN; return (0); } /* * __db_vrfy_common -- * Verify info common to all page types. */ static int __db_vrfy_common(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int ret, t_ret; u_int8_t *p; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); pip->pgno = pgno; F_CLR(pip, VRFY_IS_ALLZEROES); /* * Hash expands the table by leaving some pages between the * old last and the new last totally zeroed. Its pgin function * should fix things, but we might not be using that (e.g. if * we're a subdatabase). */ if (pgno != 0 && PGNO(h) == 0) { for (p = (u_int8_t *)h; p < (u_int8_t *)h + dbp->pgsize; p++) if (*p != 0) { EPRINT((dbp->dbenv, "Hash page %lu should be zeroed and is not", pgno)); ret = DB_VERIFY_BAD; goto err; } /* * It's totally zeroed; mark it as a hash, and we'll * check that that makes sense structurally later. */ pip->type = P_HASH; F_SET(pip, VRFY_IS_ALLZEROES); ret = 0; goto err; /* well, not really an err. */ } if (PGNO(h) != pgno) { EPRINT((dbp->dbenv, "Bad page number: %lu should be %lu", h->pgno, pgno)); ret = DB_VERIFY_BAD; } if (!__db_is_valid_pagetype(h->type)) { EPRINT((dbp->dbenv, "Bad page type: %lu", h->type)); ret = DB_VERIFY_BAD; } pip->type = h->type; err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * __db_vrfy_invalid -- * Verify P_INVALID page. * (Yes, there's not much to do here.) */ static int __db_vrfy_invalid(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int ret, t_ret; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); pip->next_pgno = pip->prev_pgno = 0; if (!IS_VALID_PGNO(NEXT_PGNO(h))) { EPRINT((dbp->dbenv, "Invalid next_pgno %lu on page %lu", NEXT_PGNO(h), pgno)); ret = DB_VERIFY_BAD; } else pip->next_pgno = NEXT_PGNO(h); if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___db_vrfy_datapage -- * Verify elements common to data pages (P_HASH, P_LBTREE, * P_IBTREE, P_IRECNO, P_LRECNO, P_OVERFLOW, P_DUPLICATE)--i.e., * those defined in the PAGE structure. * * Called from each of the per-page routines, after the * all-page-type-common elements of pip have been verified and filled * in. * * PUBLIC: int CDB___db_vrfy_datapage * PUBLIC: __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, u_int32_t)); */ int CDB___db_vrfy_datapage(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int isbad, ret, t_ret; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); isbad = 0; /* * prev_pgno and next_pgno: store for inter-page checks, * verify that they point to actual pages and not to self. * * !!! * Internal btree pages do not maintain these fields (indeed, * they overload them). Skip. */ if (TYPE(h) != P_IBTREE && TYPE(h) != P_IRECNO) { if (!IS_VALID_PGNO(PREV_PGNO(h)) || PREV_PGNO(h) == pip->pgno) { isbad = 1; EPRINT((dbp->dbenv, "Page %lu: Invalid prev_pgno %lu", pip->pgno, PREV_PGNO(h))); } if (!IS_VALID_PGNO(NEXT_PGNO(h)) || NEXT_PGNO(h) == pip->pgno) { isbad = 1; EPRINT((dbp->dbenv, "Page %lu: Invalid next_pgno %lu", pip->pgno, NEXT_PGNO(h))); } pip->prev_pgno = PREV_PGNO(h); pip->next_pgno = NEXT_PGNO(h); } /* * Verify the number of entries on the page. * There is no good way to determine if this is accurate; the * best we can do is verify that it's not more than can, in theory, * fit on the page. Then, we make sure there are at least * this many valid elements in inp[], and hope that this catches * most cases. */ if (TYPE(h) != P_OVERFLOW) { if (BKEYDATA_PSIZE(0) * NUM_ENT(h) > dbp->pgsize) { isbad = 1; EPRINT((dbp->dbenv, "Page %lu: Too many entries: %lu", pgno, NUM_ENT(h))); } pip->entries = NUM_ENT(h); } /* * btree level. Should be zero unless we're a btree; * if we are a btree, should be between LEAFLEVEL and MAXBTREELEVEL, * and we need to save it off. */ switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: if (LEVEL(h) < LEAFLEVEL + 1 || LEVEL(h) > MAXBTREELEVEL) { isbad = 1; EPRINT((dbp->dbenv, "Bad btree level %lu on page %lu", LEVEL(h), pgno)); } pip->bt_level = LEVEL(h); break; case P_LBTREE: case P_LDUP: case P_LRECNO: if (LEVEL(h) != LEAFLEVEL) { isbad = 1; EPRINT((dbp->dbenv, "Btree leaf page %lu has incorrect level %lu", pgno, LEVEL(h))); } break; default: if (LEVEL(h) != 0) { isbad = 1; EPRINT((dbp->dbenv, "Nonzero level %lu in non-btree database page %lu", LEVEL(h), pgno)); } break; } /* * Even though inp[] occurs in all PAGEs, we look at it in the * access-method-specific code, since btree and hash treat * item lengths very differently, and one of the most important * things we want to verify is that the data--as specified * by offset and length--cover the right part of the page * without overlaps, gaps, or violations of the page boundary. */ if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___db_vrfy_meta-- * Verify the access-method common parts of a meta page, using * normal mpool routines. * * PUBLIC: int CDB___db_vrfy_meta * PUBLIC: __P((DB *, VRFY_DBINFO *, DBMETA *, db_pgno_t, u_int32_t)); */ int CDB___db_vrfy_meta(dbp, vdp, meta, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; DBMETA *meta; db_pgno_t pgno; u_int32_t flags; { DBTYPE dbtype, magtype; VRFY_PAGEINFO *pip; int isbad, ret, t_ret; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); /* type plausible for a meta page */ switch (meta->type) { case P_BTREEMETA: dbtype = DB_BTREE; break; case P_HASHMETA: dbtype = DB_HASH; break; case P_QAMMETA: dbtype = DB_QUEUE; break; default: /* The verifier should never let us get here. */ DB_ASSERT(0); ret = EINVAL; goto err; } /* magic number valid */ if (!__db_is_valid_magicno(meta->magic, &magtype)) { isbad = 1; EPRINT((dbp->dbenv, "Magic number invalid on page %lu", pgno)); } if (magtype != dbtype) { isbad = 1; EPRINT((dbp->dbenv, "Magic number does not match type of page %lu", pgno)); } /* version */ if ((dbtype == DB_BTREE && meta->version != DB_BTREEVERSION) || (dbtype == DB_HASH && meta->version != DB_HASHVERSION) || (dbtype == DB_QUEUE && meta->version != DB_QAMVERSION)) { isbad = 1; EPRINT((dbp->dbenv, "%s%s", "Old of incorrect DB ", "version; extraneous errors may result")); } /* pagesize */ if (meta->pagesize != dbp->pgsize) { isbad = 1; EPRINT((dbp->dbenv, "Invalid pagesize %lu on page %lu", meta->pagesize, pgno)); } /* free list */ /* Can correctly be PGNO_INVALID--that's just the end of the list. */ if (meta->free != PGNO_INVALID && IS_VALID_PGNO(meta->free)) pip->free = meta->free; else if (!IS_VALID_PGNO(meta->free)) { isbad = 1; EPRINT((dbp->dbenv, "Nonsensical free list pgno %lu on page %lu", meta->free, pgno)); } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * __db_vrfy_freelist -- * Walk free list, checking off pages and verifying absence of * loops. */ static int __db_vrfy_freelist(dbp, vdp, meta, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t meta; u_int32_t flags; { DB *pgset; VRFY_PAGEINFO *pip; db_pgno_t pgno; int p, ret, t_ret; pgset = vdp->pgset; DB_ASSERT(pgset != NULL); if ((ret = CDB___db_vrfy_getpageinfo(vdp, meta, &pip)) != 0) return (ret); for (pgno = pip->free; pgno != PGNO_INVALID; pgno = pip->next_pgno) { if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) return (ret); /* This shouldn't happen, but just in case. */ if (!IS_VALID_PGNO(pgno)) { EPRINT((dbp->dbenv, "Invalid next_pgno on free list page %lu", pgno)); return (DB_VERIFY_BAD); } /* Detect cycles. */ if ((ret = CDB___db_vrfy_pgset_get(pgset, pgno, &p)) != 0) return (ret); if (p != 0) { EPRINT((dbp->dbenv, "Page %lu encountered a second time on free list", pgno)); return (DB_VERIFY_BAD); } if ((ret = CDB___db_vrfy_pgset_inc(pgset, pgno)) != 0) return (ret); if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); if (pip->type != P_INVALID) { EPRINT((dbp->dbenv, "Non-invalid page %lu on free list", pgno, pip->type)); ret = DB_VERIFY_BAD; /* unsafe to continue */ break; } } if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) ret = t_ret; return (ret); } /* * __db_vrfy_subdbs -- * Walk the known-safe master database of subdbs with a cursor, * verifying the structure of each subdatabase we encounter. */ static int __db_vrfy_subdbs(dbp, vdp, dbname, flags) DB *dbp; VRFY_DBINFO *vdp; char *dbname; u_int32_t flags; { DB *mdbp; DBC *dbc; DBT key, data; VRFY_PAGEINFO *pip; db_pgno_t meta_pgno; int ret, t_ret, isbad; u_int8_t type; isbad = 0; dbc = NULL; if ((ret = CDB___db_master_open(dbp, dbname, DB_RDONLY, 0, &mdbp)) != 0) return (ret); if ((ret = CDB___db_icursor(mdbp, NULL, DB_BTREE, PGNO_INVALID, 0, &dbc)) != 0) goto err; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while ((ret = dbc->c_get(dbc, &key, &data, DB_NEXT)) == 0) { if (data.size != sizeof(db_pgno_t)) { EPRINT((dbp->dbenv, "Database entry of invalid size")); isbad = 1; goto err; } memcpy(&meta_pgno, data.data, data.size); /* * Subdatabase meta pgnos are stored in network byte * order for cross-endian compatibility. Swap if appropriate. */ DB_NTOHL(&meta_pgno); if (meta_pgno == PGNO_INVALID || meta_pgno > vdp->last_pgno) { EPRINT((dbp->dbenv, "Database entry references invalid page %lu", meta_pgno)); isbad = 1; goto err; } if ((ret = CDB___db_vrfy_getpageinfo(vdp, meta_pgno, &pip)) != 0) goto err; type = pip->type; if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) goto err; switch (type) { case P_BTREEMETA: if ((ret = CDB___bam_vrfy_structure( dbp, vdp, meta_pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } break; case P_HASHMETA: if ((ret = CDB___ham_vrfy_structure( dbp, vdp, meta_pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } break; case P_QAMMETA: default: EPRINT((dbp->dbenv, "Database entry references page %lu of invalid type %lu", meta_pgno, type)); ret = DB_VERIFY_BAD; goto err; /* NOTREACHED */ } } if (ret == DB_NOTFOUND) ret = 0; err: if (dbc != NULL && (t_ret = CDB___db_c_close(dbc)) != 0 && ret == 0) ret = t_ret; if ((t_ret = mdbp->close(mdbp, 0)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * __db_vrfy_orderchkonly -- * Do an sort-order/hashing check on a known-otherwise-good subdb. */ static int __db_vrfy_orderchkonly(dbp, vdp, name, subdb, flags) DB *dbp; VRFY_DBINFO *vdp; const char *name, *subdb; u_int32_t flags; { BTMETA *btmeta; DB *mdbp, *pgset; DBC *pgsc; DBT key, data; HASH *h_internal; HMETA *hmeta; PAGE *h, *currpg; db_pgno_t meta_pgno, p, pgno; u_int32_t bucket; int t_ret, ret; currpg = h = NULL; pgsc = NULL; pgset = NULL; LF_CLR(DB_NOORDERCHK); /* Open the master database and get the meta_pgno for the subdb. */ if ((ret = CDB_db_create(&mdbp, NULL, 0)) != 0) return (ret); if ((ret = CDB___db_master_open(dbp, name, DB_RDONLY, 0, &mdbp)) != 0) goto err; memset(&key, 0, sizeof(key)); key.data = (void *)subdb; memset(&data, 0, sizeof(data)); if ((ret = dbp->get(dbp, NULL, &key, &data, 0)) != 0) goto err; if (data.size != sizeof(db_pgno_t)) { EPRINT((dbp->dbenv, "Database entry of invalid size")); ret = DB_VERIFY_BAD; goto err; } memcpy(&meta_pgno, data.data, data.size); if ((ret = CDB_memp_fget(dbp->mpf, &meta_pgno, 0, &h)) != 0) goto err; if ((ret = CDB___db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0) goto err; switch (TYPE(h)) { case P_BTREEMETA: btmeta = (BTMETA *)h; if (F_ISSET(&btmeta->dbmeta, BTM_RECNO)) { /* Recnos have no order to check. */ ret = 0; goto err; } if ((ret = __db_meta2pgset(dbp, vdp, meta_pgno, flags, pgset)) != 0) goto err; if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = CDB___db_vrfy_pgset_next(pgsc, &p)) == 0) { if ((ret = CDB_memp_fget(dbp->mpf, &p, 0, &currpg)) != 0) goto err; if ((ret = CDB___bam_vrfy_itemorder(dbp, NULL, currpg, p, NUM_ENT(currpg), 1, F_ISSET(&btmeta->dbmeta, BTM_DUP), flags)) != 0) goto err; if ((ret = CDB_memp_fput(dbp->mpf, currpg, 0)) != 0) goto err; currpg = NULL; } if ((ret = pgsc->c_close(pgsc)) != 0) goto err; break; case P_HASHMETA: hmeta = (HMETA *)h; h_internal = (HASH *)dbp->h_internal; /* * Make sure h_charkey is right. */ if (h_internal == NULL || h_internal->h_hash == NULL) { EPRINT((dbp->dbenv, "DB_ORDERCHKONLY requires that a hash function be set")); ret = DB_VERIFY_BAD; goto err; } if (hmeta->h_charkey != h_internal->h_hash(CHARKEY, sizeof(CHARKEY))) { EPRINT((dbp->dbenv, "Incorrect hash function for database")); ret = DB_VERIFY_BAD; goto err; } /* * Foreach bucket, verify hashing on each page in the * corresponding chain of pages. */ for (bucket = 0; bucket <= hmeta->max_bucket; bucket++) { pgno = hmeta->spares[CDB___db_log2(bucket + 1)]; while (pgno != PGNO_INVALID) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &currpg)) != 0) goto err; if ((ret = CDB___ham_vrfy_hashing(dbp, NUM_ENT(currpg),hmeta, bucket, pgno, flags, h_internal->h_hash)) != 0) goto err; pgno = NEXT_PGNO(currpg); if ((ret = CDB_memp_fput(dbp->mpf, currpg, 0)) != 0) goto err; currpg = NULL; } } break; default: EPRINT((dbp->dbenv, "Database meta page %lu of bad type %lu", meta_pgno, TYPE(h))); ret = DB_VERIFY_BAD; break; } err: if (pgsc != NULL) (void)pgsc->c_close(pgsc); if (pgset != NULL) (void)pgset->close(pgset, 0); if (h != NULL && (t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) ret = t_ret; if (currpg != NULL && (t_ret = CDB_memp_fput(dbp->mpf, currpg, 0)) != 0) ret = t_ret; if ((t_ret = mdbp->close(mdbp, 0)) != 0) ret = t_ret; return (ret); } /* * CDB___db_salvage -- * Walk through a page, salvaging all likely or plausible (w/ * DB_AGGRESSIVE) key/data pairs. * * PUBLIC: int CDB___db_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, * PUBLIC: void *, int (*)(void *, const void *), u_int32_t)); */ int CDB___db_salvage(dbp, vdp, pgno, h, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; PAGE *h; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { DB_ASSERT(LF_ISSET(DB_SALVAGE)); /* If we got this page in the subdb pass, we can safely skip it. */ if (CDB___db_salvage_isdone(vdp, pgno)) return (0); switch (TYPE(h)) { case P_HASH: return (CDB___ham_salvage(dbp, vdp, pgno, h, handle, callback, flags)); /* NOTREACHED */ case P_LBTREE: return (CDB___bam_salvage(dbp, vdp, pgno, P_LBTREE, h, handle, callback, NULL, flags)); /* NOTREACHED */ case P_LDUP: return (CDB___db_salvage_markneeded(vdp, pgno, SALVAGE_LDUP)); /* NOTREACHED */ case P_OVERFLOW: return (CDB___db_salvage_markneeded(vdp, pgno, SALVAGE_OVERFLOW)); /* NOTREACHED */ case P_LRECNO: /* * Recnos are tricky -- they may represent dup pages, or * they may be subdatabase/regular database pages in their * own right. If the former, they need to be printed with a * key, preferably when we hit the corresponding datum in * a btree/hash page. If the latter, there is no key. * * If a database is sufficiently frotzed, we're not going * to be able to get this right, so we best-guess: just * mark it needed now, and if we're really a normal recno * database page, the "unknowns" pass will pick us up. */ return (CDB___db_salvage_markneeded(vdp, pgno, SALVAGE_LRECNO)); /* NOTREACHED */ case P_IBTREE: case P_INVALID: case P_IRECNO: case __P_DUPLICATE: default: /* XXX: Should we be more aggressive here? */ break; } return (0); } /* * __db_salvage_unknowns -- * Walk through the salvager database, printing with key "UNKNOWN" * any pages we haven't dealt with. */ static int __db_salvage_unknowns(dbp, vdp, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { DBT unkdbt, key, *dbt; PAGE *h; db_pgno_t pgno; u_int32_t pgtype; int ret, err_ret; void *ovflbuf; memset(&unkdbt, 0, sizeof(DBT)); unkdbt.size = strlen("UNKNOWN") + 1; unkdbt.data = "UNKNOWN"; if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, 0, &ovflbuf)) != 0) return (ret); err_ret = 0; while ((ret = CDB___db_salvage_getnext(vdp, &pgno, &pgtype)) == 0) { dbt = NULL; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) { err_ret = ret; continue; } switch (pgtype) { case SALVAGE_LDUP: case SALVAGE_LRECNODUP: dbt = &unkdbt; /* FALLTHROUGH */ case SALVAGE_LBTREE: case SALVAGE_LRECNO: if ((ret = CDB___bam_salvage(dbp, vdp, pgno, pgtype, h, handle, callback, dbt, flags)) != 0) err_ret = ret; break; case SALVAGE_OVERFLOW: /* * XXX: * This may generate multiple "UNKNOWN" keys in * a database with no dups. What to do? */ if ((ret = CDB___db_safe_goff(dbp, vdp, pgno, &key, &ovflbuf, flags)) != 0) { err_ret = ret; continue; } if ((ret = CDB___db_prdbt(&key, 0, " ", handle, callback, 0, NULL)) != 0) { err_ret = ret; continue; } if ((ret = CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; case SALVAGE_HASH: if ((ret = CDB___ham_salvage( dbp, vdp, pgno, h, handle, callback, flags)) != 0) err_ret = ret; break; case SALVAGE_INVALID: case SALVAGE_IGNORE: default: /* * Shouldn't happen, but if it does, just do what the * nice man says. */ DB_ASSERT(0); break; } if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) err_ret = ret; } CDB___os_free(ovflbuf, 0); if (err_ret != 0 && ret == 0) ret = err_ret; return (ret == DB_NOTFOUND ? 0 : ret); } /* * Offset of the ith inp array entry, which we can compare to the offset * the entry stores. */ #define INP_OFFSET(h, i) \ ((db_indx_t)((u_int8_t *)(h)->inp + (i) - (u_int8_t *)(h))) /* * CDB___db_vrfy_inpitem -- * Verify that a single entry in the inp array is sane, and update * the high water mark and current item offset. (The former of these is * used for state information between calls, and is required; it must * be initialized to the pagesize before the first call.) * * Returns DB_VERIFY_FATAL if inp has collided with the data, * since verification can't continue from there; returns DB_VERIFY_BAD * if anything else is wrong. * * PUBLIC: int CDB___db_vrfy_inpitem __P((DB *, PAGE *, * PUBLIC: db_pgno_t, u_int32_t, int, u_int32_t, u_int32_t *, u_int32_t *)); */ int CDB___db_vrfy_inpitem(dbp, h, pgno, i, is_btree, flags, himarkp, offsetp) DB *dbp; PAGE *h; db_pgno_t pgno; u_int32_t i; int is_btree; u_int32_t flags, *himarkp, *offsetp; { BKEYDATA *bk; db_indx_t offset, len; DB_ASSERT(himarkp != NULL); /* * Check that the inp array, which grows from the beginning of the * page forward, has not collided with the data, which grow from the * end of the page backward. */ if ((u_int8_t *)h->inp + i >= (u_int8_t *)h + *himarkp) { /* We've collided with the data. We need to bail. */ EPRINT((dbp->dbenv, "Page %lu entries listing %lu overlaps data", pgno, i)); return (DB_VERIFY_FATAL); } offset = h->inp[i]; /* * Check that the item offset is reasonable: it points somewhere * after the inp array and before the end of the page. */ if (offset <= INP_OFFSET(h, i) || offset > dbp->pgsize) { EPRINT((dbp->dbenv, "Bad offset %lu at page %lu index %lu", offset, pgno, i)); return (DB_VERIFY_BAD); } /* Update the high-water mark (what HOFFSET should be) */ if (offset < *himarkp) *himarkp = offset; if (is_btree) { /* * Check that the item length remains on-page. */ bk = GET_BKEYDATA(h, i); len = B_TYPE(bk->type) == B_KEYDATA ? bk->len : BOVERFLOW_SIZE; if ((size_t)(offset + len) > dbp->pgsize) { EPRINT((dbp->dbenv, "Item %lu on page %lu extends past page boundary", i, pgno)); return (DB_VERIFY_BAD); } } if (offsetp != NULL) *offsetp = offset; return (0); } /* * CDB___db_vrfy_duptype-- * Given a page number and a set of flags to CDB___bam_vrfy_subtree, * verify that the dup tree type is correct--i.e., it's a recno * if DUPSORT is not set and a btree if it is. * * PUBLIC: int CDB___db_vrfy_duptype * PUBLIC: __P((DB *, VRFY_DBINFO *, db_pgno_t, u_int32_t)); */ int CDB___db_vrfy_duptype(dbp, vdp, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int ret, isbad; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); switch (pip->type) { case P_IBTREE: case P_LDUP: if (!LF_ISSET(ST_DUPSORT)) { EPRINT((dbp->dbenv, "Sorted duplicate set at page %lu in unsorted-dup database", pgno)); isbad = 1; } break; case P_IRECNO: case P_LRECNO: if (LF_ISSET(ST_DUPSORT)) { EPRINT((dbp->dbenv, "Unsorted duplicate set at page %lu in sorted-dup database", pgno)); isbad = 1; } break; default: EPRINT((dbp->dbenv, "Duplicate page %lu of inappropriate type %lu", pgno, pip->type)); isbad = 1; break; } if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) return (ret); return (isbad == 1 ? DB_VERIFY_BAD : 0); } /* * CDB___db_salvage_duptree -- * Attempt to salvage a given duplicate tree, given its alleged root. * * The key that corresponds to this dup set has been passed to us * in DBT *key. Because data items follow keys, though, it has been * printed once already. * * The basic idea here is that pgno ought to be a P_LDUP, a P_LRECNO, a * P_IBTREE, or a P_IRECNO. If it's an internal page, use the verifier * functions to make sure it's safe; if it's not, we simply bail and the * data will have to be printed with no key later on. if it is safe, * recurse on each of its children. * * Whether or not it's safe, if it's a leaf page, CDB___bam_salvage it. * * At all times, use the DB hanging off vdp to mark and check what we've * done, so each page gets printed exactly once and we don't get caught * in any cycles. * * PUBLIC: int CDB___db_salvage_duptree __P((DB *, VRFY_DBINFO *, db_pgno_t, * PUBLIC: DBT *, void *, int (*)(void *, const void *), u_int32_t)); */ int CDB___db_salvage_duptree(dbp, vdp, pgno, key, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; DBT *key; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { PAGE *h; int ret, t_ret; if (pgno == PGNO_INVALID || !IS_VALID_PGNO(pgno)) return (DB_VERIFY_BAD); /* We have a plausible page. Try it. */ if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); switch (TYPE(h)) { case P_IBTREE: case P_IRECNO: if ((ret = __db_vrfy_common(dbp, vdp, h, pgno, flags)) != 0) goto err; if ((ret = CDB___bam_vrfy(dbp, vdp, h, pgno, flags | DB_NOORDERCHK)) != 0 || (ret = CDB___db_salvage_markdone(vdp, pgno)) != 0) goto err; /* * We have a known-healthy internal page. Walk it. */ if ((ret = CDB___bam_salvage_walkdupint(dbp, vdp, h, key, handle, callback, flags)) != 0) goto err; break; case P_LRECNO: case P_LDUP: if ((ret = CDB___bam_salvage(dbp, vdp, pgno, TYPE(h), h, handle, callback, key, flags)) != 0) goto err; break; default: ret = DB_VERIFY_BAD; goto err; /* NOTREACHED */ } err: if ((t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * __db_salvage_subdbs -- * Check and see if this database has subdbs; if so, try to salvage * them independently. */ static int __db_salvage_subdbs(dbp, vdp, handle, callback, flags, hassubsp) DB *dbp; VRFY_DBINFO *vdp; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; int *hassubsp; { BTMETA *btmeta; DB *pgset; DBC *pgsc; PAGE *h; db_pgno_t p, meta_pgno; int ret, err_ret; err_ret = 0; pgsc = NULL; pgset = NULL; meta_pgno = PGNO_BASE_MD; if ((ret = CDB_memp_fget(dbp->mpf, &meta_pgno, 0, &h)) != 0) return (ret); if (TYPE(h) == P_BTREEMETA) btmeta = (BTMETA *)h; else { /* Not a btree metadata, ergo no subdbs, so just return. */ ret = 0; goto err; } /* If it's not a safe page, bail on the attempt. */ if ((ret = __db_vrfy_common(dbp, vdp, h, PGNO_BASE_MD, flags)) != 0 || (ret = CDB___bam_vrfy_meta(dbp, vdp, btmeta, PGNO_BASE_MD, flags)) != 0) goto err; if (!F_ISSET(&btmeta->dbmeta, BTM_SUBDB)) { /* No subdbs, just return. */ ret = 0; goto err; } /* We think we've got subdbs. Mark it so. */ *hassubsp = 1; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); /* * We have subdbs. Try to crack them. * * To do so, get a set of leaf pages in the master * database, and then walk each of the valid ones, salvaging * subdbs as we go. If any prove invalid, just drop them; we'll * pick them up on a later pass. */ if ((ret = CDB___db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0) return (ret); if ((ret = __db_meta2pgset(dbp, vdp, PGNO_BASE_MD, flags, pgset)) != 0) goto err; if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = CDB___db_vrfy_pgset_next(pgsc, &p)) == 0) { if ((ret = CDB_memp_fget(dbp->mpf, &p, 0, &h)) != 0) { err_ret = ret; continue; } if ((ret = __db_vrfy_common(dbp, vdp, h, p, flags)) != 0 || (ret = CDB___bam_vrfy(dbp, vdp, h, p, flags | DB_NOORDERCHK)) != 0) goto nextpg; if (TYPE(h) != P_LBTREE) goto nextpg; else if ((ret = CDB___db_salvage_subdbpg( dbp, vdp, h, handle, callback, flags)) != 0) err_ret = ret; nextpg: if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) err_ret = ret; } if (ret != DB_NOTFOUND) goto err; if ((ret = pgsc->c_close(pgsc)) != 0) goto err; ret = pgset->close(pgset, 0); return ((ret == 0 && err_ret != 0) ? err_ret : ret); /* NOTREACHED */ err: if (pgsc != NULL) (void)pgsc->c_close(pgsc); if (pgset != NULL) (void)pgset->close(pgset, 0); (void)CDB_memp_fput(dbp->mpf, h, 0); return (ret); } /* * CDB___db_salvage_subdbpg -- * Given a known-good leaf page in the master database, salvage all * leaf pages corresponding to each subdb. * * PUBLIC: int CDB___db_salvage_subdbpg * PUBLIC: __P((DB *, VRFY_DBINFO *, PAGE *, void *, * PUBLIC: int (*)(void *, const void *), u_int32_t)); */ int CDB___db_salvage_subdbpg(dbp, vdp, master, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *master; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { BKEYDATA *bkkey, *bkdata; BOVERFLOW *bo; DB *pgset; DBC *pgsc; DBT key; PAGE *subpg; db_indx_t i; db_pgno_t meta_pgno, p; int ret, err_ret, t_ret; char *subdbname; ret = err_ret = 0; subdbname = NULL; if ((ret = CDB___db_vrfy_pgset(dbp->dbenv, dbp->pgsize, &pgset)) != 0) return (ret); /* * For each entry, get and salvage the set of pages * corresponding to that entry. */ for (i = 0; i < NUM_ENT(master); i += P_INDX) { bkkey = GET_BKEYDATA(master, i); bkdata = GET_BKEYDATA(master, i + O_INDX); /* Get the subdatabase name. */ if (B_TYPE(bkkey->type) == B_OVERFLOW) { /* * We can, in principle anyway, have a subdb * name so long it overflows. Ick. */ bo = (BOVERFLOW *)bkkey; if ((ret = CDB___db_safe_goff(dbp, vdp, bo->pgno, &key, (void **)&subdbname, flags)) != 0) { err_ret = DB_VERIFY_BAD; continue; } /* Nul-terminate it. */ if ((ret = CDB___os_realloc(dbp->dbenv, key.size + 1, NULL, &subdbname)) != 0) goto err; subdbname[key.size] = '\0'; } else if (B_TYPE(bkkey->type == B_KEYDATA)) { if ((ret = CDB___os_realloc(dbp->dbenv, bkkey->len + 1, NULL, &subdbname)) != 0) goto err; memcpy(subdbname, bkkey->data, bkkey->len); subdbname[bkkey->len] = '\0'; } /* Get the corresponding pgno. */ if (bkdata->len != sizeof(db_pgno_t)) { err_ret = DB_VERIFY_BAD; continue; } memcpy(&meta_pgno, bkdata->data, sizeof(db_pgno_t)); /* If we can't get the subdb meta page, just skip the subdb. */ if (!IS_VALID_PGNO(meta_pgno) || (ret = CDB_memp_fget(dbp->mpf, &meta_pgno, 0, &subpg)) != 0) { err_ret = ret; continue; } /* * Verify the subdatabase meta page. This has two functions. * First, if it's bad, we have no choice but to skip the subdb * and let the pages just get printed on a later pass. Second, * the access-method-specific meta verification routines record * the various state info (such as the presence of dups) * that we need for CDB___db_prheader(). */ if ((ret = __db_vrfy_common(dbp, vdp, subpg, meta_pgno, flags)) != 0) { err_ret = ret; (void)CDB_memp_fput(dbp->mpf, subpg, 0); continue; } switch (TYPE(subpg)) { case P_BTREEMETA: if ((ret = CDB___bam_vrfy_meta(dbp, vdp, (BTMETA *)subpg, meta_pgno, flags)) != 0) { err_ret = ret; (void)CDB_memp_fput(dbp->mpf, subpg, 0); continue; } break; case P_HASHMETA: if ((ret = CDB___ham_vrfy_meta(dbp, vdp, (HMETA *)subpg, meta_pgno, flags)) != 0) { err_ret = ret; (void)CDB_memp_fput(dbp->mpf, subpg, 0); continue; } break; default: /* This isn't an appropriate page; skip this subdb. */ err_ret = DB_VERIFY_BAD; continue; /* NOTREACHED */ } if ((ret = CDB_memp_fput(dbp->mpf, subpg, 0)) != 0) { err_ret = ret; continue; } /* Print a subdatabase header. */ if ((ret = CDB___db_prheader(dbp, subdbname, 0, 0, handle, callback, vdp, meta_pgno)) != 0) goto err; if ((ret = __db_meta2pgset(dbp, vdp, meta_pgno, flags, pgset)) != 0) { err_ret = ret; continue; } if ((ret = pgset->cursor(pgset, NULL, &pgsc, 0)) != 0) goto err; while ((ret = CDB___db_vrfy_pgset_next(pgsc, &p)) == 0) { if ((ret = CDB_memp_fget(dbp->mpf, &p, 0, &subpg)) != 0) { err_ret = ret; continue; } if ((ret = CDB___db_salvage(dbp, vdp, p, subpg, handle, callback, flags)) != 0) err_ret = ret; if ((ret = CDB_memp_fput(dbp->mpf, subpg, 0)) != 0) err_ret = ret; } if (ret != DB_NOTFOUND) goto err; if ((ret = pgsc->c_close(pgsc)) != 0) goto err; if ((ret = CDB___db_prfooter(handle, callback)) != 0) goto err; } err: if (subdbname) CDB___os_free(subdbname, 0); if ((t_ret = pgset->close(pgset, 0)) != 0) ret = t_ret; if ((t_ret = CDB___db_salvage_markdone(vdp, PGNO(master))) != 0) return (t_ret); return ((err_ret != 0) ? err_ret : ret); } /* * __db_meta2pgset -- * Given a known-safe meta page number, return the set of pages * corresponding to the database it represents. Return DB_VERIFY_BAD if * it's not a suitable meta page or is invalid. */ static int __db_meta2pgset(dbp, vdp, pgno, flags, pgset) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; u_int32_t flags; DB *pgset; { PAGE *h; int ret, t_ret; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); switch (TYPE(h)) { case P_BTREEMETA: ret = CDB___bam_meta2pgset(dbp, vdp, (BTMETA *)h, flags, pgset); break; case P_HASHMETA: ret = CDB___ham_meta2pgset(dbp, vdp, (HMETA *)h, flags, pgset); break; default: ret = DB_VERIFY_BAD; break; } if ((t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (t_ret); return (ret); } /* * __db_guesspgsize -- * Try to guess what the pagesize is if the one on the meta page * and the one in the db are invalid. */ static int __db_guesspgsize(dbenv, fhp) DB_ENV *dbenv; DB_FH *fhp; { db_pgno_t i; size_t nr; u_int32_t guess; u_int8_t type; int ret; for (guess = DB_MAX_PGSIZE; guess >= DB_MIN_PGSIZE; guess >>= 1) { /* * We try to read three pages ahead after the first one * and make sure we have plausible types for all of them. * If the seeks fail, continue with a smaller size; * we're probably just looking past the end of the database. * If they succeed but the types are wrong, also continue * with a size smaller; we may be looking at pages N, * 2N, and 3N for some N > 1. * * As soon as we hit an invalid type, we stop and return * our best guess; the last one was probably the page size. */ for (i = 1; i <= 3; i++) { if ((ret = CDB___os_seek(dbenv, fhp, guess, i, SSZ(DBMETA, type), 0, DB_OS_SEEK_SET)) != 0) break; if ((ret = CDB___os_read(dbenv, fhp, &type, 1, &nr)) != 0 || nr == 0) break; if (type == P_INVALID || type >= P_PAGETYPE_MAX) break; } } return (guess); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_vrfyutil.c����������������������������������������������������������������������0100644�0063146�0012731�00000043171�07427026535�015465� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000 * Sleepycat Software. All rights reserved. * * $Id: db_vrfyutil.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: db_vrfyutil.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_verify.h" #include "db_ext.h" static int __db_vrfy_pgset_iinc __P((DB *, db_pgno_t, int)); /* * CDB___db_vrfy_dbinfo_create -- * Allocate and initialize a VRFY_DBINFO structure. * * PUBLIC: int CDB___db_vrfy_dbinfo_create * PUBLIC: __P((DB_ENV *, u_int32_t, VRFY_DBINFO **)); */ int CDB___db_vrfy_dbinfo_create (dbenv, pgsize, vdpp) DB_ENV *dbenv; u_int32_t pgsize; VRFY_DBINFO **vdpp; { DB *cdbp, *pgdbp, *pgset; VRFY_DBINFO *vdp; int ret; vdp = NULL; cdbp = pgdbp = pgset = NULL; if ((ret = CDB___os_calloc(NULL, 1, sizeof(VRFY_DBINFO), (void **)&vdp)) != 0) goto err; if ((ret = CDB_db_create(&cdbp, dbenv, 0)) != 0) goto err; if ((ret = cdbp->set_flags(cdbp, DB_DUP | DB_DUPSORT)) != 0) goto err; if ((ret = cdbp->set_pagesize(cdbp, pgsize)) != 0) goto err; if ((ret = cdbp->open(cdbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) goto err; if ((ret = CDB_db_create(&pgdbp, dbenv, 0)) != 0) goto err; if ((ret = pgdbp->set_pagesize(pgdbp, pgsize)) != 0) goto err; if ((ret = pgdbp->open(pgdbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) != 0) goto err; if ((ret = CDB___db_vrfy_pgset(dbenv, pgsize, &pgset)) != 0) goto err; LIST_INIT(&vdp->subdbs); LIST_INIT(&vdp->activepips); vdp->cdbp = cdbp; vdp->pgdbp = pgdbp; vdp->pgset = pgset; *vdpp = vdp; return (0); err: if (cdbp != NULL) (void)cdbp->close(cdbp, 0); if (pgdbp != NULL) (void)pgdbp->close(pgdbp, 0); if (vdp != NULL) CDB___os_free(vdp, sizeof(VRFY_DBINFO)); return (ret); } /* * CDB___db_vrfy_dbinfo_destroy -- * Destructor for VRFY_DBINFO. Destroys VRFY_PAGEINFOs and deallocates * structure. * * PUBLIC: int CDB___db_vrfy_dbinfo_destroy __P((VRFY_DBINFO *)); */ int CDB___db_vrfy_dbinfo_destroy(vdp) VRFY_DBINFO *vdp; { VRFY_CHILDINFO *c, *d; int t_ret, ret; ret = 0; for (c = LIST_FIRST(&vdp->subdbs); c != NULL; c = d) { d = LIST_NEXT(c, links); CDB___os_free(c, 0); } if ((t_ret = vdp->pgdbp->close(vdp->pgdbp, 0)) != 0) ret = t_ret; if ((t_ret = vdp->cdbp->close(vdp->cdbp, 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = vdp->pgset->close(vdp->pgset, 0)) != 0 && ret == 0) ret = t_ret; DB_ASSERT(LIST_FIRST(&vdp->activepips) == NULL); CDB___os_free(vdp, sizeof(VRFY_DBINFO)); return (ret); } /* * CDB___db_vrfy_getpageinfo -- * Get a PAGEINFO structure for a given page, creating it if necessary. * * PUBLIC: int CDB___db_vrfy_getpageinfo * PUBLIC: __P((VRFY_DBINFO *, db_pgno_t, VRFY_PAGEINFO **)); */ int CDB___db_vrfy_getpageinfo(vdp, pgno, pipp) VRFY_DBINFO *vdp; db_pgno_t pgno; VRFY_PAGEINFO **pipp; { DBT key, data; DB *pgdbp; VRFY_PAGEINFO *pip; int ret; /* * We want a page info struct. There are three places to get it from, * in decreasing order of preference: * * 1. vdp->activepips. If it's already "checked out", we're * already using it, we return the same exact structure with a * bumped refcount. This is necessary because this code is * replacing array accesses, and it's common for f() to make some * changes to a pip, and then call g() and h() which each make * changes to the same pip. vdps are never shared between threads * (they're never returned to the application), so this is safe. * 2. The pgdbp. It's not in memory, but it's in the database, so * get it, give it a refcount of 1, and stick it on activepips. * 3. malloc. It doesn't exist yet; create it, then stick it on * activepips. We'll put it in the database when we putpageinfo * later. */ /* Case 1. */ for (pip = LIST_FIRST(&vdp->activepips); pip != NULL; pip = LIST_NEXT(pip, links)) if (pip->pgno == pgno) /* Found it. */ goto found; /* Case 2. */ pgdbp = vdp->pgdbp; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); F_SET(&data, DB_DBT_MALLOC); key.data = &pgno; key.size = sizeof(db_pgno_t); if ((ret = pgdbp->get(pgdbp, NULL, &key, &data, 0)) == 0) { /* Found it. */ DB_ASSERT(data.size = sizeof(VRFY_PAGEINFO)); pip = data.data; DB_ASSERT(pip->pi_refcount == 0); LIST_INSERT_HEAD(&vdp->activepips, pip, links); goto found; } else if (ret != DB_NOTFOUND) /* Something nasty happened. */ return (ret); /* Case 3 */ if ((ret = CDB___db_vrfy_pageinfo_create(&pip)) != 0) return (ret); LIST_INSERT_HEAD(&vdp->activepips, pip, links); found: pip->pi_refcount++; *pipp = pip; DB_ASSERT(pip->pi_refcount > 0); return (0); } /* * CDB___db_vrfy_putpageinfo -- * Put back a VRFY_PAGEINFO that we're done with. * * PUBLIC: int CDB___db_vrfy_putpageinfo __P((VRFY_DBINFO *, VRFY_PAGEINFO *)); */ int CDB___db_vrfy_putpageinfo(vdp, pip) VRFY_DBINFO *vdp; VRFY_PAGEINFO *pip; { DBT key, data; DB *pgdbp; VRFY_PAGEINFO *p; int ret; #ifdef DIAGNOSTIC int found; found = 0; #endif if (--pip->pi_refcount > 0) return (0); pgdbp = vdp->pgdbp; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); key.data = &pip->pgno; key.size = sizeof(db_pgno_t); data.data = pip; data.size = sizeof(VRFY_PAGEINFO); if ((ret = pgdbp->put(pgdbp, NULL, &key, &data, 0)) != 0) return (ret); for (p = LIST_FIRST(&vdp->activepips); p != NULL; p = LIST_NEXT(p, links)) if (p == pip) { #ifdef DIAGNOSTIC found++; #endif DB_ASSERT(p->pi_refcount == 0); LIST_REMOVE(p, links); break; } #ifdef DIAGNOSTIC DB_ASSERT(found == 1); #endif DB_ASSERT(pip->pi_refcount == 0); CDB___os_free(pip, 0); return (0); } /* * CDB___db_vrfy_pgset -- * Create a temporary database for the storing of sets of page numbers. * (A mapping from page number to int, used by the *_meta2pgset functions, * as well as for keeping track of which pages the verifier has seen.) * * PUBLIC: int CDB___db_vrfy_pgset __P((DB_ENV *, u_int32_t, DB **)); */ int CDB___db_vrfy_pgset(dbenv, pgsize, dbpp) DB_ENV *dbenv; u_int32_t pgsize; DB **dbpp; { DB *dbp; int ret; if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) return (ret); if ((ret = dbp->set_pagesize(dbp, pgsize)) != 0) goto err; if ((ret = dbp->open(dbp, NULL, NULL, DB_BTREE, DB_CREATE, 0600)) == 0) *dbpp = dbp; else err: (void)dbp->close(dbp, 0); return (ret); } /* * CDB___db_vrfy_pgset_get -- * Get the value associated in a page set with a given pgno. Return * a 0 value (and succeed) if we've never heard of this page. * * PUBLIC: int CDB___db_vrfy_pgset_get __P((DB *, db_pgno_t, int *)); */ int CDB___db_vrfy_pgset_get(dbp, pgno, valp) DB *dbp; db_pgno_t pgno; int *valp; { DBT key, data; int ret, val; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); key.data = &pgno; key.size = sizeof(db_pgno_t); data.data = &val; data.ulen = sizeof(int); F_SET(&data, DB_DBT_USERMEM); if ((ret = dbp->get(dbp, NULL, &key, &data, 0)) == 0) { DB_ASSERT(data.size = sizeof(int)); memcpy(&val, data.data, sizeof(int)); } else if (ret == DB_NOTFOUND) val = 0; else return (ret); *valp = val; return (0); } /* * CDB___db_vrfy_pgset_inc -- * Increment the value associated with a pgno by 1. * * PUBLIC: int CDB___db_vrfy_pgset_inc __P((DB *, db_pgno_t)); */ int CDB___db_vrfy_pgset_inc(dbp, pgno) DB *dbp; db_pgno_t pgno; { return (__db_vrfy_pgset_iinc(dbp, pgno, 1)); } /* * CDB___db_vrfy_pgset_dec -- * Increment the value associated with a pgno by 1. * * PUBLIC: int CDB___db_vrfy_pgset_dec __P((DB *, db_pgno_t)); */ int CDB___db_vrfy_pgset_dec(dbp, pgno) DB *dbp; db_pgno_t pgno; { return (__db_vrfy_pgset_iinc(dbp, pgno, -1)); } /* * __db_vrfy_pgset_iinc -- * Increment the value associated with a pgno by i. * */ static int __db_vrfy_pgset_iinc(dbp, pgno, i) DB *dbp; db_pgno_t pgno; int i; { DBT key, data; int ret; int val; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); val = 0; key.data = &pgno; key.size = sizeof(db_pgno_t); data.data = &val; data.ulen = sizeof(int); F_SET(&data, DB_DBT_USERMEM); if ((ret = dbp->get(dbp, NULL, &key, &data, 0)) == 0) { DB_ASSERT(data.size = sizeof(int)); memcpy(&val, data.data, sizeof(int)); } else if (ret != DB_NOTFOUND) return (ret); data.size = sizeof(int); val += i; return (dbp->put(dbp, NULL, &key, &data, 0)); } /* * CDB___db_vrfy_pgset_next -- * Given a cursor open in a pgset database, get the next page in the * set. * * PUBLIC: int CDB___db_vrfy_pgset_next __P((DBC *, db_pgno_t *)); */ int CDB___db_vrfy_pgset_next(dbc, pgnop) DBC *dbc; db_pgno_t *pgnop; { DBT key, data; db_pgno_t pgno; int ret; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); /* We don't care about the data, just the keys. */ F_SET(&data, DB_DBT_USERMEM | DB_DBT_PARTIAL); F_SET(&key, DB_DBT_USERMEM); key.data = &pgno; key.ulen = sizeof(db_pgno_t); if ((ret = dbc->c_get(dbc, &key, &data, DB_NEXT)) != 0) return (ret); DB_ASSERT(key.size == sizeof(db_pgno_t)); *pgnop = pgno; return (0); } /* * CDB___db_vrfy_childcursor -- * Create a cursor to walk the child list with. Returns with a nonzero * final argument if the specified page has no children. * * PUBLIC: int CDB___db_vrfy_childcursor __P((VRFY_DBINFO *, DBC **)); */ int CDB___db_vrfy_childcursor(vdp, dbcp) VRFY_DBINFO *vdp; DBC **dbcp; { DB *cdbp; DBC *dbc; int ret; cdbp = vdp->cdbp; if ((ret = cdbp->cursor(cdbp, NULL, &dbc, 0)) == 0) *dbcp = dbc; return (ret); } /* * CDB___db_vrfy_childput -- * Add a child structure to the set for a given page. * * PUBLIC: int CDB___db_vrfy_childput * PUBLIC: __P((VRFY_DBINFO *, db_pgno_t, VRFY_CHILDINFO *)); */ int CDB___db_vrfy_childput(vdp, pgno, cip) VRFY_DBINFO *vdp; db_pgno_t pgno; VRFY_CHILDINFO *cip; { DBT key, data; DB *cdbp; int ret; cdbp = vdp->cdbp; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); key.data = &pgno; key.size = sizeof(db_pgno_t); data.data = cip; data.size = sizeof(VRFY_CHILDINFO); /* * Don't add duplicate (data) entries for a given child, and accept * DB_KEYEXIST as a successful return; we only need to verify * each child once, even if a child (such as an overflow key) is * multiply referenced. */ ret = cdbp->put(cdbp, NULL, &key, &data, DB_NODUPDATA); return (ret == DB_KEYEXIST ? 0 : ret); } /* * CDB___db_vrfy_ccset -- * Sets a cursor created with CDB___db_vrfy_childcursor to the first * child of the given pgno, and returns it in the third arg. * * PUBLIC: int CDB___db_vrfy_ccset __P((DBC *, db_pgno_t, VRFY_CHILDINFO **)); */ int CDB___db_vrfy_ccset(dbc, pgno, cipp) DBC *dbc; db_pgno_t pgno; VRFY_CHILDINFO **cipp; { DBT key, data; int ret; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); key.data = &pgno; key.size = sizeof(db_pgno_t); if ((ret = dbc->c_get(dbc, &key, &data, DB_SET)) != 0) return (ret); DB_ASSERT(data.size == sizeof(VRFY_CHILDINFO)); *cipp = (VRFY_CHILDINFO *)data.data; return (0); } /* * CDB___db_vrfy_ccnext -- * Gets the next child of the given cursor created with * CDB___db_vrfy_childcursor, and returns it in the memory provided in the * second arg. * * PUBLIC: int CDB___db_vrfy_ccnext __P((DBC *, VRFY_CHILDINFO **)); */ int CDB___db_vrfy_ccnext(dbc, cipp) DBC *dbc; VRFY_CHILDINFO **cipp; { DBT key, data; int ret; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); if ((ret = dbc->c_get(dbc, &key, &data, DB_NEXT_DUP)) != 0) return (ret); DB_ASSERT(data.size == sizeof(VRFY_CHILDINFO)); *cipp = (VRFY_CHILDINFO *)data.data; return (0); } /* * CDB___db_vrfy_ccclose -- * Closes the cursor created with CDB___db_vrfy_childcursor. * * This doesn't actually do anything interesting now, but it's * not inconceivable that we might change the internal database CDB_usage * and keep the interfaces the same, and a function call here or there * seldom hurts anyone. * * PUBLIC: int CDB___db_vrfy_ccclose __P((DBC *)); */ int CDB___db_vrfy_ccclose(dbc) DBC *dbc; { return (dbc->c_close(dbc)); } /* * CDB___db_vrfy_pageinfo_create -- * Constructor for VRFY_PAGEINFO; allocates and initializes. * * PUBLIC: int CDB___db_vrfy_pageinfo_create __P((VRFY_PAGEINFO **)); */ int CDB___db_vrfy_pageinfo_create(pgipp) VRFY_PAGEINFO **pgipp; { VRFY_PAGEINFO *pgip; int ret; if ((ret = CDB___os_calloc(NULL, 1, sizeof(VRFY_PAGEINFO), (void **)&pgip)) != 0) return (ret); DB_ASSERT(pgip->pi_refcount == 0); *pgipp = pgip; return (0); } /* * CDB___db_salvage_init -- * Set up salvager database. * * PUBLIC: int CDB___db_salvage_init __P((VRFY_DBINFO *)); */ int CDB___db_salvage_init(vdp) VRFY_DBINFO *vdp; { DB *dbp; int ret; if ((ret = CDB_db_create(&dbp, NULL, 0)) != 0) return (ret); if ((ret = dbp->set_pagesize(dbp, 1024)) != 0) goto err; if ((ret = dbp->open(dbp, NULL, NULL, DB_BTREE, DB_CREATE, 0)) != 0) goto err; vdp->salvage_pages = dbp; return (0); err: (void)dbp->close(dbp, 0); return (ret); } /* * CDB___db_salvage_destroy -- * Close salvager database. * PUBLIC: void CDB___db_salvage_destroy __P((VRFY_DBINFO *)); */ void CDB___db_salvage_destroy(vdp) VRFY_DBINFO *vdp; { (void)vdp->salvage_pages->close(vdp->salvage_pages, 0); } /* * CDB___db_salvage_getnext -- * Get the next (first) unprinted page in the database of pages we need to * print still. Delete entries for any already-printed pages we encounter * in this search, as well as the page we're returning. * * PUBLIC: int CDB___db_salvage_getnext * PUBLIC: __P((VRFY_DBINFO *, db_pgno_t *, u_int32_t *)); */ int CDB___db_salvage_getnext(vdp, pgnop, pgtypep) VRFY_DBINFO *vdp; db_pgno_t *pgnop; u_int32_t *pgtypep; { DB *dbp; DBC *dbc; DBT key, data; int ret; u_int32_t pgtype; dbp = vdp->salvage_pages; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); while ((ret = dbc->c_get(dbc, &key, &data, DB_NEXT)) == 0) { DB_ASSERT(data.size == sizeof(u_int32_t)); memcpy(&pgtype, data.data, sizeof(pgtype)); if ((ret = dbc->c_del(dbc, 0)) != 0) goto err; if (pgtype != SALVAGE_IGNORE) goto found; } /* No more entries--ret probably equals DB_NOTFOUND. */ if (0) { found: DB_ASSERT(key.size == sizeof(db_pgno_t)); DB_ASSERT(data.size == sizeof(u_int32_t)); *pgnop = *(db_pgno_t *)key.data; *pgtypep = *(u_int32_t *)data.data; } err: (void)dbc->c_close(dbc); return (ret); } /* * CDB___db_salvage_isdone -- * Return whether or not the given pgno is already marked * SALVAGE_IGNORE (meaning that we don't need to print it again). * * Returns DB_KEYEXIST if it is marked, 0 if not, or another error on * error. * * PUBLIC: int CDB___db_salvage_isdone __P((VRFY_DBINFO *, db_pgno_t)); */ int CDB___db_salvage_isdone(vdp, pgno) VRFY_DBINFO *vdp; db_pgno_t pgno; { DBT key, data; DB *dbp; int ret; u_int32_t currtype; dbp = vdp->salvage_pages; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); currtype = SALVAGE_INVALID; data.data = &currtype; data.ulen = sizeof(u_int32_t); data.flags = DB_DBT_USERMEM; key.data = &pgno; key.size = sizeof(db_pgno_t); /* * Put an entry for this page, with pgno as key and type as data, * unless it's already there and is marked done. * If it's there and is marked anything else, that's fine--we * want to mark it done. */ ret = dbp->get(dbp, NULL, &key, &data, 0); if (ret == 0) { /* * The key's already here. Check and see if it's already * marked done. If it is, return DB_KEYEXIST. If it's not, * return 0. */ if (currtype == SALVAGE_IGNORE) return (DB_KEYEXIST); else return (0); } else if (ret != DB_NOTFOUND) return (ret); /* The pgno is not yet marked anything; return 0. */ return (0); } /* * CDB___db_salvage_markdone -- * Mark as done a given page. * * PUBLIC: int CDB___db_salvage_markdone __P((VRFY_DBINFO *, db_pgno_t)); */ int CDB___db_salvage_markdone(vdp, pgno) VRFY_DBINFO *vdp; db_pgno_t pgno; { DBT key, data; DB *dbp; int pgtype, ret; u_int32_t currtype; pgtype = SALVAGE_IGNORE; dbp = vdp->salvage_pages; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); currtype = SALVAGE_INVALID; data.data = &currtype; data.ulen = sizeof(u_int32_t); data.flags = DB_DBT_USERMEM; key.data = &pgno; key.size = sizeof(db_pgno_t); /* * Put an entry for this page, with pgno as key and type as data, * unless it's already there and is marked done. * If it's there and is marked anything else, that's fine--we * want to mark it done, but db_salvage_isdone only lets * us know if it's marked IGNORE. */ if ((ret = CDB___db_salvage_isdone(vdp, pgno)) != 0) return (ret); data.size = sizeof(u_int32_t); data.data = &pgtype; return (dbp->put(dbp, NULL, &key, &data, 0)); } /* * CDB___db_salvage_markneeded -- * If it has not yet been printed, make note of the fact that a page * must be dealt with later. * * PUBLIC: int CDB___db_salvage_markneeded * PUBLIC: __P((VRFY_DBINFO *, db_pgno_t, u_int32_t)); */ int CDB___db_salvage_markneeded(vdp, pgno, pgtype) VRFY_DBINFO *vdp; db_pgno_t pgno; u_int32_t pgtype; { DB *dbp; DBT key, data; int ret; dbp = vdp->salvage_pages; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); key.data = &pgno; key.size = sizeof(db_pgno_t); data.data = &pgtype; data.size = sizeof(u_int32_t); /* * Put an entry for this page, with pgno as key and type as data, * unless it's already there, in which case it's presumably * already been marked done. */ ret = dbp->put(dbp, NULL, &key, &data, DB_NOOVERWRITE); return (ret == DB_KEYEXIST ? 0 : ret); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/debug.h����������������������������������������������������������������������������0100644�0063146�0012731�00000004053�07427026535�014223� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)debug.h 11.8 (Sleepycat) 11/8/99 */ /* * When running with #DIAGNOSTIC defined, we smash memory and do memory * guarding with a special byte value. */ #define CLEAR_BYTE 0xdb #define GUARD_BYTE 0xdc /* * DB assertions. */ #ifdef DIAGNOSTIC #define DB_ASSERT(e) ((e) ? (void)0 : __db_assert(#e, __FILE__, __LINE__)) #else #define DB_ASSERT(e) ((void)0) #endif /* * Debugging macro to log operations. * If DEBUG_WOP is defined, log operations that modify the database. * If DEBUG_ROP is defined, log operations that read the database. * * D dbp * T txn * O operation (string) * K key * A data * F flags */ #define LOG_OP(C, T, O, K, A, F) { \ DB_LSN __lsn; \ DBT __op; \ if (DB_LOGGING((C))) { \ memset(&__op, 0, sizeof(__op)); \ __op.data = O; \ __op.size = strlen(O) + 1; \ (void)CDB___db_debug_log((C)->dbp->dbenv, \ T, &__lsn, 0, &__op, (C)->dbp->log_fileid, K, A, F);\ } \ } #ifdef DEBUG_ROP #define DEBUG_LREAD(C, T, O, K, A, F) LOG_OP(C, T, O, K, A, F) #else #define DEBUG_LREAD(C, T, O, K, A, F) #endif #ifdef DEBUG_WOP #define DEBUG_LWRITE(C, T, O, K, A, F) LOG_OP(C, T, O, K, A, F) #else #define DEBUG_LWRITE(C, T, O, K, A, F) #endif /* * Hook for testing recovery at various places in the create/delete paths. */ #if CONFIG_TEST #define DB_TEST_RECOVERY(dbp, val, ret, name) \ do { \ int __ret; \ PANIC_CHECK((dbp)->dbenv); \ if ((dbp)->dbenv->test_copy == (val)) { \ /* COPY the FILE */ \ (void)(dbp)->sync((dbp), 0); \ if ((__ret = __db_testcopy((dbp), (name))) != 0) \ (ret) = CDB___db_panic((dbp)->dbenv, __ret); \ } \ if ((dbp)->dbenv->test_abort == (val)) { \ /* ABORT the TXN */ \ (ret) = EINVAL; \ goto db_tr_err; \ } \ } while (0) #define DB_TEST_RECOVERY_LABEL db_tr_err: #else #define DB_TEST_RECOVERY(dbp, val, ret, name) #define DB_TEST_RECOVERY_LABEL #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/dirent_local.c���������������������������������������������������������������������0100644�0063146�0012731�00000004324�10000513627�015550� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* */ /* dirent_local.c */ /* */ /* POSIX directory routines for Windows. */ /* */ /* Part of the ht://Dig package <http://www.htdig.org/> */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License version 2 or later */ /* <http://www.gnu.org/copyleft/lgpl.html> */ /* */ /* $Id: direct_local.c */ /* */ /* * POSIX directory routines for Windows. * * Added by Neal Richter, RightNow Technologies * June 2003 * */ #ifdef _MSC_VER /* _WIN32 */ #include <windows.h> #include <iostream.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include "dirent_local.h" /* ----- opendir ------------------------------------- Oct 23, 1999 21:52 --- * Open a directory handle */ DIR * opendir(const char *name) { DIR *dirp; char dirpath[256]; if ((dirp=malloc(sizeof(struct DIRstruct))) == NULL) { errno = ENOMEM; return(NULL); } sprintf(dirpath, "%s/*", name); if ((dirp->filehand = FindFirstFile(dirpath, &dirp->finddata)) == INVALID_HANDLE_VALUE) { errno = ENOENT; return(NULL); } dirp->priv = 1; return(dirp); } /* ----- readdir ------------------------------------- Oct 23, 1999 21:52 --- * Return the next file for a directory handle */ struct dirent * readdir(DIR *dirp) { if (!dirp) { errno = EBADF; return(NULL); } if (dirp->priv) { /* this is the first time, so return the results of FindFirstFile */ dirp->priv = 0; strcpy(dirp->file.d_name, dirp->finddata.cFileName); return(&dirp->file); } /* this is a subsequent call so get next file */ if (!FindNextFile(dirp->filehand, &dirp->finddata)) return(NULL); strcpy(dirp->file.d_name, dirp->finddata.cFileName); return(&dirp->file); } /* ----- closedir ------------------------------------ Oct 23, 1999 21:52 --- * Close directory handle */ int closedir(DIR *dirp) { if (!dirp) { errno = EBADF; return(-1); } FindClose(dirp->filehand); free(dirp); return(0); } #endif /* _MSC_VER (WIN32) */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/dirent_local.h���������������������������������������������������������������������0100644�0063146�0012731�00000002730�10000513627�015554� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* */ /* dirent_local.h */ /* */ /* POSIX directory routines for Windows. */ /* */ /* Part of the ht://Dig package <http://www.htdig.org/> */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License version 2 or later */ /* <http://www.gnu.org/copyleft/lgpl.html> */ /* */ /* $Id: direct_local.h */ /* */ /* * POSIX directory routines for Windows. * * Added by Neal Richter, RightNow Technologies * June 2003 * */ #ifndef DIRENT_LOCAL_H #define DIRENT_LOCAL_H #ifndef _WIN32 #include <dirent.h> #else #include <windows.h> #ifdef __cplusplus extern "C" { #endif /* WIN equivalent of POSIX directory routines */ #define MAXNAMLEN 255 struct dirent { char d_name[256]; /* directory name */ }; struct DIRstruct { HANDLE filehand; WIN32_FIND_DATA finddata; struct dirent file; char priv; }; typedef struct DIRstruct DIR; DIR *opendir(const char *name); struct dirent *readdir(DIR *); int closedir(DIR *); #ifdef __cplusplus } #endif #endif /* _WIN32 */ #if defined(SOLARIS) || defined(_WIN32) int scandir(char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*dcomp)(void *, void *)); int alphasort(void *a, void *b); #endif #endif /* !DIRENT_LOCAL_H */ ����������������������������������������htdig-3.2.0b6/db/env_ext.h��������������������������������������������������������������������������0100644�0063146�0012731�00000002543�07427026535�014607� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _env_ext_h_ #define _env_ext_h_ void CDB___db_shalloc_init __P((void *, size_t)); int CDB___db_shalloc __P((void *, size_t, size_t, void *)); void CDB___db_shalloc_free __P((void *, void *)); size_t CDB___db_shalloc_count __P((void *)); size_t CDB___db_shsizeof __P((void *)); void CDB___db_shalloc_dump __P((void *, FILE *)); int CDB___db_tablesize __P((u_int32_t)); void CDB___db_hashinit __P((void *, u_int32_t)); int CDB___dbenv_init __P((DB_ENV *)); int CDB___db_mi_env __P((DB_ENV *, const char *)); int CDB___db_mi_open __P((DB_ENV *, const char *, int)); int CDB___db_env_config __P((DB_ENV *, int)); int CDB___dbenv_open __P((DB_ENV *, const char *, char * const *, u_int32_t, int)); int CDB___dbenv_remove __P((DB_ENV *, const char *, char * const *, u_int32_t)); int CDB___dbenv_close __P((DB_ENV *, u_int32_t)); int CDB___db_appname __P((DB_ENV *, APPNAME, const char *, const char *, u_int32_t, DB_FH *, char **)); int CDB___db_apprec __P((DB_ENV *, u_int32_t)); int CDB___db_e_attach __P((DB_ENV *)); int CDB___db_e_detach __P((DB_ENV *, int)); int CDB___db_e_remove __P((DB_ENV *, int)); int CDB___db_e_stat __P((DB_ENV *, REGENV *, REGION *, int *)); int CDB___db_r_attach __P((DB_ENV *, REGINFO *, size_t)); int CDB___db_r_detach __P((DB_ENV *, REGINFO *, int)); #endif /* _env_ext_h_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/env_method.c�����������������������������������������������������������������������0100644�0063146�0012731�00000017222�10000513627�015242� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)env_method.c 11.5 (Sleepycat) 9/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "db_page.h" #include "db_am.h" #include "lock.h" #include "log.h" #include "mp.h" #include "txn.h" DB_GLOBALS CDB___db_global_values = { 1, /* db_set_mutexlocks */ 0, /* db_set_pageyield */ 1, /* db_set_panic */ 0, /* db_set_region_init */ 0, /* db_set_tas_spins */ /* XA environment queue */ {NULL, &CDB___db_global_values.db_envq.tqh_first} }; static void CDB___dbenv_err __P((const DB_ENV *, int, const char *, ...)); static void CDB___dbenv_errx __P((const DB_ENV *, const char *, ...)); static void CDB___dbenv_set_errcall __P((DB_ENV *, void (*)(const char *, char *))); static void CDB___dbenv_set_errfile __P((DB_ENV *, FILE *)); static void CDB___dbenv_set_errpfx __P((DB_ENV *, const char *)); static void CDB___dbenv_set_feedback __P((DB_ENV *, void (*)(DB_ENV *, int, int))); static int CDB___dbenv_set_mutexlocks __P((DB_ENV *, int)); static int CDB___dbenv_set_pageyield __P((DB_ENV *, int)); static int CDB___dbenv_set_panic __P((DB_ENV *, int)); static void CDB___dbenv_set_paniccall __P((DB_ENV *, void (*)(DB_ENV *, int))); static int CDB___dbenv_set_recovery_init __P((DB_ENV *, int (*)(DB_ENV *))); static int CDB___dbenv_set_region_init __P((DB_ENV *, int)); static int CDB___dbenv_set_tas_spins __P((DB_ENV *, u_int32_t)); static int CDB___dbenv_set_verbose __P((DB_ENV *, u_int32_t, int)); /* * CDB_db_env_create -- * DB_ENV constructor. */ int CDB_db_env_create(dbenvpp, flags) DB_ENV **dbenvpp; u_int32_t flags; { DB_ENV *dbenv; int ret; /* * !!! * We can't call the flags-checking routines, we don't have an * environment yet. */ if (flags != 0) return (EINVAL); if ((ret = CDB___os_calloc(1, sizeof(*dbenv), &dbenv)) != 0) return (ret); if ((ret = CDB___dbenv_init(dbenv)) != 0) { CDB___os_free(dbenv, sizeof(*dbenv)); return (ret); } *dbenvpp = dbenv; return (0); } /* * CDB___dbenv_init -- * Initialize a DB_ENV structure. * * PUBLIC: int CDB___dbenv_init __P((DB_ENV *)); */ int CDB___dbenv_init(dbenv) DB_ENV *dbenv; { dbenv->close = CDB___dbenv_close; dbenv->err = CDB___dbenv_err; dbenv->errx = CDB___dbenv_errx; dbenv->open = CDB___dbenv_open; dbenv->remove = CDB___dbenv_remove; dbenv->set_errcall = CDB___dbenv_set_errcall; dbenv->set_errfile = CDB___dbenv_set_errfile; dbenv->set_errpfx = CDB___dbenv_set_errpfx; dbenv->set_feedback = CDB___dbenv_set_feedback; dbenv->set_mutexlocks = CDB___dbenv_set_mutexlocks; dbenv->set_pageyield = CDB___dbenv_set_pageyield; dbenv->set_panic = CDB___dbenv_set_panic; dbenv->set_paniccall = CDB___dbenv_set_paniccall; dbenv->set_recovery_init = CDB___dbenv_set_recovery_init; dbenv->set_region_init = CDB___dbenv_set_region_init; dbenv->set_tas_spins = CDB___dbenv_set_tas_spins; dbenv->set_verbose = CDB___dbenv_set_verbose; CDB___log_dbenv_create(dbenv); /* Subsystem specific. */ CDB___lock_dbenv_create(dbenv); CDB___memp_dbenv_create(dbenv); CDB___txn_dbenv_create(dbenv); CDB___os_dbenv_create(dbenv); return (0); } /* * CDB___dbenv_err -- * Error message, including the standard error string. */ static void #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___dbenv_err(const DB_ENV *dbenv, int error, const char *fmt, ...) #else CDB___dbenv_err(dbenv, error, fmt, va_alist) const DB_ENV *dbenv; int error; const char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif CDB___db_real_err(dbenv, error, 1, 1, fmt, ap); va_end(ap); } /* * CDB___dbenv_errx -- * Error message. */ static void #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ CDB___dbenv_errx(const DB_ENV *dbenv, const char *fmt, ...) #else CDB___dbenv_errx(dbenv, fmt, va_alist) const DB_ENV *dbenv; const char *fmt; va_dcl #endif { va_list ap; #if defined(__STDC__) || defined(_MSC_VER) /* WIN32 */ va_start(ap, fmt); #else va_start(ap); #endif CDB___db_real_err(dbenv, 0, 0, 1, fmt, ap); va_end(ap); } static void CDB___dbenv_set_errcall(dbenv, errcall) DB_ENV *dbenv; void (*errcall) __P((const char *, char *)); { dbenv->db_errcall = errcall; } static void CDB___dbenv_set_errfile(dbenv, errfile) DB_ENV *dbenv; FILE *errfile; { dbenv->db_errfile = errfile; } static void CDB___dbenv_set_errpfx(dbenv, errpfx) DB_ENV *dbenv; const char *errpfx; { dbenv->db_errpfx = errpfx; } static void CDB___dbenv_set_feedback(dbenv, feedback) DB_ENV *dbenv; void (*feedback) __P((DB_ENV *, int, int)); { dbenv->db_feedback = feedback; } static int CDB___dbenv_set_mutexlocks(dbenv, onoff) DB_ENV *dbenv; int onoff; { COMPQUIET(dbenv, NULL); DB_GLOBAL(db_mutexlocks) = onoff; return (0); } static int CDB___dbenv_set_pageyield(dbenv, onoff) DB_ENV *dbenv; int onoff; { COMPQUIET(dbenv, NULL); DB_GLOBAL(db_pageyield) = onoff; return (0); } static int /* !!!: Undocumented. */ CDB___dbenv_set_panic(dbenv, onoff) DB_ENV *dbenv; int onoff; { COMPQUIET(dbenv, NULL); DB_GLOBAL(db_panic) = onoff; return (0); } static void CDB___dbenv_set_paniccall(dbenv, paniccall) DB_ENV *dbenv; void (*paniccall) __P((DB_ENV *, int)); { dbenv->db_paniccall = paniccall; } static int CDB___dbenv_set_recovery_init(dbenv, recovery_init) DB_ENV *dbenv; int (*recovery_init) __P((DB_ENV *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_recovery_init"); dbenv->db_recovery_init = recovery_init; return (0); } static int CDB___dbenv_set_region_init(dbenv, onoff) DB_ENV *dbenv; int onoff; { COMPQUIET(dbenv, NULL); DB_GLOBAL(db_region_init) = onoff; return (0); } static int CDB___dbenv_set_tas_spins(dbenv, tas_spins) DB_ENV *dbenv; u_int32_t tas_spins; { COMPQUIET(dbenv, NULL); DB_GLOBAL(db_tas_spins) = tas_spins; return (0); } static int CDB___dbenv_set_verbose(dbenv, which, onoff) DB_ENV *dbenv; u_int32_t which; int onoff; { switch (which) { case DB_VERB_CHKPOINT: case DB_VERB_DEADLOCK: case DB_VERB_RECOVERY: case DB_VERB_WAITSFOR: if (onoff) FLD_SET(dbenv->verbose, which); else FLD_CLR(dbenv->verbose, which); break; default: return (EINVAL); } return (0); } /* * CDB___db_mi_env -- * Method illegally called with public environment. * * PUBLIC: int CDB___db_mi_env __P((DB_ENV *, const char *)); */ int CDB___db_mi_env(dbenv, name) DB_ENV *dbenv; const char *name; { CDB___db_err(dbenv, "%s: method meaningless in shared environment", name); return (EINVAL); } /* * CDB___db_mi_open -- * Method illegally called after open. * * PUBLIC: int CDB___db_mi_open __P((DB_ENV *, const char *, int)); */ int CDB___db_mi_open(dbenv, name, after) DB_ENV *dbenv; const char *name; int after; { CDB___db_err(dbenv, "%s: method meaningless %s open", name, after ? "after" : "before"); return (EINVAL); } /* * CDB___db_env_config -- * Method or function called without subsystem being configured. * * PUBLIC: int CDB___db_env_config __P((DB_ENV *, int)); */ int CDB___db_env_config(dbenv, subsystem) DB_ENV *dbenv; int subsystem; { const char *name; switch (subsystem) { case DB_INIT_LOCK: name = "lock"; break; case DB_INIT_LOG: name = "log"; break; case DB_INIT_MPOOL: name = "mpool"; break; case DB_INIT_TXN: name = "txn"; break; default: name = "unknown"; break; } CDB___db_err(dbenv, "%s interface called with environment not configured for that subsystem", name); return (EINVAL); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/env_open.c�������������������������������������������������������������������������0100644�0063146�0012731�00000055012�10000513627�014722� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)env_open.c 11.8 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER /* _WIN32 */ #include <process.h> #else #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "hash.h" #include "qam.h" #include "lock.h" #include "log.h" #include "mp.h" #include "txn.h" static int CDB___dbenv_config __P((DB_ENV *, const char *, char * const *, u_int32_t)); static int CDB___dbenv_refresh __P((DB_ENV *)); static int CDB___db_home __P((DB_ENV *, const char *, u_int32_t)); static int CDB___db_parse __P((DB_ENV *, char *)); static int CDB___db_tmp_open __P((DB_ENV *, u_int32_t, char *, DB_FH *)); /* * CDB_db_version -- * Return version information. */ char * CDB_db_version(majverp, minverp, patchp) int *majverp, *minverp, *patchp; { if (majverp != NULL) *majverp = DB_VERSION_MAJOR; if (minverp != NULL) *minverp = DB_VERSION_MINOR; if (patchp != NULL) *patchp = DB_VERSION_PATCH; return ((char *)DB_VERSION_STRING); } /* * CDB___dbenv_open -- * Initialize an environment. * * PUBLIC: int CDB___dbenv_open __P((DB_ENV *, * PUBLIC: const char *, char * const *, u_int32_t, int)); */ int CDB___dbenv_open(dbenv, db_home, db_config, flags, mode) DB_ENV *dbenv; const char *db_home; char * const *db_config; u_int32_t flags; int mode; { DB_ENV *rm_dbenv; int ret; #undef OKFLAGS #define OKFLAGS \ DB_CREATE | DB_INIT_CDB | DB_INIT_LOCK | DB_INIT_LOG | \ DB_INIT_MPOOL | DB_INIT_TXN | DB_LOCKDOWN | DB_NOMMAP | \ DB_PRIVATE | DB_RECOVER | DB_RECOVER_FATAL | DB_SYSTEM_MEM | \ DB_THREAD | DB_TXN_NOSYNC | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT #undef OKFLAGS_CDB #define OKFLAGS_CDB \ DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL | DB_LOCKDOWN | \ DB_NOMMAP | DB_PRIVATE | DB_SYSTEM_MEM | DB_THREAD | \ DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT if ((ret = CDB___db_fchk(dbenv, "DBENV->open", flags, OKFLAGS)) != 0) return (ret); if (LF_ISSET(DB_INIT_CDB) && (ret = CDB___db_fchk(dbenv, "DBENV->open", flags, OKFLAGS_CDB)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "DBENV->open", flags, DB_PRIVATE, DB_SYSTEM_MEM)) != 0) return (ret); /* * If we're doing recovery, destroy the environment so that we create * all the regions from scratch. I'd like to reuse already created * regions, but that's hard. We would have to create the environment * region from scratch, at least, as we have no way of knowing if its * linked lists are corrupted. * * I suppose we could set flags while modifying those links, but that * is going to be difficult to get right. The major concern I have * is if the application stomps the environment with a rogue pointer. * We have no way of detecting that, and we could be forced into a * situation where we start up and then crash, repeatedly. * * Note that we do not check any flags like DB_PRIVATE before calling * remove. We don't care if the current environment was private or * not, we just want to nail any files that are left-over for whatever * reason, from whatever session. */ if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL)) { if ((ret = CDB_db_env_create(&rm_dbenv, 0)) != 0) return (ret); if ((ret = dbenv->remove(rm_dbenv, db_home, db_config, DB_FORCE)) != 0) return (ret); } /* Initialize the DB_ENV structure. */ if ((ret = CDB___dbenv_config(dbenv, db_home, db_config, flags)) != 0) goto err; /* Convert the DBENV->open flags to internal flags. */ if (LF_ISSET(DB_CREATE)) F_SET(dbenv, DB_ENV_CREATE); if (LF_ISSET(DB_LOCKDOWN)) F_SET(dbenv, DB_ENV_LOCKDOWN); if (LF_ISSET(DB_NOMMAP)) F_SET(dbenv, DB_ENV_NOMMAP); if (LF_ISSET(DB_PRIVATE)) F_SET(dbenv, DB_ENV_PRIVATE); if (LF_ISSET(DB_SYSTEM_MEM)) F_SET(dbenv, DB_ENV_SYSTEM_MEM); if (LF_ISSET(DB_THREAD)) F_SET(dbenv, DB_ENV_THREAD); if (LF_ISSET(DB_TXN_NOSYNC)) F_SET(dbenv, DB_ENV_TXN_NOSYNC); /* Default permissions are read-write for both owner and group. */ dbenv->db_mode = mode == 0 ? CDB___db_omode("rwrw--") : mode; /* Initialize for CDB product. */ if (LF_ISSET(DB_INIT_CDB)) { LF_SET(DB_INIT_LOCK); F_SET(dbenv, DB_ENV_CDB); } /* Create/join the environment. */ if ((ret = CDB___db_e_attach(dbenv)) != 0) goto err; /* * Initialize the subsystems. TXN uses log/lock, so do them first. */ if (LF_ISSET(DB_INIT_MPOOL) && (ret = CDB___memp_open(dbenv)) != 0) goto err; /* * Transactions imply logging. While almost all applications will want * both locking and logging, it would not be unreasonable for a single * threaded process to want transactions for atomicity guarantees, but * not necessarily need concurrency. */ if (LF_ISSET(DB_INIT_LOG | DB_INIT_TXN)) { if ((ret = CDB___log_open(dbenv)) != 0) goto err; F_SET(dbenv, DB_ENV_LOGGING); } if (LF_ISSET(DB_INIT_LOCK)) { if ((ret = CDB___lock_open(dbenv)) != 0) goto err; if (!F_ISSET(dbenv, DB_ENV_CDB)) F_SET(dbenv, DB_ENV_LOCKING); } if (LF_ISSET(DB_INIT_TXN)) { if ((ret = CDB___txn_open(dbenv)) != 0) goto err; F_SET(dbenv, DB_ENV_TXN); /* * If the application is running with transactions, initialize * the function tables. */ if ((ret = CDB___bam_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___crdel_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___db_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___ham_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___log_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___qam_init_recover(dbenv)) != 0) goto err; if ((ret = CDB___txn_init_recover(dbenv)) != 0) goto err; /* * If the application specified their own recovery * initialization function, call it. */ if (dbenv->db_recovery_init != NULL && (ret = dbenv->db_recovery_init(dbenv)) != 0) goto err; /* Perform recovery for any previous run. */ if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL) && (ret = CDB___db_apprec(dbenv, LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL))) != 0) goto err; } return (0); err: (void)CDB___dbenv_refresh(dbenv); return (ret); } /* * CDB___dbenv_remove -- * Discard an environment. * * PUBLIC: int CDB___dbenv_remove __P((DB_ENV *, * PUBLIC: const char *, char * const *, u_int32_t)); */ int CDB___dbenv_remove(dbenv, db_home, db_config, flags) DB_ENV *dbenv; const char *db_home; char * const *db_config; u_int32_t flags; { int ret, t_ret; #undef OKFLAGS #define OKFLAGS \ DB_FORCE | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "DBENV->remove", flags, OKFLAGS)) != 0) return (ret); /* Initialize the DB_ENV structure. */ if ((ret = CDB___dbenv_config(dbenv, db_home, db_config, flags)) != 0) goto err; /* Remove the environment. */ ret = CDB___db_e_remove(dbenv, LF_ISSET(DB_FORCE) ? 1 : 0); /* Discard any resources we've acquired. */ err: if ((t_ret = CDB___dbenv_refresh(dbenv)) != 0 && ret == 0) ret = t_ret; memset(dbenv, CLEAR_BYTE, sizeof(DB_ENV)); CDB___os_free(dbenv, sizeof(DB_ENV)); return (ret); } /* * CDB___dbenv_config -- * Initialize the DB_ENV structure. */ static int CDB___dbenv_config(dbenv, db_home, db_config, flags) DB_ENV *dbenv; const char *db_home; char * const *db_config; u_int32_t flags; { FILE *fp; int ret; char * const *p; char *lp, buf[MAXPATHLEN * 2]; /* Set the database home. */ if ((ret = CDB___db_home(dbenv, db_home, flags)) != 0) return (ret); /* Parse the config array. */ for (p = db_config; p != NULL && *p != NULL; ++p) if ((ret = CDB___db_parse(dbenv, *p)) != 0) return (ret); /* * Parse the config file. * * XXX * Don't use sprintf(3)/snprintf(3) -- the former is dangerous, and * the latter isn't standard, and we're manipulating strings handed * us by the application. */ if (dbenv->db_home != NULL) { #define CONFIG_NAME "/DB_CONFIG" if (strlen(dbenv->db_home) + strlen(CONFIG_NAME) + 1 > sizeof(buf)) { ret = ENAMETOOLONG; return (ret); } (void)strcpy(buf, dbenv->db_home); (void)strcat(buf, CONFIG_NAME); if ((fp = fopen(buf, "r")) != NULL) { while (fgets(buf, sizeof(buf), fp) != NULL) { if ((lp = strchr(buf, '\n')) == NULL) { CDB___db_err(dbenv, "%s: line too long", CONFIG_NAME); (void)fclose(fp); ret = EINVAL; return (ret); } *lp = '\0'; if (buf[0] == '\0' || buf[0] == '#' || isspace((int)buf[0])) continue; if ((ret = CDB___db_parse(dbenv, buf)) != 0) { (void)fclose(fp); return (ret); } } (void)fclose(fp); } } /* Set up the tmp directory path. */ if (dbenv->db_tmp_dir == NULL && (ret = CDB___os_tmpdir(dbenv, flags)) != 0) return (ret); /* * The locking file descriptor is rarely on. Set the fd to -1, not * because it's ever tested, but to make sure we catch mistakes. */ if ((ret = CDB___os_calloc(1, sizeof(*dbenv->lockfhp), &dbenv->lockfhp)) != 0) return (ret); dbenv->lockfhp->fd = -1; /* * Flag that the DB_ENV structure has been initialized. Note, this * must be set before calling into the subsystems as it's used during * file naming. */ F_SET(dbenv, DB_ENV_OPEN_CALLED); return (0); } /* * CDB___dbenv_close -- * DB_ENV destructor. * * PUBLIC: int CDB___dbenv_close __P((DB_ENV *, u_int32_t)); */ int CDB___dbenv_close(dbenv, flags) DB_ENV *dbenv; u_int32_t flags; { int ret; COMPQUIET(flags, 0); PANIC_CHECK(dbenv); ret = CDB___dbenv_refresh(dbenv); /* Discard the structure if we allocated it. */ if (!F_ISSET(dbenv, DB_ENV_USER_ALLOC)) { memset(dbenv, CLEAR_BYTE, sizeof(DB_ENV)); CDB___os_free(dbenv, sizeof(DB_ENV)); } return (ret); } /* * CDB___dbenv_refresh -- * Refresh the DB_ENV structure, releasing any allocated resources. */ static int CDB___dbenv_refresh(dbenv) DB_ENV *dbenv; { int ret, t_ret; char **p; ret = 0; /* * Close subsystems, in the reverse order they were opened (txn * must be first, it may want to discard locks and flush the log). */ if (dbenv->tx_handle != NULL) { if ((t_ret = CDB___txn_close(dbenv)) != 0 && ret == 0) ret = t_ret; dbenv->tx_handle = NULL; } if (dbenv->lk_handle != NULL) { if ((t_ret = CDB___lock_close(dbenv)) != 0 && ret == 0) ret = t_ret; dbenv->lk_handle = NULL; } CDB___lock_dbenv_close(dbenv); if (dbenv->lg_handle != NULL) { if ((t_ret = CDB___log_close(dbenv)) != 0 && ret == 0) ret = t_ret; dbenv->lg_handle = NULL; } if (dbenv->mp_handle != NULL) { if ((t_ret = CDB___memp_close(dbenv)) != 0 && ret == 0) ret = t_ret; dbenv->mp_handle = NULL; } /* Detach from the region. */ if (dbenv->reginfo != NULL) { if ((t_ret = CDB___db_e_detach(dbenv, 0)) != 0 && ret == 0) ret = t_ret; /* * !!! * Don't free dbenv->reginfo or set the reference to NULL, * that was done by CDB___db_e_detach(). */ } /* Clean up the structure. */ dbenv->db_panic = 0; if (dbenv->db_home != NULL) { CDB___os_freestr(dbenv->db_home); dbenv->db_home = NULL; } if (dbenv->db_log_dir != NULL) { CDB___os_freestr(dbenv->db_log_dir); dbenv->db_log_dir = NULL; } if (dbenv->db_tmp_dir != NULL) { CDB___os_freestr(dbenv->db_tmp_dir); dbenv->db_tmp_dir = NULL; } if (dbenv->db_data_dir != NULL) { for (p = dbenv->db_data_dir; *p != NULL; ++p) CDB___os_freestr(*p); CDB___os_free(dbenv->db_data_dir, dbenv->data_cnt * sizeof(char **)); dbenv->db_data_dir = NULL; } dbenv->data_cnt = dbenv->data_next = 0; dbenv->db_mode = 0; if (dbenv->lockfhp != NULL) { CDB___os_free(dbenv->lockfhp, sizeof(*dbenv->lockfhp)); dbenv->lockfhp = NULL; } if (dbenv->dtab != NULL) { CDB___os_free(dbenv->dtab, dbenv->dtab_size * sizeof(dbenv->dtab[0])); dbenv->dtab = NULL; dbenv->dtab_size = 0; } dbenv->mp_mmapsize = 0; dbenv->links.tqe_next = NULL; dbenv->links.tqe_prev = NULL; dbenv->xa_rmid = 0; dbenv->xa_txn = 0; F_CLR(dbenv, ~(DB_ENV_STANDALONE | DB_ENV_USER_ALLOC)); return (ret); } #define DB_ADDSTR(add) { \ if ((add) != NULL) { \ /* If leading slash, start over. */ \ if (CDB___os_abspath(add)) { \ p = str; \ slash = 0; \ } \ /* Append to the current string. */ \ len = strlen(add); \ if (slash) \ *p++ = PATH_SEPARATOR[0]; \ memcpy(p, add, len); \ p += len; \ slash = strchr(PATH_SEPARATOR, p[-1]) == NULL; \ } \ } /* * CDB___db_appname -- * Given an optional DB environment, directory and file name and type * of call, build a path based on the DBENV->open rules, and return * it in allocated space. * * PUBLIC: int CDB___db_appname __P((DB_ENV *, APPNAME, * PUBLIC: const char *, const char *, u_int32_t, DB_FH *, char **)); */ int CDB___db_appname(dbenv, appname, dir, file, tmp_oflags, fhp, namep) DB_ENV *dbenv; APPNAME appname; const char *dir, *file; u_int32_t tmp_oflags; DB_FH *fhp; char **namep; { DB_ENV etmp; size_t len, str_len; int data_entry, ret, slash, tmp_create, tmp_free; const char *a, *b, *c; char *p, *str; a = b = c = NULL; data_entry = -1; tmp_create = tmp_free = 0; /* * We don't return a name when creating temporary files, just a * file handle. Default to an error now. */ if (fhp != NULL) F_CLR(fhp, DB_FH_VALID); if (namep != NULL) *namep = NULL; /* * Absolute path names are never modified. If the file is an absolute * path, we're done. If the directory is, simply append the file and * return. */ if (file != NULL && CDB___os_abspath(file)) return (CDB___os_strdup(file, namep)); if (dir != NULL && CDB___os_abspath(dir)) { a = dir; goto done; } /* * DB_ENV DIR APPNAME RESULT * ------------------------------------------- * null null none <tmp>/file * null set none DIR/file * set null none DB_HOME/file * set set none DB_HOME/DIR/file * * DB_ENV FILE APPNAME RESULT * ------------------------------------------- * null null DB_APP_DATA <tmp>/<create> * null set DB_APP_DATA ./file * set null DB_APP_DATA <tmp>/<create> * set set DB_APP_DATA DB_HOME/DB_DATA_DIR/file * * DB_ENV DIR APPNAME RESULT * ------------------------------------------- * null null DB_APP_LOG <tmp>/file * null set DB_APP_LOG DIR/file * set null DB_APP_LOG DB_HOME/DB_LOG_DIR/file * set set DB_APP_LOG DB_HOME/DB_LOG_DIR/DIR/file * * DB_ENV APPNAME RESULT * ------------------------------------------- * null DB_APP_TMP* <tmp>/<create> * set DB_APP_TMP* DB_HOME/DB_TMP_DIR/<create> */ retry: switch (appname) { case DB_APP_NONE: if (dbenv == NULL || !F_ISSET(dbenv, DB_ENV_OPEN_CALLED)) { if (dir == NULL) goto tmp; a = dir; } else { a = dbenv->db_home; b = dir; } break; case DB_APP_DATA: if (dir != NULL) { CDB___db_err(dbenv, "DB_APP_DATA: illegal directory specification"); return (EINVAL); } if (file == NULL) { tmp_create = 1; goto tmp; } if (dbenv == NULL || !F_ISSET(dbenv, DB_ENV_OPEN_CALLED)) a = PATH_DOT; else { a = dbenv->db_home; if (dbenv->db_data_dir != NULL && (b = dbenv->db_data_dir[++data_entry]) == NULL) { data_entry = -1; b = dbenv->db_data_dir[0]; } } break; case DB_APP_LOG: if (dbenv == NULL || !F_ISSET(dbenv, DB_ENV_OPEN_CALLED)) { if (dir == NULL) goto tmp; a = dir; } else { a = dbenv->db_home; b = dbenv->db_log_dir; c = dir; } break; case DB_APP_TMP: if (dir != NULL || file != NULL) { CDB___db_err(dbenv, "DB_APP_TMP: illegal directory or file specification"); return (EINVAL); } tmp_create = 1; if (dbenv == NULL || !F_ISSET(dbenv, DB_ENV_OPEN_CALLED)) goto tmp; else { a = dbenv->db_home; b = dbenv->db_tmp_dir; } break; } /* Reference a file from the appropriate temporary directory. */ if (0) { tmp: if (dbenv == NULL || !F_ISSET(dbenv, DB_ENV_OPEN_CALLED)) { memset(&etmp, 0, sizeof(etmp)); if ((ret = CDB___os_tmpdir(&etmp, DB_USE_ENVIRON)) != 0) return (ret); tmp_free = 1; a = etmp.db_tmp_dir; } else a = dbenv->db_tmp_dir; } done: len = (a == NULL ? 0 : strlen(a) + 1) + (b == NULL ? 0 : strlen(b) + 1) + (c == NULL ? 0 : strlen(c) + 1) + (file == NULL ? 0 : strlen(file) + 1); /* * Allocate space to hold the current path information, as well as any * temporary space that we're going to need to create a temporary file * name. */ #define DB_TRAIL "BDBXXXXXX" str_len = len + sizeof(DB_TRAIL) + 10; if ((ret = CDB___os_malloc(str_len, NULL, &str)) != 0) { if (tmp_free) CDB___os_freestr(etmp.db_tmp_dir); return (ret); } slash = 0; p = str; DB_ADDSTR(a); DB_ADDSTR(b); DB_ADDSTR(file); *p = '\0'; /* Discard any space allocated to find the temp directory. */ if (tmp_free) { CDB___os_freestr(etmp.db_tmp_dir); tmp_free = 0; } /* * If we're opening a data file, see if it exists. If it does, * return it, otherwise, try and find another one to open. */ if (data_entry != -1 && CDB___os_exists(str, NULL) != 0) { CDB___os_free(str, str_len); a = b = c = NULL; goto retry; } /* Create the file if so requested. */ if (tmp_create && (ret = CDB___db_tmp_open(dbenv, tmp_oflags, str, fhp)) != 0) { CDB___os_free(str, str_len); return (ret); } if (namep == NULL) CDB___os_free(str, str_len); else *namep = str; return (0); } /* * CDB___db_home -- * Find the database home. */ static int CDB___db_home(dbenv, db_home, flags) DB_ENV *dbenv; const char *db_home; u_int32_t flags; { const char *p; /* * Use db_home by default, this allows utilities to reasonably * override the environment either explicitly or by using a -h * option. Otherwise, use the environment if it's permitted * and initialized. */ if ((p = db_home) == NULL && (LF_ISSET(DB_USE_ENVIRON) || (LF_ISSET(DB_USE_ENVIRON_ROOT) && CDB___os_isroot() == 0)) && (p = getenv("DB_HOME")) != NULL && p[0] == '\0') { CDB___db_err(dbenv, "illegal DB_HOME environment variable"); return (EINVAL); } return (p == NULL ? 0 : CDB___os_strdup(p, &dbenv->db_home)); } /* * CDB___db_parse -- * Parse a single NAME VALUE pair. */ static int CDB___db_parse(dbenv, s) DB_ENV *dbenv; char *s; { int ret; char *local_s, *name, *value, **p, *tp; /* * We need to strdup the argument in case the caller passed us * static data. */ if ((ret = CDB___os_strdup(s, &local_s)) != 0) return (ret); /* * Name/value pairs are parsed as two white-space separated strings. * Leading and trailing white-space is trimmed from the value, but * it may contain embedded white-space. Note: we use the isspace(3) * macro because it's more portable, but that means that you can use * characters like form-feed to separate the strings. */ name = local_s; for (tp = name; *tp != '\0' && !isspace((int)*tp); ++tp) ; if (*tp == '\0' || tp == name) goto illegal; *tp = '\0'; for (++tp; isspace((int)*tp); ++tp) ; if (*tp == '\0') goto illegal; value = tp; for (++tp; *tp != '\0'; ++tp) ; for (--tp; isspace((int)*tp); --tp) ; ++tp; if (tp == value) { illegal: ret = EINVAL; CDB___db_err(dbenv, "illegal name-value pair: %s", s); goto err; } *tp = '\0'; #define DATA_INIT_CNT 20 /* Start with 20 data slots. */ if (!strcmp(name, "DB_DATA_DIR")) { if (dbenv->db_data_dir == NULL) { if ((ret = CDB___os_calloc(DATA_INIT_CNT, sizeof(char **), &dbenv->db_data_dir)) != 0) goto err; dbenv->data_cnt = DATA_INIT_CNT; } else if (dbenv->data_next == dbenv->data_cnt - 1) { dbenv->data_cnt *= 2; if ((ret = CDB___os_realloc(dbenv->data_cnt * sizeof(char **), NULL, &dbenv->db_data_dir)) != 0) goto err; } p = &dbenv->db_data_dir[dbenv->data_next++]; } else if (!strcmp(name, "DB_LOG_DIR")) { if (dbenv->db_log_dir != NULL) CDB___os_freestr(dbenv->db_log_dir); p = &dbenv->db_log_dir; } else if (!strcmp(name, "DB_TMP_DIR")) { if (dbenv->db_tmp_dir != NULL) CDB___os_freestr(dbenv->db_tmp_dir); p = &dbenv->db_tmp_dir; } else goto err; ret = CDB___os_strdup(value, p); err: /* * !!! * We've inserted nuls into the string as part of parsing it, * so we can't use CDB___os_freestr(), the length won't be correct. */ CDB___os_free(local_s, 0); return (ret); } /* * CDB___db_tmp_open -- * Create a temporary file. */ static int CDB___db_tmp_open(dbenv, tmp_oflags, path, fhp) DB_ENV *dbenv; u_int32_t tmp_oflags; char *path; DB_FH *fhp; { u_long pid; int mode, isdir, ret; const char *p; char *trv; /* * Check the target directory; if you have six X's and it doesn't * exist, this runs for a *very* long time. */ if ((ret = CDB___os_exists(path, &isdir)) != 0) { CDB___db_err(dbenv, "%s: %s", path, CDB_db_strerror(ret)); return (ret); } if (!isdir) { CDB___db_err(dbenv, "%s: %s", path, CDB_db_strerror(EINVAL)); return (EINVAL); } /* Build the path. */ for (trv = path; *trv != '\0'; ++trv) ; *trv = PATH_SEPARATOR[0]; for (p = DB_TRAIL; (*++trv = *p) != '\0'; ++p) ; /* * Replace the X's with the process ID. Pid should be a pid_t, * but we use unsigned long for portability. */ for (pid = getpid(); *--trv == 'X'; pid /= 10) switch (pid % 10) { case 0: *trv = '0'; break; case 1: *trv = '1'; break; case 2: *trv = '2'; break; case 3: *trv = '3'; break; case 4: *trv = '4'; break; case 5: *trv = '5'; break; case 6: *trv = '6'; break; case 7: *trv = '7'; break; case 8: *trv = '8'; break; case 9: *trv = '9'; break; } ++trv; /* Set up open flags and mode. */ mode = CDB___db_omode("rw----"); /* Loop, trying to open a file. */ for (;;) { if ((ret = CDB___os_open(path, tmp_oflags | DB_OSO_CREATE | DB_OSO_EXCL, mode, fhp)) == 0) return (0); /* * XXX: * If we don't get an EEXIST error, then there's something * seriously wrong. Unfortunately, if the implementation * doesn't return EEXIST for O_CREAT and O_EXCL regardless * of other possible errors, we've lost. */ if (ret != EEXIST) { CDB___db_err(dbenv, "tmp_open: %s: %s", path, CDB_db_strerror(ret)); return (ret); } /* * Tricky little algorithm for backward compatibility. * Assumes sequential ordering of lower-case characters. */ for (;;) { if (*trv == '\0') return (EINVAL); if (*trv == 'z') *trv++ = 'a'; else { if (isdigit((int)*trv)) *trv = 'a'; else ++*trv; break; } } } /* NOTREACHED */ } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/env_recover.c����������������������������������������������������������������������0100644�0063146�0012731�00000023750�07427026535�015452� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1996, 1997, 1998, 1999\n\ Sleepycat Software Inc. All rights reserved.\n"; static const char sccsid[] = "@(#)env_recover.c 11.6 (Sleepycat) 10/1/99"; #endif #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "log.h" #include "txn.h" static float CDB___lsn_diff __P((DB_LSN *, DB_LSN *, DB_LSN *, u_int32_t, int)); /* * CDB___db_apprec -- * Perform recovery. * * PUBLIC: int CDB___db_apprec __P((DB_ENV *, u_int32_t)); */ int CDB___db_apprec(dbenv, flags) DB_ENV *dbenv; u_int32_t flags; { DBT data; DB_LSN ckp_lsn, first_lsn, last_lsn, lsn, open_lsn; DB_TXNREGION *region; __txn_ckp_args *ckp_args; time_t now; float nfiles; int is_thread, progress, ret; void *txninfo; COMPQUIET(nfiles, (float)0); /* Initialize the transaction list. */ if ((ret = CDB___db_txnlist_init(&txninfo)) != 0) return (ret); /* * Save the state of the thread flag -- we don't need it on at the * moment because we're single-threaded until recovery is complete. */ is_thread = F_ISSET(dbenv, DB_ENV_THREAD) ? 1 : 0; F_CLR(dbenv, DB_ENV_THREAD); /* * Recovery is done in three passes: * Pass #0: * We need to find the position from which we will open files * We need to open files beginning with the last to next * checkpoint because we might have crashed after writing the * last checkpoint record, but before having written out all * the open file information. * Pass #1: * Read forward through the log from the second to last checkpoint * opening and closing files so that at the end of the log we have * the "current" set of files open. * Pass #2: * Read backward through the log undoing any uncompleted TXNs. * If doing catastrophic recovery, we read to the beginning of * the log, otherwise, to the most recent checkpoint that occurs * before the most recent checkpoint LSN, which is returned by * CDB___log_findckp(). During this pass, checkpoint file information * is ignored, and file openings and closings are undone. * Pass #3: * Read forward through the log from the LSN found in pass #2, * redoing any committed TXNs. During this pass, checkpoint * file information is ignored, and file openings and closings * are redone. */ /* * Pass #0 * Find the second to last checkpoint in the log. This is the point * from which we want to begin pass #1 (the TXN_OPENFILES pass). */ memset(&data, 0, sizeof(data)); ckp_args = NULL; if ((ret = CDB_log_get(dbenv, &ckp_lsn, &data, DB_CHECKPOINT)) != 0) { /* * If we don't find a checkpoint, start from the beginning. * If that fails, we're done. Note, we do not require that * there be log records if we're performing recovery. */ first: if ((ret = CDB_log_get(dbenv, &ckp_lsn, &data, DB_FIRST)) != 0) { if (ret == DB_NOTFOUND) ret = 0; else CDB___db_err(dbenv, "First log record not found"); goto out; } open_lsn = ckp_lsn; } else if ((ret = CDB___txn_ckp_read(data.data, &ckp_args)) != 0) { CDB___db_err(dbenv, "Invalid checkpoint record at [%ld][%ld]\n", (u_long)ckp_lsn.file, (u_long)ckp_lsn.offset); goto out; } else if (IS_ZERO_LSN(ckp_args->last_ckp) || (ret = CDB_log_get(dbenv, &ckp_args->last_ckp, &data, DB_SET)) != 0) goto first; else open_lsn = ckp_args->last_ckp; /* * Find out the last lsn, so that we can estimate how far along we * are in recovery. This will help us determine how much log there * is between the first LSN that we're going to be working with and * the last one. We assume that each of the three phases takes the * same amount of time (a false assumption) and then use the %-age * of the amount of log traversed to figure out how much of the * pass we've accomplished. */ if (dbenv->db_feedback != NULL) { if ((ret = CDB_log_get(dbenv, &last_lsn, &data, DB_LAST)) != 0) goto out; if (last_lsn.file == ckp_lsn.file) nfiles = (float)(last_lsn.offset - ckp_lsn.offset) / dbenv->lg_max; else nfiles = (float)(last_lsn.file - ckp_lsn.file) + (float)(dbenv->lg_max - ckp_lsn.offset + last_lsn.offset) / dbenv->lg_max; } /* * Pass #1 * Now, ckp_lsn is either the lsn of the second to last checkpoint * or the lsn of the first record in the log. Open_lsn is the second * to last checkpoint or the beinning of the log; begin the * TXN_OPENFILES pass from that lsn, and proceed to the end of the log. */ lsn = open_lsn; for (;;) { if (dbenv->tx_recover != NULL) ret = dbenv->tx_recover(dbenv, &data, &lsn, TXN_OPENFILES, txninfo); else ret = CDB___db_dispatch(dbenv, &data, &lsn, TXN_OPENFILES, txninfo); if (ret != 0 && ret != DB_TXN_CKP) goto msgerr; if ((ret = CDB_log_get(dbenv, &lsn, &data, DB_NEXT)) != 0) { if (ret == DB_NOTFOUND) break; goto out; } if (dbenv->db_feedback != NULL) { progress = (int)(33 * CDB___lsn_diff(&ckp_lsn, &last_lsn, &lsn, dbenv->lg_max, 1) / nfiles); dbenv->db_feedback(dbenv, DB_RECOVER, progress); } } /* * Pass #2. * * Before we can begin pass #2, backward roll phase, we determine how * far back in the log to recover. If we are doing catastrophic * recovery, then we go as far back as we have files. If we are * doing normal recovery, we go as back to the most recent checkpoint * that occurs before the most recent checkpoint LSN. */ if (LF_ISSET(DB_RECOVER_FATAL)) { ZERO_LSN(first_lsn); } else if ((ret = CDB___log_findckp(dbenv, &first_lsn)) == DB_NOTFOUND) { /* * We don't require that log files exist if recovery * was specified. */ ret = 0; goto out; } if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) CDB___db_err(dbenv, "Recovery starting from [%lu][%lu]", (u_long)first_lsn.file, (u_long)first_lsn.offset); for (ret = CDB_log_get(dbenv, &lsn, &data, DB_LAST); ret == 0 && CDB_log_compare(&lsn, &first_lsn) > 0; ret = CDB_log_get(dbenv, &lsn, &data, DB_PREV)) { if (dbenv->tx_recover != NULL) ret = dbenv->tx_recover(dbenv, &data, &lsn, TXN_BACKWARD_ROLL, txninfo); else ret = CDB___db_dispatch(dbenv, &data, &lsn, TXN_BACKWARD_ROLL, txninfo); if (ret != 0) { if (ret != DB_TXN_CKP) goto msgerr; else ret = 0; } if (dbenv->db_feedback != NULL) { progress = 34 + (int)(33 * CDB___lsn_diff(&ckp_lsn, &last_lsn, &lsn, dbenv->lg_max, 0) / nfiles); dbenv->db_feedback(dbenv, DB_RECOVER, progress); } } if (ret != 0 && ret != DB_NOTFOUND) goto out; /* * Pass #3. */ for (ret = CDB_log_get(dbenv, &lsn, &data, DB_NEXT); ret == 0; ret = CDB_log_get(dbenv, &lsn, &data, DB_NEXT)) { if (dbenv->tx_recover != NULL) ret = dbenv->tx_recover(dbenv, &data, &lsn, TXN_FORWARD_ROLL, txninfo); else ret = CDB___db_dispatch(dbenv, &data, &lsn, TXN_FORWARD_ROLL, txninfo); if (ret != 0) { if (ret != DB_TXN_CKP) goto msgerr; else ret = 0; } if (dbenv->db_feedback != NULL) { progress = 67 + (int)(33 * CDB___lsn_diff(&ckp_lsn, &last_lsn, &lsn, dbenv->lg_max, 1) / nfiles); dbenv->db_feedback(dbenv, DB_RECOVER, progress); } } if (ret != DB_NOTFOUND) goto out; /* Now close all the db files that are open. */ CDB___log_close_files(dbenv); /* * Now set the last checkpoint lsn and the current time, * take a checkpoint, and reset the txnid. */ (void)time(&now); region = ((DB_TXNMGR *)dbenv->tx_handle)->reginfo.primary; region->last_ckp = ckp_lsn; region->time_ckp = (u_int32_t)now; if ((ret = CDB_txn_checkpoint(dbenv, 0, 0)) != 0) goto out; region->last_txnid = TXN_MINIMUM; if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY)) { CDB___db_err(dbenv, "Recovery complete at %.24s", ctime(&now)); CDB___db_err(dbenv, "%s %lx %s [%lu][%lu]", "Maximum transaction ID", ((DB_TXNHEAD *)txninfo)->maxid, "Recovery checkpoint", (u_long)region->last_ckp.file, (u_long)region->last_ckp.offset); } if (0) { msgerr: CDB___db_err(dbenv, "Recovery function for LSN %lu %lu failed", (u_long)lsn.file, (u_long)lsn.offset); } out: if (is_thread) F_SET(dbenv, DB_ENV_THREAD); CDB___db_txnlist_end(dbenv, txninfo); if (ckp_args != NULL) CDB___os_free(ckp_args, sizeof(*ckp_args)); return (ret); } /* * Figure out how many logfiles we have processed. If we are moving * forward (is_forward != 0), then we're computing current - low. If * we are moving backward, we are compouting high - current. max is * the number of bytes per logfile. */ static float CDB___lsn_diff(low, high, current, max, is_forward) DB_LSN *low, *high, *current; u_int32_t max; int is_forward; { float nf; /* * There are three cases in each direction. If you are in the * same file, then all you need worry about is the difference in * offsets. If you are in different files, then either your offsets * put you either more or less than the integral difference in the * number of files -- we need to handle both of these. */ if (is_forward) { if (current->file == low->file) nf = (float)(current->offset - low->offset) / max; else if (current->offset < low->offset) nf = (float)(current->file - low->file - 1) + (float)(max - low->offset + current->offset) / max; else nf = (float)(current->file - low->file) + (float)(current->offset - low->offset) / max; } else { if (current->file == high->file) nf = (float)(high->offset - current->offset) / max; else if (current->offset > high->offset) nf = (float)(high->file - current->file - 1) + (float)(max - current->offset + high->offset) / max; else nf = (float)(high->file - current->file) + (float)(high->offset - current->offset) / max; } return (nf); } ������������������������htdig-3.2.0b6/db/env_region.c�����������������������������������������������������������������������0100644�0063146�0012731�00000073524�10000513627�015254� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)env_region.c 11.7 (Sleepycat) 11/12/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <errno.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" static int CDB___db_des_destroy __P((DB_ENV *, REGION *)); static int CDB___db_des_get __P((DB_ENV *, REGINFO *, REGINFO *, REGION **)); static int CDB___db_e_remfile __P((DB_ENV *)); static int CDB___db_faultmem __P((void *, size_t, int)); /* * CDB___db_e_attach * Join/create the environment * * PUBLIC: int CDB___db_e_attach __P((DB_ENV *)); */ int CDB___db_e_attach(dbenv) DB_ENV *dbenv; { REGENV *renv; REGENV_REF ref; REGINFO *infop; REGION *rp, tregion; size_t size; ssize_t nrw; u_int32_t mbytes, bytes; int retry_cnt, ret, segid; char buf[sizeof(DB_REGION_FMT) + 20]; #if !defined(HAVE_MUTEX_THREADS) /* * !!! * If we don't have spinlocks, we need a file descriptor for fcntl(2) * locking. We use the file handle from the REGENV file for this * purpose. * * Since we may be using shared memory regions, e.g., shmget(2), and * not a mapped-in regular file, the backing file may be only a few * bytes in length. So, this depends on the ability to call fcntl to * lock file offsets much larger than the actual physical file. I * think that's safe -- besides, very few systems actually need this * kind of support, SunOS is the only one still in wide use of which * I'm aware. * * The error case is if an application lacks spinlocks and wants to be * threaded. That doesn't work because fcntl may lock the underlying * process, including all its threads. */ if (F_ISSET(dbenv, DB_ENV_THREAD)) { CDB___db_err(dbenv, "architecture lacks fast mutexes: applications cannot be threaded"); return (EINVAL); } #endif /* Initialization */ retry_cnt = 0; /* Repeated initialization. */ loop: renv = NULL; /* Set up the DB_ENV's REG_INFO structure. */ if ((ret = CDB___os_calloc(1, sizeof(REGINFO), &infop)) != 0) return (ret); infop->id = REG_ID_ENV; infop->mode = dbenv->db_mode; if (F_ISSET(dbenv, DB_ENV_CREATE)) F_SET(infop, REGION_CREATE_OK); /* * We have to single-thread the creation of the REGENV region. Once * it exists, we can do locking using locks in the region, but until * then we have to be the only player in the game. * * If this is a private environment, we are only called once and there * are no possible race conditions. * * If this is a public environment, we use the filesystem to ensure * the creation of the environment file is single-threaded. */ if (F_ISSET(dbenv, DB_ENV_PRIVATE)) goto creation; /* Build the region name. */ (void)snprintf(buf, sizeof(buf), "%s", DB_REGION_ENV); if ((ret = CDB___db_appname(dbenv, DB_APP_NONE, NULL, buf, 0, NULL, &infop->name)) != 0) goto err; /* * Try to create the file, if we have the authority. We have to ensure * that multiple threads/processes attempting to simultaneously create * the file are properly ordered. Open using the O_CREAT and O_EXCL * flags so that multiple attempts to create the region will return * failure in all but one. POSIX 1003.1 requires that EEXIST be the * errno return value -- I sure hope they're right. */ if (F_ISSET(dbenv, DB_ENV_CREATE)) { if ((ret = CDB___os_open(infop->name, DB_OSO_CREATE | DB_OSO_EXCL, dbenv->db_mode, dbenv->lockfhp)) == 0) goto creation; if (ret != EEXIST) { CDB___db_err(dbenv, "%s: %s", infop->name, CDB_db_strerror(ret)); goto err; } } /* * If we couldn't create the file, try and open it. (If that fails, * we're done.) */ if ((ret = CDB___os_open(infop->name, 0, dbenv->db_mode, dbenv->lockfhp)) != 0) goto err; /* * !!! * The region may be in system memory not backed by the filesystem * (more specifically, not backed by this file), and we're joining * it. In that case, the process that created it will have written * out a REGENV_REF structure as its only contents. We read that * structure before we do anything further, e.g., we can't just map * that file in and then figure out what's going on. * * All of this noise is because some systems don't have a coherent VM * and buffer cache, and what's worse, when you mix operations on the * VM and buffer cache, half the time you hang the system. * * If the file is the size of an REGENV_REF structure, then we know * the real region is in some other memory. (The only way you get a * file that size is to deliberately write it, as it's smaller than * any possible disk sector created by writing a file or mapping the * file into memory.) In which case, retrieve the structure from the * file and use it to acquire the referenced memory. * * If the structure is larger than a REGENV_REF structure, then this * file is backing the shared memory region, and we just map it into * memory. * * And yes, this makes me want to take somebody and kill them. (I * digress -- but you have no freakin' idea. This is unbelievably * stupid and gross, and I've probably spent six months of my life, * now, trying to make different versions of it work.) */ if ((ret = CDB___os_ioinfo(infop->name, dbenv->lockfhp, &mbytes, &bytes, NULL)) != 0) { CDB___db_err(dbenv, "%s: %s", infop->name, CDB_db_strerror(ret)); goto err; } /* * !!! * A size_t is OK -- regions get mapped into memory, and so can't * be larger than a size_t. */ size = mbytes * MEGABYTE + bytes; /* * If the size is 0 or less than the size of a REGENV_REF structure, * the region (or, possibly, the REGENV_REF structure) has not been * fully written. Wait awhile and try again. * * Otherwise, if the size is the size of a REGENV_REF structure, * read it into memory and use it as a reference to the real region. */ segid = INVALID_REGION_SEGID; if (size <= sizeof(ref)) { if (size != sizeof(ref)) goto retry; if ((ret = CDB___os_read(dbenv->lockfhp, &ref, sizeof(ref), &nrw)) != 0 || nrw < (ssize_t)sizeof(ref)) { if (ret == 0) ret = EIO; CDB___db_err(dbenv, "%s: unable to read system-memory information from: %s", infop->name, CDB_db_strerror(ret)); goto err; } size = ref.size; segid = ref.segid; F_SET(dbenv, DB_ENV_SYSTEM_MEM); } /* * If not doing thread locking, we need to save the file handle for * fcntl(2) locking. Otherwise, discard the handle, we no longer * need it, and the less contact between the buffer cache and the VM, * the better. */ #ifdef HAVE_MUTEX_THREADS CDB___os_closehandle(dbenv->lockfhp); #endif /* Call the region join routine to acquire the region. */ memset(&tregion, 0, sizeof(tregion)); tregion.size = size; tregion.segid = segid; if ((ret = CDB___os_r_attach(dbenv, infop, &tregion)) != 0) goto err; /* * The environment's REGENV structure has to live at offset 0 instead * of the usual shalloc information. Set the primary reference and * correct the "addr" value to reference the shalloc region. Note, * this means that all of our offsets (R_ADDR/R_OFFSET) get shifted * as well, but that should be fine. */ infop->primary = R_ADDR(infop, 0); infop->addr = (u_int8_t *)infop->addr + sizeof(REGENV); /* * Check if the environment has had a catastrophic failure. * * Check the magic number to ensure the region is initialized. If the * magic number isn't set, the lock may not have been initialized, and * an attempt to use it could lead to random behavior. * * The panic and magic values aren't protected by any lock, so we never * use them in any check that's more complex than set/not-set. * * !!! * I'd rather play permissions games using the underlying file, but I * can't because Windows/NT filesystems won't open files mode 0. */ renv = infop->primary; if (renv->panic) { ret = CDB___db_panic_msg(dbenv); goto err; } if (renv->magic != DB_REGION_MAGIC) goto retry; /* Lock the environment. */ MUTEX_LOCK(&renv->mutex, dbenv->lockfhp); /* * Finally! We own the environment now. Repeat the panic check, it's * possible that it was set while we waited for the lock. */ if (renv->panic) { ret = CDB___db_panic_msg(dbenv); goto err_unlock; } /* * Get a reference to the underlying REGION information for this * environment. */ if ((ret = CDB___db_des_get(dbenv, infop, infop, &rp)) != 0) goto err_unlock; if (rp == NULL) { CDB___db_err(dbenv, "%s: unable to find environment REGION", infop->name); ret = EINVAL; goto err_unlock; } infop->rp = rp; /* * There's still a possibility for inconsistent data. When we acquired * the size of the region and attached to it, it might have still been * growing as part of its creation. We can detect this by checking the * size we originally found against the region's current size. (The * region's current size has to be final, the creator finished growing * it before releasing the environment for us to lock.) */ if (rp->size != size) { err_unlock: MUTEX_UNLOCK(&renv->mutex); goto retry; } /* Increment the reference count. */ ++renv->refcnt; /* Discard our lock. */ MUTEX_UNLOCK(&renv->mutex); /* * Fault the pages into memory. Note, do this AFTER releasing the * lock, because we're only reading the pages, not writing them. */ (void)CDB___db_faultmem(infop->primary, rp->size, 0); /* Everything looks good, we're done. */ dbenv->reginfo = infop; return (0); creation: /* Create the environment region. */ F_SET(infop, REGION_CREATE); /* * Allocate room for 50 REGION structures plus overhead (we're going * to use this space for last-ditch allocation requests), although we * should never need anything close to that. */ memset(&tregion, 0, sizeof(tregion)); tregion.size = 50 * sizeof(REGION) + 50 * sizeof(MUTEX) + 2048; tregion.segid = INVALID_REGION_SEGID; if ((ret = CDB___os_r_attach(dbenv, infop, &tregion)) != 0) goto err; /* * Fault the pages into memory. Note, do this BEFORE we initialize * anything, because we're writing the pages, not just reading them. */ (void)CDB___db_faultmem(infop->addr, tregion.size, 1); /* * The first object in the region is the REGENV structure. This is * different from the other regions, and, from everything else in * this region, where all objects are allocated from the pool, i.e., * there aren't any fixed locations. The remaining space is made * available for later allocation. * * The allocation space must be size_t aligned, because that's what * the initialization routine is going to store there. To make sure * that happens, the REGENV structure was padded with a final size_t. * No other region needs to worry about it because all of them treat * the entire region as allocation space. * * Set the primary reference and correct the "addr" value to reference * the shalloc region. Note, this requires that we "uncorrect" it at * region detach, and that all of our offsets (R_ADDR/R_OFFSET) will be * shifted as well, but that should be fine. */ infop->primary = R_ADDR(infop, 0); infop->addr = (u_int8_t *)infop->addr + sizeof(REGENV); CDB___db_shalloc_init(infop->addr, tregion.size - sizeof(REGENV)); /* * Initialize the rest of the REGENV structure, except for the magic * number which validates the file/environment. */ renv = infop->primary; renv->panic = 0; CDB_db_version(&renv->majver, &renv->minver, &renv->patch); SH_LIST_INIT(&renv->regionq); renv->refcnt = 1; /* * Lock the environment. * * Check the lock call return. This is the first lock we initialize * and acquire, and we have to know if it fails. (It CAN fail, e.g., * SunOS, when using fcntl(2) for locking and using an in-memory * filesystem as the database home. But you knew that, I'm sure -- it * probably wasn't even worth mentioning.) */ if ((ret = __db_mutex_init(dbenv, &renv->mutex, DB_FCNTL_OFF_GEN, 0)) != 0) { CDB___db_err(dbenv, "%s: unable to initialize environment lock: %s", infop->name, CDB_db_strerror(ret)); goto err; } if (!F_ISSET(&renv->mutex, MUTEX_IGNORE) && (ret = __db_mutex_lock(&renv->mutex, dbenv->lockfhp)) != 0) { CDB___db_err(dbenv, "%s: unable to acquire environment lock: %s", infop->name, CDB_db_strerror(ret)); goto err; } /* * Get the underlying REGION structure for this environment. Note, * we created the underlying OS region before we acquired the REGION * structure, which is backwards from the normal procedure. Update * the REGION structure. */ if ((ret = CDB___db_des_get(dbenv, infop, infop, &rp)) != 0) goto err; infop->rp = rp; rp->size = tregion.size; rp->segid = tregion.segid; /* * !!! * If we create an environment where regions are public and in system * memory, we have to inform processes joining the environment how to * attach to the shared memory segment. So, we write the shared memory * identifier into the file, to be read by those other processes. * * XXX * This is really OS-layer information, but I can't see any easy way * to move it down there without passing down information that it has * no right to know, e.g., that this is the one-and-only REGENV region * and not some other random region. */ if (tregion.segid != INVALID_REGION_SEGID) { ref.size = tregion.size; ref.segid = tregion.segid; if ((ret = CDB___os_write(dbenv->lockfhp, &ref, sizeof(ref), &nrw)) != 0 || nrw != sizeof(ref)) { CDB___db_err(dbenv, "%s: unable to write out public environment ID: %s", infop->name, CDB_db_strerror(ret)); goto err; } } /* * If not doing thread locking, we need to save the file handle for * fcntl(2) locking. Otherwise, discard the handle, we no longer * need it, and the less contact between the buffer cache and the VM, * the better. */ #if defined(HAVE_MUTEX_THREADS) if (F_ISSET(dbenv->lockfhp, DB_FH_VALID)) CDB___os_closehandle(dbenv->lockfhp); #endif /* Validate the file. */ renv->magic = DB_REGION_MAGIC; /* Discard our lock. */ MUTEX_UNLOCK(&renv->mutex); /* Everything looks good, we're done. */ dbenv->reginfo = infop; return (0); err: retry: /* Close any open file handle. */ if (F_ISSET(dbenv->lockfhp, DB_FH_VALID)) (void)CDB___os_closehandle(dbenv->lockfhp); /* * If we joined or created the region, detach from it. If we created * it, destroy it. Note, there's a path in the above code where we're * using a temporary REGION structure because we haven't yet allocated * the real one. In that case the region address (addr) will be filled * in, but the REGION pointer (rp) won't. Fix it. */ if (infop->addr != NULL) { if (infop->rp == NULL) infop->rp = &tregion; /* Reset the addr value that we "corrected" above. */ infop->addr = infop->primary; (void)CDB___os_r_detach(dbenv, infop, F_ISSET(infop, REGION_CREATE)); } /* Free the allocated name and/or REGINFO structure. */ if (infop->name != NULL) CDB___os_freestr(infop->name); CDB___os_free(infop, sizeof(REGINFO)); /* If we had a temporary error, wait awhile and try again. */ if (ret == 0) { if (++retry_cnt > 3) { CDB___db_err(dbenv, "unable to join the environment"); ret = EAGAIN; } else { CDB___os_sleep(retry_cnt * 3, 0); goto loop; } } return (ret); } /* * CDB___db_e_detach -- * Detach from the environment. * * PUBLIC: int CDB___db_e_detach __P((DB_ENV *, int)); */ int CDB___db_e_detach(dbenv, destroy) DB_ENV *dbenv; int destroy; { REGENV *renv; REGINFO *infop; infop = dbenv->reginfo; renv = infop->primary; /* Lock the environment. */ MUTEX_LOCK(&renv->mutex, dbenv->lockfhp); /* Decrement the reference count. */ if (renv->refcnt == 0) { CDB___db_err(dbenv, "region %lu (environment): reference count went negative", infop->rp->id); } else --renv->refcnt; /* Release the lock. */ MUTEX_UNLOCK(&renv->mutex); /* Close the locking file handle. */ if (F_ISSET(dbenv->lockfhp, DB_FH_VALID)) (void)CDB___os_closehandle(dbenv->lockfhp); /* Reset the addr value that we "corrected" above. */ infop->addr = infop->primary; /* * Release the region, and kill our reference. * * We set the DBENV->reginfo field to NULL here and discard its memory. * DBENV->remove calls CDB___dbenv_remove to do the region remove, and * CDB___dbenv_remove attached and then detaches from the region. We don't * want to return to DBENV->remove with a non-NULL DBENV->reginfo field * because it will attempt to detach again as part of its cleanup. */ (void)CDB___os_r_detach(dbenv, infop, destroy); if (infop->name != NULL) CDB___os_free(infop->name, 0); CDB___os_free(dbenv->reginfo, sizeof(REGINFO)); dbenv->reginfo = NULL; return (0); } /* * CDB___db_e_remove -- * Discard an environment if it's not in use. * * PUBLIC: int CDB___db_e_remove __P((DB_ENV *, int)); */ int CDB___db_e_remove(dbenv, force) DB_ENV *dbenv; int force; { REGENV *renv; REGINFO *infop, reginfo; REGION *rp; int ret, saved_value; /* * This routine has to walk a nasty line between not looking into * the environment (which may be corrupted after an app or system * crash), and removing everything that needs removing. What we * do is: * 1. Connect to the environment (so it better be OK). * 2. If the environment is in use (reference count is non-zero), * return EBUSY. * 3. Overwrite the magic number so that any threads of control * attempting to connect will backoff and retry. * 4. Walk the list of regions. Connect to each region and then * disconnect with the destroy flag set. This shouldn't cause * any problems, even if the region is corrupted, because we * should never be looking inside the region. * 5. Walk the list of files in the directory, unlinking any * files that match a region name. Unlink the environment * file last. * * If the force flag is set, we do not acquire any locks during this * process. */ saved_value = DB_GLOBAL(db_mutexlocks); if (force) DB_GLOBAL(db_mutexlocks) = 0; /* Join the environment. */ if ((ret = CDB___db_e_attach(dbenv)) != 0) { /* * If we can't join it, we assume that's because it doesn't * exist. It would be better to know why we failed, but it * probably isn't important. */ ret = 0; if (force) goto remfiles; goto err; } infop = dbenv->reginfo; renv = infop->primary; /* Lock the environment. */ MUTEX_LOCK(&renv->mutex, dbenv->lockfhp); /* If it's in use, we're done. */ if (renv->refcnt == 1 || force) { /* * Set the panic flag and overwrite the magic number. * * !!! * From this point on, there's no going back, we pretty * much ignore errors, and just whack on whatever we can. */ renv->panic = 1; renv->magic = 0; /* * Unlock the environment. We should no longer need the lock * because we've poisoned the pool, but we can't continue to * hold it either, because other routines may want it. */ MUTEX_UNLOCK(&renv->mutex); /* * Attach to each sub-region and destroy it. * * !!! * The REGION_CREATE_OK flag is set for Windows/95 -- regions * are zero'd out when the last reference to the region goes * away, in which case the underlying OS region code requires * callers be prepared to create the region in order to join it. */ memset(®info, 0, sizeof(reginfo)); restart: for (rp = SH_LIST_FIRST(&renv->regionq, __db_region); rp != NULL; rp = SH_LIST_NEXT(rp, q, __db_region)) { if (rp->id == REG_ID_ENV) continue; reginfo.id = rp->id; reginfo.flags = REGION_CREATE_OK; if (CDB___db_r_attach(dbenv, ®info, 0) == 0) { R_UNLOCK(dbenv, ®info); (void)CDB___db_r_detach(dbenv, ®info, 1); } goto restart; } /* Destroy the environment's region. */ (void)CDB___db_e_detach(dbenv, 1); /* Discard the physical files. */ remfiles: (void)CDB___db_e_remfile(dbenv); } else { /* Unlock the environment. */ MUTEX_UNLOCK(&renv->mutex); /* Discard the environment. */ (void)CDB___db_e_detach(dbenv, 0); ret = EBUSY; } err: if (force) DB_GLOBAL(db_mutexlocks) = saved_value; return (ret); } /* * CDB___db_e_remfile -- * Discard any region files in the filesystem. */ static int CDB___db_e_remfile(dbenv) DB_ENV *dbenv; { static char *old_region_names[] = { "__db_lock.share", "__db_log.share", "__db_mpool.share", "__db_txn.share", NULL, }; int cnt, fcnt, lastrm, ret; u_int8_t saved_byte; const char *dir; char *p, **names, *path, buf[sizeof(DB_REGION_FMT) + 20]; /* Get the full path of a file in the environment. */ (void)snprintf(buf, sizeof(buf), "%s", DB_REGION_ENV); if ((ret = CDB___db_appname(dbenv, DB_APP_NONE, NULL, buf, 0, NULL, &path)) != 0) return (ret); /* Get the parent directory for the environment. */ if ((p = CDB___db_rpath(path)) == NULL) { p = path; saved_byte = *p; dir = PATH_DOT; } else { saved_byte = *p; *p = '\0'; dir = path; } /* Get the list of file names. */ ret = CDB___os_dirlist(dir, &names, &fcnt); /* Restore the path, and free it. */ *p = saved_byte; CDB___os_freestr(path); if (ret != 0) { CDB___db_err(dbenv, "%s: %s", dir, CDB_db_strerror(ret)); return (ret); } /* * Search for valid region names, and remove them. We remove the * environment region last, because it's the key to this whole mess. */ for (lastrm = -1, cnt = fcnt; --cnt >= 0;) { if (strlen(names[cnt]) != DB_REGION_NAME_LENGTH || memcmp(names[cnt], DB_REGION_FMT, DB_REGION_NAME_NUM) != 0) continue; if (strcmp(names[cnt], DB_REGION_ENV) == 0) { lastrm = cnt; continue; } for (p = names[cnt] + DB_REGION_NAME_NUM; *p != '\0' && isdigit((int)*p); ++p) ; if (*p != '\0') continue; if (CDB___db_appname(dbenv, DB_APP_NONE, NULL, names[cnt], 0, NULL, &path) == 0) { (void)CDB___os_unlink(path); CDB___os_freestr(path); } } if (lastrm != -1) if (CDB___db_appname(dbenv, DB_APP_NONE, NULL, names[lastrm], 0, NULL, &path) == 0) { (void)CDB___os_unlink(path); CDB___os_freestr(path); } CDB___os_dirfree(names, fcnt); /* * !!! * Backward compatibility -- remove region files from releases * before 2.8.XX. */ for (names = (char **)old_region_names; *names != NULL; ++names) if (CDB___db_appname(dbenv, DB_APP_NONE, NULL, *names, 0, NULL, &path) == 0) { (void)CDB___os_unlink(path); CDB___os_freestr(path); } return (0); } /* * CDB___db_e_stat * Statistics for the environment. * * PUBLIC: int CDB___db_e_stat __P((DB_ENV *, REGENV *, REGION *, int *)); */ int CDB___db_e_stat(dbenv, arg_renv, arg_regions, arg_regions_cnt) DB_ENV *dbenv; REGENV *arg_renv; REGION *arg_regions; int *arg_regions_cnt; { REGENV *renv; REGINFO *infop; REGION *rp; int n; infop = dbenv->reginfo; renv = infop->primary; rp = infop->rp; /* Lock the environment. */ MUTEX_LOCK(&rp->mutex, dbenv->lockfhp); *arg_renv = *renv; for (n = 0, rp = SH_LIST_FIRST(&renv->regionq, __db_region); n < *arg_regions_cnt && rp != NULL; ++n, rp = SH_LIST_NEXT(rp, q, __db_region)) arg_regions[n] = *rp; /* Release the lock. */ rp = infop->rp; MUTEX_UNLOCK(&rp->mutex); *arg_regions_cnt = n == 0 ? n : n - 1; return (0); } /* * CDB___db_r_attach * Join/create a region. * * PUBLIC: int CDB___db_r_attach __P((DB_ENV *, REGINFO *, size_t)); */ int CDB___db_r_attach(dbenv, infop, size) DB_ENV *dbenv; REGINFO *infop; size_t size; { REGENV *renv; REGION *rp; int ret; char buf[sizeof(DB_REGION_FMT) + 20]; renv = ((REGINFO *)dbenv->reginfo)->primary; F_CLR(infop, REGION_CREATE); /* Lock the environment. */ MUTEX_LOCK(&renv->mutex, dbenv->lockfhp); /* Find or create a REGION structure for this region. */ if ((ret = CDB___db_des_get(dbenv, dbenv->reginfo, infop, &rp)) != 0) { MUTEX_UNLOCK(&renv->mutex); return (ret); } infop->rp = rp; infop->id = rp->id; /* If we're creating the region, set the desired size. */ if (F_ISSET(infop, REGION_CREATE)) rp->size = size; /* Join/create the underlying region. */ (void)snprintf(buf, sizeof(buf), DB_REGION_FMT, infop->id); if ((ret = CDB___db_appname(dbenv, DB_APP_NONE, NULL, buf, 0, NULL, &infop->name)) != 0) goto err; if ((ret = CDB___os_r_attach(dbenv, infop, rp)) != 0) goto err; /* * Fault the pages into memory. Note, do this BEFORE we initialize * anything because we're writing pages in created regions, not just * reading them. */ (void)CDB___db_faultmem(infop->addr, rp->size, F_ISSET(infop, REGION_CREATE)); /* * !!! * The underlying layer may have just decided that we are going * to create the region. There are various system issues that * can result in a useless region that requires re-initialization. * * If we created the region, initialize it for allocation. */ if (F_ISSET(infop, REGION_CREATE)) { ((REGION *)(infop->addr))->magic = DB_REGION_MAGIC; (void)CDB___db_shalloc_init(infop->addr, rp->size); } /* * If the underlying REGION isn't the environment, acquire a lock * for it and release our lock on the environment. */ if (infop->id != REG_ID_ENV) { MUTEX_LOCK(&rp->mutex, dbenv->lockfhp); MUTEX_UNLOCK(&renv->mutex); } return (0); /* Discard the underlying region. */ err: if (infop->addr != NULL) (void)CDB___os_r_detach(dbenv, infop, F_ISSET(infop, REGION_CREATE)); infop->rp = NULL; infop->id = REG_ID_INVALID; /* Discard the REGION structure if we created it. */ if (F_ISSET(infop, REGION_CREATE)) (void)CDB___db_des_destroy(dbenv, rp); /* Release the environment lock. */ MUTEX_UNLOCK(&renv->mutex); return (ret); } /* * CDB___db_r_detach -- * Detach from a region. * * PUBLIC: int CDB___db_r_detach __P((DB_ENV *, REGINFO *, int)); */ int CDB___db_r_detach(dbenv, infop, destroy) DB_ENV *dbenv; REGINFO *infop; int destroy; { REGENV *renv; REGION *rp; int ret, t_ret; renv = ((REGINFO *)dbenv->reginfo)->primary; rp = infop->rp; /* Lock the environment. */ MUTEX_LOCK(&renv->mutex, dbenv->lockfhp); /* Acquire the lock for the REGION. */ MUTEX_LOCK(&rp->mutex, dbenv->lockfhp); /* Detach from the underlying OS region. */ ret = CDB___os_r_detach(dbenv, infop, destroy); /* Release the REGION lock. */ MUTEX_UNLOCK(&rp->mutex); /* If we destroyed the region, discard the REGION structure. */ if (destroy && ((t_ret = CDB___db_des_destroy(dbenv, rp)) != 0) && ret == 0) ret = t_ret; /* Release the environment lock. */ MUTEX_UNLOCK(&renv->mutex); /* Destroy the structure. */ if (infop->name != NULL) CDB___os_freestr(infop->name); return (ret); } /* * CDB___db_des_get -- * Return a reference to the shared information for a REGION, * optionally creating a new entry. */ static int CDB___db_des_get(dbenv, env_infop, infop, rpp) DB_ENV *dbenv; REGINFO *env_infop, *infop; REGION **rpp; { REGENV *renv; REGION *rp; int maxid, ret; /* * !!! * Called with the environment already locked. */ *rpp = NULL; renv = env_infop->primary; maxid = REG_ID_ASSIGN; for (rp = SH_LIST_FIRST(&renv->regionq, __db_region); rp != NULL; rp = SH_LIST_NEXT(rp, q, __db_region)) { if (rp->id == infop->id) break; if (rp->id > maxid) maxid = rp->id; } /* * If we didn't find a region, or we found one needing initialization, * and we can't create the region, fail. */ if (!F_ISSET(infop, REGION_CREATE_OK) && (rp == NULL || F_ISSET(rp, REG_DEAD))) return (ENOENT); /* * If we didn't find a region, create and initialize a REGION structure * for the caller. If id was set, use that value, otherwise we use the * next available ID. */ if (rp == NULL) { if ((ret = CDB___db_shalloc(env_infop->addr, sizeof(REGION), MUTEX_ALIGN, &rp)) != 0) return (ret); /* Initialize the region. */ memset(rp, 0, sizeof(*rp)); if ((ret = __db_mutex_init(dbenv, &rp->mutex, R_OFFSET(env_infop, &rp->mutex) + DB_FCNTL_OFF_GEN, 0)) != 0) { CDB___db_shalloc_free(env_infop->addr, rp); return (ret); } rp->segid = INVALID_REGION_SEGID; rp->id = infop->id == REG_ID_INVALID ? maxid + 1 : infop->id; SH_LIST_INSERT_HEAD(&renv->regionq, rp, q, __db_region); F_SET(infop, REGION_CREATE); } else { /* * There is one race -- a caller created a region, was trying * to initialize it for general use, and failed somehow. We * leave the region around and tell each new caller that they * are creating it, because that's easier than dealing with * the races involved in removing it. */ if (F_ISSET(rp, REG_DEAD)) { rp->primary = INVALID_ROFF; F_CLR(rp, REG_DEAD); F_SET(infop, REGION_CREATE); } } *rpp = rp; return (0); } /* * CDB___db_des_destroy -- * Destroy a reference to a REGION. */ static int CDB___db_des_destroy(dbenv, rp) DB_ENV *dbenv; REGION *rp; { REGINFO *infop; /* * !!! * Called with the environment already locked. */ infop = dbenv->reginfo; SH_LIST_REMOVE(rp, q, __db_region); CDB___db_shalloc_free(infop->addr, rp); return (0); } /* * CDB___db_faultmem -- * Fault the region into memory. */ static int CDB___db_faultmem(addr, size, created) void *addr; size_t size; int created; { int ret; u_int8_t *p, *t; /* * It's sometimes significantly faster to page-fault in all of the * region's pages before we run the application, as we see nasty * side-effects when we page-fault while holding various locks, i.e., * the lock takes a long time to acquire because of the underlying * page fault, and the other threads convoy behind the lock holder. * * If we created the region, we write a non-zero value so that the * system can't cheat. If we're just joining the region, we can * only read the value and try to confuse the compiler sufficiently * that it doesn't figure out that we're never really using it. */ ret = 0; if (DB_GLOBAL(db_region_init)) { if (created) for (p = addr, t = (u_int8_t *)addr + size; p < t; p += OS_VMPAGESIZE) p[0] = 0xdb; else for (p = addr, t = (u_int8_t *)addr + size; p < t; p += OS_VMPAGESIZE) ret |= p[0]; } return (ret); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash.c�����������������������������������������������������������������������������0100644�0063146�0012731�00000143320�10062360563�014043� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash.c 11.29 (Sleepycat) 11/14/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_am.h" #include "db_ext.h" #include "db_shash.h" #include "db_swap.h" #include "hash.h" #include "btree.h" #include "log.h" #include "lock.h" #include "txn.h" static int CDB___ham_c_close __P((DBC *)); static int CDB___ham_c_del __P((DBC *, u_int32_t)); static int CDB___ham_c_destroy __P((DBC *)); static int CDB___ham_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___ham_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___ham_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); static int CDB___ham_dup_return __P((DBC *, DBT *, u_int32_t)); static int CDB___ham_expand_table __P((DBC *)); static int CDB___ham_init_htab __P((DBC *, const char *, db_pgno_t, u_int32_t, u_int32_t)); static int CDB___ham_lookup __P((DBC *, const DBT *, u_int32_t, db_lockmode_t)); static int CDB___ham_overwrite __P((DBC *, DBT *)); /* * CDB___ham_metachk -- * * PUBLIC: int CDB___ham_metachk __P((DB *, const char *, HMETA *)); */ int CDB___ham_metachk(dbp, name, hashm) DB *dbp; const char *name; HMETA *hashm; { DB_ENV *dbenv; u_int32_t vers; int ret; dbenv = dbp->dbenv; /* * At this point, all we know is that the magic number is for a Hash. * Check the version, the database may be out of date. */ vers = hashm->dbmeta.version; if (F_ISSET(dbp, DB_AM_SWAP)) M_32_SWAP(vers); switch (vers) { case 4: /* FALLTHROUGH */ case 5: CDB___db_err(dbenv, "%s: hash version %lu requires a version upgrade", name, (u_long)vers); return (DB_OLD_VERSION); case 6: break; default: CDB___db_err(dbenv, "%s: unsupported hash version: %lu", name, (u_long)vers); return (EINVAL); } /* Swap the page if we need to. */ if (F_ISSET(dbp, DB_AM_SWAP) && (ret = CDB___ham_mswap((PAGE *)hashm)) != 0) return (ret); /* Check the type. */ if (dbp->type != DB_HASH && dbp->type != DB_UNKNOWN) return (EINVAL); dbp->type = DB_HASH; DB_ILLEGAL_METHOD(dbp, DB_OK_HASH); /* * Check application info against metadata info, and set info, flags, * and type based on metadata info. */ if ((ret = CDB___db_fchk(dbenv, "DB->open", hashm->dbmeta.flags, DB_HASH_DUP | DB_HASH_SUBDB)) != 0) return (ret); if (F_ISSET(&hashm->dbmeta, DB_HASH_DUP)) F_SET(&hashm->dbmeta, DB_HASH_DUP); else if (F_ISSET(dbp, DB_AM_DUP)) { CDB___db_err(dbenv, "%s: DB_DUP specified to open method but not set in database", name); return (EINVAL); } if (F_ISSET(&hashm->dbmeta, DB_HASH_SUBDB)) F_SET(dbp, DB_AM_SUBDB); else if (F_ISSET(dbp, DB_AM_SUBDB)) { CDB___db_err(dbenv, "%s: subdatabase specified but not supported in database", name); return (EINVAL); } /* Set the page size. */ dbp->pgsize = hashm->dbmeta.pagesize; F_CLR(dbp, DB_AM_PGDEF); /* Copy the file's ID. */ memcpy(dbp->fileid, hashm->dbmeta.uid, DB_FILE_ID_LEN); return (0); } /* * CDB___ham_open -- * * PUBLIC: int CDB___ham_open __P((DB *, const char *, db_pgno_t)); */ int CDB___ham_open(dbp, name, base_pgno) DB *dbp; const char *name; db_pgno_t base_pgno; { DB_ENV *dbenv; DBC *dbc; HASH_CURSOR *hcp; HASH *hashp; int need_sync, ret, t_ret; dbc = NULL; dbenv = dbp->dbenv; need_sync = 0; /* Initialize the remaining fields/methods of the DB. */ dbp->del = CDB___ham_delete; dbp->stat = CDB___ham_stat; /* Get a cursor we can use for the rest of this function. */ if ((ret = dbp->cursor(dbp, dbp->open_txn, &dbc, 0)) != 0) return (ret); hcp = (HASH_CURSOR *)dbc->internal; hashp = dbp->h_internal; hashp->meta_pgno = base_pgno; if ((ret = CDB___ham_get_meta(dbc)) != 0) goto err1; /* * If this is a new file, initialize it, and put it back dirty. * * Initialize the hdr structure. */ if (hcp->hdr->dbmeta.magic == DB_HASHMAGIC) { /* File exists, verify the data in the header. */ if (hashp->h_hash == NULL) hashp->h_hash = hcp->hdr->dbmeta.version < 5 ? CDB___ham_func4 : CDB___ham_func5; if (hashp->h_hash(CHARKEY, sizeof(CHARKEY)) != hcp->hdr->h_charkey) { CDB___db_err(dbp->dbenv, "hash: incompatible hash function"); ret = EINVAL; goto err2; } if (F_ISSET(&hcp->hdr->dbmeta, DB_HASH_DUP)) F_SET(dbp, DB_AM_DUP); if (F_ISSET(&hcp->hdr->dbmeta, DB_HASH_SUBDB)) F_SET(dbp, DB_AM_SUBDB); } else { /* * File does not exist, we must initialize the header. If * locking is enabled that means getting a write lock first. */ dbc->lock.pgno = base_pgno; if (F_ISSET(dbenv, DB_ENV_LOCKING) && ((ret = CDB_lock_put(dbenv, &hcp->hlock)) != 0 || (ret = CDB_lock_get(dbenv, dbc->locker, DB_NONBLOCK(dbc) ? DB_LOCK_NOWAIT : 0, &dbc->lock_dbt, DB_LOCK_WRITE, &hcp->hlock)) != 0)) goto err2; if ((ret = CDB___ham_init_htab(dbc, name, base_pgno, hashp->h_nelem, hashp->h_ffactor)) != 0) goto err2; need_sync = 1; } /* Make sure we always have a valid hashp->h_hash function. */ if (hashp->h_hash == NULL) hashp->h_hash = hcp->hdr->dbmeta.version < 5 ? CDB___ham_func4 : CDB___ham_func5; err2: /* Release the meta data page */ if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0) ret = t_ret; err1: if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; /* Sync the file so that we know that the meta data goes to disk. */ if (ret == 0 && need_sync) ret = dbp->sync(dbp, 0); #if CONFIG_TEST if (ret == 0) DB_TEST_RECOVERY(dbp, DB_TEST_POSTSYNC, ret, name); DB_TEST_RECOVERY_LABEL #endif if (ret != 0) (void)CDB___ham_db_close(dbp); return (ret); } /************************** LOCAL CREATION ROUTINES **********************/ /* * Returns 0 on No Error */ static int CDB___ham_init_htab(dbc, name, pgno, nelem, ffactor) DBC *dbc; const char *name; db_pgno_t pgno; u_int32_t nelem, ffactor; { DB *dbp; DB_LOCK metalock; DB_LSN orig_lsn; DBMETA *mmeta; HASH_CURSOR *hcp; HASH *hashp; PAGE *h; db_pgno_t mpgno; int32_t l2, nbuckets; int dirty_mmeta, i, ret, t_ret; hcp = (HASH_CURSOR *)dbc->internal; dbp = dbc->dbp; hashp = dbp->h_internal; mmeta = NULL; dirty_mmeta = 0; metalock.off = LOCK_INVALID; if (hashp->h_hash == NULL) hashp->h_hash = DB_HASHVERSION < 5 ? CDB___ham_func4 : CDB___ham_func5; if (nelem != 0 && ffactor != 0) { nelem = (nelem - 1) / ffactor + 1; l2 = CDB___db_log2(nelem > 2 ? nelem : 2); } else l2 = 1; nbuckets = 1 << l2; orig_lsn = hcp->hdr->dbmeta.lsn; memset(hcp->hdr, 0, sizeof(HMETA)); ZERO_LSN(hcp->hdr->dbmeta.lsn); hcp->hdr->dbmeta.pgno = pgno; hcp->hdr->dbmeta.magic = DB_HASHMAGIC; hcp->hdr->dbmeta.version = DB_HASHVERSION; hcp->hdr->dbmeta.pagesize = dbp->pgsize; hcp->hdr->dbmeta.type = P_HASHMETA; hcp->hdr->dbmeta.free = PGNO_INVALID; hcp->hdr->max_bucket = hcp->hdr->high_mask = nbuckets - 1; hcp->hdr->low_mask = (nbuckets >> 1) - 1; hcp->hdr->ffactor = ffactor; hcp->hdr->h_charkey = hashp->h_hash(CHARKEY, sizeof(CHARKEY)); memcpy(hcp->hdr->dbmeta.uid, dbp->fileid, DB_FILE_ID_LEN); if (F_ISSET(dbp, DB_AM_DUP)) F_SET(&hcp->hdr->dbmeta, DB_HASH_DUP); if (F_ISSET(dbp, DB_AM_SUBDB)) { F_SET(&hcp->hdr->dbmeta, DB_HASH_SUBDB); /* * If this is a subdatabase, then we need to get the LSN * off the master meta data page because that's where free * pages are linked and during recovery we need to access * that page and roll it backward/forward correctly with * respect to LSN. */ mpgno = PGNO_BASE_MD; if ((ret = CDB___db_lget(dbc, 0, mpgno, DB_LOCK_WRITE, 0, &metalock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &mpgno, 0, (PAGE **)&mmeta)) != 0) goto err; } if ((ret = CDB___ham_dirty_page(dbp, (PAGE *)hcp->hdr)) != 0) goto err; /* * Create the first and second buckets pages so that we have the * page numbers for them and we can store that page number * in the meta-data header (spares[0]). */ hcp->hdr->spares[0] = nbuckets; if ((ret = CDB_memp_fget(dbp->mpf, &hcp->hdr->spares[0], DB_MPOOL_NEW_GROUP, &h)) != 0) goto err; P_INIT(h, dbp->pgsize, hcp->hdr->spares[0], PGNO_INVALID, PGNO_INVALID, 0, P_HASH); /* Fill in the last fields of the meta data page. */ hcp->hdr->spares[0] -= (nbuckets - 1); for (i = 1; i <= l2; i++) hcp->hdr->spares[i] = hcp->hdr->spares[0]; for (; i < NCACHED; i++) hcp->hdr->spares[i] = PGNO_INVALID; /* * Before we are about to put any dirty pages, we need to log * the meta-data page create. */ ret = CDB___db_log_page(dbp, name, &orig_lsn, pgno, (PAGE *)hcp->hdr); if (dbp->open_txn != NULL) { if ((t_ret = CDB___ham_groupalloc_log(dbp->dbenv, dbp->open_txn, &hcp->hdr->dbmeta.lsn, 0, dbp->log_fileid, hcp->hdr->dbmeta.pgno, &hcp->hdr->dbmeta.lsn, mmeta == NULL ? &hcp->hdr->dbmeta.lsn : &mmeta->lsn, hcp->hdr->spares[0], hcp->hdr->max_bucket + 1)) != 0 && ret == 0) ret = t_ret; if (t_ret == 0 && mmeta != NULL) { mmeta->lsn = hcp->hdr->dbmeta.lsn; dirty_mmeta = 1; } } DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOG, ret, name); DB_TEST_RECOVERY_LABEL if ((t_ret = CDB_memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0 && ret == 0) ret = t_ret; err: if (mmeta != NULL) if ((t_ret = CDB_memp_fput(dbp->mpf, mmeta, dirty_mmeta ? DB_MPOOL_DIRTY : 0)) != 0 && ret == 0) ret = t_ret; if (metalock.off != LOCK_INVALID) (void)__TLPUT(dbc, metalock); return (ret); } static int CDB___ham_delete(dbp, txn, key, flags) DB *dbp; DB_TXN *txn; DBT *key; u_int32_t flags; { DBC *dbc; HASH_CURSOR *hcp; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->del"); if ((ret = CDB___db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) return (ret); if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "ham_delete", key, NULL, flags); hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; if ((ret = CDB___ham_lookup(dbc, key, 0, DB_LOCK_WRITE)) == 0) { if (F_ISSET(hcp, H_OK)) ret = CDB___ham_del_pair(dbc, 1); else ret = DB_NOTFOUND; } if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0) ret = t_ret; out: if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* ****************** CURSORS ********************************** */ /* * CDB___ham_c_init -- * Initialize the hash-specific portion of a cursor. * * PUBLIC: int CDB___ham_c_init __P((DBC *)); */ int CDB___ham_c_init(dbc) DBC *dbc; { HASH_CURSOR *new_curs; int ret; if ((ret = CDB___os_calloc(1, sizeof(struct cursor_t), &new_curs)) != 0) return (ret); if ((ret = CDB___os_malloc(dbc->dbp->pgsize, NULL, &new_curs->split_buf)) != 0) { CDB___os_free(new_curs, sizeof(*new_curs)); return (ret); } new_curs->dbc = dbc; dbc->internal = new_curs; dbc->c_am_close = CDB___ham_c_close; dbc->c_am_destroy = CDB___ham_c_destroy; dbc->c_del = CDB___ham_c_del; dbc->c_get = CDB___ham_c_get; dbc->c_put = CDB___ham_c_put; CDB___ham_item_init(new_curs); return (0); } /* * CDB___ham_c_close -- * Close down the cursor from a single use. */ static int CDB___ham_c_close(dbc) DBC *dbc; { int ret; if ((ret = CDB___ham_item_done(dbc, 0)) != 0) return (ret); CDB___ham_item_init((HASH_CURSOR *)dbc->internal); return (0); } /* * CDB___ham_c_destroy -- * Cleanup the access method private part of a cursor. */ static int CDB___ham_c_destroy(dbc) DBC *dbc; { HASH_CURSOR *hcp; hcp = (HASH_CURSOR *)dbc->internal; if (hcp->split_buf != NULL) CDB___os_free(hcp->split_buf, dbc->dbp->pgsize); CDB___os_free(hcp, sizeof(HASH_CURSOR)); return (0); } static int CDB___ham_c_del(dbc, flags) DBC *dbc; u_int32_t flags; { DB *dbp; DBT repldbt; HASH_CURSOR *hcp; HASH_CURSOR save_curs; db_pgno_t ppgno, chg_pgno; int ret, t_ret; DEBUG_LWRITE(dbc, dbc->txn, "ham_c_del", NULL, NULL, flags); dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___db_cdelchk(dbc->dbp, flags, F_ISSET(dbc->dbp, DB_AM_RDONLY), IS_VALID(hcp))) != 0) return (ret); if (F_ISSET(hcp, H_DELETED)) return (DB_NOTFOUND); /* * If we are in the concurrent DB product and this cursor * is not a write cursor, then this request is invalid. * If it is a simple write cursor, then we need to upgrade its * lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { /* Make sure it's a valid update cursor. */ if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EPERM); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } SAVE_CURSOR(hcp, &save_curs); if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; if ((ret = CDB___ham_get_cpage(dbc, DB_LOCK_WRITE)) != 0) goto out; if (F_ISSET(hcp, H_ISDUP) && hcp->dpgno != PGNO_INVALID) { /* * We are about to remove a duplicate from offpage. * * There are 4 cases. * 1. We will remove an item on a page, but there are more * items on that page. * 2. We will remove the last item on a page, but there is a * following page of duplicates. * 3. We will remove the last item on a page, this page was the * last page in a duplicate set, but there were dups before * it. * 4. We will remove the last item on a page, removing the last * duplicate. * In case 1 hcp->dpagep is unchanged. * In case 2 hcp->dpagep comes back pointing to the next dup * page. * In case 3 hcp->dpagep comes back NULL. * In case 4 hcp->dpagep comes back NULL. * * Case 4 results in deleting the pair off the master page. * The normal code for doing this knows how to delete the * duplicates, so we will handle this case in the normal code. */ ppgno = PREV_PGNO(hcp->dpagep); if (ppgno == PGNO_INVALID && NEXT_PGNO(hcp->dpagep) == PGNO_INVALID && NUM_ENT(hcp->dpagep) == 1) goto normal; /* Remove item from duplicate page. */ chg_pgno = hcp->dpgno; if ((ret = CDB___db_drem(dbc, &hcp->dpagep, hcp->dndx)) != 0) goto out; if (hcp->dpagep == NULL) { if (ppgno != PGNO_INVALID) { /* Case 3 */ hcp->dpgno = ppgno; if ((ret = CDB___ham_get_cpage(dbc, DB_LOCK_READ)) != 0) goto out; hcp->dndx = NUM_ENT(hcp->dpagep); F_SET(hcp, H_DELETED); } else { /* Case 4 */ ret = CDB___ham_del_pair(dbc, 1); hcp->dpgno = PGNO_INVALID; /* * Delpair updated the cursor queue, so we * don't have to do that here. */ chg_pgno = PGNO_INVALID; } } else if (PGNO(hcp->dpagep) != hcp->dpgno) { hcp->dndx = 0; /* Case 2 */ hcp->dpgno = PGNO(hcp->dpagep); if (ppgno == PGNO_INVALID) memcpy(HOFFDUP_PGNO(P_ENTRY(hcp->pagep, H_DATAINDEX(hcp->bndx))), &hcp->dpgno, sizeof(db_pgno_t)); /* * We need to put the master page here, because * although we have a duplicate page, the master * page is dirty, and ham_item_done assumes that * if you have a duplicate page, it's the only one * that can be dirty. */ ret = CDB___ham_put_page(dbp, hcp->pagep, 1); hcp->pagep = NULL; F_SET(hcp, H_DELETED); } else /* Case 1 */ F_SET(hcp, H_DELETED); if (chg_pgno != PGNO_INVALID) CDB___ham_c_update(hcp, chg_pgno, 0, 0, 1); } else if (F_ISSET(hcp, H_ISDUP)) { /* on page */ if (hcp->dup_off == 0 && DUP_SIZE(hcp->dup_len) == LEN_HDATA(hcp->pagep, hcp->hdr->dbmeta.pagesize, hcp->bndx)) ret = CDB___ham_del_pair(dbc, 1); else { repldbt.flags = 0; F_SET(&repldbt, DB_DBT_PARTIAL); repldbt.doff = hcp->dup_off; repldbt.dlen = DUP_SIZE(hcp->dup_len); repldbt.size = 0; repldbt.data = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)); ret = CDB___ham_replpair(dbc, &repldbt, 0); hcp->dup_tlen -= DUP_SIZE(hcp->dup_len); F_SET(hcp, H_DELETED); CDB___ham_c_update(hcp, hcp->pgno, DUP_SIZE(hcp->dup_len), 0, 1); } } else /* Not a duplicate */ normal: ret = CDB___ham_del_pair(dbc, 1); out: if ((t_ret = CDB___ham_item_done(dbc, ret == 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0) ret = t_ret; RESTORE_CURSOR(dbp, hcp, &save_curs, ret); if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___ham_c_dup -- * Duplicate a hash cursor, such that the new one holds appropriate * locks for the position of the original. * * PUBLIC: int CDB___ham_c_dup __P((DBC *, DBC *)); */ int CDB___ham_c_dup(orig_dbc, new_dbc) DBC *orig_dbc, *new_dbc; { HASH_CURSOR *orig, *new; orig = (HASH_CURSOR *)orig_dbc->internal; new = (HASH_CURSOR *)new_dbc->internal; #ifdef DIAGNOSTIC memset(new, 0, sizeof(*new)); #endif new->dbc = orig->dbc; new->bucket = orig->bucket; new->lbucket = orig->lbucket; new->pgno = orig->pgno; new->bndx = orig->bndx; new->dpgno = orig->dpgno; new->dndx = orig->dndx; new->dup_off = orig->dup_off; new->dup_len = orig->dup_len; new->dup_tlen = orig->dup_tlen; if (F_ISSET(orig, H_DELETED)) F_SET(new, H_DELETED); if (F_ISSET(orig, H_ISDUP)) F_SET(new, H_ISDUP); /* * If the old cursor held a lock and we're not in transactions, get one * for the new one. The reason that we don't need a new lock if we're * in a transaction is because we already hold a lock and will continue * to do so until commit, so there is no point in reaquiring it. We * don't know if the old lock was a read or write lock, but it doesn't * matter. We'll get a read lock. We know that this locker already * holds a lock of the correct type, so if we need a write lock and * request it, we know that we'll get it. */ if (orig->lock.off == LOCK_INVALID || orig_dbc->txn != NULL) { new->lock.off = LOCK_INVALID; return (0); } return (CDB___ham_lock_bucket(new_dbc, DB_LOCK_READ)); } static int CDB___ham_c_get(dbc, key, data, flags) DBC *dbc; DBT *key; DBT *data; u_int32_t flags; { DB *dbp; HASH_CURSOR *hcp, save_curs; db_lockmode_t lock_type; int get_key, ret, t_ret; DEBUG_LREAD(dbc, dbc->txn, "ham_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); hcp = (HASH_CURSOR *)dbc->internal; dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); if ((ret = CDB___db_cgetchk(dbp, key, data, flags, IS_VALID(hcp))) != 0) return (ret); /* Clear OR'd in additional bits so we can check for flag equality. */ if (LF_ISSET(DB_RMW)) { lock_type = DB_LOCK_WRITE; LF_CLR(DB_RMW); } else lock_type = DB_LOCK_READ; SAVE_CURSOR(hcp, &save_curs); if ((ret = CDB___ham_get_meta(dbc)) != 0) return (ret); hcp->seek_size = 0; ret = 0; get_key = 1; switch (flags) { case DB_PREV: if (hcp->bucket != BUCKET_INVALID) { ret = CDB___ham_item_prev(dbc, lock_type); break; } /* FALLTHROUGH */ case DB_LAST: ret = CDB___ham_item_last(dbc, lock_type); break; case DB_NEXT: if (hcp->bucket != BUCKET_INVALID) { ret = CDB___ham_item_next(dbc, lock_type); break; } /* FALLTHROUGH */ case DB_FIRST: ret = CDB___ham_item_first(dbc, lock_type); break; case DB_NEXT_DUP: /* cgetchk has already determined that the cursor is set. */ F_SET(hcp, H_DUPONLY); ret = CDB___ham_item_next(dbc, lock_type); break; case DB_SET: case DB_SET_RANGE: case DB_GET_BOTH: if (F_ISSET(dbc, DBC_CONTINUE)) { F_SET(hcp, H_DUPONLY); ret = CDB___ham_item_next(dbc, lock_type); } else ret = CDB___ham_lookup(dbc, key, 0, lock_type); get_key = 0; break; case DB_CURRENT: /* cgetchk has already determined that the cursor is set. */ if (F_ISSET(hcp, H_DELETED)) { ret = DB_KEYEMPTY; goto err1; } ret = CDB___ham_item(dbc, lock_type); break; } /* * Must always enter this loop to do error handling and * check for big key/data pair. */ while (1) { if (ret != 0 && ret != DB_NOTFOUND) goto err2; else if (F_ISSET(hcp, H_OK)) { /* Get the key. */ if (get_key && (ret = CDB___db_ret(dbp, hcp->pagep, H_KEYINDEX(hcp->bndx), key, &dbc->rkey.data, &dbc->rkey.size)) != 0) goto err2; ret = CDB___ham_dup_return(dbc, data, flags); break; } else if (!F_ISSET(hcp, H_NOMORE)) { abort(); break; } /* * Ran out of entries in a bucket; change buckets. */ switch (flags) { case DB_LAST: case DB_PREV: ret = CDB___ham_item_done(dbc, 0); if (hcp->bucket == 0) { ret = DB_NOTFOUND; goto err2; } hcp->bucket--; hcp->bndx = NDX_INVALID; if (ret == 0) ret = CDB___ham_item_prev(dbc, lock_type); break; case DB_FIRST: case DB_NEXT: ret = CDB___ham_item_done(dbc, 0); hcp->bndx = NDX_INVALID; hcp->bucket++; hcp->pgno = PGNO_INVALID; hcp->pagep = NULL; if (hcp->bucket > hcp->hdr->max_bucket) { ret = DB_NOTFOUND; goto err2; } if (ret == 0) ret = CDB___ham_item_next(dbc, lock_type); break; case DB_GET_BOTH: case DB_NEXT_DUP: case DB_SET: case DB_SET_RANGE: /* Key not found. */ ret = DB_NOTFOUND; goto err2; case DB_CURRENT: /* * This should only happen if you are doing * deletes and reading with concurrent threads * and not doing proper locking. We return * the same error code as we would if the * cursor were deleted. */ ret = DB_KEYEMPTY; goto err2; } } err2: if ((t_ret = CDB___ham_item_done(dbc, 0)) != 0 && ret == 0) ret = t_ret; err1: if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0) ret = t_ret; RESTORE_CURSOR(dbp, hcp, &save_curs, ret); F_CLR(hcp, H_DUPONLY); return (ret); } static int CDB___ham_c_put(dbc, key, data, flags) DBC *dbc; DBT *key; DBT *data; u_int32_t flags; { DB *dbp; DBT tmp_val, *myval; HASH_CURSOR *hcp, save_curs; u_int32_t nbytes; int ret, t_ret; /* * The compiler doesn't realize that we only use this when ret is * equal to 0 and that if ret is equal to 0, that we must have set * myval. So, we initialize it here to shut the compiler up. */ COMPQUIET(myval, NULL); dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); DEBUG_LWRITE(dbc, dbc->txn, "ham_c_put", flags == DB_KEYFIRST || flags == DB_KEYLAST ? key : NULL, data, flags); hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___db_cputchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), IS_VALID(hcp))) != 0) return (ret); if (F_ISSET(hcp, H_DELETED) && flags != DB_KEYFIRST && flags != DB_KEYLAST) return (DB_NOTFOUND); /* * If we are in the concurrent DB product and this cursor * is not a write cursor, then this request is invalid. * If it is a simple write cursor, then we need to upgrade its * lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { /* Make sure it's a valid update cursor. */ if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EPERM); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } SAVE_CURSOR(hcp, &save_curs); if ((ret = CDB___ham_get_meta(dbc)) != 0) goto err1; switch (flags) { case DB_KEYLAST: case DB_KEYFIRST: nbytes = (ISBIG(hcp, key->size) ? HOFFPAGE_PSIZE : HKEYDATA_PSIZE(key->size)) + (ISBIG(hcp, data->size) ? HOFFPAGE_PSIZE : HKEYDATA_PSIZE(data->size)); if ((ret = CDB___ham_lookup(dbc, key, nbytes, DB_LOCK_WRITE)) == DB_NOTFOUND) { ret = 0; if (hcp->seek_found_page != PGNO_INVALID && hcp->seek_found_page != hcp->pgno) { if ((ret = CDB___ham_item_done(dbc, 0)) != 0) goto err2; hcp->pgno = hcp->seek_found_page; hcp->bndx = NDX_INVALID; } if (F_ISSET(data, DB_DBT_PARTIAL) && data->doff != 0) { /* * A partial put, but the key does not exist * and we are not beginning the write at 0. * We must create a data item padded up to doff * and then write the new bytes represented by * val. */ if ((ret = CDB___ham_init_dbt(&tmp_val, data->size + data->doff, &dbc->rdata.data, &dbc->rdata.size)) == 0) { memset(tmp_val.data, 0, data->doff); memcpy((u_int8_t *)tmp_val.data + data->doff, data->data, data->size); myval = &tmp_val; } } else myval = (DBT *)data; if (ret == 0) ret = CDB___ham_add_el(dbc, key, myval, H_KEYDATA); goto done; } break; case DB_BEFORE: case DB_AFTER: case DB_CURRENT: ret = CDB___ham_item(dbc, DB_LOCK_WRITE); break; } if (ret == 0) { if (flags == DB_CURRENT || ((flags == DB_KEYFIRST || flags == DB_KEYLAST) && !F_ISSET(dbp, DB_AM_DUP))) ret = CDB___ham_overwrite(dbc, data); else ret = CDB___ham_add_dup(dbc, data, flags); } done: if (ret == 0 && F_ISSET(hcp, H_EXPAND)) { ret = CDB___ham_expand_table(dbc); F_CLR(hcp, H_EXPAND); } if ((t_ret = CDB___ham_item_done(dbc, ret == 0)) != 0 && ret == 0) ret = t_ret; err2: if ((t_ret = CDB___ham_release_meta(dbc)) != 0 && ret == 0) ret = t_ret; err1: RESTORE_CURSOR(dbp, hcp, &save_curs, ret); if (F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade(dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /********************************* UTILITIES ************************/ /* * CDB___ham_expand_table -- */ static int CDB___ham_expand_table(dbc) DBC *dbc; { DB *dbp; PAGE *h; HASH_CURSOR *hcp; db_pgno_t pgno; u_int32_t old_bucket, new_bucket; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_dirty_meta(dbc)) != 0) return (ret); /* * If the split point is about to increase, make sure that we * have enough extra pages. The calculation here is weird. * We'd like to do this after we've upped max_bucket, but it's * too late then because we've logged the meta-data split. What * we'll do between then and now is increment max bucket and then * see what the log of one greater than that is; here we have to * look at the log of max + 2. VERY NASTY STUFF. * * It just got even nastier. With subdatabases, we have to request * a chunk of contiguous pages, so we do that here using an * undocumented feature of mpool (the MPOOL_NEW_GROUP flag) to * give us a number of contiguous pages. Ouch. */ if (hcp->hdr->max_bucket == hcp->hdr->high_mask) { /* * Ask mpool to give us a set of contiguous page numbers * large enough to contain the next doubling. * * Figure out how many new pages we need. This will return * us the last page. We calculate its page number, initialize * the page and then write it back to reserve all the pages * in between. It is possible that the allocation of new pages * has already been done, but the tranaction aborted. Since * we don't undo the allocation, check for a valid pgno before * doing the allocation. */ pgno = hcp->hdr->max_bucket + 1; if (hcp->hdr->spares[CDB___db_log2(pgno) + 1] == PGNO_INVALID) /* Allocate a group of pages. */ ret = CDB_memp_fget(dbp->mpf, &pgno, DB_MPOOL_NEW_GROUP, &h); else { /* Just read in the last page of the batch */ pgno = hcp->hdr->spares[CDB___db_log2(pgno) + 1] + hcp->hdr->max_bucket + 1; ret = CDB_memp_fget(dbp->mpf, &pgno, DB_MPOOL_CREATE, &h); } if (ret != 0) return (ret); P_INIT(h, dbp->pgsize, pgno, PGNO_INVALID, PGNO_INVALID, 0, P_HASH); pgno -= hcp->hdr->max_bucket; } else { pgno = BUCKET_TO_PAGE(hcp, hcp->hdr->max_bucket + 1); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, DB_MPOOL_CREATE, &h)) != 0) return (ret); } /* Now we can log the meta-data split. */ if (DB_LOGGING(dbc)) { if ((ret = CDB___ham_metagroup_log(dbp->dbenv, dbc->txn, &h->lsn, 0, dbp->log_fileid, hcp->hdr->max_bucket, pgno, &hcp->hdr->dbmeta.lsn, &h->lsn)) != 0) return (ret); hcp->hdr->dbmeta.lsn = h->lsn; } /* If we allocated some new pages, write out the last page. */ if ((ret = CDB_memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY)) != 0) return (ret); new_bucket = ++hcp->hdr->max_bucket; old_bucket = (hcp->hdr->max_bucket & hcp->hdr->low_mask); /* * If we started a new doubling, fill in the spares array with * the starting page number negatively offset by the bucket number. */ if (new_bucket > hcp->hdr->high_mask) { /* Starting a new doubling */ hcp->hdr->low_mask = hcp->hdr->high_mask; hcp->hdr->high_mask = new_bucket | hcp->hdr->low_mask; if (hcp->hdr->spares[CDB___db_log2(new_bucket) + 1] == PGNO_INVALID) hcp->hdr->spares[CDB___db_log2(new_bucket) + 1] = pgno - new_bucket; } /* Relocate records to the new bucket */ return (CDB___ham_split_page(dbc, old_bucket, new_bucket)); } /* * PUBLIC: u_int32_t CDB___ham_call_hash __P((HASH_CURSOR *, u_int8_t *, int32_t)); */ u_int32_t CDB___ham_call_hash(hcp, k, len) HASH_CURSOR *hcp; u_int8_t *k; int32_t len; { u_int32_t n, bucket; HASH *hashp; hashp = hcp->dbc->dbp->h_internal; n = (u_int32_t)(hashp->h_hash(k, len)); bucket = n & hcp->hdr->high_mask; if (bucket > hcp->hdr->max_bucket) bucket = bucket & hcp->hdr->low_mask; return (bucket); } /* * Check for duplicates, and call CDB___db_ret appropriately. Release * everything held by the cursor. */ static int CDB___ham_dup_return(dbc, val, flags) DBC *dbc; DBT *val; u_int32_t flags; { DB *dbp; HASH_CURSOR *hcp; PAGE *pp; DBT *myval, tmp_val; db_indx_t ndx; db_pgno_t pgno; u_int32_t off, tlen; u_int8_t *hk, type; int cmp, ret; db_indx_t len; /* Check for duplicate and return the first one. */ dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; ndx = H_DATAINDEX(hcp->bndx); type = HPAGE_TYPE(hcp->pagep, ndx); pp = hcp->pagep; myval = val; /* * There are 4 cases: * 1. We are not in duplicate, simply call db_ret. * 2. We are looking at keys and stumbled onto a duplicate. * 3. We are in the middle of a duplicate set. (ISDUP set) * 4. This is a duplicate and we need to return a specific item. */ /* * Here we check for the case where we just stumbled onto a * duplicate. In this case, we do initialization and then * let the normal duplicate code handle it. */ if (!F_ISSET(hcp, H_ISDUP)) { if (type == H_DUPLICATE) { F_SET(hcp, H_ISDUP); hcp->dup_tlen = LEN_HDATA(hcp->pagep, hcp->hdr->dbmeta.pagesize, hcp->bndx); hk = H_PAIRDATA(hcp->pagep, hcp->bndx); if (flags == DB_LAST || flags == DB_PREV) { hcp->dndx = 0; hcp->dup_off = 0; do { memcpy(&len, HKEYDATA_DATA(hk) + hcp->dup_off, sizeof(db_indx_t)); hcp->dup_off += DUP_SIZE(len); hcp->dndx++; } while (hcp->dup_off < hcp->dup_tlen); hcp->dup_off -= DUP_SIZE(len); hcp->dndx--; } else { memcpy(&len, HKEYDATA_DATA(hk), sizeof(db_indx_t)); hcp->dup_off = 0; hcp->dndx = 0; } hcp->dup_len = len; } else if (type == H_OFFDUP) { F_SET(hcp, H_ISDUP); if (flags == DB_CURRENT) { pgno = hcp->dpgno; ndx = hcp->dndx; } else memcpy(&pgno, HOFFDUP_PGNO(P_ENTRY(hcp->pagep, ndx)), sizeof(db_pgno_t)); if (flags == DB_LAST || flags == DB_PREV) { if ((ret = CDB___db_dend(dbc, pgno, &hcp->dpagep)) != 0) return (ret); hcp->dpgno = PGNO(hcp->dpagep); hcp->dndx = NUM_ENT(hcp->dpagep) - 1; } else if ((ret = CDB___ham_next_cpage(dbc, pgno, 0, H_ISDUP)) != 0) return (ret); if (flags == DB_CURRENT) hcp->dndx = ndx; } } /* * If we are retrieving a specific key/data pair, then we * may need to adjust the cursor before returning data. */ if (flags == DB_GET_BOTH) { if (F_ISSET(hcp, H_ISDUP)) { if (hcp->dpgno != PGNO_INVALID) { if ((ret = CDB___db_dsearch(dbc, 0, val, hcp->dpgno, &hcp->dndx, &hcp->dpagep, &cmp)) != 0) return (ret); if (cmp == 0) hcp->dpgno = PGNO(hcp->dpagep); } else { CDB___ham_dsearch(dbc, val, &off, &cmp); hcp->dup_off = off; } } else { hk = H_PAIRDATA(hcp->pagep, hcp->bndx); if (((HKEYDATA *)hk)->type == H_OFFPAGE) { memcpy(&tlen, HOFFPAGE_TLEN(hk), sizeof(u_int32_t)); memcpy(&pgno, HOFFPAGE_PGNO(hk), sizeof(db_pgno_t)); if ((ret = CDB___db_moff(dbp, val, pgno, tlen, dbp->dup_compare, &cmp)) != 0) return (ret); } else { /* * We do not zero tmp_val since the comparison * routines may only look at data and size. */ tmp_val.data = HKEYDATA_DATA(hk); tmp_val.size = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); cmp = dbp->dup_compare == NULL ? CDB___bam_defcmp(&tmp_val, val) : dbp->dup_compare(&tmp_val, val); } } if (cmp != 0) return (DB_NOTFOUND); } /* * Now, everything is initialized, grab a duplicate if * necessary. */ if (F_ISSET(hcp, H_ISDUP)) { if (hcp->dpgno != PGNO_INVALID) { pp = hcp->dpagep; ndx = hcp->dndx; } else { /* * Copy the DBT in case we are retrieving into user * memory and we need the parameters for it. If the * user requested a partial, then we need to adjust * the user's parameters to get the partial of the * duplicate which is itself a partial. */ memcpy(&tmp_val, val, sizeof(*val)); if (F_ISSET(&tmp_val, DB_DBT_PARTIAL)) { /* * Take the user's length unless it would go * beyond the end of the duplicate. */ if (tmp_val.doff + hcp->dup_off > hcp->dup_len) tmp_val.dlen = 0; else if (tmp_val.dlen + tmp_val.doff > hcp->dup_len) tmp_val.dlen = hcp->dup_len - tmp_val.doff; /* * Calculate the new offset. */ tmp_val.doff += hcp->dup_off; } else { F_SET(&tmp_val, DB_DBT_PARTIAL); tmp_val.dlen = hcp->dup_len; tmp_val.doff = hcp->dup_off + sizeof(db_indx_t); } myval = &tmp_val; } } /* * Finally, if we had a duplicate, pp, ndx, and myval should be * set appropriately. */ if ((ret = CDB___db_ret(dbp, pp, ndx, myval, &dbc->rdata.data, &dbc->rdata.size)) != 0) return (ret); /* * In case we sent a temporary off to db_ret, set the real * return values. */ val->data = myval->data; val->size = myval->size; return (0); } static int CDB___ham_overwrite(dbc, nval) DBC *dbc; DBT *nval; { HASH_CURSOR *hcp; DBT *myval, tmp_val, tmp_val2; void *newrec; u_int8_t *hk, *p; u_int32_t len, nondup_size; db_pgno_t prev; db_indx_t newsize, dndx; int ret; hcp = (HASH_CURSOR *)dbc->internal; if (F_ISSET(hcp, H_ISDUP)) { /* * This is an overwrite of a duplicate; check for * onpage versus offpage and whether it's partial. */ if (hcp->dpagep != NULL) { do_offpage: if (F_ISSET(nval, DB_DBT_PARTIAL)) { /* * We are using btree routines that are * actually OK for hash to use. Since all * dbps have bt_internal initialized, this * *should* just work. */ newsize = CDB___bam_partsize( DB_CURRENT, nval, hcp->dpagep, hcp->dndx); memcpy(&tmp_val, nval, sizeof(tmp_val)); if ((ret = CDB___bam_build(dbc, DB_CURRENT, &tmp_val, hcp->dpagep, hcp->dndx, newsize)) != 0) return (ret); myval = &tmp_val; } else myval = nval; /* * Make sure that the caller isn't corrupting * the sort order. */ if (dbc->dbp->dup_compare != NULL && CDB___bam_cmp(dbc->dbp, myval, hcp->dpagep, hcp->dndx, dbc->dbp->dup_compare) != 0) return (EINVAL); prev = PREV_PGNO(hcp->dpagep); if ((ret = CDB___db_drem(dbc, &hcp->dpagep, hcp->dndx)) != 0) return (ret); /* * It's possible that hcp->dpagep is now NULL. If * we have a prev, we can deal pretty easily; if not * this gets ugly. */ if (hcp->dpagep == NULL) { if (prev == PGNO_INVALID) { /* * This was a duplicate page with * a single item. Pretend to reenter * this routine simply overwriting the * entry on the main page. */ F_CLR(hcp, H_ISDUP); goto doreplace; } if ((ret = CDB___ham_next_cpage(dbc, prev, 0, H_ISDUP)) != 0) return (ret); hcp->dndx = NUM_ENT(hcp->dpagep); } /* * On page splits, the 4th parameter of db_dput returns * the location the new item was put. We cannot pass * in permanent fields from the cursor, they may have * been updated in cursor adjustment. */ dndx = hcp->dndx; ret = CDB___db_dput(dbc, myval, &hcp->dpagep, &dndx); hcp->dpgno = PGNO(hcp->dpagep); hcp->dndx = dndx; return (ret); } /* On page dups */ if (F_ISSET(nval, DB_DBT_PARTIAL)) { /* * We're going to have to get the current item, then * construct the record, do any padding and do a * replace. */ memset(&tmp_val, 0, sizeof(tmp_val)); if ((ret = CDB___ham_dup_return(dbc, &tmp_val, DB_CURRENT)) != 0) return (ret); /* Figure out new size. */ nondup_size = tmp_val.size; newsize = nondup_size; /* * Three cases: * 1. strictly append (may need to allocate space * for pad bytes; really gross). * 2. overwrite some and append. * 3. strictly overwrite. */ if (nval->doff > nondup_size) newsize += (nval->doff - nondup_size + nval->size); else if (nval->doff + nval->dlen > nondup_size) newsize += nval->size - (nondup_size - nval->doff); else newsize += nval->size - nval->dlen; /* * Make sure that the new size doesn't put us over * the onpage duplicate size in which case we need * to convert to off-page duplicates. */ if (ISBIG(hcp, hcp->dup_tlen - nondup_size + newsize)) { if ((ret = CDB___ham_dup_convert(dbc)) != 0) return (ret); goto do_offpage; } if ((ret = CDB___os_malloc(DUP_SIZE(newsize), NULL, &newrec)) != 0) return (ret); memset(&tmp_val2, 0, sizeof(tmp_val2)); F_SET(&tmp_val2, DB_DBT_PARTIAL); /* Construct the record. */ p = newrec; /* Initial size. */ memcpy(p, &newsize, sizeof(db_indx_t)); p += sizeof(db_indx_t); /* First part of original record. */ len = nval->doff > tmp_val.size ? tmp_val.size : nval->doff; memcpy(p, tmp_val.data, len); p += len; if (nval->doff > tmp_val.size) { /* Padding */ memset(p, 0, nval->doff - tmp_val.size); p += nval->doff - tmp_val.size; } /* New bytes */ memcpy(p, nval->data, nval->size); p += nval->size; /* End of original record (if there is any) */ if (nval->doff + nval->dlen < tmp_val.size) { len = tmp_val.size - nval->doff - nval->dlen; memcpy(p, (u_int8_t *)tmp_val.data + nval->doff + nval->dlen, len); p += len; } /* Final size. */ memcpy(p, &newsize, sizeof(db_indx_t)); /* * Make sure that the caller isn't corrupting * the sort order. */ if (dbc->dbp->dup_compare != NULL) { tmp_val2.data = (u_int8_t *)newrec + sizeof(db_indx_t); tmp_val2.size = newsize; if (dbc->dbp->dup_compare(&tmp_val, &tmp_val2) != 0) { (void)CDB___os_free(newrec, DUP_SIZE(newsize)); return (EINVAL); } } tmp_val2.data = newrec; tmp_val2.size = DUP_SIZE(newsize); tmp_val2.doff = hcp->dup_off; tmp_val2.dlen = DUP_SIZE(hcp->dup_len); ret = CDB___ham_replpair(dbc, &tmp_val2, 0); (void)CDB___os_free(newrec, DUP_SIZE(newsize)); /* Update cursor */ if (ret != 0) return (ret); if (newsize > nondup_size) hcp->dup_tlen += (newsize - nondup_size); else hcp->dup_tlen -= (nondup_size - newsize); hcp->dup_len = DUP_SIZE(newsize); return (0); } else { /* Check whether we need to convert to off page. */ if (ISBIG(hcp, hcp->dup_tlen - hcp->dup_len + nval->size)) { if ((ret = CDB___ham_dup_convert(dbc)) != 0) return (ret); goto do_offpage; } /* Make sure we maintain sort order. */ if (dbc->dbp->dup_compare != NULL) { tmp_val2.data = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)) + hcp->dup_off + sizeof(db_indx_t); tmp_val2.size = hcp->dup_len; if (dbc->dbp->dup_compare(nval, &tmp_val2) != 0) return (EINVAL); } /* Overwriting a complete duplicate. */ if ((ret = CDB___ham_make_dup(nval, &tmp_val, &dbc->rdata.data, &dbc->rdata.size)) != 0) return (ret); /* Now fix what we are replacing. */ tmp_val.doff = hcp->dup_off; tmp_val.dlen = DUP_SIZE(hcp->dup_len); /* Update cursor */ if (nval->size > hcp->dup_len) hcp->dup_tlen += (nval->size - hcp->dup_len); else hcp->dup_tlen -= (hcp->dup_len - nval->size); hcp->dup_len = DUP_SIZE(nval->size); } myval = &tmp_val; } else if (!F_ISSET(nval, DB_DBT_PARTIAL)) { /* Put/overwrite */ memcpy(&tmp_val, nval, sizeof(*nval)); F_SET(&tmp_val, DB_DBT_PARTIAL); tmp_val.doff = 0; hk = H_PAIRDATA(hcp->pagep, hcp->bndx); if (HPAGE_PTYPE(hk) == H_OFFPAGE) memcpy(&tmp_val.dlen, HOFFPAGE_TLEN(hk), sizeof(u_int32_t)); else tmp_val.dlen = LEN_HDATA(hcp->pagep, hcp->hdr->dbmeta.pagesize,hcp->bndx); myval = &tmp_val; } else /* Regular partial put */ myval = nval; doreplace: return (CDB___ham_replpair(dbc, myval, 0)); } /* * Given a key and a cursor, sets the cursor to the page/ndx on which * the key resides. If the key is found, the cursor H_OK flag is set * and the pagep, bndx, pgno (dpagep, dndx, dpgno) fields are set. * If the key is not found, the H_OK flag is not set. If the sought * field is non-0, the pagep, bndx, pgno (dpagep, dndx, dpgno) fields * are set indicating where an add might take place. If it is 0, * non of the cursor pointer field are valid. */ static int CDB___ham_lookup(dbc, key, sought, mode) DBC *dbc; const DBT *key; u_int32_t sought; db_lockmode_t mode; { DB *dbp; HASH_CURSOR *hcp; db_pgno_t pgno; u_int32_t tlen; int match, ret, t_ret; u_int8_t *hk; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; /* * Set up cursor so that we're looking for space to add an item * as we cycle through the pages looking for the key. */ if ((ret = CDB___ham_item_reset(dbc)) != 0) return (ret); hcp->seek_size = sought; hcp->bucket = CDB___ham_call_hash(hcp, (u_int8_t *)key->data, key->size); while (1) { if ((ret = CDB___ham_item_next(dbc, mode)) != 0) return (ret); if (F_ISSET(hcp, H_NOMORE)) break; hk = H_PAIRKEY(hcp->pagep, hcp->bndx); switch (HPAGE_PTYPE(hk)) { case H_OFFPAGE: memcpy(&tlen, HOFFPAGE_TLEN(hk), sizeof(u_int32_t)); if (tlen == key->size) { memcpy(&pgno, HOFFPAGE_PGNO(hk), sizeof(db_pgno_t)); if ((ret = CDB___db_moff(dbp, key, pgno, tlen, NULL, &match)) != 0) return (ret); if (match == 0) { F_SET(hcp, H_OK); return (0); } } break; case H_KEYDATA: if (key->size == LEN_HKEY(hcp->pagep, dbp->pgsize, hcp->bndx) && memcmp(key->data, HKEYDATA_DATA(hk), key->size) == 0) { F_SET(hcp, H_OK); return (0); } break; case H_DUPLICATE: case H_OFFDUP: /* * These are errors because keys are never * duplicated, only data items are. */ return (CDB___db_pgfmt(dbp, PGNO(hcp->pagep))); } } /* * Item was not found. */ if (sought != 0) return (ret); if ((t_ret = CDB___ham_item_done(dbc, 0)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___ham_init_dbt -- * Initialize a dbt using some possibly already allocated storage * for items. * * PUBLIC: int CDB___ham_init_dbt __P((DBT *, u_int32_t, void **, u_int32_t *)); */ int CDB___ham_init_dbt(dbt, size, bufp, sizep) DBT *dbt; u_int32_t size; void **bufp; u_int32_t *sizep; { int ret; memset(dbt, 0, sizeof(*dbt)); if (*sizep < size) { if ((ret = CDB___os_realloc(size, NULL, bufp)) != 0) { *sizep = 0; return (ret); } *sizep = size; } dbt->data = *bufp; dbt->size = size; return (0); } /* * Adjust the cursor after an insert or delete. The cursor passed is * the one that was operated upon; we just need to check any of the * others. * * len indicates the length of the item added/deleted * add indicates if the item indicated by the cursor has just been * added (add == 1) or deleted (add == 0). * dup indicates if the addition occurred into a duplicate set. * * PUBLIC: void CDB___ham_c_update * PUBLIC: __P((HASH_CURSOR *, db_pgno_t, u_int32_t, int, int)); */ void CDB___ham_c_update(hcp, chg_pgno, len, add, is_dup) HASH_CURSOR *hcp; db_pgno_t chg_pgno; u_int32_t len; int add, is_dup; { DB *dbp; DBC *cp; HASH_CURSOR *lcp; int page_deleted; /* * Regular adds are always at the end of a given page, so we never * have to adjust anyone's cursor after a regular add. */ if (!is_dup && add) return; /* * Determine if a page was deleted. If this is a regular update * (i.e., not is_dup) then the deleted page's number will be that in * chg_pgno, and the pgno in the cursor will be different. If this * was an onpage-duplicate, then the same conditions apply. If this * was an off-page duplicate, then we need to verify if hcp->dpgno * is the same (no delete) or different (delete) than chg_pgno. */ if (!is_dup || hcp->dpgno == PGNO_INVALID) page_deleted = chg_pgno != PGNO_INVALID && chg_pgno != hcp->pgno; else page_deleted = chg_pgno != PGNO_INVALID && chg_pgno != hcp->dpgno; dbp = hcp->dbc->dbp; MUTEX_THREAD_LOCK(dbp->mutexp); for (cp = TAILQ_FIRST(&dbp->active_queue); cp != NULL; cp = TAILQ_NEXT(cp, links)) { if (cp->internal == hcp) continue; lcp = (HASH_CURSOR *)cp->internal; if (!is_dup && lcp->pgno != chg_pgno) continue; if (is_dup && ((lcp->dpgno == PGNO_INVALID && lcp->pgno != chg_pgno) || (lcp->dpgno != PGNO_INVALID && lcp->dpgno != chg_pgno))) continue; if (is_dup && F_ISSET(hcp, H_DELETED)) { if (lcp->dpgno == PGNO_INVALID) { if (lcp->pgno != chg_pgno) continue; } else if (lcp->dpgno != chg_pgno) continue; } if (page_deleted) { if (is_dup) { lcp->dpgno = hcp->dpgno; lcp->dndx = hcp->dndx; } else { lcp->pgno = hcp->pgno; lcp->bndx = hcp->bndx; lcp->bucket = hcp->bucket; } F_CLR(lcp, H_ISDUP); continue; } if (!is_dup && lcp->bndx > hcp->bndx) lcp->bndx--; else if (!is_dup && lcp->bndx == hcp->bndx) if (add) lcp->bndx++; else F_SET(lcp, H_DELETED); else if (is_dup && hcp->dpgno != PGNO_INVALID && hcp->dpgno == lcp->dpgno) { /* Off-page duplicate. */ if (add && lcp->dndx >= hcp->dndx ) lcp->dndx++; else if (!add && lcp->dndx > hcp->dndx) lcp->dndx--; else if (!add && lcp->dndx == hcp->dndx) F_SET(lcp, H_DELETED); } else if (is_dup && lcp->pgno == chg_pgno && lcp->bndx == hcp->bndx) { /* On-page duplicate. */ if (add) { lcp->dup_tlen += len; if (lcp->dup_off > hcp->dup_off) lcp->dup_off += len; if (lcp->dup_off == hcp->dup_off) lcp->dup_len = len; } else { lcp->dup_tlen -= len; if (lcp->dup_off > hcp->dup_off) lcp->dup_off -= len; else if (lcp->dup_off == hcp->dup_off) F_SET(lcp, H_DELETED); } } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } /* * CDB___ham_get_clist -- * * Get a list of cursors either on a particular bucket or on a particular * page and index combination. The former is so that we can update * cursors on a split. The latter is so we can update cursors when we * move items off page. * * PUBLIC: int CDB___ham_get_clist __P((DB *, * PUBLIC: db_pgno_t, u_int32_t, HASH_CURSOR ***)); */ int CDB___ham_get_clist(dbp, bucket, indx, listp) DB *dbp; db_pgno_t bucket; u_int32_t indx; HASH_CURSOR ***listp; { DBC *cp; int nalloc, nused, ret; /* * Assume that finding anything is the exception, so optimize for * the case where there aren't any. */ nalloc = nused = 0; *listp = NULL; MUTEX_THREAD_LOCK(dbp->mutexp); for (cp = TAILQ_FIRST(&dbp->active_queue); cp != NULL; cp = TAILQ_NEXT(cp, links)) if ((indx == NDX_INVALID && ((HASH_CURSOR *)(cp->internal))->bucket == bucket) || (indx != NDX_INVALID && ((HASH_CURSOR *)(cp->internal))->pgno == bucket && ((HASH_CURSOR *)(cp->internal))->bndx == indx)) { if (nused >= nalloc) { nalloc += 10; if ((ret = CDB___os_realloc(nalloc * sizeof(HASH_CURSOR *), NULL, listp)) != 0) return (ret); } (*listp)[nused++] = (HASH_CURSOR *)cp->internal; } MUTEX_THREAD_UNLOCK(dbp->mutexp); if (listp != NULL) { if (nused >= nalloc) { nalloc++; if ((ret = CDB___os_realloc(nalloc * sizeof(HASH_CURSOR *), NULL, listp)) != 0) return (ret); } (*listp)[nused] = NULL; } return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash.h�����������������������������������������������������������������������������0100644�0063146�0012731�00000014074�07427026535�014064� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)hash.h 11.5 (Sleepycat) 10/5/99 */ /* Hash internal structure. */ typedef struct hash_t { DB *dbp; /* Pointer to enclosing DB */ db_pgno_t meta_pgno; /* Page number of the meta data page. */ u_int32_t h_ffactor; /* Fill factor. */ u_int32_t h_nelem; /* Number of elements. */ /* Hash function. */ u_int32_t (*h_hash) __P((const void *, u_int32_t)); } HASH; /* Cursor structure definitions. */ typedef struct cursor_t { DBC *dbc; /* Per-thread information */ DB_LOCK hlock; /* Metadata page lock. */ HMETA *hdr; /* Pointer to meta-data page. */ PAGE *split_buf; /* Temporary buffer for splits. */ /* Hash cursor information */ db_pgno_t bucket; /* Bucket we are traversing. */ db_pgno_t lbucket; /* Bucket for which we are locked. */ DB_LOCK lock; /* Lock held on the current bucket. */ db_lockmode_t mode; /* Lock mode of lock. */ PAGE *pagep; /* The current page. */ db_pgno_t pgno; /* Current page number. */ db_indx_t bndx; /* Index within the current page. */ PAGE *dpagep; /* Duplicate page pointer. */ db_pgno_t dpgno; /* Duplicate page number. */ db_indx_t dndx; /* Index within a duplicate set. */ db_indx_t dup_off; /* Offset within a duplicate set. */ db_indx_t dup_len; /* Length of current duplicate. */ db_indx_t dup_tlen; /* Total length of duplicate entry. */ u_int32_t seek_size; /* Number of bytes we need for add. */ db_pgno_t seek_found_page;/* Page on which we can insert. */ #define H_DELETED 0x0001 /* Cursor item is deleted. */ #define H_DUPONLY 0x0002 /* Dups only; do not change key. */ #define H_EXPAND 0x0004 /* Table expanded. */ #define H_ISDUP 0x0008 /* Cursor is within duplicate set. */ #define H_NOMORE 0x0010 /* No more entries in bucket. */ #define H_OK 0x0020 /* Request succeeded. */ #define H_DIRTY 0x0040 /* Meta-data page needs to be written */ #define H_ORIGINAL 0x0080 /* Bucket lock existed on entry. */ u_int32_t flags; } HASH_CURSOR; #define IS_VALID(C) ((C)->bucket != BUCKET_INVALID) #define SAVE_CURSOR(ORIG, COPY) { \ if ((ORIG)->lock.off != LOCK_INVALID) \ F_SET((ORIG), H_ORIGINAL); \ *(COPY) = *(ORIG); \ } #define RESTORE_CURSOR(D, ORIG, COPY, RET) { \ if ((RET) == 0) { \ if ((ORIG)->dbc->txn == NULL && \ (COPY)->lock.off != LOCK_INVALID && \ (ORIG)->lock.off != (COPY)->lock.off) { \ if ((ORIG)->lbucket == (COPY)->lbucket && \ (ORIG)->mode == DB_LOCK_WRITE && \ (COPY)->mode == DB_LOCK_READ) { \ (void)CDB_lock_put((D)->dbenv, &(ORIG)->lock);\ (ORIG)->lock = (COPY)->lock; \ (ORIG)->mode = (COPY)->mode; \ } else \ (void)CDB_lock_put((D)->dbenv, &(COPY)->lock);\ } \ } else { \ if ((ORIG)->dbc->txn == NULL && \ (ORIG)->lock.off != LOCK_INVALID && \ (ORIG)->lock.off != (COPY)->lock.off) \ (void)CDB_lock_put((D)->dbenv, &(ORIG)->lock); \ *ORIG = *COPY; \ } \ } /* Test string. */ #define CHARKEY "%$sniglet^&" /* Overflow management */ /* * The spares table indicates the page number at which each doubling begins. * From this page number we subtract the number of buckets already allocated * so that we can do a simple addition to calculate the page number here. */ #define BUCKET_TO_PAGE(I, B) ((B) + (I)->hdr->spares[CDB___db_log2((B)+1)]) /* Constraints about number of pages and how much data goes on a page. */ #define MAX_PAGES(H) UINT32_T_MAX #define MINFILL 4 #define ISBIG(I, N) (((N) > ((I)->hdr->dbmeta.pagesize / MINFILL)) ? 1 : 0) /* Shorthands for accessing structure */ #define NDX_INVALID 0xFFFF #define BUCKET_INVALID 0xFFFFFFFF /* On page duplicates are stored as a string of size-data-size triples. */ #define DUP_SIZE(len) ((len) + 2 * sizeof(db_indx_t)) /* Log messages types (these are subtypes within a record type) */ #define PAIR_KEYMASK 0x1 #define PAIR_DATAMASK 0x2 #define PAIR_ISKEYBIG(N) (N & PAIR_KEYMASK) #define PAIR_ISDATABIG(N) (N & PAIR_DATAMASK) #define OPCODE_OF(N) (N & ~(PAIR_KEYMASK | PAIR_DATAMASK)) #define PUTPAIR 0x20 #define DELPAIR 0x30 #define PUTOVFL 0x40 #define DELOVFL 0x50 #define ALLOCPGNO 0x60 #define DELPGNO 0x70 #define SPLITOLD 0x80 #define SPLITNEW 0x90 #include "hash_auto.h" #include "hash_ext.h" #include "db_am.h" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash.src���������������������������������������������������������������������������0100644�0063146�0012731�00000023525�07427026535�014425� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)hash.src 10.14 (Sleepycat) 10/1/99 */ /* * This is the source file used to create the logging functions for the * hash package. Each access method (or set of routines wishing to register * record types with the transaction system) should have a file like this. * Each type of log record and its parameters is defined. The basic * format of a record definition is: * * BEGIN <RECORD_TYPE> * ARG|STRING|POINTER <variable name> <variable type> <printf format> * ... * END * ARG the argument is a simple parameter of the type * specified. * DBT the argument is a DBT (db.h) containing a length and pointer. * PTR the argument is a pointer to the data type specified; the entire * type should be logged. * * There are a set of shell scripts of the form xxx.sh that generate c * code and or h files to process these. (This is probably better done * in a single PERL script, but for now, this works.) * * The DB recovery system requires the following three fields appear in * every record, and will assign them to the per-record-type structures * as well as making them the first parameters to the appropriate logging * call. * rectype: record-type, identifies the structure and log/read call * txnid: transaction id, a DBT in this implementation * prev: the last LSN for this transaction */ /* * Use the argument of PREFIX as the prefix for all record types, * routines, id numbers, etc. */ PREFIX ham INCLUDE #include "db_config.h" INCLUDE INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include <sys/types.h> INCLUDE INCLUDE #include <ctype.h> INCLUDE #include <string.h> INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" INCLUDE #include "db_page.h" INCLUDE #include "db_dispatch.h" INCLUDE #include "db_am.h" INCLUDE #include "hash.h" INCLUDE #include "txn.h" INCLUDE /* * HASH-insdel: used for hash to insert/delete a pair of entries onto a master * page. The pair might be regular key/data pairs or they might be the * structures that refer to off page items, duplicates or offpage duplicates. * opcode - PUTPAIR/DELPAIR + big masks * fileid - identifies the file referenced * pgno - page within file * ndx - index on the page of the item being added (item index) * pagelsn - lsn on the page before the update * key - the key being inserted * data - the data being inserted */ BEGIN insdel ARG opcode u_int32_t lu ARG fileid int32_t lu ARG pgno db_pgno_t lu ARG ndx u_int32_t lu POINTER pagelsn DB_LSN * lu DBT key DBT s DBT data DBT s END /* * Used to add and remove overflow pages. * prev_pgno is the previous page that is going to get modified to * point to this one. If this is the first page in a chain * then prev_pgno should be PGNO_INVALID. * new_pgno is the page being allocated. * next_pgno is the page that follows this one. On allocation, * this should be PGNO_INVALID. For deletes, it may exist. * pagelsn is the old lsn on the page. */ BEGIN newpage ARG opcode u_int32_t lu ARG fileid int32_t lu ARG prev_pgno db_pgno_t lu POINTER prevlsn DB_LSN * lu ARG new_pgno db_pgno_t lu POINTER pagelsn DB_LSN * lu ARG next_pgno db_pgno_t lu POINTER nextlsn DB_LSN * lu END /* * THIS IS A DEPRECATED LOG MESSAGE. IT IS BEING SUPERCEDED * BY metagroup WHICH ALLOCATES A GROUP OF NEW PAGES. * * Splitting requires two types of log messages. The first * logs the meta-data of the split. The second logs the * data on the original page. To redo the split, we have * to visit the new page (pages) and add the items back * on the page if they are not yet there. * For the meta-data split * bucket: max_bucket in table before split * ovflpoint: overflow point before split. * spares: spares[ovflpoint] before split. */ BEGIN splitmeta ARG fileid int32_t lu ARG bucket u_int32_t lu ARG ovflpoint u_int32_t lu ARG spares u_int32_t lu POINTER metalsn DB_LSN * lu END BEGIN splitdata ARG fileid int32_t lu ARG opcode u_int32_t lu ARG pgno db_pgno_t lu DBT pageimage DBT s POINTER pagelsn DB_LSN * lu END /* * HASH-replace: is used for hash to handle partial puts that only * affect a single master page. * fileid - identifies the file referenced * pgno - page within file * ndx - index on the page of the item being modified (item index) * pagelsn - lsn on the page before the update * off - offset in the old item where the new item is going. * olditem - DBT that describes the part of the item being replaced. * newitem - DBT of the new item. * makedup - this was a replacement that made an item a duplicate. */ BEGIN replace ARG fileid int32_t lu ARG pgno db_pgno_t lu ARG ndx u_int32_t lu POINTER pagelsn DB_LSN * lu ARG off int32_t ld DBT olditem DBT s DBT newitem DBT s ARG makedup u_int32_t lu END /* * DEPRECATED IN 3.0 * Hash now uses the btree allocation and deletion page routines. * * HASH-newpgno: is used to record getting/deleting a new page number. * This doesn't require much data modification, just modifying the * meta-data. * pgno is the page being allocated/freed. * free_pgno is the next_pgno on the free list. * old_type was the type of a page being deallocated. * old_pgno was the next page number before the deallocation. */ BEGIN newpgno ARG opcode u_int32_t lu ARG fileid int32_t lu ARG pgno db_pgno_t lu ARG free_pgno db_pgno_t lu ARG old_type u_int32_t lu ARG old_pgno db_pgno_t lu ARG new_type u_int32_t lu POINTER pagelsn DB_LSN * lu POINTER metalsn DB_LSN * lu END /* * DEPRECATED in 3.0 * Since we now pre-allocate the contiguous chunk of pages for a doubling, * there is no big benefit to pre-allocating a few extra pages. It used * to be that the file was only physically as large as the current bucket, * so if you were on a doubling of 16K, but were only on the first bucket * of that 16K, the file was much shorter than it would be at the end of * the doubling, so we didn't want to force overflow pages at the end of the * 16K pages. Since we now must allocate the 16K pages (because of sub * databases), it's not a big deal to tack extra pages on at the end. * * ovfl: initialize a set of overflow pages. */ BEGIN ovfl ARG fileid int32_t lu ARG start_pgno db_pgno_t lu ARG npages u_int32_t lu ARG free_pgno db_pgno_t lu ARG ovflpoint u_int32_t lu POINTER metalsn DB_LSN * lu END /* * Used when we empty the first page in a bucket and there are pages after * it. The page after it gets copied into the bucket page (since bucket * pages have to be in fixed locations). * pgno: the bucket page * pagelsn: the old LSN on the bucket page * next_pgno: the page number of the next page * nnext_pgno: page after next_pgno (may need to change its prev) * nnextlsn: the LSN of nnext_pgno. */ BEGIN copypage ARG fileid int32_t lu ARG pgno db_pgno_t lu POINTER pagelsn DB_LSN * lu ARG next_pgno db_pgno_t lu POINTER nextlsn DB_LSN * lu ARG nnext_pgno db_pgno_t lu POINTER nnextlsn DB_LSN * lu DBT page DBT s END /* * This replaces the old splitmeta operation. It behaves largely the same * way, but it has enough information so that we can record a group allocation * which we do now because of sub databases. The number of pages allocated is * always bucket + 1 pgno is the page number of the first newly allocated * bucket. * bucket: Old maximum bucket number. * pgno: Page allocated to bucket + 1 (first newly allocated page) * metalsn: Lsn of the meta-data page. * pagelsn: Lsn of the maximum page allocated. */ BEGIN metagroup ARG fileid int32_t lu ARG bucket u_int32_t lu ARG pgno db_pgno_t lu POINTER metalsn DB_LSN * lu POINTER pagelsn DB_LSN * lu END /* * groupalloc * * This is used in conjunction with MPOOL_NEW_GROUP when we are creating * a new database to make sure that we recreate or reclaim free pages * when we allocate a chunk of contiguous ones during database creation. * * pgno: meta-data page number * metalsn: meta-data lsn * start_pgno: starting page number * num: number of allocated pages */ BEGIN groupalloc ARG fileid int32_t lu ARG pgno db_pgno_t lu POINTER metalsn DB_LSN * lu POINTER mmetalsn DB_LSN * lu ARG start_pgno db_pgno_t lu ARG num u_int32_t lu END ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_auto.c������������������������������������������������������������������������0100644�0063146�0012731�00000135143�07427026535�015110� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "hash.h" #include "txn.h" int CDB___ham_insdel_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, ndx, pagelsn, key, data) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; u_int32_t ndx; DB_LSN * pagelsn; const DBT *key; const DBT *data; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_insdel; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(ndx) + sizeof(*pagelsn) + sizeof(u_int32_t) + (key == NULL ? 0 : key->size) + sizeof(u_int32_t) + (data == NULL ? 0 : data->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &ndx, sizeof(ndx)); bp += sizeof(ndx); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); if (key == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &key->size, sizeof(key->size)); bp += sizeof(key->size); memcpy(bp, key->data, key->size); bp += key->size; } if (data == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &data->size, sizeof(data->size)); bp += sizeof(data->size); memcpy(bp, data->data, data->size); bp += data->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_insdel_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_insdel_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_insdel_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_insdel: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tndx: %lu\n", (u_long)argp->ndx); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\tkey: "); for (i = 0; i < argp->key.size; i++) { ch = ((u_int8_t *)argp->key.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tdata: "); for (i = 0; i < argp->data.size; i++) { ch = ((u_int8_t *)argp->data.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_insdel_read(recbuf, argpp) void *recbuf; __ham_insdel_args **argpp; { __ham_insdel_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_insdel_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->ndx, bp, sizeof(argp->ndx)); bp += sizeof(argp->ndx); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memset(&argp->key, 0, sizeof(argp->key)); memcpy(&argp->key.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->key.data = bp; bp += argp->key.size; memset(&argp->data, 0, sizeof(argp->data)); memcpy(&argp->data.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->data.data = bp; bp += argp->data.size; *argpp = argp; return (0); } int CDB___ham_newpage_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, prev_pgno, prevlsn, new_pgno, pagelsn, next_pgno, nextlsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t prev_pgno; DB_LSN * prevlsn; db_pgno_t new_pgno; DB_LSN * pagelsn; db_pgno_t next_pgno; DB_LSN * nextlsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_newpage; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(prev_pgno) + sizeof(*prevlsn) + sizeof(new_pgno) + sizeof(*pagelsn) + sizeof(next_pgno) + sizeof(*nextlsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &prev_pgno, sizeof(prev_pgno)); bp += sizeof(prev_pgno); if (prevlsn != NULL) memcpy(bp, prevlsn, sizeof(*prevlsn)); else memset(bp, 0, sizeof(*prevlsn)); bp += sizeof(*prevlsn); memcpy(bp, &new_pgno, sizeof(new_pgno)); bp += sizeof(new_pgno); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); memcpy(bp, &next_pgno, sizeof(next_pgno)); bp += sizeof(next_pgno); if (nextlsn != NULL) memcpy(bp, nextlsn, sizeof(*nextlsn)); else memset(bp, 0, sizeof(*nextlsn)); bp += sizeof(*nextlsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_newpage_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_newpage_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_newpage_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_newpage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tprev_pgno: %lu\n", (u_long)argp->prev_pgno); printf("\tprevlsn: [%lu][%lu]\n", (u_long)argp->prevlsn.file, (u_long)argp->prevlsn.offset); printf("\tnew_pgno: %lu\n", (u_long)argp->new_pgno); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); printf("\tnextlsn: [%lu][%lu]\n", (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_newpage_read(recbuf, argpp) void *recbuf; __ham_newpage_args **argpp; { __ham_newpage_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_newpage_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->prev_pgno, bp, sizeof(argp->prev_pgno)); bp += sizeof(argp->prev_pgno); memcpy(&argp->prevlsn, bp, sizeof(argp->prevlsn)); bp += sizeof(argp->prevlsn); memcpy(&argp->new_pgno, bp, sizeof(argp->new_pgno)); bp += sizeof(argp->new_pgno); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); bp += sizeof(argp->next_pgno); memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); bp += sizeof(argp->nextlsn); *argpp = argp; return (0); } int CDB___ham_splitmeta_log(dbenv, txnid, ret_lsnp, flags, fileid, bucket, ovflpoint, spares, metalsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; u_int32_t bucket; u_int32_t ovflpoint; u_int32_t spares; DB_LSN * metalsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_splitmeta; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(bucket) + sizeof(ovflpoint) + sizeof(spares) + sizeof(*metalsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &bucket, sizeof(bucket)); bp += sizeof(bucket); memcpy(bp, &ovflpoint, sizeof(ovflpoint)); bp += sizeof(ovflpoint); memcpy(bp, &spares, sizeof(spares)); bp += sizeof(spares); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_splitmeta_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_splitmeta_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_splitmeta_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_splitmeta: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tbucket: %lu\n", (u_long)argp->bucket); printf("\tovflpoint: %lu\n", (u_long)argp->ovflpoint); printf("\tspares: %lu\n", (u_long)argp->spares); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_splitmeta_read(recbuf, argpp) void *recbuf; __ham_splitmeta_args **argpp; { __ham_splitmeta_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_splitmeta_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->bucket, bp, sizeof(argp->bucket)); bp += sizeof(argp->bucket); memcpy(&argp->ovflpoint, bp, sizeof(argp->ovflpoint)); bp += sizeof(argp->ovflpoint); memcpy(&argp->spares, bp, sizeof(argp->spares)); bp += sizeof(argp->spares); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); *argpp = argp; return (0); } int CDB___ham_splitdata_log(dbenv, txnid, ret_lsnp, flags, fileid, opcode, pgno, pageimage, pagelsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; u_int32_t opcode; db_pgno_t pgno; const DBT *pageimage; DB_LSN * pagelsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_splitdata; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(opcode) + sizeof(pgno) + sizeof(u_int32_t) + (pageimage == NULL ? 0 : pageimage->size) + sizeof(*pagelsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (pageimage == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &pageimage->size, sizeof(pageimage->size)); bp += sizeof(pageimage->size); memcpy(bp, pageimage->data, pageimage->size); bp += pageimage->size; } if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_splitdata_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_splitdata_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_splitdata_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_splitdata: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tpageimage: "); for (i = 0; i < argp->pageimage.size; i++) { ch = ((u_int8_t *)argp->pageimage.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_splitdata_read(recbuf, argpp) void *recbuf; __ham_splitdata_args **argpp; { __ham_splitdata_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_splitdata_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memset(&argp->pageimage, 0, sizeof(argp->pageimage)); memcpy(&argp->pageimage.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->pageimage.data = bp; bp += argp->pageimage.size; memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); *argpp = argp; return (0); } int CDB___ham_replace_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, ndx, pagelsn, off, olditem, newitem, makedup) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; u_int32_t ndx; DB_LSN * pagelsn; int32_t off; const DBT *olditem; const DBT *newitem; u_int32_t makedup; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_replace; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(ndx) + sizeof(*pagelsn) + sizeof(off) + sizeof(u_int32_t) + (olditem == NULL ? 0 : olditem->size) + sizeof(u_int32_t) + (newitem == NULL ? 0 : newitem->size) + sizeof(makedup); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &ndx, sizeof(ndx)); bp += sizeof(ndx); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); memcpy(bp, &off, sizeof(off)); bp += sizeof(off); if (olditem == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &olditem->size, sizeof(olditem->size)); bp += sizeof(olditem->size); memcpy(bp, olditem->data, olditem->size); bp += olditem->size; } if (newitem == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &newitem->size, sizeof(newitem->size)); bp += sizeof(newitem->size); memcpy(bp, newitem->data, newitem->size); bp += newitem->size; } memcpy(bp, &makedup, sizeof(makedup)); bp += sizeof(makedup); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_replace_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_replace_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_replace_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_replace: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tndx: %lu\n", (u_long)argp->ndx); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\toff: %ld\n", (long)argp->off); printf("\tolditem: "); for (i = 0; i < argp->olditem.size; i++) { ch = ((u_int8_t *)argp->olditem.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tnewitem: "); for (i = 0; i < argp->newitem.size; i++) { ch = ((u_int8_t *)argp->newitem.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tmakedup: %lu\n", (u_long)argp->makedup); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_replace_read(recbuf, argpp) void *recbuf; __ham_replace_args **argpp; { __ham_replace_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_replace_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->ndx, bp, sizeof(argp->ndx)); bp += sizeof(argp->ndx); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memcpy(&argp->off, bp, sizeof(argp->off)); bp += sizeof(argp->off); memset(&argp->olditem, 0, sizeof(argp->olditem)); memcpy(&argp->olditem.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->olditem.data = bp; bp += argp->olditem.size; memset(&argp->newitem, 0, sizeof(argp->newitem)); memcpy(&argp->newitem.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->newitem.data = bp; bp += argp->newitem.size; memcpy(&argp->makedup, bp, sizeof(argp->makedup)); bp += sizeof(argp->makedup); *argpp = argp; return (0); } int CDB___ham_newpgno_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, pgno, free_pgno, old_type, old_pgno, new_type, pagelsn, metalsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; db_pgno_t free_pgno; u_int32_t old_type; db_pgno_t old_pgno; u_int32_t new_type; DB_LSN * pagelsn; DB_LSN * metalsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_newpgno; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(pgno) + sizeof(free_pgno) + sizeof(old_type) + sizeof(old_pgno) + sizeof(new_type) + sizeof(*pagelsn) + sizeof(*metalsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &free_pgno, sizeof(free_pgno)); bp += sizeof(free_pgno); memcpy(bp, &old_type, sizeof(old_type)); bp += sizeof(old_type); memcpy(bp, &old_pgno, sizeof(old_pgno)); bp += sizeof(old_pgno); memcpy(bp, &new_type, sizeof(new_type)); bp += sizeof(new_type); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_newpgno_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_newpgno_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_newpgno_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_newpgno: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tfree_pgno: %lu\n", (u_long)argp->free_pgno); printf("\told_type: %lu\n", (u_long)argp->old_type); printf("\told_pgno: %lu\n", (u_long)argp->old_pgno); printf("\tnew_type: %lu\n", (u_long)argp->new_type); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_newpgno_read(recbuf, argpp) void *recbuf; __ham_newpgno_args **argpp; { __ham_newpgno_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_newpgno_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->free_pgno, bp, sizeof(argp->free_pgno)); bp += sizeof(argp->free_pgno); memcpy(&argp->old_type, bp, sizeof(argp->old_type)); bp += sizeof(argp->old_type); memcpy(&argp->old_pgno, bp, sizeof(argp->old_pgno)); bp += sizeof(argp->old_pgno); memcpy(&argp->new_type, bp, sizeof(argp->new_type)); bp += sizeof(argp->new_type); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); *argpp = argp; return (0); } int CDB___ham_ovfl_log(dbenv, txnid, ret_lsnp, flags, fileid, start_pgno, npages, free_pgno, ovflpoint, metalsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t start_pgno; u_int32_t npages; db_pgno_t free_pgno; u_int32_t ovflpoint; DB_LSN * metalsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_ovfl; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(start_pgno) + sizeof(npages) + sizeof(free_pgno) + sizeof(ovflpoint) + sizeof(*metalsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &start_pgno, sizeof(start_pgno)); bp += sizeof(start_pgno); memcpy(bp, &npages, sizeof(npages)); bp += sizeof(npages); memcpy(bp, &free_pgno, sizeof(free_pgno)); bp += sizeof(free_pgno); memcpy(bp, &ovflpoint, sizeof(ovflpoint)); bp += sizeof(ovflpoint); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_ovfl_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_ovfl_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_ovfl_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_ovfl: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); printf("\tnpages: %lu\n", (u_long)argp->npages); printf("\tfree_pgno: %lu\n", (u_long)argp->free_pgno); printf("\tovflpoint: %lu\n", (u_long)argp->ovflpoint); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_ovfl_read(recbuf, argpp) void *recbuf; __ham_ovfl_args **argpp; { __ham_ovfl_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_ovfl_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); bp += sizeof(argp->start_pgno); memcpy(&argp->npages, bp, sizeof(argp->npages)); bp += sizeof(argp->npages); memcpy(&argp->free_pgno, bp, sizeof(argp->free_pgno)); bp += sizeof(argp->free_pgno); memcpy(&argp->ovflpoint, bp, sizeof(argp->ovflpoint)); bp += sizeof(argp->ovflpoint); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); *argpp = argp; return (0); } int CDB___ham_copypage_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, pagelsn, next_pgno, nextlsn, nnext_pgno, nnextlsn, page) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * pagelsn; db_pgno_t next_pgno; DB_LSN * nextlsn; db_pgno_t nnext_pgno; DB_LSN * nnextlsn; const DBT *page; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_copypage; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*pagelsn) + sizeof(next_pgno) + sizeof(*nextlsn) + sizeof(nnext_pgno) + sizeof(*nnextlsn) + sizeof(u_int32_t) + (page == NULL ? 0 : page->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); memcpy(bp, &next_pgno, sizeof(next_pgno)); bp += sizeof(next_pgno); if (nextlsn != NULL) memcpy(bp, nextlsn, sizeof(*nextlsn)); else memset(bp, 0, sizeof(*nextlsn)); bp += sizeof(*nextlsn); memcpy(bp, &nnext_pgno, sizeof(nnext_pgno)); bp += sizeof(nnext_pgno); if (nnextlsn != NULL) memcpy(bp, nnextlsn, sizeof(*nnextlsn)); else memset(bp, 0, sizeof(*nnextlsn)); bp += sizeof(*nnextlsn); if (page == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &page->size, sizeof(page->size)); bp += sizeof(page->size); memcpy(bp, page->data, page->size); bp += page->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_copypage_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_copypage_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_copypage_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_copypage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\tnext_pgno: %lu\n", (u_long)argp->next_pgno); printf("\tnextlsn: [%lu][%lu]\n", (u_long)argp->nextlsn.file, (u_long)argp->nextlsn.offset); printf("\tnnext_pgno: %lu\n", (u_long)argp->nnext_pgno); printf("\tnnextlsn: [%lu][%lu]\n", (u_long)argp->nnextlsn.file, (u_long)argp->nnextlsn.offset); printf("\tpage: "); for (i = 0; i < argp->page.size; i++) { ch = ((u_int8_t *)argp->page.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_copypage_read(recbuf, argpp) void *recbuf; __ham_copypage_args **argpp; { __ham_copypage_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_copypage_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); memcpy(&argp->next_pgno, bp, sizeof(argp->next_pgno)); bp += sizeof(argp->next_pgno); memcpy(&argp->nextlsn, bp, sizeof(argp->nextlsn)); bp += sizeof(argp->nextlsn); memcpy(&argp->nnext_pgno, bp, sizeof(argp->nnext_pgno)); bp += sizeof(argp->nnext_pgno); memcpy(&argp->nnextlsn, bp, sizeof(argp->nnextlsn)); bp += sizeof(argp->nnextlsn); memset(&argp->page, 0, sizeof(argp->page)); memcpy(&argp->page.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->page.data = bp; bp += argp->page.size; *argpp = argp; return (0); } int CDB___ham_metagroup_log(dbenv, txnid, ret_lsnp, flags, fileid, bucket, pgno, metalsn, pagelsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; u_int32_t bucket; db_pgno_t pgno; DB_LSN * metalsn; DB_LSN * pagelsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_metagroup; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(bucket) + sizeof(pgno) + sizeof(*metalsn) + sizeof(*pagelsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &bucket, sizeof(bucket)); bp += sizeof(bucket); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); if (pagelsn != NULL) memcpy(bp, pagelsn, sizeof(*pagelsn)); else memset(bp, 0, sizeof(*pagelsn)); bp += sizeof(*pagelsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_metagroup_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_metagroup_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_metagroup_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_metagroup: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tbucket: %lu\n", (u_long)argp->bucket); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\tpagelsn: [%lu][%lu]\n", (u_long)argp->pagelsn.file, (u_long)argp->pagelsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_metagroup_read(recbuf, argpp) void *recbuf; __ham_metagroup_args **argpp; { __ham_metagroup_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_metagroup_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->bucket, bp, sizeof(argp->bucket)); bp += sizeof(argp->bucket); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); memcpy(&argp->pagelsn, bp, sizeof(argp->pagelsn)); bp += sizeof(argp->pagelsn); *argpp = argp; return (0); } int CDB___ham_groupalloc_log(dbenv, txnid, ret_lsnp, flags, fileid, pgno, metalsn, mmetalsn, start_pgno, num) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_pgno_t pgno; DB_LSN * metalsn; DB_LSN * mmetalsn; db_pgno_t start_pgno; u_int32_t num; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_ham_groupalloc; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(pgno) + sizeof(*metalsn) + sizeof(*mmetalsn) + sizeof(start_pgno) + sizeof(num); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); if (mmetalsn != NULL) memcpy(bp, mmetalsn, sizeof(*mmetalsn)); else memset(bp, 0, sizeof(*mmetalsn)); bp += sizeof(*mmetalsn); memcpy(bp, &start_pgno, sizeof(start_pgno)); bp += sizeof(start_pgno); memcpy(bp, &num, sizeof(num)); bp += sizeof(num); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___ham_groupalloc_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __ham_groupalloc_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___ham_groupalloc_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]ham_groupalloc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\tmmetalsn: [%lu][%lu]\n", (u_long)argp->mmetalsn.file, (u_long)argp->mmetalsn.offset); printf("\tstart_pgno: %lu\n", (u_long)argp->start_pgno); printf("\tnum: %lu\n", (u_long)argp->num); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___ham_groupalloc_read(recbuf, argpp) void *recbuf; __ham_groupalloc_args **argpp; { __ham_groupalloc_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__ham_groupalloc_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); memcpy(&argp->mmetalsn, bp, sizeof(argp->mmetalsn)); bp += sizeof(argp->mmetalsn); memcpy(&argp->start_pgno, bp, sizeof(argp->start_pgno)); bp += sizeof(argp->start_pgno); memcpy(&argp->num, bp, sizeof(argp->num)); bp += sizeof(argp->num); *argpp = argp; return (0); } int CDB___ham_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_insdel_print, DB_ham_insdel)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_newpage_print, DB_ham_newpage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_splitmeta_print, DB_ham_splitmeta)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_splitdata_print, DB_ham_splitdata)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_replace_print, DB_ham_replace)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_newpgno_print, DB_ham_newpgno)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_ovfl_print, DB_ham_ovfl)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_copypage_print, DB_ham_copypage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_metagroup_print, DB_ham_metagroup)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_groupalloc_print, DB_ham_groupalloc)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___ham_init_recover __P((DB_ENV *)); */ int CDB___ham_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_insdel_recover, DB_ham_insdel)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_newpage_recover, DB_ham_newpage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_splitmeta_recover, DB_ham_splitmeta)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_splitdata_recover, DB_ham_splitdata)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_replace_recover, DB_ham_replace)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_newpgno_recover, DB_ham_newpgno)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_ovfl_recover, DB_ham_ovfl)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_copypage_recover, DB_ham_copypage)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_metagroup_recover, DB_ham_metagroup)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___ham_groupalloc_recover, DB_ham_groupalloc)) != 0) return (ret); return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_auto.h������������������������������������������������������������������������0100644�0063146�0012731�00000013224�07427026535�015110� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef ham_AUTO_H #define ham_AUTO_H #define DB_ham_insdel (DB_ham_BEGIN + 1) typedef struct _ham_insdel_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; u_int32_t ndx; DB_LSN pagelsn; DBT key; DBT data; } __ham_insdel_args; int CDB___ham_insdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *)); int CDB___ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_insdel_read __P((void *, __ham_insdel_args **)); #define DB_ham_newpage (DB_ham_BEGIN + 2) typedef struct _ham_newpage_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t prev_pgno; DB_LSN prevlsn; db_pgno_t new_pgno; DB_LSN pagelsn; db_pgno_t next_pgno; DB_LSN nextlsn; } __ham_newpage_args; int CDB___ham_newpage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *)); int CDB___ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_newpage_read __P((void *, __ham_newpage_args **)); #define DB_ham_splitmeta (DB_ham_BEGIN + 3) typedef struct _ham_splitmeta_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; u_int32_t bucket; u_int32_t ovflpoint; u_int32_t spares; DB_LSN metalsn; } __ham_splitmeta_args; int CDB___ham_splitmeta_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, u_int32_t, u_int32_t, DB_LSN *)); int CDB___ham_splitmeta_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_splitmeta_read __P((void *, __ham_splitmeta_args **)); #define DB_ham_splitdata (DB_ham_BEGIN + 4) typedef struct _ham_splitdata_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; u_int32_t opcode; db_pgno_t pgno; DBT pageimage; DB_LSN pagelsn; } __ham_splitdata_args; int CDB___ham_splitdata_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *)); int CDB___ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_splitdata_read __P((void *, __ham_splitdata_args **)); #define DB_ham_replace (DB_ham_BEGIN + 5) typedef struct _ham_replace_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; u_int32_t ndx; DB_LSN pagelsn; int32_t off; DBT olditem; DBT newitem; u_int32_t makedup; } __ham_replace_args; int CDB___ham_replace_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t)); int CDB___ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_replace_read __P((void *, __ham_replace_args **)); #define DB_ham_newpgno (DB_ham_BEGIN + 6) typedef struct _ham_newpgno_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_pgno_t pgno; db_pgno_t free_pgno; u_int32_t old_type; db_pgno_t old_pgno; u_int32_t new_type; DB_LSN pagelsn; DB_LSN metalsn; } __ham_newpgno_args; int CDB___ham_newpgno_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *, DB_LSN *)); int CDB___ham_newpgno_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_newpgno_read __P((void *, __ham_newpgno_args **)); #define DB_ham_ovfl (DB_ham_BEGIN + 7) typedef struct _ham_ovfl_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t start_pgno; u_int32_t npages; db_pgno_t free_pgno; u_int32_t ovflpoint; DB_LSN metalsn; } __ham_ovfl_args; int CDB___ham_ovfl_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, db_pgno_t, u_int32_t, DB_LSN *)); int CDB___ham_ovfl_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_ovfl_read __P((void *, __ham_ovfl_args **)); #define DB_ham_copypage (DB_ham_BEGIN + 8) typedef struct _ham_copypage_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN pagelsn; db_pgno_t next_pgno; DB_LSN nextlsn; db_pgno_t nnext_pgno; DB_LSN nnextlsn; DBT page; } __ham_copypage_args; int CDB___ham_copypage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *)); int CDB___ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_copypage_read __P((void *, __ham_copypage_args **)); #define DB_ham_metagroup (DB_ham_BEGIN + 9) typedef struct _ham_metagroup_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; u_int32_t bucket; db_pgno_t pgno; DB_LSN metalsn; DB_LSN pagelsn; } __ham_metagroup_args; int CDB___ham_metagroup_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, DB_LSN *, DB_LSN *)); int CDB___ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_metagroup_read __P((void *, __ham_metagroup_args **)); #define DB_ham_groupalloc (DB_ham_BEGIN + 10) typedef struct _ham_groupalloc_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_pgno_t pgno; DB_LSN metalsn; DB_LSN mmetalsn; db_pgno_t start_pgno; u_int32_t num; } __ham_groupalloc_args; int CDB___ham_groupalloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, DB_LSN *, db_pgno_t, u_int32_t)); int CDB___ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_groupalloc_read __P((void *, __ham_groupalloc_args **)); int CDB___ham_init_print __P((DB_ENV *)); #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_conv.c������������������������������������������������������������������������0100644�0063146�0012731�00000004240�07427026535�015076� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_conv.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "hash.h" /* * CDB___ham_pgin -- * Convert host-specific page layout from the host-independent format * stored on disk. * * PUBLIC: int CDB___ham_pgin __P((db_pgno_t, void *, DBT *)); */ int CDB___ham_pgin(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; PAGE *h; h = pp; pginfo = (DB_PGINFO *)cookie->data; /* * The hash access method does blind reads of pages, causing them * to be created. If the type field isn't set it's one of them, * initialize the rest of the page and return. */ if (h->type == 0) { P_INIT(pp, pginfo->db_pagesize, pg, PGNO_INVALID, PGNO_INVALID, 0, P_HASH); return (0); } if (!pginfo->needswap) return (0); return (h->type == P_HASHMETA ? CDB___ham_mswap(pp) : CDB___db_byteswap(pg, pp, pginfo->db_pagesize, 1)); } /* * CDB___ham_pgout -- * Convert host-specific page layout to the host-independent format * stored on disk. * * PUBLIC: int CDB___ham_pgout __P((db_pgno_t, void *, DBT *)); */ int CDB___ham_pgout(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; PAGE *h; pginfo = (DB_PGINFO *)cookie->data; if (!pginfo->needswap) return (0); h = pp; return (h->type == P_HASHMETA ? CDB___ham_mswap(pp) : CDB___db_byteswap(pg, pp, pginfo->db_pagesize, 0)); } /* * CDB___ham_mswap -- * Swap the bytes on the hash metadata page. * * PUBLIC: int CDB___ham_mswap __P((void *)); */ int CDB___ham_mswap(pg) void *pg; { u_int8_t *p; int i; CDB___db_metaswap(pg); p = (u_int8_t *)pg + sizeof(DBMETA); SWAP32(p); /* max_bucket */ SWAP32(p); /* high_mask */ SWAP32(p); /* low_mask */ SWAP32(p); /* ffactor */ SWAP32(p); /* nelem */ SWAP32(p); /* h_charkey */ for (i = 0; i < NCACHED; ++i) SWAP32(p); /* spares */ return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_dup.c�������������������������������������������������������������������������0100644�0063146�0012731�00000051406�07427026535�014727� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_dup.c 11.17 (Sleepycat) 11/14/99"; #endif /* not lint */ /* * PACKAGE: hashing * * DESCRIPTION: * Manipulation of duplicates for the hash package. * * ROUTINES: * * External * __add_dup * Internal */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifdef DIAGNOSTIC #include <assert.h> #endif #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "hash.h" #include "btree.h" static int CDB___ham_check_move __P((DBC *, u_int32_t)); /* * Called from hash_access to add a duplicate key. nval is the new * value that we want to add. The flags correspond to the flag values * to cursor_put indicating where to add the new element. * There are 4 cases. * Case 1: The existing duplicate set already resides on a separate page. * We can use common code for this. * Case 2: The element is small enough to just be added to the existing set. * Case 3: The element is large enough to be a big item, so we're going to * have to push the set onto a new page. * Case 4: The element is large enough to push the duplicate set onto a * separate page. * * PUBLIC: int CDB___ham_add_dup __P((DBC *, DBT *, u_int32_t)); */ int CDB___ham_add_dup(dbc, nval, flags) DBC *dbc; DBT *nval; u_int32_t flags; { DB *dbp; HASH_CURSOR *hcp; DBT pval, tmp_val; u_int32_t add_bytes, new_size; db_indx_t dndx; int cmp, ret; u_int8_t *hk; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; #ifdef DIAGNOSTIC assert(flags != DB_CURRENT); #endif add_bytes = nval->size + (F_ISSET(nval, DB_DBT_PARTIAL) ? nval->doff : 0); add_bytes = DUP_SIZE(add_bytes); if ((ret = CDB___ham_check_move(dbc, add_bytes)) != 0) return (ret); /* * Check if resulting duplicate set is going to need to go * onto a separate duplicate page. If so, convert the * duplicate set and add the new one. After conversion, * hcp->dndx is the first free ndx or the index of the * current pointer into the duplicate set. */ hk = H_PAIRDATA(hcp->pagep, hcp->bndx); new_size = LEN_HKEYDATA(hcp->pagep, dbp->pgsize, H_DATAINDEX(hcp->bndx)) + add_bytes; /* * We convert to off-page duplicates if the item is a big item, * the addition of the new item will make the set large, or * if there isn't enough room on this page to add the next item. */ if (HPAGE_PTYPE(hk) != H_OFFDUP && (HPAGE_PTYPE(hk) == H_OFFPAGE || ISBIG(hcp, new_size) || add_bytes > P_FREESPACE(hcp->pagep))) { if ((ret = CDB___ham_dup_convert(dbc)) != 0) return (ret); hk = H_PAIRDATA(hcp->pagep, hcp->bndx); } /* There are two separate cases here: on page and off page. */ if (HPAGE_PTYPE(hk) != H_OFFDUP) { if (HPAGE_PTYPE(hk) != H_DUPLICATE) { pval.flags = 0; pval.data = HKEYDATA_DATA(hk); pval.size = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); if ((ret = CDB___ham_make_dup(&pval, &tmp_val, &dbc->rdata.data, &dbc->rdata.size)) != 0 || (ret = CDB___ham_replpair(dbc, &tmp_val, 1)) != 0) return (ret); hk = H_PAIRDATA(hcp->pagep, hcp->bndx); HPAGE_PTYPE(hk) = H_DUPLICATE; /* * Update the cursor position since we now are in * duplicates. */ F_SET(hcp, H_ISDUP); hcp->dup_off = 0; hcp->dup_len = pval.size; hcp->dup_tlen = DUP_SIZE(hcp->dup_len); } /* Now make the new entry a duplicate. */ if ((ret = CDB___ham_make_dup(nval, &tmp_val, &dbc->rdata.data, &dbc->rdata.size)) != 0) return (ret); tmp_val.dlen = 0; switch (flags) { /* On page. */ case DB_KEYFIRST: case DB_KEYLAST: if (dbp->dup_compare != NULL) CDB___ham_dsearch(dbc, nval, &tmp_val.doff, &cmp); else { hcp->dup_tlen = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); hcp->dup_len = nval->size; F_SET(hcp, H_ISDUP); if (flags == DB_KEYFIRST) hcp->dup_off = tmp_val.doff = 0; else hcp->dup_off = tmp_val.doff = hcp->dup_tlen; } break; case DB_BEFORE: tmp_val.doff = hcp->dup_off; break; case DB_AFTER: tmp_val.doff = hcp->dup_off + DUP_SIZE(hcp->dup_len); break; } /* Add the duplicate. */ ret = CDB___ham_replpair(dbc, &tmp_val, 0); if (ret == 0) ret = CDB___ham_dirty_page(dbp, hcp->pagep); /* Now, update the cursor if necessary. */ switch (flags) { case DB_AFTER: hcp->dup_off += DUP_SIZE(hcp->dup_len); hcp->dup_len = nval->size; hcp->dup_tlen += DUP_SIZE(nval->size); break; case DB_KEYFIRST: case DB_KEYLAST: case DB_BEFORE: hcp->dup_tlen += DUP_SIZE(nval->size); hcp->dup_len = nval->size; break; } CDB___ham_c_update(hcp, hcp->pgno, tmp_val.size, 1, 1); return (ret); } /* If we get here, then we're on duplicate pages. */ if (hcp->dpgno == PGNO_INVALID) { memcpy(&hcp->dpgno, HOFFDUP_PGNO(hk), sizeof(db_pgno_t)); hcp->dndx = 0; } switch (flags) { case DB_KEYFIRST: if (dbp->dup_compare != NULL) goto sorted_dups; /* * The only way that we are already on a dup page is * if we just converted the on-page representation. * In that case, we've only got one page of duplicates. */ if (hcp->dpagep == NULL && (ret = CDB___db_dend(dbc, hcp->dpgno, &hcp->dpagep)) != 0) return (ret); hcp->dndx = 0; break; case DB_KEYLAST: if (dbp->dup_compare != NULL) { sorted_dups: if ((ret = CDB___db_dsearch(dbc, 1, nval, hcp->dpgno, &hcp->dndx, &hcp->dpagep, &cmp)) != 0) return (ret); if (cmp == 0) hcp->dpgno = PGNO(hcp->dpagep); } else { if (hcp->dpagep == NULL && (ret = CDB___db_dend(dbc, hcp->dpgno, &hcp->dpagep)) != 0) return (ret); hcp->dpgno = PGNO(hcp->dpagep); hcp->dndx = NUM_ENT(hcp->dpagep); } break; case DB_BEFORE: /* The default behavior is correct. */ break; case DB_AFTER: hcp->dndx++; break; } /* * On page splits, the 4th parameter of db_dput returns the location * the new item was put. We cannot pass in permanent fields from the * cursor, they may have been updated in cursor adjustment. */ dndx = hcp->dndx; ret = CDB___db_dput(dbc, nval, &hcp->dpagep, &dndx); hcp->dpgno = PGNO(hcp->dpagep); hcp->dndx = dndx; CDB___ham_c_update(hcp, hcp->dpgno, nval->size, 1, 1); return (ret); } /* * Convert an on-page set of duplicates to an offpage set of duplicates. * * PUBLIC: int CDB___ham_dup_convert __P((DBC *)); */ int CDB___ham_dup_convert(dbc) DBC *dbc; { DB *dbp; HASH_CURSOR *hcp, **hcs; BOVERFLOW bo; DBT dbt; HOFFPAGE ho; db_indx_t dndx, i, len, off; int c, ret; u_int8_t *p, *pend; /* * Create a new page for the duplicates. */ dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___db_new(dbc, P_DUPLICATE, &hcp->dpagep)) != 0) return (ret); hcp->dpagep->type = P_DUPLICATE; hcp->dpgno = PGNO(hcp->dpagep); /* * Now put the duplicates onto the new page. */ dndx = 0; dbt.flags = 0; switch (HPAGE_PTYPE(H_PAIRDATA(hcp->pagep, hcp->bndx))) { case H_KEYDATA: /* Simple case, one key on page; move it to dup page. */ dbt.size = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); dbt.data = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)); ret = CDB___db_pitem(dbc, hcp->dpagep, (u_int32_t)dndx, BKEYDATA_SIZE(dbt.size), NULL, &dbt); if (ret == 0) CDB___ham_dirty_page(dbp, hcp->dpagep); break; case H_OFFPAGE: /* Simple case, one key on page; move it to dup page. */ memcpy(&ho, P_ENTRY(hcp->pagep, H_DATAINDEX(hcp->bndx)), HOFFPAGE_SIZE); UMRW(bo.unused1); B_TSET(bo.type, ho.type, 0); UMRW(bo.unused2); bo.pgno = ho.pgno; bo.tlen = ho.tlen; dbt.size = BOVERFLOW_SIZE; dbt.data = &bo; ret = CDB___db_pitem(dbc, hcp->dpagep, (u_int32_t)dndx, dbt.size, &dbt, NULL); if (ret == 0) CDB___ham_dirty_page(dbp, hcp->dpagep); break; case H_DUPLICATE: /* * Get the list of cursors that may need to be updated. */ if ((ret = CDB___ham_get_clist(dbp, PGNO(hcp->pagep), hcp->bndx, &hcs)) != 0) break; p = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)); pend = p + LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); /* * We need to maintain the duplicate cursor position. * Keep track of where we are in the duplicate set via * the offset, and when it matches the one in the cursor, * set the off-page duplicate cursor index to the current * index. */ for (off = 0, i = 0; p < pend; i++) { if (off == hcp->dup_off) dndx = i; memcpy(&len, p, sizeof(db_indx_t)); dbt.size = len; p += sizeof(db_indx_t); dbt.data = p; p += len + sizeof(db_indx_t); if ((ret = CDB___db_dput(dbc, &dbt, &hcp->dpagep, &i)) != 0) break; /* * Update any other cursors */ for (c = 0; hcs != NULL && hcs[c] != NULL; c++) if (hcs[c]->dup_off == off) { hcs[c]->dpgno = PGNO(hcp->dpagep); hcs[c]->dndx = i; } off += len + 2 * sizeof(db_indx_t); } if (hcs != NULL) CDB___os_free(hcs, 0); break; default: ret = CDB___db_pgfmt(dbp, (u_long)hcp->pgno); break; } if (ret == 0) { /* * Now attach this to the source page in place of * the old duplicate item. */ CDB___ham_move_offpage(dbc, hcp->pagep, (u_int32_t)H_DATAINDEX(hcp->bndx), hcp->dpgno); /* Can probably just do a "put" here. */ ret = CDB___ham_dirty_page(dbp, hcp->pagep); hcp->dndx = dndx; } else { (void)CDB___db_free(dbc, hcp->dpagep); hcp->dpagep = NULL; } return (ret); } /* * CDB___ham_make_dup * * Take a regular dbt and make it into a duplicate item with all the partial * information set appropriately. If the incoming dbt is a partial, assume * we are creating a new entry and make sure that we do any initial padding. * * PUBLIC: int CDB___ham_make_dup __P((const DBT *, DBT *d, void **, u_int32_t *)); */ int CDB___ham_make_dup(notdup, duplicate, bufp, sizep) const DBT *notdup; DBT *duplicate; void **bufp; u_int32_t *sizep; { db_indx_t tsize, item_size; int ret; u_int8_t *p; item_size = (db_indx_t)notdup->size; if (F_ISSET(notdup, DB_DBT_PARTIAL)) item_size += notdup->doff; tsize = DUP_SIZE(item_size); if ((ret = CDB___ham_init_dbt(duplicate, tsize, bufp, sizep)) != 0) return (ret); duplicate->dlen = 0; duplicate->flags = notdup->flags; F_SET(duplicate, DB_DBT_PARTIAL); p = duplicate->data; memcpy(p, &item_size, sizeof(db_indx_t)); p += sizeof(db_indx_t); if (F_ISSET(notdup, DB_DBT_PARTIAL)) { memset(p, 0, notdup->doff); p += notdup->doff; } memcpy(p, notdup->data, notdup->size); p += notdup->size; memcpy(p, &item_size, sizeof(db_indx_t)); duplicate->doff = 0; duplicate->dlen = notdup->size; return (0); } /* * CDB___ham_check_move -- * * Check if we can do whatever we need to on this page. If not, * then we'll have to move the current element to a new page. */ static int CDB___ham_check_move(dbc, add_len) DBC *dbc; u_int32_t add_len; { DB *dbp; HASH_CURSOR *hcp; DBT k, d; DB_LSN new_lsn; PAGE *next_pagep; db_pgno_t next_pgno; u_int32_t new_datalen, old_len, rectype; u_int8_t *hk; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; hk = H_PAIRDATA(hcp->pagep, hcp->bndx); /* * If the item is already off page duplicates or an offpage item, * then we know we can do whatever we need to do in-place */ if (HPAGE_PTYPE(hk) == H_OFFDUP || HPAGE_PTYPE(hk) == H_OFFPAGE) return (0); old_len = LEN_HITEM(hcp->pagep, dbp->pgsize, H_DATAINDEX(hcp->bndx)); new_datalen = old_len - HKEYDATA_SIZE(0) + add_len; if (HPAGE_PTYPE(hk) != H_DUPLICATE) new_datalen += DUP_SIZE(0); /* * We need to add a new page under two conditions: * 1. The addition makes the total data length cross the BIG * threshold and the OFFDUP structure won't fit on this page. * 2. The addition does not make the total data cross the * threshold, but the new data won't fit on the page. * If neither of these is true, then we can return. */ if (ISBIG(hcp, new_datalen) && (old_len > HOFFDUP_SIZE || HOFFDUP_SIZE - old_len <= P_FREESPACE(hcp->pagep))) return (0); if (!ISBIG(hcp, new_datalen) && add_len <= P_FREESPACE(hcp->pagep)) return (0); /* * If we get here, then we need to move the item to a new page. * Check if there are more pages in the chain. */ new_datalen = ISBIG(hcp, new_datalen) ? HOFFDUP_SIZE : HKEYDATA_SIZE(new_datalen); next_pagep = NULL; for (next_pgno = NEXT_PGNO(hcp->pagep); next_pgno != PGNO_INVALID; next_pgno = NEXT_PGNO(next_pagep)) { if (next_pagep != NULL && (ret = CDB___ham_put_page(dbp, next_pagep, 0)) != 0) return (ret); if ((ret = CDB___ham_get_page(dbp, next_pgno, &next_pagep)) != 0) return (ret); if (P_FREESPACE(next_pagep) >= new_datalen) break; } /* No more pages, add one. */ if (next_pagep == NULL && (ret = CDB___ham_add_ovflpage(dbc, hcp->pagep, 0, &next_pagep)) != 0) return (ret); /* Add new page at the end of the chain. */ if (P_FREESPACE(next_pagep) < new_datalen && (ret = CDB___ham_add_ovflpage(dbc, next_pagep, 1, &next_pagep)) != 0) { (void)CDB___ham_put_page(dbp, next_pagep, 0); return (ret); } /* Copy the item to the new page. */ if (DB_LOGGING(hcp->dbc)) { rectype = PUTPAIR; k.flags = 0; d.flags = 0; if (HPAGE_PTYPE( H_PAIRKEY(hcp->pagep, hcp->bndx)) == H_OFFPAGE) { rectype |= PAIR_KEYMASK; k.data = H_PAIRKEY(hcp->pagep, hcp->bndx); k.size = HOFFPAGE_SIZE; } else { k.data = HKEYDATA_DATA(H_PAIRKEY(hcp->pagep, hcp->bndx)); k.size = LEN_HKEY(hcp->pagep, dbp->pgsize, hcp->bndx); } if (HPAGE_PTYPE(hk) == H_OFFPAGE) { rectype |= PAIR_DATAMASK; d.data = H_PAIRDATA(hcp->pagep, hcp->bndx); d.size = HOFFPAGE_SIZE; } else { d.data = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)); d.size = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); } if ((ret = CDB___ham_insdel_log(dbp->dbenv, dbc->txn, &new_lsn, 0, rectype, dbp->log_fileid, PGNO(next_pagep), (u_int32_t)H_NUMPAIRS(next_pagep), &LSN(next_pagep), &k, &d)) != 0) return (ret); /* Move lsn onto page. */ LSN(next_pagep) = new_lsn; /* Structure assignment. */ } CDB___ham_copy_item(dbp->pgsize, hcp->pagep, H_KEYINDEX(hcp->bndx), next_pagep); CDB___ham_copy_item(dbp->pgsize, hcp->pagep, H_DATAINDEX(hcp->bndx), next_pagep); /* Now delete the pair from the current page. */ ret = CDB___ham_del_pair(dbc, 0); /* * CDB___ham_del_pair decremented nelem. This is incorrect; we * manually copied the element elsewhere, so the total number * of elements hasn't changed. Increment it again. */ if (!F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) hcp->hdr->nelem++; (void)CDB___ham_put_page(dbp, hcp->pagep, 1); hcp->pagep = next_pagep; hcp->pgno = PGNO(hcp->pagep); hcp->bndx = H_NUMPAIRS(hcp->pagep) - 1; F_SET(hcp, H_EXPAND); return (ret); } /* * CDB___ham_move_offpage -- * Replace an onpage set of duplicates with the OFFDUP structure * that references the duplicate page. * * XXX * This is really just a special case of __onpage_replace; we should * probably combine them. * * PUBLIC: void CDB___ham_move_offpage __P((DBC *, PAGE *, u_int32_t, db_pgno_t)); */ void CDB___ham_move_offpage(dbc, pagep, ndx, pgno) DBC *dbc; PAGE *pagep; u_int32_t ndx; db_pgno_t pgno; { DB *dbp; HASH_CURSOR *hcp; DBT new_dbt; DBT old_dbt; HOFFDUP od; db_indx_t i; int32_t shrink; u_int8_t *src; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; od.type = H_OFFDUP; UMRW(od.unused[0]); UMRW(od.unused[1]); UMRW(od.unused[2]); od.pgno = pgno; if (DB_LOGGING(dbc)) { new_dbt.data = &od; new_dbt.size = HOFFDUP_SIZE; old_dbt.data = P_ENTRY(pagep, ndx); old_dbt.size = LEN_HITEM(pagep, dbp->pgsize, ndx); (void)CDB___ham_replace_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, dbp->log_fileid, PGNO(pagep), (u_int32_t)ndx, &LSN(pagep), -1, &old_dbt, &new_dbt, 0); } shrink = LEN_HITEM(pagep, dbp->pgsize, ndx) - HOFFDUP_SIZE; if (shrink != 0) { /* Copy data. */ src = (u_int8_t *)(pagep) + HOFFSET(pagep); memmove(src + shrink, src, pagep->inp[ndx] - HOFFSET(pagep)); HOFFSET(pagep) += shrink; /* Update index table. */ for (i = ndx; i < NUM_ENT(pagep); i++) pagep->inp[i] += shrink; } /* Now copy the offdup entry onto the page. */ memcpy(P_ENTRY(pagep, ndx), &od, HOFFDUP_SIZE); } /* * CDB___ham_dsearch: * Locate a particular duplicate in a duplicate set. Make sure that * we exit with the cursor set appropriately. * * PUBLIC: void CDB___ham_dsearch __P((DBC *, DBT *, u_int32_t *, int *)); */ void CDB___ham_dsearch(dbc, dbt, offp, cmpp) DBC *dbc; DBT *dbt; u_int32_t *offp; int *cmpp; { DB *dbp; HASH_CURSOR *hcp; DBT cur; db_indx_t i, len; int (*func) __P((const DBT *, const DBT *)); u_int8_t *data; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if (dbp->dup_compare == NULL) func = CDB___bam_defcmp; else func = dbp->dup_compare; i = F_ISSET(dbc, DBC_CONTINUE) ? hcp->dup_off: 0; data = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)) + i; hcp->dup_tlen = LEN_HDATA(hcp->pagep, dbp->pgsize, hcp->bndx); while (i < hcp->dup_tlen) { memcpy(&len, data, sizeof(db_indx_t)); data += sizeof(db_indx_t); cur.data = data; cur.size = (u_int32_t)len; *cmpp = func(dbt, &cur); if (*cmpp == 0 || (*cmpp < 0 && dbp->dup_compare != NULL)) break; i += len + 2 * sizeof(db_indx_t); data += len + sizeof(db_indx_t); } *offp = i; hcp->dup_off = i; hcp->dup_len = len; F_SET(hcp, H_ISDUP); } /* * CDB___ham_ca_split -- * Adjust the cursors when splitting a page. * * PUBLIC: void CDB___ham_ca_split __P((DB *, * PUBLIC: db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int)); */ void CDB___ham_ca_split(dbp, ppgno, lpgno, rpgno, split_indx, cleft) DB *dbp; db_pgno_t ppgno, lpgno, rpgno; u_int32_t split_indx; int cleft; { HASH_CURSOR *hcp; DBC *dbc; /* * If splitting the page that a cursor was on, the cursor has to be * adjusted to point to the same record as before the split. Most * of the time we don't adjust pointers to the left page, because * we're going to copy its contents back over the original page. If * the cursor is on the right page, it is decremented by the number of * records split to the left page. */ MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { hcp = (HASH_CURSOR *)dbc->internal; if (hcp->dpgno == ppgno) { if (hcp->dndx < split_indx) { if (cleft) hcp->dpgno = lpgno; } else { hcp->dpgno = rpgno; hcp->dndx -= split_indx; } } } MUTEX_THREAD_UNLOCK(dbp->mutexp); } #ifdef DEBUG /* * CDB___ham_cprint -- * Display the current cursor list. * * PUBLIC: int CDB___ham_cprint __P((DB *)); */ int CDB___ham_cprint(dbp) DB *dbp; { HASH_CURSOR *cp; DBC *dbc; MUTEX_THREAD_LOCK(dbp->mutexp); for (dbc = TAILQ_FIRST(&dbp->active_queue); dbc != NULL; dbc = TAILQ_NEXT(dbc, links)) { cp = (HASH_CURSOR *)dbc->internal; fprintf(stderr, "%#0x->%#0x: page: %lu index: %lu dpage %lu dindex: %lu", (u_int)dbc, (u_int)cp, (u_long)cp->pgno, (u_long)cp->bndx, (u_long)cp->dpgno, (u_long)cp->dndx); if (F_ISSET(cp, H_DELETED)) fprintf(stderr, " (deleted)"); fprintf(stderr, "\n"); } MUTEX_THREAD_UNLOCK(dbp->mutexp); return (0); } #endif /* DEBUG */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_ext.h�������������������������������������������������������������������������0100644�0063146�0012731�00000010126�07427026535�014736� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _hash_ext_h_ #define _hash_ext_h_ int CDB___ham_metachk __P((DB *, const char *, HMETA *)); int CDB___ham_open __P((DB *, const char *, db_pgno_t)); int CDB___ham_c_init __P((DBC *)); int CDB___ham_c_dup __P((DBC *, DBC *)); u_int32_t CDB___ham_call_hash __P((HASH_CURSOR *, u_int8_t *, int32_t)); int CDB___ham_init_dbt __P((DBT *, u_int32_t, void **, u_int32_t *)); void CDB___ham_c_update __P((HASH_CURSOR *, db_pgno_t, u_int32_t, int, int)); int CDB___ham_get_clist __P((DB *, db_pgno_t, u_int32_t, HASH_CURSOR ***)); int CDB___ham_init_recover __P((DB_ENV *)); int CDB___ham_pgin __P((db_pgno_t, void *, DBT *)); int CDB___ham_pgout __P((db_pgno_t, void *, DBT *)); int CDB___ham_mswap __P((void *)); int CDB___ham_add_dup __P((DBC *, DBT *, u_int32_t)); int CDB___ham_dup_convert __P((DBC *)); int CDB___ham_make_dup __P((const DBT *, DBT *d, void **, u_int32_t *)); void CDB___ham_move_offpage __P((DBC *, PAGE *, u_int32_t, db_pgno_t)); void CDB___ham_dsearch __P((DBC *, DBT *, u_int32_t *, int *)); void CDB___ham_ca_split __P((DB *, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, int)); int CDB___ham_cprint __P((DB *)); u_int32_t CDB___ham_func2 __P((const void *, u_int32_t)); u_int32_t CDB___ham_func3 __P((const void *, u_int32_t)); u_int32_t CDB___ham_func4 __P((const void *, u_int32_t)); u_int32_t CDB___ham_func5 __P((const void *, u_int32_t)); int CDB___ham_get_meta __P((DBC *)); int CDB___ham_release_meta __P((DBC *)); int CDB___ham_dirty_meta __P((DBC *)); int CDB___ham_db_create __P((DB *)); int CDB___ham_db_close __P((DB *)); int CDB___ham_item __P((DBC *, db_lockmode_t)); int CDB___ham_item_reset __P((DBC *)); void CDB___ham_item_init __P((HASH_CURSOR *)); int CDB___ham_item_done __P((DBC *, int)); int CDB___ham_item_last __P((DBC *, db_lockmode_t)); int CDB___ham_item_first __P((DBC *, db_lockmode_t)); int CDB___ham_item_prev __P((DBC *, db_lockmode_t)); int CDB___ham_item_next __P((DBC *, db_lockmode_t)); void CDB___ham_putitem __P((PAGE *p, const DBT *, int)); void CDB___ham_reputpair __P((PAGE *p, u_int32_t, u_int32_t, const DBT *, const DBT *)); int CDB___ham_del_pair __P((DBC *, int)); int CDB___ham_replpair __P((DBC *, DBT *, u_int32_t)); void CDB___ham_onpage_replace __P((PAGE *, size_t, u_int32_t, int32_t, int32_t, DBT *)); int CDB___ham_split_page __P((DBC *, u_int32_t, u_int32_t)); int CDB___ham_add_el __P((DBC *, const DBT *, const DBT *, int)); void CDB___ham_copy_item __P((size_t, PAGE *, u_int32_t, PAGE *)); int CDB___ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **)); int CDB___ham_put_page __P((DB *, PAGE *, int32_t)); int CDB___ham_dirty_page __P((DB *, PAGE *)); int CDB___ham_get_page __P((DB *, db_pgno_t, PAGE **)); db_pgno_t CDB___bucket_to_page __P((HASH_CURSOR *, db_pgno_t)); int CDB___ham_get_cpage __P((DBC *, db_lockmode_t)); int CDB___ham_next_cpage __P((DBC *, db_pgno_t, int, u_int32_t)); int CDB___ham_lock_bucket __P((DBC *, db_lockmode_t)); void CDB___ham_dpair __P((DB *, PAGE *, u_int32_t)); int CDB___ham_insdel_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_newpage_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_replace_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_newpgno_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_splitmeta_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_splitdata_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_ovfl_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_copypage_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_metagroup_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_groupalloc_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___ham_reclaim __P((DB *, DB_TXN *txn)); int CDB___ham_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); int CDB___ham_traverse __P((DB *, DBC *, db_lockmode_t, int (*)(DB *, PAGE *, void *, int *), void *)); int CDB___ham_upgrade __P((DB *, int, char *, DB_FH *, char *)); #endif /* _hash_ext_h_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_func.c������������������������������������������������������������������������0100644�0063146�0012731�00000012026�07427026535�015065� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_func.c 11.2 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "hash.h" /* * CDB___ham_func2 -- * Phong Vo's linear congruential hash. * * PUBLIC: u_int32_t CDB___ham_func2 __P((const void *, u_int32_t)); */ #define DCHARHASH(h, c) ((h) = 0x63c63cd9*(h) + 0x9c39c33d + (c)) u_int32_t CDB___ham_func2(key, len) const void *key; u_int32_t len; { const u_int8_t *e, *k; u_int32_t h; u_int8_t c; k = key; e = k + len; for (h = 0; k != e;) { c = *k++; if (!c && k > e) break; DCHARHASH(h, c); } return (h); } /* * CDB___ham_func3 -- * Ozan Yigit's original sdbm hash. * * Ugly, but fast. Break the string up into 8 byte units. On the first time * through the loop get the "leftover bytes" (strlen % 8). On every other * iteration, perform 8 HASHC's so we handle all 8 bytes. Essentially, this * saves us 7 cmp & branch instructions. * * PUBLIC: u_int32_t CDB___ham_func3 __P((const void *, u_int32_t)); */ u_int32_t CDB___ham_func3(key, len) const void *key; u_int32_t len; { const u_int8_t *k; u_int32_t n, loop; if (len == 0) return (0); #define HASHC n = *k++ + 65599 * n n = 0; k = key; loop = (len + 8 - 1) >> 3; switch (len & (8 - 1)) { case 0: do { HASHC; case 7: HASHC; case 6: HASHC; case 5: HASHC; case 4: HASHC; case 3: HASHC; case 2: HASHC; case 1: HASHC; } while (--loop); } return (n); } /* * CDB___ham_func4 -- * Chris Torek's hash function. Although this function performs only * slightly worse than CDB___ham_func5 on strings, it performs horribly on * numbers. * * PUBLIC: u_int32_t CDB___ham_func4 __P((const void *, u_int32_t)); */ u_int32_t CDB___ham_func4(key, len) const void *key; u_int32_t len; { const u_int8_t *k; u_int32_t h, loop; if (len == 0) return (0); #define HASH4a h = (h << 5) - h + *k++; #define HASH4b h = (h << 5) + h + *k++; #define HASH4 HASH4b h = 0; k = key; loop = (len + 8 - 1) >> 3; switch (len & (8 - 1)) { case 0: do { HASH4; case 7: HASH4; case 6: HASH4; case 5: HASH4; case 4: HASH4; case 3: HASH4; case 2: HASH4; case 1: HASH4; } while (--loop); } return (h); } /* * Fowler/Noll/Vo hash * * The basis of the hash algorithm was taken from an idea sent by email to the * IEEE Posix P1003.2 mailing list from Phong Vo (kpv@research.att.com) and * Glenn Fowler (gsf@research.att.com). Landon Curt Noll (chongo@toad.com) * later improved on their algorithm. * * The magic is in the interesting relationship between the special prime * 16777619 (2^24 + 403) and 2^32 and 2^8. * * This hash produces the fewest collisions of any function that we've seen so * far, and works well on both numbers and strings. * * PUBLIC: u_int32_t CDB___ham_func5 __P((const void *, u_int32_t)); */ u_int32_t CDB___ham_func5(key, len) const void *key; u_int32_t len; { const u_int8_t *k, *e; u_int32_t h; k = key; e = k + len; for (h = 0; k < e; ++k) { h *= 16777619; h ^= *k; } return (h); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_meta.c������������������������������������������������������������������������0100644�0063146�0012731�00000004635�07427026535�015067� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_meta.c 11.3 (Sleepycat) 9/14/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "hash.h" #include "db_shash.h" #include "lock.h" #include "txn.h" /* * Acquire the meta-data page. * * PUBLIC: int CDB___ham_get_meta __P((DBC *)); */ int CDB___ham_get_meta(dbc) DBC *dbc; { HASH_CURSOR *hcp; HASH *hashp; DB *dbp; int ret; hcp = dbc->internal; dbp = dbc->dbp; hashp = dbp->h_internal; if (dbp->dbenv != NULL && F_ISSET(dbp->dbenv, DB_ENV_LOCKING) && !F_ISSET(dbc, DBC_RECOVER)) { dbc->lock.pgno = hashp->meta_pgno; if ((ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_NONBLOCK(dbc) ? DB_LOCK_NOWAIT : 0, &dbc->lock_dbt, DB_LOCK_READ, &hcp->hlock)) != 0) return (ret); } if ((ret = CDB___ham_get_page(dbc->dbp, hashp->meta_pgno, (PAGE **)&(hcp->hdr))) != 0 && hcp->hlock.off != LOCK_INVALID) { (void)CDB_lock_put(dbc->dbp->dbenv, &hcp->hlock); hcp->hlock.off = LOCK_INVALID; } return (ret); } /* * Release the meta-data page. * * PUBLIC: int CDB___ham_release_meta __P((DBC *)); */ int CDB___ham_release_meta(dbc) DBC *dbc; { HASH_CURSOR *hcp; hcp = dbc->internal; if (hcp->hdr) (void)CDB___ham_put_page(dbc->dbp, (PAGE *)hcp->hdr, F_ISSET(hcp, H_DIRTY) ? 1 : 0); hcp->hdr = NULL; if (!F_ISSET(dbc, DBC_RECOVER) && dbc->txn == NULL && hcp->hlock.off != LOCK_INVALID) (void)CDB_lock_put(dbc->dbp->dbenv, &hcp->hlock); hcp->hlock.off = LOCK_INVALID; F_CLR(hcp, H_DIRTY); return (0); } /* * Mark the meta-data page dirty. * * PUBLIC: int CDB___ham_dirty_meta __P((DBC *)); */ int CDB___ham_dirty_meta(dbc) DBC *dbc; { DB *dbp; DB_LOCK _tmp; HASH *hashp; HASH_CURSOR *hcp; int ret; dbp = dbc->dbp; hashp = dbp->h_internal; hcp = dbc->internal; ret = 0; if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING) && !F_ISSET(dbc, DBC_RECOVER)) { dbc->lock.pgno = hashp->meta_pgno; if ((ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_NONBLOCK(dbc) ? DB_LOCK_NOWAIT : 0, &dbc->lock_dbt, DB_LOCK_WRITE, &_tmp)) == 0) { ret = CDB_lock_put(dbp->dbenv, &hcp->hlock); hcp->hlock = _tmp; } } if (ret == 0) F_SET(hcp, H_DIRTY); return (ret); } ���������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_method.c����������������������������������������������������������������������0100644�0063146�0012731�00000004414�07427026535�015414� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_method.c 11.3 (Sleepycat) 9/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "hash.h" static int CDB___ham_set_h_ffactor __P((DB *, u_int32_t)); static int CDB___ham_set_h_hash __P((DB *, u_int32_t(*)(const void *, u_int32_t))); static int CDB___ham_set_h_nelem __P((DB *, u_int32_t)); /* * CDB___ham_db_create -- * Hash specific initialization of the DB structure. * * PUBLIC: int CDB___ham_db_create __P((DB *)); */ int CDB___ham_db_create(dbp) DB *dbp; { HASH *hashp; int ret; if ((ret = CDB___os_malloc(sizeof(HASH), NULL, &dbp->h_internal)) != 0) return (ret); hashp = dbp->h_internal; hashp->h_nelem = 0; /* Defaults. */ hashp->h_ffactor = 0; hashp->h_hash = NULL; dbp->set_h_ffactor = CDB___ham_set_h_ffactor; dbp->set_h_hash = CDB___ham_set_h_hash; dbp->set_h_nelem = CDB___ham_set_h_nelem; return (0); } /* * PUBLIC: int CDB___ham_db_close __P((DB *)); */ int CDB___ham_db_close(dbp) DB *dbp; { if (dbp->h_internal == NULL) return (0); CDB___os_free(dbp->h_internal, sizeof(HASH)); dbp->h_internal = NULL; return (0); } /* * CDB___ham_set_h_ffactor -- * Set the fill factor. */ static int CDB___ham_set_h_ffactor(dbp, h_ffactor) DB *dbp; u_int32_t h_ffactor; { HASH *hashp; DB_ILLEGAL_AFTER_OPEN(dbp, "set_h_ffactor"); DB_ILLEGAL_METHOD(dbp, DB_OK_HASH); hashp = dbp->h_internal; hashp->h_ffactor = h_ffactor; return (0); } /* * CDB___ham_set_h_hash -- * Set the hash function. */ static int CDB___ham_set_h_hash(dbp, func) DB *dbp; u_int32_t (*func) __P((const void *, u_int32_t)); { HASH *hashp; DB_ILLEGAL_AFTER_OPEN(dbp, "set_h_hash"); DB_ILLEGAL_METHOD(dbp, DB_OK_HASH); hashp = dbp->h_internal; hashp->h_hash = func; return (0); } /* * CDB___ham_set_h_nelem -- * Set the table size. */ static int CDB___ham_set_h_nelem(dbp, h_nelem) DB *dbp; u_int32_t h_nelem; { HASH *hashp; DB_ILLEGAL_AFTER_OPEN(dbp, "set_h_nelem"); DB_ILLEGAL_METHOD(dbp, DB_OK_HASH); hashp = dbp->h_internal; hashp->h_nelem = h_nelem; return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_page.c������������������������������������������������������������������������0100644�0063146�0012731�00000127645�07427026535�015064� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_page.c 11.10 (Sleepycat) 10/29/99"; #endif /* not lint */ /* * PACKAGE: hashing * * DESCRIPTION: * Page manipulation for hashing package. * * ROUTINES: * * External * __get_page * __add_ovflpage * __overflow_page * Internal * open_temp */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "hash.h" #include "lock.h" #include "txn.h" /* * PUBLIC: int CDB___ham_item __P((DBC *, db_lockmode_t)); */ int CDB___ham_item(dbc, mode) DBC *dbc; db_lockmode_t mode; { DB *dbp; HASH_CURSOR *hcp; db_pgno_t next_pgno; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if (F_ISSET(hcp, H_DELETED)) return (EINVAL); F_CLR(hcp, H_OK | H_NOMORE); /* Check if we need to get a page for this cursor. */ if ((ret = CDB___ham_get_cpage(dbc, mode)) != 0) return (ret); /* Check if we are looking for space in which to insert an item. */ if (hcp->seek_size && hcp->seek_found_page == PGNO_INVALID && hcp->seek_size < P_FREESPACE(hcp->pagep)) hcp->seek_found_page = hcp->pgno; /* Check if we need to go on to the next page. */ if (F_ISSET(hcp, H_ISDUP) && hcp->dpgno == PGNO_INVALID) /* * ISDUP is set, and offset is at the beginning of the datum. * We need to grab the length of the datum, then set the datum * pointer to be the beginning of the datum. */ memcpy(&hcp->dup_len, HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)) + hcp->dup_off, sizeof(db_indx_t)); else if (F_ISSET(hcp, H_ISDUP)) { /* Make sure we're not about to run off the page. */ if (hcp->dpagep == NULL && (ret = CDB___ham_get_page(dbp, hcp->dpgno, &hcp->dpagep)) != 0) return (ret); if (hcp->dndx >= NUM_ENT(hcp->dpagep)) { if (NEXT_PGNO(hcp->dpagep) == PGNO_INVALID) { if (F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } if ((ret = CDB___ham_put_page(dbp, hcp->dpagep, 0)) != 0) return (ret); F_CLR(hcp, H_ISDUP); hcp->dpagep = NULL; hcp->dpgno = PGNO_INVALID; hcp->dndx = NDX_INVALID; hcp->bndx++; } else if ((ret = CDB___ham_next_cpage(dbc, NEXT_PGNO(hcp->dpagep), 0, H_ISDUP)) != 0) return (ret); } } if (hcp->bndx >= (db_indx_t)H_NUMPAIRS(hcp->pagep)) { /* Fetch next page. */ if (NEXT_PGNO(hcp->pagep) == PGNO_INVALID) { F_SET(hcp, H_NOMORE); if (hcp->dpagep != NULL && (ret = CDB___ham_put_page(dbp, hcp->dpagep, 0)) != 0) return (ret); hcp->dpgno = PGNO_INVALID; return (DB_NOTFOUND); } next_pgno = NEXT_PGNO(hcp->pagep); hcp->bndx = 0; if ((ret = CDB___ham_next_cpage(dbc, next_pgno, 0, 0)) != 0) return (ret); } F_SET(hcp, H_OK); return (0); } /* * PUBLIC: int CDB___ham_item_reset __P((DBC *)); */ int CDB___ham_item_reset(dbc) DBC *dbc; { HASH_CURSOR *hcp; DB *dbp; int ret; ret = 0; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if (hcp->pagep != NULL) ret = CDB___ham_put_page(dbp, hcp->pagep, 0); if (ret == 0 && hcp->dpagep != NULL) ret = CDB___ham_put_page(dbp, hcp->dpagep, 0); CDB___ham_item_init(hcp); return (ret); } /* * PUBLIC: void CDB___ham_item_init __P((HASH_CURSOR *)); */ void CDB___ham_item_init(hcp) HASH_CURSOR *hcp; { /* * If this cursor still holds any locks, we must * release them if we are not running with transactions. */ if (hcp->lock.off != LOCK_INVALID && hcp->dbc->txn == NULL) (void)CDB_lock_put(hcp->dbc->dbp->dbenv, &hcp->lock); /* * The following fields must *not* be initialized here * because they may have meaning across inits. * hlock, hdr, split_buf, stats */ hcp->bucket = BUCKET_INVALID; hcp->lbucket = BUCKET_INVALID; hcp->lock.off = LOCK_INVALID; hcp->mode = DB_LOCK_NG; hcp->pagep = NULL; hcp->pgno = PGNO_INVALID; hcp->bndx = NDX_INVALID; hcp->dpagep = NULL; hcp->dpgno = PGNO_INVALID; hcp->dndx = NDX_INVALID; hcp->dup_off = 0; hcp->dup_len = 0; hcp->dup_tlen = 0; hcp->seek_size = 0; hcp->seek_found_page = PGNO_INVALID; hcp->flags = 0; } /* * PUBLIC: int CDB___ham_item_done __P((DBC *, int)); */ int CDB___ham_item_done(dbc, dirty) DBC *dbc; int dirty; { DB *dbp; HASH_CURSOR *hcp; int ret, t_ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; t_ret = ret = 0; if (hcp->pagep) ret = CDB___ham_put_page(dbp, hcp->pagep, dirty && hcp->dpagep == NULL); hcp->pagep = NULL; if (hcp->dpagep) t_ret = CDB___ham_put_page(dbp, hcp->dpagep, dirty); hcp->dpagep = NULL; if (ret == 0 && t_ret != 0) ret = t_ret; /* * We don't throw out the page number since we might want to * continue getting on this page. */ return (ret != 0 ? ret : t_ret); } /* * Returns the last item in a bucket. * * PUBLIC: int CDB___ham_item_last __P((DBC *, db_lockmode_t)); */ int CDB___ham_item_last(dbc, mode) DBC *dbc; db_lockmode_t mode; { HASH_CURSOR *hcp; int ret; hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_item_reset(dbc)) != 0) return (ret); hcp->bucket = hcp->hdr->max_bucket; F_SET(hcp, H_OK); return (CDB___ham_item_prev(dbc, mode)); } /* * PUBLIC: int CDB___ham_item_first __P((DBC *, db_lockmode_t)); */ int CDB___ham_item_first(dbc, mode) DBC *dbc; db_lockmode_t mode; { HASH_CURSOR *hcp; int ret; hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_item_reset(dbc)) != 0) return (ret); F_SET(hcp, H_OK); hcp->bucket = 0; return (CDB___ham_item_next(dbc, mode)); } /* * CDB___ham_item_prev -- * Returns a pointer to key/data pair on a page. In the case of * bigkeys, just returns the page number and index of the bigkey * pointer pair. * * PUBLIC: int CDB___ham_item_prev __P((DBC *, db_lockmode_t)); */ int CDB___ham_item_prev(dbc, mode) DBC *dbc; db_lockmode_t mode; { DB *dbp; HASH_CURSOR *hcp; db_pgno_t next_pgno; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; /* * There are N cases for backing up in a hash file. * Case 1: In the middle of a page, no duplicates, just dec the index. * Case 2: In the middle of a duplicate set, back up one. * Case 3: At the beginning of a duplicate set, get out of set and * back up to next key. * Case 4: At the beginning of a page; go to previous page. * Case 5: At the beginning of a bucket; go to prev bucket. */ F_CLR(hcp, H_OK | H_NOMORE | H_DELETED); /* * First handle the duplicates. Either you'll get the key here * or you'll exit the duplicate set and drop into the code below * to handle backing up through keys. */ if (F_ISSET(hcp, H_ISDUP)) { if (hcp->dpgno == PGNO_INVALID) { /* Duplicates are on-page. */ if (hcp->dup_off != 0) { if ((ret = CDB___ham_get_cpage(dbc, mode)) != 0) return (ret); else { HASH_CURSOR *h; h = hcp; memcpy(&h->dup_len, HKEYDATA_DATA( H_PAIRDATA(h->pagep, h->bndx)) + h->dup_off - sizeof(db_indx_t), sizeof(db_indx_t)); hcp->dup_off -= DUP_SIZE(hcp->dup_len); hcp->dndx--; return (CDB___ham_item(dbc, mode)); } } } else if (hcp->dndx > 0) { /* Duplicates are off-page. */ hcp->dndx--; return (CDB___ham_item(dbc, mode)); } else if ((ret = CDB___ham_get_cpage(dbc, mode)) != 0) return (ret); else if (PREV_PGNO(hcp->dpagep) == PGNO_INVALID) { if (F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } else { F_CLR(hcp, H_ISDUP); /* End of dups */ hcp->dpgno = PGNO_INVALID; if (hcp->dpagep != NULL) (void)CDB___ham_put_page(dbp, hcp->dpagep, 0); hcp->dpagep = NULL; } } else if ((ret = CDB___ham_next_cpage(dbc, PREV_PGNO(hcp->dpagep), 0, H_ISDUP)) != 0) return (ret); else { hcp->dndx = NUM_ENT(hcp->pagep) - 1; return (CDB___ham_item(dbc, mode)); } } /* * If we get here, we are not in a duplicate set, and just need * to back up the cursor. There are still three cases: * midpage, beginning of page, beginning of bucket. */ if (F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } if (hcp->bndx == 0) { /* Beginning of page. */ if ((ret = CDB___ham_get_cpage(dbc, mode)) != 0) return (ret); hcp->pgno = PREV_PGNO(hcp->pagep); if (hcp->pgno == PGNO_INVALID) { /* Beginning of bucket. */ F_SET(hcp, H_NOMORE); return (DB_NOTFOUND); } else if ((ret = CDB___ham_next_cpage(dbc, hcp->pgno, 0, 0)) != 0) return (ret); else hcp->bndx = H_NUMPAIRS(hcp->pagep); } /* * Either we've got the cursor set up to be decremented, or we * have to find the end of a bucket. */ if (hcp->bndx == NDX_INVALID) { if (hcp->pagep == NULL) next_pgno = BUCKET_TO_PAGE(hcp, hcp->bucket); else goto got_page; do { if ((ret = CDB___ham_next_cpage(dbc, next_pgno, 0, 0)) != 0) return (ret); got_page: next_pgno = NEXT_PGNO(hcp->pagep); hcp->bndx = H_NUMPAIRS(hcp->pagep); } while (next_pgno != PGNO_INVALID); if (hcp->bndx == 0) { /* Bucket was empty. */ F_SET(hcp, H_NOMORE); return (DB_NOTFOUND); } } hcp->bndx--; return (CDB___ham_item(dbc, mode)); } /* * Sets the cursor to the next key/data pair on a page. * * PUBLIC: int CDB___ham_item_next __P((DBC *, db_lockmode_t)); */ int CDB___ham_item_next(dbc, mode) DBC *dbc; db_lockmode_t mode; { HASH_CURSOR *hcp; hcp = (HASH_CURSOR *)dbc->internal; /* * Deleted on-page duplicates are a weird case. If we delete the last * one, then our cursor is at the very end of a duplicate set and * we actually need to go on to the next key. */ if (F_ISSET(hcp, H_DELETED)) { if (hcp->bndx != NDX_INVALID && F_ISSET(hcp, H_ISDUP) && hcp->dpgno == PGNO_INVALID && hcp->dup_tlen == hcp->dup_off) { if (F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } else { F_CLR(hcp, H_ISDUP); hcp->dpgno = PGNO_INVALID; hcp->bndx++; } } else if (!F_ISSET(hcp, H_ISDUP) && F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } F_CLR(hcp, H_DELETED); } else if (hcp->bndx == NDX_INVALID) { hcp->bndx = 0; hcp->dpgno = PGNO_INVALID; F_CLR(hcp, H_ISDUP); } else if (F_ISSET(hcp, H_ISDUP) && hcp->dpgno != PGNO_INVALID) hcp->dndx++; else if (F_ISSET(hcp, H_ISDUP)) { if (hcp->dup_off + DUP_SIZE(hcp->dup_len) >= hcp->dup_tlen && F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } hcp->dndx++; hcp->dup_off += DUP_SIZE(hcp->dup_len); if (hcp->dup_off >= hcp->dup_tlen) { F_CLR(hcp, H_ISDUP); hcp->dpgno = PGNO_INVALID; hcp->bndx++; } } else if (F_ISSET(hcp, H_DUPONLY)) { F_CLR(hcp, H_OK); F_SET(hcp, H_NOMORE); return (0); } else hcp->bndx++; return (CDB___ham_item(dbc, mode)); } /* * PUBLIC: void CDB___ham_putitem __P((PAGE *p, const DBT *, int)); * * This is a little bit sleazy in that we're overloading the meaning * of the H_OFFPAGE type here. When we recover deletes, we have the * entire entry instead of having only the DBT, so we'll pass type * H_OFFPAGE to mean, "copy the whole entry" as opposed to constructing * an H_KEYDATA around it. */ void CDB___ham_putitem(p, dbt, type) PAGE *p; const DBT *dbt; int type; { u_int16_t n, off; n = NUM_ENT(p); /* Put the item element on the page. */ if (type == H_OFFPAGE) { off = HOFFSET(p) - dbt->size; HOFFSET(p) = p->inp[n] = off; memcpy(P_ENTRY(p, n), dbt->data, dbt->size); } else { off = HOFFSET(p) - HKEYDATA_SIZE(dbt->size); HOFFSET(p) = p->inp[n] = off; PUT_HKEYDATA(P_ENTRY(p, n), dbt->data, dbt->size, type); } /* Adjust page info. */ NUM_ENT(p) += 1; } /* * PUBLIC: void CDB___ham_reputpair * PUBLIC: __P((PAGE *p, u_int32_t, u_int32_t, const DBT *, const DBT *)); * * This is a special case to restore a key/data pair to its original * location during recovery. We are guaranteed that the pair fits * on the page and is not the last pair on the page (because if it's * the last pair, the normal insert works). */ void CDB___ham_reputpair(p, psize, ndx, key, data) PAGE *p; u_int32_t psize, ndx; const DBT *key, *data; { db_indx_t i, movebytes, newbytes; u_int8_t *from; /* First shuffle the existing items up on the page. */ movebytes = (ndx == 0 ? psize : p->inp[H_DATAINDEX(ndx - 1)]) - HOFFSET(p); newbytes = key->size + data->size; from = (u_int8_t *)p + HOFFSET(p); memmove(from - newbytes, from, movebytes); /* * Adjust the indices and move them up 2 spaces. Note that we * have to check the exit condition inside the loop just in case * we are dealing with index 0 (db_indx_t's are unsigned). */ for (i = NUM_ENT(p) - 1; ; i-- ) { p->inp[i + 2] = p->inp[i] - newbytes; if (i == H_KEYINDEX(ndx)) break; } /* Put the key and data on the page. */ p->inp[H_KEYINDEX(ndx)] = (ndx == 0 ? psize : p->inp[H_DATAINDEX(ndx - 1)]) - key->size; p->inp[H_DATAINDEX(ndx)] = p->inp[H_KEYINDEX(ndx)] - data->size; memcpy(P_ENTRY(p, H_KEYINDEX(ndx)), key->data, key->size); memcpy(P_ENTRY(p, H_DATAINDEX(ndx)), data->data, data->size); /* Adjust page info. */ HOFFSET(p) -= newbytes; NUM_ENT(p) += 2; } /* * PUBLIC: int CDB___ham_del_pair __P((DBC *, int)); */ int CDB___ham_del_pair(dbc, reclaim_page) DBC *dbc; int reclaim_page; { DB *dbp; HASH_CURSOR *hcp; DBT data_dbt, key_dbt; DB_ENV *dbenv; DB_LSN new_lsn, *n_lsn, tmp_lsn; PAGE *p; db_indx_t ndx; db_pgno_t chg_pgno, pgno; int ret, tret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; dbenv = dbp->dbenv; ndx = hcp->bndx; if (hcp->pagep == NULL && (ret = CDB___ham_get_page(dbp, hcp->pgno, &hcp->pagep)) != 0) return (ret); p = hcp->pagep; /* * We optimize for the normal case which is when neither the key nor * the data are large. In this case, we write a single log record * and do the delete. If either is large, we'll call __big_delete * to remove the big item and then update the page to remove the * entry referring to the big item. */ ret = 0; if (HPAGE_PTYPE(H_PAIRKEY(p, ndx)) == H_OFFPAGE) { memcpy(&pgno, HOFFPAGE_PGNO(P_ENTRY(p, H_KEYINDEX(ndx))), sizeof(db_pgno_t)); ret = CDB___db_doff(dbc, pgno); } if (ret == 0) switch (HPAGE_PTYPE(H_PAIRDATA(p, ndx))) { case H_OFFPAGE: memcpy(&pgno, HOFFPAGE_PGNO(P_ENTRY(p, H_DATAINDEX(ndx))), sizeof(db_pgno_t)); ret = CDB___db_doff(dbc, pgno); break; case H_OFFDUP: memcpy(&pgno, HOFFDUP_PGNO(P_ENTRY(p, H_DATAINDEX(ndx))), sizeof(db_pgno_t)); ret = CDB___db_ddup(dbc, pgno); F_CLR(hcp, H_ISDUP); break; case H_DUPLICATE: /* * If we delete a pair that is/was a duplicate, then * we had better clear the flag so that we update the * cursor appropriately. */ F_CLR(hcp, H_ISDUP); break; } if (ret) return (ret); /* Now log the delete off this page. */ if (DB_LOGGING(dbc)) { key_dbt.data = P_ENTRY(p, H_KEYINDEX(ndx)); key_dbt.size = LEN_HITEM(p, dbp->pgsize, H_KEYINDEX(ndx)); data_dbt.data = P_ENTRY(p, H_DATAINDEX(ndx)); data_dbt.size = LEN_HITEM(p, dbp->pgsize, H_DATAINDEX(ndx)); if ((ret = CDB___ham_insdel_log(dbenv, dbc->txn, &new_lsn, 0, DELPAIR, dbp->log_fileid, PGNO(p), (u_int32_t)ndx, &LSN(p), &key_dbt, &data_dbt)) != 0) return (ret); /* Move lsn onto page. */ LSN(p) = new_lsn; } CDB___ham_dpair(dbp, p, ndx); /* * If we are locking, we will not maintain this, because it is * a hot spot. * XXX perhaps we can retain incremental numbers and apply them * later. */ if (!F_ISSET(dbenv, DB_ENV_LOCKING)) --hcp->hdr->nelem; /* * If we need to reclaim the page, then check if the page is empty. * There are two cases. If it's empty and it's not the first page * in the bucket (i.e., the bucket page) then we can simply remove * it. If it is the first chain in the bucket, then we need to copy * the second page into it and remove the second page. */ if (reclaim_page && NUM_ENT(p) == 0 && PREV_PGNO(p) == PGNO_INVALID && NEXT_PGNO(p) != PGNO_INVALID) { PAGE *n_pagep, *nn_pagep; db_pgno_t tmp_pgno; /* * First page in chain is empty and we know that there * are more pages in the chain. */ if ((ret = CDB___ham_get_page(dbp, NEXT_PGNO(p), &n_pagep)) != 0) return (ret); if (NEXT_PGNO(n_pagep) != PGNO_INVALID) { if ((ret = CDB___ham_get_page(dbp, NEXT_PGNO(n_pagep), &nn_pagep)) != 0) { (void) CDB___ham_put_page(dbp, n_pagep, 0); return (ret); } } if (DB_LOGGING(dbc)) { key_dbt.data = n_pagep; key_dbt.size = dbp->pgsize; if ((ret = CDB___ham_copypage_log(dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, PGNO(p), &LSN(p), PGNO(n_pagep), &LSN(n_pagep), NEXT_PGNO(n_pagep), NEXT_PGNO(n_pagep) == PGNO_INVALID ? NULL : &LSN(nn_pagep), &key_dbt)) != 0) return (ret); /* Move lsn onto page. */ LSN(p) = new_lsn; /* Structure assignment. */ LSN(n_pagep) = new_lsn; if (NEXT_PGNO(n_pagep) != PGNO_INVALID) LSN(nn_pagep) = new_lsn; } if (NEXT_PGNO(n_pagep) != PGNO_INVALID) { PREV_PGNO(nn_pagep) = PGNO(p); (void)CDB___ham_put_page(dbp, nn_pagep, 1); } tmp_pgno = PGNO(p); tmp_lsn = LSN(p); memcpy(p, n_pagep, dbp->pgsize); PGNO(p) = tmp_pgno; LSN(p) = tmp_lsn; PREV_PGNO(p) = PGNO_INVALID; /* * Cursor is advanced to the beginning of the next page. */ hcp->bndx = 0; hcp->pgno = PGNO(p); F_SET(hcp, H_DELETED); chg_pgno = PGNO(p); if ((ret = CDB___ham_dirty_page(dbp, p)) != 0 || (ret = CDB___db_free(dbc, n_pagep)) != 0) return (ret); } else if (reclaim_page && NUM_ENT(p) == 0 && PREV_PGNO(p) != PGNO_INVALID) { PAGE *n_pagep, *p_pagep; if ((ret = CDB___ham_get_page(dbp, PREV_PGNO(p), &p_pagep)) != 0) return (ret); if (NEXT_PGNO(p) != PGNO_INVALID) { if ((ret = CDB___ham_get_page(dbp, NEXT_PGNO(p), &n_pagep)) != 0) { (void)CDB___ham_put_page(dbp, p_pagep, 0); return (ret); } n_lsn = &LSN(n_pagep); } else { n_pagep = NULL; n_lsn = NULL; } NEXT_PGNO(p_pagep) = NEXT_PGNO(p); if (n_pagep != NULL) PREV_PGNO(n_pagep) = PGNO(p_pagep); if (DB_LOGGING(dbc)) { if ((ret = CDB___ham_newpage_log(dbenv, dbc->txn, &new_lsn, 0, DELOVFL, dbp->log_fileid, PREV_PGNO(p), &LSN(p_pagep), PGNO(p), &LSN(p), NEXT_PGNO(p), n_lsn)) != 0) return (ret); /* Move lsn onto page. */ LSN(p_pagep) = new_lsn; /* Structure assignment. */ if (n_pagep) LSN(n_pagep) = new_lsn; LSN(p) = new_lsn; } hcp->pgno = NEXT_PGNO(p); hcp->bndx = 0; /* * Since we are about to delete the cursor page and we have * just moved the cursor, we need to make sure that the * old page pointer isn't left hanging around in the cursor. */ hcp->pagep = NULL; chg_pgno = PGNO(p); ret = CDB___db_free(dbc, p); if ((tret = CDB___ham_put_page(dbp, p_pagep, 1)) != 0 && ret == 0) ret = tret; if (n_pagep != NULL && (tret = CDB___ham_put_page(dbp, n_pagep, 1)) != 0 && ret == 0) ret = tret; if (ret != 0) return (ret); } else { /* * Mark item deleted so that we don't try to return it, and * so that we update the cursor correctly on the next call * to next. */ F_SET(hcp, H_DELETED); chg_pgno = hcp->pgno; ret = CDB___ham_dirty_page(dbp, p); } CDB___ham_c_update(hcp, chg_pgno, 0, 0, 0); /* * Since we just deleted a pair from the master page, anything * in hcp->dpgno should be cleared. */ hcp->dpgno = PGNO_INVALID; F_CLR(hcp, H_OK); return (ret); } /* * CDB___ham_replpair -- * Given the key data indicated by the cursor, replace part/all of it * according to the fields in the dbt. * * PUBLIC: int CDB___ham_replpair __P((DBC *, DBT *, u_int32_t)); */ int CDB___ham_replpair(dbc, dbt, make_dup) DBC *dbc; DBT *dbt; u_int32_t make_dup; { DB *dbp; HASH_CURSOR *hcp; DBT old_dbt, tdata, tmp; DB_LSN new_lsn; int32_t change; /* XXX: Possible overflow. */ u_int32_t dup, len; int is_big, ret, type; u_int8_t *beg, *dest, *end, *hk, *src; /* * Big item replacements are handled in generic code. * Items that fit on the current page fall into 4 classes. * 1. On-page element, same size * 2. On-page element, new is bigger (fits) * 3. On-page element, new is bigger (does not fit) * 4. On-page element, old is bigger * Numbers 1, 2, and 4 are essentially the same (and should * be the common case). We handle case 3 as a delete and * add. */ dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; /* * We need to compute the number of bytes that we are adding or * removing from the entry. Normally, we can simply substract * the number of bytes we are replacing (dbt->dlen) from the * number of bytes we are inserting (dbt->size). However, if * we are doing a partial put off the end of a record, then this * formula doesn't work, because we are essentially adding * new bytes. */ change = dbt->size - dbt->dlen; hk = H_PAIRDATA(hcp->pagep, hcp->bndx); is_big = HPAGE_PTYPE(hk) == H_OFFPAGE; if (is_big) memcpy(&len, HOFFPAGE_TLEN(hk), sizeof(u_int32_t)); else len = LEN_HKEYDATA(hcp->pagep, dbp->pgsize, H_DATAINDEX(hcp->bndx)); if (dbt->doff + dbt->dlen > len) change += dbt->doff + dbt->dlen - len; if (change > (int32_t)P_FREESPACE(hcp->pagep) || is_big) { /* * Case 3 -- two subcases. * A. This is not really a partial operation, but an overwrite. * Simple del and add works. * B. This is a partial and we need to construct the data that * we are really inserting (yuck). * In both cases, we need to grab the key off the page (in * some cases we could do this outside of this routine; for * cleanliness we do it here. If you happen to be on a big * key, this could be a performance hit). */ tmp.flags = 0; F_SET(&tmp, DB_DBT_MALLOC | DB_DBT_INTERNAL); if ((ret = CDB___db_ret(dbp, hcp->pagep, H_KEYINDEX(hcp->bndx), &tmp, &dbc->rkey.data, &dbc->rkey.size)) != 0) return (ret); /* Preserve duplicate info. */ dup = F_ISSET(hcp, H_ISDUP); if (dbt->doff == 0 && dbt->dlen == len) { ret = CDB___ham_del_pair(dbc, 0); if (ret == 0) ret = CDB___ham_add_el(dbc, &tmp, dbt, H_KEYDATA); } else { /* Case B */ type = HPAGE_PTYPE(hk) != H_OFFPAGE ? HPAGE_PTYPE(hk) : H_KEYDATA; tdata.flags = 0; F_SET(&tdata, DB_DBT_MALLOC | DB_DBT_INTERNAL); if ((ret = CDB___db_ret(dbp, hcp->pagep, H_DATAINDEX(hcp->bndx), &tdata, &dbc->rdata.data, &dbc->rdata.size)) != 0) goto err; /* Now we can delete the item. */ if ((ret = CDB___ham_del_pair(dbc, 0)) != 0) { CDB___os_free(tdata.data, tdata.size); goto err; } /* Now shift old data around to make room for new. */ if (change > 0) { if ((ret = CDB___os_realloc(tdata.size + change, NULL, &tdata.data)) != 0) return (ret); memset((u_int8_t *)tdata.data + tdata.size, 0, change); } end = (u_int8_t *)tdata.data + tdata.size; src = (u_int8_t *)tdata.data + dbt->doff + dbt->dlen; if (src < end && tdata.size > dbt->doff + dbt->dlen) { len = tdata.size - dbt->doff - dbt->dlen; dest = src + change; memmove(dest, src, len); } memcpy((u_int8_t *)tdata.data + dbt->doff, dbt->data, dbt->size); tdata.size += change; /* Now add the pair. */ ret = CDB___ham_add_el(dbc, &tmp, &tdata, type); CDB___os_free(tdata.data, tdata.size); } F_SET(hcp, dup); err: CDB___os_free(tmp.data, tmp.size); return (ret); } /* * Set up pointer into existing data. Do it before the log * message so we can use it inside of the log setup. */ beg = HKEYDATA_DATA(H_PAIRDATA(hcp->pagep, hcp->bndx)); beg += dbt->doff; /* * If we are going to have to move bytes at all, figure out * all the parameters here. Then log the call before moving * anything around. */ if (DB_LOGGING(dbc)) { old_dbt.data = beg; old_dbt.size = dbt->dlen; if ((ret = CDB___ham_replace_log(dbp->dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, PGNO(hcp->pagep), (u_int32_t)H_DATAINDEX(hcp->bndx), &LSN(hcp->pagep), (u_int32_t)dbt->doff, &old_dbt, dbt, make_dup)) != 0) return (ret); LSN(hcp->pagep) = new_lsn; /* Structure assignment. */ } CDB___ham_onpage_replace(hcp->pagep, dbp->pgsize, (u_int32_t)H_DATAINDEX(hcp->bndx), (int32_t)dbt->doff, change, dbt); return (0); } /* * Replace data on a page with new data, possibly growing or shrinking what's * there. This is called on two different occasions. On one (from replpair) * we are interested in changing only the data. On the other (from recovery) * we are replacing the entire data (header and all) with a new element. In * the latter case, the off argument is negative. * pagep: the page that we're changing * ndx: page index of the element that is growing/shrinking. * off: Offset at which we are beginning the replacement. * change: the number of bytes (+ or -) that the element is growing/shrinking. * dbt: the new data that gets written at beg. * PUBLIC: void CDB___ham_onpage_replace __P((PAGE *, size_t, u_int32_t, int32_t, * PUBLIC: int32_t, DBT *)); */ void CDB___ham_onpage_replace(pagep, pgsize, ndx, off, change, dbt) PAGE *pagep; size_t pgsize; u_int32_t ndx; int32_t off; int32_t change; DBT *dbt; { db_indx_t i; int32_t len; u_int8_t *src, *dest; int zero_me; if (change != 0) { zero_me = 0; src = (u_int8_t *)(pagep) + HOFFSET(pagep); if (off < 0) len = pagep->inp[ndx] - HOFFSET(pagep); else if ((u_int32_t)off >= LEN_HKEYDATA(pagep, pgsize, ndx)) { len = HKEYDATA_DATA(P_ENTRY(pagep, ndx)) + LEN_HKEYDATA(pagep, pgsize, ndx) - src; zero_me = 1; } else len = (HKEYDATA_DATA(P_ENTRY(pagep, ndx)) + off) - src; dest = src - change; memmove(dest, src, len); if (zero_me) memset(dest + len, 0, change); /* Now update the indices. */ for (i = ndx; i < NUM_ENT(pagep); i++) pagep->inp[i] -= change; HOFFSET(pagep) -= change; } if (off >= 0) memcpy(HKEYDATA_DATA(P_ENTRY(pagep, ndx)) + off, dbt->data, dbt->size); else memcpy(P_ENTRY(pagep, ndx), dbt->data, dbt->size); } /* * PUBLIC: int CDB___ham_split_page __P((DBC *, u_int32_t, u_int32_t)); */ int CDB___ham_split_page(dbc, obucket, nbucket) DBC *dbc; u_int32_t obucket, nbucket; { DB *dbp; HASH_CURSOR *hcp, **harray; DBT key, page_dbt; DB_ENV *dbenv; DB_LSN new_lsn; PAGE **pp, *old_pagep, *temp_pagep, *new_pagep; db_indx_t n; db_pgno_t bucket_pgno, npgno, next_pgno; u_int32_t big_len, len; int i, ret, tret; void *big_buf; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; dbenv = dbp->dbenv; temp_pagep = old_pagep = new_pagep = NULL; if ((ret = CDB___ham_get_clist(dbp, obucket, NDX_INVALID, &harray)) != 0) return (ret); bucket_pgno = BUCKET_TO_PAGE(hcp, obucket); if ((ret = CDB___ham_get_page(dbp, bucket_pgno, &old_pagep)) != 0) goto err; /* Properly initialize the new bucket page. */ npgno = BUCKET_TO_PAGE(hcp, nbucket); if ((ret = CDB___ham_get_page(dbp, npgno, &new_pagep)) != 0) goto err; P_INIT(new_pagep, dbp->pgsize, npgno, PGNO_INVALID, PGNO_INVALID, 0, P_HASH); temp_pagep = hcp->split_buf; memcpy(temp_pagep, old_pagep, dbp->pgsize); if (DB_LOGGING(dbc)) { page_dbt.size = dbp->pgsize; page_dbt.data = old_pagep; if ((ret = CDB___ham_splitdata_log(dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, SPLITOLD, PGNO(old_pagep), &page_dbt, &LSN(old_pagep))) != 0) goto err; } P_INIT(old_pagep, dbp->pgsize, PGNO(old_pagep), PGNO_INVALID, PGNO_INVALID, 0, P_HASH); if (DB_LOGGING(dbc)) LSN(old_pagep) = new_lsn; /* Structure assignment. */ big_len = 0; big_buf = NULL; key.flags = 0; while (temp_pagep != NULL) { for (n = 0; n < (db_indx_t)H_NUMPAIRS(temp_pagep); n++) { if ((ret = CDB___db_ret(dbp, temp_pagep, H_KEYINDEX(n), &key, &big_buf, &big_len)) != 0) goto err; if (CDB___ham_call_hash(hcp, key.data, key.size) == obucket) pp = &old_pagep; else pp = &new_pagep; /* * Figure out how many bytes we need on the new * page to store the key/data pair. */ len = LEN_HITEM(temp_pagep, dbp->pgsize, H_DATAINDEX(n)) + LEN_HITEM(temp_pagep, dbp->pgsize, H_KEYINDEX(n)) + 2 * sizeof(db_indx_t); if (P_FREESPACE(*pp) < len) { if (DB_LOGGING(dbc)) { page_dbt.size = dbp->pgsize; page_dbt.data = *pp; if ((ret = CDB___ham_splitdata_log( dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, SPLITNEW, PGNO(*pp), &page_dbt, &LSN(*pp))) != 0) goto err; LSN(*pp) = new_lsn; } if ((ret = CDB___ham_add_ovflpage(dbc, *pp, 1, pp)) != 0) goto err; } /* Check if we need to update a cursor. */ if (harray != NULL) { for (i = 0; harray[i] != NULL; i++) { if (harray[i]->pgno == PGNO(temp_pagep) && harray[i]->bndx == n) { harray[i]->pgno = PGNO(*pp); harray[i]->bndx = H_NUMPAIRS(*pp); } } } CDB___ham_copy_item(dbp->pgsize, temp_pagep, H_KEYINDEX(n), *pp); CDB___ham_copy_item(dbp->pgsize, temp_pagep, H_DATAINDEX(n), *pp); } next_pgno = NEXT_PGNO(temp_pagep); /* Clear temp_page; if it's a link overflow page, free it. */ if (PGNO(temp_pagep) != bucket_pgno && (ret = CDB___db_free(dbc, temp_pagep)) != 0) goto err; if (next_pgno == PGNO_INVALID) temp_pagep = NULL; else if ((ret = CDB___ham_get_page(dbp, next_pgno, &temp_pagep)) != 0) goto err; if (temp_pagep != NULL && DB_LOGGING(dbc)) { page_dbt.size = dbp->pgsize; page_dbt.data = temp_pagep; if ((ret = CDB___ham_splitdata_log(dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, SPLITOLD, PGNO(temp_pagep), &page_dbt, &LSN(temp_pagep))) != 0) goto err; LSN(temp_pagep) = new_lsn; } } if (big_buf != NULL) CDB___os_free(big_buf, big_len); /* * If the original bucket spanned multiple pages, then we've got * a pointer to a page that used to be on the bucket chain. It * should be deleted. */ if (temp_pagep != NULL && PGNO(temp_pagep) != bucket_pgno && (ret = CDB___db_free(dbc, temp_pagep)) != 0) goto err; /* * Write new buckets out. */ if (DB_LOGGING(dbc)) { page_dbt.size = dbp->pgsize; page_dbt.data = old_pagep; if ((ret = CDB___ham_splitdata_log(dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, SPLITNEW, PGNO(old_pagep), &page_dbt, &LSN(old_pagep))) != 0) goto err; LSN(old_pagep) = new_lsn; page_dbt.data = new_pagep; if ((ret = CDB___ham_splitdata_log(dbenv, dbc->txn, &new_lsn, 0, dbp->log_fileid, SPLITNEW, PGNO(new_pagep), &page_dbt, &LSN(new_pagep))) != 0) goto err; LSN(new_pagep) = new_lsn; } ret = CDB___ham_put_page(dbp, old_pagep, 1); if ((tret = CDB___ham_put_page(dbp, new_pagep, 1)) != 0 && ret == 0) ret = tret; if (0) { err: if (old_pagep != NULL) (void)CDB___ham_put_page(dbp, old_pagep, 1); if (new_pagep != NULL) (void)CDB___ham_put_page(dbp, new_pagep, 1); if (temp_pagep != NULL && PGNO(temp_pagep) != bucket_pgno) (void)CDB___ham_put_page(dbp, temp_pagep, 1); if (harray != NULL) /* We never knew its size. */ CDB___os_free(harray, 0); } return (ret); } /* * Add the given pair to the page. The page in question may already be * held (i.e. it was already gotten). If it is, then the page is passed * in via the pagep parameter. On return, pagep will contain the page * to which we just added something. This allows us to link overflow * pages and return the new page having correctly put the last page. * * PUBLIC: int CDB___ham_add_el __P((DBC *, const DBT *, const DBT *, int)); */ int CDB___ham_add_el(dbc, key, val, type) DBC *dbc; const DBT *key, *val; int type; { DB *dbp; HASH_CURSOR *hcp; const DBT *pkey, *pdata; DBT key_dbt, data_dbt; DB_LSN new_lsn; HOFFPAGE doff, koff; db_pgno_t next_pgno; u_int32_t data_size, key_size, pairsize, rectype; int do_expand, is_keybig, is_databig, ret; int key_type, data_type; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; do_expand = 0; if (hcp->pagep == NULL && (ret = CDB___ham_get_page(dbp, hcp->seek_found_page != PGNO_INVALID ? hcp->seek_found_page : hcp->pgno, &hcp->pagep)) != 0) return (ret); key_size = HKEYDATA_PSIZE(key->size); data_size = HKEYDATA_PSIZE(val->size); is_keybig = ISBIG(hcp, key->size); is_databig = ISBIG(hcp, val->size); if (is_keybig) key_size = HOFFPAGE_PSIZE; if (is_databig) data_size = HOFFPAGE_PSIZE; pairsize = key_size + data_size; /* Advance to first page in chain with room for item. */ while (H_NUMPAIRS(hcp->pagep) && NEXT_PGNO(hcp->pagep) != PGNO_INVALID) { /* * This may not be the end of the chain, but the pair may fit * anyway. Check if it's a bigpair that fits or a regular * pair that fits. */ if (P_FREESPACE(hcp->pagep) >= pairsize) break; next_pgno = NEXT_PGNO(hcp->pagep); if ((ret = CDB___ham_next_cpage(dbc, next_pgno, 0, 0)) != 0) return (ret); } /* * Check if we need to allocate a new page. */ if (P_FREESPACE(hcp->pagep) < pairsize) { do_expand = 1; if ((ret = CDB___ham_add_ovflpage(dbc, hcp->pagep, 1, &hcp->pagep)) != 0) return (ret); hcp->pgno = PGNO(hcp->pagep); } /* * Update cursor. */ hcp->bndx = H_NUMPAIRS(hcp->pagep); F_CLR(hcp, H_DELETED); if (is_keybig) { koff.type = H_OFFPAGE; UMRW(koff.unused[0]); UMRW(koff.unused[1]); UMRW(koff.unused[2]); if ((ret = CDB___db_poff(dbc, key, &koff.pgno)) != 0) return (ret); koff.tlen = key->size; key_dbt.data = &koff; key_dbt.size = sizeof(koff); pkey = &key_dbt; key_type = H_OFFPAGE; } else { pkey = key; key_type = H_KEYDATA; } if (is_databig) { doff.type = H_OFFPAGE; UMRW(doff.unused[0]); UMRW(doff.unused[1]); UMRW(doff.unused[2]); if ((ret = CDB___db_poff(dbc, val, &doff.pgno)) != 0) return (ret); doff.tlen = val->size; data_dbt.data = &doff; data_dbt.size = sizeof(doff); pdata = &data_dbt; data_type = H_OFFPAGE; } else { pdata = val; data_type = type; } if (DB_LOGGING(dbc)) { rectype = PUTPAIR; if (is_databig) rectype |= PAIR_DATAMASK; if (is_keybig) rectype |= PAIR_KEYMASK; if ((ret = CDB___ham_insdel_log(dbp->dbenv, dbc->txn, &new_lsn, 0, rectype, dbp->log_fileid, PGNO(hcp->pagep), (u_int32_t)H_NUMPAIRS(hcp->pagep), &LSN(hcp->pagep), pkey, pdata)) != 0) return (ret); /* Move lsn onto page. */ LSN(hcp->pagep) = new_lsn; /* Structure assignment. */ } CDB___ham_putitem(hcp->pagep, pkey, key_type); CDB___ham_putitem(hcp->pagep, pdata, data_type); /* * For splits, we are going to update item_info's page number * field, so that we can easily return to the same page the * next time we come in here. For other operations, this shouldn't * matter, since odds are this is the last thing that happens before * we return to the user program. */ hcp->pgno = PGNO(hcp->pagep); /* * XXX Maybe keep incremental numbers here */ if (!F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) hcp->hdr->nelem++; if (do_expand || (hcp->hdr->ffactor != 0 && (u_int32_t)H_NUMPAIRS(hcp->pagep) > hcp->hdr->ffactor)) F_SET(hcp, H_EXPAND); return (0); } /* * Special __putitem call used in splitting -- copies one entry to * another. Works for all types of hash entries (H_OFFPAGE, H_KEYDATA, * H_DUPLICATE, H_OFFDUP). Since we log splits at a high level, we * do not need to do any logging here. * * PUBLIC: void CDB___ham_copy_item __P((size_t, PAGE *, u_int32_t, PAGE *)); */ void CDB___ham_copy_item(pgsize, src_page, src_ndx, dest_page) size_t pgsize; PAGE *src_page; u_int32_t src_ndx; PAGE *dest_page; { u_int32_t len; void *src, *dest; /* * Copy the key and data entries onto this new page. */ src = P_ENTRY(src_page, src_ndx); /* Set up space on dest. */ len = LEN_HITEM(src_page, pgsize, src_ndx); HOFFSET(dest_page) -= len; dest_page->inp[NUM_ENT(dest_page)] = HOFFSET(dest_page); dest = P_ENTRY(dest_page, NUM_ENT(dest_page)); NUM_ENT(dest_page)++; memcpy(dest, src, len); } /* * * Returns: * pointer on success * NULL on error * * PUBLIC: int CDB___ham_add_ovflpage __P((DBC *, PAGE *, int, PAGE **)); */ int CDB___ham_add_ovflpage(dbc, pagep, release, pp) DBC *dbc; PAGE *pagep; int release; PAGE **pp; { DB *dbp; HASH_CURSOR *hcp; DB_LSN new_lsn; PAGE *new_pagep; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___db_new(dbc, P_HASH, &new_pagep)) != 0) return (ret); if (DB_LOGGING(dbc)) { if ((ret = CDB___ham_newpage_log(dbp->dbenv, dbc->txn, &new_lsn, 0, PUTOVFL, dbp->log_fileid, PGNO(pagep), &LSN(pagep), PGNO(new_pagep), &LSN(new_pagep), PGNO_INVALID, NULL)) != 0) return (ret); /* Move lsn onto page. */ LSN(pagep) = LSN(new_pagep) = new_lsn; } NEXT_PGNO(pagep) = PGNO(new_pagep); PREV_PGNO(new_pagep) = PGNO(pagep); if (release) ret = CDB___ham_put_page(dbp, pagep, 1); *pp = new_pagep; return (ret); } /* * PUBLIC: int CDB___ham_put_page __P((DB *, PAGE *, int32_t)); */ int CDB___ham_put_page(dbp, pagep, is_dirty) DB *dbp; PAGE *pagep; int32_t is_dirty; { return (CDB_memp_fput(dbp->mpf, pagep, (is_dirty ? DB_MPOOL_DIRTY : 0))); } /* * CDB___ham_dirty_page -- * Mark a page dirty. * * PUBLIC: int CDB___ham_dirty_page __P((DB *, PAGE *)); */ int CDB___ham_dirty_page(dbp, pagep) DB *dbp; PAGE *pagep; { return (CDB_memp_fset(dbp->mpf, pagep, DB_MPOOL_DIRTY)); } /* * PUBLIC: int CDB___ham_get_page __P((DB *, db_pgno_t, PAGE **)); */ int CDB___ham_get_page(dbp, addr, pagep) DB *dbp; db_pgno_t addr; PAGE **pagep; { return (CDB_memp_fget(dbp->mpf, &addr, DB_MPOOL_CREATE, pagep)); } /* * PUBLIC: db_pgno_t CDB___bucket_to_page __P((HASH_CURSOR *, db_pgno_t)); */ db_pgno_t CDB___bucket_to_page(hcp, n) HASH_CURSOR *hcp; db_pgno_t n; { int ret_val; ret_val = n + 1; if (n != 0) ret_val += hcp->hdr->spares[CDB___db_log2(n + 1) - 1]; return (ret_val); } /* * PUBLIC: int CDB___ham_get_cpage __P((DBC *, db_lockmode_t)); */ int CDB___ham_get_cpage(dbc, mode) DBC *dbc; db_lockmode_t mode; { DB *dbp; HASH_CURSOR *hcp; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; ret = 0; /* * There are three cases with respect to buckets and locks. If there * is no lock held, then if we are locking, we should get the lock. * If there is a lock held and it's for the current bucket, we don't * need to do anything. If there is a lock, but it's for a different * bucket, then we need to release and get. */ if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) { if (hcp->lock.off != LOCK_INVALID && hcp->lbucket != hcp->bucket) { /* * If this is the original lock, don't release it, * because we may need to restore it upon exit. */ if (dbc->txn == NULL && !F_ISSET(hcp, H_ORIGINAL) && (ret = CDB_lock_put(dbp->dbenv, &hcp->lock)) != 0) return (ret); F_CLR(hcp, H_ORIGINAL); hcp->lock.off = LOCK_INVALID; } if ((hcp->lock.off == LOCK_INVALID || (hcp->mode == DB_LOCK_READ && mode == DB_LOCK_WRITE))) { if ((ret = CDB___ham_lock_bucket(dbc, mode)) != 0) return (ret); F_CLR(hcp, H_ORIGINAL); } hcp->mode = mode; hcp->lbucket = hcp->bucket; } if (hcp->pagep == NULL) { if (hcp->pgno == PGNO_INVALID) { hcp->pgno = BUCKET_TO_PAGE(hcp, hcp->bucket); hcp->bndx = 0; } if ((ret = CDB___ham_get_page(dbp, hcp->pgno, &hcp->pagep)) != 0) return (ret); } if (hcp->dpgno != PGNO_INVALID && hcp->dpagep == NULL) if ((ret = CDB___ham_get_page(dbp, hcp->dpgno, &hcp->dpagep)) != 0) return (ret); return (0); } /* * Get a new page at the cursor, putting the last page if necessary. * If the flag is set to H_ISDUP, then we are talking about the * duplicate page, not the main page. * * PUBLIC: int CDB___ham_next_cpage __P((DBC *, db_pgno_t, int, u_int32_t)); */ int CDB___ham_next_cpage(dbc, pgno, dirty, flags) DBC *dbc; db_pgno_t pgno; int dirty; u_int32_t flags; { DB *dbp; HASH_CURSOR *hcp; PAGE *p; int ret; dbp = dbc->dbp; hcp = (HASH_CURSOR *)dbc->internal; if (LF_ISSET(H_ISDUP) && hcp->dpagep != NULL && (ret = CDB___ham_put_page(dbp, hcp->dpagep, dirty)) != 0) return (ret); else if (!LF_ISSET(H_ISDUP) && hcp->pagep != NULL && (ret = CDB___ham_put_page(dbp, hcp->pagep, dirty)) != 0) return (ret); if ((ret = CDB___ham_get_page(dbp, pgno, &p)) != 0) return (ret); if (LF_ISSET(H_ISDUP)) { hcp->dpagep = p; hcp->dpgno = pgno; hcp->dndx = 0; } else { hcp->pagep = p; hcp->pgno = pgno; hcp->bndx = 0; } return (0); } /* * CDB___ham_lock_bucket -- * Get the lock on a particular bucket. * * PUBLIC: int CDB___ham_lock_bucket __P((DBC *, db_lockmode_t)); */ int CDB___ham_lock_bucket(dbc, mode) DBC *dbc; db_lockmode_t mode; { HASH_CURSOR *hcp; u_int32_t flags; int ret; hcp = (HASH_CURSOR *)dbc->internal; dbc->lock.pgno = BUCKET_TO_PAGE(hcp, hcp->bucket); flags = 0; if (DB_NONBLOCK(dbc)) LF_SET(DB_LOCK_NOWAIT); ret = CDB_lock_get(dbc->dbp->dbenv, dbc->locker, flags, &dbc->lock_dbt, mode, &hcp->lock); hcp->mode = mode; return (ret); } /* * CDB___ham_dpair -- * Delete a pair on a page, paying no attention to what the pair * represents. The caller is responsible for freeing up duplicates * or offpage entries that might be referenced by this pair. * * PUBLIC: void CDB___ham_dpair __P((DB *, PAGE *, u_int32_t)); */ void CDB___ham_dpair(dbp, p, pndx) DB *dbp; PAGE *p; u_int32_t pndx; { db_indx_t delta, n; u_int8_t *dest, *src; /* * Compute "delta", the amount we have to shift all of the * offsets. To find the delta, we just need to calculate * the size of the pair of elements we are removing. */ delta = H_PAIRSIZE(p, dbp->pgsize, pndx); /* * The hard case: we want to remove something other than * the last item on the page. We need to shift data and * offsets down. */ if ((db_indx_t)pndx != H_NUMPAIRS(p) - 1) { /* * Move the data: src is the first occupied byte on * the page. (Length is delta.) */ src = (u_int8_t *)p + HOFFSET(p); /* * Destination is delta bytes beyond src. This might * be an overlapping copy, so we have to use memmove. */ dest = src + delta; memmove(dest, src, p->inp[H_DATAINDEX(pndx)] - HOFFSET(p)); } /* Adjust the offsets. */ for (n = (db_indx_t)pndx; n < (db_indx_t)(H_NUMPAIRS(p) - 1); n++) { p->inp[H_KEYINDEX(n)] = p->inp[H_KEYINDEX(n+1)] + delta; p->inp[H_DATAINDEX(n)] = p->inp[H_DATAINDEX(n+1)] + delta; } /* Adjust page metadata. */ HOFFSET(p) = HOFFSET(p) + delta; NUM_ENT(p) = NUM_ENT(p) - 2; } �������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_rec.c�������������������������������������������������������������������������0100644�0063146�0012731�00000070417�07427026535�014713� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * Margo Seltzer. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_rec.c 11.12 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "hash.h" #include "lock.h" #include "log.h" #include "mp.h" static int CDB___ham_alloc_pages __P((DB *, HMETA *, db_pgno_t, db_pgno_t)); static int CDB___ham_free_pages __P((DB *, __ham_groupalloc_args *)); /* * CDB___ham_insdel_recover -- * * PUBLIC: int CDB___ham_insdel_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_insdel_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_insdel_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t op; int cmp_n, cmp_p, getmeta, ret; COMPQUIET(info, NULL); getmeta = 0; REC_PRINT(CDB___ham_insdel_print); REC_INTRO(CDB___ham_insdel_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; getmeta = 1; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); /* * Two possible things going on: * redo a delete/undo a put: delete the item from the page. * redo a put/undo a delete: add the item to the page. * If we are undoing a delete, then the information logged is the * entire entry off the page, not just the data of a dbt. In * this case, we want to copy it back onto the page verbatim. * We do this by calling __putitem with the type H_OFFPAGE instead * of H_KEYDATA. */ op = OPCODE_OF(argp->opcode); if ((op == DELPAIR && cmp_n == 0 && !redo) || (op == PUTPAIR && cmp_p == 0 && redo)) { /* * Need to redo a PUT or undo a delete. If we are undoing a * delete, we've got to restore the item back to its original * position. That's a royal pain in the butt (because we do * not store item lengths on the page), but there's no choice. */ if (op != DELPAIR || argp->ndx == (u_int32_t)H_NUMPAIRS(pagep)) { CDB___ham_putitem(pagep, &argp->key, !redo || PAIR_ISKEYBIG(argp->opcode) ? H_OFFPAGE : H_KEYDATA); CDB___ham_putitem(pagep, &argp->data, !redo || PAIR_ISDATABIG(argp->opcode) ? H_OFFPAGE : H_KEYDATA); } else (void) CDB___ham_reputpair(pagep, file_dbp->pgsize, argp->ndx, &argp->key, &argp->data); LSN(pagep) = redo ? *lsnp : argp->pagelsn; if ((ret = CDB___ham_put_page(file_dbp, pagep, 1)) != 0) goto out; } else if ((op == DELPAIR && cmp_p == 0 && redo) || (op == PUTPAIR && cmp_n == 0 && !redo)) { /* Need to undo a put or redo a delete. */ CDB___ham_dpair(file_dbp, pagep, argp->ndx); LSN(pagep) = redo ? *lsnp : argp->pagelsn; if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 1)) != 0) goto out; } else if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 0)) != 0) goto out; /* Return the previous LSN. */ done: *lsnp = argp->prev_lsn; ret = 0; out: if (getmeta) (void)CDB___ham_release_meta(dbc); REC_CLOSE; } /* * CDB___ham_newpage_recover -- * This log message is used when we add/remove overflow pages. This * message takes care of the pointer chains, not the data on the pages. * * PUBLIC: int CDB___ham_newpage_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_newpage_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_newpage_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, change, getmeta, ret; COMPQUIET(info, NULL); getmeta = 0; REC_PRINT(CDB___ham_newpage_print); REC_INTRO(CDB___ham_newpage_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->new_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ ret = 0; goto ppage; } else if ((ret = CDB_memp_fget(mpf, &argp->new_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; getmeta = 1; /* * There are potentially three pages we need to check: the one * that we created/deleted, the one before it and the one after * it. */ cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); change = 0; if ((cmp_p == 0 && redo && argp->opcode == PUTOVFL) || (cmp_n == 0 && !redo && argp->opcode == DELOVFL)) { /* Redo a create new page or undo a delete new page. */ P_INIT(pagep, file_dbp->pgsize, argp->new_pgno, argp->prev_pgno, argp->next_pgno, 0, P_HASH); change = 1; } else if ((cmp_p == 0 && redo && argp->opcode == DELOVFL) || (cmp_n == 0 && !redo && argp->opcode == PUTOVFL)) { /* * Redo a delete or undo a create new page. All we * really need to do is change the LSN. */ change = 1; } if (!change) { if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 0)) != 0) goto out; } else { LSN(pagep) = redo ? *lsnp : argp->pagelsn; if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 1)) != 0) goto out; } /* Now do the prev page. */ ppage: if (argp->prev_pgno != PGNO_INVALID) { if ((ret = CDB_memp_fget(mpf, &argp->prev_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. * That is equivalent to having a pagelsn of 0, * so we would not have to undo anything. In * this case, don't bother creating a page. */ ret = 0; goto npage; } else if ((ret = CDB_memp_fget(mpf, &argp->prev_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->prevlsn); change = 0; if ((cmp_p == 0 && redo && argp->opcode == PUTOVFL) || (cmp_n == 0 && !redo && argp->opcode == DELOVFL)) { /* Redo a create new page or undo a delete new page. */ pagep->next_pgno = argp->new_pgno; change = 1; } else if ((cmp_p == 0 && redo && argp->opcode == DELOVFL) || (cmp_n == 0 && !redo && argp->opcode == PUTOVFL)) { /* Redo a delete or undo a create new page. */ pagep->next_pgno = argp->next_pgno; change = 1; } if (!change) { if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 0)) != 0) goto out; } else { LSN(pagep) = redo ? *lsnp : argp->prevlsn; if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 1)) != 0) goto out; } } /* Now time to do the next page */ npage: if (argp->next_pgno != PGNO_INVALID) { if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. * That is equivalent to having a pagelsn of 0, * so we would not have to undo anything. In * this case, don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->nextlsn); change = 0; if ((cmp_p == 0 && redo && argp->opcode == PUTOVFL) || (cmp_n == 0 && !redo && argp->opcode == DELOVFL)) { /* Redo a create new page or undo a delete new page. */ pagep->prev_pgno = argp->new_pgno; change = 1; } else if ((cmp_p == 0 && redo && argp->opcode == DELOVFL) || (cmp_n == 0 && !redo && argp->opcode == PUTOVFL)) { /* Redo a delete or undo a create new page. */ pagep->prev_pgno = argp->prev_pgno; change = 1; } if (!change) { if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 0)) != 0) goto out; } else { LSN(pagep) = redo ? *lsnp : argp->nextlsn; if ((ret = CDB___ham_put_page(file_dbp, (PAGE *)pagep, 1)) != 0) goto out; } } done: *lsnp = argp->prev_lsn; ret = 0; out: if (getmeta) (void)CDB___ham_release_meta(dbc); REC_CLOSE; } /* * CDB___ham_replace_recover -- * This log message refers to partial puts that are local to a single * page. You can think of them as special cases of the more general * insdel log message. * * PUBLIC: int CDB___ham_replace_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_replace_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_replace_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; DBT dbt; PAGE *pagep; int32_t grow; int change, cmp_n, cmp_p, getmeta, ret; u_int8_t *hk; COMPQUIET(info, NULL); getmeta = 0; REC_PRINT(CDB___ham_replace_print); REC_INTRO(CDB___ham_replace_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; getmeta = 1; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); memset(&dbt, 0, sizeof(dbt)); if (cmp_p == 0 && redo) { change = 1; /* Reapply the change as specified. */ dbt.data = argp->newitem.data; dbt.size = argp->newitem.size; grow = argp->newitem.size - argp->olditem.size; LSN(pagep) = *lsnp; } else if (cmp_n == 0 && !redo) { change = 1; /* Undo the already applied change. */ dbt.data = argp->olditem.data; dbt.size = argp->olditem.size; grow = argp->olditem.size - argp->newitem.size; LSN(pagep) = argp->pagelsn; } else { change = 0; grow = 0; } if (change) { CDB___ham_onpage_replace(pagep, file_dbp->pgsize, argp->ndx, argp->off, grow, &dbt); if (argp->makedup) { hk = P_ENTRY(pagep, argp->ndx); if (redo) HPAGE_PTYPE(hk) = H_DUPLICATE; else HPAGE_PTYPE(hk) = H_KEYDATA; } } if ((ret = CDB___ham_put_page(file_dbp, pagep, change)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: if (getmeta) (void)CDB___ham_release_meta(dbc); REC_CLOSE; } /* * CDB___ham_newpgno_recover -- * This log message is used when allocating or deleting an overflow * page. It takes care of modifying the meta data. * * PUBLIC: int CDB___ham_newpgno_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_newpgno_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { COMPQUIET(dbenv, NULL); COMPQUIET(dbtp, NULL); COMPQUIET(lsnp, NULL); COMPQUIET(redo, 0); COMPQUIET(info, NULL); return (EINVAL); } /* * CDB___ham_splitmeta_recover -- * This is the meta-data part of the split. Records the new and old * bucket numbers and the new/old mask information. * * PUBLIC: int CDB___ham_splitmeta_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_splitmeta_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { COMPQUIET(dbenv, NULL); COMPQUIET(dbtp, NULL); COMPQUIET(lsnp, NULL); COMPQUIET(redo, 0); COMPQUIET(info, NULL); return (EINVAL); } /* * CDB___ham_splitdata_recover -- * * PUBLIC: int CDB___ham_splitdata_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_splitdata_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_splitdata_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int change, cmp_n, cmp_p, getmeta, ret; COMPQUIET(info, NULL); getmeta = 0; REC_PRINT(CDB___ham_splitdata_print); REC_INTRO(CDB___ham_splitdata_read, 1); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; getmeta = 1; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); /* * There are two types of log messages here, one for the old page * and one for the new pages created. The original image in the * SPLITOLD record is used for undo. The image in the SPLITNEW * is used for redo. We should never have a case where there is * a redo operation and the SPLITOLD record is on disk, but not * the SPLITNEW record. Therefore, we only have work to do when * redo NEW messages and undo OLD messages, but we have to update * LSNs in both cases. */ change = 0; if (cmp_p == 0 && redo) { if (argp->opcode == SPLITNEW) /* Need to redo the split described. */ memcpy(pagep, argp->pageimage.data, argp->pageimage.size); LSN(pagep) = *lsnp; change = 1; } else if (cmp_n == 0 && !redo) { if (argp->opcode == SPLITOLD) { /* Put back the old image. */ memcpy(pagep, argp->pageimage.data, argp->pageimage.size); } else P_INIT(pagep, file_dbp->pgsize, argp->pgno, PGNO_INVALID, PGNO_INVALID, 0, P_HASH); LSN(pagep) = argp->pagelsn; change = 1; } if ((ret = CDB___ham_put_page(file_dbp, pagep, change)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: if (getmeta) (void)CDB___ham_release_meta(dbc); REC_CLOSE; } /* * CDB___ham_ovfl_recover -- * This message is generated when we initialize a set of overflow pages. * * PUBLIC: int CDB___ham_ovfl_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_ovfl_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { COMPQUIET(dbenv, NULL); COMPQUIET(dbtp, NULL); COMPQUIET(lsnp, NULL); COMPQUIET(redo, 0); COMPQUIET(info, NULL); return (EINVAL); } /* * CDB___ham_copypage_recover -- * Recovery function for copypage. * * PUBLIC: int CDB___ham_copypage_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_copypage_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_copypage_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; int cmp_n, cmp_p, getmeta, modified, ret; COMPQUIET(info, NULL); getmeta = 0; REC_PRINT(CDB___ham_copypage_print); REC_INTRO(CDB___ham_copypage_read, 1); if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; getmeta = 1; modified = 0; /* This is the bucket page. */ if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ ret = 0; goto donext; } else if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->pagelsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ memcpy(pagep, argp->page.data, argp->page.size); LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ P_INIT(pagep, file_dbp->pgsize, argp->pgno, PGNO_INVALID, argp->next_pgno, 0, P_HASH); LSN(pagep) = argp->pagelsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; donext: /* Now fix up the "next" page. */ if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ ret = 0; goto do_nn; } else if ((ret = CDB_memp_fget(mpf, &argp->next_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } /* There is nothing to do in the REDO case; only UNDO. */ cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); if (cmp_n == 0 && !redo) { /* Need to undo update described. */ memcpy(pagep, argp->page.data, argp->page.size); modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; /* Now fix up the next's next page. */ do_nn: if (argp->nnext_pgno == PGNO_INVALID) goto done; if ((ret = CDB_memp_fget(mpf, &argp->nnext_pgno, 0, &pagep)) != 0) { if (!redo) { /* * We are undoing and the page doesn't exist. That * is equivalent to having a pagelsn of 0, so we * would not have to undo anything. In this case, * don't bother creating a page. */ goto done; } else if ((ret = CDB_memp_fget(mpf, &argp->nnext_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->nnextlsn); if (cmp_p == 0 && redo) { /* Need to redo update described. */ PREV_PGNO(pagep) = argp->pgno; LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* Need to undo update described. */ PREV_PGNO(pagep) = argp->next_pgno; LSN(pagep) = argp->nnextlsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: if (getmeta) (void)CDB___ham_release_meta(dbc); REC_CLOSE; } /* * CDB___ham_metagroup_recover -- * Recovery function for metagroup. * * PUBLIC: int CDB___ham_metagroup_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_metagroup_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_metagroup_args *argp; HASH_CURSOR *hcp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t last_pgno; int cmp_n, cmp_p, groupgrow, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___ham_metagroup_print); REC_INTRO(CDB___ham_metagroup_read, 1); /* * This logs the virtual create of pages pgno to pgno + bucket * Since the mpool page-allocation is not really able to be * transaction protected, we can never undo it. Even in an abort, * we have to allocate these pages to the hash table. * The log record contains: * bucket: new bucket being allocated. * pgno: page number of the new bucket. * if bucket is a power of 2, then we allocated a whole batch of * pages; if it's not, then we simply allocated one new page. */ groupgrow = (u_int32_t)(1 << CDB___db_log2(argp->bucket + 1)) == argp->bucket + 1; last_pgno = argp->pgno; if (groupgrow) /* Read the last page. */ last_pgno += argp->bucket; if ((ret = CDB_memp_fget(mpf, &last_pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&argp->pagelsn, &LSN(pagep)); if ((cmp_p == 0 && redo) || (cmp_n == 0 && !redo)) { /* * We need to make sure that we redo the allocation of the * pages. */ if (redo) pagep->lsn = *lsnp; else pagep->lsn = argp->pagelsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; /* Now we have to update the meta-data page. */ hcp = dbc->internal; if ((ret = CDB___ham_get_meta(dbc)) != 0) goto out; cmp_n = CDB_log_compare(lsnp, &hcp->hdr->dbmeta.lsn); cmp_p = CDB_log_compare(&argp->metalsn, &hcp->hdr->dbmeta.lsn); if ((cmp_p == 0 && redo) || (cmp_n == 0 && !redo)) { if (redo) { /* Redo the actual updating of bucket counts. */ ++hcp->hdr->max_bucket; if (groupgrow) { hcp->hdr->low_mask = hcp->hdr->high_mask; hcp->hdr->high_mask = (argp->bucket + 1) | hcp->hdr->low_mask; } hcp->hdr->dbmeta.lsn = *lsnp; } else { /* Undo the actual updating of bucket counts. */ --hcp->hdr->max_bucket; if (groupgrow) { hcp->hdr->high_mask = hcp->hdr->low_mask; hcp->hdr->low_mask = hcp->hdr->high_mask >> 1; } hcp->hdr->dbmeta.lsn = argp->metalsn; } if (groupgrow && hcp->hdr->spares[CDB___db_log2(argp->bucket + 1) + 1] == PGNO_INVALID) hcp->hdr->spares[CDB___db_log2(argp->bucket + 1) + 1] = argp->pgno - argp->bucket - 1; F_SET(hcp, H_DIRTY); } if ((ret = CDB___ham_release_meta(dbc)) != 0) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___ham_groupalloc_recover -- * Recover the batch creation of a set of pages for a new database. * * PUBLIC: int CDB___ham_groupalloc_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___ham_groupalloc_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __ham_groupalloc_args *argp; DBMETA *mmeta; DB_MPOOLFILE *mpf; DB *file_dbp; DBC *dbc; PAGE *pagep; db_pgno_t pgno; int cmp_n, cmp_p, modified, ret; modified = 0; COMPQUIET(info, NULL); REC_PRINT(CDB___ham_groupalloc_print); REC_INTRO(CDB___ham_groupalloc_read, 0); if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (redo) { /* Page should have existed. */ (void)CDB___db_pgerr(file_dbp, argp->pgno); goto out; } else { ret = 0; goto done; } } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->metalsn); if (cmp_p == 0 && redo) { LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { LSN(pagep) = argp->metalsn; modified = 1; } /* * Basically, we used mpool to allocate a chunk of pages. * We need to either add those to a free list (in the undo * case) or initialize them (in the redo case). * * If we are redoing and this is a hash subdatabase, it's possible * that the pages were never allocated, so we'd better check for * that and handle it here. */ if (redo) { if ((ret = CDB___ham_alloc_pages(file_dbp, (HMETA *)pagep, argp->start_pgno, argp->num)) != 0) goto out1; /* Update the master meta data page LSN. */ if (argp->pgno != PGNO_BASE_MD) { pgno = PGNO_BASE_MD; if ((ret = CDB_memp_fget(mpf, &pgno, 0, &mmeta)) != 0) goto out1; mmeta->lsn = *lsnp; if ((ret = CDB_memp_fput(mpf, mmeta, DB_MPOOL_DIRTY)) != 0) goto out1; } } /* * If we are undoing and this is a subdatabase then we need to * put the pages on the free list. If it's not a subdatabase, * then we can simply do nothing because we're about to delete * the file. */ if (!redo && argp->pgno != PGNO_BASE_MD) { if ((ret = CDB___ham_free_pages(file_dbp, argp)) != 0) goto out1; LSN(pagep) = argp->metalsn; modified = 1; } out1: if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) != 0) goto out; done: if (ret == 0) *lsnp = argp->prev_lsn; out: REC_CLOSE; } /* * CDB___ham_free_pages -- * * Called during abort/undo of a file create. We create new pages in the file * using the MPOOL_NEW_GROUP flag. We then log the meta-data page with a * __crdel_metasub message. If we fail we need to take those newly allocated * pages and put them on a free list. Normally this would happen in the * recovery for CDB___db_new, but that doesn't get called in this case. */ static int CDB___ham_free_pages(dbp, argp) DB *dbp; __ham_groupalloc_args *argp; { DBMETA *mmeta; DB_MPOOLFILE *mpf; PAGE *pagep; u_int32_t i; db_pgno_t last_free, pgno; int mod_meta, ret, t_ret; mod_meta = 0; /* Get the master meta-data page. */ mpf = dbp->mpf; pgno = PGNO_BASE_MD; if ((ret = CDB_memp_fget(mpf, &pgno, 0, &mmeta)) != 0) return (ret); last_free = mmeta->free; for (i = 0; i <= argp->num; i++) { pgno = argp->start_pgno + i; if ((ret = CDB_memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &pagep)) != 0) { (void)CDB___db_pgerr(dbp, pgno); goto out; } /* Fix up the allocated page. */ P_INIT(pagep, dbp->pgsize, pgno, PGNO_INVALID, last_free, 0, P_INVALID); ZERO_LSN(pagep->lsn); if ((ret = CDB_memp_fput(mpf, pagep, DB_MPOOL_DIRTY)) != 0) goto out; } mmeta->free = last_free; mmeta->lsn = argp->mmetalsn; mod_meta = 1; out: if ((t_ret = CDB_memp_fput(mpf, mmeta, mod_meta ? DB_MPOOL_DIRTY : 0)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___ham_alloc_pages -- * * Called during redo of a file create. We create new pages in the file * using the MPOOL_NEW_GROUP flag. We then log the meta-data page with a * __crdel_metasub message. If we manage to crash without the newly written * pages getting to disk (I'm not sure this can happen anywhere except our * test suite?!), then we need to go through a recreate the final pages. * Hash normally has holes in its files and handles them appropriately. */ static int CDB___ham_alloc_pages(dbp, meta, start, npages) DB *dbp; HMETA *meta; db_pgno_t start, npages; { DB_MPOOLFILE *mpf; PAGE *pagep; db_pgno_t pgno; int ret; mpf = dbp->mpf; /* Read the last page of the allocation. */ pgno = meta->spares[0] + meta->max_bucket; /* If the page exists, and it has been initialized, then we're done. */ if ((ret = CDB_memp_fget(mpf, &pgno, 0, &pagep)) == 0) { if (pagep->type == P_INVALID && pagep->lsn.file == 0) goto reinit_page; if ((ret = CDB_memp_fput(mpf, pagep, 0)) != 0) return (ret); return (0); } /* * Had to create the page. On some systems (read "Windows"), * you can find random garbage on pages to which you haven't * yet written. So, we have an os layer that will do the * right thing for group allocations. We call that directly * to make sure all the pages are allocated and then continue * merrily on our way with normal recovery. */ if ((ret = CDB___os_fpinit(&mpf->fh, start, npages, dbp->pgsize)) != 0) return (ret); if ((ret = CDB_memp_fget(mpf, &pgno, DB_MPOOL_CREATE, &pagep)) != 0) { (void)CDB___db_pgerr(dbp, pgno); return (ret); } reinit_page: /* Initialize the newly allocated page. */ P_INIT(pagep, dbp->pgsize, pgno, PGNO_INVALID, PGNO_INVALID, 0, P_HASH); ZERO_LSN(pagep->lsn); if ((ret = CDB_memp_fput(mpf, pagep, DB_MPOOL_DIRTY)) != 0) return (ret); return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_reclaim.c���������������������������������������������������������������������0100644�0063146�0012731�00000003216�07427026535�015547� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_reclaim.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "hash.h" #include "lock.h" /* * CDB___ham_reclaim -- * Reclaim the pages from a subdatabase and return them to the * parent free list. For now, we link each freed page on the list * separately. If people really store hash databases in subdatabases * and do a lot of creates and deletes, this is going to be a problem, * because hash needs chunks of contiguous storage. We may eventually * need to go to a model where we maintain the free list with chunks of * contiguous pages as well. * * PUBLIC: int CDB___ham_reclaim __P((DB *, DB_TXN *txn)); */ int CDB___ham_reclaim(dbp, txn) DB *dbp; DB_TXN *txn; { DBC *dbc; HASH_CURSOR *hcp; int ret; /* Open up a cursor that we'll use for traversing. */ if ((ret = dbp->cursor(dbp, txn, &dbc, 0)) != 0) return (ret); hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_get_meta(dbc)) != 0) goto err; if ((ret = CDB___ham_traverse(dbp, dbc, DB_LOCK_WRITE, CDB___db_reclaim_callback, dbc)) != 0) goto err; if ((ret = dbc->c_close(dbc)) != 0) goto err; if ((ret = CDB___ham_release_meta(dbc)) != 0) goto err; return (0); err: if (hcp->hdr != NULL) (void)CDB___ham_release_meta(dbc); (void)dbc->c_close(dbc); return (ret); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_stat.c������������������������������������������������������������������������0100644�0063146�0012731�00000013523�07427026535�015110� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_stat.c 11.5 (Sleepycat) 9/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "hash.h" #include "lock.h" static int CDB___ham_stat_callback __P((DB *, PAGE *, void *, int *)); /* * CDB___ham_stat -- * Gather/print the hash statistics * * PUBLIC: int CDB___ham_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); */ int CDB___ham_stat(dbp, spp, db_malloc, flags) DB *dbp; void *spp, *(*db_malloc) __P((size_t)); u_int32_t flags; { DB_HASH_STAT *sp; HASH_CURSOR *hcp; DBC *dbc; PAGE *h; db_pgno_t pgno; int ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat"); sp = NULL; /* Check for invalid flags. */ if ((ret = CDB___db_statchk(dbp, flags)) != 0) return (ret); if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); hcp = (HASH_CURSOR *)dbc->internal; if ((ret = CDB___ham_get_meta(dbc)) != 0) goto err; /* Allocate and clear the structure. */ if ((ret = CDB___os_malloc(sizeof(*sp), db_malloc, &sp)) != 0) goto err; memset(sp, 0, sizeof(*sp)); /* Copy the fields that we have. */ sp->hash_pagesize = dbp->pgsize; sp->hash_buckets = hcp->hdr->max_bucket + 1; sp->hash_magic = hcp->hdr->dbmeta.magic; sp->hash_version = hcp->hdr->dbmeta.version; sp->hash_metaflags = hcp->hdr->dbmeta.flags; sp->hash_nelem = hcp->hdr->nelem; sp->hash_ffactor = hcp->hdr->ffactor; /* Walk the free list, counting pages. */ for (sp->hash_free = 0, pgno = hcp->hdr->dbmeta.free; pgno != PGNO_INVALID;) { ++sp->hash_free; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; pgno = h->next_pgno; (void)CDB_memp_fput(dbp->mpf, h, 0); } /* Now traverse the rest of the table. */ if ((ret = CDB___ham_traverse(dbp, dbc, DB_LOCK_READ, CDB___ham_stat_callback, sp)) != 0) goto err; if ((ret = dbc->c_close(dbc)) != 0) goto err; if ((ret = CDB___ham_release_meta(dbc)) != 0) goto err; *(DB_HASH_STAT **)spp = sp; return (0); err: if (sp != NULL) CDB___os_free(sp, sizeof(*sp)); if (hcp->hdr != NULL) (void)CDB___ham_release_meta(dbc); (void)dbc->c_close(dbc); return (ret); } /* * CDB___ham_traverse * Traverse an entire hash table. We use the callback so that we * can use this both for stat collection and for deallocation. * * PUBLIC: int CDB___ham_traverse __P((DB *, DBC *, db_lockmode_t, * PUBLIC: int (*)(DB *, PAGE *, void *, int *), void *)); */ int CDB___ham_traverse(dbp, dbc, mode, callback, cookie) DB *dbp; DBC *dbc; db_lockmode_t mode; int (*callback) __P((DB *, PAGE *, void *, int *)); void *cookie; { HASH_CURSOR *hcp; HKEYDATA *hk; db_pgno_t pgno, opgno; u_int32_t bucket; int did_put, i, ret; hcp = (HASH_CURSOR *)dbc->internal; /* * In a perfect world, we could simply read each page in the file * and look at its page type to tally the information necessary. * Unfortunately, the bucket locking that hash tables do to make * locking easy, makes this a pain in the butt. We have to traverse * duplicate, overflow and big pages from the bucket so that we * don't access anything that isn't properly locked. */ for (bucket = 0; bucket <= hcp->hdr->max_bucket; bucket++) { hcp->bucket = bucket; pgno = CDB___bucket_to_page(hcp, bucket); for (ret = CDB___ham_get_cpage(dbc, mode); ret == 0; ret = CDB___ham_next_cpage(dbc, pgno, 0, 0)) { pgno = NEXT_PGNO(hcp->pagep); /* * Go through each item on the page checking for * duplicates (in which case we have to count the * duplicate pages) or big key/data items (in which * case we have to count those pages). */ for (i = 0; i < NUM_ENT(hcp->pagep); i++) { hk = (HKEYDATA *)P_ENTRY(hcp->pagep, i); switch (HPAGE_PTYPE(hk)) { case H_OFFDUP: memcpy(&opgno, HOFFDUP_PGNO(hk), sizeof(db_pgno_t)); if ((ret = CDB___db_traverse_dup(dbp, opgno, callback, cookie)) != 0) return (ret); break; case H_OFFPAGE: /* * We are about to get a big page * which will use the same spot that * the current page uses, so we need * to restore the current page before * looking at it again. */ memcpy(&opgno, HOFFPAGE_PGNO(hk), sizeof(db_pgno_t)); ret = CDB___db_traverse_big(dbp, opgno, callback, cookie); if (ret != 0) return (ret); break; case H_DUPLICATE: case H_KEYDATA: break; } } /* Call the callback on main pages. */ if ((ret = callback(dbp, hcp->pagep, cookie, &did_put)) != 0) return (ret); if (did_put) hcp->pagep = NULL; if (pgno == PGNO_INVALID) break; } if (ret != 0) return (ret); if (F_ISSET(dbp->dbenv, DB_ENV_LOCKING)) (void)CDB_lock_put(dbp->dbenv, &hcp->lock); } return (0); } static int CDB___ham_stat_callback(dbp, pagep, cookie, putp) DB *dbp; PAGE *pagep; void *cookie; int *putp; { DB_HASH_STAT *sp; *putp = 0; sp = cookie; switch (pagep->type) { case P_DUPLICATE: sp->hash_dup++; sp->hash_dup_free += P_FREESPACE(pagep); break; case P_OVERFLOW: sp->hash_bigpages++; sp->hash_big_bfree += P_OVFLSPACE(dbp->pgsize, pagep); break; case P_HASH: /* * We count the buckets and the overflow pages * separately and tally their bytes separately * as well. We need to figure out if this page * is a bucket. */ if (PREV_PGNO(pagep) == PGNO_INVALID) sp->hash_bfree += P_FREESPACE(pagep); else { sp->hash_overflows++; sp->hash_ovfl_free += P_FREESPACE(pagep); } sp->hash_nrecs += H_NUMPAIRS(pagep); break; default: return (EINVAL); } return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash_upgrade.c���������������������������������������������������������������������0100644�0063146�0012731�00000011741�07427026535�015564� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)hash_upgrade.c 11.7 (Sleepycat) 10/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "hash.h" static int CDB___ham_upgrade5 __P((DB *, int, char *, DB_FH *)); /* * CDB___ham_upgrade -- * Upgrade Hash databases. * * PUBLIC: int CDB___ham_upgrade __P((DB *, int, char *, DB_FH *, char *)); */ int CDB___ham_upgrade(dbp, swapped, real_name, fhp, mbuf) DB *dbp; int swapped; char *real_name, *mbuf; DB_FH *fhp; { DB_ENV *dbenv; int ret; dbenv = dbp->dbenv; /* Check the version. */ switch (((DBMETA *)mbuf)->version) { case 4: case 5: if ((ret = CDB___ham_upgrade5(dbp, swapped, real_name, fhp)) != 0) return (ret); /* FALLTHROUGH */ case 6: break; default: CDB___db_err(dbenv, "%s: unsupported hash version: %lu", real_name, (u_long)((DBMETA *)mbuf)->version); return (DB_OLD_VERSION); } return (0); } /* * CDB___ham_upgrade5 -- * Upgrade the database from version 4/5 to version 6. */ static int CDB___ham_upgrade5(dbp, swapped, real_name, fhp) DB *dbp; int swapped; char *real_name; DB_FH *fhp; { DB_ENV *dbenv; ssize_t n; u_int32_t *o_spares, *n_spares, version; u_int32_t fillf, maxb, nelem; int i, non_zero, ret; u_int8_t nbuf[256], *new, obuf[256]; dbenv = dbp->dbenv; if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 0); /* * Seek to the beginning of the file and read the metadata page. We * read 256 bytes, which is larger than any access method's metadata * page. */ if ((ret = CDB___os_seek(fhp, 0, 0, 0, 0, DB_OS_SEEK_SET)) != 0) return (ret); if ((ret = CDB___os_read(fhp, obuf, sizeof(obuf), &n)) != 0) return (ret); /* * Upgrade a Hash meta-data page. * Version 5: byte range: Version 6: byte range: * lsn 00-07 lsn 00-07 * pgno 08-11 pgno 08-11 * magic 12-15 magic 12-15 * version 16-19 version 16-19 * pagesize 20-23 pagesize 20-23 * ovfl_point 24-27 unused 24 * type 25 * unused 26-27 * last_freed 28-31 free 28-31 * max_bucket 32-35 flags 32-35 * high_mask 36-39 uid 36-55 * low_mask 40-43 max_bucket 56-59 * ffactor 44-47 high_mask 60-63 * nelem 48-51 low_mask 64-67 * h_charkey 52-55 ffactor 68-71 * flags 56-59 nelem 72-75 * spares 60-187 h_charkey 76-79 * uid 188-207 spares 80-207 * */ /* * The first 32 bytes are similar. The only change is the version * and that we removed the ovfl_point and have the page type now. */ memcpy(nbuf, obuf, 32); /* Update the version. */ version = 6; if (swapped) M_32_SWAP(version); memcpy(nbuf + 16, &version, sizeof(u_int32_t)); /* Assign unused and type fields. */ new = nbuf + 24; *new++ = '\0'; *new++ = P_HASHMETA; *new++ = '\0'; *new = '\0'; /* Move flags */ memcpy(nbuf + 32, obuf + 56, 4); /* Copy: max_bucket, high_mask, low-mask, ffactor, nelem, h_charkey */ memcpy(nbuf + 56, obuf + 32, 24); /* * There was a bug in 2.X versions where the nelem could go negative. * In general, this is considered "bad." If it does go negative * (that is, very large and positive), we'll die trying to dump and * load this database. So, let's see if we can fix it here. */ memcpy(&nelem, nbuf + 72, sizeof(u_int32_t)); memcpy(&fillf, nbuf + 68, sizeof(u_int32_t)); memcpy(&maxb, nbuf + 56, sizeof(u_int32_t)); if (swapped) { M_32_SWAP(nelem); M_32_SWAP(fillf); M_32_SWAP(maxb); } if ((fillf != 0 && fillf * maxb < 2 * nelem) || (fillf == 0 && nelem > 0x8000000)) { nelem = 0; memcpy(nbuf + 72, &nelem, sizeof(u_int32_t)); } /* * We now have to convert the spares array. The old spares array * contained the total number of extra pages allocated prior to * the bucket that begins the next doubling. The new spares array * contains the page number of the first bucket in the next doubling * MINUS the bucket number of that bucket. */ o_spares = (u_int32_t *)(obuf + 60); n_spares = (u_int32_t *)(nbuf + 80); non_zero = 0; n_spares[0] = 1; for (i = 1; i < NCACHED; i++) { if (swapped) M_32_SWAP(o_spares[i -1]); non_zero = non_zero || o_spares[i - 1] != 0; if (o_spares[i - 1] == 0 && non_zero) n_spares[i] = 0; else n_spares[i] = 1 + o_spares[i - 1]; } if (swapped) for (i = 0; i < NCACHED; i++) M_32_SWAP(n_spares[i]); /* Replace the unique ID. */ if ((ret = CDB___os_fileid(dbenv, real_name, 1, nbuf + 36)) != 0) return (ret); if ((ret = CDB___os_seek(fhp, 0, 0, 0, 1, DB_OS_SEEK_SET)) != 0) return (ret); if ((ret = CDB___os_write(fhp, nbuf, 256, &n)) != 0) return (ret); if ((ret = CDB___os_fsync(fhp)) != 0) return (ret); if (dbp->db_feedback != NULL) dbp->db_feedback(dbp, DB_UPGRADE, 100); return (0); } �������������������������������htdig-3.2.0b6/db/hash_verify.c����������������������������������������������������������������������0100644�0063146�0012731�00000064233�07427026535�015445� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999, 2000 * Sleepycat Software. All rights reserved. * * $Id: hash_verify.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: hash_verify.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_verify.h" #include "btree.h" #include "hash.h" static int __ham_dups_unsorted __P((DB *, u_int8_t *, u_int32_t)); static int __ham_vrfy_bucket __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t, u_int32_t)); static int __ham_vrfy_item __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, u_int32_t, u_int32_t)); /* * CDB___ham_vrfy_meta -- * Verify the hash-specific part of a metadata page. * * Note that unlike btree, we don't save things off, because we * will need most everything again to verify each page and the * amount of state here is significant. * * PUBLIC: int CDB___ham_vrfy_meta __P((DB *, VRFY_DBINFO *, HMETA *, * PUBLIC: db_pgno_t, u_int32_t)); */ int CDB___ham_vrfy_meta(dbp, vdp, m, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; HMETA *m; db_pgno_t pgno; u_int32_t flags; { HASH *hashp; VRFY_PAGEINFO *pip; int i, ret, t_ret, isbad; u_int32_t pwr, mbucket; u_int32_t (*hfunc) __P((const void *, u_int32_t)); if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); isbad = 0; hashp = dbp->h_internal; if (hashp != NULL && hashp->h_hash != NULL) hfunc = hashp->h_hash; else hfunc = CDB___ham_func5; /* * If we haven't already checked the common fields in pagezero, * check them. */ if (!F_ISSET(pip, VRFY_INCOMPLETE) && (ret = CDB___db_vrfy_meta(dbp, vdp, &m->dbmeta, pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* h_charkey */ if (!LF_ISSET(DB_NOORDERCHK)) if (m->h_charkey != hfunc(CHARKEY, sizeof(CHARKEY))) { EPRINT((dbp->dbenv, "Database has different custom hash function; reverify with DB_NOORDERCHK set" )); /* * Return immediately; this is probably a sign * of user error rather than database corruption, so * we want to avoid extraneous errors. */ isbad = 1; goto err; } /* max_bucket must be less than the last pgno. */ if (m->max_bucket > vdp->last_pgno) { EPRINT((dbp->dbenv, "Impossible max_bucket %lu on meta page %lu", m->max_bucket, pgno)); /* * Most other fields depend somehow on max_bucket, so * we just return--there will be lots of extraneous * errors. */ isbad = 1; goto err; } /* * max_bucket, high_mask and low_mask: high_mask must be one * less than the next power of two above max_bucket, and * low_mask must be one less than the power of two below it. * * */ pwr = (m->max_bucket == 0) ? 1 : 1 << CDB___db_log2(m->max_bucket + 1); if (m->high_mask != pwr - 1) { EPRINT((dbp->dbenv, "Incorrect high_mask %lu on page %lu, should be %lu", m->high_mask, pgno, pwr - 1)); isbad = 1; } pwr >>= 1; if (m->low_mask != pwr - 1) { EPRINT((dbp->dbenv, "Incorrect low_mask %lu on page %lu, should be %lu", m->low_mask, pgno, pwr - 1)); isbad = 1; } /* ffactor: no check possible. */ pip->h_ffactor = m->ffactor; /* * nelem: just make sure it's not astronomical for now. This is the * same check that hash_upgrade does, since there was a bug in 2.X * which could make nelem go "negative". */ if (m->nelem > 0x80000000) { EPRINT((dbp->dbenv, "Suspiciously high nelem of %lu on page %lu", m->nelem, pgno)); isbad = 1; pip->h_nelem = 0; } else pip->h_nelem = m->nelem; /* flags */ if (F_ISSET(&m->dbmeta, DB_HASH_DUP)) F_SET(pip, VRFY_HAS_DUPS); if (F_ISSET(&m->dbmeta, DB_HASH_DUPSORT)) F_SET(pip, VRFY_HAS_DUPSORT); /* XXX: Why is the DB_HASH_SUBDB flag necessary? */ /* spares array */ for (i = 0; m->spares[i] != 0 && i < NCACHED; i++) { /* * We set mbucket to the maximum bucket that would use a given * spares entry; we want to ensure that it's always less * than last_pgno. */ mbucket = (1 << i) - 1; if (mbucket + m->spares[CDB___db_log2(mbucket + 1)] > vdp->last_pgno) { EPRINT((dbp->dbenv, "Spares array entry %lu, page %lu is invalid", i, pgno)); isbad = 1; } } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___ham_vrfy -- * Verify hash page. * * PUBLIC: int CDB___ham_vrfy __P((DB *, VRFY_DBINFO *, PAGE *, db_pgno_t, * PUBLIC: u_int32_t)); */ int CDB___ham_vrfy(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; PAGE *h; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; db_indx_t ent, himark, inpend; int isbad, ret, t_ret; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); /* Sanity check our flags and page type. */ if ((ret = CDB___db_fchk(dbp->dbenv, "CDB___ham_vrfy", flags, DB_AGGRESSIVE | DB_NOORDERCHK | DB_SALVAGE)) != 0) goto err; if (TYPE(h) != P_HASH) { TYPE_ERR_PRINT(dbp->dbenv, "CDB___ham_vrfy", pgno, TYPE(h)); DB_ASSERT(0); ret = EINVAL; goto err; } /* Verify and save off fields common to all PAGEs. */ if ((ret = CDB___db_vrfy_datapage(dbp, vdp, h, pgno, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * Verify inp[]. Each offset from 0 to NUM_ENT(h) must be lower * than the previous one, higher than the current end of the inp array, * and lower than the page size. * * In any case, we return immediately if things are bad, as it would * be unsafe to proceed. */ for (ent = 0, himark = dbp->pgsize, inpend = (u_int8_t *)h->inp - (u_int8_t *)h; ent < NUM_ENT(h); ent++) if (h->inp[ent] >= himark) { EPRINT((dbp->dbenv, "Item %lu on page %lu out of order or nonsensical", ent, pgno)); isbad = 1; goto err; } else if (inpend >= himark) { EPRINT((dbp->dbenv, "inp array collided with data on page %lu", pgno)); isbad = 1; goto err; } else { himark = h->inp[ent]; inpend += sizeof(db_indx_t); if ((ret = __ham_vrfy_item( dbp, vdp, pgno, h, ent, flags)) != 0) goto err; } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret == 0 && isbad == 1 ? DB_VERIFY_BAD : ret); } /* * __ham_vrfy_item -- * Given a hash page and an offset, sanity-check the item itself, * and save off any overflow items or off-page dup children as necessary. */ static int __ham_vrfy_item(dbp, vdp, pgno, h, i, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; PAGE *h; u_int32_t i, flags; { HOFFPAGE hop; HOFFDUP hod; VRFY_CHILDINFO child; VRFY_PAGEINFO *pip; db_indx_t offset, len, dlen, elen; int ret, t_ret; u_int8_t *databuf; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); switch (HPAGE_TYPE(h, i)) { case H_KEYDATA: /* Nothing to do here--everything but the type field is data */ break; case H_DUPLICATE: /* Are we a datum or a key? Better be the former. */ if (i % 2 == 0) { EPRINT((dbp->dbenv, "Hash key stored as duplicate at page %lu item %lu", pip->pgno, i)); } /* * Dups are encoded as a series within a single HKEYDATA, * in which each dup is surrounded by a copy of its length * on either side (so that the series can be walked in either * direction. We loop through this series and make sure * each dup is reasonable. * * Note that at this point, we've verified item i-1, so * it's safe to use LEN_HKEYDATA (which looks at inp[i-1]). */ len = LEN_HKEYDATA(h, dbp->pgsize, i); databuf = HKEYDATA_DATA(P_ENTRY(h, i)); for (offset = 0; offset < len; offset += DUP_SIZE(dlen)) { memcpy(&dlen, databuf + offset, sizeof(db_indx_t)); /* Make sure the length is plausible. */ if (offset + DUP_SIZE(dlen) > len) { EPRINT((dbp->dbenv, "Duplicate item %lu, page %lu has bad length", i, pip->pgno)); ret = DB_VERIFY_BAD; goto err; } /* * Make sure the second copy of the length is the * same as the first. */ memcpy(&elen, databuf + offset + dlen + sizeof(db_indx_t), sizeof(db_indx_t)); if (elen != dlen) { EPRINT((dbp->dbenv, "Duplicate item %lu, page %lu has two different lengths", i, pip->pgno)); ret = DB_VERIFY_BAD; goto err; } } F_SET(pip, VRFY_HAS_DUPS); if (!LF_ISSET(DB_NOORDERCHK) && __ham_dups_unsorted(dbp, databuf, len)) F_SET(pip, VRFY_DUPS_UNSORTED); break; case H_OFFPAGE: /* Offpage item. Make sure pgno is sane, save off. */ memcpy(&hop, P_ENTRY(h, i), HOFFPAGE_SIZE); if (!IS_VALID_PGNO(hop.pgno) || hop.pgno == pip->pgno || hop.pgno == PGNO_INVALID) { EPRINT((dbp->dbenv, "Offpage item %lu, page %lu has bad page number", i, pip->pgno)); ret = DB_VERIFY_BAD; goto err; } memset(&child, 0, sizeof(VRFY_CHILDINFO)); child.pgno = hop.pgno; child.type = V_OVERFLOW; child.tlen = hop.tlen; /* This will get checked later. */ if ((ret = CDB___db_vrfy_childput(vdp, pip->pgno, &child)) != 0) goto err; break; case H_OFFDUP: /* Offpage duplicate item. Same drill. */ memcpy(&hod, P_ENTRY(h, i), HOFFDUP_SIZE); if (!IS_VALID_PGNO(hod.pgno) || hod.pgno == pip->pgno || hod.pgno == PGNO_INVALID) { EPRINT((dbp->dbenv, "Offpage item %lu, page %lu has bad page number", i, pip->pgno)); ret = DB_VERIFY_BAD; goto err; } memset(&child, 0, sizeof(VRFY_CHILDINFO)); child.pgno = hod.pgno; child.type = V_DUPLICATE; if ((ret = CDB___db_vrfy_childput(vdp, pip->pgno, &child)) != 0) goto err; F_SET(pip, VRFY_HAS_DUPS); break; default: EPRINT((dbp->dbenv, "Item %i, page %lu has bad type", i, pip->pgno)); ret = DB_VERIFY_BAD; break; } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___ham_vrfy_structure -- * Verify the structure of a hash database. * * PUBLIC: int CDB___ham_vrfy_structure __P((DB *, VRFY_DBINFO *, db_pgno_t, * PUBLIC: u_int32_t)); */ int CDB___ham_vrfy_structure(dbp, vdp, meta_pgno, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t meta_pgno; u_int32_t flags; { DB *pgset; HMETA *m; PAGE *h; VRFY_PAGEINFO *pip; int isbad, p, ret, t_ret; db_pgno_t pgno; u_int32_t bucket; ret = isbad = 0; h = NULL; pgset = vdp->pgset; if ((ret = CDB___db_vrfy_pgset_get(pgset, meta_pgno, &p)) != 0) return (ret); if (p != 0) { EPRINT((dbp->dbenv, "Hash meta page %lu referenced twice", meta_pgno)); return (DB_VERIFY_BAD); } if ((ret = CDB___db_vrfy_pgset_inc(pgset, meta_pgno)) != 0) return (ret); /* Get the meta page; we'll need it frequently. */ if ((ret = CDB_memp_fget(dbp->mpf, &meta_pgno, 0, &m)) != 0) return (ret); /* Loop through bucket by bucket. */ for (bucket = 0; bucket <= m->max_bucket; bucket++) if ((ret = __ham_vrfy_bucket(dbp, vdp, m, bucket, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } /* * There may be unused hash pages corresponding to buckets * that are part of the current doubling but which are higher * than max_bucket. Loop through them, too, and make sure they're * all empty. */ for (bucket = m->max_bucket + 1; bucket <= m->high_mask; bucket++) { pgno = bucket + m->spares[CDB___db_log2(bucket + 1)]; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) goto err; /* It's okay if these pages are totally zeroed; unmark it. */ F_CLR(pip, VRFY_IS_ALLZEROES); if (pip->type != P_HASH) { EPRINT((dbp->dbenv, "Hash bucket %lu maps to non-hash page %lu", bucket, pgno)); isbad = 1; } else if (pip->entries != 0) { EPRINT((dbp->dbenv, "Non-empty page %lu in unused hash bucket %lu", pgno, bucket)); isbad = 1; } else { if ((ret = CDB___db_vrfy_pgset_get(pgset, pgno, &p)) != 0) goto err; if (p != 0) { EPRINT((dbp->dbenv, "Hash page %lu above max_bucket referenced", pgno)); isbad = 1; } else { if ((ret = CDB___db_vrfy_pgset_inc(pgset, pgno)) != 0) goto err; if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) goto err; continue; } } /* If we got here, it's an error. */ (void)CDB___db_vrfy_putpageinfo(vdp, pip); goto err; } err: if ((t_ret = CDB_memp_fput(dbp->mpf, m, 0)) != 0) return (t_ret); if (h != NULL && (t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (t_ret); return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD: ret); } /* * __ham_vrfy_bucket -- * Verify a given bucket. */ static int __ham_vrfy_bucket(dbp, vdp, m, bucket, flags) DB *dbp; VRFY_DBINFO *vdp; HMETA *m; u_int32_t bucket, flags; { HASH *hashp; VRFY_CHILDINFO *child; VRFY_PAGEINFO *mip, *pip; int ret, t_ret, isbad, p; db_pgno_t pgno, next_pgno; DBC *cc; u_int32_t (*hfunc) __P((const void *, u_int32_t)); isbad = 0; pip = NULL; cc = NULL; hashp = dbp->h_internal; if (hashp != NULL && hashp->h_hash != NULL) hfunc = hashp->h_hash; else hfunc = CDB___ham_func5; if ((ret = CDB___db_vrfy_getpageinfo(vdp, PGNO(m), &mip)) != 0) return (ret); /* Calculate the first pgno for this bucket. */ pgno = bucket + m->spares[CDB___db_log2(bucket + 1)]; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) goto err; /* Make sure we got a plausible page number. */ if (pgno > vdp->last_pgno || pip->type != P_HASH) { EPRINT((dbp->dbenv, "Bucket %lu has impossible first page %lu", bucket, pgno)); /* Unsafe to continue. */ isbad = 1; goto err; } if (pip->prev_pgno != PGNO_INVALID) { EPRINT((dbp->dbenv, "First hash page %lu in bucket %lu has a prev_pgno", pgno)); isbad = 1; } /* * Set flags for dups and sorted dups. */ flags |= F_ISSET(mip, VRFY_HAS_DUPS) ? ST_DUPOK : 0; flags |= F_ISSET(mip, VRFY_HAS_DUPSORT) ? ST_DUPSORT : 0; /* Loop until we find a fatal bug, or until we run out of pages. */ for (;;) { if ((ret = CDB___db_vrfy_pgset_get(vdp->pgset, pgno, &p)) != 0) goto err; if (p != 0) { EPRINT((dbp->dbenv, "Hash page %lu referenced twice", pgno)); isbad = 1; /* Unsafe to continue. */ goto err; } else if ((ret = CDB___db_vrfy_pgset_inc(vdp->pgset, pgno)) != 0) goto err; /* * Hash pages that nothing has ever hashed to may never * have actually come into existence, and may appear to be * entirely zeroed. This is acceptable, and since there's * no real way for us to know whether this has actually * occurred, we clear the "wholly zeroed" flag on every * hash page. A wholly zeroed page, by nature, will appear * to have no flags set and zero entries, so should * otherwise verify correctly. */ F_CLR(pip, VRFY_IS_ALLZEROES); /* If we have dups, our meta page had better know about it. */ if (F_ISSET(pip, VRFY_HAS_DUPS) && !F_ISSET(mip, VRFY_HAS_DUPS)) { EPRINT((dbp->dbenv, "Duplicates present in non-duplicate database, page %lu", pgno)); isbad = 1; } /* * If the database has sorted dups, this page had better * not have unsorted ones. */ if (F_ISSET(mip, VRFY_HAS_DUPSORT) && F_ISSET(pip, VRFY_DUPS_UNSORTED)) { EPRINT((dbp->dbenv, "Unsorted dups in sorted-dup database, page %lu", pgno)); isbad = 1; } /* Walk overflow chains and offpage dup trees. */ if ((ret = CDB___db_vrfy_childcursor(vdp, &cc)) != 0) goto err; for (ret = CDB___db_vrfy_ccset(cc, pip->pgno, &child); ret == 0; ret = CDB___db_vrfy_ccnext(cc, &child)) if (child->type == V_OVERFLOW) { if ((ret = CDB___db_vrfy_ovfl_structure(dbp, vdp, child->pgno, child->tlen, flags)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } } else if (child->type == V_DUPLICATE) { if ((ret = CDB___db_vrfy_duptype(dbp, vdp, child->pgno, flags)) != 0) { isbad = 1; continue; } if ((ret = CDB___bam_vrfy_subtree(dbp, vdp, child->pgno, NULL, NULL, flags | ST_RECNUM, NULL, NULL, NULL)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } } if ((ret = CDB___db_vrfy_ccclose(cc)) != 0) goto err; cc = NULL; /* If it's safe to check that things hash properly, do so. */ if (isbad == 0 && !LF_ISSET(DB_NOORDERCHK) && (ret = CDB___ham_vrfy_hashing(dbp, pip->entries, m, bucket, pgno, flags, hfunc)) != 0) { if (ret == DB_VERIFY_BAD) isbad = 1; else goto err; } next_pgno = pip->next_pgno; ret = CDB___db_vrfy_putpageinfo(vdp, pip); pip = NULL; if (ret != 0) goto err; if (next_pgno == PGNO_INVALID) break; /* End of the bucket. */ /* We already checked this, but just in case... */ if (!IS_VALID_PGNO(next_pgno)) { DB_ASSERT(0); EPRINT((dbp->dbenv, "Hash page %lu has bad next_pgno", pgno)); isbad = 1; goto err; } if ((ret = CDB___db_vrfy_getpageinfo(vdp, next_pgno, &pip)) != 0) goto err; if (pip->prev_pgno != pgno) { EPRINT((dbp->dbenv, "Hash page %lu has bad prev_pgno", next_pgno)); isbad = 1; } pgno = next_pgno; } err: if (cc != NULL && ((t_ret = CDB___db_vrfy_ccclose(cc)) != 0) && ret == 0) ret = t_ret; if (mip != NULL && ((t_ret = CDB___db_vrfy_putpageinfo(vdp, mip)) != 0) && ret == 0) ret = t_ret; if (pip != NULL && ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) && ret == 0) ret = t_ret; return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___ham_vrfy_hashing -- * Verify that all items on a given hash page hash correctly. * * PUBLIC: int CDB___ham_vrfy_hashing __P((DB *, * PUBLIC: u_int32_t, HMETA *, u_int32_t, db_pgno_t, u_int32_t, * PUBLIC: u_int32_t (*) __P((const void *, u_int32_t)))); */ int CDB___ham_vrfy_hashing(dbp, nentries, m, thisbucket, pgno, flags, hfunc) DB *dbp; u_int32_t nentries; HMETA *m; u_int32_t thisbucket; db_pgno_t pgno; u_int32_t flags; u_int32_t (*hfunc) __P((const void *, u_int32_t)); { DBT dbt; PAGE *h; db_indx_t i; int ret, t_ret, isbad; u_int32_t hval, bucket; ret = isbad = 0; memset(&dbt, 0, sizeof(DBT)); F_SET(&dbt, DB_DBT_REALLOC); if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); for (i = 0; i < nentries; i += 2) { /* * We've already verified the page integrity and that of any * overflow chains linked off it; it is therefore safe to use * CDB___db_ret. It's also not all that much slower, since we have * to copy every hash item to deal with alignment anyway; we * can tweak this a bit if this proves to be a bottleneck, * but for now, take the easy route. */ if ((ret = CDB___db_ret(dbp, h, i, &dbt, NULL, NULL)) != 0) goto err; hval = hfunc(dbt.data, dbt.size); bucket = hval & m->high_mask; if (bucket > m->max_bucket) bucket = bucket & m->low_mask; if (bucket != thisbucket) { EPRINT((dbp->dbenv, "Item %lu on page %lu hashes incorrectly", i, pgno)); isbad = 1; } } err: if (dbt.data != NULL) CDB___os_free(dbt.data, 0); if ((t_ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (t_ret); return ((ret == 0 && isbad == 1) ? DB_VERIFY_BAD : ret); } /* * CDB___ham_salvage -- * Safely dump out anything that looks like a key on an alleged * hash page. * * PUBLIC: int CDB___ham_salvage __P((DB *, VRFY_DBINFO *, db_pgno_t, PAGE *, * PUBLIC: void *, int (*)(void *, const void *), u_int32_t)); */ int CDB___ham_salvage(dbp, vdp, pgno, h, handle, callback, flags) DB *dbp; VRFY_DBINFO *vdp; db_pgno_t pgno; PAGE *h; void *handle; int (*callback) __P((void *, const void *)); u_int32_t flags; { DBT dbt, unkdbt; db_pgno_t dpgno; int ret, err_ret, t_ret; u_int32_t himark, tlen; u_int8_t *hk; void *buf; db_indx_t dlen, len, i; memset(&dbt, 0, sizeof(DBT)); dbt.flags = DB_DBT_REALLOC; memset(&unkdbt, 0, sizeof(DBT)); unkdbt.size = strlen("UNKNOWN") + 1; unkdbt.data = "UNKNOWN"; err_ret = 0; /* * Allocate a buffer for overflow items. Start at one page; * CDB___db_safe_goff will realloc as needed. */ if ((ret = CDB___os_malloc(dbp->dbenv, dbp->pgsize, NULL, &buf)) != 0) return (ret); himark = dbp->pgsize; for (i = 0;; i++) { /* If we're not aggressive, break when we hit NUM_ENT(h). */ if (!LF_ISSET(DB_AGGRESSIVE) && i >= NUM_ENT(h)) break; /* Verify the current item. */ ret = CDB___db_vrfy_inpitem(dbp, h, pgno, i, 0, flags, &himark, NULL); /* If this returned a fatality, it's time to break. */ if (ret == DB_VERIFY_FATAL) break; if (ret == 0) { hk = P_ENTRY(h, i); len = LEN_HKEYDATA(h, dbp->pgsize, i); if ((u_int32_t)(hk + len - (u_int8_t *)h) > dbp->pgsize) { /* * Item is unsafely large; either continue * or set it to the whole page, depending on * aggressiveness. */ if (!LF_ISSET(DB_AGGRESSIVE)) continue; len = dbp->pgsize - (u_int32_t)(hk - (u_int8_t *)h); err_ret = DB_VERIFY_BAD; } switch (HPAGE_PTYPE(hk)) { default: if (!LF_ISSET(DB_AGGRESSIVE)) break; err_ret = DB_VERIFY_BAD; /* FALLTHROUGH */ case H_KEYDATA: keydata: memcpy(buf, HKEYDATA_DATA(hk), len); dbt.size = len; dbt.data = buf; if ((ret = CDB___db_prdbt(&dbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; case H_OFFPAGE: if (len < HOFFPAGE_SIZE) { err_ret = DB_VERIFY_BAD; continue; } memcpy(&dpgno, HOFFPAGE_PGNO(hk), sizeof(dpgno)); if ((ret = CDB___db_safe_goff(dbp, vdp, dpgno, &dbt, &buf, flags)) != 0) { err_ret = ret; (void)CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL); break; } if ((ret = CDB___db_prdbt(&dbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; break; case H_OFFDUP: if (len < HOFFPAGE_SIZE) { err_ret = DB_VERIFY_BAD; continue; } memcpy(&dpgno, HOFFPAGE_PGNO(hk), sizeof(dpgno)); /* UNKNOWN iff pgno is bad or we're a key. */ if (!IS_VALID_PGNO(dpgno) || (i % 2 == 0)) { if ((ret = CDB___db_prdbt(&unkdbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; } else if ((ret = CDB___db_salvage_duptree(dbp, vdp, dpgno, &dbt, handle, callback, flags | SA_SKIPFIRSTKEY)) != 0) err_ret = ret; break; case H_DUPLICATE: /* * We're a key; printing dups will seriously * foul the output. If we're being aggressive, * pretend this is a key and let the app. * programmer sort out the mess. */ if (i % 2 == 0) { err_ret = ret; if (LF_ISSET(DB_AGGRESSIVE)) goto keydata; break; } /* Too small to have any data. */ if (len < HKEYDATA_SIZE(2 * sizeof(db_indx_t))) { err_ret = DB_VERIFY_BAD; continue; } /* Loop until we hit the total length. */ for (tlen = 0; tlen + sizeof(db_indx_t) < len; tlen += dlen) { tlen += sizeof(db_indx_t); memcpy(&dlen, hk, sizeof(db_indx_t)); /* * If dlen is too long, print all the * rest of the dup set in a chunk. */ if (dlen + tlen > len) dlen = len - tlen; memcpy(buf, hk + tlen, dlen); dbt.size = dlen; dbt.data = buf; if ((ret = CDB___db_prdbt(&dbt, 0, " ", handle, callback, 0, NULL)) != 0) err_ret = ret; tlen += sizeof(db_indx_t); } break; } } } if ((t_ret = CDB___db_salvage_markdone(vdp, pgno)) != 0) return (t_ret); return ((ret == 0 && err_ret != 0) ? err_ret : ret); } /* * CDB___ham_meta2pgset -- * Return the set of hash pages corresponding to the given * known-good meta page. * * PUBLIC: int CDB___ham_meta2pgset __P((DB *, VRFY_DBINFO *, HMETA *, u_int32_t, * PUBLIC: DB *)); */ int CDB___ham_meta2pgset(dbp, vdp, hmeta, flags, pgset) DB *dbp; VRFY_DBINFO *vdp; HMETA *hmeta; u_int32_t flags; DB *pgset; { PAGE *h; db_pgno_t pgno; u_int32_t bucket, totpgs; int ret, val; /* * We don't really need flags, but leave them for consistency with * CDB___bam_meta2pgset. */ COMPQUIET(flags, 0); DB_ASSERT(pgset != NULL); totpgs = 0; /* * Loop through all the buckets, pushing onto pgset the corresponding * page(s) for each one. */ for (bucket = 0; bucket <= hmeta->max_bucket; bucket++) { pgno = bucket + hmeta->spares[CDB___db_log2(bucket + 1)]; /* * We know the initial pgno is safe because the spares array has * been verified. * * Safely walk the list of pages in this bucket. */ for (;;) { if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) return (ret); if (TYPE(h) == P_HASH) { /* * Make sure we don't go past the end of * pgset. */ if (++totpgs > vdp->last_pgno) { (void)CDB_memp_fput(dbp->mpf, h, 0); return (DB_VERIFY_BAD); } if ((ret = CDB___db_vrfy_pgset_inc(pgset, pgno)) != 0) return (ret); pgno = NEXT_PGNO(h); } else pgno = PGNO_INVALID; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) return (ret); /* If the new pgno is wonky, go onto the next bucket. */ if (!IS_VALID_PGNO(pgno) || pgno == PGNO_INVALID) goto nextbucket; /* * If we've touched this page before, we have a cycle; * go on to the next bucket. */ if ((ret = CDB___db_vrfy_pgset_get(pgset, pgno, &val)) != 0) return (ret); if (val != 0) goto nextbucket; } nextbucket: ; } return (0); } /* * __ham_dups_unsorted -- * Takes a known-safe hash duplicate set and its total length. * Returns 1 if there are out-of-order duplicates in this set, * 0 if there are not. */ static int __ham_dups_unsorted(dbp, buf, len) DB *dbp; u_int8_t *buf; u_int32_t len; { DBT a, b; db_indx_t offset, dlen; int (*func) __P((const DBT *, const DBT *)); memset(&a, 0, sizeof(DBT)); memset(&b, 0, sizeof(DBT)); func = (dbp->dup_compare == NULL) ? CDB___bam_defcmp : dbp->dup_compare; /* * Loop through the dup set until we hit the end or we find * a pair of dups that's out of order. b is always the current * dup, a the one before it. */ for (offset = 0; offset < len; offset += DUP_SIZE(dlen)) { memcpy(&dlen, buf + offset, sizeof(db_indx_t)); b.data = buf + offset + sizeof(db_indx_t); b.size = dlen; if (a.data != NULL && func(&a, &b) > 0) return (1); a.data = b.data; a.size = b.size; } return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/ia64.gcc���������������������������������������������������������������������������0100644�0063146�0012731�00000000755�07427026535�014212� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * $Id: ia64.gcc,v 1.2 2002/02/02 18:18:05 ghutchis Exp $ * * For gcc/ia64, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ long __r; \ asm volatile("xchg1 %0=%1,%3" : "=r"(__r), "=m"(*__l) : "1"(*__l), "r"(1));\ __r ^ 1; \ }) /* * Store through a "volatile" pointer so we get a store with "release" * semantics. */ #define MUTEX_UNSET(tsl) (*(volatile unsigned char *)(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) �������������������htdig-3.2.0b6/db/install-sh�������������������������������������������������������������������������0100755�0063146�0012731�00000015722�07723261275�014776� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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 "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : 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 : 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 : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; 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 : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # 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 :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } ����������������������������������������������htdig-3.2.0b6/db/lock.c�����������������������������������������������������������������������������0100644�0063146�0012731�00000106275�07427026535�014071� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)lock.c 11.8 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "db_am.h" #include "txn.h" static int CDB___lock_checklocker __P((DB_LOCKTAB *, struct __db_lock *, u_int32_t, u_int32_t, int *)); static int CDB___lock_get_internal __P((DB_LOCKTAB *, u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *)); static int CDB___lock_is_parent __P((DB_LOCKTAB *, u_int32_t, DB_LOCKER *)); static int CDB___lock_put_internal __P((DB_LOCKTAB *, struct __db_lock *, u_int32_t, u_int32_t)); static int CDB___lock_put_nolock __P((DB_ENV *, DB_LOCK *, int *)); static void CDB___lock_remove_waiter __P((DB_LOCKOBJ *, struct __db_lock *, db_status_t)); /* * CDB_lock_id -- * Generate a unique locker id. */ int CDB_lock_id(dbenv, idp) DB_ENV *dbenv; u_int32_t *idp; { DB_LOCKTAB *lt; DB_LOCKREGION *region; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); lt = dbenv->lk_handle; region = lt->reginfo.primary; /* * Note that we are letting locker IDs wrap. * * This is potentially dangerous in that it's conceivable that you * could be allocating a new locker id and still have someone using * it. However, the alternatives are that we keep a bitmap of * locker ids or we forbid wrapping. Both are probably bad. The * bitmap of locker ids will take up 64 MB of space. Forbidding * wrapping means that we'll run out of locker IDs after 2 billion. * In order for the wrap bug to fire, we'd need to have something * that stayed open while 2 billion locker ids were used up. Since * we cache cursors it means that something would have to stay open * sufficiently long that we open and close a lot of files and a * lot of cursors within them. Betting that this won't happen seems * to the lesser of the evils. */ LOCKREGION(dbenv, lt); if (region->id >= DB_LOCK_MAXID) region->id = 0; *idp = ++region->id; UNLOCKREGION(dbenv, lt); return (0); } /* * Vector lock routine. This function takes a set of operations * and performs them all at once. In addition, CDB_lock_vec provides * functionality for lock inheritance, releasing all locks for a * given locker (used during transaction commit/abort), releasing * all locks on a given object, and generating debugging information. */ int CDB_lock_vec(dbenv, locker, flags, list, nlist, elistp) DB_ENV *dbenv; u_int32_t locker, flags; int nlist; DB_LOCKREQ *list, **elistp; { struct __db_lock *lp, *next_lock; DB_LOCKER *sh_locker, *sh_parent; DB_LOCKOBJ *sh_obj; DB_LOCKREGION *region; DB_LOCKTAB *lt; u_int32_t lndx, ndx, pndx; int did_abort, i, ret, run_dd; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "CDB_lock_vec", flags, DB_LOCK_NOWAIT)) != 0) return (ret); lt = dbenv->lk_handle; region = lt->reginfo.primary; run_dd = 0; LOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); for (i = 0, ret = 0; i < nlist && ret == 0; i++) switch (list[i].op) { case DB_LOCK_GET: ret = CDB___lock_get_internal(dbenv->lk_handle, locker, flags, list[i].obj, list[i].mode, &list[i].lock); break; case DB_LOCK_INHERIT: /* * Get the committing locker and mark it as deleted. * This allows us to traverse the locker links without * worrying that someone else is deleting locks out * from under us. However, if the locker doesn't * exist, that just means that the child holds no * locks, so inheritance is easy! */ LOCKER_LOCK(lt, region, locker, ndx); if ((ret = CDB___lock_getlocker(lt, locker, ndx, 0, &sh_locker)) != 0 || sh_locker == NULL || F_ISSET(sh_locker, DB_LOCKER_DELETED)) { if (ret == 0 && sh_locker != NULL) ret = EACCES; LOCKER_UNLOCK(lt, ndx); break; } /* Make sure we are a child transaction. */ if (sh_locker->parent_locker == INVALID_ROFF) { ret = EINVAL; LOCKER_UNLOCK(lt, ndx); break; } sh_parent = (DB_LOCKER *) R_ADDR(<->reginfo, sh_locker->parent_locker); F_SET(sh_locker, DB_LOCKER_DELETED); LOCKER_UNLOCK(lt, ndx); /* * Now, lock the parent locker; move locks from * the committing list to the parent's list. */ LOCKER_LOCK(lt, region, sh_parent->id, pndx); if (F_ISSET(sh_parent, DB_LOCKER_DELETED)) { if (ret == 0) ret = EACCES; LOCKER_UNLOCK(lt, pndx); break; } for (lp = SH_LIST_FIRST(&sh_locker->heldby, __db_lock); lp != NULL; lp = SH_LIST_FIRST(&sh_locker->heldby, __db_lock)) { SH_LIST_REMOVE(lp, locker_links, __db_lock); SH_LIST_INSERT_HEAD(&sh_parent->heldby, lp, locker_links, __db_lock); lp->holder = sh_parent->id; } LOCKER_UNLOCK(lt, pndx); /* Now free the original locker. */ ret = CDB___lock_checklocker(lt, NULL, locker, DB_LOCK_IGNOREDEL, NULL); break; case DB_LOCK_PUT: ret = CDB___lock_put_nolock(dbenv, &list[i].lock, &run_dd); break; case DB_LOCK_PUT_ALL: /* * Get the locker and mark it as deleted. This * allows us to traverse the locker links without * worrying that someone else is deleting locks out * from under us. Since the locker may hold no * locks (i.e., you could call abort before you've * done any work), it's perfectly reasonable for there * to be no locker; this is not an error. */ LOCKER_LOCK(lt, region, locker, ndx); if ((ret = CDB___lock_getlocker(lt, locker, ndx, 0, &sh_locker)) != 0 || sh_locker == NULL || F_ISSET(sh_locker, DB_LOCKER_DELETED)) { /* * If ret is set, then we'll generate an * error. If it's not set, we have nothing * to do. */ LOCKER_UNLOCK(lt, ndx); break; } F_SET(sh_locker, DB_LOCKER_DELETED); LOCKER_UNLOCK(lt, ndx); /* Now traverse the locks, releasing each one. */ for (lp = SH_LIST_FIRST(&sh_locker->heldby, __db_lock); lp != NULL; lp = SH_LIST_FIRST(&sh_locker->heldby, __db_lock)) { SH_LIST_REMOVE(lp, locker_links, __db_lock); sh_obj = (DB_LOCKOBJ *)((u_int8_t *)lp + lp->obj); SHOBJECT_LOCK(lt, region, sh_obj, lndx); ret = CDB___lock_put_internal(lt, lp, lndx, DB_LOCK_FREE | DB_LOCK_DOALL); OBJECT_UNLOCK(lt, lndx); if (ret != 0) break; } ret = CDB___lock_checklocker(lt, NULL, locker, DB_LOCK_IGNOREDEL, NULL); break; case DB_LOCK_PUT_OBJ: /* Remove all the locks associated with an object. */ OBJECT_LOCK(lt, region, list[i].obj, ndx); if ((ret = CDB___lock_getobj(lt, list[i].obj, ndx, 0, &sh_obj)) != 0 || sh_obj == NULL) { if (ret == 0) ret = EINVAL; OBJECT_UNLOCK(lt, ndx); break; } /* * Go through both waiters and holders. Don't bother * to run promotion, because everyone is getting * released. The processes waiting will still get * awakened as their waiters are released. */ for (lp = SH_TAILQ_FIRST(&sh_obj->waiters, __db_lock); ret == 0 && lp != NULL; lp = SH_TAILQ_FIRST(&sh_obj->waiters, __db_lock)) ret = CDB___lock_put_internal(lt, lp, ndx, DB_LOCK_NOPROMOTE | DB_LOCK_DOALL); /* * On the last time around, the object will get * reclaimed by CDB___lock_put_internal, structure the * loop carefully so we do not get bitten. */ for (lp = SH_TAILQ_FIRST(&sh_obj->holders, __db_lock); ret == 0 && lp != NULL; lp = next_lock) { next_lock = SH_TAILQ_NEXT(lp, links, __db_lock); ret = CDB___lock_put_internal(lt, lp, ndx, DB_LOCK_NOPROMOTE | DB_LOCK_DOALL); } OBJECT_UNLOCK(lt, ndx); break; #ifdef DEBUG case DB_LOCK_DUMP: /* Find the locker. */ LOCKER_LOCK(lt, region, locker, ndx); if ((ret = CDB___lock_getlocker(lt, locker, ndx, 0, &sh_locker)) != 0 || sh_locker == NULL || F_ISSET(sh_locker, DB_LOCKER_DELETED)) { LOCKER_UNLOCK(lt, ndx); break; } for (lp = SH_LIST_FIRST(&sh_locker->heldby, __db_lock); lp != NULL; lp = SH_LIST_NEXT(lp, locker_links, __db_lock)) { CDB___lock_printlock(lt, lp, 1); } LOCKER_UNLOCK(lt, ndx); break; #endif default: ret = EINVAL; break; } if (ret == 0) { MEMORY_LOCK(lt); if (region->need_dd && region->detect != DB_LOCK_NORUN) { run_dd = 1; region->need_dd = 0; } MEMORY_UNLOCK(lt); } UNLOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); if (run_dd) (void)CDB_lock_detect(dbenv, 0, region->detect, &did_abort); if (ret != 0 && elistp != NULL) *elistp = &list[i - 1]; return (ret); } /* * Lock acquisition routines. There are two library interfaces: * * CDB_lock_get -- * original lock get interface that takes a locker id. * * All the work for CDB_lock_get (and for the GET option of CDB_lock_vec) is done * inside of lock_get_internal. */ int CDB_lock_get(dbenv, locker, flags, obj, lock_mode, lock) DB_ENV *dbenv; u_int32_t locker, flags; const DBT *obj; db_lockmode_t lock_mode; DB_LOCK *lock; { int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "CDB_lock_get", flags, DB_LOCK_NOWAIT | DB_LOCK_UPGRADE)) != 0) return (ret); if (lock == NULL) return (EINVAL); LOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); ret = CDB___lock_get_internal(dbenv->lk_handle, locker, flags, obj, lock_mode, lock); UNLOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); return (ret); } static int CDB___lock_get_internal(lt, locker, flags, obj, lock_mode, lock) DB_LOCKTAB *lt; u_int32_t locker, flags; const DBT *obj; db_lockmode_t lock_mode; DB_LOCK *lock; { struct __db_lock *newl, *lp; DB_ENV *dbenv; DB_LOCKER *sh_locker; DB_LOCKOBJ *sh_obj; DB_LOCKREGION *region; u_int32_t locker_ndx; int did_abort, freed, ihold, on_locker_list, no_dd, ret; no_dd = ret = 0; on_locker_list = 0; region = lt->reginfo.primary; dbenv = lt->dbenv; /* * Check that the lock mode is valid. */ if ((u_int32_t)lock_mode >= region->nmodes) { CDB___db_err(dbenv, "CDB_lock_get: invalid lock mode %lu\n", (u_long)lock_mode); return (EINVAL); } /* Allocate a new lock. Optimize for the common case of a grant. */ MEMORY_LOCK(lt); region->nrequests++; if ((newl = SH_TAILQ_FIRST(®ion->free_locks, __db_lock)) != NULL) SH_TAILQ_REMOVE(®ion->free_locks, newl, links, __db_lock); MEMORY_UNLOCK(lt); if (newl == NULL) return (ENOMEM); /* Allocate a new object. */ OBJECT_LOCK(lt, region, obj, lock->ndx); if ((ret = CDB___lock_getobj(lt, obj, lock->ndx, 1, &sh_obj)) != 0) goto err; /* Get the locker, we may need it to find our parent. */ LOCKER_LOCK(lt, region, locker, locker_ndx); if ((ret = CDB___lock_getlocker(lt, locker, locker_ndx, 1, &sh_locker)) != 0) { /* * XXX: Margo * CLEANUP the object and the lock. */ LOCKER_UNLOCK(lt, locker_ndx); OBJECT_UNLOCK(lt, lock->ndx); return (ret); } /* * Now we have a lock and an object and we need to see if we should * grant the lock. We use a FIFO ordering so we can only grant a * new lock if it does not conflict with anyone on the holders list * OR anyone on the waiters list. The reason that we don't grant if * there's a conflict is that this can lead to starvation (a writer * waiting on a popularly read item will never be granted). The * downside of this is that a waiting reader can prevent an upgrade * from reader to writer, which is not uncommon. * * There is one exception to the no-conflict rule. If a lock is held * by the requesting locker AND the new lock does not conflict with * any other holders, then we grant the lock. The most common place * this happens is when the holder has a WRITE lock and a READ lock * request comes in for the same locker. If we do not grant the read * lock, then we guarantee deadlock. * * In case of conflict, we put the new lock on the end of the waiters * list, unless we are upgrading in which case the locker goes on the * front of the list. */ ihold = 0; for (lp = SH_TAILQ_FIRST(&sh_obj->holders, __db_lock); lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) { if (locker == lp->holder || CDB___lock_is_parent(lt, lp->holder, sh_locker)) { if (lp->mode == lock_mode && lp->status == DB_LSTAT_HELD) { if (LF_ISSET(DB_LOCK_UPGRADE)) goto upgrade; /* * Lock is held, so we can increment the * reference count and return this lock. */ lp->refcount++; lock->off = R_OFFSET(<->reginfo, lp); lock->gen = lp->gen; ret = 0; LOCKER_UNLOCK(lt, locker_ndx); goto done; } else ihold = 1; } else if (CONFLICTS(lt, region, lp->mode, lock_mode)) break; } /* * Make the new lock point to the new object, initialize fields. * * This lock is not linked in anywhere, so we can muck with it * without holding any mutexes. */ newl->holder = locker; newl->refcount = 1; newl->mode = lock_mode; newl->obj = SH_PTR_TO_OFF(newl, sh_obj); newl->status = DB_LSTAT_HELD; /* * If we are upgrading, then there are two scenarios. Either * we had no conflicts, so we can do the upgrade. Or, there * is a conflict and we should wait at the HEAD of the waiters * list. */ if (LF_ISSET(DB_LOCK_UPGRADE)) { if (lp == NULL) { LOCKER_UNLOCK(lt, locker_ndx); goto upgrade; } /* There was a conflict, wait. */ SH_TAILQ_INSERT_HEAD(&sh_obj->waiters, newl, links, __db_lock); goto llist; } if (lp == NULL && !ihold) for (lp = SH_TAILQ_FIRST(&sh_obj->waiters, __db_lock); lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) { if (CONFLICTS(lt, region, lp->mode, lock_mode) && locker != lp->holder) break; } if (lp == NULL) SH_TAILQ_INSERT_TAIL(&sh_obj->holders, newl, links); else if (!(flags & DB_LOCK_NOWAIT)) SH_TAILQ_INSERT_TAIL(&sh_obj->waiters, newl, links); else { ret = DB_LOCK_NOTGRANTED; LOCKER_UNLOCK(lt, locker_ndx); goto err; } llist: /* * Now, insert the lock onto its locker's list. If the locker does * not currently hold any locks, there's no reason to run a deadlock * detector, save that information. */ on_locker_list = 1; no_dd = sh_locker->master_locker == INVALID_ROFF && SH_LIST_FIRST(&sh_locker->child_locker, __db_locker) == NULL && SH_LIST_FIRST(&sh_locker->heldby, __db_lock) == NULL; SH_LIST_INSERT_HEAD(&sh_locker->heldby, newl, locker_links, __db_lock); LOCKER_UNLOCK(lt, locker_ndx); if (lp != NULL) { /* * This is really a blocker for the thread. It should be * initized locked, so that when we try to acquire it, we * block. */ newl->status = DB_LSTAT_WAITING; MEMORY_LOCK(lt); region->nconflicts++; if (region->detect == DB_LOCK_NORUN) region->need_dd = 1; MEMORY_UNLOCK(lt); OBJECT_UNLOCK(lt, lock->ndx); UNLOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); /* * We are about to wait; before waiting, see if the deadlock * detector should be run. */ if (region->detect != DB_LOCK_NORUN && !no_dd) (void)CDB_lock_detect(dbenv, 0, region->detect, &did_abort); MUTEX_LOCK(&newl->mutex, dbenv->lockfhp); LOCKREGION(dbenv, (DB_LOCKTAB *)dbenv->lk_handle); OBJECT_LOCK_NDX(lt, lock->ndx); if (newl->status != DB_LSTAT_PENDING) { (void)CDB___lock_checklocker(lt, newl, newl->holder, 0, &freed); switch (newl->status) { case DB_LSTAT_ABORTED: on_locker_list = 0; ret = DB_LOCK_DEADLOCK; break; case DB_LSTAT_NOGRANT: ret = DB_LOCK_NOTGRANTED; break; default: ret = EINVAL; break; } goto err; } else if (LF_ISSET(DB_LOCK_UPGRADE)) { /* * The lock that was just granted got put on the * holders list. Since we're upgrading some other * lock, we've got to remove it here. */ SH_TAILQ_REMOVE( &sh_obj->holders, newl, links, __db_lock); /* * Ensure that the object is not believed to be on * the object's lists, if we're traversing by locker. */ newl->links.stqe_prev = -1; goto upgrade; } else newl->status = DB_LSTAT_HELD; } lock->off = R_OFFSET(<->reginfo, newl); lock->gen = newl->gen; OBJECT_UNLOCK(lt, lock->ndx); return (0); upgrade:/* * This was an upgrade, so return the new lock to the free list and * upgrade the mode of the original lock. */ ((struct __db_lock *)R_ADDR(<->reginfo, lock->off))->mode = lock_mode; ret = 0; /* FALLTHROUGH */ done: err: OBJECT_UNLOCK(lt, lock->ndx); newl->status = DB_LSTAT_FREE; if (on_locker_list) { LOCKER_LOCK(lt, region, locker, locker_ndx); SH_LIST_REMOVE(newl, locker_links, __db_lock); LOCKER_UNLOCK(lt, locker_ndx); } MEMORY_LOCK(lt); SH_TAILQ_INSERT_HEAD(®ion->free_locks, newl, links, __db_lock); MEMORY_UNLOCK(lt); return (ret); } /* * Lock release routines. * * The user callable one is CDB_lock_put and the three we use internally are * CDB___lock_put_nolock, CDB___lock_put_internal and CDB___lock_downgrade. */ int CDB_lock_put(dbenv, lock) DB_ENV *dbenv; DB_LOCK *lock; { DB_LOCKTAB *lt; int ret, run_dd; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); lt = dbenv->lk_handle; LOCKREGION(dbenv, lt); ret = CDB___lock_put_nolock(dbenv, lock, &run_dd); UNLOCKREGION(dbenv, lt); lock->off = LOCK_INVALID; if (ret == 0 && run_dd) (void)CDB_lock_detect(dbenv, 0, ((DB_LOCKREGION *)lt->reginfo.primary)->detect, NULL); return (ret); } static int CDB___lock_put_nolock(dbenv, lock, runp) DB_ENV *dbenv; DB_LOCK *lock; int *runp; { struct __db_lock *lockp; DB_LOCKREGION *region; DB_LOCKTAB *lt; u_int32_t locker; int ret; lt = dbenv->lk_handle; region = lt->reginfo.primary; OBJECT_LOCK_NDX(lt, lock->ndx); lockp = (struct __db_lock *)R_ADDR(<->reginfo, lock->off); if (lock->gen != lockp->gen) { OBJECT_UNLOCK(lt, lock->ndx); return(EACCES); } locker = lockp->holder; ret = CDB___lock_put_internal(lt, lockp, lock->ndx, DB_LOCK_UNLINK | DB_LOCK_FREE); OBJECT_UNLOCK(lt, lock->ndx); *runp = 0; if (ret == 0) { MEMORY_LOCK(lt); if (region->need_dd && region->detect != DB_LOCK_NORUN) { *runp = 1; region->need_dd = 0; } MEMORY_UNLOCK(lt); } return (ret); } /* * CDB___lock_downgrade -- * Used by the concurrent access product to downgrade write locks * back to iwrite locks. * * PUBLIC: int CDB___lock_downgrade __P((DB_ENV *, * PUBLIC: DB_LOCK *, db_lockmode_t, u_int32_t)); */ int CDB___lock_downgrade(dbenv, lock, new_mode, flags) DB_ENV *dbenv; DB_LOCK *lock; db_lockmode_t new_mode; u_int32_t flags; { struct __db_lock *lockp; DB_LOCKOBJ *obj; DB_LOCKREGION *region; DB_LOCKTAB *lt; int ret; COMPQUIET(flags, 0); PANIC_CHECK(dbenv); lt = dbenv->lk_handle; region = lt->reginfo.primary; LOCKREGION(dbenv, lt); OBJECT_LOCK_NDX(lt, lock->ndx); lockp = (struct __db_lock *)R_ADDR(<->reginfo, lock->off); if (lock->gen != lockp->gen) { OBJECT_UNLOCK(lt, lock->ndx); ret = EACCES; goto out; } lockp->mode = new_mode; /* Get the object associated with this lock. */ obj = (DB_LOCKOBJ *)((u_int8_t *)lockp + lockp->obj); (void)CDB___lock_promote(lt, obj); OBJECT_UNLOCK(lt, lock->ndx); MEMORY_LOCK(lt); ++region->nreleases; MEMORY_UNLOCK(lt); out: UNLOCKREGION(dbenv, lt); return (0); } static int CDB___lock_put_internal(lt, lockp, obj_ndx, flags) DB_LOCKTAB *lt; struct __db_lock *lockp; u_int32_t obj_ndx; u_int32_t flags; { DB_LOCKOBJ *sh_obj; DB_LOCKREGION *region; int no_reclaim, ret, state_changed; region = lt->reginfo.primary; no_reclaim = ret = state_changed = 0; if (!OBJ_LINKS_VALID(lockp)) { /* * Someone removed this lock while we were doing a release * by locker id. We are trying to free this lock, but it's * already been done; all we need to do is return it to the * free list. */ MEMORY_LOCK(lt); lockp->status = DB_LSTAT_FREE; SH_TAILQ_INSERT_HEAD( ®ion->free_locks, lockp, links, __db_lock); MEMORY_UNLOCK(lt); return (0); } MEMORY_LOCK(lt); if (LF_ISSET(DB_LOCK_DOALL)) region->nreleases += lockp->refcount; else region->nreleases++; MEMORY_UNLOCK(lt); if (!LF_ISSET(DB_LOCK_DOALL) && lockp->refcount > 1) { lockp->refcount--; return (0); } /* Increment generation number. */ lockp->gen++; /* Get the object associated with this lock. */ sh_obj = (DB_LOCKOBJ *)((u_int8_t *)lockp + lockp->obj); /* Remove this lock from its holders/waitlist. */ if (lockp->status != DB_LSTAT_HELD) CDB___lock_remove_waiter(sh_obj, lockp, DB_LSTAT_FREE); else { SH_TAILQ_REMOVE(&sh_obj->holders, lockp, links, __db_lock); lockp->links.stqe_prev = -1; } if (LF_ISSET(DB_LOCK_NOPROMOTE)) state_changed = 0; else state_changed = CDB___lock_promote(lt, sh_obj); if (LF_ISSET(DB_LOCK_UNLINK)) ret = CDB___lock_checklocker(lt, lockp, lockp->holder, flags, NULL); /* Check if object should be reclaimed. */ if (SH_TAILQ_FIRST(&sh_obj->holders, __db_lock) == NULL) { HASHREMOVE_EL(lt->obj_tab, obj_ndx, __db_lockobj, links, sh_obj); if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) CDB___db_shalloc_free(lt->reginfo.addr, SH_DBT_PTR(&sh_obj->lockobj)); MEMORY_LOCK(lt); SH_TAILQ_INSERT_HEAD( ®ion->free_objs, sh_obj, links, __db_lockobj); MEMORY_UNLOCK(lt); state_changed = 1; } /* Free lock. */ if (!LF_ISSET(DB_LOCK_UNLINK) && LF_ISSET(DB_LOCK_FREE)) { MEMORY_LOCK(lt); lockp->status = DB_LSTAT_FREE; SH_TAILQ_INSERT_HEAD( ®ion->free_locks, lockp, links, __db_lock); MEMORY_UNLOCK(lt); } /* * If we did not promote anyone; we need to run the deadlock * detector again. */ MEMORY_LOCK(lt); if (state_changed == 0) region->need_dd = 1; MEMORY_UNLOCK(lt); return (ret); } /* * Utility functions; listed alphabetically. */ /* * CDB___lock_checklocker -- * If a locker has no more locks, then we can free the object. * Return a boolean indicating whether we freed the object or not. * * Must be called without the locker's lock set. */ static int CDB___lock_checklocker(lt, lockp, locker, flags, freed) DB_LOCKTAB *lt; struct __db_lock *lockp; u_int32_t locker, flags; int *freed; { DB_ENV *dbenv; DB_LOCKER *sh_locker; DB_LOCKREGION *region; u_int32_t indx; int ret; dbenv = lt->dbenv; region = lt->reginfo.primary; ret = 0; if (freed != NULL) *freed = 0; LOCKER_LOCK(lt, region, locker, indx); /* If the locker's list is NULL, free up the locker. */ if ((ret = CDB___lock_getlocker(lt, locker, indx, 0, &sh_locker)) != 0 || sh_locker == NULL) { if (ret == 0) ret = EACCES; goto freelock; } if (F_ISSET(sh_locker, DB_LOCKER_DELETED)) { LF_CLR(DB_LOCK_FREE); if (!LF_ISSET(DB_LOCK_IGNOREDEL)) goto freelock; } if (LF_ISSET(DB_LOCK_UNLINK)) SH_LIST_REMOVE(lockp, locker_links, __db_lock); if (SH_LIST_FIRST(&sh_locker->heldby, __db_lock) == NULL && LOCKER_FREEABLE(sh_locker)) { CDB___lock_freelocker( lt, region, sh_locker, indx); if (freed != NULL) *freed = 1; } freelock: if (LF_ISSET(DB_LOCK_FREE)) { lockp->status = DB_LSTAT_FREE; MEMORY_LOCK(lt); SH_TAILQ_INSERT_HEAD( ®ion->free_locks, lockp, links, __db_lock); MEMORY_UNLOCK(lt); } LOCKER_UNLOCK(lt, indx); return (ret); } /* * CDB___lock_addfamilylocker * Put a locker entry in for a child transaction. * * PUBLIC: int CDB___lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t)); */ int CDB___lock_addfamilylocker(dbenv, pid, id) DB_ENV *dbenv; u_int32_t pid, id; { DB_LOCKER *lockerp, *mlockerp; DB_LOCKREGION *region; DB_LOCKTAB *lt; u_int32_t ndx; int ret; lt = dbenv->lk_handle; region = lt->reginfo.primary; LOCKREGION(dbenv, lt); /* get/create the parent locker info */ LOCKER_LOCK(lt, region, pid, ndx); if ((ret = CDB___lock_getlocker(dbenv->lk_handle, pid, ndx, 1, &mlockerp)) != 0) goto err; LOCKER_UNLOCK(lt, ndx); /* * We assume that only one thread can manipulate * a single transaction family. * Therefore the master locker cannot go away while * we manipulate it, nor can another child in the * family be created at the same time. */ LOCKER_LOCK(lt, region, id, ndx); if ((ret = CDB___lock_getlocker(dbenv->lk_handle, id, ndx, 1, &lockerp)) != 0) goto err; /* Point to our parent. */ lockerp->parent_locker = R_OFFSET(<->reginfo, mlockerp); /* See if this locker is the family master. */ if (mlockerp->master_locker == INVALID_ROFF) lockerp->master_locker = R_OFFSET(<->reginfo, mlockerp); else { lockerp->master_locker = mlockerp->master_locker; mlockerp = R_ADDR(<->reginfo, mlockerp->master_locker); } /* * Link the child at the head of the master's list. * The guess is when looking for deadlock that * the most recent child is the one thats blocked. */ SH_LIST_INSERT_HEAD( &mlockerp->child_locker, lockerp, child_link, __db_locker); err: LOCKER_UNLOCK(lt, ndx); UNLOCKREGION(dbenv, lt); return (ret); } /* * CDB___lock_freefamilylocker * Remove a locker from the hash table and its family. * * This must be called without the locker bucket locked. * * PUBLIC: int CDB___lock_freefamilylocker __P((DB_LOCKTAB *, u_int32_t)); */ int CDB___lock_freefamilylocker(lt, locker) DB_LOCKTAB *lt; u_int32_t locker; { DB_ENV *dbenv; DB_LOCKER *sh_locker; DB_LOCKREGION *region; u_int32_t indx; int ret; dbenv = lt->dbenv; region = lt->reginfo.primary; LOCKREGION(dbenv, lt); LOCKER_LOCK(lt, region, locker, indx); if ((ret = CDB___lock_getlocker(lt, locker, indx, 0, &sh_locker)) != 0 || sh_locker == NULL) { if (ret == 0) ret = EACCES; goto freelock; } if (SH_LIST_FIRST(&sh_locker->heldby, __db_lock) != NULL) { ret = EINVAL; goto freelock; } /* If this is part of a family, we must fix up its links. */ if (sh_locker->master_locker != INVALID_ROFF) SH_LIST_REMOVE(sh_locker, child_link, __db_locker); CDB___lock_freelocker(lt, region, sh_locker, indx); freelock: LOCKER_UNLOCK(lt, indx); UNLOCKREGION(dbenv, lt); return (ret); } /* * CDB___lock_freelocker * common code for deleting a locker. * * This must be called with the locker bucket locked. * * PUBLIC: void CDB___lock_freelocker __P((DB_LOCKTAB *, * PUBLIC: DB_LOCKREGION *, DB_LOCKER *, u_int32_t)); */ void CDB___lock_freelocker(lt, region, sh_locker, indx) DB_LOCKTAB *lt; DB_LOCKREGION *region; DB_LOCKER *sh_locker; u_int32_t indx; { HASHREMOVE_EL( lt->locker_tab, indx, __db_locker, links, sh_locker); MEMORY_LOCK(lt); SH_TAILQ_INSERT_HEAD( ®ion->free_lockers, sh_locker, links, __db_locker); region->nlockers--; MEMORY_UNLOCK(lt); } /* * CDB___lock_getlocker -- * Get a locker in the locker hash table. The create parameter * indicates if the locker should be created if it doesn't exist in * the table. * * This must be called with the locker bucket locked. * * PUBLIC: int CDB___lock_getlocker __P((DB_LOCKTAB *, * PUBLIC: u_int32_t, u_int32_t, int, DB_LOCKER **)); */ int CDB___lock_getlocker(lt, locker, indx, create, retp) DB_LOCKTAB *lt; u_int32_t locker, indx; int create; DB_LOCKER **retp; { DB_ENV *dbenv; DB_LOCKER *sh_locker; DB_LOCKREGION *region; dbenv = lt->dbenv; region = lt->reginfo.primary; HASHLOOKUP(lt->locker_tab, indx, __db_locker, links, locker, sh_locker, CDB___lock_locker_cmp); /* * If we found the locker, then we can just return it. If * we didn't find the locker, then we need to create it. */ if (sh_locker == NULL && create) { /* Create new locker and then insert it into hash table. */ MEMORY_LOCK(lt); if ((sh_locker = SH_TAILQ_FIRST( ®ion->free_lockers, __db_locker)) == NULL) { MEMORY_UNLOCK(lt); return (ENOMEM); } SH_TAILQ_REMOVE( ®ion->free_lockers, sh_locker, links, __db_locker); if (++region->nlockers > region->maxnlockers) region->maxnlockers = region->nlockers; MEMORY_UNLOCK(lt); sh_locker->id = locker; sh_locker->dd_id = 0; sh_locker->master_locker = INVALID_ROFF; sh_locker->parent_locker = INVALID_ROFF; SH_LIST_INIT(&sh_locker->child_locker); sh_locker->flags = 0; SH_LIST_INIT(&sh_locker->heldby); HASHINSERT(lt->locker_tab, indx, __db_locker, links, sh_locker); } *retp = sh_locker; return (0); } /* * CDB___lock_getobj -- * Get an object in the object hash table. The create parameter * indicates if the object should be created if it doesn't exist in * the table. * * This must be called with the object bucket locked. * * PUBLIC: int CDB___lock_getobj __P((DB_LOCKTAB *, * PUBLIC: const DBT *, u_int32_t, int, DB_LOCKOBJ **)); */ int CDB___lock_getobj(lt, obj, ndx, create, retp) DB_LOCKTAB *lt; const DBT *obj; u_int32_t ndx; int create; DB_LOCKOBJ **retp; { DB_ENV *dbenv; DB_LOCKOBJ *sh_obj; DB_LOCKREGION *region; int ret; void *p; dbenv = lt->dbenv; region = lt->reginfo.primary; /* Look up the object in the hash table. */ HASHLOOKUP(lt->obj_tab, ndx, __db_lockobj, links, obj, sh_obj, CDB___lock_cmp); /* * If we found the object, then we can just return it. If * we didn't find the object, then we need to create it. */ if (sh_obj == NULL && create) { /* Create new object and then insert it into hash table. */ MEMORY_LOCK(lt); if ((sh_obj = SH_TAILQ_FIRST(®ion->free_objs, __db_lockobj)) == NULL) goto err; /* * If we can fit this object in the structure, do so instead * of shalloc-ing space for it. */ if (obj->size <= sizeof(sh_obj->objdata)) p = sh_obj->objdata; else if ((ret = CDB___db_shalloc( lt->reginfo.addr, obj->size, 0, &p)) != 0) goto err; memcpy(p, obj->data, obj->size); SH_TAILQ_REMOVE( ®ion->free_objs, sh_obj, links, __db_lockobj); MEMORY_UNLOCK(lt); SH_TAILQ_INIT(&sh_obj->waiters); SH_TAILQ_INIT(&sh_obj->holders); sh_obj->lockobj.size = obj->size; sh_obj->lockobj.off = SH_PTR_TO_OFF(&sh_obj->lockobj, p); HASHINSERT(lt->obj_tab, ndx, __db_lockobj, links, sh_obj); } *retp = sh_obj; return (0); err: MEMORY_UNLOCK(lt); return (ENOMEM); } /* * CDB___lock_is_parent -- * Given a locker and a transaction, return 1 if the locker is * an ancestor of the designcated transaction. This is used to determine * if we should grant locks that appear to conflict, but don't because * the lock is already held by an ancestor. */ static int CDB___lock_is_parent(lt, locker, sh_locker) DB_LOCKTAB *lt; u_int32_t locker; DB_LOCKER *sh_locker; { DB_LOCKER *parent; parent = sh_locker; while (parent->parent_locker != INVALID_ROFF) { parent = (DB_LOCKER *) R_ADDR(<->reginfo, parent->parent_locker); if (parent->id == locker) return (1); } return (0); } /* * CDB___lock_promote -- * * Look through the waiters and holders lists and decide which (if any) * locks can be promoted. Promote any that are eligible. * * This function must be called with the object bucket locked. * * PUBLIC: int CDB___lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *)); */ int CDB___lock_promote(lt, obj) DB_LOCKTAB *lt; DB_LOCKOBJ *obj; { struct __db_lock *lp_w, *lp_h, *next_waiter; DB_LOCKREGION *region; int state_changed, waiter_is_txn; region = lt->reginfo.primary; /* * We need to do lock promotion. We also need to determine if we're * going to need to run the deadlock detector again. If we release * locks, and there are waiters, but no one gets promoted, then we * haven't fundamentally changed the lockmgr state, so we may still * have a deadlock and we have to run again. However, if there were * no waiters, or we actually promoted someone, then we are OK and we * don't have to run it immediately. * * During promotion, we look for state changes so we can return this * information to the caller. */ for (lp_w = SH_TAILQ_FIRST(&obj->waiters, __db_lock), state_changed = lp_w == NULL; lp_w != NULL; lp_w = next_waiter) { waiter_is_txn = TXN_IS_HOLDING(lp_w); next_waiter = SH_TAILQ_NEXT(lp_w, links, __db_lock); for (lp_h = SH_TAILQ_FIRST(&obj->holders, __db_lock); lp_h != NULL; lp_h = SH_TAILQ_NEXT(lp_h, links, __db_lock)) { if (CONFLICTS(lt, region, lp_h->mode, lp_w->mode) && lp_h->holder != lp_w->holder && !(waiter_is_txn && TXN_IS_HOLDING(lp_h) && CDB___txn_is_ancestor( lt->dbenv, lp_h->txnoff, lp_w->txnoff))) break; } if (lp_h != NULL) /* Found a conflict. */ break; /* No conflict, promote the waiting lock. */ SH_TAILQ_REMOVE(&obj->waiters, lp_w, links, __db_lock); lp_w->status = DB_LSTAT_PENDING; SH_TAILQ_INSERT_TAIL(&obj->holders, lp_w, links); /* Wake up waiter. */ MUTEX_UNLOCK(&lp_w->mutex); state_changed = 1; } return (state_changed); } /* * CDB___lock_remove_waiter -- * Any lock on the waitlist has a process waiting for it. Therefore, * we can't return the lock to the freelist immediately. Instead, we can * remove the lock from the list of waiters, set the status field of the * lock, and then let the process waking up return the lock to the * free list. * * This must be called with the Object bucket locked. */ static void CDB___lock_remove_waiter(sh_obj, lockp, status) DB_LOCKOBJ *sh_obj; struct __db_lock *lockp; db_status_t status; { int do_wakeup; do_wakeup = lockp->status == DB_LSTAT_WAITING; SH_TAILQ_REMOVE(&sh_obj->waiters, lockp, links, __db_lock); lockp->links.stqe_prev = -1; lockp->status = status; /* * Wake whoever is waiting on this lock. * * The MUTEX_UNLOCK macro normally resolves to a single argument, * keep the compiler quiet. */ if (do_wakeup) MUTEX_UNLOCK(&lockp->mutex); } /* * CDB___lock_printlock -- * * PUBLIC: void CDB___lock_printlock __P((DB_LOCKTAB *, struct __db_lock *, int)); */ void CDB___lock_printlock(lt, lp, ispgno) DB_LOCKTAB *lt; struct __db_lock *lp; int ispgno; { DB_LOCKOBJ *lockobj; db_pgno_t pgno; u_int32_t *fidp; u_int8_t *ptr, type; const char *mode, *status; switch (lp->mode) { case DB_LOCK_IREAD: mode = "IREAD"; break; case DB_LOCK_IWR: mode = "IWR"; break; case DB_LOCK_IWRITE: mode = "IWRITE"; break; case DB_LOCK_NG: mode = "NG"; break; case DB_LOCK_READ: mode = "READ"; break; case DB_LOCK_WRITE: mode = "WRITE"; break; default: mode = "UNKNOWN"; break; } switch (lp->status) { case DB_LSTAT_ABORTED: status = "ABORT"; break; case DB_LSTAT_ERR: status = "ERROR"; break; case DB_LSTAT_FREE: status = "FREE"; break; case DB_LSTAT_HELD: status = "HELD"; break; case DB_LSTAT_NOGRANT: status = "NONE"; break; case DB_LSTAT_WAITING: status = "WAIT"; break; case DB_LSTAT_PENDING: status = "PENDING"; break; default: status = "UNKNOWN"; break; } printf("\t%lx\t%s\t%lu\t%s\t", (u_long)lp->holder, mode, (u_long)lp->refcount, status); lockobj = (DB_LOCKOBJ *)((u_int8_t *)lp + lp->obj); ptr = SH_DBT_PTR(&lockobj->lockobj); if (ispgno && lockobj->lockobj.size == sizeof(struct __db_ilock)) { /* Assume this is a DBT lock. */ memcpy(&pgno, ptr, sizeof(db_pgno_t)); fidp = (u_int32_t *)(ptr + sizeof(db_pgno_t)); type = *(u_int8_t *)(ptr + sizeof(db_pgno_t) + DB_FILE_ID_LEN); printf("%s %lu (%lu %lu %lu %lu %lu)\n", type == DB_PAGE_LOCK ? "page" : "record", (u_long)pgno, (u_long)fidp[0], (u_long)fidp[1], (u_long)fidp[2], (u_long)fidp[3], (u_long)fidp[4]); } else { printf("0x%lx ", (u_long)R_OFFSET(<->reginfo, lockobj)); CDB___db_pr(ptr, lockobj->lockobj.size); printf("\n"); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock.h�����������������������������������������������������������������������������0100644�0063146�0012731�00000021126�07427026535�014065� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)lock.h 11.5 (Sleepycat) 10/27/99 */ #ifndef DB_LOCK_DEFAULT_N #define DB_LOCK_DEFAULT_N 1000 /* Default # of locks in region. */ #endif /* * Out of band value for a lock. Locks contain an offset into a lock region, * so we use an invalid region offset to indicate an invalid or unset lock. */ #define LOCK_INVALID INVALID_ROFF /* * The locker id space is divided between the transaction manager and the lock * manager. Lock IDs start at 0 and go to DB_LOCK_MAXID. Txn IDs start at * DB_LOCK_MAXID + 1 and go up to TXN_INVALID. */ #define DB_LOCK_MAXID 0x7fffffff /* * DB_LOCKREGION -- * The lock shared region. */ typedef struct __db_lockregion { u_int32_t id; /* unique id generator */ u_int32_t need_dd; /* flag for deadlock detector */ u_int32_t detect; /* run dd on every conflict */ /* free lock header */ SH_TAILQ_HEAD(__flock) free_locks; /* free obj header */ SH_TAILQ_HEAD(__fobj) free_objs; /* free locker header */ SH_TAILQ_HEAD(__flocker) free_lockers; u_int32_t maxlocks; /* maximum number of locks in table */ u_int32_t table_size; /* size of hash table */ u_int32_t nmodes; /* number of lock modes */ u_int32_t nlockers; /* number of lockers */ u_int32_t maxnlockers; /* maximum number of lockers */ roff_t memlock_off; /* offset of memory mutex */ roff_t conf_off; /* offset of conflicts array */ roff_t obj_off; /* offset of object hash table */ roff_t osynch_off; /* offset of the object mutex table */ roff_t locker_off; /* offset of locker hash table */ roff_t lsynch_off; /* offset of the locker mutex table */ u_int32_t nconflicts; /* number of lock conflicts */ u_int32_t nrequests; /* number of lock gets */ u_int32_t nreleases; /* number of lock puts */ u_int32_t ndeadlocks; /* number of deadlocks */ } DB_LOCKREGION; /* * Since we will store DBTs in shared memory, we need the equivalent of a * DBT that will work in shared memory. */ typedef struct __sh_dbt { u_int32_t size; /* Byte length. */ ssize_t off; /* Region offset. */ } SH_DBT; #define SH_DBT_PTR(p) ((void *)(((u_int8_t *)(p)) + (p)->off)) /* * Object structures; these live in the object hash table. */ typedef struct __db_lockobj { SH_DBT lockobj; /* Identifies object locked. */ SH_TAILQ_ENTRY links; /* Links for free list. */ SH_TAILQ_HEAD(__wait) waiters; /* List of waiting locks. */ SH_TAILQ_HEAD(__hold) holders; /* List of held locks. */ /* Declare room in the object to hold * typical DB lock structures so that * we do not have to allocate them from * shalloc at run-time. */ u_int8_t objdata[sizeof(struct __db_ilock)]; } DB_LOCKOBJ; /* * Locker structures; these live in the locker hash table. */ typedef struct __db_locker { u_int32_t id; /* Locker id. */ u_int32_t dd_id; /* Deadlock detector id. */ size_t master_locker; /* Locker of master transaction. */ size_t parent_locker; /* Parent of this child. */ SH_LIST_HEAD(_child) child_locker; /* List of descendant txns; only used in a "master" txn. */ SH_LIST_ENTRY child_link; /* Links transactions in the family; elements of the child_locker list. */ SH_TAILQ_ENTRY links; /* Links for free list. */ SH_LIST_HEAD(_held) heldby; /* Locks held by this locker. */ #define DB_LOCKER_DELETED 0x0001 u_int32_t flags; } DB_LOCKER; /* * Lockers can be freed if they are not poart of a transaction * family. Members of a family either point at the master * transaction or are the master transaction and have * children lockers. */ #define LOCKER_FREEABLE(lp) ((lp)->master_locker \ == TXN_INVALID_ID && \ SH_LIST_FIRST(&(lp)->child_locker, __db_locker) \ == NULL) /* * DB_LOCKTAB -- * The primary library lock data structure (i.e., the one referenced * by the environment, as opposed to the internal one laid out in the region.) */ typedef struct __db_locktab { DB_ENV *dbenv; /* Environment. */ REGINFO reginfo; /* Region information. */ MUTEX *memlock; /* Mutex to protect memory alloc. */ u_int8_t *conflicts; /* Pointer to conflict matrix. */ DB_HASHTAB *obj_tab; /* Beginning of object hash table. */ MUTEX *osynch_tab; /* Object mutex table. */ DB_HASHTAB *locker_tab; /* Beginning of locker hash table. */ MUTEX *lsynch_tab; /* Locker mutex table. */ } DB_LOCKTAB; /* Test for conflicts. */ #define CONFLICTS(T, R, HELD, WANTED) \ (T)->conflicts[(HELD) * (R)->nmodes + (WANTED)] #define OBJ_LINKS_VALID(L) ((L)->links.stqe_prev != -1) struct __db_lock { /* * Wait on mutex to wait on lock. You reference your own mutex with * ID 0 and others reference your mutex with ID 1. */ MUTEX mutex; u_int32_t holder; /* Who holds this lock. */ u_int32_t gen; /* Generation count. */ SH_TAILQ_ENTRY links; /* Free or holder/waiter list. */ SH_LIST_ENTRY locker_links; /* List of locks held by a locker. */ u_int32_t refcount; /* Reference count the lock. */ db_lockmode_t mode; /* What sort of lock. */ ssize_t obj; /* Relative offset of object struct. */ roff_t txnoff; /* Offset of holding transaction. */ db_status_t status; /* Status of this lock. */ }; /* * This is a serious layering violation. To support nested transactions, we * need to be able to tell that a lock is held by a transaction (as opposed to * some other locker) and to be able to traverse the parent/descendent chain. * In order to do this, each lock held by a transaction maintains a reference * to the shared memory transaction structure so it can be accessed during lock * promotion. As the structure is in shared memory, we cannot store a pointer * to it, so we use the offset within the region. An invalid region offset is * used to indicate that there is no transaction associated with the current * lock. */ #define TXN_IS_HOLDING(L) ((L)->txnoff != INVALID_ROFF) /* * Flag values for CDB___lock_put_internal: * DB_LOCK_DOALL: Unlock all references in this lock (instead of only 1). * DB_LOCK_FREE: Free the lock (used in checklocker). * DB_LOCK_IGNOREDEL: Remove from the locker hash table even if already deleted (used in checklocker). * DB_LOCK_NOPROMOTE: Don't bother running promotion when releasing locks * (used by CDB___lock_put_internal). * DB_LOCK_UNLINK: Remove from the locker links (used in checklocker). */ #define DB_LOCK_DOALL 0x001 #define DB_LOCK_FREE 0x002 #define DB_LOCK_IGNOREDEL 0x004 #define DB_LOCK_NOPROMOTE 0x008 #define DB_LOCK_UNLINK 0x010 /* * Macros to get/release different types of mutexes. */ #define OBJECT_LOOKUP(lt, ndx, dbt, sh_obj) \ HASHLOOKUP((lt)->objtab, \ ndx, __db_lockobj, links, dbt, sh_obj, CDB___lock_cmp); #ifdef FINE_GRAIN #define OBJECT_LOCK_NDX(lt, ndx) \ MUTEX_LOCK(&(lt)->osynch_tab[ndx], (lt)->dbenv->lockfhp) #define OBJECT_LOCK(lt, reg, obj, ndx) \ HASHACCESS((lt)->osynch_tab, obj, \ (reg)->table_size, CDB___lock_ohash, ndx, (lt)->dbenv->lockfhp) #define SHOBJECT_LOCK(lt, reg, shobj, ndx) \ HASHACCESS((lt)->osynch_tab, shobj, \ (reg)->table_size, CDB___lock_lhash, ndx, (lt)->dbenv->lockfhp) #define OBJECT_UNLOCK(lt, ndx) \ MUTEX_UNLOCK(&(lt)->osynch_tab[ndx]) #else #define OBJECT_LOCK_NDX(lt, ndx) #define OBJECT_LOCK(lt, reg, obj, ndx) \ ndx = CDB___lock_ohash(obj) % (reg)->table_size #define SHOBJECT_LOCK(lt, reg, shobj, ndx) \ ndx = CDB___lock_lhash(shobj) % (reg)->table_size #define OBJECT_UNLOCK(lt, ndx) #endif #define LOCKER_LOOKUP(lt, ndx, locker, sh_locker) \ HASHLOOKUP((lt)->lockertab, \ ndx, __db_locker, links, locker, sh_locker, CDB___lock_locker_cmp); #ifdef FINE_GRAIN #define LOCKER_LOCK_NDX(lt, ndx) \ MUTEX_LOCK(&(lt)->lsynch_tab[ndx], (lt)->dbenv->lockfhp) #define LOCKER_LOCK(lt, reg, locker, ndx) \ HASHACCESS((lt)->lsynch_tab, locker, \ reg->table_size, CDB___lock_locker_hash, ndx, (lt)->dbenv->lockfhp) #define LOCKER_UNLOCK(lt, ndx) \ MUTEX_UNLOCK(&(lt)->lsynch_tab[ndx]) #define MEMORY_LOCK(lt) \ MUTEX_LOCK((lt)->memlock, (lt)->dbenv->lockfhp) #define MEMORY_UNLOCK(lt) \ MUTEX_UNLOCK((lt)->memlock) #else #define LOCKER_LOCK_NDX(lt, ndx) #define LOCKER_LOCK(lt, reg, locker, ndx) \ ndx = CDB___lock_locker_hash(locker) % (reg)->table_size #define LOCKER_UNLOCK(lt, ndx) #define MEMORY_LOCK(lt) #define MEMORY_UNLOCK(lt) #endif #ifdef FINE_GRAIN #define LOCKREGION(dbenv, lt) #define UNLOCKREGION(dbenv, lt) #else #define LOCKREGION(dbenv, lt) R_LOCK((dbenv), &(lt)->reginfo) #define UNLOCKREGION(dbenv, lt) R_UNLOCK((dbenv), &(lt)->reginfo) #endif #include "lock_ext.h" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock_conflict.c��������������������������������������������������������������������0100644�0063146�0012731�00000001563�07427026535�015744� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)lock_conflict.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" /* * The conflict arrays are set up such that the row is the lock you * are holding and the column is the lock that is desired. */ const u_int8_t CDB_db_rw_conflicts[] = { /* N R W */ /* N */ 0, 0, 0, /* R */ 0, 0, 1, /* W */ 0, 1, 1 }; const u_int8_t CDB_db_riw_conflicts[] = { /* N S X IX IS SIX */ /* N */ 0, 0, 0, 0, 0, 0, /* S */ 0, 0, 1, 1, 0, 1, /* X */ 1, 1, 1, 1, 1, 1, /* IX */ 0, 1, 1, 0, 0, 0, /* IS */ 0, 0, 1, 0, 0, 0, /* SIX */ 0, 1, 1, 0, 0, 0 }; ���������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock_deadlock.c��������������������������������������������������������������������0100644�0063146�0012731�00000037377�07427026535�015725� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)lock_deadlock.c 11.7 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "lock.h" #include "txn.h" #define ISSET_MAP(M, N) ((M)[(N) / 32] & (1 << (N) % 32)) #define CLEAR_MAP(M, N) { \ u_int32_t __i; \ for (__i = 0; __i < (N); __i++) \ (M)[__i] = 0; \ } #define SET_MAP(M, B) ((M)[(B) / 32] |= (1 << ((B) % 32))) #define CLR_MAP(M, B) ((M)[(B) / 32] &= ~(1 << ((B) % 32))) #define OR_MAP(D, S, N) { \ u_int32_t __i; \ for (__i = 0; __i < (N); __i++) \ D[__i] |= S[__i]; \ } #define BAD_KILLID 0xffffffff typedef struct { int valid; u_int32_t id; u_int32_t last_lock; u_int32_t last_locker_id; db_pgno_t pgno; } locker_info; static int CDB___dd_abort __P((DB_ENV *, locker_info *)); static int CDB___dd_build __P((DB_ENV *, u_int32_t **, u_int32_t *, locker_info **)); static int CDB___dd_find __P((u_int32_t *, locker_info *, u_int32_t, u_int32_t ***)); #ifdef DIAGNOSTIC static void __dd_debug __P((DB_ENV *, locker_info *, u_int32_t *, u_int32_t)); #endif int CDB_lock_detect(dbenv, flags, atype, abortp) DB_ENV *dbenv; u_int32_t flags, atype; int *abortp; { DB_LOCKREGION *region; DB_LOCKTAB *lt; locker_info *idmap; u_int32_t *bitmap, **deadp, **free_me, i, killid, nentries, nlockers; int do_pass, ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); lt = dbenv->lk_handle; if (abortp != NULL) *abortp = 0; /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "CDB_lock_detect", flags, DB_LOCK_CONFLICT)) != 0) return (ret); /* Check if a detector run is necessary. */ LOCKREGION(dbenv, lt); if (LF_ISSET(DB_LOCK_CONFLICT)) { /* Make a pass every time a lock waits. */ MEMORY_LOCK(lt); region = lt->reginfo.primary; do_pass = region->need_dd != 0; MEMORY_UNLOCK(lt); if (!do_pass) { UNLOCKREGION(dbenv, lt); return (0); } } /* Build the waits-for bitmap. */ ret = CDB___dd_build(dbenv, &bitmap, &nlockers, &idmap); UNLOCKREGION(dbenv, lt); if (ret != 0) return (ret); if (nlockers == 0) return (0); #ifdef DIAGNOSTIC if (FLD_ISSET(dbenv->verbose, DB_VERB_WAITSFOR)) __dd_debug(dbenv, idmap, bitmap, nlockers); #endif /* Find a deadlock. */ if ((ret = CDB___dd_find(bitmap, idmap, nlockers, &deadp)) != 0) return (ret); nentries = ALIGN(nlockers, 32) / 32; killid = BAD_KILLID; free_me = deadp; for (; *deadp != NULL; deadp++) { if (abortp != NULL) ++*abortp; switch (atype) { /* Kill someone. */ case DB_LOCK_OLDEST: /* * Find the first bit set in the current * array and then look for a lower tid in * the array. */ for (i = 0; i < nlockers; i++) if (ISSET_MAP(*deadp, i)) { killid = i; break; } /* * It's conceivable that under XA, the locker could * have gone away. */ if (killid == BAD_KILLID) break; /* * The oldest transaction has the lowest * transaction id. */ for (i = killid + 1; i < nlockers; i++) if (ISSET_MAP(*deadp, i) && idmap[i].id < idmap[killid].id) killid = i; break; case DB_LOCK_DEFAULT: case DB_LOCK_RANDOM: /* * We are trying to calculate the id of the * locker whose entry is indicated by deadlock. */ killid = (*deadp - bitmap) / nentries; break; case DB_LOCK_YOUNGEST: /* * Find the first bit set in the current * array and then look for a lower tid in * the array. */ for (i = 0; i < nlockers; i++) if (ISSET_MAP(*deadp, i)) { killid = i; break; } /* * It's conceivable that under XA, the locker could * have gone away. */ if (killid == BAD_KILLID) break; /* * The youngest transaction has the highest * transaction id. */ for (i = killid + 1; i < nlockers; i++) if (ISSET_MAP(*deadp, i) && idmap[i].id > idmap[killid].id) killid = i; break; default: killid = BAD_KILLID; ret = EINVAL; } if (killid == BAD_KILLID) continue; /* Kill the locker with lockid idmap[killid]. */ if ((ret = CDB___dd_abort(dbenv, &idmap[killid])) != 0) { /* * It's possible that the lock was already aborted; * this isn't necessarily a problem, so do not treat * it as an error. */ if (ret == EINVAL) ret = 0; else CDB___db_err(dbenv, "warning: unable to abort locker %lx", (u_long)idmap[killid].id); } else if (FLD_ISSET(dbenv->verbose, DB_VERB_DEADLOCK)) CDB___db_err(dbenv, "Aborting locker %lx", (u_long)idmap[killid].id); } CDB___os_free(free_me, 0); CDB___os_free(bitmap, 0); CDB___os_free(idmap, 0); return (ret); } /* * ======================================================================== * Utilities */ # define DD_INVALID_ID ((u_int32_t) -1) static int CDB___dd_build(dbenv, bmp, nlockers, idmap) DB_ENV *dbenv; u_int32_t **bmp, *nlockers; locker_info **idmap; { struct __db_lock *lp; DB_LOCKER *lip, *lockerp, *child; DB_LOCKOBJ *op, *lo; DB_LOCKREGION *region; DB_LOCKTAB *lt; locker_info *id_array; u_int32_t *bitmap, count, dd, *entryp, i, id, ndx, nentries, *tmpmap; u_int8_t *pptr; int is_first, ret; lt = dbenv->lk_handle; region = lt->reginfo.primary; /* * We'll check how many lockers there are, add a few more in for * good measure and then allocate all the structures. Then we'll * verify that we have enough room when we go back in and get the * mutex the second time. */ MEMORY_LOCK(lt); retry: count = region->nlockers; region->need_dd = 0; MEMORY_UNLOCK(lt); if (count == 0) { *nlockers = 0; return (0); } if (FLD_ISSET(dbenv->verbose, DB_VERB_DEADLOCK)) CDB___db_err(dbenv, "%lu lockers", (u_long)count); count += 40; nentries = ALIGN(count, 32) / 32; /* * Allocate enough space for a count by count bitmap matrix. * * XXX * We can probably save the malloc's between iterations just * reallocing if necessary because count grew by too much. */ if ((ret = CDB___os_calloc((size_t)count, sizeof(u_int32_t) * nentries, &bitmap)) != 0) return (ret); if ((ret = CDB___os_calloc(sizeof(u_int32_t), nentries, &tmpmap)) != 0) { CDB___os_free(bitmap, sizeof(u_int32_t) * nentries); return (ret); } if ((ret = CDB___os_calloc((size_t)count, sizeof(locker_info), &id_array)) != 0) { CDB___os_free(bitmap, count * sizeof(u_int32_t) * nentries); CDB___os_free(tmpmap, sizeof(u_int32_t) * nentries); return (ret); } /* * Now go back in and actually fill in the matrix. */ MEMORY_LOCK(lt); if (region->nlockers > count) { CDB___os_free(bitmap, count * sizeof(u_int32_t) * nentries); CDB___os_free(tmpmap, sizeof(u_int32_t) * nentries); CDB___os_free(id_array, count * sizeof(locker_info)); goto retry; } MEMORY_UNLOCK(lt); /* * First we go through and assign each locker a deadlock detector id. */ for (id = 0, i = 0; i < region->table_size; i++) { LOCKER_LOCK_NDX(lt, i); for (lip = SH_TAILQ_FIRST(<->locker_tab[i], __db_locker); lip != NULL; lip = SH_TAILQ_NEXT(lip, links, __db_locker)) if (lip->master_locker == INVALID_ROFF) { lip->dd_id = id++; id_array[lip->dd_id].id = lip->id; } else lip->dd_id = DD_INVALID_ID; LOCKER_UNLOCK(lt, i); } /* * We go through the hash table and find each object. For each object, * we traverse the waiters list and add an entry in the waitsfor matrix * for each waiter/holder combination. We acquire the hash bucket * locks as we go and then release them all at the end. */ for (i = 0; i < region->table_size; i++) { OBJECT_LOCK_NDX(lt, i); for (op = SH_TAILQ_FIRST(<->obj_tab[i], __db_lockobj); op != NULL; op = SH_TAILQ_NEXT(op, links, __db_lockobj)) { CLEAR_MAP(tmpmap, nentries); /* * First we go through and create a bit map that * represents all the holders of this object. */ for (lp = SH_TAILQ_FIRST(&op->holders, __db_lock); lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) { LOCKER_LOCK(lt, region, lp->holder, ndx); if ((ret = CDB___lock_getlocker(lt, lp->holder, ndx, 0, &lockerp)) != 0) { LOCKER_UNLOCK(lt, ndx); continue; } if (lockerp->dd_id == DD_INVALID_ID) dd = ((DB_LOCKER *) R_ADDR(<->reginfo, lockerp->master_locker))->dd_id; else dd = lockerp->dd_id; id_array[dd].valid = 1; /* * If the holder has already been aborted, then * we should ignore it for now. */ if (lp->status == DB_LSTAT_HELD) SET_MAP(tmpmap, dd); LOCKER_UNLOCK(lt, ndx); } /* * Next, for each waiter, we set its row in the matrix * equal to the map of holders we set up above. */ for (is_first = 1, lp = SH_TAILQ_FIRST(&op->waiters, __db_lock); lp != NULL; is_first = 0, lp = SH_TAILQ_NEXT(lp, links, __db_lock)) { LOCKER_LOCK(lt, region, lp->holder, ndx); if ((ret = CDB___lock_getlocker(lt, lp->holder, ndx, 0, &lockerp)) != 0) { LOCKER_UNLOCK(lt, ndx); continue; } if (lockerp->dd_id == DD_INVALID_ID) dd = ((DB_LOCKER *) R_ADDR(<->reginfo, lockerp->master_locker))->dd_id; else dd = lockerp->dd_id; id_array[dd].valid = 1; LOCKER_UNLOCK(lt, ndx); /* * If the transaction is pending abortion, then * ignore it on this iteration. */ if (lp->status != DB_LSTAT_WAITING) continue; entryp = bitmap + (nentries * dd); OR_MAP(entryp, tmpmap, nentries); /* * If this is the first waiter on the queue, * then we remove the waitsfor relationship * with oneself. However, if it's anywhere * else on the queue, then we have to keep * it and we have an automatic deadlock. */ if (is_first) CLR_MAP(entryp, dd); } } } /* * We now have a snapshot of the entire lock table. Release the * object mutexes. */ for (i = 0; i < region->table_size; i++) OBJECT_UNLOCK(lt, i); /* Now for each locker; record its last lock. */ for (id = 0; id < count; id++) { if (!id_array[id].valid) continue; LOCKER_LOCK(lt, region, id_array[id].id, ndx); if ((ret = CDB___lock_getlocker(lt, id_array[id].id, ndx, 0, &lockerp)) != 0) { CDB___db_err(dbenv, "No locks for locker %lu", (u_long)id_array[id].id); LOCKER_UNLOCK(lt, ndx); continue; } /* * If this is a master transaction, try to * find one of its children's locks first, * as they are probably more recent. */ child = SH_LIST_FIRST(&lockerp->child_locker, __db_locker); if (child != NULL) { do { lp = SH_LIST_FIRST(&child->heldby, __db_lock); if (lp != NULL && lp->status == DB_LSTAT_WAITING) { id_array[id].last_locker_id = child->id; goto get_lock; } child = SH_LIST_NEXT( child, child_link, __db_locker); } while (child != NULL); } lp = SH_LIST_FIRST(&lockerp->heldby, __db_lock); if (lp != NULL) { id_array[id].last_locker_id = lockerp->id; get_lock: id_array[id].last_lock = R_OFFSET(<->reginfo, lp); lo = (DB_LOCKOBJ *)((u_int8_t *)lp + lp->obj); pptr = SH_DBT_PTR(&lo->lockobj); if (lo->lockobj.size >= sizeof(db_pgno_t)) memcpy(&id_array[id].pgno, pptr, sizeof(db_pgno_t)); else id_array[id].pgno = 0; } LOCKER_UNLOCK(lt, ndx); } /* Pass complete, reset the deadlock detector bit. */ MEMORY_LOCK(lt); region->need_dd = 0; MEMORY_UNLOCK(lt); /* * Now we can release everything except the bitmap matrix that we * created. */ *nlockers = id; *idmap = id_array; *bmp = bitmap; CDB___os_free(tmpmap, sizeof(u_int32_t) * nentries); return (0); } static int CDB___dd_find(bmp, idmap, nlockers, deadp) u_int32_t *bmp, nlockers; locker_info *idmap; u_int32_t ***deadp; { u_int32_t i, j, k, nentries, *mymap, *tmpmap; u_int32_t **retp; int ndead, ndeadalloc, ret; #undef INITIAL_DEAD_ALLOC #define INITIAL_DEAD_ALLOC 8 ndeadalloc = INITIAL_DEAD_ALLOC; ndead = 0; if ((ret = CDB___os_malloc(ndeadalloc * sizeof(u_int32_t *), NULL, &retp)) != 0) return (ret); /* * For each locker, OR in the bits from the lockers on which that * locker is waiting. */ nentries = ALIGN(nlockers, 32) / 32; for (mymap = bmp, i = 0; i < nlockers; i++, mymap += nentries) { if (!idmap[i].valid) continue; for (j = 0; j < nlockers; j++) { if (!ISSET_MAP(mymap, j)) continue; /* Find the map for this bit. */ tmpmap = bmp + (nentries * j); OR_MAP(mymap, tmpmap, nentries); if (!ISSET_MAP(mymap, i)) continue; /* Make sure we leave room for NULL. */ if (ndead + 2 >= ndeadalloc) { ndeadalloc <<= 1; /* * If the alloc fails, then simply return the * deadlocks that we already have. */ if (CDB___os_realloc(ndeadalloc * sizeof(u_int32_t), NULL, &retp) != 0) { retp[ndead] = NULL; *deadp = retp; return (0); } } retp[ndead++] = mymap; /* Mark all participants in this deadlock invalid. */ for (k = 0; k < nlockers; k++) if (ISSET_MAP(mymap, k)) idmap[k].valid = 0; break; } } retp[ndead] = NULL; *deadp = retp; return (0); } static int CDB___dd_abort(dbenv, info) DB_ENV *dbenv; locker_info *info; { struct __db_lock *lockp; DB_LOCKER *lockerp; DB_LOCKOBJ *sh_obj; DB_LOCKREGION *region; DB_LOCKTAB *lt; u_int32_t ndx; int ret; lt = dbenv->lk_handle; region = lt->reginfo.primary; LOCKREGION(dbenv, lt); /* Find the locker's last lock. */ LOCKER_LOCK(lt, region, info->last_locker_id, ndx); if ((ret = CDB___lock_getlocker(lt, info->last_locker_id, ndx, 0, &lockerp)) != 0 || lockerp == NULL) { if (ret == 0) ret = EINVAL; goto out; } lockp = SH_LIST_FIRST(&lockerp->heldby, __db_lock); /* * It's possible that this locker was already aborted. If that's * the case, make sure that we remove its locker from the hash table. */ if (lockp == NULL) { if (LOCKER_FREEABLE(lockerp)) { CDB___lock_freelocker(lt, region, lockerp, ndx); goto out; } } else if (R_OFFSET(<->reginfo, lockp) != info->last_lock || lockp->status != DB_LSTAT_WAITING) { ret = EINVAL; goto out; } sh_obj = (DB_LOCKOBJ *)((u_int8_t *)lockp + lockp->obj); SH_LIST_REMOVE(lockp, locker_links, __db_lock); LOCKER_UNLOCK(lt, ndx); /* Abort lock, take it off list, and wake up this lock. */ SHOBJECT_LOCK(lt, region, sh_obj, ndx); lockp->status = DB_LSTAT_ABORTED; SH_TAILQ_REMOVE(&sh_obj->waiters, lockp, links, __db_lock); ret = CDB___lock_promote(lt, sh_obj); OBJECT_UNLOCK(lt, ndx); MUTEX_UNLOCK(&lockp->mutex); MEMORY_LOCK(lt); region->ndeadlocks++; MEMORY_UNLOCK(lt); UNLOCKREGION(dbenv, lt); return (0); out: UNLOCKREGION(dbenv, lt); LOCKER_UNLOCK(lt, ndx); return (ret); } #ifdef DIAGNOSTIC static void __dd_debug(dbenv, idmap, bitmap, nlockers) DB_ENV *dbenv; locker_info *idmap; u_int32_t *bitmap, nlockers; { u_int32_t i, j, *mymap, nentries; int ret; char *msgbuf; CDB___db_err(dbenv, "Waitsfor array\nWaiter:\tWaiting on:"); /* Allocate space to print 10 bytes per item waited on. */ #undef MSGBUF_LEN #define MSGBUF_LEN ((nlockers + 1) * 10 + 64) if ((ret = CDB___os_malloc(MSGBUF_LEN, NULL, &msgbuf)) != 0) return; nentries = ALIGN(nlockers, 32) / 32; for (mymap = bitmap, i = 0; i < nlockers; i++, mymap += nentries) { if (!idmap[i].valid) continue; sprintf(msgbuf, /* Waiter. */ "%lx/%lu:\t", (u_long)idmap[i].id, (u_long)idmap[i].pgno); for (j = 0; j < nlockers; j++) if (ISSET_MAP(mymap, j)) sprintf(msgbuf, "%s %lx", msgbuf, (u_long)idmap[j].id); (void)sprintf(msgbuf, "%s %lu", msgbuf, (u_long)idmap[i].last_lock); CDB___db_err(dbenv, msgbuf); } CDB___os_free(msgbuf, MSGBUF_LEN); } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock_ext.h�������������������������������������������������������������������������0100644�0063146�0012731�00000002316�07427026535�014745� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _lock_ext_h_ #define _lock_ext_h_ int CDB___lock_downgrade __P((DB_ENV *, DB_LOCK *, db_lockmode_t, u_int32_t)); int CDB___lock_addfamilylocker __P((DB_ENV *, u_int32_t, u_int32_t)); int CDB___lock_freefamilylocker __P((DB_LOCKTAB *, u_int32_t)); void CDB___lock_freelocker __P((DB_LOCKTAB *, DB_LOCKREGION *, DB_LOCKER *, u_int32_t)); int CDB___lock_getlocker __P((DB_LOCKTAB *, u_int32_t, u_int32_t, int, DB_LOCKER **)); int CDB___lock_getobj __P((DB_LOCKTAB *, const DBT *, u_int32_t, int, DB_LOCKOBJ **)); int CDB___lock_promote __P((DB_LOCKTAB *, DB_LOCKOBJ *)); void CDB___lock_printlock __P((DB_LOCKTAB *, struct __db_lock *, int)); void CDB___lock_dbenv_create __P((DB_ENV *)); void CDB___lock_dbenv_close __P((DB_ENV *)); int CDB___lock_open __P((DB_ENV *)); int CDB___lock_close __P((DB_ENV *)); void CDB___lock_dump_region __P((DB_ENV *, char *, FILE *)); int CDB___lock_cmp __P((const DBT *, DB_LOCKOBJ *)); int CDB___lock_locker_cmp __P((u_int32_t, DB_LOCKER *)); u_int32_t CDB___lock_ohash __P((const DBT *)); u_int32_t CDB___lock_lhash __P((DB_LOCKOBJ *)); u_int32_t CDB___lock_locker_hash __P((u_int32_t)); #endif /* _lock_ext_h_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock_region.c����������������������������������������������������������������������0100644�0063146�0012731�00000045204�07427026535�015426� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)lock_region.c 11.9 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "lock.h" static void CDB___lock_dump_locker __P((DB_LOCKTAB *, DB_LOCKER *, FILE *)); static void CDB___lock_dump_object __P((DB_LOCKTAB *, DB_LOCKOBJ *, FILE *)); static const char * CDB___lock_dump_status __P((db_status_t)); static int CDB___lock_init __P((DB_ENV *, DB_LOCKTAB *)); static size_t CDB___lock_region_size __P((DB_ENV *)); static int CDB___lock_set_lk_conflicts __P((DB_ENV *, u_int8_t *, int)); static int CDB___lock_set_lk_detect __P((DB_ENV *, u_int32_t)); static int CDB___lock_set_lk_max __P((DB_ENV *, u_int32_t)); /* * This conflict array is used for concurrent db access (CDB). It * uses the same locks as the db_rw_conflict array, but adds an IW * mode to be used for write cursors. */ static u_int8_t const db_cdb_conflicts[] = { /* N R W IW */ /* N */ 0, 0, 0, 0, /* R */ 0, 0, 1, 0, /* W */ 0, 1, 1, 1, /* IW */ 0, 0, 1, 1 }; /* * CDB___lock_dbenv_create -- * Lock specific creation of the DB_ENV structure. * * PUBLIC: void CDB___lock_dbenv_create __P((DB_ENV *)); */ void CDB___lock_dbenv_create(dbenv) DB_ENV *dbenv; { dbenv->lk_max = DB_LOCK_DEFAULT_N; dbenv->set_lk_conflicts = CDB___lock_set_lk_conflicts; dbenv->set_lk_detect = CDB___lock_set_lk_detect; dbenv->set_lk_max = CDB___lock_set_lk_max; } /* * CDB___lock_dbenv_close -- * Lock specific destruction of the DB_ENV structure. * * PUBLIC: void CDB___lock_dbenv_close __P((DB_ENV *)); */ void CDB___lock_dbenv_close(dbenv) DB_ENV *dbenv; { if (!F_ISSET(dbenv, DB_ENV_USER_ALLOC) && dbenv->lk_conflicts != NULL) { CDB___os_free(dbenv->lk_conflicts, dbenv->lk_modes * dbenv->lk_modes); dbenv->lk_conflicts = NULL; } } /* * CDB___lock_set_lk_conflicts * Set the conflicts matrix. */ static int CDB___lock_set_lk_conflicts(dbenv, lk_conflicts, lk_modes) DB_ENV *dbenv; u_int8_t *lk_conflicts; int lk_modes; { int ret; ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lk_conflicts"); if (dbenv->lk_conflicts != NULL) { CDB___os_free(dbenv->lk_conflicts, dbenv->lk_modes * dbenv->lk_modes); dbenv->lk_conflicts = NULL; } if ((ret = CDB___os_malloc(lk_modes * lk_modes, NULL, &dbenv->lk_conflicts)) != 0) return (ret); memcpy(dbenv->lk_conflicts, lk_conflicts, lk_modes * lk_modes); dbenv->lk_modes = lk_modes; return (0); } /* * CDB___lock_set_lk_detect * Set the automatic deadlock detection. */ static int CDB___lock_set_lk_detect(dbenv, lk_detect) DB_ENV *dbenv; u_int32_t lk_detect; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lk_detect"); switch (lk_detect) { case DB_LOCK_DEFAULT: case DB_LOCK_OLDEST: case DB_LOCK_RANDOM: case DB_LOCK_YOUNGEST: break; default: return (EINVAL); } dbenv->lk_detect = lk_detect; return (0); } /* * CDB___lock_set_lk_max * Set the lock table size. */ static int CDB___lock_set_lk_max(dbenv, lk_max) DB_ENV *dbenv; u_int32_t lk_max; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lk_max"); dbenv->lk_max = lk_max; return (0); } /* * CDB___lock_open -- * Internal version of lock_open: only called from DB_ENV->open. * * PUBLIC: int CDB___lock_open __P((DB_ENV *)); */ int CDB___lock_open(dbenv) DB_ENV *dbenv; { DB_LOCKREGION *region; DB_LOCKTAB *lt; size_t size; int ret; /* Create the lock table structure. */ if ((ret = CDB___os_calloc(1, sizeof(DB_LOCKTAB), <)) != 0) return (ret); lt->dbenv = dbenv; /* Join/create the lock region. */ lt->reginfo.id = REG_ID_LOCK; lt->reginfo.mode = dbenv->db_mode; if (F_ISSET(dbenv, DB_ENV_CREATE)) F_SET(<->reginfo, REGION_CREATE_OK); size = CDB___lock_region_size(dbenv); if ((ret = CDB___db_r_attach(dbenv, <->reginfo, size)) != 0) goto err; /* If we created the region, initialize it. */ if (F_ISSET(<->reginfo, REGION_CREATE)) if ((ret = CDB___lock_init(dbenv, lt)) != 0) goto err; /* Set the local addresses. */ region = lt->reginfo.primary = R_ADDR(<->reginfo, lt->reginfo.rp->primary); /* Check for incompatible automatic deadlock detection requests. */ if (dbenv->lk_detect != DB_LOCK_NORUN) { if (region->detect != DB_LOCK_NORUN && dbenv->lk_detect != DB_LOCK_DEFAULT && region->detect != dbenv->lk_detect) { CDB___db_err(dbenv, "lock_open: incompatible deadlock detector mode"); ret = EINVAL; goto err; } /* * Upgrade if our caller wants automatic detection, and it * was not currently being done, whether or not we created * the region. */ if (region->detect == DB_LOCK_NORUN) region->detect = dbenv->lk_detect; } /* Set remaining pointers into region. */ lt->memlock = (MUTEX *)R_ADDR(<->reginfo, region->memlock_off); lt->conflicts = (u_int8_t *)R_ADDR(<->reginfo, region->conf_off); lt->obj_tab = (DB_HASHTAB *)R_ADDR(<->reginfo, region->obj_off); lt->osynch_tab = (MUTEX *)R_ADDR(<->reginfo, region->osynch_off); lt->locker_tab = (DB_HASHTAB *)R_ADDR(<->reginfo, region->locker_off); lt->lsynch_tab = (MUTEX *)R_ADDR(<->reginfo, region->lsynch_off); R_UNLOCK(dbenv, <->reginfo); dbenv->lk_handle = lt; return (0); err: if (lt->reginfo.addr != NULL) { if (F_ISSET(<->reginfo, REGION_CREATE)) F_SET(lt->reginfo.rp, REG_DEAD); R_UNLOCK(dbenv, <->reginfo); (void)CDB___db_r_detach(dbenv, <->reginfo, 0); } CDB___os_free(lt, sizeof(*lt)); return (ret); } /* * CDB___lock_init -- * Initialize the lock region. */ static int CDB___lock_init(dbenv, lt) DB_ENV *dbenv; DB_LOCKTAB *lt; { const u_int8_t *lk_conflicts; struct __db_lock *lp; DB_LOCKER *lidp; DB_LOCKOBJ *op; DB_LOCKREGION *region; #ifdef FINE_GRAIN MUTEX *m; #endif u_int32_t i, lk_modes, nelements; u_int8_t *addr; int ret; if ((ret = CDB___db_shalloc(lt->reginfo.addr, sizeof(DB_LOCKREGION), 0, <->reginfo.primary)) != 0) return (ret); lt->reginfo.rp->primary = R_OFFSET(<->reginfo, lt->reginfo.primary); region = lt->reginfo.primary; memset(region, 0, sizeof(*region)); /* Select a conflict matrix if none specified. */ if (dbenv->lk_modes == 0) if (F_ISSET(dbenv, DB_ENV_CDB)) { lk_modes = DB_LOCK_RW_N + 1; lk_conflicts = db_cdb_conflicts; } else { lk_modes = DB_LOCK_RW_N; lk_conflicts = CDB_db_rw_conflicts; } else { lk_modes = dbenv->lk_modes; lk_conflicts = dbenv->lk_conflicts; } region->id = 0; region->need_dd = 0; region->detect = DB_LOCK_NORUN; region->maxlocks = dbenv->lk_max; region->table_size = CDB___db_tablesize(dbenv->lk_max); region->nmodes = lk_modes; region->nlockers = 0; region->maxnlockers = 0; region->nconflicts = 0; region->nrequests = 0; region->nreleases = 0; region->ndeadlocks = 0; nelements = region->table_size; /* Allocate room for the conflict matrix and initialize it. */ if ((ret = CDB___db_shalloc(lt->reginfo.addr, lk_modes * lk_modes, 0, &addr)) != 0) return (ret); memcpy(addr, lk_conflicts, lk_modes * lk_modes); region->conf_off = R_OFFSET(<->reginfo, addr); /* Allocate room for the memory mutex and initialize it. */ #ifdef FINE_GRAIN if ((ret = CDB___db_shalloc(lt->reginfo.addr, sizeof(MUTEX), MUTEX_ALIGN, &addr)) != 0) return (ret); region->memlock_off = R_OFFSET(<->reginfo, addr); if ((ret = __db_mutex_init(dbenv, (MUTEX *)addr, R_OFFSET(<->reginfo, addr) + DB_FCNTL_OFF_LOCK, 0)) != 0) return (ret); /* Allocate room for the mutex tables and initialize them. */ if ((ret = CDB___db_shalloc(lt->reginfo.addr, nelements * sizeof(MUTEX), MUTEX_ALIGN, &addr)) != 0) return (ret); region->osynch_off = R_OFFSET(<->reginfo, addr); for (i = 0; i < nelements; i++) { m = (MUTEX *)addr + i; if ((ret = __db_mutex_init(dbenv, m, R_OFFSET(<->reginfo, m) + DB_FCNTL_OFF_LOCK, 0)) != 0) return (ret); } if ((ret = CDB___db_shalloc(lt->reginfo.addr, nelements * sizeof(MUTEX), MUTEX_ALIGN, &addr)) != 0) return (ret); region->lsynch_off = R_OFFSET(<->reginfo, addr); for (i = 0; i < nelements; i++) { m = (MUTEX *)addr + i; if ((ret = __db_mutex_init(dbenv, m, R_OFFSET(<->reginfo, m) + DB_FCNTL_OFF_LOCK, 0)) != 0) return (ret); } #endif /* Allocate room for the object hash table and initialize it. */ if ((ret = CDB___db_shalloc(lt->reginfo.addr, nelements * sizeof(DB_HASHTAB), 0, &addr)) != 0) return (ret); CDB___db_hashinit(addr, nelements); region->obj_off = R_OFFSET(<->reginfo, addr); /* Allocate room for the locker hash table and initialize it. */ if ((ret = CDB___db_shalloc(lt->reginfo.addr, nelements * sizeof(DB_HASHTAB), 0, &addr)) != 0) return (ret); CDB___db_hashinit(addr, nelements); region->locker_off = R_OFFSET(<->reginfo, addr); /* * Initialize locks onto a free list. Initialize and lock the mutex * so that when we need to block, all we need do is try to acquire * the mutex. */ SH_TAILQ_INIT(®ion->free_locks); for (i = 0; i < region->maxlocks; ++i) { if ((ret = CDB___db_shalloc(lt->reginfo.addr, sizeof(struct __db_lock), MUTEX_ALIGN, &lp)) != 0) return (ret); lp->status = DB_LSTAT_FREE; if ((ret = __db_mutex_init(dbenv, &lp->mutex, R_OFFSET(<->reginfo, &lp->mutex) + DB_FCNTL_OFF_LOCK, MUTEX_SELF_BLOCK)) != 0) return (ret); MUTEX_LOCK(&lp->mutex, lt->dbenv->lockfhp); SH_TAILQ_INSERT_HEAD(®ion->free_locks, lp, links, __db_lock); } /* Initialize objects onto a free list. */ SH_TAILQ_INIT(®ion->free_objs); for (i = 0; i < region->maxlocks; ++i) { if ((ret = CDB___db_shalloc(lt->reginfo.addr, sizeof(DB_LOCKOBJ), 0, &op)) != 0) return (ret); SH_TAILQ_INSERT_HEAD( ®ion->free_objs, op, links, __db_lockobj); } /* Initialize lockers onto a free list. */ SH_TAILQ_INIT(®ion->free_lockers); for (i = 0; i < region->maxlocks; ++i) { if ((ret = CDB___db_shalloc(lt->reginfo.addr, sizeof(DB_LOCKER), 0, &lidp)) != 0) return (ret); SH_TAILQ_INSERT_HEAD( ®ion->free_lockers, lidp, links, __db_locker); } return (0); } /* * CDB___lock_close -- * Internal version of lock_close: only called from db_appinit. * * PUBLIC: int CDB___lock_close __P((DB_ENV *)); */ int CDB___lock_close(dbenv) DB_ENV *dbenv; { DB_LOCKTAB *lt; int ret; lt = dbenv->lk_handle; /* Detach from the region. */ ret = CDB___db_r_detach(dbenv, <->reginfo, 0); CDB___os_free(lt, sizeof(*lt)); return (ret); } /* * CDB_lock_stat -- * Return LOCK statistics. */ int CDB_lock_stat(dbenv, statp, db_malloc) DB_ENV *dbenv; DB_LOCK_STAT **statp; void *(*db_malloc) __P((size_t)); { DB_LOCKREGION *region; DB_LOCKTAB *lt; DB_LOCK_STAT *stats; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lk_handle, DB_INIT_LOCK); *statp = NULL; lt = dbenv->lk_handle; if ((ret = CDB___os_malloc(sizeof(*stats), db_malloc, &stats)) != 0) return (ret); /* Copy out the global statistics. */ R_LOCK(dbenv, <->reginfo); region = lt->reginfo.primary; stats->st_lastid = region->id; stats->st_maxlocks = region->maxlocks; stats->st_nmodes = region->nmodes; stats->st_nlockers = region->nlockers; stats->st_maxnlockers = region->maxnlockers; stats->st_nconflicts = region->nconflicts; stats->st_nrequests = region->nrequests; stats->st_nreleases = region->nreleases; stats->st_ndeadlocks = region->ndeadlocks; stats->st_region_wait = lt->reginfo.rp->mutex.mutex_set_wait; stats->st_region_nowait = lt->reginfo.rp->mutex.mutex_set_nowait; stats->st_regsize = lt->reginfo.rp->size; R_UNLOCK(dbenv, <->reginfo); *statp = stats; return (0); } #define LOCK_DUMP_CONF 0x001 /* Conflict matrix. */ #define LOCK_DUMP_FREE 0x002 /* Display lock free list. */ #define LOCK_DUMP_LOCKERS 0x004 /* Display lockers. */ #define LOCK_DUMP_MEM 0x008 /* Display region memory. */ #define LOCK_DUMP_OBJECTS 0x010 /* Display objects. */ #define LOCK_DUMP_ALL 0x01f /* Display all. */ /* * CDB___lock_dump_region -- * * PUBLIC: void CDB___lock_dump_region __P((DB_ENV *, char *, FILE *)); */ void CDB___lock_dump_region(dbenv, area, fp) DB_ENV *dbenv; char *area; FILE *fp; { struct __db_lock *lp; DB_LOCKER *lip; DB_LOCKOBJ *op; DB_LOCKREGION *lrp; DB_LOCKTAB *lt; u_int32_t flags, i, j; int label; /* Make it easy to call from the debugger. */ if (fp == NULL) fp = stderr; for (flags = 0; *area != '\0'; ++area) switch (*area) { case 'A': LF_SET(LOCK_DUMP_ALL); break; case 'c': LF_SET(LOCK_DUMP_CONF); break; case 'f': LF_SET(LOCK_DUMP_FREE); break; case 'l': LF_SET(LOCK_DUMP_LOCKERS); break; case 'm': LF_SET(LOCK_DUMP_MEM); break; case 'o': LF_SET(LOCK_DUMP_OBJECTS); break; } lt = dbenv->lk_handle; lrp = lt->reginfo.primary; LOCKREGION(dbenv, lt); fprintf(fp, "%s\nLock region parameters\n", DB_LINE); fprintf(fp, "%s: %lu, %s: %lu, %s: %lu, %s: %lu, %s: %lu, %s: %lu, %s: %lu\n", "table size", (u_long)lrp->table_size, "obj_off", (u_long)lrp->obj_off, "osynch_off", (u_long)lrp->osynch_off, "locker_off", (u_long)lrp->locker_off, "lsynch_off", (u_long)lrp->lsynch_off, "memlock_off", (u_long)lrp->memlock_off, "need_dd", (u_long)lrp->need_dd); if (LF_ISSET(LOCK_DUMP_CONF)) { fprintf(fp, "\n%s\nConflict matrix\n", DB_LINE); for (i = 0; i < lrp->nmodes; i++) { for (j = 0; j < lrp->nmodes; j++) fprintf(fp, "%lu\t", (u_long)lt->conflicts[i * lrp->nmodes + j]); fprintf(fp, "\n"); } } if (LF_ISSET(LOCK_DUMP_LOCKERS)) { fprintf(fp, "%s\nLocker hash buckets\n", DB_LINE); for (i = 0; i < lrp->table_size; i++) { label = 1; LOCKER_LOCK_NDX(lt, i); for (lip = SH_TAILQ_FIRST(<->locker_tab[i], __db_locker); lip != NULL; lip = SH_TAILQ_NEXT(lip, links, __db_locker)) { if (label) { fprintf(fp, "Bucket %lu:\n", (u_long)i); label = 0; } CDB___lock_dump_locker(lt, lip, fp); } LOCKER_UNLOCK(lt, i); } } if (LF_ISSET(LOCK_DUMP_OBJECTS)) { fprintf(fp, "%s\nObject hash buckets\n", DB_LINE); for (i = 0; i < lrp->table_size; i++) { label = 1; OBJECT_LOCK_NDX(lt, i); for (op = SH_TAILQ_FIRST(<->obj_tab[i], __db_lockobj); op != NULL; op = SH_TAILQ_NEXT(op, links, __db_lockobj)) { if (label) { fprintf(fp, "Bucket %lu:\n", (u_long)i); label = 0; } CDB___lock_dump_object(lt, op, fp); } OBJECT_UNLOCK(lt, i); } } if (LF_ISSET(LOCK_DUMP_FREE)) { fprintf(fp, "%s\nLock free list\n", DB_LINE); for (lp = SH_TAILQ_FIRST(&lrp->free_locks, __db_lock); lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) fprintf(fp, "0x%lx: %lu\t%lu\t%s\t0x%lx\n", (u_long)lp, (u_long)lp->holder, (u_long)lp->mode, CDB___lock_dump_status(lp->status), (u_long)lp->obj); fprintf(fp, "%s\nObject free list\n", DB_LINE); for (op = SH_TAILQ_FIRST(&lrp->free_objs, __db_lockobj); op != NULL; op = SH_TAILQ_NEXT(op, links, __db_lockobj)) fprintf(fp, "0x%lx\n", (u_long)op); fprintf(fp, "%s\nLocker free list\n", DB_LINE); for (lip = SH_TAILQ_FIRST(&lrp->free_lockers, __db_locker); lip != NULL; lip = SH_TAILQ_NEXT(lip, links, __db_locker)) fprintf(fp, "0x%lx\n", (u_long)lip); } if (LF_ISSET(LOCK_DUMP_MEM)) CDB___db_shalloc_dump(lt->reginfo.addr, fp); UNLOCKREGION(dbenv, lt); } static void CDB___lock_dump_locker(lt, lip, fp) DB_LOCKTAB *lt; DB_LOCKER *lip; FILE *fp; { struct __db_lock *lp; fprintf(fp, "L %lx [%ld]", (u_long)lip->id, (long)lip->dd_id); fprintf(fp, " %s ", F_ISSET(lip, DB_LOCKER_DELETED) ? "(D)" : " "); if ((lp = SH_LIST_FIRST(&lip->heldby, __db_lock)) == NULL) fprintf(fp, "\n"); else for (; lp != NULL; lp = SH_LIST_NEXT(lp, locker_links, __db_lock)) CDB___lock_printlock(lt, lp, 1); } static void CDB___lock_dump_object(lt, op, fp) DB_LOCKTAB *lt; DB_LOCKOBJ *op; FILE *fp; { struct __db_lock *lp; u_int32_t j; u_int8_t *ptr; u_int ch; ptr = SH_DBT_PTR(&op->lockobj); for (j = 0; j < op->lockobj.size; ptr++, j++) { ch = *ptr; fprintf(fp, isprint(ch) ? "%c" : "\\%o", ch); } fprintf(fp, "\n"); fprintf(fp, "H:"); for (lp = SH_TAILQ_FIRST(&op->holders, __db_lock); lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) CDB___lock_printlock(lt, lp, 1); lp = SH_TAILQ_FIRST(&op->waiters, __db_lock); if (lp != NULL) { fprintf(fp, "\nW:"); for (; lp != NULL; lp = SH_TAILQ_NEXT(lp, links, __db_lock)) CDB___lock_printlock(lt, lp, 1); } } static const char * CDB___lock_dump_status(status) db_status_t status; { switch (status) { case DB_LSTAT_ABORTED: return ("aborted"); case DB_LSTAT_ERR: return ("err"); case DB_LSTAT_FREE: return ("free"); case DB_LSTAT_HELD: return ("held"); case DB_LSTAT_NOGRANT: return ("nogrant"); case DB_LSTAT_PENDING: return ("pending"); case DB_LSTAT_WAITING: return ("waiting"); } return ("unknown status"); } /* * CDB___lock_region_size -- * Return the region size. */ static size_t CDB___lock_region_size(dbenv) DB_ENV *dbenv; { size_t retval; u_int32_t i, nelements, nlocks; nlocks = dbenv->lk_max; nelements = CDB___db_tablesize(dbenv->lk_max); /* * Figure out how much space we're going to need. This list should * map one-to-one with the CDB___db_shalloc calls in CDB___lock_init. */ retval = 0; retval += ALIGN(sizeof(DB_LOCKREGION), 1); retval += ALIGN(dbenv->lk_modes * dbenv->lk_modes, 1); #ifdef FINE_GRAIN retval += ALIGN(sizeof(MUTEX), MUTEX_ALIGN); retval += ALIGN(nelements * sizeof(MUTEX), MUTEX_ALIGN); retval += ALIGN(nelements * sizeof(MUTEX), MUTEX_ALIGN); #endif retval += ALIGN(nelements * sizeof(DB_HASHTAB), 1); retval += ALIGN(nelements * sizeof(DB_HASHTAB), 1); for (i = 0; i < nlocks; ++i) retval += ALIGN(sizeof(struct __db_lock), MUTEX_ALIGN); for (i = 0; i < nlocks; ++i) retval += ALIGN(sizeof(DB_LOCKOBJ), 1); for (i = 0; i < nlocks; ++i) retval += ALIGN(sizeof(DB_LOCKER), 1); /* * Aproximate the memory allocation overhead. This breaks the * abstraction a little, but seems better than a WAG. */ retval += nlocks * (2 * sizeof(ssize_t) + sizeof(size_t)); /* * Include 16 bytes of string space per lock. DB doesn't use it * because we pre-allocate lock space for DBTs in the structure. */ retval += ALIGN(nlocks * 16, sizeof(size_t)); #ifdef DIAGNOSTIC /* * The above precise calculation doesn't leave enough space for guard * bytes, of which there is one plus whatever alignment wastage for * each CDB___db_shalloc. Give ourselves some breathing room. */ retval += nlocks * 5; #endif /* And we keep getting this wrong, let's be generous. */ retval += 16 * 1024; return (retval); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock_util.c������������������������������������������������������������������������0100644�0063146�0012731�00000007207�07427026535�015121� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)lock_util.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "hash.h" #include "lock.h" /* * CDB___lock_cmp -- * This function is used to compare a DBT that is about to be entered * into a hash table with an object already in the hash table. Note * that it just returns true on equal and 0 on not-equal. Therefore * this function cannot be used as a sort function; its purpose is to * be used as a hash comparison function. * * PUBLIC: int CDB___lock_cmp __P((const DBT *, DB_LOCKOBJ *)); */ int CDB___lock_cmp(dbt, lock_obj) const DBT *dbt; DB_LOCKOBJ *lock_obj; { void *obj_data; obj_data = SH_DBT_PTR(&lock_obj->lockobj); return (dbt->size == lock_obj->lockobj.size && memcmp(dbt->data, obj_data, dbt->size) == 0); } /* * PUBLIC: int CDB___lock_locker_cmp __P((u_int32_t, DB_LOCKER *)); */ int CDB___lock_locker_cmp(locker, sh_locker) u_int32_t locker; DB_LOCKER *sh_locker; { return (locker == sh_locker->id); } /* * The next two functions are the hash functions used to store objects in the * lock hash tables. They are hashing the same items, but one (CDB___lock_ohash) * takes a DBT (used for hashing a parameter passed from the user) and the * other (CDB___lock_lhash) takes a DB_LOCKOBJ (used for hashing something that is * already in the lock manager). In both cases, we have a special check to * fast path the case where we think we are doing a hash on a DB page/fileid * pair. If the size is right, then we do the fast hash. * * We know that DB uses DB_LOCK_ILOCK types for its lock objects. The first * four bytes are the 4-byte page number and the next DB_FILE_ID_LEN bytes * are a unique file id, where the first 4 bytes on UNIX systems are the file * inode number, and the first 4 bytes on Windows systems are the FileIndexLow * bytes. So, we use the XOR of the page number and the first four bytes of * the file id to produce a 32-bit hash value. * * We have no particular reason to believe that this algorithm will produce * a good hash, but we want a fast hash more than we want a good one, when * we're coming through this code path. */ #define FAST_HASH(P) { \ u_int32_t __h; \ u_int8_t *__cp, *__hp; \ __hp = (u_int8_t *)&__h; \ __cp = (u_int8_t *)(P); \ __hp[0] = __cp[0] ^ __cp[4]; \ __hp[1] = __cp[1] ^ __cp[5]; \ __hp[2] = __cp[2] ^ __cp[6]; \ __hp[3] = __cp[3] ^ __cp[7]; \ return (__h); \ } /* * CDB___lock_ohash -- * * PUBLIC: u_int32_t CDB___lock_ohash __P((const DBT *)); */ u_int32_t CDB___lock_ohash(dbt) const DBT *dbt; { if (dbt->size == sizeof(DB_LOCK_ILOCK)) FAST_HASH(dbt->data); return (CDB___ham_func5(dbt->data, dbt->size)); } /* * CDB___lock_lhash -- * * PUBLIC: u_int32_t CDB___lock_lhash __P((DB_LOCKOBJ *)); */ u_int32_t CDB___lock_lhash(lock_obj) DB_LOCKOBJ *lock_obj; { void *obj_data; obj_data = SH_DBT_PTR(&lock_obj->lockobj); if (lock_obj->lockobj.size == sizeof(DB_LOCK_ILOCK)) FAST_HASH(obj_data); return (CDB___ham_func5(obj_data, lock_obj->lockobj.size)); } /* * CDB___lock_locker_hash -- * Hash function for entering lockers into the locker hash table. * Since these are simply 32-bit unsigned integers, just return * the locker value. * * PUBLIC: u_int32_t CDB___lock_locker_hash __P((u_int32_t)); */ u_int32_t CDB___lock_locker_hash(locker) u_int32_t locker; { return (locker); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log.c������������������������������������������������������������������������������0100644�0063146�0012731�00000027633�10000513627�013702� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)log.c 11.8 (Sleepycat) 9/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "log.h" #include "db_dispatch.h" #include "txn.h" #include "txn_auto.h" static int CDB___log_init __P((DB_ENV *, DB_LOG *)); static int CDB___log_recover __P((DB_LOG *)); /* * CDB___log_open -- * Internal version of log_open: only called from DB_ENV->open. * * PUBLIC: int CDB___log_open __P((DB_ENV *)); */ int CDB___log_open(dbenv) DB_ENV *dbenv; { DB_LOG *dblp; LOG *lp; int ret; /* Create/initialize the DB_LOG structure. */ if ((ret = CDB___os_calloc(1, sizeof(DB_LOG), &dblp)) != 0) return (ret); ZERO_LSN(dblp->c_lsn); dblp->dbenv = dbenv; /* Join/create the log region. */ dblp->reginfo.id = REG_ID_LOG; dblp->reginfo.mode = dbenv->db_mode; if (F_ISSET(dbenv, DB_ENV_CREATE)) F_SET(&dblp->reginfo, REGION_CREATE_OK); if ((ret = CDB___db_r_attach( dbenv, &dblp->reginfo, LG_BASE_REGION_SIZE + dbenv->lg_bsize)) != 0) goto err; /* If we created the region, initialize it. */ if (F_ISSET(&dblp->reginfo, REGION_CREATE)) if ((ret = CDB___log_init(dbenv, dblp)) != 0) goto err; /* Set the local addresses. */ lp = dblp->reginfo.primary = R_ADDR(&dblp->reginfo, dblp->reginfo.rp->primary); dblp->bufp = R_ADDR(&dblp->reginfo, lp->buffer_off); R_UNLOCK(dbenv, &dblp->reginfo); /* * If the region is threaded, then we have to lock both the handles * and the region, and we need to allocate a mutex for that purpose. */ if (F_ISSET(dbenv, DB_ENV_THREAD)) { if ((ret = CDB___db_mutex_alloc( dbenv, &dblp->reginfo, &dblp->mutexp)) != 0) goto detach; if ((ret = __db_mutex_init( dbenv, dblp->mutexp, 0, MUTEX_THREAD)) != 0) goto detach; } dbenv->lg_handle = dblp; return (0); err: if (dblp->reginfo.addr != NULL) { if (F_ISSET(&dblp->reginfo, REGION_CREATE)) F_SET(dblp->reginfo.rp, REG_DEAD); R_UNLOCK(dbenv, &dblp->reginfo); detach: (void)CDB___db_r_detach(dbenv, &dblp->reginfo, 0); } CDB___os_free(dblp, sizeof(*dblp)); return (ret); } /* * CDB___log_init -- * Initialize a log region in shared memory. */ static int CDB___log_init(dbenv, dblp) DB_ENV *dbenv; DB_LOG *dblp; { LOG *region; int ret; void *p; if ((ret = CDB___db_shalloc(dblp->reginfo.addr, sizeof(*region), 0, &dblp->reginfo.primary)) != 0) return (ret); dblp->reginfo.rp->primary = R_OFFSET(&dblp->reginfo, dblp->reginfo.primary); region = dblp->reginfo.primary; memset(region, 0, sizeof(*region)); region->persist.lg_max = dbenv->lg_max; region->persist.magic = DB_LOGMAGIC; region->persist.version = DB_LOGVERSION; region->persist.mode = dbenv->db_mode; SH_TAILQ_INIT(®ion->fq); /* Initialize LOG LSNs. */ region->lsn.file = 1; region->lsn.offset = 0; /* Initialize the buffer. */ if ((ret = CDB___db_shalloc(dblp->reginfo.addr, dbenv->lg_bsize, 0, &p)) != 0) return (ret); region->buffer_size = dbenv->lg_bsize; region->buffer_off = R_OFFSET(&dblp->reginfo, p); /* * XXX: * Initialize the log file size. This is a hack to push the log's * maximum size down into the Windows CDB___os_open routine, because it * wants to pre-allocate it. */ dblp->lfh.log_size = dbenv->lg_max; /* Try and recover any previous log files before releasing the lock. */ return (CDB___log_recover(dblp)); } /* * CDB___log_recover -- * Recover a log. */ static int CDB___log_recover(dblp) DB_LOG *dblp; { DBT dbt; DB_LSN lsn; LOG *lp; u_int32_t chk; int cnt, found_checkpoint, ret; lp = dblp->reginfo.primary; /* * Find a log file. If none exist, we simply return, leaving * everything initialized to a new log. */ if ((ret = CDB___log_find(dblp, 0, &cnt)) != 0) return (ret); if (cnt == 0) return (0); /* * We have the last useful log file and we've loaded any persistent * information. Pretend that the log is larger than it can possibly * be, and read the last file, looking for the last checkpoint and * the log's end. */ lp->lsn.file = cnt + 1; lp->lsn.offset = 0; lsn.file = cnt; lsn.offset = 0; /* Set the cursor. Shouldn't fail, leave error messages on. */ memset(&dbt, 0, sizeof(dbt)); if ((ret = CDB___log_get(dblp, &lsn, &dbt, DB_SET, 0)) != 0) return (ret); /* * Read to the end of the file, saving checkpoints. This will fail * at some point, so turn off error messages. */ found_checkpoint = 0; while (CDB___log_get(dblp, &lsn, &dbt, DB_NEXT, 1) == 0) { if (dbt.size < sizeof(u_int32_t)) continue; memcpy(&chk, dbt.data, sizeof(u_int32_t)); if (chk == DB_txn_ckp) { lp->chkpt_lsn = lsn; found_checkpoint = 1; } } /* * We now know where the end of the log is. Set the first LSN that * we want to return to an application and the LSN of the last known * record on disk. */ lp->lsn = lp->s_lsn = lsn; lp->lsn.offset += dblp->c_len; /* Set up the current buffer information, too. */ lp->len = dblp->c_len; lp->b_off = 0; lp->w_off = lp->lsn.offset; /* * It's possible that we didn't find a checkpoint because there wasn't * one in the last log file. Start searching. */ while (!found_checkpoint && cnt > 1) { lsn.file = --cnt; lsn.offset = 0; /* Set the cursor. Shouldn't fail, leave error messages on. */ if ((ret = CDB___log_get(dblp, &lsn, &dbt, DB_SET, 0)) != 0) return (ret); /* * Read to the end of the file, saving checkpoints. Again, * this can fail if there are no checkpoints in any log file, * so turn error messages off. */ while (CDB___log_get(dblp, &lsn, &dbt, DB_NEXT, 1) == 0) { if (dbt.size < sizeof(u_int32_t)) continue; memcpy(&chk, dbt.data, sizeof(u_int32_t)); if (chk == DB_txn_ckp) { lp->chkpt_lsn = lsn; found_checkpoint = 1; } } } /* If we never find a checkpoint, that's okay, just 0 it out. */ if (!found_checkpoint) ZERO_LSN(lp->chkpt_lsn); /* * Reset the cursor lsn to the beginning of the log, so that an * initial call to DB_NEXT does the right thing. */ ZERO_LSN(dblp->c_lsn); if (FLD_ISSET(dblp->dbenv->verbose, DB_VERB_RECOVERY)) CDB___db_err(dblp->dbenv, "Finding last valid log LSN: file: %lu offset %lu", (u_long)lp->lsn.file, (u_long)lp->lsn.offset); return (0); } /* * CDB___log_find -- * Try to find a log file. If find_first is set, valp will contain * the number of the first log file, else it will contain the number of * the last log file. * * PUBLIC: int CDB___log_find __P((DB_LOG *, int, int *)); */ int CDB___log_find(dblp, find_first, valp) DB_LOG *dblp; int find_first, *valp; { u_int32_t clv, logval; int cnt, fcnt, ret; const char *dir; char **names, *p, *q; *valp = 0; /* Find the directory name. */ if ((ret = CDB___log_name(dblp, 1, &p, NULL, 0)) != 0) return (ret); if ((q = CDB___db_rpath(p)) == NULL) dir = PATH_DOT; else { *q = '\0'; dir = p; } /* Get the list of file names. */ ret = CDB___os_dirlist(dir, &names, &fcnt); /* * !!! * We overwrote a byte in the string with a nul. We have to restore * the string so that the diagnostic checks in the memory allocation * code work. */ if (q != NULL) *q = 'a'; CDB___os_freestr(p); if (ret != 0) { CDB___db_err(dblp->dbenv, "%s: %s", dir, CDB_db_strerror(ret)); return (ret); } /* * Search for a valid log file name, return a value of 0 on * failure. * * XXX * Assumes that atoi(3) returns a 32-bit number. */ for (cnt = fcnt, clv = logval = 0; --cnt >= 0;) { if (strncmp(names[cnt], LFPREFIX, sizeof(LFPREFIX) - 1) != 0) continue; clv = atoi(names[cnt] + (sizeof(LFPREFIX) - 1)); if (find_first) { if (logval != 0 && clv > logval) continue; } else if (logval != 0 && clv < logval) continue; if (CDB___log_valid(dblp, clv, 1) == 0) logval = clv; } *valp = logval; /* Discard the list. */ CDB___os_dirfree(names, fcnt); return (0); } /* * log_valid -- * Validate a log file. * * PUBLIC: int CDB___log_valid __P((DB_LOG *, u_int32_t, int)); */ int CDB___log_valid(dblp, number, set_persist) DB_LOG *dblp; u_int32_t number; int set_persist; { DB_FH fh; LOG *region; LOGP persist; ssize_t nw; int ret; char *fname; /* Try to open the log file. */ if ((ret = CDB___log_name(dblp, number, &fname, &fh, DB_OSO_RDONLY | DB_OSO_SEQ)) != 0) { CDB___os_freestr(fname); return (ret); } /* Try to read the header. */ if ((ret = CDB___os_seek(&fh, 0, 0, sizeof(HDR), 0, DB_OS_SEEK_SET)) != 0 || (ret = CDB___os_read(&fh, &persist, sizeof(LOGP), &nw)) != 0 || nw != sizeof(LOGP)) { if (ret == 0) ret = EIO; (void)CDB___os_closehandle(&fh); CDB___db_err(dblp->dbenv, "Ignoring log file: %s: %s", fname, CDB_db_strerror(ret)); goto err; } (void)CDB___os_closehandle(&fh); /* Validate the header. */ if (persist.magic != DB_LOGMAGIC) { CDB___db_err(dblp->dbenv, "Ignoring log file: %s: magic number %lx, not %lx", fname, (u_long)persist.magic, (u_long)DB_LOGMAGIC); ret = EINVAL; goto err; } if (persist.version < DB_LOGOLDVER || persist.version > DB_LOGVERSION) { CDB___db_err(dblp->dbenv, "Ignoring log file: %s: unsupported log version %lu", fname, (u_long)persist.version); ret = EINVAL; goto err; } /* * If we're going to use this log file, set the region's persistent * information based on the headers. */ if (set_persist) { region = dblp->reginfo.primary; region->persist.lg_max = persist.lg_max; region->persist.mode = persist.mode; } ret = 0; err: CDB___os_freestr(fname); return (ret); } /* * CDB___log_close -- * Internal version of log_close: only called from db_appinit. * * PUBLIC: int CDB___log_close __P((DB_ENV *)); */ int CDB___log_close(dbenv) DB_ENV *dbenv; { DB_LOG *dblp; int ret, t_ret; ret = 0; dblp = dbenv->lg_handle; /* We may have opened files as part of XA; if so, close them. */ CDB___log_close_files(dbenv); /* Discard the per-thread lock. */ if (dblp->mutexp != NULL) CDB___db_mutex_free(dbenv, &dblp->reginfo, dblp->mutexp); /* Detach from the region. */ ret = CDB___db_r_detach(dbenv, &dblp->reginfo, 0); /* Close open files, release allocated memory. */ if (F_ISSET(&dblp->lfh, DB_FH_VALID) && (t_ret = CDB___os_closehandle(&dblp->lfh)) != 0 && ret == 0) ret = t_ret; if (dblp->c_dbt.data != NULL) CDB___os_free(dblp->c_dbt.data, dblp->c_dbt.ulen); if (F_ISSET(&dblp->c_fh, DB_FH_VALID) && (t_ret = CDB___os_closehandle(&dblp->c_fh)) != 0 && ret == 0) ret = t_ret; if (dblp->dbentry != NULL) CDB___os_free(dblp->dbentry, (dblp->dbentry_cnt * sizeof(DB_ENTRY))); CDB___os_free(dblp, sizeof(*dblp)); return (ret); } /* * CDB_log_stat -- * Return LOG statistics. */ int CDB_log_stat(dbenv, statp, db_malloc) DB_ENV *dbenv; DB_LOG_STAT **statp; void *(*db_malloc) __P((size_t)); { DB_LOG *dblp; DB_LOG_STAT *stats; LOG *region; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); *statp = NULL; dblp = dbenv->lg_handle; region = dblp->reginfo.primary; if ((ret = CDB___os_malloc(sizeof(DB_LOG_STAT), db_malloc, &stats)) != 0) return (ret); /* Copy out the global statistics. */ R_LOCK(dbenv, &dblp->reginfo); *stats = region->stat; stats->st_magic = region->persist.magic; stats->st_version = region->persist.version; stats->st_mode = region->persist.mode; stats->st_lg_bsize = region->buffer_size; stats->st_lg_max = region->persist.lg_max; stats->st_region_wait = dblp->reginfo.rp->mutex.mutex_set_wait; stats->st_region_nowait = dblp->reginfo.rp->mutex.mutex_set_nowait; stats->st_regsize = dblp->reginfo.rp->size; stats->st_cur_file = region->lsn.file; stats->st_cur_offset = region->lsn.offset; R_UNLOCK(dbenv, &dblp->reginfo); *statp = stats; return (0); } �����������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log.h������������������������������������������������������������������������������0100644�0063146�0012731�00000012321�07427026535�013713� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)log.h 11.5 (Sleepycat) 9/18/99 */ #ifndef _LOG_H_ #define _LOG_H_ struct __db_log; typedef struct __db_log DB_LOG; struct __fname; typedef struct __fname FNAME; struct __hdr; typedef struct __hdr HDR; struct __log; typedef struct __log LOG; struct __log_persist; typedef struct __log_persist LOGP; #ifndef MAXLFNAME #define LFPREFIX "log." /* Log file name prefix. */ #define LFNAME "log.%010d" /* Log file name template. */ #define LFNAME_V1 "log.%05d" /* Log file name template, rev 1. */ #define MAXLFNAME 2000000000 /* Maximum log file name. */ #endif #define LG_MAX_DEFAULT (10 * MEGABYTE) /* 10 MB. */ #define LG_BSIZE_DEFAULT (32 * 1024) /* 32 KB. */ #define LG_BASE_REGION_SIZE (60 * 1024) /* 60 KB. */ /* * The log region isn't fixed size because we store the registered * file names there. */ #define LOG_REGION_SIZE (30 * 1024) /* * The per-process table that maps log file-id's to DB structures. */ typedef struct __db_entry { DB *dbp; /* Associated DB structure. */ u_int32_t refcount; /* Reference counted. */ u_int32_t count; /* Number of ops on a deleted db. */ int deleted; /* File was not found during open. */ } DB_ENTRY; /* * DB_LOG * Per-process log structure. */ struct __db_log { /* * These fields need to be protected for multi-threaded support. * * !!! * As this structure is allocated in per-process memory, the mutex may need * to be stored elsewhere on architectures unable to support mutexes in heap * memory, e.g., HP/UX 9. */ MUTEX *mutexp; /* Mutex for thread protection. */ DB_ENTRY *dbentry; /* Recovery file-id mapping. */ #define DB_GROW_SIZE 64 u_int32_t dbentry_cnt; /* Entries. Grows by DB_GROW_SIZE. */ /* * These fields are always accessed while the region lock is held, so they do * not have to be protected by the thread lock as well, OR, they are only used * when threads are not being used, i.e. most cursor operations are disallowed * on threaded logs. */ u_int32_t lfname; /* Log file "name". */ DB_FH lfh; /* Log file handle. */ DB_LSN c_lsn; /* Cursor: current LSN. */ DBT c_dbt; /* Cursor: return DBT structure. */ DB_FH c_fh; /* Cursor: file handle. */ u_int32_t c_off; /* Cursor: previous record offset. */ u_int32_t c_len; /* Cursor: current record length. */ u_int8_t *bufp; /* Region buffer. */ /* These fields are not protected. */ DB_ENV *dbenv; /* Reference to error information. */ REGINFO reginfo; /* Region information. */ /* * These fields are used by XA; since XA forbids threaded execution, these * do not have to be protected. */ void *xa_info; /* Committed transaction list that * has to be carried between calls * to xa_recover. */ DB_LSN xa_lsn; /* Position of an XA recovery scan. */ DB_LSN xa_first; /* LSN to which we need to roll back for this XA recovery scan. */ /* * !!! * Currently used to hold: * DBC_RECOVER (a DBC flag) */ u_int32_t flags; }; /* * HDR -- * Log record header. */ struct __hdr { u_int32_t prev; /* Previous offset. */ u_int32_t cksum; /* Current checksum. */ u_int32_t len; /* Current length. */ }; struct __log_persist { u_int32_t magic; /* DB_LOGMAGIC */ u_int32_t version; /* DB_LOGVERSION */ u_int32_t lg_max; /* Maximum file size. */ int mode; /* Log file mode. */ }; /* * LOG -- * Shared log region. One of these is allocated in shared memory, * and describes the log. */ struct __log { LOGP persist; /* Persistent information. */ SH_TAILQ_HEAD(__fq) fq; /* List of file names. */ /* * The lsn LSN is the file offset that we're about to write and which * we will return to the user. */ DB_LSN lsn; /* LSN at current file offset. */ /* * The s_lsn LSN is the last LSN that we know is on disk, not just * written, but synced. */ DB_LSN s_lsn; /* LSN of the last sync. */ u_int32_t len; /* Length of the last record. */ u_int32_t w_off; /* Current write offset in the file. */ DB_LSN chkpt_lsn; /* LSN of the last checkpoint. */ time_t chkpt; /* Time of the last checkpoint. */ DB_LOG_STAT stat; /* Log statistics. */ /* * The f_lsn LSN is the LSN (returned to the user) that "owns" the * first byte of the buffer. If the record associated with the LSN * spans buffers, it may not reflect the physical file location of * the first byte of the buffer. */ DB_LSN f_lsn; /* LSN of first byte in the buffer. */ size_t b_off; /* Current offset in the buffer. */ roff_t buffer_off; /* Log buffer offset. */ u_int32_t buffer_size; /* Log buffer size. */ }; /* * FNAME -- * File name and id. */ struct __fname { SH_TAILQ_ENTRY q; /* File name queue. */ u_int16_t ref; /* Reference count. */ int32_t id; /* Logging file id. */ DBTYPE s_type; /* Saved DB type. */ roff_t name_off; /* Name offset. */ u_int8_t ufid[DB_FILE_ID_LEN]; /* Unique file id. */ }; /* File open/close register log record opcodes. */ #define LOG_CHECKPOINT 1 /* Checkpoint: file name/id dump. */ #define LOG_CLOSE 2 /* File close. */ #define LOG_OPEN 3 /* File open. */ #include "log_auto.h" #include "log_ext.h" #endif /* _LOG_H_ */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log.src����������������������������������������������������������������������������0100644�0063146�0012731�00000001363�07427026535�014257� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998 * Sleepycat Software. All rights reserved. * * @(#)log.src 10.6 (Sleepycat) 7/28/99 */ PREFIX log INCLUDE #include "db_config.h" INCLUDE INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include <sys/types.h> INCLUDE INCLUDE #include <ctype.h> INCLUDE #include <string.h> INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" INCLUDE #include "db_page.h" INCLUDE #include "db_dispatch.h" INCLUDE #include "db_am.h" INCLUDE #include "log.h" INCLUDE #include "txn.h" INCLUDE /* Used for registering name/id translations at open or close. */ BEGIN register ARG opcode u_int32_t lu DBT name DBT s DBT uid DBT s ARG id u_int32_t lu ARG ftype DBTYPE lx END �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_archive.c����������������������������������������������������������������������0100644�0063146�0012731�00000024075�10000513627�015400� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)CDB_log_archive.c 11.2 (Sleepycat) 9/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER /* _WIN32 */ #include <direct.h> #else #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "db_dispatch.h" #include "log.h" static int CDB___absname __P((char *, char *, char **)); static int CDB___build_data __P((DB_ENV *, char *, char ***, void *(*)(size_t))); static int CDB___cmpfunc __P((const void *, const void *)); static int CDB___usermem __P((char ***, void *(*)(size_t))); /* * CDB_log_archive -- * Supporting function for db_archive(1). */ int CDB_log_archive(dbenv, listp, flags, db_malloc) DB_ENV *dbenv; char ***listp; u_int32_t flags; void *(*db_malloc) __P((size_t)); { DBT rec; DB_LOG *dblp; DB_LSN stable_lsn; u_int32_t fnum; int array_size, n, ret; char **array, **arrayp, *name, *p, *pref, buf[MAXPATHLEN]; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); name = NULL; dblp = dbenv->lg_handle; COMPQUIET(fnum, 0); #define OKFLAGS (DB_ARCH_ABS | DB_ARCH_DATA | DB_ARCH_LOG) if (flags != 0) { if ((ret = CDB___db_fchk(dbenv, "CDB_log_archive", flags, OKFLAGS)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "CDB_log_archive", flags, DB_ARCH_DATA, DB_ARCH_LOG)) != 0) return (ret); } /* * Get the absolute pathname of the current directory. It would * be nice to get the shortest pathname of the database directory, * but that's just not possible. * * XXX * Can't trust getcwd(3) to set a valid errno. If it doesn't, just * guess that we ran out of memory. */ if (LF_ISSET(DB_ARCH_ABS)) { CDB___os_set_errno(0); if ((pref = getcwd(buf, sizeof(buf))) == NULL) { if (CDB___os_get_errno() == 0) CDB___os_set_errno(ENOMEM); return (CDB___os_get_errno()); } } else pref = NULL; switch (LF_ISSET(~DB_ARCH_ABS)) { case DB_ARCH_DATA: return (CDB___build_data(dbenv, pref, listp, db_malloc)); case DB_ARCH_LOG: memset(&rec, 0, sizeof(rec)); if (F_ISSET(dbenv, DB_ENV_THREAD)) F_SET(&rec, DB_DBT_MALLOC); if ((ret = CDB_log_get(dbenv, &stable_lsn, &rec, DB_LAST)) != 0) return (ret); if (F_ISSET(dbenv, DB_ENV_THREAD)) CDB___os_free(rec.data, rec.size); fnum = stable_lsn.file; break; case 0: if ((ret = CDB___log_findckp(dbenv, &stable_lsn)) != 0) { /* * A return of DB_NOTFOUND means that we didn't find * any records in the log (so we are not going to be * deleting any log files). */ if (ret != DB_NOTFOUND) return (ret); *listp = NULL; return (0); } /* Remove any log files before the last stable LSN. */ fnum = stable_lsn.file - 1; break; } #define LIST_INCREMENT 64 /* Get some initial space. */ array_size = 10; if ((ret = CDB___os_malloc(sizeof(char *) * array_size, NULL, &array)) != 0) return (ret); array[0] = NULL; /* Build an array of the file names. */ for (n = 0; fnum > 0; --fnum) { if ((ret = CDB___log_name(dblp, fnum, &name, NULL, 0)) != 0) goto err; if (CDB___os_exists(name, NULL) != 0) { CDB___os_freestr(name); name = NULL; break; } if (n >= array_size - 1) { array_size += LIST_INCREMENT; if ((ret = CDB___os_realloc( sizeof(char *) * array_size, NULL, &array)) != 0) goto err; } if (LF_ISSET(DB_ARCH_ABS)) { if ((ret = CDB___absname(pref, name, &array[n])) != 0) goto err; CDB___os_freestr(name); } else if ((p = CDB___db_rpath(name)) != NULL) { if ((ret = CDB___os_strdup(p + 1, &array[n])) != 0) goto err; CDB___os_freestr(name); } else array[n] = name; name = NULL; array[++n] = NULL; } /* If there's nothing to return, we're done. */ if (n == 0) { *listp = NULL; ret = 0; goto err; } /* Sort the list. */ qsort(array, (size_t)n, sizeof(char *), CDB___cmpfunc); /* Rework the memory. */ if ((ret = CDB___usermem(&array, db_malloc)) != 0) goto err; *listp = array; return (0); err: if (array != NULL) { for (arrayp = array; *arrayp != NULL; ++arrayp) CDB___os_freestr(*arrayp); CDB___os_free(array, sizeof(char *) * array_size); } if (name != NULL) CDB___os_freestr(name); return (ret); } /* * CDB___build_data -- * Build a list of datafiles for return. */ static int CDB___build_data(dbenv, pref, listp, db_malloc) DB_ENV *dbenv; char *pref, ***listp; void *(*db_malloc) __P((size_t)); { DBT rec; DB_LOG *dblp; DB_LSN lsn; __log_register_args *argp; u_int32_t rectype; int array_size, last, n, nxt, ret; char **array, **arrayp, *p, *real_name; dblp = dbenv->lg_handle; /* Get some initial space. */ array_size = 10; if ((ret = CDB___os_malloc(sizeof(char *) * array_size, NULL, &array)) != 0) return (ret); array[0] = NULL; memset(&rec, 0, sizeof(rec)); if (F_ISSET(dbenv, DB_ENV_THREAD)) F_SET(&rec, DB_DBT_MALLOC); for (n = 0, ret = CDB_log_get(dbenv, &lsn, &rec, DB_FIRST); ret == 0; ret = CDB_log_get(dbenv, &lsn, &rec, DB_NEXT)) { if (rec.size < sizeof(rectype)) { ret = EINVAL; CDB___db_err(dbenv, "CDB_log_archive: bad log record"); goto lg_free; } memcpy(&rectype, rec.data, sizeof(rectype)); if (rectype != DB_log_register) { if (F_ISSET(dbenv, DB_ENV_THREAD)) { CDB___os_free(rec.data, rec.size); rec.data = NULL; } continue; } if ((ret = CDB___log_register_read(rec.data, &argp)) != 0) { ret = EINVAL; CDB___db_err(dbenv, "CDB_log_archive: unable to read log record"); goto lg_free; } if (n >= array_size - 1) { array_size += LIST_INCREMENT; if ((ret = CDB___os_realloc(sizeof(char *) * array_size, NULL, &array)) != 0) goto lg_free; } if ((ret = CDB___os_strdup(argp->name.data, &array[n])) != 0) { lg_free: if (F_ISSET(&rec, DB_DBT_MALLOC) && rec.data != NULL) CDB___os_free(rec.data, rec.size); goto err1; } array[++n] = NULL; CDB___os_free(argp, 0); if (F_ISSET(dbenv, DB_ENV_THREAD)) { CDB___os_free(rec.data, rec.size); rec.data = NULL; } } /* If there's nothing to return, we're done. */ if (n == 0) { ret = 0; *listp = NULL; goto err1; } /* Sort the list. */ qsort(array, (size_t)n, sizeof(char *), CDB___cmpfunc); /* * Build the real pathnames, discarding nonexistent files and * duplicates. */ for (last = nxt = 0; nxt < n;) { /* * Discard duplicates. Last is the next slot we're going * to return to the user, nxt is the next slot that we're * going to consider. */ if (last != nxt) { array[last] = array[nxt]; array[nxt] = NULL; } for (++nxt; nxt < n && strcmp(array[last], array[nxt]) == 0; ++nxt) { CDB___os_freestr(array[nxt]); array[nxt] = NULL; } /* Get the real name. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, array[last], 0, NULL, &real_name)) != 0) goto err2; /* If the file doesn't exist, ignore it. */ if (CDB___os_exists(real_name, NULL) != 0) { CDB___os_freestr(real_name); CDB___os_freestr(array[last]); array[last] = NULL; continue; } /* Rework the name as requested by the user. */ CDB___os_freestr(array[last]); array[last] = NULL; if (pref != NULL) { ret = CDB___absname(pref, real_name, &array[last]); CDB___os_freestr(real_name); if (ret != 0) goto err2; } else if ((p = CDB___db_rpath(real_name)) != NULL) { ret = CDB___os_strdup(p + 1, &array[last]); CDB___os_freestr(real_name); if (ret != 0) goto err2; } else array[last] = real_name; ++last; } /* NULL-terminate the list. */ array[last] = NULL; /* Rework the memory. */ if ((ret = CDB___usermem(&array, db_malloc)) != 0) goto err1; *listp = array; return (0); err2: /* * XXX * We've possibly inserted NULLs into the array list, so clean up a * bit so that the other error processing works. */ if (array != NULL) for (; nxt < n; ++nxt) CDB___os_freestr(array[nxt]); /* FALLTHROUGH */ err1: if (array != NULL) { for (arrayp = array; *arrayp != NULL; ++arrayp) CDB___os_freestr(*arrayp); CDB___os_free(array, array_size * sizeof(char *)); } return (ret); } /* * CDB___absname -- * Return an absolute path name for the file. */ static int CDB___absname(pref, name, newnamep) char *pref, *name, **newnamep; { size_t l_pref, l_name; int isabspath, ret; char *newname; l_name = strlen(name); isabspath = CDB___os_abspath(name); l_pref = isabspath ? 0 : strlen(pref); /* Malloc space for concatenating the two. */ if ((ret = CDB___os_malloc(l_pref + l_name + 2, NULL, &newname)) != 0) return (ret); *newnamep = newname; /* Build the name. If `name' is an absolute path, ignore any prefix. */ if (!isabspath) { memcpy(newname, pref, l_pref); if (strchr(PATH_SEPARATOR, newname[l_pref - 1]) == NULL) newname[l_pref++] = PATH_SEPARATOR[0]; } memcpy(newname + l_pref, name, l_name + 1); return (0); } /* * CDB___usermem -- * Create a single chunk of memory that holds the returned information. * If the user has their own malloc routine, use it. */ static int CDB___usermem(listp, db_malloc) char ***listp; void *(*db_malloc) __P((size_t)); { size_t len; int ret; char **array, **arrayp, **orig, *strp; /* Find out how much space we need. */ for (len = 0, orig = *listp; *orig != NULL; ++orig) len += sizeof(char *) + strlen(*orig) + 1; len += sizeof(char *); /* Allocate it and set up the pointers. */ if ((ret = CDB___os_malloc(len, db_malloc, &array)) != 0) return (ret); strp = (char *)(array + (orig - *listp) + 1); /* Copy the original information into the new memory. */ for (orig = *listp, arrayp = array; *orig != NULL; ++orig, ++arrayp) { len = strlen(*orig); memcpy(strp, *orig, len + 1); *arrayp = strp; strp += len + 1; CDB___os_freestr(*orig); } /* NULL-terminate the list. */ *arrayp = NULL; CDB___os_free(*listp, 0); *listp = array; return (0); } static int CDB___cmpfunc(p1, p2) const void *p1, *p2; { return (strcmp(*((char * const *)p1), *((char * const *)p2))); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_auto.c�������������������������������������������������������������������������0100644�0063146�0012731�00000012100�07427026535�014731� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "log.h" #include "txn.h" int CDB___log_register_log(dbenv, txnid, ret_lsnp, flags, opcode, name, uid, id, ftype) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; const DBT *name; const DBT *uid; u_int32_t id; DBTYPE ftype; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_log_register; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(u_int32_t) + (name == NULL ? 0 : name->size) + sizeof(u_int32_t) + (uid == NULL ? 0 : uid->size) + sizeof(id) + sizeof(ftype); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); if (name == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &name->size, sizeof(name->size)); bp += sizeof(name->size); memcpy(bp, name->data, name->size); bp += name->size; } if (uid == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &uid->size, sizeof(uid->size)); bp += sizeof(uid->size); memcpy(bp, uid->data, uid->size); bp += uid->size; } memcpy(bp, &id, sizeof(id)); bp += sizeof(id); memcpy(bp, &ftype, sizeof(ftype)); bp += sizeof(ftype); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB___log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___log_register_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __log_register_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___log_register_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]CDB_log_register: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tname: "); for (i = 0; i < argp->name.size; i++) { ch = ((u_int8_t *)argp->name.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tuid: "); for (i = 0; i < argp->uid.size; i++) { ch = ((u_int8_t *)argp->uid.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tid: %lu\n", (u_long)argp->id); printf("\tftype: 0x%lx\n", (u_long)argp->ftype); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___log_register_read(recbuf, argpp) void *recbuf; __log_register_args **argpp; { __log_register_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__log_register_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memset(&argp->name, 0, sizeof(argp->name)); memcpy(&argp->name.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->name.data = bp; bp += argp->name.size; memset(&argp->uid, 0, sizeof(argp->uid)); memcpy(&argp->uid.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->uid.data = bp; bp += argp->uid.size; memcpy(&argp->id, bp, sizeof(argp->id)); bp += sizeof(argp->id); memcpy(&argp->ftype, bp, sizeof(argp->ftype)); bp += sizeof(argp->ftype); *argpp = argp; return (0); } int CDB___log_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___log_register_print, DB_log_register)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___log_init_recover __P((DB_ENV *)); */ int CDB___log_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___log_register_recover, DB_log_register)) != 0) return (ret); return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_auto.h�������������������������������������������������������������������������0100644�0063146�0012731�00000001203�07427026535�014740� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef log_AUTO_H #define log_AUTO_H #define DB_log_register (DB_log_BEGIN + 1) typedef struct _log_register_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; DBT name; DBT uid; u_int32_t id; DBTYPE ftype; } __log_register_args; int CDB___log_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, DBTYPE)); int CDB___log_register_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___log_register_read __P((void *, __log_register_args **)); int CDB___log_init_print __P((DB_ENV *)); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_compare.c����������������������������������������������������������������������0100644�0063146�0012731�00000001303�07427026535�015412� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)CDB_log_compare.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" /* * CDB_log_compare -- * Compare two LSN's; return 1, 0, -1 if first is >, == or < second. */ int CDB_log_compare(lsn0, lsn1) const DB_LSN *lsn0, *lsn1; { if (lsn0->file != lsn1->file) return (lsn0->file < lsn1->file ? -1 : 1); if (lsn0->offset != lsn1->offset) return (lsn0->offset < lsn1->offset ? -1 : 1); return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_ext.h��������������������������������������������������������������������������0100644�0063146�0012731�00000001667�07427026535�014606� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _log_ext_h_ #define _log_ext_h_ int CDB___log_open __P((DB_ENV *)); int CDB___log_find __P((DB_LOG *, int, int *)); int CDB___log_valid __P((DB_LOG *, u_int32_t, int)); int CDB___log_close __P((DB_ENV *)); int CDB___log_init_recover __P((DB_ENV *)); int CDB___log_findckp __P((DB_ENV *, DB_LSN *)); int CDB___log_get __P((DB_LOG *, DB_LSN *, DBT *, u_int32_t, int)); void CDB___log_dbenv_create __P((DB_ENV *)); int CDB___log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); int CDB___log_name __P((DB_LOG *, u_int32_t, char **, DB_FH *, u_int32_t)); int CDB___log_register_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___log_add_logid __P((DB_LOG *, DB *, u_int32_t)); int CDB___db_fileid_to_db __P((DB_ENV *, DB **, int32_t, int)); void CDB___log_close_files __P((DB_ENV *)); void CDB___log_rem_logid __P((DB_LOG *, u_int32_t)); #endif /* _log_ext_h_ */ �������������������������������������������������������������������������htdig-3.2.0b6/db/log_findckp.c����������������������������������������������������������������������0100644�0063146�0012731�00000010351�07427026535�015405� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)log_findckp.c 11.1 (Sleepycat) 7/24/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "log.h" #include "txn.h" /* * CDB___log_findckp -- * * Looks for the most recent checkpoint that occurs before the most recent * checkpoint LSN, subject to the constraint that there must be at least two * checkpoints. The reason you need two checkpoints is that you might have * crashed during the most recent one and may not have a copy of all the * open files. This is the point from which recovery can start and the * point up to which archival/truncation can take place. Checkpoints in * the log look like: * * ------------------------------------------------------------------- * | ckp A, ckplsn 100 | .... record .... | ckp B, ckplsn 600 | ... * ------------------------------------------------------------------- * LSN 500 LSN 1000 * * If we read what log returns from using the DB_CKP parameter to logput, * we'll get the record at LSN 1000. The checkpoint LSN there is 600. * Now we have to scan backwards looking for a checkpoint before LSN 600. * We find one at 500. This means that we can truncate the log before * 500 or run recovery beginning at 500. * * Returns 0 if we find a suitable checkpoint or we retrieved the first * record in the log from which to start. Returns DB_NOTFOUND if there * are no log records, errno on error. * * PUBLIC: int CDB___log_findckp __P((DB_ENV *, DB_LSN *)); */ int CDB___log_findckp(dbenv, lsnp) DB_ENV *dbenv; DB_LSN *lsnp; { DBT data; DB_LSN ckp_lsn, final_ckp, last_ckp, next_lsn; __txn_ckp_args *ckp_args; int ret; /* * Need to find the appropriate point from which to begin * recovery. */ memset(&data, 0, sizeof(data)); if (F_ISSET(dbenv, DB_ENV_THREAD)) F_SET(&data, DB_DBT_MALLOC); ZERO_LSN(ckp_lsn); if ((ret = CDB_log_get(dbenv, &last_ckp, &data, DB_CHECKPOINT)) != 0) { if (ret == ENOENT) goto get_first; else return (ret); } final_ckp = last_ckp; next_lsn = last_ckp; do { if (F_ISSET(dbenv, DB_ENV_THREAD)) CDB___os_free(data.data, data.size); if ((ret = CDB_log_get(dbenv, &next_lsn, &data, DB_SET)) != 0) return (ret); if ((ret = CDB___txn_ckp_read(data.data, &ckp_args)) != 0) { if (F_ISSET(dbenv, DB_ENV_THREAD)) CDB___os_free(data.data, data.size); return (ret); } if (IS_ZERO_LSN(ckp_lsn)) ckp_lsn = ckp_args->ckp_lsn; if (FLD_ISSET(dbenv->verbose, DB_VERB_CHKPOINT)) { CDB___db_err(dbenv, "Checkpoint at: [%lu][%lu]", (u_long)last_ckp.file, (u_long)last_ckp.offset); CDB___db_err(dbenv, "Checkpoint LSN: [%lu][%lu]", (u_long)ckp_args->ckp_lsn.file, (u_long)ckp_args->ckp_lsn.offset); CDB___db_err(dbenv, "Previous checkpoint: [%lu][%lu]", (u_long)ckp_args->last_ckp.file, (u_long)ckp_args->last_ckp.offset); } last_ckp = next_lsn; next_lsn = ckp_args->last_ckp; CDB___os_free(ckp_args, sizeof(*ckp_args)); /* * Keep looping until either you 1) run out of checkpoints, * 2) you've found a checkpoint before the most recent * checkpoint's LSN and you have at least 2 checkpoints. */ } while (!IS_ZERO_LSN(next_lsn) && (CDB_log_compare(&last_ckp, &ckp_lsn) > 0 || CDB_log_compare(&final_ckp, &last_ckp) == 0)); if (F_ISSET(dbenv, DB_ENV_THREAD)) CDB___os_free(data.data, data.size); /* * At this point, either, next_lsn is ZERO or ckp_lsn is the * checkpoint lsn and last_ckp is the LSN of the last checkpoint * before ckp_lsn. If the compare in the loop is still true, then * next_lsn must be 0 and we need to roll forward from the * beginning of the log. */ if (CDB_log_compare(&last_ckp, &ckp_lsn) >= 0 || CDB_log_compare(&final_ckp, &last_ckp) == 0) { get_first: if ((ret = CDB_log_get(dbenv, &last_ckp, &data, DB_FIRST)) != 0) return (ret); if (F_ISSET(dbenv, DB_ENV_THREAD)) CDB___os_free(data.data, data.size); } *lsnp = last_ckp; return (IS_ZERO_LSN(last_ckp) ? DB_NOTFOUND : 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_get.c��������������������������������������������������������������������������0100644�0063146�0012731�00000021412�10000513630�014520� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)CDB_log_get.c 11.4 (Sleepycat) 9/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "db_page.h" #include "log.h" #include "hash.h" /* * CDB_log_get -- * Get a log record. */ int CDB_log_get(dbenv, alsn, dbt, flags) DB_ENV *dbenv; DB_LSN *alsn; DBT *dbt; u_int32_t flags; { DB_LOG *dblp; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); /* Validate arguments. */ if (flags != DB_CHECKPOINT && flags != DB_CURRENT && flags != DB_FIRST && flags != DB_LAST && flags != DB_NEXT && flags != DB_PREV && flags != DB_SET) return (CDB___db_ferr(dbenv, "CDB_log_get", 1)); if (F_ISSET(dbenv, DB_ENV_THREAD)) { if (flags == DB_NEXT || flags == DB_PREV || flags == DB_CURRENT) return (CDB___db_ferr(dbenv, "CDB_log_get", 1)); if (!F_ISSET(dbt, DB_DBT_MALLOC | DB_DBT_REALLOC | DB_DBT_USERMEM)) return (CDB___db_ferr(dbenv, "threaded data", 1)); } dblp = dbenv->lg_handle; R_LOCK(dbenv, &dblp->reginfo); /* * If we get one of the log's header records, repeat the operation. * This assumes that applications don't ever request the log header * records by LSN, but that seems reasonable to me. */ ret = CDB___log_get(dblp, alsn, dbt, flags, 0); if (ret == 0 && alsn->offset == 0) { switch (flags) { case DB_FIRST: flags = DB_NEXT; break; case DB_LAST: flags = DB_PREV; break; } ret = CDB___log_get(dblp, alsn, dbt, flags, 0); } R_UNLOCK(dbenv, &dblp->reginfo); return (ret); } /* * CDB___log_get -- * Get a log record; internal version. * * PUBLIC: int CDB___log_get __P((DB_LOG *, DB_LSN *, DBT *, u_int32_t, int)); */ int CDB___log_get(dblp, alsn, dbt, flags, silent) DB_LOG *dblp; DB_LSN *alsn; DBT *dbt; u_int32_t flags; int silent; { DB_LSN nlsn; HDR hdr; LOG *lp; size_t len; ssize_t nr; int cnt, ret; char *np, *tbuf; const char *fail; void *shortp; u_int8_t *p; lp = dblp->reginfo.primary; fail = np = tbuf = NULL; nlsn = dblp->c_lsn; switch (flags) { case DB_CHECKPOINT: nlsn = lp->chkpt_lsn; if (IS_ZERO_LSN(nlsn)) { ret = ENOENT; goto err2; } break; case DB_NEXT: /* Next log record. */ if (!IS_ZERO_LSN(nlsn)) { /* Increment the cursor by the cursor record size. */ nlsn.offset += dblp->c_len; break; } /* FALLTHROUGH */ case DB_FIRST: /* Find the first log record. */ /* Find the first log file. */ if ((ret = CDB___log_find(dblp, 1, &cnt)) != 0) goto err2; /* * We may have only entered records in the buffer, and not * yet written a log file. If no log files were found and * there's anything in the buffer, it belongs to file 1. */ if (cnt == 0) cnt = 1; nlsn.file = cnt; nlsn.offset = 0; break; case DB_CURRENT: /* Current log record. */ break; case DB_PREV: /* Previous log record. */ if (!IS_ZERO_LSN(nlsn)) { /* If at start-of-file, move to the previous file. */ if (nlsn.offset == 0) { if (nlsn.file == 1 || CDB___log_valid(dblp, nlsn.file - 1, 0) != 0) return (DB_NOTFOUND); --nlsn.file; nlsn.offset = dblp->c_off; } else nlsn.offset = dblp->c_off; break; } /* FALLTHROUGH */ case DB_LAST: /* Last log record. */ nlsn.file = lp->lsn.file; nlsn.offset = lp->lsn.offset - lp->len; break; case DB_SET: /* Set log record. */ nlsn = *alsn; break; } if (0) { /* Move to the next file. */ next_file: ++nlsn.file; nlsn.offset = 0; } /* Return 1 if the request is past the end of the log. */ if (nlsn.file > lp->lsn.file || (nlsn.file == lp->lsn.file && nlsn.offset >= lp->lsn.offset)) return (DB_NOTFOUND); /* If we've switched files, discard the current file handle. */ if (dblp->c_lsn.file != nlsn.file && F_ISSET(&dblp->c_fh, DB_FH_VALID)) (void)CDB___os_closehandle(&dblp->c_fh); /* If the entire record is in the in-memory buffer, copy it out. */ if (nlsn.file == lp->lsn.file && nlsn.offset >= lp->w_off) { /* Copy the header. */ p = dblp->bufp + (nlsn.offset - lp->w_off); memcpy(&hdr, p, sizeof(HDR)); /* Copy the record. */ len = hdr.len - sizeof(HDR); if ((ret = CDB___db_retcopy(NULL, dbt, p + sizeof(HDR), len, &dblp->c_dbt.data, &dblp->c_dbt.ulen)) != 0) goto err1; goto cksum; } /* Acquire a file descriptor. */ if (!F_ISSET(&dblp->c_fh, DB_FH_VALID)) { if ((ret = CDB___log_name(dblp, nlsn.file, &np, &dblp->c_fh, DB_OSO_RDONLY | DB_OSO_SEQ)) != 0) { fail = np; goto err1; } CDB___os_freestr(np); np = NULL; } /* * Seek to the header offset and read the header. Because the file * may be pre-allocated, we have to make sure that we're not reading * past the information in the start of the in-memory buffer. */ if ((ret = CDB___os_seek( &dblp->c_fh, 0, 0, nlsn.offset, 0, DB_OS_SEEK_SET)) != 0) { fail = "seek"; goto err1; } if (nlsn.file == lp->lsn.file && nlsn.offset + sizeof(HDR) > lp->w_off) nr = lp->w_off - nlsn.offset; else nr = sizeof(HDR); if ((ret = CDB___os_read(&dblp->c_fh, &hdr, nr, &nr)) != 0) { fail = "read"; goto err1; } if (nr == sizeof(HDR)) shortp = NULL; else { /* If read returns EOF, try the next file. */ if (nr == 0) { if (flags != DB_NEXT || nlsn.file == lp->lsn.file) goto corrupt; goto next_file; } /* * If read returns a short count the rest of the record has * to be in the in-memory buffer. */ if (lp->b_off < sizeof(HDR) - nr) goto corrupt; /* Get the rest of the header from the in-memory buffer. */ memcpy((u_int8_t *)&hdr + nr, dblp->bufp, sizeof(HDR) - nr); shortp = dblp->bufp + (sizeof(HDR) - nr); } /* * Check for buffers of 0's, that's what we usually see during recovery, * although it's certainly not something on which we can depend. Check * for impossibly large records. The malloc should fail later, but we * have customers that run mallocs that handle allocation failure as a * fatal error. */ if (hdr.len == 0) goto next_file; if (hdr.len <= sizeof(HDR) || hdr.len > lp->persist.lg_max) goto corrupt; len = hdr.len - sizeof(HDR); /* If we've already moved to the in-memory buffer, fill from there. */ if (shortp != NULL) { if (lp->b_off < ((u_int8_t *)shortp - dblp->bufp) + len) goto corrupt; if ((ret = CDB___db_retcopy(NULL, dbt, shortp, len, &dblp->c_dbt.data, &dblp->c_dbt.ulen)) != 0) goto err1; goto cksum; } /* * Allocate temporary memory to hold the record. * * XXX * We're calling malloc(3) with a region locked. This isn't * a good idea. */ if ((ret = CDB___os_malloc(len, NULL, &tbuf)) != 0) goto err1; /* * Read the record into the buffer. If read returns a short count, * there was an error or the rest of the record is in the in-memory * buffer. Note, the information may be garbage if we're in recovery, * so don't read past the end of the buffer's memory. * * Because the file may be pre-allocated, we have to make sure that * we're not reading past the information in the start of the in-memory * buffer. */ if (nlsn.file == lp->lsn.file && nlsn.offset + sizeof(HDR) + len > lp->w_off) nr = lp->w_off - (nlsn.offset + sizeof(HDR)); else nr = len; if ((ret = CDB___os_read(&dblp->c_fh, tbuf, nr, &nr)) != 0) { fail = "read"; goto err1; } if (len - nr > lp->buffer_size) goto corrupt; if (nr != (ssize_t)len) { if (lp->b_off < len - nr) goto corrupt; /* Get the rest of the record from the in-memory buffer. */ memcpy((u_int8_t *)tbuf + nr, dblp->bufp, len - nr); } /* Copy the record into the user's DBT. */ if ((ret = CDB___db_retcopy(NULL, dbt, tbuf, len, &dblp->c_dbt.data, &dblp->c_dbt.ulen)) != 0) goto err1; CDB___os_free(tbuf, 0); tbuf = NULL; cksum: if (hdr.cksum != CDB___ham_func4(dbt->data, dbt->size)) { if (!silent) CDB___db_err(dblp->dbenv, "CDB_log_get: checksum mismatch"); goto corrupt; } /* Update the cursor and the return lsn. */ dblp->c_off = hdr.prev; dblp->c_len = hdr.len; dblp->c_lsn = *alsn = nlsn; return (0); corrupt:/* * This is the catchall -- for some reason we didn't find enough * information or it wasn't reasonable information, and it wasn't * because a system call failed. */ ret = EIO; fail = "read"; err1: if (!silent) { if (fail == NULL) CDB___db_err(dblp->dbenv, "CDB_log_get: %s", CDB_db_strerror(ret)); else CDB___db_err(dblp->dbenv, "CDB_log_get: %s: %s", fail, CDB_db_strerror(ret)); } err2: if (np != NULL) CDB___os_freestr(np); if (tbuf != NULL) CDB___os_free(tbuf, 0); return (ret); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_method.c�����������������������������������������������������������������������0100644�0063146�0012731�00000003423�10000513630�015223� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)log_method.c 11.3 (Sleepycat) 8/11/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif /* !NO_SYSTEM_INCLUDES */ #include "db_int.h" #include "log.h" static int CDB___log_set_lg_max __P((DB_ENV *, u_int32_t)); static int CDB___log_set_lg_bsize __P((DB_ENV *, u_int32_t)); /* * CDB___log_dbenv_create -- * Log specific initialization of the DB_ENV structure. * * PUBLIC: void CDB___log_dbenv_create __P((DB_ENV *)); */ void CDB___log_dbenv_create(dbenv) DB_ENV *dbenv; { dbenv->lg_bsize = LG_BSIZE_DEFAULT; dbenv->set_lg_bsize = CDB___log_set_lg_bsize; dbenv->lg_max = LG_MAX_DEFAULT; dbenv->set_lg_max = CDB___log_set_lg_max; } /* * CDB___log_set_lg_bsize -- * Set the log buffer size. */ static int CDB___log_set_lg_bsize(dbenv, lg_bsize) DB_ENV *dbenv; u_int32_t lg_bsize; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lg_bsize"); /* Let's not be silly. */ if (lg_bsize > dbenv->lg_max / 4) { CDB___db_err(dbenv, "log buffer size must be <= log file size / 4"); return (EINVAL); } dbenv->lg_bsize = lg_bsize; return (0); } /* * CDB___log_set_lg_max -- * Set the maximum log file size. */ static int CDB___log_set_lg_max(dbenv, lg_max) DB_ENV *dbenv; u_int32_t lg_max; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_lg_max"); /* Let's not be silly. */ if (lg_max < dbenv->lg_bsize * 4) { CDB___db_err(dbenv, "log file size must be >= log buffer size * 4"); return (EINVAL); } dbenv->lg_max = lg_max; return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_put.c��������������������������������������������������������������������������0100644�0063146�0012731�00000037362�10000513630�014564� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)CDB_log_put.c 11.4 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <errno.h> #include <stdio.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "db_page.h" #include "log.h" #include "hash.h" static int CDB___log_fill __P((DB_LOG *, DB_LSN *, void *, u_int32_t)); static int CDB___log_flush __P((DB_LOG *, const DB_LSN *)); static int CDB___log_newfh __P((DB_LOG *)); static int CDB___log_putr __P((DB_LOG *, DB_LSN *, const DBT *, u_int32_t)); static int CDB___log_write __P((DB_LOG *, void *, u_int32_t)); /* * CDB_log_put -- * Write a log record. */ int CDB_log_put(dbenv, lsn, dbt, flags) DB_ENV *dbenv; DB_LSN *lsn; const DBT *dbt; u_int32_t flags; { DB_LOG *dblp; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); /* Validate arguments. */ if (flags != 0 && flags != DB_CHECKPOINT && flags != DB_CURLSN && flags != DB_FLUSH) return (CDB___db_ferr(dbenv, "CDB_log_put", 0)); dblp = dbenv->lg_handle; R_LOCK(dbenv, &dblp->reginfo); ret = CDB___log_put(dbenv, lsn, dbt, flags); R_UNLOCK(dbenv, &dblp->reginfo); return (ret); } /* * CDB___log_put -- * Write a log record; internal version. * * PUBLIC: int CDB___log_put __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); */ int CDB___log_put(dbenv, lsn, dbt, flags) DB_ENV *dbenv; DB_LSN *lsn; const DBT *dbt; u_int32_t flags; { DBT fid_dbt, t; DB_LOG *dblp; DB_LSN r_unused; FNAME *fnp; LOG *lp; u_int32_t lastoff; int ret; dblp = dbenv->lg_handle; lp = dblp->reginfo.primary; /* * If the application just wants to know where we are, fill in * the information. Currently used by the transaction manager * to avoid writing TXN_begin records. */ if (flags == DB_CURLSN) { lsn->file = lp->lsn.file; lsn->offset = lp->lsn.offset; return (0); } /* If this information won't fit in the file, swap files. */ if (lp->lsn.offset + sizeof(HDR) + dbt->size > lp->persist.lg_max) { if (sizeof(HDR) + sizeof(LOGP) + dbt->size > lp->persist.lg_max) { CDB___db_err(dbenv, "CDB_log_put: record larger than maximum file size"); return (EINVAL); } /* Flush the log. */ if ((ret = CDB___log_flush(dblp, NULL)) != 0) return (ret); /* * Save the last known offset from the previous file, we'll * need it to initialize the persistent header information. */ lastoff = lp->lsn.offset; /* Point the current LSN to the new file. */ ++lp->lsn.file; lp->lsn.offset = 0; /* Reset the file write offset. */ lp->w_off = 0; } else lastoff = 0; /* Initialize the LSN information returned to the user. */ lsn->file = lp->lsn.file; lsn->offset = lp->lsn.offset; /* * Insert persistent information as the first record in every file. * Note that the previous length is wrong for the very first record * of the log, but that's okay, we check for it during retrieval. */ if (lp->lsn.offset == 0) { t.data = &lp->persist; t.size = sizeof(LOGP); if ((ret = CDB___log_putr(dblp, lsn, &t, lastoff == 0 ? 0 : lastoff - lp->len)) != 0) return (ret); /* Update the LSN information returned to the user. */ lsn->file = lp->lsn.file; lsn->offset = lp->lsn.offset; } /* Write the application's log record. */ if ((ret = CDB___log_putr(dblp, lsn, dbt, lp->lsn.offset - lp->len)) != 0) return (ret); /* * On a checkpoint, we: * Put out the checkpoint record (above). * Save the LSN of the checkpoint in the shared region. * Append the set of file name information into the log. */ if (flags == DB_CHECKPOINT) { lp->chkpt_lsn = *lsn; for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname); fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) { if (fnp->ref == 0) /* Entry not in use. */ continue; memset(&t, 0, sizeof(t)); t.data = R_ADDR(&dblp->reginfo, fnp->name_off); t.size = strlen(t.data) + 1; memset(&fid_dbt, 0, sizeof(fid_dbt)); fid_dbt.data = fnp->ufid; fid_dbt.size = DB_FILE_ID_LEN; if ((ret = CDB___log_register_log(dbenv, NULL, &r_unused, 0, LOG_CHECKPOINT, &t, &fid_dbt, fnp->id, fnp->s_type)) != 0) return (ret); } } /* * On a checkpoint or when flush is requested, we: * Flush the current buffer contents to disk. * Sync the log to disk. */ if (flags == DB_FLUSH || flags == DB_CHECKPOINT) if ((ret = CDB___log_flush(dblp, NULL)) != 0) return (ret); /* * On a checkpoint, we: * Save the time the checkpoint was written. * Reset the bytes written since the last checkpoint. */ if (flags == DB_CHECKPOINT) { (void)time(&lp->chkpt); lp->stat.st_wc_bytes = lp->stat.st_wc_mbytes = 0; } return (0); } /* * CDB___log_putr -- * Actually put a record into the log. */ static int CDB___log_putr(dblp, lsn, dbt, prev) DB_LOG *dblp; DB_LSN *lsn; const DBT *dbt; u_int32_t prev; { HDR hdr; LOG *lp; int ret; lp = dblp->reginfo.primary; /* * Initialize the header. If we just switched files, lsn.offset will * be 0, and what we really want is the offset of the previous record * in the previous file. Fortunately, prev holds the value we want. */ hdr.prev = prev; hdr.len = sizeof(HDR) + dbt->size; hdr.cksum = CDB___ham_func4(dbt->data, dbt->size); if ((ret = CDB___log_fill(dblp, lsn, &hdr, sizeof(HDR))) != 0) return (ret); lp->len = sizeof(HDR); lp->lsn.offset += sizeof(HDR); if ((ret = CDB___log_fill(dblp, lsn, dbt->data, dbt->size)) != 0) return (ret); lp->len += dbt->size; lp->lsn.offset += dbt->size; return (0); } /* * CDB_log_flush -- * Write all records less than or equal to the specified LSN. */ int CDB_log_flush(dbenv, lsn) DB_ENV *dbenv; const DB_LSN *lsn; { DB_LOG *dblp; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); dblp = dbenv->lg_handle; R_LOCK(dbenv, &dblp->reginfo); ret = CDB___log_flush(dblp, lsn); R_UNLOCK(dbenv, &dblp->reginfo); return (ret); } /* * CDB___log_flush -- * Write all records less than or equal to the specified LSN; internal * version. */ static int CDB___log_flush(dblp, lsn) DB_LOG *dblp; const DB_LSN *lsn; { DB_LSN t_lsn; LOG *lp; int current, ret; ret = 0; lp = dblp->reginfo.primary; /* * If no LSN specified, flush the entire log by setting the flush LSN * to the last LSN written in the log. Otherwise, check that the LSN * isn't a non-existent record for the log. */ if (lsn == NULL) { t_lsn.file = lp->lsn.file; t_lsn.offset = lp->lsn.offset - lp->len; lsn = &t_lsn; } else if (lsn->file > lp->lsn.file || (lsn->file == lp->lsn.file && lsn->offset > lp->lsn.offset - lp->len)) { CDB___db_err(dblp->dbenv, "CDB_log_flush: LSN past current end-of-log"); return (EINVAL); } /* * If the LSN is less than or equal to the last-sync'd LSN, we're * done. Note, the last-sync LSN saved in s_lsn is the LSN of the * first byte we absolutely know has been written to disk, so the * test is <=. */ if (lsn->file < lp->s_lsn.file || (lsn->file == lp->s_lsn.file && lsn->offset <= lp->s_lsn.offset)) return (0); /* * We may need to write the current buffer. We have to write the * current buffer if the flush LSN is greater than or equal to the * buffer's starting LSN. */ current = 0; if (lp->b_off != 0 && CDB_log_compare(lsn, &lp->f_lsn) >= 0) { if ((ret = CDB___log_write(dblp, dblp->bufp, lp->b_off)) != 0) return (ret); lp->b_off = 0; current = 1; } /* * It's possible that this thread may never have written to this log * file. Acquire a file descriptor if we don't already have one. * One last check -- if we're not writing anything from the current * buffer, don't bother. We have nothing to write and nothing to * sync. */ if (dblp->lfname != lp->lsn.file) { if (!current) return (0); if ((ret = CDB___log_newfh(dblp)) != 0) return (ret); } /* Sync all writes to disk. */ if ((ret = CDB___os_fsync(&dblp->lfh)) != 0) { CDB___db_panic(dblp->dbenv, ret); return (ret); } ++lp->stat.st_scount; /* * Set the last-synced LSN, using the LSN of the current buffer. If * the current buffer was flushed, we know the LSN of the first byte * of the buffer is on disk, otherwise, we only know that the LSN of * the record before the one beginning the current buffer is on disk. * * Check to be sure the saved lsn isn't 0 before decrementing it. If * DB_CHECKPOINT was called before we wrote any log records, you can * end up here without ever having written anything to a log file, and * decrementing s_lsn.file or s_lsn.offset will cause much sadness. */ lp->s_lsn = lp->f_lsn; if (!current && lp->s_lsn.file != 0) { if (lp->s_lsn.offset == 0) { --lp->s_lsn.file; lp->s_lsn.offset = lp->persist.lg_max; } else --lp->s_lsn.offset; } return (0); } /* * CDB___log_fill -- * Write information into the log. */ static int CDB___log_fill(dblp, lsn, addr, len) DB_LOG *dblp; DB_LSN *lsn; void *addr; u_int32_t len; { LOG *lp; u_int32_t bsize, nrec; size_t nw, remain; int ret; lp = dblp->reginfo.primary; bsize = lp->buffer_size; while (len > 0) { /* Copy out the data. */ /* * If we're beginning a new buffer, note the user LSN to which * the first byte of the buffer belongs. We have to know this * when flushing the buffer so that we know if the in-memory * buffer needs to be flushed. */ if (lp->b_off == 0) lp->f_lsn = *lsn; /* * If we're on a buffer boundary and the data is big enough, * copy as many records as we can directly from the data. */ if (lp->b_off == 0 && len >= bsize) { nrec = len / bsize; if ((ret = CDB___log_write(dblp, addr, nrec * bsize)) != 0) return (ret); addr = (u_int8_t *)addr + nrec * bsize; len -= nrec * bsize; ++lp->stat.st_wcount_fill; continue; } /* Figure out how many bytes we can copy this time. */ remain = bsize - lp->b_off; nw = remain > len ? len : remain; memcpy(dblp->bufp + lp->b_off, addr, nw); addr = (u_int8_t *)addr + nw; len -= nw; lp->b_off += nw; /* If we fill the buffer, flush it. */ if (lp->b_off == bsize) { if ((ret = CDB___log_write(dblp, dblp->bufp, bsize)) != 0) return (ret); lp->b_off = 0; ++lp->stat.st_wcount_fill; } } return (0); } /* * CDB___log_write -- * Write the log buffer to disk. */ static int CDB___log_write(dblp, addr, len) DB_LOG *dblp; void *addr; u_int32_t len; { LOG *lp; ssize_t nw; int ret; /* * If we haven't opened the log file yet or the current one * has changed, acquire a new log file. */ lp = dblp->reginfo.primary; if (!F_ISSET(&dblp->lfh, DB_FH_VALID) || dblp->lfname != lp->lsn.file) if ((ret = CDB___log_newfh(dblp)) != 0) return (ret); /* * Seek to the offset in the file (someone may have written it * since we last did). */ if ((ret = CDB___os_seek(&dblp->lfh, 0, 0, lp->w_off, 0, DB_OS_SEEK_SET)) != 0 || (ret = CDB___os_write(&dblp->lfh, addr, len, &nw)) != 0) { CDB___db_panic(dblp->dbenv, ret); return (ret); } if (nw != (int32_t)len) return (EIO); /* Reset the buffer offset and update the seek offset. */ lp->w_off += len; /* Update written statistics. */ if ((lp->stat.st_w_bytes += len) >= MEGABYTE) { lp->stat.st_w_bytes -= MEGABYTE; ++lp->stat.st_w_mbytes; } if ((lp->stat.st_wc_bytes += len) >= MEGABYTE) { lp->stat.st_wc_bytes -= MEGABYTE; ++lp->stat.st_wc_mbytes; } ++lp->stat.st_wcount; return (0); } /* * CDB_log_file -- * Map a DB_LSN to a file name. */ int CDB_log_file(dbenv, lsn, namep, len) DB_ENV *dbenv; const DB_LSN *lsn; char *namep; size_t len; { DB_LOG *dblp; int ret; char *name; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); dblp = dbenv->lg_handle; R_LOCK(dbenv, &dblp->reginfo); ret = CDB___log_name(dblp, lsn->file, &name, NULL, 0); R_UNLOCK(dbenv, &dblp->reginfo); if (ret != 0) return (ret); /* Check to make sure there's enough room and copy the name. */ if (len < strlen(name) + 1) { *namep = '\0'; return (ENOMEM); } (void)strcpy(namep, name); CDB___os_freestr(name); return (0); } /* * CDB___log_newfh -- * Acquire a file handle for the current log file. */ static int CDB___log_newfh(dblp) DB_LOG *dblp; { LOG *lp; int ret; char *name; /* Close any previous file descriptor. */ if (F_ISSET(&dblp->lfh, DB_FH_VALID)) (void)CDB___os_closehandle(&dblp->lfh); /* Get the path of the new file and open it. */ lp = dblp->reginfo.primary; dblp->lfname = lp->lsn.file; if ((ret = CDB___log_name(dblp, dblp->lfname, &name, &dblp->lfh, DB_OSO_CREATE | DB_OSO_LOG | DB_OSO_SEQ)) != 0) CDB___db_err(dblp->dbenv, "CDB_log_put: %s: %s", name, CDB_db_strerror(ret)); CDB___os_freestr(name); return (ret); } /* * CDB___log_name -- * Return the log name for a particular file, and optionally open it. * * PUBLIC: int CDB___log_name __P((DB_LOG *, * PUBLIC: u_int32_t, char **, DB_FH *, u_int32_t)); */ int CDB___log_name(dblp, filenumber, namep, fhp, flags) DB_LOG *dblp; u_int32_t filenumber, flags; char **namep; DB_FH *fhp; { LOG *lp; int ret; char *oname; char old[sizeof(LFPREFIX) + 5 + 20], new[sizeof(LFPREFIX) + 10 + 20]; lp = dblp->reginfo.primary; /* * !!! * The semantics of this routine are bizarre. * * The reason for all of this is that we need a place where we can * intercept requests for log files, and, if appropriate, check for * both the old-style and new-style log file names. The trick is * that all callers of this routine that are opening the log file * read-only want to use an old-style file name if they can't find * a match using a new-style name. The only down-side is that some * callers may check for the old-style when they really don't need * to, but that shouldn't mess up anything, and we only check for * the old-style name when we've already failed to find a new-style * one. * * Create a new-style file name, and if we're not going to open the * file, return regardless. */ (void)snprintf(new, sizeof(new), LFNAME, filenumber); if ((ret = CDB___db_appname(dblp->dbenv, DB_APP_LOG, NULL, new, 0, NULL, namep)) != 0 || fhp == NULL) return (ret); /* Open the new-style file -- if we succeed, we're done. */ if ((ret = CDB___os_open(*namep, flags, lp->persist.mode, fhp)) == 0) return (0); /* * The open failed... if the DB_RDONLY flag isn't set, we're done, * the caller isn't interested in old-style files. */ if (!LF_ISSET(DB_OSO_RDONLY)) { CDB___db_err(dblp->dbenv, "%s: log file open failed: %s", *namep, CDB_db_strerror(ret)); CDB___db_panic(dblp->dbenv, ret); return (ret); } /* Create an old-style file name. */ (void)snprintf(old, sizeof(old), LFNAME_V1, filenumber); if ((ret = CDB___db_appname(dblp->dbenv, DB_APP_LOG, NULL, old, 0, NULL, &oname)) != 0) goto err; /* * Open the old-style file -- if we succeed, we're done. Free the * space allocated for the new-style name and return the old-style * name to the caller. */ if ((ret = CDB___os_open(oname, flags, lp->persist.mode, fhp)) == 0) { CDB___os_freestr(*namep); *namep = oname; return (0); } /* * Couldn't find either style of name -- return the new-style name * for the caller's error message. If it's an old-style name that's * actually missing we're going to confuse the user with the error * message, but that implies that not only were we looking for an * old-style name, but we expected it to exist and we weren't just * looking for any log file. That's not a likely error. */ err: CDB___os_freestr(oname); return (ret); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_rec.c��������������������������������������������������������������������������0100644�0063146�0012731�00000027474�07427026535�014556� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)log_rec.c 11.16 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <assert.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "log.h" #include "db_dispatch.h" #include "db_page.h" #include "db_ext.h" static int CDB___log_do_open __P((DB_LOG *, u_int8_t *, char *, DBTYPE, u_int32_t)); static int CDB___log_lid_to_fname __P((DB_LOG *, int32_t, FNAME **)); static int CDB___log_open_file __P((DB_LOG *, __log_register_args *)); /* * PUBLIC: int CDB___log_register_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___log_register_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { DB_ENTRY *dbe; DB_LOG *logp; __log_register_args *argp; int do_rem, ret, t_ret; logp = dbenv->lg_handle; #ifdef DEBUG_RECOVER CDB___log_register_print(logp, dbtp, lsnp, redo, info); #endif COMPQUIET(lsnp, NULL); F_SET(logp, DBC_RECOVER); if ((ret = CDB___log_register_read(dbtp->data, &argp)) != 0) goto out; if ((argp->opcode == LOG_OPEN && (redo == TXN_REDO || redo == TXN_OPENFILES || redo == TXN_FORWARD_ROLL)) || (argp->opcode == LOG_CLOSE && (redo == TXN_UNDO || redo == TXN_BACKWARD_ROLL))) { /* * If we are redoing an open or undoing a close, then we need * to open a file. */ ret = CDB___log_open_file(logp, argp); if (ret == ENOENT || ret == EINVAL) { if (redo == TXN_OPENFILES && argp->name.size != 0 && (ret = CDB___db_txnlist_delete(info, argp->name.data, argp->id, 0)) != 0) goto out; ret = 0; } } else if (argp->opcode != LOG_CHECKPOINT) { /* * If we are undoing an open, then we need to close the file. * * If the file is deleted, then we can just ignore this close. * Otherwise, we should usually have a valid dbp we should * close or whose reference count should be decremented. * However, if we shut down without closing a file, we may, in * fact, not have the file open, and that's OK. */ do_rem = 0; MUTEX_THREAD_LOCK(logp->mutexp); if (argp->id < logp->dbentry_cnt) { dbe = &logp->dbentry[argp->id]; #ifdef DIAGNOSTIC assert(dbe->refcount == 1); #endif ret = CDB___db_txnlist_close(info, argp->id, dbe->count); if (dbe->dbp != NULL && (t_ret = dbe->dbp->close(dbe->dbp, 0)) != 0 && ret == 0) ret = t_ret; do_rem = 1; } MUTEX_THREAD_UNLOCK(logp->mutexp); if (do_rem) (void)CDB___log_rem_logid(logp, argp->id); } else if ((redo == TXN_UNDO || redo == TXN_OPENFILES) && (argp->id >= logp->dbentry_cnt || (!logp->dbentry[argp->id].deleted && logp->dbentry[argp->id].dbp == NULL))) { /* * It's a checkpoint and we are rolling backward. It * is possible that the system was shut down and thus * ended with a stable checkpoint; this file was never * closed and has therefore not been reopened yet. If * so, we need to try to open it. */ ret = CDB___log_open_file(logp, argp); if (ret == ENOENT || ret == EINVAL) { if (argp->name.size != 0 && (ret = CDB___db_txnlist_delete(info, argp->name.data, argp->id, 0)) != 0) goto out; ret = 0; } } out: F_CLR(logp, DBC_RECOVER); if (argp != NULL) CDB___os_free(argp, 0); return (ret); } /* * CDB___log_open_file -- * Called during CDB_log_register recovery. Make sure that we have an * entry in the dbentry table for this ndx. Returns 0 on success, * non-zero on error. */ static int CDB___log_open_file(lp, argp) DB_LOG *lp; __log_register_args *argp; { DB_ENTRY *dbe; /* * We never re-open temporary files. Temp files are only * useful during aborts in which case the dbp was entered * when the file was registered. During recovery, we treat * temp files as properly deleted files, allowing the open to * fail and not reporting any errors when recovery fails to * get a valid dbp from db_fileid_to_db. */ if (argp->name.size == 0) { (void)CDB___log_add_logid(lp, NULL, argp->id); return (ENOENT); } /* * Because of reference counting, we cannot automatically close files * during recovery, so when we're opening, we have to check that the * name we are opening is what we expect. If it's not, then we close * the old file and open the new one. */ MUTEX_THREAD_LOCK(lp->mutexp); if (argp->id < lp->dbentry_cnt) dbe = &lp->dbentry[argp->id]; else dbe = NULL; if (dbe != NULL && (dbe->deleted == 1 || dbe->dbp != NULL)) { dbe->refcount++; MUTEX_THREAD_UNLOCK(lp->mutexp); return (0); } MUTEX_THREAD_UNLOCK(lp->mutexp); return (CDB___log_do_open(lp, argp->uid.data, argp->name.data, argp->ftype, argp->id)); } /* * CDB___log_do_open -- * Open files referenced in the log. This is the part of the open that * is not protected by the thread mutex. */ static int CDB___log_do_open(lp, uid, name, ftype, ndx) DB_LOG *lp; u_int8_t *uid; char *name; DBTYPE ftype; u_int32_t ndx; { DB *dbp; int ret; u_int8_t zeroid[DB_FILE_ID_LEN]; if ((ret = CDB_db_create(&dbp, lp->dbenv, 0)) != 0) return (ret); if ((ret = dbp->open(dbp, name, NULL, ftype, 0, 0600)) == 0) { /* * Verify that we are opening the same file that we were * referring to when we wrote this log record. */ memset(zeroid, 0, DB_FILE_ID_LEN); if (memcmp(uid, dbp->fileid, DB_FILE_ID_LEN) == 0 || memcmp(dbp->fileid, zeroid, DB_FILE_ID_LEN) == 0) { (void)CDB___log_add_logid(lp, dbp, ndx); return (0); } } (void)dbp->close(dbp, 0); (void)CDB___log_add_logid(lp, NULL, ndx); return (ENOENT); } /* * CDB___log_add_logid -- * Adds a DB entry to the log's DB entry table. * * PUBLIC: int CDB___log_add_logid __P((DB_LOG *, DB *, u_int32_t)); */ int CDB___log_add_logid(logp, dbp, ndx) DB_LOG *logp; DB *dbp; u_int32_t ndx; { u_int32_t i; int ret; ret = 0; MUTEX_THREAD_LOCK(logp->mutexp); /* * Check if we need to grow the table. Note, ndx is 0-based (the * index into the DB entry table) an dbentry_cnt is 1-based, the * number of available slots. */ if (logp->dbentry_cnt <= ndx) { if ((ret = CDB___os_realloc((ndx + DB_GROW_SIZE) * sizeof(DB_ENTRY), NULL, &logp->dbentry)) != 0) goto err; /* Initialize the new entries. */ for (i = logp->dbentry_cnt; i < ndx + DB_GROW_SIZE; i++) { logp->dbentry[i].count = 0; logp->dbentry[i].dbp = NULL; logp->dbentry[i].deleted = 0; logp->dbentry[i].refcount = 0; } logp->dbentry_cnt = i; } if (logp->dbentry[ndx].deleted == 0 && logp->dbentry[ndx].dbp == NULL) { logp->dbentry[ndx].count = 0; logp->dbentry[ndx].dbp = dbp; logp->dbentry[ndx].deleted = dbp == NULL; logp->dbentry[ndx].refcount = 1; } else logp->dbentry[ndx].refcount++; err: MUTEX_THREAD_UNLOCK(logp->mutexp); return (ret); } /* * CDB___db_fileid_to_db -- * Return the DB corresponding to the specified fileid. * * PUBLIC: int CDB___db_fileid_to_db __P((DB_ENV *, DB **, int32_t, int)); */ int CDB___db_fileid_to_db(dbenv, dbpp, ndx, inc) DB_ENV *dbenv; DB **dbpp; int32_t ndx; int inc; { DB_LOG *logp; FNAME *fname; int ret; char *name; ret = 0; logp = dbenv->lg_handle; MUTEX_THREAD_LOCK(logp->mutexp); /* * Under XA, a process different than the one issuing DB operations * may abort a transaction. In this case, recovery routines are run * by a process that does not necessarily have the file open, so we * we must open the file explicitly. */ if ((u_int32_t)ndx >= logp->dbentry_cnt || (!logp->dbentry[ndx].deleted && logp->dbentry[ndx].dbp == NULL)) { if (CDB___log_lid_to_fname(logp, ndx, &fname) != 0) { /* Couldn't find entry; this is a fatal error. */ ret = EINVAL; goto err; } name = R_ADDR(&logp->reginfo, fname->name_off); /* * CDB___log_do_open is called without protection of the * log thread lock. */ MUTEX_THREAD_UNLOCK(logp->mutexp); /* * At this point, we are not holding the thread lock, so exit * directly instead of going through the exit code at the * bottom. If the CDB___log_do_open succeeded, then we don't need * to do any of the remaining error checking at the end of this * routine. */ if ((ret = CDB___log_do_open(logp, fname->ufid, name, fname->s_type, ndx)) != 0) return (ret); *dbpp = logp->dbentry[ndx].dbp; return (0); } /* * Return DB_DELETED if the file has been deleted (it's not an error). */ if (logp->dbentry[ndx].deleted) { ret = DB_DELETED; if (inc) logp->dbentry[ndx].count++; goto err; } /* * Otherwise return 0, but if we don't have a corresponding DB, it's * an error. */ if ((*dbpp = logp->dbentry[ndx].dbp) == NULL) ret = ENOENT; err: MUTEX_THREAD_UNLOCK(logp->mutexp); return (ret); } /* * Close files that were opened by the recovery daemon. * * PUBLIC: void CDB___log_close_files __P((DB_ENV *)); */ void CDB___log_close_files(dbenv) DB_ENV *dbenv; { DB_ENTRY *dbe; DB_LOG *logp; u_int32_t i; logp = dbenv->lg_handle; MUTEX_THREAD_LOCK(logp->mutexp); F_SET(logp, DBC_RECOVER); for (i = 0; i < logp->dbentry_cnt; i++) { dbe = &logp->dbentry[i]; if (dbe->dbp != NULL) { (void)dbe->dbp->close(dbe->dbp, 0); dbe->dbp = NULL; } dbe->deleted = 0; dbe->refcount = 0; } F_CLR(logp, DBC_RECOVER); MUTEX_THREAD_UNLOCK(logp->mutexp); } /* * PUBLIC: void CDB___log_rem_logid __P((DB_LOG *, u_int32_t)); */ void CDB___log_rem_logid(logp, ndx) DB_LOG *logp; u_int32_t ndx; { MUTEX_THREAD_LOCK(logp->mutexp); if (--logp->dbentry[ndx].refcount == 0) { logp->dbentry[ndx].dbp = NULL; logp->dbentry[ndx].deleted = 0; } MUTEX_THREAD_UNLOCK(logp->mutexp); } /* * CDB___log_lid_to_fname -- * Traverse the shared-memory region looking for the entry that * matches the passed log fileid. Returns 0 on success; -1 on error. */ static int CDB___log_lid_to_fname(dblp, lid, fnamep) DB_LOG *dblp; int32_t lid; FNAME **fnamep; { FNAME *fnp; LOG *lp; lp = dblp->reginfo.primary; for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname); fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) { if (fnp->ref == 0) /* Entry not in use. */ continue; if (fnp->id == lid) { *fnamep = fnp; return (0); } } return (-1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log_register.c���������������������������������������������������������������������0100644�0063146�0012731�00000012767�07427026535�015630� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)CDB_log_register.c 11.7 (Sleepycat) 9/30/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "log.h" /* * CDB_log_register -- * Register a file name. */ int CDB_log_register(dbenv, dbp, name, idp) DB_ENV *dbenv; DB *dbp; const char *name; int32_t *idp; { DBT fid_dbt, r_name; DB_LOG *dblp; DB_LSN r_unused; FNAME *fnp, *reuse_fnp; LOG *lp; size_t len; int32_t maxid; int inserted, ret; void *namep; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); dblp = dbenv->lg_handle; lp = dblp->reginfo.primary; fnp = reuse_fnp = NULL; inserted = ret = 0; namep = NULL; /* Check the arguments. */ if (dbp->type != DB_BTREE && dbp->type != DB_QUEUE && dbp->type != DB_HASH && dbp->type != DB_RECNO) { CDB___db_err(dbenv, "CDB_log_register: unknown DB file type"); return (EINVAL); } R_LOCK(dbenv, &dblp->reginfo); /* * See if we've already got this file in the log, finding the * (maximum+1) in-use file id and some available file id (if we * find an available fid, we'll use it, else we'll have to allocate * one after the maximum that we found). */ for (maxid = 0, fnp = SH_TAILQ_FIRST(&lp->fq, __fname); fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) { if (fnp->ref == 0) { /* Entry is not in use. */ if (reuse_fnp == NULL) reuse_fnp = fnp; continue; } if (!memcmp(dbp->fileid, fnp->ufid, DB_FILE_ID_LEN)) { ++fnp->ref; goto found; } if (maxid <= fnp->id) maxid = fnp->id + 1; } /* Fill in fnp structure. */ if (reuse_fnp != NULL) /* Reuse existing one. */ fnp = reuse_fnp; else { /* Allocate a new one. */ if ((ret = CDB___db_shalloc(dblp->reginfo.addr, sizeof(FNAME), 0, &fnp)) != 0) goto err; fnp->id = maxid; } fnp->ref = 1; fnp->s_type = dbp->type; memcpy(fnp->ufid, dbp->fileid, DB_FILE_ID_LEN); if (name != NULL) { len = strlen(name) + 1; if ((ret = CDB___db_shalloc(dblp->reginfo.addr, len, 0, &namep)) != 0) goto err; fnp->name_off = R_OFFSET(&dblp->reginfo, namep); memcpy(namep, name, len); } else fnp->name_off = INVALID_ROFF; /* Only do the insert if we allocated a new fnp. */ if (reuse_fnp == NULL) SH_TAILQ_INSERT_HEAD(&lp->fq, fnp, q, __fname); inserted = 1; /* Log the registry. */ if (!F_ISSET(dblp, DBC_RECOVER)) { /* * We allow logging on in-memory databases, so the name here * could be NULL. */ if (name != NULL) { r_name.data = (void *)name; r_name.size = strlen(name) + 1; } memset(&fid_dbt, 0, sizeof(fid_dbt)); fid_dbt.data = dbp->fileid; fid_dbt.size = DB_FILE_ID_LEN; if ((ret = CDB___log_register_log(dbenv, NULL, &r_unused, 0, LOG_OPEN, name == NULL ? NULL : &r_name, &fid_dbt, fnp->id, dbp->type)) != 0) goto err; } found: /* * If we found the entry in the shared area, then the file is * already open, so there is no need to log the open. We only * log the open and closes on the first open and last close. */ if (!F_ISSET(dblp, DBC_RECOVER) && (ret = CDB___log_add_logid(dblp, dbp, fnp->id)) != 0) goto err; if (idp != NULL) *idp = fnp->id; if (0) { err: if (inserted) SH_TAILQ_REMOVE(&lp->fq, fnp, q, __fname); if (namep != NULL) CDB___db_shalloc_free(dblp->reginfo.addr, namep); if (fnp != NULL) CDB___db_shalloc_free(dblp->reginfo.addr, fnp); } R_UNLOCK(dbenv, &dblp->reginfo); return (ret); } /* * CDB_log_unregister -- * Discard a registered file name. */ int CDB_log_unregister(dbenv, fid) DB_ENV *dbenv; int32_t fid; { DBT fid_dbt, r_name; DB_LOG *dblp; DB_LSN r_unused; FNAME *fnp; LOG *lp; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->lg_handle, DB_INIT_LOG); ret = 0; dblp = dbenv->lg_handle; lp = dblp->reginfo.primary; R_LOCK(dbenv, &dblp->reginfo); /* Find the entry in the log. */ for (fnp = SH_TAILQ_FIRST(&lp->fq, __fname); fnp != NULL; fnp = SH_TAILQ_NEXT(fnp, q, __fname)) if (fid == fnp->id) break; if (fnp == NULL) { CDB___db_err(dbenv, "CDB_log_unregister: non-existent file id"); ret = EINVAL; goto ret1; } /* * Log the unregistry only if this is the last one and we are * really closing the file. */ if (!F_ISSET(dblp, DBC_RECOVER) && fnp->ref == 1) { if (fnp->name_off != INVALID_ROFF) { memset(&r_name, 0, sizeof(r_name)); r_name.data = R_ADDR(&dblp->reginfo, fnp->name_off); r_name.size = strlen(r_name.data) + 1; } memset(&fid_dbt, 0, sizeof(fid_dbt)); fid_dbt.data = fnp->ufid; fid_dbt.size = DB_FILE_ID_LEN; if ((ret = CDB___log_register_log(dbenv, NULL, &r_unused, 0, LOG_CLOSE, fnp->name_off == INVALID_ROFF ? NULL : &r_name, &fid_dbt, fid, fnp->s_type)) != 0) goto ret1; } /* * If more than 1 reference, just decrement the reference and return. * Otherwise, free the name if one exists. */ --fnp->ref; if (fnp->ref == 0 && fnp->name_off != INVALID_ROFF) CDB___db_shalloc_free(dblp->reginfo.addr, R_ADDR(&dblp->reginfo, fnp->name_off)); /* * Remove from the process local table. If this operation is taking * place during recovery, then the logid was never added to the table, * so do not remove it. */ if (!F_ISSET(dblp, DBC_RECOVER)) CDB___log_rem_logid(dblp, fid); ret1: R_UNLOCK(dbenv, &dblp->reginfo); return (ret); } ���������htdig-3.2.0b6/db/ltmain.sh��������������������������������������������������������������������������0100755�0063146�0012731�00000547010�10057557652�014616� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.6 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 203 $" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<EOF $* EOF exit $EXIT_SUCCESS fi default_mode= help="Try \`$progname --help' for more information." magic="%%%MAGIC variable%%%" mkdir="mkdir" mv="mv -f" rm="rm -f" # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # test EBCDIC or ASCII case `echo A|tr A '\301'` in A) # EBCDIC based system SP2NL="tr '\100' '\n'" NL2SP="tr '\r\n' '\100\100'" ;; *) # Assume ASCII based system SP2NL="tr '\040' '\012'" NL2SP="tr '\015\012' '\040\040'" ;; esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. if test "${LC_ALL+set}" = set; then save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL fi if test "${LANG+set}" = set; then save_LANG="$LANG"; LANG=C; export LANG fi # Make sure IFS has a sensible default : ${IFS=" "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then $echo "$modename: not configured to build any kind of library" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $EXIT_SUCCESS ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T <<EOF # $libobj - a libtool object file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # Name of the PIC object. EOF # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $srcfile $pic_flag" else # Don't build PIC code command="$base_compile $srcfile" fi if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir status=$? if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then exit $status fi fi if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi $run $rm "$lobj" "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit $EXIT_FAILURE fi if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <<EOF pic_object='$objdir/$objname' EOF # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi else # No PIC object so indicate it doesn't exist in the libtool # object file. test -z "$run" && cat >> ${libobj}T <<EOF pic_object=none EOF fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else command="$base_compile $srcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$obj" "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit $EXIT_FAILURE fi if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <<EOF # Name of the non-PIC object. non_pic_object='$objname' EOF else # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <<EOF # Name of the non-PIC object. non_pic_object=none EOF fi $run $mv "${libobj}T" "${libobj}" # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit $EXIT_SUCCESS ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" base_compile="$nonopt $@" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c <<EOF int main() { return 0; } EOF $rm conftest $LTCC -o conftest conftest.c $deplibs if test "$?" -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" -ne "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) newdeplibs="$newdeplibs $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches deplib_match=$2 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then newdeplibs="$newdeplibs $i" else droppeddeps=yes $echo $echo "*** Warning: dynamic linker does not accept needed library $i." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which I believe you do not have" $echo "*** because a test_compile did reveal that the linker did not use it for" $echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi else newdeplibs="$newdeplibs $i" fi done else # Error occurred in the first compile. Let's try to salvage # the situation: Compile a separate program for each library. for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then $rm conftest $LTCC -o conftest conftest.c $i # Did it work? if test "$?" -eq 0 ; then ldd_output=`ldd conftest` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) newdeplibs="$newdeplibs $i" i="" ;; esac fi if test -n "$i" ; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches deplib_match=$2 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then newdeplibs="$newdeplibs $i" else droppeddeps=yes $echo $echo "*** Warning: dynamic linker does not accept needed library $i." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because a test_compile did reveal that the linker did not use this one" $echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes $echo $echo "*** Warning! Library $i is needed by this library but I was not able to" $echo "*** make it link in! You will probably need to install it or some" $echo "*** library that it depends on before this library will be fully" $echo "*** functional. Installing it before continuing would be even better." fi else newdeplibs="$newdeplibs $i" fi done fi ;; file_magic*) set dummy $deplibs_check_method file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test "$name" != "" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 </dev/null >/dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <<EOF /* $cwrappersource - temporary wrapper executable for $objdir/$outputname Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP The $output program cannot be directly executed until all the libtool libraries that it depends on are installed. This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. Currently, it simply execs the wrapper *script* "/bin/sh $output", but could eventually absorb all of the scripts functionality and exec $objdir/$outputname directly. */ EOF cat >> $cwrappersource<<"EOF" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <malloc.h> #include <stdarg.h> #include <assert.h> #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <<EOF newargz[0] = "$SHELL"; EOF cat >> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <<EOF execv("$SHELL",newargz); EOF cat >> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to <bug-libtool@gnu.org>." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/missing����������������������������������������������������������������������������0100755�0063146�0012731�00000024032�10057557652�014364� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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 case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; 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]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - 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 missing on your system. 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 missing on your system. 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 missing on your system. 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 missing on your system. 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, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. 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' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; 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 missing on your system. 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 missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; 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 you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed 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 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mkinstalldirs����������������������������������������������������������������������0100755�0063146�0012731�00000003704�07723271016�015567� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <friedman@prep.ai.mit.edu> # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here ������������������������������������������������������������htdig-3.2.0b6/db/mp.h�������������������������������������������������������������������������������0100644�0063146�0012731�00000023272�07661541610�013551� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)mp.h 11.3 (Sleepycat) 10/6/99 */ struct __bh; typedef struct __bh BH; struct __db_mpool; typedef struct __db_mpool DB_MPOOL; struct __db_mpreg; typedef struct __db_mpreg DB_MPREG; struct __mcache; typedef struct __mcache MCACHE; struct __mpool; typedef struct __mpool MPOOL; struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE; struct __cmpr; typedef struct __cmpr CMPR; struct __cmpr_context; typedef struct __cmpr_context CMPR_CONTEXT; /* We require at least 20K of cache. */ #define DB_CACHESIZE_MIN ( 20 * 1024) /* * By default, environments have room for 500 files. */ #define DB_MPOOLFILE_DEF 500 /* * DB_MPOOL -- * Per-process memory pool structure. */ struct __db_mpool { /* These fields need to be protected for multi-threaded support. */ MUTEX *mutexp; /* Structure thread lock. */ /* List of pgin/pgout routines. */ LIST_HEAD(__db_mpregh, __db_mpreg) dbregq; /* List of DB_MPOOLFILE's. */ TAILQ_HEAD(__db_mpoolfileh, __db_mpoolfile) dbmfq; /* These fields are not thread-protected. */ DB_ENV *dbenv; /* Reference to error information. */ REGINFO reginfo; /* Main shared region. */ int nc_reg; /* N underlying cache regions. */ REGINFO *c_reginfo; /* Underlying cache regions. */ /* I'm not sure if these need to be thread-protected... */ int recursion_level; /* limit recur'n from weak compr'n */ }; /* * DB_MPREG -- * DB_MPOOL registry of pgin/pgout functions. */ struct __db_mpreg { LIST_ENTRY(__db_mpreg) q; /* Linked list. */ int ftype; /* File type. */ /* Pgin, pgout routines. */ int (*pgin) __P((db_pgno_t, void *, DBT *)); int (*pgout) __P((db_pgno_t, void *, DBT *)); }; /* * CMPR_CONTEXT -- * Shared compresssion information. */ struct __cmpr_context { #define DB_CMPR_SUFFIX "_weakcmpr" DB *weakcmpr; /* Free weakcmpr pages pool. */ }; /* * DB_MPOOLFILE -- * Per-process DB_MPOOLFILE information. */ struct __db_mpoolfile { /* These fields need to be protected for multi-threaded support. */ MUTEX *mutexp; /* Structure thread lock. */ DB_FH fh; /* Underlying file handle. */ u_int32_t ref; /* Reference count. */ /* * !!! * This field is a special case -- it's protected by the region lock * NOT the thread lock. The reason for this is that we always have * the region lock immediately before or after we modify the field, * and we don't want to use the structure lock to protect it because * then I/O (which is done with the structure lock held because of * the race between the seek and write of the file descriptor) will * block any other put/get calls using this DB_MPOOLFILE structure. */ u_int32_t pinref; /* Pinned block reference count. */ /* * !!! * This field is a special case -- it's protected by the region lock * since it's manipulated only when new files are added to the list. */ TAILQ_ENTRY(__db_mpoolfile) q; /* Linked list of DB_MPOOLFILE's. */ /* These fields are not thread-protected. */ DB_MPOOL *dbmp; /* Overlying DB_MPOOL. */ MPOOLFILE *mfp; /* Underlying MPOOLFILE. */ void *addr; /* Address of mmap'd region. */ size_t len; /* Length of mmap'd region. */ /* These fields need to be protected for multi-threaded support. */ #define MP_READONLY 0x01 /* File is readonly. */ #define MP_UPGRADE 0x02 /* File descriptor is readwrite. */ #define MP_UPGRADE_FAIL 0x04 /* Upgrade wasn't possible. */ #define MP_CMPR 0x08 /* Transparent I/O compression. */ u_int32_t flags; CMPR_CONTEXT cmpr_context; /* Shared compression information */ }; /* * NCACHE -- * Select a cache based on the page number. This assumes accesses are * uniform across pages, which is probably OK -- what we really want to * avoid is anything that puts all the pages for any single file in the * same cache, as we expect that file access will be bursty. */ #define NCACHE(mp, pgno) \ ((pgno) % ((MPOOL *)mp)->nc_reg) /* * NBUCKET -- * We make the assumption that early pages of the file are more likely * to be retrieved than the later pages, which means the top bits will * be more interesting for hashing as they're less likely to collide. * That said, as 512 8K pages represents a 4MB file, so only reasonably * large files will have page numbers with any other than the bottom 9 * bits set. We XOR in the MPOOL offset of the MPOOLFILE that backs the * page, since that should also be unique for the page. We don't want * to do anything very fancy -- speed is more important to us than using * good hashing. */ #define NBUCKET(mc, mf_offset, pgno) \ (((pgno) ^ ((mf_offset) << 9)) % (mc)->htab_buckets) /* * MPOOL -- * Shared memory pool region. One of these is allocated in shared * memory, and describes the entire pool. */ struct __mpool { SH_TAILQ_HEAD(__mpfq) mpfq; /* List of MPOOLFILEs. */ /* * We single-thread CDB_memp_sync and CDB_memp_fsync calls. * * This mutex is intended *only* to single-thread access to the call, * it is not used to protect the lsn and lsn_cnt fields, the region * lock is used to protect them. */ MUTEX sync_mutex; /* Checkpoint lock. */ DB_LSN lsn; /* Maximum checkpoint LSN. */ u_int32_t lsn_cnt; /* Checkpoint buffers left to write. */ u_int32_t nc_reg; /* Number of underlying REGIONS. */ roff_t c_regids; /* Array of underlying REGION Ids. */ #define MP_LSN_RETRY 0x01 /* Retry all BH_WRITE buffers. */ u_int32_t flags; /* HACK!! */ /* a pointers allocated for this structure is (erroneously?) used */ /* in CDB___memp_alloc() to refer to a MCACHE structure. Make sure */ /* the allocation is big enough. */ int dummy [100]; }; /* * MCACHE -- * The memory pool may be broken up into individual pieces/files. Not * what we would have liked, but on Solaris you can allocate only a * little more than 2GB of memory in a single contiguous chunk, and I * expect to see more systems with similar issues. An MCACHE structure * describes a backing piece of memory used as a cache. */ struct __mcache { SH_TAILQ_HEAD(__bhq) bhq; /* LRU list of buffer headers. */ int htab_buckets; /* Number of hash table entries. */ roff_t htab; /* Hash table offset. */ DB_MPOOL_STAT stat; /* Per-cache mpool statistics. */ }; /* * MPOOLFILE -- * Shared DB_MPOOLFILE information. */ struct __mpoolfile { SH_TAILQ_ENTRY q; /* List of MPOOLFILEs */ int ftype; /* File type. */ int32_t lsn_off; /* Page's LSN offset. */ u_int32_t clear_len; /* Bytes to clear on page create. */ roff_t path_off; /* File name location. */ roff_t fileid_off; /* File identification location. */ roff_t pgcookie_len; /* Pgin/pgout cookie length. */ roff_t pgcookie_off; /* Pgin/pgout cookie location. */ u_int32_t lsn_cnt; /* Checkpoint buffers left to write. */ db_pgno_t last_pgno; /* Last page in the file. */ db_pgno_t orig_last_pgno; /* Original last page in the file. */ #define MP_CAN_MMAP 0x01 /* If the file can be mmap'd. */ #define MP_REMOVED 0x02 /* Backing file has been removed. */ #define MP_TEMP 0x04 /* Backing file is a temporary. */ u_int32_t flags; DB_MPOOL_FSTAT stat; /* Per-file mpool statistics. */ }; /* * BH_TO_CACHE -- * Return the cache where we can find the specified buffer header. */ #define BH_TO_CACHE(dbmp, bhp) \ (dbmp)->c_reginfo[NCACHE((dbmp)->reginfo.primary, (bhp)->pgno)].primary /* * DB_CMPR -- * Page compression information * * !!! * There is no need to keep the length of the data wrote * in the page since it's already encoded in the compressed * data. */ /* * Convert size to expected compressed size */ #define DB_CMPR_DIVIDE(dbenv, size) ((size) >> CDB___memp_cmpr_coefficient(dbenv) ) #define DB_CMPR_MULTIPLY(dbenv, size) ((size) << CDB___memp_cmpr_coefficient(dbenv) ) struct __cmpr { #define DB_CMPR_FIRST 0x01 /* Head of chain. */ #define DB_CMPR_INTERNAL 0x02 /* Weak compression data. */ #define DB_CMPR_CHAIN 0x04 /* More data in next page. */ #define DB_CMPR_FREE 0x08 /* Not in use. */ u_int16_t flags; /* * Filled if DB_CMPR_CHAIN set */ db_pgno_t next; }; /* * Reserved information at the beginning of each compressed page */ #define DB_CMPR_OVERHEAD sizeof(struct __cmpr) /* * Size of IO page, without the reserved information */ #define DB_CMPR_PAGESIZE(io) (io->pagesize - DB_CMPR_OVERHEAD) /* * Pointer to data within raw compressed buffer */ #define DB_CMPR_DATA(io) (io->buf + DB_CMPR_OVERHEAD) /* * BH -- * Buffer header. */ struct __bh { MUTEX mutex; /* Buffer thread/process lock. */ u_int16_t ref; /* Reference count. */ #define BH_CALLPGIN 0x001 /* Page needs to be reworked... */ #define BH_DIRTY 0x002 /* Page was modified. */ #define BH_DISCARD 0x004 /* Page is useless. */ #define BH_LOCKED 0x008 /* Page is locked (I/O in progress). */ #define BH_TRASH 0x010 /* Page is garbage. */ #define BH_WRITE 0x020 /* Page scheduled for writing. */ #define BH_CMPR 0x040 /* Chain contains valid data. */ #define BH_CMPR_POOL 0x080 /* Chain allocated in pool. */ #define BH_CMPR_OS 0x100 /* Chain allocate with malloc. */ u_int16_t flags; db_pgno_t *chain; /* Compression chain. */ SH_TAILQ_ENTRY q; /* LRU queue. */ SH_TAILQ_ENTRY hq; /* MPOOL hash bucket queue. */ db_pgno_t pgno; /* Underlying MPOOLFILE page number. */ roff_t mf_offset; /* Associated MPOOLFILE offset. */ /* * !!! * This array must be size_t aligned -- the DB access methods put PAGE * and other structures into it, and expect to be able to access them * directly. (We guarantee size_t alignment in the documentation too.) */ u_int8_t buf[1]; /* Variable length data. */ }; #include "mp_ext.h" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_alloc.c�������������������������������������������������������������������������0100644�0063146�0012731�00000007436�07723467752�014737� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_alloc.c 11.3 (Sleepycat) 9/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" /* * CDB___memp_alloc -- * Allocate some space in the mpool region. * * PUBLIC: int CDB___memp_alloc __P((DB_MPOOL *, * PUBLIC: REGINFO *, MPOOLFILE *, size_t, roff_t *, void *)); */ int CDB___memp_alloc(dbmp, memreg, mfp, len, offsetp, retp) DB_MPOOL *dbmp; REGINFO *memreg; MPOOLFILE *mfp; size_t len; roff_t *offsetp; void *retp; { BH *bhp, *nbhp; MCACHE *mc; MPOOL *mp; MPOOLFILE *bh_mfp; size_t total; int nomore, restart, ret, wrote; void *p; mp = dbmp->reginfo.primary; mc = memreg->primary; /* * If we're allocating a buffer, and the one we're discarding is the * same size, we don't want to waste the time to re-integrate it into * the shared memory free list. If the DB_MPOOLFILE argument isn't * NULL, we'll compare the underlying page sizes of the two buffers * before free-ing and re-allocating buffers. */ if (mfp != NULL) len = (sizeof(BH) - sizeof(u_int8_t)) + mfp->stat.st_pagesize; nomore = 0; alloc: if ((ret = CDB___db_shalloc(memreg->addr, len, MUTEX_ALIGN, &p)) == 0) { if (offsetp != NULL) *offsetp = R_OFFSET(memreg, p); *(void **)retp = p; return (0); } if (nomore) { CDB___db_err(dbmp->dbenv, "Unable to allocate %lu bytes from mpool shared region: %s\n", (u_long)len, CDB_db_strerror(ret)); return (ret); } retry: /* Find a buffer we can flush; pure LRU. */ restart = total = 0; for (bhp = SH_TAILQ_FIRST(&mc->bhq, __bh); bhp != NULL; bhp = nbhp) { nbhp = SH_TAILQ_NEXT(bhp, q, __bh); /* Ignore pinned or locked (I/O in progress) buffers. */ if (bhp->ref != 0 || F_ISSET(bhp, BH_LOCKED)) continue; /* Find the associated MPOOLFILE. */ bh_mfp = R_ADDR(&dbmp->reginfo, bhp->mf_offset); /* Write the page if it's dirty. */ if (F_ISSET(bhp, BH_DIRTY)) { ++bhp->ref; if ((ret = CDB___memp_bhwrite(dbmp, bh_mfp, bhp, &restart, &wrote)) != 0) return (ret); --bhp->ref; /* * Another process may have acquired this buffer and * incremented the ref count after we wrote it. */ if (bhp->ref != 0) goto retry; /* * If we wrote the page, continue and free the buffer. * We don't have to rewalk the list to acquire the * buffer because it was never available for any other * process to modify it. * * If we didn't write the page, but we discarded and * reacquired the region lock, restart the list walk. * * If we neither wrote the buffer nor discarded the * region lock, continue down the buffer list. */ if (wrote) ++mc->stat.st_rw_evict; else { if (restart) goto retry; continue; } } else ++mc->stat.st_ro_evict; /* * Check to see if the buffer is the size we're looking for. * If it is, simply reuse it. */ if (mfp != NULL && mfp->stat.st_pagesize == bh_mfp->stat.st_pagesize) { CDB___memp_bhfree(dbmp, bhp, 0); if (offsetp != NULL) *offsetp = R_OFFSET(memreg, bhp); *(void **)retp = bhp; return (0); } /* Note how much space we've freed, and free the buffer. */ total += CDB___db_shsizeof(bhp); CDB___memp_bhfree(dbmp, bhp, 1); /* * Retry as soon as we've freed up sufficient space. If we * have to coalesce of memory to satisfy the request, don't * try until it's likely (possible?) that we'll succeed. */ if (total >= 3 * len) goto alloc; /* Restart the walk if we discarded the region lock. */ if (restart) goto retry; } nomore = 1; goto alloc; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_bh.c����������������������������������������������������������������������������0100644�0063146�0012731�00000042111�10000513630�014164� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_bh.c 11.5 (Sleepycat) 9/21/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" #ifdef DEBUG #include "WordMonitor.h" #include "db_page.h" #endif /* DEBUG */ static int CDB___memp_upgrade __P((DB_MPOOL *, DB_MPOOLFILE *, MPOOLFILE *)); /* * CDB___memp_bhwrite -- * Write the page associated with a given bucket header. * * PUBLIC: int CDB___memp_bhwrite * PUBLIC: __P((DB_MPOOL *, MPOOLFILE *, BH *, int *, int *)); */ int CDB___memp_bhwrite(dbmp, mfp, bhp, restartp, wrotep) DB_MPOOL *dbmp; MPOOLFILE *mfp; BH *bhp; int *restartp, *wrotep; { DB_MPOOLFILE *dbmfp; DB_MPREG *mpreg; int incremented, ret; if (restartp != NULL) *restartp = 0; if (wrotep != NULL) *wrotep = 0; incremented = 0; /* * Walk the process' DB_MPOOLFILE list and find a file descriptor for * the file. We also check that the descriptor is open for writing. * If we find a descriptor on the file that's not open for writing, we * try and upgrade it to make it writeable. If that fails, we're done. */ MUTEX_THREAD_LOCK(dbmp->mutexp); for (dbmfp = TAILQ_FIRST(&dbmp->dbmfq); dbmfp != NULL; dbmfp = TAILQ_NEXT(dbmfp, q)) if (dbmfp->mfp == mfp) { if (F_ISSET(dbmfp, MP_READONLY) && CDB___memp_upgrade(dbmp, dbmfp, mfp)) { MUTEX_THREAD_UNLOCK(dbmp->mutexp); return (0); } /* * Increment the reference count -- see the comment in * CDB_memp_fclose(). */ ++dbmfp->ref; incremented = 1; break; } MUTEX_THREAD_UNLOCK(dbmp->mutexp); if (dbmfp != NULL) goto found; /* * !!! * Don't try to attach to temporary files. There are two problems in * trying to do that. First, if we have different privileges than the * process that "owns" the temporary file, we might create the backing * disk file such that the owning process couldn't read/write its own * buffers, e.g., CDB_memp_trickle() running as root creating a file owned * as root, mode 600. Second, if the temporary file has already been * created, we don't have any way of finding out what its real name is, * and, even if we did, it was already unlinked (so that it won't be * left if the process dies horribly). This decision causes a problem, * however: if the temporary file consumes the entire buffer cache, * and the owner doesn't flush the buffers to disk, we could end up * with resource starvation, and the CDB_memp_trickle() thread couldn't do * anything about it. That's a pretty unlikely scenario, though. */ if (F_ISSET(mfp, MP_TEMP)) return (0); /* * It's possible the file has been removed. Drop into the page-write * function, which has to handle the fact that we don't have any real * file descriptor information. */ if (F_ISSET(mfp, MP_REMOVED)) { dbmfp = NULL; goto found; } /* * It's not a page from a file we've opened. If the file requires * input/output processing, see if this process has ever registered * information as to how to write this type of file. If not, there's * nothing we can do. */ if (mfp->ftype != 0) { MUTEX_THREAD_LOCK(dbmp->mutexp); for (mpreg = LIST_FIRST(&dbmp->dbregq); mpreg != NULL; mpreg = LIST_NEXT(mpreg, q)) if (mpreg->ftype == mfp->ftype) break; MUTEX_THREAD_UNLOCK(dbmp->mutexp); if (mpreg == NULL) return (0); } /* * Try and open the file, attaching to the underlying shared area. * Ignore any error, assume it's a permissions problem. * * XXX * There's no negative cache, so we may repeatedly try and open files * that we have previously tried (and failed) to open. */ if (CDB___memp_fopen(dbmp, mfp, R_ADDR(&dbmp->reginfo, mfp->path_off), 0, 0, mfp->stat.st_pagesize, 0, NULL, &dbmfp) != 0) return (0); found: ret = CDB___memp_pgwrite(dbmp, dbmfp, bhp, restartp, wrotep); if (incremented) { MUTEX_THREAD_LOCK(dbmp->mutexp); --dbmfp->ref; MUTEX_THREAD_UNLOCK(dbmp->mutexp); } return (ret); } /* * CDB___memp_pgread -- * Read a page from a file. * * PUBLIC: int CDB___memp_pgread __P((DB_MPOOLFILE *, BH *, int)); */ int CDB___memp_pgread(dbmfp, bhp, can_create) DB_MPOOLFILE *dbmfp; BH *bhp; int can_create; { DB_IO db_io; DB_ENV *dbenv; DB_MPOOL *dbmp; MPOOLFILE *mfp; size_t len, pagesize; ssize_t nr; int created, ret; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; mfp = dbmfp->mfp; pagesize = mfp->stat.st_pagesize; F_SET(bhp, BH_LOCKED | BH_TRASH); MUTEX_LOCK(&bhp->mutex, dbenv->lockfhp); R_UNLOCK(dbenv, &dbmp->reginfo); /* * Temporary files may not yet have been created. We don't create * them now, we create them when the pages have to be flushed. */ nr = 0; if (F_ISSET(&dbmfp->fh, DB_FH_VALID)) { /* * Ignore read errors if we have permission to create the page. * Assume that the page doesn't exist, and that we'll create it * when we write it out. * * XXX * Theoretically, we could overwrite a page of data if it were * possible for a file to be successfully opened for reading * and then for the read to fail. Shouldn't ever happen, but * it might be worth checking to see if the offset is past the * known end-of-file. */ db_io.fhp = &dbmfp->fh; db_io.mutexp = dbmfp->mutexp; db_io.pagesize = db_io.bytes = pagesize; db_io.pgno = bhp->pgno; db_io.buf = bhp->buf; #ifdef DEBUG /* * Prevent signal to occur during IO */ word_monitor_click(); #endif /* DEBUG */ if(F_ISSET(dbmfp, MP_CMPR)) { ret = CDB___memp_cmpr(dbmfp, bhp, &db_io, DB_IO_READ, &nr); } else { ret = CDB___os_io(&db_io, DB_IO_READ, &nr); } #ifdef DEBUG if(ret == 0) { PAGE* pp = (PAGE*)db_io.buf; word_monitor_add(WORD_MONITOR_READ, 1); switch(TYPE(pp)) { case P_IBTREE: word_monitor_add(WORD_MONITOR_PAGE_IBTREE, 1); break; case P_LBTREE: word_monitor_add(WORD_MONITOR_PAGE_LBTREE, 1); break; default: word_monitor_add(WORD_MONITOR_PAGE_UNKNOWN, 1); break; } } #endif /* DEBUG */ } else ret = 0; created = 0; if (nr < (ssize_t)pagesize) { if (can_create) created = 1; else { /* * If we had a short read, ret may be 0. This may not * be an error -- in particular DB recovery processing * may request pages that have never been written to * disk, in which case we won't find the page. So, the * caller must know how to handle the error. */ if (ret == 0) ret = EIO; goto err; } } /* * Clear any bytes we didn't read that need to be cleared. If we're * running in diagnostic mode, smash any bytes on the page that are * unknown quantities for the caller. */ if (nr != (ssize_t)pagesize) { len = mfp->clear_len == 0 ? pagesize : mfp->clear_len; if (nr < (ssize_t)len) memset(bhp->buf + nr, 0, len - nr); #ifdef DIAGNOSTIC if (nr > (ssize_t)len) len = nr; if (len < pagesize) memset(bhp->buf + len, CLEAR_BYTE, pagesize - len); #endif } /* Call any pgin function. */ ret = mfp->ftype == 0 ? 0 : CDB___memp_pg(dbmfp, bhp, 1); /* Unlock the buffer and reacquire the region lock. */ err: MUTEX_UNLOCK(&bhp->mutex); R_LOCK(dbenv, &dbmp->reginfo); /* * If no errors occurred, the data is now valid, clear the BH_TRASH * flag; regardless, clear the lock bit and let other threads proceed. */ F_CLR(bhp, BH_LOCKED); if (ret == 0) { F_CLR(bhp, BH_TRASH); /* Update the statistics. */ if (created) ++mfp->stat.st_page_create; else ++mfp->stat.st_page_in; } return (ret); } /* * CDB___memp_pgwrite -- * Write a page to a file. * * PUBLIC: int CDB___memp_pgwrite * PUBLIC: __P((DB_MPOOL *, DB_MPOOLFILE *, BH *, int *, int *)); */ int CDB___memp_pgwrite(dbmp, dbmfp, bhp, restartp, wrotep) DB_MPOOL *dbmp; DB_MPOOLFILE *dbmfp; BH *bhp; int *restartp, *wrotep; { DB_ENV *dbenv; DB_IO db_io; DB_LSN lsn; MCACHE *mc; MPOOL *mp; MPOOLFILE *mfp; ssize_t nw; int callpgin, dosync, ret, syncfail; const char *fail; dbenv = dbmp->dbenv; mp = dbmp->reginfo.primary; mfp = dbmfp == NULL ? NULL : dbmfp->mfp; if (restartp != NULL) *restartp = 0; if (wrotep != NULL) *wrotep = 0; callpgin = 0; /* * Check the dirty bit -- this buffer may have been written since we * decided to write it. */ if (!F_ISSET(bhp, BH_DIRTY)) { if (wrotep != NULL) *wrotep = 1; return (0); } MUTEX_LOCK(&bhp->mutex, dbenv->lockfhp); /* * If there were two writers, we may have just been waiting while the * other writer completed I/O on this buffer. Check the dirty bit one * more time. */ if (!F_ISSET(bhp, BH_DIRTY)) { MUTEX_UNLOCK(&bhp->mutex); if (wrotep != NULL) *wrotep = 1; return (0); } F_SET(bhp, BH_LOCKED); R_UNLOCK(dbenv, &dbmp->reginfo); if (restartp != NULL) *restartp = 1; /* * It's possible that the underlying file was removed. Currently, * this is only used by the filesystem operation recovery routines, * but it's possible that it may be more widely used in the future. * * !!! * Once we pass this point, we know that dbmfp and mfp aren't NULL, * and that we have a valid file reference. */ if (mfp == NULL || F_ISSET(mfp, MP_REMOVED)) goto file_removed; /* Copy the LSN off the page if we're going to need it. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) || F_ISSET(bhp, BH_WRITE)) memcpy(&lsn, bhp->buf + mfp->lsn_off, sizeof(DB_LSN)); /* Ensure the appropriate log records are on disk. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) && (ret = CDB_log_flush(dbenv, &lsn)) != 0) goto err; /* * Call any pgout function. We set the callpgin flag so that we flag * that the contents of the buffer will need to be passed through pgin * before they are reused. */ if (mfp->ftype == 0) ret = 0; else { callpgin = 1; if ((ret = CDB___memp_pg(dbmfp, bhp, 0)) != 0) goto err; } /* Temporary files may not yet have been created. */ if (!F_ISSET(&dbmfp->fh, DB_FH_VALID)) { MUTEX_THREAD_LOCK(dbmp->mutexp); if (!F_ISSET(&dbmfp->fh, DB_FH_VALID) && ((ret = CDB___db_appname(dbenv, DB_APP_TMP, NULL, NULL, DB_OSO_CREATE | DB_OSO_EXCL | DB_OSO_TEMP, &dbmfp->fh, NULL)) != 0 || !F_ISSET(&dbmfp->fh, DB_FH_VALID))) { MUTEX_THREAD_UNLOCK(dbmp->mutexp); CDB___db_err(dbenv, "unable to create temporary backing file"); goto err; } MUTEX_THREAD_UNLOCK(dbmp->mutexp); } /* Write the page. */ db_io.fhp = &dbmfp->fh; db_io.mutexp = dbmfp->mutexp; db_io.pagesize = db_io.bytes = mfp->stat.st_pagesize; db_io.pgno = bhp->pgno; db_io.buf = bhp->buf; #ifdef DEBUG { PAGE* pp = (PAGE*)db_io.buf; word_monitor_add(WORD_MONITOR_WRITE, 1); switch(TYPE(pp)) { case P_IBTREE: word_monitor_add(WORD_MONITOR_PAGE_IBTREE, 1); break; case P_LBTREE: word_monitor_add(WORD_MONITOR_PAGE_LBTREE, 1); break; default: word_monitor_add(WORD_MONITOR_PAGE_UNKNOWN, 1); break; } } /* * Prevent signal to occur during IO */ word_monitor_click(); #endif /* DEBUG */ if(F_ISSET(dbmfp, MP_CMPR)) { ret = CDB___memp_cmpr(dbmfp, bhp, &db_io, DB_IO_WRITE, &nw); } else { ret = CDB___os_io(&db_io, DB_IO_WRITE, &nw); } if (ret != 0) { CDB___db_panic(dbenv, ret); fail = "write"; goto syserr; } if (nw != (ssize_t)mfp->stat.st_pagesize) { ret = EIO; fail = "write"; goto syserr; } file_removed: /* * !!! * Once we pass this point, dbmfp and mfp may be NULL, we may not have * a valid file reference. * * Unlock the buffer and reacquire the region lock. */ MUTEX_UNLOCK(&bhp->mutex); R_LOCK(dbenv, &dbmp->reginfo); /* * Clean up the flags based on a successful write. * * If we rewrote the page, it will need processing by the pgin * routine before reuse. */ if (callpgin) F_SET(bhp, BH_CALLPGIN); F_CLR(bhp, BH_DIRTY | BH_LOCKED); /* * If we write a buffer for which a checkpoint is waiting, update * the count of pending buffers (both in the mpool as a whole and * for this file). If the count for this file goes to zero, set a * flag so we flush the writes. */ dosync = 0; if (F_ISSET(bhp, BH_WRITE)) { F_CLR(bhp, BH_WRITE); --mp->lsn_cnt; if (mfp != NULL) dosync = --mfp->lsn_cnt == 0 ? 1 : 0; } /* Update the page clean/dirty statistics. */ mc = BH_TO_CACHE(dbmp, bhp); ++mc->stat.st_page_clean; --mc->stat.st_page_dirty; /* Update I/O statistics. */ if (mfp != NULL) ++mfp->stat.st_page_out; /* * Do the sync after everything else has been updated, so any incoming * checkpoint doesn't see inconsistent information. * * XXX: * Don't lock the region around the sync, fsync(2) has no atomicity * issues. * * XXX: * We ignore errors from the sync -- it makes no sense to return an * error to the calling process, so set a flag causing the checkpoint * to be retried later. There is a possibility, of course, that a * subsequent checkpoint was started and that we're going to force it * to fail. That should be unlikely, and fixing it would be difficult. */ if (dosync) { R_UNLOCK(dbenv, &dbmp->reginfo); syncfail = CDB___os_fsync(&dbmfp->fh) != 0; R_LOCK(dbenv, &dbmp->reginfo); if (syncfail) F_SET(mp, MP_LSN_RETRY); } if (wrotep != NULL) *wrotep = 1; return (0); syserr: CDB___db_err(dbenv, "%s: %s failed for page %lu", CDB___memp_fn(dbmfp), fail, (u_long)bhp->pgno); err: /* Unlock the buffer and reacquire the region lock. */ MUTEX_UNLOCK(&bhp->mutex); R_LOCK(dbenv, &dbmp->reginfo); /* * Clean up the flags based on a failure. * * The page remains dirty but we remove our lock. If we rewrote the * page, it will need processing by the pgin routine before reuse. */ if (callpgin) F_SET(bhp, BH_CALLPGIN); F_CLR(bhp, BH_LOCKED); return (ret); } /* * CDB___memp_pg -- * Call the pgin/pgout routine. * * PUBLIC: int CDB___memp_pg __P((DB_MPOOLFILE *, BH *, int)); */ int CDB___memp_pg(dbmfp, bhp, is_pgin) DB_MPOOLFILE *dbmfp; BH *bhp; int is_pgin; { DBT dbt, *dbtp; DB_MPOOL *dbmp; DB_MPREG *mpreg; MPOOLFILE *mfp; int ftype, ret; dbmp = dbmfp->dbmp; mfp = dbmfp->mfp; MUTEX_THREAD_LOCK(dbmp->mutexp); ftype = mfp->ftype; for (mpreg = LIST_FIRST(&dbmp->dbregq); mpreg != NULL; mpreg = LIST_NEXT(mpreg, q)) { if (ftype != mpreg->ftype) continue; if (mfp->pgcookie_len == 0) dbtp = NULL; else { dbt.size = mfp->pgcookie_len; dbt.data = R_ADDR(&dbmp->reginfo, mfp->pgcookie_off); dbtp = &dbt; } MUTEX_THREAD_UNLOCK(dbmp->mutexp); if (is_pgin) { if (mpreg->pgin != NULL && (ret = mpreg->pgin(bhp->pgno, bhp->buf, dbtp)) != 0) goto err; } else if (mpreg->pgout != NULL && (ret = mpreg->pgout(bhp->pgno, bhp->buf, dbtp)) != 0) goto err; break; } if (mpreg == NULL) MUTEX_THREAD_UNLOCK(dbmp->mutexp); return (0); err: MUTEX_THREAD_UNLOCK(dbmp->mutexp); CDB___db_err(dbmp->dbenv, "%s: %s failed for page %lu", CDB___memp_fn(dbmfp), is_pgin ? "pgin" : "pgout", (u_long)bhp->pgno); return (ret); } /* * CDB___memp_bhfree -- * Free a bucket header and its referenced data. * * PUBLIC: void CDB___memp_bhfree __P((DB_MPOOL *, BH *, int)); */ void CDB___memp_bhfree(dbmp, bhp, free_mem) DB_MPOOL *dbmp; BH *bhp; int free_mem; { DB_HASHTAB *dbht; MCACHE *mc; MPOOL *mp; int n_bucket, n_cache; mp = dbmp->reginfo.primary; mc = BH_TO_CACHE(dbmp, bhp); n_cache = NCACHE(mp, bhp->pgno); n_bucket = NBUCKET(mc, bhp->mf_offset, bhp->pgno); dbht = R_ADDR(&dbmp->c_reginfo[n_cache], mc->htab); /* Delete the buffer header from the hash bucket queue. */ SH_TAILQ_REMOVE(&dbht[n_bucket], bhp, hq, __bh); /* Delete the buffer header from the LRU queue. */ SH_TAILQ_REMOVE(&mc->bhq, bhp, q, __bh); DB_ASSERT(mc->stat.st_page_clean != 0); --mc->stat.st_page_clean; /* * If we're not reusing it immediately, free the buffer header * and data for real. */ CDB___memp_cmpr_free_chain(dbmp, bhp); if (free_mem) { CDB___db_shalloc_free(dbmp->c_reginfo[n_cache].addr, bhp); } } /* * CDB___memp_upgrade -- * Upgrade a file descriptor from readonly to readwrite. */ static int CDB___memp_upgrade(dbmp, dbmfp, mfp) DB_MPOOL *dbmp; DB_MPOOLFILE *dbmfp; MPOOLFILE *mfp; { DB_FH fh; int ret; char *rpath; /* * !!! * We expect the handle to already be locked. */ /* Check to see if we've already upgraded. */ if (F_ISSET(dbmfp, MP_UPGRADE)) return (0); /* Check to see if we've already failed. */ if (F_ISSET(dbmfp, MP_UPGRADE_FAIL)) return (1); /* * Calculate the real name for this file and try to open it read/write. * We know we have a valid pathname for the file because it's the only * way we could have gotten a file descriptor of any kind. */ if ((ret = CDB___db_appname(dbmp->dbenv, DB_APP_DATA, NULL, R_ADDR(&dbmp->reginfo, mfp->path_off), 0, NULL, &rpath)) != 0) return (ret); if (CDB___os_open(rpath, 0, 0, &fh) != 0) { F_SET(dbmfp, MP_UPGRADE_FAIL); ret = 1; } else { /* Swap the descriptors and set the upgrade flag. */ (void)CDB___os_closehandle(&dbmfp->fh); dbmfp->fh = fh; F_SET(dbmfp, MP_UPGRADE); ret = 0; } CDB___os_freestr(rpath); return (ret); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_cmpr.c��������������������������������������������������������������������������0100644�0063146�0012731�00000075365�10013144170�014560� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999, 2000 * Loic Dachary. All rights reserved. * * Overview of the code (by Lachlan Andrew, lha@users.sourceforge.net): * * This code compresses pages on-the-fly, either using a built-in algorithm, * or using the zlib library. The compressed page is stored in pages of * size CMPR_MULTIPLY(db_io->pagesize) -- a fixed multiple of the true * page size, db_io->pagesize. If the compressed page requires multiple * pages, extra pages are allocated at the end of the file, and "chained" * on to the original page. The chain is specified as an array in the first * page (not a linked list). If a subsequent write of the page requires * a shorter chain, the spare pages are recorded as "free" and listed in * the weak-compression database (with suffix given by DB_CMPR_SUFFIX). * * When writing a compressed page, extra memory may need to be allocated if * chaining occurs. This can cause recursive calls to CDB___memp_alloc(), * since the latter may write dirty cache pages to satisfy the request. * There is currently an explicit check for recursive calls, both in * CDB___memp_alloc() and CDB___memp_cmpr_write(), but a more elegant * solution would be nice. * * There also seems to be an issue with the memory allocation for the chain * array. The small allocations seem to cause fragmentation in the memory * pool (seen as very many small clean blocks, which don't go away). * * * TODO: * Keith Bostic says: * The only change I'd probably think about is if * we should merge the call to CDB___memp_pg and CDB___memp_cmpr -- kind * of a stack of page modification routines, that sits on top of * CDB___os_io. That's a bigger change, but it's probably cleaner * in the long-run. * * Pending questions: * * The CMPR structure contains binary data. Should we store them in network order ? * How is this related to DB_AM_SWAP ? * * The calls to cmpr_open/cmpr_close in memp_pgread/pgwrite are probably not * at the right place / most logical place in the function. I have troubles * finding out where to put them. They work, that's not the problem. Just don't * know if they should be before or after. * * When opening weakcmpr DB, the DB_THREAD flag is not available. Should it be * set if the main DB has this flag set ? * * In CDB___memp_cmpr, niop is always multiplied by compression factor for page 0. * I see no problems with this but it's a bit awkward. * * In CDB___memp_cmpr_page, the page built fills some fields of the PAGE structure * others are set to 0. I'm not 100% sure this is enough. It should only impact * utilities that read pages by incrementing pgno. Only stat does this an it's * enough for it. I've not found any other context where these fake pages are * used. * */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_cmpr.c 1.1 (Senga) 01/08/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "shqueue.h" #include "db_shash.h" #include "mp.h" #include "db_page.h" #include "common_ext.h" #ifdef DEBUG #include "WordMonitor.h" #endif /* DEBUG */ #if 0 #define DEBUG_CMPR 1 #endif #if 0 #define DEBUG_CMPR_ALLOC 1 #endif #ifdef HAVE_LIBZ #include "zlib.h" #endif /* HAVE_LIBZ */ static int memp_cmpr_zlib_level = -1; /* * Helpers declarations. */ static int CDB___memp_cmpr_page __P((DB_MPOOLFILE *, CMPR *, DB_IO *, ssize_t *)); /* * Maximum chain length * Cast to signed, as -1 used as a flag, which compares bigger on some systems */ #define CMPR_MAX (int)(dbenv->mp_cmpr_info->max_npages) #define CMPR_MULTIPLY(n) ((n) << (dbenv->mp_cmpr_info->coefficient)) #define CMPR_DIVIDE(n) ((n) >> (dbenv->mp_cmpr_info->coefficient)) #ifdef HAVE_LIBZ static DB_CMPR_INFO default_cmpr_info = { CDB___memp_cmpr_deflate, CDB___memp_cmpr_inflate, 3, /* reduce page size by factor of 1<<3 = 8 */ 9, /* allow 9 reduced pages, in case "compression" expands data */ 6, /* zlib compression level */ NULL }; #else /* HAVE_LIBZ */ static DB_CMPR_INFO default_cmpr_info = { 0, 0, 0, 0, 0, NULL }; #endif /* HAVE_LIBZ */ /* * Entry point. Functionaly equivalent to CDB___os_io. * Compress/uncompress pages before returning them or writing them to disk. */ /* * CDB___memp_cmpr -- * Transparent compression read/write * * PUBLIC: int CDB___memp_cmpr __P((DB_MPOOLFILE *, BH *, DB_IO *, int, ssize_t *)); */ int CDB___memp_cmpr(dbmfp, bhp, db_io, flag, niop) DB_MPOOLFILE *dbmfp; BH *bhp; DB_IO *db_io; int flag; ssize_t *niop; { size_t orig_pagesize = db_io->pagesize; db_pgno_t orig_pgno = db_io->pgno; size_t orig_bytes = db_io->bytes; DB_ENV *dbenv = dbmfp->dbmp->dbenv; DB_CMPR_INFO *cmpr_info = dbenv->mp_cmpr_info; int ret = 0; db_io->pagesize = CMPR_DIVIDE(db_io->pagesize); db_io->bytes = CMPR_DIVIDE(db_io->bytes); #ifdef HAVE_LIBZ if(memp_cmpr_zlib_level == -1) { memp_cmpr_zlib_level = cmpr_info->zlib_flags; if(memp_cmpr_zlib_level == -1) memp_cmpr_zlib_level = Z_DEFAULT_COMPRESSION; } #endif /* * Page 0 is a special case. It contains the metadata information (at most 512 bytes) * and must not be compressed because it is read with CDB___os_read and not CDB___os_io. */ switch (flag) { case DB_IO_READ: if(db_io->pgno == 0) { ret = CDB___os_io(db_io, DB_IO_READ, niop); *niop = CMPR_MULTIPLY(*niop); } else ret = CDB___memp_cmpr_read(dbmfp, bhp, db_io, niop); break; case DB_IO_WRITE: if(db_io->pgno == 0) { ret = CDB___os_io(db_io, DB_IO_WRITE, niop); *niop = CMPR_MULTIPLY(*niop); } else ret = CDB___memp_cmpr_write(dbmfp, bhp, db_io, niop); break; } db_io->pgno = orig_pgno; db_io->pagesize = orig_pagesize; db_io->bytes = orig_bytes; return ret; } /* * CDB___memp_cmpr_read -- * Transparent compression read * * PUBLIC: int CDB___memp_cmpr_read __P((DB_MPOOLFILE *, BH *, DB_IO *, ssize_t *)); */ int CDB___memp_cmpr_read(dbmfp, bhp, db_io, niop) DB_MPOOLFILE *dbmfp; BH *bhp; DB_IO *db_io; ssize_t *niop; { CMPR cmpr; int ret; int chain = 0; u_int8_t *buffcmpr = 0; int buffcmpr_length = 0; int chain_length = 0; db_pgno_t first_pgno = db_io->pgno; DB_ENV *dbenv = dbmfp->dbmp->dbenv; DB_CMPR_INFO *cmpr_info = dbenv->mp_cmpr_info; /* * By default the compression does not use too much space, * hence the chain is empty. */ F_CLR(bhp, BH_CMPR); /* * Read first page (if no overflow, this is the only one) */ ret = CDB___os_io(db_io, DB_IO_READ, niop); /* * An error or partial read on the first page means that we're not * going anywhere. */ if(ret || *niop < db_io->pagesize) goto err; /* * Read the cmpr header from page. */ memcpy(&cmpr, db_io->buf, sizeof(CMPR)); /* * If not at the beginning of compressed page chain, build * a fake page. */ if(F_ISSET(&cmpr, DB_CMPR_FREE) || F_ISSET(&cmpr, DB_CMPR_INTERNAL)) { ret = CDB___memp_cmpr_page(dbmfp, &cmpr, db_io, niop); goto err; } /* * Sanity check. Happens if file corrupted. */ if(!F_ISSET(&cmpr, DB_CMPR_FIRST)) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: expected DB_CMPR_FIRST flag set at pgno = %ld", db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, EINVAL); goto err; } if((ret = CDB___os_malloc(db_io->pagesize * CMPR_MAX, NULL, &buffcmpr)) != 0) goto err; do { /* * Read the first part of the compressed data from page. */ memcpy(buffcmpr + buffcmpr_length, DB_CMPR_DATA(db_io), DB_CMPR_PAGESIZE(db_io)); buffcmpr_length += DB_CMPR_PAGESIZE(db_io); /* * Flag must only contain FIRST|INTERNAL and/or CHAIN. If other bits are * set, the data is corrupted. Removing the FIRST|INTERNAL bits and checking * the CHAIN bit with == instead of F_ISSET verify this. */ F_CLR(&cmpr, DB_CMPR_FIRST | DB_CMPR_INTERNAL); chain = cmpr.flags; if(chain == DB_CMPR_CHAIN) { /* * Overflow Case. Continue reading data from extra pages. */ chain_length++; if(chain_length >= CMPR_MAX) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: compression chain too long at pgno = %ld", db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, EINVAL); goto err; } if(cmpr.next == 0) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: cmpr.next is null at pgno = %ld", chain, db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, EINVAL); goto err; } /* * Keep the chain in buffer header. * Freed when bhp freed in CDB___memp_bhfree(). */ CDB___memp_cmpr_alloc_chain(dbmfp->dbmp, bhp, BH_CMPR_POOL); bhp->chain[chain_length - 1] = cmpr.next; db_io->pgno = cmpr.next; /* * Read data from extra page. */ if((ret = CDB___os_io(db_io, DB_IO_READ, niop)) != 0 || *niop != db_io->pagesize) { ret = EIO; goto err; } /* * Read the cmpr header from this extra page */ memcpy(&cmpr, db_io->buf, sizeof(CMPR)); } else if(chain != 0) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: unexpected compression flag value 0x%x at pgno = %ld", chain, db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, ret); goto err; } else if(cmpr.next != 0) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: cmpr.next is not null at pgno = %ld", chain, db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, ret); goto err; } } while(chain); /* * We gathered all the compressed data in buffcmpr, inflate it. */ if(cmpr_info->zlib_flags != 0) ret = CDB___memp_cmpr_inflate(buffcmpr, buffcmpr_length, db_io->buf, CMPR_MULTIPLY(db_io->pagesize), cmpr_info->user_data); else ret = (*cmpr_info->uncompress)(buffcmpr, buffcmpr_length, db_io->buf, CMPR_MULTIPLY(db_io->pagesize), cmpr_info->user_data); if(ret != 0) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_read: unable to uncompress page at pgno = %ld", first_pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, ret); goto err; } #ifdef DEBUG { int ratio = buffcmpr_length > 0 ? (CMPR_MULTIPLY(db_io->pagesize) / buffcmpr_length) : 0; if(ratio > 10) ratio = 10; word_monitor_add(WORD_MONITOR_COMPRESS_01 + ratio, 1); } #endif /* DEBUG */ *niop = CMPR_MULTIPLY(db_io->pagesize); err: #ifdef DEBUG_CMPR if(chain_length > 0) { int i; fprintf(stderr,"CDB___memp_cmpr_read:: chain_length (number of overflow pages):%2d\n",chain_length); fprintf(stderr,"CDB___memp_cmpr_read:: chain "); for(i = 0; i < chain_length; i++) fprintf(stderr, "%d, ", bhp->chain[i]); fprintf(stderr, "\n"); } #endif if(buffcmpr) CDB___os_free(buffcmpr, 0); return ret; } /* * CDB___memp_cmpr_write -- * Transparent compression write * * PUBLIC: int CDB___memp_cmpr_write __P((DB_MPOOLFILE *, BH *, DB_IO *, ssize_t *)); */ int CDB___memp_cmpr_write(dbmfp, bhp, db_io, niop) DB_MPOOLFILE *dbmfp; BH *bhp; DB_IO *db_io; ssize_t *niop; { CMPR cmpr; int chain_length = 0; int first_nonreused_chain_pos = 0; int ret; u_int8_t *buffcmpr = 0; u_int8_t *buffp; unsigned int buffcmpr_length; u_int8_t *orig_buff = db_io->buf; DB_ENV *dbenv = dbmfp->dbmp->dbenv; DB_CMPR_INFO *cmpr_info = dbenv->mp_cmpr_info; if((ret = CDB___os_malloc(CMPR_MULTIPLY(db_io->bytes), NULL, &db_io->buf)) != 0) goto err; if(cmpr_info->zlib_flags != 0) ret = CDB___memp_cmpr_deflate(orig_buff, CMPR_MULTIPLY(db_io->pagesize), &buffcmpr, &buffcmpr_length, cmpr_info->user_data); else ret = (*cmpr_info->compress)(orig_buff, CMPR_MULTIPLY(db_io->pagesize), &buffcmpr, &buffcmpr_length, cmpr_info->user_data); if(ret != 0) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_write: unable to compress page at pgno = %ld", db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, ret); goto err; } #ifdef DEBUG { int ratio = buffcmpr_length > 0 ? (CMPR_MULTIPLY(db_io->pagesize) / buffcmpr_length) : 0; if(ratio > 10) ratio = 10; word_monitor_add(WORD_MONITOR_COMPRESS_01 + ratio, 1); } #endif /* DEBUG */ /* * This can never happen. */ if(buffcmpr_length > DB_CMPR_PAGESIZE(db_io) * CMPR_MAX) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_write: compressed data is too big at pgno = %ld", db_io->pgno); ret = CDB___db_panic(dbmfp->dbmp->dbenv, EINVAL); goto err; } buffp = buffcmpr; cmpr.flags = DB_CMPR_FIRST; cmpr.next = 0; /* write pages until the whole compressed data is written */ do { unsigned int length = buffcmpr_length - (buffp - buffcmpr); unsigned int copy_length = length > DB_CMPR_PAGESIZE(db_io) ? DB_CMPR_PAGESIZE(db_io) : length; /* * We handle serious compression stuff only if we need to. * overflow! the compressed buffer is too big -> get extra page */ if(length > copy_length) { if (dbmfp->dbmp->recursion_level >= 2 ) { fprintf(stderr,"CDB___memp_cmpr_write: Wanted %d > %d bytes\n", length, copy_length); fprintf(stderr,"Reducing wordlist_cache_dirty_level may help.\n"); ret = EBUSY; goto err; } chain_length++; if(chain_length >= CMPR_MAX) { CDB___db_err(dbmfp->dbmp->dbenv, "CDB___memp_cmpr_write: chain_length overflow"); ret = CDB___db_panic(dbmfp->dbmp->dbenv, EINVAL); goto err; } F_SET(&cmpr, DB_CMPR_CHAIN); if((ret = CDB___memp_cmpr_alloc(dbmfp, &cmpr.next, bhp, &first_nonreused_chain_pos)) != 0) goto err; CDB___memp_cmpr_alloc_chain(dbmfp->dbmp, bhp, BH_CMPR_OS); bhp->chain[chain_length - 1] = cmpr.next; } /* write in the cmpr header */ memcpy(db_io->buf, &cmpr, DB_CMPR_OVERHEAD); /* write in what's left of the compressed buffer (and that also fits in) */ memcpy(db_io->buf + DB_CMPR_OVERHEAD, buffp, copy_length); buffp += copy_length; /* actual output */ if((ret = CDB___os_io(db_io, DB_IO_WRITE, niop)) != 0 || *niop != db_io->pagesize) { ret = EIO; goto err; } db_io->pgno = cmpr.next; cmpr.flags = DB_CMPR_INTERNAL; cmpr.next = 0; } while((unsigned int)(buffp - buffcmpr) < buffcmpr_length); #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_write:: chain_length (number of overflow pages):%2d\n",chain_length); if(chain_length > 0) { int i; fprintf(stderr,"CDB___memp_cmpr_write:: chain "); for(i = 0; i < chain_length; i++) fprintf(stderr, "%d, ", bhp->chain[i]); fprintf(stderr, "\n"); } #endif /* * If the chain was not completely reused, free the remaining pages (the page compression * rate is better). */ if(F_ISSET(bhp, BH_CMPR) && first_nonreused_chain_pos >= 0) { int i; CMPR cmpr; cmpr.flags = DB_CMPR_FREE; cmpr.next = 0; memcpy(db_io->buf, &cmpr, sizeof(CMPR)); for(i = first_nonreused_chain_pos; i < (CMPR_MAX - 1) && bhp->chain[i]; i++) { if((ret = CDB___memp_cmpr_free(dbmfp, bhp->chain[i])) != 0) goto err; /* * Mark the page as free for recovery. */ db_io->pgno = bhp->chain[i]; if((ret = CDB___os_io(db_io, DB_IO_WRITE, niop)) != 0 || *niop != db_io->pagesize) { ret = EIO; goto err; } bhp->chain[i] = 0; } } CDB___memp_cmpr_free_chain(dbmfp->dbmp, bhp); /* * In case of success, always pretend that we exactly wrote the * all bytes of the original pagesize. */ *niop = CMPR_MULTIPLY(db_io->pagesize); err: CDB___os_free(db_io->buf, 0); db_io->buf = orig_buff; if(buffcmpr) CDB___os_free(buffcmpr, 0); return ret; } /* * Helpers */ /* * CDB___memp_cmpr_page -- * Build a fake page. This function is a CDB___memp_cmpr_read helper. * */ static int CDB___memp_cmpr_page(dbmfp, cmpr, db_io, niop) DB_MPOOLFILE *dbmfp; CMPR *cmpr; DB_IO *db_io; ssize_t *niop; { DB_ENV *dbenv = dbmfp->dbmp->dbenv; int ret = 0; PAGE page; memset((char*)&page, '\0', sizeof(PAGE)); page.pgno = db_io->pgno; page.type = F_ISSET(cmpr, DB_CMPR_FREE) ? P_CMPR_FREE : P_CMPR_INTERNAL; /* * Sanity check */ if(db_io->pagesize < sizeof(PAGE)) { ret = ENOMEM; goto err; } memcpy(db_io->buf, (char*)&page, sizeof(PAGE)); *niop = CMPR_MULTIPLY(db_io->pagesize); err: return ret; } /* * CDB___memp_cmpr_inflate -- * Decompress buffer * * PUBLIC: int CDB___memp_cmpr_inflate __P((const u_int8_t *, int, u_int8_t *, int, void *)); */ int CDB___memp_cmpr_inflate(inbuff, inbuff_length, outbuff, outbuff_length, user_data) const u_int8_t* inbuff; int inbuff_length; u_int8_t* outbuff; int outbuff_length; void *user_data; { #ifdef HAVE_LIBZ int ret = 0; z_stream c_stream; c_stream.zalloc=(alloc_func)0; c_stream.zfree=(free_func)0; c_stream.opaque=(voidpf)0; c_stream.next_in = (Bytef*)inbuff; c_stream.avail_in = inbuff_length; c_stream.next_out = outbuff; c_stream.avail_out = outbuff_length; if(inflateInit(&c_stream) != Z_OK || inflate(&c_stream, Z_FINISH) != Z_STREAM_END || inflateEnd(&c_stream) != Z_OK) ret = EIO; /* * The uncompressed data must *exactly* fill outbuff_length. */ if(c_stream.avail_out != 0) ret = EIO; return ret; #else /* HAVE_LIBZ */ return EINVAL; #endif /* HAVE_LIBZ */ } /* * CDB___memp_cmpr_deflate -- * Compress buffer * * PUBLIC: int CDB___memp_cmpr_deflate __P((const u_int8_t *, int, u_int8_t **, int*, void *)); */ int CDB___memp_cmpr_deflate(inbuff, inbuff_length, outbuffp, outbuff_lengthp, user_data) const u_int8_t* inbuff; int inbuff_length; u_int8_t** outbuffp; int* outbuff_lengthp; void *user_data; { #ifdef HAVE_LIBZ int ret = 0; int r; int off = 0; int freesp = 0; z_stream c_stream; u_int8_t* outbuff; /* * Z_FINISH can be used immediately after deflateInit if all the compression * is to be done in a single step. In this case, avail_out must be at least * 0.1% larger than avail_in plus 12 bytes. If deflate does not return * Z_STREAM_END, then it must be called again as described above. * * !!! * In order to avoid division by 1000, divide by 512 (2^9) using shift. * That is, make the buffer 0.2% larger. */ int outbuff_length = inbuff_length + (inbuff_length >> 9) + 12; *outbuffp = 0; *outbuff_lengthp = 0; if(CDB___os_malloc(outbuff_length, NULL, &outbuff) != 0) { ret = ENOMEM; goto err; } /* * Clear possible garbage in the page */ { PAGE* pg = (PAGE*)inbuff; switch(TYPE(pg)) { case P_IBTREE: case P_LBTREE: off = LOFFSET(pg); freesp = P_FREESPACE(pg); memset((char*)(inbuff + off), 0, freesp); break; } } c_stream.zalloc=(alloc_func)0; c_stream.zfree=(free_func)0; c_stream.opaque=(voidpf)0; if(deflateInit(&c_stream, memp_cmpr_zlib_level) != Z_OK) { ret = EIO; goto err; } c_stream.next_in = (Bytef*)inbuff; c_stream.avail_in = inbuff_length; c_stream.next_out = outbuff; c_stream.avail_out = outbuff_length; while((r = deflate(&c_stream, Z_FINISH)) != Z_STREAM_END && r == Z_OK) ; if(r != Z_STREAM_END) ret = EIO; if(deflateEnd(&c_stream) != Z_OK) ret = EIO; if(ret == 0) { *outbuffp = outbuff; *outbuff_lengthp = outbuff_length - c_stream.avail_out; } else { CDB___os_free(outbuff, outbuff_length); } #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_deflate:: compress %d bytes to %d \n", inbuff_length, *outbuff_lengthp); #endif err: return ret; #else /* HAVE_LIBZ */ return EINVAL; #endif /* HAVE_LIBZ */ } /* * CDB___memp_cmpr_info_valid -- * Compute compressed page size */ static int CDB___memp_cmpr_info_valid(dbenv,cmpr_info) DB_ENV *dbenv; DB_CMPR_INFO *cmpr_info; { int ret = 0; if(!cmpr_info ) { CDB___db_err(dbenv, "CDB___memp_cmpr_info_valid: cmpr_info == NULL"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } if(!cmpr_info->compress ) { CDB___db_err(dbenv, "CDB___memp_cmpr_info_valid: compress == NULL!"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } if(!cmpr_info->uncompress ) { CDB___db_err(dbenv, "CDB___memp_cmpr_info_valid: uncompress == NULL!"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } if(cmpr_info->coefficient == 0 || cmpr_info->coefficient > 5 ) { CDB___db_err(dbenv, "CDB___memp_cmpr_info_valid: coefficient should be > 0 and < 5 coefficient=%d ", cmpr_info->coefficient); ret = CDB___db_panic(dbenv, EINVAL); goto err; } if(cmpr_info->max_npages == 0 || cmpr_info->max_npages > 128 ) { CDB___db_err(dbenv, "CDB___memp_cmpr_info_valid: max_npages should be > 0 and < 128 max_npages=%d ", cmpr_info->max_npages); ret = CDB___db_panic(dbenv, EINVAL); goto err; } err: return ret; } /* * __memp_cmpr_pagesize -- * Compute compressed page size * * PUBLIC: u_int8_t CDB___memp_cmpr_coefficient __P((DB_ENV *dbenv)); */ u_int8_t CDB___memp_cmpr_coefficient(dbenv) DB_ENV *dbenv; { u_int8_t ret = 0; if(!dbenv || !dbenv->mp_cmpr_info) { ret = default_cmpr_info.coefficient; } else { CDB___memp_cmpr_info_valid(dbenv, dbenv->mp_cmpr_info); ret = dbenv->mp_cmpr_info->coefficient; } return (ret); } /* * Initialisation of page compression */ /* * CDB___memp_cmpr_open -- * Open the db that contains the free compression pages. * * PUBLIC: int CDB___memp_cmpr_open __P((const char *, DB_ENV *, CMPR_CONTEXT *)); */ int CDB___memp_cmpr_open(dbenv, path, flags, mode, cmpr_context) DB_ENV *dbenv; const char *path; int flags; int mode; CMPR_CONTEXT *cmpr_context; { int ret; char* tmp = 0; int tmp_length = strlen(path) + strlen(DB_CMPR_SUFFIX) + 1; /* * Management of pages containing data when the compression does not achieve * the expected compression ratio. */ { DB *dbp; if((ret = CDB___os_malloc(tmp_length, NULL, &tmp)) != 0) goto err; sprintf(tmp, "%s%s", path, DB_CMPR_SUFFIX); /* Use *standalone* database, to prevent recursion when writing pages */ /* from the cache, shared with other members of the environment */ if(CDB_db_create(&dbp, NULL, 0) != 0) goto err; cmpr_context->weakcmpr = dbp; (dbp->set_flags)(dbp, DB_RECNUM); LF_CLR(DB_COMPRESS); if(!LF_ISSET(DB_RDONLY)) LF_SET(DB_CREATE); if((ret = (dbp->open)(dbp, tmp, NULL, DB_BTREE, flags, mode)) != 0) goto err; } /* * Initialisation of cmpr_context */ if(!dbenv->mp_cmpr_info) { if(default_cmpr_info.compress == 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_open: zlib compression not available, re-compile --with-zlib=DIR"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } dbenv->mp_cmpr_info = &default_cmpr_info; } /* * Check if cmpr_info is sane */ if((ret = CDB___memp_cmpr_info_valid(dbenv, dbenv->mp_cmpr_info))) goto err; err: if(tmp) CDB___os_free(tmp, tmp_length); return ret; } /* * CDB___memp_cmpr_close -- * Close the db that contains the free compression pages. * * PUBLIC: int CDB___memp_cmpr_close __P((CMPR_CONTEXT *)); */ int CDB___memp_cmpr_close(cmpr_context) CMPR_CONTEXT *cmpr_context; { int ret = 0; if(cmpr_context->weakcmpr == 0) { ret = EINVAL; goto err; } if((ret = cmpr_context->weakcmpr->close(cmpr_context->weakcmpr, 0)) != 0) goto err; cmpr_context->weakcmpr = 0; err: return ret; } /* * CDB___memp_cmpr_alloc -- * Get a new free page to store weak compression data. * * PUBLIC: int CDB___memp_cmpr_alloc __P((DB_MPOOLFILE *, db_pgno_t *, BH *, int *)); */ int CDB___memp_cmpr_alloc(dbmfp, pgnop, bhp, first_nonreused_chain_posp) DB_MPOOLFILE *dbmfp; db_pgno_t *pgnop; BH *bhp; int *first_nonreused_chain_posp; { DB_ENV *dbenv = dbmfp->dbmp->dbenv; int ret = 0; #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_alloc:: bhp:%8x bhp->chain:%8x first_nonreused_chain_posp:%2d\n", bhp, bhp->chain, *first_nonreused_chain_posp); #endif if(F_ISSET(bhp, BH_CMPR) && bhp->chain == NULL) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: BH_CMPR set and bhp->chain == NULL"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } if((*first_nonreused_chain_posp) >= (CMPR_MAX - 1)) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: first_nonreused_chain_pos >= (CMPR_MAX - 1)"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } /* * If possible reuse an existing chain. */ if((*first_nonreused_chain_posp) >= 0 && F_ISSET(bhp, BH_CMPR) && bhp->chain[*first_nonreused_chain_posp]) { *pgnop = bhp->chain[*first_nonreused_chain_posp]; (*first_nonreused_chain_posp)++; #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_alloc:: reusing page in chain \n"); #endif } else { DB *db = dbmfp->cmpr_context.weakcmpr; DBT key; DBT data; db_recno_t recno = 1; /* all pages in bhp->chain are now reused */ (*first_nonreused_chain_posp) = -1; #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_alloc:: no more reusable pages in chain\n"); #endif if(db == 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: dbmfp->cmpr_context.weakcmpr is null"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } /* * If the existing chain is too short, pop a free page from * the free pages database. */ memset(&key, '\0', sizeof(DBT)); memset(&data, '\0', sizeof(DBT)); key.data = &recno; key.size = sizeof(recno); if((ret = db->get(db, NULL, &key, &data, DB_SET_RECNO)) != 0) { /* * If the free list is empty, create a new page. */ #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_alloc:: weakcmpr free page pool empty, allocating\n"); #endif if(ret == DB_NOTFOUND) { DB_MPOOL *dbmp = dbmfp->dbmp; ret = 0; R_LOCK(dbenv, &dbmp->reginfo); ++dbmfp->mfp->last_pgno; #ifdef DEBUG word_monitor_set(WORD_MONITOR_PGNO, dbmfp->mfp->last_pgno); #endif /* DEBUG */ *pgnop = dbmfp->mfp->last_pgno; R_UNLOCK(dbenv, &dbmp->reginfo); ret = 0; } else { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: unexpected error from weakcmpr base"); ret = CDB___db_panic(dbenv, ret); } } else { if(key.size != sizeof(db_pgno_t)) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: unexpected key size from weakcmpr base (%d instead of %d)", key.size, sizeof(db_pgno_t)); ret = CDB___db_panic(dbenv, ret); } else { memcpy((char*)pgnop, (char*)key.data, key.size); if((ret = db->del(db, NULL, &key, 0)) != 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: del error, got pgno %d", *pgnop); ret = CDB___db_panic(dbenv, ret); } if(*pgnop == 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc: unexpected pgno == 0"); ret = CDB___db_panic(dbenv, ret); } } #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_alloc:: reuse free page %d from weakcmpr\n", *pgnop); #endif } } err: return ret; } /* * CDB___memp_cmpr_free -- * Release a page used to store weak compression data. * * PUBLIC: int CDB___memp_cmpr_free __P((DB_MPOOLFILE *, db_pgno_t)); */ int CDB___memp_cmpr_free(dbmfp, pgno) DB_MPOOLFILE *dbmfp; db_pgno_t pgno; { int ret = 0; DB_ENV *dbenv = dbmfp->dbmp->dbenv; DB *db = dbmfp->cmpr_context.weakcmpr; DBT key; DBT data; #ifdef DEBUG_CMPR fprintf(stderr,"CDB___memp_cmpr_free:: freeing page (inserting into weakcmpr):%3d \n",pgno); #endif if(db == 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_free: dbmfp->cmpr_context.weakcmpr is null"); ret = CDB___db_panic(dbenv, EINVAL); goto err; } memset(&key, '\0', sizeof(DBT)); memset(&data, '\0', sizeof(DBT)); key.data = &pgno; key.size = sizeof(db_pgno_t); data.data = " "; data.size = 1; if((ret = db->put(db, 0, &key, &data, DB_NOOVERWRITE)) != 0) { CDB___db_err(dbenv, "CDB___memp_cmpr_free: put failed for pgno = %d", pgno); ret = CDB___db_panic(dbenv, ret); goto err; } err: return ret; } /* * CDB___memp_cmpr_alloc_chain -- * Allocate chain entry in BH * * PUBLIC: int CDB___memp_cmpr_alloc_chain __P((DB_MPOOL *, BH *)); */ int CDB___memp_cmpr_alloc_chain(dbmp, bhp, alloc_type) DB_MPOOL *dbmp; BH *bhp; int alloc_type; { DB_ENV *dbenv = dbmp->dbenv; int ret = 0; if(!bhp->chain) { int alloc_ret; int alloc_length = sizeof(db_pgno_t)*(CMPR_MAX-1); switch(alloc_type) { case BH_CMPR_POOL: { MPOOL *mp = dbmp->reginfo.primary; int n_cache = NCACHE(mp, bhp->pgno); alloc_ret = CDB___memp_alloc(dbmp, &dbmp->c_reginfo[n_cache], NULL, alloc_length, NULL, (void *)(&bhp->chain)); F_SET(bhp, BH_CMPR_POOL); } break; case BH_CMPR_OS: alloc_ret = CDB___os_malloc(alloc_length, NULL, &bhp->chain); F_SET(bhp, BH_CMPR_OS); break; default: CDB___db_err(dbenv, "CDB___memp_cmpr_alloc_chain: unknown alloc type :%d", alloc_type); ret = CDB___db_panic(dbenv, EINVAL); goto err; break; } if(alloc_ret) { CDB___db_err(dbenv, "CDB___memp_cmpr_alloc_chain: memp_alloc %d bytes failed:%d", alloc_length, alloc_ret); ret = CDB___db_panic(dbenv, EINVAL); goto err; } memset((void *)bhp->chain, 0, alloc_length); #if defined(DEBUG_CMPR) || defined(DEBUG_CMPR_ALLOC) fprintf(stderr, "CDB___memp_cmpr_alloc_chain:: allocate chain in %s :%8x\n", (alloc_type == BH_CMPR_OS ? "malloc" : "shalloc"), bhp->chain); #endif } else { #ifdef DEBUG_CMPR fprintf(stderr, "CDB___memp_cmpr_alloc_chain:: existing chain:%8x\n", bhp->chain); #endif } F_SET(bhp, BH_CMPR); err: return ret; } /* * CDB___memp_cmpr_free_chain -- * Free chain entry in BH * * PUBLIC: int CDB___memp_cmpr_free_chain __P((DB_MPOOL *, BH *)); */ int CDB___memp_cmpr_free_chain(dbmp, bhp) DB_MPOOL *dbmp; BH *bhp; { DB_ENV *dbenv = dbmp->dbenv; if(F_ISSET(bhp, BH_CMPR)) { if(bhp->chain) { int alloc_length = sizeof(db_pgno_t)*(CMPR_MAX-1); int alloc_type = bhp->flags & (BH_CMPR_POOL|BH_CMPR_OS); switch(alloc_type) { case BH_CMPR_POOL: { MPOOL *mp = dbmp->reginfo.primary; int n_cache = NCACHE(mp, bhp->pgno); CDB___db_shalloc_free(dbmp->c_reginfo[n_cache].addr, bhp->chain); } break; case BH_CMPR_OS: CDB___os_free(bhp->chain, alloc_length); break; default: CDB___db_err(dbenv, "CDB___memp_cmpr_free_chain: unknown alloc type :%d", alloc_type); return CDB___db_panic(dbenv, EINVAL); break; } #if defined(DEBUG_CMPR) || defined(DEBUG_CMPR_ALLOC) fprintf(stderr, "CDB___memp_cmpr_free_chain:: free chain in %s :%8x\n", (alloc_type == BH_CMPR_OS ? "malloc" : "shalloc"), bhp->chain); #endif bhp->chain = NULL; } else { CDB___db_err(dbenv, "CDB___memp_cmpr_free_chain: BH_CMPR set but null bhp->chain"); return CDB___db_panic(dbenv, EINVAL); } } else if(bhp->chain) { CDB___db_err(dbenv, "CDB___memp_cmpr_free_chain: BH_CMPR not set but bhp->chain not null"); return CDB___db_panic(dbenv, EINVAL); } F_CLR(bhp, BH_CMPR | BH_CMPR_OS | BH_CMPR_POOL); return 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_ext.h���������������������������������������������������������������������������0100644�0063146�0012731�00000003441�07427026535�014431� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #ifndef _mp_ext_h_ #define _mp_ext_h_ int CDB___memp_alloc __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, size_t, roff_t *, void *)); int CDB___memp_bhwrite __P((DB_MPOOL *, MPOOLFILE *, BH *, int *, int *)); int CDB___memp_pgread __P((DB_MPOOLFILE *, BH *, int)); int CDB___memp_pgwrite __P((DB_MPOOL *, DB_MPOOLFILE *, BH *, int *, int *)); int CDB___memp_pg __P((DB_MPOOLFILE *, BH *, int)); void CDB___memp_bhfree __P((DB_MPOOL *, BH *, int)); int CDB___memp_fopen __P((DB_MPOOL *, MPOOLFILE *, const char *, u_int32_t, int, size_t, int, DB_MPOOL_FINFO *, DB_MPOOLFILE **)); int CDB___memp_fremove __P((DB_MPOOLFILE *)); char * CDB___memp_fn __P((DB_MPOOLFILE *)); char * CDB___memp_fns __P((DB_MPOOL *, MPOOLFILE *)); void CDB___memp_dbenv_create __P((DB_ENV *)); int CDB___memp_open __P((DB_ENV *)); int CDB___memp_close __P((DB_ENV *)); void CDB___memp_dump_region __P((DB_ENV *, char *, FILE *)); int CDB___mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **)); int CDB___memp_cmpr __P((DB_MPOOLFILE *, BH *, DB_IO *, int, ssize_t *)); int CDB___memp_cmpr_read __P((DB_MPOOLFILE *, BH *, DB_IO *, ssize_t *)); int CDB___memp_cmpr_write __P((DB_MPOOLFILE *, BH *, DB_IO *, ssize_t *)); int CDB___memp_cmpr_inflate __P((const u_int8_t *, int, u_int8_t *, int, void *)); int CDB___memp_cmpr_deflate __P((const u_int8_t *, int, u_int8_t **, int*, void *)); u_int8_t CDB___memp_cmpr_coefficient __P((DB_ENV *dbenv)); int CDB___memp_cmpr_open __P((DB_ENV *, const char *, int, int, CMPR_CONTEXT *)); int CDB___memp_cmpr_close __P((CMPR_CONTEXT *)); int CDB___memp_cmpr_alloc __P((DB_MPOOLFILE *, db_pgno_t *, BH *, int *)); int CDB___memp_cmpr_free __P((DB_MPOOLFILE *, db_pgno_t)); int CDB___memp_cmpr_alloc_chain __P((DB_MPOOL *, BH *, int)); int CDB___memp_cmpr_free_chain __P((DB_MPOOL *, BH *)); #endif /* _mp_ext_h_ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_fget.c��������������������������������������������������������������������������0100644�0063146�0012731�00000026117�07427026535�014556� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_fget.c 11.8 (Sleepycat) 10/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "db_page.h" #include "mp.h" #ifdef DEBUG #include "WordMonitor.h" #endif /* DEBUG */ /* * CDB_memp_fget -- * Get a page from the file. */ int CDB_memp_fget(dbmfp, pgnoaddr, flags, addrp) DB_MPOOLFILE *dbmfp; db_pgno_t *pgnoaddr; u_int32_t flags; void *addrp; { BH *bhp; DB_ENV *dbenv; DB_MPOOL *dbmp; DB_HASHTAB *dbht; MCACHE *mc; MPOOL *mp; MPOOLFILE *mfp; size_t n_bucket, n_cache, mf_offset; u_int32_t st_hsearch; int b_incr, first, ret; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; mp = dbmp->reginfo.primary; mfp = dbmfp->mfp; PANIC_CHECK(dbenv); /* * Validate arguments. * * !!! * Don't test for DB_MPOOL_CREATE and DB_MPOOL_NEW flags for readonly * files here, and create non-existent pages in readonly files if the * flags are set, later. The reason is that the hash access method * wants to get empty pages that don't really exist in readonly files. * The only alternative is for hash to write the last "bucket" all the * time, which we don't want to do because one of our big goals in life * is to keep database files small. It's sleazy as hell, but we catch * any attempt to actually write the file in CDB_memp_fput(). */ #define OKFLAGS \ (DB_MPOOL_CREATE | DB_MPOOL_LAST | DB_MPOOL_NEW | DB_MPOOL_NEW_GROUP) if (flags != 0) { if ((ret = CDB___db_fchk(dbenv, "CDB_memp_fget", flags, OKFLAGS)) != 0) return (ret); switch (flags) { case DB_MPOOL_CREATE: case DB_MPOOL_LAST: case DB_MPOOL_NEW: case DB_MPOOL_NEW_GROUP: case 0: break; default: return (CDB___db_ferr(dbenv, "CDB_memp_fget", 1)); } } #ifdef DIAGNOSTIC /* * XXX * We want to switch threads as often as possible. Yield every time * we get a new page to ensure contention. */ if (DB_GLOBAL(db_pageyield)) CDB___os_yield(1); #endif /* Initialize remaining local variables. */ mf_offset = R_OFFSET(&dbmp->reginfo, mfp); bhp = NULL; st_hsearch = 0; b_incr = ret = 0; R_LOCK(dbenv, &dbmp->reginfo); /* * Check for the new, last or last + 1 page requests. * * Examine and update the file's last_pgno value. We don't care if * the last_pgno value immediately changes due to another thread -- * at this instant in time, the value is correct. We do increment the * current last_pgno value if the thread is asking for a new page, * however, to ensure that two threads creating pages don't get the * same one. * * If we create a page, there is the potential that a page after it * in the file will be written before it will be written. Recovery * depends on pages that are "created" in the file by subsequent pages * being written be zeroed out, not have random garbage. Ensure that * the OS agrees. * * !!! * DB_MPOOL_NEW_GROUP is undocumented -- the hash access method needs * to allocate contiguous groups of pages in order to do subdatabases. * We return the first page in the group, but the caller must put an * LSN on the *last* page and write it, otherwise after a crash we may * not create all of the pages we need to create. */ if (LF_ISSET(DB_MPOOL_LAST | DB_MPOOL_NEW | DB_MPOOL_NEW_GROUP)) { if (LF_ISSET(DB_MPOOL_NEW)) { if ((ret = CDB___os_fpinit(&dbmfp->fh, mfp->last_pgno + 1, 1, mfp->stat.st_pagesize)) != 0) { R_UNLOCK(dbenv, &dbmp->reginfo); return (ret); } ++mfp->last_pgno; #ifdef DEBUG word_monitor_set(WORD_MONITOR_PGNO, mfp->last_pgno); #endif /* DEBUG */ } if (LF_ISSET(DB_MPOOL_NEW_GROUP)) { if ((ret = CDB___os_fpinit(&dbmfp->fh, mfp->last_pgno + 1, (int)*pgnoaddr, mfp->stat.st_pagesize)) != 0) { R_UNLOCK(dbenv, &dbmp->reginfo); return (ret); } mfp->last_pgno += *pgnoaddr; } *pgnoaddr = mfp->last_pgno; } /* * Determine the hash bucket where this page will live, and get local * pointers to the cache and its hash table. */ n_cache = NCACHE(mp, *pgnoaddr); mc = dbmp->c_reginfo[n_cache].primary; n_bucket = NBUCKET(mc, mf_offset, *pgnoaddr); dbht = R_ADDR(&dbmp->c_reginfo[n_cache], mc->htab); if (LF_ISSET(DB_MPOOL_NEW | DB_MPOOL_NEW_GROUP)) goto alloc; /* * If mmap'ing the file and the page is not past the end of the file, * just return a pointer. * * The page may be past the end of the file, so check the page number * argument against the original length of the file. If we previously * returned pages past the original end of the file, last_pgno will * have been updated to match the "new" end of the file, and checking * against it would return pointers past the end of the mmap'd region. * * If another process has opened the file for writing since we mmap'd * it, we will start playing the game by their rules, i.e. everything * goes through the cache. All pages previously returned will be safe, * as long as the correct locking protocol was observed. * * XXX * We don't discard the map because we don't know when all of the * pages will have been discarded from the process' address space. * It would be possible to do so by reference counting the open * pages from the mmap, but it's unclear to me that it's worth it. */ if (dbmfp->addr != NULL && F_ISSET(mfp, MP_CAN_MMAP)) { if (*pgnoaddr > mfp->orig_last_pgno) { /* * !!! * See the comment above about non-existent pages and * the hash access method. */ if (!LF_ISSET(DB_MPOOL_CREATE)) { CDB___db_err(dbenv, "%s: page %lu doesn't exist", CDB___memp_fn(dbmfp), (u_long)*pgnoaddr); ret = EINVAL; goto err; } } else { *(void **)addrp = R_ADDR(dbmfp, *pgnoaddr * mfp->stat.st_pagesize); ++mfp->stat.st_map; goto done; } } /* Search the hash chain for the page. */ for (bhp = SH_TAILQ_FIRST(&dbht[n_bucket], __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh)) { ++st_hsearch; if (bhp->pgno != *pgnoaddr || bhp->mf_offset != mf_offset) continue; /* Increment the reference count. */ if (bhp->ref == UINT16_T_MAX) { CDB___db_err(dbenv, "%s: page %lu: reference count overflow", CDB___memp_fn(dbmfp), (u_long)bhp->pgno); ret = EINVAL; goto err; } /* * Increment the reference count. We may discard the region * lock as we evaluate and/or read the buffer, so we need to * ensure that it doesn't move and that its contents remain * unchanged. */ ++bhp->ref; b_incr = 1; /* * Any buffer we find might be trouble. * * BH_LOCKED -- * I/O is in progress. Because we've incremented the buffer * reference count, we know the buffer can't move. Unlock * the region lock, wait for the I/O to complete, and reacquire * the region. */ for (first = 1; F_ISSET(bhp, BH_LOCKED); first = 0) { R_UNLOCK(dbenv, &dbmp->reginfo); /* * Explicitly yield the processor if it's not the first * pass through this loop -- if we don't, we might end * up running to the end of our CPU quantum as we will * simply be swapping between the two locks. */ if (!first) CDB___os_yield(1); MUTEX_LOCK(&bhp->mutex, dbenv->lockfhp); /* Wait for I/O to finish... */ MUTEX_UNLOCK(&bhp->mutex); R_LOCK(dbenv, &dbmp->reginfo); } /* * BH_TRASH -- * The contents of the buffer are garbage. Shouldn't happen, * and this read is likely to fail, but might as well try. */ if (F_ISSET(bhp, BH_TRASH)) goto reread; /* * BH_CALLPGIN -- * The buffer was converted so it could be written, and the * contents need to be converted again. */ if (F_ISSET(bhp, BH_CALLPGIN)) { if ((ret = CDB___memp_pg(dbmfp, bhp, 1)) != 0) goto err; F_CLR(bhp, BH_CALLPGIN); } ++mfp->stat.st_cache_hit; *(void **)addrp = bhp->buf; goto done; } alloc: /* Allocate new buffer header and data space. */ if ((ret = CDB___memp_alloc(dbmp, &dbmp->c_reginfo[n_cache], mfp, 0, NULL, &bhp)) != 0) goto err; ++mc->stat.st_page_clean; /* * Initialize the BH fields so that we can call the CDB___memp_bhfree * routine if an error occurs. */ memset(bhp, 0, sizeof(BH)); bhp->ref = 1; bhp->pgno = *pgnoaddr; bhp->mf_offset = mf_offset; /* * Prepend the bucket header to the head of the appropriate MPOOL * bucket hash list. Append the bucket header to the tail of the * MPOOL LRU chain. */ SH_TAILQ_INSERT_HEAD(&dbht[n_bucket], bhp, hq, __bh); SH_TAILQ_INSERT_TAIL(&mc->bhq, bhp, q); #ifdef DIAGNOSTIC if ((ALIGNTYPE)bhp->buf & (sizeof(size_t) - 1)) { CDB___db_err(dbenv, "Internal error: BH data NOT size_t aligned."); ret = EINVAL; CDB___memp_bhfree(dbmp, bhp, 1); goto err; } #endif if ((ret = __db_mutex_init(dbenv, &bhp->mutex, R_OFFSET( &dbmp->reginfo, &bhp->mutex) + DB_FCNTL_OFF_MPOOL, 0)) != 0) { CDB___memp_bhfree(dbmp, bhp, 1); goto err; } /* * If we created the page, zero it out and continue. * * !!! * Note: DB_MPOOL_NEW specifically doesn't call the pgin function. * If DB_MPOOL_CREATE is used, then the application's pgin function * has to be able to handle pages of 0's -- if it uses DB_MPOOL_NEW, * it can detect all of its page creates, and not bother. * * Otherwise, read the page into memory, optionally creating it if * DB_MPOOL_CREATE is set. */ if (LF_ISSET(DB_MPOOL_NEW | DB_MPOOL_NEW_GROUP)) { if (mfp->clear_len == 0) memset(bhp->buf, 0, mfp->stat.st_pagesize); else { memset(bhp->buf, 0, mfp->clear_len); #ifdef DIAGNOSTIC memset(bhp->buf + mfp->clear_len, CLEAR_BYTE, mfp->stat.st_pagesize - mfp->clear_len); #endif } ++mfp->stat.st_page_create; } else { /* * It's possible for the read function to fail, which means * that we fail as well. Note, the CDB___memp_pgread() function * discards the region lock, so the buffer must be pinned * down so that it cannot move and its contents are unchanged. */ reread: if ((ret = CDB___memp_pgread( dbmfp, bhp, LF_ISSET(DB_MPOOL_CREATE))) != 0) { /* * !!! * Discard the buffer unless another thread is waiting * on our I/O to complete. Regardless, the header has * the BH_TRASH flag set. */ if (bhp->ref == 1) CDB___memp_bhfree(dbmp, bhp, 1); goto err; } ++mfp->stat.st_cache_miss; } /* * If we're returning a page after our current notion of the last-page, * update our information. Note, there's no way to un-instantiate this * page, it's going to exist whether it's returned to us dirty or not. */ if (bhp->pgno > mfp->last_pgno) mfp->last_pgno = bhp->pgno; *(void **)addrp = bhp->buf; done: /* Update the chain search statistics. */ if (st_hsearch) { ++mc->stat.st_hash_searches; if (st_hsearch > mc->stat.st_hash_longest) mc->stat.st_hash_longest = st_hsearch; mc->stat.st_hash_examined += st_hsearch; } ++dbmfp->pinref; R_UNLOCK(dbenv, &dbmp->reginfo); return (0); err: /* Discard our reference. */ if (b_incr) --bhp->ref; R_UNLOCK(dbenv, &dbmp->reginfo); *(void **)addrp = NULL; return (ret); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_fopen.c�������������������������������������������������������������������������0100644�0063146�0012731�00000042101�07427026535�014727� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_fopen.c 11.7 (Sleepycat) 10/27/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" static int CDB___memp_mf_close __P((DB_MPOOL *, DB_MPOOLFILE *)); static int CDB___memp_mf_open __P((DB_MPOOL *, const char *, size_t, db_pgno_t, DB_MPOOL_FINFO *, MPOOLFILE **)); /* * CDB_memp_fopen -- * Open a backing file for the memory pool. */ int CDB_memp_fopen(dbenv, path, flags, mode, pagesize, finfop, retp) DB_ENV *dbenv; const char *path; u_int32_t flags; int mode; size_t pagesize; DB_MPOOL_FINFO *finfop; DB_MPOOLFILE **retp; { DB_MPOOL *dbmp; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->mp_handle, DB_INIT_MPOOL); dbmp = dbenv->mp_handle; /* Validate arguments. */ if ((ret = CDB___db_fchk(dbenv, "CDB_memp_fopen", flags, DB_COMPRESS | DB_CREATE | DB_NOMMAP | DB_RDONLY)) != 0) return (ret); /* * Transparent I/O compression does not work on mmap'd files. */ if(LF_ISSET(DB_COMPRESS)) LF_SET(DB_NOMMAP); /* Require a non-zero pagesize. */ if (pagesize == 0) { CDB___db_err(dbenv, "CDB_memp_fopen: pagesize not specified"); return (EINVAL); } if (finfop != NULL && finfop->clear_len > pagesize) return (EINVAL); return (CDB___memp_fopen(dbmp, NULL, path, flags, mode, pagesize, 1, finfop, retp)); } /* * CDB___memp_fopen -- * Open a backing file for the memory pool; internal version. * * PUBLIC: int CDB___memp_fopen __P((DB_MPOOL *, MPOOLFILE *, const char *, * PUBLIC: u_int32_t, int, size_t, int, DB_MPOOL_FINFO *, DB_MPOOLFILE **)); */ int CDB___memp_fopen(dbmp, mfp, path, flags, mode, pagesize, needlock, finfop, retp) DB_MPOOL *dbmp; MPOOLFILE *mfp; const char *path; u_int32_t flags; int mode, needlock; size_t pagesize; DB_MPOOL_FINFO *finfop; DB_MPOOLFILE **retp; { DB_ENV *dbenv; DB_MPOOLFILE *dbmfp; DB_MPOOL_FINFO finfo; db_pgno_t last_pgno; size_t maxmap; u_int32_t mbytes, bytes, oflags; int ret; u_int8_t idbuf[DB_FILE_ID_LEN]; char *rpath; dbenv = dbmp->dbenv; ret = 0; rpath = NULL; /* * If mfp is provided, we take the DB_MPOOL_FINFO information from * the mfp. We don't bother initializing everything, because some * of them are expensive to acquire. If no mfp is provided and the * finfop argument is NULL, we default the values. */ if (finfop == NULL) { memset(&finfo, 0, sizeof(finfo)); if (mfp != NULL) { finfo.ftype = mfp->ftype; finfo.pgcookie = NULL; finfo.fileid = NULL; finfo.lsn_offset = mfp->lsn_off; finfo.clear_len = mfp->clear_len; } else { finfo.ftype = 0; finfo.pgcookie = NULL; finfo.fileid = NULL; finfo.lsn_offset = -1; finfo.clear_len = 0; } finfop = &finfo; } /* Allocate and initialize the per-process structure. */ if ((ret = CDB___os_calloc(1, sizeof(DB_MPOOLFILE), &dbmfp)) != 0) return (ret); dbmfp->dbmp = dbmp; dbmfp->ref = 1; if (LF_ISSET(DB_RDONLY)) F_SET(dbmfp, MP_READONLY); if (LF_ISSET(DB_COMPRESS)) F_SET(dbmfp, MP_CMPR); if (path == NULL) { if (LF_ISSET(DB_RDONLY)) { CDB___db_err(dbenv, "CDB_memp_fopen: temporary files can't be readonly"); ret = EINVAL; goto err; } if (LF_ISSET(DB_COMPRESS)) { CDB___db_err(dbenv, "CDB_memp_fopen: temporary files can't be compressed"); ret = EINVAL; goto err; } last_pgno = 0; } else { size_t disk_pagesize = F_ISSET(dbmfp, MP_CMPR) ? DB_CMPR_DIVIDE(dbenv, pagesize) : pagesize; /* Get the real name for this file and open it. */ if ((ret = CDB___db_appname(dbenv, DB_APP_DATA, NULL, path, 0, NULL, &rpath)) != 0) goto err; oflags = 0; if (LF_ISSET(DB_CREATE)) oflags |= DB_OSO_CREATE; if (LF_ISSET(DB_RDONLY)) oflags |= DB_OSO_RDONLY; if ((ret = CDB___os_open(rpath, oflags, mode, &dbmfp->fh)) != 0) { CDB___db_err(dbenv, "%s: %s", rpath, CDB_db_strerror(ret)); goto err; } /* * Don't permit files that aren't a multiple of the pagesize, * and find the number of the last page in the file, all the * time being careful not to overflow 32 bits. * * !!! * We can't use off_t's here, or in any code in the mainline * library for that matter. (We have to use them in the os * stubs, of course, as there are system calls that take them * as arguments.) The reason is that some customers build in * environments where an off_t is 32-bits, but still run where * offsets are 64-bits, and they pay us a lot of money. */ if ((ret = CDB___os_ioinfo(rpath, &dbmfp->fh, &mbytes, &bytes, NULL)) != 0) { CDB___db_err(dbenv, "%s: %s", rpath, CDB_db_strerror(ret)); goto err; } /* Page sizes have to be a power-of-two, ignore mbytes. */ if (bytes % disk_pagesize != 0) { CDB___db_err(dbenv, "%s: file size not a multiple of the pagesize", rpath); ret = EINVAL; goto err; } last_pgno = mbytes * (MEGABYTE / disk_pagesize); last_pgno += bytes / disk_pagesize; /* Correction: page numbers are zero-based, not 1-based. */ if (last_pgno != 0) --last_pgno; /* * Get the file id if we weren't given one. Generated file id's * don't use timestamps, otherwise there'd be no chance of any * other process joining the party. */ if (finfop->fileid == NULL) { if ((ret = CDB___os_fileid(dbenv, rpath, 0, idbuf)) != 0) goto err; finfop->fileid = idbuf; } if (LF_ISSET(DB_COMPRESS)) { if((ret = CDB___memp_cmpr_open(dbenv, path, flags, mode, &dbmfp->cmpr_context)) != 0) goto err; } } /* * If we weren't provided an underlying shared object to join with, * find/allocate the shared file objects. Also allocate space for * for the per-process thread lock. */ if (needlock) R_LOCK(dbenv, &dbmp->reginfo); ret = mfp == NULL ? CDB___memp_mf_open( dbmp, path, pagesize, last_pgno, finfop, &mfp) : 0; if (needlock) R_UNLOCK(dbenv, &dbmp->reginfo); if (ret != 0) goto err; if (F_ISSET(dbenv, DB_ENV_THREAD)) { if ((ret = CDB___db_mutex_alloc( dbenv, &dbmp->reginfo, &dbmfp->mutexp)) != 0) goto err; if ((ret = __db_mutex_init( dbenv, dbmfp->mutexp, 0, MUTEX_THREAD)) != 0) goto err; /* XXX: KEITH: CLOSE THE FILE ON FAILURE? */ } dbmfp->mfp = mfp; /* * If a file: * + is read-only * + isn't temporary * + doesn't require any pgin/pgout support * + the DB_NOMMAP flag wasn't set (in either the file open or * the environment in which it was opened) * + and is less than mp_mmapsize bytes in size * * we can mmap it instead of reading/writing buffers. Don't do error * checking based on the mmap call failure. We want to do normal I/O * on the file if the reason we failed was because the file was on an * NFS mounted partition, and we can fail in buffer I/O just as easily * as here. * * XXX * We'd like to test to see if the file is too big to mmap. Since we * don't know what size or type off_t's or size_t's are, or the largest * unsigned integral type is, or what random insanity the local C * compiler will perpetrate, doing the comparison in a portable way is * flatly impossible. Hope that mmap fails if the file is too large. */ #define DB_MAXMMAPSIZE (10 * 1024 * 1024) /* 10 Mb. */ if (F_ISSET(mfp, MP_CAN_MMAP)) { if (!F_ISSET(dbmfp, MP_READONLY)) F_CLR(mfp, MP_CAN_MMAP); if (path == NULL) F_CLR(mfp, MP_CAN_MMAP); if (finfop->ftype != 0) F_CLR(mfp, MP_CAN_MMAP); if (LF_ISSET(DB_NOMMAP) || F_ISSET(dbenv, DB_ENV_NOMMAP)) F_CLR(mfp, MP_CAN_MMAP); maxmap = dbenv->mp_mmapsize == 0 ? DB_MAXMMAPSIZE : dbenv->mp_mmapsize; if (mbytes > maxmap / MEGABYTE || (mbytes == maxmap / MEGABYTE && bytes >= maxmap % MEGABYTE)) F_CLR(mfp, MP_CAN_MMAP); } dbmfp->addr = NULL; if (F_ISSET(mfp, MP_CAN_MMAP)) { dbmfp->len = (size_t)mbytes * MEGABYTE + bytes; if (CDB___os_mapfile(dbenv, rpath, &dbmfp->fh, dbmfp->len, 1, &dbmfp->addr) != 0) { dbmfp->addr = NULL; F_CLR(mfp, MP_CAN_MMAP); } } if (rpath != NULL) CDB___os_freestr(rpath); MUTEX_THREAD_LOCK(dbmp->mutexp); TAILQ_INSERT_TAIL(&dbmp->dbmfq, dbmfp, q); MUTEX_THREAD_UNLOCK(dbmp->mutexp); *retp = dbmfp; return (0); err: /* * Note that we do not have to free the thread mutex, because we * never get to here after we have successfully allocated it. */ if (rpath != NULL) CDB___os_freestr(rpath); if (F_ISSET(&dbmfp->fh, DB_FH_VALID)) (void)CDB___os_closehandle(&dbmfp->fh); if (dbmfp != NULL) CDB___os_free(dbmfp, sizeof(DB_MPOOLFILE)); return (ret); } static MPOOL *CDB_mp; /* * CDB___memp_mf_open -- * Open an MPOOLFILE. */ static int CDB___memp_mf_open(dbmp, path, pagesize, last_pgno, finfop, retp) DB_MPOOL *dbmp; const char *path; size_t pagesize; db_pgno_t last_pgno; DB_MPOOL_FINFO *finfop; MPOOLFILE **retp; { MPOOLFILE *mfp; int ret; void *p; #define ISTEMPORARY (path == NULL) /* * Walk the list of MPOOLFILE's, looking for a matching file. * Temporary files can't match previous files. */ if (!ISTEMPORARY) { CDB_mp = dbmp->reginfo.primary; for (mfp = SH_TAILQ_FIRST(&CDB_mp->mpfq, __mpoolfile); mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) { if (F_ISSET(mfp, MP_TEMP)) continue; if (!memcmp(finfop->fileid, R_ADDR(&dbmp->reginfo, mfp->fileid_off), DB_FILE_ID_LEN)) { if (finfop->clear_len != mfp->clear_len || pagesize != mfp->stat.st_pagesize) { CDB___db_err(dbmp->dbenv, "%s: page size or clear length changed", path); return (EINVAL); } /* * It's possible that our needs for pre- and * post-processing are changing. For example, * an application created a hash subdatabase * in a database that was previously all btree. */ if (finfop->ftype != 0) mfp->ftype = finfop->ftype; /* Found it. */ *retp = mfp; return (0); } } } /* Allocate a new MPOOLFILE. */ if ((ret = CDB___memp_alloc( dbmp, &dbmp->reginfo, NULL, sizeof(MPOOLFILE), NULL, &mfp)) != 0) return (ret); *retp = mfp; /* Initialize the structure. */ memset(mfp, 0, sizeof(MPOOLFILE)); mfp->ftype = finfop->ftype; mfp->lsn_off = finfop->lsn_offset; mfp->clear_len = finfop->clear_len; /* * If the user specifies DB_MPOOL_LAST or DB_MPOOL_NEW on a CDB_memp_fget, * we have to know the last page in the file. Figure it out and save * it away. */ mfp->stat.st_pagesize = pagesize; mfp->orig_last_pgno = mfp->last_pgno = last_pgno; if (ISTEMPORARY) F_SET(mfp, MP_TEMP); else { /* Copy the file path into shared memory. */ if ((ret = CDB___memp_alloc(dbmp, &dbmp->reginfo, NULL, strlen(path) + 1, &mfp->path_off, &p)) != 0) goto err; memcpy(p, path, strlen(path) + 1); /* Copy the file identification string into shared memory. */ if ((ret = CDB___memp_alloc(dbmp, &dbmp->reginfo, NULL, DB_FILE_ID_LEN, &mfp->fileid_off, &p)) != 0) goto err; memcpy(p, finfop->fileid, DB_FILE_ID_LEN); F_SET(mfp, MP_CAN_MMAP); } /* Copy the page cookie into shared memory. */ if (finfop->pgcookie == NULL || finfop->pgcookie->size == 0) { mfp->pgcookie_len = 0; mfp->pgcookie_off = 0; } else { if ((ret = CDB___memp_alloc(dbmp, &dbmp->reginfo, NULL, finfop->pgcookie->size, &mfp->pgcookie_off, &p)) != 0) goto err; memcpy(p, finfop->pgcookie->data, finfop->pgcookie->size); mfp->pgcookie_len = finfop->pgcookie->size; } /* Prepend the MPOOLFILE to the list of MPOOLFILE's. */ CDB_mp = dbmp->reginfo.primary; SH_TAILQ_INSERT_HEAD(&CDB_mp->mpfq, mfp, q, __mpoolfile); if (0) { err: if (mfp->path_off != 0) CDB___db_shalloc_free(dbmp->reginfo.addr, R_ADDR(&dbmp->reginfo, mfp->path_off)); if (mfp->fileid_off != 0) CDB___db_shalloc_free(dbmp->reginfo.addr, R_ADDR(&dbmp->reginfo, mfp->fileid_off)); if (mfp != NULL) CDB___db_shalloc_free(dbmp->reginfo.addr, mfp); mfp = NULL; } return (0); } /* * CDB_memp_fclose -- * Close a backing file for the memory pool. */ int CDB_memp_fclose(dbmfp) DB_MPOOLFILE *dbmfp; { DB_ENV *dbenv; DB_MPOOL *dbmp; int ret, t_ret; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; ret = 0; PANIC_CHECK(dbenv); for (;;) { MUTEX_THREAD_LOCK(dbmp->mutexp); /* * We have to reference count DB_MPOOLFILE structures as other * threads may be using them. The problem only happens if the * application makes a bad design choice. Here's the path: * * Thread A opens a database. * Thread B uses thread A's DB_MPOOLFILE to write a buffer * in order to free up memory in the mpool cache. * Thread A closes the database while thread B is using the * DB_MPOOLFILE structure. * * By opening all databases before creating the threads, and * closing them after the threads have exited, applications * get better performance and avoid the problem path entirely. * * Regardless, holding the DB_MPOOLFILE to flush a dirty buffer * is a short-term lock, even in worst case, since we better be * the only thread of control using the DB_MPOOLFILE structure * to read pages *into* the cache. Wait until we're the only * reference holder and remove the DB_MPOOLFILE structure from * the list, so nobody else can even find it. */ if (dbmfp->ref == 1) { TAILQ_REMOVE(&dbmp->dbmfq, dbmfp, q); break; } MUTEX_THREAD_UNLOCK(dbmp->mutexp); (void)CDB___os_sleep(1, 0); } MUTEX_THREAD_UNLOCK(dbmp->mutexp); /* Complain if pinned blocks never returned. */ if (dbmfp->pinref != 0) CDB___db_err(dbenv, "%s: close: %lu blocks left pinned", CDB___memp_fn(dbmfp), (u_long)dbmfp->pinref); /* Close the underlying MPOOLFILE. */ (void)CDB___memp_mf_close(dbmp, dbmfp); /* Discard any mmap information. */ if (dbmfp->addr != NULL && (ret = CDB___os_unmapfile(dbenv, dbmfp->addr, dbmfp->len)) != 0) CDB___db_err(dbenv, "%s: %s", CDB___memp_fn(dbmfp), CDB_db_strerror(ret)); /* Close the file; temporary files may not yet have been created. */ if (F_ISSET(&dbmfp->fh, DB_FH_VALID) && (t_ret = CDB___os_closehandle(&dbmfp->fh)) != 0) { CDB___db_err(dbenv, "%s: %s", CDB___memp_fn(dbmfp), CDB_db_strerror(t_ret)); if (ret != 0) t_ret = ret; } if(F_ISSET(dbmfp, MP_CMPR)) { if((ret = CDB___memp_cmpr_close(&dbmfp->cmpr_context)) != 0) CDB___db_err(dbmp->dbenv, "%s: %s", CDB___memp_fn(dbmfp), strerror(ret)); F_CLR(dbmfp, MP_CMPR); } /* Discard the thread mutex. */ if (dbmfp->mutexp != NULL) CDB___db_mutex_free(dbenv, &dbmp->reginfo, dbmfp->mutexp); /* Discard the DB_MPOOLFILE structure. */ CDB___os_free(dbmfp, sizeof(DB_MPOOLFILE)); return (ret); } /* * CDB___memp_mf_close -- * Close down an MPOOLFILE. */ static int CDB___memp_mf_close(dbmp, dbmfp) DB_MPOOL *dbmp; DB_MPOOLFILE *dbmfp; { COMPQUIET(dbmp, NULL); COMPQUIET(dbmfp, NULL); /* * We don't currently close the underlying MPOOLFILE. The reason falls * out of the following: * * 1. The way we identify a buffer's underlying file is the MPOOLFILE * offset in shared memory, bhp->mf_offset. If buffers remained in * the pool after removing the MPOOLFILE, they might accidentally * be associated with a newly created MPOOLFILE that happened to be * allocated at the same offset as the previous one. * 2. We can't simply remove all the buffers from the pool, because * there may be dirty buffers associated with the MPOOLFILE that * the process hasn't yet flushed to disk. (Dirty buffers are a * possibility -- if the application specified DB_NOSYNC when it * closed the database, no dirty buffers have been flushed.) * 3. We can't simply flush all the buffers to disk, because writing * and re-integrating the memory into the free list is expensive, * and in many cases the process is simply discarding it's pool. * * We could walk the cache regions and discard the MPOOLFILE if all * the buffers are clean, but that's a pain, and probably not worth * the effort. */ return (0); } /* * CDB___memp_fremove -- * Remove an underlying file from the system. * * PUBLIC: int CDB___memp_fremove __P((DB_MPOOLFILE *)); */ int CDB___memp_fremove(dbmfp) DB_MPOOLFILE *dbmfp; { DB_ENV *dbenv; DB_MPOOL *dbmp; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; PANIC_CHECK(dbenv); R_LOCK(dbenv, &dbmp->reginfo); /* * Flag that the underlying file has been removed, and remove any * necessity for post-processing pages, anybody can discard them. */ dbmfp->mfp->ftype = 0; F_SET(dbmfp->mfp, MP_REMOVED); R_UNLOCK(dbenv, &dbmp->reginfo); return (0); } /* * CDB___memp_fn -- * On errors we print whatever is available as the file name. * * PUBLIC: char * CDB___memp_fn __P((DB_MPOOLFILE *)); */ char * CDB___memp_fn(dbmfp) DB_MPOOLFILE *dbmfp; { return (CDB___memp_fns(dbmfp->dbmp, dbmfp->mfp)); } /* * CDB___memp_fns -- * On errors we print whatever is available as the file name. * * PUBLIC: char * CDB___memp_fns __P((DB_MPOOL *, MPOOLFILE *)); * */ char * CDB___memp_fns(dbmp, mfp) DB_MPOOL *dbmp; MPOOLFILE *mfp; { if (mfp->path_off == 0) return ((char *)"temporary"); return ((char *)R_ADDR(&dbmp->reginfo, mfp->path_off)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_fput.c��������������������������������������������������������������������������0100644�0063146�0012731�00000010463�07427026535�014604� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_fput.c 11.3 (Sleepycat) 10/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" /* * CDB_memp_fput -- * Mpool file put function. */ int CDB_memp_fput(dbmfp, pgaddr, flags) DB_MPOOLFILE *dbmfp; void *pgaddr; u_int32_t flags; { BH *bhp; DB_ENV *dbenv; DB_MPOOL *dbmp; MCACHE *mc; MPOOL *mp; int ret, wrote; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; mp = dbmp->reginfo.primary; PANIC_CHECK(dbenv); /* Validate arguments. */ if (flags) { if ((ret = CDB___db_fchk(dbenv, "CDB_memp_fput", flags, DB_MPOOL_CLEAN | DB_MPOOL_DIRTY | DB_MPOOL_DISCARD)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "CDB_memp_fput", flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0) return (ret); if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) { CDB___db_err(dbenv, "%s: dirty flag set for readonly file page", CDB___memp_fn(dbmfp)); return (EACCES); } } R_LOCK(dbenv, &dbmp->reginfo); /* Decrement the pinned reference count. */ if (dbmfp->pinref == 0) CDB___db_err(dbenv, "%s: put: more blocks returned than retrieved", CDB___memp_fn(dbmfp)); else --dbmfp->pinref; /* * If we're mapping the file, there's nothing to do. Because we can * stop mapping the file at any time, we have to check on each buffer * to see if the address we gave the application was part of the map * region. */ if (dbmfp->addr != NULL && pgaddr >= dbmfp->addr && (u_int8_t *)pgaddr <= (u_int8_t *)dbmfp->addr + dbmfp->len) { R_UNLOCK(dbenv, &dbmp->reginfo); return (0); } /* Convert the page address to a buffer header. */ bhp = (BH *)((u_int8_t *)pgaddr - SSZA(BH, buf)); /* Convert the buffer header to a cache. */ mc = BH_TO_CACHE(dbmp, bhp); /* UNLOCK THE REGION, LOCK THE CACHE. */ /* Set/clear the page bits. */ if (LF_ISSET(DB_MPOOL_CLEAN) && F_ISSET(bhp, BH_DIRTY)) { ++mc->stat.st_page_clean; --mc->stat.st_page_dirty; F_CLR(bhp, BH_DIRTY); } if (LF_ISSET(DB_MPOOL_DIRTY) && !F_ISSET(bhp, BH_DIRTY)) { --mc->stat.st_page_clean; ++mc->stat.st_page_dirty; F_SET(bhp, BH_DIRTY); } if (LF_ISSET(DB_MPOOL_DISCARD)) F_SET(bhp, BH_DISCARD); /* * Check for a reference count going to zero. This can happen if the * application returns a page twice. */ if (bhp->ref == 0) { CDB___db_err(dbenv, "%s: page %lu: unpinned page returned", CDB___memp_fn(dbmfp), (u_long)bhp->pgno); R_UNLOCK(dbenv, &dbmp->reginfo); return (EINVAL); } /* * If more than one reference to the page, we're done. Ignore the * discard flags (for now) and leave it at its position in the LRU * chain. The rest gets done at last reference close. */ if (--bhp->ref > 0) { R_UNLOCK(dbenv, &dbmp->reginfo); return (0); } /* * Move the buffer to the head/tail of the LRU chain. We do this * before writing the buffer for checkpoint purposes, as the write * can discard the region lock and allow another process to acquire * buffer. We could keep that from happening, but there seems no * reason to do so. */ SH_TAILQ_REMOVE(&mc->bhq, bhp, q, __bh); if (F_ISSET(bhp, BH_DISCARD)) SH_TAILQ_INSERT_HEAD(&mc->bhq, bhp, q, __bh); else SH_TAILQ_INSERT_TAIL(&mc->bhq, bhp, q); /* * If this buffer is scheduled for writing because of a checkpoint, we * need to write it (if it's dirty), or update the checkpoint counters * (if it's not dirty). If we try to write it and can't, that's not * necessarily an error as it's not completely unreasonable that the * application have permission to write the underlying file, but set a * flag so that the next time the CDB_memp_sync function is called we try * writing it there, as the checkpoint thread of control better be able * to write all of the files. */ if (F_ISSET(bhp, BH_WRITE)) { if (F_ISSET(bhp, BH_DIRTY)) { if (CDB___memp_bhwrite(dbmp, dbmfp->mfp, bhp, NULL, &wrote) != 0 || !wrote) F_SET(mp, MP_LSN_RETRY); } else { F_CLR(bhp, BH_WRITE); --mp->lsn_cnt; --dbmfp->mfp->lsn_cnt; } } R_UNLOCK(dbenv, &dbmp->reginfo); return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_fset.c��������������������������������������������������������������������������0100644�0063146�0012731�00000003546�07427026535�014573� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_fset.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" /* * CDB_memp_fset -- * Mpool page set-flag routine. */ int CDB_memp_fset(dbmfp, pgaddr, flags) DB_MPOOLFILE *dbmfp; void *pgaddr; u_int32_t flags; { BH *bhp; DB_ENV *dbenv; DB_MPOOL *dbmp; MCACHE *mc; MPOOL *mp; int ret; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; mp = dbmp->reginfo.primary; PANIC_CHECK(dbenv); /* Validate arguments. */ if (flags == 0) return (CDB___db_ferr(dbenv, "CDB_memp_fset", 1)); if ((ret = CDB___db_fchk(dbenv, "CDB_memp_fset", flags, DB_MPOOL_DIRTY | DB_MPOOL_CLEAN | DB_MPOOL_DISCARD)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "CDB_memp_fset", flags, DB_MPOOL_CLEAN, DB_MPOOL_DIRTY)) != 0) return (ret); if (LF_ISSET(DB_MPOOL_DIRTY) && F_ISSET(dbmfp, MP_READONLY)) { CDB___db_err(dbenv, "%s: dirty flag set for readonly file page", CDB___memp_fn(dbmfp)); return (EACCES); } /* Convert the page address to a buffer header. */ bhp = (BH *)((u_int8_t *)pgaddr - SSZA(BH, buf)); /* Convert the buffer header to a cache. */ mc = BH_TO_CACHE(dbmp, bhp); R_LOCK(dbenv, &dbmp->reginfo); if (LF_ISSET(DB_MPOOL_CLEAN) && F_ISSET(bhp, BH_DIRTY)) { ++mc->stat.st_page_clean; --mc->stat.st_page_dirty; F_CLR(bhp, BH_DIRTY); } if (LF_ISSET(DB_MPOOL_DIRTY) && !F_ISSET(bhp, BH_DIRTY)) { --mc->stat.st_page_clean; ++mc->stat.st_page_dirty; F_SET(bhp, BH_DIRTY); } if (LF_ISSET(DB_MPOOL_DISCARD)) F_SET(bhp, BH_DISCARD); R_UNLOCK(dbenv, &dbmp->reginfo); return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_method.c������������������������������������������������������������������������0100644�0063146�0012731�00000004606�07427026535�015110� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_method.c 11.2 (Sleepycat) 10/6/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" static int CDB___memp_set_cachesize __P((DB_ENV *, u_int32_t, u_int32_t, int)); static int CDB___memp_set_mp_mmapsize __P((DB_ENV *, size_t)); /* * CDB___memp_dbenv_create -- * Mpool specific creation of the DB_ENV structure. * * PUBLIC: void CDB___memp_dbenv_create __P((DB_ENV *)); */ void CDB___memp_dbenv_create(dbenv) DB_ENV *dbenv; { /* * We default to 32 8K pages. We don't default to a flat 256K, because * some systems require significantly more memory to hold 32 pages than * others. For example, HP-UX with POSIX pthreads needs 88 bytes for * a POSIX pthread mutex and almost 200 bytes per buffer header, while * Solaris needs 24 and 52 bytes for the same structures. */ dbenv->mp_bytes = 32 * ((8 * 1024) + sizeof(BH)); dbenv->mp_ncache = 1; dbenv->set_mp_mmapsize = CDB___memp_set_mp_mmapsize; dbenv->set_cachesize = CDB___memp_set_cachesize; } /* * CDB___memp_set_cachesize -- * Initialize the cache size. */ static int CDB___memp_set_cachesize(dbenv, gbytes, bytes, ncache) DB_ENV *dbenv; u_int32_t gbytes, bytes; int ncache; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_cachesize"); dbenv->mp_gbytes = gbytes + bytes / GIGABYTE; dbenv->mp_bytes = bytes % GIGABYTE; dbenv->mp_ncache = ncache == 0 ? 1 : ncache; /* * If the application requested less than 500Mb, increase the * cachesize by 25% to account for our overhead. (I'm guessing * that caches over 500Mb are specifically sized, i.e., it's * a large server and the application actually knows how much * memory is available.) * * There is a minimum cache size, regardless. */ if (dbenv->mp_gbytes == 0) { if (dbenv->mp_bytes < 500 * MEGABYTE) dbenv->mp_bytes += dbenv->mp_bytes / 4; if (dbenv->mp_bytes < DB_CACHESIZE_MIN) dbenv->mp_bytes = DB_CACHESIZE_MIN; } return (0); } /* * CDB___memp_set_mp_mmapsize -- * Set the maximum mapped file size. */ static int CDB___memp_set_mp_mmapsize(dbenv, mp_mmapsize ) DB_ENV *dbenv; size_t mp_mmapsize; { dbenv->mp_mmapsize = mp_mmapsize; return (0); } ��������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_region.c������������������������������������������������������������������������0100644�0063146�0012731�00000021670�07661541610�015107� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_region.c 11.4 (Sleepycat) 10/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" static int CDB___mcache_init __P((DB_ENV *, DB_MPOOL *, int, int)); static int CDB___mpool_init __P((DB_ENV *, DB_MPOOL *, int)); /* * CDB___memp_open -- * Internal version of memp_open: only called from DB_ENV->open. * * PUBLIC: int CDB___memp_open __P((DB_ENV *)); */ int CDB___memp_open(dbenv) DB_ENV *dbenv; { DB_MPOOL *dbmp; MPOOL *mp; roff_t mpr_size, reg_size, *regids; int i, htab_buckets, ret; /* Figure out how big each cache region is. */ reg_size = dbenv->mp_gbytes / dbenv->mp_ncache; reg_size += (dbenv->mp_gbytes % dbenv->mp_ncache) / dbenv->mp_ncache; reg_size += dbenv->mp_bytes / dbenv->mp_ncache; /* * Figure out how many hash buckets each region will have. Assume we * want to keep the hash chains with under 10 pages on each chain. We * don't know the pagesize in advance, and it may differ for different * files. Use a pagesize of 1K for the calculation -- we walk these * chains a lot, they must be kept short. */ htab_buckets = CDB___db_tablesize((reg_size / (1 * 1024)) / 10); /* Create and initialize the DB_MPOOL structure. */ if ((ret = CDB___os_calloc(1, sizeof(*dbmp), &dbmp)) != 0) return (ret); LIST_INIT(&dbmp->dbregq); TAILQ_INIT(&dbmp->dbmfq); dbmp->dbenv = dbenv; /* Clear locking for avoiding mp_alloc recursion */ dbmp->recursion_level = 0; /* * Join/create the mpool region. If this is a local region we don't * need much space because the most we'll store there is the pair of * MPOOL and MPOOLFILE structures. If we're creating a full-blown * database environment, be generous -- I'd rather not fail because * we ran out of space. */ dbmp->reginfo.id = REG_ID_MPOOL; dbmp->reginfo.mode = dbenv->db_mode; if (F_ISSET(dbenv, DB_ENV_DBLOCAL)) mpr_size = sizeof(MPOOL) + sizeof(MPOOLFILE) + 5 * 1024; else mpr_size = sizeof(MPOOL) + DB_MPOOLFILE_DEF * sizeof(MPOOLFILE) + 10 * 1024; if (F_ISSET(dbenv, DB_ENV_CREATE)) F_SET(&dbmp->reginfo, REGION_CREATE_OK); if ((ret = CDB___db_r_attach(dbenv, &dbmp->reginfo, mpr_size)) != 0) goto err; /* * If we created the region, initialize it and any additional regions, * otherwise join any additional regions. */ if (F_ISSET(&dbmp->reginfo, REGION_CREATE)) { /* Initialize the primary region. */ if ((ret = CDB___mpool_init(dbenv, dbmp, dbenv->mp_ncache)) != 0) goto err; /* * We know how many regions there are going to be, allocate * the REGINFO structures and fill in local copies of that * information. */ if ((ret = CDB___os_calloc( dbenv->mp_ncache, sizeof(REGINFO), &dbmp->c_reginfo)) != 0) goto err; dbmp->nc_reg = dbenv->mp_ncache; /* Make sure we don't clear the wrong entries on error. */ for (i = 0; i < dbmp->nc_reg; ++i) dbmp->c_reginfo[i].id = REG_ID_INVALID; /* * Create/initialize the cache regions and copy their IDs * into the primary region. */ mp = R_ADDR(&dbmp->reginfo, dbmp->reginfo.rp->primary); regids = R_ADDR(&dbmp->reginfo, mp->c_regids); for (i = 0; i < dbmp->nc_reg; ++i) { dbmp->c_reginfo[i].id = REG_ID_INVALID; dbmp->c_reginfo[i].mode = dbenv->db_mode; F_SET(&dbmp->c_reginfo[i], REGION_CREATE_OK); if ((ret = CDB___db_r_attach( dbenv, &dbmp->c_reginfo[i], reg_size)) != 0) goto err; if ((ret = CDB___mcache_init(dbenv, dbmp, htab_buckets, i)) != 0) goto err; R_UNLOCK(dbenv, &dbmp->c_reginfo[i]); regids[i] = dbmp->c_reginfo[i].id; } } else { /* * We know how many regions there are going to be, allocate * the REGINFO structures and fill in local copies of that * information. */ mp = R_ADDR(&dbmp->reginfo, dbmp->reginfo.rp->primary); if ((ret = CDB___os_calloc( mp->nc_reg, sizeof(REGINFO), &dbmp->c_reginfo)) != 0) goto err; dbmp->nc_reg = mp->nc_reg; /* Make sure we don't clear the wrong entries on error. */ for (i = 0; i < dbmp->nc_reg; ++i) dbmp->c_reginfo[i].id = REG_ID_INVALID; /* Join additional regions. */ regids = R_ADDR(&dbmp->reginfo, mp->c_regids); for (i = 0; i < dbmp->nc_reg; ++i) { dbmp->c_reginfo[i].id = regids[i]; dbmp->c_reginfo[i].mode = 0; if ((ret = CDB___db_r_attach(dbenv, &dbmp->c_reginfo[i], 0)) != 0) goto err; R_UNLOCK(dbenv, &dbmp->c_reginfo[i]); } } /* Set the local addresses for the primary and cache regions. */ dbmp->reginfo.primary = mp = R_ADDR(&dbmp->reginfo, dbmp->reginfo.rp->primary); for (i = 0; i < dbmp->nc_reg; ++i) dbmp->c_reginfo[i].primary = R_ADDR(&dbmp->c_reginfo[i], dbmp->c_reginfo[i].rp->primary); R_UNLOCK(dbenv, &dbmp->reginfo); /* If the region is threaded, allocate a mutex to lock the handles. */ if (F_ISSET(dbenv, DB_ENV_THREAD)) { if ((ret = CDB___db_mutex_alloc( dbenv, &dbmp->reginfo, &dbmp->mutexp)) != 0) { goto err; } if ((ret = __db_mutex_init(dbenv, dbmp->mutexp, 0, MUTEX_THREAD)) != 0) goto err; } dbenv->mp_handle = dbmp; return (0); err: if (dbmp->reginfo.addr != NULL) { if (F_ISSET(&dbmp->reginfo, REGION_CREATE)) for (i = 0; i < dbmp->nc_reg; ++i) if (dbmp->c_reginfo[i].id != REG_ID_INVALID) F_SET(dbmp->c_reginfo[i].rp, REG_DEAD); R_UNLOCK(dbenv, &dbmp->reginfo); for (i = 0; i < dbmp->nc_reg; ++i) if (dbmp->c_reginfo[i].id != REG_ID_INVALID) (void)CDB___db_r_detach( dbenv, &dbmp->c_reginfo[i], 0); CDB___os_free(dbmp->c_reginfo, dbmp->nc_reg * sizeof(*dbmp->c_reginfo)); } CDB___os_free(dbmp, sizeof(*dbmp)); return (ret); } /* * CDB___mpool_init -- * Initialize a MPOOL structure in shared memory. */ static int CDB___mpool_init(dbenv, dbmp, nc_reg) DB_ENV *dbenv; DB_MPOOL *dbmp; int nc_reg; { MPOOL *mp; int ret; void *p; if ((ret = CDB___db_shalloc(dbmp->reginfo.addr, sizeof(*mp), 0, &dbmp->reginfo.primary)) != 0) return (ret); dbmp->reginfo.rp->primary = R_OFFSET(&dbmp->reginfo, dbmp->reginfo.primary); mp = dbmp->reginfo.primary; memset(mp, 0, sizeof(*mp)); SH_TAILQ_INIT(&mp->mpfq); if ((ret = __db_mutex_init(dbenv, &mp->sync_mutex, R_OFFSET(&dbmp->reginfo, &mp->sync_mutex) + DB_FCNTL_OFF_MPOOL, 0)) != 0) return (ret); ZERO_LSN(mp->lsn); mp->lsn_cnt = 0; mp->nc_reg = nc_reg; if ((ret = CDB___db_shalloc( dbmp->reginfo.addr, nc_reg * sizeof(int), 0, &p)) != 0) { CDB___db_shalloc_free(dbmp->reginfo.addr, dbmp->reginfo.primary); return (ret); } mp->c_regids = R_OFFSET(&dbmp->reginfo, p); return (0); } /* * CDB___mcache_init -- * Initialize a MCACHE structure in shared memory. */ static int CDB___mcache_init(dbenv, dbmp, htab_buckets, reginfo_off) DB_ENV *dbenv; DB_MPOOL *dbmp; int htab_buckets, reginfo_off; { DB_HASHTAB *htab; MCACHE *mc; MPOOL *mp; REGINFO *reginfo; int ret; COMPQUIET(dbenv, NULL); mp = dbmp->reginfo.primary; reginfo = &dbmp->c_reginfo[reginfo_off]; if ((ret = CDB___db_shalloc(reginfo->addr, sizeof(*mc), 0, ®info->primary)) != 0) return (ret); reginfo->rp->primary = R_OFFSET(reginfo, reginfo->primary); mc = reginfo->primary; memset(mc, 0, sizeof(*mc)); SH_TAILQ_INIT(&mc->bhq); /* Allocate hash table space and initialize it. */ if ((ret = CDB___db_shalloc(reginfo->addr, htab_buckets * sizeof(DB_HASHTAB), 0, &htab)) != 0) { CDB___db_shalloc_free(reginfo->addr, reginfo->primary); return (ret); } CDB___db_hashinit(htab, htab_buckets); mc->htab = R_OFFSET(reginfo, htab); mc->htab_buckets = htab_buckets; return (0); } /* * CDB___memp_close -- * Internal version of memp_close: only called from DB_ENV->close. * * PUBLIC: int CDB___memp_close __P((DB_ENV *)); */ int CDB___memp_close(dbenv) DB_ENV *dbenv; { DB_MPOOL *dbmp; DB_MPOOLFILE *dbmfp; DB_MPREG *mpreg; int i, ret, t_ret; ret = 0; dbmp = dbenv->mp_handle; /* Discard DB_MPREGs. */ while ((mpreg = LIST_FIRST(&dbmp->dbregq)) != NULL) { LIST_REMOVE(mpreg, q); CDB___os_free(mpreg, sizeof(DB_MPREG)); } /* Discard DB_MPOOLFILEs. */ while ((dbmfp = TAILQ_FIRST(&dbmp->dbmfq)) != NULL) { if(F_ISSET(dbmfp, MP_CMPR)) { dbmfp->cmpr_context.weakcmpr = 0; F_CLR(dbmfp, MP_CMPR); } if ((t_ret = CDB_memp_fclose(dbmfp)) != 0 && ret == 0) ret = t_ret; } /* Discard the thread mutex. */ if (dbmp->mutexp != NULL) CDB___db_mutex_free(dbenv, &dbmp->reginfo, dbmp->mutexp); /* Detach from the region(s). */ for (i = 0; i < dbmp->nc_reg; ++i) if ((t_ret = CDB___db_r_detach( dbenv, &dbmp->c_reginfo[i], 0)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB___db_r_detach(dbenv, &dbmp->reginfo, 0)) != 0 && ret == 0) ret = t_ret; CDB___os_free(dbmp->c_reginfo, dbmp->nc_reg * sizeof(*dbmp->c_reginfo)); CDB___os_free(dbmp, sizeof(*dbmp)); return (ret); } ������������������������������������������������������������������������htdig-3.2.0b6/db/mp_register.c����������������������������������������������������������������������0100644�0063146�0012731�00000003131�07427026535�015444� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_register.c 11.2 (Sleepycat) 9/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" /* * CDB_memp_register -- * Register a file type's pgin, pgout routines. */ int CDB_memp_register(dbenv, ftype, pgin, pgout) DB_ENV *dbenv; int ftype; int (*pgin) __P((db_pgno_t, void *, DBT *)); int (*pgout) __P((db_pgno_t, void *, DBT *)); { DB_MPOOL *dbmp; DB_MPREG *mpreg; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->mp_handle, DB_INIT_MPOOL); dbmp = dbenv->mp_handle; /* * Chances are good that the item has already been registered, as the * DB access methods are the folks that call this routine. If already * registered, just update the entry, although it's probably unchanged. */ MUTEX_THREAD_LOCK(dbmp->mutexp); for (mpreg = LIST_FIRST(&dbmp->dbregq); mpreg != NULL; mpreg = LIST_NEXT(mpreg, q)) if (mpreg->ftype == ftype) { mpreg->pgin = pgin; mpreg->pgout = pgout; break; } MUTEX_THREAD_UNLOCK(dbmp->mutexp); if (mpreg != NULL) return (0); /* New entry. */ if ((ret = CDB___os_malloc(sizeof(DB_MPREG), NULL, &mpreg)) != 0) return (ret); mpreg->ftype = ftype; mpreg->pgin = pgin; mpreg->pgout = pgout; MUTEX_THREAD_LOCK(dbmp->mutexp); LIST_INSERT_HEAD(&dbmp->dbregq, mpreg, q); MUTEX_THREAD_UNLOCK(dbmp->mutexp); return (0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_stat.c��������������������������������������������������������������������������0100644�0063146�0012731�00000022153�10000513630�014552� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_stat.c 11.4 (Sleepycat) 9/18/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdio.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_am.h" #include "mp.h" static void CDB___memp_dumpcache __P((DB_MPOOL *, REGINFO *, size_t *, FILE *, u_int32_t)); static void CDB___memp_pbh __P((DB_MPOOL *, BH *, size_t *, FILE *)); /* * CDB_memp_stat -- * Display MPOOL statistics. */ int CDB_memp_stat(dbenv, gspp, fspp, db_malloc) DB_ENV *dbenv; DB_MPOOL_STAT **gspp; DB_MPOOL_FSTAT ***fspp; void *(*db_malloc) __P((size_t)); { DB_MPOOL *dbmp; DB_MPOOL_FSTAT **tfsp; DB_MPOOL_STAT *sp; MCACHE *mc; MPOOL *mp; MPOOLFILE *mfp; size_t len, nlen; u_int32_t i; int ret; char *name; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->mp_handle, DB_INIT_MPOOL); dbmp = dbenv->mp_handle; sp = NULL; /* Global statistics. */ mp = dbmp->reginfo.primary; if (gspp != NULL) { *gspp = NULL; if ((ret = CDB___os_calloc(1, sizeof(**gspp), gspp)) != 0) return (ret); sp = *gspp; /* * Initialization and information that is not maintained on * a per-cache basis. */ sp->st_hash_longest = 0; sp->st_region_wait = dbmp->reginfo.rp->mutex.mutex_set_wait; sp->st_region_nowait = dbmp->reginfo.rp->mutex.mutex_set_nowait; sp->st_regsize = dbmp->reginfo.rp->size; sp->st_gbytes = dbenv->mp_gbytes; sp->st_bytes = dbenv->mp_bytes; R_LOCK(dbenv, &dbmp->reginfo); /* Walk the cache list and accumulate the global information. */ for (i = 0; i < mp->nc_reg; ++i) { mc = dbmp->c_reginfo[i].primary; sp->st_cache_hit += mc->stat.st_cache_hit; sp->st_cache_miss += mc->stat.st_cache_miss; sp->st_map += mc->stat.st_map; sp->st_page_create += mc->stat.st_page_create; sp->st_page_in += mc->stat.st_page_in; sp->st_page_out += mc->stat.st_page_out; sp->st_ro_evict += mc->stat.st_ro_evict; sp->st_rw_evict += mc->stat.st_rw_evict; sp->st_hash_buckets += mc->stat.st_hash_buckets; sp->st_hash_searches += mc->stat.st_hash_searches; if (mc->stat.st_hash_longest > sp->st_hash_longest) sp->st_hash_longest = mc->stat.st_hash_longest; sp->st_hash_examined += mc->stat.st_hash_examined; sp->st_page_clean += mc->stat.st_page_clean; sp->st_page_dirty += mc->stat.st_page_dirty; sp->st_page_trickle += mc->stat.st_page_trickle; sp->st_region_wait += mc->stat.st_region_wait; sp->st_region_nowait += mc->stat.st_region_nowait; } R_UNLOCK(dbenv, &dbmp->reginfo); } /* Per-file statistics. */ if (fspp != NULL) { *fspp = NULL; R_LOCK(dbenv, &dbmp->reginfo); /* Count the MPOOLFILE structures. */ for (len = 0, mfp = SH_TAILQ_FIRST(&mp->mpfq, __mpoolfile); mfp != NULL; ++len, mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) ; R_UNLOCK(dbenv, &dbmp->reginfo); if (len == 0) return (0); /* Allocate space for the pointers. */ len = (len + 1) * sizeof(DB_MPOOL_FSTAT *); if ((ret = CDB___os_malloc(len, db_malloc, fspp)) != 0) return (ret); R_LOCK(dbenv, &dbmp->reginfo); /* Build each individual entry. */ for (tfsp = *fspp, mfp = SH_TAILQ_FIRST(&mp->mpfq, __mpoolfile); mfp != NULL; ++tfsp, mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) { name = CDB___memp_fns(dbmp, mfp); nlen = strlen(name); len = sizeof(DB_MPOOL_FSTAT) + nlen + 1; if ((ret = CDB___os_malloc(len, db_malloc, tfsp)) != 0) return (ret); **tfsp = mfp->stat; (*tfsp)->file_name = (char *) (u_int8_t *)*tfsp + sizeof(DB_MPOOL_FSTAT); memcpy((*tfsp)->file_name, name, nlen + 1); /* * We have duplicate statistics fields in the cache * and per-file structures. The counters are only * incremented in the per-file structures, though. * The intent is that if we ever flush files from * the pool we can save their last known totals in * the cache structure. */ if (sp != NULL) { sp->st_cache_hit += mfp->stat.st_cache_hit; sp->st_cache_miss += mfp->stat.st_cache_miss; sp->st_map += mfp->stat.st_map; sp->st_page_create += mfp->stat.st_page_create; sp->st_page_in += mfp->stat.st_page_in; sp->st_page_out += mfp->stat.st_page_out; } } *tfsp = NULL; R_UNLOCK(dbenv, &dbmp->reginfo); } return (0); } #define FMAP_ENTRIES 200 /* Files we map. */ #define MPOOL_DUMP_HASH 0x01 /* Debug hash chains. */ #define MPOOL_DUMP_LRU 0x02 /* Debug LRU chains. */ #define MPOOL_DUMP_MEM 0x04 /* Debug region memory. */ #define MPOOL_DUMP_ALL 0x07 /* Debug all. */ /* * CDB___memp_dump_region -- * Display MPOOL structures. * * PUBLIC: void CDB___memp_dump_region __P((DB_ENV *, char *, FILE *)); */ void CDB___memp_dump_region(dbenv, area, fp) DB_ENV *dbenv; char *area; FILE *fp; { DB_MPOOL *dbmp; DB_MPOOLFILE *dbmfp; MPOOL *mp; MPOOLFILE *mfp; size_t fmap[FMAP_ENTRIES + 1]; u_int32_t i, flags; int cnt; u_int8_t *p; dbmp = dbenv->mp_handle; /* Make it easy to call from the debugger. */ if (fp == NULL) fp = stderr; for (flags = 0; *area != '\0'; ++area) switch (*area) { case 'A': LF_SET(MPOOL_DUMP_ALL); break; case 'h': LF_SET(MPOOL_DUMP_HASH); break; case 'l': LF_SET(MPOOL_DUMP_LRU); break; case 'm': LF_SET(MPOOL_DUMP_MEM); break; } R_LOCK(dbenv, &dbmp->reginfo); mp = dbmp->reginfo.primary; /* Display MPOOL structures. */ (void)fprintf(fp, "%s\nPool (region addr 0x%lx)\n", DB_LINE, (u_long)dbmp->reginfo.addr); /* Display the MPOOLFILE structures. */ cnt = 0; for (mfp = SH_TAILQ_FIRST(&mp->mpfq, __mpoolfile); mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile), ++cnt) { (void)fprintf(fp, "File #%d: %s: type %ld, %s\n\t [UID: ", cnt + 1, CDB___memp_fns(dbmp, mfp), (long)mfp->ftype, F_ISSET(mfp, MP_CAN_MMAP) ? "mmap" : "read/write"); p = R_ADDR(&dbmp->reginfo, mfp->fileid_off); for (i = 0; i < DB_FILE_ID_LEN; ++i) { (void)fprintf(fp, "%x", *p++); if (i < DB_FILE_ID_LEN - 1) (void)fprintf(fp, " "); } (void)fprintf(fp, "]\n"); if (cnt < FMAP_ENTRIES) fmap[cnt] = R_OFFSET(&dbmp->reginfo, mfp); } for (dbmfp = TAILQ_FIRST(&dbmp->dbmfq); dbmfp != NULL; dbmfp = TAILQ_NEXT(dbmfp, q), ++cnt) { (void)fprintf(fp, "File #%d: %s: per-process, %s\n", cnt + 1, CDB___memp_fn(dbmfp), F_ISSET(dbmfp, MP_READONLY) ? "readonly" : "read/write"); if (cnt < FMAP_ENTRIES) fmap[cnt] = R_OFFSET(&dbmp->reginfo, mfp); } if (cnt < FMAP_ENTRIES) fmap[cnt] = INVALID_ROFF; else fmap[FMAP_ENTRIES] = INVALID_ROFF; /* Dump each cache. */ for (i = 0; i < mp->nc_reg; ++i) { (void)fprintf(fp, "%s\nCache #%d:\n", DB_LINE, i + 1); CDB___memp_dumpcache(dbmp, &dbmp->c_reginfo[i], fmap, fp, flags); } if (LF_ISSET(MPOOL_DUMP_MEM)) CDB___db_shalloc_dump(dbmp->reginfo.addr, fp); R_UNLOCK(dbenv, &dbmp->reginfo); /* Flush in case we're debugging. */ (void)fflush(fp); } /* * CDB___memp_dumpcache -- * Display statistics for a cache. */ static void CDB___memp_dumpcache(dbmp, reginfo, fmap, fp, flags) DB_MPOOL *dbmp; REGINFO *reginfo; size_t *fmap; FILE *fp; u_int32_t flags; { BH *bhp; DB_HASHTAB *dbht; MCACHE *mc; int bucket; mc = reginfo->primary; /* Display the hash table list of BH's. */ if (LF_ISSET(MPOOL_DUMP_HASH)) { (void)fprintf(fp, "%s\nBH hash table (%lu hash slots)\npageno, file, ref, address\n", DB_LINE, (u_long)mc->htab_buckets); for (dbht = R_ADDR(reginfo, mc->htab), bucket = 0; bucket < mc->htab_buckets; ++dbht, ++bucket) { if (SH_TAILQ_FIRST(dbht, __bh) != NULL) (void)fprintf(fp, "%lu:\n", (u_long)bucket); for (bhp = SH_TAILQ_FIRST(dbht, __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh)) CDB___memp_pbh(dbmp, bhp, fmap, fp); } } /* Display the LRU list of BH's. */ if (LF_ISSET(MPOOL_DUMP_LRU)) { (void)fprintf(fp, "%s\nBH LRU list\n", DB_LINE); (void)fprintf(fp, "pageno, file, ref, address\n"); for (bhp = SH_TAILQ_FIRST(&mc->bhq, __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, q, __bh)) CDB___memp_pbh(dbmp, bhp, fmap, fp); } } /* * CDB___memp_pbh -- * Display a BH structure. */ static void CDB___memp_pbh(dbmp, bhp, fmap, fp) DB_MPOOL *dbmp; BH *bhp; size_t *fmap; FILE *fp; { static const FN fn[] = { { BH_CALLPGIN, "callpgin" }, { BH_DIRTY, "dirty" }, { BH_DISCARD, "discard" }, { BH_LOCKED, "locked" }, { BH_TRASH, "trash" }, { BH_WRITE, "write" }, { 0, NULL } }; int i; for (i = 0; i < FMAP_ENTRIES; ++i) if (fmap[i] == INVALID_ROFF || fmap[i] == bhp->mf_offset) break; if (fmap[i] == INVALID_ROFF) (void)fprintf(fp, " %4lu, %lu, %2lu, %lu", (u_long)bhp->pgno, (u_long)bhp->mf_offset, (u_long)bhp->ref, (u_long)R_OFFSET(&dbmp->reginfo, bhp)); else (void)fprintf(fp, " %4lu, #%d, %2lu, %lu", (u_long)bhp->pgno, i + 1, (u_long)bhp->ref, (u_long)R_OFFSET(&dbmp->reginfo, bhp)); CDB___db_prflags(bhp->flags, fn, fp); (void)fprintf(fp, "\n"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_sync.c��������������������������������������������������������������������������0100644�0063146�0012731�00000040075�07427026535�014604� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_sync.c 11.10 (Sleepycat) 10/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" static int CDB___bhcmp __P((const void *, const void *)); static int CDB___memp_fsync __P((DB_MPOOLFILE *)); static int CDB___memp_sballoc __P((DB_ENV *, BH ***, u_int32_t *)); /* * CDB_memp_sync -- * Mpool sync function. */ int CDB_memp_sync(dbenv, lsnp) DB_ENV *dbenv; DB_LSN *lsnp; { BH *bhp, **bharray; DB_MPOOL *dbmp; DB_LSN tlsn; MCACHE *mc; MPOOL *mp; MPOOLFILE *mfp; u_int32_t ar_cnt, i, ndirty; int ret, retry_done, retry_need, wrote; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->mp_handle, DB_INIT_MPOOL); dbmp = dbenv->mp_handle; mp = dbmp->reginfo.primary; if (!F_ISSET(dbenv, DB_ENV_LOGGING)) { CDB___db_err(dbenv, "CDB_memp_sync: requires logging"); return (EINVAL); } /* * If no LSN is provided, flush the entire cache. * * !!! * Our current behavior is to flush the entire cache, so there's * nothing special we have to do here other than deal with NULL * pointers. */ if (lsnp == NULL) { ZERO_LSN(tlsn); lsnp = &tlsn; F_SET(mp, MP_LSN_RETRY); } /* * Sync calls are single-threaded so that we don't have multiple * threads, with different checkpoint LSNs, walking the caches * and updating the checkpoint LSNs and how many buffers remain * to be written for the checkpoint. This shouldn't be a problem, * any application that has multiple checkpoint threads isn't what * I'd call trustworthy. */ MUTEX_LOCK(&mp->sync_mutex, dbenv->lockfhp); /* * If the application is asking about a previous call to CDB_memp_sync(), * and we haven't found any buffers that the application holding the * pin couldn't write, return yes or no based on the current count. * Note, if the application is asking about a LSN *smaller* than one * we've already handled or are currently handling, then we return a * result based on the count for the larger LSN. */ R_LOCK(dbenv, &dbmp->reginfo); if (!IS_ZERO_LSN(*lsnp) && !F_ISSET(mp, MP_LSN_RETRY) && CDB_log_compare(lsnp, &mp->lsn) <= 0) { if (mp->lsn_cnt == 0) { *lsnp = mp->lsn; ret = 0; } else ret = DB_INCOMPLETE; R_UNLOCK(dbenv, &dbmp->reginfo); MUTEX_UNLOCK(&mp->sync_mutex); return (ret); } /* * Allocate room for a list of buffers, and decide how many buffers * we can pin down. * * !!! * Note: CDB___memp_sballoc has released the region lock if we're not * continuing forward. */ if ((ret = CDB___memp_sballoc(dbenv, &bharray, &ndirty)) != 0 || ndirty == 0) { MUTEX_UNLOCK(&mp->sync_mutex); return (ret); } retry_done = 0; retry: retry_need = 0; /* * Start a new checkpoint. * * Save the LSN. We know that it's a new LSN, a retry, or larger than * the one for which we were already doing a checkpoint. (BTW, I don't * expect to see multiple LSN's from the same or multiple processes, * but You Just Never Know. Responding as if they all called with the * largest of the LSNs specified makes everything work.) * * We don't currently use the LSN we save. We could potentially save * the last-written LSN in each buffer header and use it to determine * what buffers need to be written. The problem with this is that it's * sizeof(LSN) more bytes of buffer header. We currently write all the * dirty buffers instead, but with a sufficiently large cache that's * going to be a problem. */ mp->lsn = *lsnp; /* * Clear the global count of buffers waiting to be written, walk the * list of files clearing the count of buffers waiting to be written. * * Clear the retry flag. */ mp->lsn_cnt = 0; for (mfp = SH_TAILQ_FIRST(&mp->mpfq, __mpoolfile); mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) mfp->lsn_cnt = 0; F_CLR(mp, MP_LSN_RETRY); /* * Walk each cache's list of buffers and mark all dirty buffers to be * written and all pinned buffers to be potentially written (we can't * know if they'll need to be written until the holder returns them to * the cache). We do this in one pass while holding the region locked * so that processes can't make new buffers dirty, causing us to never * finish. Since the application may have restarted the sync using a * different LSN value, clear any BH_WRITE flags that appear leftover * from previous calls. * * Keep a count of the total number of buffers we need to write in * MPOOL->lsn_cnt, and for each file, in MPOOLFILE->lsn_count. */ for (ar_cnt = 0, i = 0; i < mp->nc_reg; ++i) { mc = dbmp->c_reginfo[i].primary; for (bhp = SH_TAILQ_FIRST(&mc->bhq, __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, q, __bh)) { if (F_ISSET(bhp, BH_DIRTY) || bhp->ref != 0) { F_SET(bhp, BH_WRITE); ++mp->lsn_cnt; mfp = R_ADDR(&dbmp->reginfo, bhp->mf_offset); ++mfp->lsn_cnt; /* * If the buffer isn't being used, we can write * it immediately, so increment its reference * count to lock it down, and save a reference * to it. * * If we've run out space to store buffer refs, * we're screwed. We don't want to realloc the * array while holding a region lock, so we set * a flag and deal with it later. */ if (bhp->ref == 0) { ++bhp->ref; bharray[ar_cnt] = bhp; if (++ar_cnt >= ndirty) { retry_need = 1; break; } } } else if (F_ISSET(bhp, BH_WRITE)) F_CLR(bhp, BH_WRITE); } if (ar_cnt >= ndirty) break; } /* If there no buffers we can write immediately, we're done. */ if (ar_cnt == 0) { ret = mp->lsn_cnt ? DB_INCOMPLETE : 0; goto done; } R_UNLOCK(dbenv, &dbmp->reginfo); /* * Sort the buffers we're going to write immediately. * * We try and write the buffers in file/page order: it should reduce * seeks by the underlying filesystem and possibly reduce the actual * number of writes. */ if (ar_cnt > 1) qsort(bharray, ar_cnt, sizeof(BH *), CDB___bhcmp); R_LOCK(dbenv, &dbmp->reginfo); /* Walk the array, writing buffers. */ for (i = 0; i < ar_cnt; ++i) { /* * It's possible for a thread to have gotten the buffer since * we listed it for writing. If the reference count is still * 1, we're the only ones using the buffer, go ahead and write. * If it's >1, then skip the buffer and assume that it will be * written when it's returned to the cache. */ if (bharray[i]->ref > 1) { --bharray[i]->ref; continue; } /* Write the buffer. */ mfp = R_ADDR(&dbmp->reginfo, bharray[i]->mf_offset); ret = CDB___memp_bhwrite(dbmp, mfp, bharray[i], NULL, &wrote); /* Release the buffer. */ --bharray[i]->ref; if (ret == 0 && wrote) continue; /* * Any process syncing the shared memory buffer pool had best * be able to write to any underlying file. Be understanding, * but firm, on this point. */ if (ret == 0) { CDB___db_err(dbenv, "%s: unable to flush page: %lu", CDB___memp_fns(dbmp, mfp), (u_long)bharray[i]->pgno); ret = EPERM; } /* * On error, clear MPOOL->lsn and set MP_LSN_RETRY so that no * future checkpoint return can depend on this failure. Don't * bother to reset/clear: * * MPOOL->lsn_cnt * MPOOLFILE->lsn_cnt * buffer BH_WRITE flags * * they don't make any difference. */ ZERO_LSN(mp->lsn); F_SET(mp, MP_LSN_RETRY); /* Release any buffers we're still pinning down. */ while (++i < ar_cnt) --bharray[i]->ref; goto done; } ret = mp->lsn_cnt != 0 ? DB_INCOMPLETE : 0; /* * If there were too many buffers and we're not returning an error, we * re-try the checkpoint once -- since we allocated 80% of the total * buffer count, once should be enough. If it still doesn't work, some * other thread of control is dirtying buffers as fast as we're writing * them, and we might as well give up for now. In the latter case, set * the global retry flag, we'll have to start from scratch on the next * checkpoint. */ if (retry_need) { if (retry_done) { ret = DB_INCOMPLETE; F_SET(mp, MP_LSN_RETRY); } else { retry_done = 1; goto retry; } } done: R_UNLOCK(dbenv, &dbmp->reginfo); MUTEX_UNLOCK(&mp->sync_mutex); CDB___os_free(bharray, ndirty * sizeof(BH *)); return (ret); } /* * CDB_memp_fsync -- * Mpool file sync function. */ int CDB_memp_fsync(dbmfp) DB_MPOOLFILE *dbmfp; { DB_ENV *dbenv; DB_MPOOL *dbmp; int is_tmp; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; PANIC_CHECK(dbenv); /* * If this handle doesn't have a file descriptor that's open for * writing, or if the file is a temporary, there's no reason to * proceed further. */ if (F_ISSET(dbmfp, MP_READONLY)) return (0); R_LOCK(dbenv, &dbmp->reginfo); is_tmp = F_ISSET(dbmfp->mfp, MP_TEMP); R_UNLOCK(dbenv, &dbmp->reginfo); if (is_tmp) return (0); return (CDB___memp_fsync(dbmfp)); } /* * CDB___mp_xxx_fh -- * Return a file descriptor for DB 1.85 compatibility locking. * * PUBLIC: int CDB___mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **)); */ int CDB___mp_xxx_fh(dbmfp, fhp) DB_MPOOLFILE *dbmfp; DB_FH **fhp; { /* * This is a truly spectacular layering violation, intended ONLY to * support compatibility for the DB 1.85 DB->fd call. * * Sync the database file to disk, creating the file as necessary. * * We skip the MP_READONLY and MP_TEMP tests done by CDB_memp_fsync(3). * The MP_READONLY test isn't interesting because we will either * already have a file descriptor (we opened the database file for * reading) or we aren't readonly (we created the database which * requires write privileges). The MP_TEMP test isn't interesting * because we want to write to the backing file regardless so that * we get a file descriptor to return. */ *fhp = &dbmfp->fh; return (F_ISSET(&dbmfp->fh, DB_FH_VALID) ? 0 : CDB___memp_fsync(dbmfp)); } /* * CDB___memp_fsync -- * Mpool file internal sync function. */ static int CDB___memp_fsync(dbmfp) DB_MPOOLFILE *dbmfp; { BH *bhp, **bharray; DB_ENV *dbenv; DB_MPOOL *dbmp; MCACHE *mc; MPOOL *mp; size_t mf_offset; u_int32_t ar_cnt, i, ndirty; int incomplete, ret, retry_done, retry_need, wrote; dbmp = dbmfp->dbmp; dbenv = dbmp->dbenv; mp = dbmp->reginfo.primary; R_LOCK(dbenv, &dbmp->reginfo); /* * Allocate room for a list of buffers, and decide how many buffers * we can pin down. * * !!! * Note: CDB___memp_sballoc has released our region lock if we're not * continuing forward. */ if ((ret = CDB___memp_sballoc(dbenv, &bharray, &ndirty)) != 0 || ndirty == 0) return (ret); retry_done = 0; retry: retry_need = 0; /* * Walk each cache's list of buffers and mark all dirty buffers to be * written and all pinned buffers to be potentially written (we can't * know if they'll need to be written until the holder returns them to * the cache). We do this in one pass while holding the region locked * so that processes can't make new buffers dirty, causing us to never * finish. */ mf_offset = R_OFFSET(&dbmp->reginfo, dbmfp->mfp); for (ar_cnt = 0, incomplete = 0, i = 0; i < mp->nc_reg; ++i) { mc = dbmp->c_reginfo[i].primary; for (bhp = SH_TAILQ_FIRST(&mc->bhq, __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, q, __bh)) { if (!F_ISSET(bhp, BH_DIRTY) || bhp->mf_offset != mf_offset) continue; if (bhp->ref != 0 || F_ISSET(bhp, BH_LOCKED)) { incomplete = 1; continue; } /* * If the buffer isn't being used, we can write * it immediately, so increment its reference * count to lock it down, and save a reference * to it. * * If we've run out space to store buffer refs, * we're screwed. We don't want to realloc the * array while holding a region lock, so we set * a flag and deal with it later. */ ++bhp->ref; bharray[ar_cnt] = bhp; if (++ar_cnt >= ndirty) { retry_need = 1; break; } } if (ar_cnt >= ndirty) break; } /* If there no buffers we can write immediately, we're done. */ if (ar_cnt == 0) { ret = 0; goto done; } R_UNLOCK(dbenv, &dbmp->reginfo); /* Sort the buffers we're going to write. */ if (ar_cnt > 1) qsort(bharray, ar_cnt, sizeof(BH *), CDB___bhcmp); R_LOCK(dbenv, &dbmp->reginfo); /* Walk the array, writing buffers. */ for (i = 0; i < ar_cnt;) { /* * It's possible for a thread to have gotten the buffer since * we listed it for writing. If the reference count is still * 1, we're the only ones using the buffer, go ahead and write. * If it's >1, then skip the buffer and assume that it will be * written when it's returned to the cache. */ if (bharray[i]->ref > 1) { incomplete = 1; --bharray[i++]->ref; continue; } /* Write the buffer. */ ret = CDB___memp_pgwrite(dbmp, dbmfp, bharray[i], NULL, &wrote); /* Release the buffer. */ --bharray[i++]->ref; if (ret == 0) { if (!wrote) incomplete = 1; continue; } /* * On error: * * Release any buffers we're still pinning down. */ while (i < ar_cnt) --bharray[i++]->ref; break; } /* * If there were too many buffers and we're not returning an error, we * re-try the flush once -- since we allocated 80% of the total * buffer count, once should be enough. If it still doesn't work, some * other thread of control is dirtying buffers as fast as we're writing * them, and we might as well give up. */ if (retry_need) { if (retry_done) incomplete = 1; else { retry_done = 1; goto retry; } } done: R_UNLOCK(dbenv, &dbmp->reginfo); CDB___os_free(bharray, ndirty * sizeof(BH *)); /* * Sync the underlying file as the last thing we do, so that the OS * has a maximal opportunity to flush buffers before we request it. * * !!!: * Don't lock the region around the sync, fsync(2) has no atomicity * issues. */ if (ret == 0) ret = incomplete ? DB_INCOMPLETE : CDB___os_fsync(&dbmfp->fh); return (ret); } /* * CDB___memp_sballoc -- * Allocate room for a list of buffers. */ static int CDB___memp_sballoc(dbenv, bharrayp, ndirtyp) DB_ENV *dbenv; BH ***bharrayp; u_int32_t *ndirtyp; { DB_MPOOL *dbmp; MCACHE *mc; MPOOL *mp; u_int32_t i, nclean, ndirty, maxpin; int ret; dbmp = dbenv->mp_handle; mp = dbmp->reginfo.primary; /* * We don't want to hold the region lock while we write the buffers, * so only lock it while we create a list. * * Walk through the list of caches, figuring out how many buffers * we're going to need. * * Make a point of not holding the region lock across the library * allocation call. */ for (nclean = ndirty = 0, i = 0; i < mp->nc_reg; ++i) { mc = dbmp->c_reginfo[i].primary; ndirty += mc->stat.st_page_dirty; nclean += mc->stat.st_page_clean; } R_UNLOCK(dbenv, &dbmp->reginfo); if (ndirty == 0) { *ndirtyp = 0; return (0); } /* * We don't want to pin down the entire buffer cache, otherwise we'll * starve threads needing new pages. Don't pin down more than 80% of * the cache, making sure that we don't screw up just because only a * few pages have been created. */ maxpin = ((ndirty + nclean) * 8) / 10; if (maxpin < 10) maxpin = 10; /* * Get a good-sized block of memory to hold buffer pointers, we don't * want to run out, but correct if we want to allocate more than we * would be allowed to store, regardless. */ ndirty += ndirty / 2 + 10; if (ndirty > maxpin) ndirty = maxpin; if ((ret = CDB___os_malloc(ndirty * sizeof(BH *), NULL, bharrayp)) != 0) return (ret); *ndirtyp = ndirty; R_LOCK(dbenv, &dbmp->reginfo); return (0); } static int CDB___bhcmp(p1, p2) const void *p1, *p2; { BH *bhp1, *bhp2; bhp1 = *(BH * const *)p1; bhp2 = *(BH * const *)p2; /* Sort by file (shared memory pool offset). */ if (bhp1->mf_offset < bhp2->mf_offset) return (-1); if (bhp1->mf_offset > bhp2->mf_offset) return (1); /* * !!! * Defend against badly written quicksort code calling the comparison * function with two identical pointers (e.g., WATCOM C++ (Power++)). */ if (bhp1->pgno < bhp2->pgno) return (-1); if (bhp1->pgno > bhp2->pgno) return (1); return (0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp_trickle.c�����������������������������������������������������������������������0100644�0063146�0012731�00000005715�07427026535�015267� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mp_trickle.c 11.3 (Sleepycat) 9/16/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #endif #include "db_int.h" #include "db_shash.h" #include "mp.h" static int CDB___memp_trick __P((DB_ENV *, int, int, int *)); /* * CDB_memp_trickle -- * Keep a specified percentage of the buffers clean. */ int CDB_memp_trickle(dbenv, pct, nwrotep) DB_ENV *dbenv; int pct, *nwrotep; { DB_MPOOL *dbmp; MPOOL *mp; u_int32_t i; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->mp_handle, DB_INIT_MPOOL); dbmp = dbenv->mp_handle; mp = dbmp->reginfo.primary; if (nwrotep != NULL) *nwrotep = 0; if (pct < 1 || pct > 100) return (EINVAL); R_LOCK(dbenv, &dbmp->reginfo); /* Loop through the caches... */ for (ret = 0, i = 0; i < mp->nc_reg; ++i) if ((ret = CDB___memp_trick(dbenv, i, pct, nwrotep)) != 0) break; R_UNLOCK(dbenv, &dbmp->reginfo); return (ret); } /* * CDB___memp_trick -- * Trickle a single cache. */ static int CDB___memp_trick(dbenv, ncache, pct, nwrotep) DB_ENV *dbenv; int ncache, pct, *nwrotep; { BH *bhp; DB_MPOOL *dbmp; MCACHE *mc; MPOOLFILE *mfp; db_pgno_t pgno; u_long total; int ret, wrote; dbmp = dbenv->mp_handle; mc = dbmp->c_reginfo[ncache].primary; /* * If there are sufficient clean buffers, or no buffers or no dirty * buffers, we're done. * * XXX * Using st_page_clean and st_page_dirty is our only choice at the * moment, but it's not as correct as we might like in the presence * of pools with more than one buffer size, as a free 512-byte buffer * isn't the same as a free 8K buffer. */ loop: total = mc->stat.st_page_clean + mc->stat.st_page_dirty; if (total == 0 || mc->stat.st_page_dirty == 0 || (mc->stat.st_page_clean * 100) / total >= (u_long)pct) return (0); /* Loop until we write a buffer. */ for (bhp = SH_TAILQ_FIRST(&mc->bhq, __bh); bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, q, __bh)) { if (bhp->ref != 0 || !F_ISSET(bhp, BH_DIRTY) || F_ISSET(bhp, BH_LOCKED)) continue; mfp = R_ADDR(&dbmp->reginfo, bhp->mf_offset); /* * We can't write to temporary files -- see the comment in * mp_bh.c:CDB___memp_bhwrite(). */ if (F_ISSET(mfp, MP_TEMP)) continue; pgno = bhp->pgno; if ((ret = CDB___memp_bhwrite(dbmp, mfp, bhp, NULL, &wrote)) != 0) return (ret); /* * Any process syncing the shared memory buffer pool had better * be able to write to any underlying file. Be understanding, * but firm, on this point. */ if (!wrote) { CDB___db_err(dbenv, "%s: unable to flush page: %lu", CDB___memp_fns(dbmp, mfp), (u_long)pgno); return (EPERM); } ++mc->stat.st_page_trickle; if (nwrotep != NULL) ++*nwrotep; goto loop; } return (0); } ���������������������������������������������������htdig-3.2.0b6/db/mut_fcntl.c������������������������������������������������������������������������0100644�0063146�0012731�00000006330�07427026535�015123� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifdef HAVE_MUTEX_FCNTL #ifndef lint static const char sccsid[] = "@(#)mut_fcntl.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #endif #include "db_int.h" /* * CDB___db_fcntl_mutex_init -- * Initialize a DB mutex structure. * * PUBLIC: int CDB___db_fcntl_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); */ int CDB___db_fcntl_mutex_init(dbenv, mutexp, offset) DB_ENV *dbenv; MUTEX *mutexp; u_int32_t offset; { memset(mutexp, 0, sizeof(*mutexp)); /* * This is where we decide to ignore locks we don't need to set -- if * the application is private, we don't need any locks. */ if (F_ISSET(dbenv, DB_ENV_PRIVATE)) { F_SET(mutexp, MUTEX_IGNORE); return (0); } mutexp->off = offset; return (0); } /* * CDB___db_fcntl_mutex_lock * Lock on a mutex, blocking if necessary. * * PUBLIC: int CDB___db_fcntl_mutex_lock __P((MUTEX *, DB_FH *)); */ int CDB___db_fcntl_mutex_lock(mutexp, fhp) MUTEX *mutexp; DB_FH *fhp; { struct flock k_lock; int locked, ms, waited; if (!DB_GLOBAL(db_mutexlocks)) return (0); /* Initialize the lock. */ k_lock.l_whence = SEEK_SET; k_lock.l_start = mutexp->off; k_lock.l_len = 1; for (locked = waited = 0;;) { /* * Wait for the lock to become available; wait 1ms initially, * up to 1 second. */ for (ms = 1; mutexp->pid != 0;) { waited = 1; CDB___os_yield(ms * USEC_PER_MS); if ((ms <<= 1) > MS_PER_SEC) ms = MS_PER_SEC; } /* Acquire an exclusive kernel lock. */ k_lock.l_type = F_WRLCK; if (fcntl(fhp->fd, F_SETLKW, &k_lock)) return (CDB___os_get_errno()); /* If the resource is still available, it's ours. */ if (mutexp->pid == 0) { locked = 1; mutexp->pid = (u_int32_t)getpid(); } /* Release the kernel lock. */ k_lock.l_type = F_UNLCK; if (fcntl(fhp->fd, F_SETLK, &k_lock)) return (CDB___os_get_errno()); /* * If we got the resource lock we're done. * * !!! * We can't check to see if the lock is ours, because we may * be trying to block ourselves in the lock manager, and so * the holder of the lock that's preventing us from getting * the lock may be us! (Seriously.) */ if (locked) break; } if (waited) ++mutexp->mutex_set_wait; else ++mutexp->mutex_set_nowait; return (0); } /* * CDB___db_fcntl_mutex_unlock -- * Release a lock. * * PUBLIC: int CDB___db_fcntl_mutex_unlock __P((MUTEX *)); */ int CDB___db_fcntl_mutex_unlock(mutexp) MUTEX *mutexp; { if (!DB_GLOBAL(db_mutexlocks)) return (0); #ifdef DIAGNOSTIC #define MSG "mutex_unlock: ERROR: released lock that was unlocked\n" #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif if (mutexp->pid == 0) write(STDERR_FILENO, MSG, sizeof(MSG) - 1); #endif /* * Release the resource. We don't have to acquire any locks because * processes trying to acquire the lock are checking for a pid set to * 0/non-0, not to any specific value. */ mutexp->pid = 0; return (0); } #endif /* HAVE_MUTEX_FCNTL */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mut_pthread.c����������������������������������������������������������������������0100644�0063146�0012731�00000015216�07427026535�015447� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifdef HAVE_MUTEX_PTHREAD #ifndef lint static const char sccsid[] = "@(#)mut_pthread.c 11.15 (Sleepycat) 11/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #include <unistd.h> #endif #include "db_int.h" #ifdef DIAGNOSTIC #undef MSG1 #define MSG1 "mutex_lock: ERROR: lock currently in use: pid: %lu.\n" #undef MSG2 #define MSG2 "mutex_unlock: ERROR: lock already unlocked\n" #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #endif #ifdef HAVE_MUTEX_SOLARIS_LWP #define pthread_cond_signal _lwp_cond_signal #define pthread_cond_wait _lwp_cond_wait #define pthread_mutex_lock _lwp_mutex_lock #define pthread_mutex_trylock _lwp_mutex_trylock #define pthread_mutex_unlock _lwp_mutex_unlock #endif #ifdef HAVE_MUTEX_UI_THREADS #define pthread_cond_signal cond_signal #define pthread_cond_wait cond_wait #define pthread_mutex_lock mutex_lock #define pthread_mutex_trylock mutex_trylock #define pthread_mutex_unlock mutex_unlock #endif /* * CDB___db_pthread_mutex_init -- * Initialize a MUTEX. * * PUBLIC: int CDB___db_pthread_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); */ int CDB___db_pthread_mutex_init(dbenv, mutexp, flags) DB_ENV *dbenv; MUTEX *mutexp; u_int32_t flags; { int ret; ret = 0; memset(mutexp, 0, sizeof(*mutexp)); /* * If this is a thread lock or the process has told us that there are * no other processes in the environment, use thread-only locks, they * are faster in some cases. * * This is where we decide to ignore locks we don't need to set -- if * the application isn't threaded, there aren't any threads to block. */ if (LF_ISSET(MUTEX_THREAD) || F_ISSET(dbenv, DB_ENV_PRIVATE)) { if (!F_ISSET(dbenv, DB_ENV_THREAD)) { F_SET(mutexp, MUTEX_IGNORE); return (0); } F_SET(mutexp, MUTEX_THREAD); } #ifdef HAVE_MUTEX_PTHREADS { pthread_condattr_t condattr, *condattrp = NULL; pthread_mutexattr_t mutexattr, *mutexattrp = NULL; if (!F_ISSET(mutexp, MUTEX_THREAD)) { ret = pthread_condattr_init(&condattr); if (ret == 0) ret = pthread_condattr_setpshared( &condattr, PTHREAD_PROCESS_SHARED); condattrp = &condattr; if (ret == 0) ret = pthread_mutexattr_init(&mutexattr); if (ret == 0) ret = pthread_mutexattr_setpshared( &mutexattr, PTHREAD_PROCESS_SHARED); mutexattrp = &mutexattr; } if (ret == 0) ret = pthread_mutex_init(&mutexp->mutex, mutexattrp); if (mutexattrp != NULL) pthread_mutexattr_destroy(mutexattrp); if (LF_ISSET(MUTEX_SELF_BLOCK)) { if (ret == 0) ret = pthread_cond_init(&mutexp->cond, condattrp); F_SET(mutexp, MUTEX_SELF_BLOCK); if (condattrp != NULL) pthread_condattr_destroy(condattrp); }} #endif #ifdef HAVE_MUTEX_SOLARIS_LWP if (F_ISSET(mutexp, MUTEX_THREAD)) { static lwp_mutex_t mi = DEFAULTMUTEX; /* * !!! * Gcc attempts to use special Sparc instructions to do a fast * copy of the structures, but the structures aren't * necessarily appropriately aligned for the Sparc instructions * to work. We don't use memcpy instead of structure assignment * because gcc figures that one out and drops core anyway. */ CDB___ua_memcpy(&mutexp->mutex, &mi, sizeof(mi)); } else { static lwp_mutex_t mi = SHAREDMUTEX; CDB___ua_memcpy(&mutexp->mutex, &mi, sizeof(mi)); } if (LF_ISSET(MUTEX_SELF_BLOCK)) { if (F_ISSET(mutexp, MUTEX_THREAD)) { static lwp_cond_t ci = DEFAULTCV; CDB___ua_memcpy(&mutexp->cond, &ci, sizeof(ci)); } else { static lwp_cond_t ci = SHAREDCV; CDB___ua_memcpy(&mutexp->cond, &ci, sizeof(ci)); } F_SET(mutexp, MUTEX_SELF_BLOCK); } #endif #ifdef HAVE_MUTEX_UI_THREADS { int type; type = F_ISSET(mutexp, MUTEX_THREAD) ? USYNC_THREAD : USYNC_PROCESS; ret = mutex_init(&mutexp->mutex, type, NULL); if (ret == 0 && LF_ISSET(MUTEX_SELF_BLOCK)) { ret = cond_init(&mutexp->cond, type, NULL); F_SET(mutexp, MUTEX_SELF_BLOCK); }} #endif mutexp->spins = CDB___os_spin(); return (ret); } /* * CDB___db_pthread_mutex_lock * Lock on a mutex, logically blocking if necessary. * * PUBLIC: int CDB___db_pthread_mutex_lock __P((MUTEX *)); */ int CDB___db_pthread_mutex_lock(mutexp) MUTEX *mutexp; { u_int32_t nspins; int ret, waited; if (!DB_GLOBAL(db_mutexlocks) || F_ISSET(mutexp, MUTEX_IGNORE)) return (0); /* Attempt to acquire the resource for N spins. */ for (nspins = mutexp->spins; nspins > 0; --nspins) if (pthread_mutex_trylock(&mutexp->mutex) == 0) break; if (nspins == 0 && (ret = pthread_mutex_lock(&mutexp->mutex)) != 0) return (ret); if (F_ISSET(mutexp, MUTEX_SELF_BLOCK)) { for (waited = 0; mutexp->locked != 0; waited = 1) { ret = pthread_cond_wait(&mutexp->cond, &mutexp->mutex); /* * !!! * Solaris bug workaround: * pthread_cond_wait() sometimes returns ETIME -- out * of sheer paranoia, check both ETIME and ETIMEDOUT. * We believe this happens when the application uses * SIGALRM for some purpose, e.g., the C library sleep * call, and Solaris delivers the signal to the wrong * LWP. */ if (ret != 0 && ret != ETIME && ret != ETIMEDOUT) return (ret); } if (waited) ++mutexp->mutex_set_wait; else ++mutexp->mutex_set_nowait; #ifdef DIAGNOSTIC mutexp->locked = (u_int32_t)pthread_self(); #else mutexp->locked = 1; #endif if ((ret = pthread_mutex_unlock(&mutexp->mutex)) != 0) return (ret); } else { if (nspins == mutexp->spins) ++mutexp->mutex_set_nowait; else ++mutexp->mutex_set_wait; #ifdef DIAGNOSTIC if (mutexp->locked) { char msgbuf[128]; (void)snprintf(msgbuf, sizeof(msgbuf), MSG1, (u_long)mutexp->locked); (void)write(STDERR_FILENO, msgbuf, strlen(msgbuf)); } mutexp->locked = (u_int32_t)pthread_self(); #else mutexp->locked = 1; #endif } return (0); } /* * CDB___db_pthread_mutex_unlock -- * Release a lock. * * PUBLIC: int CDB___db_pthread_mutex_unlock __P((MUTEX *)); */ int CDB___db_pthread_mutex_unlock(mutexp) MUTEX *mutexp; { int ret; if (!DB_GLOBAL(db_mutexlocks) || F_ISSET(mutexp, MUTEX_IGNORE)) return (0); #ifdef DIAGNOSTIC if (!mutexp->locked) (void)write(STDERR_FILENO, MSG2, sizeof(MSG2) - 1); #endif if (F_ISSET(mutexp, MUTEX_SELF_BLOCK)) { if ((ret = pthread_mutex_lock(&mutexp->mutex)) != 0) return (ret); mutexp->locked = 0; if ((ret = pthread_mutex_unlock(&mutexp->mutex)) != 0) return (ret); if ((ret = pthread_cond_signal(&mutexp->cond)) != 0) return (ret); } else { mutexp->locked = 0; if ((ret = pthread_mutex_unlock(&mutexp->mutex)) != 0) return (ret); } return (0); } #endif /* HAVE_MUTEX_PTHREAD */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mut_tas.c��������������������������������������������������������������������������0100644�0063146�0012731�00000006653�10000513630�014566� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifdef HAVE_MUTEX_TAS #ifndef lint static const char sccsid[] = "@(#)mut_tas.c 11.4 (Sleepycat) 10/1/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #ifdef HAVE_MUTEX_68K_GCC_ASSEMBLY #include "68K.gcc" #endif #ifdef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY #include "alpha.gcc" #endif #ifdef HAVE_MUTEX_HPPA_GCC_ASSEMBLY #include "parisc.gcc" #endif #ifdef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY #include "sco.cc" #endif #ifdef HAVE_MUTEX_SPARC_GCC_ASSEMBLY #include "sparc.gcc" #endif #ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY #include "x86.gcc" #endif #ifdef DIAGNOSTIC #undef MSG1 #define MSG1 "mutex_lock: ERROR: lock currently in use: pid: %lu.\n" #undef MSG2 #define MSG2 "mutex_unlock: ERROR: lock already unlocked\n" #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #endif /* * CDB___db_tas_mutex_init -- * Initialize a MUTEX. * * PUBLIC: int CDB___db_tas_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); */ int CDB___db_tas_mutex_init(dbenv, mutexp, flags) DB_ENV *dbenv; MUTEX *mutexp; u_int32_t flags; { memset(mutexp, 0, sizeof(*mutexp)); /* * If this is a thread lock or the process has told us that there are * no other processes in the environment, use thread-only locks, they * are faster in some cases. * * This is where we decide to ignore locks we don't need to set -- if * the application isn't threaded, there aren't any threads to block. */ if (LF_ISSET(MUTEX_THREAD) || F_ISSET(dbenv, DB_ENV_PRIVATE)) { if (!F_ISSET(dbenv, DB_ENV_THREAD)) { F_SET(mutexp, MUTEX_IGNORE); return (0); } F_SET(mutexp, MUTEX_THREAD); } /* Initialize the lock. */ if (MUTEX_INIT(&mutexp->tas)) return (CDB___os_get_errno()); mutexp->spins = CDB___os_spin(); return (0); } /* * CDB___db_tas_mutex_lock * Lock on a mutex, logically blocking if necessary. * * PUBLIC: int CDB___db_tas_mutex_lock __P((MUTEX *)); */ int CDB___db_tas_mutex_lock(mutexp) MUTEX *mutexp; { u_long ms; int nspins; if (!DB_GLOBAL(db_mutexlocks) || F_ISSET(mutexp, MUTEX_IGNORE)) return (0); ms = 1; loop: /* Attempt to acquire the resource for N spins. */ for (nspins = mutexp->spins; nspins > 0; --nspins) { if (!MUTEX_SET(&mutexp->tas)) continue; #ifdef DIAGNOSTIC if (mutexp->locked != 0) { char msgbuf[128]; (void)snprintf(msgbuf, sizeof(msgbuf), MSG1, (u_long)mutexp->locked); (void)write(STDERR_FILENO, msgbuf, strlen(msgbuf)); } mutexp->locked = (u_int32_t)getpid(); #endif if (ms == 1) ++mutexp->mutex_set_nowait; else ++mutexp->mutex_set_wait; return (0); } /* Yield the processor; wait 1ms initially, up to 1 second. */ CDB___os_yield(ms * USEC_PER_MS); if ((ms <<= 1) > MS_PER_SEC) ms = MS_PER_SEC; goto loop; } /* * CDB___db_tas_mutex_unlock -- * Release a lock. * * PUBLIC: int CDB___db_tas_mutex_unlock __P((MUTEX *)); */ int CDB___db_tas_mutex_unlock(mutexp) MUTEX *mutexp; { if (!DB_GLOBAL(db_mutexlocks) || F_ISSET(mutexp, MUTEX_IGNORE)) return (0); #ifdef DIAGNOSTIC if (!mutexp->locked) (void)write(STDERR_FILENO, MSG2, sizeof(MSG2) - 1); mutexp->locked = 0; #endif MUTEX_UNSET(&mutexp->tas); return (0); } #endif /* HAVE_MUTEX_TAS */ �������������������������������������������������������������������������������������htdig-3.2.0b6/db/mutex.c����������������������������������������������������������������������������0100644�0063146�0012731�00000002717�07427026535�014277� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)mutex.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" /* * CDB___db_mutex_alloc -- * Allocate and initialize a mutex. * * PUBLIC: int CDB___db_mutex_alloc __P((DB_ENV *, REGINFO *, MUTEX **)); */ int CDB___db_mutex_alloc(dbenv, infop, storep) DB_ENV *dbenv; REGINFO *infop; MUTEX **storep; { int ret; /* * If the architecture supports mutex in heap memory, simply * use that memory. If it doesn't, we have to allocate space * in the region. */ #ifdef MUTEX_NO_MALLOC_LOCKS R_LOCK(dbenv, infop); ret = CDB___db_shalloc(infop->addr, sizeof(MUTEX), MUTEX_ALIGN, storep); R_UNLOCK(dbenv, infop); #else COMPQUIET(dbenv, NULL); COMPQUIET(infop, NULL); ret = CDB___os_calloc(1, sizeof(MUTEX), storep); #endif return (ret); } /* * CDB___db_mutex_free -- * Free a mutex. * * PUBLIC: void CDB___db_mutex_free __P((DB_ENV *, REGINFO *, MUTEX *)); */ void CDB___db_mutex_free(dbenv, infop, mutexp) DB_ENV *dbenv; REGINFO *infop; MUTEX *mutexp; { #ifdef MUTEX_NO_MALLOC_LOCKS R_LOCK(dbenv, infop); CDB___db_shalloc_free(infop->addr, mutexp); R_UNLOCK(dbenv, infop); #else COMPQUIET(dbenv, NULL); COMPQUIET(infop, NULL); CDB___os_free(mutexp, sizeof(*mutexp)); #endif } �������������������������������������������������htdig-3.2.0b6/db/mutex.h����������������������������������������������������������������������������0100644�0063146�0012731�00000030232�07427026535�014275� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)mutex.h 11.6 (Sleepycat) 10/15/99 */ /********************************************************************* * POSIX.1 pthreads interface. *********************************************************************/ #ifdef HAVE_MUTEX_PTHREADS #include <pthread.h> #define MUTEX_FIELDS \ pthread_mutex_t mutex; /* Mutex. */ \ pthread_cond_t cond; /* Condition variable. */ #endif /********************************************************************* * Solaris lwp threads interface. * * !!! * We use LWP mutexes on Solaris instead of UI or POSIX mutexes (both of * which are available), for two reasons. First, the Solaris C library * includes versions of the both UI and POSIX thread mutex interfaces, but * they are broken in that they don't support inter-process locking, and * there's no way to detect it, e.g., calls to configure the mutexes for * inter-process locking succeed without error. So, we use LWP mutexes so * that we don't fail in fairly undetectable ways because the application * wasn't linked with the appropriate threads library. Second, there were * bugs in SunOS 5.7 (Solaris 7) where if an application loaded the C library * before loading the libthread/libpthread threads libraries (e.g., by using * dlopen to load the DB library), the pwrite64 interface would be translated * into a call to pwrite and DB would drop core. *********************************************************************/ #ifdef HAVE_MUTEX_SOLARIS_LWP #include <synch.h> #define MUTEX_FIELDS \ lwp_mutex_t mutex; /* Mutex. */ \ lwp_cond_t cond; /* Condition variable. */ #endif /********************************************************************* * Solaris/Unixware threads interface. *********************************************************************/ #ifdef HAVE_MUTEX_UI_THREADS #include <thread.h> #include <synch.h> #define MUTEX_FIELDS \ mutex_t mutex; /* Mutex. */ \ cond_t cond; /* Condition variable. */ #endif /********************************************************************* * AIX C library functions. *********************************************************************/ #ifdef HAVE_MUTEX_AIX_CHECK_LOCK #include <sys/atomic_op.h> typedef int tsl_t; #define MUTEX_ALIGN sizeof(int) #define MUTEX_SET(x) (!_check_lock(x, 0, 1)) #define MUTEX_UNSET(x) _clear_lock(x, 0) #endif /********************************************************************* * General C library functions (msemaphore). * * !!! * Check for HPPA as a special case, because it requires unusual alignment, * and doesn't support semaphores in malloc(3) or shmget(2) memory. * * !!! * Do not remove the MSEM_IF_NOWAIT flag. The problem is that if a single * process makes two msem_lock() calls in a row, the second one returns an * error. We depend on the fact that we can lock against ourselves in the * locking subsystem, where we set up a mutex so that we can block ourselves. * Tested on OSF1 v4.0. *********************************************************************/ #ifdef HAVE_MUTEX_HPPA_MSEM_INIT #define MUTEX_NO_MALLOC_LOCKS #define MUTEX_NO_SHMGET_LOCKS #define MUTEX_ALIGN 16 #endif #if defined(HAVE_MUTEX_MSEM_INIT) || defined(HAVE_MUTEX_HPPA_MSEM_INIT) #include <sys/mman.h> typedef msemaphore tsl_t; #ifndef MUTEX_ALIGN #define MUTEX_ALIGN sizeof(int) #endif #define MUTEX_INIT(x) (msem_init(x, MSEM_UNLOCKED) == NULL) #define MUTEX_SET(x) (!msem_lock(x, MSEM_IF_NOWAIT)) #define MUTEX_UNSET(x) msem_unlock(x, 0) #endif /********************************************************************* * MacOS. * * !!! * We should simplify this by always returning a no-need-to-lock lock * when we initialize the mutex. *********************************************************************/ #ifdef HAVE_MUTEX_MACOS typedef unsigned char tsl_t; #define MUTEX_INIT(x) 0 #endif /********************************************************************* * Reliant UNIX C library functions. *********************************************************************/ #ifdef HAVE_MUTEX_RELIANTUNIX_INITSPIN #include <ulocks.h> typedef spinlock_t tsl_t; #define MUTEX_INIT(x) initspin(x, 1) #define MUTEX_SET(x) (cspinlock(x) == 0) #define MUTEX_UNSET(x) spinunlock(x) #endif /********************************************************************* * General C library functions (POSIX 1003.1 sema_XXX). * * !!! * Never selected by autoconfig in this release (semaphore calls are known * to not work in Solaris 5.5). *********************************************************************/ #ifdef HAVE_MUTEX_SEMA_INIT #include <synch.h> typedef sema_t tsl_t; #define MUTEX_ALIGN sizeof(int) #define MUTEX_INIT(x) (sema_init(x, 1, USYNC_PROCESS, NULL) != 0) #define MUTEX_SET(x) (sema_wait(x) == 0) #define MUTEX_UNSET(x) sema_post(x) #endif /********************************************************************* * SGI C library functions. *********************************************************************/ #ifdef HAVE_MUTEX_SGI_INIT_LOCK #include <abi_mutex.h> typedef abilock_t tsl_t; #define MUTEX_ALIGN sizeof(int) #define MUTEX_INIT(x) (init_lock(x) != 0) #define MUTEX_SET(x) (!acquire_lock(x)) #define MUTEX_UNSET(x) release_lock(x) #endif /********************************************************************* * Solaris C library functions. * * !!! * These are undocumented functions, but they're the only ones that work * correctly as far as we know. *********************************************************************/ #ifdef HAVE_MUTEX_SOLARIS_LOCK_TRY #include <sys/machlock.h> typedef lock_t tsl_t; #define MUTEX_ALIGN sizeof(int) #define MUTEX_INIT(x) 0 #define MUTEX_SET(x) _lock_try(x) #define MUTEX_UNSET(x) _lock_clear(x) #endif /********************************************************************* * VMS. *********************************************************************/ #ifdef HAVE_MUTEX_VMS #include <sys/mman.h>; #include <builtins.h> typedef unsigned char tsl_t; #define MUTEX_ALIGN sizeof(unsigned int) #ifdef __ALPHA #define MUTEX_SET(tsl) (!__TESTBITSSI(tsl, 0)) #else /* __VAX */ #define MUTEX_SET(tsl) (!(int)_BBSSI(0, tsl)) #endif #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) #endif /********************************************************************* * Win16 * * Win16 spinlocks are simple because we cannot possibly be preempted. * * !!! * We should simplify this by always returning a no-need-to-lock lock * when we initialize the mutex. *********************************************************************/ #ifdef HAVE_MUTEX_WIN16 typedef unsigned int tsl_t; #define MUTEX_ALIGN sizeof(unsigned int) #define MUTEX_INIT(x) 0 #define MUTEX_SET(tsl) (*(tsl) = 1) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #endif /********************************************************************* * Win32 * * XXX * DBDB this needs to be byte-aligned!! *********************************************************************/ #ifdef HAVE_MUTEX_WIN32 typedef unsigned int tsl_t; #define MUTEX_ALIGN sizeof(unsigned int) #define MUTEX_INIT(x) 0 #define MUTEX_SET(tsl) (!InterlockedExchange((PLONG)tsl, 1)) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #endif /********************************************************************* * 68K/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_68K_GCC_ASSEMBLY typedef unsigned char tsl_t; #endif /********************************************************************* * ALPHA/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY typedef u_int32_t tsl_t; #define MUTEX_ALIGN 4 #endif /********************************************************************* * HPPA/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_HPPA_GCC_ASSEMBLY typedef u_int32_t tsl_t; #define MUTEX_ALIGN 16 #endif /********************************************************************* * SCO/cc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY typedef unsigned char tsl_t; #endif /********************************************************************* * Sparc/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_SPARC_GCC_ASSEMBLY typedef unsigned char tsl_t; #endif /********************************************************************* * UTS/cc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_UTS_CC_ASSEMBLY typedef int tsl_t; #define MUTEX_ALIGN sizeof(int) #define MUTEX_INIT(x) 0 #define MUTEX_SET(x) (!uts_lock(x, 1)) #define MUTEX_UNSET(x) (*(x) = 0) #endif /********************************************************************* * x86/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY typedef unsigned char tsl_t; #endif /* * Mutex alignment defaults to one byte. * * !!! * Various systems require different alignments for mutexes (the worst we've * seen so far is 16-bytes on some HP architectures). Malloc(3) is assumed * to return reasonable alignment, all other mutex users must ensure proper * alignment locally. */ #ifndef MUTEX_ALIGN #define MUTEX_ALIGN 1 #endif #define MUTEX_IGNORE 0x001 /* Ignore, no lock required. */ #define MUTEX_SELF_BLOCK 0x002 /* Must block self. */ #define MUTEX_THREAD 0x004 /* Thread-only mutex. */ /* Mutex. */ struct __mutex_t { #ifdef HAVE_MUTEX_THREADS #ifdef MUTEX_FIELDS MUTEX_FIELDS #else tsl_t tas; /* Test and set. */ #endif u_int32_t spins; /* Spins before block. */ u_int32_t locked; /* !0 if locked. */ #else u_int32_t off; /* Byte offset to lock. */ u_int32_t pid; /* Lock holder: 0 or process pid. */ #endif u_int32_t mutex_set_wait; /* Granted after wait. */ u_int32_t mutex_set_nowait; /* Granted without waiting. */ u_int8_t flags; /* MUTEX_XXX */ }; /* Redirect calls to the correct functions. */ #ifdef HAVE_MUTEX_THREADS #if defined(HAVE_MUTEX_PTHREADS) || defined(HAVE_MUTEX_SOLARIS_LWP) || defined(HAVE_MUTEX_UI_THREADS) #define __db_mutex_init(a, b, c, d) CDB___db_pthread_mutex_init(a, b, d) #define __db_mutex_lock(a, b) CDB___db_pthread_mutex_lock(a) #define __db_mutex_unlock(a) CDB___db_pthread_mutex_unlock(a) #else #define __db_mutex_init(a, b, c, d) CDB___db_tas_mutex_init(a, b, d) #define __db_mutex_lock(a, b) CDB___db_tas_mutex_lock(a) #define __db_mutex_unlock(a) CDB___db_tas_mutex_unlock(a) #endif #else #define __db_mutex_init(a, b, c, d) CDB___db_fcntl_mutex_init(a, b, c) #define __db_mutex_lock(a, b) CDB___db_fcntl_mutex_lock(a, b) #define __db_mutex_unlock(a) CDB___db_fcntl_mutex_unlock(a) #endif /* * Lock/unlock a mutex. If the mutex was marked as uninteresting, the thread * of control can proceed without it. * * If the lock is for threads-only, then it was optionally not allocated and * file handles aren't necessary, as threaded applications aren't supported by * fcntl(2) locking. */ #define MUTEX_LOCK(mp, fh) \ if (!F_ISSET((MUTEX *)(mp), MUTEX_IGNORE)) \ (void)__db_mutex_lock(mp, fh); #define MUTEX_UNLOCK(mp) \ if (!F_ISSET((MUTEX *)(mp), MUTEX_IGNORE)) \ (void)__db_mutex_unlock(mp); #define MUTEX_THREAD_LOCK(mp) \ if (mp != NULL) \ MUTEX_LOCK(mp, NULL) #define MUTEX_THREAD_UNLOCK(mp) \ if (mp != NULL) \ MUTEX_UNLOCK(mp) /* * We use a single file descriptor for fcntl(2) locking, and (generally) the * object's offset in a shared region as the byte that we're locking. So, * there's a (remote) possibility that two objects might have the same offsets * such that the locks could conflict, resulting in deadlock. To avoid this * possibility, we offset the region offset by a small integer value, using a * different offset for each subsystem's locks. Since all region objects are * suitably aligned, the offset guarantees that we don't collide with another * region's objects. */ #define DB_FCNTL_OFF_GEN 0 /* Everything else. */ #define DB_FCNTL_OFF_LOCK 1 /* Lock subsystem offset. */ #define DB_FCNTL_OFF_MPOOL 2 /* Mpool subsystem offset. */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mutex_ext.h������������������������������������������������������������������������0100644�0063146�0012731�00000001350�07427026535�015154� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _mutex_ext_h_ #define _mutex_ext_h_ int CDB___db_fcntl_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); int CDB___db_fcntl_mutex_lock __P((MUTEX *, DB_FH *)); int CDB___db_fcntl_mutex_unlock __P((MUTEX *)); int CDB___db_pthread_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); int CDB___db_pthread_mutex_lock __P((MUTEX *)); int CDB___db_pthread_mutex_unlock __P((MUTEX *)); int CDB___db_tas_mutex_init __P((DB_ENV *, MUTEX *, u_int32_t)); int CDB___db_tas_mutex_lock __P((MUTEX *)); int CDB___db_tas_mutex_unlock __P((MUTEX *)); int CDB___db_mutex_alloc __P((DB_ENV *, REGINFO *, MUTEX **)); void CDB___db_mutex_free __P((DB_ENV *, REGINFO *, MUTEX *)); #endif /* _mutex_ext_h_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os.h�������������������������������������������������������������������������������0100644�0063146�0012731�00000002020�10000513630�013520� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)os.h 11.1 (Sleepycat) 7/25/99 */ #if defined(_MSC_VER) #include <windows.h> #endif /* * Filehandle. */ struct __fh_t { #if defined(_MSC_VER) /* _WIN32 */ HANDLE handle; /* Windows/32 file handle. */ #endif int fd; /* POSIX file descriptor. */ u_int32_t log_size; /* XXX: Log file size. */ #define DB_FH_NOSYNC 0x01 /* Handle doesn't need to be sync'd. */ #define DB_FH_VALID 0x02 /* Handle is valid. */ u_int8_t flags; }; /* * We group certain seek/write calls into a single function so that we * can use pread(2)/pwrite(2) where they're available. */ #define DB_IO_READ 1 #define DB_IO_WRITE 2 typedef struct __io_t { DB_FH *fhp; /* I/O file handle. */ MUTEX *mutexp; /* Mutex to lock. */ size_t pagesize; /* Page size. */ db_pgno_t pgno; /* Page number. */ u_int8_t *buf; /* Buffer. */ size_t bytes; /* Bytes read/written. */ } DB_IO; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_abs.c���������������������������������������������������������������������������0100644�0063146�0012731�00000001327�10062720744�014367� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_abs.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" /* * CDB___os_abspath -- * Return if a path is an absolute path. * * PUBLIC: int CDB___os_abspath __P((const char *)); */ int CDB___os_abspath(path) const char *path; { #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || defined (__CYGWIN__) return (path[0] == '/' || path[0] == '\\' || path [1] == ':'); #else return (path[0] == '/'); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_alloc.c�������������������������������������������������������������������������0100644�0063146�0012731�00000016035�07427026535�014726� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_alloc.c 11.6 (Sleepycat) 11/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #include <stdlib.h> #endif #include "db_int.h" #include "os_jump.h" #ifdef DIAGNOSTIC static void __os_guard __P((void)); #endif /* * !!! * Correct for systems that return NULL when you allocate 0 bytes of memory. * There are several places in DB where we allocate the number of bytes held * by the key/data item, and it can be 0. Correct here so that malloc never * returns a NULL for that reason (which behavior is permitted by ANSI). We * could make these calls macros on non-Alpha architectures (that's where we * saw the problem), but it's probably not worth the autoconf complexity. * * !!! * Correct for systems that don't set errno when malloc and friends fail. * * Out of memory. * We wish to hold the whole sky, * But we never will. */ /* * CDB___os_strdup -- * The strdup(3) function for DB. * * PUBLIC: int CDB___os_strdup __P((const char *, void *)); */ int CDB___os_strdup(str, storep) const char *str; void *storep; { size_t size; int ret; void *p; *(void **)storep = NULL; size = strlen(str) + 1; if ((ret = CDB___os_malloc(size, NULL, &p)) != 0) return (ret); memcpy(p, str, size); *(void **)storep = p; return (0); } /* * CDB___os_calloc -- * The calloc(3) function for DB. * * PUBLIC: int CDB___os_calloc __P((size_t, size_t, void *)); */ int CDB___os_calloc(num, size, storep) size_t num, size; void *storep; { void *p; int ret; size *= num; if ((ret = CDB___os_malloc(size, NULL, &p)) != 0) return (ret); memset(p, 0, size); *(void **)storep = p; return (0); } /* * CDB___os_malloc -- * The malloc(3) function for DB. * * PUBLIC: int CDB___os_malloc __P((size_t, void *(*)(size_t), void *)); */ int CDB___os_malloc(size, db_malloc, storep) size_t size; void *(*db_malloc) __P((size_t)), *storep; { void *p; *(void **)storep = NULL; /* Never allocate 0 bytes -- some C libraries don't like it. */ if (size == 0) ++size; #ifdef DIAGNOSTIC else ++size; /* Add room for a guard byte. */ #endif /* Some C libraries don't correctly set errno when malloc(3) fails. */ CDB___os_set_errno(0); if (db_malloc != NULL) p = db_malloc(size); else if (CDB___db_jump.j_malloc != NULL) p = CDB___db_jump.j_malloc(size); else p = malloc(size); if (p == NULL) { if (CDB___os_get_errno() == 0) CDB___os_set_errno(ENOMEM); return (CDB___os_get_errno()); } #ifdef DIAGNOSTIC /* * Guard bytes: if #DIAGNOSTIC is defined, we allocate an additional * byte after the memory and set it to a special value that we check * for when the memory is free'd. This is fine for structures, but * not quite so fine for strings. There are places in DB where memory * is allocated sufficient to hold the largest possible string that * we'll see, and then only some subset of the memory is used. To * support this usage, the CDB___os_freestr() function checks the byte * after the string's nul, which may or may not be the last byte in * the originally allocated memory. */ memset(p, CLEAR_BYTE, size); /* Initialize guard byte. */ #endif *(void **)storep = p; return (0); } /* * CDB___os_realloc -- * The realloc(3) function for DB. * * PUBLIC: int CDB___os_realloc __P((size_t, void *(*)(void *, size_t), void *)); */ int CDB___os_realloc(size, db_realloc, storep) size_t size; void *(*db_realloc) __P((void *, size_t)), *storep; { void *p, *ptr; ptr = *(void **)storep; /* If we haven't yet allocated anything yet, simply call malloc. */ if (ptr == NULL && db_realloc == NULL) return (CDB___os_malloc(size, NULL, storep)); /* Never allocate 0 bytes -- some C libraries don't like it. */ if (size == 0) ++size; #ifdef DIAGNOSTIC else ++size; /* Add room for a guard byte. */ #endif /* * Some C libraries don't correctly set errno when realloc(3) fails. * * Don't overwrite the original pointer, there are places in DB we * try to continue after realloc fails. */ CDB___os_set_errno(0); if (db_realloc != NULL) p = db_realloc(ptr, size); if (CDB___db_jump.j_realloc != NULL) p = CDB___db_jump.j_realloc(ptr, size); else p = realloc(ptr, size); if (p == NULL) { if (CDB___os_get_errno() == 0) CDB___os_set_errno(ENOMEM); return (CDB___os_get_errno()); } #ifdef DIAGNOSTIC ((u_int8_t *)p)[size - 1] = CLEAR_BYTE; /* Initialize guard byte. */ #endif *(void **)storep = p; return (0); } /* * CDB___os_free -- * The free(3) function for DB. * * PUBLIC: void CDB___os_free __P((void *, size_t)); */ void CDB___os_free(ptr, size) void *ptr; size_t size; { #ifdef DIAGNOSTIC if (size != 0) { /* * Check that the guard byte (one past the end of the memory) is * still CLEAR_BYTE. */ if (((u_int8_t *)ptr)[size] != CLEAR_BYTE) __os_guard(); /* Clear memory. */ if (size != 0) memset(ptr, CLEAR_BYTE, size); } #else COMPQUIET(size, 0); #endif if (CDB___db_jump.j_free != NULL) CDB___db_jump.j_free(ptr); else free(ptr); } /* * CDB___os_freestr -- * The free(3) function for DB, freeing a string. * * PUBLIC: void CDB___os_freestr __P((void *)); */ void CDB___os_freestr(ptr) void *ptr; { #ifdef DIAGNOSTIC size_t size; size = strlen(ptr) + 1; /* * Check that the guard byte (one past the end of the memory) is * still CLEAR_BYTE. */ if (((u_int8_t *)ptr)[size] != CLEAR_BYTE) __os_guard(); /* Clear memory. */ memset(ptr, CLEAR_BYTE, size); #endif if (CDB___db_jump.j_free != NULL) CDB___db_jump.j_free(ptr); else free(ptr); } #ifdef DIAGNOSTIC /* * __os_guard -- * Complain and abort. */ static void __os_guard() { /* * Eventually, once we push a DB_ENV handle down to these * routines, we should use the standard output channels. */ fprintf(stderr, "Guard byte incorrect during free.\n"); abort(); /* NOTREACHED */ } #endif /* * __ua_copy -- * Copy memory to memory without relying on any kind of alignment. * * There are places in DB that we have unaligned data, for example, * when we've stored a structure in a log record as a DBT, and now * we want to look at it. Unfortunately, if you have code like: * * struct a { * int x; * } *p; * * void *func_argument; * int local; * * p = (struct a *)func_argument; * memcpy(&local, p->x, sizeof(local)); * * some compilers optimize to use instructions that require alignment. * It's a compiler bug, but it's a pretty common one. * * Casting the memcpy arguments to (u_int8_t *) appears to work most * of the time, but we've seen examples where it wasn't sufficient * and there's nothing in ANSI C that requires it. * * PUBLIC: void *CDB___ua_memcpy __P((void *, const void *, size_t)); */ void * CDB___ua_memcpy(dst, src, len) void *dst; const void *src; size_t len; { return (memcpy(dst, src, len)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_dir.c���������������������������������������������������������������������������0100644�0063146�0012731�00000003742�10000513630�014365� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_dir.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if HAVE_DIRENT_H # include <dirent.h> # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include <sys/ndir.h> # endif # if HAVE_SYS_DIR_H # include <sys/dir.h> # endif # if HAVE_NDIR_H # include <ndir.h> # endif #endif #endif #ifdef _MSC_VER /* _WIN32 */ #include "dirent_local.h" #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_dirlist -- * Return a list of the files in a directory. * * PUBLIC: int CDB___os_dirlist __P((const char *, char ***, int *)); */ int CDB___os_dirlist(dir, namesp, cntp) const char *dir; char ***namesp; int *cntp; { struct dirent *dp; DIR *dirp; int arraysz, cnt, ret; char **names; if (CDB___db_jump.j_dirlist != NULL) return (CDB___db_jump.j_dirlist(dir, namesp, cntp)); if ((dirp = opendir(dir)) == NULL) return (CDB___os_get_errno()); names = NULL; for (arraysz = cnt = 0; (dp = readdir(dirp)) != NULL; ++cnt) { if (cnt >= arraysz) { arraysz += 100; if ((ret = CDB___os_realloc( arraysz * sizeof(names[0]), NULL, &names)) != 0) goto nomem; } if ((ret = CDB___os_strdup(dp->d_name, &names[cnt])) != 0) goto nomem; } (void)closedir(dirp); *namesp = names; *cntp = cnt; return (0); nomem: if (names != NULL) CDB___os_dirfree(names, cnt); return (ret); } /* * CDB___os_dirfree -- * Free the list of files. * * PUBLIC: void CDB___os_dirfree __P((char **, int)); */ void CDB___os_dirfree(names, cnt) char **names; int cnt; { if (CDB___db_jump.j_dirfree != NULL) CDB___db_jump.j_dirfree(names, cnt); while (cnt > 0) CDB___os_free(names[--cnt], 0); CDB___os_free(names, 0); } ������������������������������htdig-3.2.0b6/db/os_errno.c�������������������������������������������������������������������������0100644�0063146�0012731�00000001352�07427026535�014755� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_errno.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <errno.h> #endif #include "db_int.h" /* * CDB___os_get_errno -- * Return the value of errno. * * PUBLIC: int CDB___os_get_errno __P((void)); */ int CDB___os_get_errno() { /* This routine must be able to return the same value repeatedly. */ return (errno); } /* * CDB___os_set_errno -- * Set the value of errno. * * PUBLIC: void CDB___os_set_errno __P((int)); */ void CDB___os_set_errno(evalue) int evalue; { errno = evalue; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_ext.h���������������������������������������������������������������������������0100644�0063146�0012731�00000004621�07427026535�014437� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _os_ext_h_ #define _os_ext_h_ int CDB___os_abspath __P((const char *)); int CDB___os_strdup __P((const char *, void *)); int CDB___os_calloc __P((size_t, size_t, void *)); int CDB___os_malloc __P((size_t, void *(*)(size_t), void *)); int CDB___os_realloc __P((size_t, void *(*)(void *, size_t), void *)); void CDB___os_free __P((void *, size_t)); void CDB___os_freestr __P((void *)); void *CDB___ua_memcpy __P((void *, const void *, size_t)); int CDB___os_dirlist __P((const char *, char ***, int *)); void CDB___os_dirfree __P((char **, int)); int CDB___os_get_errno __P((void)); void CDB___os_set_errno __P((int)); int CDB___os_fileid __P((DB_ENV *, const char *, int, u_int8_t *)); int CDB___os_finit __P((DB_FH *, size_t, int)); int CDB___os_fpinit __P((DB_FH *, db_pgno_t, int, int)); int CDB___os_fsync __P((DB_FH *)); int CDB___os_openhandle __P((const char *, int, int, DB_FH *)); int CDB___os_closehandle __P((DB_FH *)); int CDB___os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *)); int CDB___os_r_sysdetach __P((DB_ENV *, REGINFO *, int)); int CDB___os_mapfile __P((DB_ENV *, char *, DB_FH *, size_t, int, void **)); int CDB___os_unmapfile __P((DB_ENV *, void *, size_t)); void CDB___os_dbenv_create __P((DB_ENV *)); u_int32_t CDB___db_oflags __P((int)); int CDB___db_omode __P((const char *)); int CDB___os_open __P((const char *, u_int32_t, int, DB_FH *)); int CDB___os_r_attach __P((DB_ENV *, REGINFO *, REGION *)); int CDB___os_r_detach __P((DB_ENV *, REGINFO *, int)); int CDB___os_rename __P((const char *, const char *)); int CDB___os_isroot __P((void)); char *CDB___db_rpath __P((const char *)); int CDB___os_io __P((DB_IO *, int, ssize_t *)); int CDB___os_read __P((DB_FH *, void *, size_t, ssize_t *)); int CDB___os_write __P((DB_FH *, void *, size_t, ssize_t *)); int CDB___os_seek __P((DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK)); int CDB___os_sleep __P((u_long, u_long)); int CDB___os_spin __P((void)); void CDB___os_yield __P((u_long)); int CDB___os_exists __P((const char *, int *)); int CDB___os_ioinfo __P((const char *, DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *)); int CDB___os_tmpdir __P((DB_ENV *, u_int32_t)); int CDB___os_unlink __P((const char *)); #if defined(_WIN32) int __os_win32_errno __P((void)); #endif int CDB___os_fpinit __P((DB_FH *, db_pgno_t, int, int)); int __os_is_winnt __P((void)); #endif /* _os_ext_h_ */ ���������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_fid.c���������������������������������������������������������������������������0100644�0063146�0012731�00000005320�07427026535�014371� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_fid.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <string.h> #endif #include "db_int.h" /* * CDB___os_fileid -- * Return a unique identifier for a file. * * PUBLIC: int CDB___os_fileid __P((DB_ENV *, const char *, int, u_int8_t *)); */ int CDB___os_fileid(dbenv, fname, timestamp, fidp) DB_ENV *dbenv; const char *fname; int timestamp; u_int8_t *fidp; { struct stat sb; size_t i; u_int32_t tmp; u_int8_t *p; /* Clear the buffer. */ memset(fidp, 0, DB_FILE_ID_LEN); /* On POSIX/UNIX, use a dev/inode pair. */ if (stat(fname, &sb)) { CDB___db_err(dbenv, "%s: %s", fname, strerror(CDB___os_get_errno())); return (CDB___os_get_errno()); } /* * !!! * Nothing is ever big enough -- on Sparc V9, st_ino, st_dev and the * time_t types are all 8 bytes. As DB_FILE_ID_LEN is only 20 bytes, * we convert to a (potentially) smaller fixed-size type and use it. * * We don't worry about byte sexing or the actual variable sizes. * * When this routine is called from the DB access methods, it's only * called once -- whatever ID is generated when a database is created * is stored in the database file's metadata, and that is what is * saved in the mpool region's information to uniquely identify the * file. * * When called from the mpool layer this routine will be called each * time a new thread of control wants to share the file, which makes * things tougher. As far as byte sexing goes, since the mpool region * lives on a single host, there's no issue of that -- the entire * region is byte sex dependent. As far as variable sizes go, we make * the simplifying assumption that 32-bit and 64-bit processes will * get the same 32-bit values if we truncate any returned 64-bit value * to a 32-bit value. */ tmp = (u_int32_t)sb.st_ino; for (p = (u_int8_t *)&tmp, i = sizeof(u_int32_t); i > 0; --i) *fidp++ = *p++; tmp = (u_int32_t)sb.st_dev; for (p = (u_int8_t *)&tmp, i = sizeof(u_int32_t); i > 0; --i) *fidp++ = *p++; if (timestamp) { /* * We want the number of seconds, not the high-order 0 bits, * so convert the returned time_t to a (potentially) smaller * fixed-size type. */ tmp = (u_int32_t)time(NULL); for (p = (u_int8_t *)&tmp, i = sizeof(u_int32_t); i > 0; --i) *fidp++ = *p++; } return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_finit.c�������������������������������������������������������������������������0100644�0063146�0012731�00000005166�07427026535�014750� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_finit.c 11.3 (Sleepycat) 9/22/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" /* * CDB___os_finit -- * Initialize a regular file, optionally zero-filling it as well. * * PUBLIC: int CDB___os_finit __P((DB_FH *, size_t, int)); */ int CDB___os_finit(fhp, size, zerofill) DB_FH *fhp; size_t size; int zerofill; { db_pgno_t pages; size_t i; ssize_t nw; u_int32_t relative; int ret; char buf[OS_VMPAGESIZE]; /* Write nuls to the new bytes. */ memset(buf, 0, sizeof(buf)); /* * Extend the region by writing the last page. If the region is >4Gb, * increment may be larger than the maximum possible seek "relative" * argument, as it's an unsigned 32-bit value. Break the offset into * pages of 1MB each so that we don't overflow (2^20 + 2^32 is bigger * than any memory I expect to see for awhile). */ if ((ret = CDB___os_seek(fhp, 0, 0, 0, 0, DB_OS_SEEK_END)) != 0) return (ret); pages = (size - OS_VMPAGESIZE) / MEGABYTE; relative = (size - OS_VMPAGESIZE) % MEGABYTE; if ((ret = CDB___os_seek(fhp, MEGABYTE, pages, relative, 0, DB_OS_SEEK_CUR)) != 0) return (ret); if ((ret = CDB___os_write(fhp, buf, sizeof(buf), &nw)) != 0) return (ret); if (nw != sizeof(buf)) return (EIO); /* * We may want to guarantee that there is enough disk space for the * file, so we also write a byte to each page. We write the byte * because reading it is insufficient on systems smart enough not to * instantiate disk pages to satisfy a read (e.g., Solaris). */ if (zerofill) { pages = size / MEGABYTE; relative = size % MEGABYTE; if ((ret = CDB___os_seek(fhp, MEGABYTE, pages, relative, 1, DB_OS_SEEK_END)) != 0) return (ret); /* Write a byte to each page. */ for (i = 0; i < size; i += OS_VMPAGESIZE) { if ((ret = CDB___os_write(fhp, buf, 1, &nw)) != 0) return (ret); if (nw != 1) return (EIO); if ((ret = CDB___os_seek(fhp, 0, 0, OS_VMPAGESIZE - 1, 0, DB_OS_SEEK_CUR)) != 0) return (ret); } } return (0); } /* * CDB___os_fpinit -- * Initialize a page in a regular file. * * PUBLIC: int CDB___os_fpinit __P((DB_FH *, db_pgno_t, int, int)); */ int CDB___os_fpinit(fhp, pgno, pagecount, pagesize) DB_FH *fhp; db_pgno_t pgno; int pagecount, pagesize; { COMPQUIET(fhp, NULL); COMPQUIET(pgno, 0); COMPQUIET(pagecount, 0); COMPQUIET(pagesize, 0); return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_fsync.c�������������������������������������������������������������������������0100644�0063146�0012731�00000002457�10000513630�014733� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_fsync.c 11.2 (Sleepycat) 9/22/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <fcntl.h> /* XXX: Required by __hp3000s900 */ #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" #ifdef _MSC_VER /* _WIN32 */ #include <io.h> #define fsync(fd) _commit(fd); #endif #ifdef __hp3000s900 int __mpe_fsync(fd) int fd; { extern FCONTROL(short, short, void *); FCONTROL(_MPE_FILENO(fd), 2, NULL); /* Flush the buffers */ FCONTROL(_MPE_FILENO(fd), 6, NULL); /* Write the EOF */ return (0); } #endif #ifdef __hp3000s900 #define fsync(fd) __mpe_fsync(fd); #endif /* * CDB___os_fsync -- * Flush a file descriptor. * * PUBLIC: int CDB___os_fsync __P((DB_FH *)); */ int CDB___os_fsync(fhp) DB_FH *fhp; { int ret; /* * Do nothing if the file descriptor has been marked as not requiring * any sync to disk. */ if (F_ISSET(fhp, DB_FH_NOSYNC)) return (0); ret = CDB___db_jump.j_fsync != NULL ? CDB___db_jump.j_fsync(fhp->fd) : fsync(fhp->fd); return (ret == 0 ? 0 : CDB___os_get_errno()); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_handle.c������������������������������������������������������������������������0100644�0063146�0012731�00000005166�10000513630�015044� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_handle.c 11.2 (Sleepycat) 11/12/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <fcntl.h> #include <string.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_openhandle -- * Open a file, using POSIX 1003.1 open flags. * * PUBLIC: int CDB___os_openhandle __P((const char *, int, int, DB_FH *)); */ int CDB___os_openhandle(name, flags, mode, fhp) const char *name; int flags, mode; DB_FH *fhp; { int ret, try; memset(fhp, 0, sizeof(*fhp)); for (ret = 0, try = 1; try < 4; ++try) { /* * !!! * Open with full sharing on VMS. * * We use these flags because they are the ones set by the VMS * CRTL mmap() call when it opens a file, and we have to be * able to open files that mmap() has previously opened, e.g., * when we're joining already existing DB regions. */ #ifdef _MSC_VER /* _WIN32 */ /* THIS IS A HACK TO REINSTATE BINARY MODE! FIX ME.. FIND THE PROBLEM*/ mode |= _O_BINARY; #endif fhp->fd = CDB___db_jump.j_open != NULL ? CDB___db_jump.j_open(name, flags, mode) : #ifdef __VMS open(name, flags, mode, "shr=get,put,upd,del,upi"); #else open(name, flags, mode); #endif /* DEBUGGING */ /* printf("\n[CDB___os_openhandle] name=[%s] mode=[%#x] fhp->fd=[%d]\n", name, mode, fhp->fd); */ if (fhp->fd == -1) { /* * If it's a "temporary" error, we retry up to 3 times, * waiting up to 12 seconds. While it's not a problem * if we can't open a database, an inability to open a * log file is cause for serious dismay. */ ret = CDB___os_get_errno(); if (ret == ENFILE || ret == EMFILE || ret == ENOSPC) { (void)CDB___os_sleep(try * 2, 0); continue; } } else F_SET(fhp, DB_FH_VALID); break; } return (ret); } /* * CDB___os_closehandle -- * Close a file. * * PUBLIC: int CDB___os_closehandle __P((DB_FH *)); */ int CDB___os_closehandle(fhp) DB_FH *fhp; { int ret; /* Don't close file descriptors that were never opened. */ DB_ASSERT(F_ISSET(fhp, DB_FH_VALID) && fhp->fd != -1); ret = CDB___db_jump.j_close != NULL ? CDB___db_jump.j_close(fhp->fd) : close(fhp->fd); /* * Smash the POSIX file descriptor -- it's never tested, but we want * to catch any mistakes. */ fhp->fd = -1; F_CLR(fhp, DB_FH_VALID); return (ret == 0 ? 0 : CDB___os_get_errno()); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_jump.h��������������������������������������������������������������������������0100644�0063146�0012731�00000002232�07427026535�014606� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)os_jump.h 11.1 (Sleepycat) 7/25/99 */ /* Calls which can be replaced by the application. */ struct __db_jumptab { int (*j_close) __P((int)); void (*j_dirfree) __P((char **, int)); int (*j_dirlist) __P((const char *, char ***, int *)); int (*j_exists) __P((const char *, int *)); void (*j_free) __P((void *)); int (*j_fsync) __P((int)); int (*j_ioinfo) __P((const char *, int, u_int32_t *, u_int32_t *, u_int32_t *)); void *(*j_malloc) __P((size_t)); int (*j_map) __P((char *, size_t, int, int, void **)); int (*j_open) __P((const char *, int, ...)); ssize_t (*j_read) __P((int, void *, size_t)); void *(*j_realloc) __P((void *, size_t)); int (*j_rename) __P((const char *, const char *)); int (*j_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int)); int (*j_sleep) __P((u_long, u_long)); int (*j_unlink) __P((const char *)); int (*j_unmap) __P((void *, size_t)); ssize_t (*j_write) __P((int, const void *, size_t)); int (*j_yield) __P((void)); }; extern struct __db_jumptab CDB___db_jump; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_map.c���������������������������������������������������������������������������0100644�0063146�0012731�00000020551�10000513630�014361� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_map.c 11.10 (Sleepycat) 10/31/99"; #endif /* not lint */ #ifdef _MSC_VER /* _WIN32 */ #include <windows.h> #endif #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifdef HAVE_MMAP #include <sys/mman.h> #endif #ifdef HAVE_SHMGET #include <sys/ipc.h> #include <sys/shm.h> #endif #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "os_jump.h" #ifdef HAVE_MMAP static int CDB___os_map __P((DB_ENV *, char *, DB_FH *, size_t, int, int, void **)); #endif /* * CDB___os_r_sysattach -- * Create/join a shared memory region. * * PUBLIC: int CDB___os_r_sysattach __P((DB_ENV *, REGINFO *, REGION *)); */ int CDB___os_r_sysattach(dbenv, infop, rp) DB_ENV *dbenv; REGINFO *infop; REGION *rp; { DB_FH fh; int ret; if (F_ISSET(dbenv, DB_ENV_SYSTEM_MEM)) { /* * If the region is in system memory on UNIX, we use shmget(2). * * !!! * There exist spinlocks that don't work in shmget memory, e.g., * the HP/UX msemaphore interface. If we don't have locks that * will work in shmget memory, we better be private and not be * threaded. If we reach this point, we know we're public, so * it's an error. */ #if defined(MUTEX_NO_SHMGET_LOCKS) CDB___db_err(dbenv, "%s", "architecture does not support locks inside system (shmget(2)) memory"); CDB___db_err(dbenv, "%s", "application must specify DB_PRIVATE or not specify DB_SYSTEM_MEM"); return (EINVAL); #endif #if defined(HAVE_SHMGET) if (F_ISSET(infop, REGION_CREATE) && (rp->segid = shmget(0, rp->size, IPC_PRIVATE | 0600)) == -1) return (CDB___os_get_errno()); if ((infop->addr = shmat(rp->segid, NULL, 0)) == (void *)-1) { infop->addr = NULL; return (CDB___os_get_errno()); } return (0); #else CDB___db_err(dbenv, "architecture lacks shmget(2), environments in system memory not possible"); return (CDB___db_eopnotsup(dbenv)); #endif } #ifdef HAVE_MMAP /* * Try to open/create the file. We DO NOT need to ensure that multiple * threads/processes attempting to simultaneously create the region are * properly ordered, our caller has already taken care of that. */ if ((ret = CDB___os_open(infop->name, F_ISSET(infop, REGION_CREATE_OK) ? DB_OSO_CREATE: 0, infop->mode, &fh)) != 0) CDB___db_err(dbenv, "%s: %s", infop->name, CDB_db_strerror(ret)); /* * If we created the file, grow it to its full size before mapping * it in. We really want to avoid touching the buffer cache after * mmap(2) is called, doing anything else confuses the hell out of * systems without merged VM/buffer cache systems, or, more to the * point, *badly* merged VM/buffer cache systems. */ if (ret == 0 && F_ISSET(infop, REGION_CREATE)) ret = CDB___os_finit(&fh, rp->size, DB_GLOBAL(db_region_init)); /* Map the file in. */ if (ret == 0) ret = CDB___os_map(dbenv, infop->name, &fh, rp->size, 1, 0, &infop->addr); (void)CDB___os_closehandle(&fh); return (ret); #else CDB___db_err(dbenv, "architecture lacks mmap(2), shared environments not possible"); return (CDB___db_eopnotsup(dbenv)); #endif } /* * CDB___os_r_sysdetach -- * Detach from a shared memory region. * * PUBLIC: int CDB___os_r_sysdetach __P((DB_ENV *, REGINFO *, int)); */ int CDB___os_r_sysdetach(dbenv, infop, destroy) DB_ENV *dbenv; REGINFO *infop; int destroy; { REGION *rp; int segid; rp = infop->rp; if (F_ISSET(dbenv, DB_ENV_SYSTEM_MEM)) { #ifdef HAVE_SHMGET /* * We may be about to remove the memory referenced by rp, * save the segment ID, and (optionally) wipe the original. */ segid = rp->segid; if (destroy) rp->segid = INVALID_REGION_SEGID; if (shmdt(infop->addr) != 0) return (CDB___os_get_errno()); if (destroy) if (shmctl(segid, IPC_RMID, NULL) != 0) return (CDB___os_get_errno()); return (0); #else return (EINVAL); #endif } #ifdef HAVE_MMAP #ifdef HAVE_MUNLOCK if (F_ISSET(dbenv, DB_ENV_LOCKDOWN)) (void)munlock(infop->addr, rp->size); #endif if (munmap(infop->addr, rp->size) != 0) return (CDB___os_get_errno()); if (destroy && CDB___os_unlink(infop->name) != 0) return (CDB___os_get_errno()); return (0); #else return (EINVAL); #endif } /* * CDB___os_mapfile -- * Map in a shared memory file. * * PUBLIC: int CDB___os_mapfile __P((DB_ENV *, * PUBLIC: char *, DB_FH *, size_t, int, void **)); */ int CDB___os_mapfile(dbenv, path, fhp, len, is_rdonly, addrp) DB_ENV *dbenv; char *path; DB_FH *fhp; int is_rdonly; size_t len; void **addrp; { #ifdef HAVE_MMAP return (CDB___os_map(dbenv, path, fhp, len, 0, is_rdonly, addrp)); #else COMPQUIET(dbenv, NULL); return (EINVAL); #endif } /* * CDB___os_unmapfile -- * Unmap the shared memory file. * * PUBLIC: int CDB___os_unmapfile __P((DB_ENV *, void *, size_t)); */ int CDB___os_unmapfile(dbenv, addr, len) DB_ENV *dbenv; void *addr; size_t len; { /* If the user replaced the map call, call through their interface. */ if (CDB___db_jump.j_unmap != NULL) return (CDB___db_jump.j_unmap(addr, len)); #ifdef HAVE_MMAP #ifdef HAVE_MUNLOCK if (F_ISSET(dbenv, DB_ENV_LOCKDOWN)) (void)munlock(addr, len); #else COMPQUIET(dbenv, NULL); #endif return (munmap(addr, len) ? CDB___os_get_errno() : 0); #else COMPQUIET(dbenv, NULL); return (EINVAL); #endif } #ifdef HAVE_MMAP /* * CDB___os_map -- * Call the mmap(2) function. */ static int CDB___os_map(dbenv, path, fhp, len, is_region, is_rdonly, addrp) DB_ENV *dbenv; char *path; DB_FH *fhp; int is_region, is_rdonly; size_t len; void **addrp; { void *p; int flags, prot; /* If the user replaced the map call, call through their interface. */ if (CDB___db_jump.j_map != NULL) return (CDB___db_jump.j_map (path, len, is_region, is_rdonly, addrp)); /* * If it's read-only, it's private, and if it's not, it's shared. * Don't bother with an additional parameter. */ flags = is_rdonly ? MAP_PRIVATE : MAP_SHARED; #ifdef MAP_FILE /* * Historically, MAP_FILE was required for mapping regular files, * even though it was the default. Some systems have it, some * don't, some that have it set it to 0. */ flags |= MAP_FILE; #endif /* * I know of no systems that implement the flag to tell the system * that the region contains semaphores, but it's not an unreasonable * thing to do, and has been part of the design since forever. I * don't think anyone will object, but don't set it for read-only * files, it doesn't make sense. */ #ifdef MAP_HASSEMAPHORE if (is_region && !is_rdonly) flags |= MAP_HASSEMAPHORE; #else COMPQUIET(is_region, 0); #endif prot = PROT_READ | (is_rdonly ? 0 : PROT_WRITE); /* * XXX * Work around a bug in the VMS V7.1 mmap() implementation. To map * a file into memory on VMS it needs to be opened in a certain way, * originally. To get the file opened in that certain way, the VMS * mmap() closes the file and re-opens it. When it does this, it * doesn't flush any caches out to disk before closing. The problem * this causes us is that when the memory cache doesn't get written * out, the file isn't big enough to match the memory chunk and the * mmap() call fails. This call to fsync() fixes the problem. DEC * thinks this isn't a bug because of language in XPG5 discussing user * responsibility for on-disk and in-memory synchronization. */ #ifdef VMS if (CDB___os_fsync(fhp) == -1) return(CDB___os_get_errno()); #endif /* MAP_FAILED was not defined in early mmap implementations. */ #ifndef MAP_FAILED #define MAP_FAILED -1 #endif if ((p = mmap(NULL, len, prot, flags, fhp->fd, (off_t)0)) == (void *)MAP_FAILED) return (CDB___os_get_errno()); #ifdef HAVE_MLOCK /* * If it's a region, we want to make sure that the memory isn't paged. * For example, Solaris will page large mpools because it thinks that * I/O buffer memory is more important than we are. The mlock system * call may or may not succeed (mlock is restricted to the super-user * on some systems). Currently, the only other use of mmap in DB is * to map read-only databases -- we don't want them paged, either, so * the call isn't conditional. */ if (F_ISSET(dbenv, DB_ENV_LOCKDOWN) && mlock(p, len) != 0) { (void)munmap(p, len); return (CDB___os_get_errno()); } #else COMPQUIET(dbenv, NULL); #endif *addrp = p; return (0); } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_method.c������������������������������������������������������������������������0100644�0063146�0012731�00000016452�07427026535�015117� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_method.c 11.2 (Sleepycat) 9/28/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "os_jump.h" struct __db_jumptab CDB___db_jump; static int CDB___os_set_func_close __P((DB_ENV *, int (*)(int))); static int CDB___os_set_func_dirfree __P((DB_ENV *, void (*)(char **, int))); static int CDB___os_set_func_dirlist __P((DB_ENV *, int (*)(const char *, char ***, int *))); static int CDB___os_set_func_exists __P((DB_ENV *, int (*)(const char *, int *))); static int CDB___os_set_func_free __P((DB_ENV *, void (*)(void *))); static int CDB___os_set_func_fsync __P((DB_ENV *, int (*)(int))); static int CDB___os_set_func_ioinfo __P((DB_ENV *, int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *))); static int CDB___os_set_func_malloc __P((DB_ENV *, void *(*)(size_t))); static int CDB___os_set_func_map __P((DB_ENV *, int (*)(char *, size_t, int, int, void **))); static int CDB___os_set_func_open __P((DB_ENV *, int (*)(const char *, int, ...))); static int CDB___os_set_func_read __P((DB_ENV *, ssize_t (*)(int, void *, size_t))); static int CDB___os_set_func_realloc __P((DB_ENV *, void *(*)(void *, size_t))); static int CDB___os_set_func_rename __P((DB_ENV *, int (*)(const char *, const char *))); static int CDB___os_set_func_seek __P((DB_ENV *, int (*)(int, size_t, db_pgno_t, u_int32_t, int, int))); static int CDB___os_set_func_sleep __P((DB_ENV *, int (*)(u_long, u_long))); static int CDB___os_set_func_unlink __P((DB_ENV *, int (*)(const char *))); static int CDB___os_set_func_unmap __P((DB_ENV *, int (*)(void *, size_t))); static int CDB___os_set_func_write __P((DB_ENV *, ssize_t (*)(int, const void *, size_t))); static int CDB___os_set_func_yield __P((DB_ENV *, int (*)(void))); /* * CDB___os_dbenv_create -- * Set OS specific methods, i.e., the jump table. * * PUBLIC: void CDB___os_dbenv_create __P((DB_ENV *)); */ void CDB___os_dbenv_create(dbenv) DB_ENV *dbenv; { dbenv->set_func_close = CDB___os_set_func_close; dbenv->set_func_dirfree = CDB___os_set_func_dirfree; dbenv->set_func_dirlist = CDB___os_set_func_dirlist; dbenv->set_func_exists = CDB___os_set_func_exists; dbenv->set_func_free = CDB___os_set_func_free; dbenv->set_func_fsync = CDB___os_set_func_fsync; dbenv->set_func_ioinfo = CDB___os_set_func_ioinfo; dbenv->set_func_malloc = CDB___os_set_func_malloc; dbenv->set_func_map = CDB___os_set_func_map; dbenv->set_func_open = CDB___os_set_func_open; dbenv->set_func_read = CDB___os_set_func_read; dbenv->set_func_realloc = CDB___os_set_func_realloc; dbenv->set_func_rename = CDB___os_set_func_rename; dbenv->set_func_seek = CDB___os_set_func_seek; dbenv->set_func_sleep = CDB___os_set_func_sleep; dbenv->set_func_unlink = CDB___os_set_func_unlink; dbenv->set_func_unmap = CDB___os_set_func_unmap; dbenv->set_func_write = CDB___os_set_func_write; dbenv->set_func_yield = CDB___os_set_func_yield; } static int CDB___os_set_func_close(dbenv, func_close) DB_ENV *dbenv; int (*func_close) __P((int)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_close"); CDB___db_jump.j_close = func_close; return (0); } static int CDB___os_set_func_dirfree(dbenv, func_dirfree) DB_ENV *dbenv; void (*func_dirfree) __P((char **, int)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_dirfree"); CDB___db_jump.j_dirfree = func_dirfree; return (0); } static int CDB___os_set_func_dirlist(dbenv, func_dirlist) DB_ENV *dbenv; int (*func_dirlist) __P((const char *, char ***, int *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_dirlist"); CDB___db_jump.j_dirlist = func_dirlist; return (0); } static int CDB___os_set_func_exists(dbenv, func_exists) DB_ENV *dbenv; int (*func_exists) __P((const char *, int *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_exists"); CDB___db_jump.j_exists = func_exists; return (0); } static int CDB___os_set_func_free(dbenv, func_free) DB_ENV *dbenv; void (*func_free) __P((void *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_free"); CDB___db_jump.j_free = func_free; return (0); } static int CDB___os_set_func_fsync(dbenv, func_fsync) DB_ENV *dbenv; int (*func_fsync) __P((int)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_fsync"); CDB___db_jump.j_fsync = func_fsync; return (0); } static int CDB___os_set_func_ioinfo(dbenv, func_ioinfo) DB_ENV *dbenv; int (*func_ioinfo) __P((const char *, int, u_int32_t *, u_int32_t *, u_int32_t *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_ioinfo"); CDB___db_jump.j_ioinfo = func_ioinfo; return (0); } static int CDB___os_set_func_malloc(dbenv, func_malloc) DB_ENV *dbenv; void *(*func_malloc) __P((size_t)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_malloc"); CDB___db_jump.j_malloc = func_malloc; return (0); } static int CDB___os_set_func_map(dbenv, func_map) DB_ENV *dbenv; int (*func_map) __P((char *, size_t, int, int, void **)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_map"); CDB___db_jump.j_map = func_map; return (0); } static int CDB___os_set_func_open(dbenv, func_open) DB_ENV *dbenv; int (*func_open) __P((const char *, int, ...)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_open"); CDB___db_jump.j_open = func_open; return (0); } static int CDB___os_set_func_read(dbenv, func_read) DB_ENV *dbenv; ssize_t (*func_read) __P((int, void *, size_t)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_read"); CDB___db_jump.j_read = func_read; return (0); } static int CDB___os_set_func_realloc(dbenv, func_realloc) DB_ENV *dbenv; void *(*func_realloc) __P((void *, size_t)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_realloc"); CDB___db_jump.j_realloc = func_realloc; return (0); } static int CDB___os_set_func_rename(dbenv, func_rename) DB_ENV *dbenv; int (*func_rename) __P((const char *, const char *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_rename"); CDB___db_jump.j_rename = func_rename; return (0); } static int CDB___os_set_func_seek(dbenv, func_seek) DB_ENV *dbenv; int (*func_seek) __P((int, size_t, db_pgno_t, u_int32_t, int, int)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_seek"); CDB___db_jump.j_seek = func_seek; return (0); } static int CDB___os_set_func_sleep(dbenv, func_sleep) DB_ENV *dbenv; int (*func_sleep) __P((u_long, u_long)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_sleep"); CDB___db_jump.j_sleep = func_sleep; return (0); } static int CDB___os_set_func_unlink(dbenv, func_unlink) DB_ENV *dbenv; int (*func_unlink) __P((const char *)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_unlink"); CDB___db_jump.j_unlink = func_unlink; return (0); } static int CDB___os_set_func_unmap(dbenv, func_unmap) DB_ENV *dbenv; int (*func_unmap) __P((void *, size_t)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_unmap"); CDB___db_jump.j_unmap = func_unmap; return (0); } static int CDB___os_set_func_write(dbenv, func_write) DB_ENV *dbenv; ssize_t (*func_write) __P((int, const void *, size_t)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_write"); CDB___db_jump.j_write = func_write; return (0); } static int CDB___os_set_func_yield(dbenv, func_yield) DB_ENV *dbenv; int (*func_yield) __P((void)); { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_func_yield"); CDB___db_jump.j_yield = func_yield; return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_oflags.c������������������������������������������������������������������������0100644�0063146�0012731�00000002713�07675665422�015116� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_oflags.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #endif #include "db_int.h" /* * CDB___db_oflags -- * Convert open(2) flags to DB flags. * * PUBLIC: u_int32_t CDB___db_oflags __P((int)); */ u_int32_t CDB___db_oflags(oflags) int oflags; { u_int32_t dbflags; /* * XXX * Convert POSIX 1003.1 open(2) flags to DB flags. Not an exact * science as most POSIX implementations don't have a flag value * for O_RDONLY, it's simply the lack of a write flag. */ dbflags = 0; if (oflags & O_CREAT) dbflags |= DB_CREATE; if (!(oflags & (O_RDWR | O_WRONLY)) || oflags & O_RDONLY) dbflags |= DB_RDONLY; if (oflags & O_TRUNC) dbflags |= DB_TRUNCATE; return (dbflags); } /* * CDB___db_omode -- * Convert a permission string to the correct open(2) flags. * * PUBLIC: int CDB___db_omode __P((const char *)); */ int CDB___db_omode(perm) const char *perm; { int mode; mode = 0; if (perm[0] == 'r') mode |= S_IRUSR; if (perm[1] == 'w') mode |= S_IWUSR; if (perm[2] == 'r') mode |= S_IRGRP; if (perm[3] == 'w') mode |= S_IWGRP; if (perm[4] == 'r') mode |= S_IROTH; if (perm[5] == 'w') mode |= S_IWOTH; return (mode); } �����������������������������������������������������htdig-3.2.0b6/db/os_open.c��������������������������������������������������������������������������0100644�0063146�0012731�00000004701�07427026535�014572� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_open.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <fcntl.h> #include <signal.h> #endif #include "db_int.h" /* * CDB___os_open -- * Open a file. * * PUBLIC: int CDB___os_open __P((const char *, u_int32_t, int, DB_FH *)); */ int CDB___os_open(name, flags, mode, fhp) const char *name; u_int32_t flags; int mode; DB_FH *fhp; { #if defined(HAVE_SIGFILLSET) sigset_t set, oset; #endif int oflags, ret; oflags = 0; /* * DB requires the POSIX 1003.1 semantic that two files opened at the * same time with DB_OSO_CREATE/O_CREAT and DB_OSO_EXCL/O_EXCL flags * set return an EEXIST failure in at least one. */ if (LF_ISSET(DB_OSO_CREATE)) oflags |= O_CREAT; if (LF_ISSET(DB_OSO_EXCL)) oflags |= O_EXCL; #if defined(O_DSYNC) && defined(XXX_NEVER_SET) /* * !!! * We should get better performance if we push the log files to disk * immediately instead of waiting for the sync. However, Solaris * (and likely any other system based on the 4BSD filesystem releases), * doesn't implement O_DSYNC correctly, only flushing data blocks and * not inode or indirect blocks. */ if (LF_ISSET(DB_OSO_LOG)) oflags |= O_DSYNC; #endif if (LF_ISSET(DB_OSO_RDONLY)) oflags |= O_RDONLY; else oflags |= O_RDWR; if (LF_ISSET(DB_OSO_TRUNC)) oflags |= O_TRUNC; #if defined(HAVE_SIGFILLSET) /* * We block every signal we can get our hands on so that the temporary * file isn't left around if we're interrupted at the wrong time. Of * course, if we drop core in-between the calls we'll hang forever, but * that's probably okay. ;-) */ if (LF_ISSET(DB_OSO_TEMP)) { (void)sigfillset(&set); (void)sigprocmask(SIG_BLOCK, &set, &oset); } #endif /* Open the file. */ if ((ret = CDB___os_openhandle(name, oflags, mode, fhp)) != 0) return (ret); /* Delete any temporary file. */ if (LF_ISSET(DB_OSO_TEMP)) { (void)CDB___os_unlink(name); #if defined(HAVE_SIGFILLSET) (void)sigprocmask(SIG_SETMASK, &oset, NULL); #endif } #if defined(HAVE_FCNTL_F_SETFD) /* Deny file descriptor access to any child process. */ if (fcntl(fhp->fd, F_SETFD, 1) == -1) { ret = CDB___os_get_errno(); (void)CDB___os_closehandle(fhp); return (ret); } #endif return (0); } ���������������������������������������������������������������htdig-3.2.0b6/db/os_region.c������������������������������������������������������������������������0100644�0063146�0012731�00000005370�07427026535�015117� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_region.c 11.2 (Sleepycat) 9/23/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_r_attach -- * Attach to a shared memory region. * * PUBLIC: int CDB___os_r_attach __P((DB_ENV *, REGINFO *, REGION *)); */ int CDB___os_r_attach(dbenv, infop, rp) DB_ENV *dbenv; REGINFO *infop; REGION *rp; { /* Round off the requested size for the underlying VM. */ OS_VMROUNDOFF(rp->size); #ifdef DB_REGIONSIZE_MAX /* Some architectures have hard limits on the maximum region size. */ if (rp->size > DB_REGIONSIZE_MAX) { CDB___db_err(dbenv, "region size %lu is too large; maximum is %lu", (u_long)rp->size, (u_long)DB_REGIONSIZE_MAX); return (EINVAL); } #endif /* * If a region is private, malloc the memory. * * !!! * If this fails because the region is too large to malloc, mmap(2) * using the MAP_ANON or MAP_ANONYMOUS flags would be an alternative. * I don't know of any architectures (yet!) where malloc is a problem. */ if (F_ISSET(dbenv, DB_ENV_PRIVATE)) { #if defined(MUTEX_NO_MALLOC_LOCKS) /* * !!! * There exist spinlocks that don't work in malloc memory, e.g., * the HP/UX msemaphore interface. If we don't have locks that * will work in malloc memory, we better not be private or not * be threaded. */ if (F_ISSET(dbenv, DB_ENV_THREAD)) { CDB___db_err(dbenv, "%s", "architecture does not support locks inside process-local (malloc) memory"); CDB___db_err(dbenv, "%s", "application may not specify both DB_PRIVATE and DB_THREAD"); return (EINVAL); } #endif return (CDB___os_malloc(rp->size, NULL, &infop->addr)); } /* If the user replaced the map call, call through their interface. */ if (CDB___db_jump.j_map != NULL) return (CDB___db_jump.j_map(infop->name, rp->size, 1, 0, &infop->addr)); return (CDB___os_r_sysattach(dbenv, infop, rp)); } /* * CDB___os_r_detach -- * Detach from a shared memory region. * * PUBLIC: int CDB___os_r_detach __P((DB_ENV *, REGINFO *, int)); */ int CDB___os_r_detach(dbenv, infop, destroy) DB_ENV *dbenv; REGINFO *infop; int destroy; { REGION *rp; rp = infop->rp; /* If a region is private, free the memory. */ if (F_ISSET(dbenv, DB_ENV_PRIVATE)) { CDB___os_free(infop->addr, rp->size); return (0); } /* If the user replaced the map call, call through their interface. */ if (CDB___db_jump.j_unmap != NULL) return (CDB___db_jump.j_unmap(infop->addr, rp->size)); return (CDB___os_r_sysdetach(dbenv, infop, destroy)); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_rename.c������������������������������������������������������������������������0100644�0063146�0012731�00000001402�10000513630�015045� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_rename.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_rename -- * Rename a file. * * PUBLIC: int CDB___os_rename __P((const char *, const char *)); */ int CDB___os_rename(old, new) const char *old, *new; { int ret; ret = CDB___db_jump.j_rename != NULL ? CDB___db_jump.j_rename(old, new) : rename(old, new); return (ret == -1 ? CDB___os_get_errno() : 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_root.c��������������������������������������������������������������������������0100644�0063146�0012731�00000001152�10000513630�014563� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_root.c 11.2 (Sleepycat) 9/13/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" /* * CDB___os_isroot -- * Return if user has special permissions. * * PUBLIC: int CDB___os_isroot __P((void)); */ int CDB___os_isroot() { #ifdef HAVE_GETUID return (getuid() == 0); #else return (0); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_rpath.c�������������������������������������������������������������������������0100644�0063146�0012731�00000001512�07427026535�014744� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_rpath.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <string.h> #endif #include "db_int.h" /* * CDB___db_rpath -- * Return the last path separator in the path or NULL if none found. * * PUBLIC: char *CDB___db_rpath __P((const char *)); */ char * CDB___db_rpath(path) const char *path; { const char *s, *last; last = NULL; if (PATH_SEPARATOR[1] != '\0') { for (s = path; s[0] != '\0'; ++s) if (strchr(PATH_SEPARATOR, s[0]) != NULL) last = s; } else for (s = path; s[0] != '\0'; ++s) if (s[0] == PATH_SEPARATOR[0]) last = s; return ((char *)last); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_rw.c����������������������������������������������������������������������������0100644�0063146�0012731�00000010560�10000513630�014233� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_rw.c 11.2 (Sleepycat) 9/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_io -- * Do an I/O. * * PUBLIC: int CDB___os_io __P((DB_IO *, int, ssize_t *)); */ int CDB___os_io(db_iop, op, niop) DB_IO *db_iop; int op; ssize_t *niop; { int ret; /* HACK to debug where the O_BINARY mode of the file gets fouled up */ /* printf("\n[CDB___os_io]"); printf("DB_IO_READ:[%d], DB_IO_WRITE:[%d]\n", (DB_IO_READ==op?1:0), (DB_IO_WRITE==op?1:0)); printf("[CDB___os_io]"); #ifdef HAVE_PREAD printf("using pread/pwrite\n"); #else printf("using CDB___os_read & CDB___os_write\n"); #endif printf("[CDB___os_io]"); printf("FD=[%d], BYTES=[%d], PAGESIZE=[%d]\n", db_iop->fhp->fd, db_iop->bytes,db_iop->pagesize); */ #ifdef HAVE_PREAD switch (op) { case DB_IO_READ: if (CDB___db_jump.j_read != NULL) goto slow; *niop = pread(db_iop->fhp->fd, db_iop->buf, db_iop->bytes, (off_t)db_iop->pgno * db_iop->pagesize); break; case DB_IO_WRITE: if (CDB___db_jump.j_write != NULL) goto slow; *niop = pwrite(db_iop->fhp->fd, db_iop->buf, db_iop->bytes, (off_t)db_iop->pgno * db_iop->pagesize); break; } if (*niop == (ssize_t)db_iop->bytes) return (0); slow: #endif MUTEX_THREAD_LOCK(db_iop->mutexp); if ((ret = CDB___os_seek(db_iop->fhp, db_iop->pagesize, db_iop->pgno, 0, 0, DB_OS_SEEK_SET)) != 0) goto err; switch (op) { case DB_IO_READ: ret = CDB___os_read(db_iop->fhp, db_iop->buf, db_iop->bytes, niop); break; case DB_IO_WRITE: ret = CDB___os_write(db_iop->fhp, db_iop->buf, db_iop->bytes, niop); break; } err: MUTEX_THREAD_UNLOCK(db_iop->mutexp); return (ret); } /* * CDB___os_read -- * Read from a file handle. * * PUBLIC: int CDB___os_read __P((DB_FH *, void *, size_t, ssize_t *)); */ int CDB___os_read(fhp, addr, len, nrp) DB_FH *fhp; void *addr; size_t len; ssize_t *nrp; { size_t offset; ssize_t nr; u_int8_t *taddr; /* HACK to debug where the O_BINARY mode of the file gets fouled up */ /* printf("\n[CDB___os_read] fhp->fd=[%d], len=[%d]\n", fhp->fd, len); printf("[CDB___os_read] CDB___db_jump.j_read==NULL ?[%d]\n", ( CDB___db_jump.j_read == NULL ?1:0) ); printf("[CDB___os_read] lseek(fhp->fd, 0, SEEK_CUR)=[%d]\n", lseek(fhp->fd, 0, SEEK_CUR)); printf("[CDB___os_read] current mode=[%#x]\n", setmode(fhp->fd, 0x8000)); */ for (taddr = addr, offset = 0; offset < len; taddr += nr, offset += nr) { if ((nr = CDB___db_jump.j_read != NULL ? CDB___db_jump.j_read(fhp->fd, taddr, len - offset) : read(fhp->fd, taddr, len - offset)) < 0) return (CDB___os_get_errno()); if (nr == 0) break; } *nrp = taddr - (u_int8_t *)addr; return (0); } /* * CDB___os_write -- * Write to a file handle. * * PUBLIC: int CDB___os_write __P((DB_FH *, void *, size_t, ssize_t *)); */ int CDB___os_write(fhp, addr, len, nwp) DB_FH *fhp; void *addr; size_t len; ssize_t *nwp; { size_t offset; ssize_t nw; u_int8_t *taddr; /* HACK to debug where the O_BINARY mode of the file gets fouled up */ /* printf("\n[CDB___os_write] fhp->fd=[%d], len=[%d]\n", fhp->fd, len); printf("[CDB___os_write] CDB___db_jump.j_write==NULL ?[%d]\n", ( CDB___db_jump.j_write == NULL ?1:0) ); printf("[CDB___os_write] lseek(fhp->fd, 0, SEEK_CUR)=[%d]\n", lseek(fhp->fd, 0, SEEK_CUR)); printf("[CDB___os_write] current mode=[%#x]\n", setmode(fhp->fd, 0x8000)); */ for (taddr = addr, offset = 0; offset < len; taddr += nw, offset += nw) { if ((nw = CDB___db_jump.j_write != NULL ? CDB___db_jump.j_write(fhp->fd, taddr, len - offset) : write(fhp->fd, taddr, len - offset)) < 0) return (CDB___os_get_errno()); /* HACK to debug where the O_BINARY mode of the file gets fouled up */ /* printf("** %d bytes written, wanted to write %d\n", nw, len-offset); */ } *nwp = len; /* HACK to debug where the O_BINARY mode of the file gets fouled up */ /* printf("[AFTER CDB___os_write] lseek(fhp->fd, 0, SEEK_CUR)=[%d]\n", lseek(fhp->fd, 0, SEEK_CUR)); */ return (0); } ������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_seek.c��������������������������������������������������������������������������0100644�0063146�0012731�00000002607�10000513630�014535� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_seek.c 11.3 (Sleepycat) 10/29/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #ifdef _MSC_VER /* _WIN32 */ #include <io.h> #else #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_seek -- * Seek to a page/byte offset in the file. * * PUBLIC: int CDB___os_seek * PUBLIC: __P((DB_FH *, size_t, db_pgno_t, u_int32_t, int, DB_OS_SEEK)); */ int CDB___os_seek(fhp, pgsize, pageno, relative, isrewind, db_whence) DB_FH *fhp; size_t pgsize; db_pgno_t pageno; u_int32_t relative; int isrewind; DB_OS_SEEK db_whence; { off_t offset; int whence; switch (db_whence) { case DB_OS_SEEK_CUR: whence = SEEK_CUR; break; case DB_OS_SEEK_END: whence = SEEK_END; break; case DB_OS_SEEK_SET: whence = SEEK_SET; break; default: return (EINVAL); } if (CDB___db_jump.j_seek != NULL) return (CDB___db_jump.j_seek(fhp->fd, pgsize, pageno, relative, isrewind, whence) == -1 ? CDB___os_get_errno() : 0); offset = (off_t)pgsize * pageno + relative; if (isrewind) offset = -offset; return (lseek(fhp->fd, offset, whence) == -1 ? CDB___os_get_errno() : 0); } �������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_sleep.c�������������������������������������������������������������������������0100644�0063146�0012731�00000002436�10000513630�014716� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_sleep.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_sleep -- * Yield the processor for a period of time. * * PUBLIC: int CDB___os_sleep __P((u_long, u_long)); */ int CDB___os_sleep(secs, usecs) u_long secs, usecs; /* Seconds and microseconds. */ { struct timeval t; /* Don't require that the values be normalized. */ for (; usecs >= 1000000; usecs -= 1000000) ++secs; if (CDB___db_jump.j_sleep != NULL) return (CDB___db_jump.j_sleep(secs, usecs)); /* * It's important that we yield the processor here so that other * processes or threads are permitted to run. */ t.tv_sec = secs; t.tv_usec = usecs; return (select(0, NULL, NULL, NULL, &t) == -1 ? CDB___os_get_errno() : 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_spin.c��������������������������������������������������������������������������0100644�0063146�0012731�00000004227�10000513630�014557� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_spin.c 11.2 (Sleepycat) 11/3/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if defined(HAVE_PSTAT_GETDYNAMIC) #include <sys/pstat.h> #endif #include <limits.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" #if defined(HAVE_PSTAT_GETDYNAMIC) /* * __os_pstat_getdynamic -- * HP/UX. */ static int __os_pstat_getdynamic() { struct pst_dynamic psd; return (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == -1 ? 1 : psd.psd_proc_cnt); } #endif #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) /* * CDB___os_sysconf -- * Solaris, Linux. */ static int CDB___os_sysconf() { int nproc; return ((nproc = sysconf(_SC_NPROCESSORS_ONLN)) > 1 ? nproc : 1); } #endif /* * CDB___os_spin -- * Return the number of default spins before blocking. * * PUBLIC: int CDB___os_spin __P((void)); */ int CDB___os_spin() { /* * If the application specified a value or we've already figured it * out, return it. * * XXX * We don't want to repeatedly call the underlying function because * it can be expensive (e.g., requiring multiple filesystem accesses * under Debian Linux). */ if (DB_GLOBAL(db_tas_spins) != 0) return (DB_GLOBAL(db_tas_spins)); DB_GLOBAL(db_tas_spins) = 1; #if defined(HAVE_PSTAT_GETDYNAMIC) DB_GLOBAL(db_tas_spins) = __os_pstat_getdynamic(); #endif #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) DB_GLOBAL(db_tas_spins) = CDB___os_sysconf(); #endif /* * Spin 50 times per processor, we have anecdotal evidence that this * is a reasonable value. */ if (DB_GLOBAL(db_tas_spins) != 1) DB_GLOBAL(db_tas_spins) *= 50; return (DB_GLOBAL(db_tas_spins)); } /* * CDB___os_yield -- * Yield the processor. * * PUBLIC: void CDB___os_yield __P((u_long)); */ void CDB___os_yield(usecs) u_long usecs; { if (CDB___db_jump.j_yield != NULL && CDB___db_jump.j_yield() == 0) return; CDB___os_sleep(0, usecs); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_stat.c��������������������������������������������������������������������������0100644�0063146�0012731�00000004055�07427026535�014606� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_stat.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <sys/stat.h> #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_exists -- * Return if the file exists. * * PUBLIC: int CDB___os_exists __P((const char *, int *)); */ int CDB___os_exists(path, isdirp) const char *path; int *isdirp; { struct stat sb; if (CDB___db_jump.j_exists != NULL) return (CDB___db_jump.j_exists(path, isdirp)); if (stat(path, &sb) != 0) return (CDB___os_get_errno()); #if !defined(S_ISDIR) || defined(STAT_MACROS_BROKEN) #if defined(_WIN32) || defined(WIN16) #define S_ISDIR(m) (_S_IFDIR & (m)) #else #define S_ISDIR(m) (((m) & 0170000) == 0040000) #endif #endif if (isdirp != NULL) *isdirp = S_ISDIR(sb.st_mode); return (0); } /* * CDB___os_ioinfo -- * Return file size and I/O size; abstracted to make it easier * to replace. * * PUBLIC: int CDB___os_ioinfo __P((const char *, * PUBLIC: DB_FH *, u_int32_t *, u_int32_t *, u_int32_t *)); */ int CDB___os_ioinfo(path, fhp, mbytesp, bytesp, iosizep) const char *path; DB_FH *fhp; u_int32_t *mbytesp, *bytesp, *iosizep; { struct stat sb; if (CDB___db_jump.j_ioinfo != NULL) return (CDB___db_jump.j_ioinfo(path, fhp->fd, mbytesp, bytesp, iosizep)); if (fstat(fhp->fd, &sb) == -1) return (CDB___os_get_errno()); /* Return the size of the file. */ if (mbytesp != NULL) *mbytesp = sb.st_size / MEGABYTE; if (bytesp != NULL) *bytesp = sb.st_size % MEGABYTE; /* * Return the underlying filesystem blocksize, if available. * * XXX * Check for a 0 size -- the HP MPE/iX architecture has st_blksize, * but it's always 0. */ #ifdef HAVE_ST_BLKSIZE if (iosizep != NULL && (*iosizep = sb.st_blksize) == 0) *iosizep = DB_DEF_IOSIZE; #else if (iosizep != NULL) *iosizep = DB_DEF_IOSIZE; #endif return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_tmpdir.c������������������������������������������������������������������������0100644�0063146�0012731�00000004577�07427026535�015143� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_tmpdir.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <stdlib.h> #endif #include "db_int.h" #ifdef macintosh #include <TFileSpec.h> #endif /* * CDB___os_tmpdir -- * Set the temporary directory path. * * The order of items in the list structure and the order of checks in * the environment are documented. * * PUBLIC: int CDB___os_tmpdir __P((DB_ENV *, u_int32_t)); */ int CDB___os_tmpdir(dbenv, flags) DB_ENV *dbenv; u_int32_t flags; { /* * !!! * Don't change this to: * * static const char * const list[] * * because it creates a text relocation in position independent code. */ static const char * list[] = { "/var/tmp", "/usr/tmp", "/temp", /* Windows. */ "/tmp", "C:/temp", /* Windows. */ "C:/tmp", /* Windows. */ NULL }; const char * const *lp, *p; /* Use the environment if it's permitted and initialized. */ p = NULL; if (LF_ISSET(DB_USE_ENVIRON) || (LF_ISSET(DB_USE_ENVIRON_ROOT) && CDB___os_isroot() == 0)) { if ((p = getenv("TMPDIR")) != NULL && p[0] == '\0') { CDB___db_err(dbenv, "illegal TMPDIR environment variable"); return (EINVAL); } /* Windows */ if (p == NULL && (p = getenv("TEMP")) != NULL && p[0] == '\0') { CDB___db_err(dbenv, "illegal TEMP environment variable"); return (EINVAL); } /* Windows */ if (p == NULL && (p = getenv("TMP")) != NULL && p[0] == '\0') { CDB___db_err(dbenv, "illegal TMP environment variable"); return (EINVAL); } /* Macintosh */ if (p == NULL && (p = getenv("TempFolder")) != NULL && p[0] == '\0') { CDB___db_err(dbenv, "illegal TempFolder environment variable"); return (EINVAL); } } #ifdef macintosh /* Get the path to the temporary folder. */ if (p == NULL) { FSSpec spec; if (!Special2FSSpec(kTemporaryFolderType, kOnSystemDisk, 0, &spec)) (void)CDB___os_strdup(FSp2FullPath(&spec), &p); } #endif /* Step through the list looking for a possibility. */ if (p == NULL) for (lp = list; *lp != NULL; ++lp) if (CDB___os_exists(p = *lp, NULL) == 0) break; if (p == NULL) return (0); return (CDB___os_strdup(p, &dbenv->db_tmp_dir)); } ���������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_unlink.c������������������������������������������������������������������������0100644�0063146�0012731�00000001342�10000513630�015101� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)os_unlink.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #endif #include "db_int.h" #include "os_jump.h" /* * CDB___os_unlink -- * Remove a file. * * PUBLIC: int CDB___os_unlink __P((const char *)); */ int CDB___os_unlink(path) const char *path; { int ret; ret = CDB___db_jump.j_unlink != NULL ? CDB___db_jump.j_unlink(path) : unlink(path); return (ret == -1 ? CDB___os_get_errno() : 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/parisc.gcc�������������������������������������������������������������������������0100644�0063146�0012731�00000003067�07427026535�014727� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)parisc.gcc 11.1 (Sleepycat) 7/25/99 * * Copyright (c) 1996-1997, The University of Utah and the Computer Systems * Laboratory at the University of Utah (CSL). All rights reserved. * * Permission to use, copy, modify and distribute this software is hereby * granted provided that (1) source code retains these copyright, permission, * and disclaimer notices, and (2) redistributions including binaries * reproduce the notices in supporting documentation, and (3) all advertising * materials mentioning features or use of this software display the following * acknowledgement: ``This product includes software developed by the Computer * Systems Laboratory at the University of Utah.'' * * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * CSL requests users of this software to return to csl-dist@cs.utah.edu any * improvements that they make and grant CSL redistribution rights. */ /* * The PA-RISC has a "load and clear" instead of a "test and set" instruction. * The 32-bit word used by that instruction must be 16-byte aligned. We could * use the "aligned" attribute in GCC but that doesn't work for stack variables. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile("ldcws 0(%1),%0" : "=r" (__r) : "r" (__l)); \ __r & 1; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = -1) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/patch1�����������������������������������������������������������������������������0100644�0063146�0012731�00000001106�07427026535�014063� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������*** env/db_salloc.c.orig Tue Oct 19 17:22:12 1999 --- env/db_salloc.c Wed Dec 31 19:00:00 1969 *************** *** 94,101 **** */ ++len; #endif ! align = align <= sizeof(size_t) ? ! sizeof(size_t) : ALIGN(align, sizeof(size_t)); /* Walk the list, looking for a slot. */ for (elp = SH_LIST_FIRST((struct __head *)p, __data); --- 94,100 ---- */ ++len; #endif ! align = 8; /* Walk the list, looking for a slot. */ for (elp = SH_LIST_FIRST((struct __head *)p, __data); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/patch2�����������������������������������������������������������������������������0100644�0063146�0012731�00000001716�07427026535�014073� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- db/configure.in Mon Mar 13 17:50:46 2000 +++ db/configure.in Thu Apr 6 09:57:49 2000 @@ -64,7 +64,7 @@ irix*) optimize_def="-O2" CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";; linux*) optimize_def="-O2" - CPPFLAGS="-D_REENTRANT $CPPFLAGS";; + CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT $CPPFLAGS";; mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS" LIBS="-lsocket -lsvipc $LIBS";; osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; --- db/configure Mon Mar 13 17:50:46 2000 +++ db/configure Thu Apr 6 09:57:55 2000 @@ -1999,7 +1999,7 @@ irix*) optimize_def="-O2" CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";; linux*) optimize_def="-O2" - CPPFLAGS="-D_REENTRANT $CPPFLAGS";; + CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT $CPPFLAGS";; mpeix*) CPPFLAGS="-D_POSIX_SOURCE -D_SOCKET_SOURCE $CPPFLAGS" LIBS="-lsocket -lsvipc $LIBS";; osf*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";; ��������������������������������������������������htdig-3.2.0b6/db/prefix-symbols.sh������������������������������������������������������������������0100644�0063146�0012731�00000105465�07427026535�016314� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������for i in db.h.in ../*/*.[ch] ../*/*.cc do echo $i perl -pi -e 's/CDB_//g' $i perl -pi -e ' s/\b__absname\b/CDB___absname/g; s/\b__bam_adj_log\b/CDB___bam_adj_log/g; s/\b__bam_adj_print\b/CDB___bam_adj_print/g; s/\b__bam_adj_read\b/CDB___bam_adj_read/g; s/\b__bam_adj_recover\b/CDB___bam_adj_recover/g; s/\b__bam_adjindx\b/CDB___bam_adjindx/g; s/\b__bam_adjust\b/CDB___bam_adjust/g; s/\b__bam_broot\b/CDB___bam_broot/g; s/\b__bam_build\b/CDB___bam_build/g; s/\b__bam_c_close\b/CDB___bam_c_close/g; s/\b__bam_c_del\b/CDB___bam_c_del/g; s/\b__bam_c_destroy\b/CDB___bam_c_destroy/g; s/\b__bam_c_dup\b/CDB___bam_c_dup/g; s/\b__bam_c_first\b/CDB___bam_c_first/g; s/\b__bam_c_get\b/CDB___bam_c_get/g; s/\b__bam_c_getstack\b/CDB___bam_c_getstack/g; s/\b__bam_c_init\b/CDB___bam_c_init/g; s/\b__bam_c_last\b/CDB___bam_c_last/g; s/\b__bam_c_next\b/CDB___bam_c_next/g; s/\b__bam_c_physdel\b/CDB___bam_c_physdel/g; s/\b__bam_c_prev\b/CDB___bam_c_prev/g; s/\b__bam_c_put\b/CDB___bam_c_put/g; s/\b__bam_c_reset\b/CDB___bam_c_reset/g; s/\b__bam_c_rget\b/CDB___bam_c_rget/g; s/\b__bam_c_search\b/CDB___bam_c_search/g; s/\b__bam_ca_delete\b/CDB___bam_ca_delete/g; s/\b__bam_ca_di\b/CDB___bam_ca_di/g; s/\b__bam_ca_dup\b/CDB___bam_ca_dup/g; s/\b__bam_ca_repl\b/CDB___bam_ca_repl/g; s/\b__bam_ca_rsplit\b/CDB___bam_ca_rsplit/g; s/\b__bam_ca_split\b/CDB___bam_ca_split/g; s/\b__bam_cadjust_log\b/CDB___bam_cadjust_log/g; s/\b__bam_cadjust_print\b/CDB___bam_cadjust_print/g; s/\b__bam_cadjust_read\b/CDB___bam_cadjust_read/g; s/\b__bam_cadjust_recover\b/CDB___bam_cadjust_recover/g; s/\b__bam_cdel_log\b/CDB___bam_cdel_log/g; s/\b__bam_cdel_print\b/CDB___bam_cdel_print/g; s/\b__bam_cdel_read\b/CDB___bam_cdel_read/g; s/\b__bam_cdel_recover\b/CDB___bam_cdel_recover/g; s/\b__bam_cmp\b/CDB___bam_cmp/g; s/\b__bam_copy\b/CDB___bam_copy/g; s/\b__bam_cprint\b/CDB___bam_cprint/g; s/\b__bam_db_close\b/CDB___bam_db_close/g; s/\b__bam_db_create\b/CDB___bam_db_create/g; s/\b__bam_defcmp\b/CDB___bam_defcmp/g; s/\b__bam_defpfx\b/CDB___bam_defpfx/g; s/\b__bam_delete\b/CDB___bam_delete/g; s/\b__bam_ditem\b/CDB___bam_ditem/g; s/\b__bam_dpage\b/CDB___bam_dpage/g; s/\b__bam_dpages\b/CDB___bam_dpages/g; s/\b__bam_dsearch\b/CDB___bam_dsearch/g; s/\b__bam_dup\b/CDB___bam_dup/g; s/\b__bam_iitem\b/CDB___bam_iitem/g; s/\b__bam_init_print\b/CDB___bam_init_print/g; s/\b__bam_init_recover\b/CDB___bam_init_recover/g; s/\b__bam_metachk\b/CDB___bam_metachk/g; s/\b__bam_mswap\b/CDB___bam_mswap/g; s/\b__bam_ndup\b/CDB___bam_ndup/g; s/\b__bam_nrecs\b/CDB___bam_nrecs/g; s/\b__bam_open\b/CDB___bam_open/g; s/\b__bam_ovput\b/CDB___bam_ovput/g; s/\b__bam_page\b/CDB___bam_page/g; s/\b__bam_partsize\b/CDB___bam_partsize/g; s/\b__bam_pg_alloc_log\b/CDB___bam_pg_alloc_log/g; s/\b__bam_pg_alloc_print\b/CDB___bam_pg_alloc_print/g; s/\b__bam_pg_alloc_read\b/CDB___bam_pg_alloc_read/g; s/\b__bam_pg_alloc_recover\b/CDB___bam_pg_alloc_recover/g; s/\b__bam_pg_free_log\b/CDB___bam_pg_free_log/g; s/\b__bam_pg_free_print\b/CDB___bam_pg_free_print/g; s/\b__bam_pg_free_read\b/CDB___bam_pg_free_read/g; s/\b__bam_pg_free_recover\b/CDB___bam_pg_free_recover/g; s/\b__bam_pgin\b/CDB___bam_pgin/g; s/\b__bam_pgout\b/CDB___bam_pgout/g; s/\b__bam_pinsert\b/CDB___bam_pinsert/g; s/\b__bam_psplit\b/CDB___bam_psplit/g; s/\b__bam_read_root\b/CDB___bam_read_root/g; s/\b__bam_reclaim\b/CDB___bam_reclaim/g; s/\b__bam_repl_log\b/CDB___bam_repl_log/g; s/\b__bam_repl_print\b/CDB___bam_repl_print/g; s/\b__bam_repl_read\b/CDB___bam_repl_read/g; s/\b__bam_repl_recover\b/CDB___bam_repl_recover/g; s/\b__bam_ritem\b/CDB___bam_ritem/g; s/\b__bam_root\b/CDB___bam_root/g; s/\b__bam_root_log\b/CDB___bam_root_log/g; s/\b__bam_root_print\b/CDB___bam_root_print/g; s/\b__bam_root_read\b/CDB___bam_root_read/g; s/\b__bam_root_recover\b/CDB___bam_root_recover/g; s/\b__bam_rsearch\b/CDB___bam_rsearch/g; s/\b__bam_rsplit_log\b/CDB___bam_rsplit_log/g; s/\b__bam_rsplit_print\b/CDB___bam_rsplit_print/g; s/\b__bam_rsplit_read\b/CDB___bam_rsplit_read/g; s/\b__bam_rsplit_recover\b/CDB___bam_rsplit_recover/g; s/\b__bam_search\b/CDB___bam_search/g; s/\b__bam_set_bt_compare\b/CDB___bam_set_bt_compare/g; s/\b__bam_set_bt_maxkey\b/CDB___bam_set_bt_maxkey/g; s/\b__bam_set_bt_minkey\b/CDB___bam_set_bt_minkey/g; s/\b__bam_set_bt_prefix\b/CDB___bam_set_bt_prefix/g; s/\b__bam_set_flags\b/CDB___bam_set_flags/g; s/\b__bam_setovflsize\b/CDB___bam_setovflsize/g; s/\b__bam_split\b/CDB___bam_split/g; s/\b__bam_split_log\b/CDB___bam_split_log/g; s/\b__bam_split_print\b/CDB___bam_split_print/g; s/\b__bam_split_read\b/CDB___bam_split_read/g; s/\b__bam_split_recover\b/CDB___bam_split_recover/g; s/\b__bam_stat\b/CDB___bam_stat/g; s/\b__bam_stat_callback\b/CDB___bam_stat_callback/g; s/\b__bam_stkgrow\b/CDB___bam_stkgrow/g; s/\b__bam_stkrel\b/CDB___bam_stkrel/g; s/\b__bam_total\b/CDB___bam_total/g; s/\b__bam_traverse\b/CDB___bam_traverse/g; s/\b__bam_upgrade\b/CDB___bam_upgrade/g; s/\b__bam_upgrade6\b/CDB___bam_upgrade6/g; s/\b__bhcmp\b/CDB___bhcmp/g; s/\b__bucket_to_page\b/CDB___bucket_to_page/g; s/\b__build_data\b/CDB___build_data/g; s/\b__cmpfunc\b/CDB___cmpfunc/g; s/\b__crdel_delete_log\b/CDB___crdel_delete_log/g; s/\b__crdel_delete_print\b/CDB___crdel_delete_print/g; s/\b__crdel_delete_read\b/CDB___crdel_delete_read/g; s/\b__crdel_delete_recover\b/CDB___crdel_delete_recover/g; s/\b__crdel_fileopen_log\b/CDB___crdel_fileopen_log/g; s/\b__crdel_fileopen_print\b/CDB___crdel_fileopen_print/g; s/\b__crdel_fileopen_read\b/CDB___crdel_fileopen_read/g; s/\b__crdel_fileopen_recover\b/CDB___crdel_fileopen_recover/g; s/\b__crdel_init_print\b/CDB___crdel_init_print/g; s/\b__crdel_init_recover\b/CDB___crdel_init_recover/g; s/\b__crdel_metapage_log\b/CDB___crdel_metapage_log/g; s/\b__crdel_metapage_print\b/CDB___crdel_metapage_print/g; s/\b__crdel_metapage_read\b/CDB___crdel_metapage_read/g; s/\b__crdel_metapage_recover\b/CDB___crdel_metapage_recover/g; s/\b__crdel_metasub_log\b/CDB___crdel_metasub_log/g; s/\b__crdel_metasub_print\b/CDB___crdel_metasub_print/g; s/\b__crdel_metasub_read\b/CDB___crdel_metasub_read/g; s/\b__crdel_metasub_recover\b/CDB___crdel_metasub_recover/g; s/\b__db_add_recovery\b/CDB___db_add_recovery/g; s/\b__db_addpage\b/CDB___db_addpage/g; s/\b__db_addpage_log\b/CDB___db_addpage_log/g; s/\b__db_addpage_print\b/CDB___db_addpage_print/g; s/\b__db_addpage_read\b/CDB___db_addpage_read/g; s/\b__db_addpage_recover\b/CDB___db_addpage_recover/g; s/\b__db_addrem_log\b/CDB___db_addrem_log/g; s/\b__db_addrem_print\b/CDB___db_addrem_print/g; s/\b__db_addrem_read\b/CDB___db_addrem_read/g; s/\b__db_addrem_recover\b/CDB___db_addrem_recover/g; s/\b__db_appname\b/CDB___db_appname/g; s/\b__db_apprec\b/CDB___db_apprec/g; s/\b__db_backup_name\b/CDB___db_backup_name/g; s/\b__db_big_log\b/CDB___db_big_log/g; s/\b__db_big_print\b/CDB___db_big_print/g; s/\b__db_big_read\b/CDB___db_big_read/g; s/\b__db_big_recover\b/CDB___db_big_recover/g; s/\b__db_bmeta\b/CDB___db_bmeta/g; s/\b__db_byteorder\b/CDB___db_byteorder/g; s/\b__db_byteswap\b/CDB___db_byteswap/g; s/\b__db_c_close\b/CDB___db_c_close/g; s/\b__db_c_destroy\b/CDB___db_c_destroy/g; s/\b__db_c_dup\b/CDB___db_c_dup/g; s/\b__db_cdelchk\b/CDB___db_cdelchk/g; s/\b__db_cgetchk\b/CDB___db_cgetchk/g; s/\b__db_close\b/CDB___db_close/g; s/\b__db_closechk\b/CDB___db_closechk/g; s/\b__db_cprint\b/CDB___db_cprint/g; s/\b__db_cputchk\b/CDB___db_cputchk/g; s/\b__db_cursor\b/CDB___db_cursor/g; s/\b__db_cursorchk\b/CDB___db_cursorchk/g; s/\b__db_dbenv_setup\b/CDB___db_dbenv_setup/g; s/\b__db_dbopen\b/CDB___db_dbopen/g; s/\b__db_ddup\b/CDB___db_ddup/g; s/\b__db_debug_log\b/CDB___db_debug_log/g; s/\b__db_debug_print\b/CDB___db_debug_print/g; s/\b__db_debug_read\b/CDB___db_debug_read/g; s/\b__db_debug_recover\b/CDB___db_debug_recover/g; s/\b__db_delchk\b/CDB___db_delchk/g; s/\b__db_dend\b/CDB___db_dend/g; s/\b__db_des_destroy\b/CDB___db_des_destroy/g; s/\b__db_des_get\b/CDB___db_des_get/g; s/\b__db_dispatch\b/CDB___db_dispatch/g; s/\b__db_ditem\b/CDB___db_ditem/g; s/\b__db_doff\b/CDB___db_doff/g; s/\b__db_dput\b/CDB___db_dput/g; s/\b__db_drem\b/CDB___db_drem/g; s/\b__db_dsearch\b/CDB___db_dsearch/g; s/\b__db_dsplit\b/CDB___db_dsplit/g; s/\b__db_dump\b/CDB___db_dump/g; s/\b__db_e_attach\b/CDB___db_e_attach/g; s/\b__db_e_detach\b/CDB___db_e_detach/g; s/\b__db_e_remfile\b/CDB___db_e_remfile/g; s/\b__db_e_remove\b/CDB___db_e_remove/g; s/\b__db_e_stat\b/CDB___db_e_stat/g; s/\b__db_env_config\b/CDB___db_env_config/g; s/\b__db_eopnotsup\b/CDB___db_eopnotsup/g; s/\b__db_err\b/CDB___db_err/g; s/\b__db_errcall\b/CDB___db_errcall/g; s/\b__db_errfile\b/CDB___db_errfile/g; s/\b__db_faultmem\b/CDB___db_faultmem/g; s/\b__db_fcchk\b/CDB___db_fcchk/g; s/\b__db_fchk\b/CDB___db_fchk/g; s/\b__db_fcntl_mutex_init\b/CDB___db_fcntl_mutex_init/g; s/\b__db_fcntl_mutex_lock\b/CDB___db_fcntl_mutex_lock/g; s/\b__db_fcntl_mutex_unlock\b/CDB___db_fcntl_mutex_unlock/g; s/\b__db_fd\b/CDB___db_fd/g; s/\b__db_ferr\b/CDB___db_ferr/g; s/\b__db_file_setup\b/CDB___db_file_setup/g; s/\b__db_fileid_to_db\b/CDB___db_fileid_to_db/g; s/\b__db_free\b/CDB___db_free/g; s/\b__db_get\b/CDB___db_get/g; s/\b__db_get_byteswapped\b/CDB___db_get_byteswapped/g; s/\b__db_get_type\b/CDB___db_get_type/g; s/\b__db_getchk\b/CDB___db_getchk/g; s/\b__db_getlong\b/CDB___db_getlong/g; s/\b__db_goff\b/CDB___db_goff/g; s/\b__db_hashinit\b/CDB___db_hashinit/g; s/\b__db_hmeta\b/CDB___db_hmeta/g; s/\b__db_home\b/CDB___db_home/g; s/\b__db_init\b/CDB___db_init/g; s/\b__db_init_print\b/CDB___db_init_print/g; s/\b__db_init_recover\b/CDB___db_init_recover/g; s/\b__db_isbad\b/CDB___db_isbad/g; s/\b__db_join\b/CDB___db_join/g; s/\b__db_join_close\b/CDB___db_join_close/g; s/\b__db_join_del\b/CDB___db_join_del/g; s/\b__db_join_get\b/CDB___db_join_get/g; s/\b__db_join_getnext\b/CDB___db_join_getnext/g; s/\b__db_join_put\b/CDB___db_join_put/g; s/\b__db_joinchk\b/CDB___db_joinchk/g; s/\b__db_keyempty\b/CDB___db_keyempty/g; s/\b__db_lget\b/CDB___db_lget/g; s/\b__db_loadme\b/CDB___db_loadme/g; s/\b__db_log2\b/CDB___db_log2/g; s/\b__db_log_page\b/CDB___db_log_page/g; s/\b__db_logmsg\b/CDB___db_logmsg/g; s/\b__db_lt\b/CDB___db_lt/g; s/\b__db_map_rmid\b/CDB___db_map_rmid/g; s/\b__db_map_xid\b/CDB___db_map_xid/g; s/\b__db_master_open\b/CDB___db_master_open/g; s/\b__db_master_update\b/CDB___db_master_update/g; s/\b__db_meta\b/CDB___db_meta/g; s/\b__db_metabegin\b/CDB___db_metabegin/g; s/\b__db_metaend\b/CDB___db_metaend/g; s/\b__db_metaswap\b/CDB___db_metaswap/g; s/\b__db_mi_env\b/CDB___db_mi_env/g; s/\b__db_mi_open\b/CDB___db_mi_open/g; s/\b__db_moff\b/CDB___db_moff/g; s/\b__db_mutex_alloc\b/CDB___db_mutex_alloc/g; s/\b__db_mutex_free\b/CDB___db_mutex_free/g; s/\b__db_name\b/CDB___db_name/g; s/\b__db_new\b/CDB___db_new/g; s/\b__db_noop_log\b/CDB___db_noop_log/g; s/\b__db_noop_print\b/CDB___db_noop_print/g; s/\b__db_noop_read\b/CDB___db_noop_read/g; s/\b__db_noop_recover\b/CDB___db_noop_recover/g; s/\b__db_oflags\b/CDB___db_oflags/g; s/\b__db_omode\b/CDB___db_omode/g; s/\b__db_open\b/CDB___db_open/g; s/\b__db_ovref\b/CDB___db_ovref/g; s/\b__db_ovref_log\b/CDB___db_ovref_log/g; s/\b__db_ovref_print\b/CDB___db_ovref_print/g; s/\b__db_ovref_read\b/CDB___db_ovref_read/g; s/\b__db_ovref_recover\b/CDB___db_ovref_recover/g; s/\b__db_panic\b/CDB___db_panic/g; s/\b__db_panic_msg\b/CDB___db_panic_msg/g; s/\b__db_parse\b/CDB___db_parse/g; s/\b__db_pgerr\b/CDB___db_pgerr/g; s/\b__db_pgfmt\b/CDB___db_pgfmt/g; s/\b__db_pgin\b/CDB___db_pgin/g; s/\b__db_pgout\b/CDB___db_pgout/g; s/\b__db_pitem\b/CDB___db_pitem/g; s/\b__db_poff\b/CDB___db_poff/g; s/\b__db_pr\b/CDB___db_pr/g; s/\b__db_prdb\b/CDB___db_prdb/g; s/\b__db_prdbt\b/CDB___db_prdbt/g; s/\b__db_prflags\b/CDB___db_prflags/g; s/\b__db_prinit\b/CDB___db_prinit/g; s/\b__db_prnpage\b/CDB___db_prnpage/g; s/\b__db_proff\b/CDB___db_proff/g; s/\b__db_prpage\b/CDB___db_prpage/g; s/\b__db_prtree\b/CDB___db_prtree/g; s/\b__db_psize\b/CDB___db_psize/g; s/\b__db_pthread_mutex_init\b/CDB___db_pthread_mutex_init/g; s/\b__db_pthread_mutex_lock\b/CDB___db_pthread_mutex_lock/g; s/\b__db_pthread_mutex_unlock\b/CDB___db_pthread_mutex_unlock/g; s/\b__db_put\b/CDB___db_put/g; s/\b__db_putchk\b/CDB___db_putchk/g; s/\b__db_qmeta\b/CDB___db_qmeta/g; s/\b__db_r_attach\b/CDB___db_r_attach/g; s/\b__db_r_detach\b/CDB___db_r_detach/g; s/\b__db_rdonly\b/CDB___db_rdonly/g; s/\b__db_real_err\b/CDB___db_real_err/g; s/\b__db_reclaim_callback\b/CDB___db_reclaim_callback/g; s/\b__db_refresh\b/CDB___db_refresh/g; s/\b__db_relink\b/CDB___db_relink/g; s/\b__db_relink_log\b/CDB___db_relink_log/g; s/\b__db_relink_print\b/CDB___db_relink_print/g; s/\b__db_relink_read\b/CDB___db_relink_read/g; s/\b__db_relink_recover\b/CDB___db_relink_recover/g; s/\b__db_remove\b/CDB___db_remove/g; s/\b__db_remove_callback\b/CDB___db_remove_callback/g; s/\b__db_removechk\b/CDB___db_removechk/g; s/\b__db_ret\b/CDB___db_ret/g; s/\b__db_retcopy\b/CDB___db_retcopy/g; s/\b__db_rmid_to_env\b/CDB___db_rmid_to_env/g; s/\b__db_rpath\b/CDB___db_rpath/g; s/\b__db_set_cachesize\b/CDB___db_set_cachesize/g; s/\b__db_set_dup_compare\b/CDB___db_set_dup_compare/g; s/\b__db_set_errcall\b/CDB___db_set_errcall/g; s/\b__db_set_errfile\b/CDB___db_set_errfile/g; s/\b__db_set_errpfx\b/CDB___db_set_errpfx/g; s/\b__db_set_feedback\b/CDB___db_set_feedback/g; s/\b__db_set_flags\b/CDB___db_set_flags/g; s/\b__db_set_lorder\b/CDB___db_set_lorder/g; s/\b__db_set_malloc\b/CDB___db_set_malloc/g; s/\b__db_set_pagesize\b/CDB___db_set_pagesize/g; s/\b__db_set_paniccall\b/CDB___db_set_paniccall/g; s/\b__db_set_pgsize\b/CDB___db_set_pgsize/g; s/\b__db_set_realloc\b/CDB___db_set_realloc/g; s/\b__db_shalloc\b/CDB___db_shalloc/g; s/\b__db_shalloc_count\b/CDB___db_shalloc_count/g; s/\b__db_shalloc_dump\b/CDB___db_shalloc_dump/g; s/\b__db_shalloc_free\b/CDB___db_shalloc_free/g; s/\b__db_shalloc_init\b/CDB___db_shalloc_init/g; s/\b__db_shsizeof\b/CDB___db_shsizeof/g; s/\b__db_split_log\b/CDB___db_split_log/g; s/\b__db_split_print\b/CDB___db_split_print/g; s/\b__db_split_read\b/CDB___db_split_read/g; s/\b__db_split_recover\b/CDB___db_split_recover/g; s/\b__db_statchk\b/CDB___db_statchk/g; s/\b__db_subdb_remove\b/CDB___db_subdb_remove/g; s/\b__db_sync\b/CDB___db_sync/g; s/\b__db_syncchk\b/CDB___db_syncchk/g; s/\b__db_tablesize\b/CDB___db_tablesize/g; s/\b__db_tas_mutex_init\b/CDB___db_tas_mutex_init/g; s/\b__db_tas_mutex_lock\b/CDB___db_tas_mutex_lock/g; s/\b__db_tas_mutex_unlock\b/CDB___db_tas_mutex_unlock/g; s/\b__db_tmp_open\b/CDB___db_tmp_open/g; s/\b__db_traverse_big\b/CDB___db_traverse_big/g; s/\b__db_traverse_dup\b/CDB___db_traverse_dup/g; s/\b__db_txnlist_add\b/CDB___db_txnlist_add/g; s/\b__db_txnlist_close\b/CDB___db_txnlist_close/g; s/\b__db_txnlist_delete\b/CDB___db_txnlist_delete/g; s/\b__db_txnlist_end\b/CDB___db_txnlist_end/g; s/\b__db_txnlist_find\b/CDB___db_txnlist_find/g; s/\b__db_txnlist_gen\b/CDB___db_txnlist_gen/g; s/\b__db_txnlist_init\b/CDB___db_txnlist_init/g; s/\b__db_txnlist_print\b/CDB___db_txnlist_print/g; s/\b__db_unmap_rmid\b/CDB___db_unmap_rmid/g; s/\b__db_unmap_xid\b/CDB___db_unmap_xid/g; s/\b__db_upgrade\b/CDB___db_upgrade/g; s/\b__db_xa_close\b/CDB___db_xa_close/g; s/\b__db_xa_commit\b/CDB___db_xa_commit/g; s/\b__db_xa_complete\b/CDB___db_xa_complete/g; s/\b__db_xa_create\b/CDB___db_xa_create/g; s/\b__db_xa_end\b/CDB___db_xa_end/g; s/\b__db_xa_forget\b/CDB___db_xa_forget/g; s/\b__db_xa_open\b/CDB___db_xa_open/g; s/\b__db_xa_prepare\b/CDB___db_xa_prepare/g; s/\b__db_xa_recover\b/CDB___db_xa_recover/g; s/\b__db_xa_rollback\b/CDB___db_xa_rollback/g; s/\b__db_xa_start\b/CDB___db_xa_start/g; s/\b__db_xid_to_txn\b/CDB___db_xid_to_txn/g; s/\b__dbenv_close\b/CDB___dbenv_close/g; s/\b__dbenv_config\b/CDB___dbenv_config/g; s/\b__dbenv_err\b/CDB___dbenv_err/g; s/\b__dbenv_errx\b/CDB___dbenv_errx/g; s/\b__dbenv_init\b/CDB___dbenv_init/g; s/\b__dbenv_open\b/CDB___dbenv_open/g; s/\b__dbenv_refresh\b/CDB___dbenv_refresh/g; s/\b__dbenv_remove\b/CDB___dbenv_remove/g; s/\b__dbenv_set_errcall\b/CDB___dbenv_set_errcall/g; s/\b__dbenv_set_errfile\b/CDB___dbenv_set_errfile/g; s/\b__dbenv_set_errpfx\b/CDB___dbenv_set_errpfx/g; s/\b__dbenv_set_feedback\b/CDB___dbenv_set_feedback/g; s/\b__dbenv_set_mutexlocks\b/CDB___dbenv_set_mutexlocks/g; s/\b__dbenv_set_pageyield\b/CDB___dbenv_set_pageyield/g; s/\b__dbenv_set_panic\b/CDB___dbenv_set_panic/g; s/\b__dbenv_set_paniccall\b/CDB___dbenv_set_paniccall/g; s/\b__dbenv_set_recovery_init\b/CDB___dbenv_set_recovery_init/g; s/\b__dbenv_set_region_init\b/CDB___dbenv_set_region_init/g; s/\b__dbenv_set_tas_spins\b/CDB___dbenv_set_tas_spins/g; s/\b__dbenv_set_verbose\b/CDB___dbenv_set_verbose/g; s/\b__dbh_am_chk\b/CDB___dbh_am_chk/g; s/\b__dbh_err\b/CDB___dbh_err/g; s/\b__dbh_errx\b/CDB___dbh_errx/g; s/\b__dbt_ferr\b/CDB___dbt_ferr/g; s/\b__dd_abort\b/CDB___dd_abort/g; s/\b__dd_build\b/CDB___dd_build/g; s/\b__dd_find\b/CDB___dd_find/g; s/\b__ham_add_dup\b/CDB___ham_add_dup/g; s/\b__ham_add_el\b/CDB___ham_add_el/g; s/\b__ham_add_ovflpage\b/CDB___ham_add_ovflpage/g; s/\b__ham_alloc_pages\b/CDB___ham_alloc_pages/g; s/\b__ham_c_close\b/CDB___ham_c_close/g; s/\b__ham_c_del\b/CDB___ham_c_del/g; s/\b__ham_c_destroy\b/CDB___ham_c_destroy/g; s/\b__ham_c_dup\b/CDB___ham_c_dup/g; s/\b__ham_c_get\b/CDB___ham_c_get/g; s/\b__ham_c_init\b/CDB___ham_c_init/g; s/\b__ham_c_put\b/CDB___ham_c_put/g; s/\b__ham_c_update\b/CDB___ham_c_update/g; s/\b__ham_ca_split\b/CDB___ham_ca_split/g; s/\b__ham_call_hash\b/CDB___ham_call_hash/g; s/\b__ham_check_move\b/CDB___ham_check_move/g; s/\b__ham_copy_item\b/CDB___ham_copy_item/g; s/\b__ham_copypage_log\b/CDB___ham_copypage_log/g; s/\b__ham_copypage_print\b/CDB___ham_copypage_print/g; s/\b__ham_copypage_read\b/CDB___ham_copypage_read/g; s/\b__ham_copypage_recover\b/CDB___ham_copypage_recover/g; s/\b__ham_cprint\b/CDB___ham_cprint/g; s/\b__ham_db_close\b/CDB___ham_db_close/g; s/\b__ham_db_create\b/CDB___ham_db_create/g; s/\b__ham_del_pair\b/CDB___ham_del_pair/g; s/\b__ham_delete\b/CDB___ham_delete/g; s/\b__ham_dirty_meta\b/CDB___ham_dirty_meta/g; s/\b__ham_dirty_page\b/CDB___ham_dirty_page/g; s/\b__ham_dpair\b/CDB___ham_dpair/g; s/\b__ham_dsearch\b/CDB___ham_dsearch/g; s/\b__ham_dup_convert\b/CDB___ham_dup_convert/g; s/\b__ham_dup_return\b/CDB___ham_dup_return/g; s/\b__ham_expand_table\b/CDB___ham_expand_table/g; s/\b__ham_free_pages\b/CDB___ham_free_pages/g; s/\b__ham_func2\b/CDB___ham_func2/g; s/\b__ham_func3\b/CDB___ham_func3/g; s/\b__ham_func4\b/CDB___ham_func4/g; s/\b__ham_func5\b/CDB___ham_func5/g; s/\b__ham_get_clist\b/CDB___ham_get_clist/g; s/\b__ham_get_cpage\b/CDB___ham_get_cpage/g; s/\b__ham_get_meta\b/CDB___ham_get_meta/g; s/\b__ham_get_page\b/CDB___ham_get_page/g; s/\b__ham_groupalloc_log\b/CDB___ham_groupalloc_log/g; s/\b__ham_groupalloc_print\b/CDB___ham_groupalloc_print/g; s/\b__ham_groupalloc_read\b/CDB___ham_groupalloc_read/g; s/\b__ham_groupalloc_recover\b/CDB___ham_groupalloc_recover/g; s/\b__ham_init_dbt\b/CDB___ham_init_dbt/g; s/\b__ham_init_htab\b/CDB___ham_init_htab/g; s/\b__ham_init_print\b/CDB___ham_init_print/g; s/\b__ham_init_recover\b/CDB___ham_init_recover/g; s/\b__ham_insdel_log\b/CDB___ham_insdel_log/g; s/\b__ham_insdel_print\b/CDB___ham_insdel_print/g; s/\b__ham_insdel_read\b/CDB___ham_insdel_read/g; s/\b__ham_insdel_recover\b/CDB___ham_insdel_recover/g; s/\b__ham_item\b/CDB___ham_item/g; s/\b__ham_item_done\b/CDB___ham_item_done/g; s/\b__ham_item_first\b/CDB___ham_item_first/g; s/\b__ham_item_init\b/CDB___ham_item_init/g; s/\b__ham_item_last\b/CDB___ham_item_last/g; s/\b__ham_item_next\b/CDB___ham_item_next/g; s/\b__ham_item_prev\b/CDB___ham_item_prev/g; s/\b__ham_item_reset\b/CDB___ham_item_reset/g; s/\b__ham_lock_bucket\b/CDB___ham_lock_bucket/g; s/\b__ham_lookup\b/CDB___ham_lookup/g; s/\b__ham_make_dup\b/CDB___ham_make_dup/g; s/\b__ham_metachk\b/CDB___ham_metachk/g; s/\b__ham_metagroup_log\b/CDB___ham_metagroup_log/g; s/\b__ham_metagroup_print\b/CDB___ham_metagroup_print/g; s/\b__ham_metagroup_read\b/CDB___ham_metagroup_read/g; s/\b__ham_metagroup_recover\b/CDB___ham_metagroup_recover/g; s/\b__ham_move_offpage\b/CDB___ham_move_offpage/g; s/\b__ham_mswap\b/CDB___ham_mswap/g; s/\b__ham_newpage_log\b/CDB___ham_newpage_log/g; s/\b__ham_newpage_print\b/CDB___ham_newpage_print/g; s/\b__ham_newpage_read\b/CDB___ham_newpage_read/g; s/\b__ham_newpage_recover\b/CDB___ham_newpage_recover/g; s/\b__ham_newpgno_log\b/CDB___ham_newpgno_log/g; s/\b__ham_newpgno_print\b/CDB___ham_newpgno_print/g; s/\b__ham_newpgno_read\b/CDB___ham_newpgno_read/g; s/\b__ham_newpgno_recover\b/CDB___ham_newpgno_recover/g; s/\b__ham_next_cpage\b/CDB___ham_next_cpage/g; s/\b__ham_onpage_replace\b/CDB___ham_onpage_replace/g; s/\b__ham_open\b/CDB___ham_open/g; s/\b__ham_overwrite\b/CDB___ham_overwrite/g; s/\b__ham_ovfl_log\b/CDB___ham_ovfl_log/g; s/\b__ham_ovfl_print\b/CDB___ham_ovfl_print/g; s/\b__ham_ovfl_read\b/CDB___ham_ovfl_read/g; s/\b__ham_ovfl_recover\b/CDB___ham_ovfl_recover/g; s/\b__ham_pgin\b/CDB___ham_pgin/g; s/\b__ham_pgout\b/CDB___ham_pgout/g; s/\b__ham_put_page\b/CDB___ham_put_page/g; s/\b__ham_putitem\b/CDB___ham_putitem/g; s/\b__ham_reclaim\b/CDB___ham_reclaim/g; s/\b__ham_release_meta\b/CDB___ham_release_meta/g; s/\b__ham_replace_log\b/CDB___ham_replace_log/g; s/\b__ham_replace_print\b/CDB___ham_replace_print/g; s/\b__ham_replace_read\b/CDB___ham_replace_read/g; s/\b__ham_replace_recover\b/CDB___ham_replace_recover/g; s/\b__ham_replpair\b/CDB___ham_replpair/g; s/\b__ham_reputpair\b/CDB___ham_reputpair/g; s/\b__ham_set_h_ffactor\b/CDB___ham_set_h_ffactor/g; s/\b__ham_set_h_hash\b/CDB___ham_set_h_hash/g; s/\b__ham_set_h_nelem\b/CDB___ham_set_h_nelem/g; s/\b__ham_split_page\b/CDB___ham_split_page/g; s/\b__ham_splitdata_log\b/CDB___ham_splitdata_log/g; s/\b__ham_splitdata_print\b/CDB___ham_splitdata_print/g; s/\b__ham_splitdata_read\b/CDB___ham_splitdata_read/g; s/\b__ham_splitdata_recover\b/CDB___ham_splitdata_recover/g; s/\b__ham_splitmeta_log\b/CDB___ham_splitmeta_log/g; s/\b__ham_splitmeta_print\b/CDB___ham_splitmeta_print/g; s/\b__ham_splitmeta_read\b/CDB___ham_splitmeta_read/g; s/\b__ham_splitmeta_recover\b/CDB___ham_splitmeta_recover/g; s/\b__ham_stat\b/CDB___ham_stat/g; s/\b__ham_stat_callback\b/CDB___ham_stat_callback/g; s/\b__ham_traverse\b/CDB___ham_traverse/g; s/\b__ham_upgrade\b/CDB___ham_upgrade/g; s/\b__ham_upgrade5\b/CDB___ham_upgrade5/g; s/\b__lock_addfamilylocker\b/CDB___lock_addfamilylocker/g; s/\b__lock_checklocker\b/CDB___lock_checklocker/g; s/\b__lock_close\b/CDB___lock_close/g; s/\b__lock_cmp\b/CDB___lock_cmp/g; s/\b__lock_dbenv_close\b/CDB___lock_dbenv_close/g; s/\b__lock_dbenv_create\b/CDB___lock_dbenv_create/g; s/\b__lock_downgrade\b/CDB___lock_downgrade/g; s/\b__lock_dump_locker\b/CDB___lock_dump_locker/g; s/\b__lock_dump_object\b/CDB___lock_dump_object/g; s/\b__lock_dump_region\b/CDB___lock_dump_region/g; s/\b__lock_dump_status\b/CDB___lock_dump_status/g; s/\b__lock_freefamilylocker\b/CDB___lock_freefamilylocker/g; s/\b__lock_freelocker\b/CDB___lock_freelocker/g; s/\b__lock_get_internal\b/CDB___lock_get_internal/g; s/\b__lock_getlocker\b/CDB___lock_getlocker/g; s/\b__lock_getobj\b/CDB___lock_getobj/g; s/\b__lock_init\b/CDB___lock_init/g; s/\b__lock_is_parent\b/CDB___lock_is_parent/g; s/\b__lock_lhash\b/CDB___lock_lhash/g; s/\b__lock_locker_cmp\b/CDB___lock_locker_cmp/g; s/\b__lock_locker_hash\b/CDB___lock_locker_hash/g; s/\b__lock_ohash\b/CDB___lock_ohash/g; s/\b__lock_open\b/CDB___lock_open/g; s/\b__lock_printlock\b/CDB___lock_printlock/g; s/\b__lock_promote\b/CDB___lock_promote/g; s/\b__lock_put_internal\b/CDB___lock_put_internal/g; s/\b__lock_put_nolock\b/CDB___lock_put_nolock/g; s/\b__lock_region_size\b/CDB___lock_region_size/g; s/\b__lock_remove_waiter\b/CDB___lock_remove_waiter/g; s/\b__lock_set_lk_conflicts\b/CDB___lock_set_lk_conflicts/g; s/\b__lock_set_lk_detect\b/CDB___lock_set_lk_detect/g; s/\b__lock_set_lk_max\b/CDB___lock_set_lk_max/g; s/\b__log_add_logid\b/CDB___log_add_logid/g; s/\b__log_close\b/CDB___log_close/g; s/\b__log_close_files\b/CDB___log_close_files/g; s/\b__log_dbenv_create\b/CDB___log_dbenv_create/g; s/\b__log_do_open\b/CDB___log_do_open/g; s/\b__log_fill\b/CDB___log_fill/g; s/\b__log_find\b/CDB___log_find/g; s/\b__log_findckp\b/CDB___log_findckp/g; s/\b__log_flush\b/CDB___log_flush/g; s/\b__log_get\b/CDB___log_get/g; s/\b__log_init\b/CDB___log_init/g; s/\b__log_init_print\b/CDB___log_init_print/g; s/\b__log_init_recover\b/CDB___log_init_recover/g; s/\b__log_lid_to_fname\b/CDB___log_lid_to_fname/g; s/\b__log_name\b/CDB___log_name/g; s/\b__log_newfh\b/CDB___log_newfh/g; s/\b__log_open\b/CDB___log_open/g; s/\b__log_open_file\b/CDB___log_open_file/g; s/\b__log_put\b/CDB___log_put/g; s/\b__log_putr\b/CDB___log_putr/g; s/\b__log_recover\b/CDB___log_recover/g; s/\b__log_register_log\b/CDB___log_register_log/g; s/\b__log_register_print\b/CDB___log_register_print/g; s/\b__log_register_read\b/CDB___log_register_read/g; s/\b__log_register_recover\b/CDB___log_register_recover/g; s/\b__log_rem_logid\b/CDB___log_rem_logid/g; s/\b__log_set_lg_bsize\b/CDB___log_set_lg_bsize/g; s/\b__log_set_lg_max\b/CDB___log_set_lg_max/g; s/\b__log_valid\b/CDB___log_valid/g; s/\b__log_write\b/CDB___log_write/g; s/\b__lsn_diff\b/CDB___lsn_diff/g; s/\b__mcache_init\b/CDB___mcache_init/g; s/\b__memp_alloc\b/CDB___memp_alloc/g; s/\b__memp_bhfree\b/CDB___memp_bhfree/g; s/\b__memp_bhwrite\b/CDB___memp_bhwrite/g; s/\b__memp_close\b/CDB___memp_close/g; s/\b__memp_cmpr\b/CDB___memp_cmpr/g; s/\b__memp_cmpr_alloc\b/CDB___memp_cmpr_alloc/g; s/\b__memp_cmpr_alloc_chain\b/CDB___memp_cmpr_alloc_chain/g; s/\b__memp_cmpr_close\b/CDB___memp_cmpr_close/g; s/\b__memp_cmpr_coefficient\b/CDB___memp_cmpr_coefficient/g; s/\b__memp_cmpr_deflate\b/CDB___memp_cmpr_deflate/g; s/\b__memp_cmpr_free\b/CDB___memp_cmpr_free/g; s/\b__memp_cmpr_free_chain\b/CDB___memp_cmpr_free_chain/g; s/\b__memp_cmpr_inflate\b/CDB___memp_cmpr_inflate/g; s/\b__memp_cmpr_info_valid\b/CDB___memp_cmpr_info_valid/g; s/\b__memp_cmpr_open\b/CDB___memp_cmpr_open/g; s/\b__memp_cmpr_page\b/CDB___memp_cmpr_page/g; s/\b__memp_cmpr_read\b/CDB___memp_cmpr_read/g; s/\b__memp_cmpr_write\b/CDB___memp_cmpr_write/g; s/\b__memp_dbenv_create\b/CDB___memp_dbenv_create/g; s/\b__memp_dump_region\b/CDB___memp_dump_region/g; s/\b__memp_dumpcache\b/CDB___memp_dumpcache/g; s/\b__memp_fn\b/CDB___memp_fn/g; s/\b__memp_fns\b/CDB___memp_fns/g; s/\b__memp_fopen\b/CDB___memp_fopen/g; s/\b__memp_fremove\b/CDB___memp_fremove/g; s/\b__memp_fsync\b/CDB___memp_fsync/g; s/\b__memp_mf_close\b/CDB___memp_mf_close/g; s/\b__memp_mf_open\b/CDB___memp_mf_open/g; s/\b__memp_open\b/CDB___memp_open/g; s/\b__memp_pbh\b/CDB___memp_pbh/g; s/\b__memp_pg\b/CDB___memp_pg/g; s/\b__memp_pgread\b/CDB___memp_pgread/g; s/\b__memp_pgwrite\b/CDB___memp_pgwrite/g; s/\b__memp_sballoc\b/CDB___memp_sballoc/g; s/\b__memp_set_cachesize\b/CDB___memp_set_cachesize/g; s/\b__memp_set_mp_mmapsize\b/CDB___memp_set_mp_mmapsize/g; s/\b__memp_trick\b/CDB___memp_trick/g; s/\b__memp_upgrade\b/CDB___memp_upgrade/g; s/\b__mp_xxx_fh\b/CDB___mp_xxx_fh/g; s/\b__mpool_init\b/CDB___mpool_init/g; s/\b__os_abspath\b/CDB___os_abspath/g; s/\b__os_calloc\b/CDB___os_calloc/g; s/\b__os_closehandle\b/CDB___os_closehandle/g; s/\b__os_dbenv_create\b/CDB___os_dbenv_create/g; s/\b__os_dirfree\b/CDB___os_dirfree/g; s/\b__os_dirlist\b/CDB___os_dirlist/g; s/\b__os_exists\b/CDB___os_exists/g; s/\b__os_fileid\b/CDB___os_fileid/g; s/\b__os_finit\b/CDB___os_finit/g; s/\b__os_fpinit\b/CDB___os_fpinit/g; s/\b__os_free\b/CDB___os_free/g; s/\b__os_freestr\b/CDB___os_freestr/g; s/\b__os_fsync\b/CDB___os_fsync/g; s/\b__os_get_errno\b/CDB___os_get_errno/g; s/\b__os_io\b/CDB___os_io/g; s/\b__os_ioinfo\b/CDB___os_ioinfo/g; s/\b__os_isroot\b/CDB___os_isroot/g; s/\b__os_malloc\b/CDB___os_malloc/g; s/\b__os_map\b/CDB___os_map/g; s/\b__os_mapfile\b/CDB___os_mapfile/g; s/\b__os_open\b/CDB___os_open/g; s/\b__os_openhandle\b/CDB___os_openhandle/g; s/\b__os_r_attach\b/CDB___os_r_attach/g; s/\b__os_r_detach\b/CDB___os_r_detach/g; s/\b__os_r_sysattach\b/CDB___os_r_sysattach/g; s/\b__os_r_sysdetach\b/CDB___os_r_sysdetach/g; s/\b__os_read\b/CDB___os_read/g; s/\b__os_realloc\b/CDB___os_realloc/g; s/\b__os_rename\b/CDB___os_rename/g; s/\b__os_seek\b/CDB___os_seek/g; s/\b__os_set_errno\b/CDB___os_set_errno/g; s/\b__os_set_func_close\b/CDB___os_set_func_close/g; s/\b__os_set_func_dirfree\b/CDB___os_set_func_dirfree/g; s/\b__os_set_func_dirlist\b/CDB___os_set_func_dirlist/g; s/\b__os_set_func_exists\b/CDB___os_set_func_exists/g; s/\b__os_set_func_free\b/CDB___os_set_func_free/g; s/\b__os_set_func_fsync\b/CDB___os_set_func_fsync/g; s/\b__os_set_func_ioinfo\b/CDB___os_set_func_ioinfo/g; s/\b__os_set_func_malloc\b/CDB___os_set_func_malloc/g; s/\b__os_set_func_map\b/CDB___os_set_func_map/g; s/\b__os_set_func_open\b/CDB___os_set_func_open/g; s/\b__os_set_func_read\b/CDB___os_set_func_read/g; s/\b__os_set_func_realloc\b/CDB___os_set_func_realloc/g; s/\b__os_set_func_rename\b/CDB___os_set_func_rename/g; s/\b__os_set_func_seek\b/CDB___os_set_func_seek/g; s/\b__os_set_func_sleep\b/CDB___os_set_func_sleep/g; s/\b__os_set_func_unlink\b/CDB___os_set_func_unlink/g; s/\b__os_set_func_unmap\b/CDB___os_set_func_unmap/g; s/\b__os_set_func_write\b/CDB___os_set_func_write/g; s/\b__os_set_func_yield\b/CDB___os_set_func_yield/g; s/\b__os_sleep\b/CDB___os_sleep/g; s/\b__os_spin\b/CDB___os_spin/g; s/\b__os_strdup\b/CDB___os_strdup/g; s/\b__os_sysconf\b/CDB___os_sysconf/g; s/\b__os_tmpdir\b/CDB___os_tmpdir/g; s/\b__os_unlink\b/CDB___os_unlink/g; s/\b__os_unmapfile\b/CDB___os_unmapfile/g; s/\b__os_write\b/CDB___os_write/g; s/\b__os_yield\b/CDB___os_yield/g; s/\b__qam_add_log\b/CDB___qam_add_log/g; s/\b__qam_add_print\b/CDB___qam_add_print/g; s/\b__qam_add_read\b/CDB___qam_add_read/g; s/\b__qam_add_recover\b/CDB___qam_add_recover/g; s/\b__qam_c_close\b/CDB___qam_c_close/g; s/\b__qam_c_del\b/CDB___qam_c_del/g; s/\b__qam_c_destroy\b/CDB___qam_c_destroy/g; s/\b__qam_c_dup\b/CDB___qam_c_dup/g; s/\b__qam_c_get\b/CDB___qam_c_get/g; s/\b__qam_c_init\b/CDB___qam_c_init/g; s/\b__qam_c_put\b/CDB___qam_c_put/g; s/\b__qam_db_close\b/CDB___qam_db_close/g; s/\b__qam_db_create\b/CDB___qam_db_create/g; s/\b__qam_del_log\b/CDB___qam_del_log/g; s/\b__qam_del_print\b/CDB___qam_del_print/g; s/\b__qam_del_read\b/CDB___qam_del_read/g; s/\b__qam_del_recover\b/CDB___qam_del_recover/g; s/\b__qam_delete\b/CDB___qam_delete/g; s/\b__qam_getno\b/CDB___qam_getno/g; s/\b__qam_i_delete\b/CDB___qam_i_delete/g; s/\b__qam_i_put\b/CDB___qam_i_put/g; s/\b__qam_inc_log\b/CDB___qam_inc_log/g; s/\b__qam_inc_print\b/CDB___qam_inc_print/g; s/\b__qam_inc_read\b/CDB___qam_inc_read/g; s/\b__qam_inc_recover\b/CDB___qam_inc_recover/g; s/\b__qam_incfirst_log\b/CDB___qam_incfirst_log/g; s/\b__qam_incfirst_print\b/CDB___qam_incfirst_print/g; s/\b__qam_incfirst_read\b/CDB___qam_incfirst_read/g; s/\b__qam_incfirst_recover\b/CDB___qam_incfirst_recover/g; s/\b__qam_init_print\b/CDB___qam_init_print/g; s/\b__qam_init_recover\b/CDB___qam_init_recover/g; s/\b__qam_metachk\b/CDB___qam_metachk/g; s/\b__qam_mswap\b/CDB___qam_mswap/g; s/\b__qam_mvptr_log\b/CDB___qam_mvptr_log/g; s/\b__qam_mvptr_print\b/CDB___qam_mvptr_print/g; s/\b__qam_mvptr_read\b/CDB___qam_mvptr_read/g; s/\b__qam_mvptr_recover\b/CDB___qam_mvptr_recover/g; s/\b__qam_nrecs\b/CDB___qam_nrecs/g; s/\b__qam_open\b/CDB___qam_open/g; s/\b__qam_pgin_out\b/CDB___qam_pgin_out/g; s/\b__qam_pitem\b/CDB___qam_pitem/g; s/\b__qam_position\b/CDB___qam_position/g; s/\b__qam_put\b/CDB___qam_put/g; s/\b__qam_stat\b/CDB___qam_stat/g; s/\b__ram_add\b/CDB___ram_add/g; s/\b__ram_c_del\b/CDB___ram_c_del/g; s/\b__ram_c_get\b/CDB___ram_c_get/g; s/\b__ram_c_put\b/CDB___ram_c_put/g; s/\b__ram_ca\b/CDB___ram_ca/g; s/\b__ram_delete\b/CDB___ram_delete/g; s/\b__ram_fmap\b/CDB___ram_fmap/g; s/\b__ram_getno\b/CDB___ram_getno/g; s/\b__ram_i_delete\b/CDB___ram_i_delete/g; s/\b__ram_open\b/CDB___ram_open/g; s/\b__ram_put\b/CDB___ram_put/g; s/\b__ram_root\b/CDB___ram_root/g; s/\b__ram_set_flags\b/CDB___ram_set_flags/g; s/\b__ram_set_re_delim\b/CDB___ram_set_re_delim/g; s/\b__ram_set_re_len\b/CDB___ram_set_re_len/g; s/\b__ram_set_re_pad\b/CDB___ram_set_re_pad/g; s/\b__ram_set_re_source\b/CDB___ram_set_re_source/g; s/\b__ram_source\b/CDB___ram_source/g; s/\b__ram_update\b/CDB___ram_update/g; s/\b__ram_vmap\b/CDB___ram_vmap/g; s/\b__ram_writeback\b/CDB___ram_writeback/g; s/\b__txn_activekids\b/CDB___txn_activekids/g; s/\b__txn_begin\b/CDB___txn_begin/g; s/\b__txn_check_running\b/CDB___txn_check_running/g; s/\b__txn_child_log\b/CDB___txn_child_log/g; s/\b__txn_child_print\b/CDB___txn_child_print/g; s/\b__txn_child_read\b/CDB___txn_child_read/g; s/\b__txn_child_recover\b/CDB___txn_child_recover/g; s/\b__txn_ckp_log\b/CDB___txn_ckp_log/g; s/\b__txn_ckp_print\b/CDB___txn_ckp_print/g; s/\b__txn_ckp_read\b/CDB___txn_ckp_read/g; s/\b__txn_ckp_recover\b/CDB___txn_ckp_recover/g; s/\b__txn_close\b/CDB___txn_close/g; s/\b__txn_count\b/CDB___txn_count/g; s/\b__txn_dbenv_create\b/CDB___txn_dbenv_create/g; s/\b__txn_end\b/CDB___txn_end/g; s/\b__txn_freekids\b/CDB___txn_freekids/g; s/\b__txn_init\b/CDB___txn_init/g; s/\b__txn_init_print\b/CDB___txn_init_print/g; s/\b__txn_init_recover\b/CDB___txn_init_recover/g; s/\b__txn_is_ancestor\b/CDB___txn_is_ancestor/g; s/\b__txn_lsn\b/CDB___txn_lsn/g; s/\b__txn_makefamily\b/CDB___txn_makefamily/g; s/\b__txn_open\b/CDB___txn_open/g; s/\b__txn_regop_log\b/CDB___txn_regop_log/g; s/\b__txn_regop_print\b/CDB___txn_regop_print/g; s/\b__txn_regop_read\b/CDB___txn_regop_read/g; s/\b__txn_regop_recover\b/CDB___txn_regop_recover/g; s/\b__txn_set_tx_max\b/CDB___txn_set_tx_max/g; s/\b__txn_set_tx_recover\b/CDB___txn_set_tx_recover/g; s/\b__txn_undo\b/CDB___txn_undo/g; s/\b__txn_xa_begin\b/CDB___txn_xa_begin/g; s/\b__txn_xa_regop_log\b/CDB___txn_xa_regop_log/g; s/\b__txn_xa_regop_print\b/CDB___txn_xa_regop_print/g; s/\b__txn_xa_regop_read\b/CDB___txn_xa_regop_read/g; s/\b__txn_xa_regop_recover\b/CDB___txn_xa_regop_recover/g; s/\b__ua_memcpy\b/CDB___ua_memcpy/g; s/\b__usermem\b/CDB___usermem/g; s/\b__xa_close\b/CDB___xa_close/g; s/\b__xa_cursor\b/CDB___xa_cursor/g; s/\b__xa_del\b/CDB___xa_del/g; s/\b__xa_get\b/CDB___xa_get/g; s/\b__xa_put\b/CDB___xa_put/g; s/\b__xa_txn_end\b/CDB___xa_txn_end/g; s/\b__xa_txn_init\b/CDB___xa_txn_init/g; s/\bdb_create\b/CDB_db_create/g; s/\bdb_env_create\b/CDB_db_env_create/g; s/\bdb_strerror\b/CDB_db_strerror/g; s/\bdb_version\b/CDB_db_version/g; s/\block_detect\b/CDB_lock_detect/g; s/\block_get\b/CDB_lock_get/g; s/\block_id\b/CDB_lock_id/g; s/\block_put\b/CDB_lock_put/g; s/\block_stat\b/CDB_lock_stat/g; s/\block_vec\b/CDB_lock_vec/g; s/\blog_archive\b/CDB_log_archive/g; s/\blog_compare\b/CDB_log_compare/g; s/\blog_file\b/CDB_log_file/g; s/\blog_flush\b/CDB_log_flush/g; s/\blog_get\b/CDB_log_get/g; s/\blog_put\b/CDB_log_put/g; s/\blog_register\b/CDB_log_register/g; s/\blog_stat\b/CDB_log_stat/g; s/\blog_unregister\b/CDB_log_unregister/g; s/\bmemp_fclose\b/CDB_memp_fclose/g; s/\bmemp_fget\b/CDB_memp_fget/g; s/\bmemp_fopen\b/CDB_memp_fopen/g; s/\bmemp_fput\b/CDB_memp_fput/g; s/\bmemp_fset\b/CDB_memp_fset/g; s/\bmemp_fsync\b/CDB_memp_fsync/g; s/\bmemp_register\b/CDB_memp_register/g; s/\bmemp_stat\b/CDB_memp_stat/g; s/\bmemp_sync\b/CDB_memp_sync/g; s/\bmemp_trickle\b/CDB_memp_trickle/g; s/\btxn_abort\b/CDB_txn_abort/g; s/\btxn_begin\b/CDB_txn_begin/g; s/\btxn_checkpoint\b/CDB_txn_checkpoint/g; s/\btxn_commit\b/CDB_txn_commit/g; s/\btxn_id\b/CDB_txn_id/g; s/\btxn_prepare\b/CDB_txn_prepare/g; s/\btxn_stat\b/CDB_txn_stat/g; s/\b__db_global_values\b/CDB___db_global_values/g; s/\bdb_riw_conflicts\b/CDB_db_riw_conflicts/g; s/\bdb_rw_conflicts\b/CDB_db_rw_conflicts/g; s/\bdb_xa_switch\b/CDB_db_xa_switch/g; s/\b__db_jump\b/CDB___db_jump/g; ' $i done �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam.c������������������������������������������������������������������������������0100644�0063146�0012731�00000071140�07427026535�013707� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam.c 11.23 (Sleepycat) 10/26/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_am.h" #include "lock.h" #include "qam.h" #include "mp.h" static int CDB___qam_c_close __P((DBC *)); static int CDB___qam_c_del __P((DBC *, u_int32_t)); static int CDB___qam_c_get __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___qam_c_put __P((DBC *, DBT *, DBT *, u_int32_t)); static int CDB___qam_getno __P((DB *, const DBT *, db_recno_t *)); static int CDB___qam_i_delete __P((DBC *)); static int CDB___qam_i_put __P((DBC *, DBT *, u_int32_t)); static int CDB___qam_nrecs __P((DBC *, db_recno_t *, db_recno_t *)); static int CDB___qam_position __P((DBC *, db_recno_t *, db_lockmode_t, db_recno_t, int *)); static int CDB___qam_c_destroy __P((DBC *)); /* * CDB___qam_nrecs -- * Return the record number for the head and tail of the queue. */ static int CDB___qam_nrecs(dbc, rep, start) DBC *dbc; db_recno_t *rep, *start; { DB *dbp; DB_LOCK lock; QMETA *meta; db_pgno_t pg; int ret; dbp = dbc->dbp; pg = ((QUEUE *)dbp->q_internal)->q_meta; if ((ret = CDB___db_lget(dbc, 0, pg, DB_LOCK_READ, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &meta)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, lock); return (ret); } *rep = meta->cur_recno; *start = meta->start; if ((ret = CDB_memp_fput(dbp->mpf, meta, 0)) != 0) return (ret); /* Don't hold the meta page long term. */ if ((ret = __LPUT(dbc, lock)) != 0) return (ret); return (0); } /* * CDB___qam_position -- * Position a queued access method cursor at a record. This returns * the page locked. *exactp will be set if the record is valid. */ static int CDB___qam_position(dbc, recnop, lock_mode, start, exactp) DBC *dbc; /* open cursor */ db_recno_t *recnop; /* pointer to recno to find */ db_lockmode_t lock_mode;/* locking: read or write */ db_recno_t start; /* meta.start */ int *exactp; /* indicate if it was found */ { QUEUE_CURSOR *cp; DB *dbp; QAMDATA *qp; db_pgno_t pg; int ret; dbp = dbc->dbp; cp = (QUEUE_CURSOR *) dbc->internal; /* Fetch the page for this recno. */ pg = QAM_RECNO_PAGE(dbp, start, *recnop); if ((ret = CDB___db_lget(dbc, 0, pg, lock_mode, 0, &cp->lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, lock_mode == DB_LOCK_WRITE ? DB_MPOOL_CREATE : 0, &cp->page)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, cp->lock); cp->lock.off = LOCK_INVALID; return (ret); } cp->pgno = pg; cp->indx = QAM_RECNO_INDEX(dbp, pg, start, *recnop); if (cp->page->pgno == 0) { if (F_ISSET(dbp, DB_AM_RDONLY)) { *exactp = 0; return (0); } cp->page->pgno = pg; cp->page->type = P_QAMDATA; } qp = QAM_GET_RECORD(dbp, cp->page, cp->indx); *exactp = F_ISSET(qp, QAM_VALID); return (ret); } /* * CDB___qam_pitem -- * Put an item on a queue page. Copy the data to the page and set the * VALID and SET bits. If logging and the record was previously set, * log that data, otherwise just log the new data. * * pagep must be write locked * * PUBLIC: int CDB___qam_pitem * PUBLIC: __P((DBC *, QPAGE *, u_int32_t, db_recno_t, DBT *)); */ int CDB___qam_pitem(dbc, pagep, indx, recno, data) DBC *dbc; QPAGE *pagep; u_int32_t indx; db_recno_t recno; DBT *data; { DB *dbp; DBT olddata, pdata, *datap; QAMDATA *qp; QUEUE *t; u_int32_t size; u_int8_t *dest, *p; int alloced, ret; alloced = ret = 0; dbp = dbc->dbp; t = (QUEUE *)dbp->q_internal; if (data->size > t->re_len) return (EINVAL); qp = QAM_GET_RECORD(dbp, pagep, indx); p = qp->data; size = data->size; datap = data; if (F_ISSET(data, DB_DBT_PARTIAL)) { if (data->size != data->dlen) return (EINVAL); if (data->doff + data->dlen > t->re_len) return (EINVAL); if (data->size == t->re_len) goto no_partial; /* * If we are logging, then we have to build the record * first, otherwise, we can simply drop the change * directly on the page. After this clause, make * sure that datap and p are set up correctly so that * copying datap into p does the right thing. * * Note, I am changing this so that if the existing * record is not valid, we create a complete record * to log so that both this and the recovery code is simpler. */ if (DB_LOGGING(dbc) || !F_ISSET(qp, QAM_VALID)) { datap = &pdata; memset(datap, 0, sizeof(*datap)); if ((ret = CDB___os_malloc(t->re_len, NULL, &datap->data)) != 0) return (ret); alloced = 1; datap->size = t->re_len; /* * Construct the record if it's valid, otherwise set it * all to the pad character. */ dest = datap->data; if (F_ISSET(qp, QAM_VALID)) memcpy(dest, p, t->re_len); else memset(dest, t->re_pad, t->re_len); dest += data->doff; memcpy(dest, data->data, data->size); } else { datap = data; p += data->doff; } } no_partial: if (DB_LOGGING(dbc)) { olddata.size = 0; if (F_ISSET(qp, QAM_SET)) { olddata.data = qp->data; olddata.size = t->re_len; } if ((ret = CDB___qam_add_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, dbp->log_fileid, &LSN(pagep), pagep->pgno, indx, recno, datap, qp->flags, olddata.size == 0 ? NULL : &olddata)) != 0) goto err; } F_SET(qp, QAM_VALID | QAM_SET); memcpy(p, datap->data, datap->size); if (!F_ISSET(data, DB_DBT_PARTIAL)) memset(p + datap->size, t->re_pad, t->re_len - datap->size); err: if (alloced) CDB___os_free(datap->data, t->re_len); return (ret); } /* * CDB___qam_c_put * Cursor put for queued access method. * BEFORE and AFTER cannot be specified. */ static int CDB___qam_c_put(dbc, key, data, flags) DBC *dbc; DBT *key, *data; u_int32_t flags; { QUEUE_CURSOR *cp; DB_LOCK lock; int ret; /* Check for invalid flags. */ if ((ret = CDB___db_cputchk(dbc->dbp, key, data, flags, F_ISSET(dbc->dbp, DB_AM_RDONLY), ((QUEUE_CURSOR *)dbc->internal)->recno != RECNO_OOB)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "qam_c_put", NULL, data, flags); cp = (QUEUE_CURSOR *)dbc->internal; lock = cp->lock; ret = CDB___qam_i_put(dbc, data, flags); /* Release any previous lock, if not in a transaction. */ if (ret == 0 && lock.off != LOCK_INVALID) { if ((ret = __TLPUT(dbc, lock)) != 0) return (ret); cp->lock.off = LOCK_INVALID; } return (0); } /* * CDB___qam_i_put * Internal cursor put for queued access method. */ static int CDB___qam_i_put(dbc, data, flags) DBC *dbc; DBT *data; u_int32_t flags; { QUEUE_CURSOR *cp; DB *dbp; DB_LOCK lock; QMETA *meta; db_pgno_t pg; db_recno_t new_cur, new_first; u_int32_t opcode; int exact, ret, t_ret; dbp = dbc->dbp; PANIC_CHECK(dbp->dbenv); /* * If we are running CDB, this had better be either a write * cursor or an immediate writer. If it's a regular writer, * that means we have an IWRITE lock and we need to upgrade * it to a write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EINVAL); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (ret); } cp = (QUEUE_CURSOR *)dbc->internal; /* Write lock the record. */ if ((ret = CDB___db_lget(dbc, 0, cp->recno, DB_LOCK_WRITE, DB_LOCK_RECORD, &lock)) != 0) return (ret); if ((ret = CDB___qam_position(dbc, &cp->recno, DB_LOCK_WRITE, cp->start, &exact)) != 0) { /* We could not get the page, we can release the record lock. */ __LPUT(dbc, lock); return (ret); } if (exact && flags == DB_NOOVERWRITE) { ret = __TLPUT(dbc, lock); /* Doing record locking, release the page lock */ if ((t_ret = __LPUT(dbc, cp->lock)) == 0) cp->lock.off = LOCK_INVALID; else if (ret == 0) ret = t_ret; if ((t_ret = CDB_memp_fput(dbp->mpf, cp->page, 0)) != 0 && ret == 0) ret = t_ret; return (ret == 0 ? DB_KEYEXIST : ret); } /* Put the item on the page. */ ret = CDB___qam_pitem(dbc, (QPAGE *)cp->page, cp->indx, cp->recno, data); /* Doing record locking, release the page lock */ if ((t_ret = __LPUT(dbc, cp->lock)) != 0 && ret == 0) ret = t_ret; if ((t_ret = CDB_memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY)) && ret == 0) ret = t_ret; cp->lock = lock; cp->lock_mode = DB_LOCK_WRITE; if (ret != 0) return (ret); /* We may need to reset the head or tail of the queue. */ pg = ((QUEUE *)dbp->q_internal)->q_meta; if ((ret = CDB___db_lget(dbc, 0, pg, DB_LOCK_WRITE, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &meta)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, lock); return (ret); } opcode = 0; new_cur = new_first = 0; if (cp->recno > meta->cur_recno) { new_cur = cp->recno; opcode |= QAM_SETCUR; } if (cp->recno < meta->first_recno || meta->first_recno < meta->start) { new_first = cp->recno; opcode |= QAM_SETFIRST; } if (opcode != 0 && DB_LOGGING(dbc)) { ret = CDB___qam_mvptr_log(dbp->dbenv, dbc->txn, &meta->dbmeta.lsn, 0, opcode, dbp->log_fileid, meta->first_recno, new_first, meta->cur_recno, new_cur, &meta->dbmeta.lsn); } if (opcode & QAM_SETCUR) meta->cur_recno = cp->recno; if (opcode & QAM_SETFIRST) meta->first_recno = cp->recno; if ((t_ret = CDB_memp_fput(dbp->mpf, meta, opcode != 0 ? DB_MPOOL_DIRTY : 0)) != 0 && ret == 0) ret = t_ret; /* Don't hold the meta page long term. */ if ((t_ret = __LPUT(dbc, lock)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___qam_put -- * Add a record to the queue. * If we are doing anything but appending, just call qam_c_put to do the * work. Otherwise we fast path things here. * * PUBLIC: int CDB___qam_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); */ int CDB___qam_put(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { QUEUE_CURSOR *cp; DBC *dbc; DB_LOCK lock; QMETA *meta; QPAGE *page; db_pgno_t pg; db_recno_t recno, start, total; int ret, t_ret; PANIC_CHECK(dbp->dbenv); /* Allocate a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "qam_put", key, data, flags); cp = dbc->internal; /* Check for invalid flags. */ if ((ret = CDB___db_putchk(dbp, key, data, flags, F_ISSET(dbp, DB_AM_RDONLY), 0)) != 0) goto done; /* If not appending, then just call the cursor routine */ if (flags != DB_APPEND) { if ((ret = CDB___qam_getno(dbp, key, &cp->recno)) != 0) goto done; CDB___qam_nrecs(dbc, &total, &cp->start); ret = CDB___qam_i_put(dbc, data, flags); goto done; } /* Write lock the meta page. */ pg = ((QUEUE *)dbp->q_internal)->q_meta; if ((ret = CDB___db_lget(dbc, 0, pg, DB_LOCK_WRITE, 0, &lock)) != 0) goto done; if ((ret = CDB_memp_fget(dbp->mpf, &pg, 0, &meta)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, lock); goto done; } /* Record that we are going to allocate a record. */ if (DB_LOGGING(dbc)) { CDB___qam_inc_log(dbp->dbenv, txn, &meta->dbmeta.lsn, 0, dbp->log_fileid, &meta->dbmeta.lsn); } /* Get the next record number. */ recno = ++meta->cur_recno; start = meta->start; if (meta->first_recno < meta->start || meta->first_recno > recno) meta->first_recno = recno; /* Release the meta page. */ if ((ret = CDB_memp_fput(dbp->mpf, meta, DB_MPOOL_DIRTY)) != 0) return (ret); /* Lock the record and release meta page lock. */ if ((ret = CDB___db_lget(dbc, 1, recno, DB_LOCK_WRITE, DB_LOCK_RECORD, &lock)) != 0) goto done; cp->lock = lock; cp->lock_mode = DB_LOCK_WRITE; pg = QAM_RECNO_PAGE(dbp, start, recno); /* Fetch and write lock the data page. */ if ((ret = CDB___db_lget(dbc, 0, pg, DB_LOCK_WRITE, 0, &lock)) != 0) goto done; if ((ret = CDB_memp_fget(dbp->mpf, &pg, DB_MPOOL_CREATE, &page)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, lock); goto done; } /* See if this is a new page. */ if (page->pgno == 0) { page->pgno = pg; page->type = P_QAMDATA; } /* Put the item on the page and log it. */ if ((ret = CDB___qam_pitem(dbc, page, QAM_RECNO_INDEX(dbp, pg, start, recno), recno, data)) != 0) { /* The put failed. We did not change the row. */ (void)__LPUT(dbc, cp->lock); (void)CDB_memp_fput(dbp->mpf, cp->page, DB_MPOOL_DIRTY); return (ret); } /* Doing record locking, release the page lock */ if ((ret = __LPUT(dbc, lock)) != 0) return (ret); if ((ret = CDB_memp_fput(dbp->mpf, page, DB_MPOOL_DIRTY)) != 0) return (ret); /* Return the record number to the user. */ *(db_recno_t *)key->data = recno; done: /* Discard the cursor. */ if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___qam_i_delete -- * Internal version of recno delete, called by CDB___qam_delete and * CDB___qam_c_del. */ static int CDB___qam_i_delete(dbc) DBC *dbc; { QUEUE_CURSOR *cp; DB *dbp; DBT data; DB_LOCK lock; PAGE *pagep; QAMDATA *qp; db_recno_t start; int exact, ret, t_ret; dbp = dbc->dbp; cp = dbc->internal; start = cp->start; ret = 0; /* * If this is CDB and this isn't a write cursor, then it's an error. * If it is a write cursor, but we don't yet hold the write lock, then * we need to upgrade to the write lock. */ if (F_ISSET(dbp->dbenv, DB_ENV_CDB)) { /* Make sure it's a valid update cursor. */ if (!F_ISSET(dbc, DBC_WRITECURSOR | DBC_WRITER)) return (EINVAL); if (F_ISSET(dbc, DBC_WRITECURSOR) && (ret = CDB_lock_get(dbp->dbenv, dbc->locker, DB_LOCK_UPGRADE, &dbc->lock_dbt, DB_LOCK_WRITE, &dbc->mylock)) != 0) return (EAGAIN); } if ((ret = CDB___db_lget(dbc, 0, cp->recno, DB_LOCK_WRITE, DB_LOCK_RECORD, &lock)) != 0) goto err; cp->lock_mode = DB_LOCK_WRITE; /* Find the record ; delete only deletes exact matches. */ if ((ret = CDB___qam_position(dbc, &cp->recno, DB_LOCK_WRITE, start, &exact)) != 0) { cp->lock = lock; goto err; } if (!exact) { ret = DB_NOTFOUND; goto err1; } pagep = cp->page; qp = QAM_GET_RECORD(dbp, pagep, cp->indx); if (DB_LOGGING(dbc)) { data.size = ((QUEUE *)dbp->q_internal)->re_len; data.data = qp->data; if ((ret = CDB___qam_del_log(dbp->dbenv, dbc->txn, &LSN(pagep), 0, dbp->log_fileid, &LSN(pagep), pagep->pgno, cp->indx, cp->recno)) != 0) goto err1; } F_CLR(qp, QAM_VALID); err1: if ((t_ret = CDB_memp_fput( dbp->mpf, cp->page, ret == 0 ? DB_MPOOL_DIRTY : 0)) != 0) return (ret ? ret : t_ret); /* Doing record locking, release the page lock */ if ((t_ret = __LPUT(dbc, cp->lock)) != 0) { cp->lock = lock; return (ret ? ret : t_ret); } cp->lock = lock; return (ret); err: if (F_ISSET(dbp->dbenv, DB_ENV_CDB) && F_ISSET(dbc, DBC_WRITECURSOR)) (void)CDB___lock_downgrade( dbp->dbenv, &dbc->mylock, DB_LOCK_IWRITE, 0); return (ret); } /* * CDB___qam_delete -- * Queue db->del function. * * PUBLIC: int CDB___qam_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); */ int CDB___qam_delete(dbp, txn, key, flags) DB *dbp; DB_TXN *txn; DBT *key; u_int32_t flags; { QUEUE_CURSOR *cp; DBC *dbc; db_recno_t total; int ret, t_ret; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_delchk(dbp, key, flags, F_ISSET(dbp, DB_AM_RDONLY))) != 0) return (ret); /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, txn, &dbc, DB_WRITELOCK)) != 0) return (ret); DEBUG_LWRITE(dbc, txn, "qam_delete", key, NULL, flags); cp = dbc->internal; if ((ret = CDB___qam_getno(dbp, key, &cp->recno)) != 0) goto err; CDB___qam_nrecs(dbc, &total, &cp->start); /* Do the delete. */ if (cp->recno > total) { ret = DB_NOTFOUND; goto err; } ret = CDB___qam_i_delete(dbc); /* Release the cursor. */ err: if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___qam_c_del -- * Qam cursor->c_del function */ static int CDB___qam_c_del(dbc, flags) DBC *dbc; u_int32_t flags; { QUEUE_CURSOR *cp; DB *dbp; db_recno_t total; int ret; dbp = dbc->dbp; cp = dbc->internal; PANIC_CHECK(dbp->dbenv); /* Check for invalid flags. */ if ((ret = CDB___db_cdelchk(dbp, flags, F_ISSET(dbp, DB_AM_RDONLY), cp->recno != RECNO_OOB)) != 0) return (ret); DEBUG_LWRITE(dbc, dbc->txn, "qam_c_del", NULL, NULL, flags); if ((ret = CDB___qam_nrecs(dbc, &total, &cp->start)) != 0) return (ret); return (CDB___qam_i_delete(dbc)); } /* * CDB___qam_c_get -- * Queue cursor->c_get function. */ static int CDB___qam_c_get(dbc_orig, key, data, flags) DBC *dbc_orig; DBT *key, *data; u_int32_t flags; { QUEUE_CURSOR *cp, *orig; DB *dbp; DB_LOCK lock, pglock, metalock, save_lock; DBC *dbc; PAGE *pg; QAMDATA *qp; QMETA *meta; db_indx_t save_indx; db_lockmode_t lock_mode; db_pgno_t metapno, save_page; db_recno_t start, first, skipped, save_recno; int exact, is_first, locked, ret, t_ret, with_delete; int put_mode, meta_dirty; orig = dbc_orig->internal; dbp = dbc_orig->dbp; PANIC_CHECK(dbp->dbenv); with_delete = 0; lock_mode = DB_LOCK_READ; put_mode = 0; t_ret = 0; /* Check for invalid flags. */ if ((ret = CDB___db_cgetchk(dbp, key, data, flags, orig->recno != RECNO_OOB)) != 0) return (ret); /* Clear OR'd in additional bits so we can check for flag equality. */ if (LF_ISSET(DB_RMW)) { lock_mode = DB_LOCK_WRITE; LF_CLR(DB_RMW); } if (flags == DB_CONSUME) { with_delete = 1; flags = DB_FIRST; lock_mode = DB_LOCK_WRITE; } DEBUG_LREAD(dbc_orig, dbc_orig->txn, "qam_c_get", flags == DB_SET || flags == DB_SET_RANGE ? key : NULL, NULL, flags); /* Get a copy of the original cursor, including position. */ if ((ret = dbc_orig->c_dup(dbc_orig, &dbc, DB_POSITIONI)) != 0) return (ret); cp = dbc->internal; is_first = 0; /* get the meta page */ metapno = ((QUEUE *)dbp->q_internal)->q_meta; if ((ret = CDB___db_lget(dbc, 0, metapno, lock_mode, 0, &metalock)) != 0) return (ret); locked = 1; if ((ret = CDB_memp_fget(dbp->mpf, &metapno, 0, &meta)) != 0) { /* We did not fetch it, we can release the lock. */ (void)__LPUT(dbc, metalock); return (ret); } skipped = 0; /* Make lint and friends happy. */ first = 0; meta_dirty = 0; /* Release any previous lock if not in a transaction. */ if (cp->lock.off != LOCK_INVALID) { (void)__TLPUT(dbc, cp->lock); cp->lock.off = LOCK_INVALID; } retry: /* Update the record number. */ cp->start = start = meta->start; switch (flags) { case DB_CURRENT: break; case DB_NEXT: if (cp->recno != RECNO_OOB) { ++cp->recno; break; } /* FALLTHROUGH */ case DB_FIRST: flags = DB_NEXT; is_first = 1; /* get the first record number */ cp->recno = first = meta->first_recno; /* if we will delete it, then increment */ if (with_delete && first < meta->cur_recno) { if (DB_LOGGING(dbc)) CDB___qam_incfirst_log(dbp->dbenv, dbc->txn, &LSN(meta), 0, dbp->log_fileid, first); meta->first_recno++; meta_dirty = 1; } break; case DB_PREV: if (cp->recno != RECNO_OOB) { if (cp->recno <= meta->first_recno) { ret = DB_NOTFOUND; goto err; } --cp->recno; break; } /* FALLTHROUGH */ case DB_LAST: cp->recno = meta->cur_recno; if (cp->recno == 0) { ret = DB_NOTFOUND; goto err; } break; case DB_SET: case DB_SET_RANGE: if ((ret = CDB___qam_getno(dbp, key, &cp->recno)) != 0) goto err; break; } if (cp->recno > meta->cur_recno || cp->recno < start) { ret = DB_NOTFOUND; pg = NULL; if (skipped) goto undo_meta; goto err; } /* Don't hold the meta page long term. */ if (locked) { if ((ret = __LPUT(dbc, metalock)) != 0) goto err; locked = 0; } /* Lock the record. */ if ((ret = CDB___db_lget(dbc, 0, cp->recno, lock_mode, with_delete ? DB_LOCK_NOWAIT | DB_LOCK_RECORD : DB_LOCK_RECORD, &lock)) == DB_LOCK_NOTGRANTED) { /* * In the DB_CONSUME case we skip the locked * record, someone else will pick it up. * */ is_first = 0; if (skipped == 0) skipped = cp->recno; goto retry; } if (ret != 0) goto err; /* * In the DB_FIRST or DB_LAST cases we must wait and then start over * since the first/last may have moved while we slept. * We release our locks and try again. */ if ((!with_delete && is_first) || flags == DB_LAST) { if ((ret = CDB___db_lget(dbc, 0, metapno, lock_mode, 0, &metalock)) != 0) goto err; if (cp->recno != (is_first ? meta->first_recno : meta->cur_recno)) { __LPUT(dbc, lock); if (is_first) flags = DB_FIRST; locked = 1; goto retry; } /* Don't hold the meta page long term. */ if ((ret = __LPUT(dbc, metalock)) != 0) goto err; } /* Position the cursor on the record. */ if ((ret = CDB___qam_position(dbc, &cp->recno, lock_mode, start, &exact)) != 0) { /* We cannot get the page, release the record lock. */ (void)__LPUT(dbc, lock); goto err; } pg = cp->page; pglock = cp->lock; cp->lock = lock; cp->lock_mode = lock_mode; if (!exact) { if (flags == DB_NEXT || flags == DB_PREV || flags == DB_LAST) { /* Release locks and try again. */ (void)CDB_memp_fput(dbp->mpf, cp->page, 0); (void)__LPUT(dbc, pglock); (void)__LPUT(dbc, cp->lock); cp->lock.off = LOCK_INVALID; if (flags == DB_LAST) flags = DB_PREV; if (!with_delete) is_first = 0; goto retry; } /* this is for the SET and SET_RANGE cases */ ret = DB_KEYEMPTY; goto err1; } /* Return the key if the user didn't give us one. */ if (flags != DB_SET && (ret = CDB___db_retcopy(dbp, key, &cp->recno, sizeof(cp->recno), &dbc->rkey.data, &dbc->rkey.ulen)) != 0) { if (with_delete) goto undo_meta; else goto err1; } qp = QAM_GET_RECORD(dbp, pg, cp->indx); /* Return the data item. */ if ((ret = CDB___db_retcopy(dbp, data, qp->data, ((QUEUE *)dbp->q_internal)->re_len, &dbc->rdata.data, &dbc->rdata.ulen)) != 0) { if (with_delete) goto undo_meta; else goto err1; } /* Finally, if we are doing DB_CONSUME mark the record. */ if (with_delete) { if (DB_LOGGING(dbc)) if ((ret = CDB___qam_del_log(dbp->dbenv, dbc->txn, &LSN(pg), 0, dbp->log_fileid, &LSN(pg), pg->pgno, cp->indx, cp->recno)) != 0) goto undo_meta; F_CLR(qp, QAM_VALID); put_mode = DB_MPOOL_DIRTY; /* * This code is responsible for correcting metadata. * There are 3 cases. * 1) We moved ahead more than one record. * 2) We did not actually delete cp->recno. * 3) We encountered at least one locked. * record and skipped them. */ if (cp->recno != first) { if (0) { undo_meta: is_first = 0; } if (locked == 0 && (t_ret = CDB___db_lget( dbc, 0, metapno, lock_mode, 0, &metalock)) != 0) goto err1; if (is_first) { /* * Check to see if we moved past the first record, * if so update meta so others can start past the * deleted records. */ if (meta->first_recno > first) { meta->first_recno = cp->recno; meta_dirty = 1; } } else if (skipped == 0) { /* * Error case: we did not actually delete the * record, restore meta_first so that it is at * least at or before cp->recno */ if (meta->first_recno > cp->recno) { meta->first_recno = cp->recno; meta_dirty = 1; } } else if (meta->first_recno > skipped) { /* * We skipped some records because they were * locked. If the meta-data page reflects a * starting pointer after the skipped records * we need to move it back to the first record * that is not deleted or is sill locked. * Release locks as we go, we are only * reading to optimize future fetches. */ first = meta->first_recno; /* Don't hold the meta page long term. */ __LPUT(dbc, metalock); locked = 0; /* reverify the skipped record */ save_page = cp->pgno; save_indx = cp->indx; save_recno = cp->recno; save_lock = cp->lock; do { t_ret = CDB___db_lget(dbc, 0, skipped, DB_LOCK_READ, DB_LOCK_NOWAIT | DB_LOCK_RECORD, &lock); if (t_ret == DB_LOCK_NOTGRANTED) break; if (t_ret != 0) goto err1; if ((t_ret = CDB___qam_position(dbc, &skipped, DB_LOCK_READ, start, &exact)) != 0) { (void)__LPUT(dbc, lock); goto err1; } if ((t_ret = CDB_memp_fput(dbp->mpf, cp->page, put_mode)) != 0) goto err1; if ((t_ret =__LPUT(dbc, lock)) != 0) goto err1; if ((t_ret = __LPUT(dbc, cp->lock)) != 0) goto err1; if (exact) break; } while (++skipped <= first); t_ret = 0; if ((t_ret = CDB___db_lget( dbc, 0, metapno, lock_mode, 0, &metalock)) != 0) goto err1; if (meta->first_recno > skipped) { meta->first_recno = skipped; meta_dirty = 1; } cp->pgno = save_page; cp->indx = save_indx; cp->recno = save_recno; cp->lock = save_lock; } locked = 1; } } /* * Swap the cursors so we are left with the new position inside of * the original DBCs structure, and close the dup'd cursor once it * references the old position. * * The close can fail, but we only expect DB_LOCK_DEADLOCK failures. * This violates our "the cursor is unchanged on error" semantics, * but since all you can do with a DB_LOCK_DEADLOCK failure is close * the cursor, I believe that's OK. */ orig = dbc_orig->internal; dbc_orig->internal = dbc->internal; dbc->internal = orig; err1: if (pg != NULL) { if (!ret) ret = t_ret; t_ret = CDB_memp_fput(dbp->mpf, pg, put_mode); if (!ret) ret = t_ret; /* Doing record locking, release the page lock */ t_ret = __LPUT(dbc, pglock); } err: if (meta) { if (!ret) ret = t_ret; /* release the meta page */ t_ret = CDB_memp_fput( dbp->mpf, meta, meta_dirty ? DB_MPOOL_DIRTY : 0); if (!ret) ret = t_ret; /* Don't hold the meta page long term. */ if (locked) t_ret = __LPUT(dbc, metalock); } if (!ret) ret = t_ret; t_ret = dbc->c_close(dbc); return (ret ? ret : t_ret); } /* * CDB___qam_c_close -- * Close down the cursor from a single use. */ static int CDB___qam_c_close(dbc) DBC *dbc; { QUEUE_CURSOR *cp; cp = dbc->internal; /* Discard any locks not acquired inside of a transaction. */ if (cp->lock.off != LOCK_INVALID) { (void)__TLPUT(dbc, cp->lock); cp->lock.off = LOCK_INVALID; } cp->page = NULL; cp->pgno = PGNO_INVALID; cp->indx = 0; cp->lock.off = LOCK_INVALID; cp->lock_mode = DB_LOCK_NG; cp->recno = RECNO_OOB; cp->flags = 0; return (0); } /* * CDB___qam_c_dup -- * Duplicate a queue cursor, such that the new one holds appropriate * locks for the position of the original. * * PUBLIC: int CDB___qam_c_dup __P((DBC *, DBC *)); */ int CDB___qam_c_dup(orig_dbc, new_dbc) DBC *orig_dbc, *new_dbc; { QUEUE_CURSOR *orig, *new; orig = orig_dbc->internal; new = new_dbc->internal; new->pgno = orig->pgno; new->indx = orig->indx; new->recno = orig->recno; new->start = orig->start; new->lock_mode = orig->lock_mode; /* reget the long term lock if we are not in a xact */ if (orig_dbc->txn != NULL || orig->lock.off == LOCK_INVALID) return (0); return (CDB___db_lget(new_dbc, 0, new->recno, new->lock_mode, DB_LOCK_RECORD, &new->lock)); } /* * CDB___qam_c_init * * PUBLIC: int CDB___qam_c_init __P((DBC *)); */ int CDB___qam_c_init(dbc) DBC *dbc; { QUEUE_CURSOR *cp; DB *dbp; int ret; dbp = dbc->dbp; /* Allocate the internal structure. */ if ((ret = CDB___os_calloc(1, sizeof(QUEUE_CURSOR), &cp)) != 0) return (ret); /* * Logical record numbers are always the same size, and we don't want * to have to check for space every time we return one. Allocate it * in advance. */ if ((ret = CDB___os_malloc(sizeof(db_recno_t), NULL, &dbc->rkey.data)) != 0) { CDB___os_free(cp, sizeof(QUEUE_CURSOR)); return (ret); } dbc->rkey.ulen = sizeof(db_recno_t); /* Initialize methods. */ dbc->internal = cp; dbc->c_del = CDB___qam_c_del; dbc->c_get = CDB___qam_c_get; dbc->c_put = CDB___qam_c_put; dbc->c_am_close = CDB___qam_c_close; dbc->c_am_destroy = CDB___qam_c_destroy; return (0); } /* * CDB___qam_c_destroy -- * Close a single cursor -- internal version. */ static int CDB___qam_c_destroy(dbc) DBC *dbc; { /* Discard the structures. */ CDB___os_free(dbc->internal, sizeof(QUEUE_CURSOR)); return (0); } /* * CDB___qam_getno -- * Check the user's record number. */ static int CDB___qam_getno(dbp, key, rep) DB *dbp; const DBT *key; db_recno_t *rep; { if ((*rep = *(db_recno_t *)key->data) == 0) { CDB___db_err(dbp->dbenv, "illegal record number of 0"); return (EINVAL); } return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam.h������������������������������������������������������������������������������0100644�0063146�0012731�00000005257�07427026535�013722� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. * * @(#)qam.h 11.7 (Sleepycat) 9/10/99 */ /* * QAM data elements: a status field and the data. */ typedef struct _qamdata { u_int8_t flags; /* 00: delete bit. */ #define QAM_VALID 0x01 #define QAM_SET 0x02 u_int8_t data[1]; /* Record. */ } QAMDATA; struct __queue; typedef struct __queue QUEUE; struct __qcursor; typedef struct __qcursor QUEUE_CURSOR; struct __qcursor { /* Per-thread information: queue private. */ PAGE *page; /* Cursor page. */ db_recno_t start; /* start record number. */ db_recno_t recno; /* Current record number. */ db_pgno_t pgno; /* Page. */ db_indx_t indx; /* Page item ref'd by the cursor. */ DB_LOCK lock; /* Cursor lock. */ db_lockmode_t lock_mode; /* Lock mode. */ u_int32_t flags; }; /* * The in-memory, per-tree queue data structure. */ struct __queue { db_pgno_t q_meta; /* Database meta-data page. */ db_pgno_t q_root; /* Database root page. */ int re_pad; /* Fixed-length padding byte. */ u_int32_t re_len; /* Length for fixed-length records. */ u_int32_t rec_page; /* records per page */ }; /* * Caculate the page number of a recno * * Number of records per page = * Divide the available space on the page by the record len + header. * * Page number for record = * divide the physical record number by the records per page * add the root page number * For now the root page will always be 1, but we might want to change * in the future (e.g. multiple fixed len queues per file). * * Index of record on page = * physical record number, less the logical pno times records/page */ #define CALC_QAM_RECNO_PER_PAGE(dbp) \ (((dbp)->pgsize - ALIGN(sizeof(QPAGE), sizeof(u_int32_t))) / \ ALIGN(((QUEUE *)(dbp)->q_internal)->re_len + \ sizeof(QAMDATA) - sizeof ((QAMDATA *)0)->data, sizeof(u_int32_t))) #define QAM_RECNO_PER_PAGE(dbp) (((QUEUE*)(dbp)->q_internal)->rec_page) #define QAM_RECNO_PAGE(dbp, start, recno) \ (((QUEUE *)(dbp)->q_internal)->q_root \ + (((recno) - (start)) / QAM_RECNO_PER_PAGE(dbp))) #define QAM_RECNO_INDEX(dbp, pgno, start, recno) \ (((recno) - (start)) - \ (QAM_RECNO_PER_PAGE(dbp) * \ (pgno - ((QUEUE *)(dbp)->q_internal)->q_root))) #define QAM_GET_RECORD(dbp, page, index) \ ((QAMDATA *) ((char *)(page) + \ ALIGN(sizeof(QPAGE), sizeof(u_int32_t)) + \ (ALIGN(sizeof(QAMDATA) - sizeof ((QAMDATA *)0)->data + \ ((QUEUE *)(dbp)->q_internal)->re_len, sizeof (u_int32_t)) * index))) /* * Log opcodes for the mvptr routine. */ #define QAM_SETFIRST 0x01 #define QAM_SETCUR 0x02 #include "qam_auto.h" #include "qam_ext.h" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam.src����������������������������������������������������������������������������0100644�0063146�0012731�00000003365�07427026535�014260� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. * * @(#)qam.src 11.6 (Sleepycat) 10/1/99 */ PREFIX qam INCLUDE #include "db_config.h" INCLUDE INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include <sys/types.h> INCLUDE INCLUDE #include <ctype.h> INCLUDE #include <string.h> INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" INCLUDE #include "db_page.h" INCLUDE #include "db_dispatch.h" INCLUDE #include "db_am.h" INCLUDE #include "qam.h" INCLUDE #include "txn.h" INCLUDE /* * inc * Used when we increment a record number. These do not actually * tell you what record number you got, just that you incremented * the record number. These operations are never undone. */ BEGIN inc ARG fileid int32_t lu POINTER lsn DB_LSN * lu END /* * incfirst * Used when we increment first_recno. */ BEGIN incfirst ARG fileid int32_t lu ARG recno db_recno_t lu END /* * mvptr * Used when we change one or both of cur_recno and first_recno. */ BEGIN mvptr ARG opcode u_int32_t lu ARG fileid int32_t lu ARG old_first db_recno_t lu ARG new_first db_recno_t lu ARG old_cur db_recno_t lu ARG new_cur db_recno_t lu POINTER metalsn DB_LSN * lu END /* * del * Used when we delete a record. * recno is the record that is being deleted. */ BEGIN del ARG fileid int32_t lu POINTER lsn DB_LSN * lu ARG pgno db_pgno_t lu ARG indx u_int32_t lu ARG recno db_recno_t lu END /* * add * Used when we put a record on a page. * recno is the record being added. * data is the record itself. */ BEGIN add ARG fileid int32_t lu POINTER lsn DB_LSN * lu ARG pgno db_pgno_t lu ARG indx u_int32_t lu ARG recno db_recno_t lu DBT data DBT s ARG vflag u_int32_t lu DBT olddata DBT s END ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_auto.c�������������������������������������������������������������������������0100644�0063146�0012731�00000047436�07427026535�014752� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "qam.h" #include "txn.h" int CDB___qam_inc_log(dbenv, txnid, ret_lsnp, flags, fileid, lsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; DB_LSN * lsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_qam_inc; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(*lsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___qam_inc_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __qam_inc_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___qam_inc_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]qam_inc: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___qam_inc_read(recbuf, argpp) void *recbuf; __qam_inc_args **argpp; { __qam_inc_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__qam_inc_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); *argpp = argp; return (0); } int CDB___qam_incfirst_log(dbenv, txnid, ret_lsnp, flags, fileid, recno) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; db_recno_t recno; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_qam_incfirst; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(recno); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &recno, sizeof(recno)); bp += sizeof(recno); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___qam_incfirst_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __qam_incfirst_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___qam_incfirst_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]qam_incfirst: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\trecno: %lu\n", (u_long)argp->recno); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___qam_incfirst_read(recbuf, argpp) void *recbuf; __qam_incfirst_args **argpp; { __qam_incfirst_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__qam_incfirst_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->recno, bp, sizeof(argp->recno)); bp += sizeof(argp->recno); *argpp = argp; return (0); } int CDB___qam_mvptr_log(dbenv, txnid, ret_lsnp, flags, opcode, fileid, old_first, new_first, old_cur, new_cur, metalsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; int32_t fileid; db_recno_t old_first; db_recno_t new_first; db_recno_t old_cur; db_recno_t new_cur; DB_LSN * metalsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_qam_mvptr; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(fileid) + sizeof(old_first) + sizeof(new_first) + sizeof(old_cur) + sizeof(new_cur) + sizeof(*metalsn); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); memcpy(bp, &old_first, sizeof(old_first)); bp += sizeof(old_first); memcpy(bp, &new_first, sizeof(new_first)); bp += sizeof(new_first); memcpy(bp, &old_cur, sizeof(old_cur)); bp += sizeof(old_cur); memcpy(bp, &new_cur, sizeof(new_cur)); bp += sizeof(new_cur); if (metalsn != NULL) memcpy(bp, metalsn, sizeof(*metalsn)); else memset(bp, 0, sizeof(*metalsn)); bp += sizeof(*metalsn); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___qam_mvptr_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __qam_mvptr_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___qam_mvptr_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]qam_mvptr: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\told_first: %lu\n", (u_long)argp->old_first); printf("\tnew_first: %lu\n", (u_long)argp->new_first); printf("\told_cur: %lu\n", (u_long)argp->old_cur); printf("\tnew_cur: %lu\n", (u_long)argp->new_cur); printf("\tmetalsn: [%lu][%lu]\n", (u_long)argp->metalsn.file, (u_long)argp->metalsn.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___qam_mvptr_read(recbuf, argpp) void *recbuf; __qam_mvptr_args **argpp; { __qam_mvptr_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__qam_mvptr_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->old_first, bp, sizeof(argp->old_first)); bp += sizeof(argp->old_first); memcpy(&argp->new_first, bp, sizeof(argp->new_first)); bp += sizeof(argp->new_first); memcpy(&argp->old_cur, bp, sizeof(argp->old_cur)); bp += sizeof(argp->old_cur); memcpy(&argp->new_cur, bp, sizeof(argp->new_cur)); bp += sizeof(argp->new_cur); memcpy(&argp->metalsn, bp, sizeof(argp->metalsn)); bp += sizeof(argp->metalsn); *argpp = argp; return (0); } int CDB___qam_del_log(dbenv, txnid, ret_lsnp, flags, fileid, lsn, pgno, indx, recno) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; DB_LSN * lsn; db_pgno_t pgno; u_int32_t indx; db_recno_t recno; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_qam_del; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(*lsn) + sizeof(pgno) + sizeof(indx) + sizeof(recno); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &recno, sizeof(recno)); bp += sizeof(recno); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___qam_del_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __qam_del_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___qam_del_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]qam_del: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\trecno: %lu\n", (u_long)argp->recno); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___qam_del_read(recbuf, argpp) void *recbuf; __qam_del_args **argpp; { __qam_del_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__qam_del_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->recno, bp, sizeof(argp->recno)); bp += sizeof(argp->recno); *argpp = argp; return (0); } int CDB___qam_add_log(dbenv, txnid, ret_lsnp, flags, fileid, lsn, pgno, indx, recno, data, vflag, olddata) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; DB_LSN * lsn; db_pgno_t pgno; u_int32_t indx; db_recno_t recno; const DBT *data; u_int32_t vflag; const DBT *olddata; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_qam_add; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(fileid) + sizeof(*lsn) + sizeof(pgno) + sizeof(indx) + sizeof(recno) + sizeof(u_int32_t) + (data == NULL ? 0 : data->size) + sizeof(vflag) + sizeof(u_int32_t) + (olddata == NULL ? 0 : olddata->size); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &fileid, sizeof(fileid)); bp += sizeof(fileid); if (lsn != NULL) memcpy(bp, lsn, sizeof(*lsn)); else memset(bp, 0, sizeof(*lsn)); bp += sizeof(*lsn); memcpy(bp, &pgno, sizeof(pgno)); bp += sizeof(pgno); memcpy(bp, &indx, sizeof(indx)); bp += sizeof(indx); memcpy(bp, &recno, sizeof(recno)); bp += sizeof(recno); if (data == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &data->size, sizeof(data->size)); bp += sizeof(data->size); memcpy(bp, data->data, data->size); bp += data->size; } memcpy(bp, &vflag, sizeof(vflag)); bp += sizeof(vflag); if (olddata == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &olddata->size, sizeof(olddata->size)); bp += sizeof(olddata->size); memcpy(bp, olddata->data, olddata->size); bp += olddata->size; } DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___qam_add_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __qam_add_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___qam_add_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]qam_add: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tfileid: %lu\n", (u_long)argp->fileid); printf("\tlsn: [%lu][%lu]\n", (u_long)argp->lsn.file, (u_long)argp->lsn.offset); printf("\tpgno: %lu\n", (u_long)argp->pgno); printf("\tindx: %lu\n", (u_long)argp->indx); printf("\trecno: %lu\n", (u_long)argp->recno); printf("\tdata: "); for (i = 0; i < argp->data.size; i++) { ch = ((u_int8_t *)argp->data.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tvflag: %lu\n", (u_long)argp->vflag); printf("\tolddata: "); for (i = 0; i < argp->olddata.size; i++) { ch = ((u_int8_t *)argp->olddata.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___qam_add_read(recbuf, argpp) void *recbuf; __qam_add_args **argpp; { __qam_add_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__qam_add_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->fileid, bp, sizeof(argp->fileid)); bp += sizeof(argp->fileid); memcpy(&argp->lsn, bp, sizeof(argp->lsn)); bp += sizeof(argp->lsn); memcpy(&argp->pgno, bp, sizeof(argp->pgno)); bp += sizeof(argp->pgno); memcpy(&argp->indx, bp, sizeof(argp->indx)); bp += sizeof(argp->indx); memcpy(&argp->recno, bp, sizeof(argp->recno)); bp += sizeof(argp->recno); memset(&argp->data, 0, sizeof(argp->data)); memcpy(&argp->data.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->data.data = bp; bp += argp->data.size; memcpy(&argp->vflag, bp, sizeof(argp->vflag)); bp += sizeof(argp->vflag); memset(&argp->olddata, 0, sizeof(argp->olddata)); memcpy(&argp->olddata.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->olddata.data = bp; bp += argp->olddata.size; *argpp = argp; return (0); } int CDB___qam_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_inc_print, DB_qam_inc)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_incfirst_print, DB_qam_incfirst)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_mvptr_print, DB_qam_mvptr)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_del_print, DB_qam_del)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_add_print, DB_qam_add)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___qam_init_recover __P((DB_ENV *)); */ int CDB___qam_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_inc_recover, DB_qam_inc)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_incfirst_recover, DB_qam_incfirst)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_mvptr_recover, DB_qam_mvptr)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_del_recover, DB_qam_del)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___qam_add_recover, DB_qam_add)) != 0) return (ret); return (0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_auto.h�������������������������������������������������������������������������0100644�0063146�0012731�00000005010�07427026535�014735� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef qam_AUTO_H #define qam_AUTO_H #define DB_qam_inc (DB_qam_BEGIN + 1) typedef struct _qam_inc_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; DB_LSN lsn; } __qam_inc_args; int CDB___qam_inc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *)); int CDB___qam_inc_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_inc_read __P((void *, __qam_inc_args **)); #define DB_qam_incfirst (DB_qam_BEGIN + 2) typedef struct _qam_incfirst_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; db_recno_t recno; } __qam_incfirst_args; int CDB___qam_incfirst_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_recno_t)); int CDB___qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_incfirst_read __P((void *, __qam_incfirst_args **)); #define DB_qam_mvptr (DB_qam_BEGIN + 3) typedef struct _qam_mvptr_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; int32_t fileid; db_recno_t old_first; db_recno_t new_first; db_recno_t old_cur; db_recno_t new_cur; DB_LSN metalsn; } __qam_mvptr_args; int CDB___qam_mvptr_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *)); int CDB___qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_mvptr_read __P((void *, __qam_mvptr_args **)); #define DB_qam_del (DB_qam_BEGIN + 4) typedef struct _qam_del_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; DB_LSN lsn; db_pgno_t pgno; u_int32_t indx; db_recno_t recno; } __qam_del_args; int CDB___qam_del_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t)); int CDB___qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_del_read __P((void *, __qam_del_args **)); #define DB_qam_add (DB_qam_BEGIN + 5) typedef struct _qam_add_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; int32_t fileid; DB_LSN lsn; db_pgno_t pgno; u_int32_t indx; db_recno_t recno; DBT data; u_int32_t vflag; DBT olddata; } __qam_add_args; int CDB___qam_add_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *)); int CDB___qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_add_read __P((void *, __qam_add_args **)); int CDB___qam_init_print __P((DB_ENV *)); #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_conv.c�������������������������������������������������������������������������0100644�0063146�0012731�00000002672�07427026535�014740� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam_conv.c 11.2 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "qam.h" #include "db_swap.h" #include "db_am.h" /* * CDB___qam_mswap -- * Swap the bytes on the queue metadata page. * * PUBLIC: int CDB___qam_mswap __P((PAGE *)); */ int CDB___qam_mswap(pg) PAGE *pg; { u_int8_t *p; CDB___db_metaswap(pg); p = (u_int8_t *)pg + sizeof(DBMETA); SWAP32(p); /* start */ SWAP32(p); /* first_recno */ SWAP32(p); /* cur_recno */ SWAP32(p); /* re_len */ SWAP32(p); /* re_pad */ SWAP32(p); /* rec_page */ return (0); } /* * CDB___qam_pgin_out -- * Convert host-specific page layout to/from the host-independent format * stored on disk. * We only need to fix up a few fields in the header * * PUBLIC: int CDB___qam_pgin_out __P((db_pgno_t, void *, DBT *)); */ int CDB___qam_pgin_out(pg, pp, cookie) db_pgno_t pg; void *pp; DBT *cookie; { DB_PGINFO *pginfo; QPAGE *h; COMPQUIET(pg, 0); pginfo = (DB_PGINFO *)cookie->data; if (!pginfo->needswap) return (0); h = pp; if (h->type == P_QAMMETA) return (CDB___qam_mswap(pp)); M_32_SWAP(h->lsn.file); M_32_SWAP(h->lsn.offset); M_32_SWAP(h->pgno); return (0); } ����������������������������������������������������������������������htdig-3.2.0b6/db/qam_ext.h��������������������������������������������������������������������������0100644�0063146�0012731�00000002224�07427026535�014571� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _qam_ext_h_ #define _qam_ext_h_ int CDB___qam_pitem __P((DBC *, QPAGE *, u_int32_t, db_recno_t, DBT *)); int CDB___qam_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int CDB___qam_delete __P((DB *, DB_TXN *, DBT *, u_int32_t)); int CDB___qam_c_dup __P((DBC *, DBC *)); int CDB___qam_c_init __P((DBC *)); int CDB___qam_init_recover __P((DB_ENV *)); int CDB___qam_mswap __P((PAGE *)); int CDB___qam_pgin_out __P((db_pgno_t, void *, DBT *)); int CDB___qam_db_create __P((DB *)); int CDB___qam_db_close __P((DB *)); int CDB___qam_open __P((DB *, const char *, db_pgno_t)); int CDB___qam_metachk __P((DB *, const char *, QMETA *)); int CDB___qam_inc_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_incfirst_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_mvptr_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_del_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_add_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___qam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); #endif /* _qam_ext_h_ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_method.c�����������������������������������������������������������������������0100644�0063146�0012731�00000002041�07427026535�015241� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam_method.c 11.1 (Sleepycat) 8/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "qam.h" /* * CDB___qam_db_create -- * Queue specific initialization of the DB structure. * * PUBLIC: int CDB___qam_db_create __P((DB *)); */ int CDB___qam_db_create(dbp) DB *dbp; { QUEUE *t; int ret; /* Allocate and initialize the private queue structure. */ if ((ret = CDB___os_calloc(1, sizeof(QUEUE), &t)) != 0) return (ret); dbp->q_internal = t; t->re_pad = ' '; return (0); } /* * CDB___qam_db_close -- * Queue specific discard of the DB structure. * * PUBLIC: int CDB___qam_db_close __P((DB *)); */ int CDB___qam_db_close(dbp) DB *dbp; { QUEUE *t; t = dbp->q_internal; CDB___os_free(t, sizeof(QUEUE)); dbp->q_internal = NULL; return (0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_open.c�������������������������������������������������������������������������0100644�0063146�0012731�00000010622�07427026535�014726� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam_open.c 11.12 (Sleepycat) 10/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_swap.h" #include "db_am.h" #include "lock.h" #include "qam.h" /* * CDB___qam_open * * PUBLIC: int CDB___qam_open __P((DB *, const char *, db_pgno_t)); */ int CDB___qam_open(dbp, name, base_pgno) DB *dbp; const char *name; db_pgno_t base_pgno; { QUEUE *t; DBC *dbc; DB_LOCK metalock; DB_LSN orig_lsn; QMETA *qmeta; int ret, t_ret; ret = 0; t = dbp->q_internal; /* Initialize the remaining fields/methods of the DB. */ dbp->del = CDB___qam_delete; dbp->put = CDB___qam_put; dbp->stat = CDB___qam_stat; metalock.off = LOCK_INVALID; /* Get a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); /* Get, and optionally create the metadata page. */ if ((ret = CDB___db_lget(dbc, 0, base_pgno, DB_LOCK_WRITE, 0, &metalock)) != 0) goto err; if ((ret = CDB_memp_fget( dbp->mpf, &base_pgno, DB_MPOOL_CREATE, (PAGE **)&qmeta)) != 0) goto err; /* * If the magic number is correct, we're not creating the tree. * Correct any fields that may not be right. Note, all of the * local flags were set by DB->open. */ if (qmeta->dbmeta.magic == DB_QAMMAGIC) { t->re_pad = qmeta->re_pad; t->re_len = qmeta->re_len; t->rec_page = qmeta->rec_page; (void)CDB_memp_fput(dbp->mpf, (PAGE *)qmeta, 0); goto done; } /* Initialize the tree structure metadata information. */ orig_lsn = qmeta->dbmeta.lsn; memset(qmeta, 0, sizeof(QMETA)); ZERO_LSN(qmeta->dbmeta.lsn); qmeta->dbmeta.pgno = base_pgno; qmeta->dbmeta.magic = DB_QAMMAGIC; qmeta->dbmeta.version = DB_QAMVERSION; qmeta->dbmeta.pagesize = dbp->pgsize; qmeta->dbmeta.type = P_QAMMETA; qmeta->re_pad = t->re_pad; qmeta->start = 1; qmeta->re_len = t->re_len; qmeta->rec_page = CALC_QAM_RECNO_PER_PAGE(dbp); t->rec_page = qmeta->rec_page; memcpy(qmeta->dbmeta.uid, dbp->fileid, DB_FILE_ID_LEN); /* Verify that we can fit at least one record per page. */ if (QAM_RECNO_PER_PAGE(dbp) < 1) { CDB___db_err(dbp->dbenv, "Record size of %d too large for page size of %d", t->re_len, dbp->pgsize); (void)CDB_memp_fput(dbp->mpf, (PAGE *)qmeta, 0); ret = EINVAL; goto err; } if ((ret = CDB___db_log_page(dbp, name, &orig_lsn, base_pgno, (PAGE *)qmeta)) != 0) goto err; /* Release the metadata page. */ if ((ret = CDB_memp_fput(dbp->mpf, (PAGE *)qmeta, DB_MPOOL_DIRTY)) != 0) goto err; DB_TEST_RECOVERY(dbp, DB_TEST_POSTLOG, ret, name); /* * Flush the metadata page to disk. * * !!! * It's not useful to return not-yet-flushed here -- convert it to * an error. */ if ((ret = CDB_memp_fsync(dbp->mpf)) == DB_INCOMPLETE) ret = EINVAL; DB_TEST_RECOVERY(dbp, DB_TEST_POSTSYNC, ret, name); done: t->q_meta = base_pgno; t->q_root = base_pgno + 1; err: DB_TEST_RECOVERY_LABEL /* Don't hold the meta page long term. */ if (metalock.off != LOCK_INVALID) (void)__LPUT(dbc, metalock); if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } /* * CDB___qam_metachk -- * * PUBLIC: int CDB___qam_metachk __P((DB *, const char *, QMETA *)); */ int CDB___qam_metachk(dbp, name, qmeta) DB *dbp; const char *name; QMETA *qmeta; { DB_ENV *dbenv; u_int32_t vers; int ret; dbenv = dbp->dbenv; /* * At this point, all we know is that the magic number is for a Queue. * Check the version, the database may be out of date. */ vers = qmeta->dbmeta.version; if (F_ISSET(dbp, DB_AM_SWAP)) M_32_SWAP(vers); switch (vers) { case 1: break; default: CDB___db_err(dbenv, "%s: unsupported qam version: %lu", name, (u_long)vers); return (EINVAL); } /* Swap the page if we need to. */ if (F_ISSET(dbp, DB_AM_SWAP) && (ret = CDB___qam_mswap((PAGE *)qmeta)) != 0) return (ret); /* Check the type. */ if (dbp->type != DB_QUEUE && dbp->type != DB_UNKNOWN) return (EINVAL); dbp->type = DB_QUEUE; DB_ILLEGAL_METHOD(dbp, DB_OK_QUEUE); /* Set the page size. */ dbp->pgsize = qmeta->dbmeta.pagesize; F_CLR(dbp, DB_AM_PGDEF); /* Copy the file's ID. */ memcpy(dbp->fileid, qmeta->dbmeta.uid, DB_FILE_ID_LEN); return (0); } ��������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_rec.c��������������������������������������������������������������������������0100644�0063146�0012731�00000022013�07427026535�014533� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam_rec.c 11.8 (Sleepycat) 9/14/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_am.h" #include "qam.h" #include "log.h" /* * CDB___qam_inc_recover -- * Recovery function for inc. * * PUBLIC: int CDB___qam_inc_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___qam_inc_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __qam_inc_args *argp; DB *file_dbp; DBC *dbc; DB_LOCK lock; DB_MPOOLFILE *mpf; QMETA *meta; db_pgno_t metapg; int cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___qam_inc_print); REC_INTRO(CDB___qam_inc_read, 1); metapg = ((QUEUE *)file_dbp->q_internal)->q_meta; dbc->txn = argp->txnid; if ((ret = CDB___db_lget(dbc, 0, metapg, DB_LOCK_WRITE, 0, &lock)) != 0) goto done; if ((ret = CDB_memp_fget(mpf, &metapg, 0, &meta)) != 0) { if (redo) { if ((ret = CDB_memp_fget(mpf, &metapg, DB_MPOOL_CREATE, &meta)) != 0) { (void)__LPUT(dbc, lock); goto out; } meta->dbmeta.pgno = metapg; meta->dbmeta.type = P_QAMMETA; } else { *lsnp = argp->prev_lsn; ret = 0; (void)__LPUT(dbc, lock); goto out; } } modified = 0; cmp_p = CDB_log_compare(&LSN(meta), &argp->lsn); /* Increment the counter if the page is before this lsn */ if (cmp_p == 0) { modified = 1; meta->cur_recno++; meta->dbmeta.lsn = *lsnp; } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0))) goto out; (void)__LPUT(dbc, lock); done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___qam_incfirst_recover -- * Recovery function for incfirst. * * PUBLIC: int CDB___qam_incfirst_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___qam_incfirst_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __qam_incfirst_args *argp; DB *file_dbp; DBC *dbc; DB_LOCK lock; DB_MPOOLFILE *mpf; QMETA *meta; db_pgno_t metapg; int modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___qam_incfirst_print); REC_INTRO(CDB___qam_incfirst_read, 1); metapg = ((QUEUE *)file_dbp->q_internal)->q_meta; dbc->txn = argp->txnid; if ((ret = CDB___db_lget(dbc, 0, metapg, DB_LOCK_WRITE, 0, &lock)) != 0) goto done; if ((ret = CDB_memp_fget(mpf, &metapg, 0, &meta)) != 0) { if (redo) { if ((ret = CDB_memp_fget(mpf, &metapg, DB_MPOOL_CREATE, &meta)) != 0) { (void)__LPUT(dbc, lock); goto out; } meta->dbmeta.pgno = metapg; meta->dbmeta.type = P_QAMMETA; } else { *lsnp = argp->prev_lsn; ret = 0; (void)__LPUT(dbc, lock); goto out; } } modified = 0; /* * Only move first_recno backwards so we pick up the aborted delete. * If we are going forward then we could patch first up, but it will * get fixed by normal operations. */ if (!redo) { if (meta->first_recno > argp->recno) { meta->first_recno = argp->recno; modified = 1; } } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0))) goto out; (void)__LPUT(dbc, lock); done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___qam_mvptr_recover -- * Recovery function for mvptr. * * PUBLIC: int CDB___qam_mvptr_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___qam_mvptr_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __qam_mvptr_args *argp; DB *file_dbp; DBC *dbc; DB_LOCK lock; DB_MPOOLFILE *mpf; QMETA *meta; db_pgno_t metapg; int cmp_p, cmp_n, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___qam_mvptr_print); REC_INTRO(CDB___qam_mvptr_read, 1); metapg = ((QUEUE *)file_dbp->q_internal)->q_meta; dbc->txn = argp->txnid; if ((ret = CDB___db_lget(dbc, 0, metapg, DB_LOCK_WRITE, 0, &lock)) != 0) goto done; if ((ret = CDB_memp_fget(mpf, &metapg, 0, &meta)) != 0) { if (redo) { if ((ret = CDB_memp_fget(mpf, &metapg, DB_MPOOL_CREATE, &meta)) != 0) { (void)__LPUT(dbc, lock); goto out; } meta->dbmeta.pgno = metapg; meta->dbmeta.type = P_QAMMETA; } else { *lsnp = argp->prev_lsn; ret = 0; (void)__LPUT(dbc, lock); goto out; } } modified = 0; cmp_n = CDB_log_compare(lsnp, &meta->dbmeta.lsn); cmp_p = CDB_log_compare(&meta->dbmeta.lsn, &argp->metalsn); /* * We do not undo movements, just back out the LSN change * On redo, since we are checking for exact LSN matches * we can just redo the value. */ if (cmp_n == 0 && !redo) { modified = 1; meta->dbmeta.lsn = argp->metalsn; } else if (cmp_p == 0 && redo) { if (argp->opcode & QAM_SETFIRST) meta->first_recno = argp->new_first; if (argp->opcode & QAM_SETCUR) meta->cur_recno = argp->new_cur; modified = 1; meta->dbmeta.lsn = *lsnp; } if ((ret = CDB_memp_fput(mpf, meta, modified ? DB_MPOOL_DIRTY : 0))) goto out; (void)__LPUT(dbc, lock); done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___qam_del_recover -- * Recovery function for del. * * PUBLIC: int CDB___qam_del_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___qam_del_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __qam_del_args *argp; DB *file_dbp; DBC *dbc; DB_LOCK lock; DB_MPOOLFILE *mpf; QAMDATA *qp; QMETA *meta; QPAGE *pagep; db_pgno_t metapg; int cmp_n, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___qam_del_print); REC_INTRO(CDB___qam_del_read, 1); dbc->txn = argp->txnid; if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if (redo) { if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; pagep->pgno = argp->pgno; pagep->type = P_QAMDATA; } else { *lsnp = argp->prev_lsn; ret = 0; goto out; } } modified = 0; cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); if (cmp_n > 0 && redo) { /* Need to redo delete - clear the valid bit */ qp = QAM_GET_RECORD(file_dbp, pagep, argp->indx); F_CLR(qp, QAM_VALID); LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n <= 0 && !redo) { /* make sure first is behind us */ metapg = ((QUEUE *)file_dbp->q_internal)->q_meta; if ((ret = CDB___db_lget(dbc, 0, metapg, DB_LOCK_WRITE, 0, &lock)) != 0) return (ret); if ((ret = CDB_memp_fget(file_dbp->mpf, &metapg, 0, &meta)) != 0) { (void)__LPUT(dbc, lock); goto done; } if (argp->recno < meta->first_recno) { meta->first_recno = argp->recno; (void)CDB_memp_fput(file_dbp->mpf, meta, DB_MPOOL_DIRTY); } else (void)CDB_memp_fput(file_dbp->mpf, meta, 0); (void)__LPUT(dbc, lock); /* Need to undo delete - mark the record as present */ qp = QAM_GET_RECORD(file_dbp, pagep, argp->indx); F_SET(qp, QAM_VALID); LSN(pagep) = argp->lsn; modified = 1; } if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } /* * CDB___qam_add_recover -- * Recovery function for add. * * PUBLIC: int CDB___qam_add_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___qam_add_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __qam_add_args *argp; DB *file_dbp; DBC *dbc; DB_MPOOLFILE *mpf; QAMDATA *qp; QPAGE *pagep; int cmp_n, cmp_p, modified, ret; COMPQUIET(info, NULL); REC_PRINT(CDB___qam_add_print); REC_INTRO(CDB___qam_add_read, 1); dbc->txn = argp->txnid; modified = 0; if ((ret = CDB_memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0) { if ((ret = CDB_memp_fget(mpf, &argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0) goto out; pagep->pgno = argp->pgno; pagep->type = P_QAMDATA; modified = 1; } cmp_n = CDB_log_compare(lsnp, &LSN(pagep)); cmp_p = CDB_log_compare(&LSN(pagep), &argp->lsn); if (cmp_p == 0 && redo) { /* Need to redo add - put the record on page */ if ((ret = CDB___qam_pitem(dbc, pagep, argp->indx, argp->recno, &argp->data)) != 0) goto err; LSN(pagep) = *lsnp; modified = 1; } else if (cmp_n == 0 && !redo) { /* * Need to undo add * If this was an overwrite, put old record back. * Otherwise just clear the valid bit */ if (argp->olddata.size != 0) { if ((ret = CDB___qam_pitem(dbc, pagep, argp->indx, argp->recno, &argp->olddata)) != 0) goto err; if (!(argp->vflag & QAM_VALID)) { qp = QAM_GET_RECORD( file_dbp, pagep, argp->indx); F_CLR(qp, QAM_VALID); } modified = 1; } else { qp = QAM_GET_RECORD(file_dbp, pagep, argp->indx); qp->flags = 0; modified = 1; } LSN(pagep) = argp->lsn; } err: if ((ret = CDB_memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))) goto out; done: *lsnp = argp->prev_lsn; ret = 0; out: REC_CLOSE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_stat.c�������������������������������������������������������������������������0100644�0063146�0012731�00000006260�07427026535�014743� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)qam_stat.c 11.4 (Sleepycat) 8/19/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "db_am.h" #include "lock.h" #include "qam.h" /* * CDB___qam_stat -- * Gather/print the qam statistics * * PUBLIC: int CDB___qam_stat __P((DB *, void *, void *(*)(size_t), u_int32_t)); */ int CDB___qam_stat(dbp, spp, db_malloc, flags) DB *dbp; void *spp; void *(*db_malloc) __P((size_t)); u_int32_t flags; { QUEUE *t; DBC *dbc; DB_LOCK lock; DB_QUEUE_STAT *sp; PAGE *h; QAMDATA *qp, *ep; QMETA *meta; db_indx_t indx; db_pgno_t lastpgno, pgno; int ret, t_ret; PANIC_CHECK(dbp->dbenv); DB_ILLEGAL_BEFORE_OPEN(dbp, "DB->stat"); t = dbp->q_internal; sp = NULL; lock.off = LOCK_INVALID; /* Check for invalid flags. */ if ((ret = CDB___db_statchk(dbp, flags)) != 0) return (ret); if (spp == NULL) return (0); /* Acquire a cursor. */ if ((ret = dbp->cursor(dbp, NULL, &dbc, 0)) != 0) return (ret); DEBUG_LWRITE(dbc, NULL, "qam_stat", NULL, NULL, flags); /* Allocate and clear the structure. */ if ((ret = CDB___os_malloc(sizeof(*sp), db_malloc, &sp)) != 0) goto err; memset(sp, 0, sizeof(*sp)); /* Get the meta-data page. */ if ((ret = CDB___db_lget(dbc, 0, t->q_meta, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &t->q_meta, 0, (PAGE **)&meta)) != 0) goto err; /* Get the metadata fields. */ sp->qs_magic = meta->dbmeta.magic; sp->qs_version = meta->dbmeta.version; sp->qs_metaflags = meta->dbmeta.flags; sp->qs_pagesize = meta->dbmeta.pagesize; sp->qs_re_len = meta->re_len; sp->qs_re_pad = meta->re_pad; sp->qs_start = meta->start; sp->qs_first_recno = meta->first_recno; sp->qs_cur_recno = meta->cur_recno; /* Discard the meta-data page. */ if ((ret = CDB_memp_fput(dbp->mpf, meta, 0)) != 0) goto err; (void)__LPUT(dbc, lock); /* Determine the last page of the database. */ if ((ret = CDB_memp_fget(dbp->mpf, &lastpgno, DB_MPOOL_LAST, &h)) != 0) goto err; if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) goto err; /* Walk through the pages and count. */ for (pgno = t->q_root; pgno <= lastpgno; ++pgno) { if ((ret = CDB___db_lget(dbc, 0, pgno, DB_LOCK_READ, 0, &lock)) != 0) goto err; if ((ret = CDB_memp_fget(dbp->mpf, &pgno, 0, &h)) != 0) goto err; ++sp->qs_pages; ep = (QAMDATA *)((u_long) h + dbp->pgsize - sp->qs_re_len); for (indx = 0, qp = QAM_GET_RECORD(dbp, h, indx); qp <= ep; ++indx, qp = QAM_GET_RECORD(dbp, h, indx)) { if (F_ISSET(qp, QAM_VALID)) sp->qs_nrecs++; else sp->qs_pgfree += sp->qs_re_len; } if ((ret = CDB_memp_fput(dbp->mpf, h, 0)) != 0) goto err; (void)__LPUT(dbc, lock); } *(DB_QUEUE_STAT **)spp = sp; ret = 0; if (0) { err: if (sp != NULL) CDB___os_free(sp, sizeof(*sp)); } if (lock.off != LOCK_INVALID) (void)__LPUT(dbc, lock); if ((t_ret = dbc->c_close(dbc)) != 0 && ret == 0) ret = t_ret; return (ret); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_upgrade.c����������������������������������������������������������������������0100644�0063146�0012731�00000003116�07427026535�015414� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999, 2000 * Sleepycat Software. All rights reserved. */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: qam_upgrade.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_swap.h" #include "db_am.h" #include "db_upgrade.h" #include "qam_ext.h" /* * CDB___qam_31_qammeta -- * Upgrade the database from version 1 to version 2. * * PUBLIC: int CDB___qam_31_qammeta __P((DB *, char *, u_int8_t *)); */ int CDB___qam_31_qammeta(dbp, real_name, buf) DB *dbp; char *real_name; u_int8_t *buf; { QMETA31 *newmeta; QMETA30 *oldmeta; COMPQUIET(dbp, NULL); COMPQUIET(real_name, NULL); newmeta = (QMETA31 *)buf; oldmeta = (QMETA30 *)buf; /* * Copy the fields to their new locations. * They may overlap so start at the bottom and use memmove(). */ newmeta->rec_page = oldmeta->rec_page; newmeta->re_pad = oldmeta->re_pad; newmeta->re_len = oldmeta->re_len; newmeta->cur_recno = oldmeta->cur_recno; newmeta->first_recno = oldmeta->first_recno; newmeta->start = oldmeta->start; memmove(newmeta->dbmeta.uid, oldmeta->dbmeta.uid, sizeof(oldmeta->dbmeta.uid)); newmeta->dbmeta.flags = oldmeta->dbmeta.flags; newmeta->dbmeta.record_count = 0; newmeta->dbmeta.key_count = 0; ZERO_LSN(newmeta->dbmeta.alloc_lsn); /* Update the version. */ newmeta->dbmeta.version = 2; return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/qam_verify.c�����������������������������������������������������������������������0100644�0063146�0012731�00000011117�07427026535�015271� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1999, 2000 * Sleepycat Software. All rights reserved. */ #include "htconfig.h" #ifndef lint static const char revid[] = "$Id: qam_verify.c,v 1.2 2002/02/02 18:18:05 ghutchis Exp $"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "db_page.h" #include "db_verify.h" #include "qam.h" #include "db_ext.h" /* * CDB___qam_vrfy_meta -- * Verify the queue-specific part of a metadata page. * * PUBLIC: int CDB___qam_vrfy_meta __P((DB *, VRFY_DBINFO *, QMETA *, * PUBLIC: db_pgno_t, u_int32_t)); */ int CDB___qam_vrfy_meta(dbp, vdp, meta, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; QMETA *meta; db_pgno_t pgno; u_int32_t flags; { VRFY_PAGEINFO *pip; int isbad, ret, t_ret; if ((ret = CDB___db_vrfy_getpageinfo(vdp, pgno, &pip)) != 0) return (ret); isbad = 0; /* * Queue can't be used in subdatabases, so if this isn't set * something very odd is going on. */ if (!F_ISSET(pip, VRFY_INCOMPLETE)) EPRINT((dbp->dbenv, "Queue databases must be one-per-file.")); /* start */ if (meta->start != 1) { EPRINT((dbp->dbenv, "Queue start offset of %lu", meta->start)); isbad = 1; } /* first_recno, cur_recno */ if (meta->cur_recno < meta->first_recno) { EPRINT((dbp->dbenv, "Wrongly ordered first/current recnos, %lu/%lu", meta->first_recno, meta->cur_recno)); isbad = 1; } /* cur_recno/rec_page */ if (vdp->last_pgno > 0 && (1 + ((meta->cur_recno - meta->start) / meta->rec_page)) != vdp->last_pgno) { EPRINT((dbp->dbenv, "Incorrect last page number in queue database")); isbad = 1; } /* * re_len: If this is bad, we can't safely verify queue data pages, so * return DB_VERIFY_FATAL */ if (ALIGN(meta->re_len + sizeof(QAMDATA) - 1, sizeof(u_int32_t)) * meta->rec_page + sizeof(QPAGE) > dbp->pgsize) { EPRINT((dbp->dbenv, "Queue record length %lu impossibly high for page size and records per page", meta->re_len)); ret = DB_VERIFY_FATAL; goto err; } else { vdp->re_len = meta->re_len; vdp->rec_page = meta->rec_page; } err: if ((t_ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 && ret == 0) ret = t_ret; return (ret == 0 && isbad == 1 ? DB_VERIFY_BAD : ret); } /* * CDB___qam_vrfy_data -- * Verify a queue data page. * * PUBLIC: int CDB___qam_vrfy_data __P((DB *, VRFY_DBINFO *, QPAGE *, * PUBLIC: db_pgno_t, u_int32_t)); */ int CDB___qam_vrfy_data(dbp, vdp, h, pgno, flags) DB *dbp; VRFY_DBINFO *vdp; QPAGE *h; db_pgno_t pgno; u_int32_t flags; { DB fakedb; struct __queue fakeq; QAMDATA *qp; db_recno_t i; u_int8_t qflags; /* * Not much to do here, except make sure that flags are reasonable. * * QAM_GET_RECORD assumes a properly initialized q_internal * structure, however, and we don't have one, so we play * some gross games to fake it out. */ fakedb.q_internal = &fakeq; fakeq.re_len = vdp->re_len; for (i = 0; i < vdp->rec_page; i++) { qp = QAM_GET_RECORD(&fakedb, h, i); if ((u_int8_t *)qp >= (u_int8_t *)h + dbp->pgsize) { EPRINT((dbp->dbenv, "Queue record %lu extends past end of page %lu", i, pgno)); return (DB_VERIFY_BAD); } qflags = qp->flags; qflags &= !(QAM_VALID | QAM_SET); if (qflags != 0) { EPRINT((dbp->dbenv, "Queue record %lu on page %lu has bad flags", i, pgno)); return (DB_VERIFY_BAD); } } return (0); } /* * CDB___qam_vrfy_structure -- * Verify a queue database structure, such as it is. * * PUBLIC: int CDB___qam_vrfy_structure __P((DB *, VRFY_DBINFO *, u_int32_t)); */ int CDB___qam_vrfy_structure(dbp, vdp, flags) DB *dbp; VRFY_DBINFO *vdp; u_int32_t flags; { VRFY_PAGEINFO *pip; db_pgno_t i; int ret, isbad; isbad = 0; if ((ret = CDB___db_vrfy_getpageinfo(vdp, PGNO_BASE_MD, &pip)) != 0) return (ret); if (pip->type != P_QAMMETA) { EPRINT((dbp->dbenv, "Queue database has no meta page")); isbad = 1; goto err; } if ((ret = CDB___db_vrfy_pgset_inc(vdp->pgset, 0)) != 0) goto err; for (i = 1; i <= vdp->last_pgno; i++) { if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0 || (ret = CDB___db_vrfy_getpageinfo(vdp, i, &pip)) != 0) return (ret); if (!F_ISSET(pip, VRFY_IS_ALLZEROES) && pip->type != P_QAMDATA) { EPRINT((dbp->dbenv, "Queue database page %lu of incorrect type %lu", i, pip->type)); isbad = 1; goto err; } else if ((ret = CDB___db_vrfy_pgset_inc(vdp->pgset, i)) != 0) goto err; } err: if ((ret = CDB___db_vrfy_putpageinfo(vdp, pip)) != 0) return (ret); return (isbad == 1 ? DB_VERIFY_BAD : 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/queue.h����������������������������������������������������������������������������0100644�0063146�0012731�00000022625�07427026535�014266� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 */ #ifndef _SYS_QUEUE_H_ #define _SYS_QUEUE_H_ /* * This file defines three types of data structures: lists, tail queues, * and circular queues. * * A list is headed by a single forward pointer (or an array of forward * pointers for a hash table header). The elements are doubly linked * so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before * or after an existing element or at the head of the list. A list * may only be traversed in the forward direction. * * A tail queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of * the list. A tail queue may only be traversed in the forward direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or after * an existing element, at the head of the list, or at the end of the list. * A circle queue may be traversed in either direction, but has a more * complex end of list detection. * * For details on the use of these macros, see the queue(3) manual page. */ /* * List definitions. */ #define LIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } #define LIST_ENTRY(type) \ struct { \ struct type *le_next; /* next element */ \ struct type **le_prev; /* address of previous next element */ \ } #define LIST_FIRST(head) ((head)->lh_first) #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_END(head) NULL /* * List functions. */ #define LIST_INIT(head) { \ (head)->lh_first = NULL; \ } #define LIST_INSERT_AFTER(listelm, elm, field) do { \ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ (listelm)->field.le_next->field.le_prev = \ &(elm)->field.le_next; \ (listelm)->field.le_next = (elm); \ (elm)->field.le_prev = &(listelm)->field.le_next; \ } while (0) #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.le_prev = (listelm)->field.le_prev; \ (elm)->field.le_next = (listelm); \ *(listelm)->field.le_prev = (elm); \ (listelm)->field.le_prev = &(elm)->field.le_next; \ } while (0) #define LIST_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.le_next = (head)->lh_first) != NULL) \ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ (head)->lh_first = (elm); \ (elm)->field.le_prev = &(head)->lh_first; \ } while (0) #define LIST_REMOVE(elm, field) do { \ if ((elm)->field.le_next != NULL) \ (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = (elm)->field.le_next; \ } while (0) /* * Tail queue definitions. */ #define TAILQ_HEAD(name, type) \ struct name { \ struct type *tqh_first; /* first element */ \ struct type **tqh_last; /* addr of last next element */ \ } #define TAILQ_ENTRY(type) \ struct { \ struct type *tqe_next; /* next element */ \ struct type **tqe_prev; /* address of previous next element */ \ } #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) #define TAILQ_END(head) NULL /* * Tail queue functions. */ #define TAILQ_INIT(head) do { \ (head)->tqh_first = NULL; \ (head)->tqh_last = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_HEAD(head, elm, field) do { \ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ (head)->tqh_first->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (head)->tqh_first = (elm); \ (elm)->field.tqe_prev = &(head)->tqh_first; \ } while (0) #define TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.tqe_next = NULL; \ (elm)->field.tqe_prev = (head)->tqh_last; \ *(head)->tqh_last = (elm); \ (head)->tqh_last = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ (elm)->field.tqe_next->field.tqe_prev = \ &(elm)->field.tqe_next; \ else \ (head)->tqh_last = &(elm)->field.tqe_next; \ (listelm)->field.tqe_next = (elm); \ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ } while (0) #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ (elm)->field.tqe_next = (listelm); \ *(listelm)->field.tqe_prev = (elm); \ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ } while (0) #define TAILQ_REMOVE(head, elm, field) do { \ if (((elm)->field.tqe_next) != NULL) \ (elm)->field.tqe_next->field.tqe_prev = \ (elm)->field.tqe_prev; \ else \ (head)->tqh_last = (elm)->field.tqe_prev; \ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ } while (0) /* * Circular queue definitions. */ #define CIRCLEQ_HEAD(name, type) \ struct name { \ struct type *cqh_first; /* first element */ \ struct type *cqh_last; /* last element */ \ } #define CIRCLEQ_ENTRY(type) \ struct { \ struct type *cqe_next; /* next element */ \ struct type *cqe_prev; /* previous element */ \ } #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_LAST(head) ((head)->cqh_last) #define CIRCLEQ_END(head) ((void *)(head)) #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) /* * Circular queue functions. */ #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = (void *)(head); \ (head)->cqh_last = (void *)(head); \ } while (0) #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm)->field.cqe_next; \ (elm)->field.cqe_prev = (listelm); \ if ((listelm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (listelm)->field.cqe_next->field.cqe_prev = (elm); \ (listelm)->field.cqe_next = (elm); \ } while (0) #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ (elm)->field.cqe_next = (listelm); \ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ if ((listelm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (listelm)->field.cqe_prev->field.cqe_next = (elm); \ (listelm)->field.cqe_prev = (elm); \ } while (0) #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ (elm)->field.cqe_next = (head)->cqh_first; \ (elm)->field.cqe_prev = (void *)(head); \ if ((head)->cqh_last == (void *)(head)) \ (head)->cqh_last = (elm); \ else \ (head)->cqh_first->field.cqe_prev = (elm); \ (head)->cqh_first = (elm); \ } while (0) #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.cqe_next = (void *)(head); \ (elm)->field.cqe_prev = (head)->cqh_last; \ if ((head)->cqh_first == (void *)(head)) \ (head)->cqh_first = (elm); \ else \ (head)->cqh_last->field.cqe_next = (elm); \ (head)->cqh_last = (elm); \ } while (0) #define CIRCLEQ_REMOVE(head, elm, field) do { \ if ((elm)->field.cqe_next == (void *)(head)) \ (head)->cqh_last = (elm)->field.cqe_prev; \ else \ (elm)->field.cqe_next->field.cqe_prev = \ (elm)->field.cqe_prev; \ if ((elm)->field.cqe_prev == (void *)(head)) \ (head)->cqh_first = (elm)->field.cqe_next; \ else \ (elm)->field.cqe_prev->field.cqe_next = \ (elm)->field.cqe_next; \ } while (0) #endif /* !_SYS_QUEUE_H_ */ �����������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/region.h���������������������������������������������������������������������������0100644�0063146�0012731�00000024642�07427026535�014426� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)region.h 11.2 (Sleepycat) 8/24/99 */ /* * The DB environment consists of some number of "regions", which are described * by the following four structures: * * REGENV -- shared information about the environment * REGENV_REF -- file describing system memory version of REGENV * REGION -- shared information about a single region * REGINFO -- per-process information about a REGION * * There are three types of memory that hold regions: * per-process heap (malloc) * file mapped into memory (mmap, MapViewOfFile) * system memory (shmget, CreateFileMapping) * * If the regions are private to a process, they're in malloc. If they're * public, they're in file mapped memory, or, optionally, in system memory. * Regions in the filesystem are named "__db.001", "__db.002" and so on. If * we're not using a private environment allocated using malloc(3), the file * "__db.001" will always exist, as we use it to synchronize on the regions, * whether they exist in file mapped memory or system memory. * * The file "__db.001" contains a REGENV structure and a linked list of some * number of REGION structures. Each of the REGION structures describes and * locks one of the underlying shared regions used by DB. * * __db.001 * +---------+ * |REGENV | * +---------+ +----------+ * |REGION |-> | __db.002 | * | | +----------+ * +---------+ +----------+ * |REGION |-> | __db.003 | * | | +----------+ * +---------+ +----------+ * |REGION |-> | __db.004 | * | | +----------+ * +---------+ * * The only tricky part about manipulating the regions is correctly creating * or joining the REGENV file, i.e., __db.001. We have to be absolutely sure * that only one process creates it, and that everyone else joins it without * seeing inconsistent data. Once that region is created, we can use normal * shared locking procedures to do mutal exclusion for all other regions. * * One of the REGION structures in the main environment region describes the * environment region itself. * * To lock a region, locate the REGION structure that describes it and acquire * the region's mutex. There is one exception to this rule -- the lock for the * environment region itself is in the REGENV structure, and not in the REGION * that describes the environment region. That's so that we can acquire a lock * without walking linked lists that could potentially change underneath us. * The REGION will not be moved or removed during the life of the region, and * so long-lived references to it can be held by the process. * * All requests to create or join a region return a REGINFO structure, which * is held by the caller and used to open and subsequently close the reference * to the region. The REGINFO structure contains the per-process information * that we need to access the region. * * The one remaining complication. If the regions (including the environment * region) really live in system memory, we need some way of finding it. We * do this by writing the REGENV_REF structure into the "__db.001" file. When * we first open that file, and realize it holds a REGENV_REF instead of a * REGENV structure, we simply use that information to redirect to the real * "__db.001" file. Currently, this only happens when the REGENV file is in * shared system memory returned by the UNIX shmget(2) call. * * Although DB does not currently grow regions when they run out of memory, it * would be possible to do so. To grow a region, allocate a new region of the * appropriate size, then copy the old region over it and insert the additional * space into the already existing shalloc arena. Callers may have to fix up * local references, but that should be easy to do. This failed in historic * versions of DB because the region lock lived in the mapped memory, and when * it was unmapped and remapped (or copied), threads could lose track of it. * Once we moved that lock into a region that is never unmapped, growing should * work. That all said, current versions of DB don't implement region grow * because some systems don't support mutex copying, e.g., from OSF1 V4.0: * * The address of an msemaphore structure may be significant. If the * msemaphore structure contains any value copied from an msemaphore * structure at a different address, the result is undefined. */ #define DB_REGION_FMT "__db.%03d" /* Region file name format. */ #define DB_REGION_NAME_NUM 5 /* First digit offset in file names. */ #define DB_REGION_NAME_LENGTH 8 /* Length of file names. */ #define DB_REGION_ENV "__db.001" /* Primary environment name. */ #define INVALID_REGION_SEGID -1 /* Segment IDs are either shmget(2) or * Win16 segment identifiers. They are * both stored in an "int", and we need * an out-of-band value. */ /* * Currently, region offsets are limited to 32-bits. I expect that's going * to have to be fixed in the not-too-distant future, since we won't want to * split 100Gb memory pools into that many different regions. It's typedef'd * so it won't be too painful to upgrade. */ typedef u_int32_t roff_t; /* * Nothing can live at region offset 0, because, in all cases, that's where * we store *something*. Lots of code needs an out-of-band value for region * offsets, so we use 0. */ #define INVALID_ROFF 0 /* Reference describing system memory version of REGENV. */ typedef struct __db_reg_env_ref { roff_t size; /* Region size. */ int segid; /* shmget(2) ID. */ } REGENV_REF; /* Per-environment region information. */ typedef struct __db_reg_env { /* * !!! * The mutex must be the first entry in the structure to guarantee * correct alignment. */ MUTEX mutex; /* Environment mutex. */ /* * !!! * Note, the magic and panic fields are NOT protected by the mutex, * and for this reason cannot be anything more complicated than a * zero/non-zero value. * * !!! * Some 64-bit architectures (e.g., the OSF/1 Alpha processor) do not * support 32-bit atomic reads and writes, and so have an interesting * bug where sequential 32-bit values can be accidentally overwritten, * i.e., a variable protected by a lock gets overwritten by a thread * that doesn't hold the lock, simply because the variable sequentially * followed a variable that didn't need the lock for protection. We do * not want setting the panic value to be overwritten by another thread * unlocking the region, or vice-versa, for that matter. As the magic * variable is written only during region creation, list it first to * ensure this cannot happen. * * !!! * The valid region magic number must appear at the same byte offset * in both the environment and each shared region, as Windows/95 uses * it to determine if the memory has been zeroed since it was last used. */ #define DB_REGION_MAGIC 0x120897 u_int32_t magic; /* Valid region magic number. */ int panic; /* Environment is dead. */ int majver; /* Major DB version number. */ int minver; /* Minor DB version number. */ int patch; /* Patch DB version number. */ /* List of regions. */ SH_LIST_HEAD(__db_regionh) regionq; u_int32_t refcnt; /* References to the environment. */ size_t pad; /* Guarantee that following memory is * size_t aligned. This is necessary * because we're going to store the * allocation region information there. */ } REGENV; /* Per-region shared region information. */ typedef struct __db_region { /* * !!! * The mutex must be the first entry in the structure to guarantee * correct alignment. */ MUTEX mutex; /* Region mutex. */ /* * !!! * The valid region magic number must appear at the same byte offset * in both the environment and each shared region, as Windows/95 uses * it to determine if the memory has been zeroed since it was last used. */ u_int32_t magic; SH_LIST_ENTRY q; /* Linked list of REGIONs. */ roff_t size; /* Region size in bytes. */ roff_t primary; /* Primary data structure offset. */ int segid; /* UNIX shmget(2), Win16 segment ID. */ #define REG_ID_INVALID 0 /* Invalid. */ #define REG_ID_ENV 1 /* Environment. */ #define REG_ID_LOCK 2 /* Lock region. */ #define REG_ID_LOG 3 /* Log region. */ #define REG_ID_MPOOL 4 /* Mpool region. */ #define REG_ID_TXN 5 /* Txn region. */ #define REG_ID_ASSIGN (REG_ID_TXN + 1)/* First assignable region number. */ int id; /* Region id. */ #define REG_DEAD 0x01 /* Region may be corrupted. */ u_int32_t flags; } REGION; /* * Per-process/per-attachment information about a single region. */ struct __db_reginfo_t { /* CDB___db_r_attach IN parameters. */ int id; /* Region id: used for naming. */ int mode; /* File creation mode. */ /* CDB___db_r_attach OUT parameters. */ REGION *rp; /* Shared region. */ char *name; /* Region file name. */ void *addr; /* Region allocation address. */ void *primary; /* Primary data structure address. */ void *wnt_handle; /* Win/NT HANDLE. */ #define REGION_CREATE 0x01 /* Caller created region. */ #define REGION_CREATE_OK 0x02 /* Caller willing to create region. */ u_int32_t flags; }; /* * R_ADDR Return a per-process address for a shared region offset. * R_OFFSET Return a shared region offset for a per-process address. * * !!! * R_OFFSET should really be returning a ptrdiff_t, but that's not yet * portable. We use u_int32_t, which restricts regions to 4Gb in size. */ #define R_ADDR(base, offset) \ ((void *)((u_int8_t *)((base)->addr) + offset)) #define R_OFFSET(base, p) \ ((u_int32_t)((u_int8_t *)(p) - (u_int8_t *)(base)->addr)) /* * R_LOCK Lock/unlock a region. * R_UNLOCK */ #define R_LOCK(dbenv, reginfo) \ MUTEX_LOCK(&(reginfo)->rp->mutex, (dbenv)->lockfhp) #define R_UNLOCK(dbenv, reginfo) \ MUTEX_UNLOCK(&(reginfo)->rp->mutex) /* PANIC_CHECK: Check to see if the DB environment is dead. */ #define PANIC_CHECK(dbenv) \ if (DB_GLOBAL(db_panic) && \ (dbenv)->reginfo != NULL && ((REGENV *) \ ((REGINFO *)(dbenv)->reginfo)->primary)->panic != 0) \ return (DB_RUNRECOVERY); /* * All regions are created on 8K boundaries out of sheer paranoia, so that * we don't make some underlying VM unhappy. */ #define OS_ROUNDOFF(i, s) { \ (i) += (s) - 1; \ (i) -= (i) % (s); \ } #define OS_VMPAGESIZE (8 * 1024) #define OS_VMROUNDOFF(i) OS_ROUNDOFF(i, OS_VMPAGESIZE) ����������������������������������������������������������������������������������������������htdig-3.2.0b6/db/sco.cc�����������������������������������������������������������������������������0100644�0063146�0012731�00000000611�07427026535�014053� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)x86.uslc * * UnixWare has threads in libthread, but OpenServer doesn't (yet). * * For cc/x86, 0 is clear, 1 is set. */ #if defined(__USLC__) asm int _tsl_set(void *tsl) { %mem tsl movl tsl, %ecx movl $1, %eax lock xchgb (%ecx),%al xorl $1,%eax } #endif #define MUTEX_SET(tsl) _tsl_set(tsl) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) �����������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/shqueue.h��������������������������������������������������������������������������0100644�0063146�0012731�00000026651�07427026535�014624� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)shqueue.h 11.1 (Sleepycat) 7/25/99 */ #ifndef _SYS_SHQUEUE_H_ #define _SYS_SHQUEUE_H_ /* * This file defines three types of data structures: lists, tail queues, and * circular queues, similarly to the include file <sys/queue.h>. * * The difference is that this set of macros can be used for structures that * reside in shared memory that may be mapped at different addresses in each * process. In most cases, the macros for shared structures exactly mirror * the normal macros, although the macro calls require an additional type * parameter, only used by the HEAD and ENTRY macros of the standard macros. * * For details on the use of these macros, see the queue(3) manual page. */ /* * Shared list definitions. */ #define SH_LIST_HEAD(name) \ struct name { \ ssize_t slh_first; /* first element */ \ } #define SH_LIST_ENTRY \ struct { \ ssize_t sle_next; /* relative offset next element */ \ ssize_t sle_prev; /* relative offset of prev element */ \ } /* * Shared list functions. Since we use relative offsets for pointers, * 0 is a valid offset. Therefore, we use -1 to indicate end of list. * The macros ending in "P" return pointers without checking for end * of list, the others check for end of list and evaluate to either a * pointer or NULL. */ #define SH_LIST_FIRSTP(head, type) \ ((struct type *)(((u_int8_t *)(head)) + (head)->slh_first)) #define SH_LIST_FIRST(head, type) \ ((head)->slh_first == -1 ? NULL : \ ((struct type *)(((u_int8_t *)(head)) + (head)->slh_first))) #define SH_LIST_NEXTP(elm, field, type) \ ((struct type *)(((u_int8_t *)(elm)) + (elm)->field.sle_next)) #define SH_LIST_NEXT(elm, field, type) \ ((elm)->field.sle_next == -1 ? NULL : \ ((struct type *)(((u_int8_t *)(elm)) + (elm)->field.sle_next))) #define SH_LIST_PREV(elm, field) \ ((ssize_t *)(((u_int8_t *)(elm)) + (elm)->field.sle_prev)) #define SH_PTR_TO_OFF(src, dest) \ ((ssize_t)(((u_int8_t *)(dest)) - ((u_int8_t *)(src)))) #define SH_LIST_END(head) NULL /* * Take the element's next pointer and calculate what the corresponding * Prev pointer should be -- basically it is the negation plus the offset * of the next field in the structure. */ #define SH_LIST_NEXT_TO_PREV(elm, field) \ (-(elm)->field.sle_next + SH_PTR_TO_OFF(elm, &(elm)->field.sle_next)) #define SH_LIST_INIT(head) (head)->slh_first = -1 #define SH_LIST_INSERT_AFTER(listelm, elm, field, type) do { \ if ((listelm)->field.sle_next != -1) { \ (elm)->field.sle_next = SH_PTR_TO_OFF(elm, \ SH_LIST_NEXTP(listelm, field, type)); \ SH_LIST_NEXTP(listelm, field, type)->field.sle_prev = \ SH_LIST_NEXT_TO_PREV(elm, field); \ } else \ (elm)->field.sle_next = -1; \ (listelm)->field.sle_next = SH_PTR_TO_OFF(listelm, elm); \ (elm)->field.sle_prev = SH_LIST_NEXT_TO_PREV(listelm, field); \ } while (0) #define SH_LIST_INSERT_HEAD(head, elm, field, type) do { \ if ((head)->slh_first != -1) { \ (elm)->field.sle_next = \ (head)->slh_first - SH_PTR_TO_OFF(head, elm); \ SH_LIST_FIRSTP(head, type)->field.sle_prev = \ SH_LIST_NEXT_TO_PREV(elm, field); \ } else \ (elm)->field.sle_next = -1; \ (head)->slh_first = SH_PTR_TO_OFF(head, elm); \ (elm)->field.sle_prev = SH_PTR_TO_OFF(elm, &(head)->slh_first); \ } while (0) #define SH_LIST_REMOVE(elm, field, type) do { \ if ((elm)->field.sle_next != -1) { \ SH_LIST_NEXTP(elm, field, type)->field.sle_prev = \ (elm)->field.sle_prev - (elm)->field.sle_next; \ *SH_LIST_PREV(elm, field) += (elm)->field.sle_next; \ } else \ *SH_LIST_PREV(elm, field) = -1; \ } while (0) /* * Shared tail queue definitions. */ #define SH_TAILQ_HEAD(name) \ struct name { \ ssize_t stqh_first; /* relative offset of first element */ \ ssize_t stqh_last; /* relative offset of last's next */ \ } #define SH_TAILQ_ENTRY \ struct { \ ssize_t stqe_next; /* relative offset of next element */ \ ssize_t stqe_prev; /* relative offset of prev's next */ \ } /* * Shared tail queue functions. */ #define SH_TAILQ_FIRSTP(head, type) \ ((struct type *)((u_int8_t *)(head) + (head)->stqh_first)) #define SH_TAILQ_FIRST(head, type) \ ((head)->stqh_first == -1 ? NULL : SH_TAILQ_FIRSTP(head, type)) #define SH_TAILQ_NEXTP(elm, field, type) \ ((struct type *)((u_int8_t *)(elm) + (elm)->field.stqe_next)) #define SH_TAILQ_NEXT(elm, field, type) \ ((elm)->field.stqe_next == -1 ? NULL : SH_TAILQ_NEXTP(elm, field, type)) #define SH_TAILQ_PREVP(elm, field) \ ((ssize_t *)((u_int8_t *)(elm) + (elm)->field.stqe_prev)) #define SH_TAILQ_LAST(head) \ ((ssize_t *)(((u_int8_t *)(head)) + (head)->stqh_last)) #define SH_TAILQ_NEXT_TO_PREV(elm, field) \ (-(elm)->field.stqe_next + SH_PTR_TO_OFF(elm, &(elm)->field.stqe_next)) #define SH_TAILQ_END(head) NULL #define SH_TAILQ_INIT(head) { \ (head)->stqh_first = -1; \ (head)->stqh_last = SH_PTR_TO_OFF(head, &(head)->stqh_first); \ } #define SH_TAILQ_INSERT_HEAD(head, elm, field, type) do { \ if ((head)->stqh_first != -1) { \ (elm)->field.stqe_next = \ (head)->stqh_first - SH_PTR_TO_OFF(head, elm); \ SH_TAILQ_FIRSTP(head, type)->field.stqe_prev = \ SH_TAILQ_NEXT_TO_PREV(elm, field); \ } else { \ (elm)->field.stqe_next = -1; \ (head)->stqh_last = \ SH_PTR_TO_OFF(head, &(elm)->field.stqe_next); \ } \ (head)->stqh_first = SH_PTR_TO_OFF(head, elm); \ (elm)->field.stqe_prev = \ SH_PTR_TO_OFF(elm, &(head)->stqh_first); \ } while (0) #define SH_TAILQ_INSERT_TAIL(head, elm, field) do { \ (elm)->field.stqe_next = -1; \ (elm)->field.stqe_prev = \ -SH_PTR_TO_OFF(head, elm) + (head)->stqh_last; \ if ((head)->stqh_last == \ SH_PTR_TO_OFF((head), &(head)->stqh_first)) \ (head)->stqh_first = SH_PTR_TO_OFF(head, elm); \ else \ *SH_TAILQ_LAST(head) = -(head)->stqh_last + \ SH_PTR_TO_OFF((elm), &(elm)->field.stqe_next) + \ SH_PTR_TO_OFF(head, elm); \ (head)->stqh_last = \ SH_PTR_TO_OFF(head, &((elm)->field.stqe_next)); \ } while (0) #define SH_TAILQ_INSERT_AFTER(head, listelm, elm, field, type) do { \ if ((listelm)->field.stqe_next != -1) { \ (elm)->field.stqe_next = (listelm)->field.stqe_next - \ SH_PTR_TO_OFF(listelm, elm); \ SH_TAILQ_NEXTP(listelm, field, type)->field.stqe_prev = \ SH_TAILQ_NEXT_TO_PREV(elm, field); \ } else { \ (elm)->field.stqe_next = -1; \ (head)->stqh_last = \ SH_PTR_TO_OFF(head, &elm->field.stqe_next); \ } \ (listelm)->field.stqe_next = SH_PTR_TO_OFF(listelm, elm); \ (elm)->field.stqe_prev = SH_TAILQ_NEXT_TO_PREV(listelm, field); \ } while (0) #define SH_TAILQ_REMOVE(head, elm, field, type) do { \ if ((elm)->field.stqe_next != -1) { \ SH_TAILQ_NEXTP(elm, field, type)->field.stqe_prev = \ (elm)->field.stqe_prev + \ SH_PTR_TO_OFF(SH_TAILQ_NEXTP(elm, \ field, type), elm); \ *SH_TAILQ_PREVP(elm, field) += elm->field.stqe_next; \ } else { \ (head)->stqh_last = (elm)->field.stqe_prev + \ SH_PTR_TO_OFF(head, elm); \ *SH_TAILQ_PREVP(elm, field) = -1; \ } \ } while (0) /* * Shared circular queue definitions. */ #define SH_CIRCLEQ_HEAD(name) \ struct name { \ ssize_t scqh_first; /* first element */ \ ssize_t scqh_last; /* last element */ \ } #define SH_CIRCLEQ_ENTRY \ struct { \ ssize_t scqe_next; /* next element */ \ ssize_t scqe_prev; /* previous element */ \ } /* * Shared circular queue functions. */ #define SH_CIRCLEQ_FIRSTP(head, type) \ ((struct type *)(((u_int8_t *)(head)) + (head)->scqh_first)) #define SH_CIRCLEQ_FIRST(head, type) \ ((head)->scqh_first == -1 ? \ (void *)head : SH_CIRCLEQ_FIRSTP(head, type)) #define SH_CIRCLEQ_LASTP(head, type) \ ((struct type *)(((u_int8_t *)(head)) + (head)->scqh_last)) #define SH_CIRCLEQ_LAST(head, type) \ ((head)->scqh_last == -1 ? (void *)head : SH_CIRCLEQ_LASTP(head, type)) #define SH_CIRCLEQ_NEXTP(elm, field, type) \ ((struct type *)(((u_int8_t *)(elm)) + (elm)->field.scqe_next)) #define SH_CIRCLEQ_NEXT(head, elm, field, type) \ ((elm)->field.scqe_next == SH_PTR_TO_OFF(elm, head) ? \ (void *)head : SH_CIRCLEQ_NEXTP(elm, field, type)) #define SH_CIRCLEQ_PREVP(elm, field, type) \ ((struct type *)(((u_int8_t *)(elm)) + (elm)->field.scqe_prev)) #define SH_CIRCLEQ_PREV(head, elm, field, type) \ ((elm)->field.scqe_prev == SH_PTR_TO_OFF(elm, head) ? \ (void *)head : SH_CIRCLEQ_PREVP(elm, field, type)) #define SH_CIRCLEQ_END(head) ((void *)(head)) #define SH_CIRCLEQ_INIT(head) { \ (head)->scqh_first = 0; \ (head)->scqh_last = 0; \ } #define SH_CIRCLEQ_INSERT_AFTER(head, listelm, elm, field, type) do { \ (elm)->field.scqe_prev = SH_PTR_TO_OFF(elm, listelm); \ (elm)->field.scqe_next = (listelm)->field.scqe_next + \ (elm)->field.scqe_prev; \ if (SH_CIRCLEQ_NEXTP(listelm, field, type) == (void *)head) \ (head)->scqh_last = SH_PTR_TO_OFF(head, elm); \ else \ SH_CIRCLEQ_NEXTP(listelm, \ field, type)->field.scqe_prev = \ SH_PTR_TO_OFF(SH_CIRCLEQ_NEXTP(listelm, \ field, type), elm); \ (listelm)->field.scqe_next = -(elm)->field.scqe_prev; \ } while (0) #define SH_CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field, type) do { \ (elm)->field.scqe_next = SH_PTR_TO_OFF(elm, listelm); \ (elm)->field.scqe_prev = (elm)->field.scqe_next - \ SH_CIRCLEQ_PREVP(listelm, field, type)->field.scqe_next;\ if (SH_CIRCLEQ_PREVP(listelm, field, type) == (void *)(head)) \ (head)->scqh_first = SH_PTR_TO_OFF(head, elm); \ else \ SH_CIRCLEQ_PREVP(listelm, \ field, type)->field.scqe_next = \ SH_PTR_TO_OFF(SH_CIRCLEQ_PREVP(listelm, \ field, type), elm); \ (listelm)->field.scqe_prev = -(elm)->field.scqe_next; \ } while (0) #define SH_CIRCLEQ_INSERT_HEAD(head, elm, field, type) do { \ (elm)->field.scqe_prev = SH_PTR_TO_OFF(elm, head); \ (elm)->field.scqe_next = (head)->scqh_first + \ (elm)->field.scqe_prev; \ if ((head)->scqh_last == 0) \ (head)->scqh_last = -(elm)->field.scqe_prev; \ else \ SH_CIRCLEQ_FIRSTP(head, type)->field.scqe_prev = \ SH_PTR_TO_OFF(SH_CIRCLEQ_FIRSTP(head, type), elm); \ (head)->scqh_first = -(elm)->field.scqe_prev; \ } while (0) #define SH_CIRCLEQ_INSERT_TAIL(head, elm, field, type) do { \ (elm)->field.scqe_next = SH_PTR_TO_OFF(elm, head); \ (elm)->field.scqe_prev = (head)->scqh_last + \ (elm)->field.scqe_next; \ if ((head)->scqh_first == 0) \ (head)->scqh_first = -(elm)->field.scqe_next; \ else \ SH_CIRCLEQ_LASTP(head, type)->field.scqe_next = \ SH_PTR_TO_OFF(SH_CIRCLEQ_LASTP(head, type), elm); \ (head)->scqh_last = -(elm)->field.scqe_next; \ } while (0) #define SH_CIRCLEQ_REMOVE(head, elm, field, type) do { \ if (SH_CIRCLEQ_NEXTP(elm, field, type) == (void *)(head)) \ (head)->scqh_last += (elm)->field.scqe_prev; \ else \ SH_CIRCLEQ_NEXTP(elm, field, type)->field.scqe_prev += \ (elm)->field.scqe_prev; \ if (SH_CIRCLEQ_PREVP(elm, field, type) == (void *)(head)) \ (head)->scqh_first += (elm)->field.scqe_next; \ else \ SH_CIRCLEQ_PREVP(elm, field, type)->field.scqe_next += \ (elm)->field.scqe_next; \ } while (0) #endif /* !_SYS_SHQUEUE_H_ */ ���������������������������������������������������������������������������������������htdig-3.2.0b6/db/sparc.gcc��������������������������������������������������������������������������0100644�0063146�0012731�00000002027�07427026535�014551� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)sparc.gcc 11.4 (Sleepycat) 9/14/99 * * The ldstub instruction takes the location specified by its first argument * (a register containing a memory address) and loads its contents into its * second argument (a register) and atomically sets the contents the location * specified by its first argument to a byte of 1s. (The value in the second * argument is never read, but only overwritten.) * * The stbar is needed for v8, and is implemented as membar #sync on v9, + so is functional there as well. For v7, stbar may generate an illegal + instruction and we have no way to tell what we're running on. Some + operating systems notice and skip this instruction in the fault handler. * * For gcc/sparc, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ register tsl_t __r; \ __asm__ volatile \ ("ldstub [%1],%0; stbar" \ : "=r"( __r) : "r" (__l)); \ !__r; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/stamp-h.in�������������������������������������������������������������������������0100644�0063146�0012731�00000000012�07427026535�014654� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������timestamp ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn.c������������������������������������������������������������������������������0100644�0063146�0012731�00000054520�07427026535�013745� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1995, 1996 * The President and Fellows of Harvard University. All rights reserved. * * This code is derived from software contributed to Berkeley by * Margo Seltzer. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)txn.c 11.13 (Sleepycat) 11/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "db_shash.h" #include "txn.h" #include "lock.h" #include "log.h" #include "db_dispatch.h" static int CDB___txn_begin __P((DB_TXN *)); static int CDB___txn_check_running __P((const DB_TXN *, TXN_DETAIL **)); static int CDB___txn_count __P((DB_TXN *)); static void CDB___txn_freekids __P((DB_TXN *)); static void CDB___txn_lsn __P((DB_TXN *, DB_LSN **)); static int CDB___txn_makefamily __P((DB_TXN *, int *, DB_LSN **)); static int CDB___txn_undo __P((DB_TXN *)); #define TXN_BUBBLE(AP, MAX) { \ int __j; \ DB_LSN __tmp; \ \ for (__j = 0; __j < MAX - 1; __j++) \ if (CDB_log_compare(&AP[__j], &AP[__j + 1]) < 0) { \ __tmp = AP[__j]; \ AP[__j] = AP[__j + 1]; \ AP[__j + 1] = __tmp; \ } \ } /* * CDB_txn_begin -- * This is a wrapper to the actual begin process. Normal CDB_txn_begin() * allocates a DB_TXN structure for the caller, while txn_xa_begin() does * not. Other than that, both call into the common CDB___txn_begin code(). * * Internally, we use TXN_DETAIL structures, but the DB_TXN structure * provides access to the transaction ID and the offset in the transaction * region of the TXN_DETAIL structure. */ int CDB_txn_begin(dbenv, parent, txnpp, flags) DB_ENV *dbenv; DB_TXN *parent, **txnpp; u_int32_t flags; { DB_TXN *txn; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, DB_INIT_TXN); if ((ret = CDB___db_fchk(dbenv, "CDB_txn_begin", flags, DB_TXN_NOWAIT | DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "CDB_txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0) return (ret); if ((ret = CDB___os_calloc(1, sizeof(DB_TXN), &txn)) != 0) return (ret); txn->mgrp = dbenv->tx_handle; txn->parent = parent; TAILQ_INIT(&txn->kids); txn->flags = TXN_MALLOC; if (LF_ISSET(DB_TXN_NOSYNC)) F_SET(txn, TXN_NOSYNC); if (LF_ISSET(DB_TXN_SYNC)) F_SET(txn, TXN_SYNC); if (LF_ISSET(DB_TXN_NOWAIT)) F_SET(txn, TXN_NOWAIT); if ((ret = CDB___txn_begin(txn)) != 0) { CDB___os_free(txn, sizeof(DB_TXN)); txn = NULL; } if (txn != NULL && parent != NULL) TAILQ_INSERT_HEAD(&parent->kids, txn, klinks); *txnpp = txn; return (ret); } /* * CDB___txn_xa_begin -- * XA version of CDB_txn_begin. * * PUBLIC: int CDB___txn_xa_begin __P((DB_ENV *, DB_TXN *)); */ int CDB___txn_xa_begin(dbenv, txn) DB_ENV *dbenv; DB_TXN *txn; { PANIC_CHECK(dbenv); memset(txn, 0, sizeof(DB_TXN)); txn->mgrp = dbenv->tx_handle; return (CDB___txn_begin(txn)); } /* * CDB___txn_begin -- * Normal DB version of CDB_txn_begin. */ static int CDB___txn_begin(txn) DB_TXN *txn; { DB_ENV *dbenv; DB_LSN begin_lsn; DB_TXNMGR *mgr; DB_TXNREGION *region; TXN_DETAIL *td; size_t off; u_int32_t id; int ret; mgr = txn->mgrp; dbenv = mgr->dbenv; region = mgr->reginfo.primary; /* * We do not have to write begin records (and if we do not, then we * need never write records for read-only transactions). However, * we do need to find the current LSN so that we can store it in the * transaction structure, so we can know where to take checkpoints. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) && (ret = CDB_log_put(dbenv, &begin_lsn, NULL, DB_CURLSN)) != 0) goto err2; R_LOCK(dbenv, &mgr->reginfo); /* Make sure that last_txnid is not going to wrap around. */ if (region->last_txnid == TXN_INVALID) { CDB___db_err(dbenv, "CDB_txn_begin: %s %s", "Transaction ID wrapping.", "Snapshot your database and start a new log."); ret = EINVAL; goto err1; } /* Allocate a new transaction detail structure. */ if ((ret = CDB___db_shalloc(mgr->reginfo.addr, sizeof(TXN_DETAIL), 0, &td)) != 0) goto err1; /* Place transaction on active transaction list. */ SH_TAILQ_INSERT_HEAD(®ion->active_txn, td, links, __txn_detail); id = ++region->last_txnid; ++region->nbegins; if (++region->nactive > region->maxnactive) region->maxnactive = region->nactive; td->txnid = id; td->begin_lsn = begin_lsn; ZERO_LSN(td->last_lsn); td->status = TXN_RUNNING; if (txn->parent != NULL) td->parent = txn->parent->off; else td->parent = INVALID_ROFF; off = R_OFFSET(&mgr->reginfo, td); R_UNLOCK(dbenv, &mgr->reginfo); ZERO_LSN(txn->last_lsn); txn->txnid = id; txn->off = off; /* * If this is a transaction family, we must * link the child to the maximal grandparent * in the lock table for deadlock detection. */ if (txn->parent != NULL && F_ISSET(dbenv, DB_ENV_LOCKING | DB_ENV_CDB)) { if ((ret = CDB___lock_addfamilylocker(dbenv, txn->parent->txnid, txn->txnid)) != 0) goto err2; } if (F_ISSET(txn, TXN_MALLOC)) { MUTEX_THREAD_LOCK(mgr->mutexp); TAILQ_INSERT_TAIL(&mgr->txn_chain, txn, links); MUTEX_THREAD_UNLOCK(mgr->mutexp); } return (0); err1: R_UNLOCK(dbenv, &mgr->reginfo); err2: return (ret); } /* * CDB_txn_commit -- * Commit a transaction. */ int CDB_txn_commit(txnp, flags) DB_TXN *txnp; u_int32_t flags; { DB_ENV *dbenv; DB_TXN *kids; DB_TXNMGR *mgr; int ret; mgr = txnp->mgrp; dbenv = mgr->dbenv; PANIC_CHECK(dbenv); if ((ret = CDB___db_fchk(dbenv, "CDB_txn_commit", flags, DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0) return (ret); if ((ret = CDB___db_fcchk(dbenv, "CDB_txn_commit", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0) return (ret); if ((ret = CDB___txn_check_running(txnp, NULL)) != 0) return (ret); if (LF_ISSET(DB_TXN_NOSYNC)) { F_CLR(txnp, TXN_SYNC); F_SET(txnp, TXN_NOSYNC); } if (LF_ISSET(DB_TXN_SYNC)) { F_CLR(txnp, TXN_NOSYNC); F_SET(txnp, TXN_SYNC); } /* Commit any uncommitted children. */ for (kids = TAILQ_FIRST(&txnp->kids); kids != NULL; kids = TAILQ_NEXT(kids, klinks)) if (!F_ISSET(kids, TXN_CHILDCOMMIT) && (ret = CDB_txn_commit(kids, flags)) != 0) return (ret); /* * If there are any log records, write a log record and sync the log, * else do no log writes. If the commit is for a child transaction, * we do not need to commit the child synchronously since it may still * abort (if its parent aborts), and otherwise its parent or ultimate * ancestor will write synchronously. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) && (F_ISSET(txnp, TXN_MUSTFLUSH) || !IS_ZERO_LSN(txnp->last_lsn))) { if (txnp->parent == NULL) ret = CDB___txn_regop_log(dbenv, txnp, &txnp->last_lsn, (F_ISSET(mgr->dbenv, DB_ENV_TXN_NOSYNC) && !F_ISSET(txnp, TXN_SYNC)) || F_ISSET(txnp, TXN_NOSYNC) ? 0 : DB_FLUSH, TXN_COMMIT); else { F_SET(txnp->parent, TXN_MUSTFLUSH); ret = CDB___txn_child_log(dbenv, txnp, &txnp->last_lsn, 0, TXN_COMMIT, txnp->parent->txnid); } if (ret != 0) return (ret); } /* * If this is the senior ancestor (i.e., it has no parent), then we * can release all the child transactions since everyone is committing. * Then we can release this transaction. If this is not the ultimate * ancestor, then we can neither free it or its children. */ if (txnp->parent == NULL) CDB___txn_freekids(txnp); return (CDB___txn_end(txnp, 1)); } /* * CDB_txn_abort -- * Abort a transaction. */ int CDB_txn_abort(txnp) DB_TXN *txnp; { int ret; PANIC_CHECK(txnp->mgrp->dbenv); if ((ret = CDB___txn_check_running(txnp, NULL)) != 0) return (ret); if ((ret = CDB___txn_undo(txnp)) != 0) { CDB___db_err(txnp->mgrp->dbenv, "CDB_txn_abort: Log undo failed %s", CDB_db_strerror(ret)); return (ret); } return (CDB___txn_end(txnp, 0)); } /* * CDB_txn_prepare -- * Flush the log so a future commit is guaranteed to succeed. */ int CDB_txn_prepare(txnp) DB_TXN *txnp; { DBT xid; DB_ENV *dbenv; TXN_DETAIL *td; int ret; if ((ret = CDB___txn_check_running(txnp, &td)) != 0) return (ret); dbenv = txnp->mgrp->dbenv; memset(&xid, 0, sizeof(xid)); xid.data = td->xid; xid.size = sizeof(td->xid); if (F_ISSET(dbenv, DB_ENV_LOGGING) && (ret = CDB___txn_xa_regop_log(dbenv, txnp, &txnp->last_lsn, (F_ISSET(dbenv, DB_ENV_TXN_NOSYNC) && !F_ISSET(txnp, TXN_SYNC)) || F_ISSET(txnp, TXN_NOSYNC) ? 0 : DB_FLUSH, TXN_PREPARE, &xid, td->format, td->gtrid, td->bqual)) != 0) { CDB___db_err(dbenv, "CDB_txn_prepare: log_write failed %s\n", CDB_db_strerror(ret)); return (ret); } MUTEX_THREAD_LOCK(txnp->mgrp->mutexp); td->status = TXN_PREPARED; MUTEX_THREAD_UNLOCK(txnp->mgrp->mutexp); return (ret); } /* * Return the transaction ID associated with a particular transaction */ u_int32_t CDB_txn_id(txnp) DB_TXN *txnp; { return (txnp->txnid); } /* Internal routines. */ /* * Return 0 if the txnp is reasonable, otherwise returns EINVAL. */ static int CDB___txn_check_running(txnp, tdp) const DB_TXN *txnp; TXN_DETAIL **tdp; { DB_TXNMGR *mgrp; TXN_DETAIL *tp; tp = NULL; mgrp = txnp->mgrp; if (txnp != NULL && mgrp != NULL && mgrp->reginfo.primary != NULL) { tp = (TXN_DETAIL *)R_ADDR(&mgrp->reginfo, txnp->off); /* * Child transactions could be marked committed which is OK. */ if (tp->status != TXN_RUNNING && tp->status != TXN_PREPARED && tp->status != TXN_COMMITTED) tp = NULL; if (tdp != NULL) *tdp = tp; } return (tp == NULL ? EINVAL : 0); } /* * CDB___txn_end -- * Internal transaction end routine. * * PUBLIC: int CDB___txn_end __P((DB_TXN *, int)); */ int CDB___txn_end(txnp, is_commit) DB_TXN *txnp; int is_commit; { DB_ENV *dbenv; DB_LOCKREQ request; DB_TXN *kids; DB_TXNMGR *mgr; DB_TXNREGION *region; TXN_DETAIL *tp; int ret; mgr = txnp->mgrp; dbenv = mgr->dbenv; region = mgr->reginfo.primary; /* * On aborts, we've undone the children, but we still need * to free the up. */ if (!is_commit) { while ((kids = TAILQ_FIRST(&txnp->kids)) != NULL) if ((ret = CDB___txn_end(kids, is_commit)) != 0) return (DB_RUNRECOVERY); } /* Release the locks. */ request.op = txnp->parent == NULL || is_commit == 0 ? DB_LOCK_PUT_ALL : DB_LOCK_INHERIT; if (F_ISSET(dbenv, DB_ENV_LOCKING)) { ret = CDB_lock_vec(dbenv, txnp->txnid, 0, &request, 1, NULL); if (ret != 0 && (ret != DB_LOCK_DEADLOCK || is_commit)) { CDB___db_err(dbenv, "%s: release locks failed %s", is_commit ? "CDB_txn_commit" : "CDB_txn_abort", CDB_db_strerror(ret)); return (ret); } } /* End the transaction. */ R_LOCK(dbenv, &mgr->reginfo); /* * Child transactions that are committing cannot be released until * the parent commits, since the parent may abort, causing the child * to abort as well. */ tp = (TXN_DETAIL *)R_ADDR(&mgr->reginfo, txnp->off); if (txnp->parent == NULL || !is_commit) { SH_TAILQ_REMOVE(®ion->active_txn, tp, links, __txn_detail); CDB___db_shalloc_free(mgr->reginfo.addr, tp); } else { tp->status = TXN_COMMITTED; F_SET(txnp, TXN_CHILDCOMMIT); } if (is_commit) region->ncommits++; else region->naborts++; --region->nactive; R_UNLOCK(dbenv, &mgr->reginfo); /* * If the transaction aborted, we can remove it from its parent links. * If it committed, then we need to leave it on, since the parent can * still abort. * The transaction cannot get more locks, remove its locker info. */ if (txnp->parent != NULL) { if (F_ISSET(dbenv, DB_ENV_LOCKING | DB_ENV_CDB)) CDB___lock_freefamilylocker(dbenv->lk_handle, txnp->txnid); if (!is_commit) TAILQ_REMOVE(&txnp->parent->kids, txnp, klinks); } /* Free the space. */ if (F_ISSET(txnp, TXN_MALLOC) && (txnp->parent == NULL || !is_commit)) { MUTEX_THREAD_LOCK(mgr->mutexp); TAILQ_REMOVE(&mgr->txn_chain, txnp, links); MUTEX_THREAD_UNLOCK(mgr->mutexp); CDB___os_free(txnp, sizeof(*txnp)); } return (0); } /* * CDB___txn_undo -- * Undo the transaction with id txnid. Returns 0 on success and * errno on failure. */ static int CDB___txn_undo(txnp) DB_TXN *txnp; { DBT rdbt; DB_ENV *dbenv; DB_LSN *lsn_array, *key_lsnp; DB_TXNMGR *mgr; int ntxns, ret, threaded; mgr = txnp->mgrp; dbenv = mgr->dbenv; lsn_array = NULL; if (!F_ISSET(dbenv, DB_ENV_LOGGING)) return (0); /* * This is the simplest way to code this, but if the mallocs during * recovery turn out to be a performance issue, we can do the * allocation here and use DB_DBT_USERMEM. */ memset(&rdbt, 0, sizeof(rdbt)); threaded = F_ISSET(dbenv, DB_ENV_THREAD) ? 1 : 0; if (threaded) F_SET(&rdbt, DB_DBT_MALLOC); key_lsnp = &txnp->last_lsn; if (TAILQ_FIRST(&txnp->kids) != NULL) { if ((ret = CDB___txn_makefamily(txnp, &ntxns, &lsn_array)) != 0) return (ret); key_lsnp = &lsn_array[0]; } for (ret = 0; ret == 0 && !IS_ZERO_LSN(*key_lsnp);) { /* * The dispatch routine returns the lsn of the record * before the current one in the key_lsnp argument. */ if ((ret = CDB_log_get(dbenv, key_lsnp, &rdbt, DB_SET)) == 0) { ret = mgr->recover(dbenv, &rdbt, key_lsnp, TXN_UNDO, NULL); if (threaded && rdbt.data != NULL) { CDB___os_free(rdbt.data, rdbt.size); rdbt.data = NULL; } if (lsn_array != NULL) TXN_BUBBLE(lsn_array, ntxns); } if (ret != 0) return (ret); } return (ret); } /* * Transaction checkpoint. * If either kbytes or minutes is non-zero, then we only take the checkpoint * more than "minutes" minutes have passed since the last checkpoint or if * more than "kbytes" of log data have been written since the last checkpoint. * When taking a checkpoint, find the oldest active transaction and figure out * its first LSN. This is the lowest LSN we can checkpoint, since any record * written after since that point may be involved in a transaction and may * therefore need to be undone in the case of an abort. */ int CDB_txn_checkpoint(dbenv, kbytes, minutes) DB_ENV *dbenv; u_int32_t kbytes, minutes; { DB_LOG *dblp; DB_LSN ckp_lsn, sync_lsn, last_ckp; DB_TXNMGR *mgr; DB_TXNREGION *region; LOG *lp; TXN_DETAIL *txnp; time_t last_ckp_time, now; u_int32_t kbytes_written; int ret; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, DB_INIT_TXN); mgr = dbenv->tx_handle; region = mgr->reginfo.primary; dblp = dbenv->lg_handle; lp = dblp->reginfo.primary; /* * Check if we need to run recovery. */ ZERO_LSN(ckp_lsn); if (minutes != 0) { (void)time(&now); R_LOCK(dbenv, &mgr->reginfo); last_ckp_time = region->time_ckp; R_UNLOCK(dbenv, &mgr->reginfo); if (now - last_ckp_time >= (time_t)(minutes * 60)) goto do_ckp; } if (kbytes != 0) { R_LOCK(dbenv, &dblp->reginfo); kbytes_written = lp->stat.st_wc_mbytes * 1024 + lp->stat.st_wc_bytes / 1024; ckp_lsn = lp->lsn; R_UNLOCK(dbenv, &dblp->reginfo); if (kbytes_written >= (u_int32_t)kbytes) goto do_ckp; } /* * If we checked time and data and didn't go to checkpoint, * we're done. */ if (minutes != 0 || kbytes != 0) return (0); do_ckp: if (IS_ZERO_LSN(ckp_lsn)) { R_LOCK(dbenv, &dblp->reginfo); ckp_lsn = lp->lsn; R_UNLOCK(dbenv, &dblp->reginfo); } /* * We have to find an LSN such that all transactions begun * before that LSN are complete. */ R_LOCK(dbenv, &mgr->reginfo); if (IS_ZERO_LSN(region->pending_ckp)) { for (txnp = SH_TAILQ_FIRST(®ion->active_txn, __txn_detail); txnp != NULL; txnp = SH_TAILQ_NEXT(txnp, links, __txn_detail)) { /* * Look through the active transactions for the * lowest begin lsn. */ if (!IS_ZERO_LSN(txnp->begin_lsn) && CDB_log_compare(&txnp->begin_lsn, &ckp_lsn) < 0) ckp_lsn = txnp->begin_lsn; } region->pending_ckp = ckp_lsn; } else ckp_lsn = region->pending_ckp; R_UNLOCK(dbenv, &mgr->reginfo); /* * CDB_memp_sync may change the lsn you pass it, so don't pass it * the actual ckp_lsn, pass it a temp instead. */ sync_lsn = ckp_lsn; if (mgr->dbenv->mp_handle != NULL && (ret = CDB_memp_sync(mgr->dbenv, &sync_lsn)) != 0) { /* * ret == DB_INCOMPLETE means that there are still buffers to * flush, the checkpoint is not complete. Wait and try again. */ if (ret > 0) CDB___db_err(mgr->dbenv, "CDB_txn_checkpoint: system failure in CDB_memp_sync %s\n", CDB_db_strerror(ret)); return (ret); } if (F_ISSET(mgr->dbenv, DB_ENV_LOGGING)) { R_LOCK(dbenv, &mgr->reginfo); last_ckp = region->last_ckp; ZERO_LSN(region->pending_ckp); R_UNLOCK(dbenv, &mgr->reginfo); if ((ret = CDB___txn_ckp_log(mgr->dbenv, NULL, &ckp_lsn, DB_CHECKPOINT, &ckp_lsn, &last_ckp)) != 0) { CDB___db_err(mgr->dbenv, "CDB_txn_checkpoint: log failed at LSN [%ld %ld] %s\n", (long)ckp_lsn.file, (long)ckp_lsn.offset, CDB_db_strerror(ret)); return (ret); } R_LOCK(dbenv, &mgr->reginfo); region->last_ckp = ckp_lsn; (void)time(®ion->time_ckp); R_UNLOCK(dbenv, &mgr->reginfo); } return (0); } static void CDB___txn_freekids(txnp) DB_TXN *txnp; { DB_ENV *dbenv; DB_TXN *kids; DB_TXNMGR *mgr; DB_TXNREGION *region; TXN_DETAIL *tp; mgr = txnp->mgrp; dbenv = mgr->dbenv; region = mgr->reginfo.primary; for (kids = TAILQ_FIRST(&txnp->kids); kids != NULL; kids = TAILQ_FIRST(&txnp->kids)) { /* Free any children of this transaction. */ CDB___txn_freekids(kids); /* Free the transaction detail in the region. */ R_LOCK(dbenv, &mgr->reginfo); tp = (TXN_DETAIL *)R_ADDR(&mgr->reginfo, kids->off); SH_TAILQ_REMOVE(®ion->active_txn, tp, links, __txn_detail); CDB___db_shalloc_free(mgr->reginfo.addr, tp); R_UNLOCK(dbenv, &mgr->reginfo); /* Now remove from its parent. */ TAILQ_REMOVE(&txnp->kids, kids, klinks); if (F_ISSET(txnp, TXN_MALLOC)) { MUTEX_THREAD_LOCK(mgr->mutexp); TAILQ_REMOVE(&mgr->txn_chain, kids, links); MUTEX_THREAD_UNLOCK(mgr->mutexp); CDB___os_free(kids, sizeof(*kids)); } } } /* * CDB___txn_is_ancestor -- * Determine if a transaction is an ancestor of another transaction. * This is used during lock promotion when we do not have the per-process * data structures that link parents together. Instead, we'll have to * follow the links in the transaction region. * * PUBLIC: int CDB___txn_is_ancestor __P((DB_ENV *, size_t, size_t)); */ int CDB___txn_is_ancestor(dbenv, hold_off, req_off) DB_ENV *dbenv; size_t hold_off, req_off; { DB_TXNMGR *mgr; TXN_DETAIL *hold_tp, *req_tp; mgr = dbenv->tx_handle; hold_tp = (TXN_DETAIL *)R_ADDR(&mgr->reginfo, hold_off); req_tp = (TXN_DETAIL *)R_ADDR(&mgr->reginfo, req_off); while (req_tp->parent != INVALID_ROFF) { req_tp = (TXN_DETAIL *)R_ADDR(&mgr->reginfo, req_tp->parent); if (req_tp->txnid == hold_tp->txnid) return (1); } return (0); } /* * CDB___txn_makefamily -- * Create an array of DB_LSNs for every member of the family being * aborted so that we can undo the records in the appropriate order. We * allocate memory here and expect our caller to free it when they're done. */ static int CDB___txn_makefamily(txnp, np, arrayp) DB_TXN *txnp; int *np; DB_LSN **arrayp; { DB_LSN *ap, *tmpp; int i, ret; /* Figure out how many we have. */ *np = CDB___txn_count(txnp); /* Malloc space. */ if ((ret = CDB___os_malloc(*np * sizeof(DB_LSN), NULL, arrayp)) != 0) return (ret); /* Fill in the space. */ tmpp = *arrayp; CDB___txn_lsn(txnp, &tmpp); /* Sort the LSNs. */ ap = *arrayp; for (i = 0; i < *np; i++) TXN_BUBBLE(ap, *np - i); return (0); } /* * CDB___txn_count -- * Routine to count the number of members in a transaction family. We * include the incoming transaction in the count. We assume that we never * call this routine with NULL. */ static int CDB___txn_count(txnp) DB_TXN *txnp; { DB_TXN *kids; int n; n = 1; for (kids = TAILQ_FIRST(&txnp->kids); kids != NULL; kids = TAILQ_NEXT(kids, klinks)) n += CDB___txn_count(kids); return (n); } /* * CDB___txn_lsn --- * Fill in the array with the last_lsn field of every transaction * in the family. Array is an in/out parameter that leaves you pointing * to the next space in which to place an LSN. */ static void CDB___txn_lsn(txnp, array) DB_TXN *txnp; DB_LSN **array; { DB_LSN *lsn; DB_TXN *kids; lsn = *array; lsn[0] = txnp->last_lsn; *array = &lsn[1]; for (kids = TAILQ_FIRST(&txnp->kids); kids != NULL; kids = TAILQ_NEXT(kids, klinks)) CDB___txn_lsn(kids, array); } /* * CDB___txn_activekids -- * Determine if this transaction has any active children. Returns 1 * if any active children are present; 0 otherwise. * * PUBLIC: int CDB___txn_activekids __P((DB_TXN *)); */ int CDB___txn_activekids(txnp) DB_TXN *txnp; { DB_TXN *kids; for (kids = TAILQ_FIRST(&txnp->kids); kids != NULL; kids = TAILQ_NEXT(kids, klinks)) if (!F_ISSET(kids, TXN_CHILDCOMMIT)) return (1); return (0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn.h������������������������������������������������������������������������������0100644�0063146�0012731�00000011245�07427026535�013747� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)txn.h 11.4 (Sleepycat) 10/12/99 */ #ifndef _TXN_H_ #define _TXN_H_ #include "xa.h" struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR; struct __db_txnregion; typedef struct __db_txnregion DB_TXNREGION; /* * !!! * TXN_MINIMUM = (DB_LOCK_MAXID + 1) but this makes compilers complain. */ #define TXN_MINIMUM 0x80000000 #define TXN_INVALID 0xffffffff /* Maximum number of txn ids. */ #define TXN_INVALID_ID 0 /* Invalid transaction ID. */ #define DEF_MAX_TXNS 20 /* Default max transactions. */ /* The structure allocated for every transaction. */ struct __db_txn { DB_TXNMGR *mgrp; /* Pointer to transaction manager. */ DB_TXN *parent; /* Pointer to transaction's parent. */ DB_LSN last_lsn; /* Lsn of last log write. */ u_int32_t txnid; /* Unique transaction id. */ roff_t off; /* Detail structure within region. */ TAILQ_ENTRY(__db_txn) links; /* Links transactions off manager. */ TAILQ_HEAD(__kids, __db_txn) kids; /* Child transactions. */ TAILQ_ENTRY(__db_txn) klinks; /* Links child transactions. */ #define TXN_CHILDCOMMIT 0x01 /* Transaction that has committed. */ #define TXN_MALLOC 0x02 /* Structure allocated by TXN system. */ #define TXN_MUSTFLUSH 0x04 /* A child has committed. */ #define TXN_NOSYNC 0x08 /* Do not sync on prepare and commit. */ #define TXN_NOWAIT 0x10 /* Do not wait on locks. */ #define TXN_SYNC 0x20 /* Sync on prepare and commit. */ u_int32_t flags; }; /* * Internal data maintained in shared memory for each transaction. */ typedef char DB_XID[XIDDATASIZE]; typedef struct __txn_detail { u_int32_t txnid; /* current transaction id used to link free list also */ DB_LSN last_lsn; /* last lsn written for this txn */ DB_LSN begin_lsn; /* lsn of begin record */ roff_t parent; /* Offset of transaction's parent. */ #define TXN_UNALLOC 0 #define TXN_RUNNING 1 #define TXN_ABORTED 2 #define TXN_PREPARED 3 #define TXN_COMMITTED 4 u_int32_t status; /* status of the transaction */ SH_TAILQ_ENTRY links; /* free/active list */ #define TXN_XA_ABORTED 1 #define TXN_XA_DEADLOCKED 2 #define TXN_XA_ENDED 3 #define TXN_XA_PREPARED 4 #define TXN_XA_STARTED 5 #define TXN_XA_SUSPENDED 6 u_int32_t xa_status; /* XA status */ /* * XID (xid_t) structure: because these fields are logged, the * sizes have to be explicit. */ DB_XID xid; /* XA global transaction id */ u_int32_t bqual; /* bqual_length from XID */ u_int32_t gtrid; /* gtrid_length from XID */ int32_t format; /* XA format */ } TXN_DETAIL; /* * DB_TXNMGR -- * The transaction manager encapsulates the transaction system. */ struct __db_txnmgr { /* * These fields need to be protected for multi-threaded support. * * !!! * As this structure is allocated in per-process memory, the mutex may need * to be stored elsewhere on architectures unable to support mutexes in heap * memory, e.g., HP/UX 9. */ MUTEX *mutexp; /* Lock list of active transactions * (including the content of each * TXN_DETAIL structure on the list). */ /* List of active transactions. */ TAILQ_HEAD(_chain, __db_txn) txn_chain; /* These fields are never updated after creation, and so not protected. */ DB_ENV *dbenv; /* Environment. */ REGINFO reginfo; /* Region information. */ int (*recover) /* Recovery dispatch routine */ __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); }; /* * DB_TXNREGION -- * The primary transaction data structure in the shared memory region. */ struct __db_txnregion { u_int32_t maxtxns; /* maximum number of active TXNs */ u_int32_t last_txnid; /* last transaction id given out */ DB_LSN pending_ckp; /* last checkpoint did not finish */ DB_LSN last_ckp; /* lsn of the last checkpoint */ time_t time_ckp; /* time of last checkpoint */ u_int32_t logtype; /* type of logging */ u_int32_t locktype; /* lock type */ u_int32_t naborts; /* number of aborted TXNs */ u_int32_t ncommits; /* number of committed TXNs */ u_int32_t nbegins; /* number of begun TXNs */ u_int32_t nactive; /* number of active TXNs */ u_int32_t maxnactive; /* maximum number of active TXNs */ /* active TXN list */ SH_TAILQ_HEAD(__active) active_txn; }; /* * Make the region large enough to hold N transaction detail structures * plus some space to hold thread handles and the beginning of the shalloc * region. */ #define TXN_REGION_SIZE(N) \ (sizeof(DB_TXNREGION) + N * sizeof(TXN_DETAIL) + 1000) /* * Log record types. */ #define TXN_COMMIT 1 #define TXN_PREPARE 2 #define TXN_CHECKPOINT 3 #include "txn_auto.h" #include "txn_ext.h" #include "xa_ext.h" #endif /* !_TXN_H_ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn.src����������������������������������������������������������������������������0100644�0063146�0012731�00000002721�07427026535�014306� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)txn.src 11.3 (Sleepycat) 8/29/99 */ PREFIX txn INCLUDE #include "db_config.h" INCLUDE INCLUDE #ifndef NO_SYSTEM_INCLUDES INCLUDE #include <sys/types.h> INCLUDE INCLUDE #include <ctype.h> INCLUDE #include <string.h> INCLUDE #endif INCLUDE INCLUDE #include "db_int.h" INCLUDE #include "db_page.h" INCLUDE #include "db_dispatch.h" INCLUDE #include "db_am.h" INCLUDE #include "txn.h" INCLUDE /* * This is the standard log operation for commit. */ BEGIN regop ARG opcode u_int32_t lu END /* * This is the checkpoint record. It contains the lsn that the checkpoint * guarantees and a pointer to the last checkpoint so we can walk backwards * by checkpoint. * * ckp_lsn: * The lsn in the log of the most recent point at which all begun * transactions have been aborted. This is the point for which * the checkpoint is relevant. * last_ckp: * The previous checkpoint. */ BEGIN ckp POINTER ckp_lsn DB_LSN * lu POINTER last_ckp DB_LSN * lu END /* * This is the standard log operation for prepare (since right now * we only use prepare in an XA environment). */ BEGIN xa_regop ARG opcode u_int32_t lu DBT xid DBT s ARG formatID int32_t ld ARG gtrid u_int32_t u ARG bqual u_int32_t u END /* * This is the log operation for a child commit. */ BEGIN child ARG opcode u_int32_t lu ARG parent u_int32_t lx END �����������������������������������������������htdig-3.2.0b6/db/txn_auto.c�������������������������������������������������������������������������0100644�0063146�0012731�00000032776�07427026535�015006� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #include <errno.h> #include "db_config.h" #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <ctype.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "db_dispatch.h" #include "db_am.h" #include "txn.h" int CDB___txn_regop_log(dbenv, txnid, ret_lsnp, flags, opcode) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_txn_regop; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___txn_regop_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __txn_regop_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___txn_regop_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]txn_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___txn_regop_read(recbuf, argpp) void *recbuf; __txn_regop_args **argpp; { __txn_regop_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__txn_regop_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); *argpp = argp; return (0); } int CDB___txn_ckp_log(dbenv, txnid, ret_lsnp, flags, ckp_lsn, last_ckp) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; DB_LSN * ckp_lsn; DB_LSN * last_ckp; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_txn_ckp; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(*ckp_lsn) + sizeof(*last_ckp); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); if (ckp_lsn != NULL) memcpy(bp, ckp_lsn, sizeof(*ckp_lsn)); else memset(bp, 0, sizeof(*ckp_lsn)); bp += sizeof(*ckp_lsn); if (last_ckp != NULL) memcpy(bp, last_ckp, sizeof(*last_ckp)); else memset(bp, 0, sizeof(*last_ckp)); bp += sizeof(*last_ckp); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___txn_ckp_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __txn_ckp_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___txn_ckp_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]txn_ckp: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\tckp_lsn: [%lu][%lu]\n", (u_long)argp->ckp_lsn.file, (u_long)argp->ckp_lsn.offset); printf("\tlast_ckp: [%lu][%lu]\n", (u_long)argp->last_ckp.file, (u_long)argp->last_ckp.offset); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___txn_ckp_read(recbuf, argpp) void *recbuf; __txn_ckp_args **argpp; { __txn_ckp_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__txn_ckp_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->ckp_lsn, bp, sizeof(argp->ckp_lsn)); bp += sizeof(argp->ckp_lsn); memcpy(&argp->last_ckp, bp, sizeof(argp->last_ckp)); bp += sizeof(argp->last_ckp); *argpp = argp; return (0); } int CDB___txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags, opcode, xid, formatID, gtrid, bqual) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; const DBT *xid; int32_t formatID; u_int32_t gtrid; u_int32_t bqual; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t zero; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_txn_xa_regop; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(u_int32_t) + (xid == NULL ? 0 : xid->size) + sizeof(formatID) + sizeof(gtrid) + sizeof(bqual); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); if (xid == NULL) { zero = 0; memcpy(bp, &zero, sizeof(u_int32_t)); bp += sizeof(u_int32_t); } else { memcpy(bp, &xid->size, sizeof(xid->size)); bp += sizeof(xid->size); memcpy(bp, xid->data, xid->size); bp += xid->size; } memcpy(bp, &formatID, sizeof(formatID)); bp += sizeof(formatID); memcpy(bp, >rid, sizeof(gtrid)); bp += sizeof(gtrid); memcpy(bp, &bqual, sizeof(bqual)); bp += sizeof(bqual); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___txn_xa_regop_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __txn_xa_regop_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___txn_xa_regop_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]txn_xa_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\txid: "); for (i = 0; i < argp->xid.size; i++) { ch = ((u_int8_t *)argp->xid.data)[i]; if (isprint(ch) || ch == 0xa) putchar(ch); else printf("%#x ", ch); } printf("\n"); printf("\tformatID: %ld\n", (long)argp->formatID); printf("\tgtrid: %u\n", argp->gtrid); printf("\tbqual: %u\n", argp->bqual); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___txn_xa_regop_read(recbuf, argpp) void *recbuf; __txn_xa_regop_args **argpp; { __txn_xa_regop_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__txn_xa_regop_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memset(&argp->xid, 0, sizeof(argp->xid)); memcpy(&argp->xid.size, bp, sizeof(u_int32_t)); bp += sizeof(u_int32_t); argp->xid.data = bp; bp += argp->xid.size; memcpy(&argp->formatID, bp, sizeof(argp->formatID)); bp += sizeof(argp->formatID); memcpy(&argp->gtrid, bp, sizeof(argp->gtrid)); bp += sizeof(argp->gtrid); memcpy(&argp->bqual, bp, sizeof(argp->bqual)); bp += sizeof(argp->bqual); *argpp = argp; return (0); } int CDB___txn_child_log(dbenv, txnid, ret_lsnp, flags, opcode, parent) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; u_int32_t opcode; u_int32_t parent; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_num; int ret; u_int8_t *bp; if (txnid != NULL && TAILQ_FIRST(&txnid->kids) != NULL && CDB___txn_activekids(txnid) != 0) return (EPERM); rectype = DB_txn_child; txn_num = txnid == NULL ? 0 : txnid->txnid; if (txnid == NULL) { ZERO_LSN(null_lsn); lsnp = &null_lsn; } else lsnp = &txnid->last_lsn; logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN) + sizeof(opcode) + sizeof(parent); if ((ret = CDB___os_malloc(logrec.size, NULL, &logrec.data)) != 0) return (ret); bp = logrec.data; memcpy(bp, &rectype, sizeof(rectype)); bp += sizeof(rectype); memcpy(bp, &txn_num, sizeof(txn_num)); bp += sizeof(txn_num); memcpy(bp, lsnp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(bp, &opcode, sizeof(opcode)); bp += sizeof(opcode); memcpy(bp, &parent, sizeof(parent)); bp += sizeof(parent); DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size); ret = CDB_log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags); if (txnid != NULL) txnid->last_lsn = *ret_lsnp; CDB___os_free(logrec.data, logrec.size); return (ret); } int CDB___txn_child_print(notused1, dbtp, lsnp, notused2, notused3) DB_ENV *notused1; DBT *dbtp; DB_LSN *lsnp; int notused2; void *notused3; { __txn_child_args *argp; u_int32_t i; u_int ch; int ret; i = 0; ch = 0; notused1 = NULL; notused2 = 0; notused3 = NULL; if ((ret = CDB___txn_child_read(dbtp->data, &argp)) != 0) return (ret); printf("[%lu][%lu]txn_child: rec: %lu txnid %lx prevlsn [%lu][%lu]\n", (u_long)lsnp->file, (u_long)lsnp->offset, (u_long)argp->type, (u_long)argp->txnid->txnid, (u_long)argp->prev_lsn.file, (u_long)argp->prev_lsn.offset); printf("\topcode: %lu\n", (u_long)argp->opcode); printf("\tparent: 0x%lx\n", (u_long)argp->parent); printf("\n"); CDB___os_free(argp, 0); return (0); } int CDB___txn_child_read(recbuf, argpp) void *recbuf; __txn_child_args **argpp; { __txn_child_args *argp; u_int8_t *bp; int ret; ret = CDB___os_malloc(sizeof(__txn_child_args) + sizeof(DB_TXN), NULL, &argp); if (ret != 0) return (ret); argp->txnid = (DB_TXN *)&argp[1]; bp = recbuf; memcpy(&argp->type, bp, sizeof(argp->type)); bp += sizeof(argp->type); memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid)); bp += sizeof(argp->txnid->txnid); memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN)); bp += sizeof(DB_LSN); memcpy(&argp->opcode, bp, sizeof(argp->opcode)); bp += sizeof(argp->opcode); memcpy(&argp->parent, bp, sizeof(argp->parent)); bp += sizeof(argp->parent); *argpp = argp; return (0); } int CDB___txn_init_print(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_regop_print, DB_txn_regop)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_ckp_print, DB_txn_ckp)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_xa_regop_print, DB_txn_xa_regop)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_child_print, DB_txn_child)) != 0) return (ret); return (0); } /* * PUBLIC: int CDB___txn_init_recover __P((DB_ENV *)); */ int CDB___txn_init_recover(dbenv) DB_ENV *dbenv; { int ret; if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_regop_recover, DB_txn_regop)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_ckp_recover, DB_txn_ckp)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_xa_regop_recover, DB_txn_xa_regop)) != 0) return (ret); if ((ret = CDB___db_add_recovery(dbenv, CDB___txn_child_recover, DB_txn_child)) != 0) return (ret); return (0); } ��htdig-3.2.0b6/db/txn_auto.h�������������������������������������������������������������������������0100644�0063146�0012731�00000003470�07427026535�015000� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Do not edit: automatically built by gen_rec.awk. */ #ifndef txn_AUTO_H #define txn_AUTO_H #define DB_txn_regop (DB_txn_BEGIN + 1) typedef struct _txn_regop_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; } __txn_regop_args; int CDB___txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t)); int CDB___txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_regop_read __P((void *, __txn_regop_args **)); #define DB_txn_ckp (DB_txn_BEGIN + 2) typedef struct _txn_ckp_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; DB_LSN ckp_lsn; DB_LSN last_ckp; } __txn_ckp_args; int CDB___txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *)); int CDB___txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_ckp_read __P((void *, __txn_ckp_args **)); #define DB_txn_xa_regop (DB_txn_BEGIN + 3) typedef struct _txn_xa_regop_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; DBT xid; int32_t formatID; u_int32_t gtrid; u_int32_t bqual; } __txn_xa_regop_args; int CDB___txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t)); int CDB___txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_xa_regop_read __P((void *, __txn_xa_regop_args **)); #define DB_txn_child (DB_txn_BEGIN + 4) typedef struct _txn_child_args { u_int32_t type; DB_TXN *txnid; DB_LSN prev_lsn; u_int32_t opcode; u_int32_t parent; } __txn_child_args; int CDB___txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, u_int32_t)); int CDB___txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_child_read __P((void *, __txn_child_args **)); int CDB___txn_init_print __P((DB_ENV *)); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/xa.c�������������������������������������������������������������������������������0100644�0063146�0012731�00000040240�07427026535�013536� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)xa.c 11.4 (Sleepycat) 9/10/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <stdlib.h> #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "log.h" #include "txn.h" #include "db_am.h" #include "db_dispatch.h" static int CDB___db_xa_close __P((char *, int, long)); static int CDB___db_xa_commit __P((XID *, int, long)); static int CDB___db_xa_complete __P((int *, int *, int, long)); static int CDB___db_xa_end __P((XID *, int, long)); static int CDB___db_xa_forget __P((XID *, int, long)); static int CDB___db_xa_open __P((char *, int, long)); static int CDB___db_xa_prepare __P((XID *, int, long)); static int CDB___db_xa_recover __P((XID *, long, int, long)); static int CDB___db_xa_rollback __P((XID *, int, long)); static int CDB___db_xa_start __P((XID *, int, long)); static void CDB___xa_txn_end __P((DB_ENV *)); static void CDB___xa_txn_init __P((DB_ENV *, TXN_DETAIL *, size_t)); /* * Possible flag values: * Dynamic registration 0 => no dynamic registration * TMREGISTER => dynamic registration * Asynchronous operation 0 => no support for asynchrony * TMUSEASYNC => async support * Migration support 0 => migration of transactions across * threads is possible * TMNOMIGRATE => no migration across threads */ const struct xa_switch_t CDB_db_xa_switch = { "Berkeley DB", /* name[RMNAMESZ] */ TMNOMIGRATE, /* flags */ 0, /* version */ CDB___db_xa_open, /* xa_open_entry */ CDB___db_xa_close, /* xa_close_entry */ CDB___db_xa_start, /* xa_start_entry */ CDB___db_xa_end, /* xa_end_entry */ CDB___db_xa_rollback, /* xa_rollback_entry */ CDB___db_xa_prepare, /* xa_prepare_entry */ CDB___db_xa_commit, /* xa_commit_entry */ CDB___db_xa_recover, /* xa_recover_entry */ CDB___db_xa_forget, /* xa_forget_entry */ CDB___db_xa_complete /* xa_complete_entry */ }; /* * CDB___db_xa_open -- * The open call in the XA protocol. The rmid field is an id number * that the TM assigned us and will pass us on every xa call. We need to * map that rmid number into a dbenv structure that we create during * initialization. Since this id number is thread specific, we do not * need to store it in shared memory. The file xa_map.c implements all * such xa->db mappings. * The xa_info field is instance specific information. We require * that the value of DB_HOME be passed in xa_info. Since xa_info is the * only thing that we get to pass to CDB_db_env_create, any config information * will have to be done via a config file instead of via the CDB_db_env_create * call. */ static int CDB___db_xa_open(xa_info, rmid, flags) char *xa_info; int rmid; long flags; { DB_ENV *env; if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (flags != TMNOFLAGS) return (XAER_INVAL); /* Verify if we already have this environment open. */ if (CDB___db_rmid_to_env(rmid, &env) == 0) return (XA_OK); if (CDB___os_calloc(1, sizeof(DB_ENV), &env) != 0) return (XAER_RMERR); /* Open a new environment. */ #define XA_FLAGS \ DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN if (CDB_db_env_create(&env, 0) != 0) return (XAER_RMERR); if (env->open(env, xa_info, NULL, XA_FLAGS, 0) != 0) goto err; /* Create the mapping. */ if (CDB___db_map_rmid(rmid, env) != 0) goto err; /* Allocate space for the current transaction. */ if (CDB___os_calloc(1, sizeof(DB_TXN), &env->xa_txn) != 0) goto err; env->xa_txn->txnid = TXN_INVALID; return (XA_OK); err: (void)env->close(env, 0); return (XAER_RMERR); } /* * CDB___db_xa_close -- * The close call of the XA protocol. The only trickiness here * is that if there are any active transactions, we must fail. It is * *not* an error to call close on an environment that has already been * closed (I am interpreting that to mean it's OK to call close on an * environment that has never been opened). */ static int CDB___db_xa_close(xa_info, rmid, flags) char *xa_info; int rmid; long flags; { DB_ENV *env; int ret, t_ret; COMPQUIET(xa_info, NULL); if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (flags != TMNOFLAGS) return (XAER_INVAL); /* If the environment is closed, then we're done. */ if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XA_OK); /* Check if there are any pending transactions. */ if (env->xa_txn != NULL && env->xa_txn->txnid != TXN_INVALID) return (XAER_PROTO); /* Destroy the mapping. */ ret = CDB___db_unmap_rmid(rmid); /* Discard space held for the current transaction. */ if (env->xa_txn != NULL) CDB___os_free(env->xa_txn, sizeof(DB_TXN)); /* Close the environment. */ if ((t_ret = env->close(env, 0)) != 0 && ret == 0) ret = t_ret; return (ret == 0 ? XA_OK : XAER_RMERR); } /* * CDB___db_xa_start -- * Begin a transaction for the current resource manager. */ static int CDB___db_xa_start(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; TXN_DETAIL *td; size_t off; int is_known; #define OK_FLAGS (TMJOIN | TMRESUME | TMNOWAIT | TMASYNC | TMNOFLAGS) if (LF_ISSET(~OK_FLAGS)) return (XAER_INVAL); if (LF_ISSET(TMJOIN) && LF_ISSET(TMRESUME)) return (XAER_INVAL); if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); is_known = CDB___db_xid_to_txn(env, xid, &off) == 0; if (is_known && !LF_ISSET(TMRESUME) && !LF_ISSET(TMJOIN)) return (XAER_DUPID); if (!is_known && LF_ISSET(TMRESUME | TMJOIN)) return (XAER_NOTA); /* * This can't block, so we can ignore TMNOWAIT. * * Other error conditions: RMERR, RMFAIL, OUTSIDE, PROTO, RB* */ if (is_known) { td = (TXN_DETAIL *) R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); if (td->xa_status == TXN_XA_SUSPENDED && !LF_ISSET(TMRESUME | TMJOIN)) return (XAER_PROTO); if (td->xa_status == TXN_XA_DEADLOCKED) return (XA_RBDEADLOCK); if (td->xa_status == TXN_XA_ABORTED) return (XA_RBOTHER); /* Now, fill in the global transaction structure. */ CDB___xa_txn_init(env, td, off); td->xa_status = TXN_XA_STARTED; } else { if (CDB___txn_xa_begin(env, env->xa_txn) != 0) return (XAER_RMERR); (void)CDB___db_map_xid(env, xid, env->xa_txn->off); td = (TXN_DETAIL *) R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, env->xa_txn->off); td->xa_status = TXN_XA_STARTED; } return (XA_OK); } /* * CDB___db_xa_end -- * Disassociate the current transaction from the current process. */ static int CDB___db_xa_end(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; DB_TXN *txn; TXN_DETAIL *td; size_t off; if (flags != TMNOFLAGS && !LF_ISSET(TMSUSPEND | TMSUCCESS | TMFAIL)) return (XAER_INVAL); if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); if (CDB___db_xid_to_txn(env, xid, &off) != 0) return (XAER_NOTA); txn = env->xa_txn; if (off != txn->off) return (XAER_PROTO); td = (TXN_DETAIL *)R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); if (td->xa_status == TXN_XA_DEADLOCKED) return (XA_RBDEADLOCK); if (td->status == TXN_ABORTED) return (XA_RBOTHER); if (td->xa_status != TXN_XA_STARTED) return (XAER_PROTO); /* Update the shared memory last_lsn field */ td->last_lsn = txn->last_lsn; /* * If we ever support XA migration, we cannot keep SUSPEND/END * status in the shared region; it would have to be process local. */ if (LF_ISSET(TMSUSPEND)) td->xa_status = TXN_XA_SUSPENDED; else td->xa_status = TXN_XA_ENDED; txn->txnid = TXN_INVALID; return (XA_OK); } /* * CDB___db_xa_prepare -- * Sync the log to disk so we can guarantee recoverability. */ static int CDB___db_xa_prepare(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; TXN_DETAIL *td; size_t off; if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (flags != TMNOFLAGS) return (XAER_INVAL); /* * We need to know if we've ever called prepare on this. * As part of the prepare, we set the xa_status field to * reflect that fact that prepare has been called, and if * it's ever called again, it's an error. */ if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); if (CDB___db_xid_to_txn(env, xid, &off) != 0) return (XAER_NOTA); td = (TXN_DETAIL *)R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); if (td->xa_status == TXN_XA_DEADLOCKED) return (XA_RBDEADLOCK); if (td->xa_status != TXN_XA_ENDED && td->xa_status != TXN_XA_SUSPENDED) return (XAER_PROTO); /* Now, fill in the global transaction structure. */ CDB___xa_txn_init(env, td, off); if (CDB_txn_prepare(env->xa_txn) != 0) return (XAER_RMERR); td->xa_status = TXN_XA_PREPARED; /* No fatal value that would require an XAER_RMFAIL. */ CDB___xa_txn_end(env); return (XA_OK); } /* * CDB___db_xa_commit -- * Commit the transaction */ static int CDB___db_xa_commit(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; TXN_DETAIL *td; size_t off; if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); #undef OK_FLAGS #define OK_FLAGS (TMNOFLAGS | TMNOWAIT | TMONEPHASE) if (LF_ISSET(~OK_FLAGS)) return (XAER_INVAL); /* * We need to know if we've ever called prepare on this. * We can verify this by examining the xa_status field. */ if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); if (CDB___db_xid_to_txn(env, xid, &off) != 0) return (XAER_NOTA); td = (TXN_DETAIL *)R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); if (td->xa_status == TXN_XA_DEADLOCKED) return (XA_RBDEADLOCK); if (td->xa_status == TXN_XA_ABORTED) return (XA_RBOTHER); if (LF_ISSET(TMONEPHASE) && td->xa_status != TXN_XA_ENDED && td->xa_status != TXN_XA_SUSPENDED) return (XAER_PROTO); if (!LF_ISSET(TMONEPHASE) && td->xa_status != TXN_XA_PREPARED) return (XAER_PROTO); /* Now, fill in the global transaction structure. */ CDB___xa_txn_init(env, td, off); if (CDB_txn_commit(env->xa_txn, 0) != 0) return (XAER_RMERR); /* No fatal value that would require an XAER_RMFAIL. */ CDB___xa_txn_end(env); return (XA_OK); } /* * CDB___db_xa_recover -- * Returns a list of prepared and heuristically completed transactions. * * The return value is the number of xids placed into the xid array (less * than or equal to the count parameter). The flags are going to indicate * whether we are starting a scan or continuing one. */ static int CDB___db_xa_recover(xids, count, rmid, flags) XID *xids; long count, flags; int rmid; { __txn_xa_regop_args *argp; DBT data; DB_ENV *env; DB_LOG *log; XID *xidp; int err, ret; u_int32_t rectype, txnid; ret = 0; xidp = xids; /* If the environment is closed, then we're done. */ if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); /* * If we are starting a scan, then we need to figure out where * to begin. If we are not starting a scan, we'll start from * wherever the log cursor is. Since XA apps cannot be threaded, * we don't have to worry about someone else having moved it. */ log = env->lg_handle; if (LF_ISSET(TMSTARTRSCAN)) { if ((err = CDB___log_findckp(env, &log->xa_first)) == DB_NOTFOUND) { /* * If there were no log files, then we have no * transactions to return, so we simply return 0. */ return (0); } if ((err = CDB___db_txnlist_init(&log->xa_info)) != 0) return (XAER_RMERR); } else { /* * If we are not starting a scan, the log cursor had * better be set. */ if (IS_ZERO_LSN(log->xa_lsn)) return (XAER_PROTO); } /* * At this point log->xa_first contains the point in the log * to which we need to roll back. If we are starting a scan, * we'll start at the last record; if we're continuing a scan, * we'll have to start at log->xa_lsn. */ memset(&data, 0, sizeof(data)); for (err = CDB_log_get(env, &log->xa_lsn, &data, LF_ISSET(TMSTARTRSCAN) ? DB_LAST : DB_SET); err == 0 && CDB_log_compare(&log->xa_lsn, &log->xa_first) > 0; err = CDB_log_get(env, &log->xa_lsn, &data, DB_PREV)) { memcpy(&rectype, data.data, sizeof(rectype)); /* * The only record type we care about is an DB_txn_xa_regop. * If it's a commit, we have to add it to a txnlist. If it's * a prepare, and we don't have a commit, then we return it. * We are redoing some of what's in the xa_regop_recovery * code, but we have to do it here so we can get at the xid * in the record. */ if (rectype != DB_txn_xa_regop && rectype != DB_txn_regop) continue; memcpy(&txnid, (u_int8_t *)data.data + sizeof(rectype), sizeof(txnid)); err = CDB___db_txnlist_find(log->xa_info, txnid); switch (rectype) { case DB_txn_regop: if (err == DB_NOTFOUND) CDB___db_txnlist_add(log->xa_info, txnid); err = 0; break; case DB_txn_xa_regop: /* * This transaction is committed, so we needn't read * the record and do anything. */ if (err == 0) break; if ((err = CDB___txn_xa_regop_read(data.data, &argp)) != 0) { ret = XAER_RMERR; goto out; } xidp->formatID = argp->formatID; xidp->gtrid_length = argp->gtrid; xidp->bqual_length = argp->bqual; memcpy(xidp->data, argp->xid.data, argp->xid.size); ret++; xidp++; CDB___os_free(argp, sizeof(*argp)); if (ret == count) goto done; break; } } if (err != 0 && err != DB_NOTFOUND) goto out; done: if (LF_ISSET(TMENDRSCAN)) { ZERO_LSN(log->xa_lsn); ZERO_LSN(log->xa_first); out: CDB___db_txnlist_end(env, log->xa_info); log->xa_info = NULL; } return (ret); } /* * CDB___db_xa_rollback * Abort an XA transaction. */ static int CDB___db_xa_rollback(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; TXN_DETAIL *td; size_t off; if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (flags != TMNOFLAGS) return (XAER_INVAL); if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); if (CDB___db_xid_to_txn(env, xid, &off) != 0) return (XAER_NOTA); td = (TXN_DETAIL *)R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); if (td->xa_status == TXN_XA_DEADLOCKED) return (XA_RBDEADLOCK); if (td->xa_status == TXN_XA_ABORTED) return (XA_RBOTHER); if (td->xa_status != TXN_XA_ENDED && td->xa_status != TXN_XA_SUSPENDED && td->xa_status != TXN_XA_PREPARED) return (XAER_PROTO); /* Now, fill in the global transaction structure. */ CDB___xa_txn_init(env, td, off); if (CDB_txn_abort(env->xa_txn) != 0) return (XAER_RMERR); /* No fatal value that would require an XAER_RMFAIL. */ CDB___xa_txn_end(env); return (XA_OK); } /* * CDB___db_xa_forget -- * Forget about an XID for a transaction that was heuristically * completed. Since we do not heuristically complete anything, I * don't think we have to do anything here, but we should make sure * that we reclaim the slots in the txnid table. */ static int CDB___db_xa_forget(xid, rmid, flags) XID *xid; int rmid; long flags; { DB_ENV *env; size_t off; if (LF_ISSET(TMASYNC)) return (XAER_ASYNC); if (flags != TMNOFLAGS) return (XAER_INVAL); if (CDB___db_rmid_to_env(rmid, &env) != 0) return (XAER_PROTO); /* * If mapping is gone, then we're done. */ if (CDB___db_xid_to_txn(env, xid, &off) != 0) return (XA_OK); CDB___db_unmap_xid(env, xid, off); /* No fatal value that would require an XAER_RMFAIL. */ return (XA_OK); } /* * CDB___db_xa_complete -- * Used to wait for asynchronous operations to complete. Since we're * not doing asynch, this is an invalid operation. */ static int CDB___db_xa_complete(handle, retval, rmid, flags) int *handle, *retval, rmid; long flags; { COMPQUIET(handle, NULL); COMPQUIET(retval, NULL); COMPQUIET(rmid, 0); COMPQUIET(flags, 0); return (XAER_INVAL); } /* * CDB___xa_txn_init -- * Fill in the fields of the local transaction structure given * the detail transaction structure. */ static void CDB___xa_txn_init(env, td, off) DB_ENV *env; TXN_DETAIL *td; size_t off; { DB_TXN *txn; txn = env->xa_txn; txn->mgrp = env->tx_handle; txn->parent = NULL; txn->last_lsn = td->last_lsn; txn->txnid = td->txnid; txn->off = off; txn->flags = 0; } /* * CDB___xa_txn_end -- * Invalidate a transaction structure that was generated by xa_txn_init. */ static void CDB___xa_txn_end(env) DB_ENV *env; { DB_TXN *txn; txn = env->xa_txn; if (txn != NULL) txn->txnid = TXN_INVALID; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn_ext.h��������������������������������������������������������������������������0100644�0063146�0012731�00000001420�07427026535�014621� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _txn_ext_h_ #define _txn_ext_h_ int CDB___txn_xa_begin __P((DB_ENV *, DB_TXN *)); int CDB___txn_end __P((DB_TXN *, int)); int CDB___txn_is_ancestor __P((DB_ENV *, size_t, size_t)); int CDB___txn_activekids __P((DB_TXN *)); int CDB___txn_init_recover __P((DB_ENV *)); int CDB___txn_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_xa_regop_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_ckp_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); int CDB___txn_child_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); void CDB___txn_dbenv_create __P((DB_ENV *)); int CDB___txn_open __P((DB_ENV *)); int CDB___txn_close __P((DB_ENV *)); #endif /* _txn_ext_h_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn_rec.c��������������������������������������������������������������������������0100644�0063146�0012731�00000012770�07427026535�014577� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1996 * The President and Fellows of Harvard University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)txn_rec.c 11.2 (Sleepycat) 9/9/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #endif #include "db_int.h" #include "db_page.h" #include "txn.h" #include "db_am.h" /* * PUBLIC: int CDB___txn_regop_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); * * These records are only ever written for commits. */ int CDB___txn_regop_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __txn_regop_args *argp; int ret; #ifdef DEBUG_RECOVER (void)CDB___txn_regop_print(dbenv, dbtp, lsnp, redo, info); #endif COMPQUIET(redo, 0); COMPQUIET(dbenv, NULL); if ((ret = CDB___txn_regop_read(dbtp->data, &argp)) != 0) return (ret); if (argp->opcode != TXN_COMMIT) ret = EINVAL; else if (CDB___db_txnlist_find(info, argp->txnid->txnid) == DB_NOTFOUND) ret = CDB___db_txnlist_add(info, argp->txnid->txnid); if (ret == 0) *lsnp = argp->prev_lsn; CDB___os_free(argp, 0); return (ret); } /* * PUBLIC: int CDB___txn_xa_regop_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); * * These records are only ever written for prepares. */ int CDB___txn_xa_regop_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __txn_xa_regop_args *argp; int ret; #ifdef DEBUG_RECOVER (void)CDB___txn_xa_regop_print(dbenv, dbtp, lsnp, redo, info); #endif COMPQUIET(redo, 0); COMPQUIET(dbenv, NULL); if ((ret = CDB___txn_xa_regop_read(dbtp->data, &argp)) != 0) return (ret); if (argp->opcode != TXN_PREPARE) ret = EINVAL; else /* Call CDB___db_txnlist_find so that we update the maxid. */ (void)CDB___db_txnlist_find(info, argp->txnid->txnid); if (ret == 0) *lsnp = argp->prev_lsn; CDB___os_free(argp, 0); return (ret); } /* * PUBLIC: int CDB___txn_ckp_recover __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___txn_ckp_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __txn_ckp_args *argp; int ret; #ifdef DEBUG_RECOVER CDB___txn_ckp_print(dbenv, dbtp, lsnp, redo, info); #endif COMPQUIET(dbenv, NULL); if ((ret = CDB___txn_ckp_read(dbtp->data, &argp)) != 0) return (ret); /* * Check for 'restart' checkpoint record. This occurs when the * checkpoint lsn is equal to the lsn of the checkpoint record * and means that we could set the transaction ID back to 1, so * that we don't exhaust the transaction ID name space. */ if (argp->ckp_lsn.file == lsnp->file && argp->ckp_lsn.offset == lsnp->offset) CDB___db_txnlist_gen(info, redo ? -1 : 1); *lsnp = argp->last_ckp; CDB___os_free(argp, 0); return (DB_TXN_CKP); } /* * CDB___txn_child_recover * Recover a commit record for a child transaction. * * PUBLIC: int CDB___txn_child_recover * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); */ int CDB___txn_child_recover(dbenv, dbtp, lsnp, redo, info) DB_ENV *dbenv; DBT *dbtp; DB_LSN *lsnp; int redo; void *info; { __txn_child_args *argp; int ret; #ifdef DEBUG_RECOVER (void)CDB___txn_child_print(dbenv, dbtp, lsnp, redo, info); #endif COMPQUIET(redo, 0); COMPQUIET(dbenv, NULL); if ((ret = CDB___txn_child_read(dbtp->data, &argp)) != 0) return (ret); /* * We count the child as committed only if its parent committed. * So, if we are not yet in the transaction list, but our parent * is, then we should go ahead and commit. */ if (argp->opcode != TXN_COMMIT) ret = EINVAL; else if (CDB___db_txnlist_find(info, argp->parent) == 0 && CDB___db_txnlist_find(info, argp->txnid->txnid) == DB_NOTFOUND) ret = CDB___db_txnlist_add(info, argp->txnid->txnid); if (ret == 0) *lsnp = argp->prev_lsn; CDB___os_free(argp, 0); return (ret); } ��������htdig-3.2.0b6/db/txn_region.c�����������������������������������������������������������������������0100644�0063146�0012731�00000017450�07427026535�015311� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)txn_region.c 11.4 (Sleepycat) 9/20/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <string.h> #endif #include "db_int.h" #include "db_page.h" #include "txn.h" #include "db_am.h" static int CDB___txn_init __P((DB_ENV *, DB_TXNMGR *)); static int CDB___txn_set_tx_max __P((DB_ENV *, u_int32_t)); static int CDB___txn_set_tx_recover __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, int, void *))); /* * CDB___txn_dbenv_create -- * Transaction specific initialization of the DB_ENV structure. * * PUBLIC: void CDB___txn_dbenv_create __P((DB_ENV *)); */ void CDB___txn_dbenv_create(dbenv) DB_ENV *dbenv; { dbenv->tx_max = DEF_MAX_TXNS; dbenv->set_tx_max = CDB___txn_set_tx_max; dbenv->set_tx_recover = CDB___txn_set_tx_recover; } /* * CDB___txn_set_tx_max -- * Set the size of the transaction table. */ static int CDB___txn_set_tx_max(dbenv, tx_max) DB_ENV *dbenv; u_int32_t tx_max; { ENV_ILLEGAL_AFTER_OPEN(dbenv, "set_tx_max"); dbenv->tx_max = tx_max; return (0); } /* * CDB___txn_set_tx_recover -- * Set the transaction abort recover function. */ static int CDB___txn_set_tx_recover(dbenv, tx_recover) DB_ENV *dbenv; int (*tx_recover) __P((DB_ENV *, DBT *, DB_LSN *, int, void *)); { dbenv->tx_recover = tx_recover; return (0); } /* * CDB___txn_open -- * Open a transaction region. * * PUBLIC: int CDB___txn_open __P((DB_ENV *)); */ int CDB___txn_open(dbenv) DB_ENV *dbenv; { DB_TXNMGR *tmgrp; int ret; /* Create/initialize the transaction manager structure. */ if ((ret = CDB___os_calloc(1, sizeof(DB_TXNMGR), &tmgrp)) != 0) return (ret); TAILQ_INIT(&tmgrp->txn_chain); tmgrp->dbenv = dbenv; tmgrp->recover = dbenv->tx_recover == NULL ? CDB___db_dispatch : dbenv->tx_recover; /* Join/create the txn region. */ tmgrp->reginfo.id = REG_ID_TXN; tmgrp->reginfo.mode = dbenv->db_mode; if (F_ISSET(dbenv, DB_ENV_CREATE)) F_SET(&tmgrp->reginfo, REGION_CREATE_OK); if ((ret = CDB___db_r_attach(dbenv, &tmgrp->reginfo, TXN_REGION_SIZE(dbenv->tx_max))) != 0) goto err; /* If we created the region, initialize it. */ if (F_ISSET(&tmgrp->reginfo, REGION_CREATE)) if ((ret = CDB___txn_init(dbenv, tmgrp)) != 0) goto err; /* Set the local addresses. */ tmgrp->reginfo.primary = R_ADDR(&tmgrp->reginfo, tmgrp->reginfo.rp->primary); R_UNLOCK(dbenv, &tmgrp->reginfo); /* Acquire a mutex to protect the active TXN list. */ if (F_ISSET(dbenv, DB_ENV_THREAD)) { if ((ret = CDB___db_mutex_alloc( dbenv, &tmgrp->reginfo, &tmgrp->mutexp)) != 0) goto detach; if ((ret = __db_mutex_init( dbenv, tmgrp->mutexp, 0, MUTEX_THREAD)) != 0) goto detach; } dbenv->tx_handle = tmgrp; return (0); err: if (tmgrp->reginfo.addr != NULL) { if (F_ISSET(&tmgrp->reginfo, REGION_CREATE)) F_SET(tmgrp->reginfo.rp, REG_DEAD); R_UNLOCK(dbenv, &tmgrp->reginfo); detach: (void)CDB___db_r_detach(dbenv, &tmgrp->reginfo, 0); } CDB___os_free(tmgrp, sizeof(*tmgrp)); return (ret); } /* * CDB___txn_init -- * Initialize a transaction region in shared memory. */ static int CDB___txn_init(dbenv, tmgrp) DB_ENV *dbenv; DB_TXNMGR *tmgrp; { DB_TXNREGION *region; int ret; if ((ret = CDB___db_shalloc(tmgrp->reginfo.addr, sizeof(DB_TXNREGION), 0, &tmgrp->reginfo.primary)) != 0) return (ret); tmgrp->reginfo.rp->primary = R_OFFSET(&tmgrp->reginfo, tmgrp->reginfo.primary); region = tmgrp->reginfo.primary; memset(region, 0, sizeof(*region)); region->maxtxns = dbenv->tx_max; region->last_txnid = TXN_MINIMUM; ZERO_LSN(region->pending_ckp); ZERO_LSN(region->last_ckp); region->time_ckp = time(NULL); /* * XXX * If we ever do more types of locking and logging, this changes. */ region->logtype = 0; region->locktype = 0; region->naborts = 0; region->ncommits = 0; region->nbegins = 0; region->nactive = 0; region->maxnactive = 0; SH_TAILQ_INIT(®ion->active_txn); return (0); } /* * CDB___txn_close -- * Close a transaction region. * * PUBLIC: int CDB___txn_close __P((DB_ENV *)); */ int CDB___txn_close(dbenv) DB_ENV *dbenv; { DB_TXN *txnp; DB_TXNMGR *tmgrp; int ret, t_ret; ret = 0; tmgrp = dbenv->tx_handle; /* * This function can only be called once per process (i.e., not * once per thread), so no synchronization is required. * * We would like to abort any running transactions, but the caller * is doing something wrong by calling close with active * transactions. It's quite likely that this will fail because * recovery won't find open files. If this happens, the right * solution is DB_RUNRECOVERY. So, convert any failure messages * to that. */ while ((txnp = TAILQ_FIRST(&tmgrp->txn_chain)) != TAILQ_END(&tmgrp->txn_chain)) if ((t_ret = CDB_txn_abort(txnp)) != 0) { CDB___db_err(dbenv, "Unable to abort transaction 0x%x: %s\n", txnp->txnid, CDB_db_strerror(t_ret)); CDB___txn_end(txnp, 0); if (ret == 0) ret = t_ret == 0 ? 0 : DB_RUNRECOVERY; } /* Flush the log. */ if (F_ISSET(dbenv, DB_ENV_LOGGING) && (t_ret = CDB_log_flush(dbenv, NULL)) != 0 && ret == 0) ret = t_ret; /* Discard the per-thread lock. */ if (tmgrp->mutexp != NULL) CDB___db_mutex_free(dbenv, &tmgrp->reginfo, tmgrp->mutexp); /* Detach from the region. */ if ((t_ret = CDB___db_r_detach(dbenv, &tmgrp->reginfo, 0)) != 0 && ret == 0) ret = t_ret; CDB___os_free(tmgrp, sizeof(*tmgrp)); return (ret); } int CDB_txn_stat(dbenv, statp, db_malloc) DB_ENV *dbenv; DB_TXN_STAT **statp; void *(*db_malloc) __P((size_t)); { DB_TXNMGR *mgr; DB_TXNREGION *region; DB_TXN_STAT *stats; TXN_DETAIL *txnp; size_t nbytes; u_int32_t nactive, ndx; int ret, slop; PANIC_CHECK(dbenv); ENV_REQUIRES_CONFIG(dbenv, dbenv->tx_handle, DB_INIT_TXN); *statp = NULL; slop = 200; mgr = dbenv->tx_handle; region = mgr->reginfo.primary; retry: R_LOCK(dbenv, &mgr->reginfo); nactive = region->nactive; R_UNLOCK(dbenv, &mgr->reginfo); /* * Allocate extra active structures to handle any transactions that * are created while we have the region unlocked. */ nbytes = sizeof(DB_TXN_STAT) + sizeof(DB_TXN_ACTIVE) * (nactive + slop); if ((ret = CDB___os_malloc(nbytes, db_malloc, &stats)) != 0) return (ret); R_LOCK(dbenv, &mgr->reginfo); stats->st_last_txnid = region->last_txnid; stats->st_last_ckp = region->last_ckp; stats->st_maxtxns = region->maxtxns; stats->st_naborts = region->naborts; stats->st_nbegins = region->nbegins; stats->st_ncommits = region->ncommits; stats->st_pending_ckp = region->pending_ckp; stats->st_time_ckp = region->time_ckp; stats->st_nactive = region->nactive; if (stats->st_nactive > nactive + 200) { R_UNLOCK(dbenv, &mgr->reginfo); slop *= 2; goto retry; } stats->st_maxnactive = region->maxnactive; stats->st_txnarray = (DB_TXN_ACTIVE *)&stats[1]; ndx = 0; for (txnp = SH_TAILQ_FIRST(®ion->active_txn, __txn_detail); txnp != NULL; txnp = SH_TAILQ_NEXT(txnp, links, __txn_detail)) { stats->st_txnarray[ndx].txnid = txnp->txnid; if (txnp->parent == INVALID_ROFF) stats->st_txnarray[ndx].parentid = TXN_INVALID_ID; else stats->st_txnarray[ndx].parentid = ((TXN_DETAIL *)R_ADDR(&mgr->reginfo, txnp->parent))->txnid; stats->st_txnarray[ndx].lsn = txnp->begin_lsn; ndx++; if (ndx >= stats->st_nactive) break; } stats->st_region_wait = mgr->reginfo.rp->mutex.mutex_set_wait; stats->st_region_nowait = mgr->reginfo.rp->mutex.mutex_set_nowait; stats->st_regsize = mgr->reginfo.rp->size; R_UNLOCK(dbenv, &mgr->reginfo); *statp = stats; return (0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/uts4_cc.s��������������������������������������������������������������������������0100644�0063146�0012731�00000001525�07427026535�014515� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ / / int uts_lock ( int *p, int i ); / Update the lock word pointed to by p with the / value i, using compare-and-swap. / Returns 0 if update was successful. / Returns 1 if update failed. / entry uts_lock uts_lock: using .,r15 st r2,8(sp) / Save R2 l r2,64+0(sp) / R2 -> word to update slr r0, r0 / R0 = current lock value must be 0 l r1,64+4(sp) / R1 = new lock value cs r0,r1,0(r2) / Try the update ... be x / ... Success. Return 0 la r0,1 / ... Failure. Return 1 x: / l r2,8(sp) / Restore R2 b 2(,r14) / Return to caller drop r15 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/x86.gcc����������������������������������������������������������������������������0100644�0063146�0012731�00000000650�07427026535�014066� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * @(#)x86.gcc 11.1 (Sleepycat) 7/25/99 * * For gcc/x86, 0 is clear, 1 is set. */ #define MUTEX_SET(tsl) ({ \ register tsl_t *__l = (tsl); \ int __r; \ asm volatile("movl $1,%%eax; lock; xchgb %1,%%al; xorl $1,%%eax"\ : "=&a" (__r), "=m" (*__l) \ : "1" (*__l) \ ); \ __r & 1; \ }) #define MUTEX_UNSET(tsl) (*(tsl) = 0) #define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) ����������������������������������������������������������������������������������������htdig-3.2.0b6/db/xa.h�������������������������������������������������������������������������������0100644�0063146�0012731�00000014621�07427026535�013547� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. * * @(#)xa.h 11.1 (Sleepycat) 7/25/99 */ /* * Start of xa.h header * * Define a symbol to prevent multiple inclusions of this header file */ #ifndef XA_H #define XA_H /* * Transaction branch identification: XID and NULLXID: */ #define XIDDATASIZE 128 /* size in bytes */ #define MAXGTRIDSIZE 64 /* maximum size in bytes of gtrid */ #define MAXBQUALSIZE 64 /* maximum size in bytes of bqual */ struct xid_t { long formatID; /* format identifier */ long gtrid_length; /* value from 1 through 64 */ long bqual_length; /* value from 1 through 64 */ char data[XIDDATASIZE]; }; typedef struct xid_t XID; /* * A value of -1 in formatID means that the XID is null. */ /* * Declarations of routines by which RMs call TMs: */ extern int ax_reg __P((int, XID *, long)); extern int ax_unreg __P((int, long)); /* * XA Switch Data Structure */ #define RMNAMESZ 32 /* length of resource manager name, */ /* including the null terminator */ #define MAXINFOSIZE 256 /* maximum size in bytes of xa_info */ /* strings, including the null terminator */ struct xa_switch_t { char name[RMNAMESZ]; /* name of resource manager */ long flags; /* resource manager specific options */ long version; /* must be 0 */ int (*xa_open_entry) /* xa_open function pointer */ __P((char *, int, long)); int (*xa_close_entry) /* xa_close function pointer */ __P((char *, int, long)); int (*xa_start_entry) /* xa_start function pointer */ __P((XID *, int, long)); int (*xa_end_entry) /* xa_end function pointer */ __P((XID *, int, long)); int (*xa_rollback_entry) /* xa_rollback function pointer */ __P((XID *, int, long)); int (*xa_prepare_entry) /* xa_prepare function pointer */ __P((XID *, int, long)); int (*xa_commit_entry) /* xa_commit function pointer */ __P((XID *, int, long)); int (*xa_recover_entry) /* xa_recover function pointer */ __P((XID *, long, int, long)); int (*xa_forget_entry) /* xa_forget function pointer */ __P((XID *, int, long)); int (*xa_complete_entry) /* xa_complete function pointer */ __P((int *, int *, int, long)); }; /* * Flag definitions for the RM switch */ #define TMNOFLAGS 0x00000000L /* no resource manager features selected */ #define TMREGISTER 0x00000001L /* resource manager dynamically registers */ #define TMNOMIGRATE 0x00000002L /* resource manager does not support association migration */ #define TMUSEASYNC 0x00000004L /* resource manager supports asynchronous operations */ /* * Flag definitions for xa_ and ax_ routines */ /* use TMNOFLAGGS, defined above, when not specifying other flags */ #define TMASYNC 0x80000000L /* perform routine asynchronously */ #define TMONEPHASE 0x40000000L /* caller is using one-phase commit optimisation */ #define TMFAIL 0x20000000L /* dissociates caller and marks transaction branch rollback-only */ #define TMNOWAIT 0x10000000L /* return if blocking condition exists */ #define TMRESUME 0x08000000L /* caller is resuming association with suspended transaction branch */ #define TMSUCCESS 0x04000000L /* dissociate caller from transaction branch */ #define TMSUSPEND 0x02000000L /* caller is suspending, not ending, association */ #define TMSTARTRSCAN 0x01000000L /* start a recovery scan */ #define TMENDRSCAN 0x00800000L /* end a recovery scan */ #define TMMULTIPLE 0x00400000L /* wait for any asynchronous operation */ #define TMJOIN 0x00200000L /* caller is joining existing transaction branch */ #define TMMIGRATE 0x00100000L /* caller intends to perform migration */ /* * ax_() return codes (transaction manager reports to resource manager) */ #define TM_JOIN 2 /* caller is joining existing transaction branch */ #define TM_RESUME 1 /* caller is resuming association with suspended transaction branch */ #define TM_OK 0 /* normal execution */ #define TMER_TMERR -1 /* an error occurred in the transaction manager */ #define TMER_INVAL -2 /* invalid arguments were given */ #define TMER_PROTO -3 /* routine invoked in an improper context */ /* * xa_() return codes (resource manager reports to transaction manager) */ #define XA_RBBASE 100 /* The inclusive lower bound of the rollback codes */ #define XA_RBROLLBACK XA_RBBASE /* The rollback was caused by an unspecified reason */ #define XA_RBCOMMFAIL XA_RBBASE+1 /* The rollback was caused by a communication failure */ #define XA_RBDEADLOCK XA_RBBASE+2 /* A deadlock was detected */ #define XA_RBINTEGRITY XA_RBBASE+3 /* A condition that violates the integrity of the resources was detected */ #define XA_RBOTHER XA_RBBASE+4 /* The resource manager rolled back the transaction branch for a reason not on this list */ #define XA_RBPROTO XA_RBBASE+5 /* A protocol error occurred in the resource manager */ #define XA_RBTIMEOUT XA_RBBASE+6 /* A transaction branch took too long */ #define XA_RBTRANSIENT XA_RBBASE+7 /* May retry the transaction branch */ #define XA_RBEND XA_RBTRANSIENT /* The inclusive upper bound of the rollback codes */ #define XA_NOMIGRATE 9 /* resumption must occur where suspension occurred */ #define XA_HEURHAZ 8 /* the transaction branch may have been heuristically completed */ #define XA_HEURCOM 7 /* the transaction branch has been heuristically committed */ #define XA_HEURRB 6 /* the transaction branch has been heuristically rolled back */ #define XA_HEURMIX 5 /* the transaction branch has been heuristically committed and rolled back */ #define XA_RETRY 4 /* routine returned with no effect and may be re-issued */ #define XA_RDONLY 3 /* the transaction branch was read-only and has been committed */ #define XA_OK 0 /* normal execution */ #define XAER_ASYNC -2 /* asynchronous operation already outstanding */ #define XAER_RMERR -3 /* a resource manager error occurred in the transaction branch */ #define XAER_NOTA -4 /* the XID is not valid */ #define XAER_INVAL -5 /* invalid arguments were given */ #define XAER_PROTO -6 /* routine invoked in an improper context */ #define XAER_RMFAIL -7 /* resource manager unavailable */ #define XAER_DUPID -8 /* the XID already exists */ #define XAER_OUTSIDE -9 /* resource manager doing work outside transaction */ #endif /* ifndef XA_H */ /* * End of xa.h header */ ���������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/xa_db.c����������������������������������������������������������������������������0100644�0063146�0012731�00000005753�07427026535�014215� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)xa_db.c 11.4 (Sleepycat) 9/15/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #endif #include "db_int.h" #include "xa.h" #include "xa_ext.h" static int CDB___xa_close __P((DB *, u_int32_t)); static int CDB___xa_cursor __P((DB *, DB_TXN *, DBC **, u_int32_t)); static int CDB___xa_del __P((DB *, DB_TXN *, DBT *, u_int32_t)); static int CDB___xa_get __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); static int CDB___xa_put __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); typedef struct __xa_methods { int (*close) __P((DB *, u_int32_t)); int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); } XA_METHODS; /* * CDB___db_xa_create -- * DB XA constructor. * * PUBLIC: int CDB___db_xa_create __P((DB *)); */ int CDB___db_xa_create(dbp) DB *dbp; { XA_METHODS *xam; int ret; /* * Interpose XA routines in front of any method that takes a TXN * ID as an argument. */ if ((ret = CDB___os_calloc(1, sizeof(XA_METHODS), &xam)) != 0) return (ret); dbp->xa_internal = xam; xam->close = dbp->close; xam->cursor = dbp->cursor; xam->del = dbp->del; xam->get = dbp->get; xam->put = dbp->put; dbp->close = CDB___xa_close; dbp->cursor = CDB___xa_cursor; dbp->del = CDB___xa_del; dbp->get = CDB___xa_get; dbp->put = CDB___xa_put; return (0); } static int CDB___xa_cursor(dbp, txn, dbcp, flags) DB *dbp; DB_TXN *txn; DBC **dbcp; u_int32_t flags; { DB_TXN *t; t = txn != NULL && txn == dbp->open_txn ? txn : dbp->dbenv->xa_txn; return (((XA_METHODS *)dbp->xa_internal)->cursor (dbp, t, dbcp, flags)); } static int CDB___xa_del(dbp, txn, key, flags) DB *dbp; DB_TXN *txn; DBT *key; u_int32_t flags; { DB_TXN *t; t = txn != NULL && txn == dbp->open_txn ? txn : dbp->dbenv->xa_txn; return (((XA_METHODS *)dbp->xa_internal)->del(dbp, t, key, flags)); } static int CDB___xa_close(dbp, flags) DB *dbp; u_int32_t flags; { int (*real_close) __P((DB *, u_int32_t)); real_close = ((XA_METHODS *)dbp->xa_internal)->close; CDB___os_free(dbp->xa_internal, sizeof(XA_METHODS)); dbp->xa_internal = NULL; return (real_close(dbp, flags)); } static int CDB___xa_get(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { DB_TXN *t; t = txn != NULL && txn == dbp->open_txn ? txn : dbp->dbenv->xa_txn; return (((XA_METHODS *)dbp->xa_internal)->get (dbp, t, key, data, flags)); } static int CDB___xa_put(dbp, txn, key, data, flags) DB *dbp; DB_TXN *txn; DBT *key, *data; u_int32_t flags; { DB_TXN *t; t = txn != NULL && txn == dbp->open_txn ? txn : dbp->dbenv->xa_txn; return (((XA_METHODS *)dbp->xa_internal)->put (dbp, t, key, data, flags)); } ���������������������htdig-3.2.0b6/db/xa_ext.h���������������������������������������������������������������������������0100644�0063146�0012731�00000000712�07427026535�014423� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* DO NOT EDIT: automatically built by dist/distrib. */ #ifndef _xa_ext_h_ #define _xa_ext_h_ int CDB___db_xa_create __P((DB *)); int CDB___db_rmid_to_env __P((int rmid, DB_ENV **envp)); int CDB___db_xid_to_txn __P((DB_ENV *, XID *, size_t *)); int CDB___db_map_rmid __P((int, DB_ENV *)); int CDB___db_unmap_rmid __P((int)); int CDB___db_map_xid __P((DB_ENV *, XID *, size_t)); void CDB___db_unmap_xid __P((DB_ENV *, XID *, size_t)); #endif /* _xa_ext_h_ */ ������������������������������������������������������htdig-3.2.0b6/db/xa_map.c���������������������������������������������������������������������������0100644�0063146�0012731�00000007210�07427026535�014373� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #ifndef lint static const char sccsid[] = "@(#)xa_map.c 11.1 (Sleepycat) 7/25/99"; #endif /* not lint */ #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <string.h> #endif #include "db_int.h" #include "txn.h" /* * This file contains all the mapping information that we need to support * the DB/XA interface. */ /* * CDB___db_rmid_to_env * Return the environment associated with a given XA rmid. * * PUBLIC: int CDB___db_rmid_to_env __P((int rmid, DB_ENV **envp)); */ int CDB___db_rmid_to_env(rmid, envp) int rmid; DB_ENV **envp; { DB_ENV *env; env = TAILQ_FIRST(&DB_GLOBAL(db_envq)); if (env != NULL && env->xa_rmid == rmid) { *envp = env; return (0); } /* * When we map an rmid, move that environment to be the first one in * the list of environments, so we acquire the correct environment * in DB->open. */ for (; env != NULL; env = TAILQ_NEXT(env, links)) if (env->xa_rmid == rmid) { TAILQ_REMOVE(&DB_GLOBAL(db_envq), env, links); TAILQ_INSERT_HEAD(&DB_GLOBAL(db_envq), env, links); *envp = env; return (0); } return (1); } /* * CDB___db_xid_to_txn * Return the txn that corresponds to this XID. * * PUBLIC: int CDB___db_xid_to_txn __P((DB_ENV *, XID *, size_t *)); */ int CDB___db_xid_to_txn(dbenv, xid, offp) DB_ENV *dbenv; XID *xid; size_t *offp; { DB_TXNMGR *mgr; DB_TXNREGION *tmr; struct __txn_detail *td; mgr = dbenv->tx_handle; tmr = mgr->reginfo.primary; /* * Search the internal active transaction table to find the * matching xid. If this is a performance hit, then we * can create a hash table, but I doubt it's worth it. */ R_LOCK(dbenv, &mgr->reginfo); for (td = SH_TAILQ_FIRST(&tmr->active_txn, __txn_detail); td != NULL; td = SH_TAILQ_NEXT(td, links, __txn_detail)) if (memcmp(xid->data, td->xid, XIDDATASIZE) == 0) break; R_UNLOCK(dbenv, &mgr->reginfo); if (td == NULL) return (EINVAL); *offp = R_OFFSET(&mgr->reginfo, td); return (0); } /* * CDB___db_map_rmid * Create a mapping between the specified rmid and environment. * * PUBLIC: int CDB___db_map_rmid __P((int, DB_ENV *)); */ int CDB___db_map_rmid(rmid, env) int rmid; DB_ENV *env; { env->xa_rmid = rmid; TAILQ_INSERT_TAIL(&DB_GLOBAL(db_envq), env, links); return (0); } /* * CDB___db_unmap_rmid * Destroy the mapping for the given rmid. * * PUBLIC: int CDB___db_unmap_rmid __P((int)); */ int CDB___db_unmap_rmid(rmid) int rmid; { DB_ENV *e; for (e = TAILQ_FIRST(&DB_GLOBAL(db_envq)); e->xa_rmid != rmid; e = TAILQ_NEXT(e, links)); if (e == NULL) return (EINVAL); TAILQ_REMOVE(&DB_GLOBAL(db_envq), e, links); return (0); } /* * CDB___db_map_xid * Create a mapping between this XID and the transaction at * "off" in the shared region. * * PUBLIC: int CDB___db_map_xid __P((DB_ENV *, XID *, size_t)); */ int CDB___db_map_xid(env, xid, off) DB_ENV *env; XID *xid; size_t off; { REGINFO *infop; TXN_DETAIL *td; infop = &((DB_TXNMGR *)env->tx_handle)->reginfo; td = (TXN_DETAIL *)R_ADDR(infop, off); R_LOCK(env, infop); memcpy(td->xid, xid->data, XIDDATASIZE); R_UNLOCK(env, infop); return (0); } /* * CDB___db_unmap_xid * Destroy the mapping for the specified XID. * * PUBLIC: void CDB___db_unmap_xid __P((DB_ENV *, XID *, size_t)); */ void CDB___db_unmap_xid(env, xid, off) DB_ENV *env; XID *xid; size_t off; { TXN_DETAIL *td; COMPQUIET(xid, NULL); td = (TXN_DETAIL *)R_ADDR(&((DB_TXNMGR *)env->tx_handle)->reginfo, off); memset(td->xid, 0, sizeof(td->xid)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/build_unix/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015120� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/build_vms/�������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014742� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/build_win16/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015101� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/build_win32/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015077� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/build_win32/DB_VC4.mdp�������������������������������������������������������������0100644�0063146�0012731�00000143000�06627574355�016555� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������JSG0��c����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿX�6�b�"��ÿÿ,��ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ������������øÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ�����������LL - Win32 Debug�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifac���� � � � � ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������� - Win32 Debug�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifac��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���������Ë]�����������������������ÿÿÿÿ�������Watch1��Watch2��Watch3��Watch4��������MLJL��\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifac������� �!������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �@œ��<not controlled>D:\db\build_win32�D:\db\build_win32�Watch2��Watch3��Watch4��������MLJL��\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifac#�$�%�&�'�(�)�*�+������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �¤������t controlled>D:\db\build_win32�D:\db\build_win32�Watch2��Watch3��Watch4��������MLJL��\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifac-�.�/�0�1�2�3�4�5������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �¤�����DB_DLL - Win32 Debug�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c���DB_DLL - Win32 Debug����DB_DLL - Win32 Release���DB_DLL - Win32 Debug DB_VC4.mak��CProjectDB_DLL - Win32 DebugDB_DLL - Win32 Release���ê�������DB_DLL - Win32 Debug���ê�������SSBR�� �CTargetItemSSBR\db\btree\btree_auto.c� �CFileItemSSBR\db\btree\bt_compare.c� �CFileItemSSBR\db\btree\bt_conv.c� �CFileItemSSBR\db\btree\bt_cursor.c� �CFileItemSSBR\db\btree\bt_delete.c� �CFileItemSSBR\db\btree\bt_open.c� �CFileItemSSBR\db\btree\bt_page.c� �CFileItemSSBR\db\btree\bt_put.c� �CFileItemSSBR\db\btree\bt_rec.c� �CFileItemSSBR\db\btree\bt_rsearch.c� �CFileItemSSBR\db\btree\bt_search.c� �CFileItemSSBR\db\btree\bt_split.c� �CFileItemSSBR\db\btree\bt_stat.c� �CFileItemSSBR\db\cxx\cxx_txn.cpp� �CFileItemSSBR\db\cxx\cxx_except.cpp� �CFileItemSSBR\db\cxx\cxx_lock.cpp� �CFileItemSSBR\db\cxx\cxx_log.cpp� �CFileItemSSBR\db\cxx\cxx_mpool.cpp� �CFileItemSSBR\db\cxx\cxx_table.cpp� �CFileItemSSBR\db\cxx\cxx_app.cpp� �CFileItemSSBR\db\db\db_auto.c� �CFileItemSSBR\db\db\db_conv.c� �CFileItemSSBR\db\db\db_dispatch.c� �CFileItemSSBR\db\db\db_dup.c� �CFileItemSSBR\db\db\db_overflow.c� �CFileItemSSBR\db\db\db_pr.c� �CFileItemSSBR\db\db\db_rec.c� �CFileItemSSBR\db\db\db_ret.c� �CFileItemSSBR \db\db\db.c� �CFileItemSSBR\db\common\db_shash.c� �CFileItemSSBR\db\common\db_apprec.c� �CFileItemSSBR\db\common\db_byteorder.c� �CFileItemSSBR\db\common\db_err.c� �CFileItemSSBR\db\common\db_log2.c� �CFileItemSSBR\db\common\db_region.c� �CFileItemSSBR\db\common\db_salloc.c� �CFileItemSSBR\db\common\db_appinit.c� �CFileItemSSBR \db\dbm\dbm.c� �CFileItemSSBR\db\hash\hash_stat.c� �CFileItemSSBR\db\hash\hash_auto.c� �CFileItemSSBR\db\hash\hash_conv.c� �CFileItemSSBR\db\hash\hash_dup.c� �CFileItemSSBR\db\hash\hash_func.c� �CFileItemSSBR\db\hash\hash_page.c� �CFileItemSSBR\db\hash\hash_rec.c� �CFileItemSSBR\db\hash\hash.c� �CFileItemSSBR\db\lock\lock_util.c� �CFileItemSSBR\db\lock\lock_conflict.c� �CFileItemSSBR\db\lock\lock_deadlock.c� �CFileItemSSBR\db\lock\lock.c� �CFileItemSSBR\db\log\log_register.c� �CFileItemSSBR\db\log\log_archive.c� �CFileItemSSBR\db\log\log_auto.c� �CFileItemSSBR\db\log\log_compare.c� �CFileItemSSBR\db\log\log_findckp.c� �CFileItemSSBR\db\log\log_get.c� �CFileItemSSBR\db\log\log_put.c� �CFileItemSSBR\db\log\log_rec.c� �CFileItemSSBR \db\log\log.c� �CFileItemSSBR\db\mp\mp_sync.c� �CFileItemSSBR\db\mp\mp_fget.c� �CFileItemSSBR\db\mp\mp_fopen.c� �CFileItemSSBR\db\mp\mp_fput.c� �CFileItemSSBR\db\mp\mp_fset.c� �CFileItemSSBR\db\mp\mp_open.c� �CFileItemSSBR\db\mp\mp_pr.c� �CFileItemSSBR\db\mp\mp_region.c� �CFileItemSSBR\db\mp\mp_bh.c� �CFileItemSSBR\db\mutex\mutex.c� �CFileItemSSBR\db\txn\txn_rec.c� �CFileItemSSBR\db\txn\txn_auto.c� �CFileItemSSBR \db\txn\txn.c� �CFileItemSSBR\db\clib\strsep.c� �CFileItemSSBR\db\btree\bt_recno.c� �CFileItemSSBR\db\os\os_fsync.c� �CFileItemSSBR\db\os\os_oflags.c� �CFileItemSSBR\db\os\os_open.c� �CFileItemSSBR\db\os\os_rpath.c� �CFileItemSSBR\db\os\os_rw.c� �CFileItemSSBR\db\os\os_stat.c� �CFileItemSSBR\db\os\os_unlink.c� �CFileItemSSBR\db\os\os_config.c� �CFileItemSSBR\db\os\os_alloc.c� �CFileItemSSBR\db\hsearch\hsearch.c� �CFileItemSSBR .\libdb.def� �CFileItemSSBR\db\lock\lock_region.c� �CFileItemSSBR .\dllmain.c� �CFileItemSSBR .\libdb.rc� �CFileItemSSBR\db\btree\bt_curadj.c� �CFileItemSSBR\db\db\db_join.c� �CFileItemSSBR\db\db\db_iface.c� �CFileItemSSBR\db\db\db_am.c� �CFileItemSSBR\db\os_win32\os_spin.c� �CFileItemSSBR\db\os_win32\os_dir.c� �CFileItemSSBR\db\os_win32\os_fid.c� �CFileItemSSBR\db\os_win32\os_map.c� �CFileItemSSBR\db\os_win32\os_seek.c� �CFileItemSSBR\db\os_win32\os_sleep.c� �CFileItemSSBR\db\os_win32\os_abs.c� �CFileItemSSBRdep��CDependencyContainerSSBR btree_auto.h��CDependencyFileSSBR btree_ext.h��CDependencyFileSSBRbtree.h��CDependencyFileSSBR common_ext.h��CDependencyFileSSBRdb_am.h��CDependencyFileSSBR db_auto.h��CDependencyFileSSBR db_dispatch.h��CDependencyFileSSBRdb_ext.h��CDependencyFileSSBR db_page.h��CDependencyFileSSBR mutex_ext.h��CDependencyFileSSBRos_ext.h��CDependencyFileSSBRqueue.h��CDependencyFileSSBR shqueue.h��CDependencyFileSSBRconfig.h��CDependencyFileSSBRdb.h��CDependencyFileSSBRdb_int.h��CDependencyFileSSBRstat.h��CDependencyFileSSBRtypes.h��CDependencyFileSSBR db_swap.h��CDependencyFileSSBR hash_auto.h��CDependencyFileSSBR hash_ext.h��CDependencyFileSSBRhash.h��CDependencyFileSSBRlog.h��CDependencyFileSSBR log_auto.h��CDependencyFileSSBR log_ext.h��CDependencyFileSSBR cxx_int.h��CDependencyFileSSBRdb_cxx.h��CDependencyFileSSBR txn_auto.h��CDependencyFileSSBR db_shash.h��CDependencyFileSSBRmp.h��CDependencyFileSSBRmp_ext.h��CDependencyFileSSBRtxn.h��CDependencyFileSSBR txn_ext.h��CDependencyFileSSBR clib_ext.h��CDependencyFileSSBRlock.h��CDependencyFileSSBR lock_ext.h��CDependencyFileSSBR 68020.gcc��CDependencyFileSSBR parisc.gcc��CDependencyFileSSBRsco.cc��CDependencyFileSSBR sparc.gcc��CDependencyFileSSBRx86.gcc��CDependencyFileSSBR db_join.h��CDependencyFileSSBRos.h��CDependencyFileSSBRxa.h��CDependencyFileSSBRxa_ext.h��CDependencyFileSSBR os_jump.h��CDependencyFileSSBRDJWdep��CDependencyContainerSSBR btree_auto.h��CDependencyFileSSBR btree_ext.h��CDependencyFileSSBRbtree.h��CDependencyFileSSBR common_ext.h��CDependencyFileSSBRdb_am.h��CDependencyFileSSBR db_auto.h��CDependencyFileSSBR db_dispatch.h��CDependencyFileSSBRdb_ext.h��CDependencyFileSSBR db_page.h��CDependencyFileSSBR mutex_ext.h��CDependencyFileSSBRos_ext.h��CDependencyFileSSBRqueue.h��CDependencyFileSSBR shqueue.h��CDependencyFileSSBRconfig.h��CDependencyFileSSBRdb.h��CDependencyFileSSBRdb_int.h��CDependencyFileSSBRstat.h��CDependencyFileSSBRtypes.h��CDependencyFileSSBR db_swap.h��CDependencyFileSSBR hash_auto.h��CDependencyFileSSBR hash_ext.h��CDependencyFileSSBRhash.h��CDependencyFileSSBRlog.h��CDependencyFileSSBR log_auto.h��CDependencyFileSSBR log_ext.h��CDependencyFileSSBR cxx_int.h��CDependencyFileSSBRdb_cxx.h��CDependencyFileSSBR txn_auto.h��CDependencyFileSSBR db_shash.h��CDependencyFileSSBRmp.h��CDependencyFileSSBRmp_ext.h��CDependencyFileSSBRtxn.h��CDependencyFileSSBR txn_ext.h��CDependencyFileSSBR clib_ext.h��CDependencyFileSSBRlock.h��CDependencyFileSSBR lock_ext.h��CDependencyFileSSBR 68020.gcc��CDependencyFileSSBR parisc.gcc��CDependencyFileSSBRsco.cc��CDependencyFileSSBR sparc.gcc��CDependencyFileSSBRx86.gcc��CDependencyFileSSBR db_join.h��CDependencyFileSSBRos.h��CDependencyFileSSBRxa.h��CDependencyFileSSBRxa_ext.h��CDependencyFileSSBR os_jump.h��CDependencyFileSSBRDJW\db\os\os_tmpdir.c� �CFileItemSSBRDJWDJW� �CFileItemSSBR\db\os\os_config.c� �CFileItemSSBR\db\os\os_alloc.c� �CFileItemSSBR\db\hsearch\hsearch.c� �CFileItemSSBR .\libdb.def� �CFileItemSSBR\db\lock\lock_region.c� �CFileItemSSBR .\dllmain.c� �CFileItemSSBR .\libdb.rc� �CFileItemSSBR\db\btree\bt_curadj.c� �CFileItemSSBR\db\db\db_join.c� �CFileItemSSBR\db\db\db_iface.c� �CFileItemSSBR\db\db\db_am.c� �CFileItemSSBR\db\os_win32\os_spin.c� �CFileItemSSBR\db\os_win32\os_dir.c� �CFileItemSSBR\db\os_win32\os_fid.c� �CFileItemSSBR\db\os_win32\os_map.c� �CFileItemSSBR\db\os_win32\os_seek.c� �CFileItemSSBR\db\os_win32\os_sleep.c� �CFileItemSSBR\db\os_win32\os_abs.c� �CFileItemSSBRdep��CDependencyContainerSSBR btree_auto.h��CDependencyFileSSBR btree_ext.h��CDependencyFileSSBRbtree.h��CDependencyFileSSBR common_ext.h��CDependencyFileSSBRdb_am.h��CDependencyFileSSBR db_auto.h��CDependencyFileSSBR db_dispatch.h��CDependencyFileSSBRdb_ext.h��CDependencyFileSSBR db_page.h��CDependencyFileSSBR mutex_ext.h��CDependencyFileSSBRos_ext.h��CDependencyFileSSBRqueue.h��CDependencyFileSSBR shqueue.h��CDependencyFileSSBRconfig.h��CDependencyFileSSBRdb.h��CDependencyFileSSBRdb_int.h��CDependencyFileSSBRstat.h��CDependencyFileSSBRtypes.h��CDependencyFileSSBR db_swap.h��CDependencyFileSSBR hash_auto.h��CDependencyFileSSBR hash_ext.h��CDependencyFileSSBRhash.h��CDependencyFileSSBRlog.h��CDependencyFileSSBR log_auto.h��CDependencyFileSSBR log_ext.h��CDependencyFileSSBR cxx_int.h��CDependencyFileSSBRdb_cxx.h��CDependencyFileSSBR txn_auto.h��CDependencyFileSSBR db_shash.h��CDependencyFileSSBRmp.h��CDependencyFileSSBRmp_ext.h��CDependencyFileSSBRtxn.h��CDependencyFileSSBR txn_ext.h��CDependencyFileSSBR clib_ext.h��CDependencyFileSSBRlock.h��CDependencyFileSSBR lock_ext.h��CDependencyFileSSBR 68020.gcc��CDependencyFileSSBR parisc.gcc��CDependencyFileSSBRsco.cc��CDependencyFileSSBR sparc.gcc��CDependencyFileSSBRx86.gcc��CDependencyFileSSBR db_join.h��CDependencyFileSSBRos.h��CDependencyFileSSBRxa.h��CDependencyFileSSBRxa_ext.h��CDependencyFileSSBR os_jump.h��CDependencyFileSSBRDJWdep��CDependencyContainerSSBR btree_auto.h��CDependencyFileSSBR btree_ext.h��CDependencyFileSSBRbtree.h��CDependencyFileSSBR common_ext.h��CDependencyFileSSBRdb_am.h��CDependencyFileSSBR db_auto.h��CDependencyFileSSBR db_dispatch.h��CDependencyFileSSBRdb_ext.h��CDependencyFileSSBR db_page.h��CDependencyFileSSBR mutex_ext.h��CDependencyFileSSBRos_ext.h��CDependencyFileSSBRqueue.h��CDependencyFileSSBR shqueue.h��CDependencyFileSSBRconfig.h��CDependencyFileSSBRdb.h��CDependencyFileSSBRdb_int.h��CDependencyFileSSBRstat.h��CDependencyFileSSBRtypes.h��CDependencyFileSSBR db_swap.h��CDependencyFileSSBR hash_auto.h��CDependencyFileSSBR hash_ext.h��CDependencyFileSSBRhash.h��CDependencyFileSSBRlog.h��CDependencyFileSSBR log_auto.h��CDependencyFileSSBR log_ext.h��CDependencyFileSSBR cxx_int.h��CDependencyFileSSBRdb_cxx.h��CDependencyFileSSBR txn_auto.h��CDependencyFileSSBR db_shash.h��CDependencyFileSSBRmp.h��CDependencyFileSSBRmp_ext.h��CDependencyFileSSBRtxn.h��CDependencyFileSSBR txn_ext.h��CDependencyFileSSBR clib_ext.h��CDependencyFileSSBRlock.h��CDependencyFileSSBR lock_ext.h��CDependencyFileSSBR 68020.gcc��CDependencyFileSSBR parisc.gcc��CDependencyFileSSBRsco.cc��CDependencyFileSSBR sparc.gcc��CDependencyFileSSBRx86.gcc��CDependencyFileSSBR db_join.h��CDependencyFileSSBRos.h��CDependencyFileSSBRxa.h��CDependencyFileSSBRxa_ext.h��CDependencyFileSSBR os_jump.h��CDependencyFileï R¸�0�€'ò�¤�����DB_DLL - Win32 Debug�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!�����ò�DB_DLL - Win32 Debug�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cD:\db\txn\txn_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_iface.cD:\db\db\db_am.cD:\db\os_win32\os_spin.cD:\db\os_win32\os_dir.cD:\db\os_win32\os_fid.cD:\db\os_win32\os_map.cD:\db\os_win32\os_seek.cD:\db\os_win32\os_sleep.cD:\db\os_win32\os_abs.cD:\db\os\os_tmpdir.c�DB_DLL - Win32 Release�D:\db\btree\btree_auto.cD:\db\btree\bt_compare.cD:\db\btree\bt_conv.cD:\db\btree\bt_cursor.cD:\db\btree\bt_delete.cD:\db\btree\bt_open.cD:\db\btree\bt_page.cD:\db\btree\bt_put.cD:\db\btree\bt_rec.cD:\db\btree\bt_rsearch.cD:\db\btree\bt_search.cD:\db\btree\bt_split.cD:\db\btree\bt_stat.cD:\db\cxx\cxx_txn.cppD:\db\cxx\cxx_except.cppD:\db\cxx\cxx_lock.cppD:\db\cxx\cxx_log.cppD:\db\cxx\cxx_mpool.cppD:\db\cxx\cxx_table.cppD:\db\cxx\cxx_app.cppD:\db\db\db_auto.cD:\db\db\db_conv.cD:\db\db\db_dispatch.cD:\db\db\db_dup.cD:\db\db\db_overflow.cD:\db\db\db_pr.cD:\db\db\db_rec.cD:\db\db\db_ret.c D:\db\db\db.cD:\db\common\db_shash.cD:\db\common\db_apprec.cD:\db\common\db_byteorder.cD:\db\common\db_err.cD:\db\common\db_log2.cD:\db\common\db_region.cD:\db\common\db_salloc.cD:\db\common\db_appinit.cD:\db\dbm\dbm.cD:\db\hash\hash_stat.cD:\db\hash\hash_auto.cD:\db\hash\hash_conv.cD:\db\hash\hash_dup.cD:\db\hash\hash_func.cD:\db\hash\hash_page.cD:\db\hash\hash_rec.cD:\db\hash\hash.cD:\db\lock\lock_util.cD:\db\lock\lock_conflict.cD:\db\lock\lock_deadlock.cD:\db\lock\lock.cD:\db\log\log_register.cD:\db\log\log_archive.cD:\db\log\log_auto.cD:\db\log\log_compare.cD:\db\log\log_findckp.cD:\db\log\log_get.cD:\db\log\log_put.cD:\db\log\log_rec.cD:\db\log\log.cD:\db\mp\mp_sync.cD:\db\mp\mp_fget.cD:\db\mp\mp_fopen.cD:\db\mp\mp_fput.cD:\db\mp\mp_fset.cD:\db\mp\mp_open.cD:\db\mp\mp_pr.cD:\db\mp\mp_region.cD:\db\mp\mp_bh.cD:\db\mutex\mutex.cïdb¸�0�€'ò�_rec.cD:\db\txn\txn_auto.cD:\db\txn\txn.cD:\db\clib\strsep.cD:\db\btree\bt_recno.cD:\db\os\os_fsync.cD:\db\os\os_oflags.cD:\db\os\os_open.cD:\db\os\os_rpath.cD:\db\os\os_rw.cD:\db\os\os_stat.cD:\db\os\os_unlink.cD:\db\os\os_config.cD:\db\os\os_alloc.cD:\db\hsearch\hsearch.cD:\db\build_win32\libdb.defD:\db\lock\lock_region.cD:\db\build_win32\dllmain.cD:\db\build_win32\libdb.rcD:\db\btree\bt_curadj.cD:\db\db\db_join.cD:\db\db\db_ifacY�Z�[�\�]�^�_�`�a������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� �htdig-3.2.0b6/db/clib/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013667� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/common/����������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014246� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/cxx/�������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013560� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013343� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db185/�����������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013601� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_archive/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015044� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_checkpoint/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015552� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_deadlock/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015171� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_dump/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014370� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_dump185/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014626� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_load/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014342� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_printlog/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015261� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_recover/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015070� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/db_stat/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014376� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/dbm/�������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013520� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/dist/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013721� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/dist/template/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015534� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�013706� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�014761� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/Db/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015306� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbEnv/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015757� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbInfo/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016122� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbLock/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016117� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbLockTab/��������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016546� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbLog/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015750� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbMpool/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016315� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbMpoolFile/������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017115� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbTxn/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016000� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/DbTxnMgr/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016446� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/Dbc/��������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015451� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/Dbt/��������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015472� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/historic/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016605� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/index/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016070� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_c/internal/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016575� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015341� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/Db/�������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015666� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbEnv/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016337� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbException/����������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017545� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbInfo/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016502� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbLock/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016477� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbLockTab/������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017126� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbLog/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016330� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbLsn/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016343� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbMpool/��������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016675� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbMpoolFile/����������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017475� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbTxn/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016360� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/DbTxnMgr/�������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017026� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/Dbc/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016031� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/Dbt/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016052� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_cxx/index/����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016450� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�015460� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/Db/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016005� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbEnv/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016456� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbException/���������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017664� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbInfo/��������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016621� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbLock/��������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016616� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbLockTab/�����������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�017245� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbLog/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260367�016447� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbLsn/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016454� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbMpool/�������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�017006� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbMpoolFile/���������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�017606� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbRunRecoveryException/����������������������������������������������0040755�0063146�0012731�00000000000�10063260370�022062� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbTxn/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016471� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/DbTxnMgr/������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�017137� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/Dbc/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016142� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/Dbt/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016163� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/api_java/index/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016561� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/build/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014777� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/distrib/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015340� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015145� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/folder.gif�������������������������������������������������������������0100644�0063146�0012731�00000000341�06627574354�017127� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a��Â��ÿÿÿÿÌ™Ìÿÿ™f3333���������!þNThis art is in the public domain. Kevin Hughes, kevinh@eit.com, September 1995�!ù���,�������T(ºÜþ0ÊIY¹øÎºïEÄ}d¦)Å@zj‰C,Ç+ŽõWž<œì IEáqg<²‚N"4ÚIRaV˜VÅÝÂx‚Ôl<&€Ãæ´zÍ#,LðŒ;�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/folder_open.gif��������������������������������������������������������0100644�0063146�0012731�00000000362�06627574354�020153� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a��Â��ÿÿÿÿÌ™Ìÿÿ»»»™f3333������!þNThis art is in the public domain. Kevin Hughes, kevinh@eit.com, September 1995�!ù���,�������e(ºÜþ0ÊI«m&ë|—`Ý'ž™g’뺰#£sÊÝoÀ ¡ uÂa¡ˆJ:Ÿ„¥à|ZQ˜¬zuf=½®W pÅÁ/ãsF«×mñC¨Ûï÷9¦ïûý*:ƒ5 �;������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/next.gif���������������������������������������������������������������0100644�0063146�0012731�00000000341�06627574354�016632� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF87a$�$�Â��øüøÀÀÀ���ø�ø€€€���������,����$�$��®ºÜþ0ÊI«½8ëÍ»_Ad)ˆ¨©†OH¢âëžð´ÂtæQÎ7?Iðá#V†ŽbR1ôt�d”錚ÒéTš]($¯« k“f.òEwå´5^b¯>z} –³Í|vY{jdew}bKg@Œ <mŠs*ˆ‚cƒŽK…PB™g‡’“a‘ka7§~¦�¨¤V§«°7E'±µ€z¹z-¾¿ÀÁÂÂ¼ÃÆÇ¿ÊËÌÍ �;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/prev.gif���������������������������������������������������������������0100644�0063146�0012731�00000000352�06627574354�016632� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF87a$�$�Â��øüøÀÀÀ���€€€ø�ø���������,����$�$��·ºÜþ0ÊI«½8ëÍ»_A Œ$žai¢Ž(@ã9>qè¼o$ˆÓÜ€œ®² aı $e§82^Îjij­UhUzý"ƒªÙ¦¦ÏÝ[ZõF§¹äë|Kuóz`\rmqevgp€uˆ^{xKŒS’‡†ƒ‚•s“˜—Š‘C–a8tƒ\¦FE??j91�­hªS/³¸T·²¼­#‹{Á¿-ÇÈÉÊËÌÅÌÏÐÉÓÔÕÖ �;��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/ps.gif�����������������������������������������������������������������0100644�0063146�0012731�00000000364�06627574354�016303� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a��Â��ÿÿÿÌÿÿ™™™333������������!þNThis art is in the public domain. Kevin Hughes, kevinh@eit.com, September 1995�!ù���,�������g8º¼ñ0 @«#¾IºïÀjÜç…U‰�ØhºV&L w¾UÂ'¼¦eH{»ž­óã ;ÒeAJ^X*zõ†ÖÉôÕ¬rYDb8Í^³Õç7\(ßÒë�7>ÿ€F85… �;����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/sleepycat.gif����������������������������������������������������������0100644�0063146�0012731�00000014103�06627574354�017646� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89ag�÷ÿ�ÿÿÿ!!!)))111999BBBJJJRRRZZZccckkksss{{{„„„ŒŒŒ”””œœœ¥¥¥­­­µµµ½½½ÆÆÆÎÎÎÖÖÖÞÞÞçççïïï÷÷÷ïçç÷ïïÿ÷÷ÎÆÆÖÎÎÞÖÖ½µµ­¥¥µ­­Æ½½”ŒŒœ””¥œœŒ„„{ssÿïïskk„{{kccZRRcZZÿççÿÞÞ÷ÖÖscc÷ÎÎï„„!¥99JÖ11kœ!!Î))­!!cÎ!!ÆÎ”ÆÎœÆÎÆ��Þ91Ö1)Î)!Ö)!ÆÎÆÆ�ç{sÞskçskÞkcÞcZÆRJÞZRçZRÖRJÞRJÖJBÞJBÆB9­91ÖB9œ1)­1)Î91Ö91½1)Î1)½)!ŒÎ!甌÷œ”猄Ö{sç„{Þ{sµB9Ö9)Î1!ksÎ)c÷µ­ï­¥Þœ”樂眔ÖZJÞZJk)!ÖRBÞRBÖJ9ÖB1Î9)オ絭ÿƽ÷½µïµ­Æ”Œ¥kcç{kÞscs91çscÞkZçkZÞcRÆRBÖ9!ÿÖÎ÷ÎÆ÷ƽµŒ„Ö¥œïœŒç”„÷œŒï”„çŒ{ç„sc91­ZJÞR9ÖJ1ÖB)Œ)凜県ç{cçsZÞcJÿÞÖ÷ÖÎ÷µ¥{ZRﭜ祔¥cRÿƵ÷½­ïµ¥ï”{÷ÞÖ”{s÷Ƶュ樓ÿçÞœ„{ÿÖÆ{cZ÷νïÞÖçÖÎÿÞÎ÷ÖÆÿïçÞÎÆ÷Æ­ÖÆ½ÿçÖ÷ïçÿ÷ï½µ­œ”Œ”Œ„ÿïÞZRJÿ÷çïïçÿÿ÷ÎÎÆÖÖÎÞÞÖççÞ½½µ­­¥ÆÆ½””Œœœ”¥¥œŒŒ„{{sssk„„{kkcccZRRJJJBµ½µ{„{!)!!ÖÞÞÞççkss{„„JRR!!RRZ­!)ÆÆÎÆ�������������������,����g�@ÿ�H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱcEQT"U+x+ ‘!ˆ¶¬Ú„ÌcÂk¿6}tæ¥F-]êÜɳçBXn4E„õ…Iš^¯ºC„—ÏŽÈ Q’%çÓ«X³vd CUaœèò8ŒH$­mQbèÚ·p3"Ks$NÜæ¨º»‘Ò‘(¸øf¼pA°@:XTuäI ¯¢jHII`Ã{9È`}<(¬ O„…èCà¾�>(]¸× ^(íàð€Õ=| x¡}DP O�„èSpÐ’0Î,ZQb… ³4‡®ÿÁƒØ4;s³GJ÷Ì„(¸Aõ€âI›F­šuC×°ÉF�”–€A»éóÀa·ùW€±1tœ1çtÒQG`‚@¼D1,0C l0Ð#A6Ý‚ÈuÒ¸×.ÜED‰=D cP¥I€¥ °�H>Wp¯)€ä(gP¥€$ äfÐlúÖPtú,Ð¥1 Ð„ÊY¨¤A`jÈPß(vÍ*wLI6> _Xõ öqYž„j¨E!x’a JÑ(Ga‰x‡6T >½)”à‚�xpÛš–Æ)C ”¦åAd â¥Q�@› Õÿ§Ï}Fa¬ ”@i äÌa¼AiA׳ÉsX‘E _ŒñE ”X±J#°ø©Ó/¡ÄHUz‘m¯©ˆÐ¦ êjBä6Tj�§”Ai¥5�$¼^B§­L&‡ëtAЪBë¶›” ¿ì 2¬Ë/Ìü" ÂÃzË—§úÜ7ni‚yîÅ :0©ú` ‘´*Ät%Û*%›Ò‰)𠹦ÔÌÁÊç¬óÎ i2†Q´4G>g)äÌ+šðÒ.L7½ôÓÃóÊ+̼ò 2óñ¬õÖ…� .¢HaHA!Ìá”&D¨á–¡¯Œ¢F>Gd1×t»tË–äŒ*C4ÿ%Ð/ˆD’F¸ ²6ÝØ‘Oƒ×í8DºaFãp#…(ÐÇfŸdîùA¢Äá:9#U ”ÇŽ:>I¤{Ĥ>$¤ßi&«VÀ¼OPÎÉ Aï¬I—ð€A fêÁoÊþ™>(Ä\�…qð[huÀ;•Èñ^/cj7Ô‹%l $„èñÅ-Í¢„ ÉOÿç ŠH"A2×{ÐíüÎL% . ä]úh€nxãäcBNššc<‚À !¢ØÖ°< D € &P‚eà„°�8�:8DŒ@ƒœ#/GV`N$¡È�ÿ.8�„È�ðಅÉE$‘êÌ’nS€%ð ‚—›³²Lo‹ðªÝ–´x€åÑç8Z4B.„ ŒðºÐA.¨¸ƒH0ƒ[2À€,�.øÄÒp‡; ADˆÂ” ¹.da¤ãY˜0‹ˆ0ætÀŸ&7I‘aŒA ˆäC²©ÎÕHLHjJ )¡zÍ�fi$ƒ0`–ÒiÎ,6/W½ÌA¬¢^B˜£T€˜jÄqö C<!axÂÈÀj̃ó˜e„.r0XÌ" w`CD±?Œ8#÷” ð— Æ’SÛEå1Ü$¤¿I€r©ÿ ¸FŽ9¿‚¦}¹ �»¨AJ¥w Dž D+D ¬Ó'×xE/Fq)¤Á´%'¾ p žŸ’á8«„@0!à#��ðÉJ„0”¥È9ȼà�øO —©ÈFJÔ T`øãU:àK n“¨Pê&13°A[Q0†T·ÊÕ‡X‡ AÈ'â“5dðb‚@„ …i £ÍpFæz8Ã.@2~‹Eô«˜²`‰-lÁwx‚,á†M¤®«ÍJ¢p?ƒX"sÈÓ&,%œœ‘ ­DœÁJ  €)A„,ðâXÐÙ&º0•.ÿ¼B´ŸãJ`A BŒ¼ˆÚcð‡#¨¡u±¬µ3dl‡mÀ-Ýz1…î$ÄP‚ðÄK‚¹<A˜0fHwg[8‚Sî"Š)øÈqÍøB>¾pÑójä €0ŠÌ9Ã÷Hƒjí+KÜc ƒ‹%ž�Þ­Y!Rp pžVÑ˜Û–î œYH˜PÙÇ9à öHx=€Æ,‘ô4‰cS8б ÈK@™¯Ã¨æV1ƒ—Iƒ³+- @`�@%D‹# Á¹ÆÔÐ`‚Hã "Öde(aðj45Í"³§"„KÕÌÄÀN5!«ÀŒ RÐå4Gÿ\lR›‹!ª"¼Ø r-A„r&õ7(`Ää€À½$øP!ƒ2;ŠUËûÑrôÒåzI?£Hóʵi\q!l¼´›°æWåê VÈÇd,²$Lâ¡Dø‚Ê!ƒ¤@hX`‚gü ÉØ� „8h¤`"PjV”ñh†Ìá/ðMZS£¹?­)—Â%/•t˜"õAjÆ5ê£�zM«éȦZäaÑ @´çˆ < ä@ª $à€, V8Ãذ^ƒ £ L¨BCHÀ T+8ÊD®}„JCˆ·7$U–šäÿP#ÀFXd•¨€?Ë4Ït#DJÇQõõæýj…üâ ÷xD<$pª »ø’¯Ë ,Ð¥+6Ô5¾¡<d.ö@ÄcW)O‚è§z éÀ½2/8'„KM]HZ¶Ù 5!lı…ÌnÁž7¤BHE&ì‚1á½WOF·¤HÇ7¿e� ƒ@`�Œ�Ú= @�Œ7à–¤óÓX©æ  ¡ÀâmnôT9 €�è>Y^•AFÌÀŠ®ŽB ˆXúC uþJø÷y‚…%” U\œ!¿H6‘¹ $�RBÀOt¾ @€ö·€LàþÿöÍî ø©@S9€ þ øMiö9–†�½*ˆ 1OhbXà'~�dÁ ž`Úõ Qçž@÷ПƒF¸")–/ïTOú0¤!©ÁbÕF%g‘s & pª¡ÒG! ‡Ð¯Àq` … Xà ¼p5wu s È  ±Y@ˆÐYQ� p ÃesòùÝ¢Ið/Ø)¶’… Óxð$�ðJ‚b*¨JcGP9µ/¨]WôÐr£`u˜q Œ@JGPp|šDL/Vsð´…è’b]8nae`eðÂ�·ñzÿ±Jø’sJEG‚Øb¨ºÐ£ fˆ0[`q° ª0 ¸p ·° š� °  ›À|€ ³  žVpXi l¾Õ ºw^«¤jdÖ1Z˜†r™VˆÆA/ÈønÒ&v�$¨JÒÁ�°+سëÂzÀwW¨;6ŒhŒÝ2ƒ� h­äR¯aˆugsŠ8�€ð�ÒQ�GŽÌS¥ð�ªáÑùˆF úØjÝè«D; >>&�0j ALîH–GjÐQrÜó‘-%¯Ä‡ÑcZôv Ù’.ù’0éΠ ¸�0“8ÿé-È0 ÚÒ½à De99”6Ҁܱ6¿ðGP…á ÃðVPˆðPf‡p †p‡€ ˆ`‰õC  Gdùˆ@”·  YC”nIppt�v]pV…@H]0ŒÐdáO‰ˆµXn� |ø–öå “vqp_À O˜È@ _0O€·™ˆÙU¸˜£7f°”…¢ nÃC@ Ù¶™Põ ³ ®0 ¢  ½0—�p [¯À_p˜‚a X -Oà ¼©š9³7g0�x 1 D E° <ƒ ’6Ÿ0œÄÉ™ð†€à—Áz ”ÿ°€± "r \Ó Šcèyo± D06�@?) ”0H”°t›0c°w vÀ|u£ D0£`î©8’I †@¥h À£0Þé-°@LК Á ÷P4†G;Ñ @ðmÉ5×@ ù`¿è¡áiš)0±¢Qžàa—eÜ%£_”ÎNä8Ç J ¢BÊka¢ql@ž3 ÷@±ð¤Q="¢Àd™“He\ª„pwßá™Sgö07z¦ aÖ¡ £ÐžA÷ œuà jbxJ§á÷ 1ºÈÿ ¡”™ŸÀa•9š7†Z€`\sãt RŠÛñ©Ž)Dš¡ °f‘‡‘ª²šªù‡E³*«Üheð‡¥ªo7Ž7—ª0ä@�0� À’Úv«²úb´¨æåŸ ·_@´é8.`÷À L“'rYf†`$�$3[Ä«< .'G‚d(� É4B¶ED&:›ª¯‰ÀË~f™@kª›p°IˆŠ`èV¯¦v®ß¶eœ‚ Á%€F'g‘ƒ±\âˆlönñÆjhÆvÑ F¶°Ñõ™ÿASÐp A E Rð³\£ C�Ñc9r/nt‰ Qn�Lm8¯gvàƒ; ‘j+ËsÑ8×`J qÁB‰£_ õEÚpà�ë x @€ 7C)?Û Y(‚ ¦BEÒ†´¨´ !3ù®¥!F½„nÎ3µ§j 1!ñ¶zÊ4g‘”÷Ÿ‚WNÈ0_PrÀ�æ`é!D� >@ À�10pt»R76"ÁFù?‚›cìâiŒýZ‘eF¯äv¯Ë(w©4GvGº ”[ªJp÷Ö{h ¥ëu CPéÿБÀ +0·P»à’00ð {–ÀE™;dø~ù±»IÛ»¡rM›¸¢¶»$븑Pñ‹†úâf”˼[[Iy~áà�5$ÜíÖ”Àé(F�ð K°ðà¾`<Î�R  K2Ü)‡ûsÀ¦ôö;¡ÇCˆû›Œ‹±B@¬yÃQARë¿;¹ô2ËË2 �! %0p ÷У¡ð- � pÐ�,ppö ‰0°ÎK 4§î‘– FL™rXÄV;ÄáÆ´[àEüq56S„û}…ÿŒjÆ8w•»$këÜÀ� ðvÀ À" ¿@x‹z(¢Ð „`¶;¸æb®B|ˆË¥ÑS±l�&æuË)˜Ëµì¬ˆ«EðG7ÅO×§1 ¼,´|yQLÍ‹ŽàkP…× 3à®°à „#  Œ  N7J«€ î¡›Qö0±²s8Ömü; }E’�øŒ� €3€Ïòw�øü|†È%ð�”W\R�Âjù›p~ÊпÁ²l¹ 1 H`Ð7 �Ò  �Ÿ0 Vð   r\)Ã_Ò‘ö@´Œÿ TevOløÇ°úË×çÀ(;®¥q�Ò&¹PLÑR\ÓnÞÀE€™ç…L`]1Yöð°‘ÊÌĤE†ø>öG`Ò®Ç ‘_â² !fIÓ¸jZ‹Ô‘ %Pΰ iÀs £Q% ÷VZÇ@–Ø!;'¤D ÑD T†=Ø7|ØuKØ/W·Ò¶!A”ÀþZ·°DˆÝzu›D( !P­Qu ‘iЭ Á @@OàÆ—êžFixí³öرížÈ l ž£Ì×�ÓG`³Ÿ3Ù0P­5#@q›ÀÎ'”7“èÌÎ0 ¨pÿàÒñ ‘òÍð9Ä$Ô ¡ˆZô»ƒFmøJ`äe-÷v€x4ÍÈÕ%ÈOPAÈ iDpU° × pÔÓ‰ [HÐà¢à€„PÞŸÃ%ú‹n.Ãu±ä�Ðá.;ÐÄ4ÈíL£Ë¡ˆ=M1·møŽWŽè–p'ÌðUàhtÅ` q4·° ‚IHf™m ³ñ ÙtÝÞ‚JDL X‰€XO^Ø=¿oó(nÅψ2‡Ñf>ý´óGyš@YIl, –€¤v`fpc@]`Xc ”J0IØVðÃP¨q kq‘ è;ÿL+xR‡aå∩â�0/ ÔNÔ8P$挕±a¢7 Zà }ýÇà6Û2 µ?ÁT«q)ãæè–Ö–˜‘¤@·Q1��>.+ø¢2j8‚ÓÜëâ!€ ”@ ž`P¾×� ¢pœj 0¼UÁ¸ébí-ëÁP°º+T3C&/>8æüèÌѸ+ÓbìMÍ€ £†à V  Œð ΰìá 5À«g@â4 ‰€èš¤nMåĈ팮.^îÐEòn·yÂténBÔÊä2¨ôÓñR á ÆÐ «`–°i�–O`Ÿxf@•‰5C�efÿ@–`€Ð °ðà\å/Äxå_Î…Úøð$Áä±Õsd~Ô�ŒÒÆP¡½Û ‘­^åçî„àÓ¬„qÉíA_°ð‚Ô[_Òq�[ÏÀ3DývöÄôÓpõ¯4CDÍ õLõg¯¯~ùíÞì¨; ´Òc Mî)ÈRÂØz‰G'Ç®päËx?ëSŸi ï.ó¼íBŸÇáK(6’8Iß=fÀì�w?ùLný h4¼±é íµ@’é°þŽn‚ Yô˜§z’¯úQ à$²‘ø°Ó � °÷$¥� ðô#z ýݳ� (€;Ð� páÁÜv�� °�woÜOý ÐÑÆ¯5Ë´ñO�;�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/images/toc.gif����������������������������������������������������������������0100644�0063146�0012731�00000000175�06627574354�016446� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF87a$�$�ð��þþþ���,����$�$��\„©Ëí£d¡Ú‹³¦º{;…â(}æ¶œ*H¶î ¿kÕÎAŒç¢]Ïú ‡‘Nƒuƒ$Ée‚Æ„Nœ©çî ¥’œË›vÄ=xcaÃVfš­¡tóýåH£Ü ñŽ��;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/packages/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015456� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/��������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014454� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/am/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015051� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/arch/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015371� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/arch/bigpic.gif�����������������������������������������������������������0100644�0063146�0012731�00000005035�06627574354�017342� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF87aQ1€�����ÿÿÿ,����Q1�þŒ©Ëí£œ´Ú‹³Þ¼û†âH–扦êʶî ÇòL×öçúÎ÷þ ‡Ä¢ñˆL*—̦ó J§ÔªõŠÍj·Ü®÷ ‹Çä²ùŒN«×ì¶û Ëçôºýާöü¾ÿ(8HXhxˆw¦¸Ø¸Höˆ' FiwYé•IÇ©¹å)ú‰5 gJZ…ê¶š*ÕÊëú$«V;Ët› {°gà›¼Â‹‹Dü{Ü(|±œr\\”ÜlñS -”0Ù\qÝ‹­Eì» ¸ý'Î×Û‡ÌîÎþ®¬ž.O>îS޼KߟNܯv· ¤ô/ Áƒ�ñé+¥áÑ9Ê( \ˆQ0þ„ JJÈìá^è..üxQâs=ZÌ(qZ„|"u¤( %Ì”&©Ìxò¥ÎwÔjªÂÐ,'AŒJ;nTøThB?rËݼy1åj·Ñ={ôÂªÓ î*VÞ¢ÐT[ãmK“Nä•a·-»waäM*3 ß¾.g1Lx$ĉ-nœë1d%Œ­TžÌ6‘æÍœ;{„¹Ëe£CšêÔ±V³¶åú5šÒ*hËbEîÛûbóŽäû·˜Ý&ˆ Ïaœíq3ÉG4_®'8tÑÒ§ƒªný0öì#·s?úêû—ç!È‹w†6WúóªÖSvÏþ|cóãï ,¿}ZúþÜÛOÅM [ýA`{y§ e 6!4ŸMHa…^va†nX’M’9ææù§Xˆ;Œˆ`‰y 8&*N"⇺Ɉ‹D`Hã 6£‰ú8#5æXÂŽÙÄø€mîÕ·8«ôèäWÖÐf£)f¦Ñ•@Mðä‹\NEœ– T™¤˜å“àJHI�¥U m щI¾IÚDø •ÖL^RÃÑœÈò™ ˜ó‘Vbq…è¡)e¡æôߡоb0]ÁO=bIš©£`•e(“ƒ"É�HPTUE™:PTQ•˜ ©*S›ÌJ©ª.­z­» ª+¬fÒ¥£1{þ :hŽêªOgQ ë®…b+ŸÐâÔ«¨jôëNÞÛí+Õ³e²Ý@ÚV¨tf+T»±rR­“×òêíXý;W°ú‚µ¦œ¥â´/JE°TÇÚ í¾õÚn–^ûžð0´N·T% .œq•ŠÐTÛ~¬RU±.åjÂÀžÌ”šµm00Ê–´Ó~,mV¤|éV:“êÎ:ƒê¬WŽrŠf§ðîù¥ÐèBW=꣘f¬qtBGäÆW™µÕ+"ÝÉÍwĶ¿_¯¼µÖgW £Ùm³=¶Ø.¢½6r]‹`$n"rÈwßãwà‚#ò¶›~‚Í *7Öt ãˆ;þÞ¸ž‹‡ôxâ`û© äšgN9äûyúç•CwÝ\nŽ7ë£^^è\ËŽ:„¤Ï~ºs˜w¾ûä¸û^;ìyæÞ:íœx»rÆ?<ò½›¼î±ó>}ôÌ[ÿ:õÍCÏ}élÚþ¼÷¿wo¹ö¢/¾òÛ>úî«~|ÉKO|yíËÿ™i~0éûÇGž¿1‰Šýƒßê„?ýQ-i L ±ÀW½â40iËËžó"X¤ ²Iƒßà}æ§?ôT„â!!ÿ8ˆ:o}  ý*8&~Ç„üs] =ˆ?ΆÙá!×™²0‡CüFonXÄóø°ƒ= É¡óÄÊe2äNþÿ'.\Q8[´ ÛþTņñ€M¢K8F&N1"i„b¥øE¾ñ8]ü×k¨C%Îñ)Ü_™öèE50aœ`U–D4r‘ éW"É-’Q‹¤"$'‰Iö]RƒòZ$å³@Zò‘V¤SÈ1—É Žrܤ]ÉÊT"2Zü:#,«¦Ç[ò•³ÄWÓ29J[–R—¢·^Ö*†Å’ÄäÍ!#ÉË^©ò$­p¢)oó̆u²Cé1Ú�q9ÇÔ˜Ì,#…)ÆfÎ2ŽÁ$'{²9/»Ó¹$%:­aFz*Òžúô%Õ)xKžxäçtÚ"‚þÓ ¯dè2þ‹5ON¶ ÚÌ")Ê„ò ˆ›É§D‰xÏÖ`45ÝÄ5zÒ1”t2+åBKóRr¤4£3µDMMS팧7OO1“Ó89”Ž?¥ÎNCÔî¨EuiSaúT™.•¥QÕéP¹XU¡†´¡[…ÍT!“TËdõ.aÏUSÖ�.€ú¦-Ü:Pή³¡+8g%ºÔ®âŒ[”V®¾Î zM`!HXÁÚä°’œ«b‘ÃXóõó i5JeÃóU¨µ±Žå¨g9ºVµ\Ö-¡½Êh”ÙÄœ–¥µlk1{Vg¾–´©%Ìjë2Û‡Üv@¹ÕÇn#SÛ¾üv ÃÅE¥þÔÇ‚uÖlçGßyR³Ï' 5Ö±ÔYÜY<RRÔŲb{×uj¼o:žÄÛÈÈ:²«›%¯t¡2´³x³cØú¥Ï´\²FwRCé¯4é2YUw²Ð¬rã°ÝëÖ‹*ÏâX¤Üåç–oüÔc ³ßúú÷¿ñldOØ5àçîÒ/c®MúÝ Ï¬b²l˜ÂÂ;b©’¼0öNù0˜¤¿¾j±† ãbb‘e^WgcJÐl¥<³¯…³T´§!峚éðEËÝÓµC!¾²J{‹Û-†16¾žŒEJ^öæY&ÑšƒÜÊမ·o&›S߬Ö:ÛP«g^CY ëþc0´9Eu&s™#:a¿¦ù{†¡î—ùDåHû-´¾Äã¡ zcʪ(P"ôžUó8&80Ô4èLÜÜ{ºÔ Î]‘ŸŒãU×ïŸfZ¢}Êê6ØÙ̸žµ©}½Ð[ןö²¬3Ýjd»×ÊFs³%lÔa;›|d6µwXì8 ûÙ^•6´ïìínsÛˆrÎõ´ÓG¿m_[ÙþöuÌíçv—SÝèf7¼ç}ìu#XÞä]! èÃü›ÒÃxb^ ƒ/úÖ{EuD^p‡»Û£†5ô¥)ŒpU×[àìù}ŸŽO"ãÝ&¹J’×rl*+¢¬Ÿ‹/Ûö®œÄ†ÞþhÉ™ãà¨#ä£Â6%â’.ºÑ'T"¾TZç²]Y£áœg¬ÖÆÐ¤–ú ¥G[]‹ü9j¹D¨ãÛÚØTà=v-Õ­ÿiÌá~XIÓvØ¢µODz  W›ÞÙùÂÕl]ž#Èï€'2×Å}#Â÷9„S>wßa޳–§{JÌ}µÝïà¦E¶Þ7æ 1Á 6zI™Ø!*Y™+W’§ù>Iÿ«˜Þ¢ãM|I>iù;^P©>gå>{ ¾=½÷}ê±rsÚOTíµoúñ_£ø4DŸ÷»Ÿû⎎ýì'èÜï¾÷¿þð‹üä/¿ùÏþô«ýìo¿ûßÿøËþJ(��;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/arch/smallpic.gif���������������������������������������������������������0100644�0063146�0012731�00000003115�06627574354�017706� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF87aQ!€�����ÿÿÿ,����Q!�þŒ©Ëí£œ´Ú‹³Þ¼û†âH–扦êʶî ÇòL×öçúÎ÷þ ‡Ä¢ñˆL*—̦ó J§ÔªõŠÍj·Ü®÷ ‹Çä²ùŒN«×ì¶û Ëçôºýާöü¾ÿ(8HXhxˆw¦¸Ø¸Höˆ' FiwYé•IÇ©¹å)ú‰5 gJZ…ê¶š*ÕÊëú$»P›°g›±»r;»ô‹Ð‹ÑHlqŒ" Œ´À·á,#ÍL䬘œ©Í[A=\ ª‘K øüw€Ýë§Ûg>®íÞ._ë ´lL¹Ë¯þÏN—ÀûšHÐ {÷|äC')"Âg�)NÄe ×ÄþŒ�“M`؇°r-JDøH¶‹VŒ×-ä•‘ÃÔ}³ˆòå·”,7ú„XO¦•_ÇlLÉeÆ~=:=™t¡PUæÉcs½¬ñÎA›¶œU©S§€,‰¶ÉÙ²5Öâ¼ Å-Ûi$¶E‘;†[˜Xãæõëè/-Hx³(\ʰZŠ™ žÙ8ãÈIY¾Œ9³æA”»<î úbèÑ">“Žlú´âÔª³n÷5l¶²gO­m[&îÜ wóçû7³àÂg/žê8òOÊ—Wjî<pôéЧ×Ñjý7öì¹Çrïîñ{k¾âg“/?¾:ú7ê×·iï>¾ðÍôëÛ¿¿ûdù'þòñoÞ~ü•�àŽ'à€#؃§9¸„£I˜… ™"›wW=‡«X؆µeÓ¡FUI�"e£œ§_2@Š š°¢S-¸h£'!#ãŒu9ðNM]Y¥Õ:Û dS?_ I¤‹a±˜"j@*ôÔQ:™´RŽHrÄOGp1õTRþèèã •Ö%bEäI:¥c$\&ÝU(Q6Öæ9¢©©Rv…¥å[PÑùexw®v¦>IDPŽšÈUŽYþ4hIP–¹ ŒûŒÉ)D.QÕKhV)(œv*Ú[˜zЧŸúÀ«’¯nÚ%=¶º³•¬B.ièª!J—¯�±ûþ²s){£°Ã&è,7ÒE ´Ôò8íµÅX«íGÜv~âŽK.IàšÁì¹ø¨K»e¥ë®Hñ ï¼ÚR½øÚ ï¾zø ÀÕô+°^CðÁÍ*œà ;ÌÄKüÅ[œ-ƘhœG—öñ‡ü,ɘ|2Ê¢¨¼2˧¸ü2̬È<3ͱØ|3ÎjŒ¬s=3ò3<=%Ñe m´-IG²ôH7ÔáHýÅÓR[ 5ÖMk½4×I{m4ØD‹4Ù?›Ý3Ú:«3Û6»M3Ü2Ë 3Ý.ÛÍ2Þ*ë2ß&ûM2à! þ1á®1â+n1ã;.1ä þIõP/Vn‹˜S¡ù比è9- ‡®–ä›>9éªgWnë®Û÷ø·�+ŽzÕ²ûK{ì+œ{ä·ïÛ;Äù˜ëá« éÙÍ5º‹c<‡H¦ ä¨1‰³</Ò'u¸lb+­ðÀÁŽ0jZ÷ÛúMóJæÊë;Þ‘3ë®ržˆ>ócíˆGœ€æQ¡Òï½ôyê'¥Ê•ªv%¾–àDyJ°Ìp¾·½0g²Ë§X­#tNS¨“üX§TPi^ºR÷„°A푃~òŸ¥¨@ŒØâT aà .—½b8nxæjG!l¥!ÊÝIÑñ —ÁÝ]çuõà‚¼iQJLÙþ ‹ÖŸŽýî_TœÄƒ•ÂE1B¾ðbo0º¤q cÔÁ(²/ë1oLCïU˜I-‘‰|ì#! D¥aÅpu-šß÷ IÈ.>ÊzIäa8˜¼ý9ò‘ÑÃÎÉ4ÉBFÒ|™¤Q;©ÈP‚ÒLae5iJRŠ2• 0MíX÷IV‚ •²le,kY²RâÒ–´Üå!{éKê3˜çÓ%1“¸Êcrғʦ1› ÀdBÓgÒœføŠwçYs™}9ž$·9½Eê“àôV«"¾r^‰Î|¥uÜT=ªÓCTt'uèhÏèÔÑzó¤æ)û©Íg{ÿ(™iЃ(¡ë\(C2÷–}&$ùtO !ZQþ\#-S‘÷ÐþH4¤$-©IOŠÒ”ªt¥,m©K_ ÓÕ��;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/cam/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015214� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/debug/��������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015542� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/dumpload/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016261� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/env/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015244� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/install/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016122� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/intro/��������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015607� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/lock/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015404� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/log/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015235� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/mp/�����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015070� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/perl/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015416� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/program/������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016123� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/sendmail/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016250� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/simple_tut/���������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016641� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/transapp/�����������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016304� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/ref/txn/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015265� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/sleepycat/��������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015671� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/test/�������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014657� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/docs/utility/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015403� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/examples/��������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014566� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/examples_cxx/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015450� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hash/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013673� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/hsearch/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014365� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/include/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014373� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013671� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/src/��������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014460� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/src/com/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015236� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/src/com/sleepycat/������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�017227� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/src/com/sleepycat/db/���������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�017614� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/java/src/com/sleepycat/examples/���������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�021045� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/libdb_java/������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015025� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/lock/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013700� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/log/�������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013531� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mp/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013364� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mutex/�����������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014112� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/mutex/ARCHIVE/���������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015173� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013371� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_win16/��������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014415� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/os_win32/��������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014413� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/test/������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013727� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/txn/�������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013561� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/db/xa/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013360� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/�����������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014207� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/.sniffdir/�������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�016071� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/.cvsignore�������������������������������������������������������������������0100644�0063146�0012731�00000000055�06772705363�016226� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Makefile *.lo *.la .purify .pure .deps .libs �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/DocumentDB.cc����������������������������������������������������������������0100644�0063146�0012731�00000037215�10055635540�016515� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // DocumentDB.cc // // DocumentDB: This class is the interface to the database of document // references. This database is only used while digging. // An extract of this database is used for searching. // This is because digging requires a different index // than searching. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: DocumentDB.cc,v 1.34 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "DocumentDB.h" #include "Database.h" #include "HtURLCodec.h" #include "IntObject.h" #include "HtZlibCodec.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #ifdef HAVE_STD #include <iostream> #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <iostream.h> #include <fstream.h> #endif /* HAVE_STD */ #include <errno.h> //***************************************************************************** // DocumentDB::DocumentDB() // DocumentDB::DocumentDB() { isopen = 0; isread = 0; // The first document number (NEXT_DOC_ID_RECORD) is used to // store the nextDocID number itself into. We avoid using // an all-0 key for this, mostly for being superstitious // about letting in bugs. nextDocID = NEXT_DOC_ID_RECORD + 1; } //***************************************************************************** // DocumentDB::~DocumentDB() // DocumentDB::~DocumentDB() { Close(); } //***************************************************************************** // int DocumentDB::Open(char *filename, char *indexname, char *headname) // We will attempt to open up an existing document database. If it // doesn't exist, we'll create a new one. If we are succesful in // opening the database, we need to look for our special record // which contains the next document ID to use. // There may also be an URL -> DocID index database to take // care of, as well as a DocID -> DocHead excerpt database. // int DocumentDB::Open(const String& filename, const String& indexfilename, const String& headname) { // If the database is already open, we'll close it // We might be opening this object with a new filename, so we'll be safe Close(); dbf = 0; i_dbf = 0; h_dbf = 0; i_dbf = Database::getDatabaseInstance(DB_HASH); if (i_dbf->OpenReadWrite(indexfilename, 0666) != OK) { cerr << "DocumentDB::Open: " << indexfilename << " " << strerror(errno) << "\n"; return NOTOK; } h_dbf = Database::getDatabaseInstance(DB_HASH); if (h_dbf->OpenReadWrite(headname, 0666) != OK) { cerr << "DocumentDB::Open: " << headname << " " << strerror(errno) << "\n"; return NOTOK; } dbf = Database::getDatabaseInstance(DB_HASH); if (dbf->OpenReadWrite(filename, 0666) == OK) { String data; int specialRecordNumber = NEXT_DOC_ID_RECORD; String key((char *) &specialRecordNumber, sizeof specialRecordNumber); if (dbf->Get(key, data) == OK) { memcpy(&nextDocID, data.get(), sizeof nextDocID); } isopen = 1; return OK; } else { cerr << "DocumentDB::Open: " << filename << " " << strerror(errno) << "\n"; return NOTOK; } } //***************************************************************************** // int DocumentDB::Read(char *filename, char *indexname, char *headname) // We will attempt to open up an existing document database, // and accompanying index database and excerpt database // int DocumentDB::Read(const String& filename, const String& indexfilename , const String& headfilename ) { // If the database is already open, we'll close it // We might be opening this object with a new filename, so we'll be safe Close(); dbf = 0; i_dbf = 0; h_dbf = 0; if (!indexfilename.empty()) { i_dbf = Database::getDatabaseInstance(DB_HASH); if (i_dbf->OpenRead(indexfilename) != OK) return NOTOK; } if (!headfilename.empty()) { h_dbf = Database::getDatabaseInstance(DB_HASH); if (h_dbf->OpenRead(headfilename) != OK) return NOTOK; } dbf = Database::getDatabaseInstance(DB_HASH); if (dbf->OpenRead(filename) == OK) { isopen = 1; isread = 1; return OK; } else return NOTOK; } //***************************************************************************** // int DocumentDB::Close() // Close the database. Before we close it, we first need to update // the special record which keeps track our nextDocID variable. // int DocumentDB::Close() { if (!isopen) return OK; if (!isread) { int specialRecordNumber = NEXT_DOC_ID_RECORD; String key((char *) &specialRecordNumber, sizeof specialRecordNumber); String data((char *) &nextDocID, sizeof nextDocID); dbf->Put(key, data); } if (i_dbf) { i_dbf->Close(); delete i_dbf; i_dbf = 0; } if (h_dbf) { h_dbf->Close(); delete h_dbf; h_dbf = 0; } dbf->Close(); delete dbf; dbf = 0; isopen = 0; isread = 0; return OK; } //***************************************************************************** // int DocumentDB::Add(DocumentRef &doc) // int DocumentDB::Add(DocumentRef &doc) { int docID = doc.DocID(); String temp = 0; doc.Serialize(temp); String key((char *) &docID, sizeof docID); dbf->Put(key, temp); if (h_dbf) { if (doc.DocHeadIsSet()) { temp = HtZlibCodec::instance()->encode(doc.DocHead()); h_dbf->Put(key, temp); } } else // If there was no excerpt index when we write, something is wrong. return NOTOK; if (i_dbf) { temp = doc.DocURL(); i_dbf->Put(HtURLCodec::instance()->encode(temp), key); return OK; } else // If there was no index when we write, something is wrong. return NOTOK; } //***************************************************************************** // int DocumentDB::ReadExcerpt(DocumentRef &ref) // We will attempt to access the excerpt for this ref // int DocumentDB::ReadExcerpt(DocumentRef &ref) { String data; int docID = ref.DocID(); String key((char *) &docID, sizeof docID); if (!h_dbf) return NOTOK; if (h_dbf->Get(key, data) == NOTOK) return NOTOK; ref.DocHead((char*)HtZlibCodec::instance()->decode(data)); return OK; } //***************************************************************************** // DocumentRef *DocumentDB::operator [] (int docID) // DocumentRef *DocumentDB::operator [] (int docID) { String data; String key((char *) &docID, sizeof docID); if (dbf->Get(key, data) == NOTOK) return 0; DocumentRef *ref = new DocumentRef; ref->Deserialize(data); return ref; } //***************************************************************************** // DocumentRef *DocumentDB::operator [] (const String& u) // DocumentRef *DocumentDB::operator [] (const String& u) { String data; String docIDstr; // If there is no index db, then just give up // (do *not* construct a list and traverse it). if (i_dbf == 0) return 0; else { String url(u); if (i_dbf->Get(HtURLCodec::instance()->encode(url), docIDstr) == NOTOK) return 0; } if (dbf->Get(docIDstr, data) == NOTOK) return 0; DocumentRef *ref = new DocumentRef; ref->Deserialize(data); return ref; } //***************************************************************************** // int DocumentDB::Exists(int docID) // int DocumentDB::Exists(int docID) { String key((char *) &docID, sizeof docID); return dbf->Exists(key); } //***************************************************************************** // int DocumentDB::Delete(int docID) // int DocumentDB::Delete(int docID) { String key((char*) &docID, sizeof docID); String data; if (i_dbf == 0 || dbf->Get(key, data) == NOTOK) return NOTOK; DocumentRef *ref = new DocumentRef; ref->Deserialize(data); String url = ref->DocURL(); delete ref; // We have to be really careful about deleting by URL, we might // have a newer "edition" with the same URL and different DocID String docIDstr; String encodedURL = HtURLCodec::instance()->encode(url); if (i_dbf->Get(encodedURL, docIDstr) == NOTOK) return NOTOK; // Only delete if we have a match between what we want to delete // and what's in the database if (key == docIDstr && i_dbf->Delete(encodedURL) == NOTOK) return NOTOK; if (h_dbf == 0 || h_dbf->Delete(key) == NOTOK) return NOTOK; return dbf->Delete(key); } //***************************************************************************** // int DocumentDB::DumpDB(char *filename, int verbose) // Create an extract from our database which can be used by an // external application. The extract will consist of lines with fields // separated by tabs. // // The extract will likely not be sorted by anything in particular // int DocumentDB::DumpDB(const String& filename, int verbose) { DocumentRef *ref; List *descriptions, *anchors; char *strkey; String data; FILE *fl; String docKey(sizeof(int)); if((fl = fopen(filename, "w")) == 0) { perror(form("DocumentDB::DumpDB: opening %s for writing", (const char*)filename)); return NOTOK; } dbf->Start_Get(); while ((strkey = dbf->Get_Next())) { int docID; memcpy(&docID, strkey, sizeof docID); docKey = 0; docKey.append((char *) &docID, sizeof docID); dbf->Get(docKey, data); if (docID != NEXT_DOC_ID_RECORD) { ref = new DocumentRef; ref->Deserialize(data); if (h_dbf) { h_dbf->Get(docKey,data); ref->DocHead((char*)HtZlibCodec::instance()->decode(data)); } fprintf(fl, "%d", ref->DocID()); fprintf(fl, "\tu:%s", ref->DocURL()); fprintf(fl, "\tt:%s", ref->DocTitle()); fprintf(fl, "\ta:%d", ref->DocState()); fprintf(fl, "\tm:%d", (int) ref->DocTime()); fprintf(fl, "\ts:%d", ref->DocSize()); fprintf(fl, "\tH:%s", ref->DocHead()); fprintf(fl, "\th:%s", ref->DocMetaDsc()); fprintf(fl, "\tl:%d", (int) ref->DocAccessed()); fprintf(fl, "\tL:%d", ref->DocLinks()); fprintf(fl, "\tb:%d", ref->DocBackLinks()); fprintf(fl, "\tc:%d", ref->DocHopCount()); fprintf(fl, "\tg:%d", ref->DocSig()); fprintf(fl, "\te:%s", ref->DocEmail()); fprintf(fl, "\tn:%s", ref->DocNotification()); fprintf(fl, "\tS:%s", ref->DocSubject()); fprintf(fl, "\td:"); descriptions = ref->Descriptions(); String *description; descriptions->Start_Get(); int first = 1; while ((description = (String *) descriptions->Get_Next())) { if (!first) fprintf(fl, "\001"); first = 0; fprintf(fl, "%s", description->get()); } fprintf(fl, "\tA:"); anchors = ref->DocAnchors(); String *anchor; anchors->Start_Get(); first = 1; while ((anchor = (String *) anchors->Get_Next())) { if (!first) fprintf(fl, "\001"); first = 0; fprintf(fl, "%s", anchor->get()); } fprintf(fl, "\n"); delete ref; } } fclose(fl); return OK; } //***************************************************************************** // int DocumentDB::LoadDB(const String &filename, int verbose) // Load an extract to our database from an ASCII file // The extract will consist of lines with fields separated by tabs. // The lines need not be sorted in any fashion. // int DocumentDB::LoadDB(const String& filename, int verbose) { FILE *input; String docKey(sizeof(int)); DocumentRef ref; StringList descriptions, anchors; char *token, field; String data; if((input = fopen(filename, "r")) == 0) { perror(form("DocumentDB::LoadDB: opening %s for reading", (const char*)filename)); return NOTOK; } while (data.readLine(input)) { token = strtok(data, "\t"); if (token == NULL) continue; ref.DocID(atoi(token)); if (verbose) cout << "\t loading document ID: " << ref.DocID() << endl; while ( (token = strtok(0, "\t")) ) { field = *token; token += 2; if (verbose > 2) cout << "\t field: " << field; switch(field) { case 'u': // URL ref.DocURL(token); break; case 't': // Title ref.DocTitle(token); break; case 'a': // State ref.DocState(atoi(token)); break; case 'm': // Modified ref.DocTime(atoi(token)); break; case 's': // Size ref.DocSize(atoi(token)); break; case 'H': // Head ref.DocHead(token); break; case 'h': // Meta Description ref.DocMetaDsc(token); break; case 'l': // Accessed ref.DocAccessed(atoi(token)); break; case 'L': // Links ref.DocLinks(atoi(token)); break; case 'b': // BackLinks ref.DocBackLinks(atoi(token)); break; case 'c': // HopCount ref.DocHopCount(atoi(token)); break; case 'g': // Signature ref.DocSig(atoi(token)); break; case 'e': // E-mail ref.DocEmail(token); break; case 'n': // Notification ref.DocNotification(token); break; case 'S': // Subject ref.DocSubject(token); break; case 'd': // Descriptions descriptions.Create(token, '\001'); ref.Descriptions(descriptions); break; case 'A': // Anchors anchors.Create(token, '\001'); ref.DocAnchors(anchors); break; default: break; } } // We must be careful if the document already exists // So we'll delete the old document and add the new one if (Exists(ref.DocID())) { Delete(ref.DocID()); } Add(ref); // If we add a record with an ID past nextDocID, update it if (ref.DocID() > nextDocID) nextDocID = ref.DocID() + 1; descriptions.Destroy(); anchors.Destroy(); } fclose(input); return OK; } //***************************************************************************** // List *DocumentDB::URLs() // Return a list of all the URLs in the database // Only available when there's an URL -> DocID index db handy. // List *DocumentDB::URLs() { List *list = new List; char *coded_key; if (i_dbf == 0) return 0; i_dbf->Start_Get(); while ((coded_key = i_dbf->Get_Next())) { String *key = new String(HtURLCodec::instance()->decode(coded_key)); list->Add(key); } return list; } //***************************************************************************** // List *DocumentDB::DocIDs() // Return a list of all the DocIDs in the database // List *DocumentDB::DocIDs() { List *list = new List; char *key; dbf->Start_Get(); while ((key = dbf->Get_Next())) { int docID; memcpy (&docID, key, sizeof docID); if (docID != NEXT_DOC_ID_RECORD) list->Add(new IntObject(docID)); } return list; } //***************************************************************************** // private // int readLine(FILE *in, String &line) // int readLine(FILE *in, String &line) { char buffer[2048]; int length; line = 0; while (fgets(buffer, sizeof(buffer), in)) { length = strlen(buffer); if (buffer[length - 1] == '\n') { // // A full line has been read. Return it. // line << buffer; line.chop('\n'); return 1; } else { // // Only a partial line was read. Append it to the line // and read some more. // line << buffer; } } return line.length() > 0; } // End of DocumentDB.cc �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/DocumentDB.h�����������������������������������������������������������������0100644�0063146�0012731�00000005114�10055635540�016350� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // DocumentDB.h // // DocumentDB: This class is the interface to the database of document // references. This database is only used while digging. // An extract of this database is used for searching. // This is because digging requires a different index // than searching. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: DocumentDB.h,v 1.14 2004/05/28 13:15:12 lha Exp $ // #ifndef _DocumentDB_h_ #define _DocumentDB_h_ #include "DocumentRef.h" #include "List.h" #include "Database.h" #include "IntObject.h" /* This is where the running document counter is stored. The first real document number is the next. */ #define NEXT_DOC_ID_RECORD 1 class DocumentDB { public: // // Construction/Destruction // DocumentDB(); ~DocumentDB(); // // Standard database operations // int Open(const String& filename, const String& indexfilename, const String& headname); int Read(const String& filename, const String& indexfilename = 0, const String& headfilename = 0); int Close(); int Add(DocumentRef &); // These do not read in the excerpt DocumentRef *operator [] (int DocID); DocumentRef *operator [] (const String& url); // You must call this to read the excerpt int ReadExcerpt(DocumentRef &); int Exists(int DocID); int Delete(int DocID); // // The database keeps track of document ids. Here is a way to get // the next document id. // int NextDocID() {return nextDocID++;} // And here's a way to increment NextDocID after adding lots of records // (for example when merging databases!) void IncNextDocID (int next) {nextDocID += next;} // // We will need to be able to iterate over the complete database. // // This returns a list of all the URLs, as String * List *URLs(); // This returns a list of all the DocIDs, as IntObject * List *DocIDs(); // Dump the database out to an ASCII text file int DumpDB(const String& filename, int verbose = 0); // Read in the database from an ASCII text file // (created by DumpDB) int LoadDB(const String& filename, int verbose = 0); private: Database *dbf; Database *i_dbf; Database *h_dbf; int isopen; int isread; int nextDocID; }; #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/DocumentRef.cc���������������������������������������������������������������0100644�0063146�0012731�00000051072�10055635540�016741� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // DocumentRef.cc // // DocumentRef: Reference to an indexed document. Keeps track of all // information stored on the document, either by the dig // or temporary search information. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: DocumentRef.cc,v 1.53 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "DocumentRef.h" #include "good_strtok.h" #include "WordRecord.h" #include "HtConfiguration.h" #include "HtURLCodec.h" #include "WordType.h" #include "HtWordReference.h" #include <stdlib.h> #include <ctype.h> #ifdef HAVE_STD #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <fstream.h> #endif /* HAVE_STD */ // extern HtConfiguration config; //***************************************************************************** // DocumentRef::DocumentRef() // DocumentRef::DocumentRef() { Clear(); } //***************************************************************************** // DocumentRef::~DocumentRef() // DocumentRef::~DocumentRef() { } //***************************************************************************** // void DocumentRef::Clear() // void DocumentRef::Clear() { docID = 0; docURL = 0; docTime = 0; docAccessed = 0; docHead = 0; docHeadIsSet = 0; docMetaDsc = 0; docTitle = 0; descriptions.Destroy(); docState = Reference_normal; docSize = 0; docLinks = 0; docBackLinks = 0; docAnchors.Destroy(); docHopCount = 0; docSig = 0; docEmail = 0; docNotification = 0; docSubject = 0; docScore = 0; docAnchor = 0; } //***************************************************************************** // void DocumentRef::DocState(int s) // void DocumentRef::DocState(int s) { // You can't easily do this with a cast, so we'll use a switch switch(s) { case 0: docState = Reference_normal; break; case 1: docState = Reference_not_found; break; case 2: docState = Reference_noindex; break; case 3: docState = Reference_obsolete; break; } } enum { DOC_ID, // 0 DOC_TIME, // 1 DOC_ACCESSED, // 2 DOC_STATE, // 3 DOC_SIZE, // 4 DOC_LINKS, // 5 DOC_IMAGESIZE, // 6 -- No longer used DOC_HOPCOUNT, // 7 DOC_URL, // 8 DOC_HEAD, // 9 DOC_TITLE, // 10 DOC_DESCRIPTIONS, // 11 DOC_ANCHORS, // 12 DOC_EMAIL, // 13 DOC_NOTIFICATION, // 14 DOC_SUBJECT, // 15 DOC_STRING, // 16 DOC_METADSC, // 17 DOC_BACKLINKS, // 18 DOC_SIG // 19 }; // Must be powers of two never reached by the DOC_... enums. #define CHARSIZE_MARKER_BIT 64 #define SHORTSIZE_MARKER_BIT 128 //***************************************************************************** // void DocumentRef::Serialize(String &s) // Convert all the data in the object to a string. // The data is in the string is tagged with // void DocumentRef::Serialize(String &s) { int length; String *str; // // The following macros make the serialization process a little easier // to follow. Note that if an object to be serialized has the default // value for this class, it it NOT serialized. This means that // storage will be saved... // #define addnum(id, out, var) \ if (var != 0) \ { \ if (var <= (unsigned char) ~1) \ { \ unsigned char _tmp = var; \ out << (char) (id | CHARSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ else if (var <= (unsigned short int) ~1) \ { \ unsigned short int _tmp = var; \ out << (char) (id | SHORTSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ else \ { \ out << (char) id; \ out.append((char *) &var, sizeof(var)); \ } \ } #define addstring(id, out, str) \ if (str.length()) \ { \ length = str.length(); \ if (length <= (unsigned char) ~1) \ { \ unsigned char _tmp = length; \ out << (char) (id | CHARSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ else if (length <= (unsigned short int) ~1) \ { \ unsigned short int _tmp = length; \ out << (char) (id | SHORTSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ else \ { \ out << (char) id; \ out.append((char *) &length, sizeof(length)); \ } \ out.append(str); \ } // To keep compatibility with old databases, don't bother // with long lists at all. Bloat the size for long strings with // one char to just keep a ~1 marker since we don't know the // endianness; we don't know where to put a endian-safe // size-marker, and we probably rather want the full char to // keep the length. Only strings shorter than (unsigned char) ~1 // will be "optimized"; trying to optimize strings that fit in // (unsigned short) does not seem to give anything substantial. #define addlist(id, out, list) \ if (list.Count()) \ { \ length = list.Count(); \ if (length <= (unsigned short int) ~1) \ { \ if (length <= (unsigned char) ~1) \ { \ unsigned char _tmp = length; \ out << (char) (id | CHARSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ else \ { \ unsigned short int _tmp = length; \ out << (char) (id | SHORTSIZE_MARKER_BIT); \ out.append((char *) &_tmp, sizeof(_tmp)); \ } \ list.Start_Get(); \ while ((str = (String *) list.Get_Next())) \ { \ length = str->length(); \ if (length < (unsigned char) ~1) \ { \ unsigned char _tmp = length; \ out.append((char*) &_tmp, sizeof(_tmp)); \ } \ else \ { \ unsigned char _tmp = ~1; \ out.append((char*) &_tmp, sizeof(_tmp)); \ out.append((char*) &length, sizeof(length)); \ } \ out.append(*str); \ } \ } \ else \ { \ out << (char) id; \ out.append((char *) &length, sizeof(length)); \ list.Start_Get(); \ while ((str = (String *) list.Get_Next())) \ { \ length = str->length(); \ out.append((char*) &length, sizeof(length)); \ out.append(*str); \ } \ } \ } addnum(DOC_ID, s, docID); addnum(DOC_TIME, s, docTime); addnum(DOC_ACCESSED, s, docAccessed); addnum(DOC_STATE, s, docState); addnum(DOC_SIZE, s, docSize); addnum(DOC_LINKS, s, docLinks); addnum(DOC_BACKLINKS, s, docBackLinks); addnum(DOC_HOPCOUNT, s, docHopCount); addnum(DOC_SIG, s, docSig); // Use a temporary since the addstring macro will evaluate // this multiple times. String tmps = HtURLCodec::instance()->encode(docURL); addstring(DOC_URL, s, tmps); // This is done in the DocumentDB code through the excerpt database // addstring(DOC_HEAD, s, docHead); addstring(DOC_METADSC, s, docMetaDsc); addstring(DOC_TITLE, s, docTitle); addlist(DOC_DESCRIPTIONS, s, descriptions); addlist(DOC_ANCHORS, s, docAnchors); addstring(DOC_EMAIL, s, docEmail); addstring(DOC_NOTIFICATION, s, docNotification); addstring(DOC_SUBJECT, s, docSubject); } //***************************************************************************** // void DocumentRef::Deserialize(String &stream) // Extract the contents of our private variables from the given // character string. The character string is expected to have been // created using the Serialize member. // void DocumentRef::Deserialize(String &stream) { Clear(); char *s = stream.get(); char *end = s + stream.length(); int length; int count; int i; int x; int throwaway; // As the name sounds--used for old fields String *str; // There is a problem with getting a numeric value into a // numeric unknown type that may be an enum (the other way // around is simply by casting (int)). // Supposedly the enum incarnates as a simple type, so we can // just check the size and copy the bits. #define MEMCPY_ASSIGN(to, from, type) \ do { \ type _tmp = (type) (from); \ memcpy((char *) &(to), (char *) &_tmp, sizeof(to)); \ } while (0) #define NUM_ASSIGN(to, from) \ do { \ if (sizeof(to) == sizeof(unsigned long int)) \ MEMCPY_ASSIGN(to, from, unsigned long int); \ else if (sizeof(to) == sizeof(unsigned int)) \ MEMCPY_ASSIGN(to, from, unsigned int); \ else if (sizeof(to) == sizeof(unsigned short int)) \ MEMCPY_ASSIGN(to, from, unsigned short int); \ else if (sizeof(to) == sizeof(unsigned char)) \ MEMCPY_ASSIGN(to, from, unsigned char); \ /* else fatal error here? */ \ } while (0) #define getnum(type, in, var) \ if (type & CHARSIZE_MARKER_BIT) \ { \ NUM_ASSIGN(var, *(unsigned char *) in); \ in += sizeof(unsigned char); \ } \ else if (type & SHORTSIZE_MARKER_BIT) \ { \ unsigned short int _tmp0; \ memcpy((char *) &_tmp0, (char *) (in), sizeof(unsigned short)); \ NUM_ASSIGN(var, _tmp0); \ in += sizeof(unsigned short int); \ } \ else \ { \ memcpy((char *) &var, in, sizeof(var)); \ in += sizeof(var); \ } #define getstring(type, in, str) \ getnum(type, in, length); \ str = 0; \ str.append(in, length); \ in += length #define getlist(type, in, list) \ getnum(type, in, count); \ if (type & (CHARSIZE_MARKER_BIT | SHORTSIZE_MARKER_BIT)) \ { \ for (i = 0; i < count; i++) \ { \ unsigned char _tmp = *(unsigned char *) in; \ in += sizeof(_tmp); \ if (_tmp < (unsigned char) ~1) \ length = _tmp; \ else \ getnum(~(CHARSIZE_MARKER_BIT | SHORTSIZE_MARKER_BIT), in, \ length); \ str = new String; \ str->append(in, length); \ list.Add(str); \ in += length; \ } \ } \ else \ { \ for (i = 0; i < count; i++) \ { \ getnum(~(CHARSIZE_MARKER_BIT | SHORTSIZE_MARKER_BIT), in, \ length); \ str = new String; \ str->append(in, length); \ list.Add(str); \ in += length; \ } \ } while (s < end) { x = (unsigned char) *s++; switch (x & ~(CHARSIZE_MARKER_BIT | SHORTSIZE_MARKER_BIT)) { case DOC_ID: getnum(x, s, docID); break; case DOC_TIME: getnum(x, s, docTime); break; case DOC_ACCESSED: getnum(x, s, docAccessed); break; case DOC_STATE: getnum(x, s, docState); break; case DOC_SIZE: getnum(x, s, docSize); break; case DOC_IMAGESIZE: // No longer used getnum(x, s, throwaway); break; case DOC_LINKS: getnum(x, s, docLinks); break; case DOC_HOPCOUNT: getnum(x, s, docHopCount); break; case DOC_BACKLINKS: getnum(x, s, docBackLinks); break; case DOC_SIG: getnum(x, s, docSig); break; case DOC_URL: { // Use a temporary since the addstring macro will evaluate // this multiple times. String tmps; getstring(x, s, tmps); docURL = HtURLCodec::instance()->decode(tmps); } break; case DOC_HEAD: getstring(x, s, docHead); docHeadIsSet = 1; break; case DOC_METADSC: getstring(x, s, docMetaDsc); break; case DOC_TITLE: getstring(x, s, docTitle); break; case DOC_DESCRIPTIONS: getlist(x, s, descriptions); break; case DOC_ANCHORS: getlist(x, s, docAnchors); break; case DOC_EMAIL: getstring(x, s, docEmail); break; case DOC_NOTIFICATION: getstring(x, s, docNotification); break; case DOC_SUBJECT: getstring(x, s, docSubject); break; case DOC_STRING: // This is just a debugging string. Ignore it. break; default: cerr << "BAD TAG IN SERIALIZED DATA: " << x << endl; return; } } } //***************************************************************************** // void DocumentRef::AddDescription(char *d, HtWordList &words) // void DocumentRef::AddDescription(const char *d, HtWordList &words) { if (!d || !*d) return; while (isspace(*d)) d++; if (!d || !*d) return; String desc = d; desc.chop(" \t"); // Add the description text to the word database with proper factor // Do this first because we may have reached the max_description limit // This also ensures we keep the proper weight on descriptions // that occur many times // Parse words. char *p = desc; HtConfiguration* config= HtConfiguration::config(); static int minimum_word_length = config->Value("minimum_word_length", 3); static int max_descriptions = config->Value("max_descriptions", 5); String word; HtWordReference wordRef; wordRef.Flags(FLAG_LINK_TEXT); wordRef.DocID(docID); while (*p) { // Reset contents before adding chars each round. word = 0; while (*p && HtIsWordChar(*p)) word << *p++; HtStripPunctuation(word); if (word.length() >= minimum_word_length) { // The wordlist takes care of lowercasing; just add it. wordRef.Location((p - (char*)desc) - word.length()); wordRef.Word(word); words.Replace(wordRef); } while (*p && !HtIsStrictWordChar(*p)) p++; } // And let's flush the words! (nice comment hu :-) words.Flush(); // Now are we at the max_description limit? if (descriptions.Count() >= max_descriptions) return; descriptions.Start_Get(); String *description; while ((description = (String *) descriptions.Get_Next())) { if (mystrcasecmp(description->get(), (char*)desc) == 0) return; } descriptions.Add(new String(desc)); } //***************************************************************************** // void DocumentRef::AddAnchor(char *a) // void DocumentRef::AddAnchor(const char *a) { if (a) docAnchors.Add(new String(a)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/DocumentRef.h����������������������������������������������������������������0100644�0063146�0012731�00000013456�10055635540�016607� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // DocumentRef.h // // DocumentRef: Reference to an indexed document. Keeps track of all // information stored on the document, either by the dig // or temporary search information. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: DocumentRef.h,v 1.29 2004/05/28 13:15:12 lha Exp $ // #ifndef _DocumentRef_h_ #define _DocumentRef_h_ #include "htString.h" #include "List.h" #include "HtWordList.h" #include <time.h> enum ReferenceState { Reference_normal, Reference_not_found, Reference_noindex, Reference_obsolete }; class DocumentRef : public Object { public: // // Construction/Destruction // DocumentRef(); ~DocumentRef(); // // A DocumentRef can read itself from a character string and // convert itself into a character string // void Serialize(String &s); void Deserialize(String &s); // // Access to the members // int DocID() {return docID;} char *DocURL() {return docURL;} time_t DocTime() {return docTime;} char *DocTitle() {return docTitle;} char *DocAuthor() {return docAuthor;} char *DocHead() {return docHead;} int DocHeadIsSet() {return docHeadIsSet;} char *DocMetaDsc() {return docMetaDsc;} time_t DocAccessed() {return docAccessed;} int DocLinks() {return docLinks;} int DocBackLinks() {return docBackLinks;} List *Descriptions() {return &descriptions;} ReferenceState DocState() {return docState;} int DocSize() {return docSize;} List *DocAnchors() {return &docAnchors;} double DocScore() {return docScore;} int DocSig() {return docSig;} int DocAnchor() {return docAnchor;} int DocHopCount() {return docHopCount;} char *DocEmail() {return docEmail;} char *DocNotification() {return docNotification;} char *DocSubject() {return docSubject;} void DocID(int d) {docID = d;} void DocURL(const char *u) {docURL = u;} void DocTime(time_t t) {docTime = t;} void DocTitle(const char *t) {docTitle = t;} void DocAuthor(const char *a) {docAuthor = a;} void DocHead(const char *h) {docHeadIsSet = 1; docHead = h;} void DocMetaDsc(const char *md) {docMetaDsc = md;} void DocAccessed(time_t t) {docAccessed = t;} void DocLinks(int l) {docLinks = l;} void DocBackLinks(int l) {docBackLinks = l;} void Descriptions(List &l) {descriptions = l;} void AddDescription(const char *d, HtWordList &words); void DocState(ReferenceState s) {docState = s;} void DocState(int s); void DocSize(int s) {docSize = s;} void DocSig(int s) {docSig = s;} void DocAnchors(List &l) {docAnchors = l;} void AddAnchor(const char *a); void DocScore(double s) {docScore = s;} void DocAnchor(int a) {docAnchor = a;} void DocHopCount(int h) {docHopCount = h;} void DocEmail(const char *e) {docEmail = e;} void DocNotification(const char *n) {docNotification = n;} void DocSubject(const char *s) {docSubject = s;} void Clear(); // Reset everything protected: // // These values will be stored when serializing // // This is the index number of the document in the database. int docID; // This is the URL of the document. String docURL; // This is the time specified in the document's header // Usually that's the last modified time, for servers that return it. time_t docTime; // This is the time that the last retrieval occurred. time_t docAccessed; // This is the stored excerpt of the document, just text. String docHead; // This indicates if the stored excerpt of the document has been set. int docHeadIsSet; // This is the document-specified description. // For HTML, that's the META description tag. String docMetaDsc; // This is the title of the document. String docTitle; // This is the author of the document, as specified in meta information String docAuthor; // This is a list of Strings, the text of links pointing to this document. // (e.g. <a href="docURL">description</a> List descriptions; // This is the state of the document--modified, normal, etc. ReferenceState docState; // This is the size of the original document. int docSize; // This is a count of the links in the document (outgoing links). int docLinks; // This is a count of the links to the document (incoming links). int docBackLinks; // This is a list of the anchors in the document (i.e. <A NAME=...) List docAnchors; // This is a count of the number of hops from start_urls to here. int docHopCount; // This is a signature of the document. (e.g. md5sum, checksum...) // This is currently unused. long int docSig; // // The following values are for the email notification of expiration // // This is the email destination for htnotify. String docEmail; // This is the date that htnotify should use as comparison. String docNotification; // This is the subject of the email sent out by htnotify. String docSubject; // // This is used for searching and is not stored in the database // // This is the current score of this document. double docScore; // This is the nearest anchor for the search word. int docAnchor; }; #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtConfiguration.cc�����������������������������������������������������������0100644�0063146�0012731�00000016561�10055635540�017635� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtConfiguration.cc // // HtConfiguration: extends Configuration class // to implement Apache-style config. Uses parser // generated by Bison from conf_parser.yxx // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtConfiguration.cc,v 1.10 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <stdio.h> #include "HtConfiguration.h" #include <stdlib.h> #ifdef HAVE_STD #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <fstream.h> #endif /* HAVE_STD */ #include <stdlib.h> #include <ctype.h> #include <locale.h> //******************************************************************** // Add complex entry to the configuration // void HtConfiguration::Add(const char *name, const char *value, Configuration *aList) { if (strcmp("url",name)==0) { //add URL entry URL tmpUrl(strdup(value)); Dictionary *paths= NULL; if ( (paths=(Dictionary *)dcUrls[tmpUrl.host()]) ) { paths->Add(tmpUrl.path(),aList); } else { paths=new Dictionary(); paths->Add(tmpUrl.path(),aList); dcUrls.Add(tmpUrl.host(),paths); } } else { Object *treeEntry=dcBlocks[name]; if (treeEntry!=NULL) { ((Dictionary *)treeEntry)->Add(value,aList); } else { treeEntry=new Dictionary(16); ((Dictionary *)treeEntry)->Add(value,aList); dcBlocks.Add(name, treeEntry); } } } //********************************************************************* const String HtConfiguration::Find(const char *blockName,const char *name,const char *value) const { if (!(blockName && name && value) ) return String(); union { void *ptr; Object *obj; Dictionary *dict; HtConfiguration *conf; } tmpPtr; String chr; if (strcmp("url",blockName)==0) { // URL needs special compare URL paramUrl(name); // split URL to compare separatly host and path chr=Find(¶mUrl,value); if (chr[0]!=0) { return chr; } } else { // end "server" tmpPtr.obj=dcBlocks.Find(blockName); if (tmpPtr.ptr) { tmpPtr.obj = tmpPtr.dict->Find(name); if (tmpPtr.ptr) { chr = tmpPtr.conf->Find(value); if (chr[0] != 0) return chr; } } } // If this parameter is defined in global then return it chr=Find(value); if (chr[0]!=0) { return chr; } #ifdef DEBUG cerr << "Could not find configuration option " << blockName<<":" <<name<<":"<<value<< "\n"; #endif return String(); } //********************************************************************* // const String HtConfiguration::Find(URL *aUrl, const char *value) const { if (!aUrl) return String(); Dictionary *tmpPtr=(Dictionary *)dcUrls.Find( aUrl->host() ); if (tmpPtr) { // We've got such host in config tmpPtr->Start_Get(); // Try to find best matched URL // struct candidate { Object *obj; unsigned int len; String value; } candidate; candidate.len=0; String returnValue; // Begin competition: which URL is better? // // TODO: move this loop into Dictionary // (or create Dictionary::FindBest ?) // or make url list sorted ? // or implement abstract Dictionary::Compare? const char *strParamUrl=(const char *)aUrl->path(); char* confUrl= NULL; bool found(false); while ((confUrl=tmpPtr->Get_Next()) ) { if (strncmp(confUrl,strParamUrl,strlen(confUrl))==0 && (strlen(confUrl)>=candidate.len)) { // it seems this URL match better candidate.obj=tmpPtr->Find(confUrl); // Let's see if it exists if (((HtConfiguration *)candidate.obj)->Exists(value)) { // yes, it has! We've got new candidate. candidate.value=((HtConfiguration *)candidate.obj)->Find(value); returnValue=candidate.value; candidate.len=candidate.value.length(); found = true; } } } if (found) return ParsedString(returnValue).get(dcGlobalVars); } return Find(value); } //********************************************************************* int HtConfiguration::Value(const char *blockName, const char *name, const char *value, int default_value ) { int retValue=default_value; String tmpStr=Find(blockName,name,value); if (tmpStr[0]!=0) { retValue=atoi(tmpStr.get()); } return retValue; } //********************************************************************* double HtConfiguration::Double(const char *blockName, const char *name, const char *value, double default_value ) { double retValue=default_value; String tmpStr=Find(blockName,name,value); if (tmpStr[0]!=0) { retValue=atof(tmpStr.get()); } return retValue; } //********************************************************************* int HtConfiguration::Boolean(const char *blockName, const char *name, const char *value, int default_value ) { int retValue=default_value; String tmpStr=Find(blockName,name,value); if (tmpStr[0]!=0) { if (mystrcasecmp((char*)tmpStr, "true") == 0 || mystrcasecmp((char*)tmpStr, "yes") == 0 || mystrcasecmp((char*)tmpStr, "1") == 0) retValue = 1; else if (mystrcasecmp((char*)tmpStr, "false") == 0 || mystrcasecmp((char*)tmpStr, "no") == 0 || mystrcasecmp((char*)tmpStr, "0") == 0) retValue = 0; } return retValue; } //********************************************************************* //********************************************************************* int HtConfiguration::Value(URL *aUrl, const char *value, int default_value ) { int retValue=default_value; String tmpStr=Find(aUrl,value); if (tmpStr[0]!=0) { retValue=atoi(tmpStr.get()); } return retValue; } //********************************************************************* double HtConfiguration::Double(URL *aUrl,const char *value, double default_value ) { double retValue=default_value; String tmpStr=Find(aUrl,value); if (tmpStr[0]!=0) { retValue=atof(tmpStr.get()); } return retValue; } //********************************************************************* int HtConfiguration::Boolean(URL *aUrl,const char *value, int default_value ) { int retValue=default_value; String tmpStr=Find(aUrl,value); if (tmpStr[0]!=0) { if (mystrcasecmp((char*)tmpStr, "true") == 0 || mystrcasecmp((char*)tmpStr, "yes") == 0 || mystrcasecmp((char*)tmpStr, "1") == 0) retValue = 1; else if (mystrcasecmp((char*)tmpStr, "false") == 0 || mystrcasecmp((char*)tmpStr, "no") == 0 || mystrcasecmp((char*)tmpStr, "0") == 0) retValue = 0; } return retValue; } //********************************************************************* // int HtConfiguration::Read(const String& filename) { extern FILE* yyin; extern int yyparse(void*); if ((yyin=fopen(filename,"r"))==NULL) return NOTOK; FileName=filename; // need to be before yyparse() because is used in it yyparse(this); fclose(yyin); return OK; } HtConfiguration* HtConfiguration::_config= NULL; HtConfiguration* const HtConfiguration::config() { if(_config == NULL) { _config= new HtConfiguration(); } return _config; } �����������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtConfiguration.h������������������������������������������������������������0100644�0063146�0012731�00000006207�10055635540�017473� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtConfiguration.h // // HtConfiguration: extends Configuration class // to implement Apache-style config. Uses parser // generated by Bison from conf_parser.yxx // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtConfiguration.h,v 1.5 2004/05/28 13:15:12 lha Exp $ // #ifndef _HtConfiguration_h_ #define _HtConfiguration_h_ #include"Configuration.h" #include "ParsedString.h" #include "URL.h" class HtConfiguration : public Configuration { public: const String Find(const String& name) const {return(Configuration::Find(name));} int Value(const String& name, int default_value = 0) const {return(Configuration::Value (name,default_value));} double Double(const String& name, double default_value = 0) const {return(Configuration::Double (name,default_value));} int Boolean(const String& name, int default_value = 0) const {return(Configuration::Boolean(name,default_value));} void Add(const String& str){Configuration::Add(str);} void Add(const String& name, const String& value) {Configuration::Add(name,value);} void AddParsed(const String& name, const String& value) {Configuration::AddParsed(name,value);} void Add(const char *name, const char *value, Configuration *aList); const String Find(URL *aUrl, const char *value) const; const String Find(const char *blockName, const char *name, const char *value) const; int Value(const char *blockName, const char *name, const char *value, int default_value = 0); double Double(const char *blockName, const char *name, const char *value, double default_value = 0); int Boolean(const char *blockName, const char *name, const char *value, int default_value = 0); int Value(URL *aUrl,const char *value,int default_value = 0); double Double(URL *aUrl,const char *value,double default_value = 0); int Boolean(URL *aUrl,const char *value,int default_value = 0); inline String ParseString(const char*) const; // parse ${var} string String getFileName() const { return FileName; } // // We need some way of reading in the database from a configuration file // ... this uses the parser virtual int Read(const String& filename); protected: Dictionary dcBlocks; Dictionary dcUrls; String FileName; // config's file name public: HtConfiguration():Configuration() {;} HtConfiguration(const HtConfiguration& config) : Configuration(config), dcBlocks(config.dcBlocks), dcUrls(config.dcUrls) { ; } static HtConfiguration* const config(); private: static HtConfiguration* _config; }; //******************************************************************** // inline String HtConfiguration::ParseString(const char *str) const { return ParsedString(str).get(dcGlobalVars); } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtSGMLCodec.cc���������������������������������������������������������������0100644�0063146�0012731�00000007332�10057144775�016531� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtSGMLCodec.cc // // HtSGMLCodec: A Specialized HtWordCodec class to convert between SGML // ISO 8859-1 entities and high-bit characters. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtSGMLCodec.cc,v 1.6 2004/06/01 18:25:01 angusgb Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtSGMLCodec.h" #include "HtConfiguration.h" // Constructor: parses the appropriate parameters using the // encapsulated HtWordCodec class. // Only used in privacy. HtSGMLCodec::HtSGMLCodec() { HtConfiguration* config= HtConfiguration::config(); int translate_latin1 = config->Boolean("translate_latin1", 1); StringList *myTextFromList = new StringList(); // For &foo; StringList *myNumFromList = new StringList(); // For &#nnn; StringList *myToList = new StringList(); String myTextFromString(770); // Full text list // Is this really the best way to do this? if (!translate_latin1 ) { myTextFromString = " "; } else { // this set has been slightly modified in order to manage the € entity // the resulting charset is therefore a ISO-8859-1 partially moved to ISO-8859-15 myTextFromString = " |¡|¢|£|€|¥|¦|§|"; myTextFromString << "¨|©|ª|«|¬|­|®|¯|°|"; myTextFromString << "±|²|³|´|µ|¶|·|¸|"; myTextFromString << "¹|º|»|¼|½|¾|¿|À|"; myTextFromString << "Á|Â|Ã|Ä|Å|Æ|Ç|È|"; myTextFromString << "É|Ê|Ë|Ì|Í|Î|Ï|Ð|"; myTextFromString << "Ñ|Ò|Ó|Ô|Õ|Ö|×|Ø|"; myTextFromString << "Ù|Ú|Û|Ü|Ý|Þ|ß|à|"; myTextFromString << "á|â|ã|ä|å|æ|ç|è|"; myTextFromString << "é|ê|ë|ì|í|î|ï|ð|"; myTextFromString << "ñ|ò|ó|ô|õ|ö|÷|ø|"; myTextFromString << "ù|ú|û|ü|ý|þ|ÿ"; } myTextFromList->Create(myTextFromString, '|'); for (int i = 160; i <= 255; i++) { String temp = 0; temp << (char) i; myToList->Add(temp); temp = 0; temp << "&#" << i << ";"; myNumFromList->Add(temp); if (!translate_latin1 ) break; } // Now let's take care of the low-bit characters with encodings. myTextFromList->Add("""); myToList->Add("\""); myNumFromList->Add("""); myTextFromList->Add("&"); myToList->Add("&"); myNumFromList->Add("&"); myTextFromList->Add("<"); myToList->Add("<"); myNumFromList->Add("<"); myTextFromList->Add(">"); myToList->Add(">"); myNumFromList->Add(">"); myTextWordCodec = new HtWordCodec(myTextFromList, myToList, '|'); myNumWordCodec = new HtWordCodec(myNumFromList, myToList, '|'); } HtSGMLCodec::~HtSGMLCodec() { delete myTextWordCodec; delete myNumWordCodec; } // Supposedly used as HtSGMLCodec::instance()->ErrMsg() // to check if HtWordCodec liked what was fed. String& HtSGMLCodec::ErrMsg() { return myErrMsg; } // Canonical singleton interface. HtSGMLCodec * HtSGMLCodec::instance() { static HtSGMLCodec *_instance = 0; if (_instance == 0) { _instance = new HtSGMLCodec(); } return _instance; } // End of HtSGMLCodec.cc ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtSGMLCodec.h����������������������������������������������������������������0100644�0063146�0012731�00000004177�10055635540�016370� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtSGMLCodec.h // // HtSGMLCodec: A Specialized HtWordCodec class to convert between SGML // ISO 8859-1 entities and high-bit characters. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtSGMLCodec.h,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifndef __HtSGMLCodec_h #define __HtSGMLCodec_h #include "HtWordCodec.h" // Container for a HtWordCodec (not subclassed from it due to // portability-problems using initializers). // Not for subclassing. class HtSGMLCodec { public: static HtSGMLCodec *instance(); virtual ~HtSGMLCodec(); // Similar to the HtWordCodec class. Each string may contain // zero or more of words from the lists. Here we need to run // it through two codecs because we might have two different forms inline String encode(const String &uncoded) const { return myTextWordCodec->encode(myNumWordCodec->encode(uncoded)); } // But we only want to decode into one form i.e. &foo; NOT &#nnn; String decode(const String &coded) const { return myTextWordCodec->decode(coded); } // If an error was discovered during the parsing of // entities, this returns an error message String& ErrMsg(); // egcs-1.1 (and some earlier versions) always erroneously // warns (even without warning flags) about classic singleton // constructs ("only defines private constructors and has no // friends"). Rather than adding autoconf tests to shut these // versions up with -Wno-ctor-dtor-privacy, we fake normal // conformism for it here (the minimal effort). friend void my_friend_Harvey__a_faked_friend_function(); private: // Hide default-constructor, copy-constructor and assignment // operator, making this a singleton. HtSGMLCodec(); HtSGMLCodec(const HtSGMLCodec &); void operator= (const HtSGMLCodec &); HtWordCodec *myTextWordCodec; // For &foo; HtWordCodec *myNumWordCodec; // For &#foo; String myErrMsg; }; #endif /* __HtSGMLCodec_h */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtURLCodec.cc����������������������������������������������������������������0100644�0063146�0012731�00000003035�10055635540�016416� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtURLCodec.cc // // HtURLCodec: Specialized HtWordCodec which just caters to the // needs of "url_part_aliases" and "common_url_parts". // Used for coding URLs when they are on disk; the key and the // href field in db.docdb. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtURLCodec.cc,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtURLCodec.h" #include "defaults.h" // For "config" // Constructor: parses the appropriate parameters using the // encapsulated HtWordCodec class. // Only used in privacy. HtURLCodec::HtURLCodec() { HtConfiguration* config= HtConfiguration::config(); StringList l1(config->Find("url_part_aliases"), " \t"); StringList l2(config->Find("common_url_parts"), " \t"); myWordCodec = new HtWordCodec(l1, l2, myErrMsg); } HtURLCodec::~HtURLCodec() { delete myWordCodec; } // Supposedly used as HtURLCodec::instance()->ErrMsg() // to check if HtWordCodec liked what was fed. String& HtURLCodec::ErrMsg() { return myErrMsg; } // Canonical singleton interface. HtURLCodec * HtURLCodec::instance() { static HtURLCodec *_instance = 0; if (_instance == 0) { _instance = new HtURLCodec(); } return _instance; } // End of HtURLCodec.cc ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtURLCodec.h�����������������������������������������������������������������0100644�0063146�0012731�00000004053�10055635540�016261� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtURLCodec.h // // HtURLCodec: Specialized HtWordCodec which just caters to the // needs of "url_part_aliases" and "common_url_parts". // Used for coding URLs when they are on disk; the key and the // href field in db.docdb. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtURLCodec.h,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifndef __HtURLCodec_h #define __HtURLCodec_h #include "HtWordCodec.h" // Container for a HtWordCodec (not subclassed from it due to // portability-problems using initializers). // Not for subclassing. class HtURLCodec { public: static HtURLCodec *instance(); virtual ~HtURLCodec(); // Same as in the HtWordCodec class. Each string may contain // zero or more of words from the lists. inline String encode(const String &uncoded) const { return myWordCodec->encode(uncoded); } String decode(const String &coded) const { return myWordCodec->decode(coded); } // If an error was discovered during the parsing of // url_part_aliases or common_url_parts, this member gives a // nonempty String with an error message. String& ErrMsg(); // egcs-1.1 (and some earlier versions) always erroneously // warns (even without warning flags) about classic singleton // constructs ("only defines private constructors and has no // friends"). Rather than adding autoconf tests to shut these // versions up with -Wno-ctor-dtor-privacy, we fake normal // conformism for it here (the minimal effort). friend void my_friend_Harvey__a_faked_friend_function(); private: // Hide default-constructor, copy-constructor and assignment // operator, making this a singleton. HtURLCodec(); HtURLCodec(const HtURLCodec &); void operator= (const HtURLCodec &); HtWordCodec *myWordCodec; String myErrMsg; }; #endif /* __HtURLCodec_h */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtURLRewriter.cc�������������������������������������������������������������0100644�0063146�0012731�00000002641�10055635540�017206� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtURLRewriter.cc // // HtURLRewriter: Container for a HtRegexReplaceList (not subclassed from it due to // portability-problems using initializers). // Not for subclassing. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtURLRewriter.cc,v 1.4 2004/05/28 13:15:12 lha Exp $ // #include "HtURLRewriter.h" #include "defaults.h" // For "config" // Constructor: parses the appropriate parameters using the // encapsulated RegexReplaceList class. // Only used in privacy. HtURLRewriter::HtURLRewriter() { HtConfiguration* config= HtConfiguration::config(); StringList list(config->Find("url_rewrite_rules"), " \t"); myRegexReplace = new HtRegexReplaceList(list); } HtURLRewriter::~HtURLRewriter() { delete myRegexReplace; } // Supposedly used as HtURLRewriter::instance()->ErrMsg() // to check if RegexReplaceList liked what was fed. const String& HtURLRewriter::ErrMsg() { return myRegexReplace->lastError(); } // Canonical singleton interface. HtURLRewriter * HtURLRewriter::instance() { static HtURLRewriter *_instance = 0; if (_instance == 0) { _instance = new HtURLRewriter(); } return _instance; } // End of HtURLRewriter.cc �����������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtURLRewriter.h��������������������������������������������������������������0100644�0063146�0012731�00000003224�10055635540�017046� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtURLRewriter.h // // HtURLRewriter: Container for a HtRegexReplaceList (not subclassed from it due to // portability-problems using initializers). // Not for subclassing. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtURLRewriter.h,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifndef __HtURLRewriter_h #define __HtURLRewriter_h #include "HtRegexReplaceList.h" class HtURLRewriter { public: static HtURLRewriter *instance(); virtual ~HtURLRewriter(); inline int replace(String &src) { return myRegexReplace->replace(src); } // If an error was discovered during the parsing of // config directives, this member gives a // nonempty String with an error message. const String& ErrMsg(); // egcs-1.1 (and some earlier versions) always erroneously // warns (even without warning flags) about classic singleton // constructs ("only defines private constructors and has no // friends"). Rather than adding autoconf tests to shut these // versions up with -Wno-ctor-dtor-privacy, we fake normal // conformism for it here (the minimal effort). friend void my_friend_Harvey__a_faked_friend_function(); private: // Hide default-constructor, copy-constructor and assignment // operator, making this a singleton. HtURLRewriter(); HtURLRewriter(const HtURLRewriter &); void operator= (const HtURLRewriter &); HtRegexReplaceList *myRegexReplace; }; #endif /* __HtURLRewriter_h */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtWordList.cc����������������������������������������������������������������0100644�0063146�0012731�00000011200�10055635540�016556� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtWordList.cc // // HtWordList: Specialized WordList class that can hold a list // of words waiting to be inserted in the database. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtWordList.cc,v 1.7 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtWordList.h" #include "HtWordReference.h" #include "WordRecord.h" #include "WordType.h" #include "HtConfiguration.h" #include "htString.h" #include <stdio.h> #include <stdlib.h> #include <ctype.h> #ifdef HAVE_STD #include <iostream> #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <iostream.h> #include <fstream.h> #endif /* HAVE_STD */ #include <errno.h> //***************************************************************************** // HtWordList::~HtWordList() // HtWordList::~HtWordList() { delete words; } //***************************************************************************** // HtWordList::HtWordList(const HtConfiguration& config_arg) : WordList(config_arg) { words = new List; } //***************************************************************************** // void HtWordList::Replace(const WordReference& arg) { // // New word. Create a new reference for it and cache it in the object. // words->Add(new WordReference(arg)); } //***************************************************************************** // void HtWordList::Flush() // Dump the current list of words to the database. After // the words have been dumped, the list will be destroyed to make // room for the words of the next document. // void HtWordList::Flush() { HtWordReference *wordRef; // Provided for backwards compatibility if (!isopen) Open(config["word_db"], O_RDWR); words->Start_Get(); while ((wordRef = (HtWordReference *) words->Get_Next())) { if (wordRef->Word().length() == 0) { cerr << "HtWordList::Flush: unexpected empty word\n"; continue; } Override(*wordRef); } // Cleanup words->Destroy(); } //***************************************************************************** // void HtWordList::Skip() // The current document has disappeared or been modified. // We do not need to store these words. // void HtWordList::Skip() { words->Destroy(); } // // Callback data dedicated to Dump and dump_word communication // class DumpWordData : public Object { public: DumpWordData(FILE* fl_arg) { fl = fl_arg; } FILE* fl; }; //***************************************************************************** // // Write the ascii representation of a word occurence. Helper // of WordList::Dump // static int dump_word(WordList *, WordDBCursor &, const WordReference *word, Object &data) { const HtWordReference *word_tmp = (const HtWordReference *)word; DumpWordData &info = (DumpWordData &)data; word_tmp->Dump(info.fl); return OK; } //***************************************************************************** // int HtWordList::Dump(char* filename) // // Write an ascii version of the word database in <filename> // int HtWordList::Dump(const String& filename) { FILE *fl; if (!isopen) { cerr << "WordList::Dump: database must be opened first\n"; return NOTOK; } if((fl = fopen(filename, "w")) == 0) { perror(form("WordList::Dump: opening %s for writing", (const char*)filename)); return NOTOK; } HtWordReference::DumpHeader(fl); DumpWordData data(fl); WordCursor* search = Cursor(dump_word, &data); search->Walk(); delete search; fclose(fl); return OK; } //***************************************************************************** // int HtWordList::Load(char* filename) // // Read in an ascii version of the word database in <filename> // int HtWordList::Load(const String& filename) { FILE *fl; String data; HtWordReference *next; if (!isopen) { cerr << "WordList::Load: database must be opened first\n"; return NOTOK; } if((fl = fopen(filename, "r")) == 0) { perror(form("WordList::Load: opening %s for reading", (const char*)filename)); return NOTOK; } if (HtWordReference::LoadHeader(fl) != OK) { cerr << "WordList::Load: header is not correct\n"; return NOTOK; } while (data.readLine(fl)) { next = new HtWordReference; if (next->Load(data) != OK) { delete next; continue; } words->Add(next); } Flush(); fclose(fl); return OK; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtWordList.h�����������������������������������������������������������������0100644�0063146�0012731�00000003100�10055635540�016420� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtWordList.h // // HtWordList: Specialized WordList class that can hold a list // of words waiting to be inserted in the database. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtWordList.h,v 1.6 2004/05/28 13:15:12 lha Exp $ // #ifndef _HtWordList_h_ #define _HtWordList_h_ #include <fcntl.h> #include <stdlib.h> #include"HtConfiguration.h" #include "WordList.h" class HtWordList : public WordList { public: // // Construction/Destruction // HtWordList(const Configuration & config_arg) : WordList(config_arg) { cerr << "HtWordList::HtWordList(Configuration) is not valid" << endl; abort(); } HtWordList(const HtConfiguration& config_arg); virtual ~HtWordList(); // // Update/add a word, perform sanity checking and // fill information. // void Replace(const WordReference& wordRef); // // Skip this document -- ignore all words stored in the object // from this document // void Skip(); // // Flush the words stored in the object to the database // void Flush(); // Write an ascii version of the word database in <filename> int Dump(const String& filename); // Read in an ascii version of the word database in <filename> int Load(const String& filename); private: List *words; }; #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtWordReference.cc�����������������������������������������������������������0100644�0063146�0012731�00000003357�10055635540�017557� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtWordReference.cc // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtWordReference.cc,v 1.5 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtWordReference.h" #include <stdio.h> #include <stdlib.h> // // Explain the format of data output of the Dump function // int HtWordReference::DumpHeader(FILE *fl) { fprintf(fl, "#word\tdocument id\tflags\tlocation\tanchor\n"); return OK; } // // Ascii representation of a word occurence. // int HtWordReference::Dump(FILE *fl) const { fprintf(fl, "%s\t%d\t%d\t%d\t%d\n", (char*)Word(), DocID(), Flags(), Location(), Anchor()); return OK; } // // Check the header of the file // int HtWordReference::LoadHeader(FILE *fl) { String header; header.readLine(fl); if (mystrcasecmp("#word\tdocument id\tflags\tlocation\tanchor", header.get()) == 0) return OK; else return NOTOK; } // // Ascii representation of a word occurence. // int HtWordReference::Load(const String& s) { String data(s); char *token; // Format is "%s\t%d\t%d\t%d\t%d token = strtok(data, "\t"); if (!token) return NOTOK; Word(token); token = strtok(0, "\t"); if (!token) return NOTOK; DocID(atoi(token)); token = strtok(0, "\t"); if (!token) return NOTOK; Flags(atoi(token)); token = strtok(0, "\t"); if (!token) return NOTOK; Location(atoi(token)); token = strtok(0, "\t"); if (!token) return NOTOK; Anchor(atoi(token)); return OK; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtWordReference.h������������������������������������������������������������0100644�0063146�0012731�00000005006�10055635540�017412� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtWordReference.h // // HtWordReference: Reference to a word, derived from WordReference and // implementing explicit accessors. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtWordReference.h,v 1.6 2004/05/28 13:15:12 lha Exp $ // #ifndef _HtWordReference_h_ #define _HtWordReference_h_ #include "WordReference.h" #include <stdio.h> // // Flags // (If extra flags added, also update htsearch.cc:colonPrefix // #define FLAG_TEXT 0 #define FLAG_CAPITAL 1 #define FLAG_TITLE 2 #define FLAG_HEADING 4 #define FLAG_KEYWORDS 8 #define FLAG_DESCRIPTION 16 #define FLAG_AUTHOR 32 #define FLAG_LINK_TEXT 64 #define FLAG_URL 128 // For field-restricted search, at least one of these flags must be set // in document. (255 = OR of the above...) #define FLAGS_MATCH_ONE (255 | FLAG_PLAIN) // The following are not stored in the database, but are used by WeightWord #define FLAG_PLAIN 4096 #define FLAG_EXACT 8192 #define FLAG_HIDDEN 16384 #define FLAG_IGNORE 32768 // The remainder are undefined class HtWordReference : public WordReference { public: // // Construction/Destruction // HtWordReference() {} HtWordReference(const String& key, const String& record) : WordReference(key, record) { } HtWordReference(const String& word) : WordReference(word) { } HtWordReference(String word, unsigned int docid, unsigned int flags, unsigned int location, unsigned int anchor) { Word(word); DocID(docid); Location(location); Anchor(anchor); Flags(flags); } ~HtWordReference() {} // // Accessors // String Word() const { return key.GetWord(); } void Word(const String& arg) { key.SetWord(arg); } unsigned int DocID() const { return key.Get( 1 ); } void DocID(const unsigned int arg) { key.Set( 1, arg); } unsigned int Flags() const { return key.Get( 2 ); } void Flags(const unsigned int arg) { key.Set( 2, arg); } unsigned int Location() const { return key.Get( 3 ); } void Location(const unsigned int arg) { key.Set( 3, arg); } unsigned int Anchor() const { return record.info.data; } void Anchor(const unsigned int arg) { record.info.data = arg; } // // Dumping/Loading // int Dump(FILE *fl) const; static int DumpHeader(FILE *fl); int Load(const String& s); static int LoadHeader(FILE *fl); }; #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtZlibCodec.cc���������������������������������������������������������������0100644�0063146�0012731�00000006547�10055635540�016667� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtZlibCodec.cc // // HtZlibCodec: Provide a generic access to the zlib compression routines. // If zlib is not present, encode and decode are simply // assignment functions. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtZlibCodec.cc,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtZlibCodec.h" #include "defaults.h" // For "config" #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) #include <zlib.h> #endif HtZlibCodec::HtZlibCodec() { } HtZlibCodec::~HtZlibCodec() { } String HtZlibCodec::encode(const String &str) const { String s = str; #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) HtConfiguration* config= HtConfiguration::config(); static int cf=config->Value("compression_level",0); if (cf) { // // Now compress s into c_s // unsigned char c_buffer[16384]; String c_s; z_stream c_stream; /* compression stream */ c_stream.zalloc=(alloc_func)0; c_stream.zfree=(free_func)0; c_stream.opaque=(voidpf)0; // Get compression factor, default to best if (cf<-1) cf=-1; else if (cf>9) cf=9; int err=deflateInit(&c_stream,cf); if (err!=Z_OK) return 0; int len=s.length(); c_stream.next_in=(Bytef*)(char *)s; c_stream.avail_in=len; while (err==Z_OK && c_stream.total_in!=(uLong)len) { c_stream.next_out=c_buffer; c_stream.avail_out=sizeof(c_buffer); err=deflate(&c_stream,Z_NO_FLUSH); c_s.append((char *)c_buffer,c_stream.next_out-c_buffer); } // Finish the stream for (;;) { c_stream.next_out=c_buffer; c_stream.avail_out=sizeof(c_buffer); err=deflate(&c_stream,Z_FINISH); c_s.append((char *)c_buffer,c_stream.next_out-c_buffer); if (err==Z_STREAM_END) break; //CHECK_ERR(err, "deflate"); } err=deflateEnd(&c_stream); s=c_s; } #endif // HAVE_LIBZ && HAVE_ZLIB_H return s; } String HtZlibCodec::decode(const String &str) const { String s = str; #if defined(HAVE_LIBZ) && defined(HAVE_ZLIB_H) HtConfiguration* config= HtConfiguration::config(); static int cf=config->Value("compression_level",0); if (cf) { String c_s; // Decompress stream unsigned char c_buffer[16384]; z_stream d_stream; d_stream.zalloc=(alloc_func)0; d_stream.zfree=(free_func)0; d_stream.opaque=(voidpf)0; unsigned int len=s.length(); d_stream.next_in=(Bytef*)(char *)s; d_stream.avail_in=len; int err=inflateInit(&d_stream); if (err!=Z_OK) return 1; while (err==Z_OK && d_stream.total_in<len) { d_stream.next_out=c_buffer; d_stream.avail_out=sizeof(c_buffer); err=inflate(&d_stream,Z_NO_FLUSH); c_s.append((char *)c_buffer,d_stream.next_out-c_buffer); if (err==Z_STREAM_END) break; } err=inflateEnd(&d_stream); s=c_s; } #endif // HAVE_LIBZ && HAVE_ZLIB_H return s; } // Canonical singleton interface. HtZlibCodec * HtZlibCodec::instance() { static HtZlibCodec *_instance = 0; if (_instance == 0) { _instance = new HtZlibCodec(); } return _instance; } // End of HtZlibCodec.cc ���������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/HtZlibCodec.h����������������������������������������������������������������0100644�0063146�0012731�00000003034�10055635540�016515� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HtZlibCodec.h // // HtZlibCodec: Provide a generic access to the zlib compression routines. // If zlib is not present, encode and decode are simply // assignment functions. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HtZlibCodec.h,v 1.4 2004/05/28 13:15:12 lha Exp $ // // #ifndef __HtZlibCodec_h #define __HtZlibCodec_h #include "htString.h" #include "HtCodec.h" class HtZlibCodec : public HtCodec { public: static HtZlibCodec *instance(); ~HtZlibCodec(); // Code what's in this string. String encode(const String &) const; // Decode what's in this string. String decode(const String &) const; // egcs-1.1 (and some earlier versions) always erroneously // warns (even without warning flags) about classic singleton // constructs ("only defines private constructors and has no // friends"). Rather than adding autoconf tests to shut these // versions up with -Wno-ctor-dtor-privacy, we fake normal // conformism for it here (the minimal effort). friend void my_friend_Harvey__a_faked_friend_function(); private: // Hide default-constructor, copy-constructor and assignment // operator, making this a singleton. HtZlibCodec(); HtZlibCodec(const HtZlibCodec &); void operator= (const HtZlibCodec &); }; #endif /* __HtZlibCodec_h */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/Makefile.am������������������������������������������������������������������0100644�0063146�0012731�00000002112�07723256616�016255� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ include $(top_srcdir)/Makefile.config # # Do not output #line because it confuses the dependencies # generator of GCC if configure run out of source tree. # Comment these to ease debugging. # AM_LFLAGS = -L AM_YFLAGS = -l -d EXTRA_DIST=conf_lexer.cxx conf_parser.cxx pkglib_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = DocumentDB.cc DocumentRef.cc \ HtWordReference.cc HtWordList.cc defaults.cc \ HtURLCodec.cc URL.cc URLTrans.cc \ HtZlibCodec.cc cgi.cc HtSGMLCodec.cc \ HtConfiguration.cc HtURLRewriter.cc \ conf_lexer.lxx conf_parser.yxx libcommon_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} noinst_HEADERS = DocumentDB.h \ DocumentRef.h \ HtWordReference.h \ HtWordList.h \ HtURLCodec.h \ HtSGMLCodec.h \ URL.h \ cgi.h \ HtZlibCodec.h \ defaults.h \ HtConfiguration.h \ HtURLRewriter.h \ conf_parser.h LOCAL_DEFINES= -DBIN_DIR=\"$(bindir)\" \ -DCOMMON_DIR=\"$(COMMON_DIR)\" \ -DCONFIG_DIR=\"$(CONFIG_DIR)\" \ -DDATABASE_DIR=\"$(DATABASE_DIR)\" \ -DIMAGE_URL_PREFIX=\"$(IMAGE_URL_PREFIX)\" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/Makefile.in������������������������������������������������������������������0100644�0063146�0012731�00000040171�10063260372�016256� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la # # Do not output #line because it confuses the dependencies # generator of GCC if configure run out of source tree. # Comment these to ease debugging. # AM_LFLAGS = -L AM_YFLAGS = -l -d EXTRA_DIST = conf_lexer.cxx conf_parser.cxx pkglib_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = DocumentDB.cc DocumentRef.cc \ HtWordReference.cc HtWordList.cc defaults.cc \ HtURLCodec.cc URL.cc URLTrans.cc \ HtZlibCodec.cc cgi.cc HtSGMLCodec.cc \ HtConfiguration.cc HtURLRewriter.cc \ conf_lexer.lxx conf_parser.yxx libcommon_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} noinst_HEADERS = DocumentDB.h \ DocumentRef.h \ HtWordReference.h \ HtWordList.h \ HtURLCodec.h \ HtSGMLCodec.h \ URL.h \ cgi.h \ HtZlibCodec.h \ defaults.h \ HtConfiguration.h \ HtURLRewriter.h \ conf_parser.h LOCAL_DEFINES = -DBIN_DIR=\"$(bindir)\" \ -DCOMMON_DIR=\"$(COMMON_DIR)\" \ -DCONFIG_DIR=\"$(CONFIG_DIR)\" \ -DDATABASE_DIR=\"$(DATABASE_DIR)\" \ -DIMAGE_URL_PREFIX=\"$(IMAGE_URL_PREFIX)\" subdir = htcommon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(pkglib_LTLIBRARIES) libcommon_la_LIBADD = am_libcommon_la_OBJECTS = DocumentDB.lo DocumentRef.lo \ HtWordReference.lo HtWordList.lo defaults.lo HtURLCodec.lo \ URL.lo URLTrans.lo HtZlibCodec.lo cgi.lo HtSGMLCodec.lo \ HtConfiguration.lo HtURLRewriter.lo conf_lexer.lo \ conf_parser.lo libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libcommon_la_SOURCES) HEADERS = $(noinst_HEADERS) DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am conf_lexer.cxx \ conf_parser.cxx conf_parser.h SOURCES = $(libcommon_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .cxx .lo .lxx .o .obj .yxx $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htcommon/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done conf_parser.h: conf_parser.cxx @if test ! -f $@; then \ rm -f conf_parser.cxx; \ $(MAKE) conf_parser.cxx; \ else :; fi libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libcommon_la_LDFLAGS) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cxx.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cxx.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cxx.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .lxx.cxx: $(LEXCOMPILE) `test -f $< || echo '$(srcdir)/'`$< sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ rm -f $(LEX_OUTPUT_ROOT).c .yxx.cxx: $(YACCCOMPILE) `test -f '$<' || echo '$(srcdir)/'`$< if test -f y.tab.h; then \ to=`echo "$*_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed "/^#/ s/Y_TAB_H/$$to/g" y.tab.h >$*.ht; \ rm -f y.tab.h; \ if cmp -s $*.ht $*.h; then \ rm -f $*.ht ;\ else \ mv $*.ht $*.h; \ fi; \ fi if test -f y.output; then \ mv y.output $*.output; \ fi sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ rm -f y.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f conf_lexer.cxx -rm -f conf_parser.cxx -rm -f conf_parser.h clean: clean-am clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkglibLTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-pkglibLTLIBRARIES # 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: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/Makefile.win32���������������������������������������������������������������0100644�0063146�0012731�00000001301�07675642172�016623� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ TARGET = $(LIBDIR)/libcommon$(LIBSFX) # ---------------------------------------------------------------------------- # add new library members to this list # ---------------------------------------------------------------------------- include ../Makedefs.win32 CXXSRC = DocumentDB.cc DocumentRef.cc HtWordReference.cc \ HtWordList.cc defaults.cc HtURLCodec.cc URL.cc URLTrans.cc \ HtZlibCodec.cc cgi.cc HtSGMLCodec.cc HtConfiguration.cc \ HtURLRewriter.cc LXXSRC = conf_lexer.lxx YXXSRC = conf_parser.yxx CPPFLAGS += -DYY_NEVER_INTERACTIVE -DHAVE_CONFIG_H -I../db -I../htlib -I../htword $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) include ../Makerules.win32 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/URL.cc�����������������������������������������������������������������������0100644�0063146�0012731�00000055526�10060033765�015175� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // URL.cc // // URL: A URL parsing class, implementing as closely as possible the standard // laid out in RFC2396 (e.g. http://www.faqs.org/rfcs/rfc2396.html) // including support for multiple services. (schemes in the RFC) // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: URL.cc,v 1.16 2004/06/04 08:51:01 angusgb Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "URL.h" #include "QuotedStringList.h" #include "Dictionary.h" #include "HtConfiguration.h" #include "StringMatch.h" #include "StringList.h" #include "HtURLRewriter.h" #include <string.h> #include <stdlib.h> #include <stdio.h> #ifdef HAVE_STD #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <fstream.h> #endif /* HAVE_STD */ #include <sys/types.h> #include <ctype.h> #ifndef _MSC_VER /* _WIN32 */ #include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h> #endif #define NNTP_DEFAULT_PORT 119 static Dictionary *slashCount = 0; //***************************************************************************** // URL::URL() // Default Constructor // URL::URL() : _url(0), _path(0), _service(0), _host(0), _port(0), _normal(0), _hopcount(0), _signature(0), _user(0) { } //***************************************************************************** // URL::URL(const URL& rhs) // Copy constructor // URL::URL(const URL& rhs) : _url(rhs._url), _path(rhs._path), _service(rhs._service), _host(rhs._host), _port(rhs._port), _normal(rhs._normal), _hopcount(rhs._hopcount), _signature(rhs._signature), _user(rhs._user) { } //***************************************************************************** // URL::URL(const String &nurl) // Construct a URL from a String (obviously parses the string passed in) // URL::URL(const String &nurl) : _url(0), _path(0), _service(0), _host(0), _port(0), _normal(0), _hopcount(0), _signature(0), _user(0) { parse(nurl); } //***************************************************************************** // Assignment operator const URL &URL::operator = (const URL &rhs) { if (this == &rhs) return *this; // Copy the attributes _url = rhs._url; _path = rhs._path; _service = rhs._service; _host = rhs._host; _port = rhs._port; _normal = rhs._normal; _hopcount = rhs._hopcount; _signature = rhs._signature; _user = rhs._user; return *this; } //***************************************************************************** // URL::URL(const String &url, const URL &parent) // Parse a reference given a parent url. This is needed to resolve relative // references which do NOT have a full url. // URL::URL(const String &url, const URL &parent) : _url(0), _path(0), _service(parent._service), _host(parent._host), _port(parent._port), _normal(parent._normal), _hopcount(parent._hopcount + 1), // Since this is one hop *after* the parent, we should account for this _signature(parent._signature), _user(parent._user) { HtConfiguration* config= HtConfiguration::config(); int allowspace = config->Boolean("allow_space_in_url", 0); String temp; const char *urp = url.get(); while (*urp) { if (*urp == ' ' && temp.length() > 0 && allowspace) { // Replace space character with %20 if there's more non-space // characters to come... const char *s = urp+1; while (*s && isspace(*s)) s++; if (*s) temp << "%20"; } else if (!isspace(*urp)) temp << *urp; urp++; } char* ref = temp; // // Strip any optional anchor from the reference. If, however, the // reference contains CGI parameters after the anchor, the parameters // will be moved left to replace the anchor. The overall effect is that // the anchor is removed. // Thanks goes to David Filiatrault <dwf@WebThreads.Com> for suggesting // this removal process. // char *anchor = strchr(ref, '#'); char *params = strchr(ref, '?'); if (anchor) { *anchor = '\0'; if (params) { if (anchor < params) { while (*params) { *anchor++ = *params++; } *anchor = '\0'; } } } // // If, after the removal of a possible '#' we have nothing left, // we just want to use the base URL (we're on the same page but // different anchors) // if (!*ref) { // We've already copied much of the info _url = parent._url; _path = parent._path; // Since this is on the same page, we want the same hopcount _hopcount = parent._hopcount; return; } // OK, now we need to work out what type of child URL this is char *p = ref; while (isalpha(*p)) // Skip through the service portion p++; int hasService = (*p == ':'); // Why single out http? Shouldn't others be the same? // Child URL of the form https:/child or ftp:child called "full" // How about using slashes()? if (hasService && ((strncmp(ref, "http://", 7) == 0) || (strncmp(ref, "http:", 5) != 0))) { // // No need to look at the parent url since this is a complete url... // parse(ref); } else if (strncmp(ref, "//", 2) == 0) { // look at the parent url's _service, to make this is a complete url... String fullref(parent._service); fullref << ':' << ref; parse((char*)fullref); } else { if (hasService) ref = p + 1; // Relative URL, skip "http:" if (*ref == '/') { // // The reference is on the same server as the parent, but // an absolute path was given... // _path = ref; // // Get rid of loop-causing constructs in the path // normalizePath(); } else { // // The reference is relative to the parent // _path = parent._path; int i = _path.indexOf('?'); if (i >= 0) { _path.chop(_path.length() - i); } // // Remove any leading "./" sequences which could get us into // recursive loops. // while (strncmp(ref, "./", 2) == 0) ref += 2; if (_path.last() == '/') { // // Parent was a directory. Easy enough: just append // the current ref to it // _path << ref; } else { // // Parent was a file. We need to strip the last part // of the path before we add the reference to it. // String temp = _path; p = strrchr((char*)temp, '/'); if (p) { p[1] = '\0'; _path = temp.get(); _path << ref; } else { // // Something must be wrong since there were no '/' // found in the parent url. // // We do nothing here. The new url is the parent. // } } // // Get rid of loop-causing constructs in the path // normalizePath(); } // // Build the url. (Note, the host name has NOT been normalized!) // No need for this if we have called URL::parse. // constructURL(); } } //***************************************************************************** // void URL::rewrite() // void URL::rewrite() { if (HtURLRewriter::instance()->replace(_url) > 0) parse(_url.get()); } //***************************************************************************** // void URL::parse(const String &u) // Given a URL string, extract the service, host, port, and path from it. // void URL::parse(const String &u) { HtConfiguration* config= HtConfiguration::config(); int allowspace = config->Boolean("allow_space_in_url", 0); String temp; const char *urp = u.get(); while (*urp) { if (*urp == ' ' && temp.length() > 0 && allowspace) { // Replace space character with %20 if there's more non-space // characters to come... const char *s = urp+1; while (*s && isspace(*s)) s++; if (*s) temp << "%20"; } else if (!isspace(*urp)) temp << *urp; urp++; } char *nurl = temp; // // Ignore any part of the URL that follows the '#' since this is just // an index into a document. // char *p = strchr(nurl, '#'); if (p) *p = '\0'; // Some members need to be reset. If not, the caller would // have used URL::URL(char *ref, URL &parent) // (which may call us, if the URL is found to be absolute). _normal = 0; _signature = 0; _user = 0; // // Extract the service // p = strchr(nurl, ':'); if (p) { _service = strtok(nurl, ":"); p = strtok(0, "\n"); } else { _service = "http"; p = strtok(nurl, "\n"); } _service.lowercase(); // // Extract the host // if (!p || strncmp(p, "//", 2) != 0) { // No host specified, it's all a path. _host = 0; _port = 0; _url = 0; if (p) // if non-NULL, skip (some) leading slashes in path { int i; for (i = slashes (_service); i > 0 && *p == '/'; i--) p++; if (i) // if fewer slashes than specified for protocol don't // delete any. -> Backwards compatible (necessary??) p -= slashes (_service) - i; } _path = p; if (strcmp((char*)_service, "file") == 0 || slashes (_service) < 2) _host = "localhost"; } else { p += 2; // // p now points to the host // char *q = strchr(p, ':'); char *slash = strchr(p, '/'); _path = "/"; if (strcmp((char*)_service, "file") == 0) { // These should be of the form file:/// (i.e. no host) // if there is a file://host/path then strip the host if (strncmp(p, "/", 1) != 0) { p = strtok(p, "/"); _path << strtok(0, "\n"); } else _path << strtok(p+1, "\n"); // _path is "/" - don't double _host = "localhost"; _port = 0; } else if (q && ((slash && slash > q) || !slash)) { _host = strtok(p, ":"); p = strtok(0, "/"); if (p) _port = atoi(p); if (!p || _port <= 0) _port = DefaultPort(); // // The rest of the input string is the path. // _path << strtok(0, "\n"); } else { _host = strtok(p, "/"); _host.chop(" \t"); _port = DefaultPort(); // // The rest of the input string is the path. // _path << strtok(0, "\n"); } // Check to see if host contains a user@ portion int atMark = _host.indexOf('@'); if (atMark != -1) { _user = _host.sub(0, atMark); _host = _host.sub(atMark + 1); } } // // Get rid of loop-causing constructs in the path // normalizePath(); // // Build the url. (Note, the host name has NOT been normalized!) // constructURL(); } //***************************************************************************** // void URL::normalizePath() // Called from: URL(const String &url, const URL &parent) // void URL::normalizePath() { // // Rewrite the path to be the minimal. // Remove "//", "/../" and "/./" components // HtConfiguration* config= HtConfiguration::config(); int i, limit; int leadingdotdot = 0; String newPath; int pathend = _path.indexOf('?'); // Don't mess up query strings. if (pathend < 0) pathend = _path.length(); // // get rid of "//" first, or "/foo//../" will become "/foo/" not "/" // Some database lookups interpret empty paths (// != /), so give // the use the option to turn this off. // if (!config->Boolean ("allow_double_slash")) while ((i = _path.indexOf("//")) >= 0 && i < pathend) { newPath = _path.sub(0, i).get(); newPath << _path.sub(i + 1).get(); _path = newPath; pathend = _path.indexOf('?'); if (pathend < 0) pathend = _path.length(); } // // Next get rid of redundant "/./". This could cause infinite // loops. Moreover, "/foo/./../" should become "/", not "/foo/" // while ((i = _path.indexOf("/./")) >= 0 && i < pathend) { newPath = _path.sub(0, i).get(); newPath << _path.sub(i + 2).get(); _path = newPath; pathend = _path.indexOf('?'); if (pathend < 0) pathend = _path.length(); } if ((i = _path.indexOf("/.")) >= 0 && i == pathend-2) { newPath = _path.sub(0, i+1).get(); // keep trailing slash newPath << _path.sub(i + 2).get(); _path = newPath; pathend--; } // // Now that "empty" path components are gone, remove ("/../"). // while ((i = _path.indexOf("/../")) >= 0 && i < pathend) { if ((limit = _path.lastIndexOf('/', i - 1)) >= 0) { newPath = _path.sub(0, limit).get(); newPath << _path.sub(i + 3).get(); _path = newPath; } else { _path = _path.sub(i + 3).get(); leadingdotdot++; } pathend = _path.indexOf('?'); if (pathend < 0) pathend = _path.length(); } if ((i = _path.indexOf("/..")) >= 0 && i == pathend-3) { if ((limit = _path.lastIndexOf('/', i - 1)) >= 0) newPath = _path.sub(0, limit+1).get(); // keep trailing slash else { newPath = '/'; leadingdotdot++; } newPath << _path.sub(i + 3).get(); _path = newPath; pathend = _path.indexOf('?'); if (pathend < 0) pathend = _path.length(); } // The RFC gives us a choice of what to do when we have .. left and // we're at the top level. By principle of least surprise, we'll just // toss any "leftovers" Otherwise, we'd have a loop here to add them. // Finally change all "%7E" to "~" for sanity while ((i = _path.indexOf("%7E")) >= 0 && i < pathend) { newPath = _path.sub(0, i).get(); newPath << "~"; newPath << _path.sub(i + 3).get(); _path = newPath; pathend = _path.indexOf('?'); if (pathend < 0) pathend = _path.length(); } // If the server *isn't* case sensitive, we want to lowercase the path if (!config->Boolean("case_sensitive", 1)) _path.lowercase(); // And don't forget to remove index.html or similar file. // if (strcmp((char*)_service, "file") != 0) (check is now internal) removeIndex(_path, _service); } //***************************************************************************** // void URL::dump() // void URL::dump() { cout << "service = " << _service.get() << endl; cout << "user = " << _user.get() << endl; cout << "host = " << _host.get() << endl; cout << "port = " << _port << endl; cout << "path = " << _path << endl; cout << "url = " << _url << endl; } //***************************************************************************** // void URL::path(const String &newpath) // void URL::path(const String &newpath) { HtConfiguration* config= HtConfiguration::config(); _path = newpath; if (!config->Boolean("case_sensitive",1)) _path.lowercase(); constructURL(); } //***************************************************************************** // void URL::removeIndex(String &path, String &service) // Attempt to remove the remove_default_doc from the end of a URL path if // the service allows that. (File, ftp don't. Do others?) // This needs to be done to normalize the paths and make .../ the // same as .../index.html // Called from: URL::normalize() from URL::signature() [redundant?] // URL::normalizePath() // void URL::removeIndex(String &path, String &service) { HtConfiguration* config= HtConfiguration::config(); static StringMatch *defaultdoc = 0; if (strcmp((char*)_service, "file") == 0 || strcmp((char*)_service, "ftp") == 0) return; if (path.length() == 0 || strchr((char*)path, '?')) return; int filename = path.lastIndexOf('/') + 1; if (filename == 0) return; if (! defaultdoc) { StringList l(config->Find("remove_default_doc"), " \t"); defaultdoc = new StringMatch(); defaultdoc->IgnoreCase(); defaultdoc->Pattern(l.Join('|')); } int which, length; if (defaultdoc->hasPattern() && defaultdoc->CompareWord((char*)path.sub(filename), which, length) && filename+length == path.length()) path.chop(path.length() - filename); } //***************************************************************************** // void URL::normalize() // Make sure that URLs are always in the same format. // void URL::normalize() { HtConfiguration* config= HtConfiguration::config(); static int hits = 0, misses = 0; if (_service.length() == 0 || _normal) return; // if (strcmp((char*)_service, "http") != 0) // if service specifies "doesn't specify an IP host", don't normalize it if (slashes (_service) != 2) return; // if (strcmp ((char*)_service, "http") == 0) (check is now internal) removeIndex(_path, _service); // // Convert a hostname to an IP address // _host.lowercase(); if (!config->Boolean("allow_virtual_hosts", 1)) { static Dictionary hostbyname; unsigned long addr; struct hostent *hp; String *ip = (String *) hostbyname[_host]; if (ip) { memcpy((char *) &addr, ip->get(), ip->length()); hits++; } else { addr = inet_addr(_host.get()); if (addr == 0xffffffff) { hp = gethostbyname(_host.get()); if (hp == NULL) { return; } memcpy((char *)&addr, (char *)hp->h_addr, hp->h_length); ip = new String((char *) &addr, hp->h_length); hostbyname.Add(_host, ip); misses++; } } static Dictionary machines; String key; key << int(addr); String *realname = (String *) machines[key]; if (realname) _host = realname->get(); else machines.Add(key, new String(_host)); } ServerAlias(); // // Reconstruct the url // constructURL(); _normal = 1; _signature = 0; } //***************************************************************************** // const String &URL::signature() // Return a string which uniquely identifies the server the current // URL is refering to. // This is the first portion of a url: service://user@host:port/ // (in short this is the URL pointing to the root of this server) // const String &URL::signature() { if (_signature.length()) return _signature; if (!_normal) normalize(); _signature = _service; _signature << "://"; if (_user.length()) _signature << _user << '@'; _signature << _host; _signature << ':' << _port << '/'; return _signature; } //***************************************************************************** // void URL::ServerAlias() // Takes care of the server aliases, which attempt to simplify virtual // host problems // void URL::ServerAlias() { HtConfiguration* config= HtConfiguration::config(); static Dictionary *serveraliases= 0; if (! serveraliases) { String l= config->Find("server_aliases"); String from, *to; serveraliases = new Dictionary(); char *p = strtok(l, " \t"); char *salias= NULL; while (p) { salias = strchr(p, '='); if (! salias) { p = strtok(0, " \t"); continue; } *salias++= '\0'; from = p; from.lowercase(); if (from.indexOf(':') == -1) from.append(":80"); to= new String(salias); to->lowercase(); if (to->indexOf(':') == -1) to->append(":80"); serveraliases->Add(from.get(), to); // fprintf (stderr, "Alias: %s->%s\n", from.get(), to->get()); p = strtok(0, " \t"); } } String *al= 0; int newport; int delim; String serversig = _host; serversig << ':' << _port; if ((al= (String *) serveraliases->Find(serversig))) { delim= al->indexOf(':'); // fprintf(stderr, "\nOld URL: %s->%s\n", (char *) serversig, (char *) *al); _host= al->sub(0,delim).get(); sscanf((char*)al->sub(delim+1), "%d", &newport); _port= newport; // fprintf(stderr, "New URL: %s:%d\n", (char *) _host, _port); } } //***************************************************************************** // int URL::slash(const String &protocol) // Returns number of slashes folowing the service name for protocol // int URL::slashes(const String &protocol) { if (!slashCount) { HtConfiguration* config= HtConfiguration::config(); slashCount = new Dictionary(); slashCount->Add (String("mailto"), new String("0")); slashCount->Add (String("news"), new String("0")); slashCount->Add (String("http"), new String("2")); slashCount->Add (String("ftp"), new String("2")); // file:/// has three, but the last counts as part of the path... slashCount->Add (String("file"), new String("2")); QuotedStringList qsl(config->Find("external_protocols"), " \t"); String from; int i; int sep,colon; for (i = 0; qsl[i]; i += 2) { from = qsl[i]; sep = from.indexOf("->"); if (sep != -1) from = from.sub(0, sep).get(); // "get" aids portability... colon = from.indexOf(":"); // if service specified as "help:/" or "man:", note trailing slashes // Default is 2. if (colon != -1) { int i; char count [2]; for (i = colon+1; from[i] == '/'; i++) ; count [0] = i - colon + '0' - 1; count [1] = '\0'; from = from.sub(0,colon).get(); slashCount->Add (from, new String (count)); } else slashCount->Add (from, new String ("2")); } } // Default to two slashes for unknown protocols String *count = (String *)slashCount->Find(protocol); return count ? (count->get()[0] - '0') : 2; } //***************************************************************************** // void URL::constructURL() // Constructs the _url member from everything else // Also ensures the port number is correct for the service // Called from URL::URL(const String &url, const URL &parent) // URL::parse(const String &u) // URL::path(const String &newpath) // URL::normalize() // void URL::constructURL() { if (strcmp((char*)_service, "file") != 0 && _host.length() == 0) { _url = ""; return; } _url = _service; _url << ":"; // Add correct number of slashes after service name int i; for (i = slashes (_service); i > 0; i--) { _url << "/"; } if (slashes (_service) == 2) // services specifying a particular { // IP host must begin "service://" if (strcmp((char*)_service, "file") != 0) { if (_user.length()) _url << _user << '@'; _url << _host; } if (_port != DefaultPort() && _port != 0) // Different than the default port _url << ':' << _port; } _url << _path; } /////// // Get the default port for the recognised service /////// int URL::DefaultPort() { if (strcmp((char*)_service, "http") == 0) return 80; else if (strcmp((char*)_service, "https") == 0) return 443; else if (strcmp((char*)_service, "ftp") == 0) return 21; else if (strcmp((char*)_service, "gopher") == 0) return 70; else if (strcmp((char*)_service, "file") == 0) return 0; else if (strcmp((char*)_service, "news") == 0) return NNTP_DEFAULT_PORT; else return 80; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/URL.h������������������������������������������������������������������������0100644�0063146�0012731�00000005675�10055635540�015042� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // URL.h // // URL: A URL parsing class, implementing as closely as possible the standard // laid out in RFC2396 (e.g. http://www.faqs.org/rfcs/rfc2396.html) // including support for multiple schemes. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: URL.h,v 1.8 2004/05/28 13:15:12 lha Exp $ // #ifndef _URL_h_ #define _URL_h_ #include "htString.h" class URL { public: URL(); URL(const String &url); URL(const URL& rhs); URL(const String &ref, const URL &parent); void parse(const String &url); const String &host() const {return _host;} void host(const String &h) {_host = h;} int port() const {return _port;} void port(const int p) {_port = p;} int DefaultPort(); const String &service() const {return _service;} void service(const String &s) {_service = s;} const String &path() const {return _path;} void path(const String &p); int hopcount() const {return _hopcount;} void hopcount(int h) {_hopcount = h;} const String &user() const {return _user;} void user(const String &u) {_user = u;} const String &get() const {return _url;} void dump(); void normalize(); void rewrite(); const String &signature(); const URL &operator = (const URL &rhs); private: String _url; String _path; String _service; String _host; int _port; int _normal; int _hopcount; String _signature; String _user; void removeIndex(String &, String &); void normalizePath(); void ServerAlias(); void constructURL(); // Number of slashes following service specifier. eg service("http")=2 static int slashes(const String &); }; // Unreserved punctuation allowed unencoded in URLs. We use a more restricted // list of unreserved characters than allowed by RFC 2396 (which revises and // replaces RFC 1738), because it can't hurt to encode any of these // characters, and they can pose problems in some contexts. RFC 2396 says // that only alphanumerics, the unreserved characters "-_.!~*'(),", and // reserved characters used for their reserved purposes may be used // unencoded within a URL. We encode reserved characters because we now // encode URL parameter values individually before piecing together the whole // query string using reserved characters. #define UNRESERVED "-_.!~*" //String &encodeURL(String &, char *valid = "?_@.=&/:"); //String &encodeURL(String &, char *reserved = ";/?:@&=+$,"); // char *unreserved = "-_.!~*'()"); String &encodeURL(String &, char *valid = (char *)UNRESERVED); String &decodeURL(String &); #endif �������������������������������������������������������������������htdig-3.2.0b6/htcommon/URLTrans.cc������������������������������������������������������������������0100644�0063146�0012731�00000004161�10055635540�016175� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // URLTrans.cc // // URLTrans: Helper functions for the implementation of the URL class. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: URLTrans.cc,v 1.5 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "URL.h" #include "htString.h" #include "lib.h" #include <ctype.h> //***************************************************************************** // String &decodeURL(String &str) // Convert the given URL string to a normal string. This means that // all escaped characters are converted to their normal values. The // escape character is '%' and is followed by 2 hex digits // representing the octet. // String &decodeURL(String &str) { String temp; char *p; for (p = str; p && *p; p++) { if (*p == '%') { // // 2 hex digits follow... // int value = 0; for (int i = 0; p[1] && i < 2; i++) { p++; value <<= 4; if (isdigit(*p)) value += *p - '0'; else value += toupper(*p) - 'A' + 10; } temp << char(value); } else temp << *p; } str = temp; return (str); } //***************************************************************************** // String &encodeURL(String &str, char *valid) // Convert a normal string to a URL 'safe' string. This means that // all characters not explicitly mentioned in the URL BNF will be // escaped. The escape character is '%' and is followed by 2 hex // digits representing the octet. // String &encodeURL(String &str, char *valid) { String temp; static char *digits = "0123456789ABCDEF"; char *p; for (p = str; p && *p; p++) { if (isascii(*p) && (isdigit(*p) || isalpha(*p) || strchr(valid, *p))) temp << *p; else { temp << '%'; temp << digits[(*p >> 4) & 0x0f]; temp << digits[*p & 0x0f]; } } str = temp; return (str); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/cgi.cc�����������������������������������������������������������������������0100644�0063146�0012731�00000007432�10055635540�015271� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // cgi.cc // // cgi: Parse cgi arguments and put them in a dictionary. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: cgi.cc,v 1.9 2004/05/28 13:15:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef _MSC_VER /* _WIN32 */ #include <io.h> #endif #include "cgi.h" #include "htString.h" #include "Dictionary.h" #include "good_strtok.h" #include "StringList.h" #include "URL.h" #include <stdlib.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #ifdef HAVE_STD #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <fstream.h> #endif /* HAVE_STD */ //***************************************************************************** // cgi::cgi() // cgi::cgi() { init(""); } //***************************************************************************** // cgi::cgi(char *s) // cgi::cgi(char *s) { init(s); } //***************************************************************************** // void cgi::init(char *s) // void cgi::init(char *s) { pairs = new Dictionary; int i; String method(getenv("REQUEST_METHOD")); if ((!s || !*s) && method.length() == 0) { // // Interactive mode // query = 1; return; } query = 0; String results; if (s && *s && method.length() == 0) { results = s; } else if (strcmp((char*)method, "GET") == 0) { results = getenv("QUERY_STRING"); } else { int n; char *buf; buf = getenv("CONTENT_LENGTH"); if (!buf || !*buf || (n = atoi(buf)) <= 0) return; // null query buf = new char[n + 1]; int r, i = 0; while (i < n && (r = read(0, buf+i, n-i)) > 0) i += r; buf[i] = '\0'; results = buf; delete [] buf; } // // Now we need to split the line up into name/value pairs // StringList list(results, "&;"); // // Each name/value pair now needs to be added to the dictionary // for (i = 0; i < list.Count(); i++) { char *name = good_strtok(list[i], '='); String value(good_strtok(NULL, '\n')); value.replace('+', ' '); decodeURL(value); String *str = (String *) pairs->Find(name); if (str) { // // Entry was already there. Append it to the string. // str->append('\001'); str->append(value); } else { // // New entry. Add a new string // pairs->Add(name, new String(value)); } } } //***************************************************************************** // cgi::~cgi() // cgi::~cgi() { delete pairs; } //***************************************************************************** // char *cgi::operator [] (char *name) // char *cgi::operator [] (char *name) { return get(name); } //***************************************************************************** // char *cgi::get(char *name) // char *cgi::get(char *name) { String *str = (String *) (*pairs)[name]; if (str) return str->get(); else { if (query) { char buffer[1000]; cerr << "Enter value for " << name << ": "; cin.getline(buffer, sizeof(buffer)); pairs->Add(name, new String(buffer)); str = (String *) (*pairs)[name]; return str->get(); } return 0; } } //***************************************************************************** // int cgi::exists(char *name) // int cgi::exists(char *name) { return pairs->Exists(name); } //***************************************************************************** // char *cgi::path() // char *cgi::path() { static char buffer[1000] = ""; if (query) { if (*buffer) return buffer; cerr << "Enter PATH_INFO: "; cin.getline(buffer, sizeof(buffer)); return buffer; } return getenv("PATH_INFO"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/cgi.h������������������������������������������������������������������������0100644�0063146�0012731�00000001273�10055635540�015130� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // cgi.h // // cgi: Parse cgi arguments and put them in a dictionary. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: cgi.h,v 1.4 2004/05/28 13:15:12 lha Exp $ // #ifndef _cgi_h_ #define _cgi_h_ class Dictionary; class cgi { public: cgi(); cgi(char *s); ~cgi(); char *operator [] (char *); char *get(char *); int exists(char *); char *path(); private: Dictionary *pairs; int query; void init(char *s); }; #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/conf_lexer.cxx���������������������������������������������������������������0100644�0063146�0012731�00000146366�10063260373�017077� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#line 2 "conf_lexer.cxx" #line 4 "conf_lexer.cxx" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 31 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #include <inttypes.h> typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 22 #define YY_END_OF_BUFFER 23 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[63] = { 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 23, 21, 3, 20, 11, 5, 8, 8, 3, 2, 19, 21, 3, 18, 14, 14, 10, 14, 17, 6, 7, 9, 3, 8, 8, 3, 2, 19, 0, 0, 1, 3, 14, 14, 0, 14, 14, 10, 15, 17, 9, 8, 12, 13, 13, 8, 8, 8, 8, 0, 4, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 6, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 5, 11, 5, 12, 5, 5, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 5, 14, 5, 5, 13, 5, 13, 13, 15, 16, 17, 13, 13, 13, 18, 13, 13, 19, 13, 20, 13, 13, 13, 13, 13, 13, 21, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } ; static yyconst flex_int32_t yy_meta[22] = { 0, 1, 2, 3, 1, 4, 4, 4, 5, 5, 4, 6, 6, 5, 4, 5, 5, 5, 5, 5, 5, 5 } ; static yyconst flex_int16_t yy_base[73] = { 0, 0, 20, 27, 41, 55, 59, 61, 0, 78, 89, 87, 183, 84, 183, 183, 183, 0, 65, 100, 82, 0, 80, 80, 183, 64, 107, 23, 32, 0, 183, 183, 0, 75, 0, 61, 0, 0, 0, 72, 68, 183, 68, 54, 35, 61, 121, 62, 25, 183, 0, 0, 35, 183, 47, 0, 31, 35, 9, 38, 64, 183, 183, 135, 141, 147, 20, 153, 156, 162, 165, 171, 176 } ; static yyconst flex_int16_t yy_def[73] = { 0, 62, 1, 63, 63, 64, 64, 1, 7, 65, 65, 62, 62, 62, 62, 62, 62, 66, 66, 62, 19, 20, 67, 62, 62, 68, 69, 68, 68, 70, 62, 62, 71, 62, 66, 66, 19, 20, 20, 67, 67, 62, 62, 68, 68, 72, 69, 46, 68, 62, 70, 71, 66, 62, 72, 46, 66, 66, 66, 66, 62, 62, 0, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62 } ; static yyconst flex_int16_t yy_nxt[205] = { 0, 12, 13, 14, 12, 12, 12, 12, 12, 12, 15, 16, 12, 17, 12, 17, 17, 17, 18, 17, 17, 17, 19, 20, 21, 34, 59, 22, 12, 23, 24, 12, 48, 26, 48, 49, 27, 44, 53, 44, 60, 28, 12, 23, 24, 12, 44, 26, 61, 44, 27, 58, 57, 54, 56, 28, 12, 13, 12, 12, 12, 13, 12, 12, 24, 53, 60, 54, 44, 30, 42, 41, 12, 31, 61, 41, 52, 33, 44, 17, 13, 12, 42, 41, 38, 35, 33, 62, 62, 12, 12, 13, 12, 62, 62, 62, 62, 62, 62, 62, 12, 12, 36, 37, 38, 62, 62, 39, 45, 45, 62, 45, 62, 62, 62, 62, 62, 62, 62, 62, 62, 47, 45, 45, 62, 45, 62, 55, 62, 62, 62, 62, 62, 62, 62, 47, 25, 25, 25, 25, 25, 25, 29, 29, 29, 29, 29, 29, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 40, 43, 43, 43, 46, 46, 62, 46, 46, 46, 50, 50, 50, 51, 62, 62, 51, 51, 45, 45, 62, 45, 45, 45, 11, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62 } ; static yyconst flex_int16_t yy_chk[205] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 66, 58, 2, 3, 3, 3, 3, 27, 3, 48, 28, 3, 27, 44, 48, 59, 3, 4, 4, 4, 4, 28, 4, 59, 44, 4, 57, 56, 54, 52, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 47, 60, 45, 43, 7, 42, 40, 7, 7, 60, 39, 35, 33, 25, 7, 9, 9, 23, 22, 20, 18, 13, 11, 0, 9, 9, 10, 10, 0, 0, 0, 0, 0, 0, 0, 10, 10, 19, 19, 19, 0, 0, 19, 26, 26, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 46, 46, 0, 46, 0, 46, 0, 0, 0, 0, 0, 0, 0, 46, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 67, 67, 67, 67, 67, 67, 68, 68, 68, 69, 69, 0, 69, 69, 69, 70, 70, 70, 71, 0, 0, 71, 71, 72, 72, 0, 72, 72, 72, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[23] = { 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "conf_lexer.lxx" /* // // conf_lexer.lxx // // This lexical parser is used to parse ht://Dig config // files. // // Note: The resulting .cxx file produces warnings of unused // labels. As at 2003-06-02, these have been manually // removed, but they will reappear when (f)lex is re-run. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: conf_lexer.cxx,v 1.11 2004/06/10 14:48:38 angusgb Exp $ // */ #line 22 "conf_lexer.lxx" #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #line 34 "conf_lexer.lxx" #ifdef HAVE_STRINGS_H #include <strings.h> #endif #include "HtConfiguration.h" //#include "Dictionary.h" #include "conf_parser.h" #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; String *name_stack[MAX_INCLUDE_DEPTH]; int lineno_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; #line 571 "conf_lexer.cxx" #define INITIAL 0 #define t_right 1 #define incl 2 #define bracket 3 #define br_string 4 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include <unistd.h> #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 52 "conf_lexer.lxx" #line 730 "conf_lexer.cxx" if ( (yy_init) ) { (yy_init) = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 183 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) yylineno++; ; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 54 "conf_lexer.lxx" /* Ignore comments */ YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 55 "conf_lexer.lxx" /* Ignore empty lines */ YY_BREAK case 3: YY_RULE_SETUP #line 56 "conf_lexer.lxx" /* Ignore spaces */ YY_BREAK case 4: YY_RULE_SETUP #line 57 "conf_lexer.lxx" BEGIN(incl); YY_BREAK case 5: YY_RULE_SETUP #line 58 "conf_lexer.lxx" { BEGIN(bracket); return(T_LEFT_BR); } YY_BREAK case 6: YY_RULE_SETUP #line 59 "conf_lexer.lxx" return(T_SLASH); YY_BREAK case 7: YY_RULE_SETUP #line 60 "conf_lexer.lxx" return(T_RIGHT_BR); YY_BREAK case 8: YY_RULE_SETUP #line 61 "conf_lexer.lxx" { //yylval.str = (char *)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_KEYWORD); } YY_BREAK case 9: YY_RULE_SETUP #line 67 "conf_lexer.lxx" { BEGIN(bracket); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } YY_BREAK case 10: YY_RULE_SETUP #line 74 "conf_lexer.lxx" { //yylval.str = (char*)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_NUMBER); } YY_BREAK case 11: YY_RULE_SETUP #line 81 "conf_lexer.lxx" { if (YY_START==bracket) BEGIN(br_string); else BEGIN(t_right); return(T_DELIMITER); } YY_BREAK case 12: /* rule 12 can match eol */ YY_RULE_SETUP #line 89 "conf_lexer.lxx" { //yylval.str = (char *)malloc(yyleng+1-2); yylval.str = new char[yyleng+1-2]; //strcpy(yylval.str,yytext); memcpy(yylval.str,yytext,yyleng-2); yylval.str[yyleng-2]='\0'; return(T_STRING); } YY_BREAK case 13: YY_RULE_SETUP #line 98 "conf_lexer.lxx" { yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } YY_BREAK case 14: YY_RULE_SETUP #line 104 "conf_lexer.lxx" { //yylval.str = (char *)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP #line 110 "conf_lexer.lxx" YY_BREAK /* Ignore newline after "\" */ case 16: YY_RULE_SETUP #line 114 "conf_lexer.lxx" YY_BREAK /* Ignore spaces */ case 17: YY_RULE_SETUP #line 118 "conf_lexer.lxx" { /* got the include file name */ if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) { fprintf(stderr,"Includes nested too deeply\n"); // exit(1); // Seems too harsh! return(T_NEWLINE); } include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; HtConfiguration* config= HtConfiguration::config(); // handle ${var} in file name String ParsedFilename = config->ParseString(yytext); if (ParsedFilename[0] != '/') { // Given file name not fully qualified // so strip dir. name from current one String str; if (include_stack_ptr > 1) str = *name_stack[include_stack_ptr-2]; else // still at top level config str = config->getFileName(); int len = str.lastIndexOf('/') + 1; if (len > 0) { // Current name has directory path // component, so use it for new name str.chop(str.length() - len); str << ParsedFilename; ParsedFilename = str; } } yyin = fopen( ParsedFilename.get(), "r" ); if ( ! yyin ) { fprintf(stderr,"can't find file: %s\n",yytext); // exit(1); // Seems too harsh! include_stack_ptr--; return(T_NEWLINE); } name_stack[include_stack_ptr-1] = new String(ParsedFilename.get()); lineno_stack[include_stack_ptr-1] = yylineno; yylineno = 1; yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) ); BEGIN(INITIAL); } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(t_right): case YY_STATE_EOF(incl): case YY_STATE_EOF(bracket): case YY_STATE_EOF(br_string): #line 168 "conf_lexer.lxx" { if ( include_stack_ptr <= 0 ) { static int termnext = 0; // fix to allow unterminated final line if (++termnext <= 1) return(T_NEWLINE); termnext = 0; // in case we're called again yyterminate(); } else { delete name_stack[include_stack_ptr-1]; yylineno = lineno_stack[include_stack_ptr-1]; yy_delete_buffer(YY_CURRENT_BUFFER ); yy_switch_to_buffer(include_stack[--include_stack_ptr] ); } } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 189 "conf_lexer.lxx" { BEGIN(INITIAL); return(T_NEWLINE); } YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 193 "conf_lexer.lxx" YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP #line 195 "conf_lexer.lxx" YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP #line 196 "conf_lexer.lxx" { HtConfiguration* config= HtConfiguration::config(); String str; if (include_stack_ptr > 0) str = *name_stack[include_stack_ptr-1]; else // still at top level config str = config->getFileName(); fprintf(stderr,"Unknown char in file %s line %d: %s\n",str.get(),yylineno,yytext); // exit(1); // Seems too harsh! } YY_BREAK case 22: YY_RULE_SETUP #line 206 "conf_lexer.lxx" ECHO; YY_BREAK #line 1070 "conf_lexer.cxx" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 62); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) yylineno++; ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param str a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) { return yy_scan_bytes(yy_str,strlen(yy_str) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #undef YY_NEW_FILE #undef YY_FLUSH_BUFFER #undef yy_set_bol #undef yy_new_buffer #undef yy_set_interactive #undef yytext_ptr #undef YY_DO_BEFORE_ACTION #ifdef YY_DECL_IS_OURS #undef YY_DECL_IS_OURS #undef YY_DECL #endif #line 206 "conf_lexer.lxx" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/conf_lexer.lxx���������������������������������������������������������������0100644�0063146�0012731�00000012755�10062072306�017076� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* // // conf_lexer.lxx // // This lexical parser is used to parse ht://Dig config // files. // // Note: The resulting .cxx file produces warnings of unused // labels. As at 2003-06-02, these have been manually // removed, but they will reappear when (f)lex is re-run. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: conf_lexer.lxx,v 1.12 2004/06/10 14:48:38 angusgb Exp $ // */ %{ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ %} %option yylineno noyywrap nounput %x t_right %x incl %x bracket %x br_string %{ #ifdef HAVE_STRINGS_H #include <strings.h> #endif #include "HtConfiguration.h" //#include "Dictionary.h" #include "conf_parser.h" #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; String *name_stack[MAX_INCLUDE_DEPTH]; int lineno_stack[MAX_INCLUDE_DEPTH]; int include_stack_ptr = 0; %} KEYWORD [a-zA-Z_][a-zA-Z_0-9/]* NUMBER [0-9]+ STRING [\x21-\xff]+ BR_STRING [^ \n\t<>]+ %% ^[[:space:]]*#.*\n /* Ignore comments */ ^[[:space:]]*\n /* Ignore empty lines */ <*>[ \t]+ /* Ignore spaces */ include[ \t]*: BEGIN(incl); "<" { BEGIN(bracket); return(T_LEFT_BR); } <bracket>"/" return(T_SLASH); <bracket>">" return(T_RIGHT_BR); <INITIAL,bracket>{KEYWORD} { //yylval.str = (char *)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_KEYWORD); } <br_string>{BR_STRING} { BEGIN(bracket); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } <t_right>{NUMBER} { //yylval.str = (char*)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_NUMBER); } <INITIAL,bracket>: { if (YY_START==bracket) BEGIN(br_string); else BEGIN(t_right); return(T_DELIMITER); } <t_right>{STRING}\\\n { //yylval.str = (char *)malloc(yyleng+1-2); yylval.str = new char[yyleng+1-2]; //strcpy(yylval.str,yytext); memcpy(yylval.str,yytext,yyleng-2); yylval.str[yyleng-2]='\0'; return(T_STRING); } <t_right>"\""[^\n]+"\"" { yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } <t_right>{STRING} { //yylval.str = (char *)malloc(yyleng+1); yylval.str = new char[yyleng+1]; strcpy(yylval.str,yytext); return(T_STRING); } <t_right>\\\n { /* Ignore newline after "\" */ } <t_right>[ \t]* { /* Ignore spaces */ } <incl>{STRING} { /* got the include file name */ if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) { fprintf(stderr,"Includes nested too deeply\n"); // exit(1); // Seems too harsh! return(T_NEWLINE); } include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; HtConfiguration* config= HtConfiguration::config(); // handle ${var} in file name String ParsedFilename = config->ParseString(yytext); if (ParsedFilename[0] != '/') { // Given file name not fully qualified // so strip dir. name from current one String str; if (include_stack_ptr > 1) str = *name_stack[include_stack_ptr-2]; else // still at top level config str = config->getFileName(); int len = str.lastIndexOf('/') + 1; if (len > 0) { // Current name has directory path // component, so use it for new name str.chop(str.length() - len); str << ParsedFilename; ParsedFilename = str; } } yyin = fopen( ParsedFilename.get(), "r" ); if ( ! yyin ) { fprintf(stderr,"can't find file: %s\n",yytext); // exit(1); // Seems too harsh! include_stack_ptr--; return(T_NEWLINE); } name_stack[include_stack_ptr-1] = new String(ParsedFilename.get()); lineno_stack[include_stack_ptr-1] = yylineno; yylineno = 1; yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) ); BEGIN(INITIAL); } <<EOF>> { if ( include_stack_ptr <= 0 ) { static int termnext = 0; // fix to allow unterminated final line if (++termnext <= 1) return(T_NEWLINE); termnext = 0; // in case we're called again yyterminate(); } else { delete name_stack[include_stack_ptr-1]; yylineno = lineno_stack[include_stack_ptr-1]; yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer( include_stack[--include_stack_ptr] ); } } <bracket,t_right>\n { BEGIN(INITIAL); return(T_NEWLINE); } ^[[:space:]]+ \n <*>.|\n { HtConfiguration* config= HtConfiguration::config(); String str; if (include_stack_ptr > 0) str = *name_stack[include_stack_ptr-1]; else // still at top level config str = config->getFileName(); fprintf(stderr,"Unknown char in file %s line %d: %s\n",str.get(),yylineno,yytext); // exit(1); // Seems too harsh! } %% �������������������htdig-3.2.0b6/htcommon/conf_parser.cxx��������������������������������������������������������������0100644�0063146�0012731�00000117207�10063260373�017244� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* A Bison parser, made by GNU Bison 1.875c. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUM = 258, T_DELIMITER = 259, T_NEWLINE = 260, T_RIGHT_BR = 261, T_LEFT_BR = 262, T_SLASH = 263, T_STRING = 264, T_KEYWORD = 265, T_NUMBER = 266 }; #endif #define NUM 258 #define T_DELIMITER 259 #define T_NEWLINE 260 #define T_RIGHT_BR 261 #define T_LEFT_BR 262 #define T_SLASH 263 #define T_STRING 264 #define T_KEYWORD 265 #define T_NUMBER 266 /* Copy the first part of user declarations. */ #line 1 "conf_parser.yxx" // // conf_parser.yxx // // This syntax analyzer is used to parse ht://Dig config // files. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: conf_parser.cxx,v 1.7 2004/06/10 14:48:38 angusgb Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ /* Bison version > 1.25 needed */ /* TODO: 1. Better error handling 2. ? */ #include <stdio.h> /* for debug */ #include <stdlib.h> #ifdef HAVE_STD #include <iostream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <iostream.h> #endif /* HAVE_STD */ #include "HtConfiguration.h" #include "htString.h" /*#define YYDEBUG 1*/ #define YYPARSE_PARAM aConf int yyerror(char *s); int yylex(void); #undef DEBUG #ifdef DEBUG int sn_debug=3; #endif /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 50 "conf_parser.yxx" typedef union YYSTYPE { char *str; ConfigDefaults *ConfLine; HtConfiguration *ConfLines; } YYSTYPE; /* Line 191 of yacc.c. */ #line 153 "conf_parser.cxx" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 214 of yacc.c. */ #line 165 "conf_parser.cxx" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # endif # else # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 31 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 12 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 7 /* YYNRULES -- Number of rules. */ #define YYNRULES 20 /* YYNRULES -- Number of states. */ #define YYNSTATES 37 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 266 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned char yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 18, 23, 28, 32, 45, 47, 50, 52, 55, 58, 61, 64, 67 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yysigned_char yyrhs[] = { 13, 0, -1, -1, 13, 14, -1, 15, -1, 16, -1, 5, -1, 10, 4, 9, 5, -1, 10, 4, 11, 5, -1, 10, 4, 18, 5, -1, 10, 4, 5, -1, 7, 10, 4, 9, 6, 5, 17, 7, 8, 10, 6, 5, -1, 15, -1, 17, 15, -1, 5, -1, 9, 9, -1, 11, 9, -1, 9, 11, -1, 11, 11, -1, 18, 9, -1, 18, 11, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned char yyrline[] = { 0, 65, 65, 66, 69, 81, 87, 90, 100, 106, 112, 122, 143, 161, 173, 176, 189, 202, 215, 228, 240 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "NUM", "T_DELIMITER", "T_NEWLINE", "T_RIGHT_BR", "T_LEFT_BR", "T_SLASH", "T_STRING", "T_KEYWORD", "T_NUMBER", "$accept", "input", "block", "simple_expression", "complex_expression", "simple_expression_list", "list", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 17, 17, 17, 18, 18, 18, 18, 18, 18 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 4, 4, 4, 3, 12, 1, 2, 1, 2, 2, 2, 2, 2, 2 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 2, 0, 1, 6, 0, 0, 3, 4, 5, 0, 0, 0, 10, 0, 0, 0, 0, 7, 15, 17, 8, 16, 18, 9, 19, 20, 0, 0, 14, 12, 0, 0, 13, 0, 0, 0, 11 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yysigned_char yydefgoto[] = { -1, 1, 6, 7, 8, 30, 15 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -8 static const yysigned_char yypact[] = { -8, 0, -8, -8, -7, 16, -8, -8, -8, 20, -3, 2, -8, 4, 7, 12, 21, -8, -8, -8, -8, -8, -8, -8, -8, -8, 23, 9, -8, -8, -6, 18, -8, 19, 24, 26, -8 }; /* YYPGOTO[NTERM-NUM]. */ static const yysigned_char yypgoto[] = { -8, -8, -8, -5, -8, -8, -8 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const unsigned char yytable[] = { 2, 31, 12, 9, 5, 3, 13, 4, 14, 17, 5, 16, 20, 18, 28, 19, 21, 23, 22, 5, 10, 24, 29, 25, 11, 32, 33, 26, 27, 34, 35, 36 }; static const unsigned char yycheck[] = { 0, 7, 5, 10, 10, 5, 9, 7, 11, 5, 10, 9, 5, 9, 5, 11, 9, 5, 11, 10, 4, 9, 27, 11, 4, 30, 8, 6, 5, 10, 6, 5 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 13, 0, 5, 7, 10, 14, 15, 16, 10, 4, 4, 5, 9, 11, 18, 9, 5, 9, 11, 5, 9, 11, 5, 9, 11, 6, 5, 5, 15, 17, 7, 15, 8, 10, 6, 5 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ ((Current).first_line = (Rhs)[1].first_line, \ (Current).first_column = (Rhs)[1].first_column, \ (Current).last_line = (Rhs)[N].last_line, \ (Current).last_column = (Rhs)[N].last_column) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) # define YYDSYMPRINTF(Title, Token, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yysymprint (stderr, \ Token, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_stack_print (short *bottom, short *top) #else static void yy_stack_print (bottom, top) short *bottom; short *top; #endif { YYFPRINTF (stderr, "Stack now"); for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yy_reduce_print (int yyrule) #else static void yy_reduce_print (yyrule) int yyrule; #endif { int yyi; unsigned int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) # define YYDSYMPRINTF(Title, Token, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) #else static void yysymprint (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif } else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyoutput, ")"); } #endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ #if defined (__STDC__) || defined (__cplusplus) static void yydestruct (int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yytype, yyvaluep) int yytype; YYSTYPE *yyvaluep; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvaluep; switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM) # else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else int yyparse () #endif #endif { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 3: #line 66 "conf_parser.yxx" { /* Whole config file */ ;} break; case 4: #line 69 "conf_parser.yxx" { // name: value ((HtConfiguration *)aConf)->AddParsed(yyvsp[0].ConfLine->name,yyvsp[0].ConfLine->value); #ifdef DEBUG if (sn_debug>=2) { cout<<"Added to conf: "<<yyvsp[0].ConfLine->name<<":"<<yyvsp[0].ConfLine->value<<endl; } #endif delete [] yyvsp[0].ConfLine->name; delete [] yyvsp[0].ConfLine->value; delete yyvsp[0].ConfLine; ;} break; case 5: #line 81 "conf_parser.yxx" { // <server www.gc.lviv.ua> // server_max_docs: 456 // ... : ... // </server> ;} break; case 6: #line 87 "conf_parser.yxx" { /* Ignore empty lines */ ;} break; case 7: #line 90 "conf_parser.yxx" { // locale: uk_UA.KOI8-U // // We can't do inserting into config // here because we don't know if it's // in complex expression or not. yyval.ConfLine=new ConfigDefaults; yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str; ;} break; case 8: #line 100 "conf_parser.yxx" { // max_head_length: 300000 // yyval.ConfLine=new ConfigDefaults; yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str; ;} break; case 9: #line 106 "conf_parser.yxx" { // bad_extensions: .XLS .xls .pdf .PDF .doc .DOC // yyval.ConfLine=new ConfigDefaults; yyval.ConfLine->name = yyvsp[-3].str; yyval.ConfLine->value=yyvsp[-1].str; ;} break; case 10: #line 112 "conf_parser.yxx" { // excude_urls: // yyval.ConfLine=new ConfigDefaults; yyval.ConfLine->name = yyvsp[-2].str; yyval.ConfLine->value=new char[1]; *yyval.ConfLine->value='\0'; ;} break; case 11: #line 122 "conf_parser.yxx" { // check if "<param> ... </param>" are equal if (strcmp(yyvsp[-10].str,yyvsp[-2].str)!=0) { // todo: setup error string, return with error. // Inform about line number cerr<<"Brackets mismatch: Opened: "<<yyvsp[-10].str<<" Closed: "<<yyvsp[-2].str<<endl; // exit(1); } // Oll right. Append set of parameters to object($2) ((HtConfiguration *)aConf)->Add(yyvsp[-10].str,yyvsp[-8].str,yyvsp[-5].ConfLines); #ifdef DEBUG if (sn_debug >= 2) { cout<<"Added to conf: "<<yyvsp[-10].str<<":"<<yyvsp[-8].str<<":"<<yyvsp[-5].ConfLines<<endl; } #endif delete yyvsp[-10].str; delete yyvsp[-8].str; delete [] yyvsp[-2].str; ;} break; case 12: #line 143 "conf_parser.yxx" { //aaa: nnn //bbb: ccc // ... // // First entry. We need to create conf to store it. HtConfiguration *expressionList=new HtConfiguration(); expressionList->AddParsed(yyvsp[0].ConfLine->name,yyvsp[0].ConfLine->value); yyval.ConfLines=expressionList; #ifdef DEBUG if (sn_debug>=2) { cout<<"Create list of properties: "<<expressionList<<endl; } #endif delete yyvsp[0].ConfLine->name; delete yyvsp[0].ConfLine->value; delete yyvsp[0].ConfLine; ;} break; case 13: #line 161 "conf_parser.yxx" { yyvsp[-1].ConfLines->AddParsed(yyvsp[0].ConfLine->name,yyvsp[0].ConfLine->value); #ifdef DEBUG if (sn_debug>=2) { cout<<yyvsp[0].ConfLine->name<<":"<<yyvsp[0].ConfLine->value<<" added to "<<yyvsp[-1].ConfLines<<endl; } #endif delete yyvsp[0].ConfLine->name; delete yyvsp[0].ConfLine->value; delete yyvsp[0].ConfLine; //$$=$1; //I think $$==$1 ;} break; case 14: #line 173 "conf_parser.yxx" { /* Ignore empty lines */ ;} break; case 15: #line 176 "conf_parser.yxx" { // Paste 2 components. Reallocate memory for 2 components. if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy(yyval.str,yyvsp[-1].str); strcat(yyval.str," "); // Delimiter in list strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[-1].str; delete [] yyvsp[0].str; ;} break; case 16: #line 189 "conf_parser.yxx" { // Paste 2 components. Reallocate memory for 2 components. if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy(yyval.str,yyvsp[-1].str); strcat(yyval.str," "); // Delimiter in list strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[-1].str; delete [] yyvsp[0].str; ;} break; case 17: #line 202 "conf_parser.yxx" { // Paste 2 components. Reallocate memory for 2 components. if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy(yyval.str,yyvsp[-1].str); strcat(yyval.str," "); // Delimiter in list strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[-1].str; delete [] yyvsp[0].str; ;} break; case 18: #line 215 "conf_parser.yxx" { // Paste 2 components. Reallocate memory for 2 components. if ((yyval.str=new char[strlen(yyvsp[-1].str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy(yyval.str,yyvsp[-1].str); strcat(yyval.str," "); // Delimiter in list strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[-1].str; delete [] yyvsp[0].str; ;} break; case 19: #line 228 "conf_parser.yxx" { char *old=yyval.str; if ((yyval.str=new char [strlen(yyval.str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't reallocate memory\n"); exit(1); } strcpy(yyval.str,old); delete [] old; strcat(yyval.str," "); strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[0].str; ;} break; case 20: #line 240 "conf_parser.yxx" { char *old=yyval.str; if ((yyval.str=new char [strlen(yyval.str)+strlen(yyvsp[0].str)+1+1])==NULL) { fprintf(stderr,"Can't reallocate memory\n"); exit(1); } strcpy(yyval.str,old); delete [] old; strcat(yyval.str," "); strcat(yyval.str,yyvsp[0].str); delete [] yyvsp[0].str; ;} break; } /* Line 1000 of yacc.c. */ #line 1309 "conf_parser.cxx" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 253 "conf_parser.yxx" int yyerror (char *s) /* Called by yyparse on error */ { extern int yylineno; extern int include_stack_ptr; extern String *name_stack[]; HtConfiguration* config= HtConfiguration::config(); String str; if (include_stack_ptr > 0) str = *name_stack[include_stack_ptr-1]; else // still at top level config str = config->getFileName(); //fprintf (stderr, "%s\nIn line %d\n",s,yylineno); fprintf(stderr,"Error in file %s line %d: %s\n",str.get(),yylineno,s); // exit(1); return -1; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/conf_parser.h����������������������������������������������������������������0100644�0063146�0012731�00000004022�07706720512�016665� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* A Bison parser, made by GNU Bison 1.875a. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUM = 258, T_DELIMITER = 259, T_NEWLINE = 260, T_RIGHT_BR = 261, T_LEFT_BR = 262, T_SLASH = 263, T_STRING = 264, T_KEYWORD = 265, T_NUMBER = 266 }; #endif #define NUM 258 #define T_DELIMITER 259 #define T_NEWLINE 260 #define T_RIGHT_BR 261 #define T_LEFT_BR 262 #define T_SLASH 263 #define T_STRING 264 #define T_KEYWORD 265 #define T_NUMBER 266 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) typedef union YYSTYPE { char *str; ConfigDefaults *ConfLine; HtConfiguration *ConfLines; } YYSTYPE; /* Line 1240 of yacc.c. */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/conf_parser.yxx��������������������������������������������������������������0100644�0063146�0012731�00000015033�10062072307�017261� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%{ // // conf_parser.yxx // // This syntax analyzer is used to parse ht://Dig config // files. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: conf_parser.yxx,v 1.8 2004/06/10 14:48:39 angusgb Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ /* Bison version > 1.25 needed */ /* TODO: 1. Better error handling 2. ? */ #include <stdio.h> /* for debug */ #include <stdlib.h> #ifdef HAVE_STD #include <iostream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <iostream.h> #endif /* HAVE_STD */ #include "HtConfiguration.h" #include "htString.h" /*#define YYDEBUG 1*/ #define YYPARSE_PARAM aConf int yyerror(char *s); int yylex(void); #undef DEBUG #ifdef DEBUG int sn_debug=3; #endif %} %union { char *str; ConfigDefaults *ConfLine; HtConfiguration *ConfLines; } %token NUM T_DELIMITER T_NEWLINE T_RIGHT_BR T_LEFT_BR T_SLASH %token <str> T_STRING T_KEYWORD T_NUMBER %type <str> list %type <ConfLine> simple_expression %type <ConfLines> simple_expression_list /* Grammar follows */ %% input: | input block { /* Whole config file */ } ; block: simple_expression { // name: value ((HtConfiguration *)aConf)->AddParsed($1->name,$1->value); #ifdef DEBUG if (sn_debug>=2) { cout<<"Added to conf: "<<$1->name<<":"<<$1->value<<endl; } #endif delete [] $1->name; delete [] $1->value; delete $1; } | complex_expression { // <server www.gc.lviv.ua> // server_max_docs: 456 // ... : ... // </server> } | T_NEWLINE { /* Ignore empty lines */ } ; simple_expression: T_KEYWORD T_DELIMITER T_STRING T_NEWLINE { // locale: uk_UA.KOI8-U // // We can't do inserting into config // here because we don't know if it's // in complex expression or not. $$=new ConfigDefaults; $$->name = $1; $$->value=$3; } | T_KEYWORD T_DELIMITER T_NUMBER T_NEWLINE { // max_head_length: 300000 // $$=new ConfigDefaults; $$->name = $1; $$->value=$3; } | T_KEYWORD T_DELIMITER list T_NEWLINE { // bad_extensions: .XLS .xls .pdf .PDF .doc .DOC // $$=new ConfigDefaults; $$->name = $1; $$->value=$3; } | T_KEYWORD T_DELIMITER T_NEWLINE { // excude_urls: // $$=new ConfigDefaults; $$->name = $1; $$->value=new char[1]; *$$->value='\0'; } ; complex_expression: T_LEFT_BR T_KEYWORD T_DELIMITER T_STRING T_RIGHT_BR T_NEWLINE simple_expression_list T_LEFT_BR T_SLASH T_KEYWORD T_RIGHT_BR T_NEWLINE { // check if "<param> ... </param>" are equal if (strcmp($2,$10)!=0) { // todo: setup error string, return with error. // Inform about line number cerr<<"Brackets mismatch: Opened: "<<$2<<" Closed: "<<$10<<endl; // exit(1); } // Oll right. Append set of parameters to object($2) ((HtConfiguration *)aConf)->Add($2,$4,$7); #ifdef DEBUG if (sn_debug >= 2) { cout<<"Added to conf: "<<$2<<":"<<$4<<":"<<$7<<endl; } #endif delete $2; delete $4; delete [] $10; } ; simple_expression_list: simple_expression { //aaa: nnn //bbb: ccc // ... // // First entry. We need to create conf to store it. HtConfiguration *expressionList=new HtConfiguration(); expressionList->AddParsed($1->name,$1->value); $$=expressionList; #ifdef DEBUG if (sn_debug>=2) { cout<<"Create list of properties: "<<expressionList<<endl; } #endif delete $1->name; delete $1->value; delete $1; } | simple_expression_list simple_expression { $1->AddParsed($2->name,$2->value); #ifdef DEBUG if (sn_debug>=2) { cout<<$2->name<<":"<<$2->value<<" added to "<<$1<<endl; } #endif delete $2->name; delete $2->value; delete $2; //$$=$1; //I think $$==$1 } | T_NEWLINE { /* Ignore empty lines */ } ; list: T_STRING T_STRING { // Paste 2 components. Reallocate memory for 2 components. if (($$=new char[strlen($1)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy($$,$1); strcat($$," "); // Delimiter in list strcat($$,$2); delete [] $1; delete [] $2; } | T_NUMBER T_STRING { // Paste 2 components. Reallocate memory for 2 components. if (($$=new char[strlen($1)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy($$,$1); strcat($$," "); // Delimiter in list strcat($$,$2); delete [] $1; delete [] $2; } | T_STRING T_NUMBER { // Paste 2 components. Reallocate memory for 2 components. if (($$=new char[strlen($1)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy($$,$1); strcat($$," "); // Delimiter in list strcat($$,$2); delete [] $1; delete [] $2; } | T_NUMBER T_NUMBER { // Paste 2 components. Reallocate memory for 2 components. if (($$=new char[strlen($1)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't allocate memory\n"); exit(1); } strcpy($$,$1); strcat($$," "); // Delimiter in list strcat($$,$2); delete [] $1; delete [] $2; } | list T_STRING { char *old=$$; if (($$=new char [strlen($$)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't reallocate memory\n"); exit(1); } strcpy($$,old); delete [] old; strcat($$," "); strcat($$,$2); delete [] $2; } | list T_NUMBER { char *old=$$; if (($$=new char [strlen($$)+strlen($2)+1+1])==NULL) { fprintf(stderr,"Can't reallocate memory\n"); exit(1); } strcpy($$,old); delete [] old; strcat($$," "); strcat($$,$2); delete [] $2; } ; %% int yyerror (char *s) /* Called by yyparse on error */ { extern int yylineno; extern int include_stack_ptr; extern String *name_stack[]; HtConfiguration* config= HtConfiguration::config(); String str; if (include_stack_ptr > 0) str = *name_stack[include_stack_ptr-1]; else // still at top level config str = config->getFileName(); //fprintf (stderr, "%s\nIn line %d\n",s,yylineno); fprintf(stderr,"Error in file %s line %d: %s\n",str.get(),yylineno,s); // exit(1); return -1; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/defaults.cc������������������������������������������������������������������0100644�0063146�0012731�00000404317�10062603600�016327� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // defaults.cc // // defaults: default values for the ht programs through the // HtConfiguration class // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: defaults.cc,v 1.112 2004/06/12 13:39:12 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtConfiguration.h" // Fields and their values: // Attribute name // Default value ("" becomes "no default" in .html docs) // Type (boolean, number, integer, string, string list, quoted string list, // pattern list) // Commands using attribute (all, htdig, htsearch, htfuzzy, // htdump, htload, htnotify, htpurge) // Block (Global, Server, URL) // Versions for which attribute is present // Class (Extra Output, External:Parsers, External:Protocols, // File Layout, // Indexing:Connection, Indexing:Out, Indexing:What,Indexing:Where, // Presentation:Files, Presentation:How, Presentation:Text, // Searching:Method, Searching:Ranking, Searching:UI, // URLs) // Example // Description ConfigDefaults defaults[] = { { "accents_db", "${database_base}.accents.db", \ "string", "htfuzzy htsearch", "", "all", "File Layout", "accents_db: ${database_base}.uml.db", " \ The database file used for the fuzzy \"accents\" search \ algorithm. This database is created by \ <a href=\"htfuzzy.html\">htfuzzy</a> and used by \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a>. \ " }, \ { "accept_language", "", \ "string list", "htdig", "Server", "3.2.0b4", "Indexing:Out", "accept_language: en-us en it", " \ This attribute allows you to restrict the set of natural languages \ that are preferred as a response to an HTTP request performed by the \ digger. This can be done by putting one or more language tags \ (as defined by RFC 1766) in the preferred order, separated by spaces. \ By doing this, when the server performs a content negotiation based \ on the 'accept-language' given by the HTTP user agent, a different \ content can be shown depending on the value of this attribute. If \ set to an empty list, no language will be sent and the server default \ will be returned. \ " }, \ { "add_anchors_to_excerpt", "true", \ "boolean", "htsearch", "", "3.1.0", "Presentation:How", "add_anchors_to_excerpt: no", " \ If set to true, the first occurrence of each matched \ word in the excerpt will be linked to the closest \ anchor in the document. This only has effect if the \ <strong>EXCERPT</strong> variable is used in the output \ template and the excerpt is actually going to be displayed. \ " }, \ { "allow_double_slash", "false", \ "boolean", "htdig", "", "3.2.0b4", "Indexing:Out", "allow_double_slash: true", " \ If set to true, strings of multiple slashes ('/') in URL paths \ will be left intact, rather than being collapsed. This is necessary \ for some search engine URLs which use slashes to separate fields rather \ than to separate directory components. However, it can lead to multiple database \ entries refering to the same file, and it causes '/foo//../' to \ be equivalent to '/foo/', rather than to '/'. \ " }, \ { "allow_in_form", "", \ "string list", "htsearch", "", "3.1.0", "Searching:UI", "allow_in_form: search_algorithm search_results_header", " \ Allows the specified config file attributes to be specified \ in search forms as separate fields. This could be used to \ allow form writers to design their own headers and footers \ and specify them in the search form. Another example would \ be to offer a menu of search_algorithms in the form. \ <table> \ <tr> \ <td nowrap> \ <code> \   <SELECT NAME=\"search_algorithm\"><br> \   <OPTION VALUE=\"exact:1 prefix:0.6 synonyms:0.5 endings:0.1\" SELECTED>fuzzy<br> \   <OPTION VALUE=\"exact:1\">exact<br> \   </SELECT> \ </code></td> \ </tr> \ </table> \ The general idea behind this is to make an input parameter out \ of any configuration attribute that's not already automatically \ handled by an input parameter. You can even make up your own \ configuration attribute names, for purposes of passing data from \ the search form to the results output. You're not restricted to \ the existing attribute names. The attributes listed in the \ allow_in_form list will be settable in the search form using \ input parameters of the same name, and will be propagated to \ the follow-up search form in the results template using template \ variables of the same name in upper-case. \ You can also make select lists out of any of these input \ parameters, in the follow-up search form, using the \ <a href=\"#build_select_lists\">build_select_lists</a> \ configuration attribute. \ <br>WARNING: Extreme care are should be taken with this option, as \ allowing CGI scripts to set file names can open security holes.\ " }, \ { "allow_numbers", "false", \ "boolean", "htdig htsearch", "", "all", "Indexing:What", "allow_numbers: true", " \ If set to true, numbers are considered words. This \ means that searches can be done on strings of digits as well as \ regular words. All the same rules apply to numbers as \ to words. This does not cause numbers containing a decimal point or \ commas to be treated as a single entity. \ When allow_numbers is false, words are stil \ allowed to contain digits, but they must also contain at \ least one alphabetic character or \ <a href=\"#extra_word_characters\">extra word</a> character. \ To disallow digits in words, add the digits to \ <a href=\"#valid_punctuation\">valid_punctuation</a>. \ " }, \ { "allow_space_in_url", "false", \ "boolean", "htdig", "", "3.2.0b6", "Indexing:Where", "allow_space_in_url: true", " \ If set to true, htdig will handle URLs that contain \ embedded spaces. Technically, this is a violation of \ RFC 2396, which says spaces should be stripped out \ (as htdig does by default). However, many web browsers \ and HTML code generators violate this standard already, \ so enabling this attribute allows htdig to handle these \ non-compliant URLs. Even with this attribute set, htdig \ still strips out all white space (leading, trailing and \ embedded), except that space characters embedded within \ the URL will be encoded as %20. \ " }, \ { "allow_virtual_hosts", "true", \ "boolean", "htdig", "", "3.0.8b2", "Indexing:Where", "allow_virtual_hosts: false", " \ If set to true, htdig will index virtual web sites as \ expected. If false, all URL host names will be \ normalized into whatever the DNS server claims the IP \ address to map to. If this option is set to false, \ there is no way to index either \"soft\" or \"hard\" \ virtual web sites. \ " }, \ { "anchor_target", "", \ "string", "htsearch", "", "3.1.6", "Presentation:How", "anchor_target: body", " \ When the first matched word in the excerpt is linked \ to the closest anchor in the document, this string \ can be set to specify a target in the link so the \ resulting page is displayed in the desired frame. \ This value will only be used if the \ <a href=\"#add_anchors_to_excerpt\">add_anchors_to_excerpt</a> \ attribute is set to true, the <strong>EXCERPT</strong> \ variable is used in the output template and the \ excerpt is actually displayed with a link. \ " }, \ { "any_keywords", "false", \ "boolean", "htsearch", "", "3.2.0b2", "Searching:Method", "any_keywords: yes", " \ If set to true, the words in the <strong>keywords</strong> \ input parameter in the search form will be joined with logical \ ORs rather than ANDs, so that any of the words provided will do. \ Note that this has nothing to do with limiting the search to \ words in META keywords tags. See the <a href=\"hts_form.html\"> \ search form</a> documentation for details on this. \ " }, \ { "author_factor", "1", \ "number", "htsearch", "", "3.2.0b4", "Searching:Ranking", "author_factor: 1", " \ Weighting applied to words in a <meta name=\"author\" ... > \ tag.<br> \ See also <a href=\"#heading_factor\">heading_factor</a>. \ " }, \ { "authorization", "", \ "string", "htdig", "URL", "3.1.4", "Indexing:Out", "authorization: myusername:mypassword", " \ This tells htdig to send the supplied \ <em>username</em><strong>:</strong><em>password</em> with each HTTP request. \ The credentials will be encoded using the \"Basic\" authentication \ scheme. There <em>must</em> be a colon (:) between the username and \ password.<br> \ This attribute can also be specified on htdig's command line using \ the -u option, and will be blotted out so it won't show up in a \ process listing. If you use it directly in a configuration file, \ be sure to protect it so it is readable only by you, and do not \ use that same configuration file for htsearch. \ " }, \ { "backlink_factor", "0.1", \ "number", "htsearch", "", "3.1.0", "Searching:Ranking", "backlink_factor: 501.1", " \ This is a weight of \"how important\" a page is, based on \ the number of URLs pointing to it. It's actually \ multiplied by the ratio of the incoming URLs (backlinks) \ and outgoing URLs (links on the page), to balance out pages \ with lots of links to pages that link back to them. The ratio \ gives lower weight to \"link farms\", which often have many \ links to them. This factor can \ be changed without changing the database in any way. \ However, setting this value to something other than 0 \ incurs a slowdown on search results. \ " }, \ { "bad_extensions", ".wav .gz .z .sit .au .zip .tar .hqx .exe .com .gif .jpg .jpeg .aiff .class .map .ram .tgz .bin .rpm .mpg .mov .avi .css", \ "string list", "htdig", "URL", "all", "Indexing:Where", "bad_extensions: .foo .bar .bad", " \ This is a list of extensions on URLs which are \ considered non-parsable. This list is used mainly to \ supplement the MIME-types that the HTTP server provides \ with documents. Some HTTP servers do not have a correct \ list of MIME-types and so can advertise certain \ documents as text while they are some binary format. \ If the list is empty, then all extensions are acceptable, \ provided they pass other criteria for acceptance or rejection. \ See also <a href=\"#valid_extensions\">valid_extensions</a>. \ " }, \ { "bad_local_extensions", ".php .shtml .cgi", \ "string list", "htdig", "URL", "all", "Indexing:Where", "bad_extensions: .foo .bar .bad", " \ This is a list of extensions on URLs which must be retrieved \ using the URL's true transport mechanism (such as HTTP). \ If <a href=\"#local_urls\">local_urls</a> is specified, URLs not \ ending with these extensions may instead be retrieved through \ the local filesystem for efficiency. \ " }, { "bad_querystr", "", \ "pattern list", "htdig", "URL", "3.1.0", "Indexing:Where", "bad_querystr: forum=private section=topsecret&passwd=required", " \ This is a list of CGI query strings to be excluded from \ indexing. This can be used in conjunction with CGI-generated \ portions of a website to control which pages are \ indexed. \ " }, \ { "bad_word_list", "${common_dir}/bad_words", \ "string", "htdig htsearch", "", "all", "Indexing:What,Searching:Method", "bad_word_list: ${common_dir}/badwords.txt", " \ This specifies a file which contains words which should \ be excluded when digging or searching. This list should \ include the most common words or other words that you \ don't want to be able to search on (things like <em> \ sex</em> or <em>smut</em> are examples of these.)<br> \ The file should contain one word per line. A sample \ bad words file is located in the <code>contrib/examples</code> \ directory. \ " }, \ { "bin_dir", BIN_DIR, \ "string", "all", "", "all", "File Layout", "bin_dir: /usr/local/bin", " \ This is the directory in which the executables \ related to ht://Dig are installed. It is never used \ directly by any of the programs, but other attributes \ can be defined in terms of this one. \ <p> \ The default value of this attribute is determined at \ compile time. \ </p> \ " }, \ { "boolean_keywords", "and or not", \ "string list", "htsearch", "", "3.1.6", "Presentation:How", "boolean_keywords: et ou non", " \ These three strings are used as the keywords used in \ constructing the \ <a href=\"hts_templates.html#LOGICAL_WORDS\">LOGICAL_WORDS</a> \ template variable, \ and in parsing the <a href=\"hts_form.html#words\">words</a> input \ parameter when the <a href=\"hts_form.html#method\">method</a> \ parameter or <a href=\"#match_method\">match_method</a> attribute \ is set to <code>boolean</code>. \ See also the \ <a href=\"#boolean_syntax_errors\">boolean_syntax_errors</a> attribute. \ " }, { "boolean_syntax_errors", "Expected \ 'a search word, a quoted phrase or a boolean expression between ()' \ 'at the end' 'instead of' 'end of expression' quotes", \ "quoted string list", "htsearch", "", "3.1.6", "Presentation:How", "boolean_syntax_errors: Attendait \"un mot\" \"à la fin\" \ \"au lieu de\" \"fin d'expression\" \"guillemet\"", " \ These six strings are used as the keywords used to \ construct various syntax error messages for errors encountered in \ parsing the <a href=\"hts_form.html#words\">words</a> input \ parameter when the <a href=\"hts_form.html#method\">method</a> parameter \ or <a href=\"#match_method\">match_method</a> attribute \ is set to <code>boolean</code>. \ They are used in conjunction with the \ <a href=\"#boolean_keywords\">boolean_keywords</a> attribute, and \ comprise all \ English-specific parts of these error messages. The order in which \ the strings are put together may not be ideal, or even gramatically \ correct, for all languages, but they can be used to make fairly \ intelligible messages in many languages. \ " }, { "build_select_lists", "", \ "quoted string list", "htsearch", "", "3.2.0b1", "Searching:UI", "build_select_lists: \ MATCH_LIST matchesperpage matches_per_page_list \\<br> \ 1 1 1 matches_per_page \"Previous Amount\" \\<br> \ RESTRICT_LIST,multiple restrict restrict_names 2 1 2 restrict \"\" \\<br> \ FORMAT_LIST,radio format template_map 3 2 1 template_name \"\"", " \ This list allows you to define any htsearch input parameter as \ a select list for use in templates, provided you also define \ the corresponding name list attribute which enumerates all the \ choices to put in the list. It can be used for existing input \ parameters, as well as any you define using the \ <a href=\"#allow_in_form\">allow_in_form</a> \ attribute. The entries in this list each consist of an octuple, \ a set of eight strings defining the variables and how they are to \ be used to build a select list. The attribute can contain many \ of these octuples. The strings in the string list are merely \ taken eight at a time. For each octuple of strings specified in \ build_select_lists, the elements have the following meaning: \ <ol> \ <li>the name of the template variable to be defined as a list, \ optionally followed by a comma and the type of list, and \ optional formatting codes \ <li>the input parameter name that the select list will set \ <li>the name of the user-defined attribute containing the \ name list \ <li>the tuple size used in the name list above \ <li>the index into a name list tuple for the value \ <li>the index for the corresponding label on the selector \ <li>the configuration attribute where the default value for \ this input parameter is defined \ <li>the default label, if not an empty string, which will be \ used as the label for an additional list item for the current \ input parameter value if it doesn't match any value in the \ given list \ </ol> \ See the <a href=\"hts_selectors.html\">select list documentation</a> \ for more information on this attribute. \ " }, \ { "caps_factor", "1", \ "number", "htsearch", "", "??", "Searching:Ranking", "caps_factor: 1", " \ TO BE COMPLETED<br> \ See also <a href=\"#heading_factor\">heading_factor</a>. \ " }, \ { "case_sensitive", "true", \ "boolean", "htdig", "", "3.1.0b2", "Indexing:Where", "case_sensitive: false", " \ This specifies whether ht://Dig should consider URLs \ case-sensitive or not. If your server is case-insensitive, \ you should probably set this to false. <br> \ Even if this is false, \ <a href=\"#common_url_parts\">common_url_parts</a>, \ <a href=\"#url_part_aliases\">url_part_aliases</a> and \ <a href=\"#url_rewrite_rules\">url_rewrite_rules</a> \ are all still case sensitive, and \ <a href=\"#server_aliases\">server_aliases</a> \ is still case insensitive. \ " }, \ { "check_unique_date", "false", \ "boolean", "htdig", "Global", "3.2.0b3", "", "check_unique_date: false", " \ Include the modification date of the page in the MD5 hash, to reduce the \ problem with identical but physically separate pages in different parts of the tree pointing to \ different pages. \ " }, \ { "check_unique_md5", "false", \ "boolean", "htdig", "Global", "3.2.0b3", "", "check_unique_md5: false", " \ Uses the MD5 hash of pages to reject aliases, prevents multiple entries \ in the index caused by such things as symbolic links \ Note: May not do the right thing for incremental update \ " }, \ { "collection_names", "", \ "string list", "htsearch", "", "3.2.0b2", "", "collection_names: htdig_docs htdig_bugs", " \ This is a list of config file names that are used for searching multiple databases. \ Simply put, htsearch will loop through the databases specified by each of these config \ files and present the result of the search on all of the databases. \ The corresponding config files are looked up in the <a href=\"#config_dir\">config_dir</a> directory. \ Each listed config file <strong>must</strong> exist, as well as the corresponding databases. \ " }, \ { "common_dir", COMMON_DIR, \ "string", "all", "", "all", "File Layout", "common_dir: /tmp", " \ Specifies the directory for files that will or can be \ shared among different search databases. The default \ value for this attribute is defined at compile time. \ " }, \ { "common_url_parts", "http:// http://www. ftp:// ftp://ftp. /pub/ .html .htm .shtml /index.html /index.htm .com/ .com mailto:", \ "string list", "all", "", "3.1.0", "URLs", "common_url_parts: http://www.htdig.org/ml/ \\<br> \ .html \\<br> \ http://dev.htdig.org/ \\<br> \ http://www.htdig.org/", " \ Sub-strings often found in URLs stored in the \ database. These are replaced in the database by an \ internal space-saving encoding. If a string \ specified in <a href=\"#url_part_aliases\">url_part_aliases</a>, \ overlaps any string in common_url_parts, the \ common_url_parts string is ignored.<br> \ Note that when this attribute is changed, the \ database should be rebuilt, unless the effect of \ \"changing\" the affected URLs in the database is \ wanted.<br> \ " }, \ { "compression_level", "6", \ "integer", "htdig", "", "3.1.0", "Indexing:How", "compression_level: 0", " \ If non-zero and the \ <a href=\"http://www.cdrom.com/pub/infozip/zlib/\">zlib</a> \ compression library was available when compiled, \ this attribute controls the amount of compression used in the \ <a href=\"#doc_excerpt\">doc_excerpt</a> file. \ <br/>This must be in the range 0-9, and must be non-zero when \ <a href=\"#wordlist_compress_zlib\">wordlist_compress_zlib</a> \ is used. \ " }, \ { "config", "", \ "string", "all", "", "??", "File Layout", "", " \ Name of configuration file to load. \ For security reasons, restrictions are placed on the values which \ can be specified on the command line to \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a>. \ The default value of this attribute is determined at \ compile time. \ " }, \ { "config_dir", CONFIG_DIR, \ "string", "all", "", "all", "File Layout", "config_dir: /var/htdig/conf", " \ This is the directory which contains all configuration \ files related to ht://Dig. It is never used \ directly by any of the programs, but other attributes \ or the <a href=\"#include\">include</a> directive \ can be defined in terms of this one. \ <p> \ The default value of this attribute is determined at \ compile time. \ </p> \ " }, { "content_classifier", "${bin_dir}/HtFileType", \ "string", "htdig", "", "3.2.0b4", "Indexing:What", "content_classifier: file -i -b", " \ When ht://Dig can't determine the type of a <code>file://</code> \ URL from its extension, this program is used to determine the type. \ The program is called with one argument, the name of (possibly a \ temporary copy of) the file. \ <p> \ See also <a href=\"#mime_types\">mime_types</a>.\ </p> \ " }, \ { "cookies_input_file", "", \ "string", "htdig", "", "3.2.0b4", "Indexing:Connection", "cookies_input_file: ${common_dir}/cookies.txt", " \ Specifies the location of the file used for importing cookies \ for the crawl. These cookies will be preloaded into htdig's \ in-memory cookie jar, but aren't written back to the file. \ Cookies are specified according to Netscape's format \ (tab-separated fields). If this attribute is left blank, \ no cookie file will be read. \ For more information, see the sample cookies.txt file in the \ ht://Dig source distribution. \ " }, \ { "create_image_list", "false", \ "boolean", "htdig", "", "all", "Extra Output", "create_image_list: yes", " \ If set to true, a file with all the image URLs that \ were seen will be created, one URL per line. This list \ will not be in any order and there will be lots of \ duplicates, so after htdig has completed, it should be \ piped through <code>sort -u</code> to get a unique list. \ " }, \ { "create_url_list", "false", \ "boolean", "htdig", "", "all", "Extra Output", "create_url_list: yes", " \ If set to true, a file with all the URLs that were seen \ will be created, one URL per line. This list will not \ be in any order and there will be lots of duplicates, \ so after htdig has completed, it should be piped \ through <code>sort -u</code> to get a unique list. \ " }, \ { "database_base", "${database_dir}/db", \ "string", "all", "", "all", "File Layout", "database_base: ${database_dir}/sales", " \ This is the common prefix for files that are specific \ to a search database. Many different attributes use \ this prefix to specify filenames. Several search \ databases can share the same directory by just changing \ this value for each of the databases. \ " }, \ { "database_dir", DATABASE_DIR, \ "string", "all", "", "all", "File Layout", "database_dir: /var/htdig", " \ This is the directory which contains all database and \ other files related to ht://Dig. It is never used \ directly by any of the programs, but other attributes \ are defined in terms of this one. \ <p> \ The default value of this attribute is determined at \ compile time. \ </p> \ " }, \ { "date_factor", "0", \ "number", "htsearch", "", "3.1.0", "Searching:Ranking", "date_factor: 0.35", " \ This factor, gives higher \ rankings to newer documents and lower rankings to older \ documents. Before setting this factor, it's advised to \ make sure your servers are returning accurate dates \ (check the dates returned in the long format). \ Additionally, setting this to a nonzero value incurs a \ small performance hit on searching. \ " }, \ { "date_format", "", \ "string", "htsearch", "", "3.1.2", "Presentation:How", "date_format: %Y-%m-%d", " \ This format string determines the output format for \ modification dates of documents in the search results. \ It is interpreted by your system's <em>strftime</em> \ function. Please refer to your system's manual page \ for this function, for a description of available \ format codes. If this format string is empty, as it \ is by default, \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a> \ will pick a format itself. In this case, the <a \ href=\"#iso_8601\">iso_8601</a> attribute can be used \ to modify the appearance of the date. \ " }, \ { "description_factor", "150", \ "number", "htsearch", "", "3.1.0b3", "Searching:Ranking", "description_factor: 350", " \ Plain old \"descriptions\" are the text of a link pointing \ to a document. This factor gives weight to the words of \ these descriptions of the document. Not surprisingly, \ these can be pretty accurate summaries of a document's \ content. See also <a href=\"#heading_factor\">heading_factor</a> \ and <a href=\"#meta_description_factor\">meta_description_factor</a>. \ " }, \ { "description_meta_tag_names", "description", \ "string list", "htdig", "", "3.1.6", "Searching:Ranking", "description_meta_tag_names: \"description htdig-description\"", " \ The words in this list are used to search for descriptions in HTML \ <em>META</em> tags. This list can contain any number of strings \ that each will be seen as the name for whatever description \ convention is used. While words in any of the specified \ description contents will be indexed, only the last meta tag \ containing a description will be kept for the \ <a href=\"hts_templates.html#METADESCRIPTION\"METADESCRIPTION</a> \ variable in search results. The order in \ which the names are specified in this configuration attribute \ is irrelevant, as it is the order in which the tags appear in \ the documents that matters.<br> The <em>META</em> tags have the \ following format:<br> \ <tt>   <META name=\"<em>somename</em>\" \ content=\"<em>somevalue</em>\"> </tt><br> \ See also <a href=\"#meta_description_factor\">meta_description_factor</a>. \ " }, \ { "disable_cookies", "true", \ "boolean", "htdig", "Server", "3.2.0b4", "Indexing:Connection", "disable_cookies: true", " \ This option, if set to true, will disable HTTP cookies. \ " }, \ { "doc_db", "${database_base}.docdb", \ "string", "all", "", "all", "File Layout", "doc_db: ${database_base}documents.db", " \ This file will contain a Berkeley database of documents \ indexed by document number. It contains all the information \ gathered for each document, except the document excerpts \ which are stored in the <a href=\"#doc_excerpt\"><em> \ doc_excerpt</em></a> file. \ " }, \ { "doc_excerpt", "${database_base}.excerpts", \ "string", "all", "", "3.2.0b1", "File Layout", "doc_excerpt: ${database_base}excerpts.db", " \ This file will contain a Berkeley database of document excerpts \ indexed by document number. It contains all the text \ gathered for each document, so this file can become \ rather large if <a href=\"#max_head_length\"><em> \ max_head_length</em></a> is set to a large value. \ The size can be reduced by setting the \ <a href=\"#compression_level\"><em>compression_level</em></a>, \ if supported on your system. \ " }, \ { "doc_index", "${database_base}.docs.index", \ "string", "htdig", "", "all", "File Layout", "doc_index: documents.index.db", " \ This file contains a mapping of document numbers to URLs and is \ used by htdig during indexing. It is used on updates if it exists. \ " }, \ { "doc_list", "${database_base}.docs", \ "string", "htdig htdump htload", "", "all", "File Layout", "doc_list: /tmp/documents.text", " \ This file is basically a text version of the file \ specified in <em><a href=\"#doc_db\">doc_db</a></em>. Its \ only use is to have a human readable database of all \ documents. The file is easy to parse with tools like \ perl or tcl. \ " }, \ { "endday", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "endday: 31", " \ Day component of last date allowed as last-modified date \ of returned docutments. \ This is most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>. \ See also <a href=\"#startyear\">startyear</a>. \ " }, \ { "end_ellipses", "<strong><code> ...</code></strong>", \ "string", "htsearch", "", "all", "Presentation:Text", "end_ellipses: ...", " \ When excerpts are displayed in the search output, this \ string will be appended to the excerpt if there is text \ following the text displayed. This is just a visual \ reminder to the user that the excerpt is only part of \ the complete document. \ " }, \ { "end_highlight", "</strong>", \ "string", "htsearch", "", "3.1.4", "Presentation:Text", "end_highlight: </font>", " \ When excerpts are displayed in the search output, matched \ words will be highlighted using <a href=\"#start_highlight\"> \ start_highlight</a> and this string. \ You should ensure that highlighting tags are balanced, \ that is, this string should close any formatting \ tag opened by start_highlight. \ " }, \ { "endings_affix_file", "${common_dir}/english.aff", \ "string", "htfuzzy", "", "all", "File Layout", "endings_affix_file: /var/htdig/affix_rules", " \ Specifies the location of the file which contains the \ affix rules used to create the endings search algorithm \ databases. Consult the documentation on \ <a href=\"htfuzzy.html\">htfuzzy</a> for more information on the \ format of this file. \ " }, \ { "endings_dictionary", "${common_dir}/english.0", \ "string", "htfuzzy", "", "all", "File Layout", "endings_dictionary: /var/htdig/dictionary", " \ Specifies the location of the file which contains the \ dictionary used to create the endings search algorithm \ databases. Consult the documentation on \ <a href=\"htfuzzy.html\">htfuzzy</a> for more information on the \ format of this file. \ " }, \ { "endings_root2word_db", "${common_dir}/root2word.db", \ "string", "htfuzzy htsearch", "", "all", "File Layout", "endings_root2word_db: /var/htdig/r2w.db", " \ This attributes specifies the database filename to be \ used in the 'endings' fuzzy search algorithm. The \ database maps word roots to all legal words with that \ root. For more information about this and other fuzzy \ search algorithms, consult the \ <a href=\"htfuzzy.html\">htfuzzy</a> documentation.<br> \ Note that the default value uses the \ <a href=\"#common_dir\">common_dir</a> attribute instead of the \ <a href=\"#database_dir\">database_dir</a> attribute. \ This is because this database can be shared with \ different search databases. \ " }, \ { "endings_word2root_db", "${common_dir}/word2root.db", \ "string", "htfuzzy htsearch", "", "all", "File Layout", "endings_word2root_db: /var/htdig/w2r.bm", " \ This attributes specifies the database filename to be \ used in the 'endings' fuzzy search algorithm. The \ database maps words to their root. For more information \ about this and other fuzzy search algorithms, consult \ the <a href=\"htfuzzy.html\">htfuzzy</a> \ documentation.<br> \ Note that the default value uses the \ <a href=\"#common_dir\">common_dir</a> attribute instead of the \ <a href=\"#database_dir\">database_dir</a> attribute. \ This is because this database can be shared with \ different search databases. \ " }, \ { "endmonth", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "endmonth: 12", " \ Month component of last date allowed as last-modified date \ of returned docutments. \ This is most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>. \ See also <a href=\"#startyear\">startyear</a>. \ " }, \ { "endyear", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "endyear: 2002", " \ Year component of last date allowed as last-modified date \ of returned docutments. \ This is most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>. \ See also <a href=\"#startyear\">startyear</a>. \ " }, \ { "excerpt_length", "300", \ "integer", "htsearch", "", "all", "Presentation:How", "excerpt_length: 500", " \ This is the maximum number of characters the displayed \ excerpt will be limited to. The first matched word will \ be highlighted in the middle of the excerpt so that there is \ some surrounding context.<br> \ The <em><a href=\"#start_ellipses\"> \ start_ellipses</a></em> and \ <em><a href=\"#end_ellipses\">end_ellipses</a></em> are used to \ indicate that the document contains text before and \ after the displayed excerpt respectively. \ The <em><a href=\"#start_highlight\">start_highlight</a></em> and \ <em><a href=\"#end_highlight\">end_highlight</a></em> are used to \ specify what formatting tags are used to highlight matched words. \ " }, \ { "excerpt_show_top", "false", \ "boolean", "htsearch", "", "all", "Presentation:How", "excerpt_show_top: yes", " \ If set to true, the excerpt of a match will always show \ the top of the matching document. If it is false (the \ default), the excerpt will attempt to show the part of \ the document that actually contains one of the words. \ " }, \ { "exclude", "", \ "pattern list", "htsearch", "", "3.2.0b4", "Searching:Method", "exclude: myhost.com/mailarchive/", " \ If a URL contains any of the space separated patterns, it will be \ discarded in the searching phase. This is used to exclude certain \ URLs from search results. The list can be specified from within \ the configuration file, and can be overridden with the \"exclude\" \ input parameter in the search form. \ " }, \ { "exclude_urls", "/cgi-bin/ .cgi", \ "pattern list", "htdig", "URL", "all", "Indexing:Where", "exclude_urls: students.html cgi-bin", " \ If a URL contains any of the space separated patterns, \ it will be rejected. This is used to exclude such \ common things such as an infinite virtual web-tree \ which start with cgi-bin. \ " }, \ { "external_parsers", "", \ "quoted string list", "htdig", "", "3.0.7", "External:Parsers", "external_parsers: text/html /usr/local/bin/htmlparser \\<br> \ application/pdf /usr/local/bin/parse_doc.pl \\<br> \ application/msword->text/plain \"/usr/local/bin/mswordtotxt -w\" \\<br> \ application/x-gunzip->user-defined /usr/local/bin/ungzipper", " \ This attribute is used to specify a list of \ content-type/parsers that are to be used to parse \ documents that cannot by parsed by any of the internal \ parsers. The list of external parsers is examined \ before the builtin parsers are checked, so this can be \ used to override the internal behavior without \ recompiling htdig.<br> \ The external parsers are specified as pairs of \ strings. The first string of each pair is the \ content-type that the parser can handle while the \ second string of each pair is the path to the external \ parsing program. If quoted, it may contain parameters, \ separated by spaces.<br> \ External parsing can also be done with external \ converters, which convert one content-type to \ another. To do this, instead of just specifying \ a single content-type as the first string \ of a pair, you specify two types, in the form \ <em>type1</em><strong>-></strong><em>type2</em>, \ as a single string with no spaces. The second \ string will define an external converter \ rather than an external parser, to convert \ the first type to the second. If the second \ type is <strong>user-defined</strong>, then \ it's up to the converter script to put out a \ \"Content-Type: <em>type</em>\" header followed \ by a blank line, to indicate to htdig what type it \ should expect for the output, much like what a CGI \ script would do. The resulting content-type must \ be one that htdig can parse, either internally, \ or with another external parser or converter.<br> \ Only one external parser or converter can be \ specified for any given content-type. However, \ an external converter for one content-type can be \ chained to the internal parser for the same type, \ by appending <strong>-internal</strong> to the \ second type string (e.g. text/html->text/html-internal) \ to perform external preprocessing on documents of \ this type before internal parsing. \ There are two internal parsers, for text/html and \ text/plain.<p> \ The parser program takes four command-line \ parameters, not counting any parameters already \ given in the command string:<br> \ <em>infile content-type URL configuration-file</em><br> \ <table border=\"1\"> \ <tr> \ <th> Parameter </th> \ <th> Description </th> \ <th> Example </th> \ </tr> \ <tr> \ <td valign=\"top\"> infile </td> \ <td> A temporary file with the contents to be parsed. </td> \ <td> /var/tmp/htdext.14242 </td> \ </tr> \ <tr> \ <td valign=\"top\"> content-type </td> \ <td> The MIME-type of the contents. </td> \ <td> text/html </td> \ </tr> \ <tr> \ <td valign=\"top\"> URL </td> \ <td> The URL of the contents. </td> \ <td> http://www.htdig.org/attrs.html </td> \ </tr> \ <tr> \ <td valign=\"top\"> configuration-file </td> \ <td> The configuration-file in effect. </td> \ <td> /etc/htdig/htdig.conf </td> \ </tr> \ </table><p> \ The external parser is to write information for \ htdig on its standard output. Unless it is an \ external converter, which will output a document \ of a different content-type, then its output must \ follow the format described here.<br> \ The output consists of records, each record terminated \ with a newline. Each record is a series of (unless \ expressively allowed to be empty) non-empty tab-separated \ fields. The first field is a single character \ that specifies the record type. The rest of the fields \ are determined by the record type. \ <table border=\"1\"> \ <tr> \ <th> Record type </th> \ <th> Fields </th> \ <th> Description </th> \ </tr> \ <tr> \ <th rowspan=\"3\" valign=\"top\"> w </th> \ <td valign=\"top\"> word </td> \ <td> A word that was found in the document. </td> \ </tr> \ <tr> \ <td valign=\"top\"> location </td> \ <td> \ A number indicating the normalized location of \ the word within the document. The number has to \ fall in the range 0-1000 where 0 means the top of \ the document. \ </td> \ </tr> \ <tr> \ <td valign=\"top\"> heading level </td> \ <td> \ A heading level that is used to compute the \ weight of the word depending on its context in \ the document itself. The level is in the range of \ 0-11 and are defined as follows: \ <dl compact> \ <dt> 0 </dt> <dd> Normal text </dd> \ <dt> 1 </dt> <dd> Title text </dd> \ <dt> 2 </dt> <dd> Heading 1 text </dd> \ <dt> 3 </dt> <dd> Heading 2 text </dd> \ <dt> 4 </dt> <dd> Heading 3 text </dd> \ <dt> 5 </dt> <dd> Heading 4 text </dd> \ <dt> 6 </dt> <dd> Heading 5 text </dd> \ <dt> 7 </dt> <dd> Heading 6 text </dd> \ <dt> 8 </dt> <dd> text alternative to images </dd> \ <dt> 9 </dt> <dd> Keywords </dd> \ <dt> 10 </dt> <dd> Meta-description </dd> \ <dt> 11 </dt> <dd> Author </dd> \ </dl> \ </td> \ </tr> \ <tr> \ <th rowspan=\"2\" valign=\"top\"> u </th> \ <td valign=\"top\"> document URL </td> \ <td> \ A hyperlink to another document that is \ referenced by the current document. It must be \ complete and non-relative, using the URL parameter to \ resolve any relative references found in the document. \ </td> \ </tr> \ <tr> \ <td valign=\"top\"> hyperlink description </td> \ <td> \ For HTML documents, this would be the text \ between the <a href...> and </a> \ tags. \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> t </th> \ <td valign=\"top\"> title </td> \ <td> The title of the document </td> \ </tr> \ <tr> \ <th valign=\"top\"> h </th> \ <td valign=\"top\"> head </td> \ <td> \ The top of the document itself. This is used to \ build the excerpt. This should only contain \ normal ASCII text \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> a </th> \ <td valign=\"top\"> anchor </td> \ <td> \ The label that identifies an anchor that can be \ used as a target in an URL. This really only \ makes sense for HTML documents. \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> i </th> \ <td valign=\"top\"> image URL </td> \ <td> \ An URL that points at an image that is part of \ the document. \ </td> \ </tr> \ <tr> \ <th rowspan=\"3\" valign=\"top\"> m </th> \ <td valign=\"top\"> http-equiv </td> \ <td> \ The HTTP-EQUIV attribute of a \ <a href=\"meta.html\"><em>META</em> tag</a>. \ May be empty. \ </td> \ </tr> \ <tr> \ <td valign=\"top\"> name </td> \ <td> \ The NAME attribute of this \ <a href=\"meta.html\"><em>META</em> tag</a>. \ May be empty. \ </td> \ </tr> \ <tr> \ <td valign=\"top\"> contents </td> \ <td> \ The CONTENTS attribute of this \ <a href=\"meta.html\"><em>META</em> tag</a>. \ May be empty. \ </td> \ </tr> \ </table> \ <p><em>See also FAQ questions <a href=\"FAQ.html#q4.8\">4.8</a> and \ <a href=\"FAQ.html#q4.9\">4.9</a> for more examples.</em></p> \ " }, \ { "external_protocols", "", \ "quoted string list", "htdig", "", "3.2.0b1", "External:Protocols", "external_protocols: https /usr/local/bin/handler.pl \\<br> \ ftp /usr/local/bin/ftp-handler.pl", " \ This attribute is a bit like \ <a href=\"#external_parsers\">external_parsers</a> since it specifies \ a list of protocols/handlers that are used to download documents \ that cannot be retrieved using the internal methods. This enables \ htdig to index documents with URL schemes it does not understand, \ or to use more advanced authentication for the documents it is \ retrieving. This list is checked before HTTP or other methods, \ so this can override the internal behavior without writing additional \ code for htdig.<br> \ The external protocols are specified as pairs of strings, the first \ being the URL scheme that the script can handle while the second \ is the path to the script itself. If the second is \ quoted, then additional command-line arguments may be given.<br> \ If the external protocol does not contain a colon (:), it is assumed \ to have the standard format \ \"protocol://[usr[:password]@]address[:port]/path\". \ If it ends with a colon, then it is assumed to have the simpler format \ \"protocol:path\". If it ends with \"://\" then the standard form is \ again assumed. <br> \ The program takes three command-line parameters, not counting any \ parameters already given in the command string:<br> \ <em>protocol URL configuration-file</em><br> \ <table border=\"1\"> \ <tr> \ <th> Parameter </th> \ <th> Description </th> \ <th> Example </th> \ </tr> \ <tr> \ <td valign=\"top\"> protocol </td> \ <td> The URL scheme to be used. </td> \ <td> https </td> \ </tr> \ <tr> \ <td valign=\"top\"> URL </td> \ <td> The URL to be retrieved. </td> \ <td> https://www.htdig.org:8008/attrs.html </td> \ </tr> \ <tr> \ <td valign=\"top\"> configuration-file </td> \ <td> The configuration-file in effect. </td> \ <td> /etc/htdig/htdig.conf </td> \ </tr> \ </table><p> \ The external protocol script is to write information for htdig on the \ standard output. The output must follow the form described here. The \ output consists of a header followed by a blank line, followed by \ the contents of the document. Each record in the header is terminated \ with a newline. Each record is a series of (unless expressively \ allowed to be empty) non-empty tab-separated fields. The first field \ is a single character that specifies the record type. The rest of \ the fields are determined by the record type. \ <table border=\"1\"> \ <tr> \ <th> Record type </th> \ <th> Fields </th> \ <th> Description </th> \ </tr> \ <tr> \ <th valign=\"top\"> s </th> \ <td valign=\"top\"> status code </td> \ <td> \ An HTTP-style status code, e.g. 200, 404. Typical codes include: \ <dl compact> \ <dt> 200 </dt> \ <dd> Successful retrieval </dd> \ <dt> 304 </dt> \ <dd> \ Not modified (for example, if the document hasn\'t \ changed since the last dig) \ </dd> \ <dt> 301 </dt> \ <dd> Redirect (to another URL) </dd> \ <dt> 401 </dt> \ <dd> Not authorized </dd> \ <dt> 404 </dt> \ <dd> Not found </dd> \ </dl> \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> r </th> \ <td valign=\"top\"> reason </td> \ <td> \ A text string describing the status code, \ e.g \"Redirect\" or \"Not Found.\" \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> m </th> \ <td valign=\"top\"> status code </td> \ <td> \ The modification time of this document. While the code is \ fairly flexible about the time/date formats it accepts, it \ is recommended to use something standard, like \ RFC1123: Sun, 06 Nov 1994 08:49:37 GMT, or \ ISO-8601: 1994-11-06 08:49:37 GMT. \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> t </th> \ <td valign=\"top\"> content-type </td> \ <td> \ A valid MIME type for the document, like text/html or text/plain. \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> l </th> \ <td valign=\"top\"> content-length </td> \ <td> \ The length of the document on the server, which may not \ necessarily be the length of the buffer returned. \ </td> \ </tr> \ <tr> \ <th valign=\"top\"> u </th> \ <td valign=\"top\"> url </td> \ <td> \ The URL of the document, or in the case of a redirect, the \ URL that should be indexed as a result of the redirect. \ </td> \ </tr> \ </table> \ " }, \ { "extra_word_characters", "", \ "string", "htdig htsearch", "", "3.1.2", "Indexing:What", "extra_word_characters: _", " \ These characters are considered part of a word. \ In contrast to the characters in the \ <a href=\"#valid_punctuation\">valid_punctuation</a> \ attribute, they are treated just like letter \ characters. See also the <a href=\"#allow_numbers\">allow_numbers</a>\ attribute.<br> \ Note that the <a href=\"#locale\">locale</a> attribute \ is normally used to configure which characters \ constitute letter characters.<br> \ Note also that it is an error to have characters in both \ extra_word_characters and \ <a href=\"#valid_punctuation\">valid_punctuation</a>. \ To add one of the characters in the default valid_punctuation to \ extra_word_characters, an explicit valid_punctuation entry must be \ added to the configuration file.<br> \ See also the comments about special characters at \ <a href=\"#valid_punctuation\">valid_punctuation</a>. \ " }, \ { "head_before_get", "true", \ "boolean", "htdig", "Server", "3.2.0b1", "Indexing:Connection", "head_before_get: false", " \ If set to true, an HTTP/1.1 <em>HEAD</em> \ call is made in order to retrieve header information about a document. \ If the status code and the content-type returned show that the \ document is parsable, then a subsequent 'GET' call is made. In \ general, it is recommended that this attribute be set to 'true', \ as it can really improve performance (especially when used with \ persistent connections). This is particularly so during an \ incremental dig, since in this case 'htdig' can ask the server if the \ document has been modified since last dig. However there are a few \ cases when it is better to switch it off: \ <ul> \ <li>the majority of documents are parsable (HTML or a type for which \ an external parser has been provided) and must be retrieved anyway \ (initial dig);</li> \ <li>the server does not support the HEAD method or it is \ disabled;</li> \ <li>in some cases <a href=\"#persistent_connections\">persistent_connections</a> may \ not work properly and either the 'head_before_get' attribute or the \ 'persistent_connections' attribute must be turned off.</li> \ </ul> \ " }, \ { "heading_factor", "5", \ "number", "htsearch", "", "3.2.0b1", "Searching:Ranking", "heading_factor: 20", " \ This is a factor which will be used to multiply the \ weight of words between <h1> and </h1> \ tags, as well as headings of levels <h2> through \ <h6>. It is used to assign the level of importance \ to headings. Setting a factor to 0 will cause words \ in these headings to be ignored. The number may be a \ floating point number. See also \ <a href=\"#author_factor\">author_factor</a> \ <a href=\"#backlink_factor\">backlink_factor</a> \ <a href=\"#caps_factor\">caps_factor</a> \ <a href=\"#date_factor\">date_factor</a> \ <a href=\"#description_factor\">description_factor</a> \ <a href=\"#keywords_factor\">keywords_factor</a> \ <a href=\"#meta_description_factor\">meta_description_factor</a> \ <a href=\"#text_factor\">text_factor</a> \ <a href=\"#title_factor\">title_factor</a> \ <a href=\"#url_text_factor\">url_text_factor</a> \ " }, \ { "htnotify_prefix_file", "", \ "string", "htnotify", "", "3.2.0b3", "Extra Output", "htnotify_prefix_file: ${common_dir}/notify_prefix.txt", " \ Specifies the file containing text to be inserted in each mail \ message sent by htnotify before the list of expired webpages. If omitted, \ nothing is inserted. \ " }, \ { "htnotify_replyto", "", \ "string", "htnotify", "", "3.2.0b3", "Extra Output", "htnotify_replyto: design-group@foo.com", " \ This specifies the email address that htnotify email messages \ include in the Reply-to: field. \ " }, \ { "htnotify_sender", "webmaster@www", \ "string", "htnotify", "", "all", "Extra Output", "htnotify_sender: bigboss@yourcompany.com", " \ This specifies the email address that htnotify email \ messages get sent out from. The address is forged using \ /usr/lib/sendmail. Check htnotify/htnotify.cc for \ detail on how this is done. \ " }, \ { "htnotify_suffix_file", "", \ "string", "htnotify", "", "3.2.0b3", "Extra Output", "htnotify_suffix_file: ${common_dir}/notify_suffix.txt", " \ Specifies the file containing text to be inserted in each mail message \ sent by htnotify after the list of expired webpages. If omitted, htnotify \ will insert a standard message. \ " }, \ { "htnotify_webmaster", "ht://Dig Notification Service", \ "string", "htnotify", "", "3.2.0b3", "Extra Output", "htnotify_webmaster: Notification Service", " \ This provides a name for the From field, in addition to the email \ address for the email messages sent out by htnotify. \ " }, \ { "http_proxy", "", \ "string", "htdig", "URL", "3.0", "Indexing:Connection", "http_proxy: http://proxy.bigbucks.com:3128", " \ When this attribute is set, all HTTP document \ retrievals will be done using the HTTP-PROXY protocol. \ The URL specified in this attribute points to the host \ and port where the proxy server resides.<br> \ Later, this should be able to be overridden by the \ <code>http_proxy</code> environement variable, but it currently cannot.\ The use of a proxy server greatly improves performance \ of the indexing process.<br> \ See also \ <a href=\"#http_proxy_authorization\">http_proxy_authorization</a> and \ <a href=\"#http_proxy_exclude\">#http_proxy_exclude</a>. \ " }, \ { "http_proxy_authorization", "", \ "string", "htdig", "URL", "3.2.0b4", "Indexing:Connection", "http_proxy_authorization: myusername:mypassword", " \ This tells htdig to send the supplied \ <em>username</em><strong>:</strong><em>password</em> with each HTTP request, \ when using a proxy with authorization requested. \ The credentials will be encoded using the \"Basic\" authentication \ scheme. There <em>must</em> be a colon (:) between the username and \ password.<br> \ If you use this option, be sure to protect the configuration file \ so it is readable only by you, and do not \ use that same configuration file for htsearch. \ " }, \ { "http_proxy_exclude", "", \ "pattern list", "htdig", "", "3.1.0b3", "Indexing:Connection", "http_proxy_exclude: http://intranet.foo.com/", " \ When this is set, URLs matching this will not use the \ proxy. This is useful when you have a mixture of sites \ near to the digging server and far away. \ " }, \ { "ignore_alt_text", "false", \ "boolean", "htdig", "", "3.1.6", "Indexing:What", "ignore_alt_text: true", " \ If set, this causes the text of the ALT field in an <IMG...> tag \ not to be indexed as part of the text of the document, nor included in \ excerpts. \ " }, \ { "ignore_dead_servers", "true", \ "boolean", "htdig", "", "3.1.6", "Indexing:Connection", "ignore_dead_servers: false", " \ Determines whether htdig will continue to index URLs from a \ server after an attempted connection to the server fails as \ "no host found" or "host not found (port)." If \ set to false, htdig will try <em>every</em> URL from that server. \ " }, \ { "image_list", "${database_base}.images", \ "string", "htdig", "", "all", "Extra Output", "image_list: allimages", " \ This is the file that a list of image URLs gets written \ to by <a href=\"htdig.html\">htdig</a> when the \ <a href=\"#create_image_list\">create_image_list</a> is set to \ true. As image URLs are seen, they are just appended to \ this file, so after htdig finishes it is probably a \ good idea to run <code>sort -u</code> on the file to \ eliminate duplicates from the file. \ " }, \ { "image_url_prefix", IMAGE_URL_PREFIX, \ "string", "htsearch", "", "all", "Presentation:Text", "image_url_prefix: /images/htdig", " \ This specifies the directory portion of the URL used \ to display star images. This attribute isn't directly \ used by htsearch, but is used in the default URL for \ the <a href=\"#star_image\">star_image</a> and \ <a href=\"#star_blank\">star_blank</a> attributes, and \ other attributes may be defined in terms of this one. \ <p> \ The default value of this attribute is determined at \ compile time. \ </p> \ " }, \ { "include", "", \ "string", "all", "", "3.1.0", "", "include: ${config_dir}/htdig.conf", " \ This is not quite a configuration attribute, but \ rather a directive. It can be used within one \ configuration file to include the definitions of \ another file. The last definition of an attribute \ is the one that applies, so after including a file, \ any of its definitions can be overridden with \ subsequent definitions. This can be useful when \ setting up many configurations that are mostly the \ same, so all the common attributes can be maintained \ in a single configuration file. The include directives \ can be nested, but watch out for nesting loops. \ " }, \ { "iso_8601", "false", \ "boolean", "htsearch htnotify", "", "3.1.0b2", "Presentation:How,Extra Output", "iso_8601: true", " \ This sets whether dates should be output in ISO 8601 \ format. For example, this was written on: 1998-10-31 11:28:13 EST. \ See also the <a \ href=\"#date_format\">date_format</a> attribute, which \ can override any date format that \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a> \ picks by default.<br> \ This attribute also affects the format of the date \ <a href=\"htnotify.html\">htnotify</a> expects to find \ in a <strong>htdig-notification-date</strong> field. \ " }, \ { "keywords", "", \ "string list", "htsearch", "", "??", "Searching:Method", "keywords: documentation", " \ Keywords which <strong>must</strong> be found on all pages returned, \ even if the \"or\" (\"Any\") <a href=\"#method\">method</a> is \ selected. \ " }, \ { "keywords_factor", "100", \ "number", "htsearch", "", "all", "Searching:Ranking", "keywords_factor: 12", " \ This is a factor which will be used to multiply the \ weight of words in the list of \ <a href=\"#keywords_meta_tag_names\">meta keywords</a> of a document. \ The number may be a floating point number. See also the \ <a href=\"#heading_factor\">heading_factor</a> attribute. \ " }, \ { "keywords_meta_tag_names", "keywords htdig-keywords", \ "string list", "htdig", "", "3.0.6", "Indexing:What", "keywords_meta_tag_names: keywords description", " \ The words in this list are used to search for keywords \ in HTML <em>META</em> tags. This list can contain any \ number of strings that each will be seen as the name \ for whatever keyword convention is used.<br> \ The <em>META</em> tags have the following format:<br> \ <code> \   <META name=\"<em>somename</em>\" content=\"<em>somevalue</em>\"> \ </code> \ " }, \ { "limit_normalized", "", \ "pattern list", "htdig", "", "3.1.0b2", "Indexing:Where", "limit_normalized: http://www.mydomain.com", " \ This specifies a set of patterns that all URLs have to \ match against in order for them to be included in the \ search. Unlike the limit_urls_to attribute, this is done \ <strong>after</strong> the URL is normalized and the \ <a href=\"#server_aliases\">server_aliases</a> \ attribute is applied. This allows filtering after any \ hostnames and DNS aliases are resolved. Otherwise, this \ attribute is the same as the <a \ href=\"#limit_urls_to\">limit_urls_to</a> attribute. \ " }, \ { "limit_urls_to", "${start_url}", \ "pattern list", "htdig", "", "all", "Indexing:Where", "limit_urls_to: .sdsu.edu kpbs [.*\\.html]", " \ This specifies a set of patterns that all URLs have to \ match against in order for them to be included in the \ search. Any number of strings can be specified, \ separated by spaces. If multiple patterns are given, at \ least one of the patterns has to match the URL.<br> \ Matching, by default, is a case-sensitive string match on the URL \ to be used, unless the <a href=\"#case_sensitive\">case_sensitive</a> \ attribute is false. The match will be performed <em>after</em> \ the relative references have been converted to a valid \ URL. This means that the URL will <em>always</em> start \ with a transport specifier (<code>http://</code> if none is \ specified).<br> \ Granted, this is not the perfect way of doing this, \ but it is simple enough and it covers most cases.<br> \ To limit URLs in htsearch, use \ <a href=\"#restrict\">restrict</a>. \ " }, \ { "local_default_doc", "index.html", \ "string list", "htdig", "Server", "3.0.8b2", "Indexing:Where", "local_default_doc: default.html default.htm index.html index.htm", " \ Set this to the default documents in a directory used by the \ server. This is used for local filesystem access, \ using <a href=\"#local_urls\">local_urls</a>, to \ translate URLs like http://foo.com/ into something like \ /home/foo.com/index.html \ (see also <a href=\"#remove_default_doc\">remove_default_doc</a>). \ <br>The list should only contain names that the local server \ recognizes as default documents for directory URLs, as defined \ by the DirectoryIndex setting in Apache's srm.conf, for example. \ As of version 3.1.5, this can be a string list rather than a single \ name, and htdig will use the first name that works. Since this \ requires a loop, setting the most common name first will improve \ performance. Special characters can be embedded in these names \ using %xx hex encoding. \ " }, \ { "local_urls", "", \ "string list", "htdig", "", "3.0.8b2", "Indexing:Where", "local_urls: http://www.foo.com/=/usr/www/htdocs/", " \ Set this to tell ht://Dig to access certain URLs through \ local filesystems. At first ht://Dig will try to access \ pages with URLs matching the patterns through the \ filesystems specified. If it cannot find the file, or \ if it doesn't recognize the file name extension, it will \ try the URL through HTTP instead. Note the example--the \ equal sign and the final slashes in both the URL and the \ directory path are critical. \ <br>The fallback to HTTP can be disabled by setting the \ <a href=\"#local_urls_only\">local_urls_only</a> attribute to true. \ To access user directory URLs through the local filesystem, \ set <a href=\"#local_user_urls\">local_user_urls</a>. \ File types which need processing by the HTTP server may be \ specified by the \ <a href=\"#bad_local_extensions\">bad_local_extensions</a> \ attribute. \ As of version 3.1.5, you can provide multiple mappings of a given \ URL to different directories, and htdig will use the first \ mapping that works. \ Special characters can be embedded in these names using %xx hex encoding. \ For example, you can use %3D to embed an \"=\" sign in an URL pattern. \ <br> \ See also <a href=\"#local_default_doc\">local_default_doc</a>. \ " }, \ { "local_urls_only", "false", \ "boolean", "htdig", "", "3.1.4", "Indexing:Where", "local_urls_only: true", " \ Set this to tell ht://Dig to access files only through the \ local filesystem, for URLs matching the patterns in the \ <a href=\"#local_urls\">local_urls</a> or \ <a href=\"#local_user_urls\">local_user_urls</a> attribute. If it \ cannot find the file, it will give up rather than trying HTTP or \ another protocol. With this option, even <code>file://</code> urls \ are not retrieved, except throught the local_urls mechanism.\ " }, \ { "local_user_urls", "", \ "string list", "htdig", "", "3.0.8b2", "Indexing:Where", "local_user_urls: http://www.my.org/=/home/,/www/", " \ Set this to access user directory URLs through the local \ filesystem. If you leave the \"path\" portion out, it will \ look up the user's home directory in /etc/password (or NIS \ or whatever). As with <a href=\"#local_urls\">local_urls</a>, \ if the files are not found, ht://Dig will try with HTTP or the \ appropriate protocol. Again, note the \ example's format. To map http://www.my.org/~joe/foo/bar.html \ to /home/joe/www/foo/bar.html, try the example below. \ <br>The fallback to HTTP can be disabled by setting the \ <a href=\"#local_urls_only\">local_urls_only</a> attribute to true. \ As of version 3.1.5, you can provide multiple mappings of a given \ URL to different directories, and htdig will use the first \ mapping that works. \ Special characters can be embedded in these names using %xx hex encoding. \ For example, you can use %3D to embed an \"=\" sign in an URL pattern. \ " }, \ { "locale", "C", \ "string", "htdig", "", "3.0", "Indexing:What,Presentation:How", "locale: en_US", " \ Set this to whatever locale you want your search \ database cover. It affects the way international \ characters are dealt with. On most systems a list of \ legal locales can be found in /usr/lib/locale. Also \ check the <strong>setlocale(3C)</strong> man page. \ Note that depending the locale you choose, and whether \ your system's locale implementation affects floating \ point input, you may need to specify the decimal point \ as a comma rather than a period. This will affect \ settings of <a href=\"#search_algorithm\">search_algorithm</a> \ and any of the scoring factors. \ " }, \ { "logging", "false", \ "boolean", "htsearch", "", "3.1.0b2", "Extra Output", "logging: true", " \ This sets whether htsearch should use the syslog() to log \ search requests. If set, this will log requests with a \ default level of LOG_INFO and a facility of LOG_LOCAL5. For \ details on redirecting the log into a separate file or other \ actions, see the <strong>syslog.conf(5)</strong> man \ page. To set the level and facility used in logging, change \ LOG_LEVEL and LOG_FACILITY in the include/htconfig.h file \ before compiling. \ <dl> \ <dt> \ Each line logged by htsearch contains the following: \ </dt> \ <dd> \ REMOTE_ADDR [config] (match_method) [words] \ [logicalWords] (matches/matches_per_page) - \ page, HTTP_REFERER \ </dd> \ </dl> \ where any of the above are null or empty, it \ either puts in '-' or 'default' (for config). \ " }, \ { "maintainer", "bogus@unconfigured.htdig.user", \ "string", "htdig", "Server", "all", "Indexing:Out", "maintainer: ben.dover@uptight.com", " \ This should be the email address of the person in \ charge of the digging operation. This string is added \ to the user-agent: field when the digger sends a \ request to a server. \ " }, \ { "match_method", "and", \ "string", "htsearch", "", "3.0", "Searching:Method", "match_method: boolean", " \ This is the default method for matching that htsearch \ uses. The valid choices are: \ <ul> \ <li> or </li> \ <li> and </li> \ <li> boolean </li> \ </ul> \ This attribute will only be used if the HTML form that \ calls htsearch didn't have the \ <a href=\"hts_form.html#method\">method</a> value set. \ " }, \ { "matches_per_page", "10", \ "integer", "htsearch", "", "3.0", "Searching:Method", "matches_per_page: 999", " \ If this is set to a relatively small number, the \ matches will be shown in pages instead of all at once. \ This attribute will only be used if the HTML form that \ calls htsearch didn't have the \ <a href=\"hts_form.html#matchesperpage\">matchesperpage</a> value set. \ " }, \ { "max_connection_requests", "-1", \ "integer", "htdig", "", "3.2.0b1", "Indexing:Connection", "max_connection_requests: 100", " \ This attribute tells htdig to limit the number of requests it will \ send to a server using a single, persistent HTTP connection. This \ only applies when the \ <a href=\"#persistent_connections\">persistent_connections</a> \ attribute is set. You may set the limit as high as you want, \ but it must be at least 1. A value of -1 specifies no limit. \ Requests in the queue for a server will be combined until either \ the limit is reached, or the queue is empty. \ " }, \ { "max_description_length", "60", \ "integer", "htdig", "", "all", "Indexing:What", "max_description_length: 40", " \ While gathering descriptions of URLs, \ <a href=\"htdig.html\">htdig</a> will only record \ up to this many bytes of hyperlink descriptions for use in the \ <a href=\"hts_templates.html#DESCRIPTION\">DESCRIPTION</a> template \ variable. This is used mostly to deal with broken HTML. (If a \ hyperlink is not terminated with a </a> the \ description will go on until the end of the document.) \ " }, \ { "max_descriptions", "5", \ "integer", "htdig", "", "all", "Indexing:What", "max_descriptions: 1", " \ While gathering <a href=\"#description_factor\">descriptions</a> of \ URLs for the \ <a href=\"hts_templates.html#DESCRIPTIONS\">DESCRIPTIONS</a> template \ variable, <a href=\"htdig.html\">htdig</a> will only record up to this \ number of descriptions, in the order in which it encounters \ them. This is used to prevent the database entry for a document \ from growing out of control if the document has a huge number \ of links to it. <br> \ Note that all descriptions are used for indexing. \ " }, \ { "max_doc_size", "100000", \ "integer", "htdig", "URL", "3.0", "Indexing:What", "max_doc_size: 5000000", " \ This is the upper limit to the amount of data retrieved \ for documents (in bytes). This is mainly used to prevent \ unreasonable memory consumption since each document \ will be read into memory by <a href=\"htdig.html\"> \ htdig</a>. \ " }, \ { "max_excerpts", "1", \ "integer", "htsearch", "URL", "3.1.6", "Presentation:How", "max_excerpts: 10", " \ This value determines the maximum number of excerpts \ that can be displayed for one matching document in the \ search results. \ " }, \ { "max_head_length", "512", \ "integer", "htdig", "", "all", "Indexing:How", "max_head_length: 50000", " \ For each document retrieved, the top of the document is \ stored. This attribute determines the size of this \ block (in bytes). The text that will be stored is only the text; \ no markup is stored.<br> \ We found that storing 50,000 bytes will store about \ 95% of all the documents completely. This really \ depends on how much storage is available and how much \ you want to show. Currently, this is must not be 0. \ " }, \ { "max_hop_count", "999999", \ "integer", "htdig", "", "all", "Indexing:Where", "max_hop_count: 4", " \ Instead of limiting the indexing process by URL \ pattern, it can also be limited by the number of hops \ or clicks a document is removed from the starting URL. \ <br> \ The starting page or pages will have hop count 0. \ " }, \ { "max_keywords", "-1", \ "integer", "htdig", "", "3.2.0b1", "Indexing:What", "max_keywords: 10", " \ This attribute can be used to limit the number of keywords \ per document that htdig will accept from meta keywords tags. \ A value of -1 or less means no limit. This can help combat meta \ keyword spamming, by limiting the amount of keywords that will be \ indexed, but it will not completely prevent irrelevant matches \ in a search if the first few keywords in an offending document \ are not relevant to its contents. \ " }, \ { "max_meta_description_length", "512", \ "integer", "htdig", "", "3.1.0b1", "Indexing:How", "max_meta_description_length: 1000", " \ While gathering descriptions from meta description tags, \ <a href=\"htdig.html\">htdig</a> will only store up to \ this much of the text (in bytes) for each document to fill the \ <a href=\"hts_templates.html#METADESCRIPTION\">METADESCRIPTION</a> \ template variable. All words in the meta description are still \ used for indexing. \ " }, \ { "max_prefix_matches", "1000", \ "integer", "htsearch", "", "3.1.0b1", "Searching:Method", "max_prefix_matches: 100", " \ The Prefix <a href=\"#search_algorithm\">fuzzy algorithm</a> \ could potentially match a \ very large number of words. This value limits the \ number of words each prefix can match. Note \ that this does not limit the number of documents that \ are matched in any way. \ " }, \ { "max_retries", "3", \ "integer", "htdig", "", "3.2.0b1", "Indexing:Connection", "max_retries: 6", " \ This option set the maximum number of retries when retrieving a document \ fails (mainly for reasons of connection). \ " }, \ { "max_stars", "4", \ "integer", "htsearch", "", "all", "Presentation:How", "max_stars: 6", " \ When stars are used to display the score of a match, \ this value determines the maximum number of stars that \ can be displayed. \ " }, \ { "maximum_page_buttons", "${maximum_pages}", \ "integer", "htsearch", "", "3.2.0b3", "Presentation:How", "maximum_page_buttons: 20", " \ This value limits the number of page links that will be \ included in the page list at the bottom of the search \ results page. By default, it takes on the value of the \ <a href=\"#maximum_pages\">maximum_pages</a> \ attribute, but you can set it to something lower to allow \ more pages than buttons. In this case, pages above this \ number will have no corresponding button. \ " }, \ { "maximum_pages", "10", \ "integer", "htsearch", "", "all", "Presentation:How", "maximum_pages: 20", " \ This value limits the number of page links that will be \ included in the page list at the bottom of the search \ results page. As of version 3.1.4, this will limit the \ total number of matching documents that are shown. \ You can make the number of page buttons smaller than the \ number of allowed pages by setting the \ <a href=\"#maximum_page_buttons\">maximum_page_buttons</a> \ attribute. \ " }, \ { "maximum_word_length", "32", \ "integer", "htdig htsearch htfuzzy", "", "3.1.3", "Indexing:What", "maximum_word_length: 15", " \ This sets the maximum length of words that will be \ indexed. Words longer than this value will be silently \ truncated when put into the index, or searched in the \ index. \ " }, \ { "md5_db", "${database_base}.md5hash.db", \ "string", "htdig", "", "3.2.0b3", "File Layout", "md5_db: ${database_base}.md5.db", " \ This file holds a database of md5 and date hashes of pages to \ catch and eliminate duplicates of pages. See also the \ <a href=\"#check_unique_md5\">check_unique_md5</a> and \ <a href=\"#check_unique_date\">check_unique_date</a> attributes. \ " }, \ { "meta_description_factor", "50", \ "number", "htsearch", "", "3.1.0b1", "Searching:Ranking", "meta_description_factor: 20", " \ This is a factor which will be used to multiply the \ weight of words in any META description tags in a document. \ The number may be a floating point number. See also the \ <a href=\"#heading_factor\">heading_factor</a> attribute and the \ <a href=\"#description_factor\">description_factor</a> attribute. \ " }, \ { "metaphone_db", "${database_base}.metaphone.db", \ "string", "htfuzzy htsearch", "", "all", "File Layout", "metaphone_db: ${database_base}.mp.db", " \ The database file used for the fuzzy \"metaphone\" search \ algorithm. This database is created by \ <a href=\"htfuzzy.html\">htfuzzy</a> and used by \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a>. \ " }, \ { "method_names", "and All or Any boolean Boolean", \ "quoted string list", "htsearch", "", "all", "Searching:UI", "method_names: or Or and And", " \ These values are used to create the <strong> \ method</strong> menu. It consists of pairs. The first \ element of each pair is one of the known methods, the \ second element is the text that will be shown in the \ menu for that method. This text needs to be quoted if \ it contains spaces. \ See the <a href=\"hts_selectors.html\">select list documentation</a> \ for more information on how this attribute is used. \ " }, \ { "mime_types", "${config_dir}/mime.types", \ "string", "htdig", "", "3.2.0b1", "Indexing:Where", "mime_types: /etc/mime.types", " \ This file is used by htdig for local file access and resolving \ file:// URLs to ensure the files are parsable. If you are running \ a webserver with its own MIME file, you should set this attribute \ to point to that file. \ <p> \ See also <a href=\"#content_classifier\">content_classifier</a>.\ "}, \ { "minimum_prefix_length", "1", \ "integer", "htsearch", "", "3.1.0b1", "Searching:Method", "minimum_prefix_length: 2", " \ This sets the minimum length of prefix matches used by the \ \"prefix\" fuzzy matching algorithm. Words shorter than this \ will not be used in prefix matching. \ " }, \ { "minimum_speling_length", "5", \ "integer", "htsearch", "", "3.2.0b1", "Searching:Method", "minimum_speling_length: 3", " \ This sets the minimum length of words used by the \ \"speling\" fuzzy matching algorithm. Words shorter than this \ will not be used in this fuzzy matching. \ " }, \ { "minimum_word_length", "3", \ "integer", "htdig htsearch", "", "all", "Indexing:What", "minimum_word_length: 2", " \ This sets the minimum length of words that will be \ indexed. Words shorter than this value will be silently \ ignored but still put into the excerpt.<br> \ Note that by making this value less than 3, a lot more \ words that are very frequent will be indexed. It might \ be advisable to add some of these to the \ <a href=\"#bad_word_list\">bad_words list</a>. \ " }, \ { "multimatch_factor", "1", \ "number", "htsearch", "", "3.1.6", "Searching:Ranking", "multimatch_factor: 1000", " \ This factor gives higher rankings to documents that have more than \ one matching search word when the <strong>or</strong> \ <a href=\"#match_method\">match_method</a> is used. \ In version 3.1.6, the matching words' combined scores were multiplied \ by this factor for each additional matching word. Currently, this \ multiplier is applied at most once. \ " }, { "next_page_text", "[next]", \ "string", "htsearch", "", "3.1.0", "Presentation:Text", "next_page_text: <img src=\"/htdig/buttonr.gif\">", " \ The text displayed in the hyperlink to go to the next \ page of matches. \ " }, \ { "no_excerpt_show_top", "false", \ "boolean", "htsearch", "", "3.1.0b3", "Presentation:How", "no_excerpt_show_top: yes", " \ If no excerpt is available, this option will act the \ same as <a \ href=\"#excerpt_show_top\">excerpt_show_top</a>, that is, \ it will show the top of the document. \ " }, \ { "no_excerpt_text", "<em>(None of the search words were found in the top of this document.)</em>", \ "string", "htsearch", "", "3.0", "Presentation:Text", "no_excerpt_text:", " \ This text will be displayed in place of the excerpt if \ there is no excerpt available. If this attribute is set \ to nothing (blank), the excerpt label will not be \ displayed in this case. \ " }, \ { "no_next_page_text", "${next_page_text}", \ "string", "htsearch", "", "3.0", "Presentation:Text", "no_next_page_text:", " \ The text displayed where there would normally be a \ hyperlink to go to the next page of matches. \ " }, \ { "no_page_list_header", "", \ "string", "htsearch", "", "3.0", "Presentation:Text", "no_page_list_header: <hr noshade size=2>All results on this page.<br>", " \ This text will be used as the value of the PAGEHEADER \ variable, for use in templates or the \ <a href=\"#search_results_footer\">search_results_footer</a> \ file, when all search results fit on a single page. \ " }, \ { "no_page_number_text", "", \ "quoted string list", "htsearch", "", "3.0", "Presentation:Text", "no_page_number_text: \ <strong>1</strong> <strong>2</strong> \\<br> \ <strong>3</strong> <strong>4</strong> \\<br> \ <strong>5</strong> <strong>6</strong> \\<br> \ <strong>7</strong> <strong>8</strong> \\<br> \ <strong>9</strong> <strong>10</strong> \ ", " \ The text strings in this list will be used when putting \ together the PAGELIST variable, for use in templates or \ the <a href=\"#search_results_footer\">search_results_footer</a> \ file, when search results fit on more than page. The PAGELIST \ is the list of links at the bottom of the search results page. \ There should be as many strings in the list as there are \ pages allowed by the <a href=\"#maximum_page_buttons\">maximum_page_buttons</a> \ attribute. If there are not enough, or the list is empty, \ the page numbers alone will be used as the text for the links. \ An entry from this list is used for the current page, as the \ current page is shown in the page list without a hypertext link, \ while entries from the <a href=\"#page_number_text\"> \ page_number_text</a> list are used for the links to other pages. \ The text strings can contain HTML tags to highlight page numbers \ or embed images. The strings need to be quoted if they contain \ spaces. \ " }, \ { "no_prev_page_text", "${prev_page_text}", \ "string", "htsearch", "", "3.0", "Presentation:Text", "no_prev_page_text:", " \ The text displayed where there would normally be a \ hyperlink to go to the previous page of matches. \ " }, \ { "no_title_text", "filename", \ "string", "htsearch", "", "3.1.0", "Presentation:Text", "no_title_text: \"No Title Found\"", " \ This specifies the text to use in search results when no \ title is found in the document itself. If it is set to \ filename, htsearch will use the name of the file itself, \ enclosed in brackets (e.g. [index.html]). \ " }, \ { "noindex_end", "<!--/htdig_noindex--> </SCRIPT>", \ "quoted string list", "htdig", "", "3.1.0", "Indexing:What", "noindex_end: </SCRIPT>", " \ This string marks the end of a section of an HTML file that should be \ completely ignored when indexing. Note that text between noindex_start\ and noindex_end isn't even counted as white space; the text \ \"<code>foo<!--htdig_noindex-->something<!--/htdig_noindex-->bar</code>\" \ matches the word \"foobar\", not the phrase \"foo bar\". White space \ following noindex_end <em>is</em> counted as white space. See also \ <a href=\"#noindex_start\">noindex_start</a>. \ " }, \ { "noindex_start", "<!--htdig_noindex--> <SCRIPT", \ "quoted string list", "htdig", "", "3.1.0", "Indexing:What", "noindex_start: <SCRIPT", " \ These strings mark the start of a section of an HTML file that should \ be completely ignored when indexing. They work together with \ <a href=\"#noindex_end\">noindex_end</a>. Once a string in \ noindex_start is found, text is ignored until the string at the \ <em>same position</em> within <a href=\"#noindex_end\">noindex_end</a> \ is encountered. The sections marked off this way cannot overlap. \ As in the first default pattern, this can be SGML comment \ declarations that can be inserted anywhere in the documents to exclude \ different sections from being indexed. However, existing tags can also \ be used; this is especially useful to exclude some sections from being \ indexed where the files to be indexed can not be edited. The second \ default pattern shows how SCRIPT sections in 'uneditable' documents \ can be skipped; note how noindex_start does not contain an ending \ >: this allows for all SCRIPT tags to be matched regardless of \ attributes defined (different types or languages). \ Note that the match for this string is case insensitive. \ " }, \ { "nothing_found_file", "${common_dir}/nomatch.html", \ "string", "htsearch", "", "all", "Presentation:Files", "nothing_found_file: /www/searching/nothing.html", " \ This specifies the file which contains the <code> \ HTML</code> text to display when no matches were found. \ The file should contain a complete <code>HTML</code> \ document.<br> \ Note that this attribute could also be defined in \ terms of <a href=\"#database_base\">database_base</a> to \ make is specific to the current search database. \ " }, \ { "nph", "false", \ "boolean", "htsearch", "", "3.2.0b2", "Presentation:How", "nph: true", " \ This attribute determines whether htsearch sends out full HTTP \ headers as required for an NPH (non-parsed header) CGI. Some \ servers assume CGIs will act in this fashion, for example MS \ IIS. If your server does not send out full HTTP headers, you \ should set this to true. \ " }, \ { "page_list_header", "<hr noshade size=2>Pages:<br>", \ "string", "htsearch", "", "3.0", "Presentation:Text", "page_list_header:", " \ This text will be used as the value of the PAGEHEADER \ variable, for use in templates or the \ <a href=\"#search_results_footer\">search_results_footer</a> \ file, when all search results fit on more than one page. \ " }, \ { "page_number_separator", "\" \"", \ "quoted string list", "htsearch", "", "3.1.4", "Presentation:Text", "page_number_separator: \"</td> <td>\"", " \ The text strings in this list will be used when putting \ together the PAGELIST variable, for use in templates or \ the <a href=\"#search_results_footer\">search_results_footer</a> \ file, when search results fit on more than page. The PAGELIST \ is the list of links at the bottom of the search results page. \ The strings in the list will be used in rotation, and will \ separate individual entries taken from \ <a href=\"#page_number_text\">page_number_text</a> and \ <a href=\"#no_page_number_text\">no_page_number_text</a>. \ There can be as many or as few strings in the list as you like. \ If there are not enough for the number of pages listed, it goes \ back to the start of the list. If the list is empty, a space is \ used. The text strings can contain HTML tags. The strings need \ to be quoted if they contain spaces, or to specify an empty string. \ " }, \ { "page_number_text", "", \ "quoted string list", "htsearch", "", "3.0", "Presentation:Text", "page_number_text: \ <em>1</em> <em>2</em> \\<br> \ <em>3</em> <em>4</em> \\<br> \ <em>5</em> <em>6</em> \\<br> \ <em>7</em> <em>8</em> \\<br> \ <em>9</em> <em>10</em> \ ", " \ The text strings in this list will be used when putting \ together the PAGELIST variable, for use in templates or \ the <a href=\"#search_results_footer\">search_results_footer</a> \ file, when search results fit on more than page. The PAGELIST \ is the list of links at the bottom of the search results page. \ There should be as many strings in the list as there are \ pages allowed by the <a href=\"#maximum_page_buttons\">maximum_page_buttons</a> \ attribute. If there are not enough, or the list is empty, \ the page numbers alone will be used as the text for the links. \ Entries from this list are used for the links to other pages, \ while an entry from the <a href=\"#no_page_number_text\"> \ no_page_number_text</a> list is used for the current page, as the \ current page is shown in the page list without a hypertext link. \ The text strings can contain HTML tags to highlight page numbers \ or embed images. The strings need to be quoted if they contain \ spaces. \ " }, \ { "persistent_connections", "true", \ "boolean", "htdig", "Server", "3.2.0b1", "Indexing:Connection", "persistent_connections: false", " \ If set to true, when servers make it possible, htdig can take advantage \ of persistent connections, as defined by HTTP/1.1 (<em>RFC2616</em>). This permits \ to reduce the number of open/close operations of connections, when retrieving \ a document with HTTP. \ " }, \ { "plural_suffix", "s", \ "string", "htsearch", "", "3.2.0b2", "Presentation: Text", "plural_suffix: en", " \ Specifies the value of the PLURAL_MATCHES template \ variable used in the header, footer and template files. \ This can be used for localization for non-English languages \ where 's' is not the appropriate suffix. \ " }, \ { "prefix_match_character", "*", \ "string", "htsearch", "", "3.1.0b1", "Searching:Method", "prefix_match_character: ing", " \ A null prefix character means that prefix matching should be \ applied to every search word. Otherwise prefix matching is \ done on any search word ending with the characters specified \ in this string, with the string being stripped off before \ looking for matches. The \"prefix\" algorithm must be enabled \ in <a href=\"#search_algorithm\">search_algorithm</a> \ for this to work. You may also want to set the <a \ href=\"#max_prefix_matches\">max_prefix_matches</a> and <a \ href=\"#minimum_prefix_length\">minimum_prefix_length</a> attributes \ to get it working as you want.<br> As a special case, in version \ 3.1.6 and later, if this string is non-null and is entered alone \ as a search word, it is taken as a wildcard that matches all \ documents in the database. If this string is null, the wildcard \ for this special case will be <strong>*</strong>. This wildcard \ doesn't require the prefix algorithm to be enabled. \ " }, \ { "prev_page_text", "[prev]", \ "string", "htsearch", "", "3.0", "Presentation:Text", "prev_page_text: <img src=\"/htdig/buttonl.gif\">", " \ The text displayed in the hyperlink to go to the \ previous page of matches. \ " }, \ { "regex_max_words", "25", \ "integer", "htsearch", "", "3.2.0b1", "Searching:Method", "regex_max_words: 10", " \ The \"regex\" <a href=\"#search_algorithm\">fuzzy algorithm</a> \ could potentially match a \ very large number of words. This value limits the \ number of words each regular expression can match. Note \ that this does not limit the number of documents that \ are matched in any way. \ " }, \ { "remove_bad_urls", "true", \ "boolean", "htpurge", "Server", "all", "Indexing:How", "remove_bad_urls: true", " \ If TRUE, htpurge will remove any URLs which were marked \ as unreachable by htdig from the database. If FALSE, it \ will not do this. When htdig is run in initial mode, \ documents which were referred to but could not be \ accessed should probably be removed, and hence this \ option should then be set to TRUE, however, if htdig is \ run to update the database, this may cause documents on \ a server which is temporarily unavailable to be \ removed. This is probably NOT what was intended, so \ hence this option should be set to FALSE in that case. \ " }, \ { "remove_default_doc", "index.html", \ "string list", "htdig", "", "3.1.0", "Indexing:How", "remove_default_doc: default.html default.htm index.html index.htm", " \ Set this to the default documents in a directory used by the \ servers you are indexing. These document names will be stripped \ off of URLs when they are normalized, if one of these names appears \ after the final slash, to translate URLs like \ http://foo.com/index.html into http://foo.com/<br> \ Note that you can disable stripping of these names during \ normalization by setting the list to an empty string. \ The list should only contain names that all servers you index \ recognize as default documents for directory URLs, as defined \ by the DirectoryIndex setting in Apache's srm.conf, for example. \ This does not apply to file:/// or ftp:// URLS. \ <br>See also <a href=\"#local_default_doc\">local_default_doc</a>. \ " }, \ { "remove_unretrieved_urls", "false", \ "boolean", "htpurge", "Server", "3.2.0b1", "Indexing:How", "remove_unretrieved_urls: true", " \ If TRUE, htpurge will remove any URLs which were discovered \ and included as stubs in the database but not yet retrieved. If FALSE, it \ will not do this. When htdig is run in initial mode with no restrictions \ on hopcount or maximum documents, these should probably be removed and set \ to true. However, if you are hoping to index a small set of documents and \ eventually get to the rest, you should probably leave this as false. \ " }, \ { "restrict", "", \ "pattern list", "htsearch", "", "3.2.0b4", "Searching:Method", "restrict: http://www.acme.com/widgets/", " \ This specifies a set of patterns that all URLs have to \ match against in order for them to be included in the search \ results. Any number of strings can be specified, separated by \ spaces. If multiple patterns are given, at least one of the \ patterns has to match the URL. The list can be specified \ from within the configuration file, and can be overridden \ with the \"restrict\" input parameter in the search form. Note \ that the restrict list does not take precedence over the \ <a href=\"#exclude\">exclude</a> list - if a URL matches patterns \ in both lists it is still excluded from the search results. \ <br>To restrict URLs in htdig, use \ <a href=\"#limit_urls_to\">limit_urls_to</a>. \ " }, \ { "robotstxt_name", "htdig", \ "string", "htdig", "Server", "3.0.7", "Indexing:Out", "robotstxt_name: myhtdig", " \ Sets the name that htdig will look for when parsing \ robots.txt files. This can be used to make htdig appear \ as a different spider than ht://Dig. Useful to \ distinguish between a private and a global index. \ " }, \ { "script_name", "", \ "string", "htsearch", "", "3.1.4", "Presentation:Text", "script_name: /search/results.shtml", " \ Overrides the value of the SCRIPT_NAME \ environment attribute. This is useful if \ htsearch is not being called directly as a CGI \ program, but indirectly from within a dynamic \ .shtml page using SSI directives. Previously, \ you needed a wrapper script to do this, but \ this configuration attribute makes wrapper \ scripts obsolete for SSI and possibly for \ other server scripting languages, as \ well. (You still need a wrapper script when \ using PHP, though.)<br> \ Check out the <code>contrib/scriptname</code> \ directory for a small example. Note that this \ attribute also affects the value of the <a \ href=\"hts_templates.html#CGI\">CGI</a> variable \ used in htsearch templates. \ " }, \ { "search_algorithm", "exact:1", \ "string list", "htsearch", "", "all", "Searching:Method", "search_algorithm: exact:1 soundex:0.3", " \ Specifies the search algorithms and their weight to use \ when searching. Each entry in the list consists of the \ algorithm name, followed by a colon (:) followed by a \ weight multiplier. The multiplier is a floating point \ number between 0 and 1. Note that depending on your \ <a href=\"#locale\">locale</a> setting, and whether your \ system's locale implementation affects floating point \ input, you may need to specify the decimal point as a \ comma rather than a period.<br> \ <strong>Note:</strong>If the exact \ method is not listed, the search may not work since the \ original terms will not be used.<br> \ Current algorithms supported are: \ <dl> \ <dt> \ exact \ </dt> \ <dd> \ The default exact word matching algorithm. This \ will find only exactly matched words. \ </dd> \ <dt> \ soundex \ </dt> \ <dd> \ Uses a slightly modified <a href=\"http://www.sog.org.uk/cig/vol6/605tdrake.pdf\">soundex</a> algorithm to match \ words. This requires that the soundex database be \ present. It is generated with the \ <a href=\"htfuzzy.html\">htfuzzy</a> program. \ </dd> \ <dt> \ metaphone \ </dt> \ <dd> \ Uses the metaphone algorithm for matching words. \ This algorithm is more specific to the english \ language than soundex. It requires the metaphone \ database, which is generated with the <a \ href=\"htfuzzy.html\">htfuzzy</a> program. \ </dd> \ <dt> \ accents \ </dt> \ <dd> \ Uses the accents algorithm for matching words. \ This algorithm will treat all accented letters \ as equivalent to their unaccented counterparts. \ It requires the accents database, which is \ generated with the <a \ href=\"htfuzzy.html\">htfuzzy</a> program. \ </dd> \ <dt> \ endings \ </dt> \ <dd> \ This algorithm uses language specific word endings \ to find matches. Each word is first reduced to its \ word root and then all known legal endings are used \ for the matching. This algorithm uses two databases \ which are generated with <a href=\"htfuzzy.html\"> \ htfuzzy</a>. \ </dd> \ <dt> \ synonyms \ </dt> \ <dd> \ Performs a dictionary lookup on all the words. This \ algorithm uses a database generated with the <a \ href=\"htfuzzy.html\">htfuzzy</a> program. \ </dd> \ <dt> \ substring \ </dt> \ <dd> \ Matches all words containing the queries as \ substrings. Since this requires checking every word in \ the database, this can really slow down searches \ considerably. \ <dd> \ <dt> \ prefix \ </dt> \ <dd> \ Matches all words beginning with the query \ strings. Uses the option <a \ href=\"#prefix_match_character\">prefix_match_character</a> \ to decide whether a query requires prefix \ matching. For example \"abc*\" would perform prefix \ matching on \"abc\" since * is the default \ prefix_match_character. \ </dd> \ <dt> \ regex \ </dt> \ <dd> \ Matches all words that match the patterns given as regular \ expressions. Since this requires checking every word in \ the database, this can really slow down searches \ considerably. The config file used for searching \ must include the regex meta-characters (^$\\[-]|.*) \ included in <a href=\"#extra_word_characters\">extra_word_characters</a>, \ while the config file used for digging should not.\ <dd> \ <dt> \ speling \ </dt> \ <dd> \ A simple fuzzy algorithm that tries to find one-off spelling \ mistakes, such as transposition of two letters or an extra character. \ Since this usually generates just a few possibilities, it is \ relatively quick. \ <dd> \ </dl> \ " }, \ { "search_results_contenttype", "text/html", \ "string", "htsearch", "", "all", "Presentation:Files", "search_results_contenttype: text/xml", " \ This specifies a Content-type to be output as an HTTP header \ at the start of search results. If set to an empty string, \ the Content-type header will be omitted altogether. \ " }, { "search_results_footer", "${common_dir}/footer.html", \ "string", "htsearch", "", "all", "Presentation:Files", "search_results_footer: /usr/local/etc/ht/end-stuff.html", " \ This specifies a filename to be output at the end of \ search results. While outputting the footer, some \ variables will be expanded. Variables use the same \ syntax as the Bourne shell. If there is a variable VAR, \ the following will all be recognized: \ <ul> \ <li> \ $VAR \ </li> \ <li> \ $(VAR) \ </li> \ <li> \ ${VAR} \ </li> \ </ul> \ The following variables are available. See \ <a href=\"hts_template.html\">hts_template.html</a> for a complete \ list. \ <dl> \ <dt> \ MATCHES \ </dt> \ <dd> \ The number of documents that were matched. \ </dd> \ <dt> \ PLURAL_MATCHES \ </dt> \ <dd> \ If MATCHES is not 1, this will be the string \"s\", \ else it is an empty string. This can be used to say \ something like \"$(MATCHES) \ document$(PLURAL_MATCHES) were found\" \ </dd> \ <dt> \ MAX_STARS \ </dt> \ <dd> \ The value of the <a href=\"#max_stars\">max_stars</a> \ attribute. \ </dd> \ <dt> \ LOGICAL_WORDS \ </dt> \ <dd> \ A string of the search words with either \"and\" or \ \"or\" between the words, depending on the type of \ search. \ </dd> \ <dt> \ WORDS \ </dt> \ <dd> \ A string of the search words with spaces in \ between. \ </dd> \ <dt> \ PAGEHEADER \ </dt> \ <dd> \ This expands to either the value of the \ <a href=\"#page_list_header\">page_list_header</a> or \ <a href=\"#no_page_list_header\">no_page_list_header</a> \ attribute depending on how many pages there are. \ </dd> \ </dl> \ Note that this file will <strong>NOT</strong> be output \ if no matches were found. In this case the \ <a href=\"#nothing_found_file\">nothing_found_file</a> \ attribute is used instead. \ Also, this file will not be output if it is \ overridden by defining the \ <a href=\"#search_results_wrapper\">search_results_wrapper</a> \ attribute. \ " }, \ { "search_results_header", "${common_dir}/header.html", \ "string", "htsearch", "", "all", "Presentation:Files", "search_results_header: /usr/local/etc/ht/start-stuff.html", " \ This specifies a filename to be output at the start of \ search results. While outputting the header, some \ variables will be expanded. Variables use the same \ syntax as the Bourne shell. If there is a variable VAR, \ the following will all be recognized: \ <ul> \ <li> \ $VAR \ </li> \ <li> \ $(VAR) \ </li> \ <li> \ ${VAR} \ </li> \ </ul> \ The following variables are available. See \ <a href=\"hts_template.html\">hts_template.html</a> for a complete \ list. \ <!-- Do these need to be listed for both _footer and _header? --> \ <dl> \ <dt> \ MATCHES \ </dt> \ <dd> \ The number of documents that were matched. \ </dd> \ <dt> \ PLURAL_MATCHES \ </dt> \ <dd> \ If MATCHES is not 1, this will be the string \"s\", \ else it is an empty string. This can be used to say \ something like \"$(MATCHES) \ document$(PLURAL_MATCHES) were found\" \ </dd> \ <dt> \ MAX_STARS \ </dt> \ <dd> \ The value of the <a href=\"#max_stars\">max_stars</a> \ attribute. \ </dd> \ <dt> \ LOGICAL_WORDS \ </dt> \ <dd> \ A string of the search words with either \"and\" or \ \"or\" between the words, depending on the type of \ search. \ </dd> \ <dt> \ WORDS \ </dt> \ <dd> \ A string of the search words with spaces in \ between. \ </dd> \ </dl> \ Note that this file will <strong>NOT</strong> be output \ if no matches were found. In this case the \ <a href=\"#nothing_found_file\">nothing_found_file</a> \ attribute is used instead. \ Also, this file will not be output if it is \ overridden by defining the \ <a href=\"#search_results_wrapper\">search_results_wrapper</a> \ attribute. \ " }, \ { "search_results_order", "", \ "string list", "htsearch", "", "3.2.0b2", "Searching:Ranking", "search_results_order: \ /docs/|faq.html * /maillist/ /testresults/", " \ This specifies a list of patterns for URLs in \ search results. Results will be displayed in the \ specified order, with the search algorithm result \ as the second order. Remaining areas, that do not \ match any of the specified patterns, can be placed \ by using * as the pattern. If no * is specified, \ one will be implicitly placed at the end of the \ list.<br> \ See also <a href=\"#url_seed_score\">url_seed_score</a>. \ " }, \ { "search_results_wrapper", "", \ "string", "htsearch", "", "3.1.0", "Presentation:Files", "search_results_wrapper: ${common_dir}/wrapper.html", " \ This specifies a filename to be output at the start and \ end of search results. This file replaces the \ <a href=\"#search_results_header\">search_results_header</a> and \ <a href=\"#search_results_footer\">search_results_footer</a> \ files, with the contents of both in one file, and uses the \ pseudo-variable <strong>$(HTSEARCH_RESULTS)</strong> as a \ separator for the header and footer sections. \ If the filename is not specified, the file is unreadable, \ or the pseudo-variable above is not found, htsearch reverts \ to the separate header and footer files instead. \ While outputting the wrapper, \ some variables will be expanded, just as for the \ <a href=\"#search_results_header\">search_results_header</a> and \ <a href=\"#search_results_footer\">search_results_footer</a> \ files.<br> \ Note that this file will <strong>NOT</strong> be output \ if no matches were found. In this case the \ <a href=\"#nothing_found_file\">nothing_found_file</a> \ attribute is used instead. \ " }, \ { "search_rewrite_rules", "", "string list", "htsearch", "", "3.1.6", "URLs", "search_rewrite_rules: http://(.*)\\\\.mydomain\\\\.org/([^/]*) http://\\\\2.\\\\1.com \\<br> \ http://www\\\\.myschool\\\\.edu/myorgs/([^/]*) http://\\\\1.org", " \ This is a list of pairs, <em>regex</em> <em>replacement</em>, used \ to rewrite URLs in the search results. The left hand string is a \ regular expression; the right hand string is a literal string with \ embedded placeholders for fragments that matched inside brackets in \ the regular expression. \\0 is the whole matched string, \\1 to \\9 \ are bracketted substrings. The backslash must be doubled-up in the \ attribute setting to get past the variable expansion parsing. Rewrite \ rules are applied sequentially to each URL before it is displayed \ or checked against the <a href=\"#restrict\">restrict</a> or \ <a href=\"#exclude\">exclude</a> lists. Rewriting does not stop once a \ match has been made, so multiple rules may affect a given URL. See \ also <a href=\"#url_part_aliases\">url_part_aliases</a> which allows \ URLs to be of one form during indexing and translated for results, \ and <a href=\"#url_rewrite_rules\">url_rewrite_rules</a> which allows \ URLs to be rewritten while indexing. \ " }, { "server_aliases", "", \ "string list", "htdig", "", "3.1.0b2", "Indexing:Where", "server_aliases: \ foo.mydomain.com:80=www.mydomain.com:80 \\<br> \ bar.mydomain.com:80=www.mydomain.com:80 \ ", " \ This attribute tells the indexer that servers have several \ DNS aliases, which all point to the same machine and are NOT \ virtual hosts. This allows you to ensure pages are indexed \ only once on a given machine, despite the alias used in a URL. \ As shown in the example, the mapping goes from left to right, \ so the server name on the right hand side is the one that is \ used. As of version 3.1.3, the port number is optional, and is \ assumed to be 80 if omitted. There is no easy way to map all \ ports from one alias to another without listing them all. \ " }, \ { "server_max_docs", "-1", \ "integer", "htdig", "Server", "3.1.0b3", "Indexing:Where", "server_max_docs: 50", " \ This attribute tells htdig to limit the dig to retrieve a maximum \ number of documents from each server. This can cause \ unusual behavior on update digs since the old URLs are \ stored alphabetically. Therefore, update digs will add \ additional URLs in pseudo-alphabetical order, up to the \ limit of the attribute. However, it is most useful to \ partially index a server as the URLs of additional \ documents are entered into the database, marked as never \ retrieved.<br> \ A value of -1 specifies no limit. \ " }, \ { "server_wait_time", "0", \ "integer", "htdig", "Server", "3.1.0b3", "Indexing:Connection", "server_wait_time: 20", " \ This attribute tells htdig to ensure a server has had a \ delay (in seconds) from the beginning of the last \ connection. This can be used to prevent \"server abuse\" \ by digging without delay. It's recommended to set this \ to 10-30 (seconds) when indexing servers that you don't \ monitor yourself. Additionally, this attribute can slow \ down local indexing if set, which may or may not be what \ you intended. \ " }, \ { "sort", "score", \ "string", "htsearch", "", "3.1.0", "Presentation:How", "sort: revtime", " \ This is the default sorting method that htsearch \ uses to determine the order in which matches are displayed. \ The valid choices are: \ <table border=\"0\"> \ <tr> \ <td> \ <ul> \ <li> score </li> \ <li> time </li> \ <li> title </li> \ </ul> \ </td> \ <td> \ <ul> \ <li> revscore </li> \ <li> revtime </li> \ <li> revtitle </li> \ </ul> \ </td> \ </tr> \ </table> \ This attribute will only be used if the HTML form that \ calls htsearch didn't have the <strong>sort</strong> \ value set. The words date and revdate can be used instead \ of time and revtime, as both will sort by the time that \ the document was last modified, if this information is \ given by the server. The default is to sort by the score, \ which ranks documents by best match. The sort methods that \ begin with \"rev\" simply reverse the order of the \ sort. Note that setting this to something other than \ \"score\" will incur a slowdown in searches. \ " }, \ { "sort_names", "score Score time Time title Title revscore 'Reverse Score' revtime 'Reverse Time' revtitle 'Reverse Title'", \ "quoted string list", "htsearch", "", "3.1.0", "Searching:UI", "sort_names: \ score 'Best Match' time Newest title A-Z \\<br> \ revscore 'Worst Match' revtime Oldest revtitle Z-A \ ", " \ These values are used to create the <strong> \ sort</strong> menu. It consists of pairs. The first \ element of each pair is one of the known sort methods, the \ second element is the text that will be shown in the \ menu for that sort method. This text needs to be quoted if \ it contains spaces. \ See the <a href=\"hts_selectors.html\">select list documentation</a> \ for more information on how this attribute is used. \ " }, \ { "soundex_db", "${database_base}.soundex.db", \ "string", "htfuzzy htsearch", "", "all", "File Layout", "soundex_db: ${database_base}.snd.db", " \ The database file used for the fuzzy \"soundex\" search \ algorithm. This database is created by \ <a href=\"htfuzzy.html\">htfuzzy</a> and used by \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a>. \ " }, \ { "star_blank", "${image_url_prefix}/star_blank.gif", \ "string", "htsearch", "", "all", "Presentation:Text", "star_blank: http://www.somewhere.org/icons/noelephant.gif", " \ This specifies the URL to use to display a blank of the \ same size as the star defined in the \ <a href=\"#star_image\">star_image</a> attribute or in the \ <a href=\"#star_patterns\">star_patterns</a> attribute. \ " }, \ { "star_image", "${image_url_prefix}/star.gif", \ "string", "htsearch", "", "all", "Presentation:Text", "star_image: http://www.somewhere.org/icons/elephant.gif", " \ This specifies the URL to use to display a star. This \ allows you to use some other icon instead of a star. \ (We like the star...)<br> \ The display of stars can be turned on or off with the \ <em><a href=\"#use_star_image\">use_star_image</a></em> \ attribute and the maximum number of stars that can be \ displayed is determined by the \ <em><a href=\"#max_stars\">max_stars</a></em> attribute.<br> \ Even though the image can be changed, the ALT value \ for the image will always be a '*'. \ " }, \ { "star_patterns", "", \ "string list", "htsearch", "", "3.0", "Presentation:How", "star_patterns: \ http://www.sdsu.edu /sdsu.gif \\<br> \ http://www.ucsd.edu /ucsd.gif \ ", " \ This attribute allows the star image to be changed \ depending on the URL or the match it is used for. This \ is mainly to make a visual distinction between matches \ on different web sites. The star image could be \ replaced with the logo of the company the match refers \ to.<br> \ It is advisable to keep all the images the same size \ in order to line things up properly in a short result \ listing.<br> \ The format is simple. It is a list of pairs. The first \ element of each pair is a pattern, the second element \ is a URL to the image for that pattern. \ " }, \ { "startday", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "startday: 1", " \ Day component of first date allowed as last-modified date \ of returned docutments. \ This is most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>. \ See also <a href=\"#startyear\">startyear</a>. \ " }, \ { "start_ellipses", "<strong><code>... </code></strong>", \ "string", "htsearch", "", "all", "Presentation:Text", "start_ellipses: ...", " \ When excerpts are displayed in the search output, this \ string will be prepended to the excerpt if there is \ text before the text displayed. This is just a visual \ reminder to the user that the excerpt is only part of \ the complete document. \ " }, \ { "start_highlight", "<strong>", \ "string", "htsearch", "", "3.1.4", "Presentation:Text", "start_highlight: <font color=\"#FF0000\">", " \ When excerpts are displayed in the search output, matched \ words will be highlighted using this string and \ <a href=\"#end_highlight\"> end_highlight</a>. \ You should ensure that highlighting tags are balanced, \ that is, any formatting tags that this string \ opens should be closed by end_highlight. \ " }, \ { "startmonth", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "startmonth: 1", " \ Month component of first date allowed as last-modified date \ of returned docutments. \ This is most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>. \ See also <a href=\"#startyear\">startyear</a>. \ " }, \ { "start_url", "http://www.htdig.org/", \ "string list", "htdig", "", "all", "Indexing:Where", "start_url: http://www.somewhere.org/alldata/index.html", " \ This is the list of URLs that will be used to start a \ dig when there was no existing database. Note that \ multiple URLs can be given here. \ <br>Note also that the value of <em>start_url</em> \ will be the default value for \ <a href=\"#limit_urls_to\">limit_urls_to</a>, so if \ you set start_url to the URLs for specific files, \ rather than a site or subdirectory URL, you may need \ to set limit_urls_to to something less restrictive \ so htdig doesn't reject links in the documents. \ " }, \ { "startyear", "", \ "integer", "htsearch", "", "3.1.6", "Searching:Method", "startyear: 2001", " \ This specifies the year of the cutoff start date for \ search results. If the start or end date are specified, \ only results with a last modified date within this \ range are shown. If a start or end date is specified, but startyear \ is not, then it defaults to 1970. \ See also <a href=\"#startday\">startday</a>, \ <a href=\"#startmonth\">startmonth</a>, \ <a href=\"#endday\">endday</a>, \ <a href=\"#endmonth\">endmonth</a>, \ <a href=\"#endyear\">endyear</a>. \ These are most usefully specified as a \ <a href=\"hts_form.html#startyear\">GCI argument</a>.<br> \ For each component, if a negative number is given, \ it is taken as relative to the current date. \ Relative days can span several months or even years if desired, \ and relative months can span several years. A startday of \ -90 will select matching documents modified within \ the last 90 days. \ " }, \ { "store_phrases", "true", \ "boolean", "htdig", "", "3.2.0b5", "Indexing:How", "startyear: false", " \ Causes htdig to record all occurrences of each word in a document, \ to allow accurate phrase searches. If this is false, only the first \ occurrence of each word will be stored, causing many phrases to be \ missed. Setting this false increases indexing speed by about 20%, \ and reduces disk requirements by about 60%.\ " }, \ { "substring_max_words", "25", \ "integer", "htsearch", "", "3.0.8b1", "Searching:Method", "substring_max_words: 100", " \ The Substring <a href=\"#search_algorithm\">fuzzy algorithm</a> \ could potentially match a \ very large number of words. This value limits the \ number of words each substring pattern can match. Note \ that this does not limit the number of documents that \ are matched in any way. \ " }, \ { "synonym_db", "${common_dir}/synonyms.db", \ "string", "htsearch htfuzzy", "", "3.0", "File Layout", "synonym_db: ${database_base}.syn.db", " \ Points to the database that <a href=\"htfuzzy.html\"> \ htfuzzy</a> creates when the <strong>synonyms</strong> \ algorithm is used.<br> \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a> \ uses this to perform synonym dictionary lookups. \ " }, \ { "synonym_dictionary", "${common_dir}/synonyms", \ "string", "htfuzzy", "", "3.0", "File Layout", "synonym_dictionary: /usr/dict/synonyms", " \ This points to a text file containing the synonym \ dictionary used for the synonyms search algorithm.<br> \ Each line of this file has at least two words. The \ first word is the word to replace, the rest of the \ words are synonyms for that word. \ " }, \ { "syntax_error_file", "${common_dir}/syntax.html", \ "string", "htsearch", "", "all", "Presentation:Files", "syntax_error_file: ${common_dir}/synerror.html", " \ This points to the file which will be displayed if a \ boolean expression syntax error was found. \ " }, \ { "tcp_max_retries", "1", \ "integer", "htdig", "Server", "3.2.0b1", "Indexing:Connection", "tcp_max_retries: 6", " \ This option set the maximum number of attempts when a connection \ <A href=\"#timeout\">timeout</A>s. \ After all these retries, the connection attempt results <timed out>. \ " }, \ { "tcp_wait_time", "5", \ "integer", "htdig", "Server", "3.2.0b1", "Indexing:Connection", "tcp_wait_time: 10", " \ This attribute sets the wait time (in seconds) after a connection \ fails and the <A href=\"#timeout\">timeout</A> is raised. \ " }, \ { "template_map", "Long builtin-long builtin-long Short builtin-short builtin-short", \ "quoted string list", "htsearch", "", "3.0", "Presentation:Files,Searching:UI", "template_map: \ Short short ${common_dir}/short.html \\<br> \ Normal normal builtin-long \\<br> \ Detailed detail ${common_dir}/detail.html \ ", " \ This maps match template names to internal names and \ template file names. It is a list of triplets. The \ first element in each triplet is the name that will be \ displayed in the FORMAT menu. The second element is the \ name used internally and the third element is a \ filename of the template to use.<br> \ There are two predefined templates, namely <strong> \ builtin-long</strong> and <strong> \ builtin-short</strong>. If the filename is one of \ those, they will be used instead.<br> \ More information about templates can be found in the \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a> \ documentation. The particular template is selecterd by the \ <a href=\"hts_form.html#format\">format</a> cgi argument, and the \ default is given by <a href=\"#template_name\">template_name</a> in \ the config file. \ " }, \ { "template_name", "builtin-long", \ "string", "htsearch", "", "3.0", "Searching:UI,Presentation:How", "template_name: long", " \ Specifies the default template if no \ <a href=\"hts_form.html#format\">format</a> field is given by the \ search form. This needs to map to the \ <a href=\"#template_map\">template_map</a>. \ " }, \ { "template_patterns", "", \ "string list", "htsearch", "", "3.1.4", "Presentation:How", "template_patterns: \ http://www.sdsu.edu ${common_dir}/sdsu.html \\<br> \ http://www.ucsd.edu ${common_dir}/ucsd.html \ ", " \ This attribute allows the results template to be changed \ depending on the URL or the match it is used for. This \ is mainly to make a visual distinction between matches \ on different web sites. The results for each site could \ thus be shown in a style matching that site.<br> \ The format is simply a list of pairs. The first \ element of each pair is a pattern, the second element \ is the name of the template file for that pattern.<br> \ More information about templates can be found in the \ <a href=\"htsearch.html\" target=\"_top\">htsearch</a> \ documentation.<br> \ Normally, when using this template selection method, you \ would disable user selection of templates via the <strong>format</strong> \ input parameter in search forms, as the two methods were not \ really designed to interact. Templates selected by URL patterns \ would override any user selection made in the form. If you want \ to use the two methods together, see the notes on \ <a href=\"hts_selectors.html#template_patterns\">combining</a> \ them for an example of how to do this. \ " }, \ { "text_factor", "1", \ "number", "htsearch", "", "3.0", "Searching:Ranking", "text_factor: 0", " \ This is a factor which will be used to multiply the \ weight of words that are not in any special part of a \ document. Setting a factor to 0 will cause normal words \ to be ignored. The number may be a floating point \ number. See also the <a href=\"#heading_factor\"> heading_factor</a> \ attribute. \ " }, \ { "timeout", "30", \ "integer", "htdig", "Server", "all", "Indexing:Connection", "timeout: 42", " \ Specifies the time the digger will wait to complete a \ network read. This is just a safeguard against \ unforeseen things like the all too common \ transformation from a network to a notwork.<br> \ The timeout is specified in seconds. \ " }, \ { "title_factor", "100", \ "number", "htsearch", "", "all", "Searching:Ranking", "title_factor: 12", " \ This is a factor which will be used to multiply the \ weight of words in the title of a document. Setting a \ factor to 0 will cause words in the title to be \ ignored. The number may be a floating point number. See \ also the <a href=\"#heading_factor\"> \ heading_factor</a> attribute. \ " }, \ { "translate_latin1", "true", \ "boolean", "htdig htsearch", "", "3.2.0b5", "Indexing:What", "translate_latin1: false", " \ If set to false, the SGML entities for ISO-8859-1 (or \ Latin 1) characters above &nbsp; (or &#160;) \ will not be translated into their 8-bit equivalents. \ This attribute should be set to false when using a \ <a href=\"#locale\">locale</a> that doesn't use the \ ISO-8859-1 character set, to avoid these entities \ being mapped to inappropriate 8-bit characters, or \ perhaps more importantly to avoid 8-bit characters from \ your locale being mapped back to Latin 1 SGML entities \ in search results. \ " }, \ { "url_list", "${database_base}.urls", \ "string", "htdig", "", "all", "Extra Output", "url_list: /tmp/urls", " \ This file is only created if \ <em><a href=\"#create_url_list\">create_url_list</a></em> is set to \ true. It will contain a list of all URLs that were \ seen. \ " }, \ { "url_log", "${database_base}.log", \ "string", "htdig", "", "3.1.0", "Extra Output", "url_log: /tmp/htdig.progress", " \ If <a href=\"htdig.html\">htdig</a> is \ interrupted, it will write out its progress to this \ file. Note that if it has a large number of URLs to write, \ it may take some time to exit. This can especially happen \ when running update digs and the run is interrupted soon \ after beginning. \ " }, \ { "url_part_aliases", "", \ "string list", "all", "", "3.1.0", "URLs", "url_part_aliases: \ http://search.example.com/~htdig *site \\<br> \ http://www.htdig.org/this/ *1 \\<br> \ .html *2 \ url_part_aliases: \ http://www.htdig.org/ *site \\<br> \ http://www.htdig.org/that/ *1 \\<br> \ .htm *2 \ ", " \ A list of translations pairs <em>from</em> and \ <em>to</em>, used when accessing the database. \ If a part of an URL matches with the \ <em>from</em>-string of each pair, it will be \ translated into the <em>to</em>-string just before \ writing the URL to the database, and translated \ back just after reading it from the database.<br> \ This is primarily used to provide an easy way to \ rename parts of URLs for e.g. changing \ www.example.com/~htdig to www.htdig.org. Two \ different configuration files for digging and \ searching are then used, with url_part_aliases \ having different <em>from</em> strings, but \ identical <em>to</em>-strings.<br> \ See also <a \ href=\"#common_url_parts\">common_url_parts</a>.<br> \ Strings that are normally incorrect in URLs or \ very seldom used, should be used as \ <em>to</em>-strings, since extra storage will be \ used each time one is found as normal part of a \ URL. Translations will be performed with priority \ for the leftmost longest match. Each \ <em>to</em>-string must be unique and not be a \ part of any other <em>to</em>-string. It also helps \ to keep the <em>to</em>-strings short to save space \ in the database. Other than that, the choice of \ <em>to</em>-strings is pretty arbitrary, as they \ just provide a temporary, internal encoding in the \ databases, and none of the characters in these \ strings have any special meaning.<br> \ Note that when this attribute is changed, the \ database should be rebuilt, unless the effect of \ \"moving\" the affected URLs in the database is \ wanted, as described above.<br> \ <strong>Please note:</strong> Don't just copy the \ example below into a single configuration file. \ There are two separate settings of \ <em>url_part_aliases</em> below; the first one is \ for the configuration file to be used by htdig, \ htmerge, and htnotify, and the second one is for the \ configuration file to be used by htsearch. \ In this example, htdig will encode the URL \ \"http://search.example.com/~htdig/contrib/stuff.html\" \ as \"*sitecontrib/stuff*2\" in the databases, and \ htsearch will decode it as \ \"http://www.htdig.org/contrib/stuff.htm\".<br> \ As of version 3.1.6, you can also do more complex \ rewriting of URLs using \ <a href=\"#url_rewrite_rules\">url_rewrite_rules</a> and \ <a href=\"#search_rewrite_rules\">search_rewrite_rules</a>. \ " }, \ { "url_rewrite_rules", "", \ "string list", "htdig", "", "3.2.0b3", "URLs", "url_rewrite_rules: (.*)\\\\?JServSessionIdroot=.* \\\\1 \\<br> \ (.*)\\\\&JServSessionIdroot=.* \\\\1 \\<br> \ (.*)&context=.* \\\\1<br>", " \ This is a list of pairs, <em>regex</em> <em>replacement</em> used to \ permanently rewrite URLs as they are indexed. The left hand string is \ a regular expression; the right hand string is a literal string with \ embedded placeholders for fragments that matched inside brackets in \ the regex. \\0 is the whole matched string, \\1 to \\9 are bracketted \ substrings. Note that the <strong>entire</strong> URL is replaced by \ the right hand string (not just the portion which matches the left hand\ string). Thus, a leading and trailing (.*) should be included in the \ pattern, with matching placeholders in the replacement string.<br> \ Rewrite rules are applied sequentially to each \ incoming URL before normalization occurs. Rewriting does not stop \ once a match has been made, so multiple rules may affect a given URL. \ See also <a href=\"#url_part_aliases\">url_part_aliases</a> which \ allows URLs to be of one \ form during indexing and translated for results. \ "}, \ { "url_seed_score", "", \ "string list", "htsearch", "", "3.2.0b2", "Searching::Ranking", "url_seed_score: \ /mailinglist/ *.5-1e6 <br> \ /docs/|/news/ *1.5 <br> \ /testresults/ "*.7 -200" <br> \ /faq-area/ *2+10000", " \ This is a list of pairs, <em>pattern</em> \ <em>formula</em>, used to weigh the score of \ hits, depending on the URL of the document.<br> \ The <em>pattern</em> part is a substring to match \ against the URL. Pipe ('|') characters can be \ used in the pattern to concatenate substrings for \ web-areas that have the same formula.<br> \ The formula describes a <em>factor</em> and a \ <em>constant</em>, by which the hit score is \ weighed. The <em>factor</em> part is multiplied \ to the original score, then the <em>constant</em> \ part is added.<br> \ The format of the formula is the factor part: \ "*<em>N</em>" optionally followed by comma and \ spaces, followed by the constant part : \ "+<em>M</em>", where the plus sign may be emitted \ for negative numbers. Either part is optional, \ but must come in this order.<br> \ The numbers <em>N</em> and <em>M</em> are floating \ point constants.<br> \ More straightforward is to think of the format as \ "newscore = oldscore*<em>N</em>+<em>M</em>", \ but with the "newscore = oldscore" part left out. \ " }, \ { "url_text_factor", "1", \ "number", "htsearch", "", "??", "Searching:Ranking", "url_text_factor: 1", " \ TO BE COMPLETED<br> \ See also <a href=\"#heading_factor\">heading_factor</a>. \ " }, \ { "use_doc_date", "false", \ "boolean", "htdig", "", "3.2.0b1", "Indexing:How", "use_doc_date: true", " \ If set to true, htdig will use META date tags in documents, \ overriding the modification date returned by the server. \ Any documents that do not have META date tags will retain \ the last modified date returned by the server or found on \ the local file system. \ As of version 3.1.6, in addition to META date tags, htdig will also \ recognize dc.date, dc.date.created and dc.date.modified. \ " }, \ { "use_meta_description", "false", \ "boolean", "htsearch", "", "3.1.0b1", "Presentation:How", "use_meta_description: true", " \ If set to true, any META description tags will be used as \ excerpts by htsearch. Any documents that do not have META \ descriptions will retain their normal excerpts. \ " }, \ { "use_star_image", "true", \ "boolean", "htsearch", "", "all", "Presentation:How", "use_star_image: no", " \ If set to true, the <em><a href=\"#star_image\"> \ star_image</a></em> attribute is used to display upto \ <em><a href=\"#max_stars\">max_stars</a></em> images for \ each match. \ " }, \ { "user_agent", "htdig", \ "string", "htdig", "Server", "3.1.0b2", "Indexing:Out", "user_agent: htdig-digger", " \ This allows customization of the user_agent: field sent when \ the digger requests a file from a server. \ " }, \ { "valid_extensions", "", \ "string list", "htdig", "URL", "3.1.4", "Indexing:Where", "valid_extensions: .html .htm .shtml", " \ This is a list of extensions on URLs which are \ the only ones considered acceptable. This list is used to \ supplement the MIME-types that the HTTP server provides \ with documents. Some HTTP servers do not have a correct \ list of MIME-types and so can advertise certain \ documents as text while they are some binary format. \ If the list is empty, then all extensions are acceptable, \ provided they pass other criteria for acceptance or rejection. \ If the list is not empty, only documents with one of the \ extensions in the list are parsed. \ See also <a href=\"#bad_extensions\">bad_extensions</a>. \ " }, \ { "valid_punctuation", ".-_/!#\\$%^&'", \ "string", "htdig htsearch", "", "all", "Indexing:What", "valid_punctuation: -'", " \ This is the set of characters which may be deleted \ from the document before determining what a word is. \ This means that if a document contains something like \ <code>half-hearted</code> the digger will see this as the three \ words <code> half</code>, <code>hearted</code> and \ <code>halfhearted</code>.<br> \ These characters are also removed before keywords are passed to the \ search engine, so a search for \"half-hearted\" works as expected.<br> \ Note that the dollar sign ($) and backslash (\\) must be escaped by a \ backslash in both valid_punctuation and extra_word_characters. \ Moreover, the backslash should not be the last character on the line. \ There is currently no way to include a back-quote (`) in \ extra_word_characters or valid_punctuation.<br> \ See also the \ <a href=\"#extra_word_characters\">extra_word_characters</a> \ and <a href=\"#allow_numbers\">allow_numbers</a> \ attributes. \ " }, \ { "version", VERSION, \ "string", "htsearch", "", "all", "Presentation:Text", "version: 3.2.0", " \ This specifies the value of the VERSION \ variable which can be used in search templates. \ The default value of this attribute is determined \ at compile time, and will not normally be set \ in configuration files. \ " }, \ { "word_db", "${database_base}.words.db", \ "string", "all", "", "all", "File Layout", "word_db: ${database_base}.allwords.db", " \ This is the main word database. It is an index of all \ the words to a list of documents that contain the \ words. This database can grow large pretty quickly. \ " }, \ { "word_dump", "${database_base}.worddump", \ "string", "htdig htdump htload", "", "3.2.0b1", "File Layout", "word_dump: /tmp/words.txt", " \ This file is basically a text version of the file \ specified in <em><a href=\"#word_db\">word_db</a></em>. Its \ only use is to have a human readable database of all \ words. The file is easy to parse with tools like \ perl or tcl. \ " }, \ { "wordlist_cache_inserts", "false", \ "boolean", "???", "", "???", "Indexing:How", "wordlist_cache_inserts: true", " \ If true, create a cache of size wordlist_cache_size/2 for class \ WordListOne. <em>I don't know what this is for. Does anyone?</em> \ " }, \ { "wordlist_cache_size", "10000000", \ "integer", "all", "", "3.2.0b1", "Indexing:How", "wordlist_cache_size: 40000000", " \ Size (in bytes) of memory cache used by Berkeley DB (DB used by the indexer) \ IMPORTANT: It makes a <strong>huge</strong> difference. The rule \ is that the cache size should be at least 2% of the expected index size. The \ Berkeley DB file has 1% of internal pages that <em>must</em> be cached for good \ performances. Giving an additional 1% leaves room for caching leaf pages. \ " }, \ { "wordlist_compress", "true", \ "boolean", "all", "", "3.2.0b1", "Indexing:How", "wordlist_compress: false", " \ Enables or disables the default compression system for the indexer. \ This currently attempts to compress the index by a factor of 8. If the \ Zlib library is not found on the system, the default is false. \ " }, \ { "wordlist_compress_zlib", "true", \ "boolean", "all", "", "3.2.0b4", "Indexing:How", "wordlist_compress_zlib: false", " \ Enables or disables the zlib compression system for the indexer. \ Both <a href=\"#wordlist_compress\">wordlist_compress</a> and \ <a href=\"#compression_level\">compression_level</a> must be true \ (non-zero) to use this option!\ " }, \ { "wordlist_monitor", "false", \ "boolean", "all", "", "3.2.0b1", "Extra Output", "wordlist_monitor: true", " \ This enables monitoring of what's happening in the indexer. \ It can help to detect performance/configuration problems. \ " }, \ { "wordlist_monitor_period","0", \ "number", "all", "", "3.2.0b1", "Extra Output", "wordlist_monitor_period: .1", " \ Sets the number of seconds between each monitor output. \ " }, \ { "wordlist_monitor_output","", \ "string", "all", "", "3.2.0b1", "Extra Output", "wordlist_monitor_output: myfile", " \ Print monitoring output on file instead of the default stderr. \ " }, { "wordlist_page_size", "0", \ "integer", "all", "", "3.2.0b1", "Indexing:How", "wordlist_page_size: 8192", " \ Size (in bytes) of pages used by Berkeley DB (DB used by the indexer). \ Must be a power of two. \ " }, \ { "wordlist_verbose", "", \ "integer", "", "", "", "", "wordlist_verbose: true", " \ wordlist_verbose 1 walk logic<br> \ wordlist_verbose 2 walk logic details<br> \ wordlist_verbose 2 walk logic lots of details<br> \ " }, \ { "wordlist_wordkey_description", "Word/DocID 32/Flags 8/Location 16", \ "string", "all", "", "3.2.0b1", "Indexing:How", "**this should not be configured by user**", " \ Internal key description: *not user configurable* \ " }, \ { "wordlist_wordrecord_description", "DATA", \ "string", "all", "", "3.2.0b1", "Indexing:How", "**this should not be configured by user**", " \ Internal data description: *not user configurable* \ " }, \ {0, 0, 0, 0, 0, 0, 0, 0, 0} }; HtConfiguration config; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/defaults.h�������������������������������������������������������������������0100644�0063146�0012731�00000001110�10055635541�016164� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // defaults.h // // defaults: Default configuration values for the ht programs // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: defaults.h,v 1.7 2004/05/28 13:15:13 lha Exp $ // #ifndef _defaults_h_ #define _defaults_h_ #include "HtConfiguration.h" extern ConfigDefaults defaults[]; //extern HtConfiguration config; #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htcommon/defaults.xml�����������������������������������������������������������������0100644�0063146�0012731�00000454041�10060033772�016546� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE HtdigAttributes SYSTEM "defaults.dtd" > <HtdigAttributes> <attribute name="accents_db" type="string" programs="htfuzzy htsearch" version="all" category="File Layout" > <default>${database_base}.accents.db</default> <example>${database_base}.uml.db</example> <description> The database file used for the fuzzy "accents" search algorithm. This database is created by <ref type="program">htfuzzy</ref> and used by <ref type="program">htsearch</ref>. </description> </attribute> <attribute name="accept_language" type="string_list" programs="htdig" version="3.2.0b4" category="Indexing:Out" block="Server" > <default></default> <example>en-us en it</example> <description> This attribute allows you to restrict the set of natural languages that are preferred as a response to an HTTP request performed by the digger. This can be done by putting one or more language tags (as defined by RFC 1766) in the preferred order, separated by spaces. By doing this, when the server performs a content negotiation based on the 'accept-language' given by the HTTP user agent, a different content can be shown depending on the value of this attribute. If set to an empty list, no language will be sent and the server default will be returned. </description> </attribute> <attribute name="add_anchors_to_excerpt" type="boolean" programs="htsearch" version="3.1.0" category="Presentation:How" > <default>true</default> <example>no</example> <description> If set to true, the first occurrence of each matched word in the excerpt will be linked to the closest anchor in the document. This only has effect if the <strong>EXCERPT</strong> variable is used in the output template and the excerpt is actually going to be displayed. </description> </attribute> <attribute name="allow_double_slash" type="boolean" programs="htdig" version="3.2.0b4" category="Indexing:Out" > <default>false</default> <example>true</example> <description> If set to true, strings of multiple slashes ('/') in URL paths will be left intact, rather than being collapsed. This is necessary for some search engine URLs which use slashes to separate fields rather than to separate directory components. However, it can lead to multiple database entries refering to the same file, and it causes '/foo//../' to be equivalent to '/foo/', rather than to '/'. </description> </attribute> <attribute name="allow_in_form" type="string_list" programs="htsearch" version="3.1.0" category="Searching:UI" > <default></default> <example>search_algorithm search_results_header</example> <description> Allows the specified config file attributes to be specified in search forms as separate fields. This could be used to allow form writers to design their own headers and footers and specify them in the search form. Another example would be to offer a menu of search_algorithms in the form. <codeblock> <SELECT NAME="search_algorithm"> <OPTION VALUE="exact:1 prefix:0.6 synonyms:0.5 endings:0.1" SELECTED>fuzzy <OPTION VALUE="exact:1">exact </SELECT> </codeblock> The general idea behind this is to make an input parameter out of any configuration attribute that's not already automatically handled by an input parameter. You can even make up your own configuration attribute names, for purposes of passing data from the search form to the results output. You're not restricted to the existing attribute names. The attributes listed in the allow_in_form list will be settable in the search form using input parameters of the same name, and will be propagated to the follow-up search form in the results template using template variables of the same name in upper-case. You can also make select lists out of any of these input parameters, in the follow-up search form, using the <ref type="attr">build_select_lists</ref> configuration attribute. </description> </attribute> <attribute name="allow_numbers" type="boolean" programs="htdig htsearch" version="all" category="Indexing:What" > <default>false</default> <example>true</example> <description> If set to true, numbers are considered words. This means that searches can be done on number as well as regular words. All the same rules apply to numbers as to words. See the description of <ref type="attr">valid_punctuation</ref> for the rules used to determine what a word is. </description> </attribute> <attribute name="allow_space_in_url" type="boolean" programs="htdig" version="3.2.0b6" category="Indexing:Where" > <default>false</default> <example>true</example> <description> If set to true, htdig will handle URLs that contain embedded spaces. Technically, this is a violation of <em>RFC 2396</em>, which says spaces should be stripped out (as htdig does by default). However, many web browsers and HTML code generators violate this standard already, so enabling this attribute allows htdig to handle these non-compliant URLs. Even with this attribute set, htdig still strips out all white space (leading, trailing and embedded), except that space characters embedded within the URL will be encoded as %20. </description> </attribute> <attribute name="allow_virtual_hosts" type="boolean" programs="htdig" version="3.0.8b2" category="Indexing:Where" > <default>true</default> <example>false</example> <description> If set to true, htdig will index virtual web sites as expected. If false, all URL host names will be normalized into whatever the DNS server claims the IP address to map to. If this option is set to false, there is no way to index either "soft" or "hard" virtual web sites. </description> </attribute> <attribute name="anchor_target" type="string" programs="htdig" version="3.1.6" category="Presentation:How" > <default></default> <example>body</example> <description> When the first matched word in the excerpt is linked to the closest anchor in the document, this string can be set to specify a target in the link so the resulting page is displayed in the desired frame. This value will only be used if the <ref type="attr">add_anchors_to_excerpt</ref> attribute is set to true, the <strong>EXCERPT</strong> variable is used in the output template and the excerpt is actually displayed with a link. </description> </attribute> <attribute name="any_keywords" type="boolean" programs="htsearch" version="3.2.0b2" category="Searching:Method" > <default>false</default> <example>yes</example> <description> If set to true, the words in the <strong>keywords</strong> input parameter in the search form will be joined with logical ORs rather than ANDs, so that any of the words provided will do. Note that this has nothing to do with limiting the search to words in META keywords tags. See the <a href="hts_form.html"> search form</a> documentation for details on this. </description> </attribute> <attribute name="author_factor" type="number" programs="htsearch" version="??" category="Searching:Ranking" > <default>1</default> <example>1</example> <description> TO BE COMPLETED<br/> See also <ref type="attr">heading_factor</ref>. </description> </attribute> <attribute name="authorization" type="string" programs="htdig" version="3.1.4" category="Indexing:Out" block="URL" > <default></default> <example>mypassword</example> <description> This tells htdig to send the supplied <em>username</em><strong>:</strong><em>password</em> with each HTTP request. The credentials will be encoded using the "Basic" authentication scheme. There <em>must</em> be a colon (:) between the username and password.<br/> This attribute can also be specified on htdig's command line using the -u option, and will be blotted out so it won't show up in a process listing. If you use it directly in a configuration file, be sure to protect it so it is readable only by you, and do not use that same configuration file for htsearch. </description> </attribute> <attribute name="backlink_factor" type="number" programs="htsearch" version="3.1.0" category="Searching:Ranking" > <default>1000</default> <example>501.1</example> <description> This is a weight of "how important" a page is, based on the number of URLs pointing to it. It's actually multiplied by the ratio of the incoming URLs (backlinks) and outgoing URLs (links on the page), to balance out pages with lots of links to pages that link back to them. The ratio gives lower weight to "link farms", which often have many links to them. This factor can be changed without changing the database in any way. However, setting this value to something other than 0 incurs a slowdown on search results. </description> </attribute> <attribute name="bad_extensions" type="string_list" programs="htdig" version="all" category="Indexing:Where" block="URL" > <default>.wav .gz .z .sit .au .zip .tar .hqx .exe .com .gif .jpg .jpeg .aiff .class .map .ram .tgz .bin .rpm .mpg .mov .avi .css</default> <example>.foo .bar .bad</example> <description> This is a list of extensions on URLs which are considered non-parsable. This list is used mainly to supplement the MIME-types that the HTTP server provides with documents. Some HTTP servers do not have a correct list of MIME-types and so can advertise certain documents as text while they are some binary format. If the list is empty, then all extensions are acceptable, provided they pass other criteria for acceptance or rejection. See also <ref type="attr">valid_extensions</ref>. </description> </attribute> <attribute name="bad_querystr" type="pattern_list" programs="htdig" version="3.1.0" category="Indexing:Where" block="URL" > <default></default> <example>forum=private section=topsecret&passwd=required</example> <description> This is a list of CGI query strings to be excluded from indexing. This can be used in conjunction with CGI-generated portions of a website to control which pages are indexed. </description> </attribute> <attribute name="bad_word_list" type="string" programs="htdig htsearch" version="all" category="Indexing:What,Searching:Method" > <default>${common_dir}/bad_words</default> <example>${common_dir}/badwords.txt</example> <description> This specifies a file which contains words which should be excluded when digging or searching. This list should include the most common words or other words that you don't want to be able to search on (things like <em> sex</em> or <em>smut</em> are examples of these.)<br/> The file should contain one word per line. A sample bad words file is located in the <code>contrib/examples</code> directory. </description> </attribute> <attribute name="bin_dir" type="string" programs="all" version="all" category="File Layout" > <default configmacro="true">BIN_DIR</default> <example>/usr/local/bin</example> <description> This is the directory in which the executables related to ht://Dig are installed. It is never used directly by any of the programs, but other attributes can be defined in terms of this one. <p> The default value of this attribute is determined at compile time. </p> </description> </attribute> <attribute name="boolean_keywords" type="string list" programs="htsearch" version="3.1.6" category="Presentation:How" > <default configmacro="true">and or not</default> <example>et ou non</example> <description> These three strings are used as the keywords used in constructing the LOGICAL_WORDS template variable, and in parsing the <a href="hts_form.html#words">words</a> input parameter when the <a href="hts_form.html#method">method</a> parameter or <ref type="attr">match_method</ref> attribute is set to <code>boolean</code>. See also the <ref type="attr">boolean_syntax_errors</ref> attribute. </description> </attribute> <attribute name="boolean_syntax_errors" type="quoted string list" programs="htsearch" version="3.1.6" category="Presentation:How" > <default configmacro="true">Expected 'a search word, a quoted phrase, a boolean expression between ()' 'at the end' 'instead of' 'end of expression' quotes</default> <example> Attendait "un mot" "à la fin" "au lieu de" "fin d'expression" "points de quotation" </example> <description> These six strings are used as the keywords used to construct various syntax error messages for errors encountered in parsing the <a href="hts_form.html#words">words</a> input parameter when the <a href="hts_form.html#method">method</a> parameter or <ref type="attr">match_method</ref> attribute is set to <code>boolean</code>. They are used in conjunction with the <ref type="attr">boolean_keywords</ref> attribute, and comprise all English-specific parts of these error messages. The order in which the strings are put together may not be ideal, or even gramatically correct, for all languages, but they can be used to make fairly intelligible messages in many languages. </description> </attribute> <attribute name="build_select_lists" type="quoted_string_list" programs="htsearch" version="3.2.0b1" category="Searching:UI" > <default></default> <example>MATCH_LIST matchesperpage matches_per_page_list \ 1 1 1 matches_per_page "Previous Amount" \ RESTRICT_LIST,multiple restrict restrict_names 2 1 2 restrict "" \ FORMAT_LIST,radio format template_map 3 2 1 template_name ""</example> <description> This list allows you to define any htsearch input parameter as a select list for use in templates, provided you also define the corresponding name list attribute which enumerates all the choices to put in the list. It can be used for existing input parameters, as well as any you define using the <ref type="attr">allow_in_form</ref> attribute. The entries in this list each consist of an octuple, a set of eight strings defining the variables and how they are to be used to build a select list. The attribute can contain many of these octuples. The strings in the string list are merely taken eight at a time. For each octuple of strings specified in build_select_lists, the elements have the following meaning: <ol> <li>the name of the template variable to be defined as a list, optionally followed by a comma and the type of list, and optional formatting codes</li> <li>the input parameter name that the select list will set</li> <li>the name of the user-defined attribute containing the name list</li> <li>the tuple size used in the name list above</li> <li>the index into a name list tuple for the value</li> <li>the index for the corresponding label on the selector</li> <li>the configuration attribute where the default value for this input parameter is defined</li> <li>the default label, if not an empty string, which will be used as the label for an additional list item for the current input parameter value if it doesn't match any value in the given list</li> </ol> See the <a href="hts_selectors.html">select list documentation</a> for more information on this attribute. </description> </attribute> <attribute name="caps_factor" type="number" programs="htsearch" version="??" category="Searching:Ranking" > <default>1</default> <example>1</example> <description> TO BE COMPLETED<br/> See also <ref type="attr">heading_factor</ref>. </description> </attribute> <attribute name="case_sensitive" type="boolean" programs="htdig" version="3.1.0b2" category="Indexing:Where" > <default>true</default> <example>false</example> <description> This specifies whether ht://Dig should consider URLs case-sensitive or not. If your server is case-insensitive, you should probably set this to false. </description> </attribute> <attribute name="check_unique_date" type="boolean" programs="htdig" version="3.2.0b3" category="" block="Global" > <default>false</default> <example>false</example> <description> Include the modification date of the page in the MD5 hash, to reduce the problem with identical but physically separate pages in different parts of the tree pointing to different pages. </description> </attribute> <attribute name="check_unique_md5" type="boolean" programs="htdig" version="3.2.0b3" category="" block="Global" > <default>false</default> <example>false</example> <description> Uses the MD5 hash of pages to reject aliases, prevents multiple entries in the index caused by such things as symbolic links Note: May not do the right thing for incremental update </description> </attribute> <attribute name="collection_names" type="string_list" programs="htsearch" version="3.2.0b2" category="" > <default></default> <example>htdig_docs htdig_bugs</example> <description> This is a list of config file names that are used for searching multiple databases. Simply put, htsearch will loop through the databases specified by each of these config files and present the result of the search on all of the databases. The corresponding config files are looked up in the <ref type="attr">config_dir</ref> directory. Each listed config file <strong>must</strong> exist, as well as the corresponding databases. </description> </attribute> <attribute name="common_dir" type="string" programs="all" version="all" category="File Layout" > <default configmacro="true">COMMON_DIR</default> <example>/tmp</example> <description> Specifies the directory for files that will or can be shared among different search databases. The default value for this attribute is defined at compile time. </description> </attribute> <attribute name="common_url_parts" type="string_list" programs="all" version="3.1.0" category="URLs" > <default>http:// http://www. ftp:// ftp://ftp. /pub/ .html .htm .gif .jpg .jpeg /index.html /index.htm .com/ .com mailto:</default> <example>//www.htdig.org/ml/ \ .html \ http://dev.htdig.org/ \ http://www.htdig.org/</example> <description> Sub-strings often found in URLs stored in the database. These are replaced in the database by an internal space-saving encoding. If a string specified in <ref type="attr">url_part_aliases</ref>, overlaps any string in common_url_parts, the common_url_parts string is ignored.<br/> Note that when this attribute is changed, the database should be rebuilt, unless the effect of "changing" the affected URLs in the database is wanted.<br/> </description> </attribute> <attribute name="compression_level" type="integer" programs="htdig" version="3.1.0" category="Indexing:How" > <default>0</default> <example>6</example> <description> If specified and the <a href="http://www.cdrom.com/pub/infozip/zlib/">zlib</a> compression library was available when compiled, this attribute controls the amount of compression used in the <ref type="attr">doc_excerpt</ref> file. </description> </attribute> <attribute name="config" type="string" programs="all" version="??" category="File Layout" > <default configmacro="true">DEFAULT_CONFIG_FILE</default> <example></example> <description> Name of configuration file to load. For security reasons, restrictions are placed on the values which can be specified on the command line to <ref type="program">htsearch</ref>. The default value of this attribute is determined at compile time. </description> </attribute> <attribute name="config_dir" type="string" programs="all" version="all" category="File Layout" > <default configmacro="true">CONFIG_DIR</default> <example>/var/htdig/conf</example> <description> This is the directory which contains all configuration files related to ht://Dig. It is never used directly by any of the programs, but other attributes or the <ref type="attr">include</ref> directive can be defined in terms of this one. <p> The default value of this attribute is determined at compile time. </p> </description> </attribute> <attribute name="cookies_input_file" type="string" programs="htdig" version="3.2.0b4" category="Indexing:Connection" > <default></default> <example>${common_dir}/cookies.txt</example> <description> Specifies the location of the file used for importing cookies for the crawl. These cookies will be preloaded into htdig's in-memory cookie jar, but aren't written back to the file. Cookies are specified according to Netscape's format (tab-separated fields). If this attribute is left blank, no cookie file will be read. <p> For more information, see the sample cookies.txt file in the ht://Dig source distribution. </p> </description> </attribute> <attribute name="create_image_list" type="boolean" programs="htdig" version="all" category="Extra Output" > <default>false</default> <example>yes</example> <description> If set to true, a file with all the image URLs that were seen will be created, one URL per line. This list will not be in any order and there will be lots of duplicates, so after htdig has completed, it should be piped through <code>sort -u</code> to get a unique list. </description> </attribute> <attribute name="create_url_list" type="boolean" programs="htdig" version="all" category="Extra Output" > <default>false</default> <example>yes</example> <description> If set to true, a file with all the URLs that were seen will be created, one URL per line. This list will not be in any order and there will be lots of duplicates, so after htdig has completed, it should be piped through <code>sort -u</code> to get a unique list. </description> </attribute> <attribute name="database_base" type="string" programs="all" version="all" category="File Layout" > <default>${database_dir}/db</default> <example>${database_dir}/sales</example> <description> This is the common prefix for files that are specific to a search database. Many different attributes use this prefix to specify filenames. Several search databases can share the same directory by just changing this value for each of the databases. </description> </attribute> <attribute name="database_dir" type="string" programs="all" version="all" category="File Layout" > <default configmacro="true">DATABASE_DIR</default> <example>/var/htdig</example> <description> This is the directory which contains all database and other files related to ht://Dig. It is never used directly by any of the programs, but other attributes are defined in terms of this one. <p> The default value of this attribute is determined at compile time. </p> </description> </attribute> <attribute name="date_factor" type="number" programs="htsearch" version="3.1.0" category="Searching:Ranking" > <default>0</default> <example>0.35</example> <description> This factor, gives higher rankings to newer documents and lower rankings to older documents. Before setting this factor, it's advised to make sure your servers are returning accurate dates (check the dates returned in the long format). Additionally, setting this to a nonzero value incurs a small performance hit on searching. </description> </attribute> <attribute name="date_format" type="string" programs="htsearch" version="3.1.2" category="Presentation:How" > <default></default> <example>%Y-%m-%d</example> <description> This format string determines the output format for modification dates of documents in the search results. It is interpreted by your system's <em>strftime</em> function. Please refer to your system's manual page for this function, for a description of available format codes. If this format string is empty, as it is by default, <ref type="program">htsearch</ref> will pick a format itself. In this case, the <ref type="attr">iso_8601</ref> attribute can be used to modify the appearance of the date. </description> </attribute> <attribute name="description_factor" type="number" programs="htsearch" version="3.1.0b3" category="Searching:Ranking" > <default>150</default> <example>350</example> <description> Plain old "descriptions" are the text of a link pointing to a document. This factor gives weight to the words of these descriptions of the document. Not surprisingly, these can be pretty accurate summaries of a document's content. See also <ref type="attr">heading_factor</ref> and <ref type="attr">meta_description_factor</ref>. </description> </attribute> <attribute name="description_meta_tag_names" type="number" programs="htsearch" version="3.1.6" category="Searching:Ranking" > <default>description</default> <example>"description htdig-description"</example> <description> The words in this list are used to search for descriptions in HTML <em>META</em> tags. This list can contain any number of strings that each will be seen as the name for whatever description convention is used. While words in any of the specified description contents will be indexed, only the last meta tag containing a description will be kept as the meta description field for the document, for use in search results. The order in which the names are specified in this configuration attribute is irrelevant, as it is the order in which the tags appear in the documents that matters.<br/> The <em>META</em> tags have the following format:<br/> <code> <META name="<em>somename</em>" content="<em>somevalue</em>"> </code><br/> See also <ref type="attr">meta_description_factor</ref>. </description> </attribute> <attribute name="disable_cookies" type="boolean" programs="htdig" version="3.2.0b4" category="Indexing:Connection" block="Server" > <default>true</default> <example>true</example> <description> This option, if set to true, will disable HTTP cookies. </description> </attribute> <attribute name="doc_db" type="string" programs="all" version="all" category="File Layout" > <default>${database_base}.docdb</default> <example>${database_base}documents.db</example> <description> This file will contain a Berkeley database of documents indexed by document number. It contains all the information gathered for each document, except the document excerpts which are stored in the <ref type="attr">doc_excerpt</ref> file. </description> </attribute> <attribute name="doc_excerpt" type="string" programs="all" version="3.2.0b1" category="File Layout" > <default>${database_base}.excerpts</default> <example>${database_base}excerpts.db</example> <description> This file will contain a Berkeley database of document excerpts indexed by document number. It contains all the text gathered for each document, so this file can become rather large if <ref type="attr">max_head_length</ref> is set to a large value. The size can be reduced by setting the <ref type="attr">compression_level</ref>, if supported on your system. </description> </attribute> <attribute name="doc_index" type="string" programs="htdig" version="all" category="File Layout" > <default>${database_base}.docs.index</default> <example>documents.index.db</example> <description> This file contains a mapping of document numbers to URLs and is used by htdig during indexing. It is used on updates if it exists. </description> </attribute> <attribute name="doc_list" type="string" programs="htdig htdump htload" version="all" category="File Layout" > <default>${database_base}.docs</default> <example>/tmp/documents.text</example> <description> This file is basically a text version of the file specified in <ref type="attr">doc_db</ref>. Its only use is to have a human readable database of all documents. The file is easy to parse with tools like perl or tcl. </description> </attribute> <attribute name="endday" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default></default> <example>31</example> <description> Day component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>. See also <ref type="attr">startyear</ref>. </description> </attribute> <attribute name="end_ellipses" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default><strong><code> ...</code></strong></default> <example>...</example> <description> When excerpts are displayed in the search output, this string will be appended to the excerpt if there is text following the text displayed. This is just a visual reminder to the user that the excerpt is only part of the complete document. </description> </attribute> <attribute name="end_highlight" type="string" programs="htsearch" version="3.1.4" category="Presentation:Text" > <default></strong></default> <example></font></example> <description> When excerpts are displayed in the search output, matched words will be highlighted using <ref type="attr">start_highlight</ref> and this string. You should ensure that highlighting tags are balanced, that is, this string should close any formatting tag opened by start_highlight. </description> </attribute> <attribute name="endings_affix_file" type="string" programs="htfuzzy" version="all" category="File Layout" > <default>${common_dir}/english.aff</default> <example>/var/htdig/affix_rules</example> <description> Specifies the location of the file which contains the affix rules used to create the endings search algorithm databases. Consult the documentation on <ref type="program">htfuzzy</ref> for more information on the format of this file. </description> </attribute> <attribute name="endings_dictionary" type="string" programs="htfuzzy" version="all" category="File Layout" > <default>${common_dir}/english.0</default> <example>/var/htdig/dictionary</example> <description> Specifies the location of the file which contains the dictionary used to create the endings search algorithm databases. Consult the documentation on <ref type="program">htfuzzy</ref> for more information on the format of this file. </description> </attribute> <attribute name="endings_root2word_db" type="string" programs="htfuzzy htsearch" version="all" category="File Layout" > <default>${common_dir}/root2word.db</default> <example>/var/htdig/r2w.db</example> <description> This attributes specifies the database filename to be used in the 'endings' fuzzy search algorithm. The database maps word roots to all legal words with that root. For more information about this and other fuzzy search algorithms, consult the <ref type="program">htfuzzy</ref> documentation.<br/> Note that the default value uses the <ref type="attr">common_dir</ref> attribute instead of the <ref type="attr">database_dir</ref> attribute. This is because this database can be shared with different search databases. </description> </attribute> <attribute name="endings_word2root_db" type="string" programs="htfuzzy htsearch" version="all" category="File Layout" > <default>${common_dir}/word2root.db</default> <example>/var/htdig/w2r.bm</example> <description> This attributes specifies the database filename to be used in the 'endings' fuzzy search algorithm. The database maps words to their root. For more information about this and other fuzzy search algorithms, consult the <ref type="program">htfuzzy</ref> documentation.<br/> Note that the default value uses the <ref type="attr">common_dir</ref> attribute instead of the <ref type="attr">database_dir</ref> attribute. This is because this database can be shared with different search databases. </description> </attribute> <attribute name="endmonth" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default></default> <example>12</example> <description> Month component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>. See also <ref type="attr">startyear</ref>. </description> </attribute> <attribute name="endyear" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default></default> <example>2002</example> <description> Year component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>. See also <ref type="attr">startyear</ref>. </description> </attribute> <attribute name="excerpt_length" type="integer" programs="htsearch" version="all" category="Presentation:How" > <default>300</default> <example>500</example> <description> This is the maximum number of characters the displayed excerpt will be limited to. The first matched word will be highlighted in the middle of the excerpt so that there is some surrounding context.<br/> The <ref type="attr">start_ellipses</ref> and <ref type="attr">end_ellipses</ref> are used to indicate that the document contains text before and after the displayed excerpt respectively. The <ref type="attr">start_highlight</ref> and <ref type="attr">end_highlight</ref> are used to specify what formatting tags are used to highlight matched words. </description> </attribute> <attribute name="excerpt_show_top" type="boolean" programs="htsearch" version="all" category="Presentation:How" > <default>false</default> <example>yes</example> <description> If set to true, the excerpt of a match will always show the top of the matching document. If it is false (the default), the excerpt will attempt to show the part of the document that actually contains one of the words. </description> </attribute> <attribute name="exclude" type="pattern_list" programs="htsearch" version="3.2.0b4" category="Searching:Method" > <default></default> <example>myhost.com/mailarchive/</example> <description> If a URL contains any of the space separated patterns, it will be discarded in the searching phase. This is used to exclude certain URLs from search results. The list can be specified from within the configuration file, and can be overridden with the "exclude" input parameter in the search form. </description> </attribute> <attribute name="exclude_urls" type="pattern_list" programs="htdig" version="all" category="Indexing:Where" block="URL" > <default>/cgi-bin/ .cgi</default> <example>students.html cgi-bin</example> <description> If a URL contains any of the space separated patterns, it will be rejected. This is used to exclude such common things such as an infinite virtual web-tree which start with cgi-bin. </description> </attribute> <attribute name="external_parsers" type="quoted_string_list" programs="htdig" version="3.0.7" category="External:Parsers" > <default></default> <example>text/html /usr/local/bin/htmlparser \ application/pdf /usr/local/bin/parse_doc.pl \ application/msword->text/plain "/usr/local/bin/mswordtotxt -w" \ application/x-gunzip->user-defined /usr/local/bin/ungzipper</example> <description> This attribute is used to specify a list of content-type/parsers that are to be used to parse documents that cannot by parsed by any of the internal parsers. The list of external parsers is examined before the builtin parsers are checked, so this can be used to override the internal behavior without recompiling htdig.<br/> The external parsers are specified as pairs of strings. The first string of each pair is the content-type that the parser can handle while the second string of each pair is the path to the external parsing program. If quoted, it may contain parameters, separated by spaces.<br/> External parsing can also be done with external converters, which convert one content-type to another. To do this, instead of just specifying a single content-type as the first string of a pair, you specify two types, in the form <em>type1</em><strong>-></strong><em>type2</em>, as a single string with no spaces. The second string will define an external converter rather than an external parser, to convert the first type to the second. If the second type is <strong>user-defined</strong>, then it's up to the converter script to put out a "Content-Type: <em>type</em>" header followed by a blank line, to indicate to htdig what type it should expect for the output, much like what a CGI script would do. The resulting content-type must be one that htdig can parse, either internally, or with another external parser or converter.<br/> Only one external parser or converter can be specified for any given content-type. However, an external converter for one content-type can be chained to the internal parser for the same type, by appending <strong>-internal</strong> to the second type string (e.g. text/html->text/html-internal) to perform external preprocessing on documents of this type before internal parsing. There are two internal parsers, for text/html and text/plain.<p> The parser program takes four command-line parameters, not counting any parameters already given in the command string:<br/> <em>infile content-type URL configuration-file</em><br/> </p> <table border="1"> <tr> <th> Parameter </th> <th> Description </th> <th> Example </th> </tr> <tr> <td valign="top"> infile </td> <td> A temporary file with the contents to be parsed. </td> <td> /var/tmp/htdext.14242 </td> </tr> <tr> <td valign="top"> content-type </td> <td> The MIME-type of the contents. </td> <td> text/html </td> </tr> <tr> <td valign="top"> URL </td> <td> The URL of the contents. </td> <td> http://www.htdig.org/attrs.html </td> </tr> <tr> <td valign="top"> configuration-file </td> <td> The configuration-file in effect. </td> <td> /etc/htdig/htdig.conf </td> </tr> </table><p> The external parser is to write information for htdig on its standard output. Unless it is an external converter, which will output a document of a different content-type, then its output must follow the format described here.<br/> The output consists of records, each record terminated with a newline. Each record is a series of (unless expressively allowed to be empty) non-empty tab-separated fields. The first field is a single character that specifies the record type. The rest of the fields are determined by the record type. </p> <table border="1"> <tr> <th> Record type </th> <th> Fields </th> <th> Description </th> </tr> <tr> <th rowspan="3" valign="top"> w </th> <td valign="top"> word </td> <td> A word that was found in the document. </td> </tr> <tr> <td valign="top"> location </td> <td> A number indicating the normalized location of the word within the document. The number has to fall in the range 0-1000 where 0 means the top of the document. </td> </tr> <tr> <td valign="top"> heading level </td> <td> A heading level that is used to compute the weight of the word depending on its context in the document itself. The level is in the range of 0-10 and are defined as follows: <dl compact="true"> <dt> 0 </dt> <dd> Normal text </dd> <dt> 1 </dt> <dd> Title text </dd> <dt> 2 </dt> <dd> Heading 1 text </dd> <dt> 3 </dt> <dd> Heading 2 text </dd> <dt> 4 </dt> <dd> Heading 3 text </dd> <dt> 5 </dt> <dd> Heading 4 text </dd> <dt> 6 </dt> <dd> Heading 5 text </dd> <dt> 7 </dt> <dd> Heading 6 text </dd> <dt> 8 </dt> <dd> <em>unused</em> </dd> <dt> 9 </dt> <dd> <em>unused</em> </dd> <dt> 10 </dt> <dd> Keywords </dd> </dl> </td> </tr> <tr> <th rowspan="2" valign="top"> u </th> <td valign="top"> document URL </td> <td> A hyperlink to another document that is referenced by the current document. It must be complete and non-relative, using the URL parameter to resolve any relative references found in the document. </td> </tr> <tr> <td valign="top"> hyperlink description </td> <td> For HTML documents, this would be the text between the <a href...> and </a> tags. </td> </tr> <tr> <th valign="top"> t </th> <td valign="top"> title </td> <td> The title of the document </td> </tr> <tr> <th valign="top"> h </th> <td valign="top"> head </td> <td> The top of the document itself. This is used to build the excerpt. This should only contain normal ASCII text </td> </tr> <tr> <th valign="top"> a </th> <td valign="top"> anchor </td> <td> The label that identifies an anchor that can be used as a target in an URL. This really only makes sense for HTML documents. </td> </tr> <tr> <th valign="top"> i </th> <td valign="top"> image URL </td> <td> An URL that points at an image that is part of the document. </td> </tr> <tr> <th rowspan="3" valign="top"> m </th> <td valign="top"> http-equiv </td> <td> The HTTP-EQUIV attribute of a <a href="meta.html"><em>META</em> tag</a>. May be empty. </td> </tr> <tr> <td valign="top"> name </td> <td> The NAME attribute of this <a href="meta.html"><em>META</em> tag</a>. May be empty. </td> </tr> <tr> <td valign="top"> contents </td> <td> The CONTENTS attribute of this <a href="meta.html"><em>META</em> tag</a>. May be empty. </td> </tr> </table> <p><em>See also FAQ questions <ref type="faq">4.8</ref> and <ref type="faq">4.9</ref> for more examples.</em></p> </description> </attribute> <attribute name="external_protocols" type="quoted_string_list" programs="htdig" version="3.2.0b1" category="External:Protocols" > <default></default> <example>https /usr/local/bin/handler.pl \ ftp /usr/local/bin/ftp-handler.pl</example> <description> This attribute is a bit like <ref type="attr">external_parsers</ref> since it specifies a list of protocols/handlers that are used to download documents that cannot be retrieved using the internal methods. This enables htdig to index documents with URL schemes it does not understand, or to use more advanced authentication for the documents it is retrieving. This list is checked before HTTP or other methods, so this can override the internal behavior without writing additional code for htdig.<br/> The external protocols are specified as pairs of strings, the first being the URL scheme that the script can handle while the second is the path to the script itself. If the second is quoted, then additional command-line arguments may be given.<br/> If the external protocol does not contain a colon (:), it is assumed to have the standard format "protocol://[usr[:password]@]address[:port]/path". If it ends with a colon, then it is assumed to have the simpler format "protocol:path". If it ends with "://" then the standard form is again assumed. <br/> If the external protocol does not contain a colon (:), it is assumed to have the standard format "protocol://[usr[:password]@]address[:port]/path". If it ends with a colon, then it is assumed to have the simpler format "protocol:path". If it ends with "://" then the standard form is again assumed. <br/> The program takes three command-line parameters, not counting any parameters already given in the command string:<br/> <em>protocol URL configuration-file</em><br/> <table border="1"> <tr> <th> Parameter </th> <th> Description </th> <th> Example </th> </tr> <tr> <td valign="top"> protocol </td> <td> The URL scheme to be used. </td> <td> https </td> </tr> <tr> <td valign="top"> URL </td> <td> The URL to be retrieved. </td> <td> https://www.htdig.org:8008/attrs.html </td> </tr> <tr> <td valign="top"> configuration-file </td> <td> The configuration-file in effect. </td> <td> /etc/htdig/htdig.conf </td> </tr> </table><p> The external protocol script is to write information for htdig on the standard output. The output must follow the form described here. The output consists of a header followed by a blank line, followed by the contents of the document. Each record in the header is terminated with a newline. Each record is a series of (unless expressively allowed to be empty) non-empty tab-separated fields. The first field is a single character that specifies the record type. The rest of the fields are determined by the record type. </p> <table border="1"> <tr> <th> Record type </th> <th> Fields </th> <th> Description </th> </tr> <tr> <th valign="top"> s </th> <td valign="top"> status code </td> <td> An HTTP-style status code, e.g. 200, 404. Typical codes include: <dl compact="true"> <dt> 200 </dt> <dd> Successful retrieval </dd> <dt> 304 </dt> <dd> Not modified (for example, if the document hasn't changed) </dd> <dt> 301 </dt> <dd> Redirect (to another URL) </dd> <dt> 401 </dt> <dd> Not authorized </dd> <dt> 404 </dt> <dd> Not found </dd> </dl> </td> </tr> <tr> <th valign="top"> r </th> <td valign="top"> reason </td> <td> A text string describing the status code, e.g "Redirect" or "Not Found." </td> </tr> <tr> <th valign="top"> m </th> <td valign="top"> status code </td> <td> The modification time of this document. While the code is fairly flexible about the time/date formats it accepts, it is recommended to use something standard, like RFC1123: Sun, 06 Nov 1994 08:49:37 GMT, or ISO-8601: 1994-11-06 08:49:37 GMT. </td> </tr> <tr> <th valign="top"> t </th> <td valign="top"> content-type </td> <td> A valid MIME type for the document, like text/html or text/plain. </td> </tr> <tr> <th valign="top"> l </th> <td valign="top"> content-length </td> <td> The length of the document on the server, which may not necessarily be the length of the buffer returned. </td> </tr> <tr> <th valign="top"> u </th> <td valign="top"> url </td> <td> The URL of the document, or in the case of a redirect, the URL that should be indexed as a result of the redirect. </td> </tr> </table> </description> </attribute> <attribute name="extra_word_characters" type="string" programs="htdig htsearch" version="3.1.2" category="Indexing:What" > <default></default> <example>_</example> <description> These characters are considered part of a word. In contrast to the characters in the <ref type="attr">valid_punctuation</ref> attribute, they are treated just like letter characters.<br/> Note that the <ref type="attr">locale</ref> attribute is normally used to configure which characters constitute letter characters. </description> </attribute> <attribute name="head_before_get" type="boolean" programs="htdig" version="3.2.0b1" category="Indexing:Connection" block="Server" > <default>false</default> <example>true</example> <description> This option works only if we take advantage of persistent connections (see persistent_connections attribute). If set to true an HTTP/1.1 <em>HEAD</em> call is made in order to retrieve header information about a document. If the status code and the content-type returned let the document be parsable, then a following 'GET' call is made. </description> </attribute> <attribute name="heading_factor" type="number" programs="htsearch" version="3.2.0b1" category="Searching:Ranking" > <default>5</default> <example>20</example> <description> This is a factor which will be used to multiply the weight of words between <h1> and </h1> tags, as well as headings of levels <h2> through <h6>. It is used to assign the level of importance to headings. Setting a factor to 0 will cause words in these headings to be ignored. The number may be a floating point number. See also <ref type="attr">author_factor</ref> <ref type="attr">backlink_factor</ref> <ref type="attr">caps_factor</ref> <ref type="attr">date_factor</ref> <ref type="attr">description_factor</ref> <ref type="attr">keywords_factor</ref> <ref type="attr">meta_description_factor</ref> <ref type="attr">text_factor</ref> <ref type="attr">title_factor</ref> <ref type="attr">url_text_factor</ref> </description> </attribute> <attribute name="htnotify_prefix_file" type="string" programs="htnotify" version="3.2.0b3" category="Extra Output" > <default></default> <example>${common_dir}/notify_prefix.txt</example> <description> Specifies the file containing text to be inserted in each mail message sent by htnotify before the list of expired webpages. If omitted, nothing is inserted. </description> </attribute> <attribute name="htnotify_replyto" type="string" programs="htnotify" version="3.2.0b3" category="Extra Output" > <default></default> <example>design-group@foo.com</example> <description> This specifies the email address that htnotify email messages include in the Reply-to: field. </description> </attribute> <attribute name="htnotify_sender" type="string" programs="htnotify" version="all" category="Extra Output" > <default>webmaster@www</default> <example>bigboss@yourcompany.com</example> <description> This specifies the email address that htnotify email messages get sent out from. The address is forged using /usr/lib/sendmail. Check htnotify/htnotify.cc for detail on how this is done. </description> </attribute> <attribute name="htnotify_suffix_file" type="string" programs="htnotify" version="3.2.0b3" category="Extra Output" > <default></default> <example>${common_dir}/notify_suffix.txt</example> <description> Specifies the file containing text to be inserted in each mail message sent by htnotify after the list of expired webpages. If omitted, htnotify will insert a standard message. </description> </attribute> <attribute name="htnotify_webmaster" type="string" programs="htnotify" version="3.2.0b3" category="Extra Output" > <default>ht://Dig Notification Service</default> <example>Notification Service</example> <description> This provides a name for the From field, in addition to the email address for the email messages sent out by htnotify. </description> </attribute> <attribute name="http_proxy" type="string" programs="htdig" version="3.0" category="Indexing:Connection" block="URL" > <default></default> <example>3128</example> <description> When this attribute is set, all HTTP document retrievals will be done using the HTTP-PROXY protocol. The URL specified in this attribute points to the host and port where the proxy server resides.<br/> The use of a proxy server greatly improves performance of the indexing process. </description> </attribute> <attribute name="http_proxy_authorization" type="string" programs="htdig" version="3.2.0b4" category="Indexing:Connection" block="URL" > <default></default> <example>mypassword</example> <description> This tells htdig to send the supplied <em>username</em><strong>:</strong><em>password</em> with each HTTP request, when using a proxy with authorization requested. The credentials will be encoded using the "Basic" authentication scheme. There <em>must</em> be a colon (:) between the username and password. </description> </attribute> <attribute name="http_proxy_exclude" type="pattern_list" programs="htdig" version="3.1.0b3" category="Indexing:Connection" > <default></default> <example>//intranet.foo.com/</example> <description> When this is set, URLs matching this will not use the proxy. This is useful when you have a mixture of sites near to the digging server and far away. </description> </attribute> <attribute name="ignore_alt_text" type="boolean" programs="htdig" version="3.1.6" category="Indexing:What" > <default>false</default> <example>true</example> <description> If set, this causes the text of the ALT field in an <IMG...> tag not to be indexed as part of the text of the document, nor included in excerpts. </description> </attribute> <attribute name="ignore_dead_servers" type="boolean" programs="htdig" version="3.1.6" category="Indexing:Connection" > <default>true</default> <example>false</example> <description> Determines whether htdig will continue to index URLs from a server after an attempted connection to the server fails as "no host found" or "host not found (port)." If set to false, htdig will try <em>every</em> URL from that server. </description> </attribute> <attribute name="image_list" type="string" programs="htdig" version="all" category="Extra Output" > <default>${database_base}.images</default> <example>allimages</example> <description> This is the file that a list of image URLs gets written to by <ref type="program">htdig</ref> when the <ref type="attr">create_image_list</ref> is set to true. As image URLs are seen, they are just appended to this file, so after htdig finishes it is probably a good idea to run <code>sort -u</code> on the file to eliminate duplicates from the file. </description> </attribute> <attribute name="image_url_prefix" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default configmacro="true">IMAGE_URL_PREFIX</default> <example>/images/htdig</example> <description> This specifies the directory portion of the URL used to display star images. This attribute isn't directly used by htsearch, but is used in the default URL for the <ref type="attr">star_image</ref> and <ref type="attr">star_blank</ref> attributes, and other attributes may be defined in terms of this one. <p> The default value of this attribute is determined at compile time. </p> </description> </attribute> <attribute name="include" type="string" programs="all" version="3.1.0" category="" > <default></default> <example>${config_dir}/htdig.conf</example> <description> This is not quite a configuration attribute, but rather a directive. It can be used within one configuration file to include the definitions of another file. The last definition of an attribute is the one that applies, so after including a file, any of its definitions can be overridden with subsequent definitions. This can be useful when setting up many configurations that are mostly the same, so all the common attributes can be maintained in a single configuration file. The include directives can be nested, but watch out for nesting loops. </description> </attribute> <attribute name="iso_8601" type="boolean" programs="htsearch htnotify" version="3.1.0b2" category="Presentation:How,Extra Output" > <default>false</default> <example>true</example> <description> This sets whether dates should be output in ISO 8601 format. For example, this was written on: 1998-10-31 11:28:13 EST. See also the <ref type="attr">date_format</ref> attribute, which can override any date format that <ref type="program">htsearch</ref> picks by default.<br/> This attribute also affects the format of the date <ref type="program">htnotify</ref> expects to find in a <strong>htdig-notification-date</strong> field. </description> </attribute> <attribute name="keywords" type="string_list" programs="htsearch" version="??" category="Searching:Method" > <default></default> <example>documentation</example> <description> Keywords which <strong>must</strong> be found on all pages returned, even if the "or" ("Any") <ref type="attr">method</ref> is selected. </description> </attribute> <attribute name="keywords_factor" type="number" programs="htsearch" version="all" category="Searching:Ranking" > <default>100</default> <example>12</example> <description> This is a factor which will be used to multiply the weight of words in the list of keywords of a document. The number may be a floating point number. See also the <ref type="attr">heading_factor</ref>attribute. </description> </attribute> <attribute name="keywords_meta_tag_names" type="string_list" programs="htdig" version="3.0.6" category="Indexing:What" > <default>keywords htdig-keywords</default> <example>keywords description</example> <description> The words in this list are used to search for keywords in HTML <em>META</em> tags. This list can contain any number of strings that each will be seen as the name for whatever keyword convention is used.<br/> The <em>META</em> tags have the following format: <codeblock> <META name="<em>somename</em>" content="<em>somevalue</em>"> </codeblock> </description> </attribute> <attribute name="limit_normalized" type="pattern_list" programs="htdig" version="3.1.0b2" category="Indexing:Where" > <default></default> <example>//www.mydomain.com</example> <description> This specifies a set of patterns that all URLs have to match against in order for them to be included in the search. Unlike the limit_urls_to attribute, this is done <strong>after</strong> the URL is normalized and the <ref type="attr">server_aliases</ref> attribute is applied. This allows filtering after any hostnames and DNS aliases are resolved. Otherwise, this attribute is the same as the <ref type="attr">limit_urls_to</ref> attribute. </description> </attribute> <attribute name="limit_urls_to" type="pattern_list" programs="htdig" version="all" category="Indexing:Where" > <default>${start_url}</default> <example>.sdsu.edu kpbs [.*\.html]</example> <description> This specifies a set of patterns that all URLs have to match against in order for them to be included in the search. Any number of strings can be specified, separated by spaces. If multiple patterns are given, at least one of the patterns has to match the URL.<br/> Matching, by default, is a case-insensitive string match on the URL to be used, unless the <ref type="attr">case_sensitive</ref> attribute is set. The match will be performed <em>after</em> the relative references have been converted to a valid URL. This means that the URL will <em>always</em> start with <code>http://</code>.<br/> Granted, this is not the perfect way of doing this, but it is simple enough and it covers most cases. </description> </attribute> <attribute name="local_default_doc" type="string_list" programs="htdig" version="3.0.8b2" category="Indexing:Where" block="Server" > <default>index.html</default> <example>default.html default.htm index.html index.htm</example> <description> Set this to the default documents in a directory used by the server. This is used for local filesystem access to translate URLs like http://foo.com/ into something like /home/foo.com/index.html<br/> The list should only contain names that the local server recognizes as default documents for directory URLs, as defined by the DirectoryIndex setting in Apache's srm.conf, for example. As of version 3.1.5, this can be a string list rather than a single name, and htdig will use the first name that works. Since this requires a loop, setting the most common name first will improve performance. Special characters can be embedded in these names using %xx hex encoding. </description> </attribute> <attribute name="local_urls" type="string_list" programs="htdig" version="3.0.8b2" category="Indexing:Where" > <default></default> <example>//www.foo.com/=/usr/www/htdocs/</example> <description> Set this to tell ht://Dig to access certain URLs through local filesystems. At first ht://Dig will try to access pages with URLs matching the patterns through the filesystems specified. If it cannot find the file, or if it doesn't recognize the file name extension, it will try the URL through HTTP instead. Note the example--the equal sign and the final slashes in both the URL and the directory path are critical. <br/>The fallback to HTTP can be disabled by setting the <ref type="attr">local_urls_only</ref> attribute to true. To access user directory URLs through the local filesystem, set <ref type="attr">local_user_urls</ref>. The only file name extensions currently recognized for local filesystem access are .html, .htm, .txt, .asc, .ps, .eps and .pdf. For anything else, htdig must ask the HTTP server for the file, so it can determine the MIME content-type of it. As of version 3.1.5, you can provide multiple mappings of a given URL to different directories, and htdig will use the first mapping that works. Special characters can be embedded in these names using %xx hex encoding. For example, you can use %3D to embed an "=" sign in an URL pattern. </description> </attribute> <attribute name="local_urls_only" type="boolean" programs="htdig" version="3.1.4" category="Indexing:Where" > <default>false</default> <example>true</example> <description> Set this to tell ht://Dig to access files only through the local filesystem, for URLs matching the patterns in the <ref type="attr">local_urls</ref> or <ref type="attr">local_user_urls</ref> attribute. If it cannot find the file, it will give up rather than trying HTTP or another protocol. </description> </attribute> <attribute name="local_user_urls" type="string_list" programs="htdig" version="3.0.8b2" category="Indexing:Where" > <default></default> <example>//www.my.org/=/home/,/www/</example> <description> Set this to access user directory URLs through the local filesystem. If you leave the "path" portion out, it will look up the user's home directory in /etc/password (or NIS or whatever). As with <ref type="attr">local_urls</ref>, if the files are not found, ht://Dig will try with HTTP or the appropriate protocol. Again, note the example's format. To map http://www.my.org/~joe/foo/bar.html to /home/joe/www/foo/bar.html, try the example below. <br/>The fallback to HTTP can be disabled by setting the <ref type="attr">local_urls_only</ref> attribute to true. As of version 3.1.5, you can provide multiple mappings of a given URL to different directories, and htdig will use the first mapping that works. Special characters can be embedded in these names using %xx hex encoding. For example, you can use %3D to embed an "=" sign in an URL pattern. </description> </attribute> <attribute name="locale" type="string" programs="htdig" version="3.0" category="Indexing:What,Presentation:How" > <default>C</default> <example>en_US</example> <description> Set this to whatever locale you want your search database cover. It affects the way international characters are dealt with. On most systems a list of legal locales can be found in /usr/lib/locale. Also check the <strong>setlocale(3C)</strong> man page. Note that depending the locale you choose, and whether your system's locale implementation affects floating point input, you may need to specify the decimal point as a comma rather than a period. This will affect settings of <ref type="attr">search_algorithm</ref> and any of the scoring factors. </description> </attribute> <attribute name="logging" type="boolean" programs="htsearch" version="3.1.0b2" category="Extra Output" > <default>false</default> <example>true</example> <description> This sets whether htsearch should use the syslog() to log search requests. If set, this will log requests with a default level of LOG_INFO and a facility of LOG_LOCAL5. For details on redirecting the log into a separate file or other actions, see the <strong>syslog.conf(5)</strong> man page. To set the level and facility used in logging, change LOG_LEVEL and LOG_FACILITY in the include/htconfig.h file before compiling. <dl> <dt> Each line logged by htsearch contains the following: </dt> <dd> REMOTE_ADDR [config] (match_method) [words] [logicalWords] (matches/matches_per_page) - page, HTTP_REFERER </dd> </dl> where any of the above are null or empty, it either puts in '-' or 'default' (for config). </description> </attribute> <attribute name="maintainer" type="string" programs="htdig" version="all" category="Indexing:Out" block="Server" > <default>bogus@unconfigured.htdig.user</default> <example>ben.dover@uptight.com</example> <description> This should be the email address of the person in charge of the digging operation. This string is added to the user-agent: field when the digger sends a request to a server. </description> </attribute> <attribute name="match_method" type="string" programs="htsearch" version="3.0" category="Searching:Method" > <default>and</default> <example>boolean</example> <description> This is the default method for matching that htsearch uses. The valid choices are: <ul> <li> or </li> <li> and </li> <li> boolean </li> </ul> This attribute will only be used if the HTML form that calls htsearch didn't have the <a href="hts_form.html#method">method</a> value set. </description> </attribute> <attribute name="matches_per_page" type="integer" programs="htsearch" version="3.0" category="Searching:Method" > <default>10</default> <example>999</example> <description> If this is set to a relatively small number, the matches will be shown in pages instead of all at once. This attribute will only be used if the HTML form that calls htsearch didn't have the <a href="hts_form.html#matchesperpage">matchesperpage</a> value set. </description> </attribute> <attribute name="max_connection_requests" type="integer" programs="htdig" version="3.2.0b1" category="Indexing:Connection" > <default>-1</default> <example>100</example> <description> This attribute tells htdig to limit the number of requests it will send to a server using a single, persistent HTTP connection. This only applies when the <ref type="attr">persistent_connections</ref> attribute is set. You may set the limit as high as you want, but it must be at least 1. A value of -1 specifies no limit. Requests in the queue for a server will be combined until either the limit is reached, or the queue is empty. </description> </attribute> <attribute name="max_description_length" type="integer" programs="htdig" version="all" category="Indexing:What" > <default>60</default> <example>40</example> <description> While gathering descriptions of URLs, <ref type="program">htdig</ref> will only record those descriptions which are shorter than this length. This is used mostly to deal with broken HTML. (If a hyperlink is not terminated with a </a> the description will go on until the end of the document.) </description> </attribute> <attribute name="max_descriptions" type="integer" programs="htdig" version="all" category="Indexing:What" > <default>5</default> <example>15</example> <description> While gathering descriptions of URLs, <ref type="program">htdig</ref> will only record up to this number of descriptions, in the order in which it encounters them. This is used to prevent the database entry for a document from growing out of control if the document has a huge number of links to it. </description> </attribute> <attribute name="max_doc_size" type="integer" programs="htdig" version="3.0" category="Indexing:What" block="URL" > <default>100000</default> <example>5000000</example> <description> This is the upper limit to the amount of data retrieved for documents. This is mainly used to prevent unreasonable memory consumption since each document will be read into memory by <ref type="program">htdig</ref>. </description> </attribute> <attribute name="max_excerpts" type="integer" programs="htsearch" version="3.1.6" category="Presentation:How" block="URL" > <default>1</default> <example>10</example> <description> This value determines the maximum number of excerpts that can be displayed for one matching document in the search results. </description> </attribute> <attribute name="max_head_length" type="integer" programs="htdig" version="all" category="Indexing:How" > <default>512</default> <example>50000</example> <description> For each document retrieved, the top of the document is stored. This attribute determines the size of this block. The text that will be stored is only the text; no markup is stored.<br/> We found that storing 50,000 bytes will store about 95% of all the documents completely. This really depends on how much storage is available and how much you want to show. </description> </attribute> <attribute name="max_hop_count" type="integer" programs="htdig" version="all" category="Indexing:Where" > <default>999999</default> <example>4</example> <description> Instead of limiting the indexing process by URL pattern, it can also be limited by the number of hops or clicks a document is removed from the starting URL. <br/> The starting page or pages will have hop count 0. </description> </attribute> <attribute name="max_keywords" type="integer" programs="htdig" version="3.2.0b1" category="Indexing:What" > <default>-1</default> <example>10</example> <description> This attribute can be used to limit the number of keywords per document that htdig will accept from meta keywords tags. A value of -1 or less means no limit. This can help combat meta keyword spamming, by limiting the amount of keywords that will be indexed, but it will not completely prevent irrelevant matches in a search if the first few keywords in an offending document are not relevant to its contents. </description> </attribute> <attribute name="max_meta_description_length" type="integer" programs="htdig" version="3.1.0b1" category="Indexing:How" > <default>512</default> <example>1000</example> <description> While gathering descriptions from meta description tags, <ref type="program">htdig</ref> will only store up to this much of the text for each document. </description> </attribute> <attribute name="max_prefix_matches" type="integer" programs="htsearch" version="3.1.0b1" category="Searching:Method" > <default>1000</default> <example>100</example> <description> The Prefix fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each prefix can match. Note that this does not limit the number of documents that are matched in any way. </description> </attribute> <attribute name="max_retries" type="number" programs="htdig" version="3.2.0b1" category="Indexing:Connection" > <default>3</default> <example>6</example> <description> This option set the maximum number of retries when retrieving a document fails (mainly for reasons of connection). </description> </attribute> <attribute name="max_stars" type="number" programs="htsearch" version="all" category="Presentation:How" > <default>4</default> <example>6</example> <description> When stars are used to display the score of a match, this value determines the maximum number of stars that can be displayed. </description> </attribute> <attribute name="maximum_page_buttons" type="integer" programs="htsearch" version="3.2.0b3" category="Presentation:How" > <default>${maximum_pages}</default> <example>20</example> <description> This value limits the number of page links that will be included in the page list at the bottom of the search results page. By default, it takes on the value of the <ref type="attr">maximum_pages</ref> attribute, but you can set it to something lower to allow more pages than buttons. In this case, pages above this number will have no corresponding button. </description> </attribute> <attribute name="maximum_pages" type="integer" programs="htsearch" version="all" category="Presentation:How" > <default>10</default> <example>20</example> <description> This value limits the number of page links that will be included in the page list at the bottom of the search results page. As of version 3.1.4, this will limit the total number of matching documents that are shown. You can make the number of page buttons smaller than the number of allowed pages by setting the <ref type="attr">maximum_page_buttons</ref> attribute. </description> </attribute> <attribute name="maximum_word_length" type="integer" programs="htdig htsearch" version="3.1.3" category="Indexing:What" > <default>32</default> <example>15</example> <description> This sets the maximum length of words that will be indexed. Words longer than this value will be silently truncated when put into the index, or searched in the index. </description> </attribute> <attribute name="md5_db" type="string" programs="htdig" version="3.2.0b3" category="File Layout" > <default>${database_base}.md5hash.db</default> <example>${database_base}.md5.db</example> <description> This file holds a database of md5 and date hashes of pages to catch and eliminate duplicates of pages. See also the <ref type="attr">check_unique_md5</ref> and <ref type="attr">check_unique_date</ref> attributes. </description> </attribute> <attribute name="meta_description_factor" type="number" programs="htsearch" version="3.1.0b1" category="Searching:Ranking" > <default>50</default> <example>20</example> <description> This is a factor which will be used to multiply the weight of words in any META description tags in a document. The number may be a floating point number. See also the <ref type="attr">heading_factor</ref> attribute and the <ref type="attr">description_factor</ref> attribute. </description> </attribute> <attribute name="metaphone_db" type="string" programs="htfuzzy htsearch" version="all" category="File Layout" > <default>${database_base}.metaphone.db</default> <example>${database_base}.mp.db</example> <description> The database file used for the fuzzy "metaphone" search algorithm. This database is created by <ref type="program">htfuzzy</ref> and used by <ref type="program">htsearch</ref>. </description> </attribute> <attribute name="method_names" type="quoted_string_list" programs="htsearch" version="all" category="Searching:UI" > <default>and All or Any boolean Boolean</default> <example>or Or and And</example> <description> These values are used to create the <strong> method</strong> menu. It consists of pairs. The first element of each pair is one of the known methods, the second element is the text that will be shown in the menu for that method. This text needs to be quoted if it contains spaces. See the <a href="hts_selectors.html">select list documentation</a> for more information on how this attribute is used. </description> </attribute> <attribute name="mime_types" type="string" programs="htdig" version="3.2.0b1" category="Indexing:Where" > <default>${config_dir}/mime.types</default> <example>/etc/mime.types</example> <description> This file is used by htdig for local file access and resolving file:// URLs to ensure the files are parsable. If you are running a webserver with its own MIME file, you should set this attribute to point to that file. </description> </attribute> <attribute name="minimum_prefix_length" type="integer" programs="htsearch" version="3.1.0b1" category="Searching:Method" > <default>1</default> <example>2</example> <description> This sets the minimum length of prefix matches used by the "prefix" fuzzy matching algorithm. Words shorter than this will not be used in prefix matching. </description> </attribute> <attribute name="minimum_speling_length" type="integer" programs="htsearch" version="3.2.0b1" category="Searching:Method" > <default>5</default> <example>3</example> <description> This sets the minimum length of words used by the "speling" fuzzy matching algorithm. Words shorter than this will not be used in this fuzzy matching. </description> </attribute> <attribute name="minimum_word_length" type="integer" programs="htdig htsearch" version="all" category="Indexing:What" > <default>3</default> <example>2</example> <description> This sets the minimum length of words that will be indexed. Words shorter than this value will be silently ignored but still put into the excerpt.<br/> Note that by making this value less than 3, a lot more words that are very frequent will be indexed. It might be advisable to add some of these to the <ref type="attr">bad_word_list</ref>. </description> </attribute> <attribute name="multimatch_factor" type="number" programs="htsearch" version="3.1.6" category="Searching:Ranking" > <default>1</default> <example>1000</example> <description> This factor gives higher rankings to documents that have more than one matching search word when the <strong>or</strong> <ref type="attr">match_method</ref> is used. In version 3.1.6, the matching words' combined scores were multiplied by this factor for each additional matching word. Currently, this multiplier is applied at most once. </description> </attribute> <attribute name="next_page_text" type="string" programs="htsearch" version="3.1.0" category="Presentation:Text" > <default>[next]</default> <example><img src="/htdig/buttonr.gif"></example> <description> The text displayed in the hyperlink to go to the next page of matches. </description> </attribute> <attribute name="no_excerpt_show_top" type="boolean" programs="htsearch" version="3.1.0b3" category="Presentation:How" > <default>false</default> <example>yes</example> <description> If no excerpt is available, this option will act the same as <ref type="attr">excerpt_show_top</ref>, that is, it will show the top of the document. </description> </attribute> <attribute name="no_excerpt_text" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default><em>(None of the search words were found in the top of this document.)</em></default> <example></example> <description> This text will be displayed in place of the excerpt if there is no excerpt available. If this attribute is set to nothing (blank), the excerpt label will not be displayed in this case. </description> </attribute> <attribute name="no_next_page_text" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default>[next]</default> <example></example> <description> The text displayed where there would normally be a hyperlink to go to the next page of matches. </description> </attribute> <attribute name="no_page_list_header" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default></default> <example><hr noshade size=2>All results on this page.<br></example> <description> This text will be used as the value of the PAGEHEADER variable, for use in templates or the <ref type="attr">search_results_footer</ref> file, when all search results fit on a single page. </description> </attribute> <attribute name="no_page_number_text" type="quoted_string_list" programs="htsearch" version="3.0" category="Presentation:Text" > <default></default> <example><strong>1</strong> <strong>2</strong> \ <strong>3</strong> <strong>4</strong> \ <strong>5</strong> <strong>6</strong> \ <strong>7</strong> <strong>8</strong> \ <strong>9</strong> <strong>10</strong> </example> <description> The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the <ref type="attr">search_results_footer</ref> file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. There should be as many strings in the list as there are pages allowed by the <ref type="attr">maximum_page_buttons</ref> attribute. If there are not enough, or the list is empty, the page numbers alone will be used as the text for the links. An entry from this list is used for the current page, as the current page is shown in the page list without a hypertext link, while entries from the <ref type="attr">page_number_text</ref> list are used for the links to other pages. The text strings can contain HTML tags to highlight page numbers or embed images. The strings need to be quoted if they contain spaces. </description> </attribute> <attribute name="no_prev_page_text" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default>[prev]</default> <example></example> <description> The text displayed where there would normally be a hyperlink to go to the previous page of matches. </description> </attribute> <attribute name="no_title_text" type="string" programs="htsearch" version="3.1.0" category="Presentation:Text" > <default>filename</default> <example>"No Title Found"</example> <description> This specifies the text to use in search results when no title is found in the document itself. If it is set to filename, htsearch will use the name of the file itself, enclosed in brackets (e.g. [index.html]). </description> </attribute> <attribute name="noindex_end" type="string" programs="htdig" version="3.1.0" category="Indexing:What" > <default><!--/htdig_noindex--></default> <example></SCRIPT></example> <description> This string marks the end of a section of an HTML file that should be completely ignored when indexing. It works together with <ref type="attr">noindex_start</ref>. As in the defaults, this can be SGML comment declarations that can be inserted anywhere in the documents to exclude different sections from being indexed. However, existing tags can also be used; this is especially useful to exclude some sections from being indexed where the files to be indexed can not be edited. The example shows how SCRIPT sections in 'uneditable' documents can be skipped. Note that the match for this string is case insensitive. </description> </attribute> <attribute name="noindex_start" type="string" programs="htdig" version="3.1.0" category="Indexing:What" > <default><!--htdig_noindex--></default> <example><SCRIPT</example> <description> This string marks the start of a section of an HTML file that should be completely ignored when indexing. It works together with <ref type="attr">noindex_end</ref>. As in the defaults, this can be SGML comment declarations that can be inserted anywhere in the documents to exclude different sections from being indexed. However, existing tags can also be used; this is especially useful to exclude some sections from being indexed where the files to be indexed can not be edited. The example shows how SCRIPT sections in 'uneditable' documents can be skipped; note how noindex_start does not contain an ending >: this allows for all SCRIPT tags to be matched regardless of attributes defined (different types or languages). Note that the match for this string is case insensitive. </description> </attribute> <attribute name="nothing_found_file" type="string" programs="htsearch" version="all" category="Presentation:Files" > <default>${common_dir}/nomatch.html</default> <example>/www/searching/nothing.html</example> <description> This specifies the file which contains the <code> HTML</code> text to display when no matches were found. The file should contain a complete <code>HTML</code> document.<br/> Note that this attribute could also be defined in terms of <ref type="attr">database_base</ref> to make is specific to the current search database. </description> </attribute> <attribute name="nph" type="boolean" programs="htsearch" version="3.2.0b2" category="Presentation:How" > <default>false</default> <example>true</example> <description> This attribute determines whether htsearch sends out full HTTP headers as required for an NPH (non-parsed header) CGI. Some servers assume CGIs will act in this fashion, for example MS IIS. If your server does not send out full HTTP headers, you should set this to true. </description> </attribute> <attribute name="page_list_header" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default><hr noshade size=2>Pages:<br></default> <example></example> <description> This text will be used as the value of the PAGEHEADER variable, for use in templates or the <ref type="attr">search_results_footer</ref> file, when all search results fit on more than one page. </description> </attribute> <attribute name="page_number_separator" type="quoted_string_list" programs="htsearch" version="3.1.4" category="Presentation:Text" > <default>" "</default> <example>"</td> <td>"</example> <description> The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the <ref type="attr">search_results_footer</ref> file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. The strings in the list will be used in rotation, and will separate individual entries taken from <ref type="attr">page_number_text</ref> and <ref type="attr">no_page_number_text</ref>. There can be as many or as few strings in the list as you like. If there are not enough for the number of pages listed, it goes back to the start of the list. If the list is empty, a space is used. The text strings can contain HTML tags. The strings need to be quoted if they contain spaces, or to specify an empty string. </description> </attribute> <attribute name="page_number_text" type="quoted_string_list" programs="htsearch" version="3.0" category="Presentation:Text" > <default></default> <example><em>1</em> <em>2</em> \ <em>3</em> <em>4</em> \ <em>5</em> <em>6</em> \ <em>7</em> <em>8</em> \ <em>9</em> <em>10</em> </example> <description> The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the <ref type="attr">search_results_footer</ref> file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. There should be as many strings in the list as there are pages allowed by the <ref type="attr">maximum_page_buttons</ref> attribute. If there are not enough, or the list is empty, the page numbers alone will be used as the text for the links. Entries from this list are used for the links to other pages, while an entry from the <ref type="attr">no_page_number_text</ref> list is used for the current page, as the current page is shown in the page list without a hypertext link. The text strings can contain HTML tags to highlight page numbers or embed images. The strings need to be quoted if they contain spaces. </description> </attribute> <attribute name="persistent_connections" type="boolean" programs="htdig" version="3.2.0b1" category="Indexing:Connection" block="Server" > <default>true</default> <example>false</example> <description> If set to true, when servers make it possible, htdig can take advantage of persistent connections, as defined by HTTP/1.1 (<em>RFC2616</em>). This permits to reduce the number of open/close operations of connections, when retrieving a document with HTTP. </description> </attribute> <attribute name="plural_suffix" type="string" programs="htsearch" version="3.2.0b2" category="Presentation: Text" > <default>s</default> <example>en</example> <description> Specifies the value of the PLURAL_MATCHES template variable used in the header, footer and template files. This can be used for localization for non-English languages where 's' is not the appropriate suffix. </description> </attribute> <attribute name="prefix_match_character" type="string" programs="htsearch" version="3.1.0b1" category="Searching:Method" > <default>*</default> <example>ing</example> <description> A null prefix character means that prefix matching should be applied to every search word. Otherwise a match is returned only if the word does not end in the characters specified. </description> </attribute> <attribute name="prev_page_text" type="string" programs="htsearch" version="3.0" category="Presentation:Text" > <default>[prev]</default> <example><img src="/htdig/buttonl.gif"></example> <description> The text displayed in the hyperlink to go to the previous page of matches. </description> </attribute> <attribute name="regex_max_words" type="integer" programs="htsearch" version="3.2.0b1" category="Searching:Method" > <default>25</default> <example>10</example> <description> The "regex" fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each regular expression can match. Note that this does not limit the number of documents that are matched in any way. </description> </attribute> <attribute name="remove_bad_urls" type="boolean" programs="htpurge" version="all" category="Indexing:How" block="Server" > <default>true</default> <example>true</example> <description> If TRUE, htpurge will remove any URLs which were marked as unreachable by htdig from the database. If FALSE, it will not do this. When htdig is run in initial mode, documents which were referred to but could not be accessed should probably be removed, and hence this option should then be set to TRUE, however, if htdig is run to update the database, this may cause documents on a server which is temporarily unavailable to be removed. This is probably NOT what was intended, so hence this option should be set to FALSE in that case. </description> </attribute> <attribute name="remove_default_doc" type="string_list" programs="htdig" version="3.1.0" category="Indexing:How" > <default>index.html</default> <example>default.html default.htm index.html index.htm</example> <description> Set this to the default documents in a directory used by the servers you are indexing. These document names will be stripped off of URLs when they are normalized, if one of these names appears after the final slash, to translate URLs like http://foo.com/index.html into http://foo.com/<br/> Note that you can disable stripping of these names during normalization by setting the list to an empty string. The list should only contain names that all servers you index recognize as default documents for directory URLs, as defined by the DirectoryIndex setting in Apache's srm.conf, for example. This only applies to http:// and https:// URLS. </description> </attribute> <attribute name="remove_unretrieved_urls" type="boolean" programs="htpurge" version="3.2.0b1" category="Indexing:How" block="Server" > <default>false</default> <example>true</example> <description> If TRUE, htpurge will remove any URLs which were discovered and included as stubs in the database but not yet retrieved. If FALSE, it will not do this. When htdig is run in initial mode with no restrictions on hopcount or maximum documents, these should probably be removed and set to true. However, if you are hoping to index a small set of documents and eventually get to the rest, you should probably leave this as false. </description> </attribute> <attribute name="restrict" type="pattern_list" programs="htsearch" version="3.2.0b4" category="Searching:Method" > <default></default> <example>//www.acme.com/widgets/</example> <description> This specifies a set of patterns that all URLs have to match against in order for them to be included in the search results. Any number of strings can be specified, separated by spaces. If multiple patterns are given, at least one of the patterns has to match the URL. The list can be specified from within the configuration file, and can be overridden with the "restrict" input parameter in the search form. Note that the restrict list does not take precedence over the <ref type="attr">exclude</ref> list - if a URL matches patterns in both lists it is still excluded from the search results. </description> </attribute> <attribute name="robotstxt_name" type="string" programs="htdig" version="3.0.7" category="Indexing:Out" block="Server" > <default>htdig</default> <example>myhtdig</example> <description> Sets the name that htdig will look for when parsing robots.txt files. This can be used to make htdig appear as a different spider than ht://Dig. Useful to distinguish between a private and a global index. </description> </attribute> <attribute name="script_name" type="string" programs="htsearch" version="3.1.4" category="Presentation:Text" > <default></default> <example>/search/results.shtml</example> <description> Overrides the value of the SCRIPT_NAME environment attribute. This is useful if htsearch is not being called directly as a CGI program, but indirectly from within a dynamic .shtml page using SSI directives. Previously, you needed a wrapper script to do this, but this configuration attribute makes wrapper scripts obsolete for SSI and possibly for other server scripting languages, as well. (You still need a wrapper script when using PHP, though.)<br/> Check out the <code>contrib/scriptname</code> directory for a small example. Note that this attribute also affects the value of the <a href="hts_templates.html#CGI">CGI</a> variable used in htsearch templates. </description> </attribute> <attribute name="search_algorithm" type="string_list" programs="htsearch" version="all" category="Searching:Method" > <default>exact:1</default> <example>0.3</example> <description> Specifies the search algorithms and their weight to use when searching. Each entry in the list consists of the algorithm name, followed by a colon (:) followed by a weight multiplier. The multiplier is a floating point number between 0 and 1. Note that depending on your <ref type="attr">locale</ref> setting, and whether your system's locale implementation affects floating point input, you may need to specify the decimal point as a comma rather than a period.<br/> <strong>Note:</strong>If the exact method is not listed, the search may not work since the original terms will not be used.<br/> Current algorithms supported are: <dl> <dt> exact </dt> <dd> The default exact word matching algorithm. This will find only exactly matched words. </dd> <dt> soundex </dt> <dd> Uses a slightly modified soundex algorithm to match words. This requires that the soundex database be present. It is generated with the <ref type="program">htfuzzy</ref> program. </dd> <dt> metaphone </dt> <dd> Uses the metaphone algorithm for matching words. This algorithm is more specific to the english language than soundex. It requires the metaphone database, which is generated with the <ref type="program">htfuzzy</ref> program. </dd> <dt> accents </dt> <dd> Uses the accents algorithm for matching words. This algorithm will treat all accented letters as equivalent to their unaccented counterparts. It requires the accents database, which is generated with the <ref type="program">htfuzzy</ref> program. </dd> <dt> endings </dt> <dd> This algorithm uses language specific word endings to find matches. Each word is first reduced to its word root and then all known legal endings are used for the matching. This algorithm uses two databases which are generated with <ref type="program">htfuzzy</ref>. </dd> <dt> synonyms </dt> <dd> Performs a dictionary lookup on all the words. This algorithm uses a database generated with the <ref type="program">htfuzzy</ref> program. </dd> <dt> substring </dt> <dd> Matches all words containing the queries as substrings. Since this requires checking every word in the database, this can really slow down searches considerably. </dd> <dt> prefix </dt> <dd> Matches all words beginning with the query strings. Uses the option <ref type="attr">prefix_match_character</ref> to decide whether a query requires prefix matching. For example "abc*" would perform prefix matching on "abc" since * is the default prefix_match_character. </dd> <dt> regex </dt> <dd> Matches all words that match the patterns given as regular expressions. Since this requires checking every word in the database, this can really slow down searches considerably. </dd> <dt> speling </dt> <dd> A simple fuzzy algorithm that tries to find one-off spelling mistakes, such as transposition of two letters or an extra character. Since this usually generates just a few possibilities, it is relatively quick. </dd> </dl> </description> </attribute> <attribute name="search_results_footer" type="string" programs="htsearch" version="all" category="Presentation:Files" > <default>${common_dir}/footer.html</default> <example>/usr/local/etc/ht/end-stuff.html</example> <description> This specifies a filename to be output at the end of search results. While outputting the footer, some variables will be expanded. Variables use the same syntax as the Bourne shell. If there is a variable VAR, the following will all be recognized: <ul> <li> $VAR </li> <li> $(VAR) </li> <li> ${VAR} </li> </ul> The following variables are available. See <a href="hts_template.html">hts_template.html</a> for a complete list. <dl> <dt> MATCHES </dt> <dd> The number of documents that were matched. </dd> <dt> PLURAL_MATCHES </dt> <dd> If MATCHES is not 1, this will be the string "s", else it is an empty string. This can be used to say something like "$(MATCHES) document$(PLURAL_MATCHES) were found" </dd> <dt> MAX_STARS </dt> <dd> The value of the <ref type="attr">max_stars</ref> attribute. </dd> <dt> LOGICAL_WORDS </dt> <dd> A string of the search words with either "and" or "or" between the words, depending on the type of search. </dd> <dt> WORDS </dt> <dd> A string of the search words with spaces in between. </dd> <dt> PAGEHEADER </dt> <dd> This expands to either the value of the <ref type="attr">page_list_header</ref> or <ref type="attr">no_page_list_header</ref> attribute depending on how many pages there are. </dd> </dl> Note that this file will <strong>NOT</strong> be output if no matches were found. In this case the <ref type="attr">nothing_found_file</ref> attribute is used instead. Also, this file will not be output if it is overridden by defining the <ref type="attr">search_results_wrapper</ref> attribute. </description> </attribute> <attribute name="search_results_header" type="string" programs="htsearch" version="all" category="Presentation:Files" > <default>${common_dir}/header.html</default> <example>/usr/local/etc/ht/start-stuff.html</example> <description> This specifies a filename to be output at the start of search results. While outputting the header, some variables will be expanded. Variables use the same syntax as the Bourne shell. If there is a variable VAR, the following will all be recognized: <ul> <li> $VAR </li> <li> $(VAR) </li> <li> ${VAR} </li> </ul> The following variables are available. See <a href="hts_template.html">hts_template.html</a> for a complete list. <!-- Do these need to be listed for both _footer and _header? --> <dl> <dt> MATCHES </dt> <dd> The number of documents that were matched. </dd> <dt> PLURAL_MATCHES </dt> <dd> If MATCHES is not 1, this will be the string "s", else it is an empty string. This can be used to say something like "$(MATCHES) document$(PLURAL_MATCHES) were found" </dd> <dt> MAX_STARS </dt> <dd> The value of the <ref type="attr">max_stars</ref> attribute. </dd> <dt> LOGICAL_WORDS </dt> <dd> A string of the search words with either "and" or "or" between the words, depending on the type of search. </dd> <dt> WORDS </dt> <dd> A string of the search words with spaces in between. </dd> </dl> Note that this file will <strong>NOT</strong> be output if no matches were found. In this case the <ref type="attr">nothing_found_file</ref> attribute is used instead. Also, this file will not be output if it is overridden by defining the <ref type="attr">search_results_wrapper</ref> attribute. </description> </attribute> <attribute name="search_results_order" type="string_list" programs="htsearch" version="3.2.0b2" category="Searching:Ranking" > <default></default> <example>/docs/|faq.html * /maillist/ /testresults/</example> <description> This specifies a list of patterns for URLs in search results. Results will be displayed in the specified order, with the search algorithm result as the second order. Remaining areas, that do not match any of the specified patterns, can be placed by using * as the pattern. If no * is specified, one will be implicitly placed at the end of the list.<br/> See also <ref type="attr">url_seed_score</ref>. </description> </attribute> <attribute name="search_results_wrapper" type="string" programs="htsearch" version="3.1.0" category="Presentation:Files" > <default></default> <example>${common_dir}/wrapper.html</example> <description> This specifies a filename to be output at the start and end of search results. This file replaces the <ref type="attr">search_results_header</ref> and <ref type="attr">search_results_footer</ref> files, with the contents of both in one file, and uses the pseudo-variable <strong>$(HTSEARCH_RESULTS)</strong> as a separator for the header and footer sections. If the filename is not specified, the file is unreadable, or the pseudo-variable above is not found, htsearch reverts to the separate header and footer files instead. While outputting the wrapper, some variables will be expanded, just as for the <ref type="attr">search_results_header</ref> and <ref type="attr">search_results_footer</ref> files.<br/> Note that this file will <strong>NOT</strong> be output if no matches were found. In this case the <ref type="attr">nothing_found_file</ref> attribute is used instead. </description> </attribute> <attribute name="search_rewrite_rules" type="string list" programs="htsearch" version="3.1.6" category="URLs" > <default></default> <example> http://(.*)\\.mydomain\\.org/([^/]*) http://\\2.\\1.com \ http://www\\.myschool\\.edu/myorgs/([^/]*) http://\\1.org </example> <description> This is a list of pairs, <em>regex</em> <em>replacement</em>, used to rewrite URLs in the search results. The left hand string is a regular expression; the right hand string is a literal string with embedded placeholders for fragments that matched inside brackets in the regular expression. \0 is the whole matched string, \1 to \9 are bracketted substrings. The backslash must be doubled-up in the attribute setting to get past the variable expansion parsing. Rewrite rules are applied sequentially to each URL before it is displayed or checked against the <ref type="attr">restrict</ref> or <ref type="attr">exclude</ref> lists. Rewriting does not stop once a match has been made, so multiple rules may affect a given URL. See also <ref type="attr">url_part_aliases</ref> which allows URLs to be of one form during indexing and translated for results, and <ref type="attr">url_rewrite_rules</ref> which allows URLs to be rewritten while indexing. </description> </attribute> <attribute name="server_aliases" type="string_list" programs="htdig" version="3.1.0b2" category="Indexing:Where" > <default></default> <example>foo.mydomain.com:80=www.mydomain.com:80 \ bar.mydomain.com:80=www.mydomain.com:80 </example> <description> This attribute tells the indexer that servers have several DNS aliases, which all point to the same machine and are NOT virtual hosts. This allows you to ensure pages are indexed only once on a given machine, despite the alias used in a URL. As shown in the example, the mapping goes from left to right, so the server name on the right hand side is the one that is used. As of version 3.1.3, the port number is optional, and is assumed to be 80 if omitted. There is no easy way to map all ports from one alias to another without listing them all. </description> </attribute> <attribute name="server_max_docs" type="integer" programs="htdig" version="3.1.0b3" category="Indexing:Where" block="Server" > <default>-1</default> <example>50</example> <description> This attribute tells htdig to limit the dig to retrieve a maximum number of documents from each server. This can cause unusual behavior on update digs since the old URLs are stored alphabetically. Therefore, update digs will add additional URLs in pseudo-alphabetical order, up to the limit of the attribute. However, it is most useful to partially index a server as the URLs of additional documents are entered into the database, marked as never retrieved.<br/> A value of -1 specifies no limit. </description> </attribute> <attribute name="server_wait_time" type="integer" programs="htdig" version="3.1.0b3" category="Indexing:Connection" block="Server" > <default>0</default> <example>20</example> <description> This attribute tells htdig to ensure a server has had a delay (in seconds) from the beginning of the last connection. This can be used to prevent "server abuse" by digging without delay. It's recommended to set this to 10-30 (seconds) when indexing servers that you don't monitor yourself. Additionally, this attribute can slow down local indexing if set, which may or may not be what you intended. </description> </attribute> <attribute name="sort" type="string" programs="htsearch" version="3.1.0" category="Presentation:How" > <default>score</default> <example>revtime</example> <description> This is the default sorting method that htsearch uses to determine the order in which matches are displayed. The valid choices are: <table border="0"> <tr> <td> <ul> <li> score </li> <li> time </li> <li> title </li> </ul> </td> <td> <ul> <li> revscore </li> <li> revtime </li> <li> revtitle </li> </ul> </td> </tr> </table> This attribute will only be used if the HTML form that calls htsearch didn't have the <strong>sort</strong> value set. The words date and revdate can be used instead of time and revtime, as both will sort by the time that the document was last modified, if this information is given by the server. The default is to sort by the score, which ranks documents by best match. The sort methods that begin with "rev" simply reverse the order of the sort. Note that setting this to something other than "score" will incur a slowdown in searches. </description> </attribute> <attribute name="sort_names" type="quoted_string_list" programs="htsearch" version="3.1.0" category="Searching:UI" > <default>score Score time Time title Title revscore 'Reverse Score' revtime 'Reverse Time' revtitle 'Reverse Title'</default> <example>score 'Best Match' time Newest title A-Z \ revscore 'Worst Match' revtime Oldest revtitle Z-A </example> <description> These values are used to create the <strong> sort</strong> menu. It consists of pairs. The first element of each pair is one of the known sort methods, the second element is the text that will be shown in the menu for that sort method. This text needs to be quoted if it contains spaces. See the <a href="hts_selectors.html">select list documentation</a> for more information on how this attribute is used. </description> </attribute> <attribute name="soundex_db" type="string" programs="htfuzzy htsearch" version="all" category="File Layout" > <default>${database_base}.soundex.db</default> <example>${database_base}.snd.db</example> <description> The database file used for the fuzzy "soundex" search algorithm. This database is created by <ref type="program">htfuzzy</ref> and used by <ref type="program">htsearch</ref>. </description> </attribute> <attribute name="star_blank" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default>${image_url_prefix}/star_blank.gif</default> <example>//www.somewhere.org/icons/noelephant.gif</example> <description> This specifies the URL to use to display a blank of the same size as the star defined in the <ref type="attr">star_image</ref> attribute or in the <ref type="attr">star_patterns</ref> attribute. </description> </attribute> <attribute name="star_image" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default>${image_url_prefix}/star.gif</default> <example>//www.somewhere.org/icons/elephant.gif</example> <description> This specifies the URL to use to display a star. This allows you to use some other icon instead of a star. (We like the star...)<br/> The display of stars can be turned on or off with the <ref type="attr">use_star_image</ref> attribute and the maximum number of stars that can be displayed is determined by the <ref type="attr">max_stars</ref> attribute.<br/> Even though the image can be changed, the ALT value for the image will always be a '*'. </description> </attribute> <attribute name="star_patterns" type="string_list" programs="htsearch" version="3.0" category="Presentation:How" > <default></default> <example>http://www.sdsu.edu /sdsu.gif \ http://www.ucsd.edu /ucsd.gif </example> <description> This attribute allows the star image to be changed depending on the URL or the match it is used for. This is mainly to make a visual distinction between matches on different web sites. The star image could be replaced with the logo of the company the match refers to.<br/> It is advisable to keep all the images the same size in order to line things up properly in a short result listing.<br/> The format is simple. It is a list of pairs. The first element of each pair is a pattern, the second element is a URL to the image for that pattern. </description> </attribute> <attribute name="startday" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default></default> <example>1</example> <description> Day component of first date allowed as last-modified date of returned docutments. This is most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>. See also <ref type="attr">startyear</ref>. </description> </attribute> <attribute name="start_ellipses" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default><strong><code>... </code></strong></default> <example>...</example> <description> When excerpts are displayed in the search output, this string will be prepended to the excerpt if there is text before the text displayed. This is just a visual reminder to the user that the excerpt is only part of the complete document. </description> </attribute> <attribute name="start_highlight" type="string" programs="htsearch" version="3.1.4" category="Presentation:Text" > <default><strong></default> <example><font color="#FF0000"></example> <description> When excerpts are displayed in the search output, matched words will be highlighted using this string and <ref type="attr">end_highlight</ref>. You should ensure that highlighting tags are balanced, that is, any formatting tags that this string opens should be closed by end_highlight. </description> </attribute> <attribute name="startmonth" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default></default> <example>1</example> <description> Month component of first date allowed as last-modified date of returned docutments. This is most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>. See also <ref type="attr">startyear</ref>. </description> </attribute> <attribute name="start_url" type="string_list" programs="htdig" version="all" category="Indexing:Where" > <default>http://www.htdig.org/</default> <example>//www.somewhere.org/alldata/index.html</example> <description> This is the list of URLs that will be used to start a dig when there was no existing database. Note that multiple URLs can be given here. <br/>Note also that the value of <em>start_url</em> will be the default value for <href type="attr">limit_urls_to</ref>, so if you set start_url to the URLs for specific files, rather than a site or subdirectory URL, you may need to set limit_urls_to to something less restrictive so htdig doesn't reject links in the documents. </description> </attribute> <attribute name="startyear" type="integer" programs="htsearch" version="3.1.6" category="Searching:Method" > <default>1970</default> <example>2001</example> <description> This specifies the year of the cutoff start date for search results. If the start or end date are specified, only results with a last modified date within this range are shown. See also <ref type="attr">startday</ref>, <ref type="attr">startmonth</ref>, <ref type="attr">endday</ref>, <ref type="attr">endmonth</ref>, <a href="endyear">endyear</a>. These are most usefully specified as a <a href="hts_form.html#startyear">GCI argument</a>.<br/> For each component, if a negative number is given, it is taken as relative to the current date. Relative days can span several months or even years if desired, and relative months can span several years. A startday of -90 will select matching documents modified within the last 90 days. </description> </attribute> <attribute name="substring_max_words" type="integer" programs="htsearch" version="3.0.8b1" category="Searching:Method" > <default>25</default> <example>100</example> <description> The Substring fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each substring pattern can match. Note that this does not limit the number of documents that are matched in any way. </description> </attribute> <attribute name="synonym_db" type="string" programs="htsearch htfuzzy" version="3.0" category="File Layout" > <default>${common_dir}/synonyms.db</default> <example>${database_base}.syn.db</example> <description> Points to the database that <ref type="program">htfuzzy</ref> creates when the <strong>synonyms</strong> algorithm is used.<br/> <ref type="program">htsearch</ref> uses this to perform synonym dictionary lookups. </description> </attribute> <attribute name="synonym_dictionary" type="string" programs="htfuzzy" version="3.0" category="File Layout" > <default>${common_dir}/synonyms</default> <example>/usr/dict/synonyms</example> <description> This points to a text file containing the synonym dictionary used for the synonyms search algorithm.<br/> Each line of this file has at least two words. The first word is the word to replace, the rest of the words are synonyms for that word. </description> </attribute> <attribute name="syntax_error_file" type="string" programs="htsearch" version="all" category="Presentation:Files" > <default>${common_dir}/syntax.html</default> <example>${common_dir}/synerror.html</example> <description> This points to the file which will be displayed if a boolean expression syntax error was found. </description> </attribute> <attribute name="tcp_max_retries" type="integer" programs="htdig" version="3.2.0b1" category="Indexing:Connection" block="Server" > <default>1</default> <example>6</example> <description> This option set the maximum number of attempts when a connection <ref type="attr">timeout</ref>s. After all these retries, the connection attempt results <timed out>. </description> </attribute> <attribute name="tcp_wait_time" type="integer" programs="htdig" version="3.2.0b1" category="Indexing:Connection" block="Server" > <default>5</default> <example>10</example> <description> This attribute sets the wait time (in seconds) after a connection fails and the <ref type="attr">timeout</ref> is raised. </description> </attribute> <attribute name="template_map" type="quoted_string_list" programs="htsearch" version="3.0" category="Presentation:Files,Searching:UI" > <default>Long builtin-long builtin-long Short builtin-short builtin-short</default> <example>Short short ${common_dir}/short.html \ Normal normal builtin-long \ Detailed detail ${common_dir}/detail.html </example> <description> This maps match template names to internal names and template file names. It is a list of triplets. The first element in each triplet is the name that will be displayed in the FORMAT menu. The second element is the name used internally and the third element is a filename of the template to use.<br/> There are two predefined templates, namely <strong> builtin-long</strong> and <strong> builtin-short</strong>. If the filename is one of those, they will be used instead.<br/> More information about templates can be found in the <ref type="program">htsearch</ref> documentation. The particular template is selecterd by the <a href="hts_form.html#format">format</a> cgi argument, and the default is given by <ref type="attr">template_name</ref> in the config file. </description> </attribute> <attribute name="template_name" type="string" programs="htsearch" version="3.0" category="Searching:UI,Presentation:How" > <default>builtin-long</default> <example>long</example> <description> Specifies the default template if no <a href="hts_form.html#format">format</a> field is given by the search form. This needs to map to the <ref type="attr">template_map</ref>. </description> </attribute> <attribute name="template_patterns" type="string_list" programs="htsearch" version="3.1.4" category="Presentation:How" > <default></default> <example>http://www.sdsu.edu ${common_dir}/sdsu.html \ http://www.ucsd.edu ${common_dir}/ucsd.html </example> <description> This attribute allows the results template to be changed depending on the URL or the match it is used for. This is mainly to make a visual distinction between matches on different web sites. The results for each site could thus be shown in a style matching that site.<br/> The format is simply a list of pairs. The first element of each pair is a pattern, the second element is the name of the template file for that pattern.<br/> More information about templates can be found in the <ref type="program">htsearch</ref> documentation.<br/> Normally, when using this template selection method, you would disable user selection of templates via the <strong>format</strong> input parameter in search forms, as the two methods were not really designed to interact. Templates selected by URL patterns would override any user selection made in the form. If you want to use the two methods together, see the notes on <a href="hts_selectors.html#template_patterns">combining</a> them for an example of how to do this. </description> </attribute> <attribute name="text_factor" type="number" programs="htsearch" version="3.0" category="Searching:Ranking" > <default>1</default> <example>0</example> <description> This is a factor which will be used to multiply the weight of words that are not in any special part of a document. Setting a factor to 0 will cause normal words to be ignored. The number may be a floating point number. See also the <ref type="attr">heading_factor</ref> attribute. </description> </attribute> <attribute name="timeout" type="integer" programs="htdig" version="all" category="Indexing:Connection" block="Server" > <default>30</default> <example>42</example> <description> Specifies the time the digger will wait to complete a network read. This is just a safeguard against unforeseen things like the all too common transformation from a network to a notwork.<br/> The timeout is specified in seconds. </description> </attribute> <attribute name="title_factor" type="number" programs="htsearch" version="all" category="Searching:Ranking" > <default>100</default> <example>12</example> <description> This is a factor which will be used to multiply the weight of words in the title of a document. Setting a factor to 0 will cause words in the title to be ignored. The number may be a floating point number. See also the <ref type="attr">heading_factor</ref> attribute. </description> </attribute> <attribute name="url_list" type="string" programs="htdig" version="all" category="Extra Output" > <default>${database_base}.urls</default> <example>/tmp/urls</example> <description> This file is only created if <ref type="attr">create_url_list</ref> is set to true. It will contain a list of all URLs that were seen. </description> </attribute> <attribute name="url_log" type="string" programs="htdig" version="3.1.0" category="Extra Output" > <default>${database_base}.log</default> <example>/tmp/htdig.progress</example> <description> If <ref type="program">htdig</ref> is run with the -l option and interrupted, it will write out its progress to this file. Note that if it has a large number of URLs to write, it may take some time to exit. This can especially happen when running update digs and the run is interrupted soon after beginning. </description> </attribute> <attribute name="url_part_aliases" type="string_list" programs="all" version="3.1.0" category="URLs" > <default></default> <example>http://search.example.com/~htdig *site \ http://www.htdig.org/this/ *1 \ .html *2 </example> <example>http://www.htdig.org/ *site \ http://www.htdig.org/that/ *1 \ .htm *2 </example> <description> A list of translations pairs <em>from</em> and <em>to</em>, used when accessing the database. If a part of an URL matches with the <em>from</em>-string of each pair, it will be translated into the <em>to</em>-string just before writing the URL to the database, and translated back just after reading it from the database.<br/> This is primarily used to provide an easy way to rename parts of URLs for e.g. changing www.example.com/~htdig to www.htdig.org. Two different configuration files for digging and searching are then used, with url_part_aliases having different <em>from</em> strings, but identical <em>to</em>-strings.<br/> See also <ref type="attr">common_url_parts</ref>.<br/> Strings that are normally incorrect in URLs or very seldom used, should be used as <em>to</em>-strings, since extra storage will be used each time one is found as normal part of a URL. Translations will be performed with priority for the leftmost longest match. Each <em>to</em>-string must be unique and not be a part of any other <em>to</em>-string.<br/> Note that when this attribute is changed, the database should be rebuilt, unless the effect of "moving" the affected URLs in the database is wanted, as described above.<br/> <strong>Please note:</strong> Don't just copy the example below into a single configuration file. There are two separate settings of <em>url_part_aliases</em> below; the first one is for the configuration file to be used by htdig, htmerge, and htnotify, and the second one is for the configuration file to be used by htsearch. </description> </attribute> <attribute name="url_rewrite_rules" type="string_list" programs="htdig" version="3.2.0b3" category="URLs" > <default></default> <example>(.*)\\?JServSessionIdroot=.* \\1 \ (.*)\\&JServSessionIdroot=.* \\1 \ (.*)&context=.* \\1</example> <description> This is a list of pairs, <em>regex</em> <em>replacement</em> used to permanently rewrite URLs as they are indexed. The left hand string is a regex; the right hand string is a literal string with embedded placeholders for fragments that matched inside brackets in the regex. \0 is the whole matched string, \1 to \9 are bracketted substrings. Rewrite rules are applied sequentially to each incoming URL before normalization occurs. Rewriting does not stop once a match has been made, so multiple rules may affect a given URL. See also <ref type="attr">url_part_aliases</ref> which allows URLs to be of one form during indexing and translated for results. </description> </attribute> <attribute name="url_seed_score" type="string_list" programs="htsearch" version="3.2.0b2" category="Searching::Ranking" > <default></default> <example>/mailinglist/ *.5-1e6 /docs/|/news/ *1.5 /testresults/ "*.7 -200" /faq-area/ *2+10000</example> <description> This is a list of pairs, <em>pattern</em> <em>formula</em>, used to weigh the score of hits, depending on the URL of the document.<br/> The <em>pattern</em> part is a substring to match against the URL. Pipe ('|') characters can be used in the pattern to concatenate substrings for web-areas that have the same formula.<br/> The formula describes a <em>factor</em> and a <em>constant</em>, by which the hit score is weighed. The <em>factor</em> part is multiplied to the original score, then the <em>constant</em> part is added.<br/> The format of the formula is the factor part: "*<em>N</em>" optionally followed by comma and spaces, followed by the constant part : "+<em>M</em>", where the plus sign may be emitted for negative numbers. Either part is optional, but must come in this order.<br/> The numbers <em>N</em> and <em>M</em> are floating point constants.<br/> More straightforward is to think of the format as "newscore = oldscore*<em>N</em>+<em>M</em>", but with the "newscore = oldscore" part left out. </description> </attribute> <attribute name="url_text_factor" type="number" programs="htsearch" version="??" category="Searching:Ranking" > <default>1</default> <example>1</example> <description> TO BE COMPLETED<br/> See also <ref type="attr">heading_factor</ref>. </description> </attribute> <attribute name="use_doc_date" type="boolean" programs="htdig" version="3.2.0b1" category="Indexing:How" > <default>false</default> <example>true</example> <description> If set to true, htdig will use META date tags in documents, overriding the modification date returned by the server. Any documents that do not have META date tags will retain the last modified date returned by the server or found on the local file system. </description> </attribute> <attribute name="use_meta_description" type="boolean" programs="htsearch" version="3.1.0b1" category="Presentation:How" > <default>false</default> <example>true</example> <description> If set to true, any META description tags will be used as excerpts by htsearch. Any documents that do not have META descriptions will retain their normal excerpts. </description> </attribute> <attribute name="use_star_image" type="boolean" programs="htsearch" version="all" category="Presentation:How" > <default>true</default> <example>no</example> <description> If set to true, the <ref type="attr">star_image</ref> attribute is used to display upto <ref type="attr">max_stars</ref> images for each match. </description> </attribute> <attribute name="user_agent" type="string" programs="htdig" version="3.1.0b2" category="Indexing:Out" block="Server" > <default>htdig</default> <example>htdig-digger</example> <description> This allows customization of the user_agent: field sent when the digger requests a file from a server. </description> </attribute> <attribute name="valid_extensions" type="string_list" programs="htdig" version="3.1.4" category="Indexing:Where" block="URL" > <default></default> <example>.html .htm .shtml</example> <description> This is a list of extensions on URLs which are the only ones considered acceptable. This list is used to supplement the MIME-types that the HTTP server provides with documents. Some HTTP servers do not have a correct list of MIME-types and so can advertise certain documents as text while they are some binary format. If the list is empty, then all extensions are acceptable, provided they pass other criteria for acceptance or rejection. If the list is not empty, only documents with one of the extensions in the list are parsed. See also <ref type="attr">bad_extensions</ref>. </description> </attribute> <attribute name="valid_punctuation" type="string" programs="htdig htsearch" version="all" category="Indexing:What" > <default>.-_/!#$%^&'</default> <example>-'</example> <description> This is the set of characters which will be deleted from the document before determining what a word is. This means that if a document contains something like <code>Andrew's</code> the digger will see this as <code> Andrews</code>.<br/> The same transformation is performed on the keywords the search engine gets.<br/> See also the <ref type="attr">extra_word_characters</ref> attribute. </description> </attribute> <attribute name="version" type="string" programs="htsearch" version="all" category="Presentation:Text" > <default configmacro="true">VERSION</default> <example>3.2.0</example> <description> This specifies the value of the VERSION variable which can be used in search templates. The default value of this attribute is determined at compile time, and will not normally be set in configuration files. </description> </attribute> <attribute name="word_db" type="string" programs="all" version="all" category="File Layout" > <default>${database_base}.words.db</default> <example>${database_base}.allwords.db</example> <description> This is the main word database. It is an index of all the words to a list of documents that contain the words. This database can grow large pretty quickly. </description> </attribute> <attribute name="word_dump" type="string" programs="htdig htdump htload" version="3.2.0b1" category="File Layout" > <default>${database_base}.worddump</default> <example>/tmp/words.txt</example> <description> This file is basically a text version of the file specified in <ref type="attr">word_db</ref>. Its only use is to have a human readable database of all words. The file is easy to parse with tools like perl or tcl. </description> </attribute> <attribute name="wordlist_cache_size" type="integer" programs="all" version="3.2.0b1" category="Indexing:How" > <default>10000000</default> <example>40000000</example> <description> Size of memory cache used by Berkeley DB (DB used by the indexer) IMPORTANT: It makes a <strong>huge</strong> difference. The rule is that the cache size should be at least 2% of the expected index size. The Berkeley DB file has 1% of internal pages that *must* be cached for good performances. Giving an additional 1% leaves room for caching leaf pages. </description> </attribute> <attribute name="wordlist_compress" type="boolean" programs="all" version="3.2.0b1" category="Indexing:How" > <default>true</default> <example>true</example> <description> Enables or disables the default compression system for the indexer. This currently compresses the index by a factor of 8. If the Zlib library is not found on the system, the default is false. </description> </attribute> <attribute name="wordlist_compress_zlib" type="boolean" programs="all" version="3.2.0b4" category="Indexing:How" > <default>true</default> <example>true</example> <description> Enables or disables the zlib compression system for the indexer. wordlist_compress must be true to use this option!` </description> </attribute> <attribute name="wordlist_monitor" type="boolean" programs="all" version="3.2.0b1" category="Extra Output" > <default>false</default> <example>true</example> <description> This enables monitoring of what's happening in the indexer. It can help to detect performance/configuration problems. </description> </attribute> <attribute name="wordlist_monitor_period" type="number" programs="all" version="3.2.0b1" category="Extra Output" > <default>0</default> <example>.1</example> <description> Sets the number of seconds between each monitor output. </description> </attribute> <attribute name="wordlist_monitor_output" type="string" programs="all" version="3.2.0b1" category="Extra Output" > <default></default> <example>myfile</example> <description> Print monitoring output on file instead of the default stderr. </description> </attribute> <attribute name="wordlist_page_size" type="integer" programs="all" version="3.2.0b1" category="Indexing:How" > <default>0</default> <example>8192</example> <description> Size of pages used by Berkeley DB (DB used by the indexer) </description> </attribute> <attribute name="wordlist_verbose" type="integer" programs="" version="" category="" > <default></default> <example>true</example> <description> wordlist_verbose 1 walk logic<br/> wordlist_verbose 2 walk logic details<br/> wordlist_verbose 2 walk logic lots of details<br/> </description> </attribute> <attribute name="wordlist_wordkey_description" type="string" programs="all" version="3.2.0b1" category="Indexing:How" > <default>Word/DocID 32/Flags 8/Location 16</default> <nodocs/> </attribute> <attribute name="wordlist_wordrecord_description" type="string" programs="all" version="3.2.0b1" category="Indexing:How" > <default>DATA</default> <nodocs/> </attribute> </HtdigAttributes> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/���������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013304� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/.cvsignore�����������������������������������������������������������������������0100644�0063146�0012731�00000000114�07426615571�015315� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Makefile *.lo *.la .purify .pure .deps .libs htdb_dump htdb_load htdb_stat ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/Makefile.am����������������������������������������������������������������������0100644�0063146�0012731�00000001015�07723256616�015353� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������include $(top_srcdir)/Makefile.config bin_PROGRAMS = htdb_load htdb_dump htdb_stat htdb_load_SOURCES = htdb_load.cc htdb_load_DEPENDENCIES = $(HTLIBS) htdb_load_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_load_LDADD = $(HTLIBS) htdb_dump_SOURCES = htdb_dump.cc htdb_dump_DEPENDENCIES = $(HTLIBS) htdb_dump_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_dump_LDADD = $(HTLIBS) htdb_stat_SOURCES = htdb_stat.cc htdb_stat_DEPENDENCIES = $(HTLIBS) htdb_stat_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_stat_LDADD = $(HTLIBS) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/Makefile.in����������������������������������������������������������������������0100644�0063146�0012731�00000033761�10063260372�015362� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la bin_PROGRAMS = htdb_load htdb_dump htdb_stat htdb_load_SOURCES = htdb_load.cc htdb_load_DEPENDENCIES = $(HTLIBS) htdb_load_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_load_LDADD = $(HTLIBS) htdb_dump_SOURCES = htdb_dump.cc htdb_dump_DEPENDENCIES = $(HTLIBS) htdb_dump_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_dump_LDADD = $(HTLIBS) htdb_stat_SOURCES = htdb_stat.cc htdb_stat_DEPENDENCIES = $(HTLIBS) htdb_stat_LDFLAGS = $(PROFILING) ${extra_ldflags} htdb_stat_LDADD = $(HTLIBS) subdir = htdb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = htdb_load$(EXEEXT) htdb_dump$(EXEEXT) htdb_stat$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_htdb_dump_OBJECTS = htdb_dump.$(OBJEXT) htdb_dump_OBJECTS = $(am_htdb_dump_OBJECTS) am_htdb_load_OBJECTS = htdb_load.$(OBJEXT) htdb_load_OBJECTS = $(am_htdb_load_OBJECTS) am_htdb_stat_OBJECTS = htdb_stat.$(OBJEXT) htdb_stat_OBJECTS = $(am_htdb_stat_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(htdb_dump_SOURCES) $(htdb_load_SOURCES) \ $(htdb_stat_SOURCES) DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.config \ Makefile.am SOURCES = $(htdb_dump_SOURCES) $(htdb_load_SOURCES) $(htdb_stat_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htdb/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done htdb_dump$(EXEEXT): $(htdb_dump_OBJECTS) $(htdb_dump_DEPENDENCIES) @rm -f htdb_dump$(EXEEXT) $(CXXLINK) $(htdb_dump_LDFLAGS) $(htdb_dump_OBJECTS) $(htdb_dump_LDADD) $(LIBS) htdb_load$(EXEEXT): $(htdb_load_OBJECTS) $(htdb_load_DEPENDENCIES) @rm -f htdb_load$(EXEEXT) $(CXXLINK) $(htdb_load_LDFLAGS) $(htdb_load_OBJECTS) $(htdb_load_LDADD) $(LIBS) htdb_stat$(EXEEXT): $(htdb_stat_OBJECTS) $(htdb_stat_DEPENDENCIES) @rm -f htdb_stat$(EXEEXT) $(CXXLINK) $(htdb_stat_LDFLAGS) $(htdb_stat_OBJECTS) $(htdb_stat_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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: $(mkinstalldirs) $(DESTDIR)$(bindir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am # 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: ���������������htdig-3.2.0b6/htdb/htdb_dump.cc���������������������������������������������������������������������0100644�0063146�0012731�00000032242�10055635541�015570� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #include "htconfig.h" #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1996, 1997, 1998, 1999\n\ Sleepycat Software Inc. All rights reserved.\n"; static const char sccsid[] = "@(#)db_dump.c 11.12 (Sleepycat) 11/10/99"; #endif #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #endif extern "C" { #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "btree.h" #include "hash.h" #include "lock.h" } #include "WordContext.h" #include "WordDBCompress.h" void configure __P((char *)); int db_init __P((char *, int)); int dump __P((DB *, int, int)); int dump_sub __P((DB *, char *, int, int)); int is_sub __P((DB *, int *)); int main __P((int, char *[])); void onint __P((int)); int pheader __P((DB *, char *, int, int)); int show_subs __P((DB *)); void siginit __P((void)); void usage __P((void)); DB_ENV *dbenv; int interrupted; const char *progname = "htdb_dump"; /* Program name. */ int main(int argc, char *argv[]) { extern char *optarg; extern int optind; DB *dbp; int ch, d_close; int e_close, exitval, lflag, Nflag, pflag, ret, subs, keyflag; char *dopt, *home, *subname; int compress = 0; int wordlist = 0; u_int32_t cachesize = 0; Configuration *config = 0; dbp = NULL; d_close = e_close = exitval = lflag = Nflag = pflag = 0; keyflag = 0; dopt = home = subname = NULL; while ((ch = getopt(argc, argv, "d:f:h:klNps:C:zW")) != EOF) switch (ch) { case 'd': dopt = optarg; break; case 'f': if (freopen(optarg, "w", stdout) == NULL) { fprintf(stderr, "%s: %s: reopen: %s\n", progname, optarg, strerror(errno)); exit (1); } break; case 'h': home = optarg; break; case 'k': keyflag = 1; break; case 'l': lflag = 1; break; case 'N': Nflag = 1; break; case 'p': pflag = 1; break; case 's': subname = optarg; break; case 'C': cachesize = atoi(optarg); break; case 'z': compress = DB_COMPRESS; break; case 'W': wordlist = 1; break; case '?': default: usage(); } argc -= optind; argv += optind; if (argc != 1) usage(); if (dopt != NULL && pflag) { fprintf(stderr, "%s: the -d and -p options may not both be specified\n", progname); exit (1); } if (lflag && subname != NULL) { fprintf(stderr, "%s: the -l and -s options may not both be specified\n", progname); exit (1); } /* Handle possible interruptions. */ siginit(); if(wordlist && compress) { static ConfigDefaults defaults[] = { { "wordlist_wordkey_description", "Word/DocID 32/Flag 8/Location 16"}, { "wordlist_env_skip", "true"}, { 0, 0, 0 } }; config = WordContext::Initialize(defaults); } /* * Create an environment object and initialize it for error * reporting. */ if ((ret = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: CDB_db_env_create: %s\n", progname, CDB_db_strerror(ret)); exit (1); } e_close = 1; dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); if(compress && wordlist) dbenv->mp_cmpr_info = (new WordDBCompress)->CmprInfo(); /* Initialize the environment. */ if (db_init(home, Nflag) != 0) goto err; /* Create the DB object and open the file. */ if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "CDB_db_create"); goto err; } if(cachesize > 0) dbp->set_cachesize(dbp, 0, cachesize, 1); d_close = 1; if ((ret = dbp->open(dbp, argv[0], subname, DB_UNKNOWN, (DB_RDONLY | compress), 0)) != 0) { dbp->err(dbp, ret, "open: %s", argv[0]); goto err; } if (dopt != NULL) { if (CDB___db_dump(dbp, dopt, NULL)) { dbp->err(dbp, ret, "CDB___db_dump: %s", argv[0]); goto err; } } else if (lflag) { if (is_sub(dbp, &subs)) goto err; if (subs == 0) { dbp->errx(dbp, "%s: does not contain subdatabases", argv[0]); goto err; } if (show_subs(dbp)) goto err; } else { subs = 0; if (subname == NULL && is_sub(dbp, &subs)) goto err; if (subs) { if (dump_sub(dbp, argv[0], pflag, keyflag)) goto err; } else if (pheader(dbp, NULL, pflag, keyflag) || dump(dbp, pflag, keyflag)) goto err; } if (0) { err: exitval = 1; } if (d_close && (ret = dbp->close(dbp, 0)) != 0) { exitval = 1; dbp->err(dbp, ret, "close"); } if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, "%s: dbenv->close: %s\n", progname, CDB_db_strerror(ret)); } if (interrupted) { (void)signal(interrupted, SIG_DFL); (void)raise(interrupted); /* NOTREACHED */ } if(config) { WordContext::Finish(); delete config; } return (exitval); } /* * db_init -- * Initialize the environment. */ int db_init(char *home, int Nflag) { u_int32_t flags; int ret; /* Optionally turn mutexes off. */ if (Nflag) { if ((ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "set_mutexlocks"); return (1); } if ((ret = dbenv->set_panic(dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "set_panic"); return (1); } } /* * Try and use the shared memory pool region when dumping a database, * so our information is as up-to-date as possible, even if the mpool * cache hasn't been flushed. */ flags = DB_USE_ENVIRON | DB_INIT_MPOOL | DB_INIT_LOCK; if (dbenv->open(dbenv, home, NULL, flags, 0) == 0) return (0); /* * An environment is required because we may be trying to look at * databases in directories other than the current one. We could * avoid using an environment iff the -h option wasn't specified, * but that seems like more work than it's worth. * * No environment exists (or, at least no environment that includes * an mpool region exists). Create one, but make it private so that * no files are actually created. */ LF_SET(DB_CREATE | DB_PRIVATE); if ((ret = dbenv->open(dbenv, home, NULL, flags, 0)) == 0) return (0); /* An environment is required. */ dbenv->err(dbenv, ret, "open"); return (1); } /* * pheader -- * Write out the header information. */ int pheader(DB *dbp, char *subname, int pflag, int keyflag) { DB_BTREE_STAT *btsp; DB_HASH_STAT *hsp; DB_QUEUE_STAT *qsp; int ret; printf("VERSION=2\n"); printf("format=%s\n", pflag ? "print" : "bytevalue"); if (subname != NULL) printf("subdatabase=%s\n", subname); switch (dbp->type) { case DB_BTREE: printf("type=btree\n"); if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (1); } if (F_ISSET(dbp, BTM_RECNUM)) printf("recnum=1\n"); if (btsp->bt_maxkey != 0) printf("bt_maxkey=%lu\n", (u_long)btsp->bt_maxkey); if (btsp->bt_minkey != 0 && btsp->bt_minkey != DEFMINKEYPAGE) printf("bt_minkey=%lu\n", (u_long)btsp->bt_minkey); break; case DB_HASH: printf("type=hash\n"); if ((ret = dbp->stat(dbp, &hsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (1); } if (hsp->hash_ffactor != 0) printf("h_ffactor=%lu\n", (u_long)hsp->hash_ffactor); if (hsp->hash_nelem != 0 || hsp->hash_nrecs != 0) printf("h_nelem=%lu\n", hsp->hash_nelem > hsp->hash_nrecs ? (u_long)hsp->hash_nelem : (u_long)hsp->hash_nrecs); break; case DB_QUEUE: printf("type=queue\n"); if ((ret = dbp->stat(dbp, &qsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (1); } printf("re_len=%lu\n", (u_long)qsp->qs_re_len); if (qsp->qs_re_pad != 0 && qsp->qs_re_pad != ' ') printf("re_pad=%#x\n", qsp->qs_re_pad); break; case DB_RECNO: printf("type=recno\n"); if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); return (1); } if (F_ISSET(dbp, BTM_RENUMBER)) printf("renumber=1\n"); if (F_ISSET(dbp, BTM_FIXEDLEN)) printf("re_len=%lu\n", (u_long)btsp->bt_re_len); if (btsp->bt_re_pad != 0 && btsp->bt_re_pad != ' ') printf("re_pad=%#x\n", btsp->bt_re_pad); break; case DB_UNKNOWN: abort(); /* Impossible. */ /* NOTREACHED */ } if (F_ISSET(dbp, DB_AM_DUP)) printf("duplicates=1\n"); if (!F_ISSET(dbp, DB_AM_PGDEF)) printf("db_pagesize=%lu\n", (u_long)dbp->pgsize); if (keyflag) printf("keys=1\n"); printf("HEADER=END\n"); return (0); } /* * is_sub -- * Return if the database contains subdatabases. */ int is_sub(DB *dbp, int *yesno) { DB_BTREE_STAT *btsp; DB_HASH_STAT *hsp; int ret; switch (dbp->type) { case DB_BTREE: case DB_RECNO: if ((ret = dbp->stat(dbp, &btsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); break; } *yesno = btsp->bt_metaflags & BTM_SUBDB ? 1 : 0; free(btsp); break; case DB_HASH: if ((ret = dbp->stat(dbp, &hsp, NULL, 0)) != 0) { dbp->err(dbp, ret, "DB->stat"); break; } *yesno = hsp->hash_metaflags & DB_HASH_SUBDB ? 1 : 0; free(hsp); break; case DB_QUEUE: return (0); default: abort(); /* NOTREACHED */ } return (ret); } /* * dump_sub -- * Dump out the records for a DB containing subdatabases. */ int dump_sub(DB *parent_dbp, char *parent_name, int pflag, int keyflag) { DB *dbp; DBC *dbcp; DBT key, data; int ret; char *subdb; /* * Get a cursor and step through the database, dumping out each * subdatabase. */ if ((ret = parent_dbp->cursor(parent_dbp, NULL, &dbcp, 0)) != 0) { dbenv->err(dbenv, ret, "DB->cursor"); return (1); } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) { /* Nul terminate the subdatabase name. */ if ((subdb = (char*)malloc(key.size + 1)) == NULL) { dbenv->err(dbenv, ENOMEM, NULL); return (1); } memcpy(subdb, key.data, key.size); subdb[key.size] = '\0'; /* Create the DB object and open the file. */ if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "CDB_db_create"); free(subdb); return (1); } if ((ret = dbp->open(dbp, parent_name, subdb, DB_UNKNOWN, DB_RDONLY, 0)) != 0) dbp->err(dbp, ret, "DB->open: %s:%s", parent_name, subdb); if (ret == 0 && (pheader(dbp, subdb, pflag, keyflag) || dump(dbp, pflag, keyflag))) ret = 1; (void)dbp->close(dbp, 0); free(subdb); if (ret != 0) return (1); } if (ret != DB_NOTFOUND) { dbp->err(dbp, ret, "DBcursor->get"); return (1); } if ((ret = dbcp->c_close(dbcp)) != 0) { dbp->err(dbp, ret, "DBcursor->close"); return (1); } return (0); } /* * show_subs -- * Display the subdatabases for a database. */ int show_subs(DB *dbp) { DBC *dbcp; DBT key, data; int ret; /* * Get a cursor and step through the database, printing out the key * of each key/data pair. */ if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { dbp->err(dbp, ret, "DB->cursor"); return (1); } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) { if ((ret = CDB___db_prdbt(&key, 1, NULL, stdout, 0)) != 0) { dbp->errx(dbp, NULL); return (1); } } if (ret != DB_NOTFOUND) { dbp->err(dbp, ret, "DBcursor->get"); return (1); } if ((ret = dbcp->c_close(dbcp)) != 0) { dbp->err(dbp, ret, "DBcursor->close"); return (1); } return (0); } /* * dump -- * Dump out the records for a DB. */ int dump(DB *dbp, int pflag, int keyflag) { DBC *dbcp; DBT key, data; int ret, is_recno; /* * Get a cursor and step through the database, printing out each * key/data pair. */ if ((ret = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { dbp->err(dbp, ret, "DB->cursor"); return (1); } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); is_recno = (dbp->type == DB_RECNO || dbp->type == DB_QUEUE); keyflag = is_recno ? keyflag : 1; while ((ret = dbcp->c_get(dbcp, &key, &data, DB_NEXT)) == 0) if ((keyflag && (ret = CDB___db_prdbt(&key, pflag, " ", stdout, is_recno)) != 0) || (ret = CDB___db_prdbt(&data, pflag, " ", stdout, 0)) != 0) { dbp->errx(dbp, NULL); return (1); } if (ret != DB_NOTFOUND) { dbp->err(dbp, ret, "DBcursor->get"); return (1); } if ((ret = dbcp->c_close(dbcp)) != 0) { dbp->err(dbp, ret, "DBcursor->close"); return (1); } printf("DATA=END\n"); return (0); } /* * siginit -- * Initialize the set of signals for which we want to clean up. * Generally, we try not to leave the shared regions locked if * we can. */ void siginit() { #ifdef SIGHUP (void)signal(SIGHUP, onint); #endif (void)signal(SIGINT, onint); #ifdef SIGPIPE (void)signal(SIGPIPE, onint); #endif (void)signal(SIGTERM, onint); } /* * onint -- * Interrupt signal handler. */ void onint(int signo) { if ((interrupted = signo) == 0) interrupted = SIGINT; } /* * usage -- * Display the usage message. */ void usage() { (void)fprintf(stderr, "usage: htdb_dump [-klNpWz] [-C cachesize] [-d ahr] [-f file] [-h home] [-s subdb] db_file\n"); exit(1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/htdb_load.cc���������������������������������������������������������������������0100644�0063146�0012731�00000050175�10055635542�015550� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #include "htconfig.h" #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1996, 1997, 1998, 1999\n\ Sleepycat Software Inc. All rights reserved.\n"; static const char sccsid[] = "@(#)db_load.c 11.6 (Sleepycat) 11/10/99"; #endif #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #include <errno.h> #include <limits.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #endif extern "C" { #include "db_int.h" #include "db_page.h" #include "db_am.h" } #include "WordDBCompress.h" #include "WordContext.h" #include "WordKey.h" void badend __P((void)); void badnum __P((void)); int configure __P((DB *, char **, char **, int *)); int db_init __P((char *)); int dbt_rdump __P((DBT *)); int dbt_rprint __P((DBT *)); int dbt_rrecno __P((DBT *)); int digitize __P((int, int *)); int linetorn __P((char *, db_recno_t *)); int load __P((char *, DBTYPE, char **, int, u_int32_t, int, int)); int main __P((int, char *[])); void onint __P((int)); int rheader __P((DB *, DBTYPE *, char **, int *, int*)); void siginit __P((void)); void usage __P((void)); int endodata; /* Reached the end of a database. */ int endofile; /* Reached the end of the input. */ int existed; /* Tried to load existing key. */ u_long lineno; /* Input file line number. */ int version = 1; /* Input version. */ DB_ENV *dbenv; int interrupted; const char *progname = "htdb_load"; /* Program name. */ int main(int argc, char* argv[]) { extern char *optarg; extern int optind; DBTYPE dbtype; u_int32_t cachesize = 0; u_int32_t db_nooverwrite; int ch, e_close, exitval, no_header, ret; char **clist, **clp, *home; int compress = 0; int wordlist = 0; Configuration *config = 0; home = NULL; db_nooverwrite = 0; e_close = exitval = no_header = 0; dbtype = DB_UNKNOWN; /* Allocate enough room for configuration arguments. */ if ((clp = clist = (char **)calloc(argc + 1, sizeof(char *))) == NULL) { fprintf(stderr, "%s: %s\n", progname, strerror(ENOMEM)); exit(1); } while ((ch = getopt(argc, argv, "c:f:h:nTt:C:S:zW")) != EOF) switch (ch) { case 'c': *clp++ = optarg; break; case 'f': if (freopen(optarg, "r", stdin) == NULL) { fprintf(stderr, "%s: %s: reopen: %s\n", progname, optarg, strerror(errno)); exit(1); } break; case 'h': home = optarg; break; case 'n': db_nooverwrite = DB_NOOVERWRITE; break; case 'T': no_header = 1; break; case 't': if (strcmp(optarg, "btree") == 0) { dbtype = DB_BTREE; break; } if (strcmp(optarg, "hash") == 0) { dbtype = DB_HASH; break; } if (strcmp(optarg, "recno") == 0) { dbtype = DB_RECNO; break; } if (strcmp(optarg, "queue") == 0) { dbtype = DB_QUEUE; break; } usage(); /* NOTREACHED */ case 'C': cachesize = atoi(optarg); break; case 'z': compress = DB_COMPRESS; break; case 'W': wordlist = 1; break; case '?': default: usage(); /* NOTREACHED */ } argc -= optind; argv += optind; if (argc != 1) usage(); /* Handle possible interruptions. */ siginit(); if(wordlist) { static ConfigDefaults defaults[] = { { "wordlist_wordkey_description", "Word/DocID 32/Flag 8/Location 16"}, { "wordlist_env_skip", "true"}, { 0, 0, 0 } }; config = WordContext::Initialize(defaults); } /* * Create an environment object and initialize it for error * reporting. */ if ((ret = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: CDB_db_env_create: %s\n", progname, CDB_db_strerror(ret)); exit (1); } dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); if(cachesize > 0) dbenv->set_cachesize(dbenv, 0, cachesize, 1); if(compress && wordlist) dbenv->mp_cmpr_info = (new WordDBCompress)->CmprInfo(); if (db_init(home) != 0) goto shutdown; while (!endofile) if (load(argv[0], dbtype, clist, no_header, db_nooverwrite, compress, wordlist) != 0) goto shutdown; if (0) { shutdown: exitval = 1; } if ((ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, "%s: dbenv->close: %s\n", progname, CDB_db_strerror(ret)); } if (interrupted) { (void)signal(interrupted, SIG_DFL); (void)raise(interrupted); /* NOTREACHED */ } if(config) { WordContext::Finish(); delete config; } free(clist); /* Return 0 on success, 1 if keys existed already, and 2 on failure. */ return (exitval == 0 ? (existed == 0 ? 0 : 1) : 2); } /* * load -- * Load a database. */ int load(char *name, DBTYPE argtype, char **clist, int no_header, u_int32_t db_nooverwrite, int compress, int wordlist) { DB *dbp; DBT key, rkey, data, *readp, *writep; DBTYPE dbtype; db_recno_t recno, datarecno; int checkprint, ret, rval, keys; int keyflag, ascii_recno; char *subdb; endodata = 0; subdb = NULL; memset(&key, 0, sizeof(DBT)); memset(&data, 0, sizeof(DBT)); /* Create the DB object. */ if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "CDB_db_create"); return (1); } if(wordlist) dbp->set_bt_compare(dbp, word_db_cmp); dbtype = DB_UNKNOWN; keys = -1; keyflag = -1; /* Read the header -- if there's no header, we expect flat text. */ if (no_header) { checkprint = 1; dbtype = argtype; } else { if (rheader(dbp, &dbtype, &subdb, &checkprint, &keys) != 0) goto err; if (endofile) goto done; } /* * Apply command-line configuration changes. (We apply command-line * configuration changes to all databases that are loaded, e.g., all * subdatabases.) */ if (configure(dbp, clist, &subdb, &keyflag)) goto err; if (keys != 1) { if (keyflag == 1) { dbp->err(dbp, EINVAL, "No keys specified in file"); goto err; } } else if (keyflag == 0) { dbp->err(dbp, EINVAL, "Keys specified in file"); goto err; } else keyflag = 1; if (dbtype == DB_BTREE || dbtype == DB_HASH) { if (keyflag == 0) dbp->err(dbp, EINVAL, "Btree and Hash must specify keys"); else keyflag = 1; } if (argtype != DB_UNKNOWN) { if (dbtype == DB_RECNO || dbtype == DB_QUEUE) if (keyflag != 1 && argtype != DB_RECNO && argtype != DB_QUEUE){ dbenv->errx(dbenv, "improper database type conversion specified"); goto err; } dbtype = argtype; } if (dbtype == DB_UNKNOWN) { dbenv->errx(dbenv, "no database type specified"); goto err; } if (keyflag == -1) keyflag = 0; if (keyflag == 1 && (dbtype == DB_RECNO || dbtype == DB_QUEUE)) ascii_recno = 1; else ascii_recno = 0; /* Open the DB file. */ if ((ret = dbp->open(dbp, name, subdb, dbtype, (DB_CREATE | compress), CDB___db_omode("rwrwrw"))) != 0) { dbp->err(dbp, ret, "DB->open: %s", name); goto err; } /* Initialize the key/data pair. */ readp = &key; writep = &key; if (dbtype == DB_RECNO || dbtype == DB_QUEUE) { key.size = sizeof(recno); if (keyflag) { key.data = &datarecno; if (checkprint) { readp = &rkey; goto key_data; } } else key.data = &recno; } else key_data: if ((readp->data = (void *)malloc(readp->ulen = 1024)) == NULL) { dbenv->err(dbenv, ENOMEM, NULL); goto err; } if ((data.data = (void *)malloc(data.ulen = 1024)) == NULL) { dbenv->err(dbenv, ENOMEM, NULL); goto err; } /* Get each key/data pair and add them to the database. */ for (recno = 1; !interrupted; ++recno) { if (!keyflag) if (checkprint) { if (dbt_rprint(&data)) goto err; } else { if (dbt_rdump(&data)) goto err; } else if (checkprint) { if (dbt_rprint(readp)) goto err; if (!endodata && dbt_rprint(&data)) goto fmt; } else { if (ascii_recno) { if (dbt_rrecno(readp)) goto err; } else if (dbt_rdump(readp)) goto err; if (!endodata && dbt_rdump(&data)) { fmt: dbenv->errx(dbenv, "odd number of key/data pairs"); goto err; } } if (endodata) break; if (readp != writep) { if (sscanf((char*)readp->data, "%ud", &datarecno) != 1) dbenv->errx(dbenv, "%s: non-integer key at line: %d", name, !keyflag ? recno : recno * 2 - 1); if (datarecno == 0) dbenv->errx(dbenv, "%s: zero key at line: %d", name, !keyflag ? recno : recno * 2 - 1); } switch (ret = dbp->put(dbp, NULL, writep, &data, db_nooverwrite)) { case 0: break; case DB_KEYEXIST: existed = 1; dbenv->errx(dbenv, "%s: line %d: key already exists, not loaded:", name, !keyflag ? recno : recno * 2 - 1); (void)CDB___db_prdbt(&key, checkprint, 0, stderr, 0); break; default: dbenv->err(dbenv, ret, NULL); goto err; } } done: rval = 0; if (0) { err: rval = 1; } /* Close the database. */ if ((ret = dbp->close(dbp, 0)) != 0) { dbp->err(dbp, ret, "DB->close"); rval = 1; } /* Free allocated memory. */ if (subdb != NULL) free(subdb); if (dbtype != DB_RECNO && dbtype != DB_QUEUE) free(key.data); free(data.data); return (rval); } /* * db_init -- * Initialize the environment. */ int db_init(char *home) { u_int32_t flags; int ret; /* We may be loading into a live environment. Try and join. */ flags = DB_USE_ENVIRON | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN; if (dbenv->open(dbenv, home, NULL, flags, 0) == 0) return (0); /* * We're trying to load a database. * * An environment is required because we may be trying to look at * databases in directories other than the current one. We could * avoid using an environment iff the -h option wasn't specified, * but that seems like more work than it's worth. * * No environment exists (or, at least no environment that includes * an mpool region exists). Create one, but make it private so that * no files are actually created. */ LF_CLR(DB_INIT_LOG | DB_INIT_TXN); LF_SET(DB_CREATE | DB_PRIVATE); if ((ret = dbenv->open(dbenv, home, NULL, flags, 0)) == 0) return (0); /* An environment is required. */ dbenv->err(dbenv, ret, "DBENV->open"); return (1); } #define FLAG(name, value, keyword, flag) \ if (strcmp(name, keyword) == 0) { \ switch (*value) { \ case '1': \ if ((ret = dbp->set_flags(dbp, flag)) != 0) { \ dbp->err(dbp, ret, "%s: set_flags: %s", \ progname, name); \ return (1); \ } \ break; \ case '0': \ break; \ default: \ badnum(); \ return (1); \ } \ continue; \ } #define NUMBER(name, value, keyword, func) \ if (strcmp(name, keyword) == 0) { \ if (CDB___db_getlong(dbp, \ NULL, value, 1, LONG_MAX, &val) != 0) \ return (1); \ if ((ret = dbp->func(dbp, val)) != 0) \ goto nameerr; \ continue; \ } #define STRING(name, value, keyword, func) \ if (strcmp(name, keyword) == 0) { \ if ((ret = dbp->func(dbp, value[0])) != 0) \ goto nameerr; \ continue; \ } /* * configure -- * Handle command-line configuration options. */ int configure(DB *dbp, char **clp, char **subdbp, int *keysp) { long val; int ret, savech; char *name, *value; for (; (name = *clp) != NULL; *--value = savech, ++clp) { if ((value = strchr(name, '=')) == NULL) { dbp->errx(dbp, "command-line configuration uses name=value format"); return (1); } savech = *value; *value++ = '\0'; if (strcmp(name, "subdatabase") == 0) { if ((*subdbp = strdup(value)) == NULL) { dbp->err(dbp, ENOMEM, NULL); return (1); } continue; } if (strcmp(name, "keys") == 0) { if (strcmp(value, "1") == 0) *keysp = 1; else if (strcmp(value, "0") == 0) *keysp = 0; else { badnum(); return (1); } continue; } #ifdef notyet NUMBER(name, value, "bt_maxkey", set_bt_maxkey); #endif NUMBER(name, value, "bt_minkey", set_bt_minkey); NUMBER(name, value, "db_lorder", set_lorder); NUMBER(name, value, "db_pagesize", set_pagesize); FLAG(name, value, "duplicates", DB_DUP); NUMBER(name, value, "h_ffactor", set_h_ffactor); NUMBER(name, value, "h_nelem", set_h_nelem); NUMBER(name, value, "re_len", set_re_len); STRING(name, value, "re_pad", set_re_pad); FLAG(name, value, "recnum", DB_RECNUM); FLAG(name, value, "renumber", DB_RENUMBER); dbp->errx(dbp, "unknown command-line configuration keyword"); return (1); } return (0); nameerr: dbp->err(dbp, ret, "%s: %s=%s", progname, name, value); return (1); } /* * rheader -- * Read the header message. */ int rheader(DB *dbp, DBTYPE *dbtypep, char **subdbp, int *checkprintp, int *keysp) { long val; int first, ret; char *name, *value, *p, buf[128]; *dbtypep = DB_UNKNOWN; *checkprintp = 0; for (first = 1;; first = 0) { ++lineno; /* If we don't see the expected information, it's an error. */ if (fgets(buf, sizeof(buf), stdin) == NULL) { if (!first || ferror(stdin)) goto badfmt; endofile = 1; break; } if ((p = strchr(name = buf, '=')) == NULL) goto badfmt; *p++ = '\0'; if ((p = strchr(value = p, '\n')) == NULL) goto badfmt; *p = '\0'; if (name[0] == '\0' || value[0] == '\0') goto badfmt; if (strcmp(name, "HEADER") == 0) break; if (strcmp(name, "VERSION") == 0) { /* * Version 1 didn't have a "VERSION" header line, we * only support versions 1 and 2 of the dump format. */ version = atoi(value); if (version != 2) { dbp->errx(dbp, "line %lu: VERSION %d is unsupported", lineno, version); return (1); } continue; } if (strcmp(name, "format") == 0) { if (strcmp(value, "bytevalue") == 0) { *checkprintp = 0; continue; } if (strcmp(value, "print") == 0) { *checkprintp = 1; continue; } goto badfmt; } if (strcmp(name, "type") == 0) { if (strcmp(value, "btree") == 0) { *dbtypep = DB_BTREE; continue; } if (strcmp(value, "hash") == 0) { *dbtypep = DB_HASH; continue; } if (strcmp(value, "recno") == 0) { *dbtypep = DB_RECNO; continue; } if (strcmp(value, "queue") == 0) { *dbtypep = DB_QUEUE; continue; } dbp->errx(dbp, "line %lu: unknown type", lineno); return (1); } if (strcmp(name, "subdatabase") == 0) { if ((*subdbp = strdup(value)) == NULL) { dbp->err(dbp, ENOMEM, NULL); return (1); } continue; } if (strcmp(name, "keys") == 0) { if (strcmp(value, "1") == 0) *keysp = 1; else if (strcmp(value, "0") == 0) *keysp = 0; else { badnum(); return (1); } continue; } #ifdef notyet NUMBER(name, value, "bt_maxkey", set_bt_maxkey); #endif NUMBER(name, value, "bt_minkey", set_bt_minkey); NUMBER(name, value, "db_lorder", set_lorder); NUMBER(name, value, "db_pagesize", set_pagesize); FLAG(name, value, "duplicates", DB_DUP); NUMBER(name, value, "h_ffactor", set_h_ffactor); NUMBER(name, value, "h_nelem", set_h_nelem); NUMBER(name, value, "re_len", set_re_len); STRING(name, value, "re_pad", set_re_pad); FLAG(name, value, "recnum", DB_RECNUM); FLAG(name, value, "renumber", DB_RENUMBER); dbp->errx(dbp, "unknown input-file header configuration keyword"); return (1); } return (0); nameerr: dbp->err(dbp, ret, "%s: %s=%s", progname, name, value); return (1); badfmt: dbp->errx(dbp, "line %lu: unexpected format", lineno); return (1); } /* * dbt_rprint -- * Read a printable line into a DBT structure. */ int dbt_rprint(DBT *dbtp) { u_int32_t len; u_int8_t *p; int c1, c2, e, escape, first; char buf[32]; ++lineno; first = 1; e = escape = 0; for (p = (u_int8_t*)dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { endofile = endodata = 1; return (0); } badend(); return (1); } if (first) { first = 0; if (version > 1) { if (c1 != ' ') { buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || strcmp(buf, "DATA=END\n") != 0) { badend(); return (1); } endodata = 1; return (0); } continue; } } if (escape) { if (c1 != '\\') { if ((c2 = getchar()) == EOF) { badend(); return (1); } c1 = digitize(c1, &e) << 4 | digitize(c2, &e); if (e) return (1); } escape = 0; } else if (c1 == '\\') { escape = 1; continue; } if (len >= dbtp->ulen - 10) { dbtp->ulen *= 2; if ((dbtp->data = (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) { dbenv->err(dbenv, ENOMEM, NULL); return (1); } p = (u_int8_t *)dbtp->data + len; } ++len; *p++ = c1; } dbtp->size = len; return (0); } /* * dbt_rdump -- * Read a byte dump line into a DBT structure. */ int dbt_rdump(DBT *dbtp) { u_int32_t len; u_int8_t *p; int c1, c2, e, first; char buf[32]; ++lineno; first = 1; e = 0; for (p = (u_int8_t*)dbtp->data, len = 0; (c1 = getchar()) != '\n';) { if (c1 == EOF) { if (len == 0) { endofile = endodata = 1; return (0); } badend(); return (1); } if (first) { first = 0; if (version > 1) { if (c1 != ' ') { buf[0] = c1; if (fgets(buf + 1, sizeof(buf) - 1, stdin) == NULL || strcmp(buf, "DATA=END\n") != 0) { badend(); return (1); } endodata = 1; return (0); } continue; } } if ((c2 = getchar()) == EOF) { badend(); return (1); } if (len >= dbtp->ulen - 10) { dbtp->ulen *= 2; if ((dbtp->data = (void *)realloc(dbtp->data, dbtp->ulen)) == NULL) { dbenv->err(dbenv, ENOMEM, NULL); return (1); } p = (u_int8_t *)dbtp->data + len; } ++len; *p++ = digitize(c1, &e) << 4 | digitize(c2, &e); if (e) return (1); } dbtp->size = len; return (0); } /* * dbt_rrecno -- * Read a record number dump line into a DBT structure. */ int dbt_rrecno(DBT *dbtp) { char buf[32]; ++lineno; if (fgets(buf, sizeof(buf), stdin) == NULL) { endofile = endodata = 1; return (0); } if (strcmp(buf, "DATA=END\n") == 0) { endodata = 1; return (0); } if (buf[0] != ' ' || linetorn(buf + 1, (db_recno_t *)dbtp->data)) { badend(); return (1); } dbtp->size = sizeof(db_recno_t); return (0); } /* * linetorn -- * Given a character string representing a recno in ASCII text, * return the db_recno_t. */ int linetorn(char *buf, db_recno_t *recno) { errno = 0; *recno = strtoul(buf, NULL, 0); return (errno ? 1 : 0); } /* * digitize -- * Convert a character to an integer. */ int digitize(int c, int *errorp) { switch (c) { /* Don't depend on ASCII ordering. */ case '0': return (0); case '1': return (1); case '2': return (2); case '3': return (3); case '4': return (4); case '5': return (5); case '6': return (6); case '7': return (7); case '8': return (8); case '9': return (9); case 'a': return (10); case 'b': return (11); case 'c': return (12); case 'd': return (13); case 'e': return (14); case 'f': return (15); } dbenv->errx(dbenv, "unexpected hexadecimal value"); *errorp = 1; return (0); } /* * badnum -- * Display the bad number message. */ void badnum() { dbenv->errx(dbenv, "boolean name=value pairs require a value of 0 or 1"); } /* * badend -- * Display the bad end to input message. */ void badend() { dbenv->errx(dbenv, "unexpected end of input data or key/data pair"); } /* * siginit -- * Initialize the set of signals for which we want to clean up. * Generally, we try not to leave the shared regions locked if * we can. */ void siginit() { #ifdef SIGHUP (void)signal(SIGHUP, onint); #endif (void)signal(SIGINT, onint); #ifdef SIGPIPE (void)signal(SIGPIPE, onint); #endif (void)signal(SIGTERM, onint); } /* * onint -- * Interrupt signal handler. */ void onint(int signo) { if ((interrupted = signo) == 0) interrupted = SIGINT; } /* * usage -- * Display the usage message. */ void usage() { (void)fprintf(stderr, "%s\n\t%s\n", "usage: htdb_load [-nTzW]", "[-c name=value] [-f file] [-h home] [-C cachesize] [-t btree | hash | recno] db_file"); exit(1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/htdb_stat.cc���������������������������������������������������������������������0100644�0063146�0012731�00000057746�10055635542�015617� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #include "db_config.h" #include "htconfig.h" #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1996, 1997, 1998, 1999\n\ Sleepycat Software Inc. All rights reserved.\n"; static const char sccsid[] = "@(#)db_stat.c 11.2 (Sleepycat) 9/14/99"; #endif #ifndef NO_SYSTEM_INCLUDES #include <sys/types.h> #if TIME_WITH_SYS_TIME #include <sys/time.h> #include <time.h> #else #if HAVE_SYS_TIME_H #include <sys/time.h> #else #include <time.h> #endif #endif #include <ctype.h> #include <signal.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #endif extern "C" { #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "mp.h" } #include "WordDBInfo.h" #include "WordDBCompress.h" #include "WordContext.h" #define PCT(f, t, pgsize) \ ((t) == 0 ? 0 : \ (((double)(((t) * (pgsize)) - (f)) / ((t) * (pgsize))) * 100)) typedef enum { T_NOTSET, T_DB, T_ENV, T_LOCK, T_LOG, T_MPOOL, T_TXN } test_t; int argcheck __P((char *, const char *)); int btree_stats __P((DB_ENV *, DB *)); int db_init __P((char *, test_t)); void dl __P((const char *, u_long)); void dl_bytes __P((const char *, u_long, u_long, u_long)); int env_stats __P((DB_ENV *)); int hash_stats __P((DB_ENV *, DB *)); int lock_ok __P((char *)); int lock_stats __P((DB_ENV *)); int log_stats __P((DB_ENV *)); int main __P((int, char *[])); int mpool_ok __P((char *)); int mpool_stats __P((DB_ENV *)); void onint __P((int)); void prflags __P((u_int32_t, const FN *)); int queue_stats __P((DB_ENV *, DB *)); void siginit __P((void)); int txn_compare __P((const void *, const void *)); int txn_stats __P((DB_ENV *)); void usage __P((void)); DB_ENV *dbenv; int interrupted; char *stats_internal; const char *progname = "htdb_stat"; /* Program name. */ int main(int argc, char *argv[]) { extern char *optarg; extern int optind; DB *dbp; test_t ttype; int ch, d_close, e_close, exitval, Nflag, ret; char *db, *home, *subdb; int compress = 0; int wordlist = 0; Configuration *config = 0; dbp = NULL; ttype = T_NOTSET; d_close = e_close = exitval = Nflag = 0; db = home = subdb = NULL; while ((ch = getopt(argc, argv, "C:cd:eh:lM:mNs:tzW")) != EOF) switch (ch) { case 'C': ttype = T_LOCK; if (!argcheck(stats_internal = optarg, "Acflmo")) usage(); break; case 'c': ttype = T_LOCK; break; case 'd': db = optarg; ttype = T_DB; break; case 'e': ttype = T_ENV; break; case 'h': home = optarg; break; case 'l': ttype = T_LOG; break; case 'M': ttype = T_MPOOL; if (!argcheck(stats_internal = optarg, "Ahlm")) usage(); break; case 'm': ttype = T_MPOOL; break; case 'N': Nflag = 1; break; case 's': subdb = optarg; ttype = T_DB; break; case 't': ttype = T_TXN; break; case 'z': compress = DB_COMPRESS; break; case 'W': wordlist = 1; break; case '?': default: usage(); } argc -= optind; argv += optind; switch (ttype) { case T_DB: if (db == NULL) usage(); break; case T_NOTSET: usage(); /* NOTREACHED */ default: break; } /* Handle possible interruptions. */ siginit(); if(wordlist && compress) { static ConfigDefaults defaults[] = { { "wordlist_wordkey_description", "Word/DocID 32/Flag 8/Location 16"}, { "wordlist_env_skip", "true"}, { 0, 0, 0 } }; config = WordContext::Initialize(defaults); } /* * Create an environment object and initialize it for error * reporting. */ if ((ret = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: CDB_db_env_create: %s\n", progname, CDB_db_strerror(ret)); exit (1); } dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); if(wordlist && compress) dbenv->mp_cmpr_info = (new WordDBCompress)->CmprInfo(); /* Optionally turn mutexes and the panic checks off. */ if (Nflag) { if ((ret = dbenv->set_mutexlocks(dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "set_mutexlocks"); goto shutdown; } if ((ret = dbenv->set_panic(dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "set_panic"); goto shutdown; } } /* Initialize the environment. */ if (db_init(home, ttype) != 0) goto shutdown; e_close = 1; switch (ttype) { case T_DB: /* Create the DB object and open the file. */ if ((ret = CDB_db_create(&dbp, dbenv, 0)) != 0) { dbenv->err(dbenv, ret, "CDB_db_create"); goto shutdown; } if ((ret = dbp->open(dbp, db, subdb, DB_UNKNOWN, (DB_RDONLY | compress), 0)) != 0) { dbp->err(dbp, ret, "open: %s", db); goto shutdown; } d_close = 1; switch (dbp->type) { case DB_BTREE: case DB_RECNO: if (btree_stats(dbenv, dbp)) goto shutdown; break; case DB_HASH: if (hash_stats(dbenv, dbp)) goto shutdown; break; case DB_QUEUE: if (queue_stats(dbenv, dbp)) goto shutdown; break; case DB_UNKNOWN: abort(); /* Impossible. */ /* NOTREACHED */ } break; case T_ENV: if (env_stats(dbenv)) exitval = 1; break; case T_LOCK: if (lock_stats(dbenv)) exitval = 1; break; case T_LOG: if (log_stats(dbenv)) exitval = 1; break; case T_MPOOL: if (mpool_stats(dbenv)) exitval = 1; break; case T_TXN: if (txn_stats(dbenv)) exitval = 1; break; case T_NOTSET: abort(); /* Impossible. */ /* NOTREACHED */ } if (0) { shutdown: exitval = 1; } if (d_close && (ret = dbp->close(dbp, 0)) != 0) { exitval = 1; dbp->err(dbp, ret, "close"); } if (e_close && (ret = dbenv->close(dbenv, 0)) != 0) { exitval = 1; fprintf(stderr, "%s: dbenv->close: %s\n", progname, CDB_db_strerror(ret)); } if (interrupted) { (void)signal(interrupted, SIG_DFL); (void)raise(interrupted); /* NOTREACHED */ } if(config) { WordContext::Finish(); delete config; } return (exitval); } /* * env_stats -- * Display environment statistics. */ int env_stats(DB_ENV *dbenvp) { REGENV renv; REGION *rp, regs[1024]; int n, ret; const char *lable; n = sizeof(regs) / sizeof(regs[0]); if ((ret = CDB___db_e_stat(dbenvp, &renv, regs, &n)) != 0) { dbenvp->err(dbenvp, ret, "CDB___db_e_stat"); return (1); } printf("%d.%d.%d\tEnvironment version.\n", renv.majver, renv.minver, renv.patch); printf("%lx\tMagic number.\n", (u_long)renv.magic); printf("%d\tPanic value.\n", renv.panic); /* Adjust the reference count for us... */ printf("%d\tReferences.\n", renv.refcnt - 1); dl("Locks granted without waiting.\n", (u_long)renv.mutex.mutex_set_nowait); dl("Locks granted after waiting.\n", (u_long)renv.mutex.mutex_set_wait); while (n > 0) { printf("%s\n", DB_LINE); rp = ®s[--n]; switch (rp->id) { case REG_ID_ENV: lable = "Environment"; break; case REG_ID_LOCK: lable = "Lock"; break; case REG_ID_LOG: lable = "Log"; break; case REG_ID_MPOOL: lable = "Mpool"; break; case REG_ID_TXN: lable = "Txn"; break; default: lable = "Unknown"; break; } printf("%s Region: %d.\n", lable, rp->id); dl_bytes("Size.\n", (u_long)0, (u_long)0, (u_long)rp->size); printf("%d\tSegment ID.\n", rp->segid); dl("Locks granted without waiting.\n", (u_long)rp->mutex.mutex_set_nowait); dl("Locks granted after waiting.\n", (u_long)rp->mutex.mutex_set_wait); } return (0); } /* * btree_stats -- * Display btree/recno statistics. */ int btree_stats(DB_ENV *dbenvp, DB *dbp) { static const FN fn[] = { { BTM_DUP, "duplicates" }, { BTM_FIXEDLEN, "fixed-length" }, { BTM_RECNO, "recno" }, { BTM_RECNUM, "record-numbers" }, { BTM_RENUMBER, "renumber" }, { BTM_SUBDB, "subdatabases" }, { 0, NULL } }; DB_BTREE_STAT *sp; int ret; COMPQUIET(dbenvp, NULL); if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { dbp->err(dbp, ret, "dbp->stat"); return (1); } printf("%lx\tBtree magic number.\n", (u_long)sp->bt_magic); printf("%lu\tBtree version number.\n", (u_long)sp->bt_version); prflags(sp->bt_metaflags, fn); if (dbp->type == DB_BTREE) { #ifdef NOT_IMPLEMENTED dl("Maximum keys per-page.\n", (u_long)sp->bt_maxkey); #endif dl("Minimum keys per-page.\n", (u_long)sp->bt_minkey); } if (dbp->type == DB_RECNO) { dl("Fixed-length record size.\n", (u_long)sp->bt_re_len); if (isprint(sp->bt_re_pad)) printf("%c\tFixed-length record pad.\n", (int)sp->bt_re_pad); else printf("0x%x\tFixed-length record pad.\n", (int)sp->bt_re_pad); } dl("Underlying database page size.\n", (u_long)sp->bt_pagesize); dl("Number of levels in the tree.\n", (u_long)sp->bt_levels); dl("Number of keys in the tree.\n", (u_long)sp->bt_nrecs); dl("Number of tree internal pages.\n", (u_long)sp->bt_int_pg); dl("Number of bytes free in tree internal pages", (u_long)sp->bt_int_pgfree); printf(" (%.0f%% ff).\n", PCT(sp->bt_int_pgfree, sp->bt_int_pg, sp->bt_pagesize)); dl("Number of tree leaf pages.\n", (u_long)sp->bt_leaf_pg); dl("Number of bytes free in tree leaf pages", (u_long)sp->bt_leaf_pgfree); printf(" (%.0f%% ff).\n", PCT(sp->bt_leaf_pgfree, sp->bt_leaf_pg, sp->bt_pagesize)); dl("Number of tree duplicate pages.\n", (u_long)sp->bt_dup_pg); dl("Number of bytes free in tree duplicate pages", (u_long)sp->bt_dup_pgfree); printf(" (%.0f%% ff).\n", PCT(sp->bt_dup_pgfree, sp->bt_dup_pg, sp->bt_pagesize)); dl("Number of tree overflow pages.\n", (u_long)sp->bt_over_pg); dl("Number of bytes free in tree overflow pages", (u_long)sp->bt_over_pgfree); printf(" (%.0f%% ff).\n", PCT(sp->bt_over_pgfree, sp->bt_over_pg, sp->bt_pagesize)); dl("Number of pages on the free list.\n", (u_long)sp->bt_free); free(sp); return (0); } /* * hash_stats -- * Display hash statistics. */ int hash_stats(DB_ENV *dbenvp, DB *dbp) { static const FN fn[] = { { DB_HASH_DUP, "duplicates" }, { DB_HASH_SUBDB,"subdatabases" }, { 0, NULL } }; DB_HASH_STAT *sp; int ret; COMPQUIET(dbenvp, NULL); if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { dbp->err(dbp, ret, "dbp->stat"); return (1); } printf("%lx\tHash magic number.\n", (u_long)sp->hash_magic); printf("%lu\tHash version number.\n", (u_long)sp->hash_version); prflags(sp->hash_metaflags, fn); dl("Underlying database page size.\n", (u_long)sp->hash_pagesize); dl("Number of keys in the database.\n", (u_long)sp->hash_nrecs); dl("Number of hash buckets.\n", (u_long)sp->hash_buckets); dl("Number of bytes free on bucket pages", (u_long)sp->hash_bfree); printf(" (%.0f%% ff).\n", PCT(sp->hash_bfree, sp->hash_buckets, sp->hash_pagesize)); dl("Number of overflow pages.\n", (u_long)sp->hash_bigpages); dl("Number of bytes free in overflow pages", (u_long)sp->hash_big_bfree); printf(" (%.0f%% ff).\n", PCT(sp->hash_big_bfree, sp->hash_bigpages, sp->hash_pagesize)); dl("Number of bucket overflow pages.\n", (u_long)sp->hash_overflows); dl("Number of bytes free in bucket overflow pages", (u_long)sp->hash_ovfl_free); printf(" (%.0f%% ff).\n", PCT(sp->hash_ovfl_free, sp->hash_overflows, sp->hash_pagesize)); dl("Number of duplicate pages.\n", (u_long)sp->hash_dup); dl("Number of bytes free in duplicate pages", (u_long)sp->hash_dup_free); printf(" (%.0f%% ff).\n", PCT(sp->hash_dup_free, sp->hash_dup, sp->hash_pagesize)); dl("Number of pages on the free list.\n", (u_long)sp->hash_free); return (0); } /* * queue_stats -- * Display queue statistics. */ int queue_stats(DB_ENV *dbenvp, DB *dbp) { DB_QUEUE_STAT *sp; int ret; COMPQUIET(dbenvp, NULL); if ((ret = dbp->stat(dbp, &sp, NULL, 0)) != 0) { dbp->err(dbp, ret, "dbp->stat"); return (1); } printf("%lx\tQueue magic number.\n", (u_long)sp->qs_magic); printf("%lu\tQueue version number.\n", (u_long)sp->qs_version); dl("Fixed-length record size.\n", (u_long)sp->qs_re_len); if (isprint(sp->qs_re_pad)) printf("%c\tFixed-length record pad.\n", (int)sp->qs_re_pad); else printf("0x%x\tFixed-length record pad.\n", (int)sp->qs_re_pad); dl("Underlying tree page size.\n", (u_long)sp->qs_pagesize); dl("Number of records in the database.\n", (u_long)sp->qs_nrecs); dl("Number of database pages.\n", (u_long)sp->qs_pages); dl("Number of bytes free in database pages", (u_long)sp->qs_pgfree); printf(" (%.0f%% ff).\n", PCT(sp->qs_pgfree, sp->qs_pages, sp->qs_pagesize)); printf("%lu\tFirst undeleted record.\n", (u_long)sp->qs_first_recno); printf( "%lu\tLast allocated record number.\n", (u_long)sp->qs_cur_recno); printf("%lu\tStart offset.\n", (u_long)sp->qs_start); return (0); } /* * lock_stats -- * Display lock statistics. */ int lock_stats(DB_ENV *dbenvp) { DB_LOCK_STAT *sp; int ret; if (stats_internal != NULL) { CDB___lock_dump_region(dbenvp, stats_internal, stdout); return (0); } if ((ret = CDB_lock_stat(dbenvp, &sp, NULL)) != 0) { dbenvp->err(dbenvp, ret, NULL); return (1); } dl("Last allocated locker ID.\n", (u_long)sp->st_lastid); dl("Number of lock modes.\n", (u_long)sp->st_nmodes); dl("Maximum number of locks possible.\n", (u_long)sp->st_maxlocks); dl("Current lockers.\n", (u_long)sp->st_nlockers); dl("Maximum current lockers.\n", (u_long)sp->st_nlockers); dl("Number of lock requests.\n", (u_long)sp->st_nrequests); dl("Number of lock releases.\n", (u_long)sp->st_nreleases); dl("Number of lock conflicts.\n", (u_long)sp->st_nconflicts); dl("Number of deadlocks.\n", (u_long)sp->st_ndeadlocks); dl_bytes("Lock region size.\n", (u_long)0, (u_long)0, (u_long)sp->st_regsize); dl("The number of region locks granted without waiting.\n", (u_long)sp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); return (0); } /* * log_stats -- * Display log statistics. */ int log_stats(DB_ENV *dbenvp) { DB_LOG_STAT *sp; int ret; if ((ret = CDB_log_stat(dbenvp, &sp, NULL)) != 0) { dbenvp->err(dbenvp, ret, NULL); return (1); } printf("%lx\tLog magic number.\n", (u_long)sp->st_magic); printf("%lu\tLog version number.\n", (u_long)sp->st_version); dl_bytes("Log region size.\n", (u_long)0, (u_long)0, (u_long)sp->st_regsize); dl_bytes("Log record cache size.\n", (u_long)0, (u_long)0, (u_long)sp->st_lg_bsize); printf("%#o\tLog file mode.\n", sp->st_mode); if (sp->st_lg_max % MEGABYTE == 0) printf("%luMb\tLog file size.\n", (u_long)sp->st_lg_max / MEGABYTE); else if (sp->st_lg_max % 1024 == 0) printf("%luKb\tLog file size.\n", (u_long)sp->st_lg_max / 1024); else printf("%lu\tLog file size.\n", (u_long)sp->st_lg_max); dl_bytes("Log bytes written.\n", (u_long)0, (u_long)sp->st_w_mbytes, (u_long)sp->st_w_bytes); dl_bytes("Log bytes written since last checkpoint.\n", (u_long)0, (u_long)sp->st_wc_mbytes, (u_long)sp->st_wc_bytes); dl("Total log file writes.\n", (u_long)sp->st_wcount); dl("Total log file write due to overflow.\n", (u_long)sp->st_wcount_fill); dl("Total log file flushes.\n", (u_long)sp->st_scount); printf("%lu\tCurrent log file number.\n", (u_long)sp->st_cur_file); printf("%lu\tCurrent log file offset.\n", (u_long)sp->st_cur_offset); dl("The number of region locks granted without waiting.\n", (u_long)sp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); return (0); } /* * mpool_stats -- * Display mpool statistics. */ int mpool_stats(DB_ENV *dbenvp) { DB_MPOOL_FSTAT **fsp; DB_MPOOL_STAT *gsp; int ret; if (stats_internal != NULL) { CDB___memp_dump_region(dbenvp, stats_internal, stdout); return (1); } if ((ret = CDB_memp_stat(dbenvp, &gsp, &fsp, NULL)) != 0) { dbenvp->err(dbenvp, ret, NULL); return (1); } dl("Pool region size.\n", (u_long)gsp->st_regsize); dl_bytes("Cache size.\n", (u_long)gsp->st_gbytes, (u_long)0, (u_long)gsp->st_bytes); dl("Requested pages found in the cache", (u_long)gsp->st_cache_hit); if (gsp->st_cache_hit + gsp->st_cache_miss != 0) printf(" (%.0f%%)", ((double)gsp->st_cache_hit / (gsp->st_cache_hit + gsp->st_cache_miss)) * 100); printf(".\n"); dl("Requested pages mapped into the process' address space.\n", (u_long)gsp->st_map); dl("Requested pages not found in the cache.\n", (u_long)gsp->st_cache_miss); dl("Pages created in the cache.\n", (u_long)gsp->st_page_create); dl("Pages read into the cache.\n", (u_long)gsp->st_page_in); dl("Pages written from the cache to the backing file.\n", (u_long)gsp->st_page_out); dl("Clean pages forced from the cache.\n", (u_long)gsp->st_ro_evict); dl("Dirty pages forced from the cache.\n", (u_long)gsp->st_rw_evict); dl("Dirty buffers written by trickle-sync thread.\n", (u_long)gsp->st_page_trickle); dl("Current clean buffer count.\n", (u_long)gsp->st_page_clean); dl("Current dirty buffer count.\n", (u_long)gsp->st_page_dirty); dl("Number of hash buckets used for page location.\n", (u_long)gsp->st_hash_buckets); dl("Total number of times hash chains searched for a page.\n", (u_long)gsp->st_hash_searches); dl("The longest hash chain searched for a page.\n", (u_long)gsp->st_hash_longest); dl("Total number of hash buckets examined for page location.\n", (u_long)gsp->st_hash_examined); dl("The number of region locks granted without waiting.\n", (u_long)gsp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)gsp->st_region_wait); for (; fsp != NULL && *fsp != NULL; ++fsp) { printf("%s\n", DB_LINE); printf("Pool File: %s\n", (*fsp)->file_name); dl("Page size.\n", (u_long)(*fsp)->st_pagesize); dl("Requested pages found in the cache", (u_long)(*fsp)->st_cache_hit); if ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss != 0) printf(" (%.0f%%)", ((double)(*fsp)->st_cache_hit / ((*fsp)->st_cache_hit + (*fsp)->st_cache_miss)) * 100); printf(".\n"); dl("Requested pages mapped into the process' address space.\n", (u_long)(*fsp)->st_map); dl("Requested pages not found in the cache.\n", (u_long)(*fsp)->st_cache_miss); dl("Pages created in the cache.\n", (u_long)(*fsp)->st_page_create); dl("Pages read into the cache.\n", (u_long)(*fsp)->st_page_in); dl("Pages written from the cache to the backing file.\n", (u_long)(*fsp)->st_page_out); } return (0); } /* * txn_stats -- * Display transaction statistics. */ int txn_stats(DB_ENV *dbenvp) { DB_TXN_STAT *sp; u_int32_t i; int ret; const char *p; if ((ret = CDB_txn_stat(dbenvp, &sp, NULL)) != 0) { dbenvp->err(dbenvp, ret, NULL); return (1); } p = sp->st_last_ckp.file == 0 ? "No checkpoint LSN." : "File/offset for last checkpoint LSN."; printf("%lu/%lu\t%s\n", (u_long)sp->st_last_ckp.file, (u_long)sp->st_last_ckp.offset, p); p = sp->st_pending_ckp.file == 0 ? "No pending checkpoint LSN." : "File/offset for last pending checkpoint LSN."; printf("%lu/%lu\t%s\n", (u_long)sp->st_pending_ckp.file, (u_long)sp->st_pending_ckp.offset, p); if (sp->st_time_ckp == 0) printf("0\tNo checkpoint timestamp.\n"); else printf("%.24s\tCheckpoint timestamp.\n", ctime(&sp->st_time_ckp)); printf("%lx\tLast transaction ID allocated.\n", (u_long)sp->st_last_txnid); dl("Maximum number of active transactions possible.\n", (u_long)sp->st_maxtxns); dl("Active transactions.\n", (u_long)sp->st_nactive); dl("Maximum active transactions.\n", (u_long)sp->st_maxnactive); dl("Number of transactions begun.\n", (u_long)sp->st_nbegins); dl("Number of transactions aborted.\n", (u_long)sp->st_naborts); dl("Number of transactions committed.\n", (u_long)sp->st_ncommits); dl_bytes("Transaction region size.\n", (u_long)0, (u_long)0, (u_long)sp->st_regsize); dl("The number of region locks granted without waiting.\n", (u_long)sp->st_region_nowait); dl("The number of region locks granted after waiting.\n", (u_long)sp->st_region_wait); qsort(sp->st_txnarray, sp->st_nactive, sizeof(sp->st_txnarray[0]), txn_compare); for (i = 0; i < sp->st_nactive; ++i) printf("\tid: %lx; initial LSN file/offest %lu/%lu\n", (u_long)sp->st_txnarray[i].txnid, (u_long)sp->st_txnarray[i].lsn.file, (u_long)sp->st_txnarray[i].lsn.offset); return (0); } int txn_compare(const void *a1, const void *b1) { const DB_TXN_ACTIVE *a, *b; a = (DB_TXN_ACTIVE*)a1; b = (DB_TXN_ACTIVE*)b1; if (a->txnid > b->txnid) return (1); if (a->txnid < b->txnid) return (-1); return (0); } /* * dl -- * Display a big value. */ void dl(const char *msg, u_long value) { /* * Two formats: if less than 10 million, display as the number, if * greater than 10 million display as ###M. */ if (value < 10000000) printf("%lu\t%s", value, msg); else printf("%luM\t%s", value / 1000000, msg); } /* * dl_bytes -- * Display a big number of bytes. */ void dl_bytes(const char *msg, u_long gbytes, u_long mbytes, u_long bytes) { const char *sep; while (bytes > MEGABYTE) { ++mbytes; bytes -= MEGABYTE; } while (mbytes > GIGABYTE / MEGABYTE) { ++gbytes; --mbytes; } sep = ""; if (gbytes > 0) { printf("%luGB", gbytes); sep = " "; } if (mbytes > 0) { printf("%s%luMB", sep, bytes); sep = " "; } if (bytes > 1024) { printf("%s%luKB", sep, bytes / 1024); bytes %= 1024; sep = " "; } if (bytes > 0) printf("%s%lu", sep, bytes); printf("\t%s", msg); } /* * prflags -- * Print out flag values. */ void prflags(u_int32_t flags, const FN *fnp) { const char *sep; sep = "\t"; printf("Flags:"); for (; fnp->mask != 0; ++fnp) if (fnp->mask & flags) { printf("%s%s", sep, fnp->name); sep = ", "; } printf("\n"); } /* * db_init -- * Initialize the environment. */ int db_init(char *home, test_t ttype) { u_int32_t flags; int ret; /* * Try and use the shared memory pool region when reporting statistics * on the DB databases, so our information is as up-to-date as possible, * even if the mpool cache hasn't been flushed. */ flags = DB_USE_ENVIRON; switch (ttype) { case T_ENV: break; case T_DB: case T_MPOOL: LF_SET(DB_INIT_MPOOL); break; case T_LOCK: LF_SET(DB_INIT_LOCK); break; case T_LOG: LF_SET(DB_INIT_LOG); break; case T_TXN: LF_SET(DB_INIT_TXN); break; case T_NOTSET: abort(); /* NOTREACHED */ } /* * If that fails, and we're trying to look at a shared region, it's * a hard failure. */ if ((ret = dbenv->open(dbenv, home, NULL, flags, 0)) == 0) return (0); if (ttype != T_DB) { dbenv->err(dbenv, ret, "open"); return (1); } /* * We're trying to look at a database. * * An environment is required because we may be trying to look at * databases in directories other than the current one. We could * avoid using an environment iff the -h option wasn't specified, * but that seems like more work than it's worth. * * * No environment exists (or, at least no environment that includes * an mpool region exists). Create one, but make it private so that * no files are actually created. */ LF_SET(DB_CREATE | DB_PRIVATE); if ((ret = dbenv->open(dbenv, home, NULL, flags, 0)) == 0) return (0); /* An environment is required. */ dbenv->err(dbenv, ret, "open"); return (1); } /* * argcheck -- * Return if argument flags are okay. */ int argcheck(char *arg, const char *ok_args) { for (; *arg != '\0'; ++arg) if (strchr(ok_args, *arg) == NULL) return (0); return (1); } /* * siginit -- * Initialize the set of signals for which we want to clean up. * Generally, we try not to leave the shared regions locked if * we can. */ void siginit() { #ifdef SIGHUP (void)signal(SIGHUP, onint); #endif (void)signal(SIGINT, onint); #ifdef SIGPIPE (void)signal(SIGPIPE, onint); #endif (void)signal(SIGTERM, onint); } /* * onint -- * Interrupt signal handler. */ void onint(int signo) { if ((interrupted = signo) == 0) interrupted = SIGINT; } void usage() { fprintf(stderr, "usage: htdb_stat [-celmNtzW] [-C Acflmo] [-d file [-s file]] [-h home] [-M Ahlm]\n"); exit (1); } ��������������������������htdig-3.2.0b6/htdb/mifluzdict.cc��������������������������������������������������������������������0100644�0063146�0012731�00000004350�10055635542�015774� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // NAME // // dump the dictionnary of an inverted index. // // SYNOPSIS // // mifluzdict file // // DESCRIPTION // // mifluzdict writes on <b>stdout</b> a complete ascii description // of the <b>file</b> inverted index using the <i>WordList::Write</i> // method. // // ENVIRONMENT // // <b>MIFLUZ_CONFIG</b> // file name of configuration file read by WordContext(3). Defaults to // <b>~/.mifluz.</b> // // // END // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <stdlib.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #include <htString.h> #include <WordContext.h> #include <WordList.h> #include <WordDict.h> #include <Configuration.h> typedef struct { String prefix; } params_t; static void action(WordContext* context, const String& file, params_t* params) { WordList *words = context->List(); if(words->Open(file, O_RDONLY) != OK) exit(1); if(params->prefix.empty()) { if(words->WriteDict(stdout) != OK) exit(1); } else { WordDict *dict = words->Dict(); WordDictCursor *cursor = dict->CursorPrefix(params->prefix); String word; WordDictRecord record; while(dict->NextPrefix(cursor, word, record) == 0) { printf("%s %d %d\n", (char*)word.get(), record.Id(), record.Count()); } } if(words->Close() != OK) exit(1); delete words; } static void usage() { fprintf(stderr, "usage: mifluzdict [-p prefix] file\n"); exit(1); } int main(int argc, char *argv[]) { params_t params; extern char *optarg; extern int optind; int ch; while ((ch = getopt(argc, argv, "p:")) != EOF) { switch (ch) { case 'p': params.prefix = optarg; break; default: usage(); break; } } if(optind != argc - 1) usage(); // // Mandatory to create global data needed for the library. // WordContext *context = new WordContext(); if(!context) exit(1); action(context, argv[optind], ¶ms); delete context; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/mifluzdump.cc��������������������������������������������������������������������0100644�0063146�0012731�00000003040�10055635542�016011� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // NAME // // dump the content of an inverted index. // // SYNOPSIS // // mifluzdump file // // DESCRIPTION // // mifluzdump writes on <b>stdout</b> a complete ascii description // of the <b>file</b> inverted index using the <i>WordList::Write</i> // method. // // ENVIRONMENT // // <b>MIFLUZ_CONFIG</b> // file name of configuration file read by WordContext(3). Defaults to // <b>~/.mifluz.</b> // // // END // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <stdlib.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #include <htString.h> #include <WordContext.h> #include <WordList.h> #include <Configuration.h> static void action(WordContext* context, const String& file) { WordList *words = context->List(); if(words->Open(file, O_RDONLY) != OK) exit(1); if(words->Write(stdout) != OK) exit(1); if(words->Close() != OK) exit(1); delete words; } static void usage() { fprintf(stderr, "usage: mifluzdump file\n"); exit(1); } int main(int argc, char *argv[]) { if(argc != 2) usage(); // // Mandatory to create global data needed for the library. // WordContext *context = new WordContext(); if(!context) exit(1); action(context, argv[1]); delete context; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/mifluzload.cc��������������������������������������������������������������������0100644�0063146�0012731�00000004143�10055635542�015770� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // NAME // // load the content of an inverted index. // // SYNOPSIS // // mifluzload file // // DESCRIPTION // // mifluzload reads from <b>stdout</b> a complete ascii description // of the <b>file</b> inverted index using the <i>WordList::Read</i> // method. // // ENVIRONMENT // // <b>MIFLUZ_CONFIG</b> // file name of configuration file read by WordContext(3). Defaults to // <b>~/.mifluz.</b> // // // END // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <stdlib.h> #include <unistd.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #endif /* HAVE_GETOPT_H */ #include <locale.h> #include <htString.h> #include <WordContext.h> #include <WordList.h> static void action(WordContext* context, const String& file) { WordList *words = context->List(); if(words->Open(file, O_RDWR | O_TRUNC) != OK) exit(1); if(words->Read(stdin) < 0) exit(1); if(words->Close() != OK) exit(1); delete words; } static void usage() { fprintf(stderr, "usage: mifluzload [-zv] file\n"); exit(1); } int main(int argc, char *argv[]) { if(argc < 2) usage(); setlocale(LC_ALL, ""); // // Mandatory to create global data needed for the library. // WordContext *context = new WordContext(); if(!context) exit(1); Configuration& config = context->GetConfiguration(); // extern char *optarg; extern int optind; int ch; while ((ch = getopt(argc, argv, "zv")) != EOF) { switch (ch) { case 'z': config.Add("wordlist_compress", "true"); break; case 'v': { int value = config.Value("wordlist_verbose", 0); value++; char value_string[64]; sprintf(value_string, "%d", value); config.Add("wordlist_verbose", value_string); } break; default: usage(); break; } } context->ReInitialize(); action(context, argv[optind]); delete context; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/util_sig.cc����������������������������������������������������������������������0100644�0063146�0012731�00000002604�10055635542�015441� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // /*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000 * Sleepycat Software. All rights reserved. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <sys/types.h> #include <signal.h> extern "C" { #include "db_int.h" #include "common_ext.h" } static int interrupt; static void onint(int); /* * onint -- * Interrupt signal handler. */ static void onint(int signo) { if ((interrupt = signo) == 0) interrupt = SIGINT; } void __db_util_siginit() { /* * Initialize the set of signals for which we want to clean up. * Generally, we try not to leave the shared regions locked if * we can. */ #ifdef SIGHUP (void) signal(SIGHUP, onint); #endif (void) signal(SIGINT, onint); #ifdef SIGPIPE (void) signal(SIGPIPE, onint); #endif (void) signal(SIGTERM, onint); } int __db_util_interrupted() { return (interrupt != 0); } void __db_util_sigresend() { /* Resend any caught signal. */ if (__db_util_interrupted != 0) { (void) signal(interrupt, SIG_DFL); (void) raise(interrupt); /* NOTREACHED */ } } ����������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdb/util_sig.h�����������������������������������������������������������������������0100644�0063146�0012731�00000000222�07427026544�015302� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef UTIL_SIG_H #define UTIL_SIG_H void __db_util_siginit(); int __db_util_interrupted(); void __db_util_sigresend(); #endif /* UTIL_SIG_H */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013462� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/.sniffdir/����������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�015344� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/.cvsignore����������������������������������������������������������������������0100644�0063146�0012731�00000000063�06772705363�015500� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Makefile *.lo *.la .purify .pure .deps .libs htdig �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Document.cc���������������������������������������������������������������������0100644�0063146�0012731�00000052045�10055635542�015562� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Document.cc // // Document: This class holds everything there is to know about a document. // The actual contents of the document may or may not be present at // all times for memory conservation reasons. // The document can be told to retrieve its contents. This is done // with the Retrieve call. In case the retrieval causes a // redirect, the link is followed, but this process is done // only once (to prevent loops.) If the redirect didn't // work, Document_not_found is returned. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Document.cc,v 1.71 2004/05/28 13:15:14 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include <signal.h> #include <sys/types.h> #include <sys/stat.h> #include <ctype.h> #include "Document.h" #include "StringList.h" #include "htdig.h" #include "HTML.h" #include "Plaintext.h" #include "ExternalParser.h" #include "lib.h" #include "Transport.h" #include "HtHTTP.h" #ifdef HAVE_SSL_H #include "HtHTTPSecure.h" #endif #include "HtHTTPBasic.h" #include "ExternalTransport.h" #include "defaults.h" #if 1 typedef void (*SIGNAL_HANDLER) (...); #else typedef SIG_PF SIGNAL_HANDLER; #endif //***************************************************************************** // Document::Document(char *u) // Initialize with the given url as the location for this document. // If the max_size is given, use that for size, otherwise use the // config value. // Document::Document(char *u, int max_size) { url = 0; proxy = 0; referer = 0; contents = 0; transportConnect = 0; HTTPConnect = 0; HTTPSConnect = 0; FileConnect = 0; FTPConnect = 0; NNTPConnect = 0; externalConnect = 0; HtConfiguration* config= HtConfiguration::config(); // We probably need to move assignment of max_doc_size, according // to a server or url configuration value. The same is valid for // max_retries. if (max_size > 0) max_doc_size = max_size; else max_doc_size = config->Value("max_doc_size"); if (config->Value("max_retries") > 0) num_retries = config->Value("max_retries"); else num_retries = 2; // Initialize some static variables of Transport Transport::SetDebugLevel(debug); // Initialize some static variables of Transport // and the User Agent for every HtHTTP objects HtHTTP::SetParsingController(ExternalParser::canParse); // Set the default parser content-type string Transport::SetDefaultParserContentType ("text/"); contents.allocate(max_doc_size + 100); contentType = ""; contentLength = -1; if (u) { Url(u); } } //***************************************************************************** // Document::~Document() // Document::~Document() { // We delete only the derived class objects if (HTTPConnect) delete HTTPConnect; if (HTTPSConnect) delete HTTPSConnect; if (FileConnect) delete FileConnect; if (FTPConnect) delete FTPConnect; if (NNTPConnect) delete NNTPConnect; if (externalConnect) delete externalConnect; if (url) delete url; if (proxy) delete proxy; if (referer) delete referer; #if MEM_DEBUG char *p = new char; cout << "==== Document deleted: " << this << " new at " << ((void *) p) << endl; delete p; #endif } //***************************************************************************** // void Document::Reset() // Restore the Document object to an initial state. // We will not reset the authorization information since it can be reused. // void Document::Reset() { contentType = 0; contentLength = -1; if (url) delete url; url = 0; if (referer) delete referer; referer = 0; proxy=0; authorization=0; proxy_authorization=0; contents = 0; document_length = 0; redirected_to = 0; } //***************************************************************************** // void Document::Url(const String &u) // Set the URL for this document // void Document::Url(const String &u) { HtConfiguration* config= HtConfiguration::config(); if (url) delete url; url = new URL(u); // Re-initialise the proxy if (proxy) delete proxy; proxy = 0; // Get the proxy information for this URL const String proxyURL = config->Find(url,"http_proxy"); // If http_proxy is not empty we set the proxy for the current URL if (proxyURL.length()) { proxy = new URL(proxyURL); proxy->normalize(); // set the proxy authorization information setProxyUsernamePassword(config->Find(url,"http_proxy_authorization")); } // Set the authorization information setUsernamePassword(config->Find(url,"authorization")); } //***************************************************************************** // void Document::Referer(const String &u) // Set the Referring URL for this document // void Document::Referer(const String &u) { if (referer) delete referer; referer = new URL(u); } //***************************************************************************** // int Document::UseProxy() // Returns 1 if the given url is to be retrieved from the proxy server, // or 0 if it's not. // int Document::UseProxy() { HtConfiguration* config= HtConfiguration::config(); static HtRegex *excludeProxy = 0; // // Initialize excludeProxy list if this is the first time. // if (!excludeProxy) { excludeProxy = new HtRegex(); StringList l(config->Find("http_proxy_exclude"), " \t"); excludeProxy->setEscaped(l, config->Boolean("case_sensitive")); l.Release(); } if ((proxy) && (excludeProxy->match(url->get(), 0, 0) == 0)) return true; // if the exclude pattern is empty, use the proxy return false; } //***************************************************************************** // DocStatus Document::Retrieve(HtDateTime date) // Attempt to retrieve the document pointed to by our internal URL // Transport::DocStatus Document::Retrieve(Server *server, HtDateTime date) { // Right now we just handle http:// service // Soon this will include file:// // as well as an ExternalTransport system // eventually maybe ftp:// and a few others Transport::DocStatus status; Transport_Response *response = 0; HtDateTime *ptrdatetime = 0; int useproxy = UseProxy(); int NumRetries; transportConnect = 0; if (ExternalTransport::canHandle(url->service())) { if (externalConnect) { delete externalConnect; } externalConnect = new ExternalTransport(url->service()); transportConnect = externalConnect; } #ifdef HAVE_SSL_H else if (mystrncasecmp(url->service(), "https", 5) == 0) { if (!HTTPSConnect) { if (debug>4) cout << "Creating an HtHTTPSecure object" << endl; HTTPSConnect = new HtHTTPSecure(); if (!HTTPSConnect) return Transport::Document_other_error; } if (HTTPSConnect) { // Here we must set only thing for a HTTP request HTTPSConnect->SetRequestURL(*url); // Set the user agent which can vary per server HTTPSConnect->SetRequestUserAgent(server->UserAgent()); // Set the accept language which can vary per server HTTPSConnect->SetAcceptLanguage(server->AcceptLanguage()); // Set the referer if (referer) HTTPSConnect->SetRefererURL(*referer); // Let's disable the cookies if we decided that in the config file if (server->DisableCookies()) HTTPSConnect->DisableCookies(); else HTTPSConnect->AllowCookies(); // We may issue a config paramater to enable/disable them if (server->IsPersistentConnectionAllowed()) { // Persistent connections allowed HTTPSConnect->AllowPersistentConnection(); } else HTTPSConnect->DisablePersistentConnection(); // Head before Get option control if (server->HeadBeforeGet()) HTTPSConnect->EnableHeadBeforeGet(); else HTTPSConnect->DisableHeadBeforeGet(); // http->SetRequestMethod(HtHTTP::Method_GET); if (debug > 2) { cout << "Making HTTPS request on " << url->get(); if (useproxy) cout << " via proxy (" << proxy->host() << ":" << proxy->port() << ")"; cout << endl; } } HTTPSConnect->SetProxy(useproxy); transportConnect = HTTPSConnect; } #endif else if (mystrncasecmp(url->service(), "http", 4) == 0) { if (!HTTPConnect) { if (debug>4) cout << "Creating an HtHTTPBasic object" << endl; HTTPConnect = new HtHTTPBasic(); if (!HTTPConnect) return Transport::Document_other_error; } if (HTTPConnect) { // Here we must set only thing for a HTTP request HTTPConnect->SetRequestURL(*url); // Set the user agent which can vary per server HTTPConnect->SetRequestUserAgent(server->UserAgent()); // Set the accept language which can vary per server HTTPConnect->SetAcceptLanguage(server->AcceptLanguage()); // Set the referer if (referer) HTTPConnect->SetRefererURL(*referer); // Let's disable the cookies if we decided that in the config file if (server->DisableCookies()) HTTPConnect->DisableCookies(); else HTTPConnect->AllowCookies(); // We may issue a config paramater to enable/disable them if (server->IsPersistentConnectionAllowed()) { // Persistent connections allowed HTTPConnect->AllowPersistentConnection(); } else HTTPConnect->DisablePersistentConnection(); // Head before Get option control if (server->HeadBeforeGet()) HTTPConnect->EnableHeadBeforeGet(); else HTTPConnect->DisableHeadBeforeGet(); // http->SetRequestMethod(HtHTTP::Method_GET); if (debug > 2) { cout << "Making HTTP request on " << url->get(); if (useproxy) cout << " via proxy (" << proxy->host() << ":" << proxy->port() << ")"; cout << endl; } } HTTPConnect->SetProxy(useproxy); transportConnect = HTTPConnect; } else if (mystrncasecmp(url->service(), "file", 4) == 0) { if (!FileConnect) { if (debug>4) cout << "Creating an HtFile object" << endl; FileConnect = new HtFile(); if (!FileConnect) return Transport::Document_other_error; } if (FileConnect) { // Here we must set only thing for a file request FileConnect->SetRequestURL(*url); // Set the referer if (referer) FileConnect->SetRefererURL(*referer); if (debug > 2) cout << "Making 'file' request on " << url->get() << endl; } transportConnect = FileConnect; } else if (mystrncasecmp(url->service(), "ftp", 3) == 0) { // the following FTP handling is modeled very closely on // the prior 'file'-protocol handling, so beware of bugs if (!FTPConnect) { if (debug>4) cout << "Creating an HtFTP object" << endl; FTPConnect = new HtFTP(); if (!FTPConnect) return Transport::Document_other_error; } if (FTPConnect) { // Here we must set only thing for a FTP request FTPConnect->SetRequestURL(*url); //////////////////////////////////////////////////// /// /// stuff may be missing here or in need of change /// /////////////////////////////////////////////////// // Set the referer if (referer) FTPConnect->SetRefererURL(*referer); if (debug > 2) cout << "Making 'ftp' request on " << url->get() << endl; } transportConnect = FTPConnect; } // end of else if (mystrncasecmp(url->service(), "ftp", 3) == 0) else if (mystrncasecmp(url->service(), "news", 4) == 0) { if (!NNTPConnect) { if (debug>4) cout << "Creating an HtNNTP object" << endl; NNTPConnect = new HtNNTP(); if (!NNTPConnect) return Transport::Document_other_error; } if (NNTPConnect) { // Here we got an Usenet document request NNTPConnect->SetRequestURL(*url); if (debug > 2) cout << "Making 'NNTP' request on " << url->get() << endl; } transportConnect = NNTPConnect; } else { if (debug) { cout << '"' << url->service() << "\" not a recognized transport service. Ignoring\n"; } return Transport::Document_not_recognized_service; } // Is a transport object pointer available? if (transportConnect) { // Set all the appropriate parameters if (useproxy) { transportConnect->SetConnection(proxy); if (proxy_authorization.length()) transportConnect->SetProxyCredentials(proxy_authorization); } else transportConnect->SetConnection(url); // OK. Let's set the connection time out transportConnect->SetTimeOut(server->TimeOut()); // Let's set number of retries for a failed connection attempt transportConnect->SetRetry(server->TcpMaxRetries()); // ... And the wait time after a failure transportConnect->SetWaitTime(server->TcpWaitTime()); // OK. Let's set the maximum size of a document to be retrieved transportConnect->SetRequestMaxDocumentSize(max_doc_size); // Let's set the credentials transportConnect->SetCredentials(authorization); // Let's set the modification time (in order not to retrieve a // document we already have) transportConnect->SetRequestModificationTime(date); // Make the request // Here is the main operation ... Let's make the request !!! // We now perform a loop until we want to retry the request NumRetries = 0; do { status = transportConnect->Request(); if (NumRetries++) if(debug>0) cout << "."; } while (ShouldWeRetry(status) && NumRetries < num_retries); // Let's get out the info we need response = transportConnect->GetResponse(); if (response) { // We got the response contents = response->GetContents(); contentType = response->GetContentType(); contentLength = response->GetContentLength(); ptrdatetime = response->GetModificationTime(); document_length = response->GetDocumentLength(); // This test is ugly! Can whoever put it here explain why it's // needed? Why would GetLocation() ever return a non-empty string // from a Transport subclass that's not supposed to redirect? if (transportConnect == HTTPConnect || transportConnect == HTTPSConnect || transportConnect == externalConnect) redirected_to = ((HtHTTP_Response *)response)->GetLocation(); if (ptrdatetime) { // We got the modification date/time modtime = *ptrdatetime; } // How to manage it when there's no modification date/time? if (debug > 5) { cout << "Contents:\n" << contents << endl; cout << "Content Type: " << contentType << endl; cout << "Content Length: " << contentLength << endl; cout << "Modification Time: " << modtime.GetISO8601() << endl; } } return status; } else return Transport::Document_not_found; } //***************************************************************************** // DocStatus Document::RetrieveLocal(HtDateTime date, StringList *filenames) // Attempt to retrieve the document pointed to by our internal URL // using a list of potential local filenames given. Returns Document_ok, // Document_not_changed or Document_not_local (in which case the // retriever tries it again using the standard retrieve method). // Transport::DocStatus Document::RetrieveLocal(HtDateTime date, StringList *filenames) { HtConfiguration* config= HtConfiguration::config(); struct stat stat_buf; String *filename; filenames->Start_Get(); // Loop through list of potential filenames until the list is exhausted // or a suitable file is found to exist as a regular file. while ((filename = (String *)filenames->Get_Next()) && ((stat((char*)*filename, &stat_buf) == -1) || !S_ISREG(stat_buf.st_mode))) if (debug > 1) cout << " tried local file " << *filename << endl; if (!filename) return Transport::Document_not_local; if (debug > 1) cout << " found existing file " << *filename << endl; modtime = stat_buf.st_mtime; if (modtime <= date) return Transport::Document_not_changed; char *ext = strrchr((char*)*filename, '.'); if (ext == NULL) return Transport::Document_not_local; const String *type = HtFile::Ext2Mime (ext + 1); static Dictionary *bad_local_ext = 0; if (!bad_local_ext) { // A list of bad extensions, separated by spaces or tabs bad_local_ext = new Dictionary; String t = config->Find("bad_local_extensions"); String lowerp; char *p = strtok(t, " \t"); while (p) { // Extensions are case insensitive lowerp = p; lowerp.lowercase(); bad_local_ext->Add(lowerp, 0); p = strtok(0, " \t"); } } if (type == NULL || bad_local_ext->Exists(ext)) { if (debug > 1 && type != NULL) cout << "\nBad local extension: " << *filename << endl; return Transport::Document_not_local; } else contentType = *type; // Open it FILE *f = fopen((char*)*filename, "r"); if (f == NULL) return Transport::Document_not_local; // // Read in the document itself // max_doc_size = config->Value(url,"max_doc_size"); contents = 0; char docBuffer[8192]; int bytesRead; while ((bytesRead = fread(docBuffer, 1, sizeof(docBuffer), f)) > 0) { if (debug > 2) cout << "Read " << bytesRead << " from document\n"; if (contents.length() + bytesRead > max_doc_size) bytesRead = max_doc_size - contents.length(); contents.append(docBuffer, bytesRead); if (contents.length() >= max_doc_size) break; } fclose(f); document_length = contents.length(); contentLength = stat_buf.st_size; if (debug > 2) cout << "Read a total of " << document_length << " bytes\n"; if (document_length < contentLength) document_length = contentLength; return Transport::Document_ok; } //***************************************************************************** // Parsable *Document::getParsable() // Given the content-type of a document, returns a document parser. // This will first look through the list of user supplied parsers and // then at our (limited) builtin list of parsers. The user supplied // parsers are external programs that will be used. // Parsable * Document::getParsable() { static HTML *html = 0; static Plaintext *plaintext = 0; static ExternalParser *externalParser = 0; Parsable *parsable = 0; if (ExternalParser::canParse(contentType)) { if (externalParser) { delete externalParser; } externalParser = new ExternalParser(contentType); parsable = externalParser; } else if (mystrncasecmp((char*)contentType, "text/html", 9) == 0) { if (!html) html = new HTML(); parsable = html; } else if (mystrncasecmp((char*)contentType, "text/plain", 10) == 0) { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; } else if (mystrncasecmp((char *)contentType, "text/css", 8) == 0) { return NULL; } else if (mystrncasecmp((char *)contentType, "text/", 5) == 0) { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; if (debug > 1) { cout << '"' << contentType << "\" not a recognized type. Assuming text/plain\n"; } } else { if (debug > 1) { cout << '"' << contentType << "\" not a recognized type. Ignoring\n"; } return NULL; } parsable->setContents(contents.get(), contents.length()); return parsable; } int Document::ShouldWeRetry(Transport::DocStatus DocumentStatus) { if (DocumentStatus == Transport::Document_connection_down) return 1; if (DocumentStatus == Transport::Document_no_connection) return 1; if (DocumentStatus == Transport::Document_no_header) return 1; return 0; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Document.h����������������������������������������������������������������������0100644�0063146�0012731�00000007310�10055635542�015417� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Document.h // // Document: This class holds everything there is to know about a document. // The actual contents of the document may or may not be present at // all times for memory conservation reasons. // The document can be told to retrieve its contents. This is done // with the Retrieve call. In case the retrieval causes a // redirect, the link is followed, but this process is done // only once (to prevent loops.) If the redirect didn't // work, Document_not_found is returned. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Document.h,v 1.19 2004/05/28 13:15:14 lha Exp $ // // #ifndef _Document_h_ #define _Document_h_ #include "Parsable.h" #include "Object.h" #include "URL.h" #include "htString.h" #include "StringList.h" #include "Transport.h" #include "HtHTTP.h" #include "HtFile.h" #include "HtFTP.h" #include "HtNNTP.h" #include "ExternalTransport.h" #include "Server.h" class Connection; class Document : public Object { public: // // Construction/Destruction // Document(char *url = 0, int max_size = 0); ~Document(); // // Interface to the document. // void Reset(); int Length() {return document_length;} int ContentLength() {return contentLength;} int StoredLength() {return contents.length();} char *Contents() {return contents;} void Contents(char *s) {contents = s; document_length = contents.length();} char *ContentType() {return contentType.get();} // // In case the retrieval process went through a redirect process, // the new url can be gotten using the following call // char *Redirected() {return redirected_to;} URL *Url() {return url;} void Url(const String &url); void Referer(const String &url); time_t ModTime() {return modtime.GetTime_t();} Transport::DocStatus Retrieve(Server *server, HtDateTime date); Transport::DocStatus RetrieveLocal(HtDateTime date, StringList *filenames); // // Return an appropriate parsable object for the document type. // Parsable *getParsable(); // // Set the username and password to be used in any requests // void setUsernamePassword(const String& credentials) { authorization = credentials;} void setProxyUsernamePassword(const String& credentials) { proxy_authorization = credentials;} HtHTTP *GetHTTPHandler() const { return HTTPConnect; } private: enum { Header_ok, Header_not_found, Header_not_changed, Header_redirect, Header_not_text, Header_not_authorized }; URL *url; URL *proxy; URL *referer; String contents; String redirected_to; String contentType; String authorization; String proxy_authorization; int contentLength; int document_length; HtDateTime modtime; int max_doc_size; int num_retries; int UseProxy(); Transport *transportConnect; HtHTTP *HTTPConnect; HtHTTP *HTTPSConnect; HtFile *FileConnect; HtFTP *FTPConnect; HtNNTP *NNTPConnect; ExternalTransport *externalConnect; /////// // Tell us if we should retry to retrieve an URL depending on // the first returned document status /////// int ShouldWeRetry(Transport::DocStatus DocumentStatus); }; #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/ExternalParser.cc���������������������������������������������������������������0100644�0063146�0012731�00000037265�10055635542�016752� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // ExternalParser.cc // // ExternalParser: Implementation of ExternalParser // Allows external programs to parse unknown document formats. // The parser is expected to return the document in a // specific format. The format is documented // in http://www.htdig.org/attrs.html#external_parser // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: ExternalParser.cc,v 1.29 2004/05/28 13:15:14 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "ExternalParser.h" #include "HTML.h" #include "Plaintext.h" #include "htdig.h" #include "htString.h" #include "QuotedStringList.h" #include "URL.h" #include "Dictionary.h" #include "good_strtok.h" #include <ctype.h> #include <stdio.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #include <stdlib.h> #ifdef HAVE_WAIT_H #include <wait.h> #elif HAVE_SYS_WAIT_H #include <sys/wait.h> #endif #ifdef _MSC_VER /* _WIN32 */ #include <process.h> #endif #include "defaults.h" static Dictionary *parsers = 0; static Dictionary *toTypes = 0; extern String configFile; //***************************************************************************** // ExternalParser::ExternalParser(char *contentType) // ExternalParser::ExternalParser(char *contentType) { String mime; int sep; if (canParse(contentType)) { String mime = contentType; mime.lowercase(); sep = mime.indexOf(';'); if (sep != -1) mime = mime.sub(0, sep).get(); currentParser = ((String *)parsers->Find(mime))->get(); } ExternalParser::contentType = contentType; } //***************************************************************************** // ExternalParser::~ExternalParser() // ExternalParser::~ExternalParser() { } //***************************************************************************** // int ExternalParser::readLine(FILE *in, String &line) // int ExternalParser::readLine(FILE *in, String &line) { char buffer[2048]; int length; line = 0; // read(in, buffer, sizeof(buffer) while (fgets(buffer, sizeof(buffer), in)) { length = strlen(buffer); if (buffer[length - 1] == '\n') { // // A full line has been read. Return it. // line << buffer; line.chop('\n'); return 1; } else { // // Only a partial line was read. Append it to the line // and read some more. // line << buffer; } } return line.length() > 0; } //***************************************************************************** // int ExternalParser::canParse(char *contentType) // int ExternalParser::canParse(char *contentType) { HtConfiguration* config= HtConfiguration::config(); int sep; if (!parsers) { parsers = new Dictionary(); toTypes = new Dictionary(); QuotedStringList qsl(config->Find("external_parsers"), " \t"); String from, to; int i; for (i = 0; qsl[i]; i += 2) { from = qsl[i]; to = ""; sep = from.indexOf("->"); if (sep != -1) { to = from.sub(sep+2).get(); from = from.sub(0, sep).get(); } from.lowercase(); sep = from.indexOf(';'); if (sep != -1) from = from.sub(0, sep).get(); parsers->Add(from, new String(qsl[i + 1])); toTypes->Add(from, new String(to)); } } String mime = contentType; mime.lowercase(); sep = mime.indexOf(';'); if (sep != -1) mime = mime.sub(0, sep).get(); return parsers->Exists(mime); } //***************************************************************************** // void ExternalParser::parse(Retriever &retriever, URL &base) // void ExternalParser::parse(Retriever &retriever, URL &base) { // NEAL - ENABLE/REWRITE THIS ASAP FOR WIN32 #ifndef _MSC_VER /* _WIN32 */ HtConfiguration* config= HtConfiguration::config(); if (contents == 0 || contents->length() == 0 || currentParser.length() == 0) { return; } // // Write the contents to a temporary file. // String path = getenv("TMPDIR"); int fd; if (path.length() == 0) path = "/tmp"; #ifndef HAVE_MKSTEMP path << "/htdext." << getpid(); // This is unfortunately predictable #ifdef O_BINARY fd = open((char*)path, O_WRONLY|O_CREAT|O_EXCL|O_BINARY); #else fd = open((char*)path, O_WRONLY|O_CREAT|O_EXCL); #endif #else path << "/htdex.XXXXXX"; fd = mkstemp((char*)path); // can we force binary mode somehow under Cygwin, if it has mkstemp? #endif if (fd < 0) { if (debug) cout << "External parser error: Can't create temp file " << (char *)path << endl; return; } write(fd, contents->get(), contents->length()); close(fd); // unsigned int minimum_word_length = config->Value("minimum_word_length", 3); String line; char *token1, *token2, *token3; int loc = 0, hd = 0; URL url; String mime = contentType; mime.lowercase(); int sep = mime.indexOf(';'); if (sep != -1) mime = mime.sub(0, sep).get(); String convertToType = ((String *)toTypes->Find(mime))->get(); int get_hdr = (convertToType.nocase_compare("user-defined") == 0); int get_file = (convertToType.length() != 0); String newcontent; StringList cpargs(currentParser); char **parsargs = new char * [cpargs.Count() + 5]; int argi; for (argi = 0; argi < cpargs.Count(); argi++) parsargs[argi] = (char *)cpargs[argi]; parsargs[argi++] = path.get(); parsargs[argi++] = contentType.get(); parsargs[argi++] = (char *)base.get().get(); parsargs[argi++] = configFile.get(); parsargs[argi++] = 0; int stdout_pipe[2]; int fork_result = -1; int fork_try; if (pipe(stdout_pipe) == -1) { if (debug) cout << "External parser error: Can't create pipe!" << endl; unlink((char*)path); delete [] parsargs; return; } for (fork_try = 4; --fork_try >= 0;) { fork_result = fork(); // Fork so we can execute in the child process if (fork_result != -1) break; if (fork_try) sleep(3); } if (fork_result == -1) { if (debug) cout << "Fork Failure in ExternalParser" << endl; unlink((char*)path); delete [] parsargs; return; } if (fork_result == 0) // Child process { close(STDOUT_FILENO); // Close handle STDOUT to replace with pipe dup(stdout_pipe[1]); close(stdout_pipe[0]); close(stdout_pipe[1]); close(STDIN_FILENO); // Close STDIN to replace with file open((char*)path, O_RDONLY); // Call External Parser execv(parsargs[0], parsargs); exit(EXIT_FAILURE); } // Parent Process delete [] parsargs; close(stdout_pipe[1]); // Close STDOUT for writing #ifdef O_BINARY FILE *input = fdopen(stdout_pipe[0], "rb"); #else FILE *input = fdopen(stdout_pipe[0], "r"); #endif if (input == NULL) { if (debug) cout << "Fdopen Failure in ExternalParser" << endl; unlink((char*)path); return; } while ((!get_file || get_hdr) && readLine(input, line)) { if (get_hdr) { line.chop('\r'); if (line.length() == 0) get_hdr = false; else if (mystrncasecmp((char*)line, "content-type:", 13) == 0) { token1 = line.get() + 13; while (*token1 && isspace(*token1)) token1++; token1 = strtok(token1, "\n\t"); convertToType = token1; } continue; } #ifdef O_BINARY line.chop('\r'); #endif token1 = strtok(line, "\t"); if (token1 == NULL) token1 = ""; token2 = NULL; token3 = NULL; switch (*token1) { case 'w': // word token1 = strtok(0, "\t"); if (token1 != NULL) token2 = strtok(0, "\t"); if (token2 != NULL) token3 = strtok(0, "\t"); if (token1 != NULL && token2 != NULL && token3 != NULL && (loc = atoi(token2)) >= 0 && (hd = atoi(token3)) >= 0 && hd < 12) retriever.got_word(token1, loc, hd); else cerr<< "External parser error: expected word in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 'u': // href token1 = strtok(0, "\t"); if (token1 != NULL) token2 = strtok(0, "\t"); if (token1 != NULL && token2 != NULL) { url.parse(token1); url.hopcount(base.hopcount() + 1); retriever.got_href(url, token2); } else cerr<< "External parser error: expected URL in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 't': // title token1 = strtok(0, "\t"); if (token1 != NULL) retriever.got_title(token1); else cerr<< "External parser error: expected title in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 'h': // head token1 = strtok(0, "\t"); if (token1 != NULL) retriever.got_head(token1); else cerr<< "External parser error: expected text in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 'a': // anchor token1 = strtok(0, "\t"); if (token1 != NULL) retriever.got_anchor(token1); else cerr<< "External parser error: expected anchor in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 'i': // image url token1 = strtok(0, "\t"); if (token1 != NULL) retriever.got_image(token1); else cerr<< "External parser error: expected image URL in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; case 'm': // meta { // Using good_strtok means we can accept empty // fields. char *httpEquiv = good_strtok(token1+2, '\t'); char *name = good_strtok(0, '\t'); char *content = good_strtok(0, '\t'); if (httpEquiv != NULL && name != NULL && content != NULL) { // It would be preferable if we could share // this part with HTML.cc, but it has other // chores too, and I do not see a point where to // split it up to get a common shared function // (or class). This should not stop anybody from // finding a better solution. // For now, there is duplicated code. static StringMatch *keywordsMatch = 0; if (!keywordsMatch) { StringList kn(config->Find("keywords_meta_tag_names"), " \t"); keywordsMatch = new StringMatch(); keywordsMatch->IgnoreCase(); keywordsMatch->Pattern(kn.Join('|')); } static StringMatch *descriptionMatch = 0; if (!descriptionMatch) { StringList dn(config->Find("description_meta_tag_names"), " \t"); descriptionMatch = new StringMatch(); descriptionMatch->IgnoreCase(); descriptionMatch->Pattern(dn.Join('|')); } static StringMatch *metadatetags = 0; if (!metadatetags) { metadatetags = new StringMatch(); metadatetags->IgnoreCase(); metadatetags->Pattern("date|dc.date|dc.date.created|dc.data.modified"); } // <URL:http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.2.5> // says that the "name" attribute defaults to // the http-equiv attribute if empty. if (*name == '\0') name = httpEquiv; if (*httpEquiv != '\0') { // <META HTTP-EQUIV=REFRESH case if (mystrcasecmp(httpEquiv, "refresh") == 0 && *content != '\0') { char *q = (char*)mystrcasestr(content, "url"); if (q && *q) { q += 3; // skiping "URL" while (*q && ((*q == '=') || isspace(*q))) q++; char *qq = q; while (*qq && (*qq != ';') && (*qq != '"') && !isspace(*qq))qq++; *qq = 0; URL href(q, base); // I don't know why anyone would do this, but hey... retriever.got_href(href, ""); } } } // // Now check for <meta name=... content=...> tags that // fly with any reasonable DTD out there // if (*name != '\0' && *content != '\0') { if (keywordsMatch->CompareWord(name)) { int wordindex = 1; addKeywordString (retriever, content, wordindex); // // can this be merged with Parser::addKeywordString ? // char *w = strtok(content, " ,\t\r"); // while (w) // { // if (strlen(w) >= minimum_word_length) // retriever.got_word(w, 1, 9); // w = strtok(0, " ,\t\r"); // } } if (metadatetags->CompareWord(name) && config->Boolean("use_doc_date", 0)) { retriever.got_time(content); } else if (mystrcasecmp(name, "author") == 0) { int wordindex = 1; retriever.got_author(content); addString (retriever, content, wordindex, 11); } else if (mystrcasecmp(name, "htdig-email") == 0) { retriever.got_meta_email(content); } else if (mystrcasecmp(name, "htdig-notification-date") == 0) { retriever.got_meta_notification(content); } else if (mystrcasecmp(name, "htdig-email-subject") == 0) { retriever.got_meta_subject(content); } else if (descriptionMatch->CompareWord(name) && strlen(content) != 0) { // // We need to do two things. First grab the description // String meta_dsc = content; if (meta_dsc.length() > max_meta_description_length) meta_dsc = meta_dsc.sub(0, max_meta_description_length).get(); if (debug > 1) cout << "META Description: " << content << endl; retriever.got_meta_dsc((char*)meta_dsc); // // Now add the words to the word list // (slot 10 is the new slot for this) // int wordindex = 1; addString (retriever, content, wordindex, 10); // // can this be merged with Parser::addString ? // char *w = strtok(content, " \t\r"); // while (w) // { // if (strlen(w) >= minimum_word_length) // retriever.got_word(w, 1, 10); // w = strtok(0, " \t\r"); // } } } } else cerr<< "External parser error: expected metadata in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; } default: cerr<< "External parser error: unknown field in line "<<line<<"\n" << " URL: " << base.get() << "\n"; break; } } // while(readLine) if (get_file) { if (!canParse(convertToType) && mystrncasecmp((char*)convertToType, "text/", 5) != 0) { if (mystrcasecmp((char*)convertToType, "user-defined") == 0) cerr << "External parser error: no Content-Type given\n"; else cerr << "External parser error: can't parse Content-Type \"" << convertToType << "\"\n"; cerr << " URL: " << base.get() << "\n"; } else { char buffer[2048]; int length; int nbytes = config->Value("max_doc_size"); while (nbytes > 0 && (length = fread(buffer, 1, sizeof(buffer), input)) > 0) { nbytes -= length; if (nbytes < 0) length += nbytes; newcontent.append(buffer, length); } } } fclose(input); // close(stdout_pipe[0]); // This is closed for us by the fclose() int rpid, status; while ((rpid = wait(&status)) != fork_result && rpid != -1) ; unlink((char*)path); if (newcontent.length() > 0) { static HTML *html = 0; static Plaintext *plaintext = 0; Parsable *parsable = 0; contentType = convertToType; if (canParse(contentType)) { currentParser = ((String *)parsers->Find(contentType))->get(); parsable = this; } else if (mystrncasecmp((char*)contentType, "text/html", 9) == 0) { if (!html) html = new HTML(); parsable = html; } else if (mystrncasecmp((char*)contentType, "text/plain", 10) == 0) { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; } else { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; if (debug) cout << "External parser error: \"" << contentType << "\" not a recognized type. Assuming text/plain\n"; } parsable->setContents(newcontent.get(), newcontent.length()); parsable->parse(retriever, base); } #endif //ifndef _MSC_VER /* _WIN32 */ } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/ExternalParser.h����������������������������������������������������������������0100644�0063146�0012731�00000002503�10055635542�016577� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // ExternalParser.h // // ExternalParser: Allows external programs to parse unknown document formats. // The parser is expected to return the document in a // specific format. The format is documented // in http://www.htdig.org/attrs.html#external_parser // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: ExternalParser.h,v 1.8 2004/05/28 13:15:14 lha Exp $ // #ifndef _ExternalParser_h_ #define _ExternalParser_h_ #include "Parsable.h" #include "htString.h" #include <stdio.h> class URL; class ExternalParser : public Parsable { public: // // Construction/Destruction // ExternalParser(char *contentType); virtual ~ExternalParser(); // // Main parser interface. // virtual void parse(Retriever &retriever, URL &); // // Check if the given contentType has an external parser associated // with it // static int canParse(char *contentType); private: String currentParser; String contentType; int readLine(FILE *, String &); }; #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/ExternalTransport.cc������������������������������������������������������������0100644�0063146�0012731�00000023503�10055635542�017500� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // ExternalTransport.cc // // ExternalTransport: Allows external programs to retrieve given URLs with // unknown protocols. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: ExternalTransport.cc,v 1.9 2004/05/28 13:15:14 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "ExternalTransport.h" #include "htdig.h" #include "QuotedStringList.h" #include "URL.h" #include "Dictionary.h" #include "good_strtok.h" #include <ctype.h> #include <stdio.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #include <stdlib.h> #ifdef HAVE_WAIT_H #include <wait.h> #elif HAVE_SYS_WAIT_H #include <sys/wait.h> #endif #include "defaults.h" static Dictionary *handlers = 0; static Dictionary *toTypes = 0; extern String configFile; //***************************************************************************** // ExternalTransport::ExternalTransport(char *protocol) // ExternalTransport::ExternalTransport(const String &protocol) { if (canHandle(protocol)) { _Handler = ((String *)handlers->Find(protocol))->get(); } ExternalTransport::_Protocol = protocol; _Response = new ExternalTransport_Response; } //***************************************************************************** // ExternalTransport::~ExternalTransport() // ExternalTransport::~ExternalTransport() { if (_Response) { delete _Response; } } //***************************************************************************** // int ExternalTransport::canHandle(const String &protocol) // int ExternalTransport::canHandle(const String &protocol) { HtConfiguration* config= HtConfiguration::config(); if (!handlers) { handlers = new Dictionary(); toTypes = new Dictionary(); QuotedStringList qsl(config->Find("external_protocols"), " \t"); String from, to; int i; int sep; for (i = 0; qsl[i]; i += 2) { from = qsl[i]; to = ""; sep = from.indexOf("->"); if (sep != -1) { to = from.sub(sep+2).get(); from = from.sub(0, sep).get(); } // Recognise service specified as "https://" rather than "https" sep = from.indexOf(":"); if (sep != -1) from = from.sub(0, sep).get(); handlers->Add(from, new String(qsl[i + 1])); toTypes->Add(from, new String(to)); } } return handlers->Exists(protocol); } //***************************************************************************** // void ExternalTransport::SetConnection(URL *u) // void ExternalTransport::SetConnection (URL *u) { // Grab the actual URL to pass to the handler _URL = *u; // OK, now call the parent method to make sure everything else is set up. Transport::SetConnection (u->host(), u->port()); } //***************************************************************************** // DocStatus ExternalTransport::Request() // Transport::DocStatus ExternalTransport::Request() { // NEAL - ENABLE/REWRITE THIS ASAP FOR WIN32 #ifndef _MSC_VER /* _WIN32 */ // // Start the external handler, passing the protocol, URL and config file // as command arguments // StringList hargs(_Handler); char **handlargs = new char * [hargs.Count() + 5]; int argi; for (argi = 0; argi < hargs.Count(); argi++) handlargs[argi] = (char *)hargs[argi]; handlargs[argi++] = _Protocol.get(); handlargs[argi++] = (char *)_URL.get().get(); handlargs[argi++] = configFile.get(); handlargs[argi++] = 0; int stdout_pipe[2]; int fork_result = -1; int fork_try; if (pipe(stdout_pipe) == -1) { if (debug) cerr << "External transport error: Can't create pipe!" << endl; delete [] handlargs; return GetDocumentStatus(_Response); } for (fork_try = 4; --fork_try >= 0;) { fork_result = fork(); // Fork so we can execute in the child process if (fork_result != -1) break; if (fork_try) sleep(3); } if (fork_result == -1) { if (debug) cerr << "Fork Failure in ExternalTransport" << endl; delete [] handlargs; return GetDocumentStatus(_Response); } if (fork_result == 0) // Child process { close(STDOUT_FILENO); // Close handle STDOUT to replace with pipe dup(stdout_pipe[1]); close(stdout_pipe[0]); close(stdout_pipe[1]); // not really necessary, and may pose Cygwin incompatibility... //close(STDIN_FILENO); // Close STDIN to replace with null dev. //open("/dev/null", O_RDONLY); // Call External Transport Handler execv(handlargs[0], handlargs); exit(EXIT_FAILURE); } // Parent Process delete [] handlargs; close(stdout_pipe[1]); // Close STDOUT for writing FILE *input = fdopen(stdout_pipe[0], "r"); if (input == NULL) { if (debug) cerr << "Fdopen Failure in ExternalTransport" << endl; return GetDocumentStatus(_Response); } // Set up a response for this request _Response->Reset(); // We just accessed the document _Response->_access_time = new HtDateTime(); _Response->_access_time->SettoNow(); // OK, now parse the stuff we got back from the handler... String line; char *token1; int in_header = 1; while (in_header && readLine(input, line)) { line.chop('\r'); if (line.length() > 0 && debug > 2) cout << "Header line: " << line << endl; token1 = strtok(line, "\t"); if (token1 == NULL) { token1 = ""; in_header = 0; break; } switch (*token1) { case 's': // status code token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_status_code = atoi(token1); else cerr<< "External transport error: expected status code in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; case 'r': // status reason token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_reason_phrase = token1; else cerr<< "External transport error: expected status reason in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; case 'm': // modification time token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_modification_time= NewDate(token1); // Hopefully we can grok it... else cerr<< "External transport error: expected modification time in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; case 't': // Content-Type token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_content_type = token1; else cerr<< "External transport error: expected content-type in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; case 'l': // Content-Length token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_content_length = atoi(token1); else cerr<< "External transport error: expected content-length in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; case 'u': // redirect target token1 = strtok(0, "\t"); if (token1 != NULL) _Response->_location = token1; else cerr<< "External transport error: expected URL in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; default: cerr<< "External transport error: unknown field in line "<<line<<"\n" << " URL: " << _URL.get() << "\n"; break; } } // OK, now we read in the rest of the document as contents... _Response->_contents = 0; char docBuffer[8192]; int bytesRead; while ((bytesRead = fread(docBuffer, 1, sizeof(docBuffer), input)) > 0) { if (debug > 2) cout << "Read " << bytesRead << " from document\n"; if (_Response->_contents.length() + bytesRead > _max_document_size) bytesRead = _max_document_size - _Response->_contents.length(); _Response->_contents.append(docBuffer, bytesRead); if (_Response->_contents.length() >= _max_document_size) break; } _Response->_document_length = _Response->_contents.length(); fclose(input); // close(stdout_pipe[0]); // This is closed for us by the fclose() int rpid, status; while ((rpid = wait(&status)) != fork_result && rpid != -1) ; #endif return GetDocumentStatus(_Response); } //***************************************************************************** // private // DocStatus ExternalTransport::GetDocumentStatus(ExternalTransport_Response *r) // Transport::DocStatus ExternalTransport::GetDocumentStatus(ExternalTransport_Response *r) { // The default is 'not found' if we can't figure it out... DocStatus returnStatus = Document_not_found; int statuscode = r->GetStatusCode(); if (statuscode == 200) { returnStatus = Document_ok; // OK // Is it parsable? } else if (statuscode > 200 && statuscode < 300) returnStatus = Document_ok; // Successful 2xx else if (statuscode == 304) returnStatus = Document_not_changed; // Not modified else if (statuscode > 300 && statuscode < 400) returnStatus = Document_redirect; // Redirection 3xx else if (statuscode == 401) returnStatus = Document_not_authorized; // Unauthorized return returnStatus; } //***************************************************************************** // private // int ExternalTransport::readLine(FILE *in, String &line) // int ExternalTransport::readLine(FILE *in, String &line) { char buffer[2048]; int length; line = 0; while (fgets(buffer, sizeof(buffer), in)) { length = strlen(buffer); if (buffer[length - 1] == '\n') { // // A full line has been read. Return it. // line << buffer; line.chop('\n'); return 1; } else { // // Only a partial line was read. Append it to the line // and read some more. // line << buffer; } } return line.length() > 0; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/ExternalTransport.h�������������������������������������������������������������0100644�0063146�0012731�00000004367�10055635542�017351� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // ExternalTransport.h // // ExternalTransport: Allows external programs to retrieve given URLs with // unknown protocols. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: ExternalTransport.h,v 1.5 2004/05/28 13:15:14 lha Exp $ // #ifndef _ExternalTransport_h_ #define _ExternalTransport_h_ #include "Transport.h" #include "htString.h" #include <stdio.h> // First we must declare a derived Transport_Response class // This requires declaring the main class in advance class ExternalTransport; class ExternalTransport_Response : public Transport_Response { friend class ExternalTransport; // Nothing else... We just want it so we can access the protected fields }; // Right, now we get on with the show... class ExternalTransport : public Transport { public: // // Construction/Destruction // ExternalTransport(const String &protocol); virtual ~ExternalTransport(); // // Check if the given protocol has a handler // static int canHandle(const String &protocol); // Setting connections is obviously a bit different than the base class // from a URL pointer void SetConnection (URL *u); // from a URL object void SetConnection (URL &u) { SetConnection (&u); } // Make the request DocStatus Request(); // Get the response or the status Transport_Response *GetResponse() { return _Response; } DocStatus GetDocumentStatus() { return GetDocumentStatus(_Response); } private: // The command to handle the current protocol String _Handler; // And the current protocol String _Protocol; // The URL to Request() URL _URL; // The result of the Request() ExternalTransport_Response *_Response; // Private helper to read in the result from the handler int readLine(FILE *, String &); // Work out the DocStatus from the HTTP-style status codes DocStatus GetDocumentStatus(ExternalTransport_Response *r); }; #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/HTML.cc�������������������������������������������������������������������������0100644�0063146�0012731�00000063762�10061645146�014556� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HTML.cc // // HTML: Class to parse HTML documents and return useful information // to the Retriever // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HTML.cc,v 1.76 2004/06/09 17:35:34 grdetil Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htdig.h" #include "HTML.h" #include "HtSGMLCodec.h" #include "HtConfiguration.h" #include "StringMatch.h" #include "StringList.h" #include "QuotedStringList.h" #include "URL.h" #include "WordType.h" #include <ctype.h> #include "defaults.h" // Flags for noindex & nofollow, indicating who turned indexing off/on... #define TAGnoindex 0x0001 #define TAGstyle 0x0002 #define TAGscript 0x0004 #define TAGmeta_htdig_noindex 0x0008 #define TAGmeta_robots 0x0010 static StringMatch tags; static StringMatch nobreaktags; static StringMatch spacebeforetags; static StringMatch spaceaftertags; static StringMatch metadatetags; static StringMatch descriptionMatch; static StringMatch keywordsMatch; //static int keywordsCount; //static int max_keywords; //***************************************************************************** // ADDSPACE() macro, to insert space where needed in various strings // Reduces all multiple whitespace to a single space #define ADDSPACE(in_space) \ if (!in_space) \ { \ if (in_title && !noindex) \ { \ title << ' '; \ } \ if (in_ref && description.length() < max_description_length) \ { \ description << ' '; \ } \ if (head.length() < max_head_length && !noindex && !in_title) \ { \ head << ' '; \ } \ in_space = 1; \ } //***************************************************************************** // HTML::HTML() // HTML::HTML() : skip_start (HtConfiguration::config()->Find("noindex_start")," \t"), skip_end (HtConfiguration::config()->Find("noindex_end"), " \t") { HtConfiguration *config= HtConfiguration::config(); // // Initialize the patterns that we will try to match. // The tags Match object is used to match tag commands while // tags.IgnoreCase(); tags.Pattern("title|/title|a|/a|h1|h2|h3|h4|h5|h6|/h1|/h2|/h3|/h4|/h5|/h6|noindex|/noindex|img|li|meta|frame|area|base|embed|object|link|style|/style|script|/script"); // These tags don't cause a word break. They may also be in "tags" above, // except for the "a" tag, which must be handled as a special case. // Note that <sup> & <sub> should cause a word break. nobreaktags.IgnoreCase(); nobreaktags.Pattern("font|/font|em|/em|strong|/strong|i|/i|b|/b|u|/u|tt|/tt|abbr|/abbr|code|/code|q|/q|samp|/samp|kbd|/kbd|var|/var|dfn|/dfn|cite|/cite|blink|/blink|big|/big|small|/small|s|/s"); // These tags, which may also be in "tags" above, cause word breaks and // therefore cause space to be inserted before (or after) do_tag() is done. spacebeforetags.IgnoreCase(); spacebeforetags.Pattern("title|h1|h2|h3|h4|h5|h6|address|blockquote|noindex|img|li|th|td|dt|dd|p|br|hr|center|spacer"); spaceaftertags.IgnoreCase(); spaceaftertags.Pattern("/title|/h1|/h2|/h3|/h4|/h5|/h6|/address|/blockquote"); // These are the name values of meta tags that carry date information. metadatetags.IgnoreCase(); metadatetags.Pattern("date|dc.date|dc.date.created|dc.date.modified"); // These are the name values of meta tags that carry descriptions. StringList descrNames(config->Find("description_meta_tag_names"), " \t"); descriptionMatch.IgnoreCase(); descriptionMatch.Pattern(descrNames.Join('|')); // These are the name values of meta tags that carry keywords. StringList keywordNames(config->Find("keywords_meta_tag_names"), " \t"); keywordsMatch.IgnoreCase(); keywordsMatch.Pattern(keywordNames.Join('|')); // (now in Parser) // max_keywords = config->Value("max_keywords", -1); // if (max_keywords < 0) // max_keywords = (int) ((unsigned int) ~1 >> 1); // skip_start/end mark sections of text to be ignored by ht://Dig // Make sure there are equal numbers of each, and warn of deprecated // syntax. if (skip_start.Count() > 1 || skip_end.Count() > 1) { if (skip_start.Count() != 0 && skip_end.Count() != 0) { // check for old-style start/end which allowed unquoted spaces // (Check noindex_start/end for exactly one "<" or/followed-by // exactly one ">", and no leading quotes.) // Can someone think of a better (or simpler) check?? String noindex_end (config->Find ("noindex_end")); char *first_left = strchr (noindex_end.get(), '<'); char *secnd_left = first_left ? strchr(first_left+1,'<') : (char*)0; char *first_right= strchr (noindex_end.get(), '>'); char *secnd_right= first_right? strchr(first_right+1,'>'): (char*)0; String noindex_start (config->Find ("noindex_start")); char *first_lft = strchr (noindex_start.get(), '<'); char *secnd_lft = first_left ? strchr (first_lft +1,'<') : (char*)0; char *first_rght= strchr (noindex_start.get(), '>'); char *secnd_rght= first_right? strchr (first_rght+1,'>') : (char*)0; if (((first_right && !secnd_right && first_right < first_left) || (first_left && !secnd_left && !first_right) || (first_rght && !secnd_rght && first_rght < first_lft) || (first_lft && !secnd_lft && !first_rght)) && noindex_end[0] != '\"' && noindex_start[0] != '\"') { cout << "\nWarning: To allow multiple noindex_start/end patterns, patterns containing\nspaces should now be in quotation marks. (If the entries are indended to be\nmultiple patterns, this warning can be suppressed by placing the first pattern\nin quotes.)\n\n"; // Should we treat the patterns as if they had been quoted // (as we assume was intended)? } } } // check each start has an end if (skip_start.Count() < skip_end.Count()) { cout << "Warning: " << skip_end.Count() << " noindex_end patterns, but only " << skip_start.Count() << " noindex_start patterns.\n"; } else { while (skip_start.Count () > skip_end.Count()) { int missing = skip_end.Count() - 1; skip_end.Add ((missing >= 0) ? skip_end [missing] : "<!--/htdig_noindex-->"); cout << "Warning: Copying " << skip_end [missing+1] << " as noindex_end match for " << skip_start [missing+1] << endl; } } word = 0; href = 0; title = 0; description = 0; head = 0; meta_dsc = 0; tag = 0; in_title = 0; in_ref = 0; in_heading = 0; base = 0; noindex = 0; nofollow = 0; // minimumWordLength = config->Value("minimum_word_length", 3); } //***************************************************************************** // HTML::~HTML() // HTML::~HTML() { } //***************************************************************************** // void HTML::parse(Retriever &retriever, URL &baseURL) // Parse the HTML document using the Retriever object for all the callbacks. // The HTML document contents are contained in the contents String. // void HTML::parse(Retriever &retriever, URL &baseURL) { if (contents == 0 || contents->length() == 0) return; base = &baseURL; // // We have some variables which will contain the various items we // are looking for // int wordindex = 1; int in_space; int in_punct; String scratch, textified; unsigned char *q, *start; unsigned char *position = (unsigned char *) contents->get(); unsigned char *text = (unsigned char *)new char[contents->length()+1]; unsigned char *ptext = text; keywordsCount = 0; title = 0; head = 0; meta_dsc = 0; noindex = 0; nofollow = 0; in_heading = 0; in_title = 0; in_ref = 0; in_space = 0; in_punct = 0; while (*position) { // // Filter out section marked to be ignored for indexing. // This can contain any HTML. // On finding a noindex_start, skip to first occurrence of matching // noindex_end. Any noindex_start within will be ignored. // int i; for (i = 0; i < skip_start.Count(); i++) { if (mystrncasecmp((char *)position, skip_start[i], ((String*)skip_start.Nth(i))->length()) == 0) break; // break from this loop for "continue" below... } if (i < skip_start.Count()) // found a match; { q = (unsigned char*)mystrcasestr((char *)position, skip_end[i]); if (!q) *position = '\0'; // Rest of document will be skipped... else position = q + ((String*)skip_end.Nth(i))->length(); continue; } // end of noindex_start/end code if (strncmp((char *)position, "<!", 2) == 0) { // // Possible comment declaration (but could be DTD declaration!) // A comment can contain other '<' and '>': // we have to ignore complete comment declarations // but of course also DTD declarations. // position += 2; // Get past declaration start if (strncmp((char *)position, "--", 2) == 0) { // Found start of comment - now find the end position += 2; do { q = (unsigned char*)strstr((char *)position, "--"); if (!q) { *position = '\0'; break; // Rest of document seems to be a comment... } else { position = q + 2; // Skip extra dashes after a badly formed comment while (*position == '-') position++; // Skip whitespace after an individual comment while (isspace(*position)) position++; } // if comment declaration hasn't ended, skip another comment } while (*position && *position != '>'); if (*position == '>') { position++; // End of comment declaration } } else { // Not a comment declaration after all // but possibly DTD: get to the end q = (unsigned char*)strchr((char *)position, '>'); if (q) { position = q + 1; // End of (whatever) declaration } else { *position = '\0'; // Rest of document is DTD? } } continue; } if (*position == '<') { // // Start of a tag. Since tags cannot be nested, we can simply // search for the closing '>' // q = (unsigned char*)strchr((char *)position, '>'); if (q) { // copy tag while (position <= q) *ptext++ = *position++; } else { // copy rest of text, as tag does not end while (*position) *ptext++ = *position++; } } else if (*position == '&') { q = (unsigned char*)strchr((char *)position, ';'); if (q && q <= position+10) { // got ending, looks like valid SGML entity scratch = 0; scratch.append((char*)position, q+1 - position); textified = HtSGMLCodec::instance()->encode(scratch); if (textified[0] != '&' || textified.length() == 1) { // it was decoded, copy it position = (unsigned char *)textified.get(); while (*position) { if (*position == '<') { // got a decoded <, make a fake tag for it // to avoid confusing it with real tag start *ptext++ = '<'; *ptext++ = '~'; *ptext++ = '>'; position++; } else *ptext++ = *position++; } position = q+1; } else // it wasn't decoded, copy '&', and rest will follow *ptext++ = *position++; } else // not SGML entity, copy bare '&' *ptext++ = *position++; } else { *ptext++ = *position++; } } *ptext++ = '\0'; position = text; start = position; while (*position) { if (*position == '<' && (position[1] != '~' || position[2] != '>')) { // // Start of a tag. Since tags cannot be nested, we can simply // search for the closing '>' // q = (unsigned char*)strchr((char *)position, '>'); if (!q) break; // Syntax error in the doc. Tag never ends. position++; if (noindex & TAGscript) { // Special handling in case '<' is part of JavaScript code while (isspace(*position)) position++; if (mystrncasecmp((char *)position, "/script", 7) != 0) continue; } tag = 0; tag.append((char*)position, q - position); while (isspace(*position)) position++; if (!in_space && spacebeforetags.CompareWord((char *)position) || !in_space && !in_punct && *position != '/') { // These opening tags cause a space to be inserted // before anything they insert. // Tags processed here (i.e. not in nobreaktags), like <a ...> // tag, are a special case: they don't actually add space in // formatted text, but because in our processing it causes // a word break, we avoid word concatenation in "head" string. ADDSPACE(in_space); in_punct = 0; } do_tag(retriever, tag); if (!in_space && spaceaftertags.CompareWord((char *)position)) { // These closing tags cause a space to be inserted // after anything they insert. ADDSPACE(in_space); in_punct = 0; } position = q+1; } else if (*position > 0 && HtIsStrictWordChar(*position)) { // // Start of a word. Try to find the whole thing // word = 0; in_space = 0; in_punct = 0; while (*position && HtIsWordChar(*position)) { word << (char)*position; // handle case where '<' is in extra_word_characters... if (strncmp((char *)position, "<~>", 3) == 0) position += 2; // skip over fake tag for decoded '<' position++; if (*position == '<') { q = position+1; while (isspace(*q)) q++; // Does this tag cause a word break? if (nobreaktags.CompareWord((char *)q)) { // These tags just change character formatting and // don't break words. q = (unsigned char*)strchr((char *)position, '>'); if (q) { position++; tag = 0; tag.append((char*)position, q - position); do_tag(retriever, tag); position = q+1; } } } } if (in_title && !noindex) { title << word; } if (in_ref) { if (description.length() < max_description_length) { description << word; } else { description << " ..."; if (!nofollow) retriever.got_href(*href, (char*)description); in_ref = 0; description = 0; } } if (head.length() < max_head_length && !noindex && !in_title) { // // Capitalize H1 and H2 blocks // if (in_heading > 1 && in_heading < 4) { word.uppercase(); } // // Append the word to the head (excerpt) // head << word; } if (word.length() >= (int)minimum_word_length && !noindex) { retriever.got_word((char*)word, wordindex++, in_heading); } } else { // // Characters that are not part of a word // if (isspace(*position)) { ADDSPACE(in_space); in_punct = 0; } else { // // Not whitespace // if (head.length() < max_head_length && !noindex && !in_title) { // We don't want to add random chars to the // excerpt if we're in the title. head << *position; } if (in_ref && description.length() < max_description_length) { description << *position; } if (in_title && !noindex) { title << *position; } in_space = 0; in_punct = 1; // handle normal case where decoded '<' is punctuation... if (strncmp((char *)position, "<~>", 3) == 0) position += 2; // skip over fake tag for decoded '<' } position++; } } retriever.got_head((char*)head); delete [] text; } //***************************************************************************** // void HTML::do_tag(Retriever &retriever, String &tag) // void HTML::do_tag(Retriever &retriever, String &tag) { HtConfiguration* config= HtConfiguration::config(); int wordindex = 1; char *position = tag.get(); int which, length; static int ignore_alt_text = config->Boolean("ignore_alt_text", 0); while (isspace(*position)) position++; which = -1; if (tags.CompareWord(position, which, length) < 0) return; // Nothing matched. // Use the configuration code to match attributes as key-value pairs HtConfiguration attrs; attrs.NameValueSeparators("="); attrs.Add(position); if (debug > 3) cout << "Tag: <" << tag << ">, matched " << which << endl; switch (which) { case 0: // "title" if (title.length()) { if (debug) cout << "More than one <title> tag in document!" << " (possible search engine spamming)" << endl; break; } in_title = 1; in_heading = 1; break; case 1: // "/title" if (!in_title) break; in_title = 0; in_heading = 0; retriever.got_title((char*)title); break; case 2: // "a" { if (!attrs["href"].empty()) { // // a href seen // if (in_ref) { if (debug > 1) cout << "Terminating previous <a href=...> tag," << " which didn't have a closing </a> tag." << endl; if (!nofollow) retriever.got_href(*href, (char*)description); in_ref = 0; } if (href) delete href; href = new URL(transSGML(attrs["href"]), *base); in_ref = 1; description = 0; break; } if (!attrs["title"].empty() && !attrs["href"].empty()) { // // a title seen for href // retriever.got_href(*href, transSGML(attrs["title"])); } if (!attrs["name"].empty()) { // // a name seen // retriever.got_anchor(transSGML(attrs["name"])); } break; } case 3: // "/a" if (in_ref) { if (!nofollow) retriever.got_href(*href, (char*)description); in_ref = 0; } break; case 4: // "h1" in_heading = 2; break; case 5: // "h2" in_heading = 3; break; case 6: // "h3" in_heading = 4; break; case 7: // "h4" in_heading = 5; break; case 8: // "h5" in_heading = 6; break; case 9: // "h6" in_heading = 7; break; case 10: // "/h1" case 11: // "/h2" case 12: // "/h3" case 13: // "/h4" case 14: // "/h5" case 15: // "/h6" in_heading = 0; break; case 16: // "noindex" noindex |= TAGnoindex; nofollow |= TAGnoindex; if (!attrs["follow"].empty()) nofollow &= ~TAGnoindex; break; case 27: // "style" noindex |= TAGstyle; nofollow |= TAGstyle; break; case 29: // "script" noindex |= TAGscript; nofollow |= TAGscript; break; case 17: // "/noindex" noindex &= ~TAGnoindex; nofollow &= ~TAGnoindex; break; case 28: // "/style" noindex &= ~TAGstyle; nofollow &= ~TAGstyle; break; case 30: // "/script" noindex &= ~TAGscript; nofollow &= ~TAGscript; break; case 19: // "li" if (!noindex && !in_title && head.length() < max_head_length) head << "* "; break; case 20: // "meta" { // // First test for old-style meta tags (these break any // reasonable DTD...) // if (!attrs["htdig-noindex"].empty()) { retriever.got_noindex(); noindex |= TAGmeta_htdig_noindex; nofollow |= TAGmeta_htdig_noindex; } if (!attrs["htdig-index"].empty()) { noindex &= ~TAGmeta_htdig_noindex; nofollow &= ~TAGmeta_htdig_noindex; } if (!attrs["htdig-email"].empty()) retriever.got_meta_email(transSGML(attrs["htdig-email"])); if (!attrs["htdig-notification-date"].empty()) retriever.got_meta_notification(transSGML(attrs["htdig-notification-date"])); if (!attrs["htdig-email-subject"].empty()) retriever.got_meta_subject(transSGML(attrs["htdig-email-subject"])); if (!attrs["htdig-keywords"].empty() || !attrs["keywords"].empty()) { // // Keywords are added as being at the very top of the // document and have a weight factor of // keywords-factor which is assigned to slot 9 in the // factor table. // const String keywords = attrs["htdig-keywords"].empty() ? attrs["htdig-keywords"] : attrs["keywords"]; if (!noindex) { String tmp = transSGML(keywords); addKeywordString (retriever, tmp, wordindex); } } if (!attrs["http-equiv"].empty()) { // <META HTTP-EQUIV=REFRESH case if (mystrcasecmp(attrs["http-equiv"], "refresh") == 0 && !attrs["content"].empty()) { String content = attrs["content"]; char *q = (char*)mystrcasestr((char*)content, "url"); if (q && *q) { q += 3; // skiping "URL" while (*q && ((*q == '=') || isspace(*q))) q++; char *qq = q; while (*qq && (*qq != ';') && (*qq != '"') && !isspace(*qq))qq++; *qq = 0; if (href) delete href; href = new URL(transSGML(q), *base); // I don't know why anyone would do this, but hey... if (!nofollow) retriever.got_href(*href, ""); } } } // // Now check for <meta name=... content=...> tags that // fly with any reasonable DTD out there // if (!attrs["name"].empty() && !attrs["content"].empty()) { const String cache = attrs["name"]; // First of all, check for META description if (descriptionMatch.CompareWord(cache) && !attrs["content"].empty()) { // // We need to do two things. First grab the description // and clean it up // meta_dsc = transSGML(attrs["content"]); meta_dsc.replace('\n', ' '); meta_dsc.replace('\r', ' '); meta_dsc.replace('\t', ' '); if (meta_dsc.length() > max_meta_description_length) meta_dsc = meta_dsc.sub(0, max_meta_description_length).get(); if (debug > 1) cout << "META Description: " << attrs["content"] << endl; retriever.got_meta_dsc((char*)meta_dsc); // // Now add the words to the word list // Slot 10 is the current slot for this // if (!noindex) { String tmp = transSGML(attrs["content"]); addString (retriever, tmp, wordindex, 10); } } if (keywordsMatch.CompareWord(cache) && !noindex) { String tmp = transSGML(attrs["content"]); addKeywordString (retriever, tmp, wordindex); } else if (mystrcasecmp(cache, "author") == 0) { String author = transSGML(attrs["content"]); retriever.got_author(author.get()); if (!noindex) addString (retriever, author, wordindex, 11); } else if (mystrcasecmp(cache, "htdig-email") == 0) { retriever.got_meta_email(transSGML(attrs["content"])); } else if (metadatetags.CompareWord(cache, which, length) && (cache.get())[length] == '\0' && config->Boolean("use_doc_date",0)) { retriever.got_time(transSGML(attrs["content"])); } else if (mystrcasecmp(cache, "htdig-notification-date") == 0) { retriever.got_meta_notification(transSGML(attrs["content"])); } else if (mystrcasecmp(cache, "htdig-email-subject") == 0) { retriever.got_meta_subject(transSGML(attrs["content"])); } else if (mystrcasecmp(cache, "htdig-noindex") == 0) { retriever.got_noindex(); noindex |= TAGmeta_htdig_noindex; nofollow |= TAGmeta_htdig_noindex; } else if (mystrcasecmp(cache, "robots") == 0 && !attrs["content"].empty()) { String content_cache = attrs["content"]; content_cache.lowercase(); if (content_cache.indexOf("noindex") != -1) { noindex |= TAGmeta_robots; retriever.got_noindex(); } if (content_cache.indexOf("nofollow") != -1) nofollow |= TAGmeta_robots; if (content_cache.indexOf("none") != -1) { noindex |= TAGmeta_robots; nofollow |= TAGmeta_robots; retriever.got_noindex(); } } } else if (mystrcasecmp(attrs["name"], "htdig-noindex") == 0) { retriever.got_noindex(); noindex |= TAGmeta_htdig_noindex; nofollow |= TAGmeta_htdig_noindex; } break; } case 21: // frame case 24: // embed { if (!attrs["src"].empty()) { // // src seen // if (!nofollow) { if (href) delete href; href = new URL(transSGML(attrs["src"]), *base); // Frames have the same hopcount as the parent. retriever.got_href(*href, transSGML(attrs["title"]), 0); in_ref = 0; } } break; } case 25: // object { if (!attrs["data"].empty()) { // // data seen // if (!nofollow) { if (href) delete href; href = new URL(transSGML(attrs["data"]), *base); // Assume objects have the same hopcount as the parent. retriever.got_href(*href, transSGML(attrs["title"]), 0); in_ref = 0; } } break; } case 22: // area case 26: // link { if (!attrs["href"].empty()) { // href seen if (!nofollow) { if (href) delete href; href = new URL(transSGML(attrs["href"]), *base); // area & link are like anchor tags -- one hopcount! retriever.got_href(*href, transSGML(attrs["title"]), 1); in_ref = 0; } } break; } case 23: // base { if (!attrs["href"].empty()) { URL tempBase(transSGML(attrs["href"])); *base = tempBase; } break; } case 18: // img { if (!ignore_alt_text && !attrs["alt"].empty()) { String tmp = transSGML(attrs["alt"]); if (!noindex && in_title) title << tmp << " "; if (in_ref && description.length() < max_description_length) description << tmp << " "; if (!noindex && !in_title && head.length() < max_head_length) head << tmp << " "; if (!noindex) addString (retriever, tmp, wordindex, 8); // slot for img_alt } if (!attrs["src"].empty()) { retriever.got_image(transSGML(attrs["src"])); } break; } default: return; // Nothing... } } //***************************************************************************** // const String HTML::transSGML(const String& str) // const String HTML::transSGML(const String& str) { return HtSGMLCodec::instance()->encode(str); } ��������������htdig-3.2.0b6/htdig/HTML.h��������������������������������������������������������������������������0100644�0063146�0012731�00000002544�10055635543�014412� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // HTML.h // // HTML: Class to parse HTML documents and return useful information // to the Retriever // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: HTML.h,v 1.14 2004/05/28 13:15:15 lha Exp $ // #ifndef _HTML_h_ #define _HTML_h_ #include "Parsable.h" #include "QuotedStringList.h" class Retriever; class URL; class HTML : public Parsable { public: // // Construction/Destruction // HTML(); virtual ~HTML(); // // Main parser interface. // virtual void parse(Retriever &retriever, URL &baseURL); private: // // Our state variables // String word; URL *href; String title; String description; String head; String meta_dsc; String tag; int in_title; int in_ref; int in_heading; int noindex; int nofollow; // unsigned int minimumWordLength; URL *base; QuotedStringList skip_start; QuotedStringList skip_end; // // Helper functions // void do_tag(Retriever &, String &); const String transSGML(const String& str); }; #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Makefile.am���������������������������������������������������������������������0100644�0063146�0012731�00000000707�07723256616�015540� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ include $(top_srcdir)/Makefile.config bin_PROGRAMS = htdig htdig_SOURCES = Document.cc HTML.cc \ Parsable.cc Plaintext.cc \ Retriever.cc Server.cc ExternalTransport.cc \ URLRef.cc htdig.cc ExternalParser.cc noinst_HEADERS = Document.h ExternalParser.h HTML.h \ Parsable.h Plaintext.h Retriever.h Server.h URLRef.h htdig.h \ ExternalTransport.h htdig_DEPENDENCIES = $(HTLIBS) htdig_LDFLAGS = $(PROFILING) ${extra_ldflags} htdig_LDADD = $(HTLIBS) ���������������������������������������������������������htdig-3.2.0b6/htdig/Makefile.in���������������������������������������������������������������������0100644�0063146�0012731�00000032742�10063260372�015536� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la bin_PROGRAMS = htdig htdig_SOURCES = Document.cc HTML.cc \ Parsable.cc Plaintext.cc \ Retriever.cc Server.cc ExternalTransport.cc \ URLRef.cc htdig.cc ExternalParser.cc noinst_HEADERS = Document.h ExternalParser.h HTML.h \ Parsable.h Plaintext.h Retriever.h Server.h URLRef.h htdig.h \ ExternalTransport.h htdig_DEPENDENCIES = $(HTLIBS) htdig_LDFLAGS = $(PROFILING) ${extra_ldflags} htdig_LDADD = $(HTLIBS) subdir = htdig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = htdig$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_htdig_OBJECTS = Document.$(OBJEXT) HTML.$(OBJEXT) Parsable.$(OBJEXT) \ Plaintext.$(OBJEXT) Retriever.$(OBJEXT) Server.$(OBJEXT) \ ExternalTransport.$(OBJEXT) URLRef.$(OBJEXT) htdig.$(OBJEXT) \ ExternalParser.$(OBJEXT) htdig_OBJECTS = $(am_htdig_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(htdig_SOURCES) HEADERS = $(noinst_HEADERS) DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am SOURCES = $(htdig_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htdig/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done htdig$(EXEEXT): $(htdig_OBJECTS) $(htdig_DEPENDENCIES) @rm -f htdig$(EXEEXT) $(CXXLINK) $(htdig_LDFLAGS) $(htdig_OBJECTS) $(htdig_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am # 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: ������������������������������htdig-3.2.0b6/htdig/Makefile.win32������������������������������������������������������������������0100644�0063146�0012731�00000001671�07677124212�016100� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Makefile - makefile for rightnow # APP_NAME = Right Now Web CGI RNT_PRODUCT = rnw TARGET = $(BINDIR)/htdig$(EXESFX) include ../Makedefs.win32 # ----------------------------------------------------------------------------- # add new executable members to this list CXXSRC = Document.cc HTML.cc Parsable.cc Plaintext.cc Retriever.cc \ Server.cc ExternalTransport.cc URLRef.cc htdig.cc ExternalParser.cc CPPFLAGS += -I. -I../include -I../htlib -I../htcommon -I../htword -I../db -I../htnet LDLIBS = ../lib/$(ARCH)/libhtnet.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libhtdb.lib OTHERLIBS = ws2_32.lib L:/win32/lib/zlib114/zlib.lib DEPLIBS += $(LDLIBS) $(TARGET): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS) $(LDLIBS) $(OTHERLIBS) include ../Makerules.win32 �����������������������������������������������������������������������htdig-3.2.0b6/htdig/Parsable.cc���������������������������������������������������������������������0100644�0063146�0012731�00000005326�10055635543�015536� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Parsable.cc // // Parsable: Base class for file parsers (HTML, PDF, ExternalParser ...) // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Parsable.cc,v 1.9 2004/05/28 13:15:15 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Parsable.h" #include "htdig.h" #include "defaults.h" //***************************************************************************** // Parsable::Parsable() // Parsable::Parsable() { HtConfiguration* config= HtConfiguration::config(); contents = 0; max_head_length = config->Value("max_head_length", 0); max_description_length = config->Value("max_description_length", 50); max_meta_description_length = config->Value("max_meta_description_length", 0); max_keywords = config->Value("max_keywords", -1); if (max_keywords < 0) max_keywords = (int) ((unsigned int) ~1 >> 1); minimum_word_length = config->Value("minimum_word_length", 3); } //***************************************************************************** // Parsable::~Parsable() // Parsable::~Parsable() { delete contents; } //***************************************************************************** // void Parsable::setContents(char *data, int length) // This will set the contents of the parsable object. // void Parsable::setContents(char *data, int length) { delete contents; contents = new String(data, length); } //***************************************************************************** // void Parsable::addString(char *s, int& wordindex, int slot) // Add all words in string s in "heading level" slot, incrementing wordindex // along the way. String s is corrupted. // void Parsable::addString(Retriever& retriever, char *s, int& wordindex, int slot) { char *w = HtWordToken(s); while (w) { if (strlen(w) >= minimum_word_length) retriever.got_word(w, wordindex++, slot); // slot for img_alt w = HtWordToken(0); } w = '\0'; } //***************************************************************************** // void Parsable::addKeywordString(char *s, int& wordindex) // Add all words in string s as keywords, incrementing wordindex // along the way. String s is corrupted. // void Parsable::addKeywordString(Retriever& retriever, char *s, int& wordindex) { char *w = HtWordToken(s); while (w) { if (strlen(w) >= minimum_word_length && ++keywordsCount <= max_keywords) retriever.got_word(w, wordindex++, 9); w = HtWordToken(0); } w = '\0'; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Parsable.h����������������������������������������������������������������������0100644�0063146�0012731�00000002464�10055635543�015400� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Parsable.h // // Parsable: Base class for file parsers (HTML, PDF, ExternalParser ...) // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Parsable.h,v 1.10 2004/05/28 13:15:15 lha Exp $ // #ifndef _Parsable_h_ #define _Parsable_h_ #include "htString.h" #include "Retriever.h" class URL; class Parsable { public: // // Construction/Destruction // Parsable(); virtual ~Parsable(); // // Main parser interface. // virtual void parse(Retriever &retriever, URL &) = 0; // // The rest of the members are used by the Document to provide us // the data that we contain. // virtual void setContents(char *data, int length); void addString(Retriever& retriever, char *s, int& wordindex, int slot); void addKeywordString(Retriever& retriever, char *s, int& wordindex); protected: String *contents; int max_head_length; int max_description_length; int max_meta_description_length; int max_keywords, keywordsCount; unsigned int minimum_word_length; }; #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Plaintext.cc��������������������������������������������������������������������0100644�0063146�0012731�00000004445�10055635543�015756� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Plaintext.cc // // Plaintext: Parses plaintext files. Not much to do, really. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Plaintext.cc,v 1.20 2004/05/28 13:15:15 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Plaintext.h" #include "htdig.h" #include "htString.h" #include "WordType.h" #include <ctype.h> #include "defaults.h" //***************************************************************************** // Plaintext::Plaintext() // Plaintext::Plaintext() { } //***************************************************************************** // Plaintext::~Plaintext() // Plaintext::~Plaintext() { } //***************************************************************************** // void Plaintext::parse(Retriever &retriever, URL &) // void Plaintext::parse(Retriever &retriever, URL &) { if (contents == 0 || contents->length() == 0) return; HtConfiguration* config= HtConfiguration::config(); unsigned char *position = (unsigned char *) contents->get(); static int minimumWordLength = config->Value("minimum_word_length", 3); int wordIndex = 1; int in_space = 0; String word; String head; while (*position) { word = 0; if (HtIsStrictWordChar(*position)) { // // Start of a word. Try to find the whole thing // in_space = 0; while (*position && HtIsWordChar(*position)) { word << *position; position++; } if (head.length() < max_head_length) { head << word; } if (word.length() >= minimumWordLength) { retriever.got_word((char*)word, wordIndex++, 0); } } if (head.length() < max_head_length) { // // Characters that are not part of a word // if (*position && isspace(*position)) { // // Reduce all multiple whitespace to a single space // if (!in_space) { head << ' '; } in_space = 1; } else { head << *position; in_space = 0; } } if (*position) position++; } retriever.got_head((char*)head); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Plaintext.h���������������������������������������������������������������������0100644�0063146�0012731�00000001427�10055635543�015615� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Plaintext.h // // Plaintext: Parses plaintext files. Not much to do, really. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Plaintext.h,v 1.6 2004/05/28 13:15:15 lha Exp $ // #ifndef _Plaintext_h_ #define _Plaintext_h_ #include "Parsable.h" class URL; class Plaintext : public Parsable { public: // // Construction/Destruction // Plaintext(); virtual ~Plaintext(); // // Main parser interface. // virtual void parse(Retriever &retriever, URL &); private: }; #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Retriever.cc��������������������������������������������������������������������0100644�0063146�0012731�00000141107�10055635543�015752� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Retriever.cc // // Retriever: Crawl from a list of URLs and calls appropriate parsers. The // parser notifies the Retriever object that it got something // (got_* functions) and the Retriever object feed the databases // and statistics accordingly. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Retriever.cc,v 1.94 2004/05/28 13:15:15 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef _MSC_VER /* _WIN32 */ # include <sys/types.h> # include <winsock2.h> #endif #include "Retriever.h" #include "htdig.h" #include "HtWordList.h" #include "WordRecord.h" #include "URLRef.h" #include "Server.h" #include "Parsable.h" #include "Document.h" #include "StringList.h" #include "WordType.h" #include "Transport.h" #include "HtHTTP.h" // For HTTP statistics #include "md5.h" #include "defaults.h" #ifndef _MSC_VER /* _WIN32 */ #include <pwd.h> #endif #include <signal.h> #include <stdio.h> static int noSignal; // no_store_phrases: // If true, only store first occurrence of each word in a document static bool no_store_phrases; //***************************************************************************** // Retriever::Retriever() // Retriever::Retriever(RetrieverLog flags): words(*(HtConfiguration::config())), words_to_add (100, 0.75) { HtConfiguration *config = HtConfiguration::config(); FILE *urls_parsed; currenthopcount = 0; max_hop_count = config->Value("max_hop_count", 999999); no_store_phrases = !config->Boolean("store_phrases"); // // Initialize the flags for the various HTML factors // // text_factor factor[0] = FLAG_TEXT; // title_factor factor[1] = FLAG_TITLE; // heading factor (now generic) factor[2] = FLAG_HEADING; factor[3] = FLAG_HEADING; factor[4] = FLAG_HEADING; factor[5] = FLAG_HEADING; factor[6] = FLAG_HEADING; factor[7] = FLAG_HEADING; // img alt text //factor[8] = FLAG_KEYWORDS; factor[8] = FLAG_TEXT; // treat alt text as plain text, until it has // its own FLAG and factor. // keywords factor factor[9] = FLAG_KEYWORDS; // META description factor factor[10] = FLAG_DESCRIPTION; factor[11] = FLAG_AUTHOR; doc = new Document(); minimumWordLength = config->Value("minimum_word_length", 3); log = flags; // if in restart mode if (Retriever_noLog != log) { String filelog = config->Find("url_log"); char buffer[1024]; int l; urls_parsed = fopen((char *) filelog, "r"); if (urls_parsed != 0) { // read all url discovered but not fetched before while (fgets(buffer, sizeof(buffer), urls_parsed)) { l = strlen(buffer); buffer[l - 1] = 0; Initial(buffer, 2); } fclose(urls_parsed); } unlink((char *) filelog); } check_unique_md5 = config->Boolean("check_unique_md5", 0); check_unique_date = config->Boolean("check_unique_date", 0); d_md5 = 0; if (check_unique_md5) { d_md5 = Database::getDatabaseInstance(DB_HASH); if (d_md5->OpenReadWrite(config->Find("md5_db"), 0666) != OK) { cerr << "DocumentDB::Open: " << config->Find("md5_db") << " " << strerror(errno) << "\n"; } } } //***************************************************************************** // Retriever::~Retriever() // Retriever::~Retriever() { if (d_md5) d_md5->Close(); delete doc; } //***************************************************************************** // void Retriever::setUsernamePassword(char *credentials) // void Retriever::setUsernamePassword(const char *credentials) { doc->setUsernamePassword(credentials); } //***************************************************************************** // void Retriever::Initial(char *list, int from) // Add a single URL to the list of URLs to visit. // Since URLs are stored on a per server basis, we first need to find the // the correct server to add the URL's path to. // // from == 0 urls in db.docs and no db.log // from == 1 urls in start_url add url only if not already in the list // from == 2 add url from db.log // from == 3 urls in db.docs and there was a db.log // void Retriever::Initial(const String & list, int from) { // // Split the list of urls up into individual urls. // StringList tokens(list, " \t"); String sig; String url; Server *server; for (int i = 0; i < tokens.Count(); i++) { URL u(tokens[i]); url = u.get(); // get before u.signature() resolves aliases server = (Server *) servers[u.signature()]; if (debug > 2) cout << "\t" << from << ":" << (int) log << ":" << url; if (!server) { String robotsURL = u.signature(); robotsURL << "robots.txt"; StringList *localRobotsFile = GetLocal(robotsURL); server = new Server(u, localRobotsFile); servers.Add(u.signature(), server); delete localRobotsFile; } if (from && visited.Exists(url)) { if (debug > 2) cout << " skipped" << endl; continue; } else if (IsValidURL(url) != 1) { if (debug > 2) cout << endl; continue; } if (Retriever_noLog == log || from != 3) { if (debug > 2) cout << " pushed"; server->push(u.get(), 0, 0, IsLocalURL(url.get())); } if (debug > 2) cout << endl; visited.Add(url, 0); } } //***************************************************************************** // void Retriever::Initial(List &list, int from) // void Retriever::Initial(List & list, int from) { list.Start_Get(); String *str; // from == 0 is an optimisation for pushing url in update mode // assuming that // 1) there's many more urls in docdb // 2) they're pushed first // 3) there's no duplicate url in docdb // then they don't need to be check against already pushed urls // But 2) can be false with -l option // // FIXME it's nasty, what have to be test is : // we have urls to push from db.docs but do we already have them in // db.log? For this it's using a side effect with 'visited' and that // urls in db.docs are only pushed via this method, and that db.log are pushed // first, db.docs second, start_urls third! // if (!from && visited.Count()) { from = 3; } while ((str = (String *) list.Get_Next())) { Initial(str->get(), from); } } //***************************************************************************** // static void sigexit(int) { noSignal = 0; //don't exit here.. just set the flag. } static void sigpipe(int) { } //***************************************************************************** // static void sig_handlers // initialise signal handlers // static void sig_handlers(void) { #ifndef _MSC_VER /* _WIN32 */ //POSIX SIGNALS struct sigaction action; /* SIGINT, SIGQUIT, SIGTERM */ action.sa_handler = sigexit; sigemptyset(&action.sa_mask); action.sa_flags = 0; if (sigaction(SIGINT, &action, NULL) != 0) reportError("Cannot install SIGINT handler\n"); if (sigaction(SIGQUIT, &action, NULL) != 0) reportError("Cannot install SIGQUIT handler\n"); if (sigaction(SIGTERM, &action, NULL) != 0) reportError("Cannot install SIGTERM handler\n"); if (sigaction(SIGHUP, &action, NULL) != 0) reportError("Cannot install SIGHUP handler\n"); #else //ANSI C signal handling - Limited to supported Windows signals. signal(SIGINT, sigexit); signal(SIGTERM, sigexit); #endif //_MSC_VER /* _WIN32 */ } static void sig_phandler(void) { #ifndef _MSC_VER /* _WIN32 */ struct sigaction action; sigemptyset(&action.sa_mask); action.sa_handler = sigpipe; action.sa_flags = SA_RESTART; if (sigaction(SIGPIPE, &action, NULL) != 0) reportError("Cannot install SIGPIPE handler\n"); #endif //_MSC_VER /* _WIN32 */ } //***************************************************************************** // static void win32_check_messages // Check WIN32 messages! // #ifdef _MSC_VER /* _WIN32 */ static void win32_check_messages(void) { // NEAL - NEEDS FINISHING/TESTING #if 0 MSG msg = {0, 0, 0, 0}; int cDown = 0; int controlDown = 0; if( GetMessage(&msg, 0, 0, 0) ) { switch(msg.message) { case WM_KEYDOWN: { if(LOWORD(msg.message)== 17) controlDown = 1; else if(LOWORD(msg.message) == 67) { cDown = 1; } } break; case WM_KEYUP: { if(LOWORD(msg.message) == 17) controlDown = 0; else if(LOWORD(msg.message) == 67) cDown = 0; } break; } } DispatchMessage(&msg); #endif } #endif //_MSC_VER /* _WIN32 */ //***************************************************************************** // void Retriever::Start() // This is the main loop of the retriever. We will go through the // list of paths stored for each server. While parsing the // retrieved documents, new paths will be added to the servers. We // return if no more paths need to be retrieved. // void Retriever::Start() { // // Main digger loop. The todo list should initialy have the start // URL and all the URLs which were seen in a previous dig. The // loop will continue as long as there are more URLs to visit. // int more = 1; Server *server; URLRef *ref; HtConfiguration *config = HtConfiguration::config(); // // Always sig . The delay bother me but a bad db is worst // if (Retriever_noLog != log) { sig_handlers(); } sig_phandler(); noSignal = 1; /////// // Main loop. We keep on retrieving until a signal is received // or all the servers' queues are empty. /////// #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif while (more && noSignal) { more = 0; // // Go through all the current servers in sequence. // If they support persistent connections, we keep on popping // from the same server queue until it's empty or we reach a maximum // number of consecutive requests ("max_connection_requests"). // Or the loop may also continue for the infinite, // if we set the "max_connection_requests" to -1. // If the server doesn't support persistent connection, we take // only an URL from it, then we skip to the next server. // // Since 15.05.02: even when persistent connections are activated // we should wait for a 'server_wait_time' number of seconds // after the 'max_connection_requests' value has been reached. // // Let's position at the beginning servers.Start_Get(); int count; // Maximum number of repeated requests with the same // TCP connection (so on the same Server:Port). int max_connection_requests; #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif while ((server = (Server *) servers.Get_NextElement()) && noSignal) { if (debug > 1) cout << "pick: " << server->host() << ", # servers = " << servers.Count() << endl; // We already know if a server supports HTTP pers. connections, // because we asked it for the robots.txt file (constructor of // the class). // If the Server doesn't support persistent connections // we turn it down to 1. if (server->IsPersistentConnectionAllowed()) { // Let's check for a '0' value (out of range) // If set, we change it to 1. if (config->Value("server", server->host(), "max_connection_requests") == 0) max_connection_requests = 1; else max_connection_requests = config->Value("server", server->host(), "max_connection_requests"); if (debug > 2) { cout << "> " << server->host() << " supports HTTP persistent connections"; if (max_connection_requests == -1) cout << " (" << "infinite" << ")" << endl; else cout << " (" << max_connection_requests << ")" << endl; } } else { // No HTTP persistent connections. So we request only 1 document. max_connection_requests = 1; if (debug > 2) cout << "> " << server->host() << " with a traditional HTTP connection" << endl; } count = 0; #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif while (((max_connection_requests == -1) || (count < max_connection_requests)) && (ref = server->pop()) && noSignal) { count++; // // We have a URL to index, now. We need to register the // fact that we are not done yet by setting the 'more' // variable. So, we have to restart scanning the queue. // more = 1; // // Deal with the actual URL. // We'll check with the server to see if we need to sleep() // before parsing it. // parse_url(*ref); delete ref; // We reached the maximum number of connections (either with // or without persistent connections) and we must pause and // respect the 'net ethic'. if ((max_connection_requests - count) == 0) server->delay(); // This will pause if needed // and reset the time #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif } #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif } } #ifdef _MSC_VER /* _WIN32 */ win32_check_messages(); #endif // if we exited on signal if (Retriever_noLog != log && !noSignal) { FILE *urls_parsed; String filelog = config->Find("url_log"); // save url seen but not fetched urls_parsed = fopen((char *) filelog, "w"); if (0 == urls_parsed) { reportError(form("Unable to create URL log file '%s'", filelog.get())); } else { servers.Start_Get(); while ((server = (Server *) servers.Get_NextElement())) { while (NULL != (ref = server->pop())) { fprintf(urls_parsed, "%s\n", (const char *) ref->GetURL().get()); delete ref; } } fclose(urls_parsed); } } words.Close(); } //***************************************************************************** // void Retriever::parse_url(URLRef &urlRef) // void Retriever::parse_url(URLRef & urlRef) { HtConfiguration *config = HtConfiguration::config(); URL url; DocumentRef *ref; int old_document; time_t date; static int index = 0; static int local_urls_only = config->Boolean("local_urls_only"); static int mark_dead_servers = config->Boolean("ignore_dead_servers"); Server *server; url.parse(urlRef.GetURL().get()); currenthopcount = urlRef.GetHopCount(); ref = docs[url.get()]; // It might be nice to have just an Exists() here if (ref) { // // We already have an entry for this document in our database. // This means we can get the document ID and last modification // time from there. // current_id = ref->DocID(); date = ref->DocTime(); if (ref->DocAccessed()) old_document = 1; else // we haven't retrieved it yet, so we only have the first link old_document = 0; ref->DocBackLinks(ref->DocBackLinks() + 1); // we had a new link ref->DocAccessed(time(0)); ref->DocState(Reference_normal); currenthopcount = ref->DocHopCount(); } else { // // Never seen this document before. We need to create an // entry for it. This implies that it gets a new document ID. // date = 0; current_id = docs.NextDocID(); ref = new DocumentRef; ref->DocID(current_id); ref->DocURL(url.get()); ref->DocState(Reference_normal); ref->DocAccessed(time(0)); ref->DocHopCount(currenthopcount); ref->DocBackLinks(1); // We had to have a link to get here! old_document = 0; } word_context.DocID(ref->DocID()); if (debug > 0) { // // Display progress // cout << index++ << ':' << current_id << ':' << currenthopcount << ':' << url.get() << ": "; cout.flush(); } // Reset the document to clean out any old data doc->Reset(); doc->Url(url.get()); doc->Referer(urlRef.GetReferer().get()); base = doc->Url(); // Retrieve document, first trying local file access if possible. Transport::DocStatus status; server = (Server *) servers[url.signature()]; StringList *local_filenames = GetLocal(url.get()); if (local_filenames) { if (debug > 1) cout << "Trying local files" << endl; status = doc->RetrieveLocal(date, local_filenames); if (status == Transport::Document_not_local) { if (debug > 1) cout << "Local retrieval failed, trying HTTP" << endl; if (server && !server->IsDead() && !local_urls_only) status = doc->Retrieve(server, date); else status = Transport::Document_no_host; } delete local_filenames; } else if (server && !server->IsDead() && !local_urls_only) status = doc->Retrieve(server, date); else status = Transport::Document_no_host; current_ref = ref; // // Determine what to do by looking at the status code returned by // the Document retrieval process. // String shash; String sx; char bhash[16]; time_t ddate; switch (status) { case Transport::Document_ok: trackWords = 1; if (check_unique_md5) { if (doc->StoredLength() > 0) { if (check_unique_date) { ddate = doc->ModTime(); if (ddate < time(NULL) - 10) { // Unknown date was set to current time md5(bhash, doc->Contents(), doc->StoredLength(), &ddate, debug); } else { md5(bhash, doc->Contents(), doc->StoredLength(), 0, debug); } } else md5(bhash, doc->Contents(), doc->StoredLength(), 0, debug); shash.append(bhash, MD5_LENGTH); d_md5->Get(shash, sx); if (!sx.empty()) { if (debug > 1) { cout << " Detected duplicate by md5 hash" << endl; } words.Skip(); break; // Duplicate - don't index } else { d_md5->Put(shash, "x"); } } } if (old_document) { if (doc->ModTime() == ref->DocTime()) { words.Skip(); if (debug) cout << " retrieved but not changed" << endl; words.Skip(); break; } // // Since we already had a record of this document and // we were able to retrieve it, it must have changed // since the last time we scanned it. This means that // we need to assign a new document ID to it and mark // the old one as obsolete. // words.Skip(); int backlinks = ref->DocBackLinks(); ref->DocState(Reference_obsolete); docs.Add(*ref); delete ref; current_id = docs.NextDocID(); word_context.DocID(current_id); ref = new DocumentRef; ref->DocID(current_id); ref->DocURL(url.get()); ref->DocState(Reference_normal); ref->DocAccessed(time(0)); ref->DocHopCount(currenthopcount); ref->DocBackLinks(backlinks); if (debug) cout << " (changed) "; } RetrievedDocument(*doc, url.get(), ref); // Hey! If this document is marked noindex, don't even bother // adding new words. Mark this as gone and get rid of it! if (ref->DocState() == Reference_noindex) { if (debug > 1) cout << " ( " << ref->DocURL() << " ignored)"; words.Skip(); } else words.Flush(); if (debug) cout << " size = " << doc->Length() << endl; if (urls_seen) { fprintf(urls_seen, "%s|%d|%s|%d|%d|1\n", (const char *) url.get(), doc->Length(), doc->ContentType(), (int) doc->ModTime(), currenthopcount); } break; case Transport::Document_not_changed: if (debug) cout << " not changed" << endl; words.Skip(); break; case Transport::Document_not_found: ref->DocState(Reference_not_found); if (debug) cout << " not found" << endl; recordNotFound(url.get(), urlRef.GetReferer().get(), Transport::Document_not_found); words.Skip(); break; case Transport::Document_no_host: ref->DocState(Reference_not_found); if (debug) cout << " host not found" << endl; recordNotFound(url.get(), urlRef.GetReferer().get(), Transport::Document_no_host); words.Skip(); // Mark the server as being down if (server && mark_dead_servers) server->IsDead(1); break; case Transport::Document_no_port: ref->DocState(Reference_not_found); if (debug) cout << " host not found (port)" << endl; recordNotFound(url.get(), urlRef.GetReferer().get(), Transport::Document_no_port); words.Skip(); // Mark the server as being down if (server && mark_dead_servers) server->IsDead(1); break; case Transport::Document_not_parsable: ref->DocState(Reference_noindex); if (debug) cout << " not Parsable" << endl; words.Skip(); break; case Transport::Document_redirect: if (debug) cout << " redirect" << endl; ref->DocState(Reference_obsolete); words.Skip(); got_redirect(doc->Redirected(), ref, (urlRef.GetReferer()).get()); break; case Transport::Document_not_authorized: ref->DocState(Reference_not_found); if (debug) cout << " not authorized" << endl; words.Skip(); break; case Transport::Document_not_local: ref->DocState(Reference_not_found); if (debug) cout << " not local" << endl; words.Skip(); break; case Transport::Document_no_header: ref->DocState(Reference_not_found); if (debug) cout << " no header" << endl; words.Skip(); break; case Transport::Document_connection_down: ref->DocState(Reference_not_found); if (debug) cout << " connection down" << endl; words.Skip(); break; case Transport::Document_no_connection: ref->DocState(Reference_not_found); if (debug) cout << " no connection" << endl; words.Skip(); break; case Transport::Document_not_recognized_service: ref->DocState(Reference_not_found); if (debug) cout << " service not recognized" << endl; // Mark the server as being down if (server && mark_dead_servers) server->IsDead(1); words.Skip(); break; case Transport::Document_other_error: ref->DocState(Reference_not_found); if (debug) cout << " other error" << endl; words.Skip(); break; } docs.Add(*ref); delete ref; } //***************************************************************************** // void Retriever::RetrievedDocument(Document &doc, const String &url, DocumentRef *ref) // We found a document that needs to be parsed. Since we don't know the // document type, we'll let the Document itself return an appropriate // Parsable object which we can call upon to parse the document contents. // void Retriever::RetrievedDocument(Document & doc, const String & url, DocumentRef * ref) { n_links = 0; current_ref = ref; current_title = 0; word_context.Anchor(0); current_time = 0; current_head = 0; current_meta_dsc = 0; // // Create a parser object and let it have a go at the document. // We will pass ourselves as a callback object for all the got_*() // routines. // This will generate the Parsable object as a specific parser // Parsable *parsable = doc.getParsable(); if (parsable) parsable->parse(*this, *base); else { // If we didn't get a parser, then we should get rid of this! ref->DocState(Reference_noindex); return; } // If just storing the first occurrence of each word in a document, // we must now flush the words we saw in that document if (no_store_phrases) { DictionaryCursor cursor; char *key; HtWordReference wordRef; for (words_to_add.Start_Get (cursor); (key = words_to_add.Get_Next(cursor)); ) { word_entry *entry = (word_entry*) (words_to_add [key]); wordRef.Location(entry->location); wordRef.Flags(entry->flags); wordRef.Word(key); words.Replace(WordReference::Merge(wordRef, entry->context)); // How do I clean up properly? delete entry; } words_to_add.Release (); } // // We don't need to dispose of the parsable object since it will // automatically be reused. // // // Update the document reference // ref->DocHead((char *) current_head); ref->DocMetaDsc((char *) current_meta_dsc); if (current_time == 0) ref->DocTime(doc.ModTime()); else ref->DocTime(current_time); ref->DocTitle((char *) current_title); ref->DocSize(doc.Length()); ref->DocAccessed(time(0)); ref->DocLinks(n_links); } //***************************************************************************** // int Retriever::Need2Get(const String &u) // Return TRUE if we need to retrieve the given url. This will // check the list of urls we have already visited. // int Retriever::Need2Get(const String & u) { static String url; url = u; return !visited.Exists(url); } //***************************************************************************** // int Retriever::IsValidURL(const String &u) // Return TRUE if we need to retrieve the given url. We will check // for limits here. // int Retriever::IsValidURL(const String & u) { HtConfiguration *config = HtConfiguration::config(); Dictionary invalids; Dictionary valids; URL aUrl(u); StringList tmpList; // A list of bad extensions, separated by spaces or tabs String t = config->Find(&aUrl, "bad_extensions"); String lowerp; char *p = strtok(t, " \t"); while (p) { // Extensions are case insensitive lowerp = p; lowerp.lowercase(); invalids.Add(lowerp, 0); p = strtok(0, " \t"); } // // Valid extensions are performed similarly // // A list of valid extensions, separated by spaces or tabs t = config->Find(&aUrl, "valid_extensions"); p = strtok(t, " \t"); while (p) { // Extensions are case insensitive lowerp = p; lowerp.lowercase(); valids.Add(lowerp, 0); p = strtok(0, " \t"); } static String url; url = u; // // If the URL contains any of the patterns in the exclude list, // mark it as invalid // String exclude_urls = config->Find(&aUrl, "exclude_urls"); static String *prevexcludes = 0; static HtRegexList *excludes = 0; if (!excludes || !prevexcludes || prevexcludes->compare(exclude_urls) != 0) { if (!excludes) excludes = new HtRegexList; if (prevexcludes) delete prevexcludes; prevexcludes = new String(exclude_urls); tmpList.Create(exclude_urls, " \t"); excludes->setEscaped(tmpList, config->Boolean("case_sensitive")); tmpList.Destroy(); } if (excludes->match(url, 0, 0) != 0) { if (debug > 2) cout << endl << " Rejected: item in exclude list "; return (HTDIG_ERROR_TESTURL_EXCLUDE); } // // If the URL has a query string and it is in the bad query list // mark it as invalid // String bad_querystr = config->Find(&aUrl, "bad_querystr"); static String *prevbadquerystr = 0; static HtRegexList *badquerystr = 0; if (!badquerystr || !prevbadquerystr || prevbadquerystr->compare(bad_querystr) != 0) { if (!badquerystr) badquerystr = new HtRegexList; if (prevbadquerystr) delete prevbadquerystr; prevbadquerystr = new String(bad_querystr); tmpList.Create(bad_querystr, " \t"); badquerystr->setEscaped(tmpList, config->Boolean("case_sensitive")); tmpList.Destroy(); } char *ext = strrchr((char *) url, '?'); if (ext && badquerystr->match(ext, 0, 0) != 0) { if (debug > 2) cout << endl << " Rejected: item in bad query list "; return (HTDIG_ERROR_TESTURL_BADQUERY); } // // See if the file extension is in the list of invalid ones // String urlpath = url.get(); int parm = urlpath.indexOf('?'); // chop off URL parameter if (parm >= 0) urlpath.chop(urlpath.length() - parm); ext = strrchr((char *) urlpath.get(), '.'); String lowerext; if (ext && strchr(ext, '/')) // Ignore a dot if it's not in the ext = NULL; // final component of the path. if (ext) { lowerext.set(ext); lowerext.lowercase(); if (invalids.Exists(lowerext)) { if (debug > 2) cout << endl << " Rejected: Extension is invalid!"; return (HTDIG_ERROR_TESTURL_EXTENSION); } } // // Or NOT in the list of valid ones // if (ext && valids.Count() > 0 && !valids.Exists(lowerext)) { if (debug > 2) cout << endl << " Rejected: Extension is not valid!"; return (HTDIG_ERROR_TESTURL_EXTENSION2); } // // If none of the limits is met, we disallow the URL // if (limits.match(url, 1, 0) == 0) { if (debug > 1) cout << endl << " Rejected: URL not in the limits! "; return (HTDIG_ERROR_TESTURL_LIMITS); } // // Likewise if not in list of normalized urls // // Warning! // should be last in checks because of aUrl normalization // // signature() implicitly normalizes the URL. Be efficient... Server *server = (Server *) servers[aUrl.signature()]; // aUrl.normalize(); if (limitsn.match(aUrl.get(), 1, 0) == 0) { if (debug > 2) cout << endl << " Rejected: not in \"limit_normalized\" list!"; return (HTDIG_ERROR_TESTURL_LIMITSNORM); } // // After that gauntlet, check to see if the server allows it // (robots.txt) // if (server && server->IsDisallowed(url) != 0) { if (debug > 2) cout << endl << " Rejected: forbidden by server robots.txt!"; return (HTDIG_ERROR_TESTURL_ROBOT_FORBID); } return (1); } //***************************************************************************** // StringList* Retriever::GetLocal(const String &url) // Returns a list of strings containing the (possible) local filenames // of the given url, or 0 if it's definitely not local. // THE CALLER MUST FREE THE STRINGLIST AFTER USE! // Returned strings are not hex encoded. // StringList *Retriever::GetLocal(const String & strurl) { HtConfiguration *config = HtConfiguration::config(); static StringList *prefixes = 0; String url = strurl; static StringList *paths = 0; StringList *defaultdocs = 0; URL aUrl(url); url = aUrl.get(); // make sure we look at a parsed URL // // Initialize prefix/path list if this is the first time. // The list is given in format "prefix1=path1 prefix2=path2 ..." // if (!prefixes) { prefixes = new StringList(); paths = new StringList(); String t = config->Find("local_urls"); char *p = strtok(t, " \t"); while (p) { char *path = strchr(p, '='); if (!path) { p = strtok(0, " \t"); continue; } *path++ = '\0'; String *pre = new String(p); decodeURL(*pre); prefixes->Add(pre); String *pat = new String(path); decodeURL(*pat); paths->Add(pat); p = strtok(0, " \t"); } } if (!config->Find(&aUrl, "local_default_doc").empty()) { defaultdocs = new StringList(); String t = config->Find(&aUrl, "local_default_doc"); char *p = strtok(t, " \t"); while (p) { String *def = new String(p); decodeURL(*def); defaultdocs->Add(def); p = strtok(0, " \t"); } if (defaultdocs->Count() == 0) { delete defaultdocs; defaultdocs = 0; } } // Begin by hex-decoding URL... String hexurl = url; decodeURL(hexurl); url = hexurl.get(); // Check first for local user... if (strchr(url.get(), '~')) { StringList *local = GetLocalUser(url, defaultdocs); if (local) { if (defaultdocs) delete defaultdocs; return local; } } // This shouldn't happen, but check anyway... if (strstr(url.get(), "..")) return 0; String *prefix, *path; String *defaultdoc; StringList *local_names = new StringList(); prefixes->Start_Get(); paths->Start_Get(); while ((prefix = (String *) prefixes->Get_Next())) { path = (String *) paths->Get_Next(); if (mystrncasecmp((char *) *prefix, (char *) url, prefix->length()) == 0) { int l = strlen(url.get()) - prefix->length() + path->length() + 4; String *local = new String(*path, l); *local += &url[prefix->length()]; if (local->last() == '/' && defaultdocs) { defaultdocs->Start_Get(); while ((defaultdoc = (String *) defaultdocs->Get_Next())) { String *localdefault = new String(*local, local->length() + defaultdoc->length() + 1); localdefault->append(*defaultdoc); local_names->Add(localdefault); } delete local; } else local_names->Add(local); } } if (local_names->Count() > 0) { if (defaultdocs) delete defaultdocs; return local_names; } if (defaultdocs) delete defaultdocs; delete local_names; return 0; } //***************************************************************************** // StringList* Retriever::GetLocalUser(const String &url, StringList *defaultdocs) // If the URL has ~user part, return a list of strings containing the // (possible) local filenames of the given url, or 0 if it's // definitely not local. // THE CALLER MUST FREE THE STRINGLIST AFTER USE! // StringList *Retriever::GetLocalUser(const String & url, StringList * defaultdocs) { // NOTE: Native Windows does not have this contruct for the user Web files #ifndef _MSC_VER /* _WIN32 */ HtConfiguration *config = HtConfiguration::config(); static StringList *prefixes = 0, *paths = 0, *dirs = 0; static Dictionary home_cache; URL aUrl(url); // // Initialize prefix/path list if this is the first time. // The list is given in format "prefix1=path1,dir1 ..." // If path is zero-length, user's home directory is looked up. // if (!prefixes) { prefixes = new StringList(); paths = new StringList(); dirs = new StringList(); String t = config->Find("local_user_urls"); char *p = strtok(t, " \t"); while (p) { char *path = strchr(p, '='); if (!path) { p = strtok(0, " \t"); continue; } *path++ = '\0'; char *dir = strchr(path, ','); if (!dir) { p = strtok(0, " \t"); continue; } *dir++ = '\0'; String *pre = new String(p); decodeURL(*pre); prefixes->Add(pre); String *pat = new String(path); decodeURL(*pat); paths->Add(pat); String *ptd = new String(dir); decodeURL(*ptd); dirs->Add(ptd); p = strtok(0, " \t"); } } // Can we do anything about this? if (!strchr(url, '~') || !prefixes->Count() || strstr(url, "..")) return 0; // Split the URL to components String tmp = url; char *name = strchr((char *) tmp, '~'); *name++ = '\0'; char *rest = strchr(name, '/'); if (!rest || (rest - name <= 1) || (rest - name > 32)) return 0; *rest++ = '\0'; // Look it up in the prefix/path/dir table prefixes->Start_Get(); paths->Start_Get(); dirs->Start_Get(); String *prefix, *path, *dir; String *defaultdoc; StringList *local_names = new StringList(); while ((prefix = (String *) prefixes->Get_Next())) { path = (String *) paths->Get_Next(); dir = (String *) dirs->Get_Next(); if (mystrcasecmp((char *) *prefix, (char *) tmp) != 0) continue; String *local = new String; // No path, look up home directory if (path->length() == 0) { String *home = (String *) home_cache[name]; if (!home) { struct passwd *passwd = getpwnam(name); if (passwd) { home = new String(passwd->pw_dir); home_cache.Add(name, home); } } if (home) *local += *home; else continue; } else { *local += *path; *local += name; } *local += *dir; *local += rest; if (local->last() == '/' && defaultdocs) { defaultdocs->Start_Get(); while ((defaultdoc = (String *) defaultdocs->Get_Next())) { String *localdefault = new String(*local, local->length() + defaultdoc->length() + 1); localdefault->append(*defaultdoc); local_names->Add(localdefault); } delete local; } else local_names->Add(local); } if (local_names->Count() > 0) return local_names; delete local_names; #endif //_MSC_VER /* _WIN32 */ return 0; } //***************************************************************************** // int Retriever::IsLocalURL(const String &url) // Returns 1 if the given url has a (possible) local filename // or 0 if it's definitely not local. // int Retriever::IsLocalURL(const String & url) { int ret; StringList *local_filename = GetLocal(url); ret = (local_filename != 0); if (local_filename) delete local_filename; return ret; } //***************************************************************************** // void Retriever::got_word(char *word, int location, int heading) // The location is normalized to be in the range 0 - 1000. // void Retriever::got_word(const char *word, int location, int heading) { if (debug > 3) cout << "word: " << word << '@' << location << endl; if (heading >= (int) (sizeof(factor) / sizeof(factor[0])) || heading < 0) heading = 0; // Assume it's just normal text if (trackWords && strlen(word) >= (unsigned int) minimumWordLength) { String w = word; HtWordReference wordRef; if (no_store_phrases) { // Add new word, or mark existing word as also being at // this heading level word_entry *entry; if ((entry = (word_entry*)words_to_add.Find (w)) == NULL) { words_to_add.Add(w, new word_entry (location, factor[heading], word_context)); } else { entry->flags |= factor[heading]; } } else { wordRef.Location(location); wordRef.Flags(factor[heading]); wordRef.Word(w); words.Replace(WordReference::Merge(wordRef, word_context)); } // Check for compound words... String parts = word; int added; int nparts = 1; do { added = 0; char *start = parts.get(); char *punctp = 0, *nextp = 0, *p; char punct; int n; while (*start) { p = start; for (n = 0; n < nparts; n++) { while (HtIsStrictWordChar((unsigned char) *p)) p++; punctp = p; if (!*punctp && n + 1 < nparts) break; while (*p && !HtIsStrictWordChar((unsigned char) *p)) p++; if (n == 0) nextp = p; } if (n < nparts) break; punct = *punctp; *punctp = '\0'; if (*start && (*p || start > parts.get())) { w = start; HtStripPunctuation(w); if (w.length() >= minimumWordLength) { if (no_store_phrases) { // Add new word, or mark existing word as also being at // this heading level word_entry *entry; if ((entry = (word_entry*)words_to_add.Find (w)) == NULL) { words_to_add.Add(w, new word_entry (location, factor[heading], word_context)); } else { entry->flags |= factor[heading]; } } else { wordRef.Word(w); words.Replace(WordReference::Merge(wordRef, word_context)); } if (debug > 3) cout << "word part: " << start << '@' << location << endl; } added++; } start = nextp; *punctp = punct; } nparts++; } while (added > 2); } } //***************************************************************************** // void Retriever::got_title(const char *title) // void Retriever::got_title(const char *title) { if (debug > 1) cout << "\ntitle: " << title << endl; current_title = title; } //***************************************************************************** // void Retriever::got_author(const char *e) // void Retriever::got_author(const char *author) { if (debug > 1) cout << "\nauthor: " << author << endl; current_ref->DocAuthor(author); } //***************************************************************************** // void Retriever::got_time(const char *time) // void Retriever::got_time(const char *time) { HtDateTime new_time(current_time); if (debug > 1) cout << "\ntime: " << time << endl; // // As defined by the Dublin Core, this should be YYYY-MM-DD // In the future, we'll need to deal with the scheme portion // in case someone picks a different format. // new_time.SetFTime(time, "%Y-%m-%d"); current_time = new_time.GetTime_t(); // If we can't convert it, current_time stays the same and we get // the default--the date returned by the server... } //***************************************************************************** // void Retriever::got_anchor(const char *anchor) // void Retriever::got_anchor(const char *anchor) { if (debug > 2) cout << "anchor: " << anchor << endl; current_ref->AddAnchor(anchor); word_context.Anchor(word_context.Anchor() + 1); } //***************************************************************************** // void Retriever::got_image(const char *src) // void Retriever::got_image(const char *src) { URL url(src, *base); const char *image = (const char *) url.get(); if (debug > 2) cout << "image: " << image << endl; if (images_seen) fprintf(images_seen, "%s\n", image); } //***************************************************************************** // void Retriever::got_href(URL & url, const char *description, int hops) { DocumentRef *ref = 0; Server *server = 0; int valid_url_code = 0; // Rewrite the URL (if need be) before we do anything to it. url.rewrite(); if (debug > 2) cout << "href: " << url.get() << " (" << description << ')' << endl; n_links++; if (urls_seen) fprintf(urls_seen, "%s\n", (const char *) url.get()); // // Check if this URL falls within the valid range of URLs. // valid_url_code = IsValidURL(url.get()); if (valid_url_code > 0) { // // It is valid. Normalize it (resolve cnames for the server) // and check again... // if (debug > 2) { cout << "resolving '" << url.get() << "'\n"; cout.flush(); } url.normalize(); // If it is a backlink from the current document, // just update that field. Writing to the database // is meaningless, as it will be overwritten. // Adding it as a new document may even be harmful, as // that will be a duplicate. This can happen if the // current document is never referenced before, as in a // start_url. if (strcmp(url.get(), current_ref->DocURL()) == 0) { current_ref->DocBackLinks(current_ref->DocBackLinks() + 1); current_ref->AddDescription(description, words); } else { // // First add it to the document database // ref = docs[url.get()]; // if ref exists we have to call AddDescription even // if max_hop_count is reached if (!ref && currenthopcount + hops > max_hop_count) return; if (!ref) { // // Didn't see this one, yet. Create a new reference // for it with a unique document ID // ref = new DocumentRef; ref->DocID(docs.NextDocID()); ref->DocHopCount(currenthopcount + hops); ref->DocURL(url.get()); } ref->DocBackLinks(ref->DocBackLinks() + 1); // This one! ref->AddDescription(description, words); // // If the dig is restricting by hop count, perform the check here // too if (currenthopcount + hops > max_hop_count) { delete ref; return; } if (ref->DocHopCount() > currenthopcount + hops) ref->DocHopCount(currenthopcount + hops); docs.Add(*ref); // // Now put it in the list of URLs to still visit. // if (Need2Get(url.get())) { if (debug > 1) cout << "\n pushing " << url.get() << endl; server = (Server *) servers[url.signature()]; if (!server) { // // Hadn't seen this server, yet. Register it // String robotsURL = url.signature(); robotsURL << "robots.txt"; StringList *localRobotsFile = GetLocal(robotsURL.get()); server = new Server(url, localRobotsFile); servers.Add(url.signature(), server); delete localRobotsFile; } // // Let's just be sure we're not pushing an empty URL // if (strlen(url.get())) server->push(url.get(), ref->DocHopCount(), base->get(), IsLocalURL(url.get())); String temp = url.get(); visited.Add(temp, 0); if (debug) cout << '+'; } else if (debug) cout << '*'; delete ref; } } else { // // Not a valid URL // if (debug > 1) cout << "\nurl rejected: (level 1)" << url.get() << endl; if (debug == 1) cout << '-'; if (urls_seen) { fprintf(urls_seen, "%s|||||%d\n", (const char *) url.get(), valid_url_code); } } if (debug) cout.flush(); } //***************************************************************************** // void Retriever::got_redirect(const char *new_url, DocumentRef *old_ref) // void Retriever::got_redirect(const char *new_url, DocumentRef * old_ref, const char *referer) { // First we must piece together the new URL, which may be relative URL parent(old_ref->DocURL()); URL url(new_url, parent); // Rewrite the URL (if need be) before we do anything to it. url.rewrite(); if (debug > 2) cout << "redirect: " << url.get() << endl; n_links++; if (urls_seen) fprintf(urls_seen, "%s\n", (const char *) url.get()); // // Check if this URL falls within the valid range of URLs. // if (IsValidURL(url.get()) > 0) { // // It is valid. Normalize it (resolve cnames for the server) // and check again... // if (debug > 2) { cout << "resolving '" << url.get() << "'\n"; cout.flush(); } url.normalize(); // // First add it to the document database // DocumentRef *ref = docs[url.get()]; if (!ref) { // // Didn't see this one, yet. Create a new reference // for it with a unique document ID // ref = new DocumentRef; ref->DocID(docs.NextDocID()); ref->DocHopCount(currenthopcount); } ref->DocURL(url.get()); // // Copy the descriptions of the old DocRef to this one // List *d = old_ref->Descriptions(); if (d) { d->Start_Get(); String *str; while ((str = (String *) d->Get_Next())) { ref->AddDescription(str->get(), words); } } if (ref->DocHopCount() > old_ref->DocHopCount()) ref->DocHopCount(old_ref->DocHopCount()); // Copy the number of backlinks ref->DocBackLinks(old_ref->DocBackLinks()); docs.Add(*ref); // // Now put it in the list of URLs to still visit. // if (Need2Get(url.get())) { if (debug > 1) cout << " pushing " << url.get() << endl; Server *server = (Server *) servers[url.signature()]; if (!server) { // // Hadn't seen this server, yet. Register it // String robotsURL = url.signature(); robotsURL << "robots.txt"; StringList *localRobotsFile = GetLocal(robotsURL.get()); server = new Server(url, localRobotsFile); servers.Add(url.signature(), server); delete localRobotsFile; } if (!referer || strlen(referer) == 0) server->push(url.get(), ref->DocHopCount(), base->get(), IsLocalURL(url.get()), 0); else server->push(url.get(), ref->DocHopCount(), referer, IsLocalURL(url.get()), 0); String temp = url.get(); visited.Add(temp, 0); } delete ref; } } //***************************************************************************** // void Retriever::got_head(const char *head) // void Retriever::got_head(const char *head) { if (debug > 4) cout << "head: " << head << endl; current_head = head; } //***************************************************************************** // void Retriever::got_meta_dsc(const char *md) // void Retriever::got_meta_dsc(const char *md) { if (debug > 4) cout << "meta description: " << md << endl; current_meta_dsc = md; } //***************************************************************************** // void Retriever::got_meta_email(const char *e) // void Retriever::got_meta_email(const char *e) { if (debug > 1) cout << "\nmeta email: " << e << endl; current_ref->DocEmail(e); } //***************************************************************************** // void Retriever::got_meta_notification(const char *e) // void Retriever::got_meta_notification(const char *e) { if (debug > 1) cout << "\nmeta notification date: " << e << endl; current_ref->DocNotification(e); } //***************************************************************************** // void Retriever::got_meta_subject(const char *e) // void Retriever::got_meta_subject(const char *e) { if (debug > 1) cout << "\nmeta subect: " << e << endl; current_ref->DocSubject(e); } //***************************************************************************** // void Retriever::got_noindex() // void Retriever::got_noindex() { if (debug > 1) cout << "\nMETA ROBOT: Noindex " << current_ref->DocURL() << endl; current_ref->DocState(Reference_noindex); } //***************************************************************************** // void Retriever::recordNotFound(const String & url, const String & referer, int reason) { char *message = ""; switch (reason) { case Transport::Document_not_found: message = "Not found"; break; case Transport::Document_no_host: message = "Unknown host or unable to contact server"; break; case Transport::Document_no_port: message = "Unknown host or unable to contact server (port)"; break; default: break; } notFound << message << ": " << url << " Ref: " << referer << '\n'; } //***************************************************************************** // void Retriever::ReportStatistics(char *name) // void Retriever::ReportStatistics(const String & name) { HtConfiguration *config = HtConfiguration::config(); cout << name << ": Run complete\n"; cout << name << ": " << servers.Count() << " server"; if (servers.Count() > 1) cout << "s"; cout << " seen:\n"; Server *server; String buffer; StringList results; String newname = name; newname << ": "; servers.Start_Get(); while ((server = (Server *) servers.Get_NextElement())) { buffer = 0; server->reportStatistics(buffer, newname); results.Add(buffer); } results.Sort(); for (int i = 0; i < results.Count(); i++) { cout << results[i] << "\n"; } if (notFound.length() > 0) { cout << "\n" << name << ": Errors to take note of:\n"; cout << notFound; } cout << endl; // Report HTTP connections stats cout << "HTTP statistics" << endl; cout << "===============" << endl; if (config->Boolean("persistent_connections")) { cout << " Persistent connections : Yes" << endl; if (config->Boolean("head_before_get")) cout << " HEAD call before GET : Yes" << endl; else cout << " HEAD call before GET : No" << endl; } else { cout << " Persistent connections : No" << endl; } HtHTTP::ShowStatistics(cout) << endl; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Retriever.h���������������������������������������������������������������������0100644�0063146�0012731�00000011277�10055635543�015620� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Retriever.h // // Retriever: Crawl from a list of URLs and calls appropriate parsers. The // parser notifies the Retriever object that it got something // (got_* functions) and the Retriever object feed the databases // and statistics accordingly. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Retriever.h,v 1.28 2004/05/28 13:15:15 lha Exp $ // #ifndef _Retriever_h_ #define _Retriever_h_ #include "DocumentRef.h" #include "Dictionary.h" #include "Queue.h" #include "HtWordReference.h" #include "List.h" #include "StringList.h" #include "DocumentDB.h" #define HTDIG_ERROR_TESTURL_EXCLUDE -109 #define HTDIG_ERROR_TESTURL_BADQUERY -110 #define HTDIG_ERROR_TESTURL_EXTENSION -111 #define HTDIG_ERROR_TESTURL_EXTENSION2 -112 #define HTDIG_ERROR_TESTURL_LIMITS -113 #define HTDIG_ERROR_TESTURL_LIMITSNORM -114 #define HTDIG_ERROR_TESTURL_SRCH_RESTRICT -115 #define HTDIG_ERROR_TESTURL_SRCH_EXCLUDE -116 #define HTDIG_ERROR_TESTURL_REWRITE_EMPTY -117 #define HTDIG_ERROR_TESTURL_ROBOT_FORBID -118 class URL; class Document; class URLRef; class HtWordList; enum RetrieverLog { Retriever_noLog, Retriever_logUrl, Retriever_Restart }; struct word_entry : public Object { word_entry (int loc, int fl, HtWordReference& ref) : location (loc), flags (fl), context (ref) {}; int location; int flags; HtWordReference context; }; class Retriever { public: // // Construction/Destruction // Retriever(RetrieverLog flags = Retriever_noLog); virtual ~Retriever(); // // Getting it all started // void Initial(const String& url, int checked = 0); void Initial(List &list , int checked = 0); void Start(); // // Report statistics about the parser // void ReportStatistics(const String& name); // // These are the callbacks that we need to write code for // void got_word(const char *word, int location, int heading); void got_href(URL &url, const char *description, int hops = 1); void got_title(const char *title); void got_author(const char *author); void got_time(const char *time); void got_head(const char *head); void got_meta_dsc(const char *md); void got_anchor(const char *anchor); void got_image(const char *src); void got_meta_email(const char *); void got_meta_notification(const char *); void got_meta_subject(const char *); void got_noindex(); // // Allow for the indexing of protected sites by using a // username/password // void setUsernamePassword(const char *credentials); // // Routines for dealing with local filesystem access // StringList * GetLocal(const String &strurl); StringList * GetLocalUser(const String &url, StringList *defaultdocs); int IsLocalURL(const String &url); private: // // A hash to keep track of what we've seen // Dictionary visited; URL *base; String current_title; String current_head; String current_meta_dsc; time_t current_time; int current_id; DocumentRef *current_ref; int current_anchor_number; int trackWords; int n_links; String credentials; HtWordReference word_context; HtWordList words; Dictionary words_to_add; int check_unique_md5; int check_unique_date; RetrieverLog log; // // These are weights for the words. The index is the heading level. // long int factor[12]; int currenthopcount; // // Some semi-constants... // int max_hop_count; // // The list of server-specific information objects is indexed by // ip address and port number. The list contains Server objects. // Dictionary servers; // // For efficiency reasons, we will only use one document object which // we reuse. // Document *doc; Database *d_md5; String notFound; // Some useful constants int minimumWordLength; // // Helper routines // int Need2Get(const String &url); int IsValidURL(const String &url); void RetrievedDocument(Document &, const String &url, DocumentRef *ref); void parse_url(URLRef &urlRef); void got_redirect(const char *, DocumentRef *, const char * = 0); void recordNotFound(const String &url, const String &referer, int reason); }; #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Server.cc�����������������������������������������������������������������������0100644�0063146�0012731�00000026162�10055635544�015255� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Server.cc // // Server: A class to keep track of server specific information. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Server.cc,v 1.29 2004/05/28 13:15:16 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htdig.h" #include "Server.h" #include "good_strtok.h" #include "htString.h" #include "URL.h" #include "Document.h" #include "URLRef.h" #include "Transport.h" #include "HtHTTP.h" // for checking persistent connections #include "StringList.h" #include <ctype.h> #include "defaults.h" //***************************************************************************** // Server::Server(URL u, StringList *local_robots_files) // u is the base URL for this server // Server::Server(URL u, StringList *local_robots_files) : _host(u.host()), _port(u.port()), _bad_server(0), _documents(0), _accept_language(0) { HtConfiguration* config= HtConfiguration::config(); if (debug) cout << endl << "New server: " << _host << ", " << _port << endl; // We take it from the configuration _persistent_connections = config->Boolean("server", _host.get(),"persistent_connections"); _head_before_get = config->Boolean("server", _host.get(),"head_before_get"); _max_documents = config->Value("server",_host.get(),"server_max_docs"); _connection_space = config->Value("server",_host.get(),"server_wait_time"); _user_agent = config->Find("server", _host.get(), "user_agent"); _disable_cookies = config->Boolean("server", _host.get(), "disable_cookies"); // Accept-Language directive StringList _accept_language_list(config->Find("server", _host.get(), "accept_language"), " \t"); _accept_language.trunc(); // maybe not needed for (int i = 0; i < _accept_language_list.Count(); i++) { if (i>0) _accept_language << ","; // for multiple choices _accept_language << _accept_language_list[i]; } // Timeout setting _timeout = config->Value("server",_host.get(),"timeout"); // Number of consecutive attempts to establish a TCP connection _tcp_max_retries = config->Value("server",_host.get(),"tcp_max_retries"); // Seconds to wait after a timeout occurs _tcp_wait_time = config->Value("server",_host.get(),"tcp_wait_time"); if (debug > 1) { cout << " - Persistent connections: " << (_persistent_connections?"enabled":"disabled") << endl; cout << " - HEAD before GET: " << (_head_before_get?"enabled":"disabled") << endl; cout << " - Timeout: " << _timeout << endl; cout << " - Connection space: " << _connection_space << endl; cout << " - Max Documents: " << _max_documents << endl; cout << " - TCP retries: " << _tcp_max_retries << endl; cout << " - TCP wait time: " << _tcp_wait_time << endl; cout << " - Accept-Language: " << _accept_language << endl; } _last_connection.SettoNow(); // For getting robots.txt if (strcmp(u.service(),"http") == 0 || strcmp(u.service(),"https") == 0) { // // Attempt to get a robots.txt file from the specified server // String url; url.trunc(); if (debug>1) cout << "Trying to retrieve robots.txt file" << endl; url << u.signature() << "robots.txt"; static int local_urls_only = config->Boolean("local_urls_only"); time_t timeZero = 0; // Right now we want to get this every time Document doc(url, 0); Transport::DocStatus status; if (local_robots_files) { if (debug > 1) cout << "Trying local files" << endl; status = doc.RetrieveLocal(timeZero, local_robots_files); if (status == Transport::Document_not_local) { if (local_urls_only) status = Transport::Document_not_found; else { if (debug > 1) cout << "Local retrieval failed, trying HTTP" << endl; status = doc.Retrieve(this, timeZero); } } } else if (!local_urls_only) { status = doc.Retrieve(this, timeZero); // Let's check if persistent connections are both // allowed by the configuration and possible after // having requested the robots.txt file. HtHTTP * http; if (IsPersistentConnectionAllowed() && ( http = doc.GetHTTPHandler())) { if (! http->isPersistentConnectionPossible()) _persistent_connections=0; // not possible. Let's disable // them on this server. } } else status = Transport::Document_not_found; switch (status) { case Transport::Document_ok: // // Found a robots.txt file. Go parse it. // robotstxt(doc); break; case Transport::Document_not_found: case Transport::Document_not_parsable: case Transport::Document_redirect: case Transport::Document_not_authorized: // // These cases are for when there is no robots.txt file. // We will just go on happily without restrictions // break; case Transport::Document_no_host: default: // // In all other cases the server could not be reached. // We will remember this fact so that no more attempts to // contact this server will be made. // _bad_server = 1; break; } // end switch } // end if (http || https) } // Copy constructor Server::Server(const Server& rhs) :_host(_host), _port(rhs._port), _bad_server(rhs._bad_server), _connection_space(rhs._connection_space), _last_connection(rhs._last_connection), _paths(rhs._paths), _disallow(rhs._disallow), _documents(rhs._documents), _max_documents(rhs._max_documents), _persistent_connections(rhs._persistent_connections), _head_before_get(rhs._head_before_get), _disable_cookies(rhs._disable_cookies), _timeout(rhs._timeout), _tcp_wait_time(rhs._tcp_wait_time), _tcp_max_retries(rhs._tcp_max_retries), _user_agent(rhs._user_agent), _accept_language(rhs._accept_language) { } //***************************************************************************** // Server::~Server() // Server::~Server() { } //***************************************************************************** // void Server::robotstxt(Document &doc) // This will parse the robots.txt file which is contained in the document. // void Server::robotstxt(Document &doc) { HtConfiguration* config= HtConfiguration::config(); String contents = doc.Contents(); int length; int pay_attention = 0; String pattern; String myname = config->Find("server", _host.get(), "robotstxt_name"); int seen_myname = 0; char *name, *rest; if (debug > 1) cout << "Parsing robots.txt file using myname = " << myname << "\n"; // // Go through the lines in the file and determine if we need to // pay attention to them // for (char *line = strtok(contents, "\r\n"); line; line = strtok(0, "\r\n")) { if (debug > 2) cout << "Robots.txt line: " << line << endl; // // Strip comments // if (strchr(line, '#')) { *(strchr(line, '#')) = '\0'; } name = good_strtok(line, ':'); if (!name) continue; while (name && isspace(*name)) name++; rest = good_strtok(NULL, '\r'); if (!rest) rest = ""; while (rest && isspace(*rest)) rest++; length = strlen(rest); if (length > 0) { while (length > 0 && isspace(rest[length - 1])) length--; rest[length] = '\0'; } if (mystrcasecmp(name, "user-agent") == 0) { if (debug > 1) cout << "Found 'user-agent' line: " << rest << endl; if (*rest == '*' && !seen_myname) { // // This matches all search engines... // pay_attention = 1; } else if (mystrncasecmp(rest, (char*)myname, myname.length()) == 0) { // // This is for us! This will override any previous patterns // that may have been set. // if (!seen_myname) // only take first section with our name { seen_myname = 1; pay_attention = 1; pattern = 0; // ignore previous User-agent: * } else pay_attention = 0; } else { // // This doesn't concern us // pay_attention = 0; } } else if (pay_attention && mystrcasecmp(name, "disallow") == 0) { if (debug > 1) cout << "Found 'disallow' line: " << rest << endl; // // Add this path to our list to ignore // if (*rest) { if (pattern.length()) pattern << '|'; while (*rest) { if (strchr("^.[$()|*+?{\\", *rest)) pattern << '\\'; pattern << *rest++; } } } // // Ignore anything else (comments) // } // // Compile the pattern (if any...) // if (debug > 1) cout << "Pattern: " << pattern << endl; // Empty "disallow" allows all, so don't make entry which matches all. if (!pattern.empty()) { String fullpatt = "^[^:]*://[^/]*("; fullpatt << pattern << ')'; _disallow.set(fullpatt, config->Boolean("case_sensitive")); } } //***************************************************************************** // void Server::push(String &path, int hopcount, char *referer, int local, int newDoc) // void Server::push(const String &path, int hopcount, const String &referer, int local, int newDoc) { if (_bad_server && !local) return; if (IsDisallowed(path) != 0) { if (debug > 2) cout << endl << " Rejected: forbidden by server robots.txt!"; return; } // We use -1 as no limit, but we also don't want // to forbid redirects from old places if (_max_documents != -1 && newDoc && _documents >= _max_documents) { if (debug>2) // Hey! we only want to get max_docs cout << "Limit of " << _max_documents << " reached for " << _host << endl; return; } URLRef *ref = new URLRef(); ref->SetURL(path); ref->SetHopCount(hopcount); ref->SetReferer(referer); _paths.Add(ref); if (newDoc) _documents++; // cout << "***** pushing '" << path << "' with '" << referer << "'\n"; } //***************************************************************************** // URLRef *Server::pop() // URLRef *Server::pop() { URLRef *ref = (URLRef *) _paths.Remove(); if (!ref) return 0; return ref; } //***************************************************************************** // void Server::delay() // // Keeps track of how long it's been since we've seen this server // and call sleep if necessary // void Server::delay() { HtDateTime now; int time_taken = HtDateTime::GetDiff(now, _last_connection); // arg1-arg2 > 0 if (time_taken < _connection_space) sleep(_connection_space - time_taken); now.SettoNow(); _last_connection = now; // Reset the clock for the next delay! return; } //***************************************************************************** // void Server::reportStatistics(String &out, char *name) // void Server::reportStatistics(String &out, char *name) { out << name << " " << _host << ":" << _port; out << " " << _documents << " document"; if (_documents != 1) out << "s"; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/Server.h������������������������������������������������������������������������0100644�0063146�0012731�00000010613�10055635544�015111� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Server.h // // Server: A class to keep track of server specific information. // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: Server.h,v 1.13 2004/05/28 13:15:16 lha Exp $ // #ifndef _Server_h_ #define _Server_h_ #include "Object.h" #include "htString.h" #include "StringList.h" #include "Stack.h" #include "HtHeap.h" #include "HtRegex.h" #include "StringMatch.h" #include "URLRef.h" #include "HtDateTime.h" class Document; class Server : public Object { public: // // Construction/Destruction // Server(URL u, StringList *local_robots_files = NULL); Server(const Server& rhs); ~Server(); // // This needs to be called with a document containing the // robots.txt file for this server // void robotstxt(Document &doc); // // Provide some way of getting at the host and port for this server // int port() const {return _port;} const String &host() const {return _host;} // // Provide some way of getting at the status of this server // int IsDead() {return _bad_server;} void IsDead(int flag) {_bad_server = flag;} // // Add a path to the queue for this server. // This will check to see if the server is up if the URL is not local // if it's down, it simply will not be added // void push(const String &path, int hopcount, const String &referer, int local = 0, int newDoc = 1); // // Return the next URL from the queue for this server. // URLRef *pop(); // // Delays the server if necessary. If the time between requests // is long enough, the request can occur immediately. // void delay(); // // Produce statistics for this server. // void reportStatistics(String &out, char *name); // // Methods for managing persistent connections // void AllowPersistentConnection() { _persistent_connections = true; } void AvoidPersistentConnection() { _persistent_connections = false; } bool IsPersistentConnectionAllowed () const { return _persistent_connections; } // Methods for getting info regarding server configuration bool HeadBeforeGet() const { return _head_before_get; } unsigned int TimeOut() const { return _timeout; } unsigned int TcpWaitTime() const { return _tcp_wait_time; } unsigned int TcpMaxRetries() const { return _tcp_max_retries; } unsigned int MaxDocuments() const { return _max_documents; } const String &UserAgent() const { return _user_agent; } const String &AcceptLanguage() const { return _accept_language; } bool DisableCookies() const { return _disable_cookies; } // // Return the URLs to be excluded from this server // (for inclusion in the exclude_urls attribute) // int IsDisallowed(String url) { return _disallow.match(url, 0, 0); } private: String _host; int _port; int _bad_server; // TRUE if we shouldn't use this one int _connection_space; // Seconds between connections HtDateTime _last_connection; // Time of last connection to this server HtHeap _paths; HtRegex _disallow; // This pattern will be used to test paths int _documents; // Number of documents visited int _max_documents; // Maximum number of documents from this server bool _persistent_connections; // Are pcs allowed bool _head_before_get; // HEAD call before a GET? bool _disable_cookies; // Should we send cookies? int _timeout; // Timeout for this server unsigned int _tcp_wait_time; // Wait time after a timeout // has been raised. unsigned int _tcp_max_retries; // Max number of retries when // connection is not possible // and timeout occurs String _user_agent; // User agent to use for this server String _accept_language; // Accept-language to be sent // for the HTTP server }; #endif ���������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/URLRef.cc�����������������������������������������������������������������������0100644�0063146�0012731�00000001712�10055635544�015100� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // URLRef.cc // // URLRef: A definition of a URL/Referer pair with associated hopcount // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: URLRef.cc,v 1.9 2004/05/28 13:15:16 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "URLRef.h" //***************************************************************************** // URLRef::URLRef() // URLRef::URLRef() { hopcount = 0; } //***************************************************************************** // URLRef::~URLRef() // URLRef::~URLRef() { } //***************************************************************************** // int URLRef::compare(const URLRef& to) const { return hopcount - to.hopcount; } ������������������������������������������������������htdig-3.2.0b6/htdig/URLRef.h������������������������������������������������������������������������0100644�0063146�0012731�00000002161�10055635544�014741� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // URLRef.h // // URLRef: A definition of a URL/Referer pair with associated hopcount // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: URLRef.h,v 1.9 2004/05/28 13:15:16 lha Exp $ // // #ifndef _URLRef_h_ #define _URLRef_h_ #include "Object.h" #include "htString.h" #include "URL.h" class URLRef : public Object { public: // // Construction/Destruction // URLRef(); ~URLRef(); const URL &GetURL() const {return url;} int GetHopCount() const {return hopcount;} const URL &GetReferer() const {return referer;} void SetURL(const URL &u) {url = u;} void SetHopCount(int h) {hopcount = h;} void SetReferer(const URL &ref) {referer = ref;} int compare(const Object& to) const { return compare((const URLRef&) to); } int compare(const URLRef& to) const; private: URL url; URL referer; int hopcount; }; #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/htdig.cc������������������������������������������������������������������������0100644�0063146�0012731�00000033102�10055635544�015076� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // htdig.cc // // htdig: Indexes the web sites specified in the config file // generating several databases to be used by htmerge // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: htdig.cc,v 1.42 2004/05/28 13:15:16 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Document.h" #include "Retriever.h" #include "StringList.h" #include "htdig.h" #include "defaults.h" #include "HtURLCodec.h" #include "WordContext.h" #include "HtDateTime.h" #include "HtURLRewriter.h" //////////////////////////// // For cookie jar //////////////////////////// #include "HtCookieJar.h" #include "HtCookieMemJar.h" #include "HtCookieInFileJar.h" #include "HtHTTP.h" //////////////////////////// // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include <getopt.h> #elif HAVE_GETOPT_LOCAL #include <getopt_local.h> #endif #ifdef HAVE_STD #include <iostream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <iostream.h> #endif /* HAVE_STD */ // // Global variables // int debug = 0; int report_statistics = 0; DocumentDB docs; HtRegexList limits; HtRegexList limitsn; FILE *urls_seen = NULL; FILE *images_seen = NULL; String configFile = DEFAULT_CONFIG_FILE; String minimalFile = 0; HtDateTime StartTime; HtDateTime EndTime; void usage(); void reportError(char *msg); // // Start of the program. // int main(int ac, char **av) { int c; extern char *optarg; String credentials; int initial = 0; int alt_work_area = 0; int create_text_database = 0; char *max_hops = 0; // Cookie jar dynamic creation. HtCookieJar* _cookie_jar = new HtCookieMemJar(); // new cookie jar if (_cookie_jar) HtHTTP::SetCookieJar(_cookie_jar); //extern int yydebug; //yydebug=1; // // Parse command line arguments // while ((c = getopt(ac, av, "lsm:c:vith:u:a")) != -1) { unsigned int pos; switch (c) { case 'c': configFile = optarg; break; case 'v': debug++; break; case 'i': initial++; break; case 't': create_text_database++; break; case 'h': max_hops = optarg; break; case 's': report_statistics++; break; case 'u': credentials = optarg; for (pos = 0; pos < strlen(optarg); pos++) optarg[pos] = '*'; break; case 'a': alt_work_area++; break; case 'm': minimalFile = optarg; max_hops = "0"; break; case '?': usage(); default: break; } } // Shows Start Time if (debug>0) cout << "ht://dig Start Time: " << StartTime.GetAscTime() << endl; // // First set all the defaults and then read the specified config // file to override the defaults. // HtConfiguration* const config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configFile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configFile.get())); } config->Read(configFile); // Warn user if any obsolete options are found in config file // For efficiency, check all fields here. If different config // files are used for searching, obsolete options may remain char *deprecatedOptions [] = { "heading_factor_1", "heading_factor_2", "heading_factor_3", "heading_factor_4", "heading_factor_5", "heading_factor_6", "modification_time_is_now", "pdf_parser", "translate_amp", "translate_lt_gt", "translate_quot", "uncoded_db_compatible", "" // empty terminator }; char **option; for (option = deprecatedOptions; **option; option++) { if (!config->Find(*option).empty()) cout << "Warning: Configuration option " << *option << " is no longer supported\n"; } if (config->Find("locale").empty() && debug > 0) cout << "Warning: unknown locale!\n"; if (max_hops) { config->Add("max_hop_count", max_hops); } // Set up credentials for this run if (credentials.length()) config->Add("authorization", credentials); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); // // Check url_rewrite_rules for errors. String url_rewrite_rules = HtURLRewriter::instance()->ErrMsg(); if (url_rewrite_rules.length() != 0) reportError(form("Invalid url_rewrite_rules: %s", url_rewrite_rules.get())); // // If indicated, change the database file names to have the .work // extension // if (alt_work_area != 0) { String configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } configValue = config->Find("md5_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("md5_db", configValue); } } // Imports the cookies file const String CookiesInputFile = config->Find("cookies_input_file"); if (CookiesInputFile.length()) { if (debug>0) cout << "Importing Cookies input file " << CookiesInputFile << endl; int result; HtCookieJar::SetDebugLevel(debug); // Set the debug level HtCookieInFileJar* cookie_file = new HtCookieInFileJar(CookiesInputFile, result); if (cookie_file) { if (!result) { if (debug>0) cookie_file->ShowSummary(); delete _cookie_jar; // Deletes previous cookie jar _cookie_jar = (HtCookieJar*) cookie_file; // set the imported one HtHTTP::SetCookieJar(_cookie_jar); // and set the new HTTP jar } else if (debug > 0) cout << "Warning: Import failed! (" << CookiesInputFile << ")" << endl; } else reportError(form("Unable to load cookies file '%s' in memory", CookiesInputFile.get())); } // // If needed, we will create a list of every URL we come across. // if (config->Boolean("create_url_list")) { const String filename = config->Find("url_list"); urls_seen = fopen(filename, initial ? "w" : "a"); if (urls_seen == 0) { reportError(form("Unable to create URL file '%s'", filename.get())); } } // // If needed, we will create a list of every image we come across. // if (config->Boolean("create_image_list")) { const String filename = config->Find("image_list"); images_seen = fopen(filename, initial ? "w" : "a"); if (images_seen == 0) { reportError(form("Unable to create images file '%s'", filename.get())); } } // // Set up the limits list // StringList l(config->Find("limit_urls_to"), " \t"); limits.setEscaped(l, config->Boolean("case_sensitive")); l.Destroy(); l.Create(config->Find("limit_normalized"), " \t"); limitsn.setEscaped(l, config->Boolean("case_sensitive")); l.Destroy(); // // Open the document database // const String filename = config->Find("doc_db"); if (initial) unlink(filename); const String index_filename = config->Find("doc_index"); if (initial) unlink(index_filename); const String head_filename = config->Find("doc_excerpt"); if (initial) unlink(head_filename); if (docs.Open(filename, index_filename, head_filename) < 0) { reportError(form("Unable to open/create document database '%s'", filename.get())); } const String word_filename = config->Find("word_db"); if (initial) { unlink(word_filename); unlink((word_filename + "_weakcmpr").get()); // Remove "duplicate detection" database unlink(config->Find("md5_db")); // using -i, also ignore seen-but-not-processed URLs from last pass unlink(config->Find("url_log")); } // Initialize htword WordContext::Initialize(*config); // Create the Retriever object which we will use to parse all the // HTML files. // In case this is just an update dig, we will add all existing // URLs? // Retriever retriever(Retriever_logUrl); if (minimalFile.length() == 0) { List *list = docs.URLs(); retriever.Initial(*list); delete list; // Add start_url to the initial list of the retriever. // Don't check a URL twice! // Beware order is important, if this bugs you could change // previous line retriever.Initial(*list, 0) to Initial(*list,1) retriever.Initial(config->Find("start_url"), 1); } // Handle list of URLs given in a file (stdin, if "-") specified as // argument to -m or as an optional trailing argument. if (optind < ac) { if (debug) if (minimalFile.length() != 0) cout << "Warning: argument " << av[optind] << " overrides -m " << minimalFile << endl; minimalFile = av[optind]; } if (strcmp (minimalFile.get(), "-") == 0) { String str; // Why not combine this with the code below, with input = stdin ? while (!cin.eof()) { cin >> str; str.chop("\r\n"); // (Why "\r\n" here and "\r\n\t " below?) if (str.length() > 0) retriever.Initial(str, 1); } } else if (minimalFile.length() != 0) { FILE *input = fopen(minimalFile.get(), "r"); char buffer[1000]; if (input) { while (fgets(buffer, sizeof(buffer), input)) { String str(buffer); str.chop("\r\n\t "); if (str.length() > 0) retriever.Initial(str, 1); } fclose(input); } else { cerr << "Could not open argument '" << minimalFile << "' of flag -m\n"; exit (1); } } // // Go do it! // retriever.Start(); // // All done with parsing. // // // If the user so wants, create a text version of the document database. // if (create_text_database) { const String doc_list = config->Find("doc_list"); if (initial) unlink(doc_list); docs.DumpDB(doc_list); const String word_dump = config->Find("word_dump"); if (initial) unlink(word_dump); HtWordList words(*config); if(words.Open(config->Find("word_db"), O_RDONLY) == OK) { words.Dump(word_dump); } } // // Cleanup // if (urls_seen) fclose(urls_seen); if (images_seen) fclose(images_seen); // // If needed, report some statistics // if (report_statistics) { retriever.ReportStatistics("htdig"); } // Shows End Time if (debug>0) { EndTime.SettoNow(); cout << "ht://dig End Time: " << EndTime.GetAscTime() << endl; } if (_cookie_jar) delete _cookie_jar; } // // Display usage information for the htdig program // void usage() { cout << "usage: htdig [-v][-i][-c configfile][-t][-m minimalfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a nice progress report while digging.\n\n"; cout << "\t-i\tInitial. Do not use any old databases. This is\n"; cout << "\t\taccomplished by first erasing the databases.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead of the\n"; cout << "\t\tdefault.\n\n"; cout << "\t-t\tCreate an ASCII version of the document database.\n"; cout << "\t\tThis database is easy to parse with other programs so\n"; cout << "\t\tthat information can be extracted from it.\n\n"; cout << "\t-h hopcount\n"; cout << "\t\tLimit the stored documents to those which are at\n"; cout << "\t\tmost hopcount links away from the start URL.\n\n"; cout << "\t-s\tReport statistics after completion.\n\n"; cout << "\t-u username:password\n"; cout << "\t\tTells htdig to send the supplied username and\n"; cout << "\t\tpassword with each HTTP request. The credentials\n"; cout << "\t\twill be encoded using the 'Basic' authentication scheme.\n"; cout << "\t\tThere *HAS* to be a colon (:) between the username\n"; cout << "\t\tand password.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htdig to append .work to database files, causing\n"; cout << "\t\ta second copy of the database to be built. This allows\n"; cout << "\t\tthe original files to be used by htsearch during the\n"; cout << "\t\tindexing run.\n\n"; cout << "\t-m minimalfile (or just a file name at end of arguments)\n"; cout << "\t\tTells htdig to read URLs from the supplied file and index\n"; cout << "\t\tthem in place of (or in addition to) the existing URLs in\n"; cout << "\t\tthe database and the start_url. With the -m, only the\n"; cout << "\t\tURLs specified are added to the database. A file name of\n"; cout << "\t\t'-' indicates the standard input.\n\n"; exit(0); } // // Report an error and die // void reportError(char *msg) { cout << "htdig: " << msg << "\n\n"; exit(1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/htdig.h�������������������������������������������������������������������������0100644�0063146�0012731�00000002211�10055635544�014735� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // htdig.h // // htdig: Indexes the web sites specified in the config file // generating several databases to be used by htmerge // // Part of the ht://Dig package <http://www.htdig.org/> // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // <http://www.gnu.org/copyleft/lgpl.html> // // $Id: htdig.h,v 1.16 2004/05/28 13:15:16 lha Exp $ // #ifndef _htdig_h_ #define _htdig_h_ #include "HtConfiguration.h" #include "List.h" #include "DocumentDB.h" #include "StringMatch.h" #include "htconfig.h" #include "HtRegexList.h" #include <stdlib.h> #ifndef _MSC_VER /* _WIN32 */ #include <unistd.h> #endif #ifdef HAVE_STD #include <fstream> #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include <fstream.h> #endif /* HAVE_STD */ #include <stdio.h> extern int debug; extern DocumentDB docs; extern HtRegexList limits; extern HtRegexList limitsn; extern HtRegexList excludes; extern HtRegexList badquerystr; extern FILE *urls_seen; extern FILE *images_seen; extern void reportError(char *msg); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdig/docu/���������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�014414� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdoc/��������������������������������������������������������������������������������0040755�0063146�0012731�00000000000�10063260370�013464� 5����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdoc/.cvsignore����������������������������������������������������������������������0100644�0063146�0012731�00000000011�06772705363�015473� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Makefile �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdoc/COPYING�������������������������������������������������������������������������0100644�0063146�0012731�00000063147�07676137245�014553� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������As decided by the HtDig Board Members and ratified by the HtDig Membership in October of 2002 the HtDig codebase is now licensed under the LGPL. The primary reason for doing this is to promote wider usage of HtDig by allowing more liberal use of the code as a library while preserving the "all changes/improvements must be given back" philosophy of the GPL. Here's a quote from the FSF site [http://www.gnu.org/philosophy/why-not-lgpl.html] "Using the ordinary GPL is not advantageous for every library. There are reasons that can make it better to use the Library GPL in certain cases. The most common case is when a free library's features are readily available for proprietary software through other alternative libraries. In that case, the library cannot give free software any particular advantage, so it is better to use the Library GPL for that library." ----------------------------------------------------------------------- GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdoc/ChangeLog�����������������������������������������������������������������������0100644�0063146�0012731�00001221314�10063260173�015240� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mon Jun 14 10:08:01 CEST 2004 Gabriele Bartolini <angusgb@users.sourceforge.net> * Tagged release htdig-3-2-0b6 Sun 13 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * db/os_abs.c, (db/os_abs.c.win32 removed): Re-fix Cygwin bug (#814268, fixed 25 Apr) so that it won't be clobbered by autotools. Sat 12 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdoc/RELEASE.html: Separated bug fixes from new features * htdoc/{htdig,htfuzzy}.html, installdir/{htdig,htfuzzy}.1.in: Added list of database files used * htdoc/{htdump,htmerge,htnotify,htpurge,hts_general,htstat,rundig}.html: Hyperlinked COMMON_DIR, BIN_DIR, DATABASE_DIR to attrs.html. * htcommon/defaults.cc, htdoc/attrs.html.in: Remove reference to deprecated '-l' option (generate URL log) of htdig. Fri Jun 11 11:48:40 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.cc (phrase): Applied Lachlan's patch to prevent endless loop when boolean keywords appear in a phrase in boolean match method. Fri Jun 11 11:26:56 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * db/hash.c (CDB___ham_open): Applied Red Hat's h_hash patch, to ensure that hash function always set to something valid. Fri Jun 11 10:53:49 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/HtFileType: Added -f to rm command. * htsearch/parser.cc (perform_or): Added missing & in if clause. * contrib/htdig-3.2.0.spec: Updated for 3.2.0b6. * installdir/Makefile.{am,in}: Don't stick $(DESTDIR) in HtFileType. Thu Jun 10 16:39:36 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/conf_(lexer.lxx,parser.yxx): applied Gilles' patch (April 22) which features: - improved error handling, gives file name and correct line number, even if using include files - allows space before comment, because otherwise it would just complain about the "#" character and go on to parse the text after it as a definition - allows config file with an unterminated line at end of file, by pushing an extra newline token to the parser at EOF - parser correctly handles extra newline tokens, by moving this handling out of simple_expression, and into simple_expression_list and block, as simple_expression must return a new ConfigDefaults object and a newline token doesn't cut it (caused segfaults when dealing with fix above) * htcommon/conf_lexer.cxx: Regenerate using flex 2.5.31. * htcommon/conf_parser.cxx: Regenerate using bison 1.875a. Wed Jun 9 12:32:47 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Fixed meta date handling fix of June 3 to ensure null byte gets put in by get() call. Wed 9 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * contrib/doc2html/doc2html.pl, installdir/mime.types: Add support for OpenOffice.org documents (#957305) Sat 5 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * test/t_htdig, test/t_factors: fix tests for non-gnu/linux systems. Sat 5 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdoc/cf_generate.pl: Hyperlink to simplify finding the defaults of attributes defined in terms of others (e.g., accents_db->database_base->database_dir). * htdoc/attrs.html.in: regenerated using cf_generate.pl Sat 5 Jun 2004 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Escaped new-line in "allow_spaces_in_url" entry. Set no_next_page_text to ${next_page_text}; likewise no_prev_page_text. Fri Jun 4 10:23:53 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/URL.cc: added "allow_space_in_url" (from fileSpace.1 patch) * htcommon/defaults.[cc,xml]: added documentation of allow_space_in_url * htdoc/attrs.html.in: regenerated using cf_generate.pl * htdoc/cf_byname.html: ditto * htdoc/cf_byprog.html: ditto * htdoc/RELEASE.html: updated with info regarding this attribute Thu Jun 3 16:04:23 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Fixed meta date handling to avoid inadvertently matching names like DC.Date.Review. Thu Jun 3 10:01:50 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdoc/RELEASE.html: updated release notes and changes * htdoc/THANKS.html: updated the 'thanks' section Thu Jun 3 09:32:52 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * global: updated with 'autoreconf -if' (autoconf 2.59, libtool 1.5.6 and automake 1.7.9) Wed Jun 2 19:03:14 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * contrib/rtf2html: added the rtf2html.c source as modified by David Lippi and Gabriele Bartolini of the Comune di Prato. The source code is now released under GNU GPL and included in the ht://Dig package. Tue Jun 1 20:23:40 CEST 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/HtSGMLCodec.cc: changed ¤ to € Fri 28 May 2004 Lachlan Andrew <lha at users.sourceforge.net> * Most files: Update copyright to 2004 Sun 23 May 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdocs/FAQ.html: Sync with maindocs Sun 23 May 2004 Lachlan Andrew <lha at users.sourceforge.net> * configure, configure.in: Resolve variables (e.g., BINDIR) copied into attrs.html, without introducing "NONE" prefix detected by Gabriele. Sun 23 May 2004 Lachlan Andrew <lha at users.sourceforge.net> * .version, htdoc/RELEASE.html, htdoc/where.html, htdoc/attrs.html.in, htdoc/cf_byname.html, htdoc/cf_byprog.html: Prepare docs for release of 3.2.0b6. Mon Apr 26 15:12:22 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Soundex.cc (generateKey): Applied Alex Kiesel's fix to prevent segfaults when word has no letters. Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdig/HTML.cc: Handle empty noindex_start/noindex_end lists. * htlib/StringList.{cc,h}: const-correctness of Add/Insert/Assign(char*) * redo mistakenly backed out patch... Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/parser.cc: Address (but not fix) bug #934739 If collection->getDocumentRef() on line 889 returns NULL, don't crash. I'm still trying to work out why it does return NULL -- I don't think it ever should. * mistakenly back out previous patch :( Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdig/Retriever.{h,cc}, htcommon/defaults.cc, htdoc/FAQ.html: Add store_phrases attribute. If it is false, htdig only stores the first occurrence of each word in a document. This reduces the database size dramatically, and slightly increases digging speed. Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * db/{aclocal.m4,configure,os_abs.c.win32}, STATUS, htdoc/THANKS.html: Correctly dected paths beginning C: as absolute paths in cygwin/Win32. Fixes bug #814268. Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * htdig/Retriever.cc: Gilles's patch to avoid regex compile for every URL encountered. Sun 25 Apr 2004 Lachlan Andrew <lha at users.sourceforge.net> * contrib/htdig-3.2.0.spec: Karl Eichwalder's patch to use mktemp to create safe temp file. Wed Apr 7 17:12:33 2004 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (IsValidURL): Fixed bug #931377 so bad_extensions and valid_extensions not thrown off by periods in query strings. Mon Mar 15 11:56:04 CET 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htsearch/Display.cc: changed (and fixed) the date factor formula as Lachlan and David Lippi suggested, in order not to give negative results. Fri Mar 12 09:13:28 CET 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: removed 'eval' expressions which caused the 'NONE' prefix path to be instantiated and the make script to hang * acinclude.in: fixed AC_DEFINEs for SSL and ZLIB check macros, which prevented autoheader (and therefore autoreconf) to correctly work * moved manual pages from htdoc to installdir * htdoc/[manpages].in: removed * installdir/*.[1,8]: removed man pages (htdig-pdfparser.1, htdig.1, htdump.1, htfuzzy.1, htload.1, htmerge.1, htnotify.1, htpurge.1, htsearch.1, htstat.1, rundig.1, htdigconfig.8) * installdir/*.[1,8].in: added pre-configure man pages (htdig-pdfparser.1.in, htdig.1.in, htdump.1.in, htfuzzy.1.in, htload.1.in, htmerge.1.in, htnotify.1.in, htpurge.1.in, htsearch.1.in, htstat.1.in, rundig.1.in, htdigconfig.8.in) * regenerated configure scripts with autoreconf * fixes bug #909674 Sat 21 Feb 2004 Lachlan Andrew <lha at users.sourceforge.net> * installdir/HtFileType: Use mktemp to create safe temp file (bug #901555) Wed Feb 25 11:14:45 CET 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdocs/THANKS.html: added Robert Ribnitz to the 'thanks' page and fixed Nenciarini's position (it was not in alphabetical order - sorry!). Wed Feb 25 11:02:37 CET 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * installdir/*.[1,8]: added man pages (htdig-pdfparser.1, htdig.1, htdump.1, htfuzzy.1, htload.1, htmerge.1, htnotify.1, htpurge.1, htsearch.1, htstat.1, rundig.1, htdigconfig.8) provided by Robert Ribnitz <ribnitz at linuxbourg.ch> of the Debian Project * installdir/Makefile.am: prepared the automake script for correctly handling the man pages Sat 21 Feb 2004 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/htsearch.cc: Back out change of 21 December, as it causes problems with characters which *should* be unencded, like / Thu 19 Feb 2004 Lachlan Andrew <lha at users.sourceforge.net> * aclocal.m4, acinclude.m4, configure.in: Remove duplicate tests for zlib Fix tests for SSL (Fixes bug #829081) Fix configure --help formatting * htdoc/*.[18].in, htdoc/Makefile.am, configure.in: Added man pages * htdoc/attrs.html.in, htdoc/cf_generate.pl, htdoc/Makefile.am: Fill in #define'd attribs (Fixes bug #692125) * test/Makefile.am: Incorporate new tests in make check * test/t_htdig, test/t_parsing: suppress unwanted diagnostics * STATUS: list Cygwin bug (#814268) * htcommon/default.cc: added wordlist_cache_inserts, remove worlist_cache_dirty_level * configure, */Makefile.in, */Makefile, htdoc/cf_by{name,prog}.html: regenerated Fri 13 Feb 2004 Lachlan Andrew <lha at users.sourceforge.net> * db/mp_cmpr.c: Fix bug with --without-zlib Sun 8 Feb 2004 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/URL.cc: Make server_alias case insensitive. * htdig/Document.cc: Don't hex-decode twice. (Caused problems with names like file%20name) * htdig/Retriever.cc: Test validity of URL value *before* calling signature(), as that implictly normalises, and confuses limit_normalised vs limit_urls_to * htdig/htdig.cc: Remove stale md5_db if -i specified * installdir/htdig.conf: Set common_url_parts to contain all strings which *must* be in a valid URL. Probably contains whole domain name, so more compression than using standard strings. * htcommon/defaults.cc: Update docs. Remove default "bad_extensions" from common_url_parts, and add .shtml * test/t_htdig, test/t_htdig_local: Update self-tests Tue Feb 3 18:06:38 CET 2004 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/HtConfiguration.cc: changed the Find method in order not to ignore empty string results for string attributes whenever they are defined in the configuration file by the user * htdig/Document.cc: fixed bugs in handling the http_proxy, http_proxy_authorization, authorization attributes * htlib/Configuration.[h,cc]: added the Exists method in order to query whether an attribute's definition is present in the configuration dictionary (before it was checked against its string's length which prevented empty attributes to be correctly used) * these changes fix bug #887552 Sun 18 Jan 2004 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/URL.cc, test/url.cc: Rename "allow_dbl_slash" to "allow_double_slash", to match defaults.cc * htcommon/default.cc, htdoc/{hts_temlates,attrs}.html: Explain that keywords_factor applies to meta keywords. Fix old typo. * test/t_{factors,templates}, test/htdocs/set1/{title.html,bad_local.htm} * test/conf/entry-template: Expanded test suite. Sat 17 Jan 2004 Lachlan Andrew <lha at users.sourceforge.net> * test/t_{parsing,htdig_local,factors,templates}, * test/htdocs/set1/title.html: Expanded test suite. Sat 17 Jan 2004 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/DocumentRef.cc: Fix old-style use of HtConfiguration, so defaults are read correctly. Causes max_descriptions to be treated correctly. * htcommon/default.cc, htdoc/{hts_temlates,attrs,cf_byname,cf_byprog}.html: Explain that max_description{s,_length} don't affect indexing -- only text used to fill in template variables. Mon 12 Jan 2004 Lachlan Andrew <lha at users.sourceforge.net> * Very many files: Fix bug #873965 Replace C++ style comments with C style comments in all C files, and .h files they include. Also, change //_WIN32 to /* _WIN32 */ in .cc files for uniformity. Mon 12 Jan 2004 Lachlan Andrew <lha at users.sourceforge.net> * test/t_parsing, test/test_functions.in: Add new tests * htcommon/default.cc, htdoc/hts_templates.html: Cross-ref documentation. Mon Dec 29 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/Retriever.cc: Fix bug in which validity of first URL from each server was not checked. Mon Dec 29 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/htdig.cc, htdoc/htdig.html: Fix bug #845054 Fix behaviour of -m and additional list of urls at the end of a command. In either case, "-" denotes stdin. Mon Dec 29 2003 Lachlan Andrew <lha at users.sourceforge.net> * installdir/rundig, installdir/Makefile.{in,am}: Address bug #860708 Make bin/rundig -a handle multiple database directories Sun Dec 21 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/htsearch.cc: Improve handling of restrict/exclude URLs with spaces or encoded chars Sun Dec 21 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/HtURLSeedScore.cc, htsearch/SplitMatches.cc: Fix bug #863860 Split patterns at "|". For SplitMatches, make "*" only match if all other patterns fail. Sun Dec 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/Server.cc: Fix bug #851303. Allow indexing if robots.txt has an empty "disallow". * test/t_htdig, test/t_htsearch, test/htdocs/robots.txt: Tests for the above. Sun Dec 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/htdig.cc, test/t_factors: Warn if config file has obsolete fields. Sun Dec 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/Display.cc: Apply Gilles's patch for ellipses bug #844828. Sun Dec 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * test/{t_validwords,t_templates,t_fuzzy,t_factors} * test/{set_attr,synonym_dict,dummy.stems,dummy.affixes,bad_word_list} * test/conf/main-template test/htdocs/set1/{site2.html,site4.html}: Added four new tests to test suite. Not included in "make check", but can be run explicitly by "make TESTS=t_... check". Sun Dec 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/conf_lexer.{lxx,cxx}: Back out changes to try to accept files without EOL :( Sat Dec 13 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.{cc,xml}, htdoc/{attrs,cf_byprog}.html: Fix "used by" for max_excerpts, and resulting hyperlinks. Sat Nov 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/conf_lexer.{lxx,cxx}, htcommon/conf_parser.{yxx,cxx}: Partially address bug #823455. Don't complain if config file doesn't end in EOL. Should the grammar be fixed not to need EOL? Report errors to stderr, not stdout, as they confuse the web server. Sun Nov 9 14:44:02 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * Tagged release htdig-3-2-0b5 Sat Nov 8 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/default.cc, htsearch/parser.cc: Fix bug #825877 Reduce backlink_factor to comparable with other factors, and interpret multimatch_factor as the *bonus* given for multiple matches. Sat Nov 1 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/parser.cc: Fix bug #806419. Ignore bad words at start of phrase. Tue Oct 28 11:58:06 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdig/htdig.cc: set the debug level when we are importing a cookie file. Fix bug #831478. Mon Oct 27 17:13:02 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Server.cc: Fix bug #831407. Make sure time properly reset after delay completed, so that it doesn't allow 2 connections per delay. Mon Oct 27 15:57:38 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/THANKS.html: Added Lachlan, Jim and Neal to the active developers list. Sun Oct 26 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdoc/hts_templates.html: Clarify that PREV/NEXTPAGE template variables are empty if there is only one page, ignoring no_{prev,next}_page_text. Sun Oct 26 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Fixed documentation to close bug #829767 Clarified that noindex_start/end do not get replaced by whitespace. Also removed spurious '>' from start of boolean_syntax_errors, and added missing '#' to many local <a href> tags. Sun Oct 26 12:42:27 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/defaults.cc: Fixed description of 'head_before_get' after Lachlan fixes. * htdoc/attrs.html: rerun cf_generate.pl Sat Oct 25 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/Display.cc: Fix #829761. If last component of the URL is used as a title, URL-decode it. Sat Oct 25 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/Server.cc: Fix #829754. Avoid calculations with negative time Fri Oct 24 17:17:15 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/htdig.html, htdoc/meta.html, htdoc/require.html: Update URL for the Standard for Robot Exclusion. * htdoc/htmerge.html: Added two clarifications to -m option description. * htdoc/cf_types.html: Make clear distinction between String List and Quoted String List. Fri Oct 24 15:30:08 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc: Fix bug #829746. Applied Niel Kohl's fix for this, to check if words input given before trying to use it, to avoid NULL argument to syslog(). Fri Oct 24 15:15:53 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc: Fix bug #578570. The enddate handling now works correctly for a large, negative startday value. Fri Oct 24 12:47:51 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (ctor): Fix obvious typo in metadatetags.Pattern setting. Thu Oct 23 10:27:18 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/default.cc: Fix bug #828808. Default startyear to empty Document "startyear defaults to 1970 if a start/end date set". Thu Oct 23 12:14:30 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdig/htdig.cc: restored the code before Oct 21 (fixes ##828628) Thu Oct 23 11:41:15 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdig/Retriever.[h,cc]: removed 'head_before_get' overriding by restoring the code before Oct 21. * htdig/Document.[h,cc]: ditto, with the exception of detaching the HEAD before GET mechanism from the persistent connections'. * htcommon/defaults.cc: improved documentation (even though it needs corrections by an english-speaking developer). * These changes fix bug #828628 Wed Oct 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/parser.cc: Applied Neal's patch to fix bug #823403 Documents only added to search list if they were successfully dug. Lines 237-238 of htsearch/Display.cc if (!ref || ref->DocState() != Reference_normal) continue; should now be redundant. (Left in to be defensive.) Tue Oct 21 11:04:56 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdig/Retriever.h: added the 'RetrieverType' enum and an object variable for storing the type of dig we are performing (default initial); * htdig/Retriever.cc: changed constructor in order to handle the type, added some debugging explanation regarding the override of the 'head_before_get' attribute, added checks regarding an empty database of URLs to be updated (set the type to initial). * htdig/Document.h: added the attribute 'is_initial' which stores the information regarding the type of indexing (initial or incremental) we are currently performing. Added access methods (get-and-set-like) * htdig/Document.cc: modified the logic of the HeadBeforeGet settings during the retrieval phase, in order to always override user's settings in an incremental dig and automatically set the 'HEAD' call in this case. * htcommon/defaults.cc: modified the default value of 'head_before_get' and a bit of its explanation. * htnet/HtHTTP.cc: detached the HEAD before GET mechanism to the persistent connections one * htdig/Server.cc: added one level of debugging to the display of the server settings in the server constructor Fri Oct 17 2003 Lachlan Andrew <lha at users.sourceforge.net> * htword/WordType.cc, htcommon/defaults.cc: Patched to fix bug #823083 Don't assume IsStrictChar returns false for digits. Clarify behaviour of allow_numbers in the documentation. Fri Oct 17 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Patched to fix bug #823455 Escaped "$" in valid_punctuation, and add warnings about $, \ and `. Wed Oct 15 11:12:52 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Server.cc (robotstxt): Patched to fix bug #765726. Don't block paths with subpaths excluded by robots.txt, and make sure any regex meta characters are properly escaped. Tue Oct 14 11:54:07 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: add an empty Accept-Encoding header - this inform the server that htdig is only able to manage documents that are not encoded (if no Accept-Encoding is sent, the server assumes that the client is capable of handling every content encoding - i.e. zipped documents with Apache's mod_gzip module). Partial fix of bug #594790 (which now becomes a feature request) Mon Oct 13 2003 Lachlan Andrew <lha at users.sourceforge.net> * htfuzzy/Regex.cc: Search for regular expression. (Used to ignore it!) * htfuzzy/Speling.cc, htword/{WordList.cc,WordList.h,WordKey.cc,WordKey.h}: When looking in word database for misspelt words, don't ask to match trailing numeric fields in database key. * htcommon/defaults.cc, htdoc/htfuzzy.cc: Update docs. Sun Oct 12 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/htsearch.cc: Fix bug if fuzzy algorithms produced no search words. Send all debugging output to cerr not cout. More debugging output. Sun Oct 12 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/{Retriever,Server}.cc: Back out the previous. Gilles pointed out inconsistency with Retriever::IsValidURL(). Sun Oct 5 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/{Retriever,Server}.cc: Jim Cole's patch to bug #765726. Don't block paths with subpaths excluded by robots.txt. Sun Oct 5 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/htsearch.cc: Highlight phrases containing stop words * test/t_htsearch, test/conf/htdig.conf.in: Tests for the above Sat Sep 27 2003 Lachlan Andrew <lha at users.sourceforge.net> * test/{test_functions.in,t_htdig,t_htdig_local,t_htnet}: Don't assume shell "." command passes arguments. (Doesn't on FreeBSD.) Sat Sep 27 2003 Lachlan Andrew <lha at users.sourceforge.net> * htlib/HtDateTime.h, htnet/HtCookie.cc: Avoid ambiguous function call on systems (HP-UX) where time_t=int Fri Aug 29 09:35:46 MDT 2003 Neal Richter <nealr at rightnow.com> * removed references to CDB___mp_dirty_level ,CDB_set_mp_diry_level() & CDB_get_mp_diry_level() * The config verb 'wordlist_cache_dirty_level' was left for possible use in the future. Thu Aug 28 15:11:21 MDT 2003 Neal Richter <nealr at rightnow.com> * Changed db/LICENSE file to new LGPL compatible license from Sleepycat Software -- Thanks Sleepycat! * Reverted to Revision 1.2 or db/mp_alloc.c The recent changed cuased large DB growth. Strangely the files contained no 'new' data, they were just much larger. Looks like the pages were being flushed too often???? Thu Aug 28 12:41:22 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * global: updated with 'autoreconf -if' (autoconf 2.57, libtool 1.5.0a and automake 1.7.6) * 'make check' successful on: AMD64 Linux 2.4, Alpha Linux 2.2, RedHat Linux 7.3 (2.4), SPARC Ultra60 Linux 2.4, Sparc R220 Sun Solaris (5.8). * README.developer: added further info Thu Aug 28 12:00:10 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * db/[config.guess,config.sub,install-sh,ltmain.sh,missing]: added in the database directory (this way 'make dist' goes on); I have not been able to tell the db/configure script to get the 'top_srcdir' ones (which should be the default behaviour). Maybe in the future we'll look for this. Thu Aug 28 11:53:48 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * db/configure.in: changed AC_PROG_INSTALL() to AC_PROG_INSTALL and removed AC_CONFIG_AUX_DIR; this implies that autotools copies will be made for the db directory as well. Thu Aug 28 11:36:42 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * [htcommon,htdb,htdig,htfuzzy,htlib,htnet,htsearch,httools,htword,test]/Makefile.am: added the option above to every *_LDFLAGS Thu Aug 28 11:30:39 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * Makefile.am: removed acconfig.h from the EXTRA_DIST list Thu Aug 28 11:25:07 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: removed portability checks for error, stat and lstat that caused a compile errors on Solaris. Added the '-mimpure-text' extra ld flag for GCC on solaris systems (a linkage error occurs when libstdc++ is not shared) Thu Aug 28 11:22:57 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * include/Makefile.am: changed htconfig.h.in into config.h.in Thu Aug 28 11:16:19 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/error.[h,c]: removed for now, until replacement functions will be correctly performed. Thu Aug 28 11:11:32 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdoc/cf_generate.pl: fixed an error when opening tail and head files * Makefile.am: enabled rebuild from a different directory (it is used my 'make dist') Thu Aug 28 10:46:35 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/malloc.c: modified according to autoconf specifications as far as replacement functions are regarded * htlib/[lstat, stat].c: removed for now Thu Aug 28 10:40:58 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdoc/cf_generate.pl: accept an optional parameter (top source directory) * htcommon/defaults.cc: fixed some broken lines which prevented cf_generate.pl from correctly working * htdoc/Makefile.am: modified the automake file for passing the top source directory to cf_generate.pl * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. Tue Aug 26 12:25:40 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: removed AC_FUNC_MKTIME because it may not work properly and added default replacement directory (htlib) for future uses * htlib/Makefile.am: back-step with re-inclusion of mktime.c in the list of files to be always compiled (caused linking errors for the __mktime_internal function) * global: updated with 'autoreconf -if' Sun Aug 24 12:44:29 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * updated with 'autoreconf -if': autoconf 2.57, automake 1.7.6 and libtool 1.5.0a (autotools that come with Debian SID) Sun Aug 24 12:39:34 EST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: moved AC_PROG_LEX to AM_PROG_LEX * db/configure.in: enabled AM_MAINTAINER_MODE which prevented users without autotools to configure and compile the program (relatively to the db directory) * include/htconfig.h: previously excluded from the branch (severe error!) Mon Jul 21 20:54:47 CEST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/(malloc|error|lstat|stat|realloc).c: added for cross-compiling reasons (as suggested by automake) * htlib/error.h: ditto * db/acconfig.h: removed as suggested by autotools' new versions * configure.in: removed AC_PROG_RANLIB (overriden by AC_PROG_LIBTOOL) * updated as of rerun 'autoreconf -if' Mon Jul 21 10:08:24 CEST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * Patch provided by Marco Nenciarini <mnencia at linux.it> has been completely applied; the patch adds support for detection of standard C++ library * all sources using <iostream.h> <fstream.h> <iomanip.h>: modified to use standard ISO C++ library, if present * db/configure scripts: modified for autoconf 2.57 Mon Jul 21 09:59:16 CEST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * [.,*]/Makefile.in: regenerated by new automake against new configure.in * Makefile.config: now looking for the global configuration file in the source directory Mon Jul 21 09:49:22 CEST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: completely rewritten, deprecated directives have been removed and now version 2.57 is a prerequisite. * acinclude.m4: moved all the macros here * aclocal.m4, configure: regenerated by aclocal and autoconf * acconfig.h: removed as now it is deprecated * include/htconfig.h.in: removed, as 'config.h.in' is preferred and auto-generated * config.[guess,sub]: updated with newer versions Tue Jul 8 16:29:44 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.cc (checkSyntax): Fixed boolean_syntax_errors handling to work over multiple config files. Mon Jul 7 00:41:55 CEST 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * Updated to autoconf 2.57, libtool 1.5 and automake 1.7.5 * removed acconfig.h files * autoconf include file is now include/config.h (for autoheader) * include/htconfig.h.in renamed in include/htconfig.h: now includes config.h and redefines the bool types * htlib/HtRegexList.cc, htdig/(Document.cc|ExternalParser.cc): removed TRUE and FALSE and converted to C++ standard values Sat Jul 5 2003 Lachlan Andrew <lha at users.sourceforge.net> * test/test_functions.in: Fix bugs starting/killing apache Sat Jul 5 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Disable cache flushing to avoid "page leak". Tue Jun 24 2003 Neal Richter <nearl at rightnow.com> * Update Copyright Notices in code & documentation to 2003 * Changed License Notice GPL -> LGPL License change (Decided by HtDig Board & Membership October 2002 Mon Jun 23 2003 Neal Richter <nearl at rightnow.com> * Raft of changes. Most todo with Native Win32 support * TODO: ExternalTranport & ExternalParser are effectively dissabled with #ifdefs for Native WIN32 * remove global CDB___mp_dirty_level variable and subsitute functions to set/get variable * Added local copies of GNU LGPL regex, POSIX-like dirent routines, getopt library and filecopy routines - mainly for Native WIN32 support * improve IsValidURL with return codes (htdig/Retriever.cc) * lots of improvements/new-features to libhtdig Sun Jun 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/mp_cmpr.c (CDB___memp_cmpr_open): Make weak compression database standalone to avoid recursion This *should* fix all of the recent problems with dirty cache etc. * test/search.cc: Don't take sizeof zero sized array Fri Jun 20 2003 Lachlan Andrew <lha at users.sourceforge.net> * configure,aclocal.m4,acinclude.m4: --with-ssl set CPPFLAGS, not CFLAGS Fri Jun 20 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/configure: Hack which should allow select to be detected on HP/UX * db/db.c: Replace HAVE_ZLIB with HAVE_LIBZ (as set by configure) * htword/wordKey.cc: More descriptive error message (Changes to compile with Sun's C++) * htnet/{HtCookie.cc,HtFTP.cc,Transport.cc}: Assign substring of const string to const pointer. * htsearch/ResultMatch.h: Allow use of SortType in ResultMatch::setSortType() * test/search.cc: Don't take sizeof(variable size array) * htdb/htdb_stat.cc: avoid name clash for global var internal * htcommon/URL.h, htlib/HtTime.h, htlib/htString.h, htnet/Connection.h, htword/WordBitCompress.h: Cast default args of type string literal to type (char*) * htdocs/require.html: Remove email address. * htlib/gregex.h: Avoid warning if __restrict_arr already defined Sun Jun 14 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Set wordlist_cache_dirty_level to 1 (it most conservative value). Miscellaneous reformatting. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. * htdoc/{require.html,meta.html,all.html,meta.html}: Update disk usage for phrase searching. Updated list of supported platforms. More hyperlinks. Fri Jun 13 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/Display.cc (setVariables), htdocs/hts_template.html: Set MATCH_MESSAGE from method_names (for internationalisability). Removed all trace of hack for config attribute... Thu Jun 12 14:16:05 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (main): Fixed boolean_keywords handling to work over multiple config files (must destroy old list before creating new one). * htcommon/defaults.cc, htsearch/Display.cc (setVariables): Removed incorrect default value for "config" attribute, and removed hack that attempted to correct it. * htdoc/attrs.html: Regenerated using cf_generate.pl. Thu Jun 12 13:28:01 2003 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc, htcommon/HtSGMLCodec.cc (ctor): Added translate_latin1 option to allow disable Latin 1 specific SGML translations. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. Mon Jun 9 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/htsearch.cc: Fixed setupWords loop for junk at end of query Mon Jun 9 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/Display.cc: Set CONFIG template variable to the base name of the config file (no directory or .conf), as expected by htsearch Mon Jun 9 2003 Lachlan Andrew <lha at users.sourceforge.net> * test/test_functions.in: avoid trying killing apache multiple times * configure,configure.in: Reformat --help output * htdoc/FAQ.html: Brought up-to-date with main docs * htdoc/hts_templates.html: added hyperlinks. * installdir/search.html: Display version Sun Jun 8 2003 Lachlan Andrew <lha at users.sourceforge.net> * configure: Hack to set --disable-bigfile for Solaris (with Sun cc) and --disable-shared --enable-static for Mac OS X * test/{test_functions.in,t_htdig,t_htdig_local,t_htnet}: Only start Apache for tests which need it, and kill it after the test * contrib/parse_doc.pl: Allow file names containing spaces (from .deb) Mon Jun 2 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/mp_cmpr.c: Add default zlib setting to default_cmpr_info * htcommon/defaults.cc, htword/WordDBCompress.cc: Fix docs to say default compression by 8 (not by 3, which I had "fixed" it to...) * htcommon/conf_lexer.{cxx,lxx}: Avoid warnings, and document hack. Thu May 29 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/mp_cmpr.c: Fix comparison of -1 and unsigned which broke SunOS cc * htdoc/install.html: Warn SunOS cc users to --disable-bigfile * htcommon/conf_lexer.cxx: Suppress warnings of unused identifiers * test/con/htdig.conf2.in: Disable testing of content_classifier attribute, as didn't work until after installation Tue May 27 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/configure, db/ac{local,include}.m4: Stop test for zlib from adding -I/default/path (*this* time...) * htword/DBPage.h: Fix bug introduce in previous patch * test/Makefile.{in,am}: Replace non-portable make -C X by cd X; make Tue May 27 2003 Lachlan Andrew <lha at users.sourceforge.net> * {,db/}configure, {,db/}ac{local,include}.m4: Stop test for zlib from adding -I/default/path (broke SunOS cc) Fix -Wall test if CCC is g++ but CC is not gcc * test/dbbench.cc: #include <fcntl.h> later, to avoid #define open causing problems * includedir/synonyms: Remove trailing blank line which caused warning * htnet/HtCookieInFileJar.cc,htfuzzy/Synonym.cc: .get() to stop warnings * htlib/mhash_md5.c: char -> unsigned char to stop warnings * test/search.cc, htword/WordDBPage.h: Casts to (int) to stop printf warnings. ALLIGN -> ALIGN Sat May 24 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Keep more wordlist cache pages clean * {,db/}configure{,.in}, {,db/}ac{local,include}.m4: Patch by Richard Munroe to test if -Wno-deprecated needed. Many bug fixes / extra search paths added. * include/htconfig.h.in, db/db_config.h.in: Only '#define const' if not C++ (htword/WordDB.cc uses db_config.h) * test/dbbench.cc: check for alloca even if gcc * test/t_url: used grep -C instead of grep -c (for portability) * db/mp_{alloc,cmpr}.c: Removed/replaced C++ style comments * htdoc/require.html: Revised list of supported platforms Thu May 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * htnet/HtFile.cc: Fix previous .get() patch... Thu May 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * htlib/DB_2.cc: Set wordlist_cache_dirty_level before opening database, to avoid database memory allocation problem. * db/db_err.c: Make 'fatal' errors actually exit. * htdig/Document.cc, htsearch/parser.cc, htdig/htdig.cc, * htnet/Ht{HTTP,File}.cc: Add .get() to use of strings to avoid compiler warnings (FreeBSD). Thu May 22 2003 Lachlan Andrew <lha at users.sourceforge.net> * ltmain.sh, test/Makefile.in: Hack to list library dependencies multiple times in g++ command, to get MacOS X to 'make check'. * test/{search,word}.cc: cast sizeof() to (int) to avoid warnings. * htdoc/install.html: Documented MacOS X's shared libraries problem. Sun May 18 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/mp_alloc.c: Hopefully the *last* fix for this morning's patch... * configure, aclocal.m4, acinclude.m4: Look for httpd modules in .../libexec/httpd for OS X * test/conf/httpd.conf: Disabled mod_auth_db, mod_log{agent,referer}. Sun May 18 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/db.h.in: Declare variable introduced in db/mp_cmpr.c patch Sun May 18 2003 Lachlan Andrew <lha at users.sourceforge.net> * db/mp.h, db/mp_{alloc,bh,cmpr,region}.c, * htword/WordDB.cc, htdig/htdig.cc: Avoid infinite loop if memp_alloc has only dirty, "weakly compressed" (i.e. overflow) pages. * htcommon/defaults.cc: Document the above, plus misc updates. * htword/WordDBPage.h: Cast sizeof() to (int) in printf()s to avoid compiler warnings. Sun APR 20 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/htdig.cc: delete db.words.db_weakcmpr if -i specified. Wed Feb 26 22:10:40 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: fixed colon (':') problem with HTTP header parsing, as Frank Passek, Gilles and others suggested, as space is not mandatory between the field declaration and the field value returned by the server Sun Feb 23 10:20:58 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/defaults.[cc,xml]: added the 'cookies_input_file' configuration attribute for pre-loading cookies in memory * htdig/htdig.cc: added the feature above; the code automatically loads the cookies from the input file into the 'jar' that will be used during the crawl. Sun Feb 23 10:16:08 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.h: removed the NULL pointer check before assigning a new jar to the HTTP code Tue Feb 11 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/defaults.cc: Set default compression_level to 6, which enables Neal's wordlist_compression_zlib flag. Tue Feb 11 2003 Lachlan Andrew <lha at users.sourceforge.net> * htcommon/{DocumentRef.h, HtWordReference.h}, htsearch/WeightWord.{cc,h}, htsearch/parser.{cc,h}, htsearch/htsearch.cc: Added field-restricted searching, by title:word or author:word * htdig/ExternalParser.cc, htdig/HTML.{cc,h}, htdig/Parsable.{cc,h}, htdig/Retriever.{cc,h}: Parse author from <meta ...> tags. Also moved some common functionality from HTML/ExternalParser into Parsable. * test/t_htsearch, htcommon/defaults.cc, htdoc/{TODO.html,hts_general.html,hts_method.html}: Test and document the above Sun Feb 9 2003 Lachlan Andrew <lha at users.sourceforge.net> * htdig/HTML.cc: fix bug in detection of deprecated noindex_start/end * htsearch/Display.cc: try harder to find value for DBL_MAX #680836 * htcommon/defaults.cc: fixed typos. Sat Feb 1 13:57:17 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.[h,cc]: allowed printDebug to be passed an ostream object * htnet/HtCookieMemJar.cc: removed a debug call Thu Jan 30 19:28:32 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * configure.in: used AC_LIBOBJ instead of deprecated LTLIBOBJS's workaround * ltconfig: removed as not needed anymore since libtool 1.4 * db/configure.in: added AC_CONFIG_AUX_DIR(../) for letting automake know to use the main ltmain.sh file * configure, aclocal.m4, Makefile.in, */Makefile.in, config.guess, config.sub, install-sh, ltmain.sh, missing, mkinstalldirs: re-generated by autotools: aclocal, autoconf 2.57, automake 1.6.3 and libtool 1.4.3 * db/aclocal.m4, db/configure, db/mkinstalldirs: ditto Thu Jan 30 00:16:51 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htsearch/htsearch.cc: removed a warning due to a not-initialized pointer Wed Jan 29 22:53:25 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * acinclude.m4: included the function for checking against SSL, as found in the ac-archive. Tue Jan 28 12:23:16 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/Makefile.am: added HtCookieInFileJar.[h,cc] files * installdir/cookies.txt: example file for pre-loading HTTP cookies * installdir/Makefile.am: added cookies.txt Tue Jan 28 12:16:28 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookieMemJar.[h,cc]: performed deep copy of the jar in the copy constructor Tue Jan 28 12:13:44 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.[h,cc]: added the constructor of a cookie object from a line of a cookie input file (Netscape's way): if an expiration value of '0' is set through the cookies input file, the cookie is managed as a session cookie. Improved copy constructor, solving a bug related to the expires field. Tue Jan 28 12:11:27 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookieInFileJar.[h,cc]: class for importing cookies from a text file Tue Jan 28 12:08:20 CET 2003 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/HtDateTime.h: added the constructor HtDateTime(const int) Sat Jan 25 2003 Lachlan Andrew <lha at users.sourceforge.net> * htsearch/Display.cc: Convert "<br>\n" in $(DESCRIPTION) to "<br>" so it can be used in Javascript (feature request #529926). Tue Jan 21 2003 Lachlan Andrew <lha at users.sourceforge.net> * HTML.cc (HTML, parse): Handle noindex_start/end as string lists. * test/{t_htsearch,htdocs/set1/script}: Test the above * htcomon/defaults.cc: Add "<SCRIPT" to default noindex_start/end (feature request #586359). * htlib/String.cc (operator>> (istream&,String&) ): Exit loop when getline fails for reasons other than a full buffer. * htnet/HtFile.cc (File2Mime), installdir/HtFileType: Allow file names containing spaces. Sat Jan 11 2003 Lachlan Andrew <lha at users.sourceforge.net> * htnet/HtFile.cc (Request), htdig/Document.cc (RetrieveLocal), htcommon/URL.h htcommon/URLTrans.cc: Decode URL paths before use as local filenames (file:/// & local_urls). * test/{t_htdig,t_htdig_local,t_htsearch}, test/conf/htdig.conf2.in, test/htdocs/set1/{index.html,site 1,sub%20dir/empty file.html}: Tests for the above. * htcommon/HtConfiguration.cc: brackets around assignment in 'if'. * test/search.cc (LocationCompare): Only specify default arg once. Fri Jan 10 2003 Lachlan Andrew <lha at users.sourceforge.net> * htlib/String.cc (operator>> (istream&,String&) ): Check status of stream, no return value of get(). Fixes bug (for some C++ libs) where reading stops at a blank line. Fri Jan 1 2003 Lachlan Andrew <lha at users.sourceforge.net> * htnet/HtFile.cc(Ext2Mime,Request), htdig/Document.cc(RetrieveLocal): Determine local files' MIME types from mime.types, not hard-coded. URLs matching attribute "bad_local_extensions" must use their true transport protocol (HTTP for http://, filesystem for file:///). * htnet/HtFile.cc (File2Mime, Request): For file:/// URLs only, files without (or with unrecognised) extensions are checked by the program specfied by the "content_classifier" attribute. * htnet/htFile.cc (Request): Symbolic links are treated as redirects, to avoid problems with relative references. * htcommon/defaults.cc: Documented the above (and added crossrefs). * test/t_ht{dig,dig_local,search}, test/htdocs/set1/*, test/conf/htdig.conf2.in: Add tests for bad_local_extensions. Mon Dec 31 2002 Lachlan Andrew <lha at users.sourceforge.net> * configure.in,htfuzzy/EndingsDB.cc,htlib/{HtR,r}egex.h,Makefile.am: Renamed regex.h to gregex.h and allow use of rx instead. * htcommon/defaults.cc,htdocs/{attrs,cf_byprog,cf_byname}.html: Fixed typo in cross-references to restrict and limit_urls_to. * test/t_htmerge: Re-enabled htmerge command (discarding output). * test/Makefile,test/conf/htdig.conf3.in: Added conf3 and fixed db path. Mon Dec 30 2002 Lachlan Andrew <lha at users.sourceforge.net> * contrib/doc2html/*: Incorporated David Adams' latest version, 3.0.1. Mon Dec 30 2002 Lachlan Andrew <lha at users.sourcefourge.net> Forward-ported several patches from 3.1.6: * htdig/ExternalParser.cc: Added "description_meta_tag_names" attrib. Added "dc.date|dc.date.created|dc.date.modified" synonyms for "date". Allow spaces between "url" and "=" in refresh. Fixed bug in flag positions. Added "use_doc_date" attribute. * htdig/HTML.cc: Added "description \_meta_tag_names" attribute. Added "dc.date|..." synonyms. Added "ignore_alt_text" attribute. * htdig/Retriever.cc: Added "ignore_dead_servers" attribute. Added call to "url.rewrite() in got_href(). * htdig/FAQ.html: Latest version now 3.1.6. Mention old security hole. Describe external converters for PostScript etc. Mention pdf_parser not supported in 3.2. * htdoc/{attrs,cf_byname,cf_byprog}.html: New attributes added (automatically from defaults.cc). * htdoc/htmerge.html: Update for multiple database support. * htdoc/hts_form.html: Describe relative/incomplete dates. * htdoc/require.html: Describe phrase searching, external parsers, external transports. Added some new supported systems. (Commented out as testing incomplete.) * htfuzzy/Synonym.cc: Protect against "synonym" entries with one word. * htlib/String.cc: Protect against negative string lengths. * htsearch/Display.{cc,h}: Added "search_result_contenttype" attribute, and corresponding displayHTTPheaders() function. Rewrite URLs. Remove old "ANCHOR" variable. Handle relative dates. Added "max_excerpts" attribute and buildExcerpts() function. Added "anchor_target" attribute. * htsearch/DocMatch.h: Added "orMatches" * htsearch/htsearch.cc: Added "boolean_keywords" attribute. Rewrite URLs. * htsearch/parser.cc: Added "boolean_syntax_errors" attribute. Added wildcard search. Fixed bug in perform_phrase() so it now handles "bad words" and short words properly. Added "multimatch_factor" to give greater weight to documents matching multiple "OR" terms. * htsearch/htparser.h: Added boolean_keywords support. * htcommon/defaults.{cc,xml}: New attributes added, and enhanced descriptions Cleaned code to remove some compiler warnings/errors: * htcommon/HtConfiguration.cc: Brackets around assignment 'path=' inside 'if' * htdig/Server.cc, htsearch/Display.cc: Added ".get()" when strings passed as arguments. * htlib/StringMatch.h, htword/WordBitCompress.h: Explicit cast of NULL to (char*)NULL for broken C++ compilers. Also: * STATUS: Removed "not all htsearch input parameters handled properly", "Return all URLs", "Turn on URL parser test", "htsearch phrase support tests". Reduced list of things to do for "require.html". * test/t_htsearch, test/conf/htdig.conf3.in: Added testing of phrases and boolean_keywords / boolean_syntax_errors. Thu Nov 28 09:02:46 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/english.0: Removed S flag from birth, because it doesn't do what we want (birthes, not births). Tue Nov 26 23:16:08 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/hts_form.html: Fixed typo in link & description for restrict. Tue Nov 26 22:30:06 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/english.0: Patched with Lachlan Andrew's changes, fixing lots of dubious uses of suffixes to get more appropriate and correct fuzzy endings expansions. * installdir/synonyms: Updated with the version contributed by David Adams, with minor changes. Kept old one as synonyms.original. Mon Nov 4 10:44:35 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/URL.[h,cc]: added the assignment operator Sun Oct 27 09:29:02 2002 Geoffrey Hutchison <ghutchis at localhost> Merge in word DB zlib patch from Neal Richter. * db/db.h.in, db/mp_cmpr.c, htword/WordList.cc, htword/WordDBCompress.h, htword/WordDBCompress.cc: Add support for using the zlib compression (and compression level) if specified by the new wordlist_compress_zlib, which is "true" by default. * htcommon/defaults.cc: Add attribute wordlist_compress_zlib as above. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Update using cf_generate.pl. Sat Oct 26 21:59:01 2002 Geoffrey Hutchison <ghutchis at localhost> Merge in fixes from Lachlan Andrew * test/Makefile.am, test/Makefile.in, test/t_url, test/url.cc, test/url.children, test/url.parents, test/url.output: Add URL tests to the automatic test suite (rather than requiring them to be run manually). * */Makefile.in: Regenerate using automake-1.4p6. * htcommon/URL.cc, htcommon/URL.h: Add new configuration attribute allow_double_slash to only remove // marks when requested (since some server-side code uses them), handle initial protocols without double slashes, and only remove the default doc string from appropriate protocol URLs (e.g. not file), treat ".//" as a relative path, and collapse /../ *after* // and /./ handling. * htcommon/defaults.cc: Add documentation for allow_double_slash, as well as various documentation cleanups. * htdig/ExternalTransport.cc: Fix minor bug--recognize service specified as https:// rather than https. * htdoc/hts_form.html, htdoc/hts_templates.html: Documentation fixes. * htsearch/htsearch.cc: Create valid boolean query if "exact" not specified in search_algorithms by adding the exact word with low weight. Solves PR#405294. Fri Oct 4 17:05:06 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.xml: Added first-draft XML version of defaults file. This will eventually be used to generate defaults.cc and documentation automatically. (As pointed out by Brian White, this will make the binaries smaller.) Wed Sep 25 13:56:31 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (parse): Fixed handling of JavaScript skipping so it doesn't get confused by "<" in code. Thu Sep 19 09:04:50 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc : another check for cookie jar's null pointer Tue Sep 17 17:41:51 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (external_protocols): Fixed table formatting as suggested by Lachlan Andrew. Thu Aug 29 21:21:34 CEST 2002 Soeren Vejrup Carlsen <svc at users.sourceforge.net> * htdig/Document.[h,cc]: first steps in FTP handling. HtFTP.h included and we now test for the 'ftp' protocol in the Document::Retrieve function. Has not yet been tested! * htnet/HtFTP.[h,cc]: added class to handle the FTP-protocol. Very experimental (has not been tested yet). Fri Aug 9 13:01:05 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * httools/htnotify.cc (readPreAndPostamble): Check for empty strings in file names, not just NULL, as suggested by Martin Kraemer. Wed Aug 7 12:11:31 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Fixed to impose max_doc_size restriction on external converter output which it reads in. Tue Aug 6 18:21:11 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * these changes were suggested by David Reed <DReed1 at citgo.com> (thanks) * htdig/Document.cc: manage cookies via SSL * htnet/HtCookie.[h,cc]: features both RFC2109 and Netscape version * htnet/HtCookieJar.cc: ditto Tue Aug 6 17:12:22 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/defaults.cc: added the 'http_proxy_authorization' attribute. Needs revision due to my usual *spaghetti* english. :-) * htdig/Document.[h,cc]: proxy authorization is now enabled Tue Aug 6 09:28:39 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/Connection.[h,cc]: IP address storing as string (sync with ht://Check) * htnet/Transport.[h,cc]: HTTP Proxy and Basic credentials handling moved here (ditto) through the use of a protected static method * htnet/HtHTTP.h: SetCredentials declared to be virtual (unnecessary because inherited, but gives better understanding); new method SetProxyCredentials for proxy authorization. * htnet/HtHTTP.cc: HTTP header Proxy-Authorization is now handled. The SetCredentials and SetProxyCredentials methods now make use of the Transport::SetHTTPBasicAccessAuthorizationString method, in order to write the string for negotiating the access. Fri Aug 2 15:40:18 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (Retrieve): Allow redirects from HTTPSConnect. Tue Jul 30 12:46:56 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/md5.cc: Added missing include of stdlib.h, as Geoff suggested. Sat Jul 27 11:57:25 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/SSLConnection.cc: Add fix for segfault on SSL connections noticed by several users. Fix contributed by Andy Bach <afbach at users.sourceforge.net>. Tue Jun 18 10:22:01 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (got_word): Check that the word length meets the minimum word length before doing any processing. Fri Jun 14 17:26:21 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (buildMatchList), htsearch/HtURLSeedScore.cc (Match), htsearch/SplitMatches.cc (Match): Added Jim Cole's fix to bugs in handling of search_results_order. Wed May 15 09:45:40 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/Retriever.cc: fixed the bug regarding the server_wait_time feature after the maximum number of requests per connection has been reached. Tue Apr 9 16:41:33 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie*.[h,cc]: RFC2109 compliant. * htlib/HtDateTime.[h,cc]: Add const-ness to the DiffTime static method Tue Apr 9 12:52:30 CEST 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.cc: fixed a bug regarding expiry date recognition Fri Apr 5 14:08:39 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalTransport.cc (Request): Fixed to strip CR from header lines, output header lines with -vvv. Tue Mar 19 08:40:54 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.cc: enhanced controls regarding the expires setting when no expires is returned. Prevents NULL pointer exceptions to be arisen. Mon Mar 18 11:28:02 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/HtDateTime.h: added the copy constructor * htnet/HtCookie.cc: fixed a NULL pointer bug regarding 'datestring' management and HtDateTime copy constructor is now used Tue Mar 12 18:19:49 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtDateTime.cc (Parse, SetFTime): Added Parse method for more flexible parsing of LOOSE/SHORT formats, use it in SetFTime. Also skip unexpected leading spaces in SetFTime, as these frequently cause problems with some strptime() implementations. Mon Feb 11 23:28:37 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.h (got_redirect): Add referer to properly handle broken links through a redirect as reported by Joe Jah. * htdig/Retriever.cc: As above. * htdig/Document.cc (Retrieve): Fix bug that prevented external transport methods from reporting redirects as reported by Jamie Anstice <Jamie.Anstice at sli-systems.com>. * htlib/Dictionary.cc (hashCode): Trial of hash function suggested by Jamie Anstice. Sat Feb 9 18:06:29 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/DocMatch.[h,cc]: Add scoring code for the new htsearch framework. Thu Feb 7 11:32:14 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc (ReadChunkedBody): gets control of Read_Line methods (return error when they fail). Fri Feb 1 17:12:31 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * Merged htdig-3-2-x branch back into CVS mainline. * ChangeLog.0: Update with current 3.1.6 ChangeLog. Thu Jan 24 18:06:04 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, aclocal.m4: Use new CHECK_SSL macro from the autoconf archive. * configure: Generate via autoconf. Fri Jan 18 11:15:29 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Transport.h (class Transport): Add const to SetCredentials method declaration as pointed out by Roman Maeder. Wed Jan 16 13:35:26 2002 Geoff Hutchison <ghutchis at wso.williams.edu> * db/db.h.in: Add #include <sys/stat.h> which seems to help problems of stat64 conflicts on Solaris as suggested by Gilles. Sat Jan 12 16:19:55 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: A few changes to the wording and formatting of the 'accept_language' attribute description. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jan 11 21:18:00 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/defaults.cc: added the 'accept_language' attribute Fri Jan 11 20:53:36 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.[h,cc]: management of the accept-language directive added * htcommon/URL.[h,cc]: const-ness in copy constructor and other cosmetic changes * htlib/Server.[h,cc]: management of the 'accept_language' attribute as a server block configuration directive. * htlib/Document.cc: set of the attribute above for the HTTP layer Fri Jan 11 13:25:49 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalTransport.cc (Request): Fixed to allocate access_time object before setting it. Fri Jan 4 12:31:34 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtCookie.cc, htword/WordKeyInfo.cc, htword/WordMonitor.cc, test/search.cc: changed all uses of strcasecmp to mystrcasecmp for consistency and portability. Fri Jan 4 12:17:10 2002 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtHTTP.cc (HTTPRequest): make the second comparison of the transfer-encoding header the same as the first, i.e. case insensitive and limited to 7 characters. Fri Jan 4 15:13:13 CET 2002 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: parse the transfer-encoding header as case insens. [fix htdig-Bugs-499388 by Matthias Emmert <Matthias.Emmert2 at start.de>] Sun Dec 30 15:47:35 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * HtHTTP.[h,cc]: management of the Content-Language directive for the response Sat Dec 29 13:07:08 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.[h,cc]: new fields (srcURL and isDomainValid) and a more robust class with initialization list and copy constructor * htnet/HtCookieJar.[h,cc]: method for calculating the minimum number of periods that a domain specification of a cookie must have. Depending on what the Netscape cookies specification says. * htnet/HtCookieMemJar.cc: Management of the domain field of the cookie Mon Dec 17 06:45:02 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htdig/htdig.cc: fixed bug about cookie jar creation. It is done in here, because there is only one jar for the whole process. However it can be moved anywhere else. :-) Mon Dec 17 06:40:25 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: check for null pointer of cookie jar Sun Dec 16 19:55:07 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/Connection.[h,cc]: default constructor is changed and accepts a socket value (by default is -1) * htnet/HtCookieJar.[h,cc]: added a simple iterator * htnet/HtCookieMemJar.[h,cc]: ditto * htnet/HtFile: removed the management of modification_time (constructor) * htnet/HtHTTP.[h,cc]: constructor with initilization list and without a default constructor (the construction is now forced to pass a valid connection object). Removed any memory deletion from the destructor. The class is now abstract (see the virtual pure destructor). * htnet/HtHTTPBasic.cc: creates a Connection object in the initialization and the destructor has no responsability * htnet/HtHTTPSecure.cc: creates an SSLConnection object in the initialization and the destructor has no responsability * htnet/HtNNTP.cc: creates a Connection object in the initialization and the destructor has no responsability * htnet/Transport.[h,cc]: default constructor accepts a pointer to a Connection object and the destructor carries out the deletion of it Thu Dec 6 13:24:30 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/examples/rundig.sh: Fixed to make use of DBDIR variable, and to test for and copy db.words.db.work_weakcmpr if it's there. Fri Oct 19 11:07:33 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (IsValidURL): Fixed discrepancies in debug levels for messages giving cause of rejection, inadvertantly changed when regex support added. Wed Oct 17 15:48:23 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalTransport.h: Added missing class keyword on friend declaration. Tue Oct 16 14:35:16 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/default.cc (external_parsers): Documented external converter chaining to same content-type, e.g. text/html->text/html-internal. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Oct 15 22:25:55 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc, htdig/htdig.cc, htdig/Retriever.cc: Make sure setEscaped is called with the current value of case_sensitive. Fixes bug pointed out by Phil Glatz. Fri Oct 12 17:14:08 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/htdump.html, htdoc/htload.html: Fixed 3 little typos. Fri Oct 12 15:11:45 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtHTTP.cc (ParseHeader): Show header lines in debugging output at verbosity level 3, not 4, for consistency with 3.1.x. * htcommon/URL.cc (removeIndex): Fixed to make sure the matched file name is at the end of the URL. Fri Oct 12 10:39:54 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtRegexList.cc (setEscaped): Fixed to set compiled flag to FALSE when there's no pattern, so match() can detect this condition. Fixes handling of empty lists in bad_querystr, exclude_urls, etc. * htdig/Retriever.cc (IsValidURL): Fixed bad_querystr matching to look at right part of URL, not whole URL. Mon Sep 24 11:47:15 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtHTTP.cc (SetRequestCommand): Put If-Modified-Since header out in GMT, not local time, and only put it out if existing document time > 0. * htsearch/parser.cc (perform_phrase): Optimized phrase search handling to use linear algorithm with Dictionary lookups instead of n**2 alg., as suggested by Toivo Pedaste. Tue Sep 18 10:50:40 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/running.html: New documentation on how to run after configuring. * htdoc/rundig.html: New manual page for rundig script. * htdoc/install.html: Added link to running.html. * htdoc/contents.html: Added link to running.html, rundig.html, related projects. Updated links to contrib and developer site. Fri Sep 14 22:12:56 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/URL.h: Moved DefaultPort() from private to public for use in HtHTTP.cc. Fri Sep 14 09:25:20 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtHTTP.cc (SetRequestCommand): Add port to Host: header when port is not default, as per RFC2616(14.23). Fixes bug #459969. Sat Sep 8 22:15:33 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * acconfig.h, include/htconfig.h.in: Add undef for ALLOW_INSECURE_CGI_CONFIG, which if defined does about what you'd expect. (This is for any wrapper authors who don't want to rewrite but are willing to run insecure.) * htsearch/htsearch.cc: Only allow the -c flag to work when REQUEST_METHOD is undefined. Fixes PR#458013. Tue Sep 4 18:58:31 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/DocMatch.cc: Add scoring for Quim's new parser framework. Only the normal word scoring is currently done, not backlink_factor or other "Document" methods. Fri Aug 31 15:34:28 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.h, htdig/HTML.cc (ctor, parse, do_tag): Fixed buggy handling of nested tags that independently turn off indexing, so </script> doesn't cancel <meta name=robots ...> tag. Add handling of <noindex follow> tag. Added <> delim. to tag debugging output. Fixed a few typos. Wed Aug 29 10:33:01 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (url_part_aliases): Added clarification explaining how to use example. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Aug 27 15:05:09 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/search.html: Add DTD tag for HTML 4 compliance. * installdir/htdig.conf: Added .css to bad_extensions default, added missing closing ">". * htdoc/config.html: Updated with sample of latest htdig.conf and installdir/*.html. Wed Jul 25 22:16:06 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Put new htnotify_* entries in alphabetical order. Removed superfluous quotes from htnotify_webmaster example (htnotify.cc adds in the quotes). * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Tue Jul 24 16:07:01 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Changed references in (no_)page_number_text entries from maximum_pages to maximum_page_buttons. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Tue Jul 24 14:38:22 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/hts_templates.html: Document Quim Sanmarti's URL decoding feature for template variables. Thu Jul 12 14:12:02 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtFile.cc (Request): Fixed so it doesn't remove newlines from documents, and so it only tries to open mime.types once even if the open fails. Thu Jul 12 11:40:07 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/conv_doc.pl, contrib/parse_doc.pl: Fixed EOF handling in dehyphenation, fixed to handle %xx codes in title made from URL. * contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Fixed to handle %xx codes in URL title. Wed Jul 11 15:05:47 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (readFile): Added missing fclose() call, and debugging message for when file can't be opened. Wed Jul 11 14:26:28 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (displayParsedFile): Added debugging message when file can't be opened. * htseach/Display.cc (buildMatchList): Fixed while loop to avoid warning. * htsearch/htsearch.cc (main): Fixed handling of syntax error message to use String class instead of strdup(). * htsearch/parser.cc (setError): Added debugging message when error is set. * htsearch/parser.cc (parse): Fixed not to clear error message after it's set. Sat Jul 7 22:19:18 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * */Makefile.in: Update using current production automake (1.4-p4). * htfuzzy/Regexp.[cc,h]: Change class name to Regexp to prevent further namespace clashes. * htfuzzy/Fuzzy.c: #include "Regexp.h" now and make sure we create the right class when needed. * htlib/mktime.c: Change included mktime declaration to mymktime to avoid conflict on Mac OS X. (For some reason, autoconf's AC_FUNC_MKTIME doesn't work for Mac OS X. So this is a hack in the meantime.) * htfuzzy/Makefile.am: Rename Regex files. Oops! Fri Jul 6 18:38:58 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Regexp.cc, htfuzzy/Regexp.h: Rename Regex class to prevent problems on case-insensitive systems. * htlib/HtRegexReplaceList.cc, htlib/String.cc, htdig/htdig.cc: Change #include of <stream.h> to modern standard of iostream.h. * htlib/Configuration.cc (Read): Make sure we never reference a negative position when trimming off whitespace. * config.guess, config.sub: Update with new versions from GNU to recognize various flavors of Mac OS X/Rhapsody. * htlib/strptime.cc: Make sure len is initialized. Fri Jul 6 12:04:52 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtRegexList.cc (setEscaped): Fixed a potential problem with list building. When we go back a step, we still have to compile the new pattern in case it's the last one. Wed Jul 4 23:39:19 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/URL.cc (parse, ServerAlias): Fixed two problems that caused incorrect signatures to be generated. Wed Jul 4 13:52:54 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * test/document.cc (dodoc), test/url.cc (dourl), test/testnet.cc (Retrieve): Fixed up handling of config to match David Graff's changes of May 16, and handling of HtHTTPBasic class to match Joshua Gerth's changes of Mar 17. Tue Jul 3 16:20:56 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (GetLocal): Fixed to use URL class on given URL, so that default port numbers are stripped off. This was needed to allow local fetching of robots.txt. * htnet/Connection.cc (ctors, dtor, Assign_Server, Get_Peername), htnet/Connection.h: Got rid of strdup stuff, used String class for peer & server_name. * htnet/Connection.cc (Get_PeerIP): Used unambiguous name for structure. * htnet/HtHTTP.cc (ctor, dtor): Don't allocate a 2nd Connection, as child classes already do this, and set pointer to null when connection is deleted, so we don't try to delete it twice. This was messing up the heap and causing segfaults. Call Transport::CloseConnection before deleting connection. * htnet/HtHTTPBasic.cc (dtor), htnet/HtHTTPSecure.cc (dtor), * htnet/HtNNTP.cc (dtor): Only delete connection if non-null, & set to null after deleting. Call Transport::CloseConnection before deleting connection. * htnet/Transport.cc (CloseConnection): Don't exit if connection pointer is null, as this may be normal when called from destructor. Fri Jun 29 11:14:36 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Endings.cc (getWords): Undid change introduced in 3.1.3, in part. It now gets permutations of word whether or not it has a root, but it also gets permutations of one or more roots that the word has, based on a suggestion by Alexander Lebedev. * htfuzzy/EndingsDB.cc (createRoot): Fixed to handle words that have more than one root. * installdir/english.0: Removed P flag from wit, like and high, so they're not treated as roots of witness, likeness and highness, which are already in the dictionary. Mon Jun 25 12:50:47 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (main): Got rid of last remnants of 'urllist' and used the 'l' StringList as was used in the code before, to make restrict and exclude handling work properly. Mon Jun 25 15:52:19 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htsearch/htsearch.cc: defined 'urllist' in order to remove the compilation error (as Jesse suggested). Fri Jun 22 16:28:13 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (buildMatchList): Fix date_factor calculation to avoid 32-bit int overflow after multiplication by 1000, and avoid repetitive time(0) call, as contributed by Marc Pohl. Also move the localtime() call up before gmtime() call, to avoid clobbering gmtime's returned static structure (my thinko). * htdig/htdig.cc (main): Use .work file for md5_db, if -a given, as contributed by Marc Pohl. * htcommon/URL.cc (constructURL): Ensure that the _host is set if we are constructing non-file urls, as contributed by Marc Pohl. * htdoc/THANKS.html: Credit Marc Pohl for patches. Tue Jun 19 17:14:05 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * README: Bump up to 3.2.0b4, fix note about bug report submissions. Tue Jun 19 17:01:16 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (setVariables): Fixed handling of build_select_lists attribute, to deal with new restrict & exclude attributes. Mon Jun 18 12:16:27 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * configure.in, configure: Fix "hdig" typo in help. Fri Jun 15 17:57:19 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Noted effect of locale setting on floating point numbers in search_algorithm and locale descriptions. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jun 15 15:36:51 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/cf_generate.pl: Fixed to handle new defaults.cc format with trailing backslashes. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Jun 15 14:57:21 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdb/htdb_dump.cc, htdb/htdb_load.cc, htdb/htdb_stat.cc: Added a conditional include of <getopt.h> if HAVE_GETOPT_H is defined. Fri Jun 15 11:25:24 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (main), htcommon/defaults.cc, htdoc/hts_form.html: two new attributes, used by htsearch, have been added: restrict and exclude. They can now give more control to template customisation through configuration files, allowing to restrict or exclude URLs from search without passing any CGI variables (although this specification overrides the configuration one). Fri Jun 15 09:34:23 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (main): Changed ridiculously outdated question "Did you run htmerge?" to "Did you run htdig?". Fri Jun 8 11:07:04 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc: Add <float.h> header, now needed for RH 7.1. Thu Jun 7 12:05:09 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/htdig-3.2.0.spec: Updated to 3.2.0b4. * contrib/README: Mention acroconv.pl script. Thu Jun 7 10:46:19 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (expandVariables): Use isalnum() instead of isalpha() to allow digits in variable names, allow '-' in variable names too for consistency with attribute name handling. Wed Jun 6 16:14:06 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * httools/htpurge.cc (main): Added missing "u:" declaration in getopt() call. Wed Jun 6 15:24:04 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/doc2html/DETAILS, contrib/doc2html/README, contrib/doc2html/doc2html.pl, contrib/doc2html/pdf2html.pl, contrib/doc2html/swf2html.pl: Update to version 3.0 of doc2html, contributed by David Adams <D.J.Adams at soton.ac.uk>. Wed May 16 11:23:04 2001 Geoff Hutchison <ghutchis at wso.williams.edu> Added a pile of changes contributed by David Graff <phlat at mindspring.com> fixing compilation problems with non-gcc/g++ compilers (i.e. Sun's compiler). * Makefile.config, db/Makefile.am: Added no-dependencies to AUTOMAKE_OPTIONS for those not on GNU C/C++ * configure.in: Changed AM_PROG_YACC to AC_PROG_YACC as autoconf and autoreconf both complain that AM_PROG_YACC is not in the library. * htcommon/DocumentDB.cc: Removed default parameters as they are already declared in the header * htcommon/HtConfiguration.cc: Changed some of the loop declarations so that Sparc C 4.2 is happy. Removed default parameters as they are already declared in the header Moved inline ParseString to header where it belongs. Added initialization for HtConfiguration::_config static member variable. Added implementation of HtConfiguration::config() static class member. * htcommon/HtConfiguration.h: Added include for ParsedString.h. Added declaration of static member function ::config(). Added private static member variable _config;. Added inline ParseString from implementation. * htcommon/HtURLCodec.cc, htcommon/HtURLRewriter.cc, htcommon/HtZlibCodec.cc, htcommon/URL.cc, htcommon/conf_lexer.lxx, htdig/Document.cc, htdig/ExternalParser.cc, htdig/ExternalTransport.cc, htdig/HTML.cc, htdig/Parsable.cc, htdig/Plaintext.cc, htdig/Retriever.cc, : Changed to use new global configuration semantics. * htcommon/conf_parser.yxx: Added a return to yyerror to quiet Sparc C 4.2. Should really return a value here. Is it normal to return a YY_something or just -1, 0, ? * htcommon/defaults.cc: Added line continuation characters at the end of all the string lines that did not completed by a quote. * htcommon/defaults.h, htdig/htdig.h: Removed extern HtConfiguation config in favor of HtConfiguration::config(). * htdig/ExternalTransport.h Changed return type of GetResponse to match superclass. * htdig/Server.cc, htdig/htdig.cc, htfuzzy/htfuzzy.cc, htnet/HtFile.cc, htsearch/Display.cc, htsearch/QueryLexer.cc, htsearch/WordSearcher.cc, htsearch/htsearch.cc, htsearch/parser.cc, htsearch/qtest.cc, httools/htdump.cc, httools/htload.cc, httools/htmerge.cc, httools/htnotify.cc, httools/htpurge.cc, httools/htstat.cc htlib/Configuration.cc, htlib/HtRegex.cc: Changed constructor to use initializers * htlib/HtDateTime.cc: Moved inlines to header * htlib/HtDateTime.h: Added inlines from implementation * htlib/HtHeap.cc, htlib/HtHeap.h, htlib/HtVector.cc, htlib/HtVector.h, htlib/HtVectorGeneric.h, htlib/HtVectorGenericCode.h: Changed Copy member to return same type as superclass * htlib/HtRegexReplace.cc, htlib/HtRegexReplaceList.cc: Removed default parameters as they are declared already in the header * htlib/myqsort.h: Changed comment in header to use C-style comments as it's compiled using a C. * htlib/regex.h: Changed #if __STDC__ to #if defined(__STDC__) * htword/WordKey.h: Corrected const'ness Wed May 9 07:50:19 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookieJar.h: ShowSummary makes the class abstract Sat May 5 20:51:00 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/cf_blocks.html: Add colon in example and description of blocks to match code for the moment. The parser can be changed later if we like. Sat May 5 20:38:44 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/ParsedString.cc (get): Use isalnum() instead of isalpha() for looking up--allows names that contain digits too. Sat May 5 20:36:29 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/htString.h (class String): Remove now-obsolete and confusing int() casting operator. This was previously used to make a string of a certain length. Use String(int) as a ctor instead. Sat May 5 20:30:18 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htword/WordContext.[h,cc]: Change Initialize to supply a config that can be modified (i.e. if we don't have ZLIB_H). Sat May 5 23:30:55 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookieJar.h: ShowSummary, printing cookies (to be derived) * htnet/HtCookieMemJar.[h,cc]: ShowSummary, printing cookies Thu May 3 23:14:14 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP[h,cc]: connection object is now created and destroyed. NULL pointers converted to C++ standard (0). * htnet/Transport[h,cc]: NULL pointers converted to C++ standard (0). * htnet/Connection[h,cc]: ditto Thu May 3 23:09:33 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htlib/HtDateTime.[h,cc]: Timestamp format added (used by ht://Check for MySQL interfacing) - keeping them equal helps me maintaining both of them! Thu May 3 10:28:56 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.cc (perform_and): Add missing return statement, as suggested by Quim Sanmarti. Fri Mar 30 15:50:42 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/ResultMatch.h, htsearch/ResultMatch.cc (setTitle): Changed argument type to char * to fix problem with sort by title not working, as reported by Adam Lewenberg. Fri Mar 30 14:08:51 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.h, htdig/Retriever.cc (parse_url): Define and use Document::StoredLength() method to get actual length of data retrieved and given to md5(), which may be less than original length. Fixes bug reported by Michael Haggerty. Wed Mar 21 22:22:55 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc (generateStars): Add NSTARS variable for template output as suggested by Caleb Crome <ccrome at users.sourceforge.net> (except here precision is 0). Fixes feature request #405787. * htdoc/hts_templates.html: Add description of NSTARS variable above. * htlib/HtRegex.cc (set): Make sure we free memory if we've already compiled a pattern. * htdig/Retriever.cc (got_href): Fix bug pointed out by Gilles with hopcounts and don't bother to update the DocURL unless we have a new doc. Mon Mar 19 18:00:18 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/URL.cc (URL): Make sure even absolute relative URLs are run through normalizePath() as pointed out by Gilles. Allows backout of previous fix of #408586, which does extra re-parsing of URL. * htdig/Retriever.cc (Need2Get): Back out change of Mar. 17 for above. * htcommon/conf_lexer.[cxx, lxx]: Apply change suggested by Jesse to remove empty statements. Mon Mar 19 11:33:25 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegexList.cc (setEscaped): Fix assorted bugs, including obvious segfault, incorrect creation of limits, and failure to set "compiled" flag before return(). * htdig/Retriever.cc (IsValidURL): Make sure the tmpList is cleared before attempting to parse the bad_querystr config--otherwise we'll just Add to the end of the list. Sun Mar 18 14:01:56 CET 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/Transport.[h,cc], htnet/HtHTTP.cc: In order to modularize the net code the default parser string for the content-type has been added to the Transport class. * htdig/Document.cc: modified for the changes above. Sat Mar 17 16:38:27 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure, include/htconfig.h.in: Add tests for libssl, libcrypto, and ssl.h. * htnet/SSLConnection.[cc,h], htnet/HtHTTPBasic.[cc,h], htnet/HTTPSecure.[cc,h]: New files. Contributed by Joshua Gerth <jgerth at hmsoaps.com>. * htnet/Transport.[cc,h], htnet/HtNTTP.cc, htnet/HtHTTP.cc, htnet/Connection.h: Changes needed to support SSLConnection class. * htdig/Document.cc, htdig/Document.h: Ditto. * htnet/Makefile.am, htnet/Makefile.in: Add above for compilation. * htdoc/THANKS.html: Updated with new contributors. Sat Mar 17 15:28:20 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htword/WordContext.cc (Initialize): If HAVE_LIBZ or HAVE_ZLIB_H are not defined, make sure wordlist_compress is set to false. This semi-hack will not be necessary with new mifluz code which does not necessary need zlib. Fixes bug #405761. Sat Mar 17 14:39:17 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Fixed problems with META descriptions containing newlines, returns or tabs. They are now replaced with spaces. Fixes bug #405771. Sat Mar 17 14:26:55 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Improve handling of whitespace in META refresh handling. Fixes bug #406244. * htlib/HtRegexList.cc (setEscaped): Make this more efficient by building up larger and larger patterns--when we fail, go back a step and add the pattern in the next loop. This ensures we have a list of the maximum allowable length regexp. * htdig/Retriever.cc (Need2Get): Add change suggested by Yariv Tal to run URLs through the URL parser for cleanup before comparing to the visited list. Fixes bug #408586. Mon Mar 12 13:28:56 2001 Michael Haggerty <mhagger at alum.mit.edu> * htdig/Retriever.cc, htdig/Retriever.h: Fixed two off-by-one errors related to Retriever::factor table. Mon Mar 12 11:25:31 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Dictionary.cc (Add): Fix comments about add method--it will replace existing keys. Fixes report #407940. Thu Mar 8 15:31:45 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: removed an unuseful <else> Tue Mar 6 11:42:10 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/regex.[c,h]: Update with versions from glibc 2.2.2. Mon Mar 5 13:47:30 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * ltconfig (host_os): Add test to solve problems building C++ shared libraries on some platforms. Currently should only make --enable-shared the default on Linux and *BSD* unless specified explicitly by the user. Mon Mar 5 12:52:57 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/String.cc (operator =): Add fix contributed by Yariv Tal <YarivT at webmap.com>, fixed bug #406075. Mon Mar 5 12:06:26 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegexList.cc (match): Ignore rearrangement code for the moment--may or may not be the culprit for bug #405277, but is a start to debugging the problem. * htlib/List.[cc,h]: Remove *prev pointer from listnode structure and add a *prev pointer to the cursor structure. Saves one pointer per item in the list, plus overhead. Mon Mar 5 11:56:16 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc (bad_extensions): Add .css to ignore CSS docs. * htdig/Document.cc (getParsable): Ignore CSS documents -- they aren't very useful to parse. Solves bug report #405772. Sun Mar 04 11:32:43 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.cc: fixed a bug regarding <no header> with persistent connections enabled, but head call before the get one disabled. Sourceforge.net's bug reference: 405275 - fixed. Sat Mar 3 21:09:55 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * .version: Bump to 3.2.0b4 so snapshots have right versioning. Thu Mar 1 16:51:09 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in: Added test for alloca.h, which is needed for the regex.c code. Wed Feb 28 12:54:43 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htcommon/defaults.cc: 'disable_cookies' option has been added, with a 'server' scope. By default it is set to 'false'. * htdig/Server.h, cc: management of the option above has been enhanced. * htnet/HtHTTP.h, cc: now an HTTP connection can disable/enable cookies through the configuration attribute 'disable_cookies'. * htdig/Document.cc: management of cookies enabling/disabling is here. * Cookies classes: now support the expiration time. Need only the subdomain treatment. Mon Feb 26 16:37:30 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/conf_lexer.lxx: Don't directly call exit(1) on an error condition! Seems a harsh problem for an unknown character. * htcommon/conf_parser.yxx: Ditto. (Running out of memory is a much more fatal condition, of course.) * htcommon/conf_lexer.cxx: Regenerate using flex 2.5.4. * htcommon/conf_parser.cxx: Regenerate using bison 1.28. Sun Feb 25 19:46:01 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtHTTP.h, cc: support for cookies enabled * htnet/Makefile.am: files for cookies have been added to make. Sun Feb 25 19:27:18 CEST 2001 Gabriele Bartolini <angusgb at users.sourceforge.net> * htnet/HtCookie.h,cc: class HTTP cookie * htnet/HtCookieJar.h,cc: abstract class for managing the 'jar' of cookies. In this way, we can use different methods for the storage of them. * htnet/HtCookieMemJar.h,cc: class for managing the 'jar' of cookies in memory, without persistent storage (no db or file). * Many thanks to Robert LaFerla for his coding on this! Yeah, really really thanks Robert! <robertlaferla at mediaone.net> Thu Feb 22 16:43:18 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/ChangeLog, htdig/RELEASE.html, README: Update to roll the release of 3.2.0b3. Thu Feb 22 16:22:05 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (main), htsearch/Display.cc (setVariables, createURL, buildMatchList), htdoc/hts_form.html, htdoc/hts_templates.html: Add Mike Grommet's date range search feature. Mon Feb 19 18:24:42 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Synonym.cc (createDB): Create database in a temporary directory before we move it into place, much like the endings code. This should prevent problems when we just append to the DB instead of making a new one. * htdig/htdig.cc (main): Fix bug discovered by Gilles--htword should be initialized *after* we are finished modifying config attributes based on flags and unlink with -i. * installdir/rundig: Fix bug with calling htpurge with -s option. Thu Feb 15 11:03:42 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/*.html: Update with 2001 copyrights and various changes with the website move for the pending 3.2.0b3 release. Thu Feb 15 10:41:47 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegexList.cc (match): Fix thinko with logic for matching and add code to rearrange matching nodes for hopefully better performance. Sun Feb 11 16:42:11 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegexList.h, htlib/HtRegexList.cc (class HtRegexList): Simple List(HtRegex) object with similar calling conventions to HtRegex class. This version is not as sophisticated as it could be, but it's not likely to drop objects when reorganizing. * htlib/Makefile.[in,am]: Add HtRegexList files to list for compilation. * htdig/htdig.h, htdig/htdig.cc, htdig/Retriever.cc: Use HtRegexList instead of HtRegex for setting escaped values--should never fail (since each String item is short). * htlib/HtDateTime.cc: Put back timezone specs into the output formats so we give everything even if we ignore it when reading input. Mon Feb 5 11:47:07 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.cc: Remove the timezone specs in the date formats--these are not required in the RFCs because many dates are in GMT anyway. Wed Jan 17 08:48:30 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalTransport.cc (Request): Oops, fixed a holdover from code borrowed from ExternalParser.cc's fork handling. Mon Jan 15 23:09:37 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Connection.cc: Back out previous change--this should not in any way be needed since the configure script should set FD_SET_T. * configure.in, configure: Add more lenient prototyping for select() test--now allows "const struct timeval" for compilation on BSDI. * htdoc/RELEASE.html: Update with Gilles's changes. * htdoc/cf_blocks.html: New file describing <server ...></server> and <url ...></url> blocks. * htdoc/cf_general.html, htdoc/confmenu.html: Refer to the above. Mon Jan 15 17:46:07 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/TemplateList.cc (createFromString), htcommon/defaults.cc: Treat template_map as a _quoted_ string list. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Mon Jan 15 17:40:45 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/hts_templates.html: Add METADESCRIPTION variable. * htsearch/Display.cc (displayMatch): Add METADESCRIPTION variable. * htdig/ExternalParser.cc (parse): Fix up handling of arguments. * htdig/ExternalTransport.cc (Request): Fix up handling of fork/exec and command arguments, add wait() call. Wed Jan 10 19:23:36 2001 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/rundig: Fix -a handling to move db.words.db.work_weakcmpr into place if it exists Sat Jan 6 21:50:58 2001 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in: Add checks for <sys/wait.h> and <wait.h> for ExternalParser. * include/htconfig.h.in: Regenerate using autoheader. * configure: Regenerate using configure. * htnet/Connection.cc: Add definition for FD_SET_T to fix problems compiling on BSDI mentioned by Joe. * htdig/ExternalParser.cc: Use <sys/wait.h> or <wait.h> as appropriate. Should fix problems with compiliation mentioned by Jesse on HP/UX. * README, htdoc/RELEASE.html: Adjust dates for the new year. * htdoc/upgrade.html: A few "remaining features" have been implemented. Sun Dec 06 19:46:15 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.cc: Fixed bug for Read_Line function call in ReadChunkedBody method. Many thanks to Robert LaFerla. ;-) Tue Dec 12 13:24:49 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Fixed to properly handle binary output from an external converter. Fixed some compilation errors. Tue Dec 12 12:52:14 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Handle parser command string as a string list again to allow arguments, build up argv and use execv instead of execl. Tue Dec 12 12:25:04 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Add call to wait for child process, to avoid zombie buildup. Mon Dec 11 23:57:43 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Fix up handling of fds in child process, more fault-tolerant handling of pipe or fork errors. Mon Dec 11 23:30:55 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Fix up handling of creation of temporary file, check for proper return code, give error if appropriate. Mon Dec 11 23:19:28 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Lowercase content-types and strip off any trailing semicolons, at one last spot. This reinserts code added Sep 11, which was dropped Oct 9, probably inadvertantly during mifluz back-out. Sun Dec 10 15:28:44 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/ExternalTransport.cc: Use fork/exec instead of calling popen, which bypasses any shell escape problems. * htdig/ExternalParser.cc: Ditto, plus use of mkstemp where available to pick the filename. * configure, configure.in: Check for mkstemp where available. * include/htconfig.h.in: Define it as above. * htlib/Makefile.am: Omit regex.c from SOURCES--this is included when necessary by the configure script. Otherwise this produces duplicate declarations, etc. * htlib/Makefile.in: Regenerate using automake --foreign. * htcommon/URL.cc: Fix bug with ports of 0 showing up in URLs like mailto: or other less-common protocols. Fri Dec 1 14:45:33 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/htdig-3.2.0.spec: Updated to 3.2.0b3. Fri Dec 1 13:59:09 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/Makefile.am: Fix pkginclude_HEADERS to list missing headers ber.h, libdefs.h, myqsort.h, mhash_md5.h, omit unneeded langinfo.h; fix libht_la_SOURCES to list missing sources regex.c, myqsort.c. * htlib/Makefile.in: Regenerate using automake --foreign * htlib/langinfo.h, htlib/nl_types.h: Removed as they're now unused. Fri Dec 1 13:22:47 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/strptime.cc (mystrptime): make ptr const and use cast on return value to avoid warnings. * htlib/Makefile.am: Fix pkginclude_HEADERS to list HtRegexReplace*.h rather than .cc. * htlib/Makefile.in: Regenerate using automake --foreign Fri Dec 1 11:58:21 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * Makefile.in, [hit]*/Makefile.in: Regenerate using automake --foreign after fixing bug with cp -pr in automake. Thu Nov 30 14:41:58 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/Makefile.am: Removed howitworks.html from EXTRA_DIST. * Makefile.in (distdir): Added missing variable name 'd' to cp -pr. Thu Nov 30 14:01:48 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/strptime.cc, htlib/lib.h: make first 2 args to strptime const to avoid warnings, use cast in asizeof to avoid warnings. * htsearch/qtest.cc: Change include from iostream to iostream.h * htsearch/DocMatch.cc: Change include from iostream to iostream.h * htsearch/Display.cc (createURL, buildMatchList, excerpt, hilight): Clean up code to get rid of warnings, especially resulting from NULLs in ternary operators. Thu Nov 30 10:55:09 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/String_fmt.cc (form, vform): Use vsnprintf rather than vsprintf, for buffer overflow prevention if vsnprintf available. * htdig/Retriever.cc: Remove unused strptime declaration. * htlib/HtDateTime.cc: Use mystrptime if HAVE_STRPTIME not set. Wed Nov 29 23:31:10 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdb/htdb_stat.cc, htdb_load.cc, htdb_dump.cc: Make sure we include htconfig.h to include proper declarations. * htlib/strptime.cc: Change to strptime.cc, from htdig-3.1 series hopefully more portable until I can find a more suitable replacement. * htlib/Makefile.am, htlib/Makefile.in: As above. * htlib/clib.h, htlib/lib.h: Ditto. * htdoc/all.html: Add a first draft of program summaries. Wed Nov 29 18:00:15 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (parse_url): Remove undeclared "dup" variable, add missing calls to words.Skip(). Wed Nov 29 17:44:56 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/htdig.html: Add description of -v output. Mon Nov 27 12:03:34 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/md5.cc: Added missing include of time.h Fri Nov 24 00:56:01 2000 Toivo Pedaste <toivo at ucs.uwa.edu.au> * htsearch/Display.cc: Some extra debugging for scoring Sun Nov 19 00:56:01 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/HtFile.cc (Request): Use opendir/readdir instead of scandir for generating directory listings on-the-fly. * htdoc/RELEASE.html: Write up release notes for 3.2.0b3. * htdoc/THANKS.html: Update list of contributors for 3.2.0b3 as current. Fri Nov 17 14:52:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/acroconv.pl: Added external converter script to convert PDFs with acroread. Mon Nov 6 12:13:13 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (GetLocal, GetLocalUser): move String definition out of while statement for AIX xlC compiler. Mon Oct 30 21:50:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Server.h, htdig/Server.cc (push): Add newDoc paramter that will allow redirects (old docs) to be followed and not count against the maxDoc restrictions. * htdig/Retriever.cc (got_redirect): Use new parameter so we don't count against a server's max documents since it's a redirect. * htlib/nl_types.h: Add for systems missing this header file. Sun Oct 29 21:36:51 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Updated per-server and per-URL fields to match code. I still have a "wish list" of additional attributes that should work this way eventually. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Sun Oct 22 17:13:08 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/HtWordList.h: Add missing include for stdlib.h needed for abort(). * htsearch/BooleanQueryParser.cc (ParseAnd): Fix problems with RH7 compiler -- shouldn't use "not" as a variable name! Thu Oct 19 22:19:16 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * ltmain.sh, ltconfig: Update with versions from libtool 1.3.5. which may fix some problems building libraries. Mon Oct 9 21:59:11 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * */* [many, many files]: Backed out mifluz merge by going back on modified files to 091000 snapshot. * configure: Regenerated from configure.in. * */Makefile.in: Regenerated using automake. Fri Oct 6 11:03:14 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Parse <object> tags properly, looking for data= attribute rather than src=. * htcommon/defaults.cc (server_aliases): Additional clarification to server_aliases description of port numbers. Wed Oct 4 12:12:31 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (limit_normalized, server_aliases, server_max_docs, server_wait_time): Added clarification to server_aliases description. Changed word "directive" to "attribute" where appropriate. Added cross-link to server_aliases from limit_normalized. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Wed Sep 27 00:05:41 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdb/mifluz[dict, dump, load].cc, htdb/util_sig.h, htdb/util_sig.cc: New files from mifluz merge. (Whoops, missed a directory). * htdb/*.cc: Change config.h references to htconfig.h. * htlib/myqsort.c: Ditto. * htcommon/HtWordReference.h, htcommon/HtWordReference.cc: Ensure we keep the WordContext object around--unfortunately this also requires that callers initialize us with a WordContext (e.g. from the HtWordList class). * htlib/StringMatch.h, htlib/StringMatch.cc: Changes to use WordType directly instead of HtWordType. * htfuzzy/*: Ditto. Additionally make sure HtWordReference objects are intstantiated properly. * htcommon/DocumentRef.cc, htcommon/HtWordList.cc: As above. * htdig/*: As above. * htsearch/*: As above. * httools/*: Don't bother initializing WordContext--this is done in the HtWordList class now. * htdig/htdig.cc: Ditto. * htsearch/htsearch.cc, htsearch/qtest.cc: Ditto. * htfuzzy/htfuzzy.cc: Ditto. * db/Makefile.am, db/Makefile.in: Update to build libhtdb instead of libdb to prevent conflicts. Sun Sep 24 22:50:22 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htword/HtWordList.h, htword/HtWordList.cc: Keep a WordContext object private that is associated with this word database and provide accessor. * htword/WordType.h, htword/WordType.cc: Add WordToken function, migrated from HtWordType class. * htcommon/HtWordType.cc: WordType class no longer has Instance() method, so just pass along the calls. * htlib/DB2_db.cc (db_init): Remove unnecessary NULL parameter. * htlib/Makefile.am, htlib/Makefile.in: Remove HtVectorGeneric and derived files as well as HtWordType as these are depreciated. Wed Sep 20 22:47:01 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * aclocal.m4: Add in missing autoconf macros that somehow didn't make the merge before. (No idea why I didn't catch this earlier.) * acinclude.m4: Use newer CHECK_ZLIB macro. * */Makefile.in: Updated with automake for new build changes. * configure, include/htconfig.h.in: Updated using autoconf. * test/dbbench.cc, test/word.cc, test/search.cc: Fix #include to point to htconfig.h not non-existant config.h. * htlib/Configuration.h: Fix copy ctor, removing code in header file. * htword/*.cc: Ditto. * htword/Makefile.am: Update from mifluz version. * htlib/myqsort.h, htlib/myqsort.c: Additional system library replacement code. Sat Sep 16 20:14:32 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure, acinclude.m4, aclocal.m4, acconfig.h, include/htconfig.h.in: Merged with mifluz versions. Main difference is that top-level configure script now also configures db/ directory as well. * Makefile.am, */Makefile.in: Updated with automake for new build environment (with db/ run through top-level configure). * db/*.c: Updated to use htconfig.h instead of config.h. Wed Sep 13 22:05:33 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * Merged in mifluz-0.19 branch. Everything will break temporarily. Loic and I will clean up tomorrow. * htdoc/RELEASE.html, htdoc/THANKS.html, htdoc/TODO.html: Get a start on updting these files for the next release. * htdoc/cf_generate.pl: Revert change of Sep. 9 to ignore links to all.html in cf_byprog.html file. * htdoc/all.html: New file, moved from howitworks.html and not updated yet. * htdoc/contents.html: Change link from howitworks.html to all.html Tue Sep 12 17:00:00 CEST 2000 Quim Sanmarti <qss at gtd.es> * htsearch: added AndQuery.cc BooleanLexer.cc BooleanQueryParser.cc ExactWordQuery.cc GParser.cc NearQuery.cc NotQuery.cc OperatorQuery.cc OrFuzzyExpander.cc OrQuery.cc PhraseQuery.cc Query.cc QueryLexer.cc QueryParser.cc SimpleQueryParser.cc VolatileCache.cc WordSearcher.cc qtest.cc WordSearcher.h AndQuery.h AndQueryParser.h BooleanLexer.h BooleanQueryParser.h ExactWordQuery.h FuzzyExpander.h GParser.h NearQuery.h NotQuery.h OperatorQuery.h OrFuzzyExpander.h OrQuery.h OrQueryParser.h PhraseQuery.h Query.h QueryCache.h QueryLexer.h QueryParser.h SimpleLexer.h SimpleQueryParser.h VolatileCache.h. This is the new query parsing/evaluation framework. * Modified DocMatch.{cc,h} and ResultList.{cc,h} for compatibility. * Removed the previous {And,Or,Exact,}ParseTree.{cc,h} files. * Modified Makefile.{am,in} consequently. Mon Sep 11 11:56:44 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc (parse): Lowercase content-types and strip off any trailing semicolons, at one last spot which Geoff missed. Sat Sep 9 21:28:29 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc (getParsable): Fix a bug with earlier change--if no parser is found and the MIME type is not text/* then return a NULL parser. * htdig/Retriever.cc (RetrievedDocument): If a NULL parser is returned, mark the document as noindex and move on. * configure.in, configure (enable-tests): Fix bug that would run the 'yes' program inside the configure script if --enable-tests was set. Sat Sep 9 17:50:11 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Add "all" program listing for common attributes--seems more logical esp. now with many httool programs. * htdoc/cf_generate.pl (cf_byprog): Do not output a link when 'prog' is 'all.' * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Sat Sep 9 11:44:47 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * aclocal.m4 (AM_CHECK_YACC): New macro to check for bison/yacc and use "missing yacc" if not found. * configure.in (enable_tests): Fix buglet where --enable-tests=no or --disable-tests would not work and set the default to enabled tests. Since the tests do not build unless the user does a "make check" this should not be confusing and should help debugging. Also use AM_CHECK_YACC instead of AC_CHECK_YACC. * configure: Regenerate using autoconf. Sat Sep 9 11:01:03 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/ExternalParser.cc (canParse): Lowercase content-types and strip off any trailing semicolons. Should prevent problems with combined content-type; charset values. (ctor): As above. * htdig/Document.cc (getParsable): Only assume plain text if MIME code starts with text/. Should prevent problems with retrieving things like image/png or application/postscript as text. Fri Sep 8 22:59:10 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Add new attributes htnotify_replyto, htnotify_webmaster, htnotify_prefix_file, htnotify_suffix_file. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. * httools/htnotify.cc: Added in code from Richard Beton <richard.beton at roke.co.uk> to collect multiple URLs per e-mail address and allow customization of notification messages by reading in header/footer text as designated by the new attributes above. Fri Sep 8 15:15:00 2000 Quim Sanmarti <qss at gtd.es> * htsearch/Display.cc: Fixed tiny date_format bug; added url-decoding template variable expansion. Thu Sep 7 23:45:25 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (Retriever): Only open up md5 database if check_unique_md5 attribute is set. Thu Sep 7 22:56:19 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/URL.cc (DefaultPort): Add file default port of 0. * htnet/HtFile.cc (Request): Handle directory listings by using scandir and generating minimal HTML file with appropriate noindex listing. Wed Sep 06 10:00:50 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htlib/URL.h, htlib/URL.cc: Restored corrected versions of URL.* * htnet/HtNNTP.h: Removed the error in the NNTP class declaration Mon Sep 04 13:43:40 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.cc: Restored previous version of HtHTTP. I removed an initialization in the constructor (_modification_time). Sorry. Sun Sep 3 16:51:24 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc, htdig/Server.cc: Fix compiler warnings about String conversions. * configure, configure.in, db/configure, db/configure.in, db/acinclude.m4, db/aclocal.m4: Ensure --enable-bigfile is handled correctly by the configure scripts as pointed out by Jesse. Fri Sep 01 23:28:43 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * URL.cc: added DefaultPort() method and changed NNTP default port from 523 to 119. * Document.cc: management of NNTP documents retrieval. Fri Sep 01 19:05:02 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtNNTP.* : just created them ... * htnet/HtHTTP.cc : removed modification_time deletion in the class destructor. Thu Sep 01 12:00:00 2000 Toivo Pedaste <toivo at ucs.uwa.edu.au> * htdig/Retriever.cc: Allow for modify time being set to current time if not available. Thu Aug 31 13:21:12 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (allow_in_form, build_select_lists): Add clearer instructions to allow_in_form description, add cross-links between these two sections. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Wed Aug 30 10:01:59 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * substition of char * returned types to const String & in URL and Server classes. This change made me do lots of changes in other files: HtFile.cc, HtHTTP.cc, HtConfiguration.*, Document.*, ExternalParser.*, Retriever.*. Tue Aug 30 12:00:00 2000 Toivo Pedaste <toivo at ucs.uwa.edu.au> * htlibs/md5.cc, htlibs/md5.h: Generate md5 hash of a page and also optionally the modify date. * htlibs/mhash_md5.h, htlibs/mhash_md5.c, htlibs/libdefs.h: Md5 hash code from libmhash * htdig/Retriever.cc: Allow storing m5 hashes of pages in order to reject aliases. * htcommon/defaults.cc: Options "check_unique_md5" and "check_unique_date" Tue Aug 29 08:51:39 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/upgrade.html: Add description of the difference between htmerge and htpurge. Mention other httools. * htsearch/parser.cc, htsearch/parser.h: Merge in patch by Quim Sanmarti <qss at gtd.es> to fix problems with phrase searching and AND searches and improve performance. Sun Aug 27 22:41:10 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/AndParseTree.cc, htsearch/OrParseTree.cc (Parse): Rewrote using new WordToken inherited method. Fixes a bug where user input two phrases next to each other. * htsearch/ParseTree.cc (Parse): Fix bug where phrases would "adsorb" prior query words. Also fix bug where operators were incorrectly popped off the stack. Should (hopefully) solve all parsing problems. * htsearch/*ParseTree.cc (GetLogicalWords): Test for empty list of children to prevent potential segfault. Sat Aug 26 18:40:50 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * installdir/{syntax, header, footer, wrapper, nomatch}.html: Add DTD tags, ALT attributes and remove bogus </select> tags to fix invalid HTML pointed out in PR#901. Wed Aug 23 23:39:18 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/ParseTree.cc (Parse): Get rid of compiler warnings, use new private tokenizer to ensure parens and quote aren't removed. Also, when popping an operator off the parens stack, make sure it's adopted by a new ParseTree object so we get the parens back in the tree heirarchy. Wed Aug 23 23:34:44 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/AndParseTree.cc (Parse): Fix nasty infinite loop when phrases hit in AND searches. * htsearch/OrParseTree.cc (Parse): Ditto. Wed Aug 23 13:24:31 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.*, htnet/Transport.h: all 'char *', when possibile, have been changed into 'const String &' types. Sun Aug 20 23:25:01 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htpurge.cc (purgeDocs): Add error message when document database is completely empty. Should take care of PR#672 (and others). Sun Aug 20 20:37:53 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegex.h, htlib/HtRegex.cc: Made destructor virtual, added lastError() and associated support. Changed return type of set*() to int. They now return the value of |compiled|. * htcommon/defaults.cc (url_rewrite_rules): Add new attribute to support patch by Andy Armstrong <andy at tagish.com> for permanent URL rewriting. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. * htlib/HtRegexReplace.cc, htlib/HtRegexReplaceList.cc, htlib/HtRegexReplace.h, htlib/HtRegexReplaceList.h, htcommon/HtURLRewriter.cc, htcommon/HtURLRewriter.h: New classes. * htcommon/Makefile.am, htcommon/Makefile.in: Add compilation for HtURLRewriter. * htlib/Makefile.am, htcommon/Makefile.in: Ditto for HtRegexReplace* * htcommon/URL.h, htcommon/URL.cc (rewrite): New method for transforming URLs based on HtURLRewriter. * htdig/Retriever.cc (got_href): Rewrite the URL before we do anything with it. * htdig/htdig.cc: Include HtURLRewriter headers and check rewrite rules for errors. Sat Aug 19 17:01:36 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/conf_lexer.lxx: Patched to fix the bug with relative filename includes. Keeps a separate stack with the filenames and adjusts accordingly. * htcommon/conf_lexer.cxx: Updated using flex 2.5.4. Thu Aug 17 23:59:26 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/conf_lexer.lxx: Patched to fix a bug reported by Abel Deuring -- config filename stack was decremented too many times. * htcommon/conf_lexer.cxx: Updated using flex 2.5.4. Thu Aug 17 23:40:08 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htword/WordType.h (WordToken): Add non-destructive version of HtWordToken using a passed int as a pointer into the string. Add virtual destructor so class can be sub-classed. * htword/WordType.cc (WordToken): Implement it. * httools/htmerge.cc (mergeDB): Back out change of Aug. 9th -- WordSearchDescription has disappeared from htword interfaces. Should be restored when Loic comes back and can suggest an alternative. Thu Aug 17 16:59:05 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (createURL): Get rid of extra "config=" parameter that was inserted before collections stuff. Thu Aug 17 15:47:58 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.cc: ask again for a document after a <NoHeader> response is given by the HTTPRequest() method. Thu Aug 17 12:25:33 CEST 2000 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.*, htnet/Transport.* : fixed bug with HTTP/1.1 management. Now the "Connection: close" directive is handled and force the connection to be closed. So the bug has now been fixed. Fixed other minor bugs and strings initializations. Tue Aug 15 00:24:33 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * contrib/multidig/Makefile, gen-collect, db.conf, multidig.conf: Add missing trailing newlines as pointed out by Doug Moran <dmoran at dougmoran.com>. * contrib/multidig/Makefile (install): Make sure scripts have a+x permissions. Pointed out by Doug Moran. * contrib/multidig/new-collect: Fix typo to ensure MULTIDIG_CONF is set correctly. Sun Aug 13 23:17:30 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Server.h, htdig/Server.cc (Server): Add support for per-server user_agent configuration. * htdig/Document.cc (Retrieve): Ditto. * httools/htpurge.cc (purgeDocs): Set remove_* attributes on a per-server basis. * htcommon/defaults.cc: Fix remove_bad_urls and remove_unretrieved_urls to point to htpurge and not htmerge. Sat Aug 12 23:03:32 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/cf_generate.pl (html_escape): Fix mindless thinko with perl stringwise-equal operator. Documentation is now generated with block: portion appropriate to defaults.cc. * htdoc/attrs.html, cf_by{name,prog}.html: Reran cf_generate.pl. Fri Aug 11 16:03:18 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (parse): fix problem with & not being translated. Fri Aug 11 10:48:54 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (setVariables), htcommon/defaults.cc: Added maximum_page_buttons attribute, to limit buttons to less than maximum_pages. Fixes PR#731 & PR#781. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Aug 9 23:04:39 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htmerge.cc (mergeDB): Add fix to prevent duplicate documents when you merge a database with a copy of itself contributed by Lorenzo. Wed Aug 9 22:58:39 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/parser.cc (score): Merged in patch contributed by Lorenzo Campedelli <lorenzo.campedelli at libero.it> and Arthur Prokosch <prokosch at aptima.com> to fix problems with AND operators and phrase matches. Wed Aug 2 11:44:11 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (setVariables), htcommon/defaults.cc: Enhanced build_select_lists attribute, to generate not only single-choice select lists, but also select multiple lists, radio button lists and checkbox lists. Added explanation and examples in documentation. * htdoc/hts_selectors.html: Added detailed explanation of new feature. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Tue Aug 1 21:50:22 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/ParseTree.cc (Parse): Fix problems with token comparisons and fix thinko with HtWordToken parsing--previously didn't advance the parse step at all. * htsearch/*ParseTree.cc (Parse): Fix thinko with HtWordToken as above--here it acted as an infinite loop. * htdig/ExternalParser.cc (parse): Add shell quoting around content-type. Hard to exploit, but a server could potentially return a strange value that could then be exectuted locally. Thu Jun 29 23:33:51 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/ParseTree.h, htsearch/ParseTree.cc: New parent class for the new htsearch framework. Still needs work. * htsearch/*ParseTree.*: Derived classes appropriate to the method indicated. * htsearch/parsetest.cc: New program to alllow initial command-line testing of ParseTree classes. * htsearch/Makefile.am, htsearch/Makefile.in: Build parsetest in addition to htsearch. Eventually, parsetest is probably best modified slightly and moved into the tests directory. Tue Jun 20 22:29:57 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htmerge.cc (mergeDB): Merge in patch contributed by Lorenzo Campedelli <lorenzo.campedelli at libero.it> to greatly reduce memory usage. Sun Jun 18 13:15:43 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Object.h (class Object): Fix problems with retrieval order by insuring the compare() method is declared const. Tue Jun 13 22:57:10 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (GetLocal): Fix bug that would cause a coredump when local_urls was used and local_default_docs was needed. The list of default filenames was freed before it should have been. Tue Jun 13 19:30:28 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/HtWordReference.h, htcommon/HtWordReference.cc (Load, LoadHeaders): New methods to check the header of an ASCII representation and read it in. * htcommon/HtWordList.h, htcommon/HtWordList.cc (Load): Add load method to read in data. Calls the new methods above. * httools/htload.cc: Open word databases read-write and call HtWordList::Load(). Sun Jun 11 14:39:28 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc (generateStars): Fix problem when maxScore == minScore as reported by Rajendra. Fixed problem PR#858. (displayMatch): Ditto. * htsearch/htsearch.cc: Fix memory corruption problem in reporting syntax errors pointed out by Rajendra. Fixes PR#860. Thu Jun 8 09:31:15 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Accents.h, htfuzzy/Accents.cc: Apply Robert Marchand's patch to his algorithm. Gets rid of writeDB function (falls back on default one in Fuzzy.cc), changes addWord, and adds a new getWords function to override default. These avoid overhead of unaccented forms of words in accents database, but ensure that unaccented form of search word is always searched. Thu Jun 8 09:00:02 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/DocumentRef.h(DocScore, docScore), htsearch/ResultMatch.cc(ScoreMatch::compare), htsearch/ResultMatch.h(setScore, getScore, score), htsearch/Display.cc(displayMatch, generateStars, buildMatchList): Apply Terry Luedtke's patch for score calculations, to calculate min & max from log(score). Thu Jun 8 08:47:03 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/doc2html/doc2html.pl: Apply David Adams' fix for missing quote. Wed Jun 07 10:53:53 2000 Loic Dachary <loic at senga.org> * db/db.c (CDB___db_dbenv_setup): open mode is 0666 instead of 0 otherwise the weakcmpr file is not open with the proper mode. Tue Jun 6 23:48:48 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htpurge.cc: Fix coredump problems by passing dictionaries as pointers rather than full objects (this is preferred anyway). Sun Jun 4 22:17:14 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * test/t_htdig_local: Added test for local filesystem support. * test/config/htdig.conf2.in: Change to be a config file for local_urls testing. * test/Makefile.am: Add t_htdig_local to list. Tue May 30 23:52:45 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htmerge.cc: Move to httools directory, remove "cleanup" functionality now in htpurge and merge in htmerge.h and db.cc files. * httools/Makefile.am: Add htmerge now moved to this directory. * */Makefile.in: Update with automake. * Makefile.am (SUBDIRS): Remove htmerge, now found in httools. * configure.in: Ditto. * configure: Update with autoconf. * test/test_functions.in: Add paths for htpurge, htstat, htload, htdump and update path for htmerge. * test/t_htdig: Change htmerge to htpurge to clean out incorrect URLs. * installdir/rundig: Change htmerge to htpurge. This needs serious additional cleanup for use in 3.2 since many conventions have changed! Tue May 23 22:21:14 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * README: Fix for 3.2.0b3 and clean up organization a bit for new directory structure. Wed May 17 23:22:31 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Add support for TITLE attributes in anchor and related tags. Fri May 12 17:54:09 2000 Loic Dachary <loic at senga.org> * db/acinclude.m4: bigfile support is disabled by default. * db/mp_region.c (CDB___memp_close): clear weakcmpr pointer when closing region so that memory pool files are not released twice. Wed May 10 22:26:21 2000 Loic Dachary <loic at senga.org> * */*.cc: all include htconfig.h * htlib/HtTime.h: remove htconfig.h inclusion (never in headers) * htlib/*.h,*.cc: Fix copyright GNU Public -> Gnu General Public and 1999, 2000 instead of 1999. Tue May 09 16:38:07 2000 Loic Dachary <loic at senga.org> * htsearch/Collection.cc (Collection): set searchWords and searchWordsPattern to null in constructor. Delete in destructor. Also delete matches in destructor. * test/word.cc (doskip_harness): free cursor after use. * test/word.cc (doskip_overflow): free cursor after use. * test/dbbench.cc (find): free cursor after use. * htsearch/htsearch.cc (main): free searchWords and searchWordsPattern after usage. * htdb/htdb_{load,dump,stat}.cc (main): call WordContext::Finish to free global context for inverted index. * htdb/htdb_stat.cc (btree_stats): free stat structure. * htlib/List.h (class List): Add Shift/Unshift/Push/Pop methods. * htlib/List.h (class List): Add Remove(int position) method. Tue May 09 00:22:33 2000 Loic Dachary <loic at senga.org> * htsearch/htsearch.cc (main): kill useless call to StringList::Release * htsearch/HtURLSeedScore.cc (ScoreAdjustItem): remove useless call to StringList::Destroy. * htlib/HtWordCodec.cc (HtWordCodec): Fix usage of StringList that was inserting pointers to volatile strings instead of permanent copies. I suspect that the tweak on StringList was primarily done to satisfy this piece of code. After reviewing all the usage of StringList, it's the only one to use it in this fashion. * htlib/QuotedStringList.h (class QuotedStringList): remove noop destructor to enable Destroy of the underlying StringList when deleted. Mon May 08 18:17:02 2000 Loic Dachary <loic at senga.org> * htlib/StringList.h (class StringList): change methods Add/Insert/Assign that were copying the String* given in argument. This behaviour is confusing since it has a different semantic than the base class List. Mon May 08 17:16:00 2000 Loic Dachary <loic at senga.org> * htdig/Retriever.cc (GetLocal): fix leaked defaultdocs Mon May 08 04:27:47 2000 Loic Dachary <loic at senga.org> * htlib/StringList.cc (Create): remove SRelease. Deleting the strings is taken care of by the destructor thru Destroy. If destruction of the Strings is not desirable Release should be used. SRelease was added apparently after a virtual constructor doing nothing was added to hide the default call to Destroy therefore leaking memory. Mon May 08 01:28:25 2000 Loic Dachary <loic at senga.org> * test/txt2mifluz.cc,word.cc,search.cc: fix minor memory leaks. Sun May 07 19:24:12 2000 Loic Dachary <loic at senga.org> * Makefile.config (HTLIBS): add libht at end because htdb now depends on htlib. * configure.in,htlib/Makefile.am: use LTLIBOBJS as suggested by the libtool documentation. Sun May 07 17:09:22 2000 Loic Dachary <loic at senga.org> * test/Makefile.am (clean-local): clean conf to prevent inconsistencies when re-configuring in a directory that is not the source directory. Sun May 07 05:07:23 2000 Loic Dachary <loic at senga.org> * db/mkinstalldir,test/benchmark: Add for installation purpose Sun May 07 02:17:03 2000 Loic Dachary <loic at senga.org> * Makefile.am (distclean-local): Xtest instead of test that confuse some shells. Sun May 07 02:02:46 2000 Loic Dachary <loic at senga.org> * htword/WordDB.cc: Move Open to WordDB.cc. Sun May 07 01:32:47 2000 Loic Dachary <loic at senga.org> * test/t_*: check/fix scripts. All regression tests pass on RedHat-6.2. Sun May 07 00:54:30 2000 Loic Dachary <loic at senga.org> * */*.cc: fix warnings and large file support inclusion files on Solaris. Sat May 06 21:55:58 2000 Loic Dachary <loic at senga.org> * test/: import regression tests from mifluz * htlib/DB2_db.cc (db_init): fix flags used when creating the environment to include a memory pool. * htcommon/defaults.cc: change wordkey_description format. update all wordlist_* attributes Sat May 06 04:46:03 2000 Loic Dachary <loic at senga.org> * htmerge/words.cc (mergeWords): WordSearchDescription becomes WordCursor. * httools/htpurge.cc (purgeWords): WordSearchDescription becomes WordCursor. Sat May 06 02:01:40 2000 Loic Dachary <loic at senga.org> * htdb/*: upgrade to Berkeley DB 3.0.55. Very different. * htlib/getcwd.c,memcmp.c,memcpy.c,memmove.c,raise.c,snprintf.c, strerror.c,vsnprintf.c,clib.h: Add compatibility support * htcommon/DocumentDB.cc (LoadDB): remove unused variable * htlib/DB2_db.cc: adapt to Berkeley DB 3.0.55 syntax. * htlib/Database.h (class Database): remove DB_INFO, does not exist in Berkeley DB 3.0.55 * htlib/*: run ../db/prefix-symbols.sh * Makefile.config (INCLUDES): fix db include dirs * acconfig.h: Big file support + replacement functions * acinclude.m4,configure.in : db instead of db/dist + bug fixes Fri May 5 08:33:59 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * db/*: Merge in changes from Loic's mifluz tree. This will break everything, but Loic promises he'll fix it ASAP after I make this change. Mon Apr 24 21:58:22 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/htdig.cc (main): Make the -l stop & restart mode the default. This will catch signals and quit gracefully. The command-line parser will still accept -l, it will just ignore it. (usage): Remove -l portion. (main): Fix -m option to read in a file as it's supposed to do! Also set max_hops correctly so really only indexes the URLs in that file. * htdoc/htdig.html: Remove -l from documentation since it's now the default. Mon Apr 24 21:22:53 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Server.cc (push): Fix bug where changes in the robots.txt would be ignored. If a URL was indexed and later the robots.txt changed to forbid it, the URL would still be updated. Wed Apr 19 22:13:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * Merging in changes from mifluz 0.14 from Loic. * htlib/Configuration.cc (Read): Removed dependency on fstream.h, use fopen, fprintf, fgets, fclose instead of iostream. * htlib/HtPack.cc, htlib/HtVectorGeneric.h, htlib/Object.h, htlib/ParsedString.cc, htlib/String.cc: Remove use of cerr, instead use fprintf(stderr ...). * htlib/Dictionary.cc, htlib/HtVectorGeneric.cc, htlib/List.cc, htlib/Object.cc, htlib/StringList.cc, htlib/htString.h, htlib/strcasecmp.cc: Add #ifdef blocks for htconfig.h Wed Apr 12 19:09:40 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * .version: Bump to 3.2.0b3. * htdoc/htload.html, htdoc/htpurge.html, htdoc/htstat.html: Fix typos in headers. * htdoc/main.html: Fix link to download to actually point to 3.2.0b2. Tue Apr 11 00:21:48 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc (setupWords): Does not apply fuzzy algorithms to phrase queries. This helps prevent the infinite loops described on the mailing list. * htcommon/conf_parser.yxx (list): Add conditions for lists starting with string-number, number-string, and number-number. * htcommon/conf_parser.cxx: Regenerate using bison. * htdoc/RELEASE.html: Update release notes for recent bug fixes and likely release date for 3.2.0b2. * htdoc/main.html: Add a blurb about the 3.2.0b2 release. * htdoc/*.html: Remove author notes in the footer as requested by Andrew. To balance it out, the copyright notice at the top links to THANKS.html. Sun Apr 9 15:21:12 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/conf_parser.yxx (list): Fix problem with build_select_lists--parser didn't support lists including numbers. * htcommon/conf_parser.cxx: Regenerate using bison. Sun Apr 9 12:53:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/RELEASE.html: Add a first draft of 3.2.0b2 release notes. Sun Apr 9 12:31:13 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/Makefile.am, httools/Makefile.in: Add htload to compilation list. * htcommon/DocumentDB.h: Add optional verbose options to DumpDB and LoadDB. * htcommon/DocumentDB.cc (LoadDB): Implement loading and parsing an ASCII version of the document database. Records on disk will replace any matching records in the db. (DumpDB): Add all fields in the DocumentRef to ensure the entire database is written out. * htcommon/DocumentRef.h: Add new method for setting DocStatus from an int type. * htcommon/DocumentRef.cc (DocStatus): Set it using a switch statement. (It's not pretty, but it works.) * httools/htload.cc: New file. Loads in ASCII versions of the databases, replacing existing records if found. * httools/htdump.cc: Pass verbose flags to DumpDB method. Make sure to close the document DB before quitting. * httools/htpurge.cc: Add -u option to specify a URL to purge from the command-line. * httools/htstat.cc: Add -u option to output the list of URLs in the document DB as well. Sat Apr 8 16:35:55 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Change all <b>, <i>, and <tt> tags to the HTML-4.0 compliant <strong>, <em>, and <code> tags. * installdir/long.html, installdir/header.html, installdir/nomatch.html, installdir/syntax.html, installdir/wrapper.html: Ditto. * htdoc/*.html: Ditto. (Don't you just love sed?) * htsearch/TemplateList.cc (createFromString): Ditto. * htdoc/htpurge.html, htdoc/htdump.html, htdoc/htload.html, htdoc/htstat.html: New files documenting usage of httools programs. * htdoc/contents.html: Add links to above. * htdoc/htdig.html: Update table with -t format to match htdump. Fri Apr 7 00:30:01 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * README: Update to mention 3.2.0b2 and use correct copyright. (It is 2000 after all!) * htdoc/FAQ.html, htdoc/where.html, htdoc/uses.html, htdoc/isp.html: Update with most recent versions from maindocs. * htdoc/RELEASE.html: Add release notes for 3.1.5 to the top. (It's out of version ordering, but it is in correct chronological order.) Fri Apr 7 00:11:29 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htpurge.cc (main): Read in URLs from STDIN for purging, one per line. Pass them along to purgeDocs for removal. Also, make discard_list into a local variable and pass it from purgeDocs to purgeWords. (purgeDocs): Accept a hash of URLs to delete (user input) and return the list of doc IDs deleted. (usage): Note the - option to read in URLs to be deleted from STDIN. Thu Apr 6 00:10:23 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (got_redirect): Allow the redirect to accept relative redirects instead of just full URLs. Wed Apr 5 15:07:52 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc: Added #if test to make sure DBL_MAX is defined on Solaris, as reported by Terry Luedtke. Tue Apr 4 12:46:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/doc2html/*: Added parser submitted by D.J.Adams at soton.ac.uk Mon Apr 3 13:48:59 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Fix error in description of new attribute plural_suffix. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Mar 31 21:48:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure: Add test using AC_TRY_RUN to compile against the htlib/regex.c and attempt to compile a regexp. This should allow us to find out if the included regex code causes problems. * acconfig.h: Add HAVE_BROKEN_REGEX as a result of the configure script to conditionally include the appropriate regex.h file. * include/htconfig.h.in: Regenerate using autoheader. * htlib/regex.c: Move #include "htconfig.h" inside HAVE_CONFIG_H tests. This file is only created when this is true anyway. This prevents problems with the configure test. * htlib/HtRegex.h, htfuzzy/EndingsDB.cc: Use HAVE_BROKEN_REGEX switch to use the system include instead of the local include where appropriate. * htlib/Makefile.am, htlib/Makefile.in: Only compile regex.lo if the configure script added it to LIBOBJS. Thu Mar 30 22:41:38 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/URL.cc (normalizePath): Remove Gilles's loop to add back ../ components to a path that would go above the top level. Now we simply discard them. Both are allowed under the RFC, but this should have fewer "surprises." Tue Mar 28 21:57:49 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Connection.cc (Read_Partial): Fix bug reported by Valdas where a zero value returned by select would result in an infinite loop. * htcommon/defaults.cc: Add new attribute plural_suffix to set the language-dependent suffix for PLURAL_MATCHES contributed by Jesse. * htsearch/Display.cc (setVariables): Use it. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Mon Mar 27 22:28:20 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentRef.cc (Deserialize): Add back stub for DOC_IMAGESIZE to prevent decoding errors. This just throws away that field. * htcommon/HtSGMLCodec.h (class HtSGMLCodec): Differentiate between codec used for &foo; and numeric form &#nnn; Make sure encoding goes through both but decoding only goes through the preferred text form. * htcommon/HtSGMLCodec.cc (HtSGMLCodec): When constructing the private HtWordCodec objects, create separate lists for the number and text codecs. Mon Mar 27 21:25:27 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/HtURLSeedScore.cc (ScoreAdjustItem): Change to use HtRegex for flexibility and to get around const char * -> char * problems. * htsearch/SplitMatches.cc (MatchArea): Ditto. * htsearch/Makefile.am, htsearch/Makefile.in: Add SplitMatches.cc and HtURLSeedScore.cc to compilation list! Mon Mar 27 21:03:12 2000 Hans-Peter Nilsson <hp at bitrange.com> * htcommon/defaults.cc (defaults): Add default for search_results_order, url_seed_score. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerated using cf_generate.pl. * htlib/List.h (List): New method AppendList. * htlib/List.cc (List::AppendList): Implement it. * htsearch/SplitMatches.h, htsearch/SplitMatches.cc: New. * htsearch/HtURLSeedScore.cc, HtURLSeedScore.h: New. * htsearch/Display.h (class Display: Add member minScore. Change maxScore type to double. * htsearch/Display.cc: Include SplitMatches.h and HtURLSeedScore.h (ctor): Initialize minScore, change init value for maxScore to -DBL_MAX. (buildMatchList): Use a SplitMatches to hold search results and interate over its parts when sorting scores. Ignore Count() of matches when setting minScore and maxScore. Use an URLSeedScore to adjust the score after other calculations. Calculate minScore. Correct maxScore adjustment for change to double. (displayMatch): Use minScore in calculation of score to adjust for negative scores. (sort): Calculation of maxScore moved to buildMatchList. Mon Mar 27 20:22:24 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Remove DocImageSize field since it is not used anywhere and is never updated. * htdig/Retriever.h (class Retriever): Remove references to Images class. * htcommon/DocumentDB.cc (DumpDB): Ignore DocImageSize field. * htdig/Makefile.am, htdig/Makefile.in: Remove Images.cc since this is no longer used. * htdig/Plaintext.cc: Do not insert SGML equivalents into the excerpt, these are decoded by HtSGMLCodec automatically. Sat Mar 25 21:58:36 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/cf_generate.pl (html_escape): Changed <b></b> and <i></i> tags to HTML 4.0 <strong> and <em> tags. Sat Mar 25 17:23:46 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdb/Makefile.am, htdb/Makefile.in: Change the names of the htdb utility programs to escape name conflicts with httool programs. * htdb/htdb_load.cc: Rename htload.cc to escape name conflict and more closely match orignal db_load program name. * htdb/htdb_dump.cc, htdb/htdb_stat.cc: Ditto. * htfuzzy/Prefix.cc (getWords): Add code to "weed out" duplicates returned from WordList::Prefix. We only want to add unique words to the search list. Fri Mar 24 22:33:20 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc (Document): Fix bug reported by Mentos Hoffman, contributed by Atlee Gordy <agordy at moonlight.net>. Mon Mar 20 23:14:26 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentDB.cc (Delete): Fix bug reported by Valdas where duplicate document records could "sneak in" because the doc_index entry was removed incorrectly. Mon Mar 20 19:08:14 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Added block field and added appropriate blocks. * htlib/Configuration.h (struct ConfigDefaults): Add block field. * htdoc/cf_generate.pl: Parse the new block field. * htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/attrs.html: Regenerate using above. * htcommon/DocumentDB.cc (DumpDB): Make sure we decompress the DocHead field before we write it to disk! * httools/htdump.cc, httools/htstat.cc: Call WordContext::Initialize() before doing any htword calls. Mon Mar 20 14:10:30 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/htpurge.cc: Whoops! Left some references to htmerge in the error messages and usage message. * httools/htstat.cc: New program. Simply spits up the total number of documents, words and unique words in the databases. * httools/htdump.cc: New program. Simply dumps the contents of the document DB and the word DB to doc_list and word_dump files respectively. Also has flags -w and -d to pick one or the other. * httools/Makefile.am, httools/Makefile.in: Add htdump and htstat programs to compilation list. * htcommon/DocumentDB.cc (DumpDB): Change name of CreateSearchDB and add fields for DocBackLinks, DocSig, DocHopCount, DocEmail, DocNotification, and DocSubject. This should now export every portion of the document DB. * htcommon/DocumentDB.h: Change name of CreateSearchDB and add stub for LoadDB, to be written shortly. * htdig/htdig.cc: Call DumpDB instead of CreateSearchDB when creating an ASCII version of the DB. Sat Mar 18 22:57:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * httools/Makefile.am, httools/Makefile.in: New directory for useful database utilities. * httools/htnotify.cc: Moved htnotify to httools directory. * httools/htpurge.cc: New program--currently just purges documents (and corresponding words) in the databases. Will shortly also allow deletion of specified URLs. * Makefile.am, configure.in: Remove htnotify directory in favor of httools directory. * configure: Regenerate using autoconf. * Makefile.in: Regenerate using automake --foreign. Fri Mar 17 16:47:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (excerpt, hilight): Correctly handle case where there is no pattern to highlight. * htsearch/htsearch.cc (addRequiredWords), htcommon/defaults.cc: Add any_keywords attribute, to OR keywords rather than ANDing, fix addRequiredWords not to mess up expression when there are no search words, but required words are given. * htdoc/hts_form.html: Mention new attribute, add links to all mentioned attributes. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Mar 17 15:48:12 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Accents.cc (generateKey): Truncate words to maximum_word_length, for consistency with what's found in word DB. Fri Mar 17 10:56:17 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Use case insensitive parsing of META robots tag content. * htlib/String.cc (uppercase): Fix misplaced cast for islower(). Mon Mar 6 17:31:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc (setupWords): Don't allow comma as string list separator, as it can be a decimal point in some locales. Mon Mar 06 00:58:00 2000 Loic Dachary <loic at ceic.com> * db/mp/mp_bh.c (__memp_bhfree): always free the chain, if any. The bh is reset to null after free and we loose the pointer anyway, finally filling the pool with it. * db/mp/mp_cmpr.c (__memp_cmpr_write): i < CMPR_MAX - 1 instead of i < CMPR_MAX otherwise go beyond array limits. This fixes a major problem when handling large files. Sat Mar 04 19:41:49 2000 Loic Dachary <loic at ceic.com> * db/mp/mp_cmpr.c (__memp_cmpr_free_chain): clear BH_CMPR flag. Was causing core dumps, thanks to Peter Marelas maral at phase-one.com.au for providing a simple case to reproduce the error. Fri Mar 3 11:32:34 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * Fixed bugs regarding yesterday's changes. Even Leonardo da Vinci used to commit errors, so ... Fri Mar 3 11:25:42 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * testnet.cc: added the -r and -w options in order to set how many times it retries to re-connect after a timeout occurs, and how long it should wait after it. Thu Mar 2 18:45:15 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/Connection.*: management of wait_time and number of retries after a timeout occurs. * htnet/Transport.*: Management of connection attributes above. * htdig/Server.*: Set members for managing timeout retries taken from the configuration file ("timeout", "tcp_max_retries", "tcp_wait_time"). * htdig/Document.cc: Added the chance to configure on a server basis "persistent_connections", "head_before_get", "timeout", "tcp_max_retries", "tcp_wait_time". Changed Retrieve method accepting now a server object pointer: Retrieve (server*, HtDateTime). * htdig/Retriever.cc: Added the chance to configure on a server basis "max_connection_requests" attribute. * htcommon/defaults.cc: Added "tcp_max_retries", "tcp_wait_time" -- Need to be go over by someone who speaks english better than me. Not a hard work !!! ;-) Wed Mar 1 17:01:09 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc (excerpt, hilight): move SGML encoding into hilight() function, because when it's done earlier it breaks highlighting of accented characters. Wed Mar 1 16:02:49 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/htfuzzy.cc (main): Correctly test return value on Open() of word database, include db name in error message if Open() fails, do a WordContext::Initialize() before we need htword functions. (Obviously I'm the first to test htfuzzy in 3.2!) * htfuzzy/Accents.cc (generateKey): cast characters to unsigned char before using as array subscripts. Wed Mar 1 13:27:26 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Added accents_db attribute, mentioned accents algorithm in search_algorithms section. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * installdir/htdig.conf: Added mentions of accents, speling & substring, fixed a couple typos in comments. * htdoc/htfuzzy.html: Added blurb on accents algorithm. * htdoc/require.html: Added mentions of accents, speling, substring, prefix & regex. * htdoc/config.html: Updated with sample of latest htdig.conf and installdir/*.html, added blurb on wrapper.html. Wed Mar 1 00:30:19 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure: Add test for FD_SET_T, the second (also third and fourth) argument in calls to select(). Should solve PR#739. * acconfig.h, include/htconfig.h.in: Add declaration for FD_SET_T. * htnet/Connection.cc (ReadPartial): Change declaration of fds to use FD_SET_T define set by the configure script. Tue Feb 29 23:11:49 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/DB2_db.cc (Error): Simply fprint the error message on stderr. This is not a method since the db.h interface expects a C function. (db_init): Don't set db_errfile, instead set errcall to point to the new Error function. Tue Feb 29 15:09:41 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Accents.h, htfuzzy/Accents.cc: Adapted writeDB() for 3.2. Tue Feb 29 14:29:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Accents.h, htfuzzy/Accents.cc: Added these, as contributed by Robert Marchand, to implement accents fuzzy match. Adapted to 3.2. * htfuzzy/Fuzzy.cc, htfuzzy/htfuzzy.cc, htfuzzy/Makefile.am, htfuzzy/Makefile.in: Added in accents algorithm, as for soundex. Tue Feb 29 11:31:53 2000 Loic Dachary <loic at ceic.com> * test/testnet.cc (Listen): Add -b port to listen to a specific port. This is to test connect timeout conditions. * htnet/Connection.cc (Connect): Added SIGALRM signal handler, Connect() always allow EINTR to occur. Mon Feb 28 15:32:46 2000 Loic Dachary <loic at ceic.com> * htword/WordKey.h (class WordKey): explicitly add inline keyword for all inline functions. Mon Feb 28 13:10:34 2000 Loic Dachary <loic at ceic.com> * htword/WordKey.h (class WordKey): nfields data member caches result of NFields() method. * htword/WordDBPage.h (class WordDBPage): nfields data member caches result of WordKey::NFields() method. * acinclude.m4 (APACHE): check in lib/apache for modules Sat Feb 26 22:05:03 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Collection.h, htsearch/Collection.cc: New files contributed by Rajendra Inamdar <inamdar at beasys.com>. * htsearch/Makefile.am, htsearch/Makefile.in: Compile them. * htcommon/defaults.cc: Add new collection_names attribute as described by Rajendra. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * htsearch/Display.h, htsearch/Display.cc: Loop through collections as we are assembling results. (buildMatchList): Use 1.0 as minimum score and take log(score) as the final score. This requires an increase in magnitude in weight to correspond to a factor of increase in score. * htsearch/DocMatch.h, htsearch/DocMatch.cc: Keep track of the collection we're in. * htsearch/ResultMatch.h: Ditto. * htsearch/htsearch.h, htsearch/htsearch.cc: Wrap results in collections. * htsearch/parser.h, htsearch/parser.cc: Set the collection for the results--we use this to get to the appropriate word DB. (score): Divide word weights by word frequency to calibrate for expected Zipf's law. Rare words should count more. Fri Feb 25 11:19:47 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (maximum_pages): Describe new bahaviour (as of 3.1.4), where this limits total matches shown. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Thu Feb 24 14:43:06 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtFile.cc (Request): Fix silly typo. * htlib/DB2_db.cc: Remove include of malloc.h, as it causes problems on some systems (e.g. Mac OS X), and all we need should be in stdlib.h. Thu Feb 24 13:11:15 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnet/HtFile.cc (Request): Don't append more than _max_document_size bytes to _contents string, set _content_length to size returned by stat(). * htnet/HtHTTP.cc (HTTPRequest): Extra tests in case Content-Length not given for non-chunked input, and not to close persistent connection when chunked input exceeds _max_document_size. (ReadChunkedBody): Don't append more than _max_document_size bytes to _contents string. Thu Feb 24 11:40:24 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Fix handling of img alt text to be consistent with body text, rather than keywords. * htdig/Retriever.cc (ctor): Treat alt text as plain text, until it has its own FLAG and factor. Thu Feb 24 11:16:37 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (version): Moved example over to correct field. (defaults[] terminator): Padded zeros to new number of fields. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Thu Feb 24 19:08:41 2000 Loic Dachary <loic at ceic.com> * htmerge/words.cc: only display Word in verbose message instead of complete key if verbosity < 3. Thu Feb 24 10:43:12 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (external_protocols, external_parser): Swapped these two entries to put them in alphabetical order. (star_blank): Fixed old typo (incorrect reference to image_star). * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 23 16:53:40 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc (backlink_factor, external_parser, local_default_doc, local_urls, local_urls_only, local_user_urls): Add some updates from 3.1.5's attrs.html. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 23 15:11:51 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> [ Improve htsearch's HTML 4.0 compliance ] * htsearch/TemplateList.cc (createFromString): Use file name rather than internal name to select builtin-* templates, use $&(TITLE) and $&(URL) in templates and quote HTML tag parameters. * installdir/long.html, installdir/short.html: Use $&(TITLE) and $&(URL) in templates and quote HTML tag parameters. * htsearch/Display.cc (setVariables): quote all HTML tag parameters in generated select lists. * installdir/footer.html, installdir/header.html, installdir/nomatch.html, installdir/search.html, installdir/syntax.html, installdir/wrapper.html: Use $&(var) where appropriate, and quote HTML tag parameters. * installdir/htdig.conf: quote all HTML tag parameters. Wed Feb 23 13:40:27 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/URL.h (encodeURL): Change list of valid characters to include only unreserved ones. * htcommon/cgi.cc (init): Allow "&" and ";" as input param. separators. * htsearch/Display.cc (createURL): Encode each parameter separately, using new unreserved list, before piecing together query string, to allow characters like "?=&" within parameters to be encoded. Wed Feb 23 13:22:29 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/URL.cc (ServerAlias): Fix server_aliases processing to prevent infinite loop (as for local_urls in PR#688). Wed Feb 23 12:49:52 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtDateTime.h, htlib/HtDateTime.cc: change Httimegm() method to HtTimeGM(), to avoid conflict with Httimegm() C function, so we don't need "::" override, for Mac OS X. * htlib/htString.h, htlib/String.cc: change write() method to Write(), to avoid conflict with write() function, so we don't need "::" override, for Mac OS X. Wed Feb 23 12:17:46 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/Configuration.cc(Read): Fixed to allow final line without terminating newline character, rather than ignoring it. Wed Feb 23 12:01:01 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (GetLocal, GetLocalUser): Add URL-decoding enhancements to local_urls, local_default_urls & local_default_doc, to allow hex encoding of special characters. Wed Feb 23 19:14:29 2000 Loic Dachary <loic at ceic.com> * htcommon/conf_parser.cxx: regenerated from conf_parser.yxx Wed Feb 23 19:04:16 2000 Loic Dachary <loic at ceic.com> * test/test_functions.in: inconditionaly remove existing test/var directory before runing tests to prevent accidents. * htcommon/URL.cc (URL): fixed String->char warning * htcommon/defaults.cc (wordlist_compress): defaults to true Tue Feb 22 17:09:10 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc(parse, do_tag): Fix handling of <img alt=...> text and parsing of words in meta tags, to to proper word separation. * htlib/HtWordType.h, htlib/HtWordType.cc: Add HtWordToken() function, to replace strtok() in HTML parser. Tue Feb 22 16:21:25 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/URL.cc (ctor, normalizePath): Fix PR#779, to handle relative URLs correctly when there's a trailing ".." or leading "//". Tue Feb 22 14:09:26 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (RetrieveLocal): Handle common extensions for text/plain, application/pdf & application/postscript. Mon Feb 21 17:25:21 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/htdig-3.2.0.spec: Fixed %post script to add more descriptive entries in htdig.conf, made cron script a config file, updated to 3.2.0b2. * contrib/conv_doc.pl, contrib/parse_doc.pl: Added comments to show Warren Jones's updates in change history. Mon Feb 21 17:09:13 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/HtConfiguration.h, htcommon/conf_parser.yxx, htlib/Configuration.h, htlib/Configuration.cc: split Add() method into Add() and AddParsed(), so that only config attributes get parsed. Use AddParsed() only in Read() and Defaults(). Fri Feb 18 22:50:54 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Connection.h, htnet/Connection.cc: Renamed methods with capitals to remove the need to use ::-escaped library calls. * htnet/Transport.h, htnet/Transport.cc, htnet/HtHTTP.cc, htdig/Images.cc: Fix code using Connection to use the newly capitalized methods. Fri Feb 18 14:40:50 2000 Loic Dachary <loic at ceic.com> * test/conf/access.conf.in: removed cookies. Not used and some httpd are not compiled with usertrack. Wed Feb 16 12:15:08 2000 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/Makefile.am replaced conf.tab.cc.h by conf_parser.h in noinst_HEADERS * htcommon/conf_parser.yxx,conf_parser.lxx,HtConfiguration.cc, HtConfiguration.h: added copyright and Id: * htcommon/cgi.cc(init): fixed bug: array must be free by delete [] buf, not just delete buf; Tue Feb 15 23:16:14 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/HtHTTP.cc (isParsable): Remove application/pdf as a default type--it is now handled through the ExternalParser interface if at all. * htcommon/defaults.cc: Remove pdf_parser attribute. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. * htdig/Document.cc (getParsable): Remove PDF once and for all (hopefully). * htdig/ExternalParser.cc (parse): Ditto. * configure.in: Remove check for PDF_PARSER. * configure: Regenerate using autoconf * htdig/Makefile.am: Remove PDF.cc and PDF.h. * Makefile.in, */Makefile.in: Regenerate using automake --foreign Tue Feb 15 12:02:39 EET 2000 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/HtConfiguration.cc,HtConfiguration.h: fixed bug discovered by Gilles. HtConfiguration was able to get info only from "url" and "server" block. * htcommon/conf_parser.yxx: deleted 1st parameter for new char[], lefted when realloc was replaced by new char[]. Removed a few unused variable declaration. * htcommon/Makefile.am: added -d flag to bison to generate conf_parser.h template from conf_parser.yxx; conf_lexer.lxx uses #include conf_parser.h; conf.tab.cc.h removed. Sun Feb 13 21:19:04 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Get rid of uncoded_db_compatible since the current DB format has clearly broken backwards compatibility. * htsearch/Display.cc (Display), htnotify/htnotify.cc (main), htmerge/docs.cc (convertDocs), htmerge/db.cc (mergeDB), htdig/htdig.cc (main): Remove call to DocumentDB::setCompatibility(). * htcommon/DocumentDB.h (class DocumentDB): Remove setCompatibility and related private variable. * htcommon/DocumentDB.cc ([], Delete): Don't bother checking for an unencoded URL, at this point all URLs will be encoded using HtURLCodec. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Sat Feb 12 21:29:20 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/HtSGMLCodec.cc (HtSGMLCodec): Always translate " & < and > * htcommon/defaults.cc: Remove translate_* and word_list attributes since they're now no longer used. * htdig/PDF.cc (parseNonTextLine): Fix bogus escape sequences around Title parsing. Fixes PR#740. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Fri Feb 11 11:41:36 2000 Loic Dachary <loic at ceic.com> * htlib/Makefile.am: removed CFLAGS=-g (use make CXXFLAGS=-g all instead). * htdoc/install.html: specify header/lib install directory now is prefix/include/htdig and prefix/lib/htdig. * Makefile.am (distclean-local): use TESTDIR instead of deprecated HTDIGDIRS. * */Makefile.am: install libraries in prefix/lib/htdig and includes in prefix/include/htdig. Just prepend pkg in front of automake targets. * include/Makefile.am: install htconfig.h Thu Feb 10 23:18:37 2000 Loic Dachary <loic at ceic.com> * Connection.cc (Connection): set retry_value to 1 instead of 0 as suggested by Geoff. Thu Feb 10 17:36:09 2000 Loic Dachary <loic at ceic.com> * htdig/Document.cc: fix (String)->(char*) conversion warnings. * htword/WordList.cc: kill Collect(WordSearchDescription) which was useless and error prone. * htword/WordDB.h (WordDBCursor::Get): small performance improvement by copying values only if key found. * htword/WordDB.h,WordList.cc: fix reference counting bug when using Override (+1 even if entry existed). Turn WordDB.h return values to be std Berkeley DB fashion instead of the mixture with OK/NOTOK that was a stupid idea. This allows to detect Put errors and handle them properly to fix the Override bug without performance loss. * test/conf/httpd.conf.in: comment out loading of mod_rewrite since not everyone has it. Thu Feb 10 00:26:02 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Add new attribute "nph" to send out non-parsed headers for servers that do not supply HTTP headers on CGI output (e.g. IIS). * htsearch/Display.cc (display): If nph is set, send out HTTP OK header as suggested by Matthew Daniel <mdaniel at scdi.com> (displaySyntaxError): Ditto. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate from current defaults.cc file. Thu Feb 10 00:21:58 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Treat <script></script> tags as noindex tags, much like <style></style> as suggested by Torsten. Thu Feb 10 00:02:41 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * .version: Bump for 3.2.0b2. * htcommon/defaults.cc: Add category fields for each attribute. Though these are currently unused, they could allow the documentation to be split into multiple files based on logical categories and subcategories. Wed Feb 9 23:52:55 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Connection.cc (connect): Add alarm(timeout) ... alarm(0) around ::connect() call to ensure this does timeout as appropriate as suggested by Russ Lentini <rlentini at atl.lmco.com> to resolve PR#762 (and probably others as well). (connect): Add a retry loop as suggested by Wilhelm Schnell <Wilhelm.Schnell at mn.man.de> to resolve PR#754. * htnet/HtHTTP.cc (HTTPRequest): Add CloseConnection() when the connection fails on open before returning from the method. Should take care of PR#670 for htdig-3-2-x. Wed Feb 09 17:20:50 2000 Loic Dachary <loic at ceic.com> * db/dist/Makefile.in (libhtdb.so): move dependent libraries *after* the list of objects, otherwise it's useless. * htword/WordKey.h (class WordKey): move #if SWIG around to please swig (www.swig.org). * htword/WordList.h (class WordList): allow SWIG to see Walk* functions (#if SWIG). Wed Feb 9 09:21:00 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Server.cc (robotstxt): apply more rigorous parsing of multiple user-agent fields, and use only the first one. * htlib/HtRegex.cc (set): apply the fix from Valdas Andrulis, to properly compile case_sensitive expressions. Mon Feb 09 09:43:59 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.cc: changed "<<" to append() for content_length assignment in ReadChunkedBody() function (as Gilles suggested) Tue Feb 08 10:54:08 2000 Loic Dachary <loic at ceic.com> * db/dist/configure.in: Added AC_PREFIX_DEFAULT(/opt/www) so that headers and libraries are installed in the proper directory when no --prefix is given. Tue Feb 08 10:32:48 2000 Loic Dachary <loic at ceic.com> * test/t_wordskip: copy $srcdir/skiptest_db.txt to allow running outside the source tree. * configure.in: use '${prefix}/...' instead of "$ac_default_prefix/..." that did not carry the --prefix value. * configure.in: run CHECK_USER and AC_PROG_APACHE if --enable-tests Mon Feb 07 17:40:47 2000 Loic Dachary <loic at ceic.com> * htlib/htString.h (last): turn to const Mon Feb 07 14:05:37 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/HtHTTP.cc: fixed a bug in ReadChunkedBody() function regarding document size assignment (raised by Valdas Andrulis) Sun Feb 06 19:11:05 2000 Loic Dachary <loic at ceic.com> * configure.in: Fix inconsistencies between default values shown by ./configure and actual defaults. * htdoc/install.html: change example version 3.1 to 3.2 Commented out warning about libguile. Replace CONFIG variables by configure.in options. Specify default value for each of them. Replace (and move) make depend by automake (distributed Makefiles do not include dependency generation) Added section for running tests. Added section on shared libraries. * configure.in: use AM_CONDITIONAL for --enable-tests * Makefile.am: use automake conditionals for subdir so that make dist knows what to distribution --enable-tests specified or not. * db/Makefile.in: allow make dist to work outside the source tree. Sat Feb 05 18:31:04 2000 Loic Dachary <loic at ceic.com> * test/word.cc (SkipTestEntries): The fix of WordList::SkipUselessSequentialWalking actually saves us a few hops when walking lists of words. Fri Feb 04 17:28:32 2000 Loic Dachary <loic at ceic.com> * htword/WordKey.cc,WordReference.cc,WordRecord.cc (Print): use cerr instead of cout for immediate printing under debugger. Thu Feb 3 16:06:45 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (RetrieveLocal): fix bug that prevented local filesystem digging, because max_doc_size was initialized to 0. Now sets it to max_doc_size for current url. Thu Feb 3 12:36:56 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/Makefile.{am,in}: install mime.types as mime.types, not as htdig.conf. * htfuzzy/EndingsDB.cc (createDB): fix code to use MV macro in system() command, not hard-coded "MV" string literal, and use get() on config objects to avoid passing String objects to form(). Wed Feb 2 19:44:33 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.cc (SetRFC1123): Strip off weekday, if present and use LOOSE format. (SetRFC850): Ditto. * configure.in, configure: Add configure check for "mv." * htfuzzy/Makefile.am: Use it. * */Makefile.in: Regenerate using automake. * htfuzzy/EndingsDB.cc (createDB): Use the detected mv, or whatever is in the path to move the endings DB when they're finished. Wed Feb 2 15:49:14 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (RetrieveLocal), htdig/Retriever.cc (GetLocal): Fix compilation errors. Oops! Wed Feb 2 13:53:27 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc (IsValidURL): fix problem with valid_extensions matching failure when URL parameters follow extension. Wed Feb 2 13:29:48 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/QuotedStringList.cc (Create): fix PR#743, where quoted string lists didn't allow embedded quotes of opposite sort in strings (e.g. "'" or '"'), and fix to avoid overrunning end of string if it ends with backslash. Wed Feb 2 13:23:16 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (ctor, parse, do_tag), htcommon/defaults.cc: Add max_keywords attribute to limit meta keyword spamming. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Wed Feb 2 12:57:40 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (RetrieveLocal), htdig/Document.h, htdig/Retriever.cc (Initial, parse_url, GetLocal, GetLocalUser, IsLocalURL, got_href, got_redirect), htdig/Retriever.h, htdig/Server.cc (ctor), htdig/Server.h: Add in Paul Henson's enhancements to local_urls, local_default_urls & local_default_doc. * htcommon/defaults.cc: Document these. Wed Feb 02 10:14:57 2000 Loic Dachary <loic at ceic.com> * htword/WordKeyInfo.h,WordKey.{cc,h}: fix overflow bug when 32 bits. For that purpose implement Outbound/Overflow/Underflow methods in WordKey, MaxValue in WordKey/WordKeyInfo. (WordKey::SetToFollowing) was FUBAR : overflow of field1 tested with number of bits in next field, do not handle overflow, Re-implemented. (WordKey::Set) Change atoi to strtoul. (WordList::SkipUselessSequentialWalking) was much to fucked up to explain. Re-implement (WordKey::Diff) Added as a support function of SkipUselessSequentialWalking. implement consistent verbosity. * htword/WordList.cc (operator >>): explicit error message when insert failed, with line number. Wed Feb 2 00:11:03 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdoc/RELEASE.html: Finish up with notes on all significant new attributes. * htdoc/FAQ.html, htdoc/where.html: Mention new 3.2.0b1 release as a beta. * contrib/README: Update to mention new scripts. * installdir/mime.types: Add default Apache mime.types file for systems that do not already have one. * installdir/Makefile.am: Make sure it is installed by default. * installdir/Makefile.in: Regenerate using automake. * htcommon/defaults.cc: Add documentation for mime_types attribute, remove currently unused image_alt_factor, and add documentation for external_protocols. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Regenerate using cf_generate.pl. Tue Feb 1 10:24:19 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.cc (score): fix up score calculations for correctness and efficiency. Mon Jan 31 16:29:20 2000 Marcel Bosc <bosc at ceic.com> * htword/WordBitCompress.cc: fixed endian bug in compression Sat Jan 29 21:14:03 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/parser.cc (score): Change config.Value (which returns int) to config.Double to preserve accuracy of attributes. * htcommon/defaults.cc: Updated documentation for attributes now allowing regex, search_algorithms (for new fuzzy) and added documentation for the overlooked remove_unretrieved_urls. * htdoc/*.html: Updated copyright notice for 2000, changed footer to use CVS's magic Date keyword. Regenerated documentation from defaults changes. Sat Jan 29 16:32:08 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * contrib/htdig-3.1.4.spec, contrib/htdig-3.1.4-conf.patch: Remove these since they don't apply to the 3.2.x releases. * htfuzzy/Synonym.cc (openIndex): Change database format from DB_BTREE to DB_HASH--no reason for the synonym database to be a btree. This was probably overlooked when I switched the rest of the fuzzy databases over to DB_HASH. Sat Jan 29 05:34:26 2000 Loic Dachary <loic at ceic.com> * htword/WordKey.h (UnpackNumber): Very nasty bug. Optimization dated Dec 29 broke endianess on Solaris. Restore previous version. Fri Jan 28 18:17:08 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Configuration.h (struct ConfigDefaults): Add version and category fields for more accurate documentation. * htcommon/defaults.cc: Add blank category fields and start filling in version field. Killed modification_time_is_now_attribute. * htdig/Document.cc (Document): Kill attribute modification_time_is_now since it can cause more harm than good. * htnet/HtHTTP.cc (ParseHeader): Ditto. * htdoc/cf_generate.pl: Added support for new version and category fields. Currently category does nothing, but it could split the documentation into categories. Sat Jan 29 01:37:45 2000 Loic Dachary <loic at ceic.com> * .version: remove the trailing -dev Thu Jan 27 12:22:57 2000 Loic Dachary <loic at ceic.com> * htword/WordList.cc: cdebug replaced by cerr. replace lverbose by verbose > 2. Remove shutup. (WordList): monitor = 0 (Open): create monitor only if wordlist_monitor = true (Close): delete monitor if set, delete compressor if set * htword/WordDBCompress.cc,WordList.cc: only activate monitoring code if monitor is set. No interaction with the monitor is therefore possible if wordlist_monitor is false. * htword/WordMonitor.cc: remove useless test of wordlist_monitor (done by WordList now). * htword/WordDBCompress.cc (TestCompress): remove redundant debuglevel argument. * htword/WordDBCompress.cc (WordDBCompress): init cmprInfo to 0 * db/include/db_cxx.h: Add get_mp_cmpr_info method * htword/WordDBCompress.cc (WordDBCompress): set default debug level to 0 * htword/WordDB.h: CmprInfo returns current CmprInfo and non static, overload to set CmprInfo if argument given. * htword/WordDBCompress.h: new CmprInfo() method returns DB_CMPR_INFO object for Berkeley DB database. * htword/WordList.h: add compressor member, kill cmprInfo member. * htword/WordList.cc: Wed Jan 26 20:05:33 2000 Loic Dachary <loic at ceic.com> * htword/WordList.cc,htword/WordList.h: get rid of obsolete WordBenchmarking Wed Jan 26 9:14:32 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htcommon/defaults.cc: added "max_connection_requests". * htdig/Retriever.cc: now manages the attribute above. Tue Jan 25 12:59:01 2000 Loic Dachary <loic at ceic.com> * htsearch/Display.cc (setVariables): fixed Display.cc:505: warning: multiline `//' comment Tue Jan 25 8:37:15 2000 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Document.h: Added the "HtHTTP *GetHTTPHandler()" method, in order to be able to control an HTTP object outside the Document class. This is useful for the Server class, after the request for robots.txt. We can control the response of a server and check if it supports persistent connections. * htdig/Server.cc: inside the constructor, persistent_connections var is initialized to the configuration parameter value, instead of <true>. Besides, after the request of the robots.txt, it controls and set the attribute for persistent connections, depending on whether the server supports them or not. * htdig/Retriever.cc: modified the Start() method. Now the loop manage HTTP persistent connections "on a server" basis. Indeed, it's a Server object that decides if persisent connections are allowed on that server or not (depending on configuration or capabilities of the remote http server). Mon Jan 24 12:57:45 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setVariables): Added double quotes around default selection value in build_select_lists handling. Mon Jan 24 12:37:22 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setVariables), htcommon/defaults.cc: Added build_select_lists attribute, to generate selector menus in forms. Added relevant explanations and links to selectors documentation. * htdoc/hts_selectors.html: Added this page to explain this new feature, plus other details on select lists in general. * htdoc/hts_templates.html: Added relevant links to related attributes and selectors documentation. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Fri Jan 21 18:57:58 EET 2000 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/HtConfiguration.cc: added HtConfiguration::ParseString(char*) method to allow lexer handle "include: ${var}/file.inc" construction * htcommon/conf_lexer.lxx: fixed handling "include: ${var}file.inc" bug. Fri Jan 21 17:04:28 2000 Loic Dachary <loic at ceic.com> * htword/WordList.cc (WalkFinish,WalkInit,WalkNextStep): fix typos in error messages and misleading comment. * htword/WordList.h,WordList.cc: move part of WalkInit in WalkRewind so that we have a function to go back to the beginning of possible matches. Wed Jan 19 21:49:57 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Only add words for META descriptions, keywords, and IMG ALT attributes if doindex is set. * htcommon/DocumentRef.h: Added Reference_obsolete for documents that should be removed (but haven't). * htdig/Retriever.cc (parse_url): Flag documents that have been modified as Reference_obsolete and update the database. Flag all documents with various errors as something other than Reference_normal, as appropriate--these probably should be pruned. * htdig/Retriever.h: Get rid of GetRef() method--it's only used once! * htsearch/Display.cc (display): Don't show DocumentRefs with states other than Reference_normal--these documents have various errors. * htmerge/docs.cc: If a document has a state of Reference_obsolete, ignore it. * htcommon/HtWordList.h, htcommon/HtWordList.cc (Skip): Change MarkGone() to Skip() to emphasize that this document should be ignored. Wed Jan 19 14:11:51 2000 Loic Dachary <loic at ceic.com> * htword/WordList.cc (SkipUselessSequentialWalking): return OK if skipping, NOTOK if not skipping. * htword/WordReference.h: remove useless Clear in WordReference(key, record) constructor. * htword/WordList.h,WordList.cc: Split Walk in three separate functions WalkInit, WalkNext and WalkFinish. Much clearer. Fill the status field of WordSearchDescription to have more information about the error condition. Add found field to WordSearchDescription for WalkNext result. Add cursor_get_flags and searchKeyIsSamePrefix fields to WordSearchDescription as internal state information. * htword/WordList.h,WordList.cc: WalkInit to create and prepare cursor, WalkNext to move to next match WalkNextStep to move to next index entry, be it a match or not WalkFinish to release cursor. * htword/WordList.h: WordSearchDescription::ModifyKey add to jump while walking. * htword/WordList.cc (WalkNext) : it is now legal to step without collection or callback because search contains the last match (found field) and it s therefore not useless. Mon Jan 17 12:15:45 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/htdig-3.2.0.spec: added sample RPM spec file for 3.2 Sat Jan 15 11:53:35 2000 Loic Dachary <loic at ceic.com> * htdb/htstat.cc,htdb/htdump.cc: remove useless -S option since the page size is found in the header of the file. * htdb/htstat.cc,htdump.cc,htload.cc: only call WordContext::Initialize if -W flag specified. Fri Jan 14 18:39:12 2000 Marcel Bosc <bosc at ceic.com> * htword/WordBitCompress.cc: speedup, VlengthCoder::code() finds appropriate coding interval much faster Fri Jan 14 11:30:41 2000 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriver.cc(IsValidURL): Fix problem with valid_extensions, which got lost in the shuffle yesterday. Fri Jan 14 15:56:49 2000 Loic Dachary <loic at ceic.com> * htword/WordType.cc,WordRecord.cc,WordKeyInfo.cc (Initialize): change inverted test on instance (== instead of !=). * htword/WordRecord.cc (WordRecordInfo): change inverted test on compare Fri Jan 14 14:24:39 2000 Loic Dachary <loic at ceic.com> * htdig/htdig.cc,htmerge/htmerge.cc,htsearch/htsearch.cc: Use Initialize(defaults) to load configuration file if provided. * htword/WordDBCompress.cc (Compress): initialize monitor to null in constructor and check if null before usage. Core dumped in htdb/htload. * htword/WordContext.h (class WordContext): Add Initialize(const ConfigDefaults* config_defaults = 0) that probe configuration files. Usefull when htword is used as a standalone library. Thu Jan 13 19:52:27 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriver.cc: Fix problem with valid_extensions when an "extension" would include part of a directory path or server name, as contributed by Warren Jones. Thu Jan 13 19:22:25 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Makefile.am, htnet/Makefile.in: Add HtFile to the build process. Thu Jan 13 18:58:03 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/HtFile.h, htnet/HtFile.cc: New Transport classes contributed by Alexis Mikhailov to allow file:// access. * htdig/Document.h, htdig/Document.cc: Add logic to call HtFile objects for URLs. * htcommon/URL.cc: Don't remove a trailing index.html (removeIndex) if the URL is a file://URL. Thu Jan 13 18:49:41 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * contrib/conv_doc.pl, contrib/parse_doc.pl: Replace "break" by "last" for correct Perl syntax and additional cleanups and simplifications as contributed by Warren Jones. Thu Jan 13 18:42:29 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * htword/WordType.h, htword/WordType.cc: Implementation of new methods IsDigit() and IsCntrl() as contributed by Marc Pohl <marc.pohl at wdr.de>. Fixes some problems with 8-bit characters. Thu Jan 13 17:17:47 2000 Geoff Hutchison <ghutchis at wso.williams.edu> * ChangeLog.0, configure, configure.in, htfuzzy/Endings.cc, htlib/String.cc, htlib/Configuration.cc, htlib/QuotedStringList.cc, htlib/regex.c, htcommon/defaults.cc, htdig/ExternalParser.cc, htdig/Retriever.h, htsearch/Display.cc, include/htconfig.h.in installdir/htdig.conf: Merge in changes from 3.1.x releases. * htdoc/: Merge in documentation changes from 3.1.x releases. Thu Jan 13 20:12:42 2000 Loic Dachary <loic at ceic.com> * htword/WordList.cc (Walk): close the cursor before returning. If not doing that the cursor might be closed after the database is closed, leading to double free of the cursor. Bad bug. Thu Jan 13 13:23:17 2000 Loic Dachary <loic at ceic.com> * htword/WordContext.h (class WordContext): simplifies a lot. WordContext is no longer a repository for pointers of class instances. Only a place to call Initialize for classes that have a single instance. * htlib/HtWordType.cc: added to include definition of functions shortcuts for WordType. * htword/WordRecord.h,WordType.h,WordKeyInfo.h: implement homogeneous scheme to handle unique instance of the class. - constructor takes const Configuration& argument and init object with config values - static member instance - static method Initialize the static member instance - static method Instance returns the pointer in instance data member * htword/WordRecord.cc: add constructor for WordRecordInfo, and Instance static function. Add WORD_RECORD_INVALID to depict uninitialize WordRecordInfo object. * htword/WordKeyInfo.h: rename SetKeyDescriptionFromFile and SetKeyDescriptionFromString to InitializeFromFile and InitializeFromString and implement them by calling Initialize. rename SetKeyDescriptionRandom to InitializeRandom rename Initialize(String& line) to GetNFields(String& line) rename Initialize(int nfields) to Alloc(int nfields) * htdig/htdig.cc,htmerge/htmerge.cc,htsearch/htsearch.cc,test/word.cc: replace WordList::Initialize with WordContext::Initialize and run immediately after config is read. Otherwise WordType fails to work and configuration value extraction will fail. * htmerge/htmerge.cc: move initialization * test/conf/htdig.conf2.in: reorder so that it looks as much as possible as conf.in Thu Jan 13 12:33:46 2000 Loic Dachary <loic at ceic.com> * htdb/htstat.cc,htdump.cc,htload.cc: set proper progname Wed Jan 12 20:02:26 2000 Loic Dachary <loic at ceic.com> * htcommon/HtWordList.cc (Dump): Use Walk instead of Collect otherwise does not work. Wed Jan 12 19:38:33 2000 Loic Dachary <loic at ceic.com> * htlib/HtDateTime.h (class HtDateTime): killed void SetDateTime(const int t) because they cause problems when time_t is an int and were useless anyway. Wed Jan 12 13:31:45 2000 Loic Dachary <loic at ceic.com> * htword/WordBitCompress.h: remove inline qualifier on check_tag1: its not inline * htword/WordKey.h: #define WORD_KEY_UNKNOWN_POSITION to -1. Remove default argument to SetToFollowing so that its more explicit when used with WORD_KEY_UNKNOWN_POSITION. * htword/WordKey.cc: change name of variable info0 to info * htword/WordList.cc: use WordKey::Info instead of WordKeyInfo::Get as done in WordKey.cc for consistency. * htword/WordList.{cc,h},htword/WordDB.h: rename WordCursor to WordDBCursor for consistency. * htword/WordList.h: Kill the WordSearchDescription::Setup useless function * htword/WordList.h: WordSearchDescription constructor now have a straightforward semantics. * htword/WordList.h: Rename Search into Collect since it already existed, just with a different prototype. Wed Jan 12 12:36:46 2000 Loic Dachary <loic at ceic.com> * htword/WordList.h (class WordSearchDescription): add cursor member Tue Jan 11 19:33:44 2000 Marcel Bosc <bosc at ceic.com> * htlib/HtVectorGeneric,htword: Fixed some warnings found when compiling under FreeBSD Tue Jan 11 18:22:58 2000 Marcel Bosc <bosc at ceic.com> * htlib/HtVectorGeneric.h: inlined functions Add and Allocate which are critical to performance Tue Jan 11 12:18:47 2000 Marcel Bosc <bosc at ceic.com> * htword/WordKey.h: fixed uninitialized memory read * htword/WordBitCompress.cc: Fixed big number BUG Fixed memeory leak Tue Jan 11 09:37:36 2000 Loic Dachary <loic at ceic.com> * htword/WordList.h: move operator << and operator >> to end of functions declarations instead of data members. * htword/WordList.h: added more comments on functions behaviour. * htword/WordList.h: added #if SWIG for Perl interface Mon Jan 10 17:55:05 2000 Marcel Bosc <bosc at ceic.com> * htword/WordDBPage: enhanced compression debugging output Mon Jan 10 09:07:19 2000 Loic Dachary <loic at ceic.com> * WordContext.h,WordKey.h,WordList.h: Added #if SWIG for perl interfaces. Remove InSortOrder, useless now that everything is manipulated in sort order as far as the interface is concerned. * WordKey.cc,WordList.cc: remove InSortOrder * WordKey.h,WordRecord.h,WordReference.h: commented out Set/Get for ascii Set/Get for SWIG. * WordKey.h: turn CopyFrom to public for those who dont want to use operator =. * WordKey.h: rename info -> Info and nfields NFields * WordKey.h: remove int IsFullyDefined() const redundant with Filled Thu Jan 06 14:41:15 2000 Marcel Bosc <bosc at ceic.com> * htword,all: Changed interface to overloaded Walk function that was ambigous on some compilers... Thu Jan 06 14:00:01 2000 Loic Dachary <loic at ceic.com> * htword/WordList.h (class WordSearchDescription): rename setup to Setup * htword/WordList.h (class WordBenchmarking): rename show to Show * htword/WordRecord.{h,cc}, htword/WordReference.h, htword/WordList.h: add comments, reorganize member functions for clarity. Thu Jan 06 12:01:47 2000 Marcel Bosc <bosc at ceic.com> * htword/compression: Split WordDBCompress.* to WordDBCompress + WordDBPage.* * htword/WordBitCompress: renamed put/get to put_uint/get_uint. added get/put_uint_vl * htword/compression: modified slightly the compression: this makes old databases OBSOLETE: headers compress better. Chaged Flags compress better and faster. * htword/WordKey: added operator [] and Get/Set accessors * htword: removed the obsolete --with_key configure option (KEYDESC) * htword/WordMonitor: addded monitor input Wed Jan 05 14:32:31 2000 Loic Dachary <loic at ceic.com> * htword/WordKeyInfo.h (class WordKeyInfo ): if(encode) was if(sort) * htword/WordKeyInfo.h: rename show to Show an nprint to Nprint * htword/WordKeyInfo.h: move WORD_ISA from WordKey.h to WordKeyInfo.h, rename WORD_ISA_String to WORD_ISA_STRING. * htword/WordKey.h: rename FATAL_ABORT to WORD_FATAL_ABORT and errr to word_errr * htword/WordKey.h: move private functions at bottom of class above data members rename show_packed to ShowPacked * htword/WordKey.cc: move WordKeyInfo::SetKeyDescriptionRandom from WordKey.cc to WordKeyInfo.cc * htword/WordKeyInfo.cc: add include htconfig.h Wed Jan 05 13:26:16 2000 Loic Dachary <loic at ceic.com> * htdig/ExternalParser.cc (parse): use nocase_compare instead of mystrcasecmp to suppress warnings. (char*)String for mystrncasecmp that has no equivalent in the String class. * htdig/Retriever.cc (IsValidURL): remove warning by (char*)url Wed Jan 05 11:54:19 2000 Loic Dachary <loic at ceic.com> * htword/WordKey.h: kill obsolete comment and add suffix explanation at the beginning of the file. * htword/WordKey.h (class WordKey): rename copy_from and initialize to CopyFrom and Initialize to fit naming conventions. Reorganize the methods to group them in logical sets. Fix indenting. Comment each method. * htword/WordKey.h (Clear): add kword.trunc() * htword/WordKey.h: protect SetWord(const char *str,int len) because it opens the door to all kind of specific derivations. Should be SetWord(String(foo, foo_length)) if not performance critical. Wed Dec 29 18:41:14 1999 Marcel Bosc <bosc at ceic.com> * htlib/HtMaxMin: added max/min of arrays, added comments to HtMaxMin. Added HtMaxMin.cc all these are used in htword * htlib/HtTime.h: added comments. included portable time.h * htlib/HtVectorGeneric.cc: added HtVector_double, HtVector_String * htlib/HtVectorGeneric.h: inlined several methods, disactivated CheckBounds * htlib/StringMatch.cc: removed #include"WordType.h", this made htlib dependant on htword, which is not acceptable for a library * htlib/HtWordType.h: this replaces the macros used in StringMatch.cc * htlib/HtRandom.h: added tools for using random number (this is used currently in tests) * htword/WordBitCompress.cc: transfered max_v/min_v to htlib * htword/WordBitCompress.cc: optimized put/get for better performance * htword/WordMonitor: system for detailed monitoring of operation and performance within htword * htword/WordDBCompress: fixed compression for case of empty WordRecord * htword/WordDBCompress: cleaned up some code added some comments * htword/WordKeyInfo: split WordKey files into WordKey and WordKeyInfo files * htword/WordContext: centralized global configuration into one class * htword/WordKey: inserted randomized key/keydescription into WordKey classes (this was previously used in several tests) * htword/WordKey: optimized Compare, UnpackNumber for speed (these are really speed critical) * htword/WordRecord: is now configurable, type can be configured to "DATA" (htdig) or "NONE" (for other uses) * htword/WordType: changed macros to global functions to make it compatible with cleanup in StringMatch. Integrated WordType to WordContext configuration/Initialization * htword/WordKeyInfo: fixed initialization from key descrition file Tue Dec 28 18:58:21 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htlib/String.cc: String::lowercase(), String::uppercase() support for national character added. * htfuzzy/Prefix.cc: method "prefix" works now. Mon Dec 27 22:17:48 1999 Loic Dachary <loic at ceic.com> * htdig/htdig.cc (main): change '\r\n' to "\r\n" * Makefile.config,db/dist/Makefile.in: rename libdb to libhtdb to prevent conflicts with installed libdb. * db/dist/Makefile.in: do not install documentation nor binary utilities (db_dump & al) since they are replaced by htdb binaries (htdump & al). * db/dist/Makefile.in (prefix): prepend $(DESTDIR) to prefix to support make DESTDIR=/staging install for binary distribution packages generation. * configure.in: use AC_FUNC_ALLOCA to check for alloca. Used in regex and test/dbbench.cc only but definitely a usefull feature to have. Thu Dec 23 11:10:24 1999 Marcel Bosc <bosc at ceic.com> * htcommon/defaults.cc: set wordlist_cache_size default to 10Meg * db/mp: removed some debuging messages * htword/WordList.cc: added warning if no cache * test/word.cc: added cache * htlib/HtTime.h: added ifdefs for portable time.h sys/time.h Tue Dec 21 23:33:06 1999 Loic Dachary <loic at ceic.com> * htdoc/attrs.html,cf_by*.html: regenerate to include wordlist_wordkey_description attribute * htcommon/Makefile.am: Add AM_LFLAGS = -L and AM_YFLAGS = -l to prevent #line generation because it confuses the dependencies generator of GCC if configure run out of source tree. * configure.in: remove --with-key option. Not needed since word description now dynamic. Destroyed WordKey.h if specified. * htword/Makefile.am: remove commented lines for WordKey.h generation. Tue Dec 21 18:18:01 1999 Marcel Bosc <bosc at ceic.com> * htword: added code for benchmarking Mon Dec 20 17:59:15 1999 Marcel Bosc <bosc at ceic.com> * WordKey: Made the key structure dynamic: Changing the key structure used to imply recompiling the htword library. This should not change anything in htdig. * WordKey: numerical key fields are stored in an array of unsigned ints instead of compile-time defined pools. * WordKey.h: WordKey now needs copy opreators. Setbits are stored in sort order (used to be in encoding order) * htword: word_key_info is now a pointer, had to change all references * word.cc: Rewrote wordkey test for new dynamically set key structure. The test randomly creates key structures and tests them. * test: adapted test files (simplifies things a lot) 1999-12-21 Toivo Pedaste <toivo at ucs.uwa.edu.au> * htlib/Dictionary.cc: Fix memory leak when destroying dictionary * htlib/StringList.cc, htdig/Retriever.cc: Fix memory leak, not the most elegent way but I'm not sure about the exact semantics of StringList Mon Dec 20 21:59:03 1999 Loic Dachary <loic at ceic.com> * htdb/{Makefile.am,err.c,getlong.c}: Fix mistake: err.c and getlong.c contain C functions (declared in clib_ext) and must be C compiled otherwise the prototype won't fit. Checking db Makefiles, getlong.c and err.c are added to the list of objects for each utility program. This guaranties that they won't conflict with objects included in libdb.a. Sun Dec 19 20:04:42 1999 Loic Dachary <loic at ceic.com> * htdb/{Makefile.am, err.cc}: add err.cc for portability purposes. Fri Dec 17 18:04:09 1999 Loic Dachary <loic at ceic.com> * Makefile.config: add PROFILING variable and document it. Designed to enable profiling of htdig easily. * */Makefile.am: add *_LDFLAGS = $(PROFILING) for every binary to enable profiling, if specified. Thu Dec 16 17:16:33 1999 Loic Dachary <loic at ceic.com> * htdb/*.cc: add -W option to activate htword specific compression. Keep compatibility with zlib compression (-z only). Thu Dec 16 11:56:02 1999 Loic Dachary <loic at ceic.com> * test/dbbench.cc: change wrong strcpy with memcpy Wed Dec 15 15:04:39 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/htdig.cc(main): Handle list of URLs given on stdin, if optional "-" argument given. (Uses >> operator below.) * htlib/htString.h, htlib/String.cc: Added Alexis Mikhailov's String input methods, readLine() and >> operator. Wed Dec 15 13:59:34 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc: remove include of sys/stat.h, which is no longer needed after hack removed from Need2Get(), and could pose a problem on systems that need sys/types.h included first. Wed Dec 15 17:00:04 1999 Loic Dachary <loic at ceic.com> * htword/WordDB.h: add inline keyword for portability * htword/WordDB.h: add CmprInfo method to get object describing compression scheme for Berkeley DB * htdb: Add htdump, htload, htstat equivalent of db_dump db_load and db_stat that know about htword specific compression strategy. * htword/WordDBCompress: add static to localy defined functions and variables, remove unecessary #define and #include from header. Tue Dec 14 21:56:57 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/conf_parser.lxx, htcommon/conf_lexer.cxx: bcopy on Solaris is in strings.h, not in string.h. Added check for #ifdef HAVE_STRINGS_H Tue Dec 14 19:18:22 1999 Marcel Bosc <bosc at ceic.com> * WordBitCompress: code cleaned up and commented Tue Dec 14 18:32:21 1999 Loic Dachary <loic at ceic.com> * htword/Word{Record,Reference,Key}: added a Get method to convert the structure into it's ascii string representation. operator << now uses Get. Tue Dec 14 17:46:33 1999 Loic Dachary <loic at ceic.com> * db/dist/Makefile.in (install): fix bugous test for libshared Tue Dec 14 14:10:28 1999 Loic Dachary <loic at ceic.com> * htword/{WordKey,WordReference,WordRecord}: rework the input methods (operator >>). Each class now has a Set function to initialize itself from an ascii description and a Get function to retrieve an ascii description of the object. * htword/WordList: operator >> has a better and cleaner input loop using StringList and String instead of char*. Tue Dec 14 12:06:24 1999 Marcel Bosc <bosc at ceic.com> * WordDBCompress.cc : Added compression version checking Mon Dec 13 21:09:31 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/conf_parser.lxx, htcommon/conf_lexer.cxx: Added #include <string.h> Without it failed to compile on Solaris. Mon Dec 13 16:31:27 1999 Marcel Bosc <bosc at ceic.com> * htword/WordBitCompress.cc : fixed bug that made compression fail on big documents or big number of url's ... Mon Dec 13 13:49:35 1999 Loic Dachary <loic at ceic.com> * htword/WordKey.h.tmpl: Added *_POSITION macro generation Mon Dec 13 11:51:50 1999 Marcel Bosc <bosc at ceic.com> * htcommon/conf_parser.yxx: fixed several delete that should be delete [] Sun Dec 12 17:14:00 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/conf_lexer.lxx, htcommon/conf_lexer.cxx: national symbols are allowed in right part of expressions (noted by Marcel Bosc). Changed default behavior of flex from print unknown chars on stdout to exit with error message. Sat Dec 11 17:34:03 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htdig/Retriever.cc,htdig/htdig.cc: "exclude_urls","bad_querystr" "bad_extensions","valid_extensions","local_default_doc" changed for new config. * htdig/Server.cc: "server_max_docs","server_wait_time" changed for new config. * check for "limit_normalized" moved from Retriever::got_href and Retriever::got_redirect to more appropriate Retriever::IsValidUrl Fri Dec 10 18:05:48 1999 Marcel Bosc <bosc at ceic.com> * htword: checked for failed memory allocations in compression code Fri Dec 10 18:03:42 1999 Marcel Bosc <bosc at ceic.com> * htword/WordList,htcommon/HtWordList.cc,htmerge/words.cc: cleaned up WordList::Walk() function, change two occurences of WordList::Walk in htdig files Fri Dec 10 17:40:22 1999 Marcel Bosc <bosc at ceic.com> * htword/WordKey.cc (Compare): Fixed bug: compare used to compare chars and not unsigned chars, this failed when non-ascii caracters were used Fri Dec 10 11:54:36 1999 Marcel Bosc <bosc at ceic.com> * htcommon/defaults.cc : doc for wordlist_cache_size Thu Dec 09 17:07:47 1999 Marcel Bosc <bosc at ceic.com> * htcommon/defaults.cc: added defaults for compression and DB configuration parameters Thu Dec 09 16:47:54 1999 Loic Dachary <loic at ceic.com> * db/dist/configure.in,Makefile.in: Added shared lib support for linux only. Not enabled if not on linux. Thu Dec 09 15:07:11 1999 Loic Dachary <loic at ceic.com> * acinclude.m4,db/dist/acinclude.mr: CHECK_ZLIB now fails if either zlib.h or libz is not found. * configure.in: do not test zlib.h * db/db/db.c,db/mp/mp_fopen.c: added #ifdef HAVE_ZLIB so that compilation works if zlib is not found * htlib/.cvsignore: remove wrong *.cxx * test/dbbench.cc: added #ifdef HAVE_ZLIB so that compilation works if zlib is not found Thu Dec 09 13:25:45 1999 Marcel Bosc <bosc at ceic.com> * test/Word.cc,t_wordlist,Makefile.am: upgraded tests * htcommon/HtWordList.h: fixed Configuration/HtConfiguration problem Thu Dec 09 12:10:32 1999 Marcel Bosc <bosc at ceic.com> * htword: Added the compression code: * WordDBCompress: Classes for page specific compression code * WordBitCompress: Classes for bitstreams and non-specific compression Thu Dec 9 12:09:51 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htcommon/HtConfiguration.cc: bug fix: sometimes htConfiguration::Find(url,char*) retuned empty values even if there was something to return. Thu Dec 09 11:15:30 1999 Marcel Bosc <bosc at ceic.com> * htlib/Configuration.cc (Read): Read is now a virtual function: the old one for Configuration the new one (Vadim's ... with the parser) in HtConfiguration Thu Dec 09 11:01:22 1999 Loic Dachary <loic at ceic.com> * acinclude.m4: upgrade AC_PROG_APACHE macro for modules detection. * test/conf/httpd.conf,test/test_functions.in,test/conf/Makefile: use @APACHE_MODULES@ to accomodate various apache modules directory flavors. Tue Dec 07 20:32:34 1999 Marcel Bosc <bosc at ceic.com> * htdig: Split the Configuration class into Configuration and HtConfiguration. All the HtConfiguration and the configuration parsing (lex..) was woved to htcommon. Configuration was replaced by HtConfiguration as needed Tue Dec 07 16:21:13 1999 Loic Dachary <loic at ceic.com> * configure.in: added AM_PROG_LEX and AC_PROG_YACC * htlib/Makefile.am: simply set conf_lexer.lxx and conf_parser.yxx, automake knows how to handle these. The renaming is needed to avoid conflicts in automake generated rules. Mon Dec 6 16:23:39 CST 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/cf_generate.pl: added a bit of error checking for when it can't fetch the config info, and made it more flexible for what it allows as terminator. * htcommon/defaults.cc: add default and description for authorization attribute, and clean up external_protocols entry for cf_generate.pl. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl * htdig/htdig.cc(main): set authorization parameter before Retriever constuctor is called, as it may initialize a Server. (Should complete fix of PR#490.) Mon Dec 6 21:34:29 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htdig/Document.cc htdig/htdig.cc: "authorization" parameter in config is added and is new config compatible. New code has'n got PR#490 bug (don't authentificate robot.txt) Mon Dec 06 11:58:56 1999 Marcel Bosc <bosc at ceic.com> * HtVectorGeneric.h: generic vectors, stl-free: this was originally a copy of HtVector.h with Object * replaced by GType and some small changes. It has been modified and checked to see if it all works ok. You can build vectors of any type that has an empty constructor. * HtVectorGenericCode.h: generic vectors, stl-free: implementation (modified "copy" of HtVector.cc) * HtVectorGeneric.cc: generic vectors: implementation for common types * HtVector_int.h: generic vectors: declaration for the most common type (and example of howto use) Sat Dec 4 23:49:18 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Synonym.cc (createDB): Change declaration to match Fuzzy::createDB(config), allowing the method to be called by htfuzzy. * htfuzzy/htfuzzy.cc (main): Add an error message if fuzzy->createDB() comes back with an error. Sat Dec 4 15:38:34 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * htnet/HtHTTP.cc, htnet/HtHTTP.h, htdig/Document.cc fixed proxy bug. GET command in HtHTTP included only path of url insead full url when use proxy. HtHTTP::UseProxy(int) added. * htdig/Document.cc: make "http_proxy" parameter url-depended for new configuration. Fri Dec 03 14:57:13 1999 Marcel Bosc <bosc at ceic.com> * BerkelyDB: Compression code: added possibility to use user-defined compression routines (the goal is to enable the mifluz-specific DB page compression that obtains higher compression ratios than generic zlib compression) this envolves the following changes in BerkeleyDB: * BerkelyDB/CompressionEnvironment: Adding a structure db_cmpr_info in db_env that permits db user to specify the external compression routines and other information related to compression * BerkelyDB/CompressionEnvironment: Adding a cmpr_context structure to DB_MPOOLFILE that stores information that compression needs (the _weacmpr DB and the db_cmpr_info) * BerkelyDB/Compression: Needed to modify the compression system (that is implemented in the BerkelyDB memory pool) to permit higher compression ratios and to use the compression environment Thu Dec 2 16:47:30 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc(parse_url): Use a static int to avoid re-fetching local_urls_only from the config object. (Initial, got_href, got_redirect): Try to get the local filename for a server's robots.txt file and pass it along to the newly generated server. * htdig/Server.cc(ctor): Retrieve the robots.txt file from the filesystem when possible and respect the local_urls_only option. * htdig/Server.h: Change type of local_robots_file to String* to better match Retriever::GetLocal(). Thu Dec 02 16:24:27 1999 Loic Dachary <loic at ceic.com> * htword/WordReference.cc,WordKey.cc,WordRecord.cc (Print): Add function to ease printing from Perl. Thu Dec 02 16:06:29 1999 Loic Dachary <loic at ceic.com> * htword/WordReference.h (WORD_FILLED): remove unused WORD_FILLED and WORD_PARTIAL macros Wed Dec 01 19:18:42 1999 Loic Dachary <loic at ceic.com> * htword/WordKey.h.tmpl,WordRecord.h,WordReference.h, WordList.h: Added #ifndef SWIG for www.swig.org sake. Wed Dec 1 19:47:20 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegex.cc, htlib/HtRegex.h (set*): Add a case_sensitive flag which defaults to insensitive. This better mirrors the StringMatch class. * htcommon/URL.cc(signature): Make the signature a proper URL to the base of the server. * htdig/Server.h: Add IsDead() methods to query the status of the server, as well as an IsDisallowed() method to query whether a URL is forbidden by the robots.txt rules. Change _disallow to HtRegex. * htdig/Server.cc(ctor): Only retrieve the robots.txt file if this is an http or https server. (robotstxt): Use the proper HtRegex method for setting the pattern. (push): Remove logic checking the _disallow patterns. This is now done by the Retriever object. * htcommon/defaults.cc: Add new attribute "local_urls_only" which defaults to false, which dictates whether retrieval should revert to another method if RetrieveLocal() fails. * htdig/Retriever.cc(parse_url): Check to see if the server is dead before calling the Retrieve() method. Notify the server object if a connection fails. Also respects the new local_urls_only attribute as described above. (IsValidURL): Check the server's IsDisallowed() method to see if the robots.txt forbids this URL. * htdoc/THANKS.html: Updated to reflect current contributions, etc. * README: Update to mention version 3.2.0b1. Wed Dec 1 17:05:48 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc(GetLocal): Fix error in GetLocalUser() return value check, as suggested by Vadim. Wed Dec 1 15:57:09 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/conv_doc.pl: Added a sample external converter script. Mon Nov 29 23:19:35 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriver.cc, htdig/Retriver.h, htdig/Server.cc, htdig/Server.h: forward-ported patch provided by Alexis Mikhailov <alexis at medinf.chuvashia.su> and Gilles's for cleaning up IsLocal/GetLocal. Makes local digging persistent, even when HTTP server is down. Mon Nov 29 22:35:06 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * test/url.cc: New test for URL class. * test/url.parents: Base URLs for parsing. * test/url.children: Derived relative URLs for testing. * test/Makefile.am, test/Makefile.in: Add the above for building. * htcommon/URL.cc: A variety of bug fixes (some hacks), especially for file:// and user@host URLs. Sun Nov 28 00:35:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * .version: Bump to 3.2.0b1-dev. Sat Nov 27 20:23:14 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/ExternalTransport.h, htdig/ExternalTransport.cc: New class to allow external scripts to handle transport methods. * contrib/handler.pl: Example handler using the program 'curl' to handle HTTP or HTTPS transactions. * htcommon/defaults.cc: Add new configuration option 'external_protocols' as a list of protocols and scripts to handle them. Documentation currently needs to be written. * htdig/Document.h, htdig/Document.cc(Retrieve): Call ExternalTransport::canHandle to establish which protocols are supported by handler scripts and then create an appropriate transport object. * Makefile.in, htdig/Makefile.am, htdig/Makefile.in: Add dependencies for ExternalTransport class. * htnet/HtHTTP.h, htnet/HtHTTP.cc, htnet/Transport.h, htnet/Transport.cc: Move _location field from HtHTTP_Response to Transport_Response to allow other subclasses to use it. Similarly, move NewDate and RecognizeDateFormat to Transport. Fri Nov 26 17:07:52 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc(HTML & do_tag): add code to turn off indexing between <style> and </style> tags. Fri Nov 26 15:56:47 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setVariables): added Alexis Mikhailov's fix to check the number of pages against maximum_pages at the right time. * htlib/String.cc(write): added Alexis Mikhailov's fix to bump up pointer after writing a block. Wed Nov 24 15:10:05 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * installdir/htdig.conf: Add bad_extensions to make it more obvious to users how to exclude certain document types. Tue Nov 23 19:29:37 CST 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htnotify/htnotify.cc(send_notification): apply Jason Haar's fix to quote the sender name "ht://Dig Notification Service". Tue Nov 23 19:46:00 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * conf.tab.cc.h conf.l.cc conf.tab.cc Added files pre-generated from conf.y, conf.l Sun Nov 21 18:26:21 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> *htdig/Document.cc: "max_doc_size" supports new configuration and is url-depended now. Sun Nov 21 17:06:50 EET 1999 Vadim Chekan <vadim at etc.lviv.ua> * New config parser commited. htlib/(Makefile.am,Makefile.in), htlib/Configuration.cc, htlib/Configuration.h htlib/(conf.y, conf.l) added. Fri Nov 12 14:17:37 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/cgi.cc(init): Fix bug in reading long queries via POST method (PR#668). Wed Nov 10 15:34:04 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setVariables & createURL), htsearch/htsearch.cc(main), htdoc/hts_templates.html: handle keywords input parameter like others, and make it propagate to followups. Wed Nov 10 15:16:57 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc: Fix PR#688, where htdig goes into an infinite loop if an entry in local_urls (or local_user_urls) is missing a '=' (or a ','). * htcommon/defaults.cc: removed vestigial references to MAX_MATCHES template variables in search_results_{header,footer}. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl * htdoc/hts_form.html: add disclaimer about keywords parameter not being limited to meta keywords. * htdoc/meta.html: add description of "keywords" meta tag property. add links to keywords_factor & meta_description_factor attributes. 1999-11-10 Toivo Pedaste <toivo at ucs.uwa.edu.au> * htdig/Retriever.cc : Ignore SIGPIPEs with persistant connections * htnet/HtHTTP.cc : Fix buffer overrun reading chunks * htdig/Document.cc : Make redirects work * htdig/Retriever.cc : Make valid URL checks apply to initial URL's particularly those from a previous run * htlib/Dictionary.cc : Fix memory deallocation error Tue Nov 02 13:44:57 1999 Marcel Bosc <bosc at ceic.com> * htsearch/Display.cc (setVariables): parentheses missing around ternary operator : confusion in priority with <<. Tue Nov 02 13:33:50 1999 Marcel Bosc <bosc at ceic.com> * htsearch/Display.cc (hilight): changed static char * (!!) to const string, static char evaluated before configuration is loaded so config had no effect + unnecesary conversion Tue Nov 02 11:45:49 1999 Marcel Bosc <bosc at ceic.com> * htword/WordKey.cc : Cleaned up obsolete code now using *InSortOrder fcts and WordKeyInfo.sort[] * htword/WordKey : Added FirstSkipField : find first field that must be checked for skip * htword/WordKey (PrefixOnly): now returns OK/NOTOK, fixed bug which made Walk loop over the whole db if the searchkey just had a the "word" field defined * htword/WordKey.cc (Unpack): had forgten to: SetDefinedWordSuffix * htword/WordKey.cc (operator >>): added check for very very long words (even if this should never happen) * htword/WordKey.cc (operators << >>): added <UNDEF> word suffix handling * htword/WordKey.h : Filled() did not check for WordSuffix * htword/WordKey.h : added WordKey::ExactEqual * htword/WordKey.h (IsDefinedWordSuffix): fixed bad flag check * htword/WordList : Removed all obsolete HTDIG_WORDLIST flags: only two remain : COLLECTOR and WALKER the rest is now specified by the searchKey removed action arg to WordList::Collect() * htcommon/HtWordList.cc,htmerge/words.cc : changed flags in calls to WordList::Walk * htword/WordList.cc : skip now deals with the SuffixUndefined case Fri Oct 29 17:13:21 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/cf_generate.pl: now updates last modified date in attrs.html * htdoc/attrs.html: reran cf_generate.pl Fri Oct 29 15:28:22 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setVariables & hilight): added Sergey's idea for start_highlight, end_highlight & page_number_separator attributes. * htcommon/defaults.cc: added & documented these. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Thu Oct 28 13:06:23 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/ExternalParser.cc: added support for external converters as extension to external_parsers attribute. * htcommon/defaults.cc: Updated external_parsers with new description and examples of external converters. Thu Oct 28 12:52:28 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: Updated programs lists for *_factor, so they all refer to htsearch and not htdig. Added htsearch to programs lists for translate_*. img_alt_factor & url_factor not defined yet because they're still not used in htdig/htsearch. Wed Oct 27 15:53:36 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: added descriptions & examples for doc_excerpt, heading_factor, max_descriptions, minimum_speling_length, regex_max_words, use_doc_date, valid_extensions. Added references to these elsewhere in document as appropriate. Removed -pairs option from pdf_parser default (again). Minor changes to noindex_start & end, and changed example for modification_time_is_now. Corrected references to heading_factor_[1-6]. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Oct 27 13:32:50 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/cf_generate.pl: changed formatting of output to more closely match format of old attrs.html (to make diff'ing easier), and fixed handling of pdf_parser default to strip quotes. * htcommon/defaults.cc: oops, fixed typo in url_part_aliases example. * htdoc/attrs.html, cf_by{name,prog}.html: reran cf_generate.pl Wed Oct 27 18:24:36 1999 Loic Dachary <loic at ceic.com> * htdoc/cf_generate.pl: fixed wrong target for cf_byprog, escape HTML chars <>&'" for default values. Wed Oct 27 10:21:18 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: restored 2nd example for url_part_aliases Tue Oct 26 16:28:29 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc: corrected descriptions for allow_in_form, search_results_header, noindex_start, noindex_end. Also fixed a few small typos & formatting errors here & there in descriptions and examples. Tue Oct 26 16:01:22 1999 Loic Dachary <loic at ceic.com> * htword/Makefile.am: rm Wordkey.h instead of chmod to copy with non existent WordKey.h Tue Oct 26 10:54:52 1999 Loic Dachary <loic at ceic.com> * htcommon/default.cc: fixed all inconsistencies reported by Gilles. Mon Oct 25 11:42:13 1999 Marcel Bosc <bosc at ceic.com> * htword/ word.cc,t_wordskip,skip_db.txt: Added test for *Skip Speedup* * htword/ WordList: Added tracing of Walk() for debuging purposes Fri Oct 22 18:22:00 1999 Marcel Bosc <bosc at ceic.com> * htword/ WordList.cc,WordKey: Added a defined/undefined flag for saying if a search key's word is a prefix or not: WORD_KEY_WORDSUFFIX_DEFINED reduces code size and makes it much easier to undertand * htword/ WordList,WordReference,WordKey: Added input output streams for WordList,WordReference,WordKey Wed Oct 20 16:47:52 1999 Marcel Bosc <bosc at ceic.com> * htword/ WordKey,Makefile.am,WordCaseIsAStatements.h: for readability replaced the switch ... #ifdef ..STATEMENT().... sequence that apeared many times with an include file :WordCaseIsAStatements.h * htword/ WordKey: WordKeyInfo: duplicated all of the fields structure into sort structure, for fast acces without cross referencing and for simplifying code (required change of perl in template WordKey.h.tmpl) * htword/ WordList: *Skip Speedup* added a speedup to avoid wasting time by sequentialy walking through useless entries. see function: SkipUselessSequentialWalking() for an example and more info * htword/ WordKey.h,WordKey.cc: Changed Set,Unset,IsSet Wordkey accesors' names to: SetDefined,Undefined,IsDefined. (easier to read and avoids naming conflicts) * htword/ WordKey: added generic numerical accesors for accesing numerical fields in WordKey (in sorted order):GetInSortOrder,SetInSortOrder * htword/ WordKey,word_builder.pl: added a MAX_NFIELDS constant, that specifies a maximum number of fields that a WordKey can have. Sanity check in word_builder.pl. * htword/ word_builder.pl: enforced word sort order to ascending * htword/ WordList: added a verbose flag using config."wordlist_verbose" Tue Oct 19 18:36:42 1999 Loic Dachary <loic at ceic.com> * htword/WordType.h: const accessors to wtype and config Tue Oct 19 13:10:47 1999 Loic Dachary <loic at ceic.com> * acconfig.h: remove uncessary VERSION (redundant) Tue Oct 19 11:32:38 1999 Loic Dachary <loic at ceic.com> * db/Makefile.in,db/dist/Makefile.in: install db library so that external applications can be linked. Tue Oct 19 10:57:27 1999 Loic Dachary <loic at ceic.com> * configure.in: add --with-key to specify alternate to htword/word.desc * configure.in: htword is done before htcommon to prevent unecessary recompilation because WordKey.h changes. * htword/Makefile.am: use @KEYDESC@ Tue Oct 19 10:38:41 1999 Loic Dachary <loic at ceic.com> * test/word.cc use TypeA instead of DocID and the like Mon Oct 18 17:21:34 1999 Loic Dachary <loic at ceic.com> * Makefile.config: AUTOMAKE_OPTIONS = foreign Mon Oct 18 11:40:17 1999 Marcel Bosc <bosc at ceic.com> * htword/ WordList.cc (Walk): fixed bug in Walk: if flag HTDIG_WORDLIST was set then data was uninitialized in loop Fri Oct 15 18:52:03 1999 Marcel Bosc <bosc at ceic.com> * htdig/Document.h (class Document): added const to: Transport::DocStatus RetrieveLocal(HtDateTime date, const String filename); Fri Oct 15 17:46:23 1999 Loic Dachary <loic at ceic.com> * acinclude.m4,configure.in: modified AC_APACHE_PROG to detect version number and control it. * test/conf/*.in: patch to fit module loading or not, accomodate various installation configurations. * test/test_functions.in: More portable call to apache. Fri Oct 15 12:55:47 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Document: added the management of 'persistent_connections', 'head_before_get', 'max_retries' configuration attributes. Fri Oct 15 12:54:11 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * test/testnet.cc: added the option '-m' for setting the max size of the document. Fri Oct 15 12:48:49 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Server: added a flag for persistent connections. It's set to true if the Server allows persistent connections. It should be used when retrieving a document. Fri Oct 15 12:45:42 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * defaults.cc: added the configuration attributes 'persistent_connections', 'max_retries' and 'head_before_get'. Their default values are respectively true, 3, false. Fri Oct 15 12:35:51 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc: managing of uncompleted stream reading with persistent connections (it occurs when max_doc_size is lower than the real content length of the document, or when a document is not parsable and we asked for it with a GET call). * Transport: _host variable is treated as a String, as Loic suggested. Fri Oct 15 12:11:23 1999 Marcel Bosc <bosc at ceic.com> * Added README to htword Thu Oct 14 11:29:35 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/mktime.c, htlib/regex.c, htlib/regex.h, htlib/strptime.c: Updated with latest glibc versions. Merging from glibc sources may have introduced bugs, so this is the last merge before htdig-3.2.0b1. Thu Oct 14 13:09:32 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/Transport: added statistics for open and close of connections and changes of servers. Fixed a bug in the SetConnection method, regarding the host comparison. Added a method for showing the statistics on a given channel. * htnet/HtHTTP: More debug info available. Added a method for showing the statistics on a given channel. * test/testnet.cc: now receives changes above. Wed Oct 13 13:35:42 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Document.h: added an HtHTTP pointer to the class. * htdig/Document.cc: Transport and HtHTTP initialization methods inside the Document constructur. The class destructor now calls only the HtHTTP destructor (not the Transport destructor). Modified the Retrieve method. * htdig/Server.h: _last_connection is now an HtDateTime object. * htdig/Server.cc: _modified the constructor and the delay method. * htdig/Retriever.cc: modified the parse_url function in order to manage all the Document status messages coming from the Transport class. Also modified the method for not found URLs for managing the no_port status. Tue Oct 12 10:12:10 1999 Loic Dachary <loic at ceic.com> * install headers and libraries so that htdig libraries may be used by external programs * htword/WordList.cc,WordType.cc: add comments about config parameters used. Fri Oct 8 09:35:30 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.cc (SetFTime): Change buffer argument to const char* to prevent problems passing in const buffers. * htnet/HtHTTP.h: Change SetUserAgent to take a const char* to prevent problems passing in const parameters. * htdig/Document.h, htdig/Document.cc(): Use Transport class for obtaining documents. Remove duplication of declarations (e.g. DocStatus). * htdig/Retriever.cc: Adapt switch statements from Document::DocStatus to Transport::DocStatus. * htdig/Server.cc: Use Document::Retrieve instead of RetrieveHTTP. Fri Oct 08 16:35:16 1999 Loic Dachary <loic at ceic.com> * test/t_htnet: succeed if timeout occurs. It was the opposite. * configure.in: AC_MSG_CHECKING(how to call getpeername?) add missing comma at end for header spec block. Fri Oct 08 14:42:47 1999 Loic Dachary <loic at ceic.com> * Fix all warnings reported by gcc-2.95.1 related to string cast to char*. Fri Oct 08 14:04:21 1999 Loic Dachary <loic at yoda.ceic.com> * htlib/Configuration,ParsedString,Dictionary: change char* to String where possible. * Fix a lot of warnings reported by gcc-2.95.1 related to string cast to char*. * Completely disable exception code from db. Fri Oct 08 13:44:32 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc: fixed a little bug in setting the modification time if not returned by the server. Fri Oct 08 11:30:53 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc: better management of connection failures return values. * Transport.h: added Document_no_connection and Document_connection_no_port enum values. * testnet.cc: management of above changes. Fri Oct 08 11:27:31 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * configure.in: modified getpeername() test. Fri Oct 08 10:28:15 1999 Loic Dachary <loic at ceic.com> * htdig/Retriever.cc (IsValidURL): test return value of ext = strrchr(url, '.'); * htword/WordRecord.h: initialize info member to 0 in constructor and Clear. * htlib/Configuration: char* -> String to all functions. Resolve warnings. Thu Oct 07 16:19:46 1999 Loic Dachary <loic at ceic.com> * htnet/HtHTTP.cc (ReadChunkedBody): use append instead of << because buffer is *not* null terminated. * htnet/Transport.cc (Transport): initialize _port and _max_document_size otherwise comparison with undefined value occurs. Thu Oct 07 16:34:21 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc: call FinishRequest everytime in HTTPRequest() a value is returned. * testnet.cc: improved with more statistics and connections timeouts control. Thu Oct 07 12:53:12 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * configure.in: modified getpeername() test function with AC_LANG_CPLUSPLUS instead of AC_LANG_C. Thu Oct 07 11:56:52 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc : fixed bug of double deleting _access_time and _modification_time objects in ~HtHTTP(). Thu Oct 07 10:17:22 1999 Loic Dachary <loic at ceic.com> * htword/WordRecord.h: change (const char*) cast to (char*) * htword/WordKey.h.tmp: fix constness of accessors, const accessor returns const ref. Prevents unecessary copies. Wed Oct 6 23:31:50 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htnet/Connection.h, htnet/Connection.cc: Merge in io class. Connection class was the only subclass of io. * Makefile.in, htlib/Makefile.am, htlib/Makefile.in: Update for removed io class. * htdig/ExternalParser.cc: Add more verbose flags for errors. Wed Oct 06 14:56:34 1999 Loic Dachary <loic at ceic.com> * htnet/Connection.cc (assign_server): use free, not delete on strdup allocated memory. * htcommon/URL.cc (URL): set _port to 0 in constructors. Wed Oct 06 12:08:38 1999 Loic Dachary <loic at ceic.com> * Move htlib/HtSGMLCodec.* to htcommon to prevent crossed interdependencies between htlib and htcommon Wed Oct 06 12:07:32 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP.cc: patch from Michal Hirohama regarding the SetBodyReadingController() method Wed Oct 06 11:49:15 1999 Loic Dachary <loic at ceic.com> * Move htlib/HtZlibCodec.* htlib/cgi.* to htcommon to prevent crossed interdependencies between htlib and htcommon Wed Oct 06 11:40:48 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * HtHTTP: stores the server info correctly and removed some debug info in chunk managing Wed Oct 06 11:39:12 1999 Loic Dachary <loic at ceic.com> * Move htlib/*URL* to htcommon Wed Oct 06 10:09:19 1999 Loic Dachary <loic at ceic.com> * README: add htword * test/t_htnet: fix variable set problem & return code problem Wed Oct 06 08:53:52 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * Written t_htnet test Tue Oct 5 12:24:43 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * db/*: Import of Sleepycat's Berkeley DB 2.7.7. * db/db/db.c, db/include/db.h, db/include/db_cxx.h, db/mp/mp_bh.c: Resolve conflicts created in merge. Tue Oct 05 18:53:13 1999 Loic Dachary <loic at ceic.com> * htdig/Display.cc, htword/*.cc: add inclusion of htconfig.h Tue Oct 05 14:54:17 1999 Loic Dachary <loic at ceic.com> * htlib/htString.h (class String): add set(char*) * htword/WordKey.cc: define typedefs for key components. Leads to more regular code and no dependency on a predefined set of known types. All types must still be castable to unsigned int. Assume Word of type String always exists. Generic Get/Set/Unset methods made simpler. Added const and ref for Get in both forms. * htword/WordList.cc: enable word reference counting only if wordlist_extend configuration parameter is set. This parameter is hidden because no code uses per word statistics at present. It is only activated in the test directory. * htword/word_list.pl: add mapping to symbolic type names, force and check to have exactly one String field named Word. Mon Oct 04 20:05:35 1999 Loic Dachary <loic at ceic.com> * test: add thingies to make test work when doing ./configure outside the source directory. * htword/WordList: Add Ref and Unref to update statistics. Fix walking to start from the end of statistics. All statistics words start with \001, therefore at the beginning of the file and all clustered together. * htword/WordStat: derived from WordReference to implement uniq word statistics. * test/word.cc: test statistics updating. * htword/WordKey.cc: fix bugous compare (returned length diff if key of different length). Mon Oct 04 18:43:56 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * test/testnet.cc: added the option for HEAD before GET control Mon Oct 04 17:33:24 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/Transport.h .cc: added the FlushConnection() method * htnet/HtHTTP.h .cc: now the Request() method can make a HEAD request precede a GET request. This is made by default, and can be changed by using the methods Enable/DisableHeadBeforeGet(). A configuration option can be raised to manage it. Mon Oct 04 12:43:41 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htlib/io.h .cc: added a flush() method. * htnet/HtHTTP.cc: manage the chunk correctly, by calling the flush() method after reading it. Mon Oct 04 12:02:24 1999 Loic Dachary <loic at ceic.com> * htlib/htString.h: move null outside inline operator [] functions. Fri Oct 01 14:55:56 1999 Loic Dachary <loic at ceic.com> * htword/WordRecord: mutable, can also contain uniq word statistics. * htword/WordReference: remove all dependencies related to the actual structure of the key. * htcommon/HtWordReference: derived from WordReference, explicit accessors. * htcommon/HtWordList: derived from WordList, only handles the word cache (Flush, MarkGone). * htdig/HTML.cc (do_tag): add wordindex to have location set in tags * htcommon/DocumentRef.cc (AddDescription): add Location calculation * htword/WordList.cc: add dberror to map Berkeley DB error codes * htsearch/Display.cc (display): initialize good_sort to get rid of strange warning. Fri Oct 01 09:02:11 1999 Loic Dachary <loic at ceic.com> * Makefile.config: duplicate library lines to resolve interdependencies. Thu Sep 30 17:56:55 1999 Loic Dachary <loic at ceic.com> * htmerge/words.cc (delete_word): Upgrade to use WordCursor. * htword/WordList: Walk now uses a local WordCursor. Many concurent Walk can happen at the same time. * htword/WordList: Walk callback now take the current WordCursor. Added a Delete method that takes the WordCursor. Allows to delete the current record while walking. * db/include/db_cxx.h (DB_ENV): add int return type to operator = * db/dist/configure.in (CXXFLAGS): disable adding obsolete g++ option. * configure.in: enable C++ support when configuring Berkeley DB * htword: create. move Word* from htcommon. move HtWordType from htlib and rename WordType. * htword/WordList: use db_cxx interface instead of Database. Less interface overhead. Get access to full capabilities of Berkeley DB. Much more error checking done. Create WordCursor private class to use String instead of Dbt. Wed Sep 29 20:03:31 1999 Loic Dachary <loic at yoda.ceic.com> * htlib/lib.h: AIX xlC does is confused by overloaded mystrcasestr that only differ in constness. Only keep const form and use cast where approriate. *sigh* * htlib/htString.h: accomodate new form of Object::compare and Copy. Explicitly convert compare arg to String&, prevent hiding and therefore missing the underlying compare function. * htlib/HtVector.cc (Copy): make it const * htlib/HtHeap.cc: accomodate new form of Object::compare * htcommon/List.h,cc: Add ListCursor to allow many pointers that walk the list to exist in the same program. * htlib/Object.h (class Object): kill unused Serialize + Deserialize. Change unused Copy to const and bark on stderr if called because it is clearly not was is wanted. If Copy is called and the derived class does not implement Copy we are in trouble. Alternatives are to make it pure virtual but it will break things all over the code or to abort but this will be considered to violent. Change compare to take a const reference and be a const. Wed Sep 29 16:51:58 1999 Loic Dachary <loic at yoda.ceic.com> * acinclude.m4,configure.in,Makefile.config: remove -Wall from Makefile.conf, add the AC_COMPILE_WARNINGS macro in acinclude.m4 and use it in configure.in. * htdoc/default_check.pl: remove, unused Wed Sep 29 13:07:58 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/Transport: fixed some bugs on construction and destruction * htnet/HtHTTP: the most important add is the decoding of chunked encoded responses, as reported on RFC2616 (HTTP/1.1). It needs to be developed, because it timeouts at the end of the request. Added a function pointer in order to dynamically handle the function that reads the body of a response (for now, normal and chunked, but other encoding ways exist, so ...). Fixed some bugs on construction and added some features like Server and Transfer-encoding headers. Wed Sep 29 13:54:59 1999 Loic Dachary <loic at yoda.ceic.com> * fix all inline method declarations so that they are always declared inline in the class declaration if an inline definition follows. * acinclude.m4: also search apache in /usr/local/apache/bin by default. * fix various warnings of gcc-2.95, now compiles ok without warnings and with -Wall. * htlib/htString.h: removed commented out inline get * test/testnet.cc: add includes for optarg Tue Sep 28 18:56:36 1999 Loic Dachary <loic at ceic.com> * Makefile.config (HTLIBS): libhtnet at the beginning of the list. It matters on Solaris-2.6 for instance. * test/testnet.cc: change times to timesvar to avoid conflict with function (was warning only on Solaris-2.6). * htdig,htsearch,htmerge,test/word are purify clean when running make check. Tue Sep 28 18:23:49 1999 Loic Dachary <loic at ceic.com> * htmerge/words.cc (mergeWords): use WordList::Walk to avoid loading ALL the words into memory. * htlib/DB2_db.cc (Open): we don't want duplicates. Big mistake. If DUP is on, every put for update will insert a new entry. * htcommon/WordList.cc (Delete): separate Delete (straight Delete and WalkDelete) to avoid accessing dbf from outside WordList. * htcommon/WordList.cc (Walk): now promoted to public. Tue Sep 28 16:34:56 1999 Loic Dachary <loic at ceic.com> * test/word.cc (dolist): Add regression tests for Delete. * htcommon/WordList.cc (Delete): Reimplement from scratch. Use Walk to find records to delete. This allows to say delete all occurence of this word, delete all words in this document (slow), delete all occurences of this word in this document etc. * htcommon/WordList.cc (Walk): extend so that it handles walk for partially specified keys, remains fully backward compatible. It allows to extract all the words in a specific document (slow) or all occurences of a word in a specific document etc. Tue Sep 28 12:56:12 1999 Loic Dachary <loic at ceic.com> * htcommon/DocumentDB.cc (Open): report errors on stderr * htmerge/docs.cc (convertDocs): rely on error reporting from DocumentDB instead of implementing a custom one. Tue Sep 28 11:36:28 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htnet/Transport.h: added the status code and the reason phrase * htnet/HtHTTP.cc .h: removed the attributes above. Read the body of a response if the code is 2xx. Issues the GetLocation() method. Tue Sep 28 10:32:47 1999 Loic Dachary <loic at ceic.com> * test/htdocs/set3: create and populate with cgi scripts have bad behaviour (time out and, slow connection). Tue Sep 28 10:20:23 1999 Loic Dachary <loic at ceic.com> * test/htdocs: move html files in set1/set2 subdirectories to allows tests that use different set of files. Change htdig.conf accordingly. Tue Sep 28 09:31:12 1999 Loic Dachary <loic at ceic.com> * test/Makefile.am: comment test options, add LONG_TEST='y' for lengthy tests, by default run quick tests. * installdir/bad_words: removed it an of : since the minimum word length is by default 3, these words are ignored anyway. Mon Sep 27 20:37:38 1999 Loic Dachary <loic at ceic.com> * htlib/HtWordType.h,cc: concentrate knowledge about word definition in this class. Rename the class WordType (think WordReference etc...). Change Initialize to use an external default object. A WordType object may be allocated on its own. Drag functionalities from BadWordFile, Replace and IsValid of WordList, and concentrate them in the WordType::Normalize function. * htcommon/WordList: use the new WordList semantic. WordType is now a member of WordList, opening the possibility to have many WordList object with different configurations within the same program since the constructor takes * htsearch/htsearch.cc (setupWords): Use HtNormalize to find out if word should be ignored in query. Formerly using IsValid. * htlib/String.cc (operator []): fix big mistake, operator [] was indeed last() ! * htlib/String.cc(uppercase, lowercase): return the number of converted chars. * htlib/String.cc(remove): return the number of chars removed. Mon Sep 27 17:43:23 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * Created testnet.cc under test dir for trying the htnet library It's a simple program that retrieves an URL. * htnet/HtHTTP.cc, .h: added a 'int (*) (char *)' function pointer. This attribute is static and it is used under the isParsable method in order to determine if a document is parsable. It must be set outside this class by using the SetParsingController static method. The classic use is to set it to 'ExternalParser::canParse' . Mon Sep 27 10:52:51 1999 Loic Dachary <loic at ceic.com> * htmerge/db.cc (mergeDB): delete words instead of words->Destroy() because the words object itself was not freed. Mon Sep 27 10:38:37 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * Created 'htnet' library Mon Sep 27 12:39:24 1999 Loic Dachary <loic at ceic.com> * test/word.cc (dolist): don't deal with upper case at present and prevent warning. Mon Sep 27 10:38:37 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htlib/String.cc: removed compiler warnings * htdig/HtHTTP.h: corrected cvs Id property Mon Sep 27 10:29:58 1999 Loic Dachary <loic at ceic.com> * htlib/String.cc (String): make sure *all* constructors set the Data member to 0. * htsearch/parser.cc (score): add missing dm->id = wr->DocID(); strange it did not make search fail horribly. Mon Sep 27 09:46:34 1999 Loic Dachary <loic at ceic.com> * test/conf/htdig.conf.in (common_dir): add common_dir so that templates are found in compile directory. * htsearch/parser.cc (phrase): free wordList at end and only allocate if needed. Fri Sep 24 16:35:47 1999 Loic Dachary <loic at ceic.com> * htcommon/DocumentDB.ccf (Open): change mode to 666 instead of 664, it's the bizness of umask to remove permission bits. * htlib/URL.cc (removeIndex): Memory leak. do not use l.Release since standard Destroy called by destructor is ok. * htdig/htdig.cc (main): Memory leak. Use l.Destroy instead of l.Release. * htlib/StringList.cc (Join): Memory leak (new String str + return *str). Also change to const fct. * htlib/List.cc (Nth): add const version to help StringList::Join save memory. * htdig/HTML.cc (parse): delete [] text (was missing []) * htlib/HtVector.cc: Most of the boundary tests with element_count (but not all of them) were wrong (> instead of >= for instance). * htlib/HtVector.cc (Previous): limit test cut and pasted from Next and obviously completely wrong. Fix. * htlib/HtVector.cc (Remove): use RemoveFrom, avoid code duplication. * htcommon/DocumentRef.cc (Clear): set all numerical fields to 0, and truncate strings to 0. Some were missing. * htlib/Connection.cc (Connection): free(server_name) because allocated by strdup not new. Fri Sep 24 14:30:21 1999 Loic Dachary <loic at ceic.com> * */.cvsignore: update to include .pure, *.la, *.lo, .purify * htlib/String.cc (String): add Data = 0 * htlib/htString.h (class String): add Data = 0 * htlib/String.cc (String): init set to MinimumAllocationSize at least prevents leaking if init = 0. * htlib/String.cc (nocase_compare): use get() instead of direct pointer to Data so that the trailing null will be added. * htlib/Dictionary.cc (DictionaryEntry): free(key) instead of delete [] key because obtained with strdup. * htlib/DB2_db.cc (Close): free(dbenv) because db_appexit does not free this although it free everything else. Thu Sep 23 18:18:40 1999 Loic Dachary <loic at ceic.com> * configure.in: add PERL detection & use in Makefile.am Thu Sep 23 14:29:29 1999 Loic Dachary <loic at ceic.com> * configure.in: removed unused alloca.h * htcommon/DocumentDB.cc: test isopen in Close instead of before calling Close. Add some const in functions arguments. (Read): change char* args to const String&, changed tests for null pointers to empty(). (Add): Delete the temp class member, use function local temp. (operator []): change char* args to const String& (CreateSearchDB): change char* args to const String& * htcommon/DocumentRef.cc:(AddDescription): Add some const in functions arguments. Use a WordReference as insertion context instead of merely the docid: it contains the insertion context. (AddAnchor): Add some const in functions arguments. * htcommon/DocumentRef.h: Add some const in inline functions arguments. * htcommon/Makefile.am: add WordKey + WordKey.h generation * htcommon/word_builder.pl, word.desc, WordKey.h.tmpl: generate WordKey.h from WordKey.h.tmpl and word.desc * htcommon/WordList.cc: In general remove code that belongs to WordReference rather than WordList and cleanup const + String. (WordList) the constructor takes a Configuration object in argument. (Word -> Replace): Word method replaced by Replace method because more explicit. Now taks a WordReference in argument instead of the list of fields values. (valid_word deleted, IsValid only): Add some const in functions arguments. (BadWordFile): change char* args to const String& (Open + Read -> Open): Open and Read merge into Open with mode argument. change char* args to const String&. (Add): use WordReference::Pack and simply do Put. (operator[], Prefix ...) now take WordReference instead of Word. Autmatic Conversion from Word for compatibility thru WordReference(const Word& w). (Dump): change char* args to const String& (Walk): use WordReference member functions instead of hard coded packing * htcommon/WordRecord.h: move flag definitions to WordReference.h only keep anchor, the reste moved to key. * htdig/Document.cc: change all config[""] manipulations from char* to String or const String (setUsernamePassword): Add some const in functions arguments. * htdig/HTML.cc: change all config[""] manipulations from char* to String or const String. Change null pointer tests to empty(). (transSGML): change char* args to const String& * htdig/HtHTTP.cc: Add error messages for default cases in every switch. * htdig/PDF.cc: (parse) change char* to const String& for config[""] * htdig/Plaintext.cc: (parse) remove unused variable * htdig/Retriever.cc: use WordReference word_context instead of simple docid to hold the insertion context. (Retriever) pass config to WordList initializer. (setUsernamePassword): Add some const in functions arguments. (Initial): change char* args to const String& (parse_url): use WordReference word_context, add debug information. (RetrievedDocument): set anchor in word_context. (got_word): use Replace instead of Word (got_*): Add some const in functions arguments. * htdig/htdig.cc: change all config[""] manipulations from char* to String * htdoc/cf_generate.pl: compute attrs.html, cf_byprog.html and cf_byname.html from ../htlib/default.cc and attrs_head.html attrs_tail.html cf_byname_head.html cf_byname_tail.html cf_byprog_head.html cf_byprog_tail.html Add rules in Makefile.am * htfuzzy: In every programs I changed the constructor to take a Configuration agrument. The openIndex and writeDB had this argument sometime used it, sometimes used the global config. Having it in the contructor is cleaner and safer, there is no more reference to the global config. I also changed some char* to String and const. Most of the program look the same, I won't go into details here :-} * htlib/Configuration.cc: changed separators from String* to String. Simpler. (~Configuration): removed because not needed. (Add): change to String, remove new String + delete for local var. (Find, operator[]): make it const fct, add some const in functions arguments. (Value + Double): killed, replaced by as_integer + as_double from String (Boolean): use String methods + string objects (Defaults): Add some const in functions arguments. * htlib/Configuration.h: add char *type; // Type of the value (string, integer, boolean) char *programs; // White separated list of programs/modules using this attribute char *example; // Example usage of the attribute (HTML) char *description; // Long description of the attribute (HTML) to the ConfigDefaults type. * htlib/Connection.cc: (assign_server) change char* args to const String& * htlib/DB2_db.cc: Merge with DB2_hash. Add compare and prefix functions pointers. Merge OpenRead & OpenReadWrite into Open, keep for compatibility. skey and data are now strings instead of DBT. Remove Get_Next_Seq. Get_Next now returns key and value in arguments. Remove all other Get_Next interfaces. * htlib/Database.h: Compatibility functions for Get_Next Put, Get, Exists, Delete take String args and are inline Add SetPrefix and SetCompare * htlib/Dictionary.cc: Add copy constructor. Add DictionaryCursor that holds the traversal context. Use DictionaryCursor object for traversal without explicit cursor specified. Add constness where meaningfull. * htlib/HtPack.cc: (htPack) format is const, change strtol call to use temporary variable to cope with constness. (htUnpack) dataref argument is not a reference anymore. Not used anywhere and kind of hidden argument nobody wants. * htlib/HtRegex.cc: set, match, HtRegex have const args. * htlib/HtWordCodec.cc: (code) orig is const * htlib/HtWordType.cc,h: statics is made of String instead of char*. Remove static String punct_and_extra from Initialize. * htlib/HtZlibCodec.cc: len is unsigned int * htlib/ParsedString.cc: add constness to function args (get) use String instead of char * htlib/QuotedStringList.cc: inline functions argument variations and add constness. * htlib/String.cc: add constness whereever possible. * htlib/htString.h: Add const get, char* cast, operator []. Add as_double conversion. * htlib/StringList.cc: inline functions argument variations and add constness. * htlib/StringMatch.cc: add constness to function args. * htlib/URL.cc: add constness to function args. (URL): fct arg was used as temp. Change, clearer. * htlib/lib.h: add const declaration of string manipulation functions. Two forms for mystrcasestsr: const and not const. * htlib/strcasecmp.cc: add constness to function args. * htlib/timegm.c: add declaration for __mktime_internal * htmerge/db.cc: change *doc* vars from char* to const String, use new WordList + WordReference interface. * htmerge/docs.cc: change *doc* vars from char* to const String. * htmerge/words.cc: use new WordList + WordReference interface. * htsearch/Display.cc: use empty method on String where appropriate. use String instead of char* where config[""] used. (includeURL): change char* args to const String& * htsearch/ResultMatch.cc: (setTitle, setSortType) change char* args to const String& * htsearch/Template.cc: (createFromFile) change char* args to const String& * htsearch/Template.h: accessors return const String& or take const char* * htsearch/TemplateList.cc: (get) use const String for internalNames. * htsearch/htsearch.cc: use String instead of char* where config[""] used. * htsearch/parser.cc: Initialize WordList member with config global. (perform_push): free the result list after calling score. (score, phrase): use new WordList + WordReference interface. Thu Sep 23 14:29:29 1999 Loic Dachary <loic at ceic.com> * htcommon/WordKey.h.tmpl, WordKey.cc: new, describe the key of the word database. * htcommon/word.desc: new, abstract description of the key structure of the word database. * htcommon/word_builder.pl: new, generate WordKey.h from WordKey.h.tmpl * htcommon/WordReference.cc: move key manipulation to WordKey.cc Add Unpack/Pack functions. Add accessors for fields and move fields to private. Add constness where possible. Mon Sep 20 14:50:47 1999 Loic Dachary <loic at ceic.com> * Everywhere config["string"] is used, check that it's *not* converted to char* for later use. Keep String object so that there is no chance to use a char* that has been deallocated. Using a String as return for config["string"] is also *much* safer for the great number of calls that did not check for a possible 0 pointer return. * htfuzzy/*.{cc,h}: const Configuration& config member. Constructor sets it. Remove config argument from openIndex & writeDB. The idea (as it was initialy, I guess) is to be able to have a standalone fuzzy library using a specify configuration file. It is now possible and consistent. * htlib/htString.cc: more constness where appropriate. Changed compare to have const String& arg instead of const Object* because useless and potential source of bugous code. * htfuzzy/Regex.cc (getWords): fix bugous setting of extra_word_chars configuration value. It is set to change the behaviour of HtStripPunctuation but this function get the extra_word_chars from a static array initialized at program start by static void Initialize(Configuration & config). Use straight s.remove() instead. Besides, the string was anchored by prepending a ^ that was removed because part of the reserved chars. Mon Sep 20 11:47:05 1999 Loic Dachary <loic at ceic.com> * htlib/Configuration.cc (operator []): changed return type to String to solve memory leak. When char* the string was malloced from ParsedString after substitution and never freed. In fact it was even worse : it was free before use in some cases. Sun Sep 19 19:12:44 1999 Loic Dachary <loic at ceic.com> * htdoc/cf_generate.pl, htcommon/defaults.cc, htlib/Configuration.h: Change the structure of the configuration defaults. Move description, examples, types, used_by information from attrs.html. Write cf_generate.pl to build attrs.html, cf_byname, cf_byprog from defaults.cc. Makes it easier to maintain an up to date description of existing attributes. About 10 attributes existed in defaults.cc and were not describted in the HTML pages. Add rules in htdoc/Makefile.am to generate the pages if a source changes. Fri Sep 17 19:34:48 1999 Loic Dachary <loic at ceic.com> * Makefile.config: add -Wall to all compilation and fix all resulting warnings. * htlib/Connection.cc (assign_server): remove redundant test and cast litteral value to unsigned * htlib/String.cc: add const qualifier where possible. Helps dealing with const objects at an upper level. Fri Sep 17 18:27:57 1999 Alexander Bergolth <leo at leo.wu-wien.ac.at> A few changes so that it compiles with xlC on AIX: * configure.in, include/htconfig.h.in: Add check for sys/select.h. Add "long unsigned int" to the possible getpeername_length types. * htdig/htdig.cc: Moved variable declaration out of case block. * htlib/Connection.cc: Include sys/select.h. * htcommon/WordList.cc: just a type cast * htlib/regex.c: define true and false only if they aren't already * htdig/Transport.{h,cc}: removed inline keywords (inline functions have to be defined and declared simultaneously) * htlib/{mktime.c,regex.h,strptime.c,timegm.c}: change // comments to /* ... */ Tue Sep 14 01:15:48 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/db.cc: Rewrite to use the WordList functions to merge the two word databases. Also make sure to load the document excerpt when adding in DocumentRefs. * htmerge/docs.cc: Fix bug where ids were not added to the discard list correctly. * htmerge/words.cc: Fix bug where ids were not checked for existance in the discard list correctly. Sun Sep 12 12:27:16 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Remove word_list since that file is no longer used. * htdig/htdig.cc: Ensure -a and -i are followed for the word_db file. Fixes PR #638. Sat Sep 11 00:11:28 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/StringMatch.h: Add back mistakenly deleted #ifndef/#define. Fri Sep 10 23:07:43 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/*, htcommon/*, htdig/*, htlib/*: Add copyright information. Fri Sep 10 11:33:50 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htnotify/htnotify.cc: Add copyright information. * htsearch/* htfuzzy/*: Ditto. Fri Sep 10 15:24:44 1999 Loic Dachary <loic at ceic.com> * htdig/Retriever.cc: change static WordList words to object member. words.Close() at end of Start function to make sure data is flushed by database. * htcommon/WordList.cc (Close): test isopen to prevent ugly crash. Remove isopen test in calling functions. Fri Sep 10 13:45:53 1999 Loic Dachary <loic at ceic.com> * htcommon/WordList.h htcommon/WordList.cc: methods Collect and Walk that factorise the behaviour of operator [], Prefix and WordRefs. * htcommon/WordList.h htcommon/WordList.cc: method Dump to dump an ascii version of the word database. * htcommon/WordReference.h,htcommon/WordReference.cc: method Dump to write an ascii version of a word. * htdig/htdig.cc: -t now also dump word database in ascii as well. * htdoc/attrs.html,cf_byprog.html,cf_byname.html: added doc for word_dump Thu Sep 9 20:30:18 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Fuzzy.h, htfuzzy/Fuzzy.cc, htfuzzy/Prefix.cc, htfuzzy/Regex.cc, htfuzzy/Speling.cc, htfuzzy/Substring.cc, htfuzzy/htfuzzy.cc, htfuzzy.h: Change to use WordList code instead of direct access to the database. Thu Sep 9 14:55:59 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/parse_doc.pl: fix bug in pdf title extraction. Tue Sep 7 23:49:41 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/ExternalParser.h, htdig/ExternalParser.cc (parse): Change parsing of location to allow phrase searching -- location is *not* just 0-1000. * htdig/Plaintext.h, htdig/Plaintext.cc, htdig/PDF.cc: Ditto. * htdig/Retriever.h, htdig/Retriever.cc: Don't call HtStripPunctuation. This is now done in the WordList::Word method. * htcommon/WordList.h htcommon/WordList.cc (Prefix): New method to do prefix retrievals. Essentially the same as [], except the loop is broken only in the unlikely event that we retrieve something beyond the range set. (Exists): New method for checking the existance of a string--attempt to retrieve it and determine if anything's actually there. (Word): Call HtStripPunctuation as part of the cleanup. Tue Sep 7 21:37:44 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Add new configuration option removed_unretrieved_urls to remove docs that have not been accessed. * htmerge/docs.cc (convertDocs): Use it. * htcommon/defaults.h, htcommon/WordRecord.h, htcommon/WordReference.h: Add copyright notice to head of file. Mon Sep 6 10:32:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtZlibCodec.h, htlib/HtZlibCodec.cc(instance): New method as used in other codecs. (encode, decode): Fix compilation errors. * htlib/Makefile.am: Added HtZlibCodec.cc to the compilation list. * htcommon/DocumentDB.cc (ReadExcerpt): Call HtZlibCodec to decompress the excerpt. (Add): Call HtZlibCodec to compress the excerpt before storing. (Open, Read): If the databases are already open, close them first in case we're opening under a different filename. (CreateSearchDB): Remove call to external sort program. Database is already sorted by DocID. * configure.in, configure: Remove check for external sort program. No longer necessary. * */Makefile.in: Regenerate using automake. Sun Sep 5 13:50:34 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/docs.cc: Ensure a document with empty excerpt has actually been retrieved. Otherwise document stubs are always removed. * htlib/String.cc: Implement the nocase_compare method. * htcommon/WordReference.cc: Implement a compare method for WordRefs to use in sorting. Uses the above. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Update the headers. * htcommon/DocumentDB.h: Ditto. Sun Sep 5 01:37:27 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/WordList.cc(Flush): Call Add() instead of storing the data ourselves. Additionally, don't open the database ourself (and then close it), instead call Open() if it's not open already. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc(AddDescription): Pass in a WordList to use when adding link text words. Ensures that the word db is never opened twice for writing. * htdig/Retriever.cc: Call AddDescription as above. * htdig/Server.cc(ctor): If debugging, write out an entry for the robots.txt file. * htlib/HtHeap.cc(percolateUp): Fix a bug where the parent was not updated when moving up more than once. (pushDownRoot): Fix a bug where the root was inproperly pushed down when it required looping. Fri Sep 3 16:23:23 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtHeap.cc(Remove): Correct bug where after a removal, the structure was not "re-heapified" correctly. The last item should be moved to the top and pushed down. (pushDownRoot): Don't move items past the size of the underlying array. * htdig/Server.h, htdig/Server.cc: Change _paths to work on a heap, based on the hopcount. Ensures on a given server that the indexing will be done in level-order by hopcount. Wed Sep 01 15:40:37 1999 Loic Dachary <loic at ceic.com> * test: implement minimal tests for htsearch and htdig Tue Aug 31 02:17:04 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/WordRecord.h: Change back to struct to ensure integrity when compressed and stored in the word database. * htcommon/WordList.cc (Flush): Use HtPack to compress the WordRecord before storage. ([], WordRefs): Use HtUnpack to decompress the WordRecord after storage. Sun Aug 29 00:42:07 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc (convertToBoolean): Remove debugging strings. * htsearch/parser.h: Add new method score(List) to merge scoring for both standard and phrase searching. * htsearch/parser.cc(phrase): Keep the current list of successful matched words around to pass to score and perform_phrase. (perform_phrase): Naively (and slowly, but correctly) loop through past words to make sure they match DocID as well as successive locations. Move scoring to score(). (perform_push): Move scoring to score(). (score): Loop through a list of WordReferences and create a list of scored DocMatches. Sun Aug 29 00:33:17 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc(createLogicalWords): Hack to produce correct output with phrase searching (e.g. anything in quotes is essentially left alone). Ensure the StringMatch pattern includes the phrase with correct spacing as well. (setupWords): Add a " token whenever it occurs in the query. (convertToBoolean): Make sure booleans are not inserted into phrases. * htsearch/parser.h: Add new methods phrase and perfor_phrase to take care of parsing phrases and performing the actual matching. * htsearch/parser.cc(lexan): Return a '"' when present for phrase searching. (factor): Call phrase() before parsing a factor--phrases are the highest priority, so ("RedHat Linux" & Debian) ! Windows makes sense. (phrase): New method--slurps up the rest of a phrase and calls perform_phrase to do the matching. (perform_phrase): New method--currently just calls perform_and to give the simulation of a phrase match. Sat Aug 28 15:57:53 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Server.h, htdig/Server.cc: Undo yesterdays change -- still very buggy and shouldn't be used yet. * htdig/Retriever.cc (parse_url): Change default index to 1 to more closely match DocIDs shown with verbose output. * htsearch/DocMatch.h: Change score to double and clean up headers. * htcommon/WordRecord.h: Change unnecessary long ints (id and flags) to plain ints. * htdig/HTML.cc (parse): Call got_word with actual word sequence (i.e. 1, 2, 3...) rather than scaling to 1-1000 by character offset. * htlib/Database.h, htlib/DB2_db.h, htlib/DB2_hash.h: Change Get_Item to Get_Next(String item) to return the data as a reference. This makes it easier to use in a loop and cuts the database calls in half. * htlib/DB2_db.cc, htlib/DB2_hash.cc: Implement it, making sure we keep the possibly useful data around, rather than tossing it! * htsearch/htsearch.cc(htsearch): Don't attempt to open the word db ourselves. Instead, pass the filename off to the parser, which will do it through WordList. * htsearch/parser.h: Use a WordList instead of a generic Database. * htsearch/parser.cc(perform_push): Use the WordList[] operator to return a list of all matching WordRefs and loop through, summing the score. * htcommon/WordList.cc (Flush): Don't use HtPack on the data--somehow when unpacking, there's a mismatch of sizes. (Read): Fix thinko where we attempted to open the database as a DB_HASH. ([]): Don't use HtUnpack since we get mismatches. Use the new Get_Next(data) call instead of calling Get_Item separately. (WordRefs): Same as above. Fri Aug 27 09:44:09 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (Need2Get): Remove duplicate detection code for local_urls. The code is somewhat buggy and should be replaced by more general code shortly. * htdig/Server.h, htdig/Server.cc (push, pop): Change _paths to a HtHeap sorted on hopcount first (and order placed on heap second). Ensures that on each server, the order indexed is guaranteed to be level-order by hopcount. * htdig/URLRef.h, htdig/URLRef.cc (compare): Add comparison method to enable sorting by hopcount. Fri Aug 27 09:36:35 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/WordList.h, htcommon/WordList.cc (WordList): Change words to a list instead of a dictionary for minor speed improvement. Thu Aug 26 11:18:20 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc, htdoc/attrs.html: increase default maximum_word_length to 32. Wed Aug 25 16:50:16 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Retriever.cc(got_word): add code to check for compound words and add their component parts to the word database. * htdig/PDF.cc(parseString), htdig/Plaintext.cc(parse): Don't strip punctuation or lowercase the word before calling got_word. That should be left up to got_word & Word methods. * htlib/StringMatch.h, htlib/StringMatch.cc(Pattern, IgnoreCase): Add an IgnorePunct() method, which allows matches to skip over valid punctuation, change Pattern() and IgnoreCase() to accomodate this. * htsearch/htsearch.cc(main, createLogicalWords): use IgnorePunct() to highlight matching words in excerpts regardless of punctuation, toss out old origPattern, and don't add short or bad words to logicalPattern. * htlib/HtWordType.h, htlib/HtWordType.cc(Initialize): set up and use a lookup table to speed up HtIsWordChar() and HtIsStrictWordChar(). Mon Aug 23 10:13:05 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc(parse): fix problems with null pointer when attempting SGML entity decoding on bare &, as reported by Vadim Chekan. Thu Aug 19 11:52:06 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc(main): Fix to allow multiple keywords input parameter definitions. * contrib/parse_doc.pl: make spaces optional in LANGUAGE = POSTSCRIPT PJL test. Wed Aug 18 11:27:46 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/PDF.cc(parse): Fixed wrong variable name in new code. Double-Oops! (It was Friday the 13th, after all...) Tue Aug 17 16:26:46 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtHeap.cc(Remove): apply Geoff's patch to fix Remove. * htlib/HtVector.h, htlib/HtVector.cc(Index): various bounds overrun bug fixes and checking in Last(), Nth() & Index(). Mon Aug 16 13:55:10 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(expandVariables): fix up test for & Mon Aug 16 12:08:57 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * Makefine.am, Makefile.in, installdir/Makefile.am, installdir/Makefile.in: change all remaining INSTALL_ROOT to DESTDIR. Fri Aug 13 15:44:31 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/PDF.cc(parse): added missing ')' in new code. Oops! * htlib/strptime.c, htlib/mktime.c: added #include "htconfig.h" to pick up definitions from configure program. Let's try to remember that config.h != htconfig.h! Fri Aug 13 14:49:07 1999 Loic Dachary <loic at ceic.com> * configure.in: removed unused HTDIG_TOP, changed AM_WITH_ZLIB by CHECK_ZLIB Fri Aug 13 14:00:16 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/PDF.cc(parse), htcommon/defaults.cc, htdoc/attrs.html (pdf_parser): Removed -pairs option from default arguments, added special test for acroread to decide whether to use output file or directory as last argument (also adds -toPostScript if missing). Program now tries to test for existance of parser before trying to call it. Fri Aug 13 10:10:16 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/attrs.html(pdf_parser): updated xpdf version number. Thu Aug 12 17:09:37 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/parse_doc.pl: updated for xpdf 0.90, plus other fixes. Thu Aug 12 11:12:07 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/attrs.html(logging): added Geoff's description of log lines. Thu Aug 12 11:21:12 1999 Loic Dachary <loic at ceic.com> * strptime fixes : AC_FUNC_STRPTIME defined in acinclude.m4 and used in configure.in, conditional compilation of strptime.c (only if HAVE_STRPTIME not defined), removed Htstrptime (strptime.c now defines strptime), changed all calls to Htstrptime to calls to strptime. Wed Aug 11 16:59:41 1999 Loic Dachary <loic at ceic.com> * */Makefile.am: use -release instead of -version-info because nobody wants to bother with published shared lib interfaces version numbers at present. * htlib/Makefile.am: added langinfo.h Wed Aug 11 15:00:07 1999 Loic Dachary <loic at yoda.ceic.com> * acconfig.h: removed MAX_WORD_LENGTH * re-run auto* to make sure chain is consistent * Makefile.am: improve distclean for tests Wed Aug 11 13:46:22 1999 Loic Dachary <loic at yoda.ceic.com> * configure.in: change --enable-test to --enable-tests so that Berkeley DB tests are not activated. Since they depend on tcl this can be a pain. * acinclude.m4: AM_PROG_TIME locate time command + find out if verbose output is -l (freebsd) or -v (linux) Wed Aug 11 13:13:39 1999 Loic Dachary <loic at yoda.ceic.com> * acinclude.m4 : AM_WITH_ZLIB autoconf macro for zlib detection that allows --with-zlib=DIR to specify the install root of zlib, --without-zlib to prevent inclusion of zlib. If nothing specified zlib is searched in /usr and /usr/local. --disable-zlib is replaced with --without-zlib. * configure.in,configure,aclocal.m4,db/dist/acinclude.m4, db/dist/aclocal.m4,db/dist/configure,db/dist/configure.in: changed to use AM_WITH_ZLIB Tue Aug 10 21:14:34 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc (outputVariable): Fix compilation error with assignment between char * and char *. * htsearch/htsearch.cc (main): Use cleaner trick to sidestep discarding const char * as suggested by Gilles. Tue Aug 10 17:24:12 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(expandVariables): clean up, simplify and label lexical analyzer states. Tue Aug 10 17:04:54 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(expandVariables, outputVariable): add handling for $%(var) and $&(var) in templates. Still to be documented. Tue Aug 10 20:13:52 1999 Loic Dachary <loic at yoda.ceic.com> * db/mp/mp_bh.c: fixed HAVE_ZLIB -> HAVE_LIBZ Tue Aug 10 17:58:01 1999 Loic Dachary <loic at yoda.ceic.com> * configure,configure.in,db/dist/configure.in,db/dist/configure: added --with-zlib configure flag for htdig to specify zlib installation path. Motivated to have compatible tests between htdig and db as far as zlib is concerned. Otherwise configuration is confused and miss an existing libz. Tue Aug 10 17:44:49 1999 Loic Dachary <loic at yoda.ceic.com> * db/mp/mp_fopen.c: fixed cmpr_open called even if libz not here Tue Aug 10 17:40:53 1999 Loic Dachary <loic at yoda.ceic.com> * htlib/langinfo.h: header missing on FreeBSD-3.2, needed by strptime.c Tue Aug 10 11:43:14 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.h, htdig/HTML.cc(parse, do_tag): fix problems with SGML entity decoding, add decoding of entities within tag attributes. Mon Aug 9 21:13:50 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HtHTTP.h(SetRequestMethod): Fix declaration to be void. * htdig/Transport.h(GetRequestMaxDocumentSize): Fix declaration to return int. * htdig/Retriever.cc(got_href): Fix mistake in hopcount calculations. Now returns the correct hopcount even for pages when a faster path is found. (Still need to change indexing to sort on hopcount). * htsearch/htsearch.cc(main): Fix compiler error in gcc-2.95 when discarding const by using strcpy. It's a hack, hopefully there's a better way. Mon Aug 9 17:23:15 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/URL.cc(ServerAlias): fix small memory leak in new default path code (don't need to allocate new from string each time). * htlib/cgi.cc(init): Fix PR#572, where htsearch crashed if CONTENT_LENGTH was not set but REQUEST_METHOD was. * htfuzzy/Fuzzy.cc(getWords), htfuzzy/Metaphone.cc(vscode): Fix Geoff's change of May 15 to Fuzzy.cc, add test to vscode macro to stay in array bounds, so non-ASCII letters to cause segfault. Should fix PR#514. Mon Aug 9 17:03:45 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * include/htconfig.h.in, htcommon/WordList.cc(Word,Flush&BadWordFile), htcommon/DocumentRef.cc(AddDescription), htcommon/defaults.cc, htsearch/parser.cc(perform_push), htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Convert the MAX_WORD_LENGTH compile-time option into the run-time configuration attribute maximum_word_length. This required reinserting word truncation code that had been taken out of WordList.cc. Mon Aug 9 16:34:14 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HtHTTP.cc (isParsable): allow application/pdf as parsable, to use builtin PDF code. * htdig/HtHTTP.cc (ParseHeader), htdig/Document.cc (readHeader): clean up header parsing. * htdig/Document.cc (getdate): make tm static, so it's initialized to zeros. Should fix PR#81 & PR#472, where strftime() would crash on some systems. Idea submitted by benoit.sibaud at cnet.francetelecom.fr * htlib/URL.cc (parse): fix PR#348, to make sure a missing or invalid port number will get set correctly. Mon Aug 9 15:42:41 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Added descriptions for attributes that were missing, added a few clarifications, and corrected a few defaults and typos. Covers PR#558, PR#626, and then some. * configure.in, configure, include/htconfig.h.in, htlib/regex.c: PR#545 fixed - configure tests for presence of alloca.h for regex.c Sat Aug 07 13:40:17 1999 Loic Dachary <loic at ceic.com> * configure.in: remove test for strptime. Run autoconf + autoheader. * htlib/HtDateTime.cc: always use htdig strptime, do not try to use existing function in libc. * htlib/HtDateTime.h: move inclusion of htconfig.h on top of file, change #ifdef HAVE_CONFIG to HAVE_CONFIG_H Fri Aug 6 16:37:33 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc (UseProxy): fix call to match() and test of return value to work as documented for http_proxy_exclude (PR#603). Fri Aug 06 15:06:23 1999 <loic at yoda.ceic.com> * db/dist/config.hin, db/mp/mp_cmpr.c db/db/db.c, db/mp/mp_fopen.c: disable compression if zlib not found by configure. Thu Aug 05 12:27:15 1999 <loic at yoda.ceic.com> * test/dbbench.cc: invert -z and -Z for consistency * test/Makefile.am: add dbbench call examples Thu Aug 05 11:38:58 1999 Loic Dachary <loic at ceic.com> * test/Makefile.am: all .html go in distribution, compile dbbench that tests Berkeley DB performances. * configure.in/Makefile.am: conditional inclusion of the test directory in the list of subdirs (--enable-test). The list of subdirs is now @HTDIGDIRS@ in configure.in & Makefile.am * db/*: Transparent I/O compression implementation. Defines the DB_COMPRESS flag. For instance DB_CREATE | DB_COMPRESS. * db/db_dump/load: add -C option to specify cache size to db_dump/db_load Wed Aug 4 22:57:27 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * db/*: Import of Sleepycat's Berkeley DB 2.7.5. Wed Aug 4 22:40:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * contrib/htparsedoc/htparsedoc: Add in contributed bug fixes from Andrew Bishop to work on SunOS 4.x machines. Wed Aug 4 01:58:52 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * COPYING, htdoc/COPYING, configure.in, Makefile.am, Makefile.in: Update information to use canonical version of the GPL from the FSF. In particular, this version has the correct mailing address of the FSF. Mon Aug 02 11:28:00 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htlib/htString.h, htlib/String.cc : added the possibility to insert an unsigned int into a string. * htdig.cc : with verbose mode shows start and end time. Thu Jul 22 18:10:00 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Transport.cc, htdig/HtHTTP.cc : modified the destructors. Thu Jul 22 13:10:00 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Transport.cc, htdig/Transport.h, htdig/HtHTTP.cc, htdig/HtHTTP.h: Re-analyzed inheritance methods and attributes of the 2 classes. This is a first step, not definitive ... cos it still doesn't work as I hope. Tue Jul 20 11:21:52 1999 <loic at ceic.com> * configure.in : added AM_MAINTAINER_MODE to prevent unwanted dependencies check by default. * db/Makefile.in : remove Makefile when distclean Mon Jul 19 13:23:53 1999 <loic at ceic.com> * Makefile.config (INCLUDES): added -I$(top_srcdir)/include because automatically -I../include is not good, added -I$(top_builddir)/db/dist because some db headers are configure generated (if building in a directory that is not the source directory). * rename db/Makefile db/Makefile.in: otherwise it does not show up if if building in a directory that is not the source directory. Mon Jul 19 13:02:22 1999 <loic at ceic.com> * .cvsignore: do not ignore Makefile.config Sun Jul 18 22:47:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/parser.cc: Eliminated compiler errors. Currently returns no matches until bugs in the WordList code are fixed. Sun Jul 18 22:42:04 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/htmerge.h: Cleanup, including WordRecord and WordReference as needed. * htmerge/htmerge.cc: Update for files necessary for merge calls. Call convertDocs before mergeWords so that the discardList gets the list of documents deleted. * htmerge/docs.cc: Update for difference in calling order. * htmerge/words.cc: Update (and significant cleanup) since WordList writes directly to db.words.db. Iterate over the stored words, deleting those from deleted documents. * htmerge/db.cc: Update to eliminate compiler errors. Currently disabled until bugs in the words code are fixed. Sun Jul 18 22:33:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Collapse the multiple heading_factors into one. (It's prohibitive to define a flag for each h* tag). Add a new url_factor for the text of URLs (presently unused). * htcommon/DocumentRef.cc(AddDescription): Use FLAG_LINK_TEXT as defined in htcommon/WordRecord.h. * htdig/Retriever.h: Change factor to accomodate flags instead of weighting factors. * htdig/Retriever.cc: Update to use flags, and define the indexed flags in factor as appropriate. * htdig/HTML.cc: Update calls to got_word with appropriate new offsets into factor[]. Sun Jul 18 22:18:16 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/WordReference.h, htcommon/WordRecord.h: Update to use flags instead of weight. * htcommon/WordList.h, htcommon/WordList.cc: Add database access routines to match DocumentDB.cc. (Word): Recognize flags instead of weight, simply add the word. (Duplicates expected!) (mark*): Simply delete the list of words. (flush): Rather than dump to a text file, dump directly to the db. Sun Jul 18 21:50:04 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Database.h, htlib/DB2_db.h, htlib/DB2_hash.h: Add new method Get_Item to access the data of the current item when using Get_Next() or Get_Next_Seq(). * htlib/DB2_db.h, htlib/DB2_hash.cc: Implement Get_Item() using cursor access. Sat Jul 17 12:59:01 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * test/*.html: Added various HTML files as the beginnings of a testing suite. Fri Jul 16 16:06:27 1999 Loic Dachary <loic at ceic.com> * All libraries (except db) use libtools. Shared libraries are generated by default. --disable-shared to get old behaviour. Libraries are installed in all cases. * Change structure of default installation directory (match standard). database : var/htdig programs : bin libraries : lib Like default apache: conf : conf htdocs : htdocs/htdig cgi-bin : cgi-bin * Switch all Makefile.in into Makefile.am * CONFIG.in CONFIG : removed. Replaced with --with- arguments in configure.in * Makefile.config.in removed, only keep Makefile.config : automake automatically defines variables for each AC_SUBST variables. Makefile.config has HTLIBS + DEFINES * db/Makefile : added to forward (clean all distclean) targets to db/dist and implement distdir target. * acconfig.h : created to allow autoheader to work (contains GETPEERNAME_LENGTH_T HAVE_BOOL, HAVE_TRUE, HAVE_FALSE, NEED_PROTO_GETHOSTNAME). Extra definitions added before @TOP@ (TRUE, FALSE, VERSION, MAX_WORD_LENGTH, LOG_LEVEL, LOG_FACILITY). * installdir/Makefile.am : installation rules moved from Makefile.am to installdir/Makefile.am * include/Makefile.am : distribute htconfig.h.in and stamp-h.in * Makefile.am : do not pre-create the directories, creation is done during the installation * configure.in: CF_MAKE_INCLUDE not needed anymore : automake handles the include itself. Fri Jul 16 13:04:27 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc(parse): fix to prevent closing ">" from being passed to do_tag(). Thu Jul 15 21:25:12 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc (readHeader, getParsable): Add back application/pdf to use builtin PDF code. * htdig/Makefile.in: Remove broken Postscript parser as it never worked. * htlib/URL.cc (normalizePath, path): Use config.Boolean as pointed out by Gilles. Thu Jul 15 15:54:30 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdoc/attrs.html(pdf_parser & external_parsers): add corrections & clarifications, links to relevant FAQ entries. Thu Jul 15 18:00:00 1999 CEST Gabriele Bartolini <g.bartol at comune.prato.it> * htlib/HtDateTime.cc, htlib/HtDateTime.h : added the possibility to initialize and compares HtDateTime with integers. Added the constructor HtDateTime (int) and various operator overloading methods. Wed Jul 14 22:57:14 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/URL.cc (normalizePath, path): If not case_sensitive, lowercase the URL. Should ensure that all URLs are appropriately lowercased, regardless of where they're generated. Wed Jul 14 22:37:47 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/DB2_db.cc (OpenReadWrite, OpenRead): Add flag DB_DUP to database to allow storage of duplicate keys (in this case, words). Tue Jul 13 15:36:40 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc (do_tag): Fix handling of <link> and <area>, to use href= instead of src=. Mon Jul 12 22:31:48 1999 Hanno Mueller <kontakt at hanno.de> * contrib/scriptname/results.shtml: Remove unintentional $(VERSION). Mon Jul 12 22:20:40 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Cleanups suggested by Gilles, combining <link> and <area>, <embed> <object> and <frame> and moving <img> to a separate case. Sun Jul 11 19:32:38 1999 Hanno Mueller <kontakt at hanno.de> * contrib/README: Add scriptname directory. * contrib/scriptname/*: An example of using htsearch within dynamic SSI pages * htcommon/defaults.cc: Add script_name attribute to override SCRIPT_NAME CGI environment variable. * htdoc/FAQ.html: Update question 4.7 based on including htsearch as a CGI in SSI markup. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: Update based on behavior of script_name attribute. * htsearch/Display.cc: Set SCRIPT_NAME variable to attribute script_name if set and CGI environment variable if undefined. Sat Jul 10 00:22:34 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Regex.cc (getWords): Anchor the match to the beginning of string, add regex-interpeted characters to extra_word_chars temporarily, and strip remaining punctuation before making a match. Fri Jul 9 22:35:57 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc: Back out change of June 24. * htsearch/htsearch.cc: Ditto. * htsearch/htsearch.cc (setupWords): Remove HtStripPunctuation in favor of requiring Fuzzy classes to strip whatever punctuation is necessary. * htfuzzy/Fuzzy.h: Add HtWordType.h to #includes and update comments. * htfuzzy/Synonym.cc, htfuzzy/Substring.cc, htfuzzy/Speling.cc, htfuzzy/Prefix.cc, htfuzzy/Exact.cc, htfuzzy/Endings.cc, htfuzzy/Fuzzy.cc (getWords): Call HtStripPunctuation on input before performing fuzzy matching. Thu Jul 8 21:28:44 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Add support for parsing <LINK> tags. Mon Jul 5 16:53:23 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/htdig.cc (main): Insert '*' instead of username/password combination to hide credentials in process accounting. Sat Jul 3 17:35:52 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Transport.h(ConnectionWrite): Return value from Connection::write call. * htdig/URLRef.h, htdig/URLRef.cc: Cleanup and made hopcount default consistent with 7/3 change to DocumentRef.cc * htdig/Server.h, htdig/Server.cc, htdig/Retriever.cc: Cleanup and fixes to match URLRef calling interface. Sat Jul 3 16:37:29 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.cc (do_tag): Fix <meta> robots parsing to allow multiple directives to work correctly. Fixes PR#578, as provided by Chris Liddiard <c.h.liddiard at qmw.ac.uk>. Sat Jul 3 00:47:51 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Makefile.in: Remove old SGMLEntities code. Sat Jul 3 00:26:55 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentRef.cc (Clear): Change default value of docHopCount to 0 to fix several hopcount bugs. * htdig/Transport.h, htdig/Transport.cc: Changes to support URL referers as well as authentication credentials. * htdig/HtHTTP.h, htdig/HtHTTP.cc(SetCredentials): Implement HTTP Basic Authentication credentials. (SetRequestCommand): Use Referer and Authentication headers if supplied. Sun Jun 30 11:26:00 1999 Gabriele Bartolini <g.bartol at comune.prato.it> * htdig/Transport.h: Inserted the methods declarations regarding the connection management. The code has been moved out from the HtHTTP.h code. Also moved here the static variable 'debug'. * htdig/Transport.cc: Definition of the connection management code. The code has been moved out from the HtHTTP.cc code. * htdig/HtHTTP.h: Eliminated the connection management code and the static variable 'debug'. Inserted the 'modification_time_is_now' as a static variable, in order to respect the encapsulation principle. * htdig/HtHTTP.cc: Eliminated the connection management code and the static variable 'debug' initialization. Inserted the 'modification_time_is_now' initialization. Sun Jun 27 16:29:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HTML.h: Cleanup. * htcommon/defaults.cc: Added default for img_alt_factor for text weighting on <IMG ALT="..." tags. * htdig/Retriever.cc: Add slot for img_alt_factor. * htdig/HTML.cc (do_tag): Rewrite using Configuration class to separate tag attributes. (parse): Ignore final '>' in string passed to do_tag. (do_tag): Index IMG ALT text. Fri Jun 25 17:58:44 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Transport.h: Fix virtual methods for Transport_Response to have defaults. * htdig/HtHTTP.h: Fix class declaration of HtHTTP class to prevent syntax error. Pointed out by Gabriele. * htdig/Transport.cc: Add (empty) ctor and dtor functions for Transport_Response. Thu Jun 24 22:28:44 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc (main): Add support for form inputs configdir and commondir as contributed by Herbert Martin Dietze <herbert at fh-wedel.de>. * htsearch/Display.cc (createURL): If configdir and commondir are defined, add them to URLs sent for other pages. Wed Jun 23 23:00:18 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HtHTTP.h, htdig/HtHTTP.cc: Make a subclass of Transport. Wed Jun 23 22:08:20 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Configuration.cc (Add): Handle single-quoted values for attributes. Tue Jun 22 23:35:39 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Transport.h, htdig/Transport.cc: Virtual classes to handle transport protocols such as HTTP, FTP, WAIS, gopher, etc. * htdig/Makefile.in: Make sure they're compiled (not that there's much!) * htdig/HtHTTP.h: Add htdig.h to ensure config is defined. Mon Jun 21 14:33:10 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc(readHeader), htdig/HtHTTP.cc(ParseHeader): fix handling of modification_time_is_now in readHeader, add similar code to ParseHeader. Sun Jun 20 21:25:15 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.h: Add hop parameter to got_href method. Defaults to 1. * htdig/Retriever.cc(got_href): Use it instead of constant 1. * htdig/HTML.cc (do_tag): Use new hop parameter to keep the same hopcount for frame, embed and object tags. * htdig/Makefile.in: Make sure HtHTTP.cc is compiled. * htdig/HtHTTP.cc (ctor): Add default value for _server to make prevent strange segmentation faults. Fri Jun 18 09:53:30 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/DocumentRef.h, htcommon/DocumentRef.cc(Clear, Deserialize): add docHeadIsSet field, code for setting and getting it. * htcommon/DocumentDB.cc(Add): only put out excerpt record if DocHead is really set. * htmerge/doc.cc(convertDocs): add missing else after code to delete documents with no excerpts. (All these changes fix the disappearing excerpts problem in 3.2.) Wed Jun 16 23:04:38 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc (UseProxy): Change http_proxy_exclude to an escaped regex string. Allows for much more complicated rules. Wed Jun 16 16:04:07 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * Makefile.config.in: fix typo in name IMAGE_URL_PREFIX. * htdig/Retriever.cc(IsValidURL): change handling of valids to only reject if list is not empty, give different error message. Wed Jun 16 14:40:56 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc(main): pass StringList args to setEscaped() instead of unprocessed input[] char *'s. * htsearch/Display.cc(buildMatchList): cast score to (int) in maxScore calculation, to avoid compiler warnings. * htdig/htdig.cc(main): change comparison on minimalFile to avoid compiler warnings. Wed Jun 16 11:30:23 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/HtRegex.cc(setEscaped): Fix appending of substring to avoid compiler warnings. * htlib/HtDateTime.cc(SettoNow): Strip out all the nonsense that doesn't work, set Ht_t directly instead. Wed Jun 16 09:58:12 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * configure.in, configure, Makefile.config.in: Correct handling of SEARCH_FORM variable, as Gabriele recommended. Wed Jun 16 09:32:06 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/cgi.h, htlib/cgi.cc(cgi & init), htsearch/htsearch.cc (main & usage): allow a query string to be passed as an argument. Wed Jun 16 08:43:09 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/Makefile.in, htdig/Makefile.in, htfuzzy/Makefile.in, htmerge/Makefile.in, htnotify/Makefile.in: Use standard $(bindir) variable instead of $(BIN_DIR). Allows for standard configure flags to set this. (Completes Geoff's change on May 15.) Tue Jun 15 14:31:50 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/PDF.cc(parseNonTextLine): move line that clears _parsedString, so title cleared even if rejected. * htsearch/Display.cc(buildMatchList & sort): move maxScore calculation from sort to buildMatchList, so it's done even if there's only 1 match. Mon Jun 14 15:01:07 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc(RetrieveHTTP): Show "Unknown host" message if Connection::assign_server() fails (due to gethostbyname() failure). Mon Jun 14 13:52:34 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htcommon/defaults.cc, htsearch/Display.h, htsearch/Display.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/hts_templates.html: add template_patterns attribute, to select result templates based on URL patterns. Sun Jun 13 16:29:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (IsValidURL): Add valid_extension list, as requested numerous times. * htcommon/defaults.cc: Add config attribute valid_extensions, with default as empty. Sat Jun 12 23:10:39 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentRef.h: Fix thinkos introduced in change earlier today. Actually compiles correctly now. Sat Jun 12 22:37:22 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HtHTTP.cc (ParseHeader): Fix parsing to take empty headers into account. Fixes PR#557. * htsearch/Display.h, htsearch/Display.cc (excerpt): Fix declaration to refer to first as reference--ensures ANCHOR is properly set. Fixes PR#541 as suggested by <pmb1 at york.ac.uk>. * htfuzzy/Endings.cc (getWords): Fixed PR#560 as suggested by Steve Arlow <yorick at ClarkHill.com>. Solves problems with fuzzy matching on words like -ness: witness, highness, likeness... Tries to interpret words as root words before attempting stemming. * installdir/search.html (Match): Add Boolean to default search form, as suggested by PR#561. * htlib/URL.cc (URL): Fix PR#566 by setting the correct length of the string being matched. 'http://' is 7 characters... Sat Jun 12 19:06:36 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtZlibCodec.h, htlib/HtZlibCodec.cc: New files. Provide general access to zlib compression routines when available. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Remove compression access and restore DocHead access through default methods. Compression of excerpts will occur through the HtZlibCodec classes and through the DocumentDB excerpt access. Sat Jun 12 15:25:08 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/docs.cc (convertDocs): Load excerpt from external database before considering it empty. Sat Jun 12 14:41:54 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc (displayMatch): Added patch from Torsten Neuer <tneuer at inwise.de> to fix PR# 554. * htdig/HTML.cc (do_tag): Add parsing for <embed> and <object>, including suggestions from Gilles as to condensing cases with <img> parsing. Sat Jun 12 14:00:39 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/ExternalParser.cc (parse): Quote the filename before passing it to the command-line to prevent shell escapes. Fixes PR#542. Fri Jun 11 15:59:10 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/URL.cc(removeIndex): use CompareWord instead of FindFirstWord, to avoid substring matches. Wed Jun 2 15:51:00 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/URLTrans.cc(encodeURL): Fix to ensure that non-ASCII letters get URL-encoded. Mon May 31 22:40:29 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentDB.cc(ReadExcerpt): Fix silly typos with methods, thinko with docID. (Add): Add the excerpt *before* the URL index is written. * htdig/Retriever.cc(isValidURL): Remove code restricting URLs to relative and http://. * htdig/htdig.cc(main): Unlink the doc_excerpt file when doing an initial dig. (main): Fix silly typo with minimumFile. * htmerge/db.cc(mergeDB): Call DocumentDB::Open() with doc_excerpt for consistency--doesn't actually do anything with it. * htmerge/docs.cc(convertDocs): Ditto. Also don't delete a document simply because it has an empty DocHead. Excerpts are now stored in a separate database! * htmerge/htmerge.h: Call mergeDB and convertDocs with doc_excerpt parameter. * htmerge/htmerge.cc(main): Ditto. * htsearch/Display.h: Call ctor with all three doc db filenames. * htsearch/Display.cc(Display): Call DocumentDB::Open with above. (excerpt): Retrieve the excerpt from the excerpt database. * htsearch/htsearch.cc: Call Display::Display with all three doc db filenames. Mon May 31 15:08:30 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentDB.h: Add new method ReadExcerpt to read the excerpt from the separate (new) excerpt database. Change Open() and Read() methods to account for this new database. * htcommon/DocumentDB.cc (Open): Open the excerpt database too. (Read): Ditto. (Close): Close it if it exists. (ReadExcerpt): Explicitly read the DocHead of this DocumentRef. (Add): Make sure DocHeads go into the excerpt database. (Delete): Make sure we delete the associated excerpt too. (CreateSearchDB): Make sure we grab the excerpt from the database. * htcommon/DocumentRef.cc(Serialize): Don't serialize the DocHead field, this is done in the DocumentDB code. * htcommon/defaults.cc(modification_time_is_now): Set to true to avoid problems with not setting dates when no Last-Modified: header appears. (doc_excerpt): Add new attribute for the filename of the excerpt database. * htdig/HtHTTP.h: Remove incorrect virtual declarations from Request and EstablishConnection methods. Assign void return value to ResetStatistics since it doesn't return a value. * htdig/htdig.cc (main): Add new "minimal" flag '-m' to only index the URLs in the supplied file. Sets hopcount to ignore links. Sun May 30 19:36:15 1999 Alexander Bergolth <leo at leo.wu-wien.ac.at> * htlib/URL.cc (normalizePath): Fix bug that caused endless loops and core dumps when normalizing URLs with more than one of ( "/../" | "/./" | "//" | "%7E" ) * htlib/HtDateTime.cc (Httimegm): Call Httimegm in timegm.c unless HAVE_TIMEGM. Wed May 26 23:15:46 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htmerge/db.cc (mergeDB): Add patch contributed by Roman Dimov <roman at twist.mark-itt.ru> to fix problems with confusing docIDs, resulting in documents in main db removed when the corresponding DocID was supposed to be removed from the merged db. Wed May 26 11:30:22 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.h, htsearch/Display.cc, htsearch/htsearch.cc: Switch restrict and excludes to use HtRegex instead of StringMatch. * htdig/htdig.cc (main): Fix typo clobbering setting of excludes. Obviously fixes problems with badquerystr and excludes! * htdig/HtHTTP.cc (ParseHeader): Change parsing to skip extra whitespace, as in 5/19 Document.cc(readHeader) change. Wed May 19 22:17:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/HtHTTP.cc, htdig/HtHTTP.h: Add new files, contributed by Gabriele. A start at an HTTP/1.1 implementation. * htdig/Document.cc (readHeader): Fix change of 5/16 to actually work! :-) * htsearch/Display.cc (expandVariables): Change end-of-expansion test to include states 2 and 5 to ensure templates ending in } are still properly expanded, as suggested by Gilles. Mon May 17 14:31:31 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegex.cc (setEscaped): Use full list of characters to escape as suggested by Gilles. Sun May 16 17:27:51 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Document.cc (readHeader): Since multiple whitespace characters are allowed after headers, don't use strtok. (readHeader): We no longer pretend to parse Word, PostScript, or PDF files internally. (getParsable): Don't generate PostScript or PDF objects since we no longer recommend using them. Sun May 16 17:07:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegex.cc (setEscaped): Ensure escaping does not loop beyond the end of a string. * htdig/Retriever.cc (IsValidURL): Fix badquerystr parsing to use HtRegex as expected. (Oops!) * htdig/HTML.cc (parse): Use HtSGMLCodec during parsing, rather than encoding the whole document at the beginning. More consistent with previous use of SGMLEntities. Sat May 15 12:57:40 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/URL.cc (normalizePath): Remove extra (useless) variable declarations. * htlib/htString.h, htlib/String.cc: Add new method Nth to solve problems with (String *)->[]. * htlib/HtRegex.h, htlib/HtRegex.cc: Added new method setEscaped(StringList) to produce a pattern connected with '|' of possibly escaped strings. Strings are not escaped if enclosed in [] and the brackets are removed from unescaped regex. * htdig/htdig.h: Use HtRegex instead of StringMatch for limiting by default. * htdig/Retriever.cc: As above. * htdig/htdig.cc(main): As above. Use setEscaped to set limits correctly (i.e. in a backwards-compatible way). Sat May 15 11:24:26 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Speling.h, htfuzzy/Speling.cc: New files for simple spelling corection. Currently limited to transpostion and added character errors. Missing character errors to be added soon. * htfuzzy/Makefile.in: Compile it. * htfuzzy/Fuzzy.cc (getFuzzyByName): Use it. * htcommon/defaults.cc: Add new option minimum_speling_length for the shortest query word to receive speling fuzzy modifications. Should prevent problems with valid words generating unrelated "corrections" of words. Default is 5 chars. Sat May 15 11:18:27 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Fuzzy.cc (getWords): Ensure word is not an empty or null string. * htfuzzy/Metaphone.cc (generateKey): Ditto. Should solve PR#514. * htdig/Document.cc (Reset): Do not use modification_time_is_now attribute. Simply reset modtime to 0, time is set elsewhere. * Makefile.config.in: Add options from separate CONFIG files. * configure.in, configure: Add configure-level switches for --with-image-url-prefix= and --with-search-form=. Do not generate CONFIG file (hopefully to be phased out soon). * */Makefile.in: Make linking CONFIG-dependent files depend on Makefile.config, not CONFIG. * Makefile.in: Use standard $(bindir) variable instead of $(BIN_DIR). Allows for standard configure flags to set this. Tue May 11 11:15:08 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.h, htlib/HtDateTime.cc: Updates from Gabriele, fixing SetToNow() and adding GetDiff to return the difference in time_t between two objects. * htdig/Retriever.cc (Need2Get): Add patch from Warren Jones <wjones at tc.fluke.com> to keep track of inodes on local files to eliminate duplicates. Hopefully this will serve for a first-try at a signature method for HTTP as well. Tue May 4 20:20:40 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/Regex.h, htfuzzy/Regex.cc: Add new regex fuzzy algorithm, based on Substring and Prefix. * htfuzzy/Fuzzy.cc (getFuzzyByName): Add it. * htfuzzy/Makefile.in: Compile it. * htcommon/defaults.cc: Add new attribute regex_max_words, same concept as substring_max_words. * htfuzzy/Exact.cc, htfuzzy/Substring.cc, htfuzzy/Prefix.cc: Define names attribute for debugging purposes. * installdir/htdig.conf: Fix the comments for search_algorithm to refer to all the current possibilities. * htlib/HtRegex.cc (match): Slight cleanup of how to return. Tue May 4 15:28:38 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc (reportError): Add e-mail of maintainer to error message. Should help direct people to the correct place. * htdig/Retriever.cc (IsValidURL): Lowercase all extensions from bad_extensions as well as all extensions used in comparisons. Ensures we're using case-insenstive matching. Mon May 3 23:20:22 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/Retriever.cc (IsValidURL): Fix typo with #else statement for REGEX. * htdig/htdig.cc: Add conditionals for REGEX to use HtRegex instead of StringMatch methods when defined. * htlib/HtDateTime.h: Update to remove definitions of true and false, established by May 2 change in include/htconfig.h.in as contributed by Gabriele. * htlib/HtDateTime.cc: Replace call to mktime internal function to Httimegm in timegm.c, contributed by Leo. * htlib/timegm.c: Declare my_mktime_gmtime_r to prevent compiler errors with incompatible gmtime structures, contributed by Leo. * configure.in: Rearrange date/time checks for clarity. * configure: Regenerate using autoconf. * include/htconfig.in: Add HAVE_STRFTIME flag. Sun May 2 18:49:04 1999 Alexander Bergolth <leo at leo.wu-wien.ac.at> * configure.in, include/htconfig.h.in: Added a configure test for the availability of the bool type. Fri Apr 30 20:00:09 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.h, htlib/HtDateTime.cc: Update with new versions sent by Gabriele. Fri Apr 30 19:30:42 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtRegex.h, htlib/HtRegex.cc: New class, contributed by Peter D. Gray <pdg at draci.its.uow.edu.au> as a small wrapper for system regex calls. * htlib/Makefile.in: Build it. * htdig/htdig.h: Use it if REGEX is defined. * htdig/htdig.cc: Ditto. * htdig/Retriever.cc: Ditto. * htsearch/Display.cc(generateStars): Remove extra newline after STARSRIGHT and STARSLEFT variables, noted by Torsten Neuer <tneuer at inwise.de>. Fri Apr 30 18:52:56 1999 Alexander Bergolth <leo at leo.wu-wien.ac.at> * htlib/URL.cc(ServerAlias): port for server_aliases entries now defaults to 80 if omitted. Wed Apr 28 19:57:38 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtDateTime.h, htlib/HtDateTime.cc: New class, contributed by Gabriele. * htlib/Makefile.in: Compile it. * README: Update message from 3.1.0 (oops!) to 3.2.0, remove rx directory. * installdir/htdig.conf: Add example of no_excerpt_show_top attribute in line with most user's expectations. * contrib/README: Mention contributed section of the website. * Makefile.in: Ignore mailarchive directory--now removed from CVS. Wed Apr 28 10:46:31 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htmerge/db.cc(mergeDB): fix a few errors in how the merge index name is obtained. Tue Apr 27 23:00:39 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * Makefile.config.in: Remove now-useless LIBDIRS variable. * mailarchive/Split.java, mailarchive/htdig: Remove ancient mailarchive stuff. Tue Apr 27 18:01:52 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(setupImages): Remove code setting URLimage to a bogus pattern (remnant left over after merge). Tue Apr 27 16:43:08 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc(RetrieveHTTP): Show "Unable to build connection" message at lower debug level. Tue Apr 27 11:24:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.h: Remove sort, compare functions re-introduced in merge. Moved to ResultMatch by Hans-Peter's April 19th chnages. * htsearch/Display.cc: Remove bogus call to ResultMatch:setRef, removed by Hans-Pater's April 19th changes. Sat Apr 24 21:08:35 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * Merge in changes from 3.1.2 (see below). * htcommon/WordList.cc: Change valid_word to use iscntl(). * htdig/Plaintext.cc: Remove CVS Log. * htdig/Retriever.cc: Fix ancient bug with empty excludes list. * htlib/List.cc: Remove CVS Log, use more succinct test for out-of-bounds. * htsearch/Display.cc: Fix logic with starPatterns, only show top of META description. * htsearch/Display.h: Introduce headers needed for sort functionality. * installdir/htdig.conf: Add example max_doc_size attribute as well as example for including start_url from a file. * htdoc/ChangeLog, htdoc/RELEASE.html, htdoc/FAQ.html, htdoc/where.html, htdoc/cf_byname.html, htdoc/cf_byprog.html, htdoc/uses.html, htdoc/contents.html, htdoc/mailarchive.html: Merge in documentation updates from 3.1.2. Sat Apr 24 15:18:45 1999 Hans-Peter Nilsson <hp at bitrange.com> * htsearch/Display.cc (sort): Return immediately if <= 1 items to sort. Mon Apr 19 00:53:06 1999 Hans-Peter Nilsson <hp at bitrange.com> * htsearch/ResultMatch.h (create): New. All (the only) ctor caller changed to use this. (setRef, getRef): Removed. Callers changed to use nearby data. (incomplete): Removed. (setIncompleteScore): Renamed to... (setScore): ...this. All callers changed. (setSortType): New. (getTitle, getTime, setTitle, setTime, getSortFun): New virtual functions. (enum SortType): Moved from Display, private. (mySortType): New static member. * htsearch/ResultMatch.cc (mySortType): Define static member variable. (getScore): Remove handling of "incomplete". Moved to ResultMatch.h (getTitle, getTime, setTitle, setTime): New dummy functions. (class ScoreMatch, class TimeMatch, class IDMatch, class TitleMatch): Derived classes with compare functions (from Display) and extra sort-method-related members, as needed. (setSortType): New, mostly moved from Display. (create): New. * htsearch/Display.h: Changed first argument from ResultMatch * to DocumentRef *. (compare, compareTime, compareID, compareTitle, enum SortType, sortType): Removed. * htsearch/Display.cc (display): Call ResultMatch::setSortType and output syntax error page for invalid sort methods. (displayMatch): Change first argument from ResultMatch * to DocumentRef *ref. All callers changed. (buildMatchList): Remove call to sortType and typ variable. Always call (ResultMatch::)setTime and setTitle. Remove extra call to setID. (sort): Call (ResultMatch::)getSortFun for qsort compare function. (compare, compareTime, compareID, compareTitle, sortType): Removed. Wed Apr 14 21:21:35 1999 Alexander Bergolth <leo at leo.wu-wien.ac.at> * htlib/regex.c: fixed compile problem with AIX xlc compiler * htlib/HtHeap.h: fixed compile problem with AIX xlc compiler (bool) * htlib/HtVector.h: ditto * htsearch/Display.cc: fixed typo Wed Apr 14 00:17:06 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.h: Add compareID for sorting results by DocID. * htsearch/Display.cc: As above. Tue Apr 13 23:50:28 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/defaults.cc: Add new config option use_doc_date to use document meta information for the DocTime() field. * htdig/HTML.cc(do_tag): Call Retriever::got_time if use_doc_date is set and we run across a META date tag. * htdig/Retriever.h, htdig/Retriver.cc: Add new got_date function. When called, sets the DocTime field of the DocumentRef after parsing is completed. Currently assumes ISO 8601 format for the date tag. Sun Apr 11 12:51:39 1999 Hans-Peter Nilsson <hp at bitrange.com> * htsearch/Display.cc (buildMatchList): Delete thisRef if excluded by URL. Call setRef(NULL), not setRef(thisRef). Wed Apr 7 19:35:42 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc(usage): Remove bogus -w flag. Thu Apr 1 12:05:11 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/htsearch.cc(main): Apply Gabriele's patch to avoid using an invalid matchesperpage CGI input variable. * htsearch/Display.cc(display) & (setVariables): Correct any invalid values for matches_per_page attribute to avoid div. by 0 error. Wed Mar 31 15:19:25 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htfuzzy/Synonym.cc: Fix previous fix of minor memory leak. (db pointer wasn't properly set) Mon Mar 29 10:31:09 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/Display.cc(excerpt): Added patch from Gabriele to improve display of excerpts--show top of description always, otherwise try to find the excerpt. Sun Mar 28 19:45:02 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtWordType.h (HtIsWordChar): Avoid matching 0 when using strchr. (HtIsStrictWordChar): Ditto. * htdig/ExternalParser.cc (parse): Before got_href call, set hopcount of URL to that of base plus 1. Add URL to external parser error output. * htlib/URL.cc (URL(char *ref, URL &parent) ): Move call to constructURL call inside previous else-clause. (parse): Reset _normal, _signature, _user initially. Commence parsing, even if no "//" is found. Do not set _normal here. (normalizePath): Call removeIndex finally. * htcommon/WordRecord.h (WORD_RECORD_COMPRESSED_FORMAT) [!NO_WORD_COUNT]: Change to "cu4". * htlib/HtPack.cc (htPack): Correct handling at end of code-string and end of encoding-byte. Add code 'c' for often-1 unsigned ints. (htUnpack): Add handling of code 'c'. Thu Mar 25 12:18:05 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * installdir/long.html, installdir/short.html: Remove backslashes before quotes in HTML versions of the builtin templates. * Makefile.in: Add long.html & short.html to COMMONHTML list, so they get installed in common_dir. Thu Mar 25 11:56:50 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(displayMatch), htcommon/defaults.cc, htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Add date_format attribute suggested by Marc Pohl. Thu Mar 25 09:46:07 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(displayMatch): Avoid segfault when DocAnchors list has too few entries for current anchor number. Tue Mar 23 15:08:40 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(displayMatch): Fix problem when documents did not have descriptions. Tue Mar 23 14:17:14 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/PDF.cc(parseString): Use minimum_word_length instead of hardcoded constant. Tue Mar 23 14:02:40 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc: Fix bug where noindex_start was empty, allow case insensitive matching of noindex_start & noindex_end. * htdoc/attrs.html, htdoc/cf_byname.html, htdoc/cf_byprog.html: Fix inconsistencies in documentation for noindex_start & noindex_end. Tue Mar 23 14:01:16 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc: Add check for <a href=...> tag that is missing a closing </a> tag, terminating it at next href. Tue Mar 23 13:57:35 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Document.cc: Fix check of Content-type header in readHeader(), correcting bug introduced Jan 10 (for PR#91), and check against allowed external parsers. Tue Mar 23 13:54:35 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc: More lenient comment parsing, allows extra dashes. Tue Mar 23 12:22:53 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htlib/Configuration.cc(Add): Fix function to avoid infinite loop on some systems, which don't allow all the letters in isalnum() that isalpha() does, e.g. accented ones. * htdig/HTML.cc: Fix three reported bugs about inconsistent handling of space and punctuation in title, href description & head. Now makes destinction between tags that cause word breaks and those that don't, and which of the latter add space. Tue Mar 23 12:15:48 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/Plaintext.cc(parse): Use minimum_word_length instead of hardcoded constant. Tue Mar 23 12:11:04 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htmerge/words.cc(mergeWords): Fix to prevent description text words from clobbering anchor number of merged anchor text words. Tue Mar 23 12:02:00 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/Display.cc(generateStars): Add in support for use_star_image which was lost when template support was put in way back when. Tue Mar 23 11:47:52 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * Makefile.in: add missing ';' in for loops, between fi & done Mon Mar 22 16:06:15 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htdig/HTML.cc: Check for presence of more than one <title> tag. Mon Mar 22 15:32:15 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrib/parse_doc.pl: Fix handling of minimum word length. Sun Mar 21 15:19:00 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtPack.cc (htPack): New. * htlib/HtPack.h: New. * htsearch/parser.cc (perform_push): Unpack WordRecords using htUnpack. * htsearch/htsearch.h: Add "debug" declaration. * htmerge/words.cc (mergeWords): Pack WordRecords using htPack. * htlib/Makefile.in (OBJS): Add HtPack.o * htcommon/WordRecord.h: Add WORD_RECORD_COMPRESSED_FORMAT * htdig/HTML.cc (parse): Keep contents in String variable textified_contents while using its "char *". * htsearch/Display.cc (excerpt): Similar for head_string. Thu Mar 18 20:01:24 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * installdir/long.html, installdir/short.html: Write out HTML versions of the builtin templates. * installdir/htdig.conf: Add commented-out template_map and template_name attributes to use the on-disk versions. Tue Mar 16 03:06:06 1999 Hans-Peter Nilsson <hp at bitrange.com> * htcommon/DocumentDB.cc (Delete): Fix bad parameter to Get: use key, not DocID. Tue Mar 16 01:50:16 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtWordType.h (class HtWordType): New. * htlib/HtWordType.cc: New. * htlib/Makefile.in (OBJS): Add HtWordType.o * htdoc/attrs.html: Document attribute extra_word_characters. * htdoc/cf_byprog.html: Ditto. * htdoc/cf_byname.html: Ditto. * htcommon/defaults.cc (defaults): Add extra_word_characters. * htsearch/htsearch.h: Lose spurious extern declaration of unused variable valid_punctuation. * htsearch/htsearch.cc (main): Call HtWordType::Initialize. (setupWords): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htsearch/Display.cc (excerpt): Use HtIsStrictWordChar. * htlib/StringMatch.cc (FindFirstWord): Ditto. (CompareWord): Ditto. * htdig/htdig.cc (main): Call HtWordType::Initialize. * htdig/Retriever.h (class Retriever): Lose member valid_punctuation. * htdig/Retriever.cc (Retriever): Lose its initialization. * htdig/Postscript.h (class Postscript): Lose member valid_punctuation. * htdig/Postscript.cc (Postscript): Lose its initialization. (flush_word): Use HtStripPunctuation. (parse_string): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. * htdig/Parsable.h (class Parsable): Lose member valid_punctuation. * htdig/Parsable.cc (Parsable): Lose its initilization. * htcommon/WordList.cc (valid_word): Use HtIsStrictWordChar. (BadWordFile): Use HtStripPunctuation. Do not read valid_punctuation. * htcommon/DocumentRef.cc (AddDescription): Use HtIsWordChar, HtIsStrictWordChar and HtStripPunctuation. Do not read valid_punctuation. * htdig/PDF.cc (parseString): Similar.. * htdig/HTML.cc (parse): Similar. * htdig/Plaintext.cc (parse): Similar. Sun Mar 14 14:04:31 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Makefile.in: Add HtSGMLEntites.o to OBJS. Sat Mar 13 21:29:38 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htcommon/DocumentDB.cc(Open, Read): Switch to DB_HASH for faster access. Most important for very quick URL lookups! * htcommon/DocumentRef.cc(AddDescription): Check to see that description isn't a null string or contains only whitespace before doing anything. * htlib/HtSGMLCodec.h, htlib/HtSGMLCodec.cc: Add new class to convert between SGML entities and high-bit characters. * htdig/HTML.cc(parse): Use it instead of SGMLEntities. * htsearch/Display.cc(excerpt): Use HtSGMLCodec to covert *back* to SGML entities before displaying. * htlib/HtHeap.cc: Cleaned up comments, use more efficient procedure to build from a vector. * htlib/HtWordCodec.cc(HtWordCodec): Fix bug with constructing from uninitialized variables! * htlib/URL.h, htlib/URL.cc: Initial support for multiple schemes and user@host URLs. * htlib/List.cc(Nth): Check for out-of-bounds requests before doing anything. Fri Mar 12 00:31:03 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/mktime.c (__mon_yday): Correct size to number of initializers (2). * htsearch/htsearch.cc (main): Remove doc_index handling. * htsearch/ResultMatch.h (setURL): Change to setID, use int. All callers changed. (getURL): Change to getID. All callers changed. (String url): Change to "int id". * htsearch/Display.h: (Display): Second parameter removed. (docIndex) removed. * htsearch/Display.cc (Display, ~Display): Do not handle docIndex. (display): Use DocumentDB::operator [](int), not DocumentDB::operator [] (char *). (buildMatchList): Changed to handle ResultMatch as DocID int, instead of URL string: use DocumentDB::operator [](int), not DocumentDB::operator [] (char *). Get DocumentRef directly, then filter the URL by includeURL(). * htnotify/htnotify.cc (main): Use DocIDs(), not DocURLs(). Handle the change from String * to IntObject *. * htmerge/htmerge.cc (main): Do not delete doc_index. * htmerge/docs.cc (convertDocs): Test doc_index access as read-only. Pass as parameter for docdb, do not handle separately. * htmerge/docs.cc (convertDocs): Add debug messages about cause when deleting documents. If verbose > 1, write id/URL for every URL. * htmerge/db.cc (mergeDB): Handle doc_index, test accessibility. * htlib/IntObject.h (class IntObject): Add int-constructor. * htdoc/attrs.html (doc_index): Say that mapping is from document URLs to numbers. (doc_db): Say that indexing is on document number. * htdoc/cf_byprog.html (doc_index): Move from htsearch to htdig entry. * htdig/htdig.cc (main): Add .work suffix to doc_index too. Unlink doc_index if initial. * htcommon/DocumentDB.h (Open): New second argument. (Read): New second argument, default to 0. (operator [](int)): New. (Exists(char *), Delete(char *)): Change to int parameter. (DocIDs, i_dbf): New. * htcommon/DocumentDB.cc (operator [](int)): New. (Exists(char *), Delete(char *)): Changed to DocID int parameter. All callers changed. (URLs): Assume keys are ok without probing for documents with each key. (DocIDs): New. (Open): Take an index database file name as second argument. All callers changed. (Read): Similar, accept 0. (all): Change to index on DocID. Wed Mar 10 02:25:24 1999 Hans-Peter Nilsson <hp at bitrange.com> * htdoc/attrs.html (template_name): Typo; used by htsearch, not htdig. Mon Mar 8 13:30:44 1999 Hans-Peter Nilsson <hp at bitrange.com> * htdig/Retriever.cc (got_href): Check if the ref is for the current document before adding it to the db. Mon Mar 8 01:36:38 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/DB2_db.cc: Remove errno. * htlib/DB2_hash.cc: Ditto. Sun Mar 7 20:50:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htfuzzy/EndingsDB.cc(createDB): Use link and unlink to move, rather than a non-portable system call. * htcommon/DocumentRef.h, htcommon/DocumentRef.cc: Fix #ifdef problems with zlib. Sun Mar 7 09:39:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/timegm.c: Fix problems compiling on libc5 systems noted by Hans-Peter. * htlib/Makefile.in, Makefile.in, Makefile.config.in: Use regex.c instead of rx. * htfuzzy/EndingsDB.cc: Ditto. * configure.in, configure: Don't bother to config rx directory. Fri Mar 5 08:09:20 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * contrig/parse_doc.pl: uses pdftotext to handle PDF files, generates a head record with punctuation intact, extra checks for file "wrappers" & check for MS Word signature (no longer defaults to catdoc), strip extra punct. from start & end of words, rehyphenate text from PDFs. Tue Mar 2 23:18:20 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htdig/htdig.cc: Renamed main.cc for consistency with other programs. * htlib/DB2_hash.h, htlib/DB2_hash.cc: Added interface to Berkeley hash database format. * htlib/Makefile.in: Use them! * htlib/Database.h: Define database types, allowing a choice between different formats. * htlib/Database.cc(getDatabaseInstance): Use passed type to pick between subclasses. Currently only uses Hash and B-Tree formats of Berkeley DB. * htcommon/DocumentDB.cc, htfuzzy/Endings.cc, htfuzzy/EndingsDB.cc, htfuzzy/Fuzzy.cc, htfuzzy/Prefix.cc, htfuzzy/Substring.cc, htfuzzy/Synonym.cc, htfuzzy/htfuzzy.cc, htmerge/docs.cc, htmerge/words.cc, htsearch/Display.cc, htsearch/htsearch.cc: Use new form of getDatabaseInstance(), currently with DB_BTREE option (for compatibility). Mon Mar 1 22:53:37 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/regex.c, htlib/striptime.c: Import new versions from glibc. * htlib/Makefile.in, htlib/mktime.c, htlib/timegm.c, htlib/lib.h: Changes to use glibc timegm() function instead of buggy mytimegm(). * htdig/Document.cc(getdate): Use it. Tue Mar 2 02:35:50 1999 Hans-Peter Nilsson <hp at bitrange.com> * attrs.html: Rephrase and clarify entry for url_part_aliases. Sun Feb 28 23:25:40 1999 Hans-Peter Nilsson <hp at bitrange.com> * htlib/HtURLCodec.cc (~HtURLCodec): Add missing deletion of myWordCodec. Fri Feb 26 19:03:58 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * configure, configure.in: Fix typo on timegm test. * htlib/mytimegm.cc: Fix Y2K problems. Wed Feb 24 21:09:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc(main): Remember to delete the parser! * htlib/String.cc(String(char *s, int len)): Remove redundant copy. * htsearch/Display.cc(display): Free DocumentRef memory after displaying them. (displayMatch): Fix memory leak when documents did not have anchors. Wed Feb 24 15:18:26 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Configuration.cc(Add): Fix small leak in locale code. * htlib/String.cc: Fix up code to be cleaner with memory allocation, inline next_power_of_2. Mon Feb 22 22:13:49 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/String.cc, htlib/htString.h: Fix some memory leaks. Mon Feb 22 08:52:19 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/Dictionary.h, htlib/Dictionary.cc(hashCode): Check if key can be converted to an integer using strtol. If so, use the integer as the hash code. * htlib/HtVector.h, htlib/HtVector.cc: Implement Release() method and make sure delete calls are done properly. * htsearch/ResultList.h, htsearch/ResultList.cc(elements): Use HtVector instead of List. * htsearch/parser.cc: Ditto. Sun Feb 21 16:13:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtHeap.h, htlib/HtHeap.cc: Add new class. * htlib/Makefile.in: Compile it. * htlib/HtVector.h, htlib/HtVector.cc: Add Assign() to assign to elements of vectors. Sun Feb 21 14:45:26 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htsearch/htsearch.cc: Add patch from Jerome Alet <alet at unice.fr> to allow '.' in config field but NOT './' for security reasons. * htdig/HTML.cc: Add patch from Gabriele to ensure META descriptions are parsed, even if 'description' is added to the keyword list. Sun Feb 21 14:43:44 1999 Gilles Detillieux <grdetil at scrc.umanitoba.ca> * htsearch/parser.h, htsearch/parser.cc: Clean up patch made for error messages, made on Feb 16. Thu Feb 18 20:19:30 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * htlib/HtVector.h, htlib/HtVector.cc: Added new Vector class. * htlib/Makefile.in: Compile it. * htlib/strptime.c: Add new version from glibc-2.1, replacing strptime.cc. * htdig/Document.cc: Use it. * htlib/regex.h, htlib/regex.c: Add new files from glibc-2.1. * htlib/mktime.c: Update from glibc-2.1. Wed Feb 17 23:44:59 1999 Geoff Hutchison <ghutchis at wso.williams.edu> * configure.in, configure, aclocal.m4: Add autoconf macro to detect syntax of makefile includes. * Makefile.in, Makefile.config.in, */Makefile.in: Change include syntax to use it. Wed Feb 17 12:36:42 1999 Hans-Peter Nilsson <hp at bitrange.com> * htcommon/defaults.cc (defaults): locale: change to "C". Local Variables: add-log-time-format: current-time-string End: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������htdig-3.2.0b6/htdoc/FAQ.html������������������������������������������������������������������������0100644�0063146�0012731�00000417173�10055635544�015005� 0����������������������������������������������������������������������������������������������������ustar �angusgb�������������������������htdig������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>ht://Dig Frequently Asked Questions

    Frequently Asked Questions

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    This FAQ is compiled by the ht://Dig developers and the most recent version is available at <http://www.htdig.org/FAQ.html>. Questions (and answers!) are greatly appreciated. Please send questions and/or answers to the ht://Dig user mailing list at: <htdig-general@lists.sourceforge.net>.

    Questions

    1. General

    1.1. Can I search the internet with ht://Dig?
    1.2. Can I index the internet with ht://Dig?
    1.3. What's the difference between htdig and ht://Dig?
    1.4. I sent mail to Andrew or Geoff or Gilles, but I never got a response!
    1.5. I sent a question to the mailing list but I never got a response!
    1.6. I have a great idea/patch for ht://Dig!
    1.7. Is ht://Dig Y2K compliant?
    1.8. I think I found a bug. What should I do?
    1.9. Does ht://Dig support phrase or near matching?
    1.10. What are the practical and/or theoretical limits of ht://Dig?
    1.11. Do any ISPs offer ht://Dig as part of their web hosting services?
    1.12. Can I use ht://Dig on a commercial website?
    1.13. Why do you use a non-free product to index PDF files?
    1.14. Why do you have all those SourceForge logos on your website?
    1.15. My question isn't answered here. Where should I go for help?
    1.16. Why do the developers get annoyed when I e-mail questions directly to them rather than the mailing list?
    1.17. Why do replies to messages on the mailing list only go to the sender and not to the list?
    1.18. Can I use ht://Dig to index and search an SQL database?

    2. Getting ht://Dig

    2.1. What's the latest version of ht://Dig?
    2.2. Are there binary distributions of ht://Dig?
    2.3. Are there mirror sites for ht://Dig?
    2.4. Is ht://Dig available by ftp?
    2.5. Are patches around to upgrade between versions?
    2.6. Is there a Windows 95/98/2000/NT version of ht://Dig?
    2.7. Where can I find the documentation for my version of ht://Dig?

    3. Compiling

    3.1. When I compile ht://Dig I get an error about libht.a.
    3.2. I get an error about -lg
    3.3. I'm compiling on Digital Unix and I get mesages about "unresolved" and "db_open."
    3.4. I'm compiling on FreeBSD and I get lots of messages about '___error' being unresolved.
    3.5. I'm compiling on HP/UX and I get a complaint about "Large Files not supported."
    3.6. I'm compiling on Solaris and when I run the programs I get complaints about not finding libstdc++.
    3.7. I'm compiling on IRIX and I'm having database problems when I run the program.
    3.8. I'm compiling with gcc 3.2 and getting all sorts of warnings/errors about ostream and such.

    4. Configuration

    4.1. How come I can't index my site?
    4.2. How can I change the output format of htsearch?
    4.3. How do I index pages that start with '~'?
    4.4. Can I use multiple databases?
    4.5. OK, I can use multiple databases. Can I merge them into one?
    4.6. Wow, ht://Dig eats up a lot of disk space. How can I cut down?
    4.7. Can I use SSI or other CGIs in my htsearch results?
    4.8. How do I index Word, Excel, PowerPoint or PostScript documents?
    4.9. How do I index PDF files?
    4.10. How do I index documents in other languages?
    4.11. How do I get rotating banner ads in search results?
    4.12. How do I index numbers in documents?
    4.13. How can I call htsearch from a hypertext link, rather than from a search form?
    4.14. How do I restrict a search to only meta keywords entries in documents?
    4.15. Can I use meta tags to prevent htdig from indexing certain files?
    4.16. How do I get htsearch to use the star image in a different directory than the default /htdig?
    4.17. How do I get htdig or htsearch to rewrite URLs in the search results?
    4.18. What are all the options in htdig.conf, and are there others?
    4.19. How do I get more than 10 pages of 10 search results from htsearch?
    4.20. How do I restrict a search to only certain subdirectories or documents?
    4.21. How can I allow people to search while the index is updating?
    4.22. How can I get htdig to ignore the robots.txt file or meta robots tags?
    4.23. How can I get htdig not to index some directories, but still follow links?
    4.24. How can I get rid of duplicates in search results?
    4.25. How can I change the scores in search results, and what are the defaults?
    4.26. How can I get htdig not to index JavaScript code or CSS?

    5. Troubleshooting

    5.1. I can't seem to index more than X documents in a directory.
    5.2. I can't index PDF files.
    5.3. When I run "rundig," I get a message about "DATABASE_DIR" not being found.
    5.4. When I run htmerge, it stops with an "out of diskspace" message.
    5.5. I have problems running rundig from cron under Linux.
    5.6. When I run htmerge, it stops with an "Unexpected file type" message.
    5.7. When I run htsearch, I get lots of Internal Server Errors (#500).
    5.8. I'm having problems with indexing words with accented characters.
    5.9. When I run htmerge, it stops with a "Word sort failed" message.
    5.10. When htsearch has a lot of matches, it runs extremely slowly.
    5.11. When I run htsearch, it gives me a count of matches, but doesn't list the matching documents.
    5.12. I can't seem to index documents with names like left_index.html with htdig.
    5.13. I get Premature End of Script Headers errors when running htsearch.
    5.14. I get Segmentation faults when running htdig, htsearch or htfuzzy.
    5.15. Why does htdig 3.1.3 mangle URL parameters that contain bare "&" characters?
    5.16. When I run htmerge, it stops with an "Unable to open word list file '.../db.wordlist'" message.
    5.17. When using Netscape, htsearch always returns the "No match" page.
    5.18. Why doesn't htdig follow links to other pages in JavaScript code?
    5.19. When I run htsearch from the web server, it returns a bunch of binary data.
    5.20. Why are the betas of 3.2 so slow at indexing?
    5.21. Why does htsearch use ";" instead of "&" to separate URL parameters for the page buttons?
    5.22. Why does htsearch show the "&" character as "&amp;" in search results?
    5.23. I get Internal Server or Unrecognized character errors when running htsearch.
    5.24. I took some settings out of my htdig.conf but they're still set.
    5.25. When I run htdig on my site, it misses entire directories.
    5.26. What do all the numbers and symbols in the htdig -v output mean?
    5.27. Why is htdig rejecting some of the links in my documents?
    5.28. When I run htdig or htmerge, I get a "DB2 problem...: missing or empty key value specified" message.
    5.29. When I run htdig on my site, it seems to go on and on without ending.
    5.30. Why does htsearch no longer recognize the -c option when run from the web server?
    5.31. I've set a config attribute exactly as documented but it seems to have no effect.
    5.32. When I run htsearch, it gives a page with an "Unable to read configuration file" message.
    5.33. How can I find out which version of ht://Dig I have installed?
    5.34. When running htdig, I get "Error (0): PDF file is damaged - attempting to reconstruct xref table..."
    5.35. When running htdig on Mandrake Linux, I get "host not found" and "no server running" errors.
    5.36. When I run htsearch, it gives me the list of matching documents, but no header or footer.
    5.37. When I index files with doc2html.pl, it fails with the "UNABLE to convert" error.
    5.38. Why do my searches find search terms in pathnames, or how do I prevent matching filenames?
    5.39. I set up an external parser but I still can't index Word/Excel/PowerPoint/PDF documents.

    Answers

    1. General

    1.1. Can I search the internet with ht://Dig?

    No, ht://Dig is a system for indexing and searching a finite (not necessarily small) set of sites or intranet. It is not meant to replace any of the many internet-wide search engines.

    1.2. Can I index the internet with ht://Dig?

    No, as above, ht://Dig is not meant as an internet-wide search engine. While there is theoretically nothing to stop you from indexing as much as you wish, practical considerations (e.g. time, disk space, memory, etc.) will limit this.

    1.3. What's the difference between htdig and ht://Dig?

    The complete ht://Dig package consists of several programs, one of which is called "htdig." This program performs the "digging" or indexing of the web pages. Of course an index doesn't do you much good without a program to sort it, search through it, etc.

    1.4. I sent mail to Andrew or Geoff or Gilles, but I never got a response!

    Andrew no longer does much work on ht://Dig. He has started a company, called Contigo Software and is quite busy with that. To contact any of the current developers, send mail to <htdig-dev>. This list is intended primarily for the discussion of current and future development of the software.

    Geoff and Gilles are currently the maintainers of ht://Dig, but they are both volunteers. So while they do read all the e-mail they receive, they may not respond immediately. Questions about ht://Dig in general, and especially questions or requests for help in configuring the software, should be posted to the <htdig-general> mailing list. When posting a followup to a message on the list, you should use the "reply to all" or "group reply" feature of your mail program, to make sure the mailing list address is included in the reply, rather than replying only to the author of the message. See also question 1.16 and the mailing list page.

    1.5. I sent a question to the mailing list but I never got a response!

    Development of ht://Dig is done by volunteers. Since we all have other jobs, it make take a while before someone gets back to you. Please be patient and don't hound the volunteers with direct or repeated requests. If you don't get a response after 3 or 4 days, then a reminder may help. See also question 1.16.

    1.6. I have a great idea/patch for ht://Dig!

    Great! Development of ht://Dig continues through suggestions and improvements from users. If you have an idea (or even better, a patch), please send it to the ht://Dig mailing list so others can use it. For suggestions on how to submit patches, please check the Guidelines for Patch Submissions. If you'd like to make a feature request, you can do so through the ht://Dig bug database

    1.7. Is ht://Dig Y2K compliant?

    ht://Dig should be y2k compliant since it never stores dates as two-digit years. Under ht://Dig's copyright (GPL), there is no warranty whatsoever as permitted by law. If you would like an iron-clad, legally-binding guarantee, feel free to check the source code itself. Versions prior to 3.1.2 did have a problem with the parsing of the Last-Modified header returned by the HTTP server, which will cause incorrect dates to be stored for documents modified after February 28, 2000 (yes, it didn't recognize 2000 as a leap year). Versions prior to 3.1.5 didn't correctly handle servers that return two digit years in the Last-Modified header, for years after 99. These problems are fixed in the current release. If you discover something else, please let us know!

    1.8. I think I found a bug. What should I do?

    Well, there are probably bugs out there. You have two options for bug-reporting. You can either mail the ht://Dig mailing list at <htdig-general@lists.sourceforge.net> or better yet, report it to the bug database, which ensures it won't become lost amongst all of the other mail on the list. Please try to include as much information as possible, including the version of ht://Dig (see question 5.33), the OS, and anything else that might be helpful. Often, running the programs with one "-v" or more (e.g. "-vvv") gives useful debugging information. If you are unsure whether the problem is a bug or a configuration problem, you should discuss the problem on <htdig-general> (after carefully reading the FAQ and searching the mail archive and patch archive, of course) to sort out what it is. The mailing list has a wider audience, so you're more likely to get help with configuration problems there than by reporting them to the bug database.

    Whether reporting problems to the bug database or mailing list, we cannot stress enough the importance of always indicating which version of ht://Dig you are running. See question 5.33. There are still a lot of users, ISPs and software distributors using older versions, and there have been a lot of bug fixes and new features added in recent versions. Knowing which version you're running is absolutely essential in helping to find a solution. If you're unsure if your version is current, or what fixes and features have been added in more recent versions, please see the release notes. See also question 2.1.

    1.9. Does ht://Dig support phrase or near matching?

    Phrase searching has been added for the 3.2 release, which is currently in the beta phase (3.2.0b6 as of this writing). Near or proximity matching will probably be added in a future beta.

    1.10. What are the practical and/or theoretical limits of ht://Dig?

    The code itself doesn't put any real limit on the number of pages. There are several sites in the hundreds of thousands of pages. As for practical limits, it depends a lot on how many pages you plan on indexing. Some operating systems limit files to 2 GB in size, which can become a problem with a large database. There are also slightly different limits to each of the programs. Right now htmerge performs a sort on the words indexed. Most sort programs use a fair amount of RAM and temporary disk space as they assemble the sorted list. The htdig program stores a fair amount of information about the URLs it visits, in part to only index a page once. This takes a fair amount of RAM. With cheap RAM, it never hurts to throw more memory at indexing larger sites. In a pinch, swap will work, but it obviously really slows things down.

    The 3.2 development code helps with many of these limitations. In paticular, it generates the databases on the fly, which means you don't have to sort them before searching. Additionally, the new databases are compressed significantly, making them usually around 50% the size of those in previous versions.

    1.11. Do any ISPs offer ht://Dig as part of their web hosting services?

    Yes. A list of such ISPs is available here

    1.12. Can I use ht://Dig on a commercial website?

    Sure! The GNU Library General Public License (LGPL) has no restrictions on use. So you are free to use ht://Dig however you want on your website, personal files, etc. The license only restricts distribution. So if you're planning on a commercial software product that includes ht://Dig, you will have to provide source code including any modifications upon request.

    1.13. Why do you use a non-free product to index PDF files?

    We don't. You can use the "acroread" program to index PDF files, but this is no longer recommended. Initially this program was the only reliable way to extract data from PDF files. However, the xpdf package is a reliable, free software package for indexing and viewing PDF files. See question 4.9 for details on using xpdf to index PDF files. We do not advocate using acroread any longer because it is a proprietary product. Additionally it is no longer reliable at extracting data.

    1.14. Why do you have all those SourceForge logos on your website?

    SourceForge is a new service for open source software. You can host your project on SourceForge servers and use many of their services like bug-tracking and the like. The ht://Dig project currently uses SourceForge for a mirror of the main website at htdig.sourceforge.net as well as a mirror of ht://Dig releases and contributed work.

    1.15. My question isn't answered here. Where should I go for help?

    Before you go anywhere else, think of other ways of phrasing your question. Many times people have questions that are very similar to other FAQ and while we try to phrase the queries in the FAQ closely to the most common questions, we obviously can't get them all! The next place to check is the documentation itself. In particular, take a look at the list of configuration attributes, particularly the list by name and by program. There are a lot of them, but chances are there's something that might fit your needs. You should also take a close look at all of htsearch's documentation, especially the section "HTML form" which describes all the CGI input parameters available for controlling the search, including limiting the search to certain subdirectories. You can find the answer yourself to almost all "how can I..." questions by exploring what the various configuration attributes and search form input parameters can do. Also have a look at our collection of Contributed Guides for help on things like HTML forms and CGI, tutorials on installing, configuring, using, and internationalizing ht://Dig, as well as using PHP with htsearch.

    Finally, if you've exhausted all the online documentation, there's the htdig-general mailing list. There are hundreds of users subscribed and chances are good that someone has had a similar problem before or can suggest a solution.

    1.16. Why do the developers get annoyed when I e-mail questions directly to them rather than the mailing list?

    The htdig-general mailing list exists for dealing with questions about the software, its installation, configuration, and problems with it. E-mailing the developers directly circumvents this forum and its benefits. Most annoyingly, it puts the onus on an individual to answer, even if that individual is not the best or most qualified person to answer. This is not a one-man show. It also circumvents the archiving mechanism of the mailing list, so not only do subscribers not see these private messages and replies, but future users who may run into the exact same problems won't see them. Remember that the developers are all volunteers, and they don't work for free for your benefit alone. They volunteer for the benefit of the whole ht://Dig user community, so don't expect extra support from them outside of that community. See also questions 1.4 and 1.5.

    Note also that when you reply to a message on the list, you should make sure the reply gets on the list as well, provided your reply is still on-topic. See question 1.17 below.

    1.17. Why do replies to messages on the mailing list only go to the sender and not to the list?

    The simple answer is that, unlike some mailing lists, the lists on SourceForge don't force replies back on the list. This is actually a good thing, because you can reply to the sender directly if you want to, or you can use your mail program's "reply to all" capability (sometimes called "group reply") to reply to the mailing list as well. It does mean you have to think before you post a reply, but some would argue that this is a good thing too. There are some compelling reasons to try to keep on-topic discussions on the list, though (see questions 1.16 and 1.4 above).

    The technical answer is SourceForge's policy on Reply-To: munging, where you'll find all the gory details about the pros and cons of the two common ways of setting up a mailing list, and why SourceForge turns off Reply-To munging. It so happens that the ht://Dig maintainers agree with SourceForge's policy on this, even if we did have a say in the matter. So, counterarguments to this policy are rather moot, and it would be better not to waste any more mailing list bandwidth debating them. (We've heard all the arguments anyway.)

    1.18. Can I use ht://Dig to index and search an SQL database?

    You can if your database has a web-based front end that can be "spidered" by ht://Dig. The requirement is that every search result must resolve to a unique URL which can be accessed via HTTP. The htdig program uses these URLs, which you feed it via the start_url attribute, to fetch and index each page of information. The search results will then give a list of URLs for all pages that match the search terms. If you don't have such a front end to your database, or the search results must be given as something other than URLs, then ht://Dig is probably not the best way of dealing with this problem: you may be better off using an SQL query engine that works directly on your own database, rather than building a separate ht://Dig database for searching.

    Ted Stresen-Reuter had the following tips: "In my case, because I like htdig's ability to rank results (and that ranking can be modified), I created an index page that simply walks through each record and indexes each record (with next and previous links so the spider can read all the records). And then I do one other thing: I make the <title> tag start with the unique ID of each record. Then, when I'm parsing the search results, I do a lookup on the database using the title tag as the key."


    2. Getting ht://Dig

    2.1. What's the latest version of ht://Dig?

    The latest version is 3.1.6 as of this writing. A beta version of the 3.2 code, 3.2.0b6, is also available, for those who wish to test it. You can find out about the latest version by reading the release notes.

    Note that if you're running any version older than 3.1.5 (including 3.2.0b1) on a public web site, you should upgrade immediately, as older versions have a rather serious security hole which is explained in detail in this advisory which was sent to the Bugtraq mailing list. Another slightly less serious, but still troubling security hole exists in 3.1.5 and older (including 3.2.0b3 and older), so you should upgrade if you're running one of these. You can view details on this vulnerability from the bugtraq mailing list. If you're unsure of which version you're running, see question 5.33.

    2.2. Are there binary distributions of ht://Dig?

    We're trying to get consistent binary distributions for popular platforms. Contributed binary releases will go in the contributed binaries section and contributions should be mentioned to the htdig-general mailing list.

    Anyone who would like to make consistent binary distributions of ht://Dig at least should signup to the htdig-announce mailing list.

    2.3. Are there mirror sites for ht://Dig?

    Yes, see our mirrors listing. If you'd like to mirror the site, please see the mirroring guide.

    2.4. Is ht://Dig available by ftp?

    Yes. You can find the current versions and several older versions at various <mirror sites> as well as the other locations mentioned in the download page.

    2.5. Are patches around to upgrade between versions?

    Most versions are also distributed as a patch to the previous version's source code. The most recent exception to this was version 3.1.0b1. Since this version switched from the GDBM database to DB2, the new database package needed to be shipped with the distribution. This made the potential patch almost as large as the regular distribution. Update patches resumed with version 3.1.0b2. You can also find archives of patches submitted to the htdig mailing lists, to fix specific bugs or add features, at Joe Jah's htdig-patches ftp site.

    2.6. Is there a Windows 95/98/2000/NT version of ht://Dig?

    The ht://Dig package can be built on the Win32 platform when using the Cygwin package. For details, see the contributed guide, Idiot's Guide to Installing ht://Dig on Win32.

    As of the 3.2.0b5 beta release, there is also native Win32 support, thanks to Neal Richter. (Installation docs will be written soon...)

    2.7. Where can I find the documentation for my version of ht://Dig?

    The documentation for the most recent stable release is always posted at www.htdig.org. The documentation for the latest beta release can be found at http://www.htdig.org/dev/htdig-3.2/. In all releases, the documentation is included in the htdoc subdirectory of the source distribution, so you always have access to the documentation for your current version.


    3. Compiling

    3.1. When I compile ht://Dig I get an error about libht.a

    This usually indicates that either libstdc++ is not installed or is installed incorrectly. To get libstdc++ or any other GNU too, check ftp://ftp.gnu.org/gnu/. Note that the most recent versions of gcc come with libstdc++ included and are available from http://gcc.gnu.org/

    3.2. I get an error about -lg

    This is due to a bug in the Makefile.config.in of version 3.1.0b1. Remove all flags "-ggdb" in Makefile.config.in. Then type "./config.status" to rebuild the Makefiles and recompile. This bug is fixed in version 3.1.0b2.

    3.3. I'm compiling on Digital Unix and I get mesages about "unresolved" and "db_open."

    Answer contributed by George Adams <learningapache@my-dejanews.com>

    What you're seeing are problems related to the Berkeley DB library. htdig needs a fairly modern version of db, which is why it ships with one that works. (see that -L../db-2.4.14/dist line? That's where htdig's db library is).
    The solution is to modify the c++ command so it explicity references the correct libdb.a . You can do this by replacing the "-ldb" directive in the c++ command with "../db-2.4.14/dist/libdb.a" This problem has been resolved as of version 3.1.0.

    3.4. I'm compiling on FreeBSD and I get lots of messages about '___error' being unresolved.

    Answer contributed by Laura Wingerd <laura@perforce.com>
    I got a clean build of htdig-3.1.2 on FreeBSD 2.2.8 by taking -D_THREAD_SAFE out of CPPFLAGS, and setting LIBS to null, in db/dist/configure.

    3.5. I'm compiling on HP/UX and I get a complaint about "Large Files not supported."

    The db/ pacakge, included with ht://Dig seems to be unable to complete on HP/UX 10.20 in particular. After running the top-level configure script, cd into db/dist and type:

    ./configure --disable-bigfile

    Then continue with the normal compilation.

    3.6. I'm compiling on Solaris and when I run the programs I get complaints about not finding libstdc++.

    Answer contributed by Adam Rice <adam@newsquest.co.uk>

    The problem is that the Solaris loader can't find the library. The best thing to do is set the LD_RUN_PATH environment variable during compile to the directory where libstdc++.so.2.8.1.1 lives. This tells the linker to search that directory at runtime.

    Note that LD_RUN_PATH is not to be confused with LD_LIBRARY_PATH. The latter is parsed at run-time, while LD_RUN_PATH essentially compiles in a library path into the executable, so that it doesn't need a LD_LIBRARY_PATH setting to find its libraries. This allows you to avoid all the complexities of setting an environment variable for a CGI program run from the server. If all else fails, you can always run your programs from wrapper shell scripts that set the LD_LIBRARY_PATH environment variable appropriately.

    Note also that while this answer is specific to Solaris, it may work for other OSes too, so you may want to give it a try. However, not all versions of the ld program on all OSes support the LD_RUN_PATH environment variable, even if these systems support shared libraries. Try "man ld" on your system to find out the best way of setting the runtime search path for shared libraries. If ld doesn't support LD_RUN_PATH, but does support the -R option, you can add one or more of these options to LIBDIRS in Makefile.config before running make on a 3.1.x release. (For a 3.2 beta release, you can add these options to the LDFLAGS environment variable before you run ./configure.)

    3.7. I'm compiling on IRIX and I'm having database problems when I run the program.

    It is not entirely clear why these problems occur, though they seem to only happen when older compilers are used. Several people have reported that the problems go away when using the latest version of gcc.

    3.8. I'm compiling with gcc 3.2 and getting all sorts of warnings/errors about ostream and such.

    With versions before 3.2.0b5, you should use the following command to configure the ht://Dig package so it can be built with gcc 3.2:

    CXXFLAGS=-Wno-deprecated CPPFLAGS=-Wno-deprecated ./configure
    


    4. Configuration

    4.1. How come I can't index my site?

    There are a variety of reasons ht://Dig won't index a site. To get to the bottom of things, it's advisable to turn on some debugging output from the htdig program. When running from the command-line, try "-vvv" in addition to any other flags. This will add debugging output, including the responses from the server.

    See also questions 5.25, 5.27, 5.16 and 5.18.

    4.2. How can I change the output format of htsearch?

    Answer contributed by: Malki Cymbalista <Malki.Cymbalista@weizmann.ac.il>

    You can change the output format of htsearch by creating different header, footer and result files that specify how you want the output to look. You then create a configuration file that specifies which files to use. In the html document that links to the search, you specify which configuration file to use.

    So the configuration file would have the lines:

    search_results_header: ${common_dir}/ccheader.html
    search_results_footer: ${common_dir}/ccfooter.html
    template_map:  Long long builtin-long \
                   Short short builtin-short \
                   Default default ${common_dir}/ccresult.html
    template_name: Default
    

    You would also put into the configuration file any other lines from the default configuration file that apply to htsearch.

    The files ${common_dir}/ccheader.html and ${common_dir}/ccfooter.html and ${common_dir}/ccresult.html would be tailored to give the output in the desired format.

    Assuming your configuration file is called cc.conf, the html file that links to the search has to set the config parameter equal to cc. The following line would do it:
    <input type="hidden" name="config" value="cc">

    Note: Don't just add the line above to your search form without checking if there isn't already a similar line giving the config attribute a different value. The sample search.html form that comes with the package includes a line like this already, giving "config" the default value of "htdig". If it's there, modify it instead of adding another definition. The config input parameter doesn't need to be hidden either, and you may want to define it as a pull-down list to select different databases (see question 4.4).

    4.3. How do I index pages that start with '~'?

    ht://Dig should index pages starting with '~' as if it was another web browser. If you are having problems with this, check your server log files to see what file the server is attempting to return.

    4.4. Can I use multiple databases?

    Yes, though you may find it easier to have one larger database and use restrict or exclude fields on searches. To use multiple databases, you will need a config file for each database. Then each file will set the database_dir or database_base attribute to change the name of the databases. The config file is selected by the config input field in the search form.
    See also questions 4.2 and 4.20.

    4.5. OK, I can use multiple databases. Can I merge them into one?

    As of version 3.1.0, you can do this with the -m option to htmerge.

    4.6. Wow, ht://Dig eats up a lot of disk space. How can I cut down?

    There are several ways to cut down on disk space. One is not to use the "-a" option, which creates work copies of the databases. Naturally this essentially doubles the disk usage. If you don't need to index and search at the same time, you can ignore this flag.

    If you are running 3.2.0b5 or higher and don't have compression turned on, then turning that on will also save considerable space.

    Changing configuration variables can also help cut down on disk usage. Decreasing max_head_length and max_meta_description_length will cut down on the size of the excerpts stored (in fact, if you don't have use_meta_description set, you can set max_meta_description_length to 0!).

    If you are running 3.2.0b6 or higher, you can turn off store_phrases. This cuts the database size by about 60%, at the expense of severely limiting the effectiveness of phrase searches. It also reduces digging time slightly.

    Other techniques include removing the db.wordlist file and adding more words to the bad_words file.

    The University of Leipzig has published word lists containing the 100, 1000 and 10000 most often used words in English, German, French and Dutch. No copyrights or restrictions seem to be applied to the downloadable files. These can be very handy when putting together a bad_words file. Thanks to Peter Asemann for this tip.

    4.7. Can I use SSI or other CGIs in my htsearch results?

    Not really. Apache will not parse CGI output for SSI statements (See the Apache FAQ). Thus,the htsearch CGI does not understand SSI markup and thus cannot include other CGIs. However, it is possible doing it the other way round: you can have the htsearch results included in your dynamic page.

    The Apache project has mentioned that this will be a feature added to the Apache 2.0 version, currently in development.

    The easiest approach in the meantime is using SSI with the help of the script_name configuration file attribute. See the contrib/scriptname directory for a small example using SSI.

    For CGI and PHP, you need a "wrapper" script to do that. For perl script examples, see the files in contrib/ewswrap. The PHP guide (see contributed guides) not only describes a wrapper script for PHP, but also offers a step by step tutorial to the basics of ht://dig and is well worth reading. For other alternatives, see question 4.11.

    4.8. How do I index Word, Excel, PowerPoint or PostScript documents?

    This must be done with an external parser or converter. A sample of such an external converter is the contrib/doc2html/doc2html.pl Perl script. It will parse Word, PostScript, PDF and other documents, when used with the appropriate document to text converters. It uses catdoc to parse Word documents, and ps2ascii to parse PostScript files. The comments in the Perl script and accompanying documentation indicate where you can obtain these converters.

    Versions of htdig before 3.1.4 don't support external converters, so you have to use an external parser script such as contrib/parse_doc.pl (or better yet, upgrade htdig if you can). External converter scripts are simpler to write and maintain than a full external parser, as they just convert input documents to text/plain or text/html, and pass that back to htdig to be parsed. Parsing is more consistent across document types with external converters, because the final work is done by htdig's internal parsers. External parser scripts tend to be hacks that don't recognize a lot of the parsing attributes in your htdig.conf, so they have to be hacked some more when you change your attributes.

    The most recent versions of parse_doc.pl, conv_doc.pl and the doc2html package are available on our web site.
    See below for an example of doc2html.pl, or see the comments in conv_doc.pl and parse_doc.pl, or the documentation for doc2html for examples of their usage. For help with troubleshooting, see questions 5.37 and 5.39.

    4.9. How do I index PDF files?

    This too can be done with an external parser or converter, in combination with the pdftotext program that is part of the xpdf 0.90 package. A sample of such a converter is the doc2html.pl Perl script. It uses pdftotext to parse PDF documents, then processes the text into external parser records. The most recent version of doc2html.pl is available on our web site.

    For example, you could put this in your configuration file:

    external_parsers: application/msword->text/html /usr/local/bin/doc2html.pl \
                      application/postscript->text/html /usr/local/bin/doc2html.pl \
                      application/pdf->text/html /usr/local/bin/doc2html.pl
    

    You would also need to configure the script to indicate where all of the document to text converters are installed. See the DETAILS file that comes with doc2html for more information.

    Versions of htdig before 3.1.4 don't support external converters, so you have to use an external parser script such as contrib/parse_doc.pl (or better yet, upgrade htdig if you can). See question 4.8 above.

    Whether you use this external parser or converter, or acroread with the pdf_parser attribute, to successfully index PDF files be sure to set the max_doc_size attribute to a value larger than the size of your largest PDF file. PDF documents can not be parsed if they are truncated.

    This also raises the questions of why two different methods of indexing PDFs are supported, and which method is preferred. The built-in PDF support, which uses acroread to convert the PDF to PostScript, was the first method which was provided. It had a few problems with it: acroread is not open source, it is not supported on all systems on which ht://Dig can run, and for some PDFs, the PostScript that acroread generated was very difficult to parse into indexable text. Also, the built-in PDF support expected PDF documents to use the same character encoding as is defined in your current locale, which isn't always the case. The external converters, which use pdftotext, were developed to overcome these problems. xpdf 0.90 is free software, and its pdftotext utility works very well as an indexing tool. It also converts various PDF encodings to the Latin 1 set. It is the opinion of the developers that this is the preferred method. However, some users still prefer to stick with acroread, as it works well for them, and is a little easier to set up if you've already installed Acrobat.

    Also, pdftotext still has some difficulty handling text in landscape orientation, even with its new -raw option in 0.90, so if you need to index such text in PDFs, you may still get better results with acroread. The pdf_parser attribute has been removed from the 3.2 beta releases of htdig, so to use acroread with htdig 3.2.0b5 or other 3.2 betas, use the acroconv.pl external converter script from our web site.

    See also question 5.2 below and question 1.13 above. See questions 5.37 and 5.39 for troubleshooting tips.

    4.10. How do I index documents in other languages?

    The first and most important thing you must do, to allow ht://Dig to properly support international characters, is to define the correct locale for the language and country you wish to support. This is done by setting the locale attribute (see question 5.8). The next step is to configure ht://Dig to use dictionary and affix files for the language of your choice. These can be the same dictionary and affix files as are used by the ispell software. A collection of these is available from Geoff Kuenning's International Ispell Dictionaries page, and we're slowly building a collection of word lists on our web site.

    For example, if you install German dictionaries in common/german, you could use these lines in your configuration file:

    locale:               de_DE
    lang_dir:             ${common_dir}/german
    bad_word_list:        ${lang_dir}/bad_words
    endings_affix_file:   ${lang_dir}/german.aff
    endings_dictionary:   ${lang_dir}/german.0
    endings_root2word_db: ${lang_dir}/root2word.db
    endings_word2root_db: ${lang_dir}/word2root.db
    

    You can build the endings database with htfuzzy endings. (This command may actually take days to complete, for releases older than 3.1.2. Current releases use faster regular expression matching, which will speed this up by a few orders of magnitude.) Note that the "*.0" files are not part of the ispell dictionary distributions, but are easily made by concatenating the partial dictionaries and sorting to remove duplicates (e.g.: "cat * | sort | uniq > lang.0" in most cases). You will also need to redefine the synonyms file if you wish to use the synonyms search algorithm. This file is not included with most of the dictionaries, nor is the bad_words file.

    If you put all the language-specific dictionaries and configuration files in separate directories, and set all the attribute definitions accordingly in each search config file to access the appropriate files, you can have a multilingual setup where the user selects the language by selecting the "config" input parameter value. In addition to the attributes given in the example above, you may also want custom settings for these language-specific attributes: date_format, iso_8601, method_names, no_excerpt_text, no_next_page_text, no_prev_page_text, nothing_found_file, page_list_header, prev_page_text, search_results_wrapper (or search_results_header and search_results_footer), sort_names, synonym_db, synonym_dictionary, syntax_error_file, template_map, and of course database_dir or database_base if you maintain multiple databases for sites of different languages. You could also change the definition of common_dir, rather than making up a lang_dir attribute as above, as many language-specific files are defined relative to the common_dir setting.

    If you're running version 3.1.6 of ht://Dig, you may also be interested in the accents fuzzy match algorithm in the search_algorithm attribute, which lets you treat accented and unaccented letters as equivalent in words. Note that if you use the accents algorithm, you need to rebuild the accents database each time you update your word database, using "htfuzzy accents". This command isn't in the default rundig script, so you may want to add it there. The accents fuzzy match algorithm is also in the 3.2 beta releases. There are also the boolean_keywords and boolean_syntax_errors attributes in 3.1.6 for changing other language-specific messages in htsearch.

    Current versions of ht://Dig only support 8-bit characters, so languages such as Chinese and Japanese, which require 16-bit characters, are not currently supported.

    Didier Lebrun has written a guide for configuring htdig to support French, entitled Comment installer et configurer HtDig pour la langue française. His "kit de francisation" is also available on our web site.

    See also question 4.2 for tips on customizing htsearch, and question 4.6 for tips where to find bad_words files.

    4.11. How do I get rotating banner ads in search results?

    While htsearch doesn't currently provide a means of doing SSI on its output, or calling other CGI scripts, it does have the capability of using environment variables in templates.

    The easiest way to get rotating banners in htsearch is to replace htsearch with a wrapper script that sets an environment variable to the banner content, or whatever dynamically generated content you want. Your script can then call the real htsearch to do the work. The wrapper script can be written as a shell script, or in Perl, C, C++, or whatever you like. You'd then need to reference that environment variable in header.html (or wrapper.html if that's what you're using), to indicate where the dynamic content should be placed.

    If the dynamic content is generated by a CGI script, your new wrapper script which calls this CGI would then have to strip out the parts that you don't want embedded in the output (headers, some tags) so that only the relevant content gets put into the environment variable you want. You'd also have to make sure this CGI script doesn't grab the POST data or get confused by the QUERY_STRING contents intended for htsearch. Your script should not take anything out of, or add anything to, the QUERY_STRING environment variable.

    An alternative approach is to have a cron job that periodically regenerates a different header.html or wrapper.html with the new banner ad, or changes a link to a different pre-generated header.html or wrapper.html file. For other alternatives, see question 4.7.

    4.12. How do I index numbers in documents?

    By default, htdig doesn't treat numbers without letters as words, so it doesn't index them. To change this behavior, you must set the allow_numbers attribute to true, and rebuild your index from scratch using rundig or htdig with the -i option, so that bare numbers get added to the index.

    4.13. How can I call htsearch from a hypertext link, rather than from a search form?

    If you change the search.html form to use the GET method rather than POST, you can see the URLs complete with all the arguments that htsearch needs for a query. Here is an example:
    http://www.grommetsRus.com/cgi-bin/htsearch?config=htdig&restrict=&exclude=&method=and&format=builtin-long&words=grapple+grommets which can actually be simplified to:
    http://www.grommetsRus.com/cgi-bin/htsearch?method=and&words=grapple+grommets with the current defaults. The "&" character acts as a separator for the input parameters, while the "+" character acts as a space character within an input parameter. In versions 3.1.5 or 3.2.0b2, or later, you can use a semicolon character ";" as a parameter separator, rather than "&", for HTML 4.0 compliance. Most non-alphanumeric characters should be hex-encoded following the convention for URL encoding (e.g. "%" becomes "%25", "+" becomes "%2B", etc). Any htsearch input parameter that you'd use in a search form can be added to the URL in this way. This can be embedded into an <a href="..."> tag.
    See also question 5.21.

    4.14. How do I restrict a search to only meta keywords entries in documents?

    First of all, you do not do this by using the "keywords" field in the search form. This seems to be a frequent cause of confusion. The "keywords" input parameter to htsearch has absolutely nothing to do with searching meta keywords fields. It actually predates the addition of meta keyword support in 3.1.x. A better choice of name for the parameter would have been "requiredwords", because that's what it really means - a list of words that are all required to be found somewhere in the document, in addition to the words the user specifies in the search form.

    As of 3.2.0b5, the most direct way to search for a particular meta keyword is to specify the word as "keyword:<word>". Similarly, "title:", "heading:", and "author:" restrict searches to the respective fields. To search for words in the body of the text, use "text:".

    To restrict all search terms to meta keywords only, you can set all factors other than keywords_factor to 0, and for 3.1.x, you must then reindex your documents. In the 3.2 betas, you can change factors at search time without needing to reindex. As of 3.2.0b5, it is possible to restrict the search in the query itself. Note that changing the scoring factors in this way will only alter the scoring of search results, and shift the low or zero scores to the end of the results when sorting by score (as is done by default). For versions before 3.2.0b5, the results with scores of zero aren't actually removed from the search results.

    4.15. Can I use meta tags to prevent htdig from indexing certain files?

    Yes, in each HTML file you want to exclude, add the following between the <HEAD> and </HEAD> tags:

    <META NAME="robots" CONTENT="noindex, follow">

    Doing so will allow htdig to still follow links to other documents, but will prevent this document from being put into the index itself. You can also use "nofollow" to prevent following of links. See the section on Recognized META information for more details. For documents produced automatically by MhonArc, you can have that line inserted automatically by putting it in the MhonArc resource file, in the sections IDXPGBEGIN and TIDXPGBEGIN.

    You can also use the noindex_start and noindex_end attributes to define one set of tags which will mark sections to be stripped out of documents, so they don't get indexed, or you can mark sections with the non-DTD <noindex> and </noindex> tags. The noindex_start and noindex_end attributes can also be used to suppress in-line JavaScript code that wasn't properly enclosed in HTML comment tags (see question 4.26). In 3.1.6, you can also put a section between <noindex follow> and </noindex> tags to turn off indexing of text but still allow htdig to follow links.

    If you require much more elaborate schemes for avoiding indexing certain parts of your HTML files, especially if you don't have control over these files and can't add tags to them, you can set up htdig's external_parsers attribute with an external converter that will preprocess the HTML before it's parsed and indexed by htdig. Examples of this are the unhypermail.sh script in our contributed parsers and the ungeoify.sh script in our contributed scripts. By preprocessing the HTML, you can strip out parts you don't want, or you can add or change tags wherever they're needed, if you're willing to put in the effort to learn awk/sed/perl enough to do the job.

    4.16. How do I get htsearch to use the star image in a different directory than the default /htdig?

    You must set either the image_url_prefix attribute, or both star_blank and star_image in your htdig.conf, to refer to the URL path for these files. You should also set this URL path similarly in in common/header.html and common/wrapper.html, as they also refer to the star.gif file. If you want to relocate other graphics, such as the buttons or the ht://Dig logo, you should change all references to these in htdig.conf and common/*.html.

    4.17. How do I get htdig or htsearch to rewrite URLs in the search results?

    This can be done by using the url_part_aliases configuration file attribute. You have to set up different configuration files for htdig and htsearch, to define a different setting of this attribute for each one.

    A large number of users insist on ignoring that last point and try to make do with just one definition, either for htdig or htsearch, or sometimes for both. This seems to stem from a fundamental misunderstanding of how this attribute works, so perhaps a clarification is needed. The url_part_aliases attribute uses a two stage process. In the first stage, htdig encodes the URLs as they go into the database, by using the pairs in url_part_aliases going from left to right. In the second stage, htsearch decodes the encoded URLs taken from the database, by using the pairs in url_part_aliases going from right to left. If you have the same value for url_part_aliases in htdig and htsearch, you end up with the same URLs in the end. If you modify the first string (the from string) in the pairs listed in url_part_aliases for htsearch, then when htsearch decodes the URLs it ends up rewriting part of them.

    While you might think that if you don't use url_part_aliases in htdig, then you can use it in htsearch to alter unencoded URLs, the reality is that if you don't encode parts of URLs using url_part_aliases, they still get encoded automatically by the common_url_parts attribute. This helps to reduce the size of your databases. So, trying to use url_part_aliases only in htsearch doesn't work because there are no unencoded URLs in the database, so the right hand strings in the pairs you define won't match anything.

    You also can't put two different definitions of the url_part_aliases attribute in a single configuration file, as some users have attempted. When you define an attribute twice, the second definition merely overrides the first. Pay close attention to the description and examples for url_part_aliases. You must put one definition of this attribute in your configuration file for htdig, htmerge (or htpurge) and htnotify, and a different definition of it in your configuration file for htsearch.

    4.18. What are all the options in htdig.conf, and are there others?

    In ht://Dig's terminology, the settings in its configuration files are called configuration attributes, to distinguish them from command line options, CGI input parameters and template variables. There are many, many attributes that can be set to control almost all aspects of indexing, searching, customization of output and internationalization. All attributes have a built-in default setting, and only a subset of these appear in the sample htdig.conf file. See the documentation for all default values for attributes not overridden in the configuration file, and for help on using any of them. See also question 1.15.

    4.19. How do I get more than 10 pages of 10 search results from htsearch?

    There are two attributes that control the number of matches per page and the total number of pages. The number of matches per page can be set in your configuration file, using the matches_per_page attribute, or in your search form, using the matchesperpage input parameter.

    The number of pages is controlled by the maximum_pages attribute in your search configuration file. The current default for maximum_pages is 10 because the ht://Dig package comes with 10 images, with numbers 1 through 10, for use as page list buttons. If we increased the limit, we'd have to field a whole lot more questions from users irate because only the first 10 buttons are graphics, and the rest are text. If you want more than 10 pages of results, change maximum_pages, but you may also want to set the page_number_text and no_page_number_text attributes in your search configuration file to nothing, or remove them, to use text rather than images for the links to other pages.

    In version of htsearch before 3.1.4, maximum_pages limited only the number of page list buttons, and not the actual number of pages. This was changed because there was no means of limiting the total number of pages, but this ended up frustrating users who wanted the ability to have more pages than buttons. In 3.2.0b3 and 3.1.6 we introduced a maximum_page_buttons attribute for this purpose.

    4.20. How do I restrict a search to only certain subdirectories or documents?

    That depends on whether you want to protect certain parts of your site from prying eyes, or just limit the scope of search results to certain relevant areas. For the latter, you just need to set the restrict or exclude input parameter in the search form. This can be done using hidden input fields containing preset values, text input fields, select lists, radio buttons or checkboxes, as you see fit. If you use select lists, you can propagate the choices to select lists in the follow-up search forms using the build_select_lists configuration attribute. The University at Albany has a good description of how to use the restrict or exclude input parameters: Constructing a local search using ht://Dig Search forms.
    To include a hex encoded character (such as a %20 for a space) in a restrict or exclude string, the '%' must again be encoded. For example, to match a filename containing a space, the URL must contain %20, and so the CGI parameter passed to htsearch must contain %2520. The %25 encodes the '%'. (Note that this is only necessary for CGI input parameters, not for the corresponding configuration attributes in your htdig.conf file, as attributes aren't subjected to the same hex decoding step as parameters are.)
    See also question 4.4.

    If you wish to keep secure and non-secure areas on your site separate, and avoid having unauthorized users seeing documents from secure areas in their search results, that takes a bit more effort. You certainly can't rely on the restrict and exclude parameters, or even the config parameter, as any parameter in a search form can also be overridden by the user in a URL with CGI parameters. The safest option would be to host the secure and non-secure areas on separate servers with independent installations of htsearch, each with its own ht://Dig database, but that is often too costly or impractical an option. The next best thing is to host them on the same site, but make sure that everything is very clearly separated to prevent any leakage of secure data. You should maintain separate databases for the secure and public areas of your site, by setting up different htdig configuration files for each area. Use different settings of the start_url, limit_urls_to and database_dir configuration attributes, and possibly even different common_dir settings as well. Make sure your database_dir, and even your common_dir, are not in any directories accessible from the web server. Run htdig and htmerge (or rundig) with each separate configuration file, to build your two databases.

    The tricky part is to make sure your htsearch program is secure. You don't want to use the same htsearch for the secure and public sites, because otherwise the public site could access the configuration for the secure database, making its data publicly accessible. You must either compile two separate versions of htsearch, with different settings of the CONFIG_DIR make variable, or you must make a simple wrapper script for htsearch that overrides the compiled-in CONFIG_DIR setting by a different setting of the CONFIG_DIR environment variable. Make sure the CONFIG_DIR for the secure area is not a subdirectory of the CONFIG_DIR for the public area. In this way, you can maintain separate directories of config files for the public and secure sites, so that the secure config files are not accessible from the public htsearch.

    Put the htsearch binary or wrapper script for the secure site in a different ScriptAlias'ed cgi-bin directory than the public one, and protect the secure cgi-bin with a .htaccess file or in your server configuration. Alternatively, you can put the secure program, let's call it htssearch, in the same cgi-bin, but protect that one CGI program in your server configuration, e.g.:

    <Location /cgi-bin/htssearch>
    AuthType Basic
    AuthName ....
    AuthUserFile ...
    AuthGroupFile ...
    <Limit GET POST>
    require group foo
    </Limit>
    </Location>
    

    This describes the setup for an Apache server. You'd need to work out an equivalent configuration for your server if you're not running Apache.

    4.21. How can I allow people to search while the index is updating?

    Answer contributed by Avi Rappoport <avirr@searchtools.com>

    If you have enough disk space for two copies of the index database, use -a with the htdig and htmerge processes. This will make use of a copy of the index database with the extension ".work", and update the copy instead of the originals. This way, htsearch can use those originals while the update is going on. When it's done, you can move the .work versions to replace the originals, and htsearch will use them. The current rundig script will do this for you if you supply the -a flag to it. However, rundig builds the database from scratch each time you run it. If you want to update an alternate copy of the database, see the contributed rundig.sh script.

    4.22. How can I get htdig to ignore the robots.txt file or meta robots tags?

    You can't, and you shouldn't. The Standard for Robot Exclusion exists for a very good reason, and any well behaved indexing engine or spider should conform to it. If you have a problem with a robots.txt file, you really should take it up with the site's webmaster. If they don't have a problem with you indexing their site, they shouldn't mind setting up a User-agent entry in their robots.txt file with a name you both agree on. The user agent setting that htdig uses for matching entries in robots.txt can be changed via the robotstxt_name attribute in your config file.

    If you have a problem with a robots meta tag in a document (see question 4.15) you should take it up with the author or maintainer of that page. These tags are an all or nothing deal, as they can't be set up to allow some engines and disallow others. If htdig encounters them, it has to give the page's creator the benefit of the doubt and honour them. If exceptions to the rule are wanted, this should be done with a robots.txt file rather than a meta tag.

    4.23. How can I get htdig not to index some directories, but still follow links?

    You can simply add the directory name to your robots.txt file or to the exclude_urls attribute in your configuration, but that will exclude all files under that directory. If you want the files in that directory to be indexed, you have a couple options. You can add an index.html file to the directory, that will include a robots meta tag (see question 4.15) to prevent indexing, and will contain links to all your files in this directory. The drawback of this is that you must maintain the index.html file yourself, as it won't be automatically updated as new files are added to the directory.

    The other technique you can use, if you want the directory index to be made by the web server, is to get the server to insert the robots meta tag into the index page it generates. In Apache, this is done using the HeaderName and IndexOptions directives in the directory's .htaccess file. For example:

       HeaderName .htrobots 
       IndexOptions FancyIndexing SuppressHTMLPreamble
    

    and in the .htrobots file:

    <HTML><head>
    <META NAME="robots" CONTENT="noindex, follow">
    <title>Index of /this/dir</title>
    </head>
    

    If you don't mind getting just one copy of each directory, but want to suppress the multiple copies generated by Apache's FancyIndexing option, you can either turn off FancyIndexing or you can add "?D=A ?D=D ?M=A ?M=D ?N=A ?N=D ?S=A ?S=D" to the bad_querystr attribute (without the quotes) to suppress the alternately sorted views of the directory. For Apache 2.x, you'd use "C=D C=M C=N C=S O=A O=D" instead in your bad_querystr setting.

    4.24. How can I get rid of duplicates in search results?

    This depends on the cause of the duplicate documents. htdig does keep track of the URLs it visits, so it never puts the same URL more than once in the database. So, if you have duplicate documents in your search results, it's because the same document appears under different URLs. Sometimes the URLs vary only slightly, and in subtle ways, so you may have to look hard to find out what the variation is. Here are some common reasons, each requiring a different solution.

    • You're indexing a case insensitive web server (e.g. an NT based server), but the case_sensitive attribute is still set to true. In this case, if htdig encounters two URLs pointing to the same document, but the case of the letters in one is different than the other (even if it's only 1 letter), it will not treat them as the same URL.

    • You have symbolic links (or hard links) to some of these documents, so they can be reached by several URLs. The solution here is to build an exclude list of URLs that are actually symbolic links, and putting these in exclude_urls (or in your robots.txt file). You can automate this using a technique similar to the find command in question 5.25 which builds the start_url list, but adding a -type l to find symbolic links.

    • You have copies of the same documents in different locations. This is similar to the symbolic link problem above, but harder to fix automatically.

    • The duplicate URLs result from CGI, SSI or other dynamic pages that give the same content even though there may be variations in the query string or other parts of the URL. The approach to fix this is similar to the fix above, but may be less easy to automate, depending on what the variations are. You can add patterns to exclude_urls or bad_querystr to get rid of unwanted variations. These are especially important to bring under control, because in some cases, if left unchecked, they can result in an infinite virtual hierarchy which htdig will never be able to finish indexing. For example, in a CGI-based calendar, htdig could go on following next month or next year links to infinity, but this can be stopped by adding a stop year to bad_querystr.

      Another common example happens when htdig hits a link to an SSI page and the URL has an extra trailing slash. This can happen with either .shtml pages or .html pages that use the XBitHack. The trailing slash causes the URL to be misinterpreted as a directory URL, and any relative URLs in the document are added to the URL, creating longer and longer URLs that still lead to the same SSI document. There are two things you can do:
      1. hunt down the pages with the incorrect links, i.e. search for ".shtml/" or ".html/" in URLs in your documents, and fix these links; or
      2. add .shtml/ and .html/ to your exclude_urls setting to get htdig to ignore these defective links.
      The second option is easier, but you run the risk that htdig will miss some SSI pages if the only links to them have the trailing slash, so you may want to try hunting down the links anyway.

      See also question 5.29.

    • The duplicates result from session IDs in PHP or other dynamic pages that give the same content even though the ID changes during the indexing process. This can lead not only to duplicates, but also to URLs that become unusable because of expired session IDs. Session IDs are the bane of search engines, and you should avoid using them if at all possible. If getting rid of them altogether isn't an option, then you can at least remove them while indexing, using the url_rewrite_rules attribute. This will only work if htdig can access the documents without a session ID, as htdig rewrites the URL before fetching the document, and htsearch presents the rewritten URL (without session ID) in search results.
    4.25. How can I change the scores in search results, and what are the defaults?

    The scores are calculated mostly by htdig at indexing time, with some tweaking done by htsearch at search time. There are a number of configuration attributes, all called <something>_factor, which can control the scoring calculations. In addition, the location of words within the document has an effect on score, as word scores are also multiplied by a varying location factor somewhere in between 1000 for words near the start and 1 for words near the end of the document. As of yet, there is no way to change this factor. For any of the scoring factors you can configure, and which are used by htdig, you will have to reindex your documents so the new factors take effect. The default values for these scoring factors, as well as information about whether they're used by htdig or htsearch, are all listed in the configuration attributes documentation. Malcolm Austen has written some notes on page scores for 3.1.x which you may find helpful.

    Note that the above applies to the 3.1.x releases, while in the 3.2 beta releases, all scores are calculated at search time with no weight being put on the location of words within the document.

    4.26. How can I get htdig not to index JavaScript code or CSS?

    The HTML parser in htdig recognizes and parses only HTML, which is all there should be within an HTML file. If your HTML files contain in-line JavaScript code or Cascading Style Sheets (CSS), these in-line codes, which are clearly not HTML, should be enclosed within an HTML comment tag so they are hidden from view from the HTML parser, or for that matter from any web client that is not JavaScript-aware or CSS-aware. See Behind the Scenes with JavaScript for a description of the technique, which applies equally well to in-line style sheets. If fixing up all non-HTML compliant JavaScript or CSS code in your HTML files is not an option, then see question 4.15 for an alternate technique.

    The HTML parser in htdig 3.1.6 tries skipping over bare in-line JavaScript code in HTML, unlike previous versions, but a small bug in the parser causes it to be thrown off by a "<" sign in the JavaScript, and it may then miss the closing </script> tag. This can be fixed by applying this patch.


    5. Troubleshooting

    5.1. I can't seem to index more than X documents in a directory.

    This usually has to do with the default document size limit. If you set max_doc_size in your config file to something enough to read in the directory index (try 100000 for 100K) this should fix this problem. Of course this will require more memory to read the larger file. Don't set it to a value larger than the amount of memory you have, and never more than about 2 billion, the maximum value of a 32-bit integer. If htdig is missing entire directories, see question 5.25.

    5.2. I can't index PDF files.

    As above, this usually has to do with the default document size. What happens is ht://Dig will read in part of a PDF file and try to index it. This usually fails. Try setting max_doc_size in your config file to a larger value than the size of your largest PDF file. Don't go overboard, though, as you don't want to overflow a 32-bit integer (about 2 billion), and you don't want to allocate much more memory than you need to store the largest document.

    There is a bug in Adobe Acrobat Reader version 4, in its handling of the -pairs option, which causes a segmentation violation when using it with htdig 3.1.2 or earlier. There is a workaround for this as of version 3.1.3 - you must remove the -pairs option from your pdf_parser definition, if it's there. However, acroread version 4 is still very unstable (on Linux, anyway) so it is not recommended as a PDF parser. An alternative is to use an external converter with the xpdf 0.90 package installed on your system, as described in question 4.9 above.

    5.3. When I run "rundig," I get a message about "DATABASE_DIR" not being found.

    This is due to a bug in the Makefile.in file in version 3.1.0b1. The easiest fix is to edit the rundig file and change the line "TMPDIR=@DATABASE_DIR@" to set TMPDIR to a directory with a large amount of temporary disk space for htmerge. This bug is fixed in version 3.1.0b2.

    5.4. When I run htmerge, it stops with an "out of diskspace" message.

    This means that htmerge has run out of temporary disk space for sorting. Either in your "rundig" script (if you run htmerge through that) or before you run htmerge, set the variable TMPDIR to a temp directory with lots of space.

    5.5. I have problems running rundig from cron under Linux.

    This problem commonly occurs on Red Hat Linux 5.0 and 5.1, because of a bug in vixie-cron. It causes htmerge to fail with a "Word sort failed" error. It's fixed in Red Hat 5.2. You can install vixie-cron-3.0.1-26.{arch}.rpm from a 5.2 distribution to fix the problem on 5.0 or 5.1. A quick fix for the problem is to change the first line of rundig to "#!/bin/ash" which will run the script through the ash shell, but this doesn't solve the underlying problem.

    5.6. When I run htmerge, it stops with an "Unexpected file type" message.

    Often this is because the databases are corrupt. Try removing them and rebuilding. If this doesn't work, some have found that the solution for question 3.2 works for this as well. This should be fixed in versions from 3.1.x

    5.7. When I run htsearch, I get lots of Internal Server Errors (#500).

    If you are running under Solaris, see 3.6. The solution for Solaris may also work for other OSes that use shared libraries in non-standard locations, so refer to question 3.6 if you suspect a shared library problem. In any case, check your web server error logs to see the cause of the internal server errors. If it's not a problem with shared libraries, there's a good chance that the error logs will still contain useful error messages that will help you figure out what the problem is.
    See also questions 5.13 and 5.23.

    5.8. I'm having problems with indexing words with accented characters.

    Most of the time, this is caused by either not setting or incorrectly setting the locale attribute. The default locale for most systems is the "portable" locale, which strips everything down to standard ASCII. Most systems expect something like locale: en_US or locale: fr_FR. Locale files are often found in /usr/share/locale or the $LANGUAGE environment variable. See also question 4.10.

    Setting the locale correctly seems to be a frequent source of frustration for ht://Dig users, so here are a few pointers which some have found useful. First of all, if you don't have any luck with the settings of the locale attribute that you try, make sure you use a locale that is defined on your system. As mentioned above, these are usually installed in /usr/share/locale, so look there for a directory named for the locale you want to use. If you don't find it, but find something close, try that locale name. Note that the locale may not have to be specific to the language you're indexing, as long as it uses the same character set. E.g. most western European languages use the ISO-8859-1 Latin 1 character set, so on most systems the locales for all these languages define the same character types table and can be used interchangeably. Some systems, however, define only the accented letters used for a given language, so "your mileage may vary." The important thing is that the directory for your locale definition must have a file named LC_CTYPE in it. For example, on many Linux distributions, a language-specific locale like fr won't contain this file, but country-specific locales like fr_FR or fr_CA will. If you don't find any appropriate locales installed on your system, try obtaining and installing the locale definition files from your OS distribution. Also, once you've set your locale, you need to reindex all your documents in order for the locale to take effect in the word database. This means rerunning the "rundig" script, or running "htdig -i" and htmerge (or htpurge in the 3.2 betas).

    Note also that some UNIX systems and libc5-based Linux systems just don't have a working implementation of locales, so you may not be able to get locales working at all on certain systems. The testlocale.c program on our web site can let you see the LC_CTYPE tables for any locale, to aid in finding one that works. Carefully follow the directions in the program's comments to know how to use it and what to look for in its output.

    5.9. When I run htmerge, it stops with a "Word sort failed" message.

    There are three common causes of this. First of all, the sort program may be running out of temporary file space. Fix this by freeing up some space where sort puts its temporary files, or change the setting of the TMPDIR environment variable to a directory on a volume with more space. A second common problem is on systems with a BSD version of the sort program (such as FreeBSD or NetBSD). This program uses the -T option as a record separator rather than an alternate temporary directory. On these systems, you must remove the TMPDIR environment variable from rundig, or change the code in htmerge/words.cc not to use the -T option. A third cause is the cron program on Red Hat Linux 5.0 or 5.1. (See question 5.5 above.)

    5.10. When htsearch has a lot of matches, it runs extremely slowly.

    When you run htsearch with no customization, on a large database, and it gets a lot of hits, it tends to take a long time to process those hits. Some users with large databases have reported much higher performance, for searches that yield lots of hits, by setting the backlink_factor attribute in htdig.conf to 0, and sorting by score. The scores calculated this way aren't quite as good, but htsearch can process hits much faster when it doesn't need to look up the db.docdb record for each hit, just to get the backlink count, date or title, either for scoring or for sorting. This affects versions 3.1.0b3 and up. In version 3.2, currently under development, the databases will be structured differently, so it should perform searches more quickly.

    In version 3.1.6, the date range selection code also slows down htsearch for the same reason. Unfortunately, a small bug crept into the code so that even if you don't set any of the date range input parameters (startyear, endyear, etc.), and you set backlink_factor and date_factor to 0, htsearch still looks at the date in the db.docdb record for each hit. You can avoid this either by setting startyear to 1969 and endyear to 2038 in your config file, or by applying this patch.

    5.11. When I run htsearch, it gives me a count of matches, but doesn't list the matching documents.

    This most commonly happens when you run htsearch while the database is currently being rebuilt or updated by htdig. If htdig and htmerge have run to completion, and the problem still occurs, this is usually an indication of a corrupted database. If it's finding matches, it's because it found the matching words in db.words.db. However, it isn't finding the document records themselves in db.docdb, which would suggest that either db.docdb, or db.docs.index (which maps document IDs used in db.words.db to URLs used to look up records in db.docdb), is incomplete or messed up. You'll likely need to rebuild your database from scratch if it's corrupted. Older versions of ht://Dig were susceptible to database corruption of this sort. Versions 3.1.2 and later are much more stable.

    Another possible cause of this problem is unreadable result template files. If you define external template files via the template_map attribute, rather than using the builtin-short or builtin-long templates, and the file names are incorrect or the files do not have read permission for the user ID under which htsearch runs, then htsearch won't be able to display the results. Also, all directories leading up to these template files must be searchable (i.e. executable) by htsearch, or it won't be able to open the files. This is the opposite problem of that described in question 5.36. If htsearch displays nothing at all, you may have both problems.

    5.12. I can't seem to index documents with names like left_index.html with htdig.

    There is a bug in the implementation of the remove_default_doc attribute in htdig versions 3.1.0, 3.1.1 and 3.1.2, which causes it to match more than it should. The default value for this attribute is "index.html", so any URL in which the filename ends with this string (rather than matches it entirely) will have the filename stripped off. This is fixed in version 3.1.3.

    5.13. I get Premature End of Script Headers errors when running htsearch.

    This happens when htsearch dies before putting out a "Content-Type" header. If you are running Apache under Solaris, or another system that may be using shared libraries in non-standard locations, first try the solution described in question 3.6. If that doesn't work, or you're running on another system, try running "htsearch -vvv" directly from the command line to see where and why it's failing. It should prompt you for the search words, as well as the format.
    If it works from the command line, but not from the web server, it's almost certainly a web server configuration problem. Check your web server's error log for any information related to htsearch's failure. One increasingly common problem is Apache configurations which expect all CGI scripts to be Perl, rather than binary executables or other scripts, so they use "perl-handler" rather than "cgi-handler".
    See also questions 5.7, 5.14 and 5.23.

    5.14. I get Segmentation faults when running htdig, htsearch or htfuzzy.

    Despite a great deal of debugging of these programs, we haven't been able to completely eliminate all such problems on all platforms. If you're running htsearch or htfuzzy on a BSDI system, a common cause of core dumps is due to a conflict between the GNU regex code bundled in htdig 3.1.2 and later, and the BSD C or C++ library. The solution is to use the BSD library's own rx code instead, using version 3.1.6 or newer as summarized by Joe Jah:

    • ./configure --with-rx
    • make

    This solution may work on some other platforms as well (we haven't heard one way or the other), but will definitely not work on some platforms. For instance, on libc5-based Linux systems, the bundled regex code works fine by default, but using libc5's regex code causes core dumps.

    Users of Cobalt Raq or Qube servers have complained of segmentation faults in htdig. Apparently this is due to problems in their C++ libraries, which are fixed in their experimental compiler and libraries. The following commands should install the packages you need:

    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/binutils-2.8.1-3C1.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-1.0.2-9.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-c++-1.0.2-9.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-g77-1.0.2-9.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/egcs-objc-1.0.2-9.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/libstdc++-2.8.0-9.mips.rpm
    rpm -Uvh ftp://ftp.cobaltnet.com/pub/experimental/libstdc++-devel-2.8.0-9.mips.rpm
    rpm -Uvh --force ftp://ftp.cobaltnet.com/pub/products/current/RPMS/gcc-2.7.2-C2.mips.rpm

    You may have to remove the libg++ package, if you have it installed before installing libstdc++, because of conflicts in these packages. Be sure to do a "make clean" before a "make", to remove any object files compiled with the old compiler and headers.

    For other causes of segmentation faults, or in other programs, getting a stack backtrace after the fault can be useful in narrowing down the problem. E.g.: try "gdb /path/to/htsearch /path/to/core", then enter the command "bt". You can also try running the program directly under the debugger, rather than attempting a post-mortem analysis of the core dump. Options to the program can be given on gdb's "run" command, and after the program is suspended on fault, you can use the "bt" command. This may give you enough information to find and fix the problem yourself, or at least it may help others on the htdig mailing list to point out what to do next.

    5.15. Why does htdig 3.1.3 mangle URL parameters that contain bare "&" characters?

    This is a known bug in 3.1.3, and is fixed with this patch. You can apply the patch by entering into the main source directory for htdig-3.1.3, and using the command "patch -p0 < /path/to/HTML.cc.0". This is also fixed as of version 3.1.4.

    5.16. When I run htmerge, it stops with an "Unable to open word list file '.../db.wordlist'" message.

    The most common cause of this error is that htdig did not manage to index any documents, and so it did not create a word list. You should repeat the htdig or rundig command with the -vvv option to see where and why it is failing. See question 4.1.

    5.17. When using Netscape, htsearch always returns the "No match" page.

    Check your search form. Chances are there is a hidden input field with no value defined. For example, one user had
    <input type=hidden name=restrict> in his search form, instead of
    <input type=hidden name=restrict value=""> The problem is that Netscape sets the missing value to a default of " " (two spaces), rather than an empty string. For the restrict parameter, this is a problem, because htsearch won't likely find any URLs with two spaces in them. Other input parameters may similarly pose a problem.

    Another possibility, if you're running 3.2.0b1 or 3.2.0b2, is that you need to make the db.words.db_weakcmpr file writeable by the user ID under which the web server runs. This is a bug, and is fixed in the 3.2.0b5 beta.

    5.18. Why doesn't htdig follow links to other pages in JavaScript code?

    There probably isn't any indexing tool in existance that follows JavaScript links, because they don't know how to initiate JavaScript events. Realistically, it would take a full JavaScript parser in order to be able to figure out all the possible URLs that the code could generate, something that's way beyond the means of any search engine. You have a few options:

    • Add "backup" links using plain HTML <a href=...> tags to all the pages that could be accessed through JavaScript,
    • Add <link> tags to point to all these pages (see Links and search engines in W3C's HTML 4.0 Specification - requires htdig 3.1.3 or greater, but then everyone should be running 3.1.6 or greater anyway),
    • Compose a list of all the unreachable documents, or write a program to do so, and feed that list as part of htdig's start_url attribute. See also question 5.25.
    5.19. When I run htsearch from the web server, it returns a bunch of binary data.

    Your server is returning the contents of the htsearch binary. Common causes of this are:

    • no execute permission on the htsearch binary,
    • the binary won't run on this system (it may be compiled for the wrong system type), or
    • the web server doesn't recognize the file as a CGI (for Apache, you must have a ScriptAlias directive for the program or the directory in which it's installed, or define a cgi-script handler for some suffix, e.g. .cgi, and add that suffix to the program file name).

    By default, Apache is usually configured with one cgi-bin directory as ScriptAlias, so all your CGI programs must go in there, or have a .cgi suffix on them. Your configuration may differ, however.

    5.20. Why are the betas of 3.2 so slow at indexing?

    As the release notes for these versions suggest, they are somewhat unoptimized and are made available for testing Since the 3.2 code indexes all locations of words to support phrase searching and other advanced methods, this additional data slows down the indexer. To compensate, the code has a cache configured by the wordlist_cache_size attribute. As of this writing, the word database code will slow down considerably when the cache fills up. Setting the cache as large as possible provides considerable performance improvement. Development is in progress to improve cache performance. For 3.2.0b6 and higher, see also the store_phrases attribute, which can turn off support for phrase searches, improving the speed.

    5.21. Why does htsearch use ";" instead of "&" to separate URL parameters for the page buttons?

    In versions 3.1.5 and 3.2.0b2, and later, htsearch was changed to use a semicolon character ";" as a parameter separator for page button URLs, rather than "&", for HTML 4.0 compliance. It now allows both the "&" and the ";" as separators for input parameters, because the CGI specification still uses the "&". This change may cause some PHP or CGI wrapper scripts to stop working, but these scripts should be similarly changed to recognize both separator characters. For the definitive reference on this issue, please refer to section B.2.2 of W3C's HTML 4.0 Specification, Ampersands in URI attribute values. We're all a little tired of arguing about it. If you don't like the standard, you can change the Display::createURL() code yourself to ignore it.
    See also question 4.13.

    If you want to try working within the new standard, you may find it helpful to know that recent versions of CGI.pm will allow either the ampersand or semicolon as a parameter separator, which should fix any Perl scripts that use this library. In PHP, you can simply set the following in your php.ini file to allow either separator:

    arg_separator.input = ";&"
    
    5.22. Why does htsearch show the "&" character as "&amp;" in search results?

    In version 3.1.5, htsearch was fixed to properly re-encode the characters &, <, >, and " into SGML entities. However, the default value for the translate_amp, translate_lt_gt and translate_quot attributes is still false, so these entities don't get converted by htdig. If you set these three attributes to true in your htdig.conf and reindex, the problem will go away.

    In the 3.2 betas there was a bug in the HTML parser that caused it to fail when attempting to translate the "&amp;" entity. This has been fixed in 3.2.0b3. The translate_* attributes are gone as of 3.2.0b2.

    5.23. I get Internal Server or Unrecognized character errors when running htsearch.

    An increasingly common problem is Apache configurations which expect all CGI scripts to be Perl, rather than binary executables or other scripts, so they use "perl-handler" rather than "cgi-handler". The fix is to create a separate directory for non-Perl CGI scripts, and define it as such in your httpd.conf file. You should define it the same way as your existing cgi-bin directory, but use "cgi-handler" instead of "perl-handler". In any case, you should check your web server's error log for any information related to htsearch's failure.
    See also questions 5.7, 5.14 and 5.13.

    5.24. I took some settings out of my htdig.conf but they're still set.

    All configuration file attributes have compiled-in, default values. Taking an attribute out of the file is not the same thing as setting it to an empty string, a 0, or a value of false. See question 4.18.

    5.25. When I run htdig on my site, it misses entire directories.

    First of all, htdig doesn't look at directories itself. It is a spider, and it follows hypertext links in HTML documents. If htdig seems to be missing some documents or entire directory sub-trees of your site, it is most likely because there are no HTML links to these documents or directories. (See also question 5.18.) If htdig does not come across at least one hypertext link to a document or directory, and it's not explicitly listed in the start_url attribute, then this document or directory is essentially hidden from view to htdig, or to any web browser or spider for that matter. You can only get htdig to index directories, without providing your own files with links to the contents of these directories, by using your web server's automatic index generation feature. In Apache, this is done with the mod_autoindex module, which is usually compiled-in by default, and is enabled with the "Indexes" option for a given directory hierarchy. For example, you can put these directives in your Apache configuration:

    <Directory "/path/to/your/document/root">
        Options Indexes FollowSymLinks Includes ExecCGI
    </Directory>
    

    This will cause Apache to automatically generate an index for any directory that does not have an index.html or other "DirectoryIndex" file in it. Other web servers will have similar features, which you should look for in your server documentation.

    As an alternative to relying on the web server's autoindex feature, you can compose a list of all the unreachable documents, or write a program to do so, and feed that list as part of htdig's start_url attribute. Here is an example of simple shell script to make a file of URLs you can use with a configuration entry like start_url: `/path/to/your/file`:

    find /path/to/your/document/root -type f -name \*.html -print | \
        sed -e 's|/path/to/your/document/root/|http://www.yourdomain.com/|' > \
            /path/to/your/file
    

    Other reasons why htdig might be missing portions of your site might be that they fall out of the bounds specified by the limit_urls_to attribute (which takes on the value of start_url by default), they are explicitly excluded using the exclude_urls attribute, or they are disallowed by a robots.txt file (see the htdig documentation for notes about robot exclusion) or by a robots meta tag (see question 4.15). If htdig seems to be missing the last part of a large directory or document, see question 5.1. For reasons why htdig may be rejecting some links to parts of your site, see question 5.27.

    5.26. What do all the numbers and symbols in the htdig -v output mean?

    Output from htdig -v typically looks like this:

    23000:35506:2:http://xxx.yyy.zz/index.html: ***-+****--++***+ size = 4056
    

    The first number is the number of documents parsed so far, the second is the DocID for this document, and the third is the hop count of the document (number of hops from one of the start_url documents). After the URL, it shows a "*" for a link in the document that it already visited (or at least queued for retrieval), a "+" for a new link it just queued, and a "-" for a link it rejected for any of a number of reasons. To find out what those reasons are, you need to run htdig with at least 3 "v" options, i.e. -vvv. If there are no "*", "+" or "-" symbols after the URL, it doesn't mean the document was not parsed or was empty, but only that no links to other documents were found within it.

    5.27. Why is htdig rejecting some of the links in my documents?

    When htdig parses documents and finds hypertext links to other documents (hrefs), it may reject them for any of several reasons. To find out what those reasons are, you need to run htdig with at least 3 "v" options, i.e. -vvv. Here are the meanings of some of the messages you might see at this verbosity level.

    Not an http or relative link!
    In versions 3.1.5 and earlier, only "http://" URLs, or URLs relative to those, are allowed.
    Item in the exclude list: item # n
    A substring of the URL matches one of the items in the exclude_urls attribute. The given item number will indicate which pattern matched, starting at 1. The 3.2.0 betas do not give the item number.
    Extension is invalid!
    The file name extension or suffix matches one of those listed in the bad_extensions attribute.
    Extension is not valid!
    The file name extension or suffix does not match one of those listed in the valid_extensions attribute, if any are specified.
    Invalid Querystring! or
    item in bad query list
    The URL contains a query string which matches one of those listed in the bad_querystr attribute.
    URL not in the limits!
    No substring of the URL entirely matches one of the items in the limit_urls_to attribute. The purpose of this attribute is to keep htdig from attempting to index the entire World Wide Web.
    forbidden by server robots.txt!
    A substring of the URL matches one of the items disallowed in the servers robots.txt file. See A Standard for Robot Exclusion. This message exists only in the 3.2.0 betas. In 3.1.5 and earlier, this condition is only caught later, resulting in the message "robots.txt: discarding 'URL'" from htdig, and a later "Deleted: no excerpt" message from htmerge.
    url rejected: (level 2)
    No substring of the URL entirely matches one of the items in the limit_normalized attribute. All the other rejections above will be indicated as level 1. The 3.2.0 betas give the much more meaningful message 'not in "limit_normalized" list!'

    Another possibility, if none of the error messages above appear for some of the links you think htdig should be accepting, is that htdig isn't even finding the links at all. First, make sure you're not making false assumptions about how htdig finds these. It only reads links in HTML code, and not JavaScript, and it doesn't read directories unless the HTTP server is feeding it directory listings. You will need to take a close look at the htdig -vvv (or -vvvv) output to see what htdig is finding, in and around the areas where the desired links are supposed to be found in your HTML code, to see if it's actually finding them. See also question 5.25.

    5.28. When I run htdig or htmerge, I get a "DB2 problem...: missing or empty key value specified" message.

    The most common cause of this error is that htdig or htmerge rejected any documents that had been put in the database, leaving an empty database. You need to find out the reasons for the rejection of these documents. See questions 4.1, 5.25 and 5.27.

    5.29. When I run htdig on my site, it seems to go on and on without ending.

    There are some things that can cause htdig to run on without ending, especially when indexing dynamic content (ASP, PHP, SSI or CGI pages). This usually involves htdig getting caught in an infinite virtual hierarchy. A sure sign of this is if the current size of your database is much larger than the total size of the site you are indexing, or if in the verbose output of htdig (see question 4.1) you see the same URLs come up again and again with only subtle variations. In any case, you must figure out the reason htdig keeps revisiting the same documents using different URLs, as explained in question 4.24, and set your exclude_urls and bad_querystr attributes appropriately to stop htdig from going down those paths.

    5.30. Why does htsearch no longer recognize the -c option when run from the web server?

    This was a security hole in 3.1.5 and older, and 3.2.0b3 and older releases of ht://Dig. (See question 2.1.) There's a compile-time macro you can set in htsearch.cc to disable this security fix, but that's a bad idea because it reopens the hole. This should only be done as a last recourse, when all other avenues fail. The -c option was only intended for testing htsearch from the command line, and not for use when calling htsearch on the web server. Unfortunately, far too many users have needlessly latched onto this option for CGI scripts. The preferred ways of specifying the config file are as follows, in order of preference:

    1. use the "config" input parameter in your search form (see question 4.2).
    2. if you need to get at files outside the default CONFIG_DIR, use a wrapper script that redefines the CONFIG_DIR environment variable, then use the config input parameter as above (see question 4.20).
    3. use a wrapper script to force htsearch to use a specific config file using the -c option. This is especially for cases where you want to prevent the user from selecting other config files in your CONFIG_DIR using the config input parameter. This should be done by using the GET method to call the wrapper script, and in this script you must unset the REQUEST_METHOD enviroment variable and pass "$QUERY_STRING" as a single argument to htsearch. (This safely gets around htsearch's test which disables -c.)
    4. configure and compile different htsearch binaries with different compile-time definitions of CONFIG_DIR, so you can avoid wrapper scripts altogether.
    5. define ALLOW_INSECURE_CGI_CONFIG in htsearch.cc and recompile htsearch if all other approaches above fail for you.
    5.31. I've set a config attribute exactly as documented but it seems to have no effect.

    There are a few fairly common reasons why this might happen:

    1. You may have a typo. Spelling matters, so make sure the attribute name is spelled exactly as it is in the documentation. Misspelled attribute definitions are silently ignored. This is because you're allowed to make up your own attribute definitions for use by other attribute definitions, as ${myownattribute}. Also remember to put the colon (":") separator between the attribute name and value in your definition.
    2. The attribute isn't supported in your version of the software. The documented configuration attributes on the www.htdig.org web site are for the most recent stable release. See questions 2.1 and 2.7 for details. If you're running an older version, or even a more recent beta release, you may not have the same set of attributes to work with. Consult the appropriate documentation, or upgrade to the current release.
    3. You're not modifying the right configuration file. The default configuration file is specified when you first configure ht://Dig before compiling, but other configuration files can be specified at run time, using the -c command-line option for most programs, or the config input parameter for htsearch (see question 4.2).
    4. You've got more than one definition of the attribute. Only the last occurrence of an attribute in the configuration file is the definition that's used for that attribute, overriding earlier definitions. This also applies for nested configuration files that are loaded in via the include directive, so check for other definitions in all included files. Similarly for htsearch, look out for multiple definitions of input parameters in your search forms, as mentioned in question 4.2 - these don't override each other but they get combined with a Ctrl-A as separator, which may not be what you want either.
    5. Your attribute definition is being "swallowed up" by an incomplete multi-line definition above it. Remember that when a line of an attribute definition ends with a single backslash ("\") before the end of the line (without any space after the backslash), then the following line is appended to it as a continuation of the same attribute definition. For an attribute definition that spans several lines, all lines but the last must end with a backslash. If you want a backslash to go into the attribute definition literally, it must be doubled-up, as \\.
    6. On a similar note, make sure your attribute definitions are all terminated by a newline character. Beware of text editors that do word wrapping. It may look like two separate lines on the screen, when it fact you've got two attribute definitions on the same long line, so the second is swallowed up as part of the first.
    7. Your attribute definition is being overridden by an htsearch CGI input parameter. For example, template_name is ignored if the format input parameter is defined. The allow_in_form attribute can define any number of new CGI input parameters that override the attributes of the same name in your config file.
    8. Your attribute definition is being ignored or overridden by a related attribute. Watch out for unexpected interactions between different attributes. For instance, characters in valid_punctuation are stripped out of words, so those characters may not have the effect you want if you've added them to extra_word_characters or prefix_match_character. Also, search_results_wrapper will override search_results_header and search_results_footer, but only if you've set up the wrapper file correctly.
    9. Watch out for possible "latent effects" of some attributes. For example, when you change attributes used by htdig, they won't have an immediate effect on entries already in the database, so you would have to reindex your site before they take effect. Similarly, attributes that affect how htfuzzy builds some of its databases don't take effect until those databases are rebuilt. Another, more subtle latent effect occurs with releases 3.1.6 and 3.2 betas: when you interrupt htdig (i.e. with Control-C or a kill command), it stores the list of currently queued URLs in db.log, in your database directory, so that the next time you invoke htdig it can resume the interrupted dig. A side-effect of this file is that if you change some attributes like limit_urls_to or exclude_urls before restarting, the URLs in the file are still taken as-is, having been checked against the old settings of limit_urls_to or exclude_urls before being queued. This might explain one reason htdig seems to ignore your new settings of these.
    5.32. When I run htsearch, it gives a page with an "Unable to read configuration file" message.

    The most common causes of this error are:

    • Your configuration file name is misspelled in the "config" input parameter of your search form, or you have two definitions of this parameter (see question 4.2).
    • You didn't install your configuration file in the directory defined by the CONFIG_DIR compile-time Makefile variable (see also question 4.20). This is where htsearch will look for the configuration file specified by the "config" input parameter.
    • The configuration file is not readable by the user ID under which your web server, and thus htsearch, runs. Similarly, if the directories from CONFIG_DIR up to the root directory are not executable by this same user ID, htsearch won't be able to access the configuration files.
    5.33. How can I find out which version of ht://Dig I have installed?

    You should always check which version of ht://Dig you're running, before you report any problems, or even if you suspect a problem. You can find out the version number of an installed ht://Dig package by running the command:

    htdig -\? | head

    (or use "more" if you don't have a "head" command). The full version number appears on the third line of output, after "This program is part of ht://Dig", and it should also include the snapshot date if you're running a pre-release snapshot. Always include this full version number with any bug report or problem report on a mailing list. You can save yourself and others a lot of grief by being certain of which version you're running, especially if you've installed more than one. If you're running ht://Dig from an RPM package, you should also report the package version and release number, which you can determine with the command "rpm -q htdig", and mention where you obtained the package. This will alert us to the ideosyncracies and/or patches in a particular RPM package. Also, if you've applied any patches yourself (see question 2.5) please mention which ones. See also question 1.8, on reporting bugs or configuration problems.

    5.34. When running htdig, I get "Error (0): PDF file is damaged - attempting to reconstruct xref table..."

    This message comes from the pdftotext utility, when a PDF file has been truncated. Find the largest PDF file on the site you're indexing, and set max_doc_size to at least that size (see question 5.2). If you need to track down which PDF is causing the error, try running "htdig -i -v > log.txt 2>&1" so you can see which URL is being indexed when the error occurs. The output redirects in that command combine stdout (where htdig's output goes) and stderr (where pdftotext's error messages go) into one output stream. If you're using acroread to index PDF files, the error message for a truncated PDF file is simply "Could not repair file." It's also possible to get errors like this from PDF files that are smaller than max_doc_size, if they're already truncated or corrupted on the server.

    5.35. When running htdig on Mandrake Linux, I get "host not found" and "no server running" errors.

    The default htdig.conf configuration in Mandrake's RPM package of htdig very stupidly enables the local_urls_only attribute by default, which means you can only index a limited set of files on the local server. Anything else, where htdig would normally fall back to using HTTP, will fail. To make matters worse, they put a very misleading comment above that attribute setting, which throws users off track. This attribute is useful in certain circumstances where you never want htdig to fall back to HTTP, but enabling it by default was a very bad judgement call on Mandrake's part.

    5.36. When I run htsearch, it gives me the list of matching documents, but no header or footer.

    The header and footer typically contain the followup search form, an indication of the total number of matches, and buttons to other pages of matches if the results don't fit on one page. If these don't show up, it could be that in attempting to customize these (see question 4.2), you removed them or rendered them unusable. Even if you didn't customize them, make sure you installed the search_results_header and search_results_footer files (or the search_results_wrapper file) in the correct location (where you told ht://Dig they'd be when you configured prior to compiling). Also make sure they have read permission for the user ID under which htsearch runs, and all directories leading up to these template files are searchable (i.e. executable) by htsearch, or it won't be able to open the files.

    This is the opposite problem of that described in question 5.11. If htsearch displays nothing at all, you may have both problems or you may have no matches or a boolean query syntax error and the nothing_found_file or syntax_error_file is missing or unreadable.

    5.37. When I index files with doc2html.pl, it fails with the "UNABLE to convert" error.

    This is an indication that doc2html.pl wasn't configured properly. Carefully follow all the directions for installation in the DETAILS file that comes with the script. In addition to installing doc2html.pl, you must:

    • Install xpdf and check that pdftotext and pdfinfo work from the command line,
    • Configure pdf2html.pl to use pdftotext and pdfinfo and check that it works from the command line,
    • Configure doc2html.pl to use pdf2html.pl and check that it works from the command line:
      doc2html.pl /full/path/to/sample/filename.pdf "application/pdf" url

    You should repeat a similar set of steps to configure and test doc2html.pl for other document types, such as Word, RTF, Excel and other document types. See also questions 4.8, 4.9 and 5.39.

    5.38. Why do my searches find search terms in pathnames, or how do I prevent matching filenames?

    htdig doesn't normally add the URL components to the index itself, but when you index a directory where the filenames are used as link description text (such as an automatic DirectoryIndex created by Apache's mod_autoindex) then these link descriptions get indexed, carrying the weight assigned to them by the description_factor attribute. Thus, a search for a filename will match this link description, and the file will show up in search results. To avoid that, make sure your DirctoryIndexes don't get indexed as detailed in question 4.23.

    Conversely, there is no way to force htdig to index URL components so that a search for a file name will yield a match on that file, unless you index an HTML file (or several) containing links to all the files you want, where the link description text does contain the full URL or the pathname components you want.

    5.39. I set up an external parser but I still can't index Word/Excel/PowerPoint/PDF documents.

    You probably need to carefully re-read and follow questions 4.8, 4.9, 5.25 and 5.27. When you can't index documents with an external parser or converter, there are three main issues, or points of failure, that you need to resolve. You need to figure out on which of the three stages the process is failing, and focus on that stage to get to the bottom of why it's not working at that stage. You need to run htdig with anywhere from 1 to 4 -v options, to get the debugging output you need to see where it's failing and why. This may be an iterative process, if htdig is failing at more than one stage: you might fix one problem only to run into another.

    1. Is htdig actually finding links to the PDF, Word, etc. documents you want to index? Make sure you're not making false assumptions about how htdig finds these (questions 5.25 and 5.18), and then find out how htdig is looking at the links in your HTML files to see if it's ignoring or rejecting links to your externally parsed documents (questions 4.1 and 5.27).

    2. If it is finding and accepting the links to these documents, is it correctly fetching them and passing them on to the appropriate external converter to be able to index them? Look at htdig -vvv output, around the time it tries to fetch one of these, and see what it does next. Does the file size look right? Are there any error messages around there? If the external converter isn't even being called, take a close look at your external_parsers attribute setting to make sure it's correct (see question 5.31).

    3. If it is attempting to convert them, is the external converter doing what it should, to feed some indexable text back into htdig's parser? You can also try htdig -vvvv (4 -v options) to see if it's actually parsing individual words from any of these. If this is too much output to wade through, try setting start_url to the URL of a single document that you want to test, so you can look in detail at what htdig does with it. You can also try running the external converter manually on one of these documents to see what it spits out. See question 5.37. Make sure your documents actually contain indexable text. Some PDFs are nothing but scanned images of pages, so it looks like text but it's just images with no computer-readable text.


    Last modified: $Date: 2004/05/28 13:15:16 $
    SourceForge Logo htdig-3.2.0b6/htdoc/Makefile.am0100644006314600127310000000243510024270226015517 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config EXTRA_DIST = COPYING \ ChangeLog \ FAQ.html \ RELEASE.html \ THANKS.html \ TODO.html \ author.html \ bdot.gif \ bugs.html \ attrs.html attrs_head.html attrs_tail.html \ cf_byname.html cf_byname_head.html cf_byname_tail.html \ cf_byprog.html cf_byprog_head.html cf_byprog_tail.html \ cf_general.html \ cf_types.html \ cf_variables.html \ config.html \ confindex.html \ confmenu.html \ contents.html \ dot.gif \ htdig.gif \ htdig.html \ htdig_big.gif \ htfuzzy.html \ htmerge.html \ htnotify.html \ hts_form.html \ hts_general.html \ hts_menu.html \ hts_method.html \ hts_templates.html \ htsearch.html \ index.html \ install.html \ ma_menu.html \ mailarchive.html \ mailing.html \ main.html \ meta.html \ notification.html \ require.html \ triangle.gif \ up.gif \ uses.html \ where.html \ cf_generate.pl attrs.html.in: attrs_head.html attrs_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} cf_byname.html: cf_byname_head.html cf_byname_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} cf_byprog.html: cf_byprog_head.html cf_byprog_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} htdig-3.2.0b6/htdoc/Makefile.in0100644006314600127310000002451710063260372015541 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la EXTRA_DIST = COPYING \ ChangeLog \ FAQ.html \ RELEASE.html \ THANKS.html \ TODO.html \ author.html \ bdot.gif \ bugs.html \ attrs.html attrs_head.html attrs_tail.html \ cf_byname.html cf_byname_head.html cf_byname_tail.html \ cf_byprog.html cf_byprog_head.html cf_byprog_tail.html \ cf_general.html \ cf_types.html \ cf_variables.html \ config.html \ confindex.html \ confmenu.html \ contents.html \ dot.gif \ htdig.gif \ htdig.html \ htdig_big.gif \ htfuzzy.html \ htmerge.html \ htnotify.html \ hts_form.html \ hts_general.html \ hts_menu.html \ hts_method.html \ hts_templates.html \ htsearch.html \ index.html \ install.html \ ma_menu.html \ mailarchive.html \ mailing.html \ main.html \ meta.html \ notification.html \ require.html \ triangle.gif \ up.gif \ uses.html \ where.html \ cf_generate.pl subdir = htdoc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = attrs.html depcomp = am__depfiles_maybe = DIST_SOURCES = DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.config \ COPYING ChangeLog Makefile.am attrs.html.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htdoc/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) attrs.html: $(top_builddir)/config.status attrs.html.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 installdirs: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am attrs.html.in: attrs_head.html attrs_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} cf_byname.html: cf_byname_head.html cf_byname_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} cf_byprog.html: cf_byprog_head.html cf_byprog_tail.html ../htcommon/defaults.cc cf_generate.pl @PERL@ ${srcdir}/cf_generate.pl ${top_srcdir} # 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: htdig-3.2.0b6/htdoc/RELEASE.html0100644006314600127310000016720110062603600015432 0ustar angusgbhtdig ht://Dig: Release notes

    Release notes

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    These are notes that go with each release of ht://Dig. There is also a ChangeLog file which has more details on the code changes.

    Release notes for htdig-3.2.0b6 20 Jun 2004
    The next beta release of ht://Dig, 3.2.0b6, is now available. It fixes several bugs from 3.2.0b5, and runs somewhat faster, although still much slower than 3.1.6. (No significant speed improvements are expected in the near future, although we are working on it.) Calling this release a "beta" simply means that exhausive testing, especially on non-Linux platforms, is not yet complete. However, we consider it stable enough for most production use.

    As with 3.2.0b5, if you are upgrading from a previous version, you should read the upgrade guide first.

    Bug fixes:
    • Correctly handle empty disallow entries in robots.txt
    • No longer compile regular expressions for every URL (improve performances)
    • Allow compressed databases on Cygwin
    • Fixed bugs in phrase searching
    • Improved parsing of the configuration file
    • bin/rundig -a handles multiple database directories
    • Ellipsis displayed correctly by htsearch
    • Allow '-' argument to '-m' ('minimal') runtime option to htdig
    • Check validity of first URL from each server
    • No longer ignore empty configuration attributes
    • fixed bug in handling 'http_proxy', 'http_proxy_authorization', 'authorization attributes'
    • remove stale md5_db if '-i' specified
    • Make 'server_alias' case insensitive
    • fixed bugs with zlib
    • Allow &euro; HTML entity
    • fixed other minor bugs
    New features:
    • added allow_space_in_url attribute: if set to true, htdig will handle URLs that contain embedded spaces
    • added store_phrases attribute: if it is false, htdig only stores the first occurrence of each word in a document
    • added an improved version of RTF2HTML into the contrib section
    • added OpenOffice.org support to doc2html in contrib section
    • improved date factor formula
    • improved tests
    • improved documentation
    • added man pages

    Release notes for htdig-3.2.0b5 10 Nov 2003
    This version was slated to be 3.2.0rc1, but some final testing is still required. It primarily fixes many bugs in 3.2.0b3, with some limited new functionality. As with 3.2.0b1 and 3.2.0b2, if you are upgrading from a previous version, you should read the upgrade guide first.

    • Fixed database bugs. Introduced zlib compression to replace buggy internal compression.
    • Forward-ported functionality from 3.1.6 (description_meta_tag_names, use_doc_date, ignore_alt_text, ignore_dead_servers, boolean_keywords, boolean_syntax_errors, multimatch_factor, translate_latin1)
    • Fixed bugs in phrase searching
    • Fixed compile problems due to deprecated C++ includes
    • Fixed bugs handling double slashes in URLs
    • Suppress display of matches with weight zero
    • Fixed bugs in nesting of tags which turn off indexing
    • Added Native Win32 support
    • Added http_proxy_authorization attribute
    • Improved networking code, with improved cookie handling and accept_language support
    • Implemented field-restricted searches (e.g. title:word)
    • Handle noindex_start/noindex_end as string lists
    • Implemented external converters, text/html->text/html-internal
    • Improved support for MIME types
    • Changed licence to LGPL from GPL

    Release notes for htdig-3.2.0b4
    This beta was never issued.

    Release notes for htdig-3.2.0b3 22 Feb 2001
    This version is still marked beta because it has still only received limited testing and there are still revisions pending for the 3.2 releases. However, it adds more functionality and should address all serious bugs in the 3.2.0b2 release. As with 3.2.0b1 and 3.2.0b2, if you are upgrading from a previous version, you should read the upgrade guide first.

    Please note if you are updating from a prior release (3.1 or 3.2), the htmerge program has changed syntax as noted below. You will probably want to change your behavior to call htpurge instead of htmerge after htdig as noted below.

    • Fixed several non-exploitable bugs in handling external parsers or transport agents.
    • Fix bug where changes in the robots.txt would be ignored. If a URL was indexed and later the robots.txt changed to forbid it, the URL would be checked anyway.
    • Fixed scoring bugs introduced in 3.2.0b2.
    • Fixed a non-exploitable security issue where content-type headers were passed incorrectly to external parsers or converters.
    • Fixed bugs in the accents fuzzy algorithm, cutting down on the size of the accent database.
    • Fixed a bug where duplicate documents would be generated when merging a database with itself.
    • Fixed a bug in the new regex handling for indexing limits where large patterns could fail and would be silently ignored.
    • Fixed minor bugs with the HTTP/1.1 implementation.
    • Fix a bug where an extra config= portion of a URL would be output when using collections.
    • Fixed a bug with content-type declarations in external parsers with combined content-type; charset declarations.
    • Fixed a bug in the config parser that did not correctly handle relative config include statements.
    • Fixed a bug in htfuzzy which would append to an existing synonyms database rather than creating it anew.
    • Fixed problems with the configure script ignoring --enable-bigfile flags.
    • Fixed problems with retrieval order--this could potentially foul things up when limiting indexing by hopcount.
    • Fixed some problems with the HTML in the included sample files.
    • Make the -l flag to htdig obsolete--this is now the default behavior -- the program will intercept many signals and write a log file for a restart.
    • Updated database format from the mifluz/htword project.
    • Changed syntax of htmerge. The program now only merges databases. The htpurge program will "clean up" databases after running htdig. The included "rundig" script reflects this.
    • htload now properly loads ASCII word databases.
    • Enhanced build_select_lists attribute.
    • Added support for controlling the number of Page buttons in htsearch with maximum_page_buttons.
    • Added the METADESCRIPTION htsearch template variable for displaying the <META> description field in output along with the normal description, instead of using the use_meta_description attribute.
    • Added support for permanent URL rewriting with the url_rewrite_rules attribute. (As opposed to the url_part_aliases attribute which can provide a different URL to htsearch and htdig.)
    • Added support for restricting a search to match only documents between two dates as specified in the search form as well as the template variables STARTYEAR, STARTMONTH, STARTDAY, ENDYEAR, ENDMONTH, ENDDAY.
    • Added support for limiting duplicates based on MD5 signatures with the new attributes check_unique_md5, check_unique_date, md5_db.
    • The documentation has been revised to include a block: portion to note if attributes can be included in URL or Server blocks. See the configuration documentation for more information.
    • More attributes are set on a per-server or per-URL basis.
    • New support for nttp:// protocol.
    • Added support for auto-generating directory listings for file:// URLs.
    • Set the default compilation to enable tests that can be run with "make check"
    • Greatly improved htnotify program with one message per e-mail address and support for message templates using the new attributes htnotify_webmaster, htnotify_replyto, htnotify_prefix_file, htnotify_suffix_file.
    • There are the usual variety of other fixes and changes. See the ChangeLog for more details.
    • Once again, a huge thank you to everyone who contributed bug reports, fixes and patches!
    Release notes for htdig-3.2.0b2 11 Apr 2000
    This version is still marked beta because it has still only received limited testing. However, it adds more functionality and should fix all known bugs in the previous 3.2.0b1 release, including the security hole fixed in version 3.1.5 in production versions. As with 3.2.0b1, if you are upgrading from a previous version, you should read the upgrade guide first.

    • Fixed several bugs in the new HTTP/1.1 implementation that would cause problems with so-called "Chunked" data.
    • Fixed a bug in the new regex-based configuration options that would ignore the case_sensitive attribute.
    • Fixed the robots.txt parsing to more rigorously stick to the standard.
    • Fixed a bug where upper-case META robots directives would be ignored.
    • Fixed a bug that could leave a connection open when it failed.
    • Fixed the timeout in the connection code to ensure that hung connections are killed properly.
    • Fixed a bug where duplicates of modified documents could pile up over time.
    • Fixed a bug in the SGML entity handling where numeric entities would be ignored. (e.g. &#162; -> ¢)
    • Fixed a bug in the new configuration parser that wouldn't accept lists including numbers
    • Fixed a potential infinite loop in the phrase searching parser that came up when fuzzy algorithms were used.
    • The HTML parser now ignores anything between <script> tags, much like it does for <style> tags.
    • Fixed some performance problems in the new word database code.
    • Removed the attributes translate_quot, translate_lt, translate_gt and translate_amp since all SGML entities are now encoded and decoded when displayed.
    • Removed the attribute uncoded_db_compatible since the 3.2 databases are no longer compatible with previous versions anyway.
    • Removed the attribute word_list because the db.wordlist file is no longer generated. To get an ASCII version of the database, use the word_dump attribute.
    • Removed the pdf_parser attribute. It is now preferred to use the external parser or external converter support with xpdf.
    • The wordlist_compress attribute is now turned on by default.
    • The output from htsearch and the default and included templates should now be more HTML-4.0 compliant.
    • Added support for searching collections of multiple databases. To use this, supply multiple config fields or config names separated by "|" characters. Also see the collection_names attribute.
    • Added a new accents fuzzy algorithm, which treats accented and unaccented words the same. You must create an accents_db with htfuzzy after indexing.
    • Added new attributes tcp_max_retries and tcp_wait_time to control how many times a low-level connection is retried and how long to wait on a hung connection.
    • Add any_keywords attribute to OR the keywords field in a search form instead of AND-ing them together.
    • Add the attributes search_results_order and url_seed_score to control result ranking and scoring based on URL patterns.
    • Moved the htnotify program into the new httools directory.
    • Added the programs htdump, htload, htstat and htpurge.
    • There are the usual variety of other fixes and changes. See the ChangeLog for more details.
    • Once again, a huge thank you to everyone who contributed bug reports, fixes and patches!

    Release notes for htdig-3.1.5 25 Feb 2000
    This version cleans up some remaining bugs in the 3.1.4 release. As the latest stable release of ht://Dig, it is recommended for all production servers.

    • Fixed a nasty security hole in htsearch, which would allow users to view any file on your site that had read permission.
    • Fixed a bug that could cause problems with 8-bit characters on some systems.
    • Made some attempts to get htsearch's output to be more HTML 4.0 compliant. It quotes all HTML tag parameters, and uses ";" instead of "&" as parameter separator in URLs for next pages. Reserved characters in parameters are now encoded. Please note that this may break a variety of CGI wrappers, for example, those written in PHP3.
    • Fixed handling of SGML entities: htdig will still decode them to store as single characters in the database, but htsearch now encodes some of them back for compliant results.
    • Added two new formats for variables in htsearch templates, $%(var), which escapes the variable for a URL, and $&(var), which HTML-escapes the variable as necessary.
    • Fixed htdig's handling of robots.txt, such that only the first applicable User-agent field bearing its name will be used, rather than only the last.
    • Fixed htdig's handling of servers that return 2-digit years.
    • Fixed handling of embedded quotes in quoted string lists.
    • Fixed handling of relative URLs with trailing ".." or leading "//".
    • Fixed handling of the valid_extensions attribute, which sometimes failed in the previous version.
    • Enhanced the handling of local filesystem indexing with the local_urls, local_user_urls or local_default_doc attributes, which now allow multiple directory or file names to be tried.
    • Added the build_select_lists attribute to allow the config file to specify <select> form elements in htsearch output as a template variable, much like $(SORT) and $(METHOD).
    • Added support for two additional configuration attributes: max_keywords, and nph.
    • A variety of other bug fixes, and many documentation updates. See the ChangeLog for details.
    • Once again, thanks to everyone who reported bugs and bug fixes.

    Release notes for htdig-3.2.0b1 4 Feb 2000
    This marks the first beta version of the 3.2.0 codebase, over a year in the works. Since it has not received as much testing as the 3.1.x series, it is *not* recommended for production environments. A full description of how to upgrade is provided here.

    NOTE: Read this document before upgrading. You have been warned.

    • Fixed a bug in htdig where hopcounts could be calculated incorrectly between multiple servers.
    • Fixed a bug that could cause problems with 8-bit characters on some systems.
    • Fixed handling of unreachable servers. First, the new max_retries attribute allows htdig to attempt multiple connections. Secondly, if the server is not available, htdig will stop trying to connect.
    • Fixed handling of SGML entities: htdig will still decode them to store as single characters in the database, but htsearch now encodes them back for compliant results.
    • Rewrote the database formats, allowing room for more sophisticated searches and compression of the word database using the new attribute wordlist_compress. These changes include the removal of the word_list file (db.wordlist) and the addition of the new doc_excerpt database.
    • Cleaned up many parts of the code, including the URL and HTML parsers. Additionally, on platforms that support it, much of the code will be built as shared libraries, which should help memory utilization, especially under high load.
    • Removed the modification_time_is_now attribute, which is now on by default. This means the time at indexing is taken as the date of the document if the server does not return a date.
    • Added the new attribute use_doc_date to use the date specified in a META date tag.
    • Merged all heading_factor attributes into one new attribute, heading_factor.
    • As a result of the new database format, all _factor attributes (like title_factor and keywords_factor are now dynamic--you do not have to rebuild your database to change the scaling.
    • Changed attributes bad_querystr, exclude_urls, limit_urls_to, limit_normalized, http_proxy_exclude to allow full regular expressions when the regex are surrounded by [ and ].
    • Changed htsearch fields restrict and exclude to allow regular expressions when the regex are surrounded by [ and ].
    • Added phrase searching support to htsearch--queries enclosed in quotes will be checked to ensure the words occur in that exact order in the documents.
    • Added the build_select_lists attribute to allow the config file to specify <select> form elements in htsearch output as a template variable, much like $(SORT) and $(METHOD).
    • Added a regex fuzzy method. This will allow searches to include regex that match words. The fuzzy method will return up to regex_max_words matches.
    • Added a speling [sic] fuzzy method. This attempts several simple spelling mistakes (like transposed letters and extra letters) to find matches. This adds the new attribute minimum_speling_length to restrict whether small words should be checked. Transposing letters in smaller words can give unrelated correctly-spelled words.
    • Added support for external transport methods, using the external_protocols attribute, an analogue of the external_parsers system.
    • Added support for HTTP/1.1, including persistent connections. This can be configured using the new attributes persistent_connections, head_before_get, and max_connection_requests.
    • Added support for file:// URLs and support for using the mime_types file to decide whether local files are parsable.
    • Added two new formats for variables in htsearch templates, $%(var), which escapes the variable for a URL, and $&(var), which HTML-escapes the variable as necessary.
    • Added support for reading the list of URLs to index with htdig by supplying the command-line option -.
    • Added a flag -m to htdig to index only the files given in the filename.
    • There are many more changes especially to the internal code structure, so a huge thank you goes out to everyone who helped make this release!

    Release notes for htdig-3.1.4 9 Dec 1999
    This version cleans up some remaining bugs in the 3.1.3 release. As the latest stable release of ht://Dig, it is recommended for all production servers.

    • Fixed a nasty bug in URL parameter parsing, which was gobbling up bare ampersands (&) and CGI parameter names.
    • Fixed a bug where htdig would go into an infinite loop if an entry in local_urls, local_user_urls or server_aliases was missing the "=".
    • Fixed a bug in htsearch, where it failed when reading long queries via the POST method.
    • Fixed a bug in htdig, where it failed to close the connection after certain errors.
    • Fixed a bug that clobbered the hop count of initial documents.
    • Fixed bugs in HTML parser's handling of META tags. It no longer continues indexing meta tags when indexing is turned off for the document, and it no longer gets confused by punctuation in META descriptions and keywords.
    • Fixed a bug in the handling of the case_sensitive attribute, so that it's not limited to robots.txt parsing. Now, if false, it causes URLs to be mapped to lowercase, to avoid mixed case duplicates as expected.
    • HTML parser now indexes text in alt parameter of img tags, and calculates word locations more accurately than before.
    • Digging via the local filesystem can now be done even without an HTTP server running, and a few more file types can be indexed locally, without having to rely on the server.
    • Sender name in htnotify's e-mail messages is now quoted.
    • The external_parsers attribute is now extended to support external converters, to avoid a lot of the complications of writing external parsers.
    • Added support for several new configuration attributes: authorization, start_highlight, end_highlight, local_urls_only, page_number_separator, script_name, template_patterns, and valid_extensions.
    • The keywords input parameter to htsearch is now propagated to followup searches, as for other input parameters.
    • The query string can now be passed to htsearch as a single command line argument, for use in scripts.
    • Added better examples and comments in sample htdig.conf, and added boolean match type to sample search.html form.
    • The HTML parser in htdig now turns off indexing between <style> and </style> tags.
    • A variety of other bug fixes, and many documentation updates. See the ChangeLog for details.
    • Once again, thanks to everyone who reported bugs and bug fixes.

    Release notes for htdig-3.1.3 22 Sep 1999
    This version fixes a number of bugs in the 3.1.2 release and is the latest stable release of ht://Dig. It is the only version recommended for production servers and users of all previous versions are suggested to upgrade.

    • Fixed a long-standing bug where search queries containing punctuation would not be highlighted in excerpts.
    • Fixed a bug where SGML entities inside HTML tags were not expanded.
    • Fixed the server_aliases attribute to default to port 80 if ommitted.
    • Fixed a bug in URL parsing, where documents ending in the value used for remove_default_doc were ignored. For example, a URL ending in /left_index.html would become /.
    • Fixed META robot parsing to correctly parse multiple directives.
    • Fixed a coredump when generating the metaphone fuzzy database on some systems.
    • Fixed the behavior of the modification_time_is_now attribute to work as documented.
    • Fixed the behavior of htdig to block out the username/password set on the command-line in process listing.
    • Fixed a bug with external parsers to prevent shell escapes in filenames.
    • Fixed a bug on some systems, where printing a date might crash.
    • Handles the ispell endings lists better so that suffixes more closely match grammatical rules.
    • Changed the maximum word length to a run-time option, set with the new attribute maximum_word_length.
    • Tests for the presence of alloca.h, which would cause problems with compiling the regex code under non-GNU compilers.
    • Added support for <EMBED>, <OBJECT>, and <LINK> HTML tags.
    • A variety of other bugs were fixed, see the ChangeLog for details.
    • When indexing, htdig should now attempt to index compound words as separate words in addition to a compound word. For example, "pdf_parser" would also be indexed as "pdf" and "parser."
    • Once again, thanks to everyone who reported bugs and bug fixes.

    Release notes for htdig-3.1.2 21 Apr 1999
    This version fixes a number of bugs in the 3.1.1 release and is the latest stable release of ht://Dig. It is highly recommended for production servers.

    • Fixed a bug that ignored META description tags when they were also added to the meta_keywords attribute.
    • Fixed the HTML comment parsing to be more lenient about non-standard comments.
    • Fixed problems in the date-parsing code that made it Y2K incompatible. In particular, it forgot that 2000 is a leap year and wouldn't correctly parse dates after 29 Feb 2000.
    • Fixed a variety of bugs in the HTML parser.
    • Fixed an old bug that would exclude all URLs if the exclude_urls attribute left empty.
    • Fixed display of META description tags. Now it always shows the top of a description. If no description exists, it looks for the search terms in the excerpt as usual.
    • Fixed some small memory leaks.
    • Changed the htfuzzy endings algorithm to use a more efficient regex system. Speed improvements on non-English languages are noted, now taking minutes for generation that would take days!
    • Changed the noindex_start and noindex_end attributes to allow case-insensitive matching.
    • Added on-disk versions of the builtin templates to make it more obvious how to change the results templates.
    • Added date_format attribute to change the format of dates output in search results.
    • Added extra_word_characters attribute that defines extra characters that should be considered part of a word, rather than punctuation.
    • Several other, relatively minor bugs were also fixed. Many thanks to those who sent in bug reports and to Gilles Detillieux for coordinating this release.

    Release notes for htdig-3.1.1 17 Feb 1999
    This version cleans up some remaining bugs in the 3.1.0 release. As the latest stable release of ht://Dig, it is recommended for all production servers.

    • Fixed a bug in the configure script under IRIX and Solaris 7.
    • Fixed a minor bug with the Berkeley database code under AlphaLinux.
    • Fixed a serious bug causing bus errors on several platforms, notably Solaris SPARC, caused by unaligned access to database structures.
    • Fixed some bugs in the boolean search parser.
    • Replaced the contributed parse_word_doc.pl script with a more capable parse_doc.pl script.
    • Fixed the htnotify program to parse dates as mentioned in the documentation.
    • Cleaned up some minor mistakes in the documentation and moved to HTML 4.0 Transitional syntax.
    • Fixed the documentation for the pdf_parser attribute that was changed in version 3.1.0. This attribute must call the parser with all command-line options.

    Release notes for htdig-3.1.0 9 Feb 1999
    This version marks the "full release" of version 3.1.0. Naturally, this version adds a few new feature and fixes a large number of remaining bugs. This version is the latest stable release of ht://Dig and is recommended for all production servers for current bug-fixes and oft-requested features.

    NOTE: You must rebuild your databases from scratch after updating to this version. Several database-related bugs were fixed and will remain unless you rebuild from scratch. We're sorry for any inconvenience.

    • Fixed a variety of small memory leaks.
    • Fixed a bug that could duplicate documents in the document databases.
    • Fixed a bug that would not remove documents marked as deleted.
    • Fixed a bug that could dump core with incorrectly defined template_map attributes.
    • Fixed a bug that could dump core or produce bogus dates when a server returns the date in an incorrect format.
    • Fixed a variety of string-matching bugs that caused problems with restricting indexing and searching.
    • Fixed a bug that could dump core if logging searches and CGI environment variables were not set.
    • Fixed a bug that would not hilight searches properly if they contained punctuation.
    • Fixed PDF parsing to support programs beyond acroread.
    • Fixed a bug that caused problems with large robots.txt files.
    • Fixed a bug in the sample rundig script from a non-portable test for the age of databases.
    • Fixed bugs in the fuzzy matching code that could prevent searches from completing if fuzzy databases were not present.
    • Fixed bugs in the soundex and metaphone algorithms that would only return the first word of several matching words. Note that to completely fix this bug, you must rebuild your soundex and metaphone databases.
    • Fixed up many compilation warnings and errors.
    • Fixed a performance slowdown in htsearch when backlink_factor and date_factor are zero and can be ignored.
    • Improved performance when a server ignores the If-Modified-Since request during update digs.
    • Added a warning message if the locale: option is set to a locale that is not present.
    • Some minor performance improvements.
    • Allow "include" keyword in config file to include other config files.
    • Uses latest (2.6.4) version of the Berkeley database.
    • Two databases may be merged together using htmerge.
    • The htdig program can be safely stopped and restarted in the middle of a dig. The dig will write the progress to the file specified by the new url_log option.
    • Added support for anchors in excerpts with the add_anchors_to_excerpt option and the ANCHOR template variable.
    • Added support for sorting results in increasing or decreasing order of document date, size, title and score using the search form. Note that changing sort from the default of score will result in a performance decrease.
    • Added config options sort and sort_names to change the default sort and names used in the SORT template variable.
    • Added the option compression_level to compress the document database if the zlib library is present.
    • Added the options noindex_start and noindex_stop to delimit sections of HTML documents to be ignored.
    • Added the option allow_in_form to allow specific config options to be set in the search form.
    • Added the option bad_querystr to ingore URLs containing specified CGI queries.
    • Added the option search_results_wrapper to replace separate header and footer files. For mor information, see the general htsearch documentation.
    • Added option no_title_text to allow configuration of the text used when no title is found.
    • Added option url_part_aliases to allow rewriting portions of URLs.
    • Added option common_url_parts to compression common portions of URLs. Requires rebuilding databases when changed.
    • Added option remove_default_doc to control whether ht://Dig strips off the default document in a folder. Set to empty will prevent problems with servers that treat / and /index.html as different URLs.
    • Of course there are many other bug-fixes and small enhancements. Many thanks to everyone who reported a bug or contributed code for this release!

    Release notes for htdig-3.1.0b4 22 Dec 1998
    This version fixes a security hole in htnotify. The hole has been present in previous versions but was inadevertently made worse in the 3.1.0 beta releases. Malicious users could contstruct pages that executed commands running under the shell of the user running htnotify. It is highly recommended that users of previous versions switch to this release.

    • Fixed a memory leak in htnotify and htsearch.
    • Updated the contributed parse_word_doc.pl script.

    Release notes for htdig-3.1.0b3 15 Dec 1998
    This version adds only a few features and a significant number of bug fixes. This version has been pretty thoroughly tested. Though there are a few remaining issues, it is hoped that this will be near the end of the beta releases before version 3.1.0. Note that it's recommended to update your databases to eliminate the possibility of subtle changes in the database format.

    • Fixed a bug which would ignore the proxy settings, introduced in version 3.1.0b2.
    • Fixed a bug where words would remain from deleted documents.
    • Fixed a bug where SGML < was considered part of a tag in the HTML parser, introduced in verison 3.1.0b2.
    • Fixed a bug where empty boolean searches would dump core.
    • Fixed a bug where boolean "and," "or," and "not" would be removed from a search string, causing a sytnax error.
    • Fixed a bug which wouldn't keep track of the hopcounts correctly.
    • Added support for META refresh tags, contributed by Aidas Kasparas
    • Added support for using CGI environment variables in the search templates, contributed by Gilles Detillieux.
    • Improved memory requirements slightly through fixing a memory leak in htdig and a general system-wide adjustment.
    • Improved support for multiple exclude and restrict items through htsearch, contributed by William Rhee and Gilles.
    • Improved support to compile under CygWinB20, contributed by Klaus Mueller.
    • Upgraded to the latest version (2.5.9) of the Berkeley DB
    • Added a new option server_wait_time to give a delay between connections to a server. Currently this can also affect local filesystem digging if set.
    • Added a new option server_max_docs to limit the number of documents pulled down from a server in one dig.
    • Added a new option http_proxy_exclude to ignore the proxy setting on certain URLs.
    • Added a new option no_excerpt_show_topto show the top of a document when there is no excerpt.
    • Added new options date_factor, backlink_factor, and description_factor to improve search rankings. Respectively, they can give higher rankings to more recent documents, documents with a high number of links pointing to them, and documents with relevant URL descriptions pointing to them. See the documentation for more information.
    • Added a set of contributed scripts called multidig to help work with multiple sets of URLs and databases.
    • Fixed many compilation problems under AIX, thanks to Alexander Bergolth!
    • Many other bugs were fixed, so a big thanks to everyone who submitted a bug report, patch or gave other feedback! See the ChangeLog for more details.

    Release notes for htdig-3.1.0b2 1 Nov 1998
    This version adds a few minor features as well as many bugfixes. It is still considered beta as some bug reports have not been fully examined.

    • Fixed a major database corruption problem. Since this bug corrupted the document databases, to completely fix it, you will need to rebuild your databases from scratch.
    • Fixed many problems with the Makefiles and configure scripts. Using ./configure --prefix= now works.
    • Added fixes for connection problems with Digital Alpha-based systems contributed by Paul J. Meyer!
    • Added support for syslog-based htsearch logging. See the config documentation for more details. Thanks to Leo Bergolth for this!
    • Added fixes to work with DNS aliases (as opposed to virtual hosts) through the server_aliases and limit_normalized options as contributed by Leo Bergolth.
    • Added cleanups of the HTML parser and the connection timeout code contributed by René Seindal.
    • Now supports case insensitive servers through the case_sensitive option.
    • Now supports ISO 8601 date format, using the iso_8601 option.
    • Added a wrapper to emulate Exite for Web Servers (EWS) contributed by John Grohol.
    • Added fixes to the contrib whatsnew.pl script to work with DB2 contributed by Jacques Reynes.
    • Added a new contributed synonyms file from John Banbury
    • Added a new template variable: CURRENT, the number of the current match, from a patch by René Seindal.
    • Many other minor bugs were fixed, so a big thanks to everyone who submitted a bug report or a patch! See the ChangeLog for more details.

    Release notes for htdig-3.1.0b1 8 Sep 1998
    This version adds several major new features as well as some bug-fixes. It is considered a beta release since it has only seen limited testing.

    It is extremely important that you rebuild all your databases made with previous versions. This version no longer uses the GDBM database format and databases produced with it will be incompatible with other versions. Do not blame me for anything if you didn't do this. You have been warned...

    • Added patches made by Pasi Eronen to support local filesystem access
    • Added a PDF parser contributed by Sylvain Wallez
    • Added support for META description and robots tags
    • Converted the database code to use the BerkeleyDB format, contibuted by Esa Ahola and Jesse op den Brouw.
    • Added a prefix fuzzy algorithm, contributed by Esa and Jesse.
    • Various other bugs were fixed. Thanks for all the patches that were sent to me and the mailing list!

    Release notes for htdig-3.0.8b2 15 Aug 1997
    This new version contains most of the patches that Pasi Eronen has posted to the list plus some other random fixes.

    Release notes for htdig-3.0.8b1 27-Apr-1997
    I consider this a beta release since I have not had time to test everything. Use at your own risk...

    • Base tag problem fixed
    • URL parser somewhat more robust
    • Date parsing bug fixed
    • Added Substring fuzzy algorithm.
    • Various other bugs were fixed. Thanks for all the patches that were sent to me!

    Release notes for htdig-3.0.7 12-Jan-1997
    More bug fixes and some minor new functionality. Hopefully, I'll be able to finish up work on version 3.1 at some point in the near future.
    I have recently received some more patches for various things, but I have not incorporated those, yet. Next version.

    • The problem with the missing words has been fixed. This was a problem in the Dictionary class.
    • htsearch is a *lot* faster due to a patch by Esa Ahola.
    • htfuzzy has some work done to it. With the addition of the new rx-1.4 library, the endings algorithm now actually works for languages other than English... It still takes an awfully long time to build the tables for languages with lots of rules.
    • URLs now can be of the dubious form http:foo.html I have never seen this used and think it is bogus, but alas, it works now.
    • A search form can now manually add words to any search using the new keywords form attribute.
    • A problem in the plaintext parser used to cause bogus HTML in search results. This has been fixed.
    • New documentation format. Lots of new documentation, as well.
    • New robotstxt_name attribute. Used to match the 'user-agent' lines in robots.txt files.
    • The <base> tag is now properly supported.
    • Preliminary support for lots of new features, including:
      • External document parsers. You'll be able to write your own document parser for that special document type that ht://Dig doesn't know about.
      • New fuzzy search algorithms: substring, regex, globbing, etc.

    Release notes for htdig-3.0.6 26-Oct-1996
    Just a single bug fix and one additional feature in this release.

    • Fixed the problem that caused frequent crashes with virtual memory exhausted.
    • Added a new attribute, keywords_meta_tag_names, which should contain a list of meta tag names for which the content should be used as keywords. The default is set to "keywords htdig-keywords"

    Release notes for htdig-3.0.5 13-Oct-1996
    This release consists of more bug fixes.
    I want to thank Elliot Lee <sopwith@cuc.edu> for his help with tracking down several bugs.

    • Fixed problem with accent characters. Words with SGML entities and iso-8859-1 characters will now be indexed correctly.
    • Changed the auto configuration to detect the need for a prototype for the gethostname() function. (This was supposed to be fixed before, but wasn't)
    • Reduced the memory requirements for all the programs by changing the rehash() method in the Dictionary class. Access to hashes may be a little slower, but the memory requirements were reduced by a factor 10 or so.
    • Hopefully fixed a problem with the time related functions on certain platforms. More checks are done to make sure the functions that are used are actually available.

    Release notes for htdig-3.0.4 2-Sep-1996
    The previous version failed to build under Linux. This should be fixed now.

    • Fixed problem with the time stuff which caused the build of htdig to fail.
    • Fixed a memory problem in htdig

    Release notes for htdig-3.0.3 2-Sep-1996
    Bugs bugs bugs... Will they ever all be found?

    NOTE: I made extensive changes to the htdig.conf file that gets installed. I would advise you to remove or rename your existing htdig.conf and let the installation process create a new one for you that you can then modify.

    Also, since the rundig script has changed, you should remove the old one before installing ht://Dig. (The installation will refuse to overwrite existing files...)

    • The problem with htsearch crashing on some machines has been fixed.
    • A bug caused the <AREA> tab to be ignored. Fixed.
    • A bug in SunOS caused dates to be all screwed up.
    • Added lots of comments to the example htdig.conf file. Also added some additional example attributes.
    • Fixed a bug in the installation process which caused rundig to be created incorrectly.
    • Added a sample synonyms file. Also modified rundig to create a synonyms database for it.

    Release notes for htdig-3.0.2 22-Aug-1996
    More bug fixes.

    • Multiple start URLs now actually work. Before they were just documented to work, but didn't actually work.
    • htmerge now will refuse to remove database files if it detects that the call to /bin/sort failed.
    • htmerge can now tell /bin/sort to use a specific temporary directory. This is done by setting the TMPDIR environment variable.
    • htsearch can now search for words with non-ASCII characters in them.
    • Added support for finding URLs in the <frame> and <area> tags.
    • There is a problem with htsearch under Linux. It causes a segmentation violation after the first search result is displayed. Don't know what the problem is, yet.
    • Fixed bug in the auto configuration which always set the value for NEED_PROTO_GETHOSTNAME to 1. For most systems this actually needs to be 0.
    • Release notes for htdig-3.0.1 16-Aug-1996
      This is a maintenance release in response to several bug reports.
      • htdig now will display a list of errors when the statistics option (-s) is used. The list gives the URL that caused the error and a URL that referred to it. Hopefully this information is useful for site maintainers.
      • Some problems with the SGML character entities were fixed. The major symptom was that the ';' that ends an entity used to be included as well.
      • Major problems with htnotify were fixed. There were many hardcoded things in this program that made it very specific to SDSU and to me.
      • malloc.h should not be included anymore. All references to it were replaced with stdlib.h instead. This should make compiles on some platforms work better.
      • htsearch now will use the CONFIG_DIR environment variable to override the compiled in default. (set in the CONFIG file...) This was done so that htsearch can be called from a simple wrapper that sets that environment variable. Only the wrapper needs to be be modified to get different CONFIG_DIR values.

    Release notes for htdig-3.0 17-Jul-1996
    I decided to make this the official 3.0 release.

    It is extremely important that you remove all traces of earlier beta versions of the software before installing this version or that you install in a completely different location. Do not blame me for anything if you didn't do this. You have been warned...
    • htwrapper is no more. htsearch is now the CGI program
    • htsearch now uses templates to display the results. A template is simply a piece of HTML code for a single match. The HTML code includes variables that will be expanded to the various items that are unique to each match, like URL, EXCERPT, TITLE, etc. The template can be selected at search time (through a menu). There are two builtin templates: builtin-short and builtin-long. The builtin-short template just lists the stars and title while the builtin-long template lists results in a similar fashion to the way Alta Vista displays results.
    • Many runtime configuration options have been removed and many new ones have been added. Check the configuration file documentation for details. There are also some enhancements to the format of the configuration file.
      • Attribute values can now span multiple lines by ending each line that needs to be continued with a backslash ('\'). The file that is specified is read in and all newlines and starting and trailing whitespaces are reduced to a single space. If the file is not found, nothing is included and no error is flagged.
        Note that the backquote character is used, not the regular quote character.
      • Attribute values can now include the contents of files. Just put the filename in back-quotes. The filename can use the normal variable expansion so that things like:
        someattribute: `${common_dir}/somefile`
      Notable attribute changes:
      • All the attributes that set the heading text have been removed. These attributes include:
        • accessed_heading_text
        • datesize_heading_text
        • descriptions_heading_text
        • excerpt_heading_text
        • modified_heading_text
        • score_heading_text
        • size_heading_text
        • url_heading_text
        • wordlist_heading_text
        • field_order
      • New attributes added:
        http_proxy
        Added to support the use of a HTTP proxy server to index documents
        locale
        Added to support international character sets
        match_method
        New way of specifying if a search is an 'or', 'and', or 'boolean' search
        matches_per_page
        The new paged results uses this
        max_doc_size
        Limit the size of documents retrieved
        next_page_text
        Used in the navigation between pages
        no_excerpt_text
        Text displayed if no excerpt was available (this used to be hard-coded)
        no_next_page_text
        Used in the navigation between pages
        no_prev_page_text
        Used in the navigation between pages
        prev_page_text
        Used in the navigation between pages
        star_patterns
        Allow different star images to be used depending on the match URL
        synonym_dictionary
        Support for the new synonyms fuzzy algorithm
        synonym_db
        Support for the new synonyms fuzzy algorithm
        syntax_error_file
        HTML file displayed if there was a boolean expression syntax error
        template_map
        Used in the support for the new result display templates
        template_name
        Sets the default template name
        text_factor
        Added to allow normal text to have a variable weight (0, for example...)
      • Some form tag names have changed. The list of recognized form tags are in the htsearch documentation.
      • Multiple start urls can be specified as a value to the 'start_url' attribute. This could be combined with the file inclusion to read in a file of URLs to start with.
      • htdig now sends the 'Referer:' header in HTTP requests so that any link errors will be logged in the server's log files.
      • In addition to the "htdig-keywords" META tag name, htdig now also supports just "keywords". This is to make it more compatible with the Alta Vista search engine.
      • The verbose display of htdig was enhanced to show '+' for a link that will be followed and '-' for a link that was discarded.
      • htmerge was changed to use the Unix sort program instead of doing its own sorting. It no longer uses mmap() to map the words into memory. This was causing problems on systems with limited virtual memory available. (What??? You mean you DON'T have at least a 1GB disk dedicated to swap???)
      • The Endings algorithm was fixed up to work properly now. There were several well hidden bugs that made the algorithm come up with illegal words.
      • The synonyms fuzzy algorithm was added. This is simply a mapping of words to other words. The input file is just a list of words which causes the first word on a line to be mapped to the rest of the words on that line. (We use this to map course abbreviations to full course names)
      • SGML entities are now supported. They are translated to their equivalent ISO-8859-1 encoding.

    Release notes for htdig-3.0b5

    • The configuration has changed. There is now a CONFIG file which contains all the variables which control where things get installed. 'make install' will now actually attempt to set everything up with default or example files.
      Note that some default directories have changed. For example, the default configuration file location is not /usr/local/etc/htdig.conf anymore. Instead it is now defined in terms of CONFIG_DIR.
    • The htfuzzy/createDict.pl Perl program has been obsoleted. Creating the endings database is now done by htfuzzy itself. If you already have endings databases, you don't need to recreate them, they will still work.
    • GNU rx-1.0 is now included with the distribution. This is used by htfuzzy to create the endings databases.
    • The name of the whole search system has changed from HTDig to ht://Dig.
    • The HTML documentation got a big facelift! This includes the new logo for ht://Dig. (Thanks goes to Keith Parks for the Images!)
    • htsearch got a new option '-r' which will allow it to produce raw output. This output can easily parsed by a wrapper program to produce custom HTML or other output for the search results.

    Last modified: $Date: 2004/06/12 13:39:12 $ htdig-3.2.0b6/htdoc/THANKS.html0100644006314600127310000001464010057557447015365 0ustar angusgbhtdig ht://Dig: Thanks

    ht://Dig: Thanks

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    As with most development projects, contributions come from many people and in many forms. The ht://Dig project would like to thank its many contributors. Omissions are merely accidental, please e-mail the htdig-dev list if you have been left out or a contribution is not mentioned.

    Active Developers (in alphabetical order)

    • Lachlan Andrew for much testing, debugging, continual help and cracking of the whip.
    • Gabriele Bartolini for the new htnet and date/time code and continual help.
    • Jim Cole for testing, debugging, and being a big help on the mailing lists.
    • Loic Dachary for Berkeley DB compression, automake/libtool customization, word database implementation, regression tests, fixes using Purify.
    • Gilles Detillieux for uncountable bug-fixes, feature enhancements, RedHat RPMs, and documentation updates.
    • Geoff Hutchison for filling in as maintainer, dreaming up implementations, and handling many of the little details.
    • Torsten Neuer for a variety of bug-fixes, suggestions, and the contributed PHP wrapper.
    • Toivo Pedaste for fixing memory leaks and various bugs and contributing md5 duplicate-detection code.
    • Neal Richter for the native Win32 port, libhtdig development, testing and debugging.
    • Quim Sanmarti for providing a new htsearch query parser in qtest.

    Additional Contributors:

    • Sergey Abdurashitov for some nifty htsearch formatting options.
    • D.J. Adams for contributing the doc2html external converter.
    • Esa Ahloa for the Prefix fuzzy algorithm, for the DB2 backend and many bug fixes.
    • Jerome Alet for bugfixes in the htsearch CGI.
    • Andy Armstrong for contributing regex-based URL rewriting.
    • John Banbury for his contributed synonym file.
    • Richard Beton for his rewrite of htnotify, including one message per e-mail address and customizable messages.
    • Alexander Bergolth for bug fixes, htsearch logging, and other features.
    • Andrew Bishop for many bug fixes and gentle prodding.
    • Pontus Borg for fixes under AIX.
    • Marcel Bosc for improvements in the word database implementation.
    • Lorenzo Campedelli for fixing problems with phrase searching.
    • Vadim Chekan for many bug fixes and the new configuration parser.
    • Matthew Daniel for nph-CGI support.
    • Ákos Dömötör for unaccented search-match code.
    • Jennifer Dudley for fixing an infinite loop in htdig's local_urls handling.
    • Peter Enderborg for bug fixes in the plaintext parser.
    • Pasi Eronen for countless memory patches, virtual hosting, and local file digging.
    • Iosif Fettich for improving internationalization support.
    • Tim Frost for fixing URLs with single quotes.
    • Didier Gautheron for fixing many bugs and general improvements.
    • Joshua Gerth for contributing HTTPS support to 3.2 using OpenSSL.
    • Peter Gray for contributing support for regex in config attributes.
    • Bernhard Griener for argument checks in mystrncasecmp().
    • John Grohol for the EWS wrapper script.
    • Jason Haar for a fix to htnotify's e-mail header syntax.
    • Zvi Har'El for bug reports and patches.
    • Werner Hett for discovering a security hole in htnotify.
    • Rajendra Inamdar for contributing htsearch collection support.
    • Joe Jah for bug fixes and maintaining the ht://Dig patch archive at ftp://sol.ccsf.cc.ca.us/htdig-patches/.
    • Richard Jones for his contributed MS Word external parser.
    • Aidas Kasparas for contributing support for META refresh tags.
    • Marjolein Katsma for implementing anchors in excerpts and parsing comments and many updates to the documentation.
    • Ric Klaren for patches to the Makefiles and help with RPM support.
    • Maren Leizoala for countless bug reports and thorough testing.
    • David Lippi for testing and improving RTF2HTML.
    • Benoit Majeau for contributing additional URL debugging info.
    • Robert Marchand for contributing the accents fuzzy algorithm.
    • Paul Meyer for fixing connection code on Dec Alpha environments.
    • Alexis Mikhailov for contributing better support for local filesystem indexing.
    • Hanno Mueller for script_name patch and examples.
    • Klaus Mueller for working out a Win32 port using CygWin.
    • Marco Nenciarini for the new autotools support and the conditional removal of deprecated include files.
    • Hans-Peter Nilsson for many bug fixes and other contributions.
    • Tobias Oetiker for fixes to the timeout system.
    • Jesse op den Brouw for the DB2 backend and survey and the parse_word_doc script.
    • Marc Pohl for 8-bit clean patch for Solaris, other bug fixes.
    • Arthur Prokosch for fixing problems with phrase searching.
    • William Rhee for improving support with multiple excludes and restricts
    • Jacques Reynes for updates to the whatsnew script.
    • Robert Ribnitz and the Debian Project for maintaining the man pages.
    • Chris-Jason Richards for fixing htnotify under sendmail.
    • Phillippe Rochat for fixing whitespace detection in config files.
    • Markus Röhricht for help debugging a database error under CygWin.
    • Andrew Scherpbier for being the original author and leading the project.
    • René Seindal for updates to the HTML parser and the timeout mechanism.
    • Benjamin Smedberg for help with the ht://Dig website.
    • Jan Sorensen for allowing parsing of 8-bit text without compiler options.
    • Sylvain Wallez for the PDF parser.
    • Randy Winch for contributing zlib document compression.
    • And many others who made bug reports and suggested changes to the code!

    Last modified: $Date: 2004/06/03 08:19:51 $ htdig-3.2.0b6/htdoc/TODO.html0100644006314600127310000000617710055635545015142 0ustar angusgbhtdig ht://Dig: TODO list

    TODO list

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Here is a list of things have been requested or that are in the works. They in no particular order. Tasks that are outstanding are designated with a square. Tasks which are complete but not in the current release yet are designated with a circle, and tasks which have been completed and are in the current release are designated with a bullet.

    Feature requests and bug reports are always welcome. They should be sent to <htdig3-bugs@htdig.org>

    • Redesign the database backend to support additional enhancements:
      • Phrase searching
      • Field-based searching
      • "Collections" of multiple databases
      • Continual indexing
      • Parallel indexing and searching
    • Add support for BSDI make program
    • Add support for different transport protocols
      • Gopher
      • FTP
      • local filesystem
      • HTTP-PROXY
      • HTTPS
      • HTTP/1.1
    • Better Internationalization
      • Support for UTF-8
      • Allow character translation (e.g. remove accents)
    • Better examples of configuration and result templates
    • Eliminate or detect duplicate documents
    • Send one e-mail per author using htnotify
    • Allow "external decoders," programs to perform some action on files before parsing.
      • Compress, gzip, bzip2, zlib decoders
      • DVI, TeX -> PS decoders
    • AltaVista style +/- boolean queries
    • Support for browser cookies
    • Search improvements
      • Phrase searching
      • New fuzzy search types
        • Automatic spelling correction
        • Trigram matching
        • Regex word match
        • Accent stripping

    Last modified: $Date: 2004/05/28 13:15:17 $ htdig-3.2.0b6/htdoc/all.html0100644006314600127310000001073510055635545015140 0ustar angusgbhtdig ht://Dig: Overview of Programs

    Overview of Programs

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    There are several programs in the ht://Dig package.

    htdig

    Digging is the first step in creating a search database. This system uses the word digging while other systems call it harvesting or gathering. In the ht://Dig system, the program htdig performs the information gathering stage. In this process, the program will act as a regular web user, except that it will follow all hyperlinks that it comes across. (Actually, it will not follow all of them, just those that are within the domain it needs to gather information on...)
    Each document it goes to is examined and all the unique words in this document are extracted and stored.

    The digging process will only follow links and has no notion of JavaScript, applets, or user-input forms.


    htsearch

    Searching is where the users actually get to use all the information that was gathered during the dig and merge stages. The htsearch program performs the actual searches. It typically produces HTML output which will be seen by the users, though other text formats could be generated by editing the output templates.


    htmerge

    Merging does exactly that--it merges one database into another. In previous versions of ht://Dig, the htmerge program also formed databases for use by htsearch from the htdig output. This process is now largely unnecessary except for removal of invalid URLs which is now done by the htpurge program.


    htpurge

    Purging removes documents and the associated words from the databases. This should be done after running htdig to remove invalid URLs, documents marked not to be indexed, old versions of modified documents, etc. You can also specify specific URLs to be removed explicitly by htpurge.


    htload

    Loading involves importing the contents of the databases from formatted ASCII text documents as created by htdump or the -t flag from htdig. This is, of course, destructive by nature and data from the text files will replace any conflicting data in the databases.


    htdump

    Dumping involves exporting the contents of the databases to formatted ASCII text documents. This can be useful for backups, transferring databases between different operating systems, changing the compression or encodings in the ht://Dig configuration, parsing by external utilities. It is not recommended to edit these files by hand, so be warned! (Minor edits will probably be fine.)


    htstat

    The htstat program returns statistics on the databases, similar to the -s flags for some of the programs. In addition, it can return a list of URLs in the databases.


    htnotify

    The ht://Dig system includes a handy reminder service which allows HTML authors to add some ht://Dig specific meta information in HTML documents. This meta information is used to email authors after a specified date. Very useful to maintain lists that contain those annoying "new" graphics with new items. (Hint: Things really aren't all that new anymore after 6 months!)


    htfuzzy

    To allow the searches to use "fuzzy" algorithms to match words, the htfuzzy program can create indexes for several different algorithms.


    Last modified: $Date: 2004/05/28 13:15:17 $ htdig-3.2.0b6/htdoc/attrs.html.in0100644006314600127310000101153710062603600016115 0ustar angusgbhtdig ht://Dig: Configuration file attributes

    Configuration file format -- Attributes

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Alphabetical list of attributes


    accents_db
    type:
    string
    used by:
    htfuzzy, htsearch
    default:
    ${database_base}.accents.db
    block:
    Global
    version:
    all
    description:
    The database file used for the fuzzy "accents" search algorithm. This database is created by htfuzzy and used by htsearch.
    example:
    accents_db: ${database_base}.uml.db

    accept_language
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    Server
    version:
    3.2.0b4 or later
    description:
    This attribute allows you to restrict the set of natural languages that are preferred as a response to an HTTP request performed by the digger. This can be done by putting one or more language tags (as defined by RFC 1766) in the preferred order, separated by spaces. By doing this, when the server performs a content negotiation based on the 'accept-language' given by the HTTP user agent, a different content can be shown depending on the value of this attribute. If set to an empty list, no language will be sent and the server default will be returned.
    example:
    accept_language: en-us en it

    add_anchors_to_excerpt
    type:
    boolean
    used by:
    htsearch
    default:
    true
    block:
    Global
    version:
    3.1.0 or later
    description:
    If set to true, the first occurrence of each matched word in the excerpt will be linked to the closest anchor in the document. This only has effect if the EXCERPT variable is used in the output template and the excerpt is actually going to be displayed.
    example:
    add_anchors_to_excerpt: no

    allow_double_slash
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    If set to true, strings of multiple slashes ('/') in URL paths will be left intact, rather than being collapsed. This is necessary for some search engine URLs which use slashes to separate fields rather than to separate directory components. However, it can lead to multiple database entries refering to the same file, and it causes '/foo//../' to be equivalent to '/foo/', rather than to '/'.
    example:
    allow_double_slash: true

    allow_in_form
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.0 or later
    description:
    Allows the specified config file attributes to be specified in search forms as separate fields. This could be used to allow form writers to design their own headers and footers and specify them in the search form. Another example would be to offer a menu of search_algorithms in the form.
      <SELECT NAME="search_algorithm">
      <OPTION VALUE="exact:1 prefix:0.6 synonyms:0.5 endings:0.1" SELECTED>fuzzy
      <OPTION VALUE="exact:1">exact
      </SELECT>
    The general idea behind this is to make an input parameter out of any configuration attribute that's not already automatically handled by an input parameter. You can even make up your own configuration attribute names, for purposes of passing data from the search form to the results output. You're not restricted to the existing attribute names. The attributes listed in the allow_in_form list will be settable in the search form using input parameters of the same name, and will be propagated to the follow-up search form in the results template using template variables of the same name in upper-case. You can also make select lists out of any of these input parameters, in the follow-up search form, using the build_select_lists configuration attribute.
    WARNING: Extreme care are should be taken with this option, as allowing CGI scripts to set file names can open security holes.
    example:
    allow_in_form: search_algorithm search_results_header

    allow_numbers
    type:
    boolean
    used by:
    htdig, htsearch
    default:
    false
    block:
    Global
    version:
    all
    description:
    If set to true, numbers are considered words. This means that searches can be done on strings of digits as well as regular words. All the same rules apply to numbers as to words. This does not cause numbers containing a decimal point or commas to be treated as a single entity. When allow_numbers is false, words are stil allowed to contain digits, but they must also contain at least one alphabetic character or extra word character. To disallow digits in words, add the digits to valid_punctuation.
    example:
    allow_numbers: true

    allow_space_in_url
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.2.0b6 or later
    description:
    If set to true, htdig will handle URLs that contain embedded spaces. Technically, this is a violation of RFC 2396, which says spaces should be stripped out (as htdig does by default). However, many web browsers and HTML code generators violate this standard already, so enabling this attribute allows htdig to handle these non-compliant URLs. Even with this attribute set, htdig still strips out all white space (leading, trailing and embedded), except that space characters embedded within the URL will be encoded as %20.
    example:
    allow_space_in_url: true

    allow_virtual_hosts
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Global
    version:
    3.0.8b2 or later
    description:
    If set to true, htdig will index virtual web sites as expected. If false, all URL host names will be normalized into whatever the DNS server claims the IP address to map to. If this option is set to false, there is no way to index either "soft" or "hard" virtual web sites.
    example:
    allow_virtual_hosts: false

    anchor_target
    type:
    string
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    When the first matched word in the excerpt is linked to the closest anchor in the document, this string can be set to specify a target in the link so the resulting page is displayed in the desired frame. This value will only be used if the add_anchors_to_excerpt attribute is set to true, the EXCERPT variable is used in the output template and the excerpt is actually displayed with a link.
    example:
    anchor_target: body

    any_keywords
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    If set to true, the words in the keywords input parameter in the search form will be joined with logical ORs rather than ANDs, so that any of the words provided will do. Note that this has nothing to do with limiting the search to words in META keywords tags. See the search form documentation for details on this.
    example:
    any_keywords: yes

    author_factor
    type:
    number
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    Weighting applied to words in a <meta name="author" ... > tag.
    See also heading_factor.
    example:
    author_factor: 1

    authorization
    type:
    string
    used by:
    htdig
    default:
    No default
    block:
    URL
    version:
    3.1.4 or later
    description:
    This tells htdig to send the supplied username:password with each HTTP request. The credentials will be encoded using the "Basic" authentication scheme. There must be a colon (:) between the username and password.
    This attribute can also be specified on htdig's command line using the -u option, and will be blotted out so it won't show up in a process listing. If you use it directly in a configuration file, be sure to protect it so it is readable only by you, and do not use that same configuration file for htsearch.
    example:
    authorization: myusername:mypassword

    backlink_factor
    type:
    number
    used by:
    htsearch
    default:
    0.1
    block:
    Global
    version:
    3.1.0 or later
    description:
    This is a weight of "how important" a page is, based on the number of URLs pointing to it. It's actually multiplied by the ratio of the incoming URLs (backlinks) and outgoing URLs (links on the page), to balance out pages with lots of links to pages that link back to them. The ratio gives lower weight to "link farms", which often have many links to them. This factor can be changed without changing the database in any way. However, setting this value to something other than 0 incurs a slowdown on search results.
    example:
    backlink_factor: 501.1

    bad_extensions
    type:
    string list
    used by:
    htdig
    default:
    .wav .gz .z .sit .au .zip .tar .hqx .exe .com .gif .jpg .jpeg .aiff .class .map .ram .tgz .bin .rpm .mpg .mov .avi .css
    block:
    URL
    version:
    all
    description:
    This is a list of extensions on URLs which are considered non-parsable. This list is used mainly to supplement the MIME-types that the HTTP server provides with documents. Some HTTP servers do not have a correct list of MIME-types and so can advertise certain documents as text while they are some binary format. If the list is empty, then all extensions are acceptable, provided they pass other criteria for acceptance or rejection. See also valid_extensions.
    example:
    bad_extensions: .foo .bar .bad

    bad_local_extensions
    type:
    string list
    used by:
    htdig
    default:
    .php .shtml .cgi
    block:
    URL
    version:
    all
    description:
    This is a list of extensions on URLs which must be retrieved using the URL's true transport mechanism (such as HTTP). If local_urls is specified, URLs not ending with these extensions may instead be retrieved through the local filesystem for efficiency.
    example:
    No example provided

    bad_querystr
    type:
    pattern list
    used by:
    htdig
    default:
    No default
    block:
    URL
    version:
    3.1.0 or later
    description:
    This is a list of CGI query strings to be excluded from indexing. This can be used in conjunction with CGI-generated portions of a website to control which pages are indexed.
    example:
    bad_querystr: forum=private section=topsecret&passwd=required

    bad_word_list
    type:
    string
    used by:
    htdig, htsearch
    default:
    ${common_dir}/bad_words
    block:
    Global
    version:
    all
    description:
    This specifies a file which contains words which should be excluded when digging or searching. This list should include the most common words or other words that you don't want to be able to search on (things like sex or smut are examples of these.)
    The file should contain one word per line. A sample bad words file is located in the contrib/examples directory.
    example:
    bad_word_list: ${common_dir}/badwords.txt

    bin_dir
    type:
    string
    used by:
    all
    default:
    @bindir@
    block:
    Global
    version:
    all
    description:
    This is the directory in which the executables related to ht://Dig are installed. It is never used directly by any of the programs, but other attributes can be defined in terms of this one.

    The default value of this attribute is determined at compile time.

    example:
    bin_dir: /usr/local/bin

    boolean_keywords
    type:
    string list
    used by:
    htsearch
    default:
    and or not
    block:
    Global
    version:
    3.1.6 or later
    description:
    These three strings are used as the keywords used in constructing the LOGICAL_WORDS template variable, and in parsing the words input parameter when the method parameter or match_method attribute is set to boolean. See also the boolean_syntax_errors attribute.
    example:
    boolean_keywords: et ou non

    boolean_syntax_errors
    type:
    quoted string list
    used by:
    htsearch
    default:
    Expected 'a search word, a quoted phrase or a boolean expression between ()' 'at the end' 'instead of' 'end of expression' quotes
    block:
    Global
    version:
    3.1.6 or later
    description:
    These six strings are used as the keywords used to construct various syntax error messages for errors encountered in parsing the words input parameter when the method parameter or match_method attribute is set to boolean. They are used in conjunction with the boolean_keywords attribute, and comprise all English-specific parts of these error messages. The order in which the strings are put together may not be ideal, or even gramatically correct, for all languages, but they can be used to make fairly intelligible messages in many languages.
    example:
    boolean_syntax_errors: Attendait "un mot" "à la fin" "au lieu de" "fin d'expression" "guillemet"

    build_select_lists
    type:
    quoted string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This list allows you to define any htsearch input parameter as a select list for use in templates, provided you also define the corresponding name list attribute which enumerates all the choices to put in the list. It can be used for existing input parameters, as well as any you define using the allow_in_form attribute. The entries in this list each consist of an octuple, a set of eight strings defining the variables and how they are to be used to build a select list. The attribute can contain many of these octuples. The strings in the string list are merely taken eight at a time. For each octuple of strings specified in build_select_lists, the elements have the following meaning:
    1. the name of the template variable to be defined as a list, optionally followed by a comma and the type of list, and optional formatting codes
    2. the input parameter name that the select list will set
    3. the name of the user-defined attribute containing the name list
    4. the tuple size used in the name list above
    5. the index into a name list tuple for the value
    6. the index for the corresponding label on the selector
    7. the configuration attribute where the default value for this input parameter is defined
    8. the default label, if not an empty string, which will be used as the label for an additional list item for the current input parameter value if it doesn't match any value in the given list
    See the select list documentation for more information on this attribute.
    example:
    build_select_lists: MATCH_LIST matchesperpage matches_per_page_list \
    1 1 1 matches_per_page "Previous Amount" \
    RESTRICT_LIST,multiple restrict restrict_names 2 1 2 restrict "" \
    FORMAT_LIST,radio format template_map 3 2 1 template_name ""

    caps_factor
    type:
    number
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    ??
    description:
    TO BE COMPLETED
    See also heading_factor.
    example:
    caps_factor: 1

    case_sensitive
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Global
    version:
    3.1.0b2 or later
    description:
    This specifies whether ht://Dig should consider URLs case-sensitive or not. If your server is case-insensitive, you should probably set this to false.
    Even if this is false, common_url_parts, url_part_aliases and url_rewrite_rules are all still case sensitive, and server_aliases is still case insensitive.
    example:
    case_sensitive: false

    check_unique_date
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    Include the modification date of the page in the MD5 hash, to reduce the problem with identical but physically separate pages in different parts of the tree pointing to different pages.
    example:
    check_unique_date: false

    check_unique_md5
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    Uses the MD5 hash of pages to reject aliases, prevents multiple entries in the index caused by such things as symbolic links Note: May not do the right thing for incremental update
    example:
    check_unique_md5: false

    collection_names
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    This is a list of config file names that are used for searching multiple databases. Simply put, htsearch will loop through the databases specified by each of these config files and present the result of the search on all of the databases. The corresponding config files are looked up in the config_dir directory. Each listed config file must exist, as well as the corresponding databases.
    example:
    collection_names: htdig_docs htdig_bugs

    common_dir
    type:
    string
    used by:
    all
    default:
    @COMMON_DIR@
    block:
    Global
    version:
    all
    description:
    Specifies the directory for files that will or can be shared among different search databases. The default value for this attribute is defined at compile time.
    example:
    common_dir: /tmp

    common_url_parts
    type:
    string list
    used by:
    all
    default:
    http:// http://www. ftp:// ftp://ftp. /pub/ .html .htm .shtml /index.html /index.htm .com/ .com mailto:
    block:
    Global
    version:
    3.1.0 or later
    description:
    Sub-strings often found in URLs stored in the database. These are replaced in the database by an internal space-saving encoding. If a string specified in url_part_aliases, overlaps any string in common_url_parts, the common_url_parts string is ignored.
    Note that when this attribute is changed, the database should be rebuilt, unless the effect of "changing" the affected URLs in the database is wanted.
    example:
    common_url_parts: http://www.htdig.org/ml/ \
    .html \
    http://dev.htdig.org/ \
    http://www.htdig.org/

    compression_level
    type:
    integer
    used by:
    htdig
    default:
    6
    block:
    Global
    version:
    3.1.0 or later
    description:
    If non-zero and the zlib compression library was available when compiled, this attribute controls the amount of compression used in the doc_excerpt file.
    This must be in the range 0-9, and must be non-zero when wordlist_compress_zlib is used.
    example:
    compression_level: 0

    config
    type:
    string
    used by:
    all
    default:
    No default
    block:
    Global
    version:
    ??
    description:
    Name of configuration file to load. For security reasons, restrictions are placed on the values which can be specified on the command line to htsearch. The default value of this attribute is determined at compile time.
    example:
    No example provided

    config_dir
    type:
    string
    used by:
    all
    default:
    @CONFIG_DIR@
    block:
    Global
    version:
    all
    description:
    This is the directory which contains all configuration files related to ht://Dig. It is never used directly by any of the programs, but other attributes or the include directive can be defined in terms of this one.

    The default value of this attribute is determined at compile time.

    example:
    config_dir: /var/htdig/conf

    content_classifier
    type:
    string
    used by:
    htdig
    default:
    ${bin_dir}/HtFileType
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    When ht://Dig can't determine the type of a file:// URL from its extension, this program is used to determine the type. The program is called with one argument, the name of (possibly a temporary copy of) the file.

    See also mime_types.

    example:
    content_classifier: file -i -b

    cookies_input_file
    type:
    string
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    Specifies the location of the file used for importing cookies for the crawl. These cookies will be preloaded into htdig's in-memory cookie jar, but aren't written back to the file. Cookies are specified according to Netscape's format (tab-separated fields). If this attribute is left blank, no cookie file will be read. For more information, see the sample cookies.txt file in the ht://Dig source distribution.
    example:
    cookies_input_file: ${common_dir}/cookies.txt

    create_image_list
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    all
    description:
    If set to true, a file with all the image URLs that were seen will be created, one URL per line. This list will not be in any order and there will be lots of duplicates, so after htdig has completed, it should be piped through sort -u to get a unique list.
    example:
    create_image_list: yes

    create_url_list
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    all
    description:
    If set to true, a file with all the URLs that were seen will be created, one URL per line. This list will not be in any order and there will be lots of duplicates, so after htdig has completed, it should be piped through sort -u to get a unique list.
    example:
    create_url_list: yes

    database_base
    type:
    string
    used by:
    all
    default:
    ${database_dir}/db
    block:
    Global
    version:
    all
    description:
    This is the common prefix for files that are specific to a search database. Many different attributes use this prefix to specify filenames. Several search databases can share the same directory by just changing this value for each of the databases.
    example:
    database_base: ${database_dir}/sales

    database_dir
    type:
    string
    used by:
    all
    default:
    @DATABASE_DIR@
    block:
    Global
    version:
    all
    description:
    This is the directory which contains all database and other files related to ht://Dig. It is never used directly by any of the programs, but other attributes are defined in terms of this one.

    The default value of this attribute is determined at compile time.

    example:
    database_dir: /var/htdig

    date_factor
    type:
    number
    used by:
    htsearch
    default:
    0
    block:
    Global
    version:
    3.1.0 or later
    description:
    This factor, gives higher rankings to newer documents and lower rankings to older documents. Before setting this factor, it's advised to make sure your servers are returning accurate dates (check the dates returned in the long format). Additionally, setting this to a nonzero value incurs a small performance hit on searching.
    example:
    date_factor: 0.35

    date_format
    type:
    string
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.2 or later
    description:
    This format string determines the output format for modification dates of documents in the search results. It is interpreted by your system's strftime function. Please refer to your system's manual page for this function, for a description of available format codes. If this format string is empty, as it is by default, htsearch will pick a format itself. In this case, the iso_8601 attribute can be used to modify the appearance of the date.
    example:
    date_format: %Y-%m-%d

    description_factor
    type:
    number
    used by:
    htsearch
    default:
    150
    block:
    Global
    version:
    3.1.0b3 or later
    description:
    Plain old "descriptions" are the text of a link pointing to a document. This factor gives weight to the words of these descriptions of the document. Not surprisingly, these can be pretty accurate summaries of a document's content. See also heading_factor and meta_description_factor.
    example:
    description_factor: 350

    description_meta_tag_names
    type:
    string list
    used by:
    htdig
    default:
    description
    block:
    Global
    version:
    3.1.6 or later
    description:
    The words in this list are used to search for descriptions in HTML META tags. This list can contain any number of strings that each will be seen as the name for whatever description convention is used. While words in any of the specified description contents will be indexed, only the last meta tag containing a description will be kept for the variable in search results. The order in which the names are specified in this configuration attribute is irrelevant, as it is the order in which the tags appear in the documents that matters.
    The META tags have the following format:
      <META name="somename" content="somevalue">
    See also
    meta_description_factor.
    example:
    description_meta_tag_names: "description htdig-description"

    disable_cookies
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Server
    version:
    3.2.0b4 or later
    description:
    This option, if set to true, will disable HTTP cookies.
    example:
    disable_cookies: true

    doc_db
    type:
    string
    used by:
    all
    default:
    ${database_base}.docdb
    block:
    Global
    version:
    all
    description:
    This file will contain a Berkeley database of documents indexed by document number. It contains all the information gathered for each document, except the document excerpts which are stored in the doc_excerpt file.
    example:
    doc_db: ${database_base}documents.db

    doc_excerpt
    type:
    string
    used by:
    all
    default:
    ${database_base}.excerpts
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This file will contain a Berkeley database of document excerpts indexed by document number. It contains all the text gathered for each document, so this file can become rather large if max_head_length is set to a large value. The size can be reduced by setting the compression_level, if supported on your system.
    example:
    doc_excerpt: ${database_base}excerpts.db

    doc_index
    type:
    string
    used by:
    htdig
    default:
    ${database_base}.docs.index
    block:
    Global
    version:
    all
    description:
    This file contains a mapping of document numbers to URLs and is used by htdig during indexing. It is used on updates if it exists.
    example:
    doc_index: documents.index.db

    doc_list
    type:
    string
    used by:
    htdig, htdump, htload
    default:
    ${database_base}.docs
    block:
    Global
    version:
    all
    description:
    This file is basically a text version of the file specified in doc_db. Its only use is to have a human readable database of all documents. The file is easy to parse with tools like perl or tcl.
    example:
    doc_list: /tmp/documents.text

    endday
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    Day component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a GCI argument. See also startyear.
    example:
    endday: 31

    end_ellipses
    type:
    string
    used by:
    htsearch
    default:
    <strong><code> ...</code></strong>
    block:
    Global
    version:
    all
    description:
    When excerpts are displayed in the search output, this string will be appended to the excerpt if there is text following the text displayed. This is just a visual reminder to the user that the excerpt is only part of the complete document.
    example:
    end_ellipses: ...

    end_highlight
    type:
    string
    used by:
    htsearch
    default:
    </strong>
    block:
    Global
    version:
    3.1.4 or later
    description:
    When excerpts are displayed in the search output, matched words will be highlighted using start_highlight and this string. You should ensure that highlighting tags are balanced, that is, this string should close any formatting tag opened by start_highlight.
    example:
    end_highlight: </font>

    endings_affix_file
    type:
    string
    used by:
    htfuzzy
    default:
    ${common_dir}/english.aff
    block:
    Global
    version:
    all
    description:
    Specifies the location of the file which contains the affix rules used to create the endings search algorithm databases. Consult the documentation on htfuzzy for more information on the format of this file.
    example:
    endings_affix_file: /var/htdig/affix_rules

    endings_dictionary
    type:
    string
    used by:
    htfuzzy
    default:
    ${common_dir}/english.0
    block:
    Global
    version:
    all
    description:
    Specifies the location of the file which contains the dictionary used to create the endings search algorithm databases. Consult the documentation on htfuzzy for more information on the format of this file.
    example:
    endings_dictionary: /var/htdig/dictionary

    endings_root2word_db
    type:
    string
    used by:
    htfuzzy, htsearch
    default:
    ${common_dir}/root2word.db
    block:
    Global
    version:
    all
    description:
    This attributes specifies the database filename to be used in the 'endings' fuzzy search algorithm. The database maps word roots to all legal words with that root. For more information about this and other fuzzy search algorithms, consult the htfuzzy documentation.
    Note that the default value uses the common_dir attribute instead of the database_dir attribute. This is because this database can be shared with different search databases.
    example:
    endings_root2word_db: /var/htdig/r2w.db

    endings_word2root_db
    type:
    string
    used by:
    htfuzzy, htsearch
    default:
    ${common_dir}/word2root.db
    block:
    Global
    version:
    all
    description:
    This attributes specifies the database filename to be used in the 'endings' fuzzy search algorithm. The database maps words to their root. For more information about this and other fuzzy search algorithms, consult the htfuzzy documentation.
    Note that the default value uses the common_dir attribute instead of the database_dir attribute. This is because this database can be shared with different search databases.
    example:
    endings_word2root_db: /var/htdig/w2r.bm

    endmonth
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    Month component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a GCI argument. See also startyear.
    example:
    endmonth: 12

    endyear
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    Year component of last date allowed as last-modified date of returned docutments. This is most usefully specified as a GCI argument. See also startyear.
    example:
    endyear: 2002

    excerpt_length
    type:
    integer
    used by:
    htsearch
    default:
    300
    block:
    Global
    version:
    all
    description:
    This is the maximum number of characters the displayed excerpt will be limited to. The first matched word will be highlighted in the middle of the excerpt so that there is some surrounding context.
    The start_ellipses and end_ellipses are used to indicate that the document contains text before and after the displayed excerpt respectively. The start_highlight and end_highlight are used to specify what formatting tags are used to highlight matched words.
    example:
    excerpt_length: 500

    excerpt_show_top
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    all
    description:
    If set to true, the excerpt of a match will always show the top of the matching document. If it is false (the default), the excerpt will attempt to show the part of the document that actually contains one of the words.
    example:
    excerpt_show_top: yes

    exclude
    type:
    pattern list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    If a URL contains any of the space separated patterns, it will be discarded in the searching phase. This is used to exclude certain URLs from search results. The list can be specified from within the configuration file, and can be overridden with the "exclude" input parameter in the search form.
    example:
    exclude: myhost.com/mailarchive/

    exclude_urls
    type:
    pattern list
    used by:
    htdig
    default:
    /cgi-bin/ .cgi
    block:
    URL
    version:
    all
    description:
    If a URL contains any of the space separated patterns, it will be rejected. This is used to exclude such common things such as an infinite virtual web-tree which start with cgi-bin.
    example:
    exclude_urls: students.html cgi-bin

    external_parsers
    type:
    quoted string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.0.7 or later
    description:
    This attribute is used to specify a list of content-type/parsers that are to be used to parse documents that cannot by parsed by any of the internal parsers. The list of external parsers is examined before the builtin parsers are checked, so this can be used to override the internal behavior without recompiling htdig.
    The external parsers are specified as pairs of strings. The first string of each pair is the content-type that the parser can handle while the second string of each pair is the path to the external parsing program. If quoted, it may contain parameters, separated by spaces.
    External parsing can also be done with external converters, which convert one content-type to another. To do this, instead of just specifying a single content-type as the first string of a pair, you specify two types, in the form type1->type2, as a single string with no spaces. The second string will define an external converter rather than an external parser, to convert the first type to the second. If the second type is user-defined, then it's up to the converter script to put out a "Content-Type: type" header followed by a blank line, to indicate to htdig what type it should expect for the output, much like what a CGI script would do. The resulting content-type must be one that htdig can parse, either internally, or with another external parser or converter.
    Only one external parser or converter can be specified for any given content-type. However, an external converter for one content-type can be chained to the internal parser for the same type, by appending -internal to the second type string (e.g. text/html->text/html-internal) to perform external preprocessing on documents of this type before internal parsing. There are two internal parsers, for text/html and text/plain.

    The parser program takes four command-line parameters, not counting any parameters already given in the command string:
    infile content-type URL configuration-file
    Parameter Description Example
    infile A temporary file with the contents to be parsed. /var/tmp/htdext.14242
    content-type The MIME-type of the contents. text/html
    URL The URL of the contents. http://www.htdig.org/attrs.html
    configuration-file The configuration-file in effect. /etc/htdig/htdig.conf

    The external parser is to write information for htdig on its standard output. Unless it is an external converter, which will output a document of a different content-type, then its output must follow the format described here.
    The output consists of records, each record terminated with a newline. Each record is a series of (unless expressively allowed to be empty) non-empty tab-separated fields. The first field is a single character that specifies the record type. The rest of the fields are determined by the record type.
    Record type Fields Description
    w word A word that was found in the document.
    location A number indicating the normalized location of the word within the document. The number has to fall in the range 0-1000 where 0 means the top of the document.
    heading level A heading level that is used to compute the weight of the word depending on its context in the document itself. The level is in the range of 0-11 and are defined as follows:
    0
    Normal text
    1
    Title text
    2
    Heading 1 text
    3
    Heading 2 text
    4
    Heading 3 text
    5
    Heading 4 text
    6
    Heading 5 text
    7
    Heading 6 text
    8
    text alternative to images
    9
    Keywords
    10
    Meta-description
    11
    Author
    u document URL A hyperlink to another document that is referenced by the current document. It must be complete and non-relative, using the URL parameter to resolve any relative references found in the document.
    hyperlink description For HTML documents, this would be the text between the <a href...> and </a> tags.
    t title The title of the document
    h head The top of the document itself. This is used to build the excerpt. This should only contain normal ASCII text
    a anchor The label that identifies an anchor that can be used as a target in an URL. This really only makes sense for HTML documents.
    i image URL An URL that points at an image that is part of the document.
    m http-equiv The HTTP-EQUIV attribute of a META tag. May be empty.
    name The NAME attribute of this META tag. May be empty.
    contents The CONTENTS attribute of this META tag. May be empty.

    See also FAQ questions 4.8 and 4.9 for more examples.

    example:
    external_parsers: text/html /usr/local/bin/htmlparser \
    application/pdf /usr/local/bin/parse_doc.pl \
    application/msword->text/plain "/usr/local/bin/mswordtotxt -w" \
    application/x-gunzip->user-defined /usr/local/bin/ungzipper

    external_protocols
    type:
    quoted string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This attribute is a bit like external_parsers since it specifies a list of protocols/handlers that are used to download documents that cannot be retrieved using the internal methods. This enables htdig to index documents with URL schemes it does not understand, or to use more advanced authentication for the documents it is retrieving. This list is checked before HTTP or other methods, so this can override the internal behavior without writing additional code for htdig.
    The external protocols are specified as pairs of strings, the first being the URL scheme that the script can handle while the second is the path to the script itself. If the second is quoted, then additional command-line arguments may be given.
    If the external protocol does not contain a colon (:), it is assumed to have the standard format "protocol://[usr[:password]@]address[:port]/path". If it ends with a colon, then it is assumed to have the simpler format "protocol:path". If it ends with "://" then the standard form is again assumed.
    The program takes three command-line parameters, not counting any parameters already given in the command string:
    protocol URL configuration-file
    Parameter Description Example
    protocol The URL scheme to be used. https
    URL The URL to be retrieved. https://www.htdig.org:8008/attrs.html
    configuration-file The configuration-file in effect. /etc/htdig/htdig.conf

    The external protocol script is to write information for htdig on the standard output. The output must follow the form described here. The output consists of a header followed by a blank line, followed by the contents of the document. Each record in the header is terminated with a newline. Each record is a series of (unless expressively allowed to be empty) non-empty tab-separated fields. The first field is a single character that specifies the record type. The rest of the fields are determined by the record type.
    Record type Fields Description
    s status code An HTTP-style status code, e.g. 200, 404. Typical codes include:
    200
    Successful retrieval
    304
    Not modified (for example, if the document hasn't changed since the last dig)
    301
    Redirect (to another URL)
    401
    Not authorized
    404
    Not found
    r reason A text string describing the status code, e.g "Redirect" or "Not Found."
    m status code The modification time of this document. While the code is fairly flexible about the time/date formats it accepts, it is recommended to use something standard, like RFC1123: Sun, 06 Nov 1994 08:49:37 GMT, or ISO-8601: 1994-11-06 08:49:37 GMT.
    t content-type A valid MIME type for the document, like text/html or text/plain.
    l content-length The length of the document on the server, which may not necessarily be the length of the buffer returned.
    u url The URL of the document, or in the case of a redirect, the URL that should be indexed as a result of the redirect.

    example:
    external_protocols: https /usr/local/bin/handler.pl \
    ftp /usr/local/bin/ftp-handler.pl

    extra_word_characters
    type:
    string
    used by:
    htdig, htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.2 or later
    description:
    These characters are considered part of a word. In contrast to the characters in the valid_punctuation attribute, they are treated just like letter characters. See also the allow_numbers attribute.
    Note that the locale attribute is normally used to configure which characters constitute letter characters.
    Note also that it is an error to have characters in both extra_word_characters and valid_punctuation. To add one of the characters in the default valid_punctuation to extra_word_characters, an explicit valid_punctuation entry must be added to the configuration file.
    See also the comments about special characters at valid_punctuation.
    example:
    extra_word_characters: _

    head_before_get
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Server
    version:
    3.2.0b1 or later
    description:
    If set to true, an HTTP/1.1 HEAD call is made in order to retrieve header information about a document. If the status code and the content-type returned show that the document is parsable, then a subsequent 'GET' call is made. In general, it is recommended that this attribute be set to 'true', as it can really improve performance (especially when used with persistent connections). This is particularly so during an incremental dig, since in this case 'htdig' can ask the server if the document has been modified since last dig. However there are a few cases when it is better to switch it off:
    • the majority of documents are parsable (HTML or a type for which an external parser has been provided) and must be retrieved anyway (initial dig);
    • the server does not support the HEAD method or it is disabled;
    • in some cases persistent_connections may not work properly and either the 'head_before_get' attribute or the 'persistent_connections' attribute must be turned off.
    example:
    head_before_get: false

    heading_factor
    type:
    number
    used by:
    htsearch
    default:
    5
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This is a factor which will be used to multiply the weight of words between <h1> and </h1> tags, as well as headings of levels <h2> through <h6>. It is used to assign the level of importance to headings. Setting a factor to 0 will cause words in these headings to be ignored. The number may be a floating point number. See also author_factor backlink_factor caps_factor date_factor description_factor keywords_factor meta_description_factor text_factor title_factor url_text_factor
    example:
    heading_factor: 20

    htnotify_prefix_file
    type:
    string
    used by:
    htnotify
    default:
    No default
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    Specifies the file containing text to be inserted in each mail message sent by htnotify before the list of expired webpages. If omitted, nothing is inserted.
    example:
    htnotify_prefix_file: ${common_dir}/notify_prefix.txt

    htnotify_replyto
    type:
    string
    used by:
    htnotify
    default:
    No default
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    This specifies the email address that htnotify email messages include in the Reply-to: field.
    example:
    htnotify_replyto: design-group@foo.com

    htnotify_sender
    type:
    string
    used by:
    htnotify
    default:
    webmaster@www
    block:
    Global
    version:
    all
    description:
    This specifies the email address that htnotify email messages get sent out from. The address is forged using /usr/lib/sendmail. Check htnotify/htnotify.cc for detail on how this is done.
    example:
    htnotify_sender: bigboss@yourcompany.com

    htnotify_suffix_file
    type:
    string
    used by:
    htnotify
    default:
    No default
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    Specifies the file containing text to be inserted in each mail message sent by htnotify after the list of expired webpages. If omitted, htnotify will insert a standard message.
    example:
    htnotify_suffix_file: ${common_dir}/notify_suffix.txt

    htnotify_webmaster
    type:
    string
    used by:
    htnotify
    default:
    ht://Dig Notification Service
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    This provides a name for the From field, in addition to the email address for the email messages sent out by htnotify.
    example:
    htnotify_webmaster: Notification Service

    http_proxy
    type:
    string
    used by:
    htdig
    default:
    No default
    block:
    URL
    version:
    3.0 or later
    description:
    When this attribute is set, all HTTP document retrievals will be done using the HTTP-PROXY protocol. The URL specified in this attribute points to the host and port where the proxy server resides.
    Later, this should be able to be overridden by the http_proxy environement variable, but it currently cannot. The use of a proxy server greatly improves performance of the indexing process.
    See also http_proxy_authorization and #http_proxy_exclude.
    example:
    http_proxy: http://proxy.bigbucks.com:3128

    http_proxy_authorization
    type:
    string
    used by:
    htdig
    default:
    No default
    block:
    URL
    version:
    3.2.0b4 or later
    description:
    This tells htdig to send the supplied username:password with each HTTP request, when using a proxy with authorization requested. The credentials will be encoded using the "Basic" authentication scheme. There must be a colon (:) between the username and password.
    If you use this option, be sure to protect the configuration file so it is readable only by you, and do not use that same configuration file for htsearch.
    example:
    http_proxy_authorization: myusername:mypassword

    http_proxy_exclude
    type:
    pattern list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.1.0b3 or later
    description:
    When this is set, URLs matching this will not use the proxy. This is useful when you have a mixture of sites near to the digging server and far away.
    example:
    http_proxy_exclude: http://intranet.foo.com/

    ignore_alt_text
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.1.6 or later
    description:
    If set, this causes the text of the ALT field in an <IMG...> tag not to be indexed as part of the text of the document, nor included in excerpts.
    example:
    ignore_alt_text: true

    ignore_dead_servers
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Global
    version:
    3.1.6 or later
    description:
    Determines whether htdig will continue to index URLs from a server after an attempted connection to the server fails as "no host found" or "host not found (port)." If set to false, htdig will try every URL from that server.
    example:
    ignore_dead_servers: false

    image_list
    type:
    string
    used by:
    htdig
    default:
    ${database_base}.images
    block:
    Global
    version:
    all
    description:
    This is the file that a list of image URLs gets written to by htdig when the create_image_list is set to true. As image URLs are seen, they are just appended to this file, so after htdig finishes it is probably a good idea to run sort -u on the file to eliminate duplicates from the file.
    example:
    image_list: allimages

    image_url_prefix
    type:
    string
    used by:
    htsearch
    default:
    @IMAGE_URL_PREFIX@
    block:
    Global
    version:
    all
    description:
    This specifies the directory portion of the URL used to display star images. This attribute isn't directly used by htsearch, but is used in the default URL for the star_image and star_blank attributes, and other attributes may be defined in terms of this one.

    The default value of this attribute is determined at compile time.

    example:
    image_url_prefix: /images/htdig

    include
    type:
    string
    used by:
    all
    default:
    No default
    block:
    Global
    version:
    3.1.0 or later
    description:
    This is not quite a configuration attribute, but rather a directive. It can be used within one configuration file to include the definitions of another file. The last definition of an attribute is the one that applies, so after including a file, any of its definitions can be overridden with subsequent definitions. This can be useful when setting up many configurations that are mostly the same, so all the common attributes can be maintained in a single configuration file. The include directives can be nested, but watch out for nesting loops.
    example:
    include: ${config_dir}/htdig.conf

    iso_8601
    type:
    boolean
    used by:
    htsearch, htnotify
    default:
    false
    block:
    Global
    version:
    3.1.0b2 or later
    description:
    This sets whether dates should be output in ISO 8601 format. For example, this was written on: 1998-10-31 11:28:13 EST. See also the date_format attribute, which can override any date format that htsearch picks by default.
    This attribute also affects the format of the date htnotify expects to find in a htdig-notification-date field.
    example:
    iso_8601: true

    keywords
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    ??
    description:
    Keywords which must be found on all pages returned, even if the "or" ("Any") method is selected.
    example:
    keywords: documentation

    keywords_factor
    type:
    number
    used by:
    htsearch
    default:
    100
    block:
    Global
    version:
    all
    description:
    This is a factor which will be used to multiply the weight of words in the list of meta keywords of a document. The number may be a floating point number. See also the heading_factor attribute.
    example:
    keywords_factor: 12

    keywords_meta_tag_names
    type:
    string list
    used by:
    htdig
    default:
    keywords htdig-keywords
    block:
    Global
    version:
    3.0.6 or later
    description:
    The words in this list are used to search for keywords in HTML META tags. This list can contain any number of strings that each will be seen as the name for whatever keyword convention is used.
    The META tags have the following format:
      <META name="somename" content="somevalue">
    example:
    keywords_meta_tag_names: keywords description

    limit_normalized
    type:
    pattern list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.1.0b2 or later
    description:
    This specifies a set of patterns that all URLs have to match against in order for them to be included in the search. Unlike the limit_urls_to attribute, this is done after the URL is normalized and the server_aliases attribute is applied. This allows filtering after any hostnames and DNS aliases are resolved. Otherwise, this attribute is the same as the limit_urls_to attribute.
    example:
    limit_normalized: http://www.mydomain.com

    limit_urls_to
    type:
    pattern list
    used by:
    htdig
    default:
    ${start_url}
    block:
    Global
    version:
    all
    description:
    This specifies a set of patterns that all URLs have to match against in order for them to be included in the search. Any number of strings can be specified, separated by spaces. If multiple patterns are given, at least one of the patterns has to match the URL.
    Matching, by default, is a case-sensitive string match on the URL to be used, unless the case_sensitive attribute is false. The match will be performed after the relative references have been converted to a valid URL. This means that the URL will always start with a transport specifier (http:// if none is specified).
    Granted, this is not the perfect way of doing this, but it is simple enough and it covers most cases.
    To limit URLs in htsearch, use restrict.
    example:
    limit_urls_to: .sdsu.edu kpbs [.*\.html]

    local_default_doc
    type:
    string list
    used by:
    htdig
    default:
    index.html
    block:
    Server
    version:
    3.0.8b2 or later
    description:
    Set this to the default documents in a directory used by the server. This is used for local filesystem access, using local_urls, to translate URLs like http://foo.com/ into something like /home/foo.com/index.html (see also remove_default_doc).
    The list should only contain names that the local server recognizes as default documents for directory URLs, as defined by the DirectoryIndex setting in Apache's srm.conf, for example. As of version 3.1.5, this can be a string list rather than a single name, and htdig will use the first name that works. Since this requires a loop, setting the most common name first will improve performance. Special characters can be embedded in these names using %xx hex encoding.
    example:
    local_default_doc: default.html default.htm index.html index.htm

    local_urls
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.0.8b2 or later
    description:
    Set this to tell ht://Dig to access certain URLs through local filesystems. At first ht://Dig will try to access pages with URLs matching the patterns through the filesystems specified. If it cannot find the file, or if it doesn't recognize the file name extension, it will try the URL through HTTP instead. Note the example--the equal sign and the final slashes in both the URL and the directory path are critical.
    The fallback to HTTP can be disabled by setting the local_urls_only attribute to true. To access user directory URLs through the local filesystem, set local_user_urls. File types which need processing by the HTTP server may be specified by the bad_local_extensions attribute. As of version 3.1.5, you can provide multiple mappings of a given URL to different directories, and htdig will use the first mapping that works. Special characters can be embedded in these names using %xx hex encoding. For example, you can use %3D to embed an "=" sign in an URL pattern.
    See also local_default_doc.
    example:
    local_urls: http://www.foo.com/=/usr/www/htdocs/

    local_urls_only
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.1.4 or later
    description:
    Set this to tell ht://Dig to access files only through the local filesystem, for URLs matching the patterns in the local_urls or local_user_urls attribute. If it cannot find the file, it will give up rather than trying HTTP or another protocol. With this option, even file:// urls are not retrieved, except throught the local_urls mechanism.
    example:
    local_urls_only: true

    local_user_urls
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.0.8b2 or later
    description:
    Set this to access user directory URLs through the local filesystem. If you leave the "path" portion out, it will look up the user's home directory in /etc/password (or NIS or whatever). As with local_urls, if the files are not found, ht://Dig will try with HTTP or the appropriate protocol. Again, note the example's format. To map http://www.my.org/~joe/foo/bar.html to /home/joe/www/foo/bar.html, try the example below.
    The fallback to HTTP can be disabled by setting the local_urls_only attribute to true. As of version 3.1.5, you can provide multiple mappings of a given URL to different directories, and htdig will use the first mapping that works. Special characters can be embedded in these names using %xx hex encoding. For example, you can use %3D to embed an "=" sign in an URL pattern.
    example:
    local_user_urls: http://www.my.org/=/home/,/www/

    locale
    type:
    string
    used by:
    htdig
    default:
    C
    block:
    Global
    version:
    3.0 or later
    description:
    Set this to whatever locale you want your search database cover. It affects the way international characters are dealt with. On most systems a list of legal locales can be found in /usr/lib/locale. Also check the setlocale(3C) man page. Note that depending the locale you choose, and whether your system's locale implementation affects floating point input, you may need to specify the decimal point as a comma rather than a period. This will affect settings of search_algorithm and any of the scoring factors.
    example:
    locale: en_US

    logging
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    3.1.0b2 or later
    description:
    This sets whether htsearch should use the syslog() to log search requests. If set, this will log requests with a default level of LOG_INFO and a facility of LOG_LOCAL5. For details on redirecting the log into a separate file or other actions, see the syslog.conf(5) man page. To set the level and facility used in logging, change LOG_LEVEL and LOG_FACILITY in the include/htconfig.h file before compiling.
    Each line logged by htsearch contains the following:
    REMOTE_ADDR [config] (match_method) [words] [logicalWords] (matches/matches_per_page) - page, HTTP_REFERER
    where any of the above are null or empty, it either puts in '-' or 'default' (for config).
    example:
    logging: true

    maintainer
    type:
    string
    used by:
    htdig
    default:
    bogus@unconfigured.htdig.user
    block:
    Server
    version:
    all
    description:
    This should be the email address of the person in charge of the digging operation. This string is added to the user-agent: field when the digger sends a request to a server.
    example:
    maintainer: ben.dover@uptight.com

    match_method
    type:
    string
    used by:
    htsearch
    default:
    and
    block:
    Global
    version:
    3.0 or later
    description:
    This is the default method for matching that htsearch uses. The valid choices are:
    • or
    • and
    • boolean
    This attribute will only be used if the HTML form that calls htsearch didn't have the method value set.
    example:
    match_method: boolean

    matches_per_page
    type:
    integer
    used by:
    htsearch
    default:
    10
    block:
    Global
    version:
    3.0 or later
    description:
    If this is set to a relatively small number, the matches will be shown in pages instead of all at once. This attribute will only be used if the HTML form that calls htsearch didn't have the matchesperpage value set.
    example:
    matches_per_page: 999

    max_connection_requests
    type:
    integer
    used by:
    htdig
    default:
    -1
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This attribute tells htdig to limit the number of requests it will send to a server using a single, persistent HTTP connection. This only applies when the persistent_connections attribute is set. You may set the limit as high as you want, but it must be at least 1. A value of -1 specifies no limit. Requests in the queue for a server will be combined until either the limit is reached, or the queue is empty.
    example:
    max_connection_requests: 100

    max_description_length
    type:
    integer
    used by:
    htdig
    default:
    60
    block:
    Global
    version:
    all
    description:
    While gathering descriptions of URLs, htdig will only record up to this many bytes of hyperlink descriptions for use in the DESCRIPTION template variable. This is used mostly to deal with broken HTML. (If a hyperlink is not terminated with a </a> the description will go on until the end of the document.)
    example:
    max_description_length: 40

    max_descriptions
    type:
    integer
    used by:
    htdig
    default:
    5
    block:
    Global
    version:
    all
    description:
    While gathering descriptions of URLs for the DESCRIPTIONS template variable, htdig will only record up to this number of descriptions, in the order in which it encounters them. This is used to prevent the database entry for a document from growing out of control if the document has a huge number of links to it.
    Note that all descriptions are used for indexing.
    example:
    max_descriptions: 1

    max_doc_size
    type:
    integer
    used by:
    htdig
    default:
    100000
    block:
    URL
    version:
    3.0 or later
    description:
    This is the upper limit to the amount of data retrieved for documents (in bytes). This is mainly used to prevent unreasonable memory consumption since each document will be read into memory by htdig.
    example:
    max_doc_size: 5000000

    max_excerpts
    type:
    integer
    used by:
    htsearch
    default:
    1
    block:
    URL
    version:
    3.1.6 or later
    description:
    This value determines the maximum number of excerpts that can be displayed for one matching document in the search results.
    example:
    max_excerpts: 10

    max_head_length
    type:
    integer
    used by:
    htdig
    default:
    512
    block:
    Global
    version:
    all
    description:
    For each document retrieved, the top of the document is stored. This attribute determines the size of this block (in bytes). The text that will be stored is only the text; no markup is stored.
    We found that storing 50,000 bytes will store about 95% of all the documents completely. This really depends on how much storage is available and how much you want to show. Currently, this is must not be 0.
    example:
    max_head_length: 50000

    max_hop_count
    type:
    integer
    used by:
    htdig
    default:
    999999
    block:
    Global
    version:
    all
    description:
    Instead of limiting the indexing process by URL pattern, it can also be limited by the number of hops or clicks a document is removed from the starting URL.
    The starting page or pages will have hop count 0.
    example:
    max_hop_count: 4

    max_keywords
    type:
    integer
    used by:
    htdig
    default:
    -1
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This attribute can be used to limit the number of keywords per document that htdig will accept from meta keywords tags. A value of -1 or less means no limit. This can help combat meta keyword spamming, by limiting the amount of keywords that will be indexed, but it will not completely prevent irrelevant matches in a search if the first few keywords in an offending document are not relevant to its contents.
    example:
    max_keywords: 10

    max_meta_description_length
    type:
    integer
    used by:
    htdig
    default:
    512
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    While gathering descriptions from meta description tags, htdig will only store up to this much of the text (in bytes) for each document to fill the METADESCRIPTION template variable. All words in the meta description are still used for indexing.
    example:
    max_meta_description_length: 1000

    max_prefix_matches
    type:
    integer
    used by:
    htsearch
    default:
    1000
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    The Prefix fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each prefix can match. Note that this does not limit the number of documents that are matched in any way.
    example:
    max_prefix_matches: 100

    max_retries
    type:
    integer
    used by:
    htdig
    default:
    3
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This option set the maximum number of retries when retrieving a document fails (mainly for reasons of connection).
    example:
    max_retries: 6

    max_stars
    type:
    integer
    used by:
    htsearch
    default:
    4
    block:
    Global
    version:
    all
    description:
    When stars are used to display the score of a match, this value determines the maximum number of stars that can be displayed.
    example:
    max_stars: 6

    maximum_page_buttons
    type:
    integer
    used by:
    htsearch
    default:
    ${maximum_pages}
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    This value limits the number of page links that will be included in the page list at the bottom of the search results page. By default, it takes on the value of the maximum_pages attribute, but you can set it to something lower to allow more pages than buttons. In this case, pages above this number will have no corresponding button.
    example:
    maximum_page_buttons: 20

    maximum_pages
    type:
    integer
    used by:
    htsearch
    default:
    10
    block:
    Global
    version:
    all
    description:
    This value limits the number of page links that will be included in the page list at the bottom of the search results page. As of version 3.1.4, this will limit the total number of matching documents that are shown. You can make the number of page buttons smaller than the number of allowed pages by setting the maximum_page_buttons attribute.
    example:
    maximum_pages: 20

    maximum_word_length
    type:
    integer
    used by:
    htdig, htsearch, htfuzzy
    default:
    32
    block:
    Global
    version:
    3.1.3 or later
    description:
    This sets the maximum length of words that will be indexed. Words longer than this value will be silently truncated when put into the index, or searched in the index.
    example:
    maximum_word_length: 15

    md5_db
    type:
    string
    used by:
    htdig
    default:
    ${database_base}.md5hash.db
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    This file holds a database of md5 and date hashes of pages to catch and eliminate duplicates of pages. See also the check_unique_md5 and check_unique_date attributes.
    example:
    md5_db: ${database_base}.md5.db

    meta_description_factor
    type:
    number
    used by:
    htsearch
    default:
    50
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    This is a factor which will be used to multiply the weight of words in any META description tags in a document. The number may be a floating point number. See also the heading_factor attribute and the description_factor attribute.
    example:
    meta_description_factor: 20

    metaphone_db
    type:
    string
    used by:
    htfuzzy, htsearch
    default:
    ${database_base}.metaphone.db
    block:
    Global
    version:
    all
    description:
    The database file used for the fuzzy "metaphone" search algorithm. This database is created by htfuzzy and used by htsearch.
    example:
    metaphone_db: ${database_base}.mp.db

    method_names
    type:
    quoted string list
    used by:
    htsearch
    default:
    and All or Any boolean Boolean
    block:
    Global
    version:
    all
    description:
    These values are used to create the method menu. It consists of pairs. The first element of each pair is one of the known methods, the second element is the text that will be shown in the menu for that method. This text needs to be quoted if it contains spaces. See the select list documentation for more information on how this attribute is used.
    example:
    method_names: or Or and And

    mime_types
    type:
    string
    used by:
    htdig
    default:
    ${config_dir}/mime.types
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This file is used by htdig for local file access and resolving file:// URLs to ensure the files are parsable. If you are running a webserver with its own MIME file, you should set this attribute to point to that file.

    See also content_classifier.

    example:
    mime_types: /etc/mime.types

    minimum_prefix_length
    type:
    integer
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    This sets the minimum length of prefix matches used by the "prefix" fuzzy matching algorithm. Words shorter than this will not be used in prefix matching.
    example:
    minimum_prefix_length: 2

    minimum_speling_length
    type:
    integer
    used by:
    htsearch
    default:
    5
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This sets the minimum length of words used by the "speling" fuzzy matching algorithm. Words shorter than this will not be used in this fuzzy matching.
    example:
    minimum_speling_length: 3

    minimum_word_length
    type:
    integer
    used by:
    htdig, htsearch
    default:
    3
    block:
    Global
    version:
    all
    description:
    This sets the minimum length of words that will be indexed. Words shorter than this value will be silently ignored but still put into the excerpt.
    Note that by making this value less than 3, a lot more words that are very frequent will be indexed. It might be advisable to add some of these to the bad_words list.
    example:
    minimum_word_length: 2

    multimatch_factor
    type:
    number
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    3.1.6 or later
    description:
    This factor gives higher rankings to documents that have more than one matching search word when the or match_method is used. In version 3.1.6, the matching words' combined scores were multiplied by this factor for each additional matching word. Currently, this multiplier is applied at most once.
    example:
    multimatch_factor: 1000

    next_page_text
    type:
    string
    used by:
    htsearch
    default:
    [next]
    block:
    Global
    version:
    3.1.0 or later
    description:
    The text displayed in the hyperlink to go to the next page of matches.
    example:
    next_page_text: <img src="/htdig/buttonr.gif">

    no_excerpt_show_top
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    3.1.0b3 or later
    description:
    If no excerpt is available, this option will act the same as excerpt_show_top, that is, it will show the top of the document.
    example:
    no_excerpt_show_top: yes

    no_excerpt_text
    type:
    string
    used by:
    htsearch
    default:
    <em>(None of the search words were found in the top of this document.)</em>
    block:
    Global
    version:
    3.0 or later
    description:
    This text will be displayed in place of the excerpt if there is no excerpt available. If this attribute is set to nothing (blank), the excerpt label will not be displayed in this case.
    example:
    no_excerpt_text:

    no_next_page_text
    type:
    string
    used by:
    htsearch
    default:
    ${next_page_text}
    block:
    Global
    version:
    3.0 or later
    description:
    The text displayed where there would normally be a hyperlink to go to the next page of matches.
    example:
    no_next_page_text:

    no_page_list_header
    type:
    string
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.0 or later
    description:
    This text will be used as the value of the PAGEHEADER variable, for use in templates or the search_results_footer file, when all search results fit on a single page.
    example:
    no_page_list_header: <hr noshade size=2>All results on this page.<br>

    no_page_number_text
    type:
    quoted string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.0 or later
    description:
    The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the search_results_footer file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. There should be as many strings in the list as there are pages allowed by the maximum_page_buttons attribute. If there are not enough, or the list is empty, the page numbers alone will be used as the text for the links. An entry from this list is used for the current page, as the current page is shown in the page list without a hypertext link, while entries from the page_number_text list are used for the links to other pages. The text strings can contain HTML tags to highlight page numbers or embed images. The strings need to be quoted if they contain spaces.
    example:
    no_page_number_text: <strong>1</strong> <strong>2</strong> \
    <strong>3</strong> <strong>4</strong> \
    <strong>5</strong> <strong>6</strong> \
    <strong>7</strong> <strong>8</strong> \
    <strong>9</strong> <strong>10</strong>

    no_prev_page_text
    type:
    string
    used by:
    htsearch
    default:
    ${prev_page_text}
    block:
    Global
    version:
    3.0 or later
    description:
    The text displayed where there would normally be a hyperlink to go to the previous page of matches.
    example:
    no_prev_page_text:

    no_title_text
    type:
    string
    used by:
    htsearch
    default:
    filename
    block:
    Global
    version:
    3.1.0 or later
    description:
    This specifies the text to use in search results when no title is found in the document itself. If it is set to filename, htsearch will use the name of the file itself, enclosed in brackets (e.g. [index.html]).
    example:
    no_title_text: "No Title Found"

    noindex_end
    type:
    quoted string list
    used by:
    htdig
    default:
    <!--/htdig_noindex--> </SCRIPT>
    block:
    Global
    version:
    3.1.0 or later
    description:
    This string marks the end of a section of an HTML file that should be completely ignored when indexing. Note that text between noindex_start and noindex_end isn't even counted as white space; the text "foosomethingbar" matches the word "foobar", not the phrase "foo bar". White space following noindex_end is counted as white space. See also noindex_start.
    example:
    noindex_end: </SCRIPT>

    noindex_start
    type:
    quoted string list
    used by:
    htdig
    default:
    <!--htdig_noindex--> <SCRIPT
    block:
    Global
    version:
    3.1.0 or later
    description:
    These strings mark the start of a section of an HTML file that should be completely ignored when indexing. They work together with noindex_end. Once a string in noindex_start is found, text is ignored until the string at the same position within noindex_end is encountered. The sections marked off this way cannot overlap. As in the first default pattern, this can be SGML comment declarations that can be inserted anywhere in the documents to exclude different sections from being indexed. However, existing tags can also be used; this is especially useful to exclude some sections from being indexed where the files to be indexed can not be edited. The second default pattern shows how SCRIPT sections in 'uneditable' documents can be skipped; note how noindex_start does not contain an ending >: this allows for all SCRIPT tags to be matched regardless of attributes defined (different types or languages). Note that the match for this string is case insensitive.
    example:
    noindex_start: <SCRIPT

    nothing_found_file
    type:
    string
    used by:
    htsearch
    default:
    ${common_dir}/nomatch.html
    block:
    Global
    version:
    all
    description:
    This specifies the file which contains the HTML text to display when no matches were found. The file should contain a complete HTML document.
    Note that this attribute could also be defined in terms of database_base to make is specific to the current search database.
    example:
    nothing_found_file: /www/searching/nothing.html

    nph
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    This attribute determines whether htsearch sends out full HTTP headers as required for an NPH (non-parsed header) CGI. Some servers assume CGIs will act in this fashion, for example MS IIS. If your server does not send out full HTTP headers, you should set this to true.
    example:
    nph: true

    page_list_header
    type:
    string
    used by:
    htsearch
    default:
    <hr noshade size=2>Pages:<br>
    block:
    Global
    version:
    3.0 or later
    description:
    This text will be used as the value of the PAGEHEADER variable, for use in templates or the search_results_footer file, when all search results fit on more than one page.
    example:
    page_list_header:

    page_number_separator
    type:
    quoted string list
    used by:
    htsearch
    default:
    " "
    block:
    Global
    version:
    3.1.4 or later
    description:
    The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the search_results_footer file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. The strings in the list will be used in rotation, and will separate individual entries taken from page_number_text and no_page_number_text. There can be as many or as few strings in the list as you like. If there are not enough for the number of pages listed, it goes back to the start of the list. If the list is empty, a space is used. The text strings can contain HTML tags. The strings need to be quoted if they contain spaces, or to specify an empty string.
    example:
    page_number_separator: "</td> <td>"

    page_number_text
    type:
    quoted string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.0 or later
    description:
    The text strings in this list will be used when putting together the PAGELIST variable, for use in templates or the search_results_footer file, when search results fit on more than page. The PAGELIST is the list of links at the bottom of the search results page. There should be as many strings in the list as there are pages allowed by the maximum_page_buttons attribute. If there are not enough, or the list is empty, the page numbers alone will be used as the text for the links. Entries from this list are used for the links to other pages, while an entry from the no_page_number_text list is used for the current page, as the current page is shown in the page list without a hypertext link. The text strings can contain HTML tags to highlight page numbers or embed images. The strings need to be quoted if they contain spaces.
    example:
    page_number_text: <em>1</em> <em>2</em> \
    <em>3</em> <em>4</em> \
    <em>5</em> <em>6</em> \
    <em>7</em> <em>8</em> \
    <em>9</em> <em>10</em>

    persistent_connections
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Server
    version:
    3.2.0b1 or later
    description:
    If set to true, when servers make it possible, htdig can take advantage of persistent connections, as defined by HTTP/1.1 (RFC2616). This permits to reduce the number of open/close operations of connections, when retrieving a document with HTTP.
    example:
    persistent_connections: false

    plural_suffix
    type:
    string
    used by:
    htsearch
    default:
    s
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    Specifies the value of the PLURAL_MATCHES template variable used in the header, footer and template files. This can be used for localization for non-English languages where 's' is not the appropriate suffix.
    example:
    plural_suffix: en

    prefix_match_character
    type:
    string
    used by:
    htsearch
    default:
    *
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    A null prefix character means that prefix matching should be applied to every search word. Otherwise prefix matching is done on any search word ending with the characters specified in this string, with the string being stripped off before looking for matches. The "prefix" algorithm must be enabled in search_algorithm for this to work. You may also want to set the max_prefix_matches and minimum_prefix_length attributes to get it working as you want.
    As a special case, in version 3.1.6 and later, if this string is non-null and is entered alone as a search word, it is taken as a wildcard that matches all documents in the database. If this string is null, the wildcard for this special case will be *. This wildcard doesn't require the prefix algorithm to be enabled.
    example:
    prefix_match_character: ing

    prev_page_text
    type:
    string
    used by:
    htsearch
    default:
    [prev]
    block:
    Global
    version:
    3.0 or later
    description:
    The text displayed in the hyperlink to go to the previous page of matches.
    example:
    prev_page_text: <img src="/htdig/buttonl.gif">

    regex_max_words
    type:
    integer
    used by:
    htsearch
    default:
    25
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    The "regex" fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each regular expression can match. Note that this does not limit the number of documents that are matched in any way.
    example:
    regex_max_words: 10

    remove_bad_urls
    type:
    boolean
    used by:
    htpurge
    default:
    true
    block:
    Server
    version:
    all
    description:
    If TRUE, htpurge will remove any URLs which were marked as unreachable by htdig from the database. If FALSE, it will not do this. When htdig is run in initial mode, documents which were referred to but could not be accessed should probably be removed, and hence this option should then be set to TRUE, however, if htdig is run to update the database, this may cause documents on a server which is temporarily unavailable to be removed. This is probably NOT what was intended, so hence this option should be set to FALSE in that case.
    example:
    remove_bad_urls: true

    remove_default_doc
    type:
    string list
    used by:
    htdig
    default:
    index.html
    block:
    Global
    version:
    3.1.0 or later
    description:
    Set this to the default documents in a directory used by the servers you are indexing. These document names will be stripped off of URLs when they are normalized, if one of these names appears after the final slash, to translate URLs like http://foo.com/index.html into http://foo.com/
    Note that you can disable stripping of these names during normalization by setting the list to an empty string. The list should only contain names that all servers you index recognize as default documents for directory URLs, as defined by the DirectoryIndex setting in Apache's srm.conf, for example. This does not apply to file:/// or ftp:// URLS.
    See also local_default_doc.
    example:
    remove_default_doc: default.html default.htm index.html index.htm

    remove_unretrieved_urls
    type:
    boolean
    used by:
    htpurge
    default:
    false
    block:
    Server
    version:
    3.2.0b1 or later
    description:
    If TRUE, htpurge will remove any URLs which were discovered and included as stubs in the database but not yet retrieved. If FALSE, it will not do this. When htdig is run in initial mode with no restrictions on hopcount or maximum documents, these should probably be removed and set to true. However, if you are hoping to index a small set of documents and eventually get to the rest, you should probably leave this as false.
    example:
    remove_unretrieved_urls: true

    restrict
    type:
    pattern list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    This specifies a set of patterns that all URLs have to match against in order for them to be included in the search results. Any number of strings can be specified, separated by spaces. If multiple patterns are given, at least one of the patterns has to match the URL. The list can be specified from within the configuration file, and can be overridden with the "restrict" input parameter in the search form. Note that the restrict list does not take precedence over the exclude list - if a URL matches patterns in both lists it is still excluded from the search results.
    To restrict URLs in htdig, use limit_urls_to.
    example:
    restrict: http://www.acme.com/widgets/

    robotstxt_name
    type:
    string
    used by:
    htdig
    default:
    htdig
    block:
    Server
    version:
    3.0.7 or later
    description:
    Sets the name that htdig will look for when parsing robots.txt files. This can be used to make htdig appear as a different spider than ht://Dig. Useful to distinguish between a private and a global index.
    example:
    robotstxt_name: myhtdig

    script_name
    type:
    string
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.4 or later
    description:
    Overrides the value of the SCRIPT_NAME environment attribute. This is useful if htsearch is not being called directly as a CGI program, but indirectly from within a dynamic .shtml page using SSI directives. Previously, you needed a wrapper script to do this, but this configuration attribute makes wrapper scripts obsolete for SSI and possibly for other server scripting languages, as well. (You still need a wrapper script when using PHP, though.)
    Check out the contrib/scriptname directory for a small example. Note that this attribute also affects the value of the CGI variable used in htsearch templates.
    example:
    script_name: /search/results.shtml

    search_algorithm
    type:
    string list
    used by:
    htsearch
    default:
    exact:1
    block:
    Global
    version:
    all
    description:
    Specifies the search algorithms and their weight to use when searching. Each entry in the list consists of the algorithm name, followed by a colon (:) followed by a weight multiplier. The multiplier is a floating point number between 0 and 1. Note that depending on your locale setting, and whether your system's locale implementation affects floating point input, you may need to specify the decimal point as a comma rather than a period.
    Note:If the exact method is not listed, the search may not work since the original terms will not be used.
    Current algorithms supported are:
    exact
    The default exact word matching algorithm. This will find only exactly matched words.
    soundex
    Uses a slightly modified soundex algorithm to match words. This requires that the soundex database be present. It is generated with the htfuzzy program.
    metaphone
    Uses the metaphone algorithm for matching words. This algorithm is more specific to the english language than soundex. It requires the metaphone database, which is generated with the htfuzzy program.
    accents
    Uses the accents algorithm for matching words. This algorithm will treat all accented letters as equivalent to their unaccented counterparts. It requires the accents database, which is generated with the htfuzzy program.
    endings
    This algorithm uses language specific word endings to find matches. Each word is first reduced to its word root and then all known legal endings are used for the matching. This algorithm uses two databases which are generated with htfuzzy.
    synonyms
    Performs a dictionary lookup on all the words. This algorithm uses a database generated with the htfuzzy program.
    substring
    Matches all words containing the queries as substrings. Since this requires checking every word in the database, this can really slow down searches considerably.
    prefix
    Matches all words beginning with the query strings. Uses the option prefix_match_character to decide whether a query requires prefix matching. For example "abc*" would perform prefix matching on "abc" since * is the default prefix_match_character.
    regex
    Matches all words that match the patterns given as regular expressions. Since this requires checking every word in the database, this can really slow down searches considerably. The config file used for searching must include the regex meta-characters (^$\[-]|.*) included in extra_word_characters, while the config file used for digging should not.
    speling
    A simple fuzzy algorithm that tries to find one-off spelling mistakes, such as transposition of two letters or an extra character. Since this usually generates just a few possibilities, it is relatively quick.
    example:
    search_algorithm: exact:1 soundex:0.3

    search_results_contenttype
    type:
    string
    used by:
    htsearch
    default:
    text/html
    block:
    Global
    version:
    all
    description:
    This specifies a Content-type to be output as an HTTP header at the start of search results. If set to an empty string, the Content-type header will be omitted altogether.
    example:
    search_results_contenttype: text/xml

    search_results_footer
    type:
    string
    used by:
    htsearch
    default:
    ${common_dir}/footer.html
    block:
    Global
    version:
    all
    description:
    This specifies a filename to be output at the end of search results. While outputting the footer, some variables will be expanded. Variables use the same syntax as the Bourne shell. If there is a variable VAR, the following will all be recognized:
    • $VAR
    • $(VAR)
    • ${VAR}
    The following variables are available. See hts_template.html for a complete list.
    MATCHES
    The number of documents that were matched.
    PLURAL_MATCHES
    If MATCHES is not 1, this will be the string "s", else it is an empty string. This can be used to say something like "$(MATCHES) document$(PLURAL_MATCHES) were found"
    MAX_STARS
    The value of the max_stars attribute.
    LOGICAL_WORDS
    A string of the search words with either "and" or "or" between the words, depending on the type of search.
    WORDS
    A string of the search words with spaces in between.
    PAGEHEADER
    This expands to either the value of the page_list_header or no_page_list_header attribute depending on how many pages there are.
    Note that this file will NOT be output if no matches were found. In this case the nothing_found_file attribute is used instead. Also, this file will not be output if it is overridden by defining the search_results_wrapper attribute.
    example:
    search_results_footer: /usr/local/etc/ht/end-stuff.html

    search_results_header
    type:
    string
    used by:
    htsearch
    default:
    ${common_dir}/header.html
    block:
    Global
    version:
    all
    description:
    This specifies a filename to be output at the start of search results. While outputting the header, some variables will be expanded. Variables use the same syntax as the Bourne shell. If there is a variable VAR, the following will all be recognized:
    • $VAR
    • $(VAR)
    • ${VAR}
    The following variables are available. See hts_template.html for a complete list.
    MATCHES
    The number of documents that were matched.
    PLURAL_MATCHES
    If MATCHES is not 1, this will be the string "s", else it is an empty string. This can be used to say something like "$(MATCHES) document$(PLURAL_MATCHES) were found"
    MAX_STARS
    The value of the max_stars attribute.
    LOGICAL_WORDS
    A string of the search words with either "and" or "or" between the words, depending on the type of search.
    WORDS
    A string of the search words with spaces in between.
    Note that this file will NOT be output if no matches were found. In this case the nothing_found_file attribute is used instead. Also, this file will not be output if it is overridden by defining the search_results_wrapper attribute.
    example:
    search_results_header: /usr/local/etc/ht/start-stuff.html

    search_results_order
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    This specifies a list of patterns for URLs in search results. Results will be displayed in the specified order, with the search algorithm result as the second order. Remaining areas, that do not match any of the specified patterns, can be placed by using * as the pattern. If no * is specified, one will be implicitly placed at the end of the list.
    See also url_seed_score.
    example:
    search_results_order: /docs/|faq.html * /maillist/ /testresults/

    search_results_wrapper
    type:
    string
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.0 or later
    description:
    This specifies a filename to be output at the start and end of search results. This file replaces the search_results_header and search_results_footer files, with the contents of both in one file, and uses the pseudo-variable $(HTSEARCH_RESULTS) as a separator for the header and footer sections. If the filename is not specified, the file is unreadable, or the pseudo-variable above is not found, htsearch reverts to the separate header and footer files instead. While outputting the wrapper, some variables will be expanded, just as for the search_results_header and search_results_footer files.
    Note that this file will NOT be output if no matches were found. In this case the nothing_found_file attribute is used instead.
    example:
    search_results_wrapper: ${common_dir}/wrapper.html

    search_rewrite_rules
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    This is a list of pairs, regex replacement, used to rewrite URLs in the search results. The left hand string is a regular expression; the right hand string is a literal string with embedded placeholders for fragments that matched inside brackets in the regular expression. \0 is the whole matched string, \1 to \9 are bracketted substrings. The backslash must be doubled-up in the attribute setting to get past the variable expansion parsing. Rewrite rules are applied sequentially to each URL before it is displayed or checked against the restrict or exclude lists. Rewriting does not stop once a match has been made, so multiple rules may affect a given URL. See also url_part_aliases which allows URLs to be of one form during indexing and translated for results, and url_rewrite_rules which allows URLs to be rewritten while indexing.
    example:
    search_rewrite_rules: http://(.*)\\.mydomain\\.org/([^/]*) http://\\2.\\1.com \
    http://www\\.myschool\\.edu/myorgs/([^/]*) http://\\1.org

    server_aliases
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.1.0b2 or later
    description:
    This attribute tells the indexer that servers have several DNS aliases, which all point to the same machine and are NOT virtual hosts. This allows you to ensure pages are indexed only once on a given machine, despite the alias used in a URL. As shown in the example, the mapping goes from left to right, so the server name on the right hand side is the one that is used. As of version 3.1.3, the port number is optional, and is assumed to be 80 if omitted. There is no easy way to map all ports from one alias to another without listing them all.
    example:
    server_aliases: foo.mydomain.com:80=www.mydomain.com:80 \
    bar.mydomain.com:80=www.mydomain.com:80

    server_max_docs
    type:
    integer
    used by:
    htdig
    default:
    -1
    block:
    Server
    version:
    3.1.0b3 or later
    description:
    This attribute tells htdig to limit the dig to retrieve a maximum number of documents from each server. This can cause unusual behavior on update digs since the old URLs are stored alphabetically. Therefore, update digs will add additional URLs in pseudo-alphabetical order, up to the limit of the attribute. However, it is most useful to partially index a server as the URLs of additional documents are entered into the database, marked as never retrieved.
    A value of -1 specifies no limit.
    example:
    server_max_docs: 50

    server_wait_time
    type:
    integer
    used by:
    htdig
    default:
    0
    block:
    Server
    version:
    3.1.0b3 or later
    description:
    This attribute tells htdig to ensure a server has had a delay (in seconds) from the beginning of the last connection. This can be used to prevent "server abuse" by digging without delay. It's recommended to set this to 10-30 (seconds) when indexing servers that you don't monitor yourself. Additionally, this attribute can slow down local indexing if set, which may or may not be what you intended.
    example:
    server_wait_time: 20

    sort
    type:
    string
    used by:
    htsearch
    default:
    score
    block:
    Global
    version:
    3.1.0 or later
    description:
    This is the default sorting method that htsearch uses to determine the order in which matches are displayed. The valid choices are:
    • score
    • time
    • title
    • revscore
    • revtime
    • revtitle
    This attribute will only be used if the HTML form that calls htsearch didn't have the sort value set. The words date and revdate can be used instead of time and revtime, as both will sort by the time that the document was last modified, if this information is given by the server. The default is to sort by the score, which ranks documents by best match. The sort methods that begin with "rev" simply reverse the order of the sort. Note that setting this to something other than "score" will incur a slowdown in searches.
    example:
    sort: revtime

    sort_names
    type:
    quoted string list
    used by:
    htsearch
    default:
    score Score time Time title Title revscore 'Reverse Score' revtime 'Reverse Time' revtitle 'Reverse Title'
    block:
    Global
    version:
    3.1.0 or later
    description:
    These values are used to create the sort menu. It consists of pairs. The first element of each pair is one of the known sort methods, the second element is the text that will be shown in the menu for that sort method. This text needs to be quoted if it contains spaces. See the select list documentation for more information on how this attribute is used.
    example:
    sort_names: score 'Best Match' time Newest title A-Z \
    revscore 'Worst Match' revtime Oldest revtitle Z-A

    soundex_db
    type:
    string
    used by:
    htfuzzy, htsearch
    default:
    ${database_base}.soundex.db
    block:
    Global
    version:
    all
    description:
    The database file used for the fuzzy "soundex" search algorithm. This database is created by htfuzzy and used by htsearch.
    example:
    soundex_db: ${database_base}.snd.db

    star_blank
    type:
    string
    used by:
    htsearch
    default:
    ${image_url_prefix}/star_blank.gif
    block:
    Global
    version:
    all
    description:
    This specifies the URL to use to display a blank of the same size as the star defined in the star_image attribute or in the star_patterns attribute.
    example:
    star_blank: http://www.somewhere.org/icons/noelephant.gif

    star_image
    type:
    string
    used by:
    htsearch
    default:
    ${image_url_prefix}/star.gif
    block:
    Global
    version:
    all
    description:
    This specifies the URL to use to display a star. This allows you to use some other icon instead of a star. (We like the star...)
    The display of stars can be turned on or off with the use_star_image attribute and the maximum number of stars that can be displayed is determined by the max_stars attribute.
    Even though the image can be changed, the ALT value for the image will always be a '*'.
    example:
    star_image: http://www.somewhere.org/icons/elephant.gif

    star_patterns
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.0 or later
    description:
    This attribute allows the star image to be changed depending on the URL or the match it is used for. This is mainly to make a visual distinction between matches on different web sites. The star image could be replaced with the logo of the company the match refers to.
    It is advisable to keep all the images the same size in order to line things up properly in a short result listing.
    The format is simple. It is a list of pairs. The first element of each pair is a pattern, the second element is a URL to the image for that pattern.
    example:
    star_patterns: http://www.sdsu.edu /sdsu.gif \
    http://www.ucsd.edu /ucsd.gif

    startday
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    Day component of first date allowed as last-modified date of returned docutments. This is most usefully specified as a GCI argument. See also startyear.
    example:
    startday: 1

    start_ellipses
    type:
    string
    used by:
    htsearch
    default:
    <strong><code>... </code></strong>
    block:
    Global
    version:
    all
    description:
    When excerpts are displayed in the search output, this string will be prepended to the excerpt if there is text before the text displayed. This is just a visual reminder to the user that the excerpt is only part of the complete document.
    example:
    start_ellipses: ...

    start_highlight
    type:
    string
    used by:
    htsearch
    default:
    <strong>
    block:
    Global
    version:
    3.1.4 or later
    description:
    When excerpts are displayed in the search output, matched words will be highlighted using this string and end_highlight. You should ensure that highlighting tags are balanced, that is, any formatting tags that this string opens should be closed by end_highlight.
    example:
    start_highlight: <font color="#FF0000">

    startmonth
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    Month component of first date allowed as last-modified date of returned docutments. This is most usefully specified as a GCI argument. See also startyear.
    example:
    startmonth: 1

    start_url
    type:
    string list
    used by:
    htdig
    default:
    http://www.htdig.org/
    block:
    Global
    version:
    all
    description:
    This is the list of URLs that will be used to start a dig when there was no existing database. Note that multiple URLs can be given here.
    Note also that the value of start_url will be the default value for limit_urls_to, so if you set start_url to the URLs for specific files, rather than a site or subdirectory URL, you may need to set limit_urls_to to something less restrictive so htdig doesn't reject links in the documents.
    example:
    start_url: http://www.somewhere.org/alldata/index.html

    startyear
    type:
    integer
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.6 or later
    description:
    This specifies the year of the cutoff start date for search results. If the start or end date are specified, only results with a last modified date within this range are shown. If a start or end date is specified, but startyear is not, then it defaults to 1970. See also startday, startmonth, endday, endmonth, endyear. These are most usefully specified as a GCI argument.
    For each component, if a negative number is given, it is taken as relative to the current date. Relative days can span several months or even years if desired, and relative months can span several years. A startday of -90 will select matching documents modified within the last 90 days.
    example:
    startyear: 2001

    store_phrases
    type:
    boolean
    used by:
    htdig
    default:
    true
    block:
    Global
    version:
    3.2.0b5 or later
    description:
    Causes htdig to record all occurrences of each word in a document, to allow accurate phrase searches. If this is false, only the first occurrence of each word will be stored, causing many phrases to be missed. Setting this false increases indexing speed by about 20%, and reduces disk requirements by about 60%.
    example:
    No example provided

    substring_max_words
    type:
    integer
    used by:
    htsearch
    default:
    25
    block:
    Global
    version:
    3.0.8b1 or later
    description:
    The Substring fuzzy algorithm could potentially match a very large number of words. This value limits the number of words each substring pattern can match. Note that this does not limit the number of documents that are matched in any way.
    example:
    substring_max_words: 100

    synonym_db
    type:
    string
    used by:
    htsearch, htfuzzy
    default:
    ${common_dir}/synonyms.db
    block:
    Global
    version:
    3.0 or later
    description:
    Points to the database that htfuzzy creates when the synonyms algorithm is used.
    htsearch uses this to perform synonym dictionary lookups.
    example:
    synonym_db: ${database_base}.syn.db

    synonym_dictionary
    type:
    string
    used by:
    htfuzzy
    default:
    ${common_dir}/synonyms
    block:
    Global
    version:
    3.0 or later
    description:
    This points to a text file containing the synonym dictionary used for the synonyms search algorithm.
    Each line of this file has at least two words. The first word is the word to replace, the rest of the words are synonyms for that word.
    example:
    synonym_dictionary: /usr/dict/synonyms

    syntax_error_file
    type:
    string
    used by:
    htsearch
    default:
    ${common_dir}/syntax.html
    block:
    Global
    version:
    all
    description:
    This points to the file which will be displayed if a boolean expression syntax error was found.
    example:
    syntax_error_file: ${common_dir}/synerror.html

    tcp_max_retries
    type:
    integer
    used by:
    htdig
    default:
    1
    block:
    Server
    version:
    3.2.0b1 or later
    description:
    This option set the maximum number of attempts when a connection timeouts. After all these retries, the connection attempt results .
    example:
    tcp_max_retries: 6

    tcp_wait_time
    type:
    integer
    used by:
    htdig
    default:
    5
    block:
    Server
    version:
    3.2.0b1 or later
    description:
    This attribute sets the wait time (in seconds) after a connection fails and the timeout is raised.
    example:
    tcp_wait_time: 10

    template_map
    type:
    quoted string list
    used by:
    htsearch
    default:
    Long builtin-long builtin-long Short builtin-short builtin-short
    block:
    Global
    version:
    3.0 or later
    description:
    This maps match template names to internal names and template file names. It is a list of triplets. The first element in each triplet is the name that will be displayed in the FORMAT menu. The second element is the name used internally and the third element is a filename of the template to use.
    There are two predefined templates, namely builtin-long and builtin-short. If the filename is one of those, they will be used instead.
    More information about templates can be found in the htsearch documentation. The particular template is selecterd by the format cgi argument, and the default is given by template_name in the config file.
    example:
    template_map: Short short ${common_dir}/short.html \
    Normal normal builtin-long \
    Detailed detail ${common_dir}/detail.html

    template_name
    type:
    string
    used by:
    htsearch
    default:
    builtin-long
    block:
    Global
    version:
    3.0 or later
    description:
    Specifies the default template if no format field is given by the search form. This needs to map to the template_map.
    example:
    template_name: long

    template_patterns
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.1.4 or later
    description:
    This attribute allows the results template to be changed depending on the URL or the match it is used for. This is mainly to make a visual distinction between matches on different web sites. The results for each site could thus be shown in a style matching that site.
    The format is simply a list of pairs. The first element of each pair is a pattern, the second element is the name of the template file for that pattern.
    More information about templates can be found in the htsearch documentation.
    Normally, when using this template selection method, you would disable user selection of templates via the format input parameter in search forms, as the two methods were not really designed to interact. Templates selected by URL patterns would override any user selection made in the form. If you want to use the two methods together, see the notes on combining them for an example of how to do this.
    example:
    template_patterns: http://www.sdsu.edu ${common_dir}/sdsu.html \
    http://www.ucsd.edu ${common_dir}/ucsd.html

    text_factor
    type:
    number
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    3.0 or later
    description:
    This is a factor which will be used to multiply the weight of words that are not in any special part of a document. Setting a factor to 0 will cause normal words to be ignored. The number may be a floating point number. See also the heading_factor attribute.
    example:
    text_factor: 0

    timeout
    type:
    integer
    used by:
    htdig
    default:
    30
    block:
    Server
    version:
    all
    description:
    Specifies the time the digger will wait to complete a network read. This is just a safeguard against unforeseen things like the all too common transformation from a network to a notwork.
    The timeout is specified in seconds.
    example:
    timeout: 42

    title_factor
    type:
    number
    used by:
    htsearch
    default:
    100
    block:
    Global
    version:
    all
    description:
    This is a factor which will be used to multiply the weight of words in the title of a document. Setting a factor to 0 will cause words in the title to be ignored. The number may be a floating point number. See also the heading_factor attribute.
    example:
    title_factor: 12

    translate_latin1
    type:
    boolean
    used by:
    htdig, htsearch
    default:
    true
    block:
    Global
    version:
    3.2.0b5 or later
    description:
    If set to false, the SGML entities for ISO-8859-1 (or Latin 1) characters above &nbsp; (or &#160;) will not be translated into their 8-bit equivalents. This attribute should be set to false when using a locale that doesn't use the ISO-8859-1 character set, to avoid these entities being mapped to inappropriate 8-bit characters, or perhaps more importantly to avoid 8-bit characters from your locale being mapped back to Latin 1 SGML entities in search results.
    example:
    translate_latin1: false

    url_list
    type:
    string
    used by:
    htdig
    default:
    ${database_base}.urls
    block:
    Global
    version:
    all
    description:
    This file is only created if create_url_list is set to true. It will contain a list of all URLs that were seen.
    example:
    url_list: /tmp/urls

    url_log
    type:
    string
    used by:
    htdig
    default:
    ${database_base}.log
    block:
    Global
    version:
    3.1.0 or later
    description:
    If htdig is interrupted, it will write out its progress to this file. Note that if it has a large number of URLs to write, it may take some time to exit. This can especially happen when running update digs and the run is interrupted soon after beginning.
    example:
    url_log: /tmp/htdig.progress

    url_part_aliases
    type:
    string list
    used by:
    all
    default:
    No default
    block:
    Global
    version:
    3.1.0 or later
    description:
    A list of translations pairs from and to, used when accessing the database. If a part of an URL matches with the from-string of each pair, it will be translated into the to-string just before writing the URL to the database, and translated back just after reading it from the database.
    This is primarily used to provide an easy way to rename parts of URLs for e.g. changing www.example.com/~htdig to www.htdig.org. Two different configuration files for digging and searching are then used, with url_part_aliases having different from strings, but identical to-strings.
    See also common_url_parts.
    Strings that are normally incorrect in URLs or very seldom used, should be used as to-strings, since extra storage will be used each time one is found as normal part of a URL. Translations will be performed with priority for the leftmost longest match. Each to-string must be unique and not be a part of any other to-string. It also helps to keep the to-strings short to save space in the database. Other than that, the choice of to-strings is pretty arbitrary, as they just provide a temporary, internal encoding in the databases, and none of the characters in these strings have any special meaning.
    Note that when this attribute is changed, the database should be rebuilt, unless the effect of "moving" the affected URLs in the database is wanted, as described above.
    Please note: Don't just copy the example below into a single configuration file. There are two separate settings of url_part_aliases below; the first one is for the configuration file to be used by htdig, htmerge, and htnotify, and the second one is for the configuration file to be used by htsearch. In this example, htdig will encode the URL "http://search.example.com/~htdig/contrib/stuff.html" as "*sitecontrib/stuff*2" in the databases, and htsearch will decode it as "http://www.htdig.org/contrib/stuff.htm".
    As of version 3.1.6, you can also do more complex rewriting of URLs using url_rewrite_rules and search_rewrite_rules.
    example:
    url_part_aliases: http://search.example.com/~htdig *site \
    http://www.htdig.org/this/ *1 \
    .html *2
    url_part_aliases: http://www.htdig.org/ *site \
    http://www.htdig.org/that/ *1 \
    .htm *2

    url_rewrite_rules
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    Global
    version:
    3.2.0b3 or later
    description:
    This is a list of pairs, regex replacement used to permanently rewrite URLs as they are indexed. The left hand string is a regular expression; the right hand string is a literal string with embedded placeholders for fragments that matched inside brackets in the regex. \0 is the whole matched string, \1 to \9 are bracketted substrings. Note that the entire URL is replaced by the right hand string (not just the portion which matches the left hand string). Thus, a leading and trailing (.*) should be included in the pattern, with matching placeholders in the replacement string.
    Rewrite rules are applied sequentially to each incoming URL before normalization occurs. Rewriting does not stop once a match has been made, so multiple rules may affect a given URL. See also url_part_aliases which allows URLs to be of one form during indexing and translated for results.
    example:
    url_rewrite_rules: (.*)\\?JServSessionIdroot=.* \\1 \
    (.*)\\&JServSessionIdroot=.* \\1 \
    (.*)&context=.* \\1

    url_seed_score
    type:
    string list
    used by:
    htsearch
    default:
    No default
    block:
    Global
    version:
    3.2.0b2 or later
    description:
    This is a list of pairs, pattern formula, used to weigh the score of hits, depending on the URL of the document.
    The pattern part is a substring to match against the URL. Pipe ('|') characters can be used in the pattern to concatenate substrings for web-areas that have the same formula.
    The formula describes a factor and a constant, by which the hit score is weighed. The factor part is multiplied to the original score, then the constant part is added.
    The format of the formula is the factor part: "*N" optionally followed by comma and spaces, followed by the constant part : "+M", where the plus sign may be emitted for negative numbers. Either part is optional, but must come in this order.
    The numbers N and M are floating point constants.
    More straightforward is to think of the format as "newscore = oldscore*N+M", but with the "newscore = oldscore" part left out.
    example:
    url_seed_score: /mailinglist/ *.5-1e6
    /docs/|/news/ *1.5
    /testresults/ "*.7 -200"
    /faq-area/ *2+10000

    url_text_factor
    type:
    number
    used by:
    htsearch
    default:
    1
    block:
    Global
    version:
    ??
    description:
    TO BE COMPLETED
    See also heading_factor.
    example:
    url_text_factor: 1

    use_doc_date
    type:
    boolean
    used by:
    htdig
    default:
    false
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    If set to true, htdig will use META date tags in documents, overriding the modification date returned by the server. Any documents that do not have META date tags will retain the last modified date returned by the server or found on the local file system. As of version 3.1.6, in addition to META date tags, htdig will also recognize dc.date, dc.date.created and dc.date.modified.
    example:
    use_doc_date: true

    use_meta_description
    type:
    boolean
    used by:
    htsearch
    default:
    false
    block:
    Global
    version:
    3.1.0b1 or later
    description:
    If set to true, any META description tags will be used as excerpts by htsearch. Any documents that do not have META descriptions will retain their normal excerpts.
    example:
    use_meta_description: true

    use_star_image
    type:
    boolean
    used by:
    htsearch
    default:
    true
    block:
    Global
    version:
    all
    description:
    If set to true, the star_image attribute is used to display upto max_stars images for each match.
    example:
    use_star_image: no

    user_agent
    type:
    string
    used by:
    htdig
    default:
    htdig
    block:
    Server
    version:
    3.1.0b2 or later
    description:
    This allows customization of the user_agent: field sent when the digger requests a file from a server.
    example:
    user_agent: htdig-digger

    valid_extensions
    type:
    string list
    used by:
    htdig
    default:
    No default
    block:
    URL
    version:
    3.1.4 or later
    description:
    This is a list of extensions on URLs which are the only ones considered acceptable. This list is used to supplement the MIME-types that the HTTP server provides with documents. Some HTTP servers do not have a correct list of MIME-types and so can advertise certain documents as text while they are some binary format. If the list is empty, then all extensions are acceptable, provided they pass other criteria for acceptance or rejection. If the list is not empty, only documents with one of the extensions in the list are parsed. See also bad_extensions.
    example:
    valid_extensions: .html .htm .shtml

    valid_punctuation
    type:
    string
    used by:
    htdig, htsearch
    default:
    .-_/!#\$%^&'
    block:
    Global
    version:
    all
    description:
    This is the set of characters which may be deleted from the document before determining what a word is. This means that if a document contains something like half-hearted the digger will see this as the three words half, hearted and halfhearted.
    These characters are also removed before keywords are passed to the search engine, so a search for "half-hearted" works as expected.
    Note that the dollar sign ($) and backslash (\) must be escaped by a backslash in both valid_punctuation and extra_word_characters. Moreover, the backslash should not be the last character on the line. There is currently no way to include a back-quote (`) in extra_word_characters or valid_punctuation.
    See also the extra_word_characters and allow_numbers attributes.
    example:
    valid_punctuation: -'

    version
    type:
    string
    used by:
    htsearch
    default:
    @VERSION@
    block:
    Global
    version:
    all
    description:
    This specifies the value of the VERSION variable which can be used in search templates. The default value of this attribute is determined at compile time, and will not normally be set in configuration files.
    example:
    version: 3.2.0

    word_db
    type:
    string
    used by:
    all
    default:
    ${database_base}.words.db
    block:
    Global
    version:
    all
    description:
    This is the main word database. It is an index of all the words to a list of documents that contain the words. This database can grow large pretty quickly.
    example:
    word_db: ${database_base}.allwords.db

    word_dump
    type:
    string
    used by:
    htdig, htdump, htload
    default:
    ${database_base}.worddump
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This file is basically a text version of the file specified in word_db. Its only use is to have a human readable database of all words. The file is easy to parse with tools like perl or tcl.
    example:
    word_dump: /tmp/words.txt

    wordlist_cache_inserts
    type:
    boolean
    used by:
    ???
    default:
    false
    block:
    Global
    version:
    ???
    description:
    If true, create a cache of size wordlist_cache_size/2 for class WordListOne. I don't know what this is for. Does anyone?
    example:
    wordlist_cache_inserts: true

    wordlist_cache_size
    type:
    integer
    used by:
    all
    default:
    10000000
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Size (in bytes) of memory cache used by Berkeley DB (DB used by the indexer) IMPORTANT: It makes a huge difference. The rule is that the cache size should be at least 2% of the expected index size. The Berkeley DB file has 1% of internal pages that must be cached for good performances. Giving an additional 1% leaves room for caching leaf pages.
    example:
    wordlist_cache_size: 40000000

    wordlist_compress
    type:
    boolean
    used by:
    all
    default:
    true
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Enables or disables the default compression system for the indexer. This currently attempts to compress the index by a factor of 8. If the Zlib library is not found on the system, the default is false.
    example:
    wordlist_compress: false

    wordlist_compress_zlib
    type:
    boolean
    used by:
    all
    default:
    true
    block:
    Global
    version:
    3.2.0b4 or later
    description:
    Enables or disables the zlib compression system for the indexer. Both wordlist_compress and compression_level must be true (non-zero) to use this option!
    example:
    wordlist_compress_zlib: false

    wordlist_monitor
    type:
    boolean
    used by:
    all
    default:
    false
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    This enables monitoring of what's happening in the indexer. It can help to detect performance/configuration problems.
    example:
    wordlist_monitor: true

    wordlist_monitor_period
    type:
    number
    used by:
    all
    default:
    0
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Sets the number of seconds between each monitor output.
    example:
    wordlist_monitor_period: .1

    wordlist_monitor_output
    type:
    string
    used by:
    all
    default:
    No default
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Print monitoring output on file instead of the default stderr.
    example:
    wordlist_monitor_output: myfile

    wordlist_page_size
    type:
    integer
    used by:
    all
    default:
    0
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Size (in bytes) of pages used by Berkeley DB (DB used by the indexer). Must be a power of two.
    example:
    wordlist_page_size: 8192

    wordlist_verbose
    type:
    integer
    used by:
    default:
    No default
    block:
    Global
    version:
    description:
    wordlist_verbose 1 walk logic
    wordlist_verbose 2 walk logic details
    wordlist_verbose 2 walk logic lots of details
    example:
    wordlist_verbose: true

    wordlist_wordkey_description
    type:
    string
    used by:
    all
    default:
    Word/DocID 32/Flags 8/Location 16
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Internal key description: *not user configurable*
    example:
    No example provided

    wordlist_wordrecord_description
    type:
    string
    used by:
    all
    default:
    DATA
    block:
    Global
    version:
    3.2.0b1 or later
    description:
    Internal data description: *not user configurable*
    example:
    No example provided

    Last modified: Sat Jun 12 23:26:34 EST 2004 htdig-3.2.0b6/htdoc/attrs_head.html0100644006314600127310000000126710055635546016507 0ustar angusgbhtdig ht://Dig: Configuration file attributes

    Configuration file format -- Attributes

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Alphabetical list of attributes


    htdig-3.2.0b6/htdoc/attrs_tail.html0100644006314600127310000000010007426615573016526 0ustar angusgbhtdig Last modified: $Date: 2002/02/01 22:49:31 $ htdig-3.2.0b6/htdoc/author.html0100644006314600127310000000320210055635546015662 0ustar angusgbhtdig ht://Dig: About the Author

    ht://Dig: About the Author

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Andrew Scherpbier is the author of ht://Dig. He started work on ht://Dig while working at San Diego State University. In August 1996, he formed his own software company, Contigo Software, together with several partners. He currently is Vice President of Research and Development at Contigo Software.

    Unfortunately, since starting Contigo Software, Andrew has had very little time to work on ht://Dig. This is also the reason that email regarding ht://Dig sent directly to Andrew will most likely go unanswered. Please direct questions to the ht://Dig mailing list. Also make sure you consult the Frequently Asked Questions page and browse or search the Mailing list archive.


    Andrew Scherpbier <andrew@contigo.com> Last modified: $Date: 2004/05/28 13:15:18 $
    SourceForge Logo htdig-3.2.0b6/htdoc/bdot.gif0100644006314600127310000000005606661432570015115 0ustar angusgbhtdigGIF89a €î÷ÿ,  „©Ë}Þ‹é”.;htdig-3.2.0b6/htdoc/bugs.html0100644006314600127310000000406310055635546015326 0ustar angusgbhtdig ht://Dig: Bug Reporting

    Bug Reporting

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    If you are having problems or have suggestions for ht://Dig feel free to fill out a bug report form. Before you do this, please do the following:

    • Make sure you have the latest version, always available at http://www.htdig.org/where.html. You can also check the release notes for what has changed in new versions.
    • Read the latest documentation, always available at http://www.htdig.org/
    • Read the FAQ, always available at http://www.htdig.org/FAQ.html
    • Looked at the log from running with more verbosity. Usually "-vvv" is helpful for debugging information. Please include any related messages and as much information about your configuration as possible.
    • Checked the ht://Dig bug database.
    • If the bug involves dumping a core file, it also helps if you can provide debugging information from the core. If you don't know how to do this, feel free to ask.

    If you've done this, you can easily submit a bug report or a feature request through the bug database.


    Last modified: $Date: 2004/05/28 13:15:18 $
    SourceForge Logo htdig-3.2.0b6/htdoc/cf_blocks.html0100644006314600127310000000335510055635546016316 0ustar angusgbhtdig ht://Dig: Configuration file format -- Block restrictions

    Configuration file format -- Restricting Attributes

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Many attributes may be restricted in scope, specifically those used by the htdig indexer. These attributes can be specified on a per-server or per-URL basis and thus can be applied to only one site or even one particular portion of a site. For example:

    <server: www.foo.com>
    server_wait_time: 5
    </server>

    Here the portions inside the <server:> </server> block are normal attributes as specified in the general configuration documentation. However, rather than applying to all servers, these attributes will apply only to the www.foo.com server.

    It is also possible to have <url:> </url> blocks. With these, any URL matching the pattern specified in the block will use the attributes within, overriding any other configuration.

    Not all attributes apply within blocks. Those that do are listed with the appropriate context in the attribute documentation.


    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/cf_byname.html0100644006314600127310000006521110060033772016300 0ustar angusgbhtdig Alphabetical Attributes


    Alphabetical Attributes

    Navigate
    ^ ht://Dig
       ^ Configuration file

    A
    * accents_db
    * accept_language
    * add_anchors_to_excerpt
    * allow_double_slash
    * allow_in_form
    * allow_numbers
    * allow_space_in_url
    * allow_virtual_hosts
    * anchor_target
    * any_keywords
    * author_factor
    * authorization

    B
    * backlink_factor
    * bad_extensions
    * bad_local_extensions
    * bad_querystr
    * bad_word_list
    * bin_dir
    * boolean_keywords
    * boolean_syntax_errors
    * build_select_lists

    C
    * caps_factor
    * case_sensitive
    * check_unique_date
    * check_unique_md5
    * collection_names
    * common_dir
    * common_url_parts
    * compression_level
    * config
    * config_dir
    * content_classifier
    * cookies_input_file
    * create_image_list
    * create_url_list

    D
    * database_base
    * database_dir
    * date_factor
    * date_format
    * description_factor
    * description_meta_tag_names
    * disable_cookies
    * doc_db
    * doc_excerpt
    * doc_index
    * doc_list

    E
    * endday
    * end_ellipses
    * end_highlight
    * endings_affix_file
    * endings_dictionary
    * endings_root2word_db
    * endings_word2root_db
    * endmonth
    * endyear
    * excerpt_length
    * excerpt_show_top
    * exclude
    * exclude_urls
    * external_parsers
    * external_protocols
    * extra_word_characters

    H
    * head_before_get
    * heading_factor
    * htnotify_prefix_file
    * htnotify_replyto
    * htnotify_sender
    * htnotify_suffix_file
    * htnotify_webmaster
    * http_proxy
    * http_proxy_authorization
    * http_proxy_exclude

    I
    * ignore_alt_text
    * ignore_dead_servers
    * image_list
    * image_url_prefix
    * include
    * iso_8601

    K
    * keywords
    * keywords_factor
    * keywords_meta_tag_names

    L
    * limit_normalized
    * limit_urls_to
    * local_default_doc
    * local_urls
    * local_urls_only
    * local_user_urls
    * locale
    * logging

    M
    * maintainer
    * match_method
    * matches_per_page
    * max_connection_requests
    * max_description_length
    * max_descriptions
    * max_doc_size
    * max_excerpts
    * max_head_length
    * max_hop_count
    * max_keywords
    * max_meta_description_length
    * max_prefix_matches
    * max_retries
    * max_stars
    * maximum_page_buttons
    * maximum_pages
    * maximum_word_length
    * md5_db
    * meta_description_factor
    * metaphone_db
    * method_names
    * mime_types
    * minimum_prefix_length
    * minimum_speling_length
    * minimum_word_length
    * multimatch_factor

    N
    * next_page_text
    * no_excerpt_show_top
    * no_excerpt_text
    * no_next_page_text
    * no_page_list_header
    * no_page_number_text
    * no_prev_page_text
    * no_title_text
    * noindex_end
    * noindex_start
    * nothing_found_file
    * nph

    P
    * page_list_header
    * page_number_separator
    * page_number_text
    * persistent_connections
    * plural_suffix
    * prefix_match_character
    * prev_page_text

    R
    * regex_max_words
    * remove_bad_urls
    * remove_default_doc
    * remove_unretrieved_urls
    * restrict
    * robotstxt_name

    S
    * script_name
    * search_algorithm
    * search_results_contenttype
    * search_results_footer
    * search_results_header
    * search_results_order
    * search_results_wrapper
    * search_rewrite_rules
    * server_aliases
    * server_max_docs
    * server_wait_time
    * sort
    * sort_names
    * soundex_db
    * star_blank
    * star_image
    * star_patterns
    * startday
    * start_ellipses
    * start_highlight
    * startmonth
    * start_url
    * startyear
    * store_phrases
    * substring_max_words
    * synonym_db
    * synonym_dictionary
    * syntax_error_file

    T
    * tcp_max_retries
    * tcp_wait_time
    * template_map
    * template_name
    * template_patterns
    * text_factor
    * timeout
    * title_factor
    * translate_latin1

    U
    * url_list
    * url_log
    * url_part_aliases
    * url_rewrite_rules
    * url_seed_score
    * url_text_factor
    * use_doc_date
    * use_meta_description
    * use_star_image
    * user_agent

    V
    * valid_extensions
    * valid_punctuation
    * version

    W
    * word_db
    * word_dump
    * wordlist_cache_inserts
    * wordlist_cache_size
    * wordlist_compress
    * wordlist_compress_zlib
    * wordlist_monitor
    * wordlist_monitor_period
    * wordlist_monitor_output
    * wordlist_page_size
    * wordlist_verbose
    * wordlist_wordkey_description
    * wordlist_wordrecord_description
    Quick Search:
    htdig-3.2.0b6/htdoc/cf_byname_head.html0100644006314600127310000000146207426615574017301 0ustar angusgbhtdig Alphabetical Attributes


    Alphabetical Attributes

    Navigate
    ^ ht://Dig
       ^ Configuration file

    htdig-3.2.0b6/htdoc/cf_byname_tail.html0100644006314600127310000000037707426615574017335 0ustar angusgbhtdig
    Quick Search:
    htdig-3.2.0b6/htdoc/cf_byprog.html0100644006314600127310000007056010060033773016333 0ustar angusgbhtdig Attributes by Program


    Attributes by Program

    Navigate
    ^ ht://Dig
       ^ Configuration file


    ???
    * wordlist_cache_inserts

    all
    * bin_dir
    * common_dir
    * common_url_parts
    * config
    * config_dir
    * database_base
    * database_dir
    * doc_db
    * doc_excerpt
    * include
    * url_part_aliases
    * word_db
    * wordlist_cache_size
    * wordlist_compress
    * wordlist_compress_zlib
    * wordlist_monitor
    * wordlist_monitor_period
    * wordlist_monitor_output
    * wordlist_page_size
    * wordlist_wordkey_description
    * wordlist_wordrecord_description

    htdig
    * accept_language
    * allow_double_slash
    * allow_numbers
    * allow_space_in_url
    * allow_virtual_hosts
    * authorization
    * bad_extensions
    * bad_local_extensions
    * bad_querystr
    * bad_word_list
    * case_sensitive
    * check_unique_date
    * check_unique_md5
    * compression_level
    * content_classifier
    * cookies_input_file
    * create_image_list
    * create_url_list
    * description_meta_tag_names
    * disable_cookies
    * doc_index
    * doc_list
    * exclude_urls
    * external_parsers
    * external_protocols
    * extra_word_characters
    * head_before_get
    * http_proxy
    * http_proxy_authorization
    * http_proxy_exclude
    * ignore_alt_text
    * ignore_dead_servers
    * image_list
    * keywords_meta_tag_names
    * limit_normalized
    * limit_urls_to
    * local_default_doc
    * local_urls
    * local_urls_only
    * local_user_urls
    * locale
    * maintainer
    * max_connection_requests
    * max_description_length
    * max_descriptions
    * max_doc_size
    * max_head_length
    * max_hop_count
    * max_keywords
    * max_meta_description_length
    * max_retries
    * maximum_word_length
    * md5_db
    * mime_types
    * minimum_word_length
    * noindex_end
    * noindex_start
    * persistent_connections
    * remove_default_doc
    * robotstxt_name
    * server_aliases
    * server_max_docs
    * server_wait_time
    * start_url
    * store_phrases
    * tcp_max_retries
    * tcp_wait_time
    * timeout
    * translate_latin1
    * url_list
    * url_log
    * url_rewrite_rules
    * use_doc_date
    * user_agent
    * valid_extensions
    * valid_punctuation
    * word_dump

    htdump
    * doc_list
    * word_dump

    htfuzzy
    * accents_db
    * endings_affix_file
    * endings_dictionary
    * endings_root2word_db
    * endings_word2root_db
    * maximum_word_length
    * metaphone_db
    * soundex_db
    * synonym_db
    * synonym_dictionary

    htload
    * doc_list
    * word_dump

    htnotify
    * htnotify_prefix_file
    * htnotify_replyto
    * htnotify_sender
    * htnotify_suffix_file
    * htnotify_webmaster
    * iso_8601

    htpurge
    * remove_bad_urls
    * remove_unretrieved_urls

    htsearch
    * accents_db
    * add_anchors_to_excerpt
    * allow_in_form
    * allow_numbers
    * anchor_target
    * any_keywords
    * author_factor
    * backlink_factor
    * bad_word_list
    * boolean_keywords
    * boolean_syntax_errors
    * build_select_lists
    * caps_factor
    * collection_names
    * date_factor
    * date_format
    * description_factor
    * endday
    * end_ellipses
    * end_highlight
    * endings_root2word_db
    * endings_word2root_db
    * endmonth
    * endyear
    * excerpt_length
    * excerpt_show_top
    * exclude
    * extra_word_characters
    * heading_factor
    * image_url_prefix
    * iso_8601
    * keywords
    * keywords_factor
    * logging
    * match_method
    * matches_per_page
    * max_excerpts
    * max_prefix_matches
    * max_stars
    * maximum_page_buttons
    * maximum_pages
    * maximum_word_length
    * meta_description_factor
    * metaphone_db
    * method_names
    * minimum_prefix_length
    * minimum_speling_length
    * minimum_word_length
    * multimatch_factor
    * next_page_text
    * no_excerpt_show_top
    * no_excerpt_text
    * no_next_page_text
    * no_page_list_header
    * no_page_number_text
    * no_prev_page_text
    * no_title_text
    * nothing_found_file
    * nph
    * page_list_header
    * page_number_separator
    * page_number_text
    * plural_suffix
    * prefix_match_character
    * prev_page_text
    * regex_max_words
    * restrict
    * script_name
    * search_algorithm
    * search_results_contenttype
    * search_results_footer
    * search_results_header
    * search_results_order
    * search_results_wrapper
    * search_rewrite_rules
    * sort
    * sort_names
    * soundex_db
    * star_blank
    * star_image
    * star_patterns
    * startday
    * start_ellipses
    * start_highlight
    * startmonth
    * startyear
    * substring_max_words
    * synonym_db
    * syntax_error_file
    * template_map
    * template_name
    * template_patterns
    * text_factor
    * title_factor
    * translate_latin1
    * url_seed_score
    * url_text_factor
    * use_meta_description
    * use_star_image
    * valid_punctuation
    * version
    Quick Search:
    htdig-3.2.0b6/htdoc/cf_byprog_head.html0100644006314600127310000000145607426615574017333 0ustar angusgbhtdig Attributes by Program


    Attributes by Program

    Navigate
    ^ ht://Dig
       ^ Configuration file

    htdig-3.2.0b6/htdoc/cf_byprog_tail.html0100644006314600127310000000036607426615574017362 0ustar angusgbhtdig
    Quick Search:
    htdig-3.2.0b6/htdoc/cf_general.html0100644006314600127310000000520310055635546016450 0ustar angusgbhtdig ht://Dig: Configuration file format -- General

    Configuration file format -- General

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    All programs in the ht://Dig system use a flexible configuration file. This configuration file is a plain ASCII text file. Each line in the file is either a comment or contains an attribute. Comment lines are blank lines or lines that start with a '#'. Attributes consist of a variable name and an associated value:

    <name>:<whitespace><value><newline>

    The <name> contains any alphanumeric character or underline (_) The <value> can include any character except newline. It also cannot start with spaces or tabs since those are considered part of the whitespace after the colon. It is important to keep in mind that any trailing spaces or tabs will be included.

    It is possible to split the <value> across several lines of the configuration file by ending each line with a backslash (\). The effect on the value is that a space is added where the line split occurs.

    Each program only extracts the attributes it needs and hence it is often convenient to use the same configuration file with all ht://Dig programs. If an attribute is specified more than once in the file, only the last one will be used.

    If a program needs a particular attribute and it is not in the configuration file, it will use the default value which is compiled into the program as defined in htcommon/defaults.cc.

    A configuration file can include another file, by using the special <name>, include. The <value> is taken as the file name of another configuration file to be read in at this point. If the given file name is not fully qualified, it is taken relative to the directory in which the current configuration file is found. Variable expansion is permitted in the file name. Multiple include statements, and nested includes are also permitted.

    Example:
    include: common.conf

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/cf_generate.pl0100755006314600127310000001556610060246167016305 0ustar angusgbhtdig# # cf_generate.pl # # cf_generate: Build the files cf_byprog.html, cf_byname.html and # attrs.html from the informations found # in ../htcommon/defaults.cc. # attrs.html : attrs_head.html + generation + attrs_tail.html # cf_byprog.html : cf_byprog_head.html + generation + cf_byprog_tail.html # cf_byname.html : cf_byname_head.html + generation + cf_byname_tail.html # # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: cf_generate.pl,v 1.9 2004/06/05 04:30:47 lha Exp $ # use strict; use vars qw(%char2quote); %char2quote = ( '>' => '>', '<' => '<', '&' => '&', "'" => ''', '"' => '"', ); sub html_escape { my($toencode) = @_; return undef if(!defined($toencode)); $toencode =~ s;([&\"<>\']);$char2quote{$1};ge; return $toencode; } # # Read and parse attributes descriptions found in defaults.cc # my($dir); if (scalar(@ARGV) == 0) { $dir = '..'; } else { $dir = @ARGV[0]; } local($/) = undef; my($file) = $dir . "/htcommon/defaults.cc"; my($content); open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; close(FILE); # # Change curly to square brackets to generate perl arrays instead # of hashes. Order is important. # $content =~ s/.*ConfigDefaults.*?\{(.*)\{0, 0.*/[$1]/s; $content =~ s/\s*\\*$//mg; $content =~ s/([\@\$])/\\$1/gs; $content =~ s/^\{/\[/mg; $content =~ s/^\"\s*\},$/\" \],/mg; # # Transform macro substituted strings by @strings@ (substitued by ../configure) # Three step process ( -> \@ string\@ -> \@string\@ -> @string@ ) # as perl seems to get confused by @$2. # $content =~ s|^(\[ \"\w+\", )([A-Z].*?),\n|$1\"\\\@$2\\@\",\n|mg; #$content =~ s/^(\[ \"\w+\", )\"(.*?)\"(.*?)\"(.*?)\",\n/$1\"$2\\\"$3\\\"$4\",\n/mg; $content =~ s/BIN_DIR/bindir/g; my($config); eval "\$config = $content"; if(!$config) { die "could not extract any configuration info from $file"; } # # Spit the HTML pages # my($file); # # Complete list of attributes with descriptions and examples. # $file = "attrs.html.in"; open(ATTR, ">$file") or die "cannot open $file for writing : $!"; $file = $dir . "/htdoc/attrs_head.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; print ATTR $content; close(FILE); # # Index by attribute name # $file = "cf_byname.html"; open(BYNAME, ">$file") or die "cannot open $file for writing : $!"; $file = $dir . "/htdoc/cf_byname_head.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; print BYNAME $content; close(FILE); my($letter) = ''; my($record); foreach $record (@$config) { my($name, $default, $type, $programs, $block, $version, $category, $example, $description) = @$record; if($letter ne uc(substr($name, 0, 1))) { print BYNAME "\t

    \n" if($letter); $letter = uc(substr($name, 0, 1)); print BYNAME "\t$letter
    \n"; } print BYNAME "\t \"*\" $name
    \n"; my($used_by) = join(",\n\t\t\t", map { my($top) = $_ eq 'htsearch' ? " target=\"_top\"" : ""; "$_"; } split(' ', $programs)); if ($block eq '') { $block = "Global"; } if($version != 'all') { $version = "$version or later"; } if(!($example =~ /^$name:/)) { $example = "\t\t\t No example provided \n"; } elsif($example =~ /\A$name:\s*\Z/s) { $example = "\t\t\t $name: \n"; } else { my($one); my($html) = ''; foreach $one (split("$name:", $example)) { next if($one =~ /^\s*$/); $html .= < $name: $one EOF } $example = $html; } if($default =~ /^\s*$/) { $default = "No default"; } else { $default =~ s/^([A-Z][A-Z_]*) \" (.*?)\"/$1 $2/; # for PDF_PARSER $default = html_escape($default); # hyperlink default values defined in terms of other attributes $default =~ s/\${([A-Za-z_]*)}/\${$1<\/a>}/; } print ATTR <
    $name
    type:
    $type
    used by:
    $used_by
    default:
    $default
    block:
    $block
    version:
    $version
    description:
    $description
    example:
    $example

    EOF } open(FILE, "date |") or die "cannot open pipe to date command for reading : $!"; $content = ; close(FILE); my($date) = $content; my($file) = $dir . "/htdoc/attrs_tail.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; $content =~ s/Last modified: [^\n]*\n/Last modified: $date/; print ATTR $content; close(FILE); my($file) = $dir . "/htdoc/cf_byname_tail.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; print BYNAME $content; close(FILE); close(ATTR); close(BYNAME); # # Index by program name # $file = "cf_byprog.html"; open(BYPROG, ">$file") or die "cannot open $file for writing : $!"; $file = $dir . "/htdoc/cf_byprog_head.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; print BYPROG $content; close(FILE); my(%prog2attr); foreach $record (@$config) { my($name, $default, $type, $programs, $example, $description) = @$record; my($prog); foreach $prog (split(' ', $programs)) { push(@{$prog2attr{$prog}}, $record); } } my($prog); foreach $prog (sort(keys(%prog2attr))) { my($top) = $prog eq 'htsearch' ? "target=\"_top\"" : "target=\"body\""; print BYPROG "\t
    $prog
    \n"; my($record); foreach $record (@{$prog2attr{$prog}}) { my($name, $default, $type, $programs, $example, $description) = @$record; print BYPROG "\t \"*\" $name
    \n"; } } my($file) = $dir . "/htdoc/cf_byprog_tail.html"; open(FILE, "<$file") or die "cannot open $file for reading : $!"; $content = ; print BYPROG $content; close(FILE); close(BYPROG); htdig-3.2.0b6/htdoc/cf_types.html0100644006314600127310000000445710055635546016211 0ustar angusgbhtdig ht://Dig: Configuration file format -- Attribute Types

    Configuration file format -- Attribute Types

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    The meaning of the attribute value depends on the attribute itself. In general, the values can be of several types:

    String
    Any string of characters except newline.
    String List
    A sequence of strings separated by whitespace. Individual strings within the list cannot be quoted and therefore cannot contain whitespace.
    Quoted String List
    A sequence of strings separated by whitespace. Individual strings within the list may be quoted using single or double quotes. The quotes are needed when the individual strings contain whitespace. If you want a quote mark or a backslash to be inserted as-is into a string, you must preceed it with a backslash.
    Pattern List
    A sequence of patterns separated by whitespace. Normal strings are considered patterns to be matched exactly. Strings surrounded by [ and ] are considered regular expressions (ignoring the outer [] characters).
    Number
    A string that represents a number. The attribute determines if the number has to be a pure integer or if it can be a floating point number.
    Boolean
    A string that represents a truth value. Acceptable truth values are given below.
    For true:
    • yes
    • true
    • 1
    For false:
    • no
    • false
    • 0

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/cf_variables.html0100644006314600127310000000405110055635546017003 0ustar angusgbhtdig ht://Dig: Configuration file format -- Variable Expansion

    Configuration file format -- Variable Expansion

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Attribute values can contain references to other attributes. This is done similarly to how Perl, Bourne shell, and Makefiles use variables. The variables that are referenced will be expanded when the variable is used, not when it is defined. This means that attributes don't have to be defined in the order that they are used.

    Example attribute reference in an attribute value:

    database_base: ${database_dir}/htdig

    or

    database_base: $database_dir/htdig

    Many default values use the attribute expansion mechanism to make configuration easier and more generic.

    In addition to variable expansion, it is also possible to include the contents of a file as the value of an attribute. This is done by putting the filename in backquotes (`). Within the backquotes, variable expansion will still work so that files can be specified relative to some path. The backquotes and the filename will be replaced by the contents of the file if it exists. All whitespace (spaces, tabs, newlines, etc) in the file are condensed to one space before the substitution takes place. The following are some examples of the use of the backquoting scheme:

    start_url: `${common_dir}/starting_points`
    limit_urls_to: `${common_dir}/limit_list`

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/config.html0100644006314600127310000004727310055635546015645 0ustar angusgbhtdig ht://Dig: Configuration

    Configuration

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    ht://Dig requires a configuration file and several HTML files to operate correctly. Fortunately, when ht://Dig is installed, a very reasonable configuration is created and in most cases only minor modifications to the files are necessary.

    Below, we will use the variables that were set in CONFIG to designate specific paths.

    Standard files:


    ${CONFIG_DIR}/htdig.conf

    This is the main runtime configuration file for all programs that make up ht://Dig. The file is fully described in the Configuration file manual.

    When ht://Dig is installed, several attributes will be customized to your particular environment, but for reference, here is a sample copy of what it can look like:

    
    #
    # Example config file for ht://Dig.
    #
    # This configuration file is used by all the programs that make up ht://Dig.
    # Please refer to the attribute reference manual for more details on what
    # can be put into this file.  (http://www.htdig.org/confindex.html)
    # Note that most attributes have very reasonable default values so you
    # really only have to add attributes here if you want to change the defaults.
    #
    # What follows are some of the common attributes you might want to change.
    #
    
    #
    # Specify where the database files need to go.  Make sure that there is
    # plenty of free disk space available for the databases.  They can get
    # pretty big.
    #
    database_dir:           /opt/www/htdig/db
    
    #
    # This specifies the URL where the robot (htdig) will start.  You can specify
    # multiple URLs here.  Just separate them by some whitespace.
    # The example here will cause the ht://Dig homepage and related pages to be
    # indexed.
    # You could also index all the URLs in a file like so:
    # start_url:           `${common_dir}/start.url`
    #
    start_url:              http://www.htdig.org/
    
    #
    # This attribute limits the scope of the indexing process.  The default is to
    # set it to the same as the start_url above.  This way only pages that are on
    # the sites specified in the start_url attribute will be indexed and it will
    # reject any URLs that go outside of those sites.
    #
    # Keep in mind that the value for this attribute is just a list of string
    # patterns. As long as URLs contain at least one of the patterns it will be
    # seen as part of the scope of the index.
    #
    limit_urls_to:          ${start_url}
    
    #
    # If there are particular pages that you definitely do NOT want to index, you
    # can use the exclude_urls attribute.  The value is a list of string patterns.
    # If a URL matches any of the patterns, it will NOT be indexed.  This is
    # useful to exclude things like virtual web trees or database accesses.  By
    # default, all CGI URLs will be excluded.  (Note that the /cgi-bin/ convention
    # may not work on your web server.  Check the  path prefix used on your web
    # server.)
    #
    exclude_urls:           /cgi-bin/ .cgi
    
    #
    # Since ht://Dig does not (and cannot) parse every document type, this 
    # attribute is a list of strings (extensions) that will be ignored during 
    # indexing. These are *only* checked at the end of a URL, whereas 
    # exclude_url patterns are matched anywhere.
    #
    # Also keep in mind that while other attributes allow regex, these must be 
    # actual strings.
    #
    bad_extensions:         .wav .gz .z .sit .au .zip .tar .hqx .exe .com .gif \
            .jpg .jpeg .aiff .class .map .ram .tgz .bin .rpm .mpg .mov .avi .css
    
    #
    # The string htdig will send in every request to identify the robot.  Change
    # this to your email address.
    #
    maintainer:             unconfigured@htdig.searchengine.maintainer
    
    #
    # The excerpts that are displayed in long results rely on stored information
    # in the index databases.  The compiled default only stores 512 characters of
    # text from each document (this excludes any HTML markup...)  If you plan on
    # using the excerpts you probably want to make this larger.  The only concern
    # here is that more disk space is going to be needed to store the additional
    # information.  Since disk space is cheap (! :-)) you might want to set this
    # to a value so that a large percentage of the documents that you are going
    # to be indexing are stored completely in the database.  At SDSU we found
    # that by setting this value to about 50k the index would get 97% of all
    # documents completely and only 3% was cut off at 50k.  You probably want to
    # experiment with this value.
    # Note that if you want to set this value low, you probably want to set the
    # excerpt_show_top attribute to false so that the top excerpt_length characters
    # of the document are always shown.
    #
    max_head_length:        10000
    
    #
    # To limit network connections, ht://Dig will only pull up to a certain limit
    # of bytes. This prevents the indexing from dying because the server keeps
    # sending information. However, several FAQs happen because people have files
    # bigger than the default limit of 100KB. This sets the default a bit higher.
    # (see <http://www.htdig.org/FAQ.html> for more)
    #
    max_doc_size:           200000
    
    #
    # Most people expect some sort of excerpt in results. By default, if the 
    # search words aren't found in context in the stored excerpt, htsearch shows 
    # the text defined in the no_excerpt_text attribute:
    # (None of the search words were found in the top of this document.)
    # This attribute instead will show the top of the excerpt.
    #
    no_excerpt_show_top:    true
    
    #
    # Depending on your needs, you might want to enable some of the fuzzy search
    # algorithms.  There are several to choose from and you can use them in any
    # combination you feel comfortable with.  Each algorithm will get a weight
    # assigned to it so that in combinations of algorithms, certain algorithms get
    # preference over others.  Note that the weights only affect the ranking of
    # the results, not the actual searching.
    # The available algorithms are:
    #       accents
    #       exact
    #       endings
    #       metaphone
    #       prefix
    #       regex
    #       soundex
    #       speling [sic]
    #       substring
    #       synonyms
    # By default only the "exact" algorithm is used with weight 1.
    # Note that if you are going to use the endings, metaphone, soundex, accents,
    # or synonyms algorithms, you will need to run htfuzzy to generate
    # the databases they use.
    #
    search_algorithm:       exact:1 synonyms:0.5 endings:0.1
    
    #
    # The following are the templates used in the builtin search results
    # The default is to use compiled versions of these files, which produces
    # slightly faster results. However, uncommenting these lines makes it
    # very easy to change the format of search results.
    # See <http://www.htdig.org/hts_templates.html> for more details.
    #
    # template_map: Long long ${common_dir}/long.html \
    #               Short short ${common_dir}/short.html
    # template_name: long
    
    #
    # The following are used to change the text for the page index.
    # The defaults are just boring text numbers.  These images spice
    # up the result pages quite a bit.  (Feel free to do whatever, though)
    #
    next_page_text:         <img src="/htdig/buttonr.gif" border="0" align="middle" width="30" height="30" alt="next">
    no_next_page_text:
    prev_page_text:         <img src="/htdig/buttonl.gif" border="0" align="middle" width="30" height="30" alt="prev">
    no_prev_page_text:
    page_number_text:       '<img src="/htdig/button1.gif" border="0" align="middle" width="30" height="30" alt="1">' \
                            '<img src="/htdig/button2.gif" border="0" align="middle" width="30" height="30" alt="2">' \
                            '<img src="/htdig/button3.gif" border="0" align="middle" width="30" height="30" alt="3">' \
                            '<img src="/htdig/button4.gif" border="0" align="middle" width="30" height="30" alt="4">' \
                            '<img src="/htdig/button5.gif" border="0" align="middle" width="30" height="30" alt="5">' \
                            '<img src="/htdig/button6.gif" border="0" align="middle" width="30" height="30" alt="6">' \
                            '<img src="/htdig/button7.gif" border="0" align="middle" width="30" height="30" alt="7">' \
                            '<img src="/htdig/button8.gif" border="0" align="middle" width="30" height="30" alt="8">' \
                            '<img src="/htdig/button9.gif" border="0" align="middle" width="30" height="30" alt="9">' \
                            '<img src="/htdig/button10.gif" border="0" align="middle" width="30" height="30" alt="10">'
    #
    # To make the current page stand out, we will put a border around the
    # image for that page.
    #
    no_page_number_text:    '<img src="/htdig/button1.gif" border="2" align="middle" width="30" height="30" alt="1">' \
                            '<img src="/htdig/button2.gif" border="2" align="middle" width="30" height="30" alt="2">' \
                            '<img src="/htdig/button3.gif" border="2" align="middle" width="30" height="30" alt="3">' \
                            '<img src="/htdig/button4.gif" border="2" align="middle" width="30" height="30" alt="4">' \
                            '<img src="/htdig/button5.gif" border="2" align="middle" width="30" height="30" alt="5">' \
                            '<img src="/htdig/button6.gif" border="2" align="middle" width="30" height="30" alt="6">' \
                            '<img src="/htdig/button7.gif" border="2" align="middle" width="30" height="30" alt="7">' \
                            '<img src="/htdig/button8.gif" border="2" align="middle" width="30" height="30" alt="8">' \
                            '<img src="/htdig/button9.gif" border="2" align="middle" width="30" height="30" alt="9">' \
                            '<img src="/htdig/button10.gif" border="2" align="middle" width="30" height="30" alt="10">'
    
    

    ${SEARCH_DIR}/search.html

    This is the default search form. It is an example interface to the search engine, htsearch. The file contains a form with as its action a call to htsearch. There are several form variables which htsearch will use. More about those can be found in the htsearch documentation.

    An example file can be as follows:

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>ht://Dig WWW Search</title>
    </head>
    <body bgcolor="#eef7ff">
    <h1>
    <a href="http://www.htdig.org"><IMG SRC="/htdig/htdig.gif" align="bottom" alt="ht://Dig" border="0"></a>
    WWW Site Search</h1>
    <hr noshade size="4">
    This search will allow you to search the contents of
    all the publicly available WWW documents at this site.
    <br>
    <p>
    <form method="post" action="/cgi-bin/htsearch">
    <font size="-1">
    Match: <select name="method">
    <option value="and">All
    <option value="or">Any
    <option value="boolean">Boolean
    </select>
    Format: <select name="format">
    <option value="builtin-long">Long
    <option value="builtin-short">Short
    </select>
    Sort by: <select name="sort">
    <option value="score">Score
    <option value="time">Time
    <option value="title">Title
    <option value="revscore">Reverse Score
    <option value="revtime">Reverse Time
    <option value="revtitle">Reverse Title
    </select>
    </font>
    <input type="hidden" name="config" value="htdig">
    <input type="hidden" name="restrict" value="">
    <input type="hidden" name="exclude" value="">
    <br>
    Search:
    <input type="text" size="30" name="words" value="">
    <input type="submit" value="Search">
    </form>
    <hr noshade size="4">
    </body>
    </html>
    
    
    

    ${COMMON_DIR}/header.html

    This file is the file that is output before any of the search results are produced in a search. This file can be customized to reflect your particular web look-and-feel, for example. Take note that this file is only the top part of the full HTML document that is produced when search results are displayed. This means that it should start with the proper HTML introductory tags and title.

    This file will not just simply be copied. Instead, the search engine will look for special variables inside the file. These variables will be replaced with the appropriate values for the particular search it is used for. For more details of the use of these variables, consult the htsearch templates documentation.

    Below is the default header.html file that gets installed. Note that it contains a form to allow the user to refine the search.

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html><head><title>Search results for '$&(WORDS)'</title></head>
    <body bgcolor="#eef7ff">
    <h2><img src="/htdig/htdig.gif" alt="ht://Dig">
    Search results for '$&(LOGICAL_WORDS)'</h2>
    <hr noshade size="4">
    <form method="get" action="$(CGI)">
    <font size="-1">
    <input type="hidden" name="config" value="$&(CONFIG)">
    <input type="hidden" name="restrict" value="$&(RESTRICT)">
    <input type="hidden" name="exclude" value="$&(EXCLUDE)">
    Match: $(METHOD)
    Format: $(FORMAT)
    Sort by: $(SORT)
    <br>
    Refine search:
    <input type="text" size="30" name="words" value="$&(WORDS)">
    <input type="submit" value="Search">
    </font>
    </form>
    <hr noshade size="1">
    <strong>Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches.
    More <img src="/htdig/star.gif" alt="*">'s indicate a better match.
    </strong>
    <hr noshade size="1">
    
    

    ${COMMON_DIR}/footer.html

    This file is output after all the search results have been displayed. All the same header.html rules apply to this file, except that it is supposed to contain all the ending HTML tags.

    Below is the default footer.html file that gets installed. Note that it contains the page navigation stuff.

    
    $(PAGEHEADER)
    $(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
    <hr noshade size="4">
    <a href="http://www.htdig.org/">
    <img src="/htdig/htdig.gif" border="0" alt="ht://Dig">ht://Dig $(VERSION)</a>
    </body></html>
    
    

    ${COMMON_DIR}/wrapper.html

    This file may be used in place of the header.html and footer.html files above. It is simply the concatenation of these two files, with the pseudo-variable $(HTSEARCH_RESULTS) as a separator for the header and footer sections. All the same header.html and footer.html rules apply to this file. To make this file override the header and footer files above, you must define the search_results_wrapper attribute.


    ${COMMON_DIR}/nomatch.html

    If a search produces no matches, this file is displayed. All the relevant variables will be replaced as in the header.html and footer.html files. The default nomatch.html is little more than header.html and footer.html appended:

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html><head><title>No match for '$&(LOGICAL_WORDS)'</title></head>
    <body bgcolor="#eef7ff">
    <h1><img src="/htdig/htdig.gif" alt="ht://Dig">
    Search results</h1>
    <hr noshade size="4">
    <h2>No matches were found for '$&(LOGICAL_WORDS)'</h2>
    <p>
    Check the spelling of the search word(s) you used.
    If the spelling is correct and you only used one word,
    try using one or more similar search words with "<strong>Any</strong>."
    </p><p>
    If the spelling is correct and you used more than one
    word with "<strong>Any</strong>," try using one or more similar search
    words with "<strong>Any</strong>."</p><p>
    If the spelling is correct and you used more than one
    word with "<strong>All</strong>," try using one or more of the same words
    with "<strong>Any</strong>."</p>
    <hr noshade size="4">
    <form method="get" action="$(CGI)">
    <font size="-1">
    <input type="hidden" name="config" value="$&(CONFIG)">
    <input type="hidden" name="restrict" value="$&(RESTRICT)">
    <input type="hidden" name="exclude" value="$&(EXCLUDE)">
    Match: $(METHOD)
    Format: $(FORMAT)
    Sort by: $(SORT)
    <br>
    Refine search:
    <input type="text" size="30" name="words" value="$&(WORDS)">
    <input type="submit" value="Search">
    </font>
    </form>
    <hr noshade size="4">
    <a href="http://www.htdig.org/">
    <img src="/htdig/htdig.gif" border="0" alt="ht://Dig">ht://Dig $(VERSION)</a>
    </body></html>
    
    

    ${COMMON_DIR}/syntax.html

    If a boolean expression search causes a syntax error, this file will be displayed.

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html><head><title>Error in Boolean search for '$&(WORDS)'</title></head>
    <body bgcolor="#eef7ff">
    <h1><img src="/htdig/htdig.gif" alt="ht://Dig">
    Error in Boolean search for '$&(LOGICAL_WORDS)'</h1>
    <hr noshade size="4">
    Boolean expressions need to be 'correct' in order for the search
    system to use them.
    The expression you entered has errors in it.<p>
    Examples of correct expressions are: <strong>cat and dog</strong>, <strong>cat
    not dog</strong>, <strong>cat or (dog not nose)</strong>.<br>Note that
    the operator <strong>not</strong> has the meaning of 'without'.
    <blockquote><strong>
    $(SYNTAXERROR)
    </strong></blockquote>
    <hr noshade size="4">
    <form method="get" action="$(CGI)">
    <font size="-1">
    <input type="hidden" name="config" value="$&(CONFIG)">
    <input type="hidden" name="restrict" value="$&(RESTRICT)">
    <input type="hidden" name="exclude" value="$&(EXCLUDE)">
    Match: $(METHOD)
    Format: $(FORMAT)
    Sort: $(SORT)
    <br>
    Refine search:
    <input type="text" size="30" name="words" value="$&(WORDS)">
    <input type="submit" value="Search">
    </font>
    </form>
    <hr noshade size="4">
    <a href="http://www.htdig.org/">
    <img src="/htdig/htdig.gif" border="0" alt="ht://Dig">ht://Dig $(VERSION)</a>
    </body></html>
    
    
    

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/confindex.html0100644006314600127310000000057306662627025016347 0ustar angusgbhtdig ht://Dig -- Internet search engine software htdig-3.2.0b6/htdoc/confmenu.html0100644006314600127310000000307507426615574016211 0ustar angusgbhtdig Configuration file


    Configuration file

    Navigate
    ^ ht://Dig

    File format
    * General
    * Block restrictions
    * Attribute types
    * Variable expansion

    Attributes
    > By program
    > Alphabetical
    Quick Search:
    htdig-3.2.0b6/htdoc/contents.html0100644006314600127310000001016307426615574016230 0ustar angusgbhtdig ht://Dig Table of Contents


    Contents

    General
    * ht://Dig
    * Features and Requirements
    * Where to get it
    * Installation
    * Configuration
    * Running ht://Dig
    * FAQ
    > Mailing list
    * Uses of ht://Dig
    * License information

    Reference
    * Overview
    * rundig
    * htdig
    * htmerge
    * htnotify
    * htdump
    * htload
    * htpurge
    * htstat
    * htfuzzy
    > htsearch
    > Configuration file
    * META tags

    Other
    * Contributors
    * Release notes
    * ChangeLog
    * TODO
    * Bug Reporting
    * Related Projects
    > Contributed Work
    * Developer Site

    Quick Search:
    htdig-3.2.0b6/htdoc/dot.gif0100644006314600127310000000005606275416054014753 0ustar angusgbhtdigGIF87a €Z{Œÿÿÿ,  „©Ë}Þ‹é”.;htdig-3.2.0b6/htdoc/htdig.gif0100644006314600127310000000343606275416053015270 0ustar angusgbhtdigGIF87aQ6Äÿÿÿµµµ{ss„{{B99µssµJJµ))­½½­„J΄s{cZ”R1ÿÆ¥91çïïJRJckcŒœ9csZ{ŒRs„Œ¥µBk„ÎÖÞRRZ,Q6ÿà%Ždižhª®,™½p,Ït‰š7i£íÿ0ÎHôi0˜c¹$ ‹Ðàð¥áX56$†CÄv:ÂÒ`p|U«U;ͤ9X¢ð%Ø'Сl<@vJvvvCuwrS“y3…ƒŸŽŽ:\–t°›2”?“¦§¹«¬•´º@s˜š4¸ÉYƒaÀŒŽŽ‘<n5O³³µä1У Tq0¢ŸÀíŽì/´Ä£pC€Ì.!ËTÑ8Grµ{gEÆ>*L&áµßö4"À¥ <*HŽÿL˜fà\BX$’äQŒš7;*ôPÀAƒ€1q¯Ñ71bX¸¡RXv(´Lˆ®&)Å $…Pa܇ ,ë ÂcÓ¥öÔW¦ k~XFw!…i„nˆŠÊ§k£* ]¶°™„ /p ñhRÀp‘u˜°’”ª™&$ýংÄàÑÊ•áÃXÅb}¢-v±Ñ¶ ÃZi‡€æFS©¾¤´9àçHn–NÌñbX·vðú±ÎÙ{3.ôÀE7¦~óf`‡}ˆˆ2ˆ[/ì3±ØåÍÿ>·³6Æì]^‡ÏyûgÚ5ΠÆ1ÑX©¥÷Èz Ý´Áÿw| fØõf%#(A@œךa‰­åX#oÁRÁ6QEUŸ| EØH}ÜéÔ4`€}e^qç ð^,UË«C]žÐçÛšUð>lpA'pµk øG^GáåDdvXàdY—¢‘¶³ØV –a¦‰õD|emX@gGF …I$o+ ¦"L•VC©FÜØt¹—î̶JãTrÙn£éÏ †zà$8å@¨¦çœÕ´È&³áå›Î'¡ «|@#X@ÈìJÆ ˜‡«Dò {=ÊêÉ&t%¥¢vÛMšMÿ5DÐÍ Z0Á·à×@w6ÒÁ–œ~‚Œ&IeãÒ Þ‘3B ht://Dig: htdig

    htdig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htdig [options] [start_url_file]

    Description

    Htdig retrieves HTML documents using the HTTP protocol and gathers information from these documents which can later be used to search these documents. This program can be referred to as the search robot.

    Options

    -a
    Use alternate work files. Tells htdig to append .work to database files, causing a second copy of the database to be built. This allows the original files to be used by htsearch during the indexing run. When used without the "-i" flag for an update dig, htdig will use any existing .work files for the databases to update.
    -c configfile
    Use the specified configfile file instead of the default.
    -h maxhops
    Restrict the dig to documents that are at most maxhops links away from the starting document.
    -i
    Initial. Do not use any old databases. This is accomplished by first erasing the databases.
    -m url_file
    Minimal. Index only the URLs listed in url_file and no others. A file name of "-" reads from STDIN. See also the start_url_file argument.
    -s
    Print statistics about the dig after completion.
    -t
    Create an ASCII version of the document database. This database is easy to parse with other programs so that information can be extracted from it for purposes other than searching. One could gather some interesting statistics from this database.

    Each line in the file starts with the document id followed by a list of \tfieldname:value. The fields always appear in the order listed below:

    fieldnamevalue
    uURL
    tTitle
    aState (0 = normal, 1 = not found, 2 = not indexed, 3 = obsolete)
    mLast modification time as reported by the server
    sSize in bytes
    HExcerpt
    hMeta description
    lTime of last retrieval
    LCount of the links in the document (outgoing links)
    bCount of the links to the document (incoming links or backlinks)
    cHopCount of this document
    gSignature of the document used for duplicate-detection
    eE-mail address to use for a notification message from htnotify
    nDate to send out a notification e-mail message
    SSubject for a notification e-mail message
    dThe text of links pointing to this document. (e.g. <a href="docURL">description</a>)
    AAnchors in the document (i.e. <A NAME=...)
    -u username:password
    Tells htdig to send the supplied username and password with each HTTP request. The credentials will be encoded using the 'Basic' authentication scheme. There HAS to be a colon (:) between the username and password.
    -v
    Verbose mode. This increases the verbosity of the program. Using more than 2 is probably only useful for debugging purposes. The default verbose mode (using only one -v) gives a nice progress report while digging. This progress report can be a bit cryptic, so here is a brief explanation. A line is shown for each URL, with 3 numbers before the URL and some symbols after the URL. The first number is the number of documents parsed so far, the second is the DocID for this document, and the third is the hop count of the document (number of hops from one of the start_url documents). After the URL, it shows a "*" for a link in the document that it already visited, a "+" for a new link it just queued, and a "-" for a link it rejected for any of a number of reasons. To find out what those reasons are, you need to run htdig with at least 3 -v options, i.e. -vvv. If there are no "*", "+" or "-" symbols after the URL, it doesn't mean the document was not parsed or was empty, but only that no links to other documents were found within it. With more verbose output, these symbols will get interspersed in several lines of debugging output.
    start_url_file
    A file containing a list of URLs to start indexing from, or "-" for STDIN. This will augment the default start_url and override the file supplied to [-m url_file].

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.
    DATABASE_DIR/db.docdb
    Stores data about each document (title, url, etc.).
    DATABASE_DIR/db.words.db, DATABASE_DIR/db.words.db_weakcmpr
    Record which documents each word occurs in.
    DATABASE_DIR/db.excerpts
    Stores start of each document to show context of matches.

    See Also

    htmerge, htsearch, Configuration file format, and A Standard for Robot Exclusion.

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/htdig_big.gif0100644006314600127310000001500606275416053016105 0ustar angusgbhtdigGIF87aÇ…Õÿÿÿ÷÷÷ïïœ„„„{{{cccJJJBBB111½µµµ¥¥Æ¥¥)!!µ„„½ssµkkZ11µZZµRRµBB{))­11¥!!­c{­­œ{Z)J!sRJRŒcR¥1ÿ½œ½Bﵔ筌½”{çµ”J9)B991ÖÞÞ½ÆÆ!!Œ¥­9RZc„”Z{ŒRs„­½Æ)9BRk{{”¥B1c)B„9B,Ç…ÿ@›pH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿¶ZÍv»…Áè´z]Õår²ŸB–Ó™Çì¼~Ï­Ñd !!<…<ƒ24x|ŽKq†””!97bŒœl7?„•£‡? ofžª«Yšc¤–=be¬{®®d»N78Å?±rµ=Î  9½Ö5e7:P×c©ÂÄÅãÇ.›QÙéebi0ïïÈ‚ô##%ù 1 Ç~èp7® À1`Ä@ƒF&%7f¼3ð›£pð2xqîIÄ8BŠÄ‘ƒF»ŒüX9(ÄÊ'Và[¡€J j¸ËÈ“§ÿ L&‰Ø3Þ‹0öÜØ1ذž~TCÞ´$²f•£‚¦œ d Ugѳï P0TbQdHù(åÉ”Ê\xQ§z!š‘ÀʬƒVF8q"B"°<ýnÛ‰¶h€˜Žð]z”Ó]xu§\&VöË< Úª B‰¨O ¦É !ŒEÓÈdº•Á=]ÊÑîn”¿T…wJAV*£F­‚^F?Ùˆ-›ç:çnkÌýhó±Þšã ÎE»: ¡b¹ûж§¢^=ã‚è›´cæ~QdYÔGsÿA…¬J”ç’Ql ¡Ì÷ÇË™ñJvàß’ú@G:ÍÂË—’ÐDœkUräTîR6Ž$qøb!Ûö·A°U©F)6ªˆNÛ ‰T÷8:Zr‹›´Z.‰&2è ”£[ ÙæÖ0•÷Kd×H°Xæo–äÜPPuÉ]Þ“Èòà AÓT•„§&Ú1k"Œk‹غº²}s¢ÿ‚eDýðÏe—+å= Õt™®¬L'Ù§X¢lŽ?=ÖH…šÇ¢>.R• è@‚[PjŒ–‹[nÈÒ‚3 X2Ñ)Ð.Ñ!;(J…BˆÐï8ó4ëIï ?Ñ…  ]JœjC–V޲•ûÀ!ùÏŒ2s¬öñàŸåΰòæ°ãI¬IÉ ’ÈT˜ Ð5J8¿¤u”Lífój?ûÄŽ¯,Y‡8¶. Õ%I+´úQlu và«Ö²$dð@°¼UÒåyC¼æök\ÓÒE¡dUÿír…« À5/½¡ ’DI&à¨Á$ú4Э«âívYE ÿ2€×4!¤ EíDÊjM{&à>€ \”ÄMG9xi!á6×ײ¿=îRÀÛÎÛöp0Êõš@/#)xŠÊMo~~ ƒC8 äe»à±!a}òsy€ tÄ/p B 4Än¢æ‹‡*ÞõÂɽ^ËW,²tñÇKeëv7ËÙz¹ SŸ½ ž¶)ƒ6µ Ul¬lã[4¥ºÎâ•À¼] OÌóŒ+#oÁrsr‰šË)ÀƸoS öÛXñ9®CæHPï€Ðжë-ìÿ Üf ¾yÁêt t` ' l\Çí¨“¼¶ƒt­s ËO?àe€§;B8JžQ´b«,ÔžÊÀ~µ'Iò°©m+A/s›¶Ý<¦*ÕrL•ž 8=7ZxˆŠ+ `‡mÁŧ†1£Ó¹êVG»×Ò¥‰¨ ¦úl9fA÷Ø®:¦„þ4¨£WÀ´ü„!&ùÖà½hf µ Ðh a×ìädz=ôí`˜àä&Њʵ²¶[“ ?®ÎŸ„îïik.Z܉etæx|òñž,A!@Ò—Îô¦›à†.¤cÞ˜â&¹"ÞžZ}ÿ6ÞTöhupÎq÷ýdw‰ãN”—¼éL'®ŸjàÞ – ¯H¼ëSµÒîÜÔ'tQðì,Ç!½ÞÚÏŠ+8^%-k VX×Ðá¨FÔHý½!̀ꂭ{-Í{K°³JµkJ^ZÀçËÖš]G»àö/È}îÏûÇûy‚¹}O üN*ù8þE}úw±^첑 î{¯¼ÚYû‚Û{ÿûàwÁÀÇÑÛ½: €â¤‡Í§ae>˜kóOkúL®-ȃþà€¤`ME7‰Q¶~èqÐM.2Êç)‘FjW×W¢‚"ÿ$1P;„Ç|’Ásë•2ç' a;tÐ#€ÔQ5Ø Ýw€à·M¿]¤u‡1°1+Öè&j@\’ £2Z²³;0H˜„Hè(>¢„J„Lp4N8v 0‚r„809à°)-p€ Qcàx0~*aLôUG8…NÈ%;@p8Ð?óWÙQþ8ÂÅa/¼ˆ—Eêg  "à¼ci~EHlsC.8¶ˆ‡ 8en’aMe O€ h5iã×£M“è}Û¤‰ÐZ+¡·ôÂY'oÿ¼$hï;EˆŠQ'ýG)芹‹·¬×z'‹§§½ð[H©Ò+Ä(ªÈƒ¡)è‚Ì8}ÏH)¸ø}Ó˜Õø°ffat[vŠÝÈ nà-0_Øs†*áçHcỨ;• 0?OäwõXŒ6 3“6`€ÿøŒ÷•Ž1XƒÐ€5ô‘ÅØE?p„a‰{‡§‘*ƒïb( à‘òG’%¹ Ǩ`1/ü§‘+i€ØÑ f0„ÄUŠPO8I2Ð}/ -' ŽÿèŒçÈ‘ø“«ðkÕ! `/P|Ù”-ÿß÷“2 3RÂãÈzy_/“xa` ™—80† A–ˆh–P€†1• À–´Ðz+A 2‹8˜SÀO™5DŽ[ÙZ´x_?0Ž”™†q ™žù™ š¢9W‹ ƒ€@)µ8¯§•08w£ù𰛝 sY™¶èYrP›DYy²ù›ÀœÙ‹u‹ É!ŽþÛߗ€Âùœ;Ä…”d$£d ¬y€,!}T˜r†Oɾ96Ø ¿YP pžpðS @b³žÈ£žðç¹CÀ`ŸÉSšþ¸nsaã"PÊþƒõÿP9€ôœ:6ïùž@Ô™ðpÀ€ubž ؉š*6!:¢ùy¢•Ãç©£9šp¢1Š€ôÌÙ‘ºÆ €HS©Ðh‹?€°Ö))º¢;º£+*6:ú¥c3£Zz¥íY901Ú!:bZÀ¦^Ê€Ðð0P¢ §r*6¡€oª£à¡cƒ§t*6Àr Ÿ}Êði§ŽªŸ€ú¦ ŒyO €©€z46T †s°2`ð5!PÔy~Z§ú¨”J«ý™ Pì©ÿ’Š}úðI‘*Z'“z¨P§õ ZH¬æ™«ì £xª§P¢ì)š£ÂúžÐš¨ºêŸ°zÔj§p§jªŸ>ú¡¢0”¸M ú©pº¢O¤–¤ª› €·°`ޏ6p¢yê£Ò¢!ª£ÐŠ«ï:% £P' «®>z­²ú©6Š<0Á„p§ðÙž%Š¥ ˨uj¢eÚ­ÿ™§ ¨# ­?Z¢vúºªž §ê:)«ŸÏª§™J¤“(?§;ʲå?ù@ p8a‘6°^#bó¦;ë¥p¦õ)¤6»µþ¹§1Êÿ³Э)z²è£g»Ÿ…¤³1ðž10¡z§€§%z P"úžÍ :ø)©0·y‹¦®¹  @¢ p¦†;¸òJ” à¸oº¢‘ˬvê¸%0”*Q ª $”°ú)¢wº²uÂ`û©xZs˳yš§Ö¢ùùš `©9š¯Ÿy#ª¼ðÉ1j·K.:²hÚ± 4ïi£˦Î˦ØûŸÌŠŸcÃTEú} oš¹ÿY¨vú¦P~Þ÷l 0  !$ PP§ÎÍ £È«¼g[±š®j ª;Û½õ ªÿèÁøô“èœ;D¾¸§à¨Ò†¿ø›£‹q®)Á$\ÂàT¹9ƒ ¿¸—ÐA¦àÁþBòPåi¢Ip;6‚ :;ì¬,º]D “·µC4—?)ºÈ -4Ãþ P”¢Â8ÌOºª¡ÂûŸ“­Ø)¨ÚúŖ#¡•ÒÉÊš<ÛÙœ `ÿ‰OZ¹Mƒ¦àÄNܬêrULF5ºÅᚥa:£l;6#›£Wz¦bJ­ƒ ¼×š²æÉÂ[)uʰ`tÄÍ™þ€ «kÇ3Ì3¤Ç{Ü@Á€šÅw ³4ê¨öê©ê«¦iŽšÆÊ+±,Æ×Ú¬³ª¬ÿ°¯¦¹iÊú±¶Œ>šj¾˜ Å2PýàÄŽÊôV¡üGÏjËß{³¨ ¨ez¯­\È늫€ú­ÏЍa cs§{ °´ó + ËxjÄC¿˜œb¶’Ì °Ìø,ª7üÌÈ#²$»¾eìÈH;Є¬Ë8««àz¶*¡ÂÚ¬°ÅhšŸ7 ¥DYJ™['â»CÚÉ›Oy} €ø<ÒàûÌÏ÷9¡G[Îhl©1º­¹ÅKŸ§<¢‰{¨À¡ÁCÆ[9ð¹åëç{ÊÌ5$uá÷“°­G÷<ÒôËŠÒq›Åæù¼Œš¾“Ú©¸\½ðI¨¼Cÿ8[9hê¼ðY6å»MzºµüäEŠ1‘ÕŽJ¿ôÛ—fÕ„ŒÔÏÉ`,dÚQU¾*Ê–£ÚBškšÝœ! ° íØ›ÁÌ£¡©žÛ*Aý©Ú\KÜj¡È£Ô}Òú¸›²Ïà§s¥n±S}‘­¡"‹>y랎:¡JâÌÇ;±[Ú£G{¥;ì¡JºŸ¾Ý^ûÞ Ö‘|[Wª¥æé¼ƒ;Æ3ªÒÝœl3H 0 )¶ ßé=¦¾}¨ÿeªà^šÈ’Š£gz¶ëм¢ Á|*§Ü©¸\©jŠÜª :ÂJ«¿ÊÒ±l§zZ·µÚ¢Z¤qð9‡úÅÁ;⊧H-ŸYÜŸ¹•ctCþ2à%š«Þü¬ŽJŸ¼j©gk©HÞ§ÿ9âjÊÌŽ Ÿ3>¸;ÛßèÍÑ:¡¸š Û° ÛÈàÍ ó»ú¡h¼®+«ÅKÎdþD~{ràÆ…L¼7«±Ïê°Z>6¾jÍPç·'¡#†ž¶ ð£:¡Éš¶ÜŒbjÀš·) ±aj¢¦=ÊXÝ@k¡l룮Ã>+6ë»Èƒ¨{ë³mž¥`å´š¥`1Û–ÿ“\§™ÑֺÓY|²Ñe€`9Åëß;È£.¤Ø zþÚeª¾ƒ¬¹?ì·Øðó®tÛ» ¬1JÎ%*¹ÍÊÈÁS­×¾¦÷ ¹µ{ݼ²?*¢ðâD©Á¯š§¼ÁîÂØe»¼u+•ý¢Ä~·€¹ýÏ4» P§ ÓðmÚ¡OFYι ,±ËŠÐŒúç^z¶œ‹ÖÌ›¶húª6Ñ€="@cOY› 3Ц…<²ìÕ:m9>ë³Ùûžp½Ôp¥«1=ËÙŒñ5¤«"º¾9ô>[ñèÙ©,ÎÛhê\1žâ·Ý¸%¸·{k(›É*©¤­¡Z›ÿ³ì+‡3&œfÿoãš:ÿõÀ¹Ÿƒ´r$ð@*ߟÉTM5sO n·àzž§ ŸúÀ;F€k¯zkžÆ H“'÷„tʼnjåýÝ©G?ø5tCr?÷…Ý÷„¸¸Š£+ʦÀë¼e­¦s{¸Íj÷ðÝÍÖÉú¬¢˜Ÿù!pðÖËÈznºš·d[úÇ”ùrçÚœ¿¢.§‹ª¡i¨´l¢šžË¨þ§Íß§dŠû#^¢ €¯r!Ð2jì.åÂ/¤$oÆ5ÄV²ÏÜœÏåq:®,:§bÌåø¼®€«^Ž«“LŸÁMí›n°ä$á0$¡tÈÌ#9ypdeÁL^ÿ—ä–Ûñ„†aRÈÓ5ŸÑiõ:Ív8 Nœ“¬XÝ8#“at&ªŽ"¤&*öê“è&&@ÀÄH~6 Þ"µ"¥""¶Ý:Ù*-C@ØX[]_1(0.b.hm£B/díjo— "b&.–'  œ¡!´V(SÊbµ.B“˜Ä;@2bõ\QS_Ýßá·¾m#´*"&¹æç;2&",â0ž½ ÿ´è _=@Ø Ñ…Â";ù$ùhÊ]ˆˆD>Ä9’dIw~Xº´jŸ>“]²©ôø’fM›ðRZúÁòfš˜*„ì9”èK—rŠÙVôÌOm!„2%ÿZª$‡2l‘”q(”FH?^*óÊËW ’ªDT.ÿ:Ü1»«T.wêUÀ*–ƒ‘Iy¤oœÁHæÔ™›¤”iìRܨpa3äLØr´jS…øuË=)~26Wš]8ø²:†ä›E®€í׬\`(ƒ€›©€¬Žè°ªâ8ùCÙ df jøÐæpÉ€2h"£;|û«;÷ð ¬üsÈ‹©8|; „Pç¶\(‹üT°…¥O2Eç2ëÂÀRK•rò‘c‰ ø. ‘« páà>ü‘$>óN­4qEF)ç (hÄ »ÜÈ‚ÿ42&¶Œ&  $"€À+ÊdDý2 B9~莈Uðé@AüxºÌ†™Â*GâpÒ‹°<c7²‚$G@,Úq×î°¥™.!/ ht://Dig: htdump

    htdump

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htdump [options]

    Description

    Htdump writes out an ASCII-text version of the document and word databases in the same form as the -t option of htdig.

    Options

    -a
    Use alternate work files. Tells htdump to append .work to database files, allowing it to operate on a second set of databases.
    -c configfile
    Use the specified configfile file instead of the default.
    -d
    Do not dump the document database.
    -v
    Verbose mode. This doesn't have much effect.
    -w
    Do not dump the word database.

    File Formats

    Document Database

    Each line in the file starts with the document id followed by a list of fieldname:value separated by tabs. The fields always appear in the order listed below:

    fieldname value
    uURL
    tTitle
    aState (0 = normal, 1 = not found, 2 = not indexed, 3 = obsolete)
    mLast modification time as reported by the server
    sSize in bytes
    HExcerpt
    hMeta description
    lTime of last retrieval
    LCount of the links in the document (outgoing links)
    bCount of the links to the document (incoming links or backlinks)
    cHopCount of this document
    gSignature of the document used for duplicate-detection
    eE-mail address to use for a notification message from htnotify
    nDate to send out a notification e-mail message
    SSubject for a notification e-mail message
    dThe text of links pointing to this document. (e.g. <a href="docURL">description</a>)
    AAnchors in the document (i.e. <A NAME=...)

    Word Database

    The first line of the ASCII word database is a comment, prefixed with '#' and specifies the columns of the file separated by tabs. The fields are:

    word
    document id
    flags
    location
    anchor

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.
    DATABASE_DIR/db.docs
    The default ASCII document database file.
    DATABASE_DIR/db.worddump
    The default ASCII word database file.

    See Also

    htdig, htload and Configuration file format

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/htfuzzy.html0100644006314600127310000001256110062603601016074 0ustar angusgbhtdig ht://Dig: htfuzzy

    htfuzzy

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htfuzzy [-c configfile][-v] algorithm ...

    Description

    Htfuzzy creates indexes for different "fuzzy" search algorithms. These indexes can then be used by the htsearch program.

    Options

    -c configfile
    Use the specified configuration file instead of the default.
    -v
    Verbose mode. Used once will provide progress feedback, used more than once will overflow even the biggest buffers. :-)

    Algorithms

    Indexes for the following search algorithms can currently be created:
    soundex
    Creates a slightly modified soundex key database. A soundex key encodes letters as digits, with similar sounding letters (c, k, q) given the same digit. Vowels are not coded. Differences with the standard soundex algorithm are:
    • Keys are 6 digits.
    • The first letter is also encoded.
    metaphone
    Creates a metaphone key database. This algorithm is more specific to English, but will get fewer "weird" matches than the soundex algorithm.
    accents
    Creates an accents key database. This algorithm will map all accented letters to their unaccented counterparts, so that a search for the unaccented word will yield all variations of this word with accents.
    endings
    Creates two databases which can be used to match common word endings. The creation of these databases requires a list of affix rules and a dictionary which uses those affix rules. The format of the affix rules and dictionary files are the ones used by the ispell program. Included with the distribution are the affix rules for English and a fairly small English dictionary. Other languages can be supported by getting the appropriate affix rules and dictionaries. These are available for many languages; check the ispell distribution for more details.
    synonyms
    Creates a database of synonyms for words. It reads a text database of synonyms and creates a database that htsearch can then use. Each line of the text database consists of words where the first word will have the other words on that line as synonyms.

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.
    DATABASE_DIR/db.accents.db
    (Output) Maps between characters with and without accents for accents fuzzy rule
    DATABASE_DIR/db.metaphone.db
    (Output) Database of similar-sounding words for metaphone fuzzy rule
    DATABASE_DIR/db.soundex.db
    (Output) Database of similar-sounding words for soundex fuzzy rule
    COMMON_DIR/english.0, COMMON_DIR/english.aff
    (Input) List of words and affix rules used to generate endings
    COMMON_DIR/root2word.db, COMMON_DIR/word2rood.db
    (Output) Database used for endings fuzzy rule
    COMMON_DIR/synonyms
    (Input) List of groups of words considered synonymous
    COMMON_DIR/synonyms.db
    (Output) Database used for synonyms fuzzy rule

    See Also

    htdig, htmerge, htsearch, Configuration file format, and ispell.

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/htload.html0100644006314600127310000001041710055635546015641 0ustar angusgbhtdig ht://Dig: htload

    htload

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htload [options]

    Description

    Htload reads in an ASCII-text version of the document and word databases in the same form as the -t option of htdig and htdump. Note that this will overwrite data in your databases, so this should be used with great care.

    Options

    -a
    Use alternate work files. Tells htload to append .work to database files, allowing it to operate on a second set of databases.
    -c configfile
    Use the specified configfile file instead of the default.
    -d
    Do not load the document database.
    -v
    Verbose mode. This doesn't have much effect.
    -w
    Do not load the word database.

    File Formats

    Document Database

    Each line in the file starts with the document id followed by a list of fieldname:value separated by tabs. The fields always appear in the order listed below:

    fieldname value
    uURL
    tTitle
    aState (0 = normal, 1 = not found, 2 = not indexed, 3 = obsolete)
    mLast modification time as reported by the server
    sSize in bytes
    HExcerpt
    hMeta description
    lTime of last retrieval
    LCount of the links in the document (outgoing links)
    bCount of the links to the document (incoming links or backlinks)
    cHopCount of this document
    gSignature of the document used for duplicate-detection
    eE-mail address to use for a notification message from htnotify
    nDate to send out a notification e-mail message
    SSubject for a notification e-mail message
    dThe text of links pointing to this document. (e.g. <a href="docURL">description</a>)
    AAnchors in the document (i.e. <A NAME=...)

    Word Database

    The first line of the ASCII word database is a comment, prefixed with '#' and specifies the columns of the file separated by tabs. The fields are:

    word
    document id
    flags
    location
    anchor

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.
    DATABASE_DIR/db.docs
    The default ASCII document database file.
    DATABASE_DIR/db.worddump
    The default ASCII word database file.

    See Also

    htdig, htdump and Configuration file format

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/htmerge.html0100644006314600127310000000727310062603601016010 0ustar angusgbhtdig ht://Dig: htmerge

    htmerge

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htmerge [options]

    Description

    Htmerge is used to create a document index and word database from the files that were created by htdig. These databases are then used by htsearch to perform the actual searched.

    Options

    -a
    Use alternate work files. Tells htdig to append .work to database files, causing a second copy of the database to be built. This allows the original files to be used by htsearch during the indexing run.
    -c configfile
    Use the specified configuration file instead of the default.
    -d
    Prevent the document index from being created.
    -m merge_configfile
    Merge the databases specified by merge_configfile into the databases specified by -c or the default. You will need a separate config file for each of the two databases. Then each file will set the database_dir or database_base attribute to change the name of the databases, so they are in different directories or files.
    Note: You must run htmerge separately on each of the databases created by htdig before merging them together with this option. This is because merging the two wordlists together requires wordlists that have already been cleaned up by htmerge. Because the -m option allows you to specify only one database to be merged into the other, and only one -m option may be specified, if you need to merge three or more databases together you must run htmerge multiple times with the -m option.
    -s
    Print statistics about the document and word databases after htmerge has finished.
    -v
    Run in verbose mode. This will provide some hints as to the progress of the merge. This can be useful when running htmerge interactively since some parts (especially the word database creation) can take a very long time.
    -w
    Prevent the word database from being created.
    In addition to the command line options, the environment variable TMPDIR will be used to designate the directory where intermediate files are stored during the sorting process.

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.

    See Also

    htdig, htsearch and Configuration file format.

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/htnotify.html0100644006314600127310000000440610062603601016214 0ustar angusgbhtdig ht://Dig: htnotify

    htnotify

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htnotify [-b database][-c configfile][-v]

    Description

    Htnotify scans the document database created by htmerge and sends an email message for every page that is out of date. Look in the notification manual for instructions to set up this service.

    Options

    -b database
    Specifies an alternative database than what is specified in the configuration file.
    -c configfile
    Use the specified configuration file instead of the default.
    -v
    Verbose mode. This increases the verbosity of the program. Used once will display a log of what email messages were sent. Used more than once will display information about each document that has email notification set.

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.
    DATABASE_DIR/db.docdb
    Stores data about each document (title, url, etc.).

    See Also

    htdig, htmerge, Email notification service and Configuration file format.

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/htpurge.html0100644006314600127310000000460610062603601016030 0ustar angusgbhtdig ht://Dig: htpurge

    htpurge

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htpurge [options]

    Description

    Htpurge functions to remove specified URLs from the databases as well as bad URLs, unretrieved URLs, obsolete documents, etc. It is recommended that htpurge be run after htdig to clean out any documents of this sort.

    Options

    -
    URL input. Read in a list of URLs to remove from the standard input, one per line.
    -a
    Use alternate work files. Tells htpurge to append .work to the database files allowing it to operate on a second set of databases.
    -c configfile
    Use the specified configfile file instead of the default.
    -u
    URL input. Add this URL to the list of URLs to remove. This can be specified multiple times.
    -v
    Verbose mode. This increases the verbosity of the program. Using more than 2 is probably only useful for debugging purposes. The default verbose mode gives a progress on what it is doing and where it is.

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.

    See Also

    htdig, htmerge, and Configuration file format

    The ht://Dig Group <htdig@htdig.org> Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/hts_form.html0100644006314600127310000002041310055635546016204 0ustar angusgbhtdig ht://Dig: htsearch

    htsearch

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    HTML Form

    The primary interface to htsearch is through an HTML form. When the form is submitted, the htsearch program will take values from the form and perform the actual search. The search can be modified in many ways with either hidden input fields or other HTML form tags. Study the examples to get a feel of what things are possible.

    The HTML form is expected to contain at least an input text field named words. This is where the user will enter the search words. Other values are also recognized but have appropriate defaults in case they are not used:

    config
    Specifies the name of the configuration file. The name here is the name without the path and without the .conf at the end. This file is assumed to be located in the CONFIG_DIR directory. Periods are not allowed in this field for security reasons (to prevent HTML authors from pointing all around at your files).
    The default is htdig
    exclude
    This value is a pattern that specifies which URLs are to be excluded from the search results. If a URL matches one of these patterns it is discarded. Multiple patterns can be given, separated by a bar ("|"), or multiple definitions of the exclude input parameter can be given. This pattern may include regular expressions when enclosed within [ and ] characters.
    The default is specified by the exclude attribute in the configuration file.
    format
    This specifies the name of the template to display the search results in. There are two builtin templates named builtin-long and builtin-short which can be used, but any number of custom templates can also be defined. Find out more about the templates in the Output Templates section.
    The format value can be specified as either a hidden input field or a drop down menu.
    The default is specified by the template_name attribute in the configuration file, and the template variable is SELECTED_FORMAT.
    keywords
    Used to specify a list of required words that have to be in the documents. This list of words is added to the normal words value using logical "and"s, or logical "or"s if the any_keywords attribute is set to true in the configuration file.
    An example use for this value is to make it a drop down menu with a limited set of predetermined categories or keywords to restrict the search. This can be very useful for very structured pages.
    Note that the words may appear anywhere in the document. The scope of these required words is not limited to words in META tags with the "keywords" or "htdig-keywords" property, despite what the parameter name may suggest.
    The default is specified by the keywords attribute in the configuration file.
    matchesperpage
    Specifies how many matches will be displayed on each page of results.
    The default is specified by the matches_per_page attribute in the configuration file, and the template variable is MATCHES_PER_PAGE. Since this value has to be a number, it either needs to be set using a hidden input field or a with a drop down menu.
    method
    This can be one of and, or, or boolean. It determines what type of search will be performed.
    The default is specified by the match_method attribute in the configuration file and the template variable is SELECTED_METHOD. It is quite useful to make this item a drop down menu so the user can select the type of search at search time.
    page
    This should normally not be used. It is generated by the paged results display.
    restrict
    This value is a pattern that all URLs of the search results will have to match. This can be used to restrict the search to a particular subtree or subsection of a bigger database. Multiple patterns can be given, separated by a bar ("|"), or multiple definitions of the restrict input parameter can be given. Any URL in the search results will have to match at least one of these patterns. The pattern may include regular expressions when the expression is enclosed by [ and ] characters.
    Note that the restrict list does not take precedence over the exclude list - if a URL matches patterns in both lists it is still excluded from the search results.
    The default is specified by the restrict attribute in the configuration file.
    sort
    This can be one of score, time, date, title, revscore, revtime, revdate, or revtitle. It determines what type of sort will be performed on the search results. The types time and date are synonymous, as are revtime and revdate, as all four sort on the time that the documents were last modified, if this information is given by the server. The sort methods that begin with rev simply reverse the order of the sort.
    The default is specified by the sort attribute in the configuration file, and the template variable is SELECTED_SORT. It is quite useful to make this item a drop down menu so the user can select the type of sort at search time.
    startyear, startmonth, startday, endyear, endmonth, endday
    These values specify the allowed range of document modification dates allowed in the search results. They can be used to restrict the search to particular "ages" of documents, new or old.
    If the year is specified by two digits (e.g. 02), then it is assumed to be in the 1900s if it is in the range 70-99, and in the 2000s if it is in the range 00-69. If the year is not specified, the search does not exclude documents outside the range of dates within the year. Thus it is impossible, for example, to restrict a search to documents dated "December".
    Incompletely specified end dates are interpreted as follows:
    Date Becomes
    04-31 04-31- end of time
    05-199905-31-1999
    1999 12-31-1999

    The default is the full range of documents in the database. These values can also be specified by configuration attributes of the same names in the configuration file. If a negative number is given for any of these, it is taken as relative to the current year, month or day.

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/hts_general.html0100644006314600127310000000325510062603601016644 0ustar angusgbhtdig ht://Dig: htsearch

    htsearch

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Htsearch is the actual search engine of the ht://Dig search system. It is a CGI program that is expected to be invoked by an HTML form. It will accept both the GET and POST methods of passing data to the CGI program.

    Files used by htsearch

    CONFIG_DIR/htdig.conf
    The default configuration file.
    COMMON_DIR/header.html
    The default search results header file
    COMMON_DIR/footer.html
    The default search results footer file
    COMMON_DIR/wrapper.html
    The default search results wrapper file, that contains the header and footer together in one file
    COMMON_DIR/nomatch.html
    The default 'no matches found' HTML file
    COMMON_DIR/syntax.html
    The default file that explains boolean expression syntax errors

    Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/hts_menu.html0100644006314600127310000000234007426615574016213 0ustar angusgbhtdig ht://Dig: htsearch


    htsearch

    Navigate
    ^ ht://Dig

    htsearch
    * General
    * HTML form
    * Templates
    * Search method

    Quick Search:
    htdig-3.2.0b6/htdoc/hts_method.html0100644006314600127310000000755510055635546016535 0ustar angusgbhtdig ht://Dig: htsearch

    htsearch

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Search Method Used

    The way htsearch performs it search and applies its ranking rules are fairly complicated. This is an attempt at explaining in global terms what goes on when htsearch searches.

    htsearch gets a list of (case insensitive) words from the HTML form that invoked it. If htsearch was invoked with boolean expression parsing enabled, it will do a quick syntax check on the input words. If there are syntax errors, it will display the syntax error file that is specified with the syntax_error_file attribute.

    If the boolean parser was not enabled, the list of words is converted into a boolean expression by putting either "and"s or "or"s between the words. (This depends on the search type.) Phrases within double quotes (") specify that the words must occur sequentially within the document.

    If a word is immediately preceeded by a field specifer (title:, heading:, author:, keyword:, descr:, link:, url:) then it will only match documents in which the word occurred within field. For example, descr:foo only matches documents containing <meta value="description" value="... foo ...">. The link: field refers to the text in the hyperlinks to a document, rather than text within the document itself. Similarly url: (will eventually) refer to the actual URL of the document, not any of its contents. The prefixes exact: and hidden: are also accepted. The former (will) cause the fuzzy search algorithm not to be applied to this word, while the latter causes the word not to be displayed in the query string of the results page.

    Each of the words in the list (but not within a phrase) is now expanded using the search algorithms that were specified in the search_algorithm attribute. For example, the endings algorithm will convert a word like "person" into "person or persons". In this fashion, all the specified algorithms are used on each of the words and the result is a new boolean expression.

    The next step is to perform database lookups on the words in the expression. The result of these lookups are then passed to the boolean expression parser.

    The boolean expression parser is a simple recursive descent parser with an operand stack. It knows how to deal with "not", "and", "or" and parenthesis. The result of the parser will be one set of matches.
    Note that the operator "not" is used as the word 'without' and is binary: You can not write "cat and not dog" or just "not dog" but you can write "cat not dog".

    At this point, the matches are ranked. The rank of a match is determined by the weight of the words that caused the match and the weight of the algorithm that generated the word. Word weights are generally determined by the importance of the word in a document. For example, words in the title of a document have a much higher weight than words at the bottom of the document.

    Finally, when the document ranks have been determined and the documents sorted, the resulting matches are displayed. If paged output is required, only a subset of all the matches will be displayed.


    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/hts_selectors.html0100644006314600127310000003351210055635546017250 0ustar angusgbhtdig ht://Dig: htsearch

    htsearch

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Input parameter select lists

    The primary interface to htsearch is through an HTML form. The input fields in this form can be defined as any type that HTML allows, but some of these are best handled through HTML select lists.

    Pre-defined template select lists

    In order to propagate these select lists to the search form in the results template, so that the default selected value will be the one the user last selected, htsearch defines a few of these select lists as template variables. These variables are:

    • FORMAT, which selects the format input parameter for follow-up searches, with the current value being the default. The current value is taken from the format input parameter, if one was provided, or from the template_name attribute otherwise, and this value will also be given in the SELECTED_FORMAT template variable. The various parameter values, and their corresponding labels for the select list, are taken from the template_map attribute.
    • METHOD, which selects the method input parameter for follow-up searches, with the current value being the default. The current value is taken from the method input parameter, if one was provided, or from the match_method attribute otherwise, and this value will also be given in the SELECTED_METHOD template variable. The various parameter values, and their corresponding labels for the select list, are taken from the method_names attribute.
    • SORT, which selects the sort input parameter for follow-up searches, with the current value being the default. The current value is taken from the sort input parameter, if one was provided, or from the sort attribute otherwise, and this value will also be given in the SELECTED_SORT template variable. The various parameter values, and their corresponding labels for the select list, are taken from the sort_names attribute.

    In addition to these template variables, htsearch makes use of a number of other input parameters, all of which have corresponding template variables and configuration attributes. It's also possible, within htsearch, to make an input parameter out of any configuration attribute that's not already automatically handled by an input parameter. This is accomplished by means of the allow_in_form attribute. The attributes listed in the allow_in_form list will be settable in the search form using input parameters of the same name, and will be propagated to the follow-up search form in the results template using template variables of the same name in upper-case.

    Custom template select lists

    This gives you a great deal of flexibility in configuring htsearch, but all of these template variables still contain only the parameter value, and not a select list to choose the value. In order to use any input parameters as select lists, other than the three pre-defined variables above, one must either statically define a select list in the results template follow-up form, just as in the initial search form or instruct htsearch to build one as a template variable. Statically defining new select lists is easier, as you have to do it for the initial search form anyway, but this has the drawback that the user's selection from the initial form does not appear as the default selection in the follow-up form, because the default is static.

    To overcome this drawback, you must use the build_select_lists configuration attribute. Its usage is a bit complicated, but it's extremely flexible, allowing you do define any htsearch input parameter as a select list for use in templates, provided you also define the corresponding name list attribute which enumerates all the choices to put in the list. It can be used for existing input parameters, as well as any you define using the allow_in_form attribute.

    The entries in this list each consist of an octuple, a set of eight strings defining the variables and how they are to be used to build a select list. The attribute can contain many of these octuples. The strings in the string list are merely taken eight at a time. For each octuple of strings specified in build_select_lists, the elements have the following meaning:

    1. the name of the template variable to be defined as a list, optionally followed by a comma and the type of list, and optional formatting codes
    2. the input parameter name that the select list will set
    3. the name of the user-defined attribute containing the name list, that is the list of values and labels for the select list items, much like the template_map, method_name and sort_name attributes
    4. the tuple size used in the name list above
    5. the index into a name list tuple for the value
    6. the index for the corresponding label to be displayed on the selector
    7. the configuration attribute where the default value for this input parameter is defined, which may or may not be the same name as the input parameter
    8. the default label, if not an empty string, which will be used as the label for an additional list item for the current input parameter value if it doesn't match any value in the given list

    The first element in an entry is actually a comma separated list. The first item within this list is the name of the template variable to be created. The next item, if specified, is the type of select list or input list to be created in this template variable. Choices are select, multiple, radio, and checkbox, with the default being select. The word multiple refers to a <select multiple> type of select list, where more than one option can be selected. The choices radio and checkbox will build lists of <input> tags of these types, rather than a select list with <option> tags. The optional third and fourth items in this comma separated list are text or formatting tags that will be prepended and appended, respectively, to each item in the built list, before the <option> or <input> tag and after the label for that tag. This first element is parsed as a quoted string list within a quoted string list, so you can embed quotes and commas within elements of this inner list if you use correct quoting. See examples below.

    The name list that you define will most commonly consist of pairs of values, and therefore you'd use a tuple size of 2. The method_names and sort_names attributes are samples of such name lists. You can give any name you'd like to the name list attributes you define yourself, but you should try to avoid using any of the names of existing attributes. The value and label for the pairs in lists you define yourself can appear in either order, depending on the index you specify for each. In the case where you'd want the labels on the selector to be the same as the actual parameter values used, which would make sense for lists of numbers, you can use a tuple size of 1, and indexes of 1, to avoid having to duplicate all the numbers in the list.

    Any of the strings in an octuple may be quoted, and should be if you want to include spaces or define an empty string. If the default label, the eight element in an entry, is an empty string, the select list will not have a selected item if the current input parameter value doesn't match any value in the name list. If a default label is given, an additional list item will be added to the list using this label, if the current input parameter value doesn't match.

    If the seventh element, the configuration attribute name, is an empty string, the default value will be taken from from the input parameter, the second element, instead. This is especially useful for input parameters that don't get mapped to a configuration attribute, or for checkboxes or multiple selects, where the separation between individual choices may get lost when the input parameter is mapped to an attribute.

    Here is an example of its usage, which illustrates different tuple sizes and orders:

    build_select_lists:     MATCH_LIST,radio matchesperpage matches_per_page_list \
                                    1 1 1 matches_per_page "Previous Amount" \
                    RESTRICT_LIST,multiple restrict restrict_names 2 1 2 restrict "" \
                    FORMAT_LIST format template_map 3 2 1 template_name ""
    
    matches_per_page_list:  1 5 10 20 100 500
    
    restrict_names: "http://www.myschool.edu/Admin/" "Admin Web Pages" \
                    "http://www.myschool.edu/Faculty/" "Faculty Web Pages" \
                    "http://www.myschool.edu/Student/" "Student Web Pages" \
                    "" "Whole Web Site"
    	

    The FORMAT_LIST example should give something equivalent to the FORMAT template variable, which is already set by htsearch. It is included as an additional example of how to specify the tuple size and indices of values and labels in a tuple.

    Here is an example which illustrates additional formatting tags, and the quoting that may be required:

    build_select_lists:     "RESTRICT_LIST,checkbox,'<font face=\\"Arial,Helvetica\\" size=\\"+2\\">',</font><br>" \
                                    restrict restrict_names 2 1 2 restrict ""
    	

    In this example, the font tag will be inserted before each checkbox input tag, and the closing font tag and line break will be appended after each label that follows the input tag. Because the font tag has an embeded comma, which is also the separator for the list in the first element, the whole tag (i.e. the whole third item in the comma separated list) is quoted, and it's quoted with single quotes so as not to conflict with the double quotes enclosing the whole element. Finally, to embed a double quote in the font tag, it must be escaped with two backslashes - the first of these is absorbed by the variable expansion phase that all attribute values go through, and the second is used to embed the double quote within a double quoted string.

    Combining the format select list with template_patterns

    The addition of the template_patterns attribute has added a new wrinkle to the pre-defined select list for the format parameter. If a document URL matches an entry in template_patterns, its corresponding result template will override any template the user selected with the format parameter. The problem stems from the fact that the two were not originally intended to be used together in the same htsearch configuration. When configuring htsearch, you'd normally set it up to use one mechanism or the other, but not a combination of the two.

    However, the following example would allow user-selected templates to work together with template_patterns:

    template_map:      Long long ${common_dir}/long.html \
                       Short short ${common_dir}/short.html
    template_name:     long
    template_patterns: .pdf ${common_dir}/${template_name}-pdffile.html \
                       .ps  ${common_dir}/${template_name}-psfile.html \
                       .doc ${common_dir}/${template_name}-docfile.html
    	

    This works because the template_name attribute gets set internally in htsearch, to the user-selected value of the format input parameter, before the variable expansion in template_patterns takes place. As long as you stick to a template file naming convention that uses the internal name element of template_map (second element in a triple) as part of the file name, this should work like a charm. Your common directory would have to contain the template files long-pdffile.html, long-psfile.html, long-docfile.html, short-pdffile.html, short-psfile.html, and short-docfile.html, for the example above to work, in addition to the long.html and short.html files, which will be used for URLs that don't match any of the patterns. Of course, these patterns can be any URL parts, and not just suffixes. Be sure to also change the values for format in your initial search form, search.html, to use your chosen internal names.


    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/hts_templates.html0100644006314600127310000003411710055635546017245 0ustar angusgbhtdig ht://Dig: htsearch

    htsearch

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Output Templates

    The htsearch program will normally produce HTML output. In this process it makes extensive use of template in which variables will be substituted. The templates are specified in the configuration file. The configuration file attributes defining these templates are:

    In addition to these files, the search results are also produced with the use of templates. The result templates are a bit more complicated because they can be specified at runtime using an HTML menu. They are specified using the template_map configuration file attribute. This attribute contains a list of strings triplets. For each triplet of strings, the elements have the following meaning:

    1. the name that will appear in the FORMAT menu (see below)
    2. the internal name used by htsearch for this result template
    3. the base filename for the template.

    There are two predefined templates that are used by default. They have the internal names builtin-long and builtin-short. As such, the default value for the template_map attribute is as follows:

    Long builtin-long builtin-long \
    Short builtin-short builtin-short

    Which means that there will be two ways to display the search results: a "Long" and a "Short" way. The first template listed will always be the default one for the first search. Thereafter, the default will be whatever was selected for the previous search.

    Result template files

    When a custom template is required, one or more template files need to be created and referenced in the template_map attribute. These templates are user-selectable from the search form. It is also possible to select result templates based on URL patterns of the search matches, using the template_patterns attribute. This allows distinct visual styles to be used for matches on different web sites.

    There are many variables that can be substituted into these templates. Not all of them make sense for each file, so not all of them will be substituted for every file, as noted below. In addition, all of the standard CGI environment variables are available, and listed in the cgi specification. Variables will be substituted normally with the format $(VAR), escaped for use in a URL with the format $%(VAR), URL-encoding decoded with the format $=(VAR), and HTML-escaped with the format $&(VAR). The variables are:

    ANCHOR (Only in matchTemplate)
    Expands to the named anchor found just before the first match; it includes "#" at the start so it can be directly appended to the URL variable. If no anchor was found, ANCHOR is empty.
    BACKLINKS (Only in matchTemplate)
    The number of links to the current match.
    CGI
    Unless the configuration file sets a different value, this expands to whatever the SCRIPT_NAME environment variable is. See the script_name configuration file attribute for more information.
    CONFIG
    The configuration file.
    CURRENT (Only in matchTemplate)
    The number of the current match.
    DESCRIPTION (Only in matchTemplate)
    The first URL description for the matched document. See below.
    DESCRIPTIONS (Only in matchTemplate)
    A list of URL text descriptions for the matched document. The entries in the list are separated by <br>. These are the text used between the <a href...> and </a>tags. These are controlled by the max_descriptions and max_description_length configuration attributes.
    DOCID (Only in matchTemplate)
    The internal ID for the document for the current match.
    EXCERPT (Only in matchTemplate)
    The relevant excerpt for the current match.
    EXCLUDE
    A list of words excluded from the search, separated by '|'.
    FIRSTDISPLAYED
    The index of the first match on this page.
    FORMAT
    Expands to an HTML menu of all the available formats. The current format will be the default one. The menu is composed of choices itemized in the template_map attribute. The expansion of this template variable is described in more detail in the select list documentation.
    HOPCOUNT (Only in matchTemplate)
    The distance of this match away from the starting document(s).
    KEYWORDS
    A string of the search keywords with spaces in between, as specified in the keywords input parameter.
    LASTDISPLAYED
    The index of the last match on this page.
    LOGICAL_WORDS
    A string of the search words with "and", "or" or "not" between the words, depending on the type of search. (These values are overridden by the boolean_keywords attribute.)
    MATCH_MESSAGE
    This is either all or any depending on the match method used. (These values are overridden by the method_names attribute.)
    MATCHES
    The total number of matches that were found.
    MATCHES_PER_PAGE
    The configured maximum number of matches on this page.
    MAX_STARS
    The configured maximum number of stars to display in matches.
    METADESCRIPTION (Only in matchTemplate)
    The meta description text (if any) for the matched document.
    METHOD
    Expands to an HTML menu of all the available matching methods. The current method will be the default one. The menu is composed of choices itemized in the method_names attribute. The expansion of this template variable is described in more detail in the select list documentation.
    MODIFIED (Only in matchTemplate)
    The date and time the document was last modified
    NEXTPAGE
    This expands to the value of the next_page_text or no_next_page_text attributes depending on whether there is a next page or not. If there is only one page of output, this is empty, regardless of the setting of no_next_page_text.
    NSTARS
    The number of stars calculated for this document as an integer, up to a maximum specified by the max_stars attribute.
    PAGE
    The current page number. Equal to the page CGI argument, or 1 by default.
    PAGEHEADER
    This expands to either the value of the page_list_header or no_page_list_header attributes depending on how many pages there are.
    PAGELIST
    This expands to a list of hyperlinks using the page_number_text and no_page_number_text attributes. For the current page, it displays no_page_number_text without a hyperlink. Other pages have a hyperlink, and use page_number_text.
    PAGES
    The total number of pages.
    PERCENT (Only in matchTemplate)
    The match score as a percentage. Its range is 1 to 100, without a percent sign. The minimum is always 1 so the variable can be used as the value for an HTML WIDTH attribute.
    PLURAL_MATCHES
    If the MATCHES variable is other than 1, this will be a single 's'. (This value is overridden by the plural_suffix attribute.)
    PREVPAGE
    This expands to the value of the prev_page_text or no_prev_page_text attributes depending on whether there is a previous page or not. If there is only one page of output, this is empty, regardless of the setting of no_prev_page_text.
    RESTRICT
    The list of patterns which must be matched by the returned URLs, separated by '|'.
    SCORE (Only in matchTemplate)
    The score of the current match
    SELECTED_FORMAT
    The currently selected format.
    SELECTED_METHOD
    The currently selected matching method.
    SELECTED_SORT
    The currently selected sorting method.
    SIZE (Only in matchTemplate)
    The size of the document for the current match
    SIZEK (Only in matchTemplate)
    The size in kilobytes of the document for the current match
    SORT
    Expands to an HTML menu of all the available sorting methods. The current method will be the default one. The menu is composed of choices itemized in the sort_names attribute. The expansion of this template variable is described in more detail in the select list documentation.
    STARSLEFT (Only in matchTemplate)
    A set of HTML <img> tags with the stars aligned on the left.
    STARSRIGHT (Only in matchTemplate)
    A set of HTML <img> tags with the stars stars aligned on the right.
    STARTYEAR, STARTMONTH, STARTDAY, ENDYEAR, ENDMONTH, ENDDAY
    The currently specified date range for restricting search results.
    SYNTAXERROR (Only in syntax_error_file)
    Is the text of the boolean expression syntax error.
    TITLE (Only in matchTemplate)
    The title of the document for the current match
    URL (Only in matchTemplate)
    The URL to the document for the current match
    VERSION
    The ht://Dig version number.
    WORDS
    A string of the search words with spaces in between.

    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/htsearch.html0100644006314600127310000000057406662627026016175 0ustar angusgbhtdig ht://Dig -- Internet search engine software htdig-3.2.0b6/htdoc/htstat.html0100644006314600127310000000372110062603601015656 0ustar angusgbhtdig ht://Dig: htstat

    htstat

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    htstat [options]

    Description

    Htstat returns statistics on the document and word databases, much like the -s option to htdig or htmerge.

    Options

    -a
    Use alternate work files. Tells htstat to append .work to the database files allowing it to operate on a second set of databases.
    -c configfile
    Use the specified configfile file instead of the default.
    -u
    Output the list of URLs in the document database.
    -v
    Verbose mode. This increases the verbosity of the program. This has little effect.

    Files

    CONFIG_DIR/htdig.conf
    The default configuration file.

    See Also

    htdig, htmerge, and Configuration file format

    The ht://Dig Group <htdig@htdig.org> Last modified: $Date: 2004/06/12 13:39:13 $ htdig-3.2.0b6/htdoc/index.html0100644006314600127310000000056506662627026015503 0ustar angusgbhtdig ht://Dig -- Internet search engine software htdig-3.2.0b6/htdoc/install.html0100644006314600127310000003166110055635546016040 0ustar angusgbhtdig ht://Dig: Installation

    Installation

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    This document will attempt to show the steps needed to build and install the ht://Dig system.
    The main sections are:


    For the impatient...

    The standard GNU installation process works for ht://Dig.
    ./configure --prefix=/usr/local
    make
    make install
    vi /usr/local/conf/htdig.conf
    /usr/local/bin/rundig
    (The final three commands must be issued as root.)



    Extracting the software

    The distribution of ht://Dig is in the form of a gzipped tar file. The name of the file will be something like htdig-3.2.0.tar.gz. To extract, you can use either the GNU tar command as follows:

    % tar xzf tarfile.tar.gz

    If you do not have GNU tar, you can do the following:

    % gunzip -c tarfile.tar.gz | tar xf -

    In either case, a new directory will be created under which the distribution will be extracted. The directory it creates will be htdig- followed by the version number.


    Configure

    Once the distribution has been extracted, change to the newly created directory.
    In this directory you will need execute the configure program:

    % ./configure

    This program will attempt to determine what your particular system can and can't do.

    If you are going to change any of the sources to ht://Dig, then you can optionally add dependency information to all the Makefiles before running configure with the command

    % automake

    This only needs to be done if you are going to change any of the sources to ht://Dig and requires GCC.

    The configure program has some ht://Dig specific options in addition to the standard ones that you get when running

    	  ./configure --help
    	  

    --prefix=DIR
    This is where all of the ht://Dig parts will be installed. Various other variables will use this value as their base. [default=/opt/www]
    --bindir=DIR
    All the ht://Dig executable programs will go here [default=/opt/www/bin].
    --with-config-dir=DIR
    where your config directory is [default=/opt/www/conf]
    --with-default-config-file=FILE
    Point this to where all the tools will look for the configuration file [default=/opt/www/conf/htdig.conf].
    --with-common-dir=DIR
    This directory is for files which can be shared between different search databases [default=/opt/www/share/htdig].
    --with-database-dir=DIR
    Set this to the directory where the search databases are going to be. (Make sure there is plenty of space on the partition you put this on!) [default=/opt/www/var/htdig].
    --with-cgi-bin-dir=DIR
    The directory where your HTTP server looks for CGI programs. This is where htsearch will get installed [default=/opt/www/cgi-bin].
    --with-image-dir=DIR
    Define this to be a place that can be accessed by your web server. This is where a couple of images will be installed [default=/opt/www/htdocs/htdig].
    --with-image-url-prefix=LOCATION
    This is the URL which points to the directory specified by the --with-image-dir=DIR option above [default=/htdig].
    --with-search-dir=FILE
    where the sample search form should be installed [default=/opt/www/htdocs/htdig].
    --with-search-form=FILE
    The name of the file in which the sample search form will be installed, relative to the directory specified with --with-search-dir=DIR [default=search.html].

    Compile

    The configure program will have created Makefiles in all the important directories.

    If make is not able to deal with the generated Makefiles, you should probably obtain GNU make.

    Now build the complete system with

    % make

    (Sit back and relax for a while...)

    If the compilation failed with the error that it cannot find libht.a, the most likely problem is that your system does not have libstdc++ installed. Please check the system requirements for details on this.


    Test

    Once built, you can run tests if you provided the --enable-tests at configure time. These tests require that you have a working Apache daemon available with version >= 1.3.1. To run the tests execute:

    If your Apache daemon is installed in a non standard place, specify it with the --with-apache=PATH configure option.

    % make check

    Install

    Everything should have built at this point. To install the software, you need to execute

    % make install

    This will perform several tasks. It will first attempt to create the directories that you specified to ./configure. It will then copy the following programs to the --bindir=DIR directory:

    • htdig
    • htmerge
    • htfuzzy
    • htnotify
    • htdump
    • htstat
    • htload

    It will also copy the htsearch program to your --with-cgi-bin-dir=DIR directory.

    After this, several files will be customized and installed. Here is a list of the files that get installed:

    *--with-config-dir=DIR/htdig.conf
    A minimal config file which can be used to create a search database for http://www.htdig.org/
    *--with-search-form=FILE
    A sample HTML document that contains a search form.
    * --with-common-dir=DIR/footer.html
    A sample HTML document that can be used as the search results footer.
    * --with-common-dir=DIR/header.html
    A sample HTML document that can be used as the search results header.
    * --with-common-dir=DIR/nomatch.html
    A sample HTML document that can be used if nothing was found.
    * --with-common-dir=DIR/syntax.html
    A sample HTML document that will be displayed if the user entered an illegal boolean expression. found.
    * --with-common-dir=DIR/english.0
    Default list of words with affixes that is used by htfuzzy.
    * --with-common-dir=DIR/english.aff
    Default affix rule database that is used by htfuzzy.
    * --with-image-dir=DIR/star.gif
    The default star image that is used to rank matches.
    * --with-image-dir=DIR/star_blank.gif
    The default placeholder image that is the same size as the star, but is blank. This is used to align the results in the short listing.
    * --with-image-dir=DIR/htdig.gif
    The nifty ht://Dig logo.
    * --with-image-dir=DIR/button*.gif
    Sample images used to show the search result pages.
    * --bindir=DIR/rundig
    A sample shell script which will create a database.
    * --prefix=DIR/lib/htdig/*.{a,so}
    The shared and static libraries.
    * --prefix=DIR/include/htdig/*.h
    The header files that allow anyone to develop a program based on the internals of htdig.

    Note that these files will never replace any existing files that may already be installed.

    It is also important to note that these files are mostly examples. As they stand, they will work, but you probably want to modify them to reflect your needs.

    After the installation, you will be ready to test out everything. You can use the rundig script to make a test database of the online documentation at http://www.htdig.org/

    The only thing left to do is to modify the htdig.conf config file which was placed in --with-config-dir=DIR/htdig.conf. The Configuration manual has the details on how what attributes are needed. Then, you'll be ready to begin running ht://Dig.


    Shared Libraries

    By default ht://Dig is compiled with shared libraries. If running on a platform other than Linux or FreeBSD, this may be a problem. We recommend that you compile with the --disable-shared configure option.

    If you installed with shared libraries, you must be sure the system will find them. Usually it's done by adding the prefix/lib/htdig directory to the LD_LIBRARY_PATH. This is really system dependent and you must check your documentation.


    Notes for particular operating systems

    Mac OS X cannot handle ht://Dig's shared libraries. Use
    ./configure --disable-shared --enable-static.

    Solaris cc has problems with long file offsets. Use
    ./configure --disable-bigfile.

    HP-UX 10.20 does not handle ./configure. Sorry.


    Andrew Scherpbier <andrew@contigo.com> & the ht://Dig Group
    Last modified: $Date: 2004/05/28 13:15:18 $ htdig-3.2.0b6/htdoc/isp.html0100644006314600127310000001302410055635547015157 0ustar angusgbhtdig ht://Dig: ISPs that Offer ht://Dig

    Uses of ht://Dig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    From time to time, we get requests for recommendations for ISPs that offer ht://Dig hosting services. This list is provided as a service for such requests and does not represent any sort of endorsement of the companies listed. If you are an ISP, you may be listed if you provide web hosting services for third parties and offer ht://Dig as a search engine for clients as a pre-installed option. If you would like to be added to the list, please fill out the form below.

    Your name:
    Your e-mail:
    Page title:
    Page URL:


    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htdoc/ma_menu.html0100644006314600127310000001247307426615574016022 0ustar angusgbhtdig ht://Dig: Mailing list archive


    mail archive

    Navigate
    ^ ht://Dig

    mailing list archive
    * General

    1997

    * January
    * February
    * March
    * April
    * May
    * June
    * July
    * August
    * September
    * October
    * November
    * December

    1998

    * January
    * February
    * March
    * April
    * May
    * June
    * July
    * August
    * September
    * October
    * November
    * December

    1999

    * January
    * February
    * March
    * April
    * May
    * June
    * July
    * August
    * September
    * October
    * November
    * December

    Quick Search:
    htdig-3.2.0b6/htdoc/mailarchive.html0100644006314600127310000000061606710471224016644 0ustar angusgbhtdig ht://Dig -- Internet search engine software htdig-3.2.0b6/htdoc/mailing.html0100644006314600127310000000421610055635547016007 0ustar angusgbhtdig ht://Dig: Mailing list

    ht://Dig mailing list

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    There are now several mailing lists related to ht://Dig.

    htdig-general is a relatively high volume list for discussion of ht://Dig and related announcements. Major announcements, such as new releases are sent to this list as well as the htdig3-announce list below. List traffic is archived here.
    htdig-announce is a read-only list only for announcements of ht://Dig releases from the main htdig list.
    htdig-dev is a fairly moderate volume list for discussion of ht://Dig development issues and patches. List traffic is archived here.
    htdig-updates is a read-only, relatively high volume list that tracks changes to the CVS source tree.

    To sign up for a list, you should go to the SourceForge mailing list page. Please note that the archives on SourceForge are only from the middle of January 2001, while the above archives comprise messages dating back much further.

    In addition to the mailing lists, bug reports and feature requests should be sent to the online bug-tracking database through the bug reporting page.


    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htdoc/main.html0100644006314600127310000001702010055635547015310 0ustar angusgbhtdig ht://Dig: Overview

    ht://Dig
    WWW Search Engine Software

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Recent News

    Release of 3.2.0b5
        lha - 2003-11-10 03:57   -   ht://Dig
    After being asked "Is ht://Dig dead?" once too often, the ht://Dig group is very happy to announce the release of ht://Dig version 3.2.0b5. This fourth beta release of 3.2 (yes, 3.2.0b4 was cancelled) should fix all bugs in previous 3.2 releases and indtroduces a few new features. As a beta release, it has not received exhaustive testing. However, we believe it to be almost stable enough for production use, and hope that you consider giving it a try to provide feedback.


    Release of 3.1.6
        ghutchis - 2002-02-01 07:49   -   ht://Dig
    The ht://Dig group is quite happy to announce, at long last, the release of version 3.1.6. This new production version fixes a number of important bugs and adds a few heavily-requested features. As the latest stable release, it is recommended for all production servers. For more details, check the Release Notes at http://www.htdig.org/RELEASE.html or download 3.1.6 from http://www.htdig.org/where.html or http://www.htdig.org/mirrors.html
    (5 Comments) [Read More/Comment]

    FTP Site ftp.htdig.org Offline
        ghutchis - 2001-11-30 07:42   -   ht://Dig
    SourceForge has stopped hosting project ftp services. So the main FTP repository, ftp.htdig.org is no longer.

    Files available from FTP have also always been available from http://www.htdig.org/files/
    Security Vulnerabilities in 3.1.5 and 3.2.0b3
        ghutchis - 2001-10-15 12:51   -   ht://Dig
    The current released versions are vulnerable to a security hole in the htsearch CGI program. Pre-release snapshots of 3.2.0b4 and 3.1.6 are available from the development snapshots directory that fix the problem: http://www.htdig.org/files/snapshots/
    (6 Comments) [Read More/Comment]

    Release of 3.2.0b3
        ghutchis - 2001-02-22 18:20   -   ht://Dig
    The ht://Dig group is quite happy to announce, at long last, the release of ht://Dig version 3.2.0b3. This third beta release of 3.2 offers several long-awaited features and should fix all bugs in previous 3.2 releases. As a beta release, it still has only received limited testing. However, as the final release of 3.2.0 nears, we hope that you consider giving it a try to provide feedback.
    (5 Comments) [Read More/Comment]


    Introduction

    The ht://Dig system is a complete world wide web indexing and searching system for a domain or intranet. This system is not meant to replace the need for powerful internet-wide search systems like Lycos, Infoseek, Google and AltaVista. Instead it is meant to cover the search needs for a single company, campus, or even a particular sub section of a web site.
    As opposed to some WAIS-based or web-server based search engines, ht://Dig can easily span several web servers. The type of these different web servers doesn't matter as long as they understand common protocols like HTTP.

    ht://Dig was developed at San Diego State University as a way to search the various web servers on the campus network. Here are some examples of the application of ht://Dig on the SDSU network:

    You can search this documentation as well:

    Restrict to:

    Many different types of searches can be set up using only a single search database. For example, the online documentation search above uses the same database as the campus main search. The difference between the searches is that the documentation search will only show results related to the online documentation.


    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htdoc/meta.html0100644006314600127310000001721010055635547015313 0ustar angusgbhtdig ht://Dig: Recognized META information in HTML documents

    Recognized META information in HTML documents

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Introduction

    As the ht://Dig system will index all HTML pages on a system, individual authors of pages may want to control some of the aspects of the indexing operation. To this end, ht://Dig will recognize some special <META> tag attributes. The following things can be controlled in this manner:

    • Do not index the document
    • Notify a user that the document has expired
    • Set keywords for the document

    General <META> tag use

    In HTML, any number of <META> tags can be used between the <HEAD> and </HEAD> tags of a document. There are three possible attributes in this tag, two of which are recognized by ht://Dig:

    NAME
    Used to name a specific property.
    CONTENT
    Used to supply the value for a named property.

    A document could start with something like the following:

    <HTML>
    <HEAD>
    <META NAME="htdig-keywords" CONTENT="phone telephone online electronic directory">
    <META NAME="htdig-email" CONTENT="pat.user@nowhere.net">
    <TITLE>Some document title</TITLE>
    </HEAD>
    <BODY>
    Body of document
    </BODY>
    </HTML>

    Recognized properties

    The following properties are recognized by ht://Dig:

    • htdig-keywords
    • htdig-noindex
    • htdig-email
    • htdig-notification-date
    • htdig-email-subject
    • robots
    • keywords
    • description
    • author

    Detailed information about the htdig-email, htdig-notification-date, and htdig-email-subject properties can be found in the Email notification service document.

    Descriptions of the properties and their values:

    htdig-keywords
    The value of this property should be a blank separated list of keywords which will get a very high weight when searching. This can be used to get around some problems with common synonyms for words in the document. For example, if a document is a telephone directory, possible keywords could be "telephone phone directory book list". Now, regardless of what text is actually in the document, it can be found if these keywords are used in the search. The weight that words in the content string will have in search results is controlled by the keywords_factor attribute in your configuration.
    htdig-noindex
    This property has no value associated with it. If it is used, the document will NOT be included in any searches. Example uses of this could be:
    • A document which is dynamic. ie: the contents change continually.
    • Temporary document, not officially available, yet.
    • A document you just don't want to be found.
    htdig-email
    The value is the email address a notification message should be sent to. Multiple email addresses can be given by separating them by commas. If no email address is given, no notification will be sent.
    (Please check the Email notification service documentation for more details on this.)
    htdig-notification-date
    The value is the date on or after which the notification should be sent. The format is simply month / day / year, or if the iso_8601 attribute is set, year - month - day. Make sure that the year has the century with it as well. This means that you should use 1995 instead of 95.
    If no date is given, no notification will be sent. (Please check the Email notification service documentation for more details on this.)
    htdig-email-subject
    The value specifies the subject the notification message. This is an optional property. (Please check the Email notification service documentation for more details on this.)
    robots
    The value specifies restrictions on robots (including ht://Dig) for the current page. These restrictions can be "noindex" to prevent indexing the document but allowing the robot to follow links from the page, "nofollow" to allow indexing but preventing links from being followed, or "none" to prevent both. Additionally, ht://Dig supports the values "index" and "follow" and "all" which obviously are the opposite of the other values and are the default behavior. For more information on META robots tags, check out the HTMLAuthor's Guide to the Robots META tag.
    keywords
    The value of this property should be a blank separated list of keywords, just as for the htdig-keywords property. They are treated as equivalent by htdig. The reason for two different properties is that the keywords property is used by other search engines as well, while the htdig-keywords property can be used for words you want indexed only by htdig. You can get htdig to treat other property names as equivalent to htdig-keywords, or disable the htdig-keywords or keywords properties, by changing the keywords_meta_tag_names attribute in your configuration.
    description
    The value allows you to specify an alternate excerpt (description) of a page. If the config-file attribute use_meta_description is used, then any documents with descriptions will use them instead of the automatically generated excerpts. The weight that words in the content string will have in search results is controlled by the meta_description_factor attribute in your configuration.
    author
    The value specifies the name, email address and/or affiliation of the creator or authoriser of a page. The weight that words in the content string will have in search results is controlled by the author_factor attribute in your configuration. A search for "author:name" will look only in these fields for the word name.

    Last modified: $Date: 2004/05/28 13:15:19 $ htdig-3.2.0b6/htdoc/notification.html0100644006314600127310000001366110055635547017061 0ustar angusgbhtdig ht://Dig: Email notification service

    ht://Dig Email notification service

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Introduction

    As any HTML author knows, information is only useful if it is valid. Unfortunately, a lot of information has an inherent expiration date. Things like meeting schedules, announcements of upcoming events, and pages with those annoying yellow 'NEW' images by certain links.

    ht://Dig is a WWW index/search system developed at San Diego State University. Since this index system already scans all HTML documents, it was the logical choice to incorporate a reminder service into it.

    ht://Dig can be told to remind you about an HTML page sometime in the future. The reminder/notification will come by email and will contain the URL to the page plus some other information.


    Use

    ht://Dig detects special use of the <META> tag in HTML documents. The <META> tags should go between <HEAD> and </HEAD> of an HTML document.

    Example:

    <HTML>
    <HEAD>
    <META NAME="htdig-email" CONTENT="pat.user@nowhere.net">
    <META NAME="htdig-email-subject" CONTENT="Reminder to update a page">
    <META NAME="htdig-notification-date" CONTENT="8/28/1995">
    <TITLE>Someone's homepage.</TITLE>
    </HEAD>
    <BODY>
    Body of document
    </BODY>
    </HTML>

    After 8/28/1995 pat.user@nowhere.net will get a mail message which will look something like this:

    From: ht://Dig email notification service
    Subject: WWW notification: Reminder to update a page
    To: pat.user@nowhere.net

    The following page was tagged to notify you after 8/28/1995.

    URL: http://www.sdsu.edu/~turtle/index.html
    Date: 8/28/1995
    Subject: Reminder to update a page

    Attributes

    The special ht://Dig <META> tag attributes related to notification are:

    • NAME="htdig-email" CONTENT="email address [, email address] ..."
    • NAME="htdig-notification-date" CONTENT="earliest notification date"
    • NAME="htdig-email-subject" CONTENT="notification message subject"

    Descriptions of the values for the attributes:

    htdig-email
    This is the email address the notification message should be sent to. Multiple email addresses can be given by separating them by commas. If no email address is given, no notification will be sent.
    htdig-notification-date
    This is the date on or after which the notification should be sent. The format is simply month / day / year, or if the iso_8601 attribute is set, year - month - day. Make sure that the year has the century with it as well. This means that you should use 1995 instead of 95.
    The format of dates is actually a little more flexible than this. Any punctuation or white space can be used as separators, and if the year, month and date do not appear as expected in the order listed above, the notification service will try to make sense of the order used, if the date can be resolved unambiguously in another order. Using four-digit years avoids ambiguity between the year and the month or day. The format year - month - day is accepted without ambiguity when a four-digit year is used, whether the iso_8601 attribute is set or not. When the year is given after the month and day, the format is either day - month - year, if iso_8601 is true and the year has four digits, or month - day - year otherwise.
    If no date is given, no notification will be sent. If a date is given but is malformed, a notification of this error will be sent. For correct dates, a notification will be sent every time the system runs the notification service, on or after the date given. To end the notifications, you must update or remove the notification date in the document.
    htdig-email-subject
    This specifies the subject the notification message. This is an optional attribute. Note that if you want to put spaces in the subject, you have to put double quotes (") around it.

    There are a couple of other META attributes which are recognized. These can be found in the more general ht://Dig META tag documentation.


    Disclaimer

    This service is a free service for all HTML maintainers whose documents are covered by the ht://Dig search system. If any of the attributes are improperly formatted, no notifications will be mailed. Email notification may not always occur on the date that you specified. We can only guarantee a notification of at most once a week.


    Last modified: $Date: 2004/05/28 13:15:19 $ htdig-3.2.0b6/htdoc/require.html0100644006314600127310000002547010055635547016050 0ustar angusgbhtdig ht://Dig: Features and System requirements

    Features and System requirements

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Features

    Here are some of the major features of ht://Dig. They are in no particular order.

    * Intranet searching
    ht://Dig has the ability to search through many servers on a network by acting as a WWW browser.
    * It is free
    The whole system is released under the GNU Library General Public License (LGPL)
    * Robot exclusion is supported
    The Standard for Robot Exclusion is supported by ht://Dig.
    * Boolean expression searching
    Searches can be arbitrarily complex using boolean expressions.
    * Phrase searching
    A phrase can be searched for by enclosing it in quotes. Phrase searches can be combined with word searches, as in Linux and "high quality".
    * Configurable search results
    The output of a search can easily be tailored to your needs by means of providing HTML templates.
    * Fuzzy searching
    Searches can be performed using various configurable algorithms. Currently the following algorithms are supported (in any combination):
    • exact
    • soundex
    • metaphone
    • common word endings
    • synonyms
    • accent stripping
    • substring and prefix
    • regular expressions
    • simple spelling corrections
    * Searching of many file formats
    Both HTML documents and plain text files can be searched directly ht://Dig itself. There is also a mechanism to allow external programs ("external parsers") to be used while building the database so that arbitrary file formats can be searched.
    * Document retrieval using many transport services
    Several transport services can be handled by ht://Dig, including http://, ftp:// and file:///. There is also a mechanism to allow external programs ("external protocols") to be used while building the database so that arbitrary transport services can be used.
    * Keywords can be added to HTML documents
    Any number of keywords can be added to HTML documents which will not show up when the document is viewed. This is used to make a document more like to be found and also to make it appear higher in the list of matches.
    * Email notification of expired documents
    Special meta information can be added to HTML documents which can be used to notify the maintainer of those documents at a certain time. It is handy to get reminded when to remove the "New" images from a certain page, for example.
    * A Protected server can be indexed
    ht://Dig can be told to use a specific username and password when it retrieves documents. This can be used to index a server or parts of a server that are protected by a username and password.
    * Searches on subsections of the database
    It is easy to set up a search which only returns documents whose URL matches a certain pattern. This becomes very useful for people who want to make their own data searchable without having to use a separate search engine or database.
    * Full source code included
    The search engine comes with full source code. The whole system is released under the terms and conditions of the GNU Library General Public License (LGPL) version 2.0
    * The depth of the search can be limited
    Instead of limiting the search to a set of machines, it can also be restricted to documents that are a certain number of "mouse-clicks" away from the start document.
    * Full support for the ISO-Latin-1 character set
    Both SGML entities like '&agrave;' and ISO-Latin-1 characters can be indexed and searched.

    Requirements to build ht://Dig

    ht://Dig was developed under Unix using C++.

    For this reason, you will need a Unix machine, a C compiler and a C++ compiler. (The C compiler is needed to compile some of the GNU libraries)

    Unfortunately, we only have access to a couple of different Unix machines. ht://Dig has been tested on these machines:

    • FreeBSD 4.6 (using gcc 2.95.3)
    • Mandrake Linux 8.2 (using gcc 3.2)
    • Debian, 2.2.19 kernel (using gcc 2.95.4)
    • Debian on an Alpha
    • RedHat 7.3, 8.0
    • Sun Solaris 2.8 = SunOS 5.8 (using gcc 3.1)
    • Sun Solaris 2.8 = SunOS 5.8 (using Sun's cc / g++ 3.1)
    • Mac OS X 10.2 (using gcc)
    There are reports of ht://Dig working on a number of other platforms.

    libstdc++

    If you plan on using g++ to compile ht://Dig, you have to make sure that libstdc++ has been installed. Unfortunately, libstdc++ is a separate package from gcc/g++. You can get libstdc++ from the GNU software archive.


    Disk space requirements

    The search engine will require lots of disk space to store its databases. Unfortunately, there is no exact formula to compute the space requirements. It depends on the number of documents you are going to index but also on the various options you use.

    As a temporary measure, 3.2 betas use a very inefficient database structure to enable phrase searching. This will be fixed before the release of 3.2.0. Currently, indexing a site of around 10,000 documents gives a database of around 400MB using the default setting for maximum document size and storing the first 50,000 bytes of each document to enable context to be displayed.

    Keep in mind that we keep at most 50,000 bytes of each document. This may seen a lot, but most documents aren't very big and it gives us a big enough chunk to almost always show an excerpt of the matches.

    You may find that if you store most of each document, the databases are almost the same size, or even larger than the documents themselves! Remember that if you're storing a significant portion of each document (say 50,000 bytes as above), you have that requirement, plus the size of the word database and all the additional information about each document (size, URL, date, etc.) required for searching.


    Last modified: $Date: 2004/05/28 13:15:19 $ htdig-3.2.0b6/htdoc/rundig.html0100644006314600127310000001265510062603601015645 0ustar angusgbhtdig ht://Dig: rundig

    rundig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    Synopsis

    rundig [options]

    Description

    Rundig is a shell script that builds the databases necessary for a typical ht://Dig setup. It runs htdig first to build the initial database, then it runs htpurge to clean up the document and word databases that were created by htdig. It then runs htnotify, and finally runs htfuzzy if necessary, to build the endings and synonyms databases if they're missing or outdated. Rundig uses the "-i" option to htdig, so it always reindexes your web site from scratch when you run it.

    Options

    -a
    Use alternate work files. Tells htdig and htpurge to append .work to database files, causing a second copy of the database to be built. This allows the original files to be used by htsearch during the indexing run. After htdig and htpurge are done building the .work database files, rundig will move them into place, replacing the original files.
    This option only works for building a new second copy of the database from scratch, and not for updating an existing database. To do that would require further customization of the rundig script. It's not sufficient to simply remove the "-i" option from htdig in the script. See the Customization section below.
    -c configfile
    Use the specified configfile file instead of the default.
    -s
    Print statistics about the dig after completion.
    -v
    Verbose mode. This increases the verbosity of the programs. Using more than 2 is probably only useful for debugging purposes. The default verbose mode (using only one -v) gives a nice progress report while digging and merging. This progress report can be a bit cryptic, but is explained in the htdig documentation.

    Files

    BIN_DIR/htdig, htpurge, htnotify, htfuzzy
    The executable programs called by rundig.
    CONFIG_DIR/htdig.conf
    The default configuration file.
    COMMON_DIR/english.0, english.aff, synonyms
    The default fuzzy match dictionary (input) files.

    See Also

    htdig, htpurge, htnotify, htfuzzy, htsearch, and Configuration file format.

    Customization

    Because rundig is a shell script, it's easy to customize it as needed. It's also necessary to customize it if you change the settings of your database_dir or common_dir attributes (you'll need to make the corresponding changes to the DBDIR and COMMONDIR variables in the script), if you decide to use other fuzzy algorithms that need their own databases rebuilt, or if you change the names of the endings or synonyms databases or source files. Before customizing the script, be sure to familiarize yourself with the individual programs in the package and how they interact.

    A common mistake is to assume that you can simply take the "-i" option off the htdig command line in rundig to make rundig update rather than reindexing from scratch. This will work as long as you don't use the "-a" option to rundig. The file manipulations that rundig -a does assume that you've created a new database from scratch, and all files are moved from .work files to the original file locations. However, nothing is done before running htdig to move or copy the db.wordlist and db.docdb to .work files before running htdig. The end result is that a rundig -a will still reindex your site from scratch. When it comes to more drastic changes such as this, many users chose to write their own custom script, rather than modifying rundig. For example, see the rundig.sh script in our contributed files.

    Last modified: $Date: 2004/06/12 13:39:13 $
    SourceForge Logo htdig-3.2.0b6/htdoc/running.html0100644006314600127310000001334710055635547016054 0ustar angusgbhtdig Running ht://Dig

    Running ht://Dig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    This document will attempt to show the steps needed to use the ht://Dig system, after obtaining, installing and configuring it.
    The main sections are:


    Building the databases

    After setting up all the configuration files, you can build the required databases simply by running rundig. This script will run htdig first to build the initial database, then it runs htpurge to clean up the document and word databases that were created by htdig. It then runs htnotify, and finally runs htfuzzy if necessary, to build the endings and synonyms databases if they're missing or outdated. The rundig script can be customized for your specific needs, or you can develop your own script that runs any of these programs. Read the reference sections for each of these programs to get a better understanding of what each one does.

    The htfuzzy program deserves a bit more explaining. It is used to build databases that are used by some of the fuzzy match algorithms selected by htsearch's search_algorithm attribute. The endings and synonyms algorithms use static dictionaries, so their databases only need to be rebuilt by htfuzzy when the dictionary files are changed, or when ht://Dig is initially installed. The rundig script handles the building of these two databases as needed for the default setup. A few of the other fuzzy match algorithms use databases that are derived from the word database built by htdig/htpurge, so if you use these algorithms you should rebuild their databases with htfuzzy every time you update your index. This isn't done in rundig, but the comments in the script show where you can add your htfuzzy commands as needed. Some fuzzy match algorithms don't need their own database, as they just operate on the word database, so they don't need any special setup.


    Testing and troubleshooting

    Once the databases are built, you should test out htsearch. It's recommended that you first try a few queries running htsearch on the command line, as it helps to separate problems that are specific to ht://Dig from web server or CGI problems. Once you have that working, try running htsearch from your web browser, using the search form you configured.

    If you run into problems at any point in the building and testing of your databases, there are many things you can do. All ht://Dig programs feature a -v option to get some debugging output. The more of these options you put on the command line, the more output you'll usually get. To get help with common problems, or with interpreting some of the debugging output, please look to the ht://Dig FAQ (frequently asked questions) as your first line of support. Most of the problems that ht://Dig users have are explained there, and the on-line FAQ on the website is updated frequently as new problems arise. The FAQ will also tell you where you can turn if your question isn't answered there. Remember that questions may not be phrased exactly as you'd state them, so look carefully for anything that seems similar to the problem you're trying to solve.


    Maintaining the system

    Once everything is running, you have to deal with the question of how you can keep everything running and up to date. The databases don't automatically update themselves, of course, so you'll need to figure out how to schedule automatic updates of the database. Most users use the crontab facility on their systems to schedule daily or weekly updates of their database. This can be as simple as running "rundig" or "rundig -a" from your crontab, or from a file in /etc/cron.daily if your system uses this, to rebuild from scratch every night. For a small site, this may take only a few minutes to run. Other sites will run more elaborate update scripts, to update their existing databases nightly, and schedule complete rebuilds less frequently, such as monthly.

    You need to pay close attention to how long updates take to run. There are no database lockouts in ht://Dig, so you don't want to schedule update or reindexing runs so frequently that they run into each other.


    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htdoc/triangle.gif0100644006314600127310000000006106275416054015766 0ustar angusgbhtdigGIF87a €ÿÿÿZ{Œ, DŽ›ºŒžt²V i f‡;htdig-3.2.0b6/htdoc/up.gif0100644006314600127310000000006206275416053014605 0ustar angusgbhtdigGIF87a €_ÿÿÿ, „§¸ß^Rž:ž;õW;htdig-3.2.0b6/htdoc/upgrade.html0100644006314600127310000000550210055635547016015 0ustar angusgbhtdig ht://Dig: Upgrading to 3.2.x

    Upgrading from 3.1.x to 3.2.x

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    This guide is intended for those upgrading from 3.1.x or earlier versions to 3.2.x. The best advice is don't. That is, it is highly recommended that you install the 3.2 release in a separate directory tree and treat everything as if you were installing it for the first time. This is not just because this is a beta release. There are several main reasons for this:

    • The htmerge program now only merges. You do not need to run it after running htdig as before. The "cleanup" duties have been moved to the htpurge program that also deletes URLs. The sample rundig script is modified accordingly.
    • The default directory structure of this release is different from previous releases, more in line with other UNIX programs.
    • The databases are all in different formats. This version cannot read databases from previous versions since the new formats have significantly more information and this cannot be reconstructed from old databases. This goes for fuzzy databases as well. Future versions can use the new htdump and htload programs to dump and load databases to/from text files. These will also allow databases to be transfered between platforms.
    Text files, such as config files, result templates, etc. are the same between releases, so you will probably wish to copy these to your new installation.

    Additionally, you may find things a bit rough at first. We appreciate your comments and suggestions, especially in the form of performance comparisons with the 3.1.x releases. Additionally, there are several things planned for the final 3.2.0 release that have not been implemented yet:

    • Proximity (near) searching.
    • Phrase searching method (in addition to and, or, and boolean).
    • Field-based searching--restricting to a header, title, etc.
    • Date-based searching--restricting to a range of dates.
    • Implementation of a more accurate scoring system.
    • Parallel indexing and searching.
    • Support for https: and ftp: access
    Please send comments, patches, etc. to the <htdig3-dev@htdig.org> mailing list.
    Last modified: $Date: 2004/05/28 13:15:19 $ htdig-3.2.0b6/htdoc/uses.html0100644006314600127310000014216310055635547015352 0ustar angusgbhtdig ht://Dig: Sites that Use ht://Dig

    Uses of ht://Dig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    The following is a list of publically available sites that use ht://Dig. If you use ht://Dig on your public site and would like it to be on this list as well, please fill out the form below. Your link will be added in the next update.

    Your name:
    Your e-mail:
    Page title:
    Page URL:
    Please note that this list does not represent any sort of endorsement or recommendation of the sites or companies listed. It's merely a list of known sites that use ht://Dig. Additionally we maintain a related list of ISPs that offer ht://Dig as part of their web hosting services.

    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htdoc/where.html0100644006314600127310000001202510055635547015476 0ustar angusgbhtdig ht://Dig: Where to get it

    Where to get ht://Dig

    ht://Dig Copyright © 1995-2004 The ht://Dig Group
    Please see the file COPYING for license information.


    • The current production release of ht://Dig is 3.1.6.
    • The current beta release of ht://Dig is 3.2.0b6.

    The ht://Dig source releases are available from multiple sources around the world. Note that releases are as a gzipped tar file (.tar.gz). You will need the GNU gunzip program, part of the gzip package, to extract the files in the archive. You can get the latest version of any of the GNU tools from ftp://ftp.gnu.org/gnu/.

    The latest documentation of ht://Dig is always available at http://www.htdig.org/ or any of the ht://Dig mirrors. The documentation for the latest beta release can be found at http://www.htdig.org/dev/htdig-3.2/, or the dev/htdig-3.2 subdirectory of most mirrors.


    Site Stable Release (3.1.6)Beta Release (3.2.0b6) Prior ReleasesContributed Binaries
    htdig.org (HTTP) (HTTP) (HTTP) (HTTP)
    htdig.sourceforge.net (HTTP) (HTTP) (HTTP) (HTTP)
    download.sourceforge.net (HTTP) (FTP)   (HTTP) (FTP)  
    www.it.htdig.org (HTTP) (FTP) (HTTP) (FTP) (HTTP) (FTP) (HTTP) (FTP)  
    opdenbrouw.nl (HTTP) (HTTP) (HTTP) (HTTP)

    Last modified: $Date: 2004/05/28 13:15:19 $
    SourceForge Logo htdig-3.2.0b6/htfuzzy/0040755006314600127310000000000010063260370014106 5ustar angusgbhtdightdig-3.2.0b6/htfuzzy/.sniffdir/0040755006314600127310000000000010063260370015770 5ustar angusgbhtdightdig-3.2.0b6/htfuzzy/.cvsignore0100644006314600127310000000006506772705363016126 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htfuzzy htdig-3.2.0b6/htfuzzy/Accents.cc0100644006314600127310000001114610055635547016012 0ustar angusgbhtdig// // Accents.cc // // Accents: A fuzzy matching algorithm by Robert Marchand, to treat all // ISO-8859-1 accented letters as equivalent to their unaccented // counterparts. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Accents.cc,v 1.5 2004/05/28 13:15:19 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Configuration.h" #include "Accents.h" #include "Dictionary.h" #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ extern int debug; /*-------------------------------------------------------------------. | Ajoute par Robert Marchand pour permettre le traitement adequat de | | l'ISO-LATIN (provient du code de Pierre Rosa) | `-------------------------------------------------------------------*/ /*--------------------------------------------------. | table iso-latin1 "minusculisee" et "de-accentuee" | `--------------------------------------------------*/ static char MinusculeISOLAT1[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 91, 92, 93, 94, 95, 96, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 168, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 208, 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 222, 223, 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 240, 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 254, 255}; //***************************************************************************** // Accents::Accents(const HtConfiguration& config_arg) // Accents::Accents(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "accents"; } //***************************************************************************** // Accents::~Accents() // Accents::~Accents() { } //***************************************************************************** // void Accents::generateKey(char *word, String &key) // void Accents::generateKey(char *word, String &key) { static int maximum_word_length = config.Value("maximum_word_length", 12); if (!word || !*word) return; String temp(word); if (temp.length() > maximum_word_length) temp.chop(temp.length()-maximum_word_length); word = temp.get(); key = '0'; while (*word) { key << MinusculeISOLAT1[ (unsigned char) *word++ ]; } } //***************************************************************************** // void Accents::addWord(char *word) // void Accents::addWord(char *word) { if (!dict) { dict = new Dictionary; } String key; generateKey(word, key); // Do not add fuzzy key as a word, will be added at search time. if (mystrcasecmp(word, key.get()) == 0) return; String *s = (String *) dict->Find(key); if (s) { // if (mystrcasestr(s->get(), word) != 0) (*s) << ' ' << word; } else { dict->Add(key, new String(word)); } } //***************************************************************************** // void Accents::getWords(char *word, List &words) // void Accents::getWords(char *word, List &words) { if (!word || !*word) return; Fuzzy::getWords(word, words); // fuzzy key itself is always searched. String fuzzyKey; generateKey(word, fuzzyKey); if (mystrcasecmp(fuzzyKey.get(), word) != 0) words.Add(new String(fuzzyKey)); } htdig-3.2.0b6/htfuzzy/Accents.h0100644006314600127310000000161410055635550015645 0ustar angusgbhtdig// // Accents.h // // Accents: A fuzzy matching algorithm by Robert Marchand, to treat all // ISO-8859-1 accented letters as equivalent to their unaccented // counterparts. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Accents.h,v 1.4 2004/05/28 13:15:20 lha Exp $ // // #ifndef _Accents_h_ #define _Accents_h_ #include "Fuzzy.h" class Accents : public Fuzzy { public: // // Construction/Destruction // Accents(const HtConfiguration& config_arg); virtual ~Accents(); virtual void generateKey(char *word, String &key); virtual void addWord(char *word); virtual void getWords(char *word, List &words); private: }; #endif htdig-3.2.0b6/htfuzzy/Endings.cc0100644006314600127310000000753710055635550016024 0ustar angusgbhtdig// // Endings.cc // // Endings: A fuzzy matching algorithm to match the grammatical endings rules // used by the ispell dictionary files. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Endings.cc,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "StringList.h" #include "Endings.h" #include "htfuzzy.h" #include "HtConfiguration.h" //***************************************************************************** // Endings::Endings() // Endings::Endings(const HtConfiguration& config_arg) : Fuzzy(config_arg) { root2word = 0; word2root = 0; name = "endings"; } //***************************************************************************** // Endings::~Endings() // Endings::~Endings() { if (root2word) { root2word->Close(); delete root2word; root2word = 0; } if (word2root) { word2root->Close(); delete word2root; word2root = 0; } } //***************************************************************************** // void Endings::getWords(char *word, String &words) // Return a list of words with some common English word endings. // void Endings::getWords(char *w, List &words) { if (!word2root || !root2word) return; String data; String word = w; word.lowercase(); HtStripPunctuation(word); String saveword = word.get(); // // Look for word's root(s). Some words may have more than one root, // so handle them all. Whether or not a word has a root, it's assumed // to be root in itself. // if (word2root->Get(word, data) == OK) word << ' ' << data; StringList roots(word, " "); Object *root; roots.Start_Get(); while ((root = roots.Get_Next()) != 0) { // // Found a root. Look for new words that have this root. // word = ((String *)root)->get(); if (root2word->Get(word, data) == OK) word << ' ' << data; // // Iterate through the root's permutations // char *token = strtok(word.get(), " "); while (token) { if (mystrcasecmp(token, saveword.get()) != 0) { // // This permutation isn't the original word, so we add it // to the list if it's not already there. // Object *obj; words.Start_Get(); while((obj = words.Get_Next()) != 0) { if (mystrcasecmp(token, ((String *)obj)->get()) == 0) break; } if (obj == 0) words.Add(new String(token)); } token = strtok(0, " "); } } } //***************************************************************************** // void Endings::generateKey(char *word, String &key) // Not needed. void Endings::generateKey(char *, String &) { } //***************************************************************************** // void Endings::addWord(char *word) // Not needed. void Endings::addWord(char *) { } //***************************************************************************** // int Endings::openIndex() // Dummy method. Just makde sure we don't actually create a database. // int Endings::openIndex() { String filename = config["endings_word2root_db"]; word2root = Database::getDatabaseInstance(DB_BTREE); if (word2root->OpenRead((char*)filename) == NOTOK) return NOTOK; filename = config["endings_root2word_db"]; root2word = Database::getDatabaseInstance(DB_BTREE); if (root2word->OpenRead((char*)filename) == NOTOK) return NOTOK; return OK; } //***************************************************************************** // int Endings::writeDB() // Dummy method. Just making sure we don't actually write anything. // int Endings::writeDB() { return OK; } htdig-3.2.0b6/htfuzzy/Endings.h0100644006314600127310000000264710055635550015663 0ustar angusgbhtdig// // Endings.h // // Endings: A fuzzy matching algorithm to match the grammatical endings rules // used by the ispell dictionary files. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Endings.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Endings_h_ #define _Endings_h_ #include "Fuzzy.h" class Dictionary; class String; class List; class Endings : public Fuzzy { public: // // Construction/Destruction // Endings(const HtConfiguration& config_arg); virtual ~Endings(); virtual void getWords(char *word, List &words); virtual void generateKey(char *word, String &key); virtual void addWord(char *word); virtual int openIndex(); virtual int writeDB(); // // Special member which will create the two databases needed for this // algorithm. // int createDB(const HtConfiguration &config); static void mungeWord(char *, String &); private: Database *root2word; Database *word2root; int createRoot(Dictionary &, char *, char *, const String&); int readRules(Dictionary &, const String&); void expandWord(String &, List &, Dictionary &, char *, char *); }; #endif htdig-3.2.0b6/htfuzzy/EndingsDB.cc0100644006314600127310000002205210055635550016217 0ustar angusgbhtdig// // EndingsDB.cc // // EndingsDB: Implementation of the private endings database // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: EndingsDB.cc,v 1.17 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Endings.h" #include "htfuzzy.h" #include "SuffixEntry.h" #include "Dictionary.h" #include "List.h" #include "HtConfiguration.h" #include "filecopy.h" // This is an attempt to get around compatibility problems // with the included regex #ifdef _MSC_VER /* _WIN32 */ #include "regex_win32.h" #else # ifdef USE_RX # include # else // Use regex # ifdef HAVE_BROKEN_REGEX # include # else // include regex code and header # include "gregex.h" # endif # endif #endif //_MSC_VER /* _WIN32 */ #include #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ //***************************************************************************** // int Endings::createDB(const HtConfiguration &config) { Dictionary rules; String tmpdir = getenv("TMPDIR"); String word2root, root2word; #if defined(LIBHTDIG) || defined(LIBHTDIGPHP) || defined(_MSC_VER) //WIN32 int ret = -1; char * source = NULL; char * dest = NULL; #endif if (tmpdir.length()) { word2root = tmpdir; root2word = tmpdir; } else { word2root = "/tmp"; root2word = "/tmp"; } word2root << "/word2root.db"; root2word << "/root2word.db"; if (debug) cout << "htfuzzy/endings: Reading rules\n"; if (readRules(rules, config["endings_affix_file"]) == NOTOK) return NOTOK; if (debug) cout << "htfuzzy/endings: Creating databases\n"; if (createRoot(rules, word2root, root2word, config["endings_dictionary"]) == NOTOK) return NOTOK; // // Since we used files in TMPDIR for our temporary databases, we need // to now move them to the correct location as defined in the config // database. // #if defined(LIBHTDIG) || defined(LIBHTDIGPHP) || defined(_MSC_VER) //WIN32 //Uses file_copy function - works on Unix/Linux & WinNT source = root2word.get(); dest = (char *)config["endings_root2word_db"].get(); //Attempt rename, if fail attempt copy & delete. ret = rename(source, dest); if (ret < 0) { ret = file_copy(source, dest, FILECOPY_OVERWRITE_ON); if (ret == TRUE) unlink(source); else return NOTOK; } source = word2root.get(); dest = (char *)config["endings_word2root_db"].get(); //Attempt rename, if fail attempt copy & delete. ret = rename(source, dest); if (ret < 0) { ret = file_copy(source, dest, FILECOPY_OVERWRITE_ON); if (ret == TRUE) unlink(source); else return NOTOK; } #else //This code uses a system call - Phase this out struct stat stat_buf; String mv("mv"); // assume it's in the PATH if predefined setting fails if ((stat(MV, &stat_buf) != -1) && S_ISREG(stat_buf.st_mode)) mv = MV; system(form("%s %s %s;%s %s %s", mv.get(), root2word.get(), config["endings_root2word_db"].get(), mv.get(), word2root.get(), config["endings_word2root_db"].get())); #endif return OK; } //***************************************************************************** int Endings::readRules(Dictionary &rules, const String& rulesFile) { FILE *fl = fopen(rulesFile, "r"); if (fl == NULL) return NOTOK; int inSuffixes = 0; char currentSuffix[2] = " "; char *p; char input[1024]; String line; while (fgets(input, sizeof(input), fl)) { if (input[0] == '\n' || input[0] == '#') continue; if (mystrncasecmp(input, "suffixes", 8) == 0) { inSuffixes = 1; continue; } else if (mystrncasecmp(input, "prefixes", 8) == 0) { inSuffixes = 0; continue; } if (!inSuffixes) continue; if (mystrncasecmp(input, "flag ", 5) == 0) { p = input + 5; while (*p == '*' || *p == ' ' || *p == '\t') p++; currentSuffix[0] = *p; } else { line << input; line.chop("\r\n"); if (line.indexOf('>') > 0) { List *list; SuffixEntry *se = new SuffixEntry(line); if (rules.Exists(currentSuffix)) { list = (List *) rules[currentSuffix]; } else { list = new List; rules.Add(currentSuffix, list); } list->Add(se); line = 0; } } } fclose(fl); return OK; } //***************************************************************************** int Endings::createRoot(Dictionary &rules, char *word2root, char *root2word, const String& dictFile) { FILE *fl = fopen(dictFile, "r"); if (fl == NULL) return NOTOK; Database *w2r = Database::getDatabaseInstance(DB_BTREE); Database *r2w = Database::getDatabaseInstance(DB_BTREE); w2r->OpenReadWrite(word2root, 0664); r2w->OpenReadWrite(root2word, 0664); char input[1024]; char *p; String words; String word; List wordList; int count = 0; String data; while (fgets(input, sizeof(input), fl)) { if ((count % 100) == 0 && debug == 1) { cout << "htfuzzy/endings: words: " << count << '\n'; cout.flush(); } count++; p = strchr(input, '/'); if (p == NULL) continue; // Only words that have legal endings are used *p++ = '\0'; mungeWord(input, word); expandWord(words, wordList, rules, word, p); if (debug > 1) cout << "htfuzzy/endings: " << word << " --> " << words << endl; // // Store the root mapped to the list of expanded words. // r2w->Put(word, words); // // For each of the expanded words, build a map to its root. // for (int i = 0; i < wordList.Count(); i++) { // // Append to existing record if there is one. // data = ""; if (w2r->Get(*(String *)wordList[i], data) == OK) data << ' '; data << word; w2r->Put(*(String *)wordList[i], data); } } if (debug == 1) cout << endl; fclose(fl); w2r->Close(); r2w->Close(); delete w2r; delete r2w; return OK; } //***************************************************************************** // Convert a word from the dictionary format into something we can actually // use. This means that the word will be converted to lowercase and that // any accents will be combined into single characters. // void Endings::mungeWord(char *input, String &word) { char *p = input + 1; word = 0; while (*input) { p = input + 1; switch (*p) { case '"': // The previous character needs to get an umlaut switch (*input) { case 'a': case 'A': word << char(228); input += 2; continue; break; case 'e': case 'E': word << char(235); input += 2; continue; break; case 'i': case 'I': word << char(239); input += 2; continue; break; case 'o': case 'O': word << char(246); input += 2; continue; break; case 'u': case 'U': word << char(252); input += 2; continue; break; } break; case 'S': // See if the previous character needs to be an sz if (*input == 's') { word << char(223); input += 2; continue; } else { word << *input; } break; default: word << *input; break; } input++; } word.lowercase(); } //***************************************************************************** void Endings::expandWord(String &words, List &wordList, Dictionary &rules, char *word, char *suffixes) { char suffix[2] = " "; String root; SuffixEntry *entry; List *suffixRules; char *p; String rule; words = 0; wordList.Destroy(); while (*suffixes > ' ') { suffix[0] = *suffixes++; if (!rules.Exists(suffix)) continue; suffixRules = (List *) rules[suffix]; for (int i = 0; i < suffixRules->Count(); i++) { entry = (SuffixEntry *) (*suffixRules)[i]; root = word; regex_t reg; rule = entry->rule; if (strchr((char*)rule, '\'')) continue; if (debug > 2) cout << "Applying regex '" << entry->expression << "' to " << word << endl; regcomp(®, (char*)entry->expression, REG_ICASE | REG_NOSUB | REG_EXTENDED); if (regexec(®, word, 0, NULL, 0) == 0) { // // Matched // if (rule[0] == '-') { // // We need to remove something... // p = strchr((char*)rule, ','); if (p) { *p++ = '\0'; root.chop((int)strlen(rule.get()) - 1); root << p; } } else { root << rule; } root.lowercase(); if (debug > 2) cout << word << " with " << rule << " --> '" << root << "'\n"; wordList.Add(new String(root)); words << root << ' '; } regfree(®); } } words.chop(1); } htdig-3.2.0b6/htfuzzy/Exact.cc0100644006314600127310000000277110055635550015474 0ustar angusgbhtdig// // Exact.cc // // Exact: The exact-match "fuzzy" matching. Simply returns the word (minus punctuation) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Exact.cc,v 1.11 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Exact.h" #include "htString.h" #include "List.h" //***************************************************************************** // Exact::Exact() // Exact::Exact(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "exact"; } //***************************************************************************** // Exact::~Exact() // Exact::~Exact() { } //***************************************************************************** void Exact::getWords(char *w, List &words) { String stripped = w; HtStripPunctuation(stripped); words.Add(new String(stripped)); } //***************************************************************************** int Exact::openIndex() { return 0; } //***************************************************************************** void Exact::generateKey(char *, String &) { } //***************************************************************************** void Exact::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Exact.h0100644006314600127310000000161610055635550015333 0ustar angusgbhtdig// // Exact.h // // Exact: The exact-match "fuzzy" matching. Simply returns the word (minus punctuation) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Exact.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Exact_h_ #define _Exact_h_ #include "Fuzzy.h" class Dictionary; class String; class List; class Exact : public Fuzzy { public: // // Construction/Destruction // Exact(const HtConfiguration& config_arg); virtual ~Exact(); virtual void getWords(char *word, List &words); virtual int openIndex(); virtual void generateKey(char *, String &); virtual void addWord(char *); private: }; #endif htdig-3.2.0b6/htfuzzy/Fuzzy.cc0100644006314600127310000001137510055635550015557 0ustar angusgbhtdig// // Fuzzy.cc // // Fuzzy: This is the base class for all the different types of fuzzy searches. // We only define the interface. // // There are two main uses of classes derived from this class: // 1) Creation of a fuzzy index // 2) Searching for a word using the fuzzy index // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Fuzzy.cc,v 1.20 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Fuzzy.h" #include "htfuzzy.h" #include "HtConfiguration.h" #include "List.h" #include "StringList.h" #include "Endings.h" #include "Exact.h" #include "Metaphone.h" #include "Soundex.h" #include "Synonym.h" #include "Substring.h" #include "Prefix.h" #include "Regexp.h" #include "Speling.h" #include "Accents.h" //***************************************************************************** // Fuzzy::Fuzzy(const HtConfiguration& config) // Fuzzy::Fuzzy(const HtConfiguration& config_arg) : config(config_arg) { dict = 0; index = 0; } //***************************************************************************** // Fuzzy::~Fuzzy() // Fuzzy::~Fuzzy() { if (index) { index->Close(); delete index; index = 0; } delete dict; } //***************************************************************************** // void Fuzzy::getWords(char *word, List &words) // void Fuzzy::getWords(char *word, List &words) { if (!index) return; if (!word || !*word) return; // // Convert the word to a fuzzy key // String fuzzyKey; String data; String stripped = word; HtStripPunctuation(stripped); generateKey(stripped, fuzzyKey); if (debug > 2) cout << "\n\tkey: " << fuzzyKey << endl; words.Destroy(); if (index->Get(fuzzyKey, data) == OK) { // // Found the entry // char *token = strtok(data.get(), " "); while (token) { if (mystrcasecmp(token, word) != 0) { words.Add(new String(token)); } token = strtok(0, " "); } } else { // // The key wasn't found. // } } //***************************************************************************** // int Fuzzy::openIndex(const HtConfiguration &config) // int Fuzzy::openIndex() { String var = name; var << "_db"; const String filename = config[var]; index = Database::getDatabaseInstance(DB_HASH); if (index->OpenRead(filename) == NOTOK) { delete index; index = 0; return NOTOK; } return OK; } //***************************************************************************** // int Fuzzy::writeDB(HtConfiguration &config) // int Fuzzy::writeDB() { String var = name; var << "_db"; const String filename = config[var]; index = Database::getDatabaseInstance(DB_HASH); if (index->OpenReadWrite(filename, 0664) == NOTOK) return NOTOK; String *s; char *fuzzyKey; int count = 0; dict->Start_Get(); while ((fuzzyKey = dict->Get_Next())) { s = (String *) dict->Find(fuzzyKey); index->Put(fuzzyKey, *s); if (debug > 1) { cout << "htfuzzy: '" << fuzzyKey << "' ==> '" << s->get() << "'\n"; } count++; if ((count % 100) == 0 && debug == 1) { cout << "htfuzzy: keys: " << count << '\n'; cout.flush(); } } if (debug == 1) { cout << "htfuzzy:Total keys: " << count << "\n"; } return OK; } //***************************************************************************** // Fuzzy algorithm factory. // Fuzzy * Fuzzy::getFuzzyByName(char *name, const HtConfiguration& config) { if (mystrcasecmp(name, "exact") == 0) return new Exact(config); else if (mystrcasecmp(name, "soundex") == 0) return new Soundex(config); else if (mystrcasecmp(name, "metaphone") == 0) return new Metaphone(config); else if (mystrcasecmp(name, "accents") == 0) return new Accents(config); else if (mystrcasecmp(name, "endings") == 0) return new Endings(config); else if (mystrcasecmp(name, "synonyms") == 0) return new Synonym(config); else if (mystrcasecmp(name, "substring") == 0) return new Substring(config); else if (mystrcasecmp(name, "prefix") == 0) return new Prefix(config); else if (mystrcasecmp(name, "regex") == 0) return new Regexp(config); else if (mystrcasecmp(name, "speling") == 0) return new Speling(config); else return 0; } //***************************************************************************** int Fuzzy::createDB(const HtConfiguration &) { return OK; } void Fuzzy::generateKey(char *, String &) { } void Fuzzy::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Fuzzy.h0100644006314600127310000000570210055635550015416 0ustar angusgbhtdig// // Fuzzy.h // // Fuzzy: This is the base class for all the different types of fuzzy searches. // We only define the interface. // // There are two main uses of classes derived from this class: // 1) Creation of a fuzzy index // 2) Searching for a word using the fuzzy index // // The Fuzzy classes take the raw words from the user's query and generate // a list of words to be looked up in the database. These words are created // using the getWords call and can either be picked off from a separate fuzzy // database specific to the method, or by generating words on the fly. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Fuzzy.h,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifndef _Fuzzy_h_ #define _Fuzzy_h_ #include "Object.h" #include "htString.h" #include "Database.h" #include "HtWordType.h" #include "HtWordList.h" class HtConfiguration; class Dictionary; class List; class Fuzzy : public Object { public: // // Construction/Destruction // Fuzzy(const HtConfiguration& config); virtual ~Fuzzy(); // // Given a single work, generate a list of replacement words using // the current algorithm. // virtual void getWords(char *word, List &words); // // For the current algorithm, open the key database // virtual int openIndex(); // // For searching, we will need to keep track of the weight associated // with a particular fuzzy algorithm. // void setWeight(double w) {weight = w;} double getWeight() {return weight;} //******************************************************************* // The following are used in the creation of the fuzzy databases. // // For the current algorithm, write the database to disk. // virtual int writeDB(); // // For the current algorithm, create the database. // This is for those algoritms that don't need a list of words // to work. // virtual int createDB(const HtConfiguration &config); // // Given a word from the htdig word database, create the appropriate // entries into memory which will later be written out with writeDB(). // virtual void addWord(char *word); // // Each algorithm has a name... // char *getName() {return name;} // // Fuzzy algorithm factory. This returns a new Fuzzy algorithm // object that belongs to the given name. // static Fuzzy *getFuzzyByName(char *name, const HtConfiguration& config); protected: // // Given a single word, generate a database key // virtual void generateKey(char *word, String &key); char *name; Database *index; Dictionary *dict; double weight; const HtConfiguration& config; }; #endif htdig-3.2.0b6/htfuzzy/Makefile.am0100644006314600127310000000141007723256616016154 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config LOCAL_DEFINES= -DMV=\"$(MV)\" pkglib_LTLIBRARIES = libfuzzy.la libfuzzy_la_SOURCES = Endings.cc EndingsDB.cc Exact.cc \ Fuzzy.cc Metaphone.cc Soundex.cc Accents.cc \ SuffixEntry.cc Synonym.cc \ Substring.cc Prefix.cc Regexp.cc Speling.cc libfuzzy_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} noinst_HEADERS = Accents.h \ Endings.h \ Exact.h \ Fuzzy.h \ Metaphone.h \ Prefix.h \ Regexp.h \ Soundex.h \ Speling.h \ Substring.h \ SuffixEntry.h \ Synonym.h \ htfuzzy.h bin_PROGRAMS = htfuzzy htfuzzy_SOURCES = htfuzzy.cc htfuzzy_DEPENDENCIES = libfuzzy.la $(HTLIBS) htfuzzy_LDFLAGS = $(PROFILING) ${extra_ldflags} htfuzzy_LDADD = libfuzzy.la $(HTLIBS) htdig-3.2.0b6/htfuzzy/Makefile.in0100644006314600127310000003670110063260372016161 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la LOCAL_DEFINES = -DMV=\"$(MV)\" pkglib_LTLIBRARIES = libfuzzy.la libfuzzy_la_SOURCES = Endings.cc EndingsDB.cc Exact.cc \ Fuzzy.cc Metaphone.cc Soundex.cc Accents.cc \ SuffixEntry.cc Synonym.cc \ Substring.cc Prefix.cc Regexp.cc Speling.cc libfuzzy_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} noinst_HEADERS = Accents.h \ Endings.h \ Exact.h \ Fuzzy.h \ Metaphone.h \ Prefix.h \ Regexp.h \ Soundex.h \ Speling.h \ Substring.h \ SuffixEntry.h \ Synonym.h \ htfuzzy.h bin_PROGRAMS = htfuzzy htfuzzy_SOURCES = htfuzzy.cc htfuzzy_DEPENDENCIES = libfuzzy.la $(HTLIBS) htfuzzy_LDFLAGS = $(PROFILING) ${extra_ldflags} htfuzzy_LDADD = libfuzzy.la $(HTLIBS) subdir = htfuzzy ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(pkglib_LTLIBRARIES) libfuzzy_la_LIBADD = am_libfuzzy_la_OBJECTS = Endings.lo EndingsDB.lo Exact.lo Fuzzy.lo \ Metaphone.lo Soundex.lo Accents.lo SuffixEntry.lo Synonym.lo \ Substring.lo Prefix.lo Regexp.lo Speling.lo libfuzzy_la_OBJECTS = $(am_libfuzzy_la_OBJECTS) bin_PROGRAMS = htfuzzy$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_htfuzzy_OBJECTS = htfuzzy.$(OBJEXT) htfuzzy_OBJECTS = $(am_htfuzzy_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libfuzzy_la_SOURCES) $(htfuzzy_SOURCES) HEADERS = $(noinst_HEADERS) DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am SOURCES = $(libfuzzy_la_SOURCES) $(htfuzzy_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htfuzzy/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfuzzy.la: $(libfuzzy_la_OBJECTS) $(libfuzzy_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libfuzzy_la_LDFLAGS) $(libfuzzy_la_OBJECTS) $(libfuzzy_la_LIBADD) $(LIBS) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done htfuzzy$(EXEEXT): $(htfuzzy_OBJECTS) $(htfuzzy_DEPENDENCIES) @rm -f htfuzzy$(EXEEXT) $(CXXLINK) $(htfuzzy_LDFLAGS) $(htfuzzy_OBJECTS) $(htfuzzy_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(bindir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-pkglibLTLIBRARIES ctags \ distclean distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-exec install-exec-am install-info install-info-am \ install-man install-pkglibLTLIBRARIES install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am uninstall-pkglibLTLIBRARIES # 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: htdig-3.2.0b6/htfuzzy/Makefile.win320100644006314600127310000000220507677124213016517 0ustar angusgbhtdig TARGET1 = $(LIBDIR)/libfuzzy$(LIBSFX) TARGET2 = $(BINDIR)/htfuzzy$(EXESFX) # ---------------------------------------------------------------------------- # add new library members to this list # ---------------------------------------------------------------------------- include ../Makedefs.win32 CXXSRC = Endings.cc EndingsDB.cc Exact.cc Fuzzy.cc Metaphone.cc \ Soundex.cc Accents.cc SuffixEntry.cc Synonym.cc \ Substring.cc Prefix.cc Regexp.cc Speling.cc CPPFLAGS += -DHAVE_CONFIG_H -I. -I../htlib -I../db -I../htcommon -I../htword OBJS2 = win32/htfuzzy.obj LDLIBS = ../lib/$(ARCH)/libhtnet.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libfuzzy.lib ../lib/$(ARCH)/libhtdb.lib OTHERLIBS = ws2_32.lib L:/win32/lib/zlib114/zlib.lib DEPLIBS += $(LDLIBS) all: $(TARGET1) $(TARGET2) $(TARGET1): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) $(TARGET2): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS2) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS2) $(LDLIBS) $(OTHERLIBS) include ../Makerules.win32 htdig-3.2.0b6/htfuzzy/Metaphone.cc0100644006314600127310000002212110055635550016337 0ustar angusgbhtdig// // Metaphone.cc // // Metaphone: A fuzzy matching algorithm used to match words that // sound alike in the English language. Probably not so // good for foreign languages. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Metaphone.cc,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Metaphone.h" #include "Dictionary.h" #include //***************************************************************************** // Metaphone::Metaphone(const HtConfiguration& config_arg) // Metaphone::Metaphone(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "metaphone"; } //***************************************************************************** // Metaphone::~Metaphone() // Metaphone::~Metaphone() { } //***************************************************************************** // void Metaphone::generateKey(char *word, String &key) // /* * This code was copied from the slapd package developed at umich. * it was debugged and cleaned up in February 1999 by Geoffrey Hutchison * for the ht://Dig Project. */ /* * Metaphone copied from C Gazette, June/July 1991, pp 56-57, * author Gary A. Parker, with changes by Bernard Tiffany of the * University of Michigan, and more changes by Tim Howes of the * University of Michigan. */ /* Character coding array */ static char vsvfn[26] = { 1, 16, 4, 16, 9, 2, 4, 16, 9, 2, 0, 2, 2, /* A B C D E F G H I J K L M */ 2, 1, 4, 0, 2, 4, 4, 1, 0, 0, 0, 8, 0}; /* N O P Q R S T U V W X Y Z */ /* Macros to access character coding array */ #define vscode(x) ((x) >= 'A' && (x) <= 'Z' ? vsvfn[(x) - 'A'] : 0) #define vowel(x) ((x) != '\0' && vscode(x) & 1) /* AEIOU */ #define same(x) ((x) != '\0' && vscode(x) & 2) /* FJLMNR */ #define varson(x) ((x) != '\0' && vscode(x) & 4) /* CGPST */ #define frontv(x) ((x) != '\0' && vscode(x) & 8) /* EIY */ #define noghf(x) ((x) != '\0' && vscode(x) & 16) /* BDH */ #define MAXPHONEMELEN 6 void Metaphone::generateKey(char *word, String &key) { if (!word || !*word) return; char *n; String ntrans; /* * Copy Word to internal buffer, dropping non-alphabetic characters * and converting to upper case */ ntrans << "0000"; for (; *word; word++) { if (isalpha(*word)) ntrans << *word; } ntrans.uppercase(); /* ntrans[0] will always be == 0 */ n = ntrans.get(); *n++ = 0; *n++ = 0; *n++ = 0; *n = 0; /* Pad with nulls */ n = ntrans.get() + 4; /* Assign pointer to start */ /* Check for PN, KN, GN, AE, WR, WH, and X at start */ switch (*n) { case 'P': case 'K': case 'G': /* 'PN', 'KN', 'GN' becomes 'N' */ if (*(n + 1) == 'N') *n++ = 0; break; case 'A': /* 'AE' becomes 'E' */ if (*(n + 1) == 'E') *n++ = 0; break; case 'W': /* 'WR' becomes 'R', and 'WH' to 'W' */ if (*(n + 1) == 'R') *n++ = 0; else if (*(n + 1) == 'H') { *(n + 1) = *n; *n++ = 0; } break; case 'X': /* 'X' becomes 'S' */ *n = 'S'; break; } /* * Now, loop step through string, stopping at end of string or when * the computed 'metaph' is MAXPHONEMELEN characters long */ for (; *n && key.length() < MAXPHONEMELEN; n++) { /* Drop duplicates except for CC */ if (*(n - 1) == *n && *n != 'C') continue; /* Check for F J L M N R or first letter vowel */ if (same(*n) || *(n - 1) == '\0' && vowel(*n)) key << *n; else { switch (*n) { case 'B': /* * B unless in -MB */ if (*(n + 1) || *(n - 1) != 'M') key << *n; break; case 'C': /* * X if in -CIA-, -CH- else S if in * -CI-, -CE-, -CY- else dropped if * in -SCI-, -SCE-, -SCY- else K */ if (*(n - 1) != 'S' || !frontv(*(n + 1))) { if (*(n + 1) == 'I' && *(n + 2) == 'A') key << 'X'; else if (frontv(*(n + 1))) key << 'S'; else if (*(n + 1) == 'H') key << (((*(n - 1) == '\0' && !vowel(*(n + 2))) || *(n - 1) == 'S') ? 'K' : 'X'); else key << 'K'; } break; case 'D': /* * J if in DGE or DGI or DGY else T */ key << ((*(n + 1) == 'G' && frontv(*(n + 2))) ? (char) 'J' : (char) 'T'); break; case 'G': /* * F if in -GH and not B--GH, D--GH, * -H--GH, -H---GH else dropped if * -GNED, -GN, -DGE-, -DGI-, -DGY- * else J if in -GE-, -GI-, -GY- and * not GG else K * */ if ((*(n + 1) != 'G' || vowel(*(n + 2))) && (*(n + 1) != 'N' || (*(n + 1) && (*(n + 2) != 'E' || *(n + 3) != 'D'))) && (*(n - 1) != 'D' || !frontv(*(n + 1)))) if (frontv(*(n + 1)) && *(n + 2) != 'G') key << 'J'; else key << 'K'; else if (*(n + 1) == 'H' && !noghf(*(n - 3)) && *(n - 4) != 'H') key << 'F'; break; case 'H': /* * H if before a vowel and not after * C, G, P, S, T else dropped */ if (!varson(*(n - 1)) && (!vowel(*(n - 1 )) || vowel(*(n + 1)))) key << 'H'; break; case 'K': /* * dropped if after C else K */ if (*(n - 1) != 'C') key << 'K'; break; case 'P': /* * F if before H, else P */ key << (*(n + 1) == 'H' ? (char) 'F' : (char) 'P'); break; case 'Q': /* * K */ key << 'K'; break; case 'S': /* * X in -SH-, -SIO- or -SIA- else S */ key << ((*(n + 1) == 'H' || (*(n + 1) == 'I' && (*(n + 2) == 'O' || *(n + 2) == 'A'))) ? (char) 'X' : (char) 'S'); break; case 'T': /* * X in -TIA- or -TIO- else 0 (zero) * before H else dropped if in -TCH- * else T */ if (*(n + 1) == 'I' && (*(n + 2) == 'O' || *(n + 2) == 'A')) key << 'X'; else if (*(n + 1) == 'H') key << '0'; else if (*(n + 1) != 'C' || *(n + 2) != 'H') key << 'T'; break; case 'V': /* * F */ key << 'F'; break; case 'W': /* * W after a vowel, else dropped */ case 'Y': /* * Y unless followed by a vowel */ if (vowel(*(n + 1))) key << *n; break; case 'X': /* * KS */ if (*(n - 1) == '\0') key << 'S'; else key << "KS"; /* Insert K, then S */ break; case 'Z': /* * S */ key << 'S'; break; } } } } //***************************************************************************** // void Metaphone::addWord(char *word) // void Metaphone::addWord(char *word) { if (!dict) { dict = new Dictionary; } String key; generateKey(word, key); if (key.length() == 0) return; String *s = (String *) dict->Find(key); if (s) { // if (mystrcasestr(s->get(), word) != 0) (*s) << ' ' << word; } else { dict->Add(key, new String(word)); } } htdig-3.2.0b6/htfuzzy/Metaphone.h0100644006314600127310000000155610055635550016212 0ustar angusgbhtdig// // Metaphone.h // // Metaphone: A fuzzy matching algorithm used to match words that // sound alike in the English language. Probably not so // good for foreign languages. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Metaphone.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Metaphone_h_ #define _Metaphone_h_ #include "Fuzzy.h" class Metaphone : public Fuzzy { public: // // Construction/Destruction // Metaphone(const HtConfiguration& config_arg); virtual ~Metaphone(); virtual void generateKey(char *word, String &key); virtual void addWord(char *word); private: }; #endif htdig-3.2.0b6/htfuzzy/Prefix.cc0100644006314600127310000000713210055635550015661 0ustar angusgbhtdig// // Prefix.cc // // Prefix: The prefix fuzzy algorithm. Performs a O(log n) search on for words // matching the *prefix* specified--thus significantly faster than a full // substring search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Prefix.cc,v 1.17 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Prefix.h" #include "htString.h" #include "List.h" #include "StringMatch.h" #include "HtConfiguration.h" //***************************************************************************** // Prefix::Prefix(const HtConfiguration& config_arg) // Prefix::Prefix(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "prefix"; } //***************************************************************************** // Prefix::~Prefix() // Prefix::~Prefix() { } //***************************************************************************** // // Prefix search // void Prefix::getWords(char *w, List &words) { if (w == NULL || w[0] == '\0') return; String stripped = w; HtStripPunctuation(stripped); w = stripped.get(); const String prefix_suffix = config["prefix_match_character"]; int prefix_suffix_length = prefix_suffix.length(); int minimum_prefix_length = config.Value("minimum_prefix_length"); if (debug) cerr << " word=" << w << " prefix_suffix=" << prefix_suffix << " prefix_suffix_length=" << prefix_suffix_length << " minimum_prefix_length=" << minimum_prefix_length << "\n"; if ((int)strlen(w) < minimum_prefix_length + prefix_suffix_length) return; // A null prefix character means that prefix matching should be // applied to every search word; otherwise return if the word does // not end in the prefix character(s). // if (prefix_suffix_length > 0 && strcmp(prefix_suffix, w+strlen(w)-prefix_suffix_length)) return; HtWordList wordDB(config); if (wordDB.Open(config["word_db"], O_RDONLY) == NOTOK) return; int wordCount = 0; int maximumWords = config.Value("max_prefix_matches", 1000); String s; int len = strlen(w) - prefix_suffix_length; // Strip the prefix character(s) char w2[8192]; strncpy(w2, w, sizeof(w2) - 1); w2[sizeof(w2) - 1] = '\0'; w2[strlen(w2) - prefix_suffix_length] = '\0'; String w3(w2); w3.lowercase(); List *wordList = wordDB.Prefix(w3.get()); WordReference *word_ref; String last_word; wordList->Start_Get(); while (wordCount < maximumWords && (word_ref = (WordReference *) wordList->Get_Next() )) { s = word_ref->Key().GetWord(); // If we're somehow past the original word, we're done if (mystrncasecmp(s.get(), w, len)) break; // If this is a duplicate word, ignore it if (last_word.length() != 0 && last_word == s) continue; last_word = s; words.Add(new String(s)); wordCount++; } if (wordList) { wordList->Destroy(); delete wordList; } wordDB.Close(); } //***************************************************************************** int Prefix::openIndex() { return 0; } //***************************************************************************** void Prefix::generateKey(char *, String &) { } //***************************************************************************** void Prefix::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Prefix.h0100644006314600127310000000200510055635550015515 0ustar angusgbhtdig// // Prefix.h // // Prefix: The prefix fuzzy algorithm. Performs a O(log n) search on for words // matching the *prefix* specified--thus significantly faster than a full // substring search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Prefix.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Prefix_h_ #define _Prefix_h_ #include "Fuzzy.h" #include "htfuzzy.h" class Dictionary; class String; class List; class Prefix : public Fuzzy { public: // // Construction/Destruction // Prefix(const HtConfiguration& config_arg); virtual ~Prefix(); virtual void getWords(char *word, List &words); virtual int openIndex(); virtual void generateKey(char *, String &); virtual void addWord(char *); private: }; #endif htdig-3.2.0b6/htfuzzy/Regexp.cc0100644006314600127310000000526110055635550015657 0ustar angusgbhtdig// // Regexp.cc // // Regexp: A fuzzy to match input regex against the word database. // Based on the substring fuzzy // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Regexp.cc,v 1.5 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Regexp.h" #include "htString.h" #include "List.h" #include "StringMatch.h" #include "HtConfiguration.h" //***************************************************************************** // Regexp::Regexp(const HtConfiguration& config_arg) // Regexp::Regexp(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "regex"; } //***************************************************************************** // Regexp::~Regexp() // Regexp::~Regexp() { } //***************************************************************************** // A very simplistic and inefficient regex search. For every word // that is looked for we do a complete linear search through the word // database. // Maybe a better method of doing this would be to mmap a list of words // to memory and then run the regex on it. It would still be a // linear search, but with much less overhead. // void Regexp::getWords(char *pattern, List &words) { HtRegex regexMatch; String stripped (pattern); // First we have to strip the necessary punctuation // Why?? lha // stripped.remove("^.[]$()|*+?{},-\\"); // Anchor the string to be matched regexMatch.set(String("^") + stripped); HtWordList wordDB(config); List *wordList; String *key; wordDB.Open(config["word_db"], O_RDONLY); wordList = wordDB.Words(); int wordCount = 0; int maximumWords = config.Value("regex_max_words", 25); wordList->Start_Get(); while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) { if (regexMatch.match(*key, 0, 0) != 0) { words.Add(new String(*key)); wordCount++; } } if (wordList) { wordList->Destroy(); delete wordList; } wordDB.Close(); } //***************************************************************************** int Regexp::openIndex() { return 0; } //***************************************************************************** void Regexp::generateKey(char *, String &) { } //***************************************************************************** void Regexp::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Regexp.h0100644006314600127310000000166110055635550015521 0ustar angusgbhtdig// // Regexp.h // // Regexp: A fuzzy to match input regex against the word database. // Based on the substring fuzzy // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Regexp.h,v 1.4 2004/05/28 13:15:20 lha Exp $ // #ifndef _Regexp_h_ #define _Regexp_h_ #include "Fuzzy.h" #include "HtRegex.h" class Dictionary; class String; class List; class Regexp : public Fuzzy { public: // // Construction/Destruction // Regexp(const HtConfiguration& config_arg); virtual ~Regexp(); virtual void getWords(char *word, List &words); virtual int openIndex(); virtual void generateKey(char *, String &); virtual void addWord(char *); private: }; #endif htdig-3.2.0b6/htfuzzy/Soundex.cc0100644006314600127310000000527310055635550016055 0ustar angusgbhtdig// // Soundex.cc // // Soundex: A fuzzy matching algorithm on the principal of the // Soundex method for last names used by the U.S. INS // and described by Knuth and others. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Soundex.cc,v 1.11 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Soundex.h" #include "Dictionary.h" #include //***************************************************************************** // Soundex::Soundex(const HtConfiguration& config_arg) // Soundex::Soundex(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "soundex"; } //***************************************************************************** // Soundex::~Soundex() // Soundex::~Soundex() { } //***************************************************************************** // void Soundex::generateKey(char *word, String &key) // void Soundex::generateKey(char *word, String &key) { int code = 0; int lastcode = 0; key = 0; if (!word) { key = '0'; return; } while (*word && !isalpha(*word)) word++; if (*word) { key << *word++; } else { key = '0'; return; } while (key.length() < 6) { switch (*word) { case 'b': case 'p': case 'f': case 'v': code = 1; break; case 'c': case 's': case 'k': case 'g': case 'j': case 'q': case 'x': case 'z': code = 2; break; case 'd': case 't': code = 3; break; case 'l': code = 4; break; case 'm': case 'n': code = 5; break; case 'r': code = 6; break; case 'a': case 'e': case 'i': case 'o': case 'u': case 'y': case 'w': case 'h': code = 0; break; default: break; } if (code && code != lastcode) { key << code; lastcode = code; } if (*word) word++; else break; } } //***************************************************************************** // void Soundex::addWord(char *word) // void Soundex::addWord(char *word) { if (!dict) { dict = new Dictionary; } String key; generateKey(word, key); String *s = (String *) dict->Find(key); if (s) { // if (mystrcasestr(s->get(), word) != 0) (*s) << ' ' << word; } else { dict->Add(key, new String(word)); } } htdig-3.2.0b6/htfuzzy/Soundex.h0100644006314600127310000000154410055635550015714 0ustar angusgbhtdig// // Soundex.h // // Soundex: A fuzzy matching algorithm on the principal of the // Soundex method for last names used by the U.S. INS // and described by Knuth and others. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Soundex.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Soundex_h_ #define _Soundex_h_ #include "Fuzzy.h" class Soundex : public Fuzzy { public: // // Construction/Destruction // Soundex(const HtConfiguration& config_arg); virtual ~Soundex(); virtual void generateKey(char *word, String &key); virtual void addWord(char *word); private: }; #endif htdig-3.2.0b6/htfuzzy/Speling.cc0100644006314600127310000000613510055635550016027 0ustar angusgbhtdig// // Speling.h // // Speling: (sic) Performs elementary (one-off) spelling correction for ht://Dig // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Speling.cc,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Speling.h" #include "htString.h" #include "List.h" #include "StringMatch.h" #include "HtConfiguration.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include //***************************************************************************** // Speling::Speling(const HtConfiguration& config_arg) // Speling::Speling(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "speling"; } //***************************************************************************** // Speling::~Speling() // Speling::~Speling() { } //***************************************************************************** // A fairly efficient one-off spelling checker // This generates the small list of possibilities and // checks to see if they exist... // void Speling::getWords(char *w, List &words) { if ((int)strlen(w) < config.Value("minimum_speling_length",5)) return; HtWordList wordDB(config); // last arg=1 -> open to compare only "word" part of of word keys if (wordDB.Open(config["word_db"], O_RDONLY, 1) == NOTOK) return; String initial = w; String stripped = initial; HtStripPunctuation(stripped); String tail; int max_length = stripped.length() - 1; for (int pos = 0; pos < max_length; pos++) { // First transposes // (these are really common) initial = stripped; char temp = initial[pos]; initial[pos] = initial[pos+1]; initial[pos+1] = temp; if (!wordDB.Exists(initial)) // Seems weird, but this is correct words.Add(new String(initial)); // Now let's do deletions initial = stripped; tail = initial.sub(pos+1); if (pos > 0) { initial = initial.sub(0, pos); initial += tail; } else initial = tail; if (!wordDB.Exists(initial)) // Seems weird, but this is correct words.Add(new String(initial)); } // One last deletion -- check the last character! initial = stripped; initial = initial.sub(0, initial.length() - 1); if (!wordDB.Exists(initial)) // Seems weird, but this is correct words.Add(new String(initial)); wordDB.Close(); } //***************************************************************************** int Speling::openIndex() { return 0; } //***************************************************************************** void Speling::generateKey(char *, String &) { } //***************************************************************************** void Speling::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Speling.h0100644006314600127310000000161210055635550015664 0ustar angusgbhtdig// // Speling.h // // Speling: (sic) Performs elementary (one-off) spelling correction for ht://Dig // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Speling.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Speling_h_ #define _Speling_h_ #include "Fuzzy.h" class Dictionary; class String; class List; class Speling : public Fuzzy { public: // // Construction/Destruction // Speling(const HtConfiguration& config_arg); virtual ~Speling(); virtual void getWords(char *word, List &words); virtual int openIndex(); virtual void generateKey(char *, String &); virtual void addWord(char *); private: }; #endif htdig-3.2.0b6/htfuzzy/Substring.cc0100644006314600127310000000542010055635550016402 0ustar angusgbhtdig// // Substring.cc // // Substring: The substring fuzzy algorithm. Currently a rather slow, naive approach // that checks the substring against every word in the word db. // It does not generate a separate database. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Substring.cc,v 1.15 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Substring.h" #include "htString.h" #include "List.h" #include "StringMatch.h" #include "HtConfiguration.h" //***************************************************************************** // Substring::Substring(const HtConfiguration& config_arg) // Substring::Substring(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "substring"; } //***************************************************************************** // Substring::~Substring() // Substring::~Substring() { } //***************************************************************************** // A very simplistic and inefficient substring search. For every word // that is looked for we do a complete linear search through the word // database. // Maybe a better method of doing this would be to mmap a list of words // to memory and then run the StringMatch on it. It would still be a // linear search, but with much less overhead. // void Substring::getWords(char *w, List &words) { // First strip the punctuation String stripped = w; HtStripPunctuation(stripped); // Now set up the StringMatch object StringMatch match; match.Pattern(stripped); // And get the list of all possible words HtWordList wordDB(config); List *wordList; String *key; wordDB.Open(config["word_db"], O_RDONLY); wordList = wordDB.Words(); int wordCount = 0; int maximumWords = config.Value("substring_max_words", 25); wordList->Start_Get(); while (wordCount < maximumWords && (key = (String *) wordList->Get_Next())) { if (match.FindFirst((char*)*key) >= 0) { words.Add(new String(*key)); wordCount++; } } if (wordList) { wordList->Destroy(); delete wordList; } wordDB.Close(); } //***************************************************************************** int Substring::openIndex() { return 0; } //***************************************************************************** void Substring::generateKey(char *, String &) { } //***************************************************************************** void Substring::addWord(char *) { } htdig-3.2.0b6/htfuzzy/Substring.h0100644006314600127310000000203710055635550016245 0ustar angusgbhtdig// // Substring.h // // Substring: The substring fuzzy algorithm. Currently a rather slow, naive approach // that checks the substring against every word in the word db. // It does not generate a separate database. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Substring.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef _Substring_h_ #define _Substring_h_ #include "Fuzzy.h" class Dictionary; class String; class List; class Substring : public Fuzzy { public: // // Construction/Destruction // Substring(const HtConfiguration& config_arg); virtual ~Substring(); virtual void getWords(char *word, List &words); virtual int openIndex(); virtual void generateKey(char *, String &); virtual void addWord(char *); private: }; #endif htdig-3.2.0b6/htfuzzy/SuffixEntry.cc0100644006314600127310000000321710055635550016712 0ustar angusgbhtdig// // SuffixEntry.cc // // SuffixEntry: Decode the suffix rules used in the ispell dictionary files // for the endings fuzzy DB. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SuffixEntry.cc,v 1.5 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "SuffixEntry.h" #include "Endings.h" //***************************************************************************** // SuffixEntry::SuffixEntry() // SuffixEntry::SuffixEntry(char *str) { parse(str); } //***************************************************************************** // SuffixEntry::~SuffixEntry() // SuffixEntry::~SuffixEntry() { } //***************************************************************************** // void SuffixEntry::parse(char *str) // Parse a string in the format '>' into ourselves. // void SuffixEntry::parse(char *str) { String temp = 0; while (*str == ' ' || *str == '\t') str++; temp = "^.*"; while (*str != '>') { if (*str != ' ' && *str != '\t') temp << *str; str++; } temp << "$"; while (*str == ' ' || *str == '\t' || *str == '>') str++; Endings::mungeWord(temp, expression); temp = 0; while (*str != ' ' && *str != '\t' && *str != '\n' && *str != '\r' && *str) { temp << *str; str++; } Endings::mungeWord(temp, rule); } htdig-3.2.0b6/htfuzzy/SuffixEntry.h0100644006314600127310000000146010055635550016552 0ustar angusgbhtdig// // SuffixEntry.h // // SuffixEntry: Decode the suffix rules used in the ispell dictionary files // for the endings fuzzy DB. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SuffixEntry.h,v 1.6 2004/05/28 13:15:20 lha Exp $ // #ifndef _SuffixEntry_h_ #define _SuffixEntry_h_ #include "Object.h" #include "htString.h" class SuffixEntry : public Object { public: // // Construction/Destruction // SuffixEntry(char *); ~SuffixEntry(); String expression; String rule; void parse(char *str); private: }; #endif htdig-3.2.0b6/htfuzzy/Synonym.cc0100644006314600127310000001164110055635550016100 0ustar angusgbhtdig// // Synonym.cc // // Synonym: A fuzzy matching algorithm to create a database of related words // (or misspellings) that should be searched together. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Synonym.cc,v 1.16 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Synonym.h" #include "htfuzzy.h" #include "List.h" #include "StringList.h" #include "HtConfiguration.h" #include "filecopy.h" #include #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ //***************************************************************************** Synonym::Synonym(const HtConfiguration& config_arg) : Fuzzy(config_arg) { name = "synonyms"; db = 0; } //***************************************************************************** Synonym::~Synonym() { if (db) { db->Close(); delete db; db = 0; } } //***************************************************************************** int Synonym::createDB(const HtConfiguration &config) { String tmpdir = getenv("TMPDIR"); String dbFile; #if defined(LIBHTDIG) || defined(LIBHTDIGPHP) || defined(_MSC_VER) //WIN32 int ret = -1; char * source = NULL; char * dest = NULL; #endif if (tmpdir.length()) dbFile = tmpdir; else dbFile = "/tmp"; dbFile << "/synonyms.db"; char input[1000]; FILE *fl; const String sourceFile = config["synonym_dictionary"]; fl = fopen(sourceFile, "r"); if (fl == NULL) { cout << "htfuzzy/synonyms: unable to open " << sourceFile << endl; cout << "htfuzzy/synonyms: Use the 'synonym_dictionary' attribute\n"; cout << "htfuzzy/synonyms: to specify the file that contains the synonyms\n"; return NOTOK; } Database *db = Database::getDatabaseInstance(DB_HASH); if (db->OpenReadWrite(dbFile.get(), 0664) == NOTOK) { delete db; db = 0; return NOTOK; } String data; String word; int count = 0; while (fgets(input, sizeof(input), fl)) { StringList sl(input, " \t\r\n"); if (sl.Count() < 2) { // Avoid segfault caused by calling Database::Put() if (debug) // with negative length for data field { cout<<"htfuzzy/synonyms: Rejected line with less than 2 words: " << input << endl; cout.flush(); } continue; } for (int i = 0; i < sl.Count(); i++) { data = 0; for (int j = 0; j < sl.Count(); j++) { if (i != j) data << sl[j] << ' '; } word = sl[i]; word.lowercase(); data.lowercase(); db->Put(word, String(data.get(), data.length() - 1)); if (debug && (count % 10) == 0) { cout << "htfuzzy/synonyms: " << count << ' ' << word << "\n"; cout.flush(); } count++; } } fclose(fl); db->Close(); delete db; #if defined(LIBHTDIG) || defined(LIBHTDIGPHP) || defined(_MSC_VER) //WIN32 //Uses file_copy function - works on Unix/Linux & WinNT source = dbFile.get(); dest = (char *)config["synonym_db"].get(); //Attempt rename, if fail attempt copy & delete. ret = rename(source, dest); if (ret < 0) { ret = file_copy(source, dest, FILECOPY_OVERWRITE_ON); if (ret == TRUE) unlink(source); else return NOTOK; } if (debug) { cout << "htfuzzy/synonyms: " << count << ' ' << word << "\n"; cout << "htfuzzy/synonyms: Done.\n"; } #else //This code uses a system call - Phase this out struct stat stat_buf; String mv("mv"); // assume it's in the PATH if predefined setting fails if ((stat(MV, &stat_buf) != -1) && S_ISREG(stat_buf.st_mode)) mv = MV; system(form("%s %s %s", mv.get(), dbFile.get(), config["synonym_db"].get())); #endif return OK; } //***************************************************************************** int Synonym::openIndex() { const String dbFile = config["synonym_db"]; if (db) { db->Close(); delete db; db = 0; } db = Database::getDatabaseInstance(DB_HASH); if (db->OpenRead(dbFile) == NOTOK) { delete db; db = 0; return NOTOK; } return OK; } //***************************************************************************** void Synonym::getWords(char *originalWord, List &words) { String data; String stripped = originalWord; HtStripPunctuation(stripped); if (db && db->Get(stripped, data) == OK) { char *token = strtok(data.get(), " "); while (token) { words.Add(new String(token)); token = strtok(0, " "); } } } htdig-3.2.0b6/htfuzzy/Synonym.h0100644006314600127310000000166410055635550015746 0ustar angusgbhtdig// // Synonym.h // // Synonym: A fuzzy matching algorithm to create a database of related words // (or misspellings) that should be searched together. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Synonym.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // // #ifndef _Synonym_h_ #define _Synonym_h_ #include "Fuzzy.h" class List; class Synonym : public Fuzzy { public: // // Construction/Destruction // Synonym(const HtConfiguration& config_arg); ~Synonym(); // // Lookup routines // virtual void getWords(char *word, List &words); virtual int openIndex(); // // Creation // virtual int createDB(const HtConfiguration &config); protected: Database *db; }; #endif htdig-3.2.0b6/htfuzzy/htfuzzy.cc0100644006314600127310000001375610055635550016160 0ustar angusgbhtdig// // htfuzzy.cc // // htfuzzy: Create one or more ``fuzzy'' indexes into the main word database. // These indexes can be used by htsearch to perform a search that uses // other algorithms than exact word match. // // This program is meant to be run after htmerge has created the word // database. // // For each fuzzy algorithm, there will be a separate database. Each // database is simply a mapping from the fuzzy key to a list of words // in the main word database. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htfuzzy.cc,v 1.20 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htfuzzy.h" #include "Fuzzy.h" #include "Accents.h" #include "Soundex.h" #include "Endings.h" #include "Metaphone.h" #include "Synonym.h" #include "htString.h" #include "List.h" #include "Dictionary.h" #include "defaults.h" #include "HtWordList.h" #include "WordContext.h" // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif int debug = 0; void usage(); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int c, i; extern char *optarg; extern int optind; String configFile = DEFAULT_CONFIG_FILE; // // Parse command line arguments // while ((c = getopt(ac, av, "c:v")) != -1) { switch (c) { case 'c': configFile = optarg; break; case 'v': debug++; break; default: usage(); } } HtConfiguration* config= HtConfiguration::config(); // // Determine what algorithms to use // List wordAlgorithms; List noWordAlgorithms; for (i = optind; i < ac; i++) { if (mystrcasecmp(av[i], "soundex") == 0) { wordAlgorithms.Add(new Soundex(*config)); } else if (mystrcasecmp(av[i], "metaphone") == 0) { wordAlgorithms.Add(new Metaphone(*config)); } else if (mystrcasecmp(av[i], "accents") == 0) { wordAlgorithms.Add(new Accents(*config)); } else if (mystrcasecmp(av[i], "endings") == 0) { noWordAlgorithms.Add(new Endings(*config)); } else if (mystrcasecmp(av[i], "synonyms") == 0) { noWordAlgorithms.Add(new Synonym(*config)); } else { reportError(form("'%s' is not a supported algorithm", av[i])); } } if (wordAlgorithms.Count() == 0 && noWordAlgorithms.Count() == 0) { cout << "htfuzzy: No algorithms specified\n"; usage(); } // // Find and parse the configuration file. // config->Defaults(&defaults[0]); if (access((char*)configFile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configFile.get())); } config->Read(configFile); // Initialize htword library (key description + wordtype...) WordContext::Initialize(*config); Fuzzy *fuzzy; if (wordAlgorithms.Count() > 0) { // // Open the word database so that we can grab the words from it. // HtWordList worddb(*config); if (worddb.Open(config->Find("word_db"), O_RDONLY) == OK) { // // Go through all the words in the database // List *words = worddb.Words(); String *key; Fuzzy *fuzzy = 0; String word, fuzzyKey; int count = 0; words->Start_Get(); while ((key = (String *) words->Get_Next())) { word = *key; wordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) wordAlgorithms.Get_Next())) { fuzzy->addWord(word); } count++; if ((count % 100) == 0 && debug) { cout << "htfuzzy: words: " << count << '\n'; cout.flush(); } } if (debug) { cout << "htfuzzy: total words: " << count << "\n"; cout << "htfuzzy: Writing index files...\n"; } // // All the information is now in memory. // Write all of it out to the individual databases // wordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) wordAlgorithms.Get_Next())) { fuzzy->writeDB(); } worddb.Close(); words->Destroy(); delete words; if (fuzzy) delete fuzzy; } else { reportError(form("Unable to open word database %s", config->Find("word_db").get())); } } if (noWordAlgorithms.Count() > 0) { noWordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) noWordAlgorithms.Get_Next())) { if (debug) { cout << "htfuzzy: Selected algorithm: " << fuzzy->getName() << endl; } if (fuzzy->createDB(*config) == NOTOK) { cout << "htfuzzy: Could not create database for algorithm: " << fuzzy->getName() << endl; } } } if (debug) { cout << "htfuzzy: Done.\n"; } return 0; } //***************************************************************************** // void usage() // void usage() { cout << "usage: htfuzzy [-c configfile][-v] algorithm ...\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Supported algorithms:\n"; cout << "\tsoundex\n"; cout << "\tmetaphone\n"; cout << "\taccents\n"; cout << "\tendings\n"; cout << "\tsynonyms\n"; cout << "\n"; cout << "Options:\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead of the\n"; cout << "\t\tdefault.\n\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes.\n\n"; exit(0); } //***************************************************************************** // void reportError(char *msg) // void reportError(char *msg) { cout << "htfuzzy: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/htfuzzy/htfuzzy.h0100644006314600127310000000235710055635550016015 0ustar angusgbhtdig// // htfuzzy.h // // htfuzzy: Create one or more ``fuzzy'' indexes into the main word database. // These indexes can be used by htsearch to perform a search that uses // other algorithms than exact word match. // // This program is meant to be run after htmerge has created the word // database. // // For each fuzzy algorithm, there will be a separate database. Each // database is simply a mapping from the fuzzy key to a list of words // in the main word database. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htfuzzy.h,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifndef _htfuzzy_h_ #define _htfuzzy_h_ #include "htconfig.h" #include "HtConfiguration.h" #include "HtWordList.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include extern int debug; extern void reportError(char *msg); #endif htdig-3.2.0b6/htlib/0040755006314600127310000000000010063260370013465 5ustar angusgbhtdightdig-3.2.0b6/htlib/.sniffdir/0040755006314600127310000000000010063260370015347 5ustar angusgbhtdightdig-3.2.0b6/htlib/.cvsignore0100644006314600127310000000005506772705363015504 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htdig-3.2.0b6/htlib/Configuration.cc0100644006314600127310000002363610055635550016621 0ustar angusgbhtdig// // Configuration.cc // // Configuration: This class provides an object lookup table. Each object // in the Configuration is indexed with a string. The objects // can be returned by mentioning their string index. Values may // include files with `/path/to/file` or other configuration // variables with ${variable} // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Configuration.cc,v 1.20 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "Configuration.h" #include "htString.h" #include "ParsedString.h" #include #include #include //********************************************************************* // Configuration::Configuration() // Configuration::Configuration() : separators("=:"), allow_multiple(0) { } //********************************************************************* // void Configuration::NameValueSeparators(char *s) // void Configuration::NameValueSeparators(const String& s) { separators = s; } //********************************************************************* // Add an entry to the configuration table. // void Configuration::Add(const String& str_arg) { const char* str = str_arg; String name, value; while (str && *str) { while (isspace(*str)) str++; name = 0; if (!isalpha(*str)) break; // Some isalnum() implementations don't allow all the letters that // isalpha() does, e.g. accented ones. They're not POSIX.2 compliant // but we won't punish them with an infinite loop... if (!isalnum(*str)) break; while (isalnum(*str) || *str == '-' || *str == '_') name << *str++; name.lowercase(); // // We have the name. Let's see if we will get a value // while (isspace(*str)) str++; if (!*str) { // // End of string. We need to store the name as a boolean TRUE // Add(name, "true"); return; } if (!strchr((char*)separators, *str)) { // // We are now at a new name. The previous one needs to be set // to boolean TRUE // Add(name, "true"); continue; } // // We now need to deal with the value // str++; // Skip the separator while (isspace(*str)) str++; if (!*str) { // // End of string reached. The value must be blank // Add(name, ""); break; } value = 0; if (*str == '"') { // // Ah! A quoted value. This should be easy to deal with... // (Just kidding!) // str++; while (*str && *str != '"') { value << *str++; } Add(name, value); if (*str == '"') str++; continue; } else if (*str == '\'') { // A single quoted value. str++; while (*str && *str != '\'') { value << *str++; } Add(name, value); if (*str == '\'') str++; continue; } else { // // A non-quoted string. This string will terminate at the // next blank // while (*str && !isspace(*str)) { value << *str++; } Add(name, value); continue; } } } //********************************************************************* // Add an entry to the configuration table, without allowing variable // or file expansion of the value. // void Configuration::Add(const String& name, const String& value) { String escaped; const char *s = value.get(); while (*s) { if (strchr("$`\\", *s)) escaped << '\\'; escaped << *s++; } ParsedString *ps = new ParsedString(escaped); dcGlobalVars.Add(name, ps); } //********************************************************************* // Add an entry to the configuration table, allowing parsing for variable // or file expansion of the value. // void Configuration::AddParsed(const String& name, const String& value) { ParsedString *ps = new ParsedString(value); if (mystrcasecmp(name, "locale") == 0) { String str(setlocale(LC_ALL, ps->get(dcGlobalVars))); ps->set(str); // // Set time format to standard to avoid sending If-Modified-Since // http headers in native format which http servers can't // understand // setlocale(LC_TIME, "C"); } dcGlobalVars.Add(name, ps); } //********************************************************************* // Remove an entry from both the hash table and from the list of keys. // int Configuration::Remove(const String& name) { return dcGlobalVars.Remove(name); } //********************************************************************* // char *Configuration::Find(const char *name) const // Retrieve a variable from the configuration database. This variable // will be parsed and a new String object will be returned. // const String Configuration::Find(const String& name) const { ParsedString *ps = (ParsedString *) dcGlobalVars[name]; if (ps) { return ps->get(dcGlobalVars); } else { #ifdef DEBUG fprintf (stderr, "Could not find configuration option %s\n", (const char*)name); #endif return 0; } } //- // Return 1 if the value of configuration attribute name has // been set, 0 otherwise int Configuration::Exists(const String& name) const { return dcGlobalVars.Exists(name); } //********************************************************************* Object *Configuration::Get_Object(char *name) { return dcGlobalVars[name]; } //********************************************************************* // int Configuration::Value(const String& name, int default_value) const { return Find(name).as_integer(default_value); } //********************************************************************* // double Configuration::Double(const String& name, double default_value) const { return Find(name).as_double(default_value); } //********************************************************************* // int Configuration::Boolean(char *name, int default_value) // int Configuration::Boolean(const String& name, int default_value) const { int value = default_value; const String s = Find(name); if (s[0]) { if (s.nocase_compare("true") == 0 || s.nocase_compare("yes") == 0 || s.nocase_compare("1") == 0) value = 1; else if (s.nocase_compare("false") == 0 || s.nocase_compare("no") == 0 || s.nocase_compare("0") == 0) value = 0; } return value; } //********************************************************************* // const String Configuration::operator[](const String& name) const { return Find(name); } //********************************************************************* // int Configuration::Read(const String& filename) { FILE* in = fopen((const char*)filename, "r"); if(!in) { fprintf(stderr, "Configuration::Read: cannot open %s for reading : ", (const char*)filename); perror(""); return NOTOK; } #define CONFIG_BUFFER_SIZE (50*1024) // // Make the line buffer large so that we can read long lists of start // URLs. // char buffer[CONFIG_BUFFER_SIZE + 1]; char *current; String line; String name; char *value; int len; while (fgets(buffer, CONFIG_BUFFER_SIZE, in)) { line << buffer; line.chop("\r\n"); if (line.last() == '\\') { line.chop(1); continue; // Append the next line to this one } current = line.get(); if (*current == '#' || *current == '\0') { line = 0; continue; // Comments and blank lines are skipped } name = strtok(current, ": =\t"); value = strtok(0, "\r\n"); if (!value) value = ""; // Blank value // // Skip any whitespace before the actual text // while (*value == ' ' || *value == '\t') value++; len = strlen(value) - 1; // // Skip any whitespace after the actual text // while (len >= 0 && (value[len] == ' ' || value[len] == '\t')) { value[len] = '\0'; len--; } if (mystrcasecmp((char*)name, "include") == 0) { ParsedString ps(value); String str(ps.get(dcGlobalVars)); if (str[0] != '/') // Given file name not fully qualified { str = filename; // so strip dir. name from current one len = str.lastIndexOf('/') + 1; if (len > 0) str.chop(str.length() - len); else str = ""; // No slash in current filename str << ps.get(dcGlobalVars); } Read(str); line = 0; continue; } AddParsed(name, value); line = 0; } fclose(in); return OK; } //********************************************************************* // void Configuration::Defaults(ConfigDefaults *array) // void Configuration::Defaults(const ConfigDefaults *array) { for (int i = 0; array[i].name; i++) { AddParsed(array[i].name, array[i].value); } } htdig-3.2.0b6/htlib/Configuration.h0100644006314600127310000001605010055635550016453 0ustar angusgbhtdig// // Configuration.h // // NAME // // reads the configuration file and manages it in memory. // // SYNOPSIS // // #include // // Configuration config; // // ConfigDefault config_defaults = { // { "verbose", "true" }, // { 0, 0 } // }; // // config.Defaults(config_defaults); // // config.Read("~/.myconfig") ; // // config.Add("sync", "false"); // // if(config["sync"]) ... // if(config.Value("rate") < 50) ... // if(config.Boolean("sync")) ... // // DESCRIPTION // // The primary purpose of the Configuration class is to parse // a configuration file and allow the application to modify the internal // data structure. All values are strings and are converted by the // appropriate accessors. For instance the Boolean method will // return numerical true (not zero) if the string either contains // a number that is different from zero or the string true. // // The ConfigDefaults type is a structure of two char pointers: // the name of the configuration attribute and it's value. The end of // the array is the first entry that contains a null pointer instead of // the attribute name. Numerical // values must be in strings. For instance: //
    // ConfigDefault* config_defaults = {
    //   { "wordlist_compress", "true" },
    //   { "wordlist_page_size", "8192" },
    //   { 0, 0 }
    // };
    // 
    // Returns the configuration (object of type Configuration) // built if a file was found or config_defaults // provided, 0 otherwise. // The additional // fields of the ConfigDefault are purely informative. // // FILE FORMAT // // This configuration file is a plain ASCII text file. Each line in // the file is either a comment or contains an attribute. // Comment lines are blank lines or lines that start with a '#'. // Attributes consist of a variable name and an associated // value: // //
    // <name>:<whitespace><value><newline>
    // 
    // // The <name> contains any alphanumeric character or // underline (_) The <value> can include any character // except newline. It also cannot start with spaces or tabs since // those are considered part of the whitespace after the colon. It // is important to keep in mind that any trailing spaces or tabs // will be included. // // It is possible to split the <value> across several // lines of the configuration file by ending each line with a // backslash (\). The effect on the value is that a space is // added where the line split occurs. // // A configuration file can include another file, by using the special // <name>, include. The <value> is taken as // the file name of another configuration file to be read in at // this point. If the given file name is not fully qualified, it is // taken relative to the directory in which the current configuration // file is found. Variable expansion is permitted in the file name. // Multiple include statements, and nested includes are also permitted. // //
    // include: common.conf
    // 
    // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Configuration.h,v 1.11 2004/05/28 13:15:20 lha Exp $ // #ifndef _Configuration_h_ #define _Configuration_h_ #include "Dictionary.h" #include "htString.h" struct ConfigDefaults { char *name; // Name of the attribute char *value; // Default value char *type; // Type of the value (string, integer, boolean) char *programs; // Whitespace separated list of programs/modules using this attribute char *block; // Configuration block this can be used in (can be blank) char *version; // Version that introduced the attribute char *category; // Attribute category (to split documentation) char *example; // Example usage of the attribute (HTML) char *description; // Long description of the attribute (HTML) }; class Configuration : public Object { public: //- // Constructor // Configuration(); #ifndef SWIG Configuration(const Configuration& config) : dcGlobalVars(config.dcGlobalVars), separators(config.separators) { allow_multiple = config.allow_multiple; } #endif /* SWIG */ //- // Destructor // ~Configuration() {} // // Adding and deleting items to and from the Configuration // #ifndef SWIG //- // Add configuration item str to the configuration. The value // associated with it is undefined. // void Add(const String& str); #endif /* SWIG */ //- // Add configuration item name to the configuration and associate // it with value. // void Add(const String& name, const String& value); void AddParsed(const String& name, const String& value); //- // Remove the name from the configuration. // int Remove(const String& name); //- // Let the Configuration know how to parse name value pairs. // Each character of string s is a valid separator between // the name and the value. // void NameValueSeparators(const String& s); //- // Read name/value configuration pairs from the file filename. // virtual int Read(const String& filename); //- // Return the value of configuration attribute name as a // String. // const String Find(const String& name) const; //- // Return 1 if the value of configuration attribute name has // been set, 0 otherwise int Exists(const String& name) const; #ifndef SWIG //- // Alias to the Find method. // const String operator[](const String& name) const; #endif /* SWIG */ //- // Return the value associated with the configuration attribute // name, converted to integer using the atoi(3) function. // If the attribute is not found in the configuration and // a default_value is provided, return it. // int Value(const String& name, int default_value = 0) const; //- // Return the value associated with the configuration attribute // name, converted to double using the atof(3) function. // If the attribute is not found in the configuration and // a default_value is provided, return it. // double Double(const String& name, double default_value = 0) const; //- // Return 1 if the value associated to name is // either 1, yes or true. // Return 0 if the value associated to name is // either 0, no or false. // int Boolean(const String& name, int default_value = 0) const; Object *Get_Object(char *name); //- // Load configuration attributes from the name and value // members of the array argument. // void Defaults(const ConfigDefaults *array); protected: Dictionary dcGlobalVars; String separators; int allow_multiple; }; #endif htdig-3.2.0b6/htlib/DB2_db.cc0100644006314600127310000002041510055635550015016 0ustar angusgbhtdig// // DB2_db.cc // // DB2_db: Implements the Berkeley B-Tree database as a Database object // (including duplicate values to allow duplicate word entries) // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: DB2_db.cc,v 1.26 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #ifndef _MSC_VER /* _WIN32 */ #include #endif #include "DB2_db.h" #include "HtConfiguration.h" // Default cache size in kilobytes. // Maybe this should be an config option, just for easy testing and // determination for best system performance // NOTE: page size is 1KB - do not change!! #define CACHE_SIZE_IN_KB 64 //***************************************************************************** // DB2_db::DB2_db() // DB2_db::DB2_db() { isOpen = 0; _compare = 0; _prefix = 0; } //***************************************************************************** // DB2_db::~DB2_db() // DB2_db::~DB2_db() { Close(); } //***************************************************************************** // int DB2_db::Open(const char *filename, int flags, int mode) { // // Initialize the database environment. // if((dbenv = db_init((char *)NULL)) == 0) return NOTOK; if(CDB_db_create(&dbp, dbenv, 0) != 0) return NOTOK; if(_compare) dbp->set_bt_compare(dbp, _compare); if(_prefix) dbp->set_bt_prefix(dbp, _prefix); // // Open the database. // if((errno = dbp->open(dbp, filename, NULL, db_type, flags, mode)) == 0) { // // Acquire a cursor for the database. // if ((seqrc = dbp->cursor(dbp, NULL, &dbcp, 0)) != 0) { seqerr = seqrc; Close(); return NOTOK; } isOpen = 1; return OK; } else { return NOTOK; } } //***************************************************************************** // int DB2_db::Close() // int DB2_db::Close() { if(isOpen) { // // Close cursor, database and clean up environment // (void)(dbcp->c_close)(dbcp); (void)(dbp->close)(dbp, 0); (void)(dbenv->close(dbenv, 0)); dbenv = 0; } isOpen = 0; return OK; } //***************************************************************************** // char *DB2_db::Get_Next(String &item, String &key) // char * DB2_db::Get_Next(String &item, String &key) { if (isOpen && !seqrc) { // // Return values // key = skey; lkey = skey; item = data; // // Search for the next record // DBT local_key; DBT local_data; memset(&local_key, 0, sizeof(DBT)); memset(&local_data, 0, sizeof(DBT)); local_key.data = skey.get(); local_key.size = skey.length(); seqrc = dbcp->c_get(dbcp, &local_key, &local_data, DB_NEXT); seqerr = seqrc; if(!seqrc) { data = 0; data.append((char*)local_data.data, (int)local_data.size); skey = 0; skey.append((char*)local_key.data, (int)local_key.size); } return lkey.get(); } else return 0; } //***************************************************************************** // void DB2_db::Start_Seq() // void DB2_db::Start_Seq(const String& key) { DBT local_key; DBT local_data; memset(&local_key, 0, sizeof(DBT)); memset(&local_data, 0, sizeof(DBT)); skey = key; local_key.data = skey.get(); local_key.size = skey.length(); if (isOpen && dbp) { // // Okay, get the first key. Use DB_SET_RANGE for finding partial // keys also. If you set it to DB_SET, and the words book, books // and bookstore do exists, it will find them if you specify // book*. However if you specify boo* if will not find // anything. Setting to DB_SET_RANGE will still find the `first' // word after boo* (which is book). // seqrc = dbcp->c_get(dbcp, &local_key, &local_data, DB_SET_RANGE); seqerr = seqrc; if(!seqrc) { data = 0; data.append((char*)local_data.data, (int)local_data.size); skey = 0; skey.append((char*)local_key.data, (int)local_key.size); } } } //***************************************************************************** // void DB2_db::Start_Get() // void DB2_db::Start_Get() { DBT local_key; DBT local_data; memset(&local_key, 0, sizeof(DBT)); memset(&local_data, 0, sizeof(DBT)); if (isOpen && dbp) { // // Okay, get the first key. Use DB_SET_RANGE for finding partial // keys also. If you set it to DB_SET, and the words book, books // and bookstore do exists, it will find them if you specify // book*. However if you specify boo* if will not find // anything. Setting to DB_SET_RANGE will still find the `first' // word after boo* (which is book). // seqrc = dbcp->c_get(dbcp, &local_key, &local_data, DB_FIRST); seqerr = seqrc; if(!seqrc) { data = 0; data.append((char*)local_data.data, (int)local_data.size); skey = 0; skey.append((char*)local_key.data, (int)local_key.size); } } } //***************************************************************************** // int DB2_db::Put(const String &key, const String &data) // int DB2_db::Put(const String &key, const String &data) { DBT k, d; memset(&k, 0, sizeof(DBT)); memset(&d, 0, sizeof(DBT)); if (!isOpen) return NOTOK; k.data = (char*)key.get(); k.size = key.length(); d.data = (char*)data.get(); d.size = data.length(); // // A 0 in the flags in put means replace, if you didn't specify DB_DUP // somewhere else... // return (dbp->put)(dbp, NULL, &k, &d, 0) == 0 ? OK : NOTOK; } //***************************************************************************** // int DB2_db::Get(const String &key, String &data) // int DB2_db::Get(const String &key, String &data) { DBT k, d; memset(&k, 0, sizeof(DBT)); memset(&d, 0, sizeof(DBT)); // // k arg of get should be const but is not. Harmless cast. // k.data = (char*)key.get(); k.size = key.length(); int rc = dbp->get(dbp, NULL, &k, &d, 0); if (rc) return NOTOK; data = 0; data.append((char *)d.data, d.size); return OK; } //***************************************************************************** // int DB2_db::Exists(const String &key) // int DB2_db::Exists(const String &key) { String data; if (!isOpen) return 0; return Get(key, data); } //***************************************************************************** // int DB2_db::Delete(const String &key) // int DB2_db::Delete(const String &key) { DBT k; memset(&k, 0, sizeof(DBT)); if (!isOpen) return 0; k.data = (char*)key.get(); k.size = key.length(); return (dbp->del)(dbp, NULL, &k, 0); } //***************************************************************************** // DB2_db *DB2_db::getDatabaseInstance() // DB2_db * DB2_db::getDatabaseInstance(DBTYPE) { return new DB2_db(); } //***************************************************************************** // void Error(const char *error_prefix, char *message); // void Error(const char *error_prefix, char *message) { // We don't do anything here, it's mostly a stub so we can set a breakpoint // for debugging purposes fprintf(stderr, "%s: %s\n", error_prefix, message); } //****************************************************************************** /* * db_init -- * Initialize the environment. Only returns a pointer */ DB_ENV * DB2_db::db_init(char *home) { DB_ENV *dbenv; char *progname = "DB2 problem..."; int error; if((error = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "DB2_db: CDB_db_env_create %s\n", CDB_db_strerror(error)); return 0; } dbenv->set_errpfx(dbenv, progname); dbenv->set_errcall(dbenv, &Error); if((error = dbenv->open(dbenv, (const char*)home, NULL, DB_CREATE | DB_PRIVATE | DB_INIT_LOCK | DB_INIT_MPOOL, 0666)) != 0) { dbenv->err(dbenv, error, "open %s", (home ? home : "")); return 0; } return (dbenv); } htdig-3.2.0b6/htlib/DB2_db.h0100644006314600127310000000264710055635550014667 0ustar angusgbhtdig// // DB2_db.h // // DB2_db: Implements the Berkeley B-Tree database as a Database object // (including duplicate values to allow duplicate word entries) // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: DB2_db.h,v 1.11 2004/05/28 13:15:20 lha Exp $ // #ifndef _DB2_db_h_ #define _DB2_db_h_ #include "Database.h" #include #include class DB2_db : public Database { // // Construction/Destruction // protected: DB2_db(); public: ~DB2_db(); static DB2_db *getDatabaseInstance(DBTYPE type); virtual int OpenReadWrite(const char *filename, int mode) { return Open(filename, DB_CREATE, mode); } virtual int OpenRead(const char *filename) { return Open(filename, DB_RDONLY, 0666); } virtual int Close(); virtual int Get(const String &, String &); virtual int Put(const String &, const String &); virtual int Exists(const String &); virtual int Delete(const String &); virtual void Start_Get(); virtual char *Get_Next(String &item, String &key); virtual void Start_Seq(const String& key); private: DB_ENV *db_init(char *); int Open(const char *filename, int flags, int mode); }; #endif htdig-3.2.0b6/htlib/Database.cc0100644006314600127310000000216410055635550015507 0ustar angusgbhtdig// // Database.cc // // Database: Class which defines the interface to a generic, // simple database. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Database.cc,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Database.h" #include "DB2_db.h" //***************************************************************************** // Database::Database() // Database::Database() { } //***************************************************************************** // Database::~Database() // Database::~Database() { } //***************************************************************************** // Database *Database::getDatabaseInstance() // Database * Database::getDatabaseInstance(DBTYPE type = DB_BTREE) { Database* db = DB2_db::getDatabaseInstance(type); db->db_type = type; return db; } htdig-3.2.0b6/htlib/Database.h0100644006314600127310000000530310055635550015347 0ustar angusgbhtdig// // Database.h // // Database: Class which defines the interface to a generic, // simple database. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Database.h,v 1.15 2004/05/28 13:15:20 lha Exp $ // #ifndef _Database_h_ #define _Database_h_ #include "Object.h" #include "htString.h" #include // Database Types // defined in db.h // #define DB_BTREE 1 // #define DB_HASH 2 #ifndef GDBM_HASH #define GDBM_HASH 2 #endif class Database : public Object { // // Make sure no one can actually create an object of this type or // the derived types. The static getDatabaseInstance() method needs to be // used. // protected: Database(); public: ~Database(); // // Since the contructor is protected, the only way to actually get // a Database object is through the following class method. // The idea here is that the particular type of database used by // all the programs is to be defined in one place. // static Database *getDatabaseInstance(DBTYPE type); // // Common interface // virtual int OpenReadWrite(const char *filename, int mode = 0666) = 0; virtual int OpenRead(const char *filename) = 0; void SetCompare(int (*func)(const DBT *a, const DBT *b)) { _compare = func; } void SetPrefix(size_t (*func)(const DBT *a, const DBT *b)) { _prefix = func; } virtual int Close() = 0; virtual int Put(const String &key, const String &data) = 0; virtual int Get(const String &key, String &data) = 0; virtual int Exists(const String &key) = 0; virtual int Delete(const String &key) = 0; virtual void Start_Get() = 0; virtual char *Get_Next() { String item; String key; return Get_Next(item, key); } virtual char *Get_Next(String &item) { String key; return Get_Next(item, key); } virtual char *Get_Next(String &item, String &key) = 0; virtual void Start_Seq(const String& str) = 0; virtual char *Get_Next_Seq() { return Get_Next(); } protected: int isOpen; DB *dbp; // database DBC *dbcp; // cursor String skey; // Next key to search for iterator String data; // Next data to return for iterator String lkey; // Contains the last key returned by iterator DB_ENV *dbenv; // database enviroment int (*_compare)(const DBT *a, const DBT *b); // Key comparison size_t (*_prefix)(const DBT *a, const DBT *b); // Key reduction int seqrc; int seqerr; DBTYPE db_type; }; #endif htdig-3.2.0b6/htlib/Dictionary.cc0100644006314600127310000002060210055635550016105 0ustar angusgbhtdig// // Dictionary.cc // // Dictionary: This class provides an object lookup table. // Each object in the dictionary is indexed with a string. // The objects can be returned by mentioning their // string index. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Dictionary.cc,v 1.16 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Dictionary.h" #include class DictionaryEntry { public: unsigned int hash; char *key; Object *value; DictionaryEntry *next; ~DictionaryEntry(); void release(); }; DictionaryEntry::~DictionaryEntry() { free(key); delete value; } void DictionaryEntry::release() { value = NULL; // Prevent the value from being deleted } //********************************************************************* // Dictionary::Dictionary() { init(101, 10.0f); } Dictionary::Dictionary(int initialCapacity, float loadFactor) { init(initialCapacity, loadFactor); } Dictionary::Dictionary(int initialCapacity) { init(initialCapacity, 0.75f); } Dictionary::Dictionary(const Dictionary& other) { init(other.initialCapacity, other.loadFactor); DictionaryCursor cursor; const char* key; for(other.Start_Get(cursor); (key = other.Get_Next(cursor));) { Add(key, other[key]); } } //********************************************************************* // Dictionary::~Dictionary() { Destroy(); delete [] table; } //********************************************************************* // void Dictionary::Destroy() { DictionaryEntry *t, *n; for (int i = 0; i < tableLength; i++) { if (table[i] != NULL) { t = table[i]; do { // clear out hash chain n = t->next; delete t; t = n; } while (n); table[i] = NULL; } } count = 0; } //********************************************************************* // void Dictionary::Release() { DictionaryEntry *t, *n; for (int i = 0; i < tableLength; i++) { if (table[i] != NULL) { t = table[i]; do { // clear out hash chain n = t->next; t->release(); delete t; t = n; } while (n); table[i] = NULL; } } count = 0; } //********************************************************************* // void Dictionary::init(int initialCapacity, float loadFactor) { if (initialCapacity <= 0) initialCapacity = 101; if (loadFactor <= 0.0) loadFactor = 0.75f; Dictionary::loadFactor = loadFactor; table = new DictionaryEntry*[initialCapacity]; for (int i = 0; i < initialCapacity; i++) { table[i] = NULL; } threshold = (int)(initialCapacity * loadFactor); tableLength = initialCapacity; count = 0; } //********************************************************************* // unsigned int Dictionary::hashCode(const char *key) const { char *test; long conv_key = strtol(key, &test, 10); if (key && *key && !*test) // Conversion succeeded return conv_key; char *base = (char*)malloc(strlen(key) + 2); char *tmp_key = base; strcpy(tmp_key, key); unsigned int h = 0; int length = strlen(tmp_key); if (length >= 16) { tmp_key += strlen(tmp_key) - 15; length = strlen(tmp_key); } for (int i = length; i > 0; i--) { h = (h*37) + *tmp_key++; } free(base); return h; } //********************************************************************* // Add an entry to the hash table. This will replace the // data associated with an already existing key. // void Dictionary::Add(const String& name, Object *obj) { unsigned int hash = hashCode(name); int index = hash % tableLength; DictionaryEntry *e; for (e = table[index]; e != NULL; e = e->next) { if (e->hash == hash && strcmp(e->key, name) == 0) { delete e->value; e->value = obj; return; } } if (count >= threshold) { rehash(); Add(name, obj); return; } e = new DictionaryEntry(); e->hash = hash; e->key = strdup(name); e->value = obj; e->next = table[index]; table[index] = e; count++; } //********************************************************************* // Remove an entry from the hash table. // int Dictionary::Remove(const String& name) { if (!count) return 0; unsigned int hash = hashCode(name); int index = hash % tableLength; DictionaryEntry *e, *prev; for (e = table[index], prev = NULL; e != NULL; prev = e, e = e->next) { if (hash == e->hash && strcmp(e->key, name) == 0) { if (prev != NULL) { prev->next = e->next; } else { table[index] = e->next; } count--; delete e; return 1; } } return 0; } //********************************************************************* // Object *Dictionary::Find(const String& name) const { if (!count) return NULL; unsigned int hash = hashCode(name); int index = hash % tableLength; DictionaryEntry *e; for (e = table[index]; e != NULL; e = e->next) { if (e->hash == hash && strcmp(e->key, name) == 0) { return e->value; } } return NULL; } //********************************************************************* // Object *Dictionary::operator[](const String& name) const { return Find(name); } //********************************************************************* // int Dictionary::Exists(const String& name) const { if (!count) return 0; unsigned int hash = hashCode(name); int index = hash % tableLength; DictionaryEntry *e; for (e = table[index]; e != NULL; e = e->next) { if (e->hash == hash && strcmp(e->key, name) == 0) { return 1; } } return 0; } //********************************************************************* // void Dictionary::rehash() { DictionaryEntry **oldTable = table; int oldCapacity = tableLength; int newCapacity; DictionaryEntry *e; int i, index; newCapacity = count > oldCapacity ? count * 2 + 1 : oldCapacity * 2 + 1; DictionaryEntry **newTable = new DictionaryEntry*[newCapacity]; for (i = 0; i < newCapacity; i++) { newTable[i] = NULL; } threshold = (int) (newCapacity * loadFactor); table = newTable; tableLength = newCapacity; for (i = oldCapacity; i-- > 0;) { for (DictionaryEntry *old = oldTable[i]; old != NULL;) { e = old; old = old->next; index = e->hash % newCapacity; e->next = newTable[index]; newTable[index] = e; } } delete [] oldTable; } //********************************************************************* // void Dictionary::Start_Get(DictionaryCursor& cursor) const { cursor.currentTableIndex = -1; cursor.currentDictionaryEntry = NULL; } //********************************************************************* // char * Dictionary::Get_Next(DictionaryCursor& cursor) const { while (cursor.currentDictionaryEntry == NULL || cursor.currentDictionaryEntry->next == NULL) { cursor.currentTableIndex++; if (cursor.currentTableIndex >= tableLength) { cursor.currentTableIndex--; return NULL; } cursor.currentDictionaryEntry = table[cursor.currentTableIndex]; if (cursor.currentDictionaryEntry != NULL) { return cursor.currentDictionaryEntry->key; } } cursor.currentDictionaryEntry = cursor.currentDictionaryEntry->next; return cursor.currentDictionaryEntry->key; } //********************************************************************* // Object * Dictionary::Get_NextElement(DictionaryCursor& cursor) const { while (cursor.currentDictionaryEntry == NULL || cursor.currentDictionaryEntry->next == NULL) { cursor.currentTableIndex++; if (cursor.currentTableIndex >= tableLength) { cursor.currentTableIndex--; return NULL; } cursor.currentDictionaryEntry = table[cursor.currentTableIndex]; if (cursor.currentDictionaryEntry != NULL) { return cursor.currentDictionaryEntry->value; } } cursor.currentDictionaryEntry = cursor.currentDictionaryEntry->next; return cursor.currentDictionaryEntry->value; } htdig-3.2.0b6/htlib/Dictionary.h0100644006314600127310000000504210055635550015750 0ustar angusgbhtdig// // Dictionary.h // // Dictionary: This class provides an object lookup table. // Each object in the dictionary is indexed with a string. // The objects can be returned by mentioning their // string index. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Dictionary.h,v 1.10 2004/05/28 13:15:20 lha Exp $ // #ifndef _Dictionary_h_ #define _Dictionary_h_ #include "Object.h" #include "htString.h" #include "List.h" class Dictionary; class DictionaryEntry; class DictionaryCursor { public: // // Support for the Start_Get and Get_Next routines // int currentTableIndex; DictionaryEntry *currentDictionaryEntry; }; class Dictionary : public Object { public: // // Construction/Destruction // Dictionary(); Dictionary(const Dictionary& other); Dictionary(int initialCapacity); Dictionary(int initialCapacity, float loadFactor); ~Dictionary(); // // Adding and deleting items to and from the dictionary // void Add(const String& name, Object *obj); int Remove(const String& name); // // Searching can be done with the Find() member of the array indexing // operator // Object *Find(const String& name) const; Object *operator[](const String& name) const; int Exists(const String& name) const; // // We want to be able to go through all the entries in the // dictionary in sequence. To do this, we have the same // traversal interface as the List class // void Start_Get() { Start_Get(cursor); } void Start_Get(DictionaryCursor& cursor) const; // // Get the next key // char *Get_Next() { return Get_Next(cursor); } char *Get_Next(DictionaryCursor& cursor) const; // // Get the next entry // Object *Get_NextElement() { return Get_NextElement(cursor); } Object *Get_NextElement(DictionaryCursor& cursor) const; void Release(); void Destroy(); int Count() const { return count; } private: DictionaryEntry **table; int tableLength; int initialCapacity; int count; int threshold; float loadFactor; DictionaryCursor cursor; void rehash(); void init(int, float); unsigned int hashCode(const char *key) const; }; #endif htdig-3.2.0b6/htlib/HtCodec.cc0100644006314600127310000000132010055635550015305 0ustar angusgbhtdig// // HtCodec.cc // // HtCodec: Provide a generic means to take a String, code // it, and return the encoded string. And vice versa. // // Keep constructor and destructor in a file of its own. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCodec.cc,v 1.6 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtCodec.h" HtCodec::HtCodec() { } HtCodec::~HtCodec() { } // End of HtCodec.cc htdig-3.2.0b6/htlib/HtCodec.h0100644006314600127310000000172610055635550015161 0ustar angusgbhtdig// // HtCodec.h // // HtCodec: Provide a generic means to take a String, code // it, and return the encoded string. And vice versa. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCodec.h,v 1.6 2004/05/28 13:15:20 lha Exp $ // #ifndef __HtCodec_h #define __HtCodec_h #include "htString.h" class HtCodec : public Object { public: HtCodec(); virtual ~HtCodec(); // Code what's in this string. virtual String encode(const String &) const = 0; // Decode what's in this string. virtual String decode(const String &) const = 0; private: HtCodec(const HtCodec &); // Not supposed to be implemented. void operator= (const HtCodec &); // Not supposed to be implemented. }; #endif /* __HtCodec_h */ htdig-3.2.0b6/htlib/HtDateTime.cc0100644006314600127310000006675110055635550016007 0ustar angusgbhtdig// // HtDateTime.cc // // HtDateTime: Parse, split, compare and format dates and times. // Uses locale. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtDateTime.cc,v 1.20 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtDateTime.h" #include #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #ifndef HAVE_STRPTIME // mystrptime() declared in lib.h, defined in htlib/strptime.cc #define strptime(s,f,t) mystrptime(s,f,t) #else /* HAVE_STRPTIME */ #ifndef HAVE_STRPTIME_DECL extern "C" { extern char *strptime(const char *__s, const char *__fmt, struct tm *__tp); } #endif /* HAVE_STRPTIME_DECL */ #endif /* HAVE_STRPTIME */ /////// // Static local variable : Visible only here !!! /////// #define MAXSTRTIME 256 // Max length of my_strtime static struct tm Ht_tm; static char my_strtime[MAXSTRTIME]; /////// // Recognized Date Formats /////// // RFC1123: Sun, 06 Nov 1994 08:49:37 GMT #define RFC1123_FORMAT "%a, %d %b %Y %H:%M:%S %Z" #define LOOSE_RFC1123_FORMAT "%d %b %Y %H:%M:%S" // RFC850 : Sunday, 06-Nov-94 08:49:37 GMT #define RFC850_FORMAT "%A, %d-%b-%y %H:%M:%S %Z" #define LOOSE_RFC850_FORMAT "%d-%b-%y %H:%M:%S" // ANSI C's asctime() format : Sun Nov 6 08:49:37 1994 #define ASCTIME_FORMAT "%a %b %e %H:%M:%S %Y" #define LOOSE_ASCTIME_FORMAT "%b %e %H:%M:%S %Y" // ISO8601 : 1994-11-06 08:49:37 GMT #define ISO8601_FORMAT "%Y-%m-%d %H:%M:%S %Z" // ISO8601 (short version): 1994-11-06 #define ISO8601_SHORT_FORMAT "%Y-%m-%d" // Timestamp : 19941106084937 #define TIMESTAMP_FORMAT "%Y%m%d%H%M%S" /////// // Initialization /////// const int HtDateTime::days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; /////// // Input Formats // /////// /////// // Generalized date/time parser for "LOOSE" formats // - converts LOOSE RFC850 or RFC1123 date string into a time value // - converts SHORT ISO8601 date string into a time value // - autodetects which of these formats is used // - assumes midnight if time portion omitted // We've had problems using strptime() and timegm() on a few platforms // while parsing these formats, so this is an attempt to sidestep them. // // Returns 0 if parsing failed, or returns number of characters parsed // in date string otherwise, and sets Ht_t field to time_t value. /////// #define EPOCH 1970 int HtDateTime::Parse(const char *date) { register const char *s; register const char *t; int day, month, year, hour, minute, second; // // Three possible time designations: // Tuesday, 01-Jul-97 16:48:02 GMT (RFC850) // or // Thu, 01 May 1997 00:40:42 GMT (RFC1123) // or // 1997-05-01 00:40:42 GMT (ISO8601) // // We strip off the weekday because we don't need it, and // because some servers send invalid weekdays! // (Some don't even send a weekday, but we'll be flexible...) s = date; while (*s && *s != ',') s++; if (*s) s++; else s = date; while (isspace(*s)) s++; // check for ISO8601 format month = 0; t = s; while (isdigit(*t)) t++; if (t > s && *t == '-' && isdigit(t[1])) day = -1; else { // not ISO8601, so try RFC850 or RFC1123 // get day... if (!isdigit(*s)) return 0; day = 0; while (isdigit(*s)) day = day * 10 + (*s++ - '0'); if (day > 31) return 0; while (*s == '-' || isspace(*s)) s++; // get month... // (it's ugly, but it works) switch (*s++) { case 'J': case 'j': switch (*s++) { case 'A': case 'a': month = 1; s++; break; case 'U': case 'u': switch (*s++) { case 'N': case 'n': month = 6; break; case 'L': case 'l': month = 7; break; default: return 0; } break; default: return 0; } break; case 'F': case 'f': month = 2; s += 2; break; case 'M': case 'm': switch (*s++) { case 'A': case 'a': switch (*s++) { case 'R': case 'r': month = 3; break; case 'Y': case 'y': month = 5; break; default: return 0; } break; default: return 0; } break; case 'A': case 'a': switch (*s++) { case 'P': case 'p': month = 4; s++; break; case 'U': case 'u': month = 8; s++; break; default: return 0; } break; case 'S': case 's': month = 9; s += 2; break; case 'O': case 'o': month = 10; s += 2; break; case 'N': case 'n': month = 11; s += 2; break; case 'D': case 'd': month = 12; s += 2; break; default: return 0; } while (*s == '-' || isspace(*s)) s++; } // get year... if (!isdigit(*s)) return 0; year = 0; while (isdigit(*s)) year = year * 10 + (*s++ - '0'); if (year < 69) year += 2000; else if (year < 1900) year += 1900; else if (year >= 19100) // seen some programs do it, why not check? year -= (19100-2000); while (*s == '-' || isspace(*s)) s++; if (day < 0) { // still don't have day, so it's ISO8601 format // get month... if (!isdigit(*s)) return 0; month = 0; while (isdigit(*s)) month = month * 10 + (*s++ - '0'); if (month < 1 || month > 12) return 0; while (*s == '-' || isspace(*s)) s++; // get day... if (!isdigit(*s)) return 0; day = 0; while (isdigit(*s)) day = day * 10 + (*s++ - '0'); if (day < 1 || day > 31) return 0; while (*s == '-' || isspace(*s)) s++; } // optionally get hour... hour = 0; while (isdigit(*s)) hour = hour * 10 + (*s++ - '0'); if (hour > 23) return 0; while (*s == ':' || isspace(*s)) s++; // optionally get minute... minute = 0; while (isdigit(*s)) minute = minute * 10 + (*s++ - '0'); if (minute > 59) return 0; while (*s == ':' || isspace(*s)) s++; // optionally get second... second = 0; while (isdigit(*s)) second = second * 10 + (*s++ - '0'); if (second > 59) return 0; while (*s == ':' || isspace(*s)) s++; // Assign the new value to time_t field // // Calculate date as seconds since 01 Jan 1970 00:00:00 GMT // This is based somewhat on the date calculation code in NetBSD's // cd9660_node.c code, for which I was unable to find a reference. // It works, though! // Ht_t = (time_t) (((((367L*year - 7L*(year+(month+9)/12)/4 - 3L*(((year)+((month)+9)/12-1)/100+1)/4 + 275L*(month)/9 + day) - (367L*EPOCH - 7L*(EPOCH+(1+9)/12)/4 - 3L*((EPOCH+(1+9)/12-1)/100+1)/4 + 275L*1/9 + 1)) * 24 + hour) * 60 + minute) * 60 + second); // cerr << "Date string '" << date << "' converted to time_t " // << (int)Ht_t << ", used " << (s-date) << " characters\n"; return s-date; } /////// // Personalized format such as C strftime function // Overloaded version 1 // It ignores, for now, Time Zone values /////// char *HtDateTime::SetFTime(const char *buf, const char *format) { register char *p; register int r; ToGMTime(); // This must be set cos strptime always stores in GM p = (char *) buf; if (*format == '%') // skip any unexpected white space while (isspace(*p)) p++; // Special handling for LOOSE/SHORT formats... if ((strcmp((char *) format, LOOSE_RFC850_FORMAT) == 0 || strcmp((char *) format, LOOSE_RFC1123_FORMAT) == 0 || strcmp((char *) format, ISO8601_SHORT_FORMAT) == 0) && (r = Parse(p)) > 0) return p+r; p = (char *) strptime (p, (char *) format, & Ht_tm); #ifdef TEST_HTDATETIME // ViewStructTM(& Ht_tm); #endif // Assign the new value to time_t value SetDateTime(Ht_tm); return p; } /////// // C asctime() standard format /////// void HtDateTime::SetAscTime(char *s) { // Unfortunately, I cannot think of an easy test to // see if we have a weekday *FIX* SetFTime(s, ASCTIME_FORMAT); } /////// // RFC1123 standard Date format // Sun, 06 Nov 1994 08:49:37 GMT /////// void HtDateTime::SetRFC1123(char *s) { // abbreviated weekday name; // day of the month; // abbreviated month name; // year as ccyy; // hour ( 00 - 23); // minute ( 00 - 59); // seconds ( 00 - 59); // time zone name; // First, if we have it, strip off the weekday char *stripped; stripped = strchr(s, ','); if (stripped) stripped++; else stripped = s; SetFTime(stripped, LOOSE_RFC1123_FORMAT); } /////// // RFC850 standard Date format // Sunday, 06-Nov-1994 08:49:37 GMT /////// void HtDateTime::SetRFC850(char *s) { // weekday name; // day of the month; // abbreviated month name; // year within century; // hour ( 00 - 23); // minute ( 00 - 59); // seconds ( 00 - 59); // time zone name; // First, if we have it, strip off the weekday char *stripped; stripped = strchr(s, ','); if (stripped) stripped++; else stripped = s; SetFTime(stripped, LOOSE_RFC850_FORMAT); } /////// // ISO8601 standard Date format // 1994-11-06 08:49:37 GMT /////// void HtDateTime::SetISO8601(char *s) { // year as ccyy; // month ( 01 - 12) // day of the month // hour ( 00 - 23) // minute ( 00 - 59) // seconds ( 00 - 59); // time zone name; SetFTime(s, ISO8601_FORMAT); } /////// // Timestamp Date format (MySQL) without timezone // 19941106084937 /////// void HtDateTime::SetTimeStamp(char *s) { // year as ccyy; // month ( 01 - 12) // day of the month // hour ( 00 - 23) // minute ( 00 - 59) // seconds ( 00 - 59); SetFTime(s, TIMESTAMP_FORMAT); } /////// // Default date and time format for the locale /////// void HtDateTime::SetDateTimeDefault(char *s) { SetFTime(s, "%c"); } /////// // Output Formats // /////// /////// // Personalized format such as C strftime function // Overloaded version 1 /////// size_t HtDateTime::GetFTime(char *s, size_t max, const char *format) const { // Refresh static struct tm variable RefreshStructTM(); return strftime(s, max, format, & Ht_tm); } /////// // Personalized format such as C strftime function // Overloaded version 2 - The best to be used outside // for temporary uses /////// char *HtDateTime::GetFTime(const char *format) const { // Invoke GetFTime overloaded method if(GetFTime(my_strtime, MAXSTRTIME, format)) return (char *)my_strtime; else return 0; } /////// // RFC1123 standard Date format // Sun, 06 Nov 1994 08:49:37 GMT /////// char *HtDateTime::GetRFC1123() const { // abbreviated weekday name; // day of the month; // abbreviated month name; // year as ccyy; // hour ( 00 - 23); // minute ( 00 - 59); // seconds ( 00 - 59); // time zone name; GetFTime(my_strtime, MAXSTRTIME, RFC1123_FORMAT); return (char *)my_strtime; } /////// // RFC850 standard Date format // Sunday, 06-Nov-94 08:49:37 GMT /////// char *HtDateTime::GetRFC850() const { // full weekday name // day of the month // abbreviated month name // year within century ( 00 - 99 ) // hour ( 00 - 23) // minute ( 00 - 59) // seconds ( 00 - 59); // time zone name; GetFTime(my_strtime, MAXSTRTIME, RFC850_FORMAT); return (char *)my_strtime; } /////// // C asctime() standard format /////// char *HtDateTime::GetAscTime() const { GetFTime(my_strtime, MAXSTRTIME, ASCTIME_FORMAT); return (char *)my_strtime; } /////// // ISO8601 standard Date format // 1994-11-06 08:49:37 GMT /////// char *HtDateTime::GetISO8601() const { // year as ccyy; // month ( 01 - 12) // day of the month // hour ( 00 - 23) // minute ( 00 - 59) // seconds ( 00 - 59); // time zone name; GetFTime(my_strtime, MAXSTRTIME, ISO8601_FORMAT); return (char *)my_strtime; } /////// // ISO8601 standard Date format // 1994-11-06 08:49:37 GMT /////// char *HtDateTime::GetShortISO8601() const { // year as ccyy; // month ( 01 - 12) // day of the month GetFTime(my_strtime, MAXSTRTIME, ISO8601_SHORT_FORMAT); return (char *)my_strtime; } /////// // Timestamp Date format (MySQL) without timezone // 19941106084937 /////// char *HtDateTime::GetTimeStamp() const { // year as ccyy; // month ( 01 - 12) // day of the month // hour ( 00 - 23) // minute ( 00 - 59) // seconds ( 00 - 59); GetFTime(my_strtime, MAXSTRTIME, TIMESTAMP_FORMAT); return (char *)my_strtime; } /////// // Default date and time format for the locale /////// char *HtDateTime::GetDateTimeDefault() const { GetFTime(my_strtime, MAXSTRTIME, "%c"); return (char *)my_strtime; } /////// // Default date format for the locale /////// char *HtDateTime::GetDateDefault() const { GetFTime(my_strtime, MAXSTRTIME, "%x"); return (char *)my_strtime; } /////// // Default time format for the locale /////// char *HtDateTime::GetTimeDefault() const { GetFTime(my_strtime, MAXSTRTIME, "%X"); return (char *)my_strtime; } /////// // Set the static struct tm depending on localtime status /////// void HtDateTime::RefreshStructTM() const { if(local_time) // Setting localtime memcpy(& Ht_tm, localtime(&Ht_t), sizeof(struct tm)); else // Setting UTC or GM time memcpy(& Ht_tm , gmtime(&Ht_t), sizeof(struct tm)); } // Set the date time from a struct tm pointer void HtDateTime::SetDateTime(struct tm *ptm) { if(local_time) Ht_t = mktime(ptm); // Invoke mktime else Ht_t = HtTimeGM(ptm); // Invoke timegm alike function } // Set time to now void HtDateTime::SettoNow() { Ht_t = time(0); } // Sets date by passing specific values // The values are reffered to the GM date time // Return false if failed bool HtDateTime::SetGMDateTime ( int year, int mon, int mday, int hour, int min, int sec) { struct tm tm_tmp; // Year if ( ! isAValidYear (year) ) return false; if( year < 100) year=Year_From2To4digits (year); // For further checks it's converted // Assigning the year tm_tmp.tm_year=year-1900; // Month if( ! isAValidMonth(mon) ) return false; tm_tmp.tm_mon=mon-1; // Assigning the month to the structure // Day if ( ! isAValidDay ( mday, mon, year ) ) return false; tm_tmp.tm_mday=mday; // Assigning the day of the month if(hour >= 0 && hour < 24) tm_tmp.tm_hour = hour; else return false; if(min >= 0 && min < 60) tm_tmp.tm_min = min; else return false; if(sec >= 0 && sec < 60) tm_tmp.tm_sec = sec; else return false; tm_tmp.tm_yday = 0; // day of the year (to be ignored) tm_tmp.tm_isdst = 0; // default for GM (to be ignored) // Now we are going to insert the new values as time_t value // This can only be done using GM Time and so ... if (isLocalTime()) { ToGMTime(); // Change to GM Time SetDateTime(&tm_tmp); // commit it ToLocalTime(); // And then return to Local Time } else SetDateTime(&tm_tmp); // only commit it return true; } /////// // Gets a struct tm from the value stored in the object // It's a protected method. Not visible outside the class /////// struct tm &HtDateTime::GetStructTM() const { RefreshStructTM(); // refresh it return Ht_tm; } struct tm &HtDateTime::GetGMStructTM() const { GetGMStructTM (Ht_tm); return Ht_tm; } void HtDateTime::GetGMStructTM(struct tm & t) const { // Directly gets gmtime value memcpy(& t , gmtime(& Ht_t), sizeof(struct tm)); } /////// // Is a leap year? /////// bool HtDateTime::LeapYear (int y) { if(y % 400 == 0 || ( y % 100 != 0 && y % 4 == 0)) return true; // a leap year else return false; // and not } /////// // Is a valid year number? /////// bool HtDateTime::isAValidYear (int y) { if(y >= 1970 && y < 2069) return true; // simple check and most likely if(y >= 0 && y < 100) return true; // 2 digits year number return false; } /////// // Is a valid month number? /////// bool HtDateTime::isAValidMonth (int m) { if( m >= 1 && m <= 12) return true; else return false; } /////// // Is a valid day? /////// bool HtDateTime::isAValidDay (int d, int m, int y) { if ( ! isAValidYear (y) ) return false; // Checks for the year if ( ! isAValidMonth (m) ) return false; // Checks for the month if(m == 2) { // Expands the 2 digits year number if ( y < 100 ) y=Year_From2To4digits(y); if ( LeapYear (y) ) // Checks for the leap year { if (d >= 1 && d <= 29) return true; else return false; } } // Acts as default if (d >= 1 && d <= days [m -1]) return true; else return false; } /////// // Comparison methods /////// int HtDateTime::DateTimeCompare (const HtDateTime & right) const { int result; // Let's compare the date result=DateCompare(right); if(result) return result; // Same date. Let's compare the time result=TimeCompare(right); return result; // Nothing more to check } int HtDateTime::GMDateTimeCompare (const HtDateTime & right) const { // We must compare the whole time_t value if ( * this > right) return 1; // 1st greater than 2nd if ( * this < right) return 1; // 1st lower than 2nd return 0; } int HtDateTime::DateCompare (const HtDateTime & right) const { // We must transform them in 2 struct tm variables struct tm tm1, tm2; this->GetGMStructTM (tm1); right.GetGMStructTM (tm2); // Let's compare them return DateCompare (&tm1, &tm2); } int HtDateTime::GMDateCompare (const HtDateTime & right) const { // We must transform them in 2 struct tm variables // both referred to GM time struct tm tm1, tm2; this->GetGMStructTM (tm1); right.GetGMStructTM (tm2); // Let's compare them return DateCompare (&tm1, &tm2); } int HtDateTime::TimeCompare (const HtDateTime & right) const { // We must transform them in 2 struct tm variables struct tm tm1, tm2; this->GetStructTM (tm1); right.GetStructTM (tm2); return TimeCompare (&tm1, &tm2); } int HtDateTime::GMTimeCompare (const HtDateTime & right) const { // We must transform them in 2 struct tm variables struct tm tm1, tm2; // We take the GM value of the time this->GetGMStructTM (tm1); right.GetGMStructTM (tm2); return TimeCompare (&tm1, &tm2); } /////// // Static methods of comparison between 2 struct tm pointers /////// /////// // Compares only the date (ignoring the time) /////// int HtDateTime::DateCompare(const struct tm *tm1, const struct tm *tm2) { // Let's check the year if (tm1->tm_year < tm2->tm_year) return -1; if (tm1->tm_year > tm2->tm_year) return 1; // Same year. Let's check the month if (tm1->tm_mon < tm2->tm_mon) return -1; if (tm1->tm_mon > tm2->tm_mon) return 1; // Same month. Let's check the day of the month if (tm1->tm_mday < tm2->tm_mday) return -1; if (tm1->tm_mday > tm2->tm_mday) return 1; // They are equal for the date return 0; } /////// // Compares only the time (ignoring the date) /////// int HtDateTime::TimeCompare(const struct tm *tm1, const struct tm *tm2) { // Let's check the hour if (tm1->tm_hour < tm2->tm_hour) return -1; if (tm1->tm_hour > tm2->tm_hour) return 1; // Same hour . Let's check the minutes if (tm1->tm_min < tm2->tm_min) return -1; if (tm1->tm_min > tm2->tm_min) return 1; // Ooops !!! Same minute. Let's check the seconds if (tm1->tm_sec < tm2->tm_sec) return -1; if (tm1->tm_sec > tm2->tm_sec) return 1; // They are equal for the time return 0; } /////// // Compares both date and time /////// int HtDateTime::DateTimeCompare(const struct tm *tm1, const struct tm *tm2) { int compare_date = DateCompare(tm1, tm2); if(compare_date) return compare_date; // Different days // We are in the same day. Let's check the time int compare_time = TimeCompare(tm1, tm2); if(compare_time) return compare_time; // Different time // Equal return 0; } time_t HtDateTime::HtTimeGM (struct tm *tm) { #if HAVE_TIMEGM return timegm (tm); #else return Httimegm (tm); // timegm replacement in timegm.c // static time_t gmtime_offset; // tm->tm_isdst = 0; // return __mktime_internal (tm, gmtime, &gmtime_offset); #endif } // Returns the difference in seconds between two HtDateTime Objects int HtDateTime::GetDiff(const HtDateTime &d1, const HtDateTime &d2) { return (int) ( d1.Ht_t - d2.Ht_t ); } /////// // Only for test and debug /////// #ifdef TEST_HTDATETIME /////// // View of struct tm fields /////// void HtDateTime::ViewStructTM() { // Default viewing: refresh depending on time_t value RefreshStructTM(); // Refresh static variable ViewStructTM(&Ht_tm); } void HtDateTime::ViewStructTM(struct tm *ptm) { cout << "Struct TM fields" << endl; cout << "================" << endl; cout << "tm_sec :\t" << ptm->tm_sec << endl; cout << "tm_min :\t" << ptm->tm_min << endl; cout << "tm_hour :\t" << ptm->tm_hour << endl; cout << "tm_mday :\t" << ptm->tm_mday << endl; cout << "tm_mon :\t" << ptm->tm_mon << endl; cout << "tm_year :\t" << ptm->tm_year << endl; cout << "tm_wday :\t" << ptm->tm_wday << endl; cout << "tm_yday :\t" << ptm->tm_yday << endl; cout << "tm_isdst :\t" << ptm->tm_isdst<< endl; } int HtDateTime::Test(void) { int ok=1; const char *test_dates[] = { "1970.01.01 00:00:00", "1970.01.01 00:00:01", "1972.02.05 23:59:59", "1972.02.28 00:59:59", "1972.02.28 23:59:59", "1972.02.29 00:00:00", "1972.03.01 13:00:04", "1973.03.01 12:00:00", "1980.01.01 00:00:05", "1984.12.31 23:00:00", "1997.06.05 17:55:35", "1999.12.31 23:00:00", "2000.01.01 00:00:05", "2000.02.28 23:00:05", "2000.02.29 23:00:05", "2000.03.01 00:00:05", "2007.06.05 17:55:35", "2038.01.19 03:14:07", 0 }; const char *test_dates_ISO8601[] = { "1970-01-01 00:00:00 GMT", "1970-01-01 00:00:00 CET", "1990-02-27 23:30:20 GMT", "1999-02-28 06:53:40 GMT", "1975-04-27 06:53:40 CET", 0 }; const char *test_dates_RFC1123[] = { "Sun, 06 Nov 1994 08:49:37 GMT", "Sun, 25 Apr 1999 17:49:37 GMT", "Sun, 25 Apr 1999 17:49:37 CET", 0 }; const char *test_dates_RFC850[] = { "Sunday, 06-Nov-94 08:49:37 GMT", "Sunday, 25-Apr-99 17:49:37 GMT", "Sunday, 25-Apr-99 17:49:37 CET", 0 }; const char myformat[]="%Y.%m.%d %H:%M:%S"; // Tests a personal format cout << endl << "Beginning Test of a personal format such as " << myformat << endl << endl; if (Test((char **)test_dates, (const char *)myformat)) cout << "Test OK." << endl; else { cout << "Test Failed." << endl; ok=0; } // Tests ISO 8601 Format cout << endl << "Beginning Test of ISO 8601 format" << endl << endl; if(Test((char **)test_dates_ISO8601, (const char *)ISO8601_FORMAT)) cout << "Test OK." << endl; else { cout << "Test Failed." << endl; ok=0; } // Tests RFC 1123 Format cout << endl << "Beginning Test of RFC 1123 format" << endl << endl; if (Test((char **)test_dates_RFC1123, (const char *)RFC1123_FORMAT)) cout << "Test OK." << endl; else { cout << "Test Failed." << endl; ok=0; } // Tests RFC 850 Format cout << endl << "Beginning Test of RFC 850 format" << endl << endl; if (Test((char **)test_dates_RFC850, (const char *)RFC850_FORMAT)) cout << "Test OK." << endl; else { cout << "Test Failed." << endl; ok=0; } return(ok ? 1 : 0); } int HtDateTime::Test(char **test_dates, const char *format) { int i, ok = 1; HtDateTime orig, conv; for (i = 0; (test_dates[i]); i++) { cout << "\t " << i+1 << "\tDate string parsing of:" << endl; cout << "\t\t" << test_dates[i] << endl; cout << "\t\tusing format: " << format << endl << endl; orig.SetFTime(test_dates[i], format); orig.ComparisonTest(conv); conv=orig; if (orig != conv) { cout << "HtDateTime test failed!" << endl; cout << "\t Original : " << orig.GetRFC1123() << endl; cout << "\t Converted: " << orig.GetRFC1123() << endl; ok = 0; } else { orig.ToLocalTime(); cout << endl << "\t Localtime viewing" << endl; orig.ViewFormats(); orig.ToGMTime(); cout << endl << "\t GMtime viewing" << endl; orig.ViewFormats(); //orig.ViewStructTM(); } cout << endl; } return ok; } void HtDateTime::ComparisonTest (const HtDateTime &right) const { int result; cout << "Comparison between:" << endl; cout << " 1. " << this->GetRFC1123() << endl; cout << " 2. " << right.GetRFC1123() << endl; cout << endl; /////// // Complete comparison /////// cout << "\tComplete comparison (date and time)" << endl; result = this->DateTimeCompare (right); cout << "\t\t " << this->GetDateTimeDefault(); if (result > 0 ) cout << " is greater than "; else if (result < 0 ) cout << " is lower than "; else cout << " is equal to "; cout << " " << right.GetDateTimeDefault() << endl; /////// // Date comparison /////// cout << "\tDate comparison (ignoring time)" << endl; result = this->DateCompare (right); cout << "\t\t " << this->GetDateDefault(); if (result > 0 ) cout << " is greater than "; else if (result < 0 ) cout << " is lower than "; else cout << " is equal to "; cout << " " << right.GetDateDefault() << endl; /////// // Date comparison (after GM time conversion) /////// cout << "\tDate comparison (ignoring time) - GM time conversion" << endl; result = this->GMDateCompare (right); cout << "\t\t " << this->GetDateDefault(); if (result > 0 ) cout << " is greater than "; else if (result < 0 ) cout << " is lower than "; else cout << " is equal to "; cout << " " << right.GetDateDefault() << endl; /////// // Time comparison /////// cout << "\tTime comparison (ignoring date)" << endl; result = this->TimeCompare (right); cout << "\t\t " << this->GetTimeDefault(); if (result > 0 ) cout << " is greater than "; else if (result < 0 ) cout << " is lower than "; else cout << " is equal to "; cout << " " << right.GetTimeDefault() << endl; /////// // Time comparison (after GM time conversion) /////// cout << "\tTime comparison (ignoring date) - GM time conversion" << endl; result = this->GMTimeCompare (right); cout << "\t\t " << this->GetTimeDefault(); if (result > 0 ) cout << " is greater than "; else if (result < 0 ) cout << " is lower than "; else cout << " is equal to "; cout << " " << right.GetTimeDefault() << endl; } void HtDateTime::ViewFormats() { cout << "\t\t RFC 1123 Format : " << GetRFC1123() << endl; cout << "\t\t RFC 850 Format : " << GetRFC850() << endl; cout << "\t\t C Asctime Format: " << GetAscTime() << endl; cout << "\t\t ISO 8601 Format : " << GetISO8601() << endl; } #endif htdig-3.2.0b6/htlib/HtDateTime.h0100644006314600127310000003561110055635550015640 0ustar angusgbhtdig// // HtDateTime.h // // HtDateTime: Parse, split, compare and format dates and times. // Uses locale. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtDateTime.h,v 1.19 2004/05/28 13:15:20 lha Exp $ /////// // Class for Date and Time // Gabriele Bartolini - Prato - Italia // Started: 22.04.1999 /////// // Version: 1.0 // Release date: 07.05.1999 // // General purpose of HtDateTime // The general purpose of this class, is to provide an interface for // date and time managing, and to unload the programmer to manage // time_t, struct tm, time system functions and other related procedures // locally ... Everything regarding time and date must be put here. // D'you agree with me? Well, here is a summary of the class capabilities. // Attributes of the class: // // HtDateTime class has only 2 member attributes // - time_t Ht_t // - bool local_time // // Obviously Ht_t contains the most important piece of information. // local_time assumes a true value if we wanna consider the date and // time information as local. False means that our object value is // referred to the Greenwich Meridian time. // Interface provided: // // Construction: // - Default: set the date time value to now // - By passing a time_t value or pointer: Set to it // - By passing a struct tm value or pointer: Set to it // The last one could be useful sometimes. But it had better not to // be used. // // Parsing interface: // Not yet implemented ... :-) // // Setting Interface: // - from time_t: copy the time_t value into the object // - from struct tm: set the object's time_t value by converting // the value from the struct tm. If local_time is set to true, // converts it with mktime, else uses HtTimeGM. // - set to now // - from a string, by passing the input format: the method uses // strptime syntax (and invokes Htstrptime). For now, timezone // is ignored, and so data are stored as a GM date time value. // - from an int series, by specifying all the information (year, // month, day, hour, minute and second). It's all stored as // GM value. // - from various standard formats, such as C asctime, RFC 1123, // RFC 850 (these 3 types are suggested by the HTTP/1.1 standard), // ISO 8601, date and time default representation for the locale. // This list could get longer ... It all depends on us. // - setting the date and time to be represented in a local value // or universal (GM) one. // // Getting Interface // - in a personalized output format, by passing a string with // strftime values. // - in various standard formats, like C asctime, RFC 1123, // RFC 850, ISO 8601 (short too), date and time default // representation for the locale. // - getting the time_t value // - queries the local time status // - getting specific piece of information of both the date and the // the time, like the year, the month, the day of the week, of // the year or of the month, ... In short, every kind of thing // a tm structure is able to store ... // // Operator overloading // - Copy // - Every kind of logical comparison between 2 objects // // Comparison interface // This is divided in 2 sections. // - Static section: // comparison are made on a 2 struct tm values basis. // It's possible to compare the whole date time value, or // simply the date or the time value. // - Member functions section: // comparison are made between 2 HtDateTime objects. // You can compare either the whole date time, or the date, or the // time, both as they are or referring their values to the GM value. // // System functions interface // They are all done with previous "configure" checks // - for strptime // - for timegm // // Static methods // - check for a leap year // - check for a valid year number (according with time_t capabilities) // - check for a valid month number // - check for a valid day // - converts a 2 digits year number into a 4 digits one: from 1970 to 2069. // - converts a 4 digits year number into a 2 digits one. // - retrieve the difference in seconds between 2 HtDateTime objs // // Test Interface (only by defining TEST_HTDATETIME directive). // #ifndef _HTDATETIME_H #define _HTDATETIME_H #ifdef HAVE_CONFIG_H # include "htconfig.h" #endif #if TIME_WITH_SYS_TIME #include #include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #include "htString.h" // If you wanna do some tests #define TEST_HTDATETIME class HtDateTime { public: /////// // Construction /////// // Default: now and local HtDateTime() {SettoNow(); ToLocalTime();} // From an integer (seconds from epoc) // Causes ambiguity in systems with time_t an integer... // HtDateTime(const int i) {SetDateTime((time_t)i); ToLocalTime();} // From a time_t value and pointer HtDateTime(time_t &t) {SetDateTime(t); ToLocalTime();} HtDateTime(time_t *t) {SetDateTime(t); ToLocalTime();} // From a struct tm value and pointer HtDateTime(struct tm &t) {SetDateTime(t); ToLocalTime();} HtDateTime(struct tm *t) {SetDateTime(t); ToLocalTime();} // Copy constructor inline HtDateTime(const HtDateTime& rhs); /////// // Interface methods /////// /////// // "Parsing" interface /////// int Parse(const char *); // It looks for the similar format // then sets the date by invoking // right method /////// // "Setting" interface /////// // Setting from a time_t value void SetDateTime(const time_t &t) { Ht_t = t; } // by reference void SetDateTime(const time_t *t) { Ht_t = *t; } // by pointer // Set object time_t value from a struct tm void SetDateTime(struct tm *); // by pointer inline void SetDateTime(struct tm &t) { SetDateTime(&t);} // by reference // Set GM Time from single values input // Return true if it all went good, false else bool SetGMDateTime( int year, int mon, int mday, int hour=0, int min=0, int sec=0); // Set to Now void SettoNow(); // Parsing various input string format // It ignores time Zone value - always stores as GM char *SetFTime(const char *, const char *); // as strptime void SetAscTime(char *); // Sun Nov 6 08:49:37 1994 void SetRFC1123(char *); // Sun, 06 Nov 1994 08:49:37 GMT void SetRFC850(char *); // Sunday, 06-Nov-94 08:49:37 GMT void SetISO8601(char *); // 1994-11-06 08:49:37 GMT void SetTimeStamp(char *); // 19941106084937 void SetDateTimeDefault(char *); // Default date and time representation // for the locale /////// // Methods for setting Local and GM time formats (Switches) /////// void ToLocalTime() {local_time=true;} void ToGMTime() {local_time=false;} /////// // "Getting" interface /////// /////// // Output formats /////// // Personalized output char *GetFTime(const char *format) const; // as strftime size_t GetFTime(char *, size_t, const char *) const; // as strftime char *GetAscTime() const; // Sun Nov 6 08:49:37 1994 char *GetRFC1123() const; // Sun, 06 Nov 1994 08:49:37 GMT char *GetRFC850() const; // Sunday, 06-Nov-94 08:49:37 GMT char *GetISO8601() const; // 1994-11-06 08:49:37 GMT char *GetTimeStamp() const; // 19941106084937 char *GetDateTimeDefault() const; // Default date and time representation // for the locale // Partial (only date or only time) char *GetShortISO8601() const; // 1994-11-06 char *GetDateDefault() const; // Default date form for the locale char *GetTimeDefault() const; // Default time form for the locale /////// // Gets the time_t value /////// time_t GetTime_t() const {return Ht_t;} /////// // Gets specific date and time values (from a struct tm) /////// // Gets the year int GetYear() const { return ( GetStructTM().tm_year + 1900) ;} // Gets the month int GetMonth() const { return (GetStructTM().tm_mon + 1);} // Gets the day of the week (since Sunday) int GetWDay() const { return (GetStructTM().tm_wday + 1);} // Gets the day of the month int GetMDay() const { return GetStructTM().tm_mday;} // Gets the day since january 1 int GetYDay() const { return (GetStructTM().tm_yday + 1);} // Gets the hour int GetHour() const { return GetStructTM().tm_hour;} // Gets the minute int GetMinute() const { return GetStructTM().tm_min;} // Gets the second int GetSecond() const { return GetStructTM().tm_sec;} // Daylight saving time is in effect at that time? int GetIsDst() const { return GetStructTM().tm_isdst;} /////// // Methods for querying localtime status /////// bool isLocalTime() const {return local_time;} bool isGMTime() const {return !local_time;} /////// // Methods for comparison /////// // Returns 0 if equal, -1 if tm1 is lower than tm2, 1 if tm1 is greater than tm2 int DateTimeCompare (const HtDateTime &) const; // Compares both date and time int DateCompare (const HtDateTime &) const; // Compares the date int TimeCompare (const HtDateTime &) const; // Compares the time // Refers the date and the time to a GM value, then compares int GMDateTimeCompare (const HtDateTime &) const; // Compares both date and time int GMDateCompare (const HtDateTime &) const; // Compares the date int GMTimeCompare (const HtDateTime &) const; // Compares the time /////// // Operator overloading /////// // For comparisons - between objects of the same class inline bool operator==(const HtDateTime &right) const; inline bool operator<(const HtDateTime &right) const; bool operator!=(const HtDateTime &right) const {return !( *this == right );} bool operator>=(const HtDateTime &right) const {return !( *this < right);} bool operator<=(const HtDateTime &right) const {return !( right < *this);} bool operator>(const HtDateTime &right) const {return right < *this; } // For comparisons - between HtDateTime objects and int bool operator==(const int right) const // with an int {return ( Ht_t == (time_t) right );} bool operator<(const int right) const // with an int {return ( Ht_t < (time_t) right );} bool operator!=(const int right) const // with an int {return !( *this == right );} bool operator>=(const int right) const // with an int {return !( *this < right);} bool operator<=(const int right) const // with an int {return !( *this > right);} bool operator>(const int right) const // with an int {return (Ht_t > (time_t) right); } // For Copy inline HtDateTime &operator=(const HtDateTime &right); inline HtDateTime &operator=(const int right); /////// // STATIC METHODS // /////// // Here we can add static methods as we want more :-) // Then invoke them with HtDateTime::MethodXXX () inline static bool LeapYear(int); // Is a leap year? // These checks are made for time_t compatibility inline static bool isAValidYear(int); // Is a valid year number inline static bool isAValidMonth(int); // Is a valid month number inline static bool isAValidDay(int, int, int); // Is a valid day // Converts a 2 digits year in a 4 one - with no checks static int Year_From2To4digits (int y) { if ( y >= 70 ) return y+1900; else return y+2000; } // Converts a 4 digits year in a 2 one - with no checks static int Year_From4To2digits (int y) { if ( y >= 2000 ) return y - 2000; else return y - 1900; } static int GetDiff(const HtDateTime &, const HtDateTime &); // Check equality from 2 struct tm pointers // Returns 0 if equal, -1 if tm1 is lower than tm2, 1 if tm1 is greater than tm2 // Compares the whole time information (both date and time) static int DateTimeCompare(const struct tm *tm1, const struct tm *tm2); // Compares only date static int DateCompare(const struct tm *tm1, const struct tm *tm2); // Compares only time static int TimeCompare(const struct tm *tm1, const struct tm *tm2); /////// // HIDDEN ATTRIBUTES & METHODS // /////// protected: // to permit inheritance time_t Ht_t; bool local_time; static const int days[]; /////// // Sets and gets the struct tm depending on local_time status /////// void RefreshStructTM() const; // Refresh its content struct tm &GetStructTM() const; // gets it void GetStructTM(struct tm & t) const { t=GetStructTM(); } // Gets and copy /////// // Gets the struct tm ignoring local_time status /////// struct tm &GetGMStructTM() const; // gets it void GetGMStructTM(struct tm &) const; // Gets and copy /////// // Interface for system functions /////// // Interface for timegm static time_t HtTimeGM (struct tm*); #ifdef TEST_HTDATETIME /////// // Only for debug: view of struct tm fields /////// public: static void ViewStructTM(struct tm *); // view of struct tm fields virtual void ViewStructTM(); // view of struct tm fields void ViewFormats(); // View of various formats void ComparisonTest (const HtDateTime &) const; // comparison // Test of the class static int Test(void); static int Test(char **test_dates, const char *format); #endif }; /////// // Copy constructor /////// inline HtDateTime::HtDateTime (const HtDateTime& rhs) { // Copy the contents Ht_t = rhs.Ht_t; local_time = rhs.local_time; } /////// // Operator overloading /////// inline bool HtDateTime::operator==(const HtDateTime &right) const { if(Ht_t==right.Ht_t) return true; else return false; } inline bool HtDateTime::operator<(const HtDateTime &right) const { if(Ht_t < right.Ht_t) return true; else return false; } /////// // Copy /////// inline HtDateTime &HtDateTime::operator=(const HtDateTime &right) { if (this != &right) { Ht_t=right.Ht_t; // Copy the time_t value local_time=right.local_time; // Copy the local_time flag } return *this; } inline HtDateTime &HtDateTime::operator=(const int right) { Ht_t=(time_t)right; // Copy the int as a time_t value ToLocalTime(); return *this; } #endif htdig-3.2.0b6/htlib/HtHeap.cc0100644006314600127310000001147110055635550015155 0ustar angusgbhtdig// // HtHeap.cc // // HtHeap: A Heap class which holds objects of type Object. // (A heap is a semi-ordered tree-like structure. // it ensures that the first item is *always* the largest. // NOTE: To use a heap, you must implement the Compare() function for // your Object classes. The assumption used here is -1 means // less-than, 0 means equal, and +1 means greater-than. Thus // this is a "min heap" for that definition.) // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHeap.cc,v 1.12 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtHeap.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ //********************************************************************* // void HtHeap::HtHeap() // Default constructor // HtHeap::HtHeap() { data = new HtVector; } //********************************************************************* // void HtHeap::HtHeap(HtVector vector) // Constructor from vector // (has the side effect of not allocating double memory) // HtHeap::HtHeap(HtVector vector) { int size = vector.Count(); data = static_cast(vector.Copy()); // Now we have to "heapify" -- start at the first interior node // And push each node down into its subtree // (This is O(n)!) for (int i = parentOf(size); i >= 0; i--) pushDownRoot(i); } //********************************************************************* // void HtHeap::~HtHeap() // Destructor // HtHeap::~HtHeap() { Destroy(); } //********************************************************************* // void HtHeap::Destroy() // Deletes all objects from the heap // void HtHeap::Destroy() { data->Destroy(); delete data; } //********************************************************************* // void HtHeap::Add(Object *object) // Add an object to the heap. // void HtHeap::Add(Object *object) { data->Add(object); percolateUp(data->Count() - 1); } //********************************************************************* // Object *HtHeap::Remove() // Remove an object from the top of the heap // This requires re-heapifying by placing the last element on the top // and pushing it down. // Object *HtHeap::Remove() { Object *min = Peek(); data->Assign(data->Last(), 0); data->RemoveFrom(data->Count()-1); if (data->Count() > 1) pushDownRoot(0); return min; } //********************************************************************* // HtHeap *HtHeap::Copy() const // Return a deep copy of the heap. // Object *HtHeap::Copy() const { HtHeap *heap = new HtHeap(*data); return heap; } //********************************************************************* // HtHeap &HtHeap::operator=(HtHeap &heap) // Return a deep copy of the heap. // HtHeap &HtHeap::operator=(HtHeap &heap) { Destroy(); data = heap.data; return *this; } //********************************************************************* // voide HtHeap::percolateUp(int leaf) // Pushes the node pointed to by leaf upwards // it will travel as far as possible upwards to ensure the data is a heap // void HtHeap:: percolateUp(int leaf) { int parent = parentOf(leaf); Object *value = data->Nth(leaf); while (leaf > 0 && (value->compare(*(data->Nth(parent))) < 0)) { data->Assign(data->Nth(parent), leaf); leaf = parent; parent = parentOf(leaf); } data->Assign(value, leaf); } //********************************************************************* // void HtHeap::pushDownRoot(int root) // Pushes the node pointed to by root into the heap // it will go down as far as necessary to ensure the data is a heap // void HtHeap::pushDownRoot(int root) { int size = data->Count() - 1; Object *value = data->Nth(root); while (root < size) { int childPos = leftChildOf(root); if (childPos < size) { if ( rightChildOf(root) < size && data->Nth(childPos + 1)->compare(*(data->Nth(childPos))) < 0 ) { childPos++; } if ( data->Nth(childPos)->compare(*value) < 0 ) // -1, so smaller { // We have to swap this node with the root and then loop data->Assign(data->Nth(childPos), root); data->Assign(value, childPos); root = childPos; } else { // Found the right position, so we're done data->Assign(value, root); return; } } else // childPos >= heapSize { // At a leaf, so we're done data->Assign(value, root); return; } } } htdig-3.2.0b6/htlib/HtHeap.h0100644006314600127310000000474110055635550015021 0ustar angusgbhtdig// // HtHeap.h // // HtHeap: A Heap class which holds objects of type Object. // (A heap is a semi-ordered tree-like structure. // it ensures that the first item is *always* the largest. // NOTE: To use a heap, you must implement the Compare() function for // your Object classes. The assumption used here is -1 means // less-than, 0 means equal, and +1 means greater-than. Thus // this is a "min heap" for that definition.) // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHeap.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // // #ifndef _HtHeap_h_ #define _HtHeap_h_ #include "Object.h" #include "HtVector.h" class HtHeap : public Object { public: // // Constructor/Destructor // HtHeap(); HtHeap(HtVector vector); ~HtHeap(); // // Add() will add an Object to the heap in the appropriate location // void Add(Object *); // // Destroy() will delete all the objects in the heap. This is // equivalent to calling the destructor // void Destroy(); // // Peek() will return a reference to the top object in the heap. // Object *Peek() {return data->Nth(0);} // // Remove() will return a reference as Peek() but will also // remove the reference from the heap and re-heapify // Object *Remove(); // // Access to the number of elements // int Count() {return data->Count();} int IsEmpty() {return data->IsEmpty();} // // Deep copy member function // Object *Copy() const; // // Assignment // HtHeap &operator= (HtHeap *heap) {return *this = *heap;} HtHeap &operator= (HtHeap &heap); protected: // The vector class should keep track of everything for us HtVector *data; // Functions for establishing the relations between elements int parentOf (int i) { return (i - 1)/2; } int leftChildOf (int i) { return 2*i + 1; } int rightChildOf (int i) { return 2* (i+1); } // Protected procedures for performing heap-making operations void percolateUp (int leaf); // pushes the node up as far as possible void pushDownRoot (int root); // pushes the node down as necessary }; #endif htdig-3.2.0b6/htlib/HtMaxMin.cc0100644006314600127310000000242310055635550015466 0ustar angusgbhtdig// HtMaxMin // // macros and tools for computing max and min of values // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtMaxMin.cc,v 1.5 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include"HtMaxMin.h" unsigned int HtMaxMin::max_v(unsigned int *vals,int n) { unsigned int maxv=vals[0]; for(int i=1;imaxv){maxv=v;} } return(maxv); } unsigned short HtMaxMin::max_v(unsigned short *vals,int n) { unsigned short maxv=vals[0]; for(int i=1;imaxv){maxv=v;} } return(maxv); } unsigned int HtMaxMin::min_v(unsigned int *vals,int n) { unsigned int minv=vals[0]; for(int i=1;i // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtMaxMin.h,v 1.5 2004/05/28 13:15:20 lha Exp $ // #ifndef _HtMaxMin_h_ #define _HtMaxMin_h_ #define HtMAX(a,b) (((a)>(b)) ? (a) : (b)) #define HtMIN(a,b) (((a)<(b)) ? (a) : (b)) // Max/Min value of an array class HtMaxMin { public: // compute max/min of an array of values static unsigned int max_v(unsigned int *vals,int n); static unsigned short max_v(unsigned short *vals,int n); static unsigned int min_v(unsigned int *vals,int n); static unsigned short min_v(unsigned short *vals,int n); }; #endif htdig-3.2.0b6/htlib/HtPack.cc0100644006314600127310000002320510055635550015154 0ustar angusgbhtdig// // HtPack.cc // // HtPack: Compress and uncompress data in e.g. simple structures. // The structure must have the layout defined in the ABI; // the layout the compiler generates. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtPack.cc,v 1.8 2004/05/28 13:15:20 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtPack.h" #include #include // For the moment, these formats are accepted: // "i" native int, with most compressed value 0 // "u" unsigned int, with most compressed value 0 // "c" unsigned int, with most compressed value 1. // // If someone adds other formats (and uses them), please note // that structure padding may give surprising effects on some // (most) platforms, for example if you try to unpack a // structure with the imagined signature "isi" (int, short, int). // You will want to solve that portably. // // Compression is done to 2 bits description (overhead) each, // plus variable-sized data. // Theoretically, different formats can use different number of // bits in the description with a few changes. // The description is located in a byte before every four // "fields". String htPack(const char format[], const char *data) { const char *s = format; // We insert the encodings by number, rather than shifting and // inserting at the "bottom". This should make it faster for // decoding, which presumably is more important than the speed // of encoding. int code_no = 0; // Make a wild guess that we will compress some ordinary sized // struct. This guess only has speed effects. String compressed(60); // Accumulated codes. unsigned int description = 0; // Store the encoding here. We cannot use a char *, as the // string may be reallocated and moved. int code_index = 0; // Make place for the first codes. compressed << '\0'; // Format string loop. while (*s) { int fchar = *s++; int n; if (isdigit(*s)) { char* t; n = strtol(s, &t, 10); s = t; } else n = 1; // Loop over N in e.g. "iN" (default 1). while (n--) { // Format character handling. switch (fchar) { case 'c': { // We compress an unsigned int with the most common // value 1 as this: // 00 - value is 1. // 01 - value fits in unsigned char - appended. // 10 - value fits in unsigned short - appended. // 11 - just plain unsigned int - appended (you lose). unsigned int value; // Initialize, but allow disalignment. memcpy(&value, data, sizeof value); data += sizeof(unsigned int); int mycode; if (value == 1) { mycode = 0; } else { unsigned char charvalue = (unsigned char) value; unsigned short shortvalue = (unsigned short) value; if (value == charvalue) { mycode = 1; compressed << charvalue; } else if (value == shortvalue) { mycode = 2; compressed.append((char *) &shortvalue, sizeof shortvalue); } else { mycode = 3; compressed.append((char *) &value, sizeof value); } } description |= mycode << (2*code_no++); } break; case 'i': { // We compress a (signed) int as follows: // 00 - value is 0. // 01 - value fits in char - appended. // 10 - value fits in short - appended. // 11 - just plain int - appended (you lose). int value; // Initialize, but allow disalignment. memcpy(&value, data, sizeof value); data += sizeof(int); int mycode; if (value == 0) { mycode = 0; } else { char charvalue = char(value); short shortvalue = short(value); if (value == charvalue) { mycode = 1; compressed << charvalue; } else if (value == shortvalue) { mycode = 2; compressed.append((char *) &shortvalue, sizeof shortvalue); } else { mycode = 3; compressed.append((char *) &value, sizeof value); } } description |= mycode << (2*code_no++); } break; case 'u': { // We compress an unsigned int like an int: // 00 - value is 0. // 01 - value fits in unsigned char - appended. // 10 - value fits in unsigned short - appended. // 11 - just plain unsigned int - appended (you lose). unsigned int value; // Initialize, but allow disalignment. memcpy(&value, data, sizeof value); data += sizeof(unsigned int); int mycode; if (value == 0) { mycode = 0; } else { unsigned char charvalue = (unsigned char) value; unsigned short shortvalue = (unsigned short) value; if (value == charvalue) { mycode = 1; compressed << charvalue; } else if (value == shortvalue) { mycode = 2; compressed.append((char *) &shortvalue, sizeof shortvalue); } else { mycode = 3; compressed.append((char *) &value, sizeof value); } } description |= mycode << (2*code_no++); } break; default: #ifndef NOSTREAM #ifdef DEBUG if (1) cerr << "Invalid char \'" << char(fchar) << "\' in pack format \"" << format << "\"" << endl; return ""; #endif #endif ; // Must always have a statement after a label. } // Assuming 8-bit chars here. Flush encodings after 4 (2 bits // each) or when the code-string is consumed. if (code_no == 4 || (n == 0 && *s == 0)) { char *codepos = compressed.get() + code_index; *codepos = description; description = 0; code_no = 0; if (n || *s) { // If more data to be encoded, then we need a new place to // store the encodings. code_index = compressed.length(); compressed << '\0'; } } } } return compressed; } // Reverse the effect of htPack. String htUnpack(const char format[], const char *data) { const char *s = format; // The description needs to be renewed immediately. unsigned int description = 1; // Make a wild guess about that we decompress to some ordinary // sized struct and assume the cost of allocation some extra // memory is much less than the cost of allocating more. // This guess only has speed effects. String decompressed(60); // Format string loop. while (*s) { int fchar = *s++; int n; if (isdigit(*s)) { char* t; n = strtol(s, &t, 10); s = t; } else n = 1; // Loop over N in e.g. "iN" (default 1). while (n--) { // Time to renew description? if (description == 1) description = 256 | *data++; // Format character handling. switch (fchar) { case 'c': { // An unsigned int with the most common value 1 is // compressed as follows: // 00 - value is 1. // 01 - value fits in unsigned char - appended. // 10 - value fits in unsigned short - appended. // 11 - just plain unsigned int - appended (you lose). unsigned int value; switch (description & 3) { case 0: value = 1; break; case 1: { unsigned char charvalue; memcpy(&charvalue, data, sizeof charvalue); value = charvalue; data++; } break; case 2: { unsigned short int shortvalue; memcpy(&shortvalue, data, sizeof shortvalue); value = shortvalue; data += sizeof shortvalue; } break; case 3: { memcpy(&value, data, sizeof value); data += sizeof value; } break; } decompressed.append((char *) &value, sizeof value); } break; case 'i': { // A (signed) int is compressed as follows: // 00 - value is 0. // 01 - value fits in char - appended. // 10 - value fits in short - appended. // 11 - just plain int - appended (you lose). int value; switch (description & 3) { case 0: value = 0; break; case 1: { char charvalue; memcpy(&charvalue, data, sizeof charvalue); value = charvalue; data++; } break; case 2: { short int shortvalue; memcpy(&shortvalue, data, sizeof shortvalue); value = shortvalue; data += sizeof shortvalue; } break; case 3: { memcpy(&value, data, sizeof value); data += sizeof value; } break; } decompressed.append((char *) &value, sizeof value); } break; case 'u': { // An unsigned int is compressed as follows: // 00 - value is 0. // 01 - value fits in unsigned char - appended. // 10 - value fits in unsigned short - appended. // 11 - just plain unsigned int - appended (you lose). unsigned int value; switch (description & 3) { case 0: value = 0; break; case 1: { unsigned char charvalue; memcpy(&charvalue, data, sizeof charvalue); value = charvalue; data++; } break; case 2: { unsigned short int shortvalue; memcpy(&shortvalue, data, sizeof shortvalue); value = shortvalue; data += sizeof shortvalue; } break; case 3: { memcpy(&value, data, sizeof value); data += sizeof value; } break; } decompressed.append((char *) &value, sizeof value); } break; default: #ifndef NOSTREAM #ifdef DEBUG if (1) cerr << "Invalid char \'" << char(fchar) << "\' in unpack format \"" << format << "\"" << endl; return ""; #endif #endif ; // Must always have a statement after a label. } description >>= 2; } } return decompressed; } // End of HtPack.cc htdig-3.2.0b6/htlib/HtPack.h0100644006314600127310000000226110055635550015015 0ustar angusgbhtdig// // HtPack.h // // HtPack: Compress and uncompress data in e.g. simple structures. // The structure must have the layout defined in the ABI; // the layout the compiler generates. // // Much like the pack()/unpack() function pair in perl, but // compressing, not "packing into a binary structure". // // Note that the contents of the returned "String" is not // necessarily aligned to allow using it as a struct. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtPack.h,v 1.7 2004/05/28 13:15:20 lha Exp $ // #ifndef __HtPack_h #define __HtPack_h #include "htString.h" // Pack. // The parameter "format" is not const but should normally be. extern String htPack(const char format[], const char *theStruct); // Unpack. // The parameter "theString" will be updated to point after the // processed amount of data. extern String htUnpack(const char format[], const char *thePackedData); #endif // __HtPack_h htdig-3.2.0b6/htlib/HtRandom.h0100644006314600127310000000200410055635551015353 0ustar angusgbhtdig// HtRandom.h // // class HtRandom: // tools for random numbers // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRandom.h,v 1.5 2004/05/28 13:15:21 lha Exp $ // #ifndef _HtRandom_h_ #define _HtRandom_h_ class HtRandom { public: // produce a random unsigned int between v0 and v1 static inline unsigned int rnd(unsigned int v0,unsigned int v1) { return((rand()%(v1-v0)) + v0 ); } // randomly mix up an array of int's static int *randomize_v(int *vals,int n) { int i; if(!vals) { vals=new int[n]; for(i=0;i // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegex.cc,v 1.13 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtRegex.h" #include HtRegex::HtRegex() : compiled(0) { } HtRegex::HtRegex(const char *str, int case_sensitive) : compiled(0) { set(str, case_sensitive); } HtRegex::~HtRegex() { if (compiled != 0) regfree(&re); compiled = 0; } const String &HtRegex::lastError() { return lastErrorMessage; } int HtRegex::set(const char * str, int case_sensitive) { if (compiled != 0) regfree(&re); int err; compiled = 0; if (str == NULL) return 0; if (strlen(str) <= 0) return 0; if (err = regcomp(&re, str, case_sensitive ? REG_EXTENDED : (REG_EXTENDED|REG_ICASE)), err == 0) { compiled = 1; } else { size_t len = regerror(err, &re, 0, 0); char *buf = new char[len]; regerror(err, &re, buf, len); lastErrorMessage = buf; delete buf; } return compiled; } int HtRegex::setEscaped(StringList &list, int case_sensitive) { String *str; String transformedLimits; list.Start_Get(); while ((str = (String *) list.Get_Next())) { if (str->indexOf('[') == 0 && str->lastIndexOf(']') == str->length()-1) { transformedLimits << str->sub(1,str->length()-2).get(); } else // Backquote any regex special characters { for (int pos = 0; pos < str->length(); pos++) { if (strchr("^.[$()|*+?{\\", str->Nth(pos))) transformedLimits << '\\'; transformedLimits << str->Nth(pos); } } transformedLimits << "|"; } transformedLimits.chop(1); return set(transformedLimits, case_sensitive); } int HtRegex::match(const char * str, int nullpattern, int nullstr) { int rval; if (compiled == 0) return(nullpattern); if (str == NULL) return(nullstr); if (strlen(str) <= 0) return(nullstr); rval = regexec(&re, str, (size_t) 0, NULL, 0); if (rval == 0) return(1); else return(0); } htdig-3.2.0b6/htlib/HtRegex.h0100644006314600127310000000364110055635551015215 0ustar angusgbhtdig// // HtRegex.h // // HtRegex: A simple C++ wrapper class for the system regex routines. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegex.h,v 1.13 2004/05/28 13:15:21 lha Exp $ // // #ifndef _HtRegex_h_ #define _HtRegex_h_ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Object.h" #include "StringList.h" // This is an attempt to get around compatibility problems // with the included regex #ifdef _MSC_VER /* _WIN32 */ #include "regex_win32.h" #else # ifdef USE_RX # include # else // Use regex # ifdef HAVE_BROKEN_REGEX # include # else // include regex code and header # include "gregex.h" # endif # endif #endif /* _WIN32 */ #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ class HtRegex : public Object { public: // // Construction/Destruction // HtRegex(); HtRegex(const char *str, int case_sensitive = 0); virtual ~HtRegex(); // // Methods for setting the pattern // int set(const String& str, int case_sensitive = 0) { return set(str.get(), case_sensitive); } int set(const char *str, int case_sensitive = 0); int setEscaped(StringList &list, int case_sensitive = 0); virtual const String &lastError(); // returns the last error message // // Methods for checking a match // int match(const String& str, int nullmatch, int nullstr) { return match(str.get(), nullmatch, nullstr); } int match(const char *str, int nullmatch, int nullstr); protected: int compiled; regex_t re; String lastErrorMessage; }; #endif htdig-3.2.0b6/htlib/HtRegexList.cc0100644006314600127310000000602510055635551016206 0ustar angusgbhtdig// // HtRegexList.cc // // HtRegex: A list of HtRegex objects for handling large regex patterns // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexList.cc,v 1.5 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtRegexList.h" #include class listnode { public: listnode *next; Object *object; }; HtRegexList::HtRegexList() { compiled = 0; } HtRegexList::~HtRegexList() { compiled = 0; } const String &HtRegexList::lastError() { return lastErrorMessage; } int HtRegexList::setEscaped(StringList &list, int case_sensitive) { if (list.Count() == 0) { compiled = false; return true; } String *str; String transformedLimits, currentPattern, prevPattern; HtRegex *limit = new HtRegex; list.Start_Get(); while ((str = (String *) list.Get_Next())) { if (str->indexOf('[') == 0 && str->lastIndexOf(']') == str->length()-1) { transformedLimits = str->sub(1,str->length()-2).get(); } else // Backquote any regex special characters { transformedLimits = 0; for (int pos = 0; pos < str->length(); pos++) { if (strchr("^.[$()|*+?{\\", str->Nth(pos))) transformedLimits << '\\'; transformedLimits << str->Nth(pos); } } if (!currentPattern.empty()) currentPattern << "|"; currentPattern << transformedLimits; if (!limit->set(currentPattern.get(), case_sensitive)) { if (prevPattern.empty()) // we haven't set anything yet! { lastErrorMessage = limit->lastError(); compiled = 0; return false; } limit->set(prevPattern.get(), case_sensitive); // Go back a step Add(limit); limit = new HtRegex; currentPattern = transformedLimits; if (!limit->set(currentPattern.get(), case_sensitive)) { lastErrorMessage = limit->lastError(); compiled = 0; return false; } } prevPattern = currentPattern; } Add(limit); // OK, we're done so just add the last compiled pattern compiled = 1; return true; } int HtRegexList::match(const char * str, int nullpattern, int nullstr) { HtRegex *regx; if (compiled == 0) return(nullpattern); if (str == NULL) return(nullstr); if (strlen(str) <= 0) return(nullstr); if (number == 0) return(1); // An empty pattern matches everything Start_Get(); while ((regx = (HtRegex *) Get_Next())) { if (regx->match(str, nullpattern, nullstr)) { // Move this one to the front and update pointers if (cursor.current_index != -1) { if (cursor.prev) cursor.prev->next = cursor.current->next; cursor.prev = 0; cursor.current->next = head; head = cursor.current; cursor.current = head; cursor.current_index = -1; } return(1); } } return(0); } htdig-3.2.0b6/htlib/HtRegexList.h0100644006314600127310000000233510055635551016050 0ustar angusgbhtdig// // HtRegexList.h // // HtRegexList: A list of HtRegex objects for handling large regex patterns // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexList.h,v 1.4 2004/05/28 13:15:21 lha Exp $ // // #ifndef _HtRegexList_h_ #define _HtRegexList_h_ #include "Object.h" #include "List.h" #include "StringList.h" #include "HtRegex.h" class HtRegexList : public List { public: // // Construction/Destruction // HtRegexList(); virtual ~HtRegexList(); // // Setting (construct from a list of patterns) // int setEscaped(StringList &list, int case_sensitive = 0); virtual const String &lastError(); // returns the last error message // // Methods for checking a match // int match(const String& str, int nullmatch, int nullstr) { return match(str.get(), nullmatch, nullstr); } int match(const char *str, int nullmatch, int nullstr); protected: int compiled; String lastErrorMessage; private: }; #endif htdig-3.2.0b6/htlib/HtRegexReplace.cc0100644006314600127310000000715410055635551016652 0ustar angusgbhtdig// // HtRegexReplace.cc // // HtRegexReplace: A subclass of HtRegex that can perform replacements // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexReplace.cc,v 1.4 2004/05/28 13:15:21 lha Exp $ // #include "HtRegexReplace.h" #include HtRegexReplace::HtRegexReplace() { } HtRegexReplace::HtRegexReplace(const char *from, const char *to, int case_sensitive) : HtRegex(from, case_sensitive) { memset(®s, 0, sizeof(regs)); repBuf = 0; segSize = segUsed = 0; segMark = 0; repLen = 0; setReplace(to); } HtRegexReplace::~HtRegexReplace() { empty(); } int HtRegexReplace::replace(String &str, int nullpattern, int nullstr) { const int regCount = sizeof(regs) / sizeof(regs[0]); if (compiled == 0 || repBuf == 0) return nullpattern; if (str.length() == 0) return nullstr; if (regexec(&re, str.get(), regCount, regs, 0) == 0) { // Firstly work out how long the result string will be. We think this will be more effecient // than letting the buffer grow in stages as we build the result, but who knows? //cout << "!!! Match !!!" << endl; size_t resLen = repLen; int i, reg, repPos; const char *src = str.get(); for (i = 1; i < (int) segUsed; i += 2) { reg = segMark[i]; if (reg < regCount && regs[reg].rm_so != -1) resLen += regs[reg].rm_eo - regs[reg].rm_so; } //cout << "result will be " << resLen << " chars long" << endl; String result(resLen); // Make the result string preallocating the buffer size for (i = 0, repPos = 0;; ) { //cout << "appending segment " << i << endl; result.append(repBuf + repPos, segMark[i] - repPos); // part of the replace string repPos = segMark[i]; // move forward if (++i == (int) segUsed) break; // was that the last segment? reg = segMark[i++]; // get the register number if (reg < regCount && regs[reg].rm_so != -1) result.append((char *) src + regs[reg].rm_so, regs[reg].rm_eo - regs[reg].rm_so); } str = result; //cout << "return " << result.get() << endl; return 1; } return 0; } // Private: place a mark in the mark buffer growing it if necessary. void HtRegexReplace::putMark(int n) { // assert(segUsed <= segSize); if (segUsed == segSize) { size_t newSize = segSize * 2 + 5; // grow in chunks int *newMark = new int[newSize]; // do we assume that new can't fail? memcpy(newMark, segMark, segSize * sizeof(int)); delete segMark; segMark = newMark; segSize = newSize; } segMark[segUsed++] = n; } void HtRegexReplace::empty() { // Destroy any existing replace pattern delete repBuf; repBuf = 0; segSize = segUsed = 0; delete segMark; segMark = 0; repLen = 0; } void HtRegexReplace::setReplace(const char *to) { empty(); repBuf = new char[strlen(to)]; // replace buffer can never contain more text than to string int bufPos = 0; // our position within the output buffer while (*to) { if (*to == '\\') { if (*++to == '\0') break; if (*to >= '0' && *to <= '9') { putMark(bufPos); putMark(*to - '0'); } else { // We could handle some C style escapes here, but instead we just pass the character // after the backslash through. This means that \\, \" and \' will do the right thing. // It's unlikely that anyone will need any C style escapes in ht://Dig anyway. repBuf[bufPos++] = *to; } to++; } else { repBuf[bufPos++] = *to++; } } putMark(bufPos); repLen = (size_t) bufPos; } htdig-3.2.0b6/htlib/HtRegexReplace.h0100644006314600127310000000244310055635551016510 0ustar angusgbhtdig// // HtRegexReplace.h // // HtRegexReplace: A subclass of HtRegex that can perform replacements // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexReplace.h,v 1.4 2004/05/28 13:15:21 lha Exp $ // #ifndef _HtRegexReplace_h_ #define _HtRegexReplace_h_ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtRegex.h" class HtRegexReplace : public HtRegex { public: // // Construction/Destruction // HtRegexReplace(); HtRegexReplace(const char *from, const char *to, int case_sensitive = 0); virtual ~HtRegexReplace(); // // Methods for setting the replacement pattern // void setReplace(const String& str) { setReplace(str.get()); } void setReplace(const char *str); // // Methods for replacing // int replace(String &str, int nullpattern = 0, int nullstr = 0); protected: char *repBuf; // Replace text. size_t segSize, segUsed; int *segMark; size_t repLen; regmatch_t regs[10]; // Various private methods void putMark(int n); void empty(); }; #endif htdig-3.2.0b6/htlib/HtRegexReplaceList.cc0100644006314600127310000000365110055635551017504 0ustar angusgbhtdig// // HtRegexReplaceList.cc // // HtRegexReplaceList: Perform RegexReplace on a list of from/to pairs. // Patterns are applied in order; pattern matching // doesn't stop when a match occurs. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexReplaceList.cc,v 1.5 2004/05/28 13:15:21 lha Exp $ // // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtRegexReplaceList.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ HtRegexReplaceList::HtRegexReplaceList(StringList &list, int case_sensitive ) { if (list.Count() & 1) { lastErrorMessage = "HtRegexReplaceList needs an even number of strings"; return; } int i; String err; for (i = 0; i < list.Count(); i += 2) { String from = list[i]; String to = list[i+1]; HtRegexReplace *replacer = new HtRegexReplace(from.get(), to.get(), case_sensitive); replacers.Add(replacer); // Stash it even if there's an error so it will get destroyed later const String &err = replacer->lastError(); if (err.length() != 0) { lastErrorMessage = err; return; } } } HtRegexReplaceList::~HtRegexReplaceList() { // replacers gets chucked away } int HtRegexReplaceList::replace(String &str, int nullpattern , int nullstr ) { int repCount = replacers.Count(); int doneCount = 0; for (int rep = 0; rep < repCount; rep++) { HtRegexReplace *replacer = (HtRegexReplace *) replacers[rep]; if (replacer->replace(str, nullpattern, nullstr) > 0) doneCount++; } return doneCount; } const String &HtRegexReplaceList::lastError() { return lastErrorMessage; } // End of HtRegexReplaceList.cc htdig-3.2.0b6/htlib/HtRegexReplaceList.h0100644006314600127310000000221310055635551017337 0ustar angusgbhtdig// // HtRegexReplaceList.h // // HtRegexReplaceList: Perform RegexReplace on a list of from/to pairs. // Patterns are applied in order; pattern matching // doesn't stop when a match occurs. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtRegexReplaceList.h,v 1.4 2004/05/28 13:15:21 lha Exp $ // #ifndef __HtRegexReplaceList_h #define __HtRegexReplaceList_h #include "HtRegexReplace.h" #include "List.h" #include "StringList.h" class HtRegexReplaceList : public Object { public: // Construct a HtRegexReplaceList. |list| should contain an even // number of strings that constitute from/to pairs. HtRegexReplaceList(StringList &list, int case_sensitive = 0); virtual ~HtRegexReplaceList(); int replace(String &str, int nullpattern = 0, int nullstr = 0); virtual const String &lastError(); private: List replacers; String lastErrorMessage; }; #endif /* __HtRegexReplaceList_h */ htdig-3.2.0b6/htlib/HtTime.h0100644006314600127310000000454610055635551015046 0ustar angusgbhtdig// HtTime.h // // class HtTime: // tools for timing // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtTime.h,v 1.8 2004/05/28 13:15:21 lha Exp $ // #ifndef _HtTime_h_ #define _HtTime_h_ #if TIME_WITH_SYS_TIME #include #include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef _MSC_VER /* _WIN32 */ #include #endif class HtTime { public: // time in seconds (double format) static inline double DTime() { #ifdef _MSC_VER /* _WIN32 */ struct timeb tb; ftime(&tb); return((double)((tb.millitm/1000)+tb.time+tb.timezone)); #else struct timeval tv; gettimeofday(&tv,NULL); return(tv.tv_usec/1000000.0+tv.tv_sec); #endif } // time in seconds relative to T0 (double format) static inline double DTime(double T0) { #ifdef _MSC_VER /* _WIN32 */ struct timeb tb; ftime(&tb); return((double)(((tb.millitm/1000)+tb.time+tb.timezone))-T0); #else struct timeval tv; gettimeofday(&tv,NULL); return((tv.tv_usec/1000000.0+tv.tv_sec)-T0); #endif } // Do something every x seconds class Periodic { double t0; double last; double period; public: double total(){return(HtTime::DTime(t0));} void change_period(double nperiod){period=nperiod;} int operator()(double *prperiod=NULL) { double t=HtTime::DTime(t0); if(prperiod){*prperiod=t-last;} if((t-last)>period) { last=t; return(1); } return(0); } Periodic(double nperiod=.1) { period=nperiod; t0=HtTime::DTime(); last=0; } }; #ifdef NOTDEF // print progression message every x seconds class Progression { double t0; double last; double period; char *label; public: double total(){return(HtTime::DTime()-t0);} int operator()(double x) { double t=HtTime::DTime()-t0; if((t-last)>period) { last=t; printf("%s (%f): %f\n",label,t,x); return(1); } return(0); } Progression(double nperiod=.1,char *nlabel=(char *)"progression") { label=nlabel; period=nperiod; t0=HtTime::DTime(); last=0; } }; #endif }; #endif // _HtTime_h_ htdig-3.2.0b6/htlib/HtVector.cc0100644006314600127310000001625310055635551015546 0ustar angusgbhtdig// // HtVector.cc // // HtVector: A Vector class which holds objects of type Object. // (A vector is an array that can expand as necessary) // This class is very similar in interface to the List class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtVector.cc,v 1.11 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtVector.h" //********************************************************************* // void HtVector::HtVector() // Default constructor // HtVector::HtVector() { data = new Object *[4]; // After all, why would anyone want an empty vector? element_count = 0; allocated = 4; current_index = -1; } //********************************************************************* // void HtVector::HtVector(int capacity) // Constructor with known capacity // (has the side effect of not allocating double memory) // HtVector::HtVector(int capacity) { data = new Object *[capacity]; element_count = 0; allocated = capacity; current_index = -1; } //********************************************************************* // void HtVector::~HtVector() // Destructor // HtVector::~HtVector() { Destroy(); } //********************************************************************* // void HtVector::Release() // Remove all objects from the vector, but do not delete them void HtVector::Release() { for (current_index = 0; current_index < element_count; current_index++) { data[current_index] = NULL; } if (data) delete [] data; data = NULL; allocated = 0; element_count = 0; current_index = -1; } //********************************************************************* // void HtVector::Destroy() // Deletes all objects from the vector // void HtVector::Destroy() { for (current_index = 0; current_index < element_count; current_index++) if (data[current_index]) { delete data[current_index]; data[current_index] = NULL; } if (data) delete [] data; data = NULL; allocated = 0; element_count = 0; current_index = -1; } //********************************************************************* // void HtVector::Add(Object *object) // Add an object to the list. // void HtVector::Add(Object *object) { Allocate(element_count+1); data[element_count] = object; element_count += 1; } //********************************************************************* // void HtVector::Insert(Object *object, int position) // Add an object into the list. // void HtVector::Insert(Object *object, int position) { if (position < 0) return; if (position >= element_count) { Add(object); return; } Allocate(element_count + 1); for (int i = element_count; i > position; i--) data[i] = data[i-1]; data[position] = object; element_count += 1; } //********************************************************************* // void HtVector::Assign(Object *object, int position) // Assign an object to the position // void HtVector:: Assign(Object *object, int position) { // Simply perform an insert, followed by a remove! Insert(object, position); RemoveFrom(position + 1); return; } //********************************************************************* // int HtVector::Remove(Object *object) // Remove an object from the list. // int HtVector::Remove(Object *object) { return RemoveFrom(Index(object)); } //********************************************************************* // int HtVector::RemoveFrom(int position) // Remove an object from the list. // int HtVector::RemoveFrom(int position) { if (position < 0 || position >= element_count) return NOTOK; for (int i = position; i < element_count - 1; i++) data[i] = data[i+1]; element_count -= 1; return OK; } //********************************************************************* // Object *HtVector::Get_Next() // Return the next object in the list. // Object *HtVector::Get_Next() { current_index++; if (current_index >= element_count) return 0; return data[current_index]; } //********************************************************************* // Object *HtVector::Get_First() // Return the first object in the list. // Object *HtVector::Get_First() { if (!IsEmpty()) { current_index = 0; return data[0]; } else return 0; } //********************************************************************* // int HtVector::Index(Object *obj) // Return the index of an object in the list. // int HtVector::Index(Object *obj) { int index = 0; while (index < element_count && data[index] != obj) { index++; } if (index >= element_count) return -1; else return index; } //********************************************************************* // Object *HtVector::Next(Object *prev) // Return the next object in the list. Using this, the list will // appear as a circular list. // Object *HtVector::Next(Object *prev) { current_index = Index(prev); if (current_index == -1) return 0; current_index++; // We should probably do this with remainders if (current_index >= element_count) current_index = 0; return data[current_index]; } //********************************************************************* // Object *HtVector::Previous(Object *next) // Return the previous object in the vector. Using this, the vector will // appear as a circular list. // Object *HtVector::Previous(Object *next) { current_index = Index(next); if (current_index == -1) return 0; current_index--; // We should probably do this with remainders if (current_index < 0) current_index = element_count - 1; return data[current_index]; } //********************************************************************* // Object *HtVector::Copy() const // Return a deep copy of the vector. // Object *HtVector::Copy() const { HtVector *vector = new HtVector(allocated); for(int i = 0; i < Count(); i++) vector->Add(data[i]->Copy()); return vector; } //********************************************************************* // HtVector &HtVector::operator=(HtVector &vector) // Return a deep copy of the list. // HtVector &HtVector::operator=(HtVector &vector) { Destroy(); for(int i = 0; i < vector.Count(); i++) Add(vector.data[i]->Copy()); return *this; } //********************************************************************* // int Allocate(int capacity) // Ensure there is at least capacity space in the vector // void HtVector::Allocate(int capacity) { if (capacity > allocated) // Darn, we actually have to do work :-) { Object **old_data = data; // Ensure we have more than the capacity and we aren't // always rebuilding the vector (which leads to quadratic behavior) while (allocated < capacity) allocated *= 2; data = new Object *[allocated]; for (int i = 0; i < element_count; i++) { data[i] = old_data[i]; old_data[i] = NULL; } if (old_data) delete [] old_data; } } htdig-3.2.0b6/htlib/HtVector.h0100644006314600127310000000714310055635551015406 0ustar angusgbhtdig// // HtVector.h // // HtVector: A Vector class which holds objects of type Object. // (A vector is an array that can expand as necessary) // This class is very similar in interface to the List class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtVector.h,v 1.10 2004/05/28 13:15:21 lha Exp $ // // #ifndef _HtVector_h_ #define _HtVector_h_ #include "Object.h" class HtVector : public Object { public: // // Constructor/Destructor // HtVector(); HtVector(int capacity); ~HtVector(); // // Add() will append an Object to the end of the vector // void Add(Object *); // // Insert() will insert an object at the given position. If the // position is larger than the number of objects in the vector, the // object is appended; no new objects are created between the end // of the vector and the given position. // void Insert(Object *, int position); // // Assign() will assign the object to the given position, replacing // the object currently there. It is functionally equivalent to calling // RemoveFrom() followed by Insert() void Assign(Object *, int position); // // Find the given object in the vector and remove it from the vector. // The object will NOT be deleted. If the object is not found, // NOTOK will be returned, else OK. // int Remove(Object *); // // Remove the object at the given position // (in some sense, the inverse of Insert) // int RemoveFrom(int position); // // Release() will remove all the objects from the vector. // This will NOT delete them void Release(); // // Destroy() will delete all the objects in the vector. This is // equivalent to calling the destructor // void Destroy(); // // Vector traversel (a bit redundant since you can use []) // void Start_Get() {current_index = -1;} Object *Get_Next(); Object *Get_First(); Object *Next(Object *current); Object *Previous(Object *current); Object *Last() {return element_count<=0?(Object *)NULL:data[element_count-1];} // // Direct access to vector items. To assign new objects, use // Insert() or Add() or Assign() // Object *operator[] (int n) {return (n<0||n>=element_count)?(Object *)NULL:data[n];} Object *Nth(int n) {return (n<0||n>=element_count)?(Object *)NULL:data[n];} // // Access to the number of elements // int Count() const {return element_count;} int IsEmpty() {return element_count==0;} // // Get the index number of an object. If the object is not found, // returns -1 // int Index(Object *); // // Deep copy member function // Object *Copy() const; // // Vector Assignment // HtVector &operator= (HtVector *vector) {return *this = *vector;} HtVector &operator= (HtVector &vector); protected: // // The actual internal data array Object **data; // // For traversal it is nice to know where we are... // int current_index; // // It's nice to keep track of how many things we contain... // as well as how many slots we've declared // int element_count; int allocated; // // Protected function to ensure capacity // void Allocate(int ensureCapacity); }; #endif htdig-3.2.0b6/htlib/HtVectorGeneric.cc0100644006314600127310000000364310055635551017042 0ustar angusgbhtdig// // HtVectorGeneric.cc // // HtVectorGeneric: A Vector class which holds objects of type GType. // (A vector is an array that can expand as necessary) // This class is very similar in interface to the List class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtVectorGeneric.cc,v 1.5 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtVector_int.h" #define GType int #define HtVectorGType HtVector_int #include "HtVectorGenericCode.h" #define GType char #define HtVectorGType HtVector_char #include "HtVectorGeneric.h" #define GType char #define HtVectorGType HtVector_char #include "HtVectorGenericCode.h" #include"HtVector_String.h" #define GType String #define HtVectorGType HtVector_String #include "HtVectorGenericCode.h" #define GType double #define HtVectorGType HtVector_double #include "HtVectorGeneric.h" #define GType double #define HtVectorGType HtVector_double #include "HtVectorGenericCode.h" #include // this is just to check if it compiles ok class ZOZO { int a,b,c; public: void show(){printf("ZOZO SHOW:%d %d %d\n",a,b,c);} ZOZO() { a=1; b=2; c=3; } }; #define HTVECTORGENERIC_NOTCOMPARABLE #define GType ZOZO #define HtVectorGType HtVector_ZOZO #include "HtVectorGeneric.h" #define HTVECTORGENERIC_NOTCOMPARABLE #define GType ZOZO #define HtVectorGType HtVector_ZOZO #include "HtVectorGenericCode.h" void test_HtVectorGeneric() { HtVector_int intv; HtVector_char charv; HtVector_ZOZO vz; ZOZO zz; vz.push_back(zz); vz.push_back(zz); vz.push_back(zz); int i; for(i=0;i // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtVectorGeneric.h,v 1.5 2004/05/28 13:15:21 lha Exp $ // // // #ifndef _HtVectorGeneric_h_ //#define _HtVectorGeneric_h_ // HOWTO use: // let's say you have a class called Zozo (that has to have an // empty constructor Zozo::Zozo() ) // You want to use vectors of Zozo's (called HtVector_Zozo ) // // In every file you use it you must include its declaration: // // #define GType Zozo // #define HtVectorGType HtVector_Zozo // #include "HtVectorGeneric.h" // // Then you can use it: // HtVector_Zozo vect; // Zozo a,b,c; // vect.push_back(a); // vect.push_back(b); // vect[0]=c; // // Somewhere in some .cc file you have to // // #define GType Zozo // #define HtVectorGType HtVector_Zozo // #include "HtVectorGenericCode.h" // // // Notes: // *If you include the declaration more // than once in the same scope you will get // errors (HtVector_Zozo : already declared) // // *Bounds checking is on by default, this should be // changed (it's performance critical), if your'e // out of bounds an error is printed on cerr // but the prg doesnt stop (maybe it should?) // // *vectors containing pointers DO NOT FREE // them, this is deliberate // #include "Object.h" class HtVectorGType : public Object { public: // // Constructor/Destructor // HtVectorGType(); HtVectorGType(int capacity); ~HtVectorGType(); protected: // // this error checking should be made optional! // inline void CheckBounds(const int n) const {if(n<0 || n>=element_count){ fprintf(stderr, "HtVectorGType::CheckBounds: out of bounds.\n");}} public: // // Insert() will insert an object at the given position. If the // position is larger than the number of objects in the vector, the // object is appended; no new objects are created between the end // of the vector and the given position. // void Insert(const GType &, int position); // *** this is obsolete in HtVectorGeneric ** use: vector[position]=value; // void Assign(GType , int position); // // Remove the object at the given position // (in some sense, the inverse of Insert) // void RemoveFrom(int position); // Release is obsolete since no deletions of pointers contained in // the vector is done // void Release(); // // Destroy() will delete all the objects in the vector. // Warning: no deletions of pointers contained in // the vector are done (that's up to you) // void Destroy(); // // Vector traversal (a bit redundant since you can use []) // void Start_Get() {current_index = -1;} GType & Get_Next(); GType & Get_First(); GType & Last() {return Nth(element_count-1);} // // Direct access to vector items. To assign new objects, use // Insert() or Add() or Assign() // inline GType & Nth(int n) { #ifdef HtVectorGeneric_CheckBounds CheckBounds(n); #endif return data[n]; } inline const GType & Nth(int n) const { #ifdef HtVectorGeneric_CheckBounds CheckBounds(n); #endif return data[n]; } inline GType & operator[] (int n) {return Nth(n);} inline const GType & operator[] (int n) const {return Nth(n);} // // Access to the number of elements // inline int Count() const {return element_count;} inline int IsEmpty() {return element_count==0;} // // Accesses wich involve finding an element (only possible if // we can compare two elements) // #ifndef HTVECTORGENERIC_NOTCOMPARABLE // // Get the index number of an object. If the object is not found, // returns -1 // int Index(const GType &); GType & Next(const GType ¤t); GType & Previous(const GType ¤t); // // Find the given object in the vector and remove it from the vector. // The object will NOT be deleted. If the object is not found, // NOTOK will be returned, else OK. // void Remove(const GType &); #endif // // Deep copy member function // Object *Copy() const; // // Vector Assignment // HtVectorGType &operator= (HtVectorGType *vector) {return *this = *vector;} HtVectorGType &operator= (const HtVectorGType &vector); protected: // // The actual internal data array GType *data; // // For traversal it is nice to know where we are... // int current_index; // // It's nice to keep track of how many things we contain... // as well as how many slots we've declared // int element_count; int allocated; protected: // // Protected function to ensure capacity // inline void Allocate(int capacity) { if (capacity > allocated){ActuallyAllocate(capacity);} } void ActuallyAllocate(int); public: // // Add() will append an object to the end of the vector // inline void Add(const GType &object) { Allocate(element_count+1); data[element_count] = object; element_count += 1; } // // STL like accesors // public: inline int size() const {return Count();} inline void push_back(const GType &v) {Add( v);} inline GType * begin() {return(data);} inline const GType * begin() const {return(data);} inline GType * end() {return(data+element_count);} inline const GType * end() const {return(data+element_count);} inline GType & back() {return Nth(element_count-1);} inline const GType & back() const {return Nth(element_count-1);} inline void pop_back() {RemoveFrom(size()-1);} inline void clear() {;} void reserve (int n) {Allocate(n);} // TODO: erase clear resize insert(...) and many others }; // #endif #ifdef HTVECTORGENERIC_NOTCOMPARABLE #undef HTVECTORGENERIC_NOTCOMPARABLE #endif #undef HtVectorGType #undef GType htdig-3.2.0b6/htlib/HtVectorGenericCode.h0100644006314600127310000001427410055635551017501 0ustar angusgbhtdig// // HtVectorGenericCode.h // // HtVectorGeneric: A Vector class which holds objects of type GType. // (A vector is an array that can expand as necessary) // This class is very similar in interface to the List class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtVectorGenericCode.h,v 1.5 2004/05/28 13:15:21 lha Exp $ // //********************************************************************* // void HtVectorGType::HtVectorGType() // Default constructor // HtVectorGType::HtVectorGType() { data = new GType[4]; // After all, why would anyone want an empty vector? element_count = 0; allocated = 4; current_index = -1; } //********************************************************************* // void HtVectorGType::HtVectorGType(int capacity) // Constructor with known capacity // (has the side effect of not allocating double memory) // HtVectorGType::HtVectorGType(int capacity) { data = new GType[capacity]; element_count = 0; allocated = capacity; current_index = -1; } //********************************************************************* // void HtVectorGType::~HtVectorGType() // Destructor // HtVectorGType::~HtVectorGType() { Destroy(); } //********************************************************************* // void HtVectorGType::Destroy() // Deletes all objects from the vector // void HtVectorGType::Destroy() { if (data) delete [] data; data = NULL; allocated = 0; element_count = 0; current_index = -1; } //********************************************************************* // void HtVectorGType::Insert(GType object, int position) // Add an object into the list. // void HtVectorGType::Insert(const GType &object, int position) { if (position < 0) {CheckBounds(position);} if (position >= element_count) { Add(object); return; } Allocate(element_count + 1); for (int i = element_count; i > position; i--) data[i] = data[i-1]; data[position] = object; element_count += 1; } //********************************************************************* // int HtVectorGType::RemoveFrom(int position) // Remove an object from the list. // void HtVectorGType::RemoveFrom(int position) { CheckBounds(position); for (int i = position; i < element_count - 1; i++) { data[i] = data[i+1]; } element_count -= 1; } //********************************************************************* // GType HtVectorGType::Get_Next() // Return the next object in the list. // GType &HtVectorGType::Get_Next() { current_index++; CheckBounds(current_index); return data[current_index]; } //********************************************************************* // GType HtVectorGType::Get_First() // Return the first object in the list. // GType &HtVectorGType::Get_First() { CheckBounds(0); return data[0]; } #ifndef HTVECTORGENERIC_NOTCOMPARABLE //********************************************************************* // int HtVectorGType::Index(GType obj) // Return the index of an object in the list. // int HtVectorGType::Index(const GType &obj) { int index0 = 0; while (index0 < element_count && data[index0] != obj) { index0++; } if (index0 >= element_count) return -1; else return index0; } //********************************************************************* // GType HtVectorGType::Next(GType prev) // Return the next object in the list. Using this, the list will // appear as a circular list. // GType &HtVectorGType::Next(const GType & prev) { current_index = Index(prev); CheckBounds(current_index); current_index++; // We should probably do this with remainders return Nth(current_index); } //********************************************************************* // GType HtVectorGType::Previous(GType next) // Return the previous object in the vector. Using this, the vector will // appear as a circular list. // GType &HtVectorGType::Previous(const GType & next) { current_index = Index(next); CheckBounds(current_index); current_index--; // We should probably do this with remainders return Nth(current_index); } //********************************************************************* // int HtVectorGType::Remove(GType object) // Remove an object from the list. // void HtVectorGType::Remove(const GType &object) { int pos = Index(object); CheckBounds(pos); RemoveFrom(pos); } #endif //********************************************************************* // HtVectorGType *HtVectorGType::Copy() const // Return a deep copy of the vector. // Object *HtVectorGType::Copy() const { HtVectorGType *vector = new HtVectorGType(allocated); for(int i = 0; i < Count(); i++) { #ifdef HTVECTORGENERIC_OBJECTPTRTYPE vector->Add(data[i]->Copy()); #else vector->Add(data[i]); #endif } return vector; } //********************************************************************* // HtVectorGType &HtVectorGType::operator=(HtVectorGType &vector) // Return a deep copy of the list. // HtVectorGType &HtVectorGType::operator=(const HtVectorGType &vector) { Destroy(); for(int i = 0; i < vector.Count(); i++) { Add(vector.data[i]); } return *this; } //********************************************************************* // int Allocate(int capacity) // Ensure there is at least capacity space in the vector // void HtVectorGType::ActuallyAllocate(int capacity) { if (capacity > allocated) // Darn, we actually have to do work :-) { GType *old_data = data; // Ensure we have more than the capacity and we aren't // always rebuilding the vector (which leads to quadratic behavior) if(!allocated){allocated=1;} while (allocated < capacity) allocated *= 2; data = new GType[allocated]; for (int i = 0; i < element_count; i++) { data[i] = old_data[i]; } if (old_data) delete [] old_data; } } #ifdef HTVECTORGENERIC_NOTCOMPARABLE #undef HTVECTORGENERIC_NOTCOMPARABLE #endif #undef HtVectorGType #undef GType htdig-3.2.0b6/htlib/HtVector_String.h0100644006314600127310000000073110055635551016730 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifndef _HtVector_String_h_ #define _HtVector_String_h_ #include"htString.h" #define GType String #define HtVectorGType HtVector_String #include "HtVectorGeneric.h" #endif htdig-3.2.0b6/htlib/HtVector_int.h0100644006314600127310000000066710055635551016264 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifndef _HtVector_int_h_ #define _HtVector_int_h_ #define GType int #define HtVectorGType HtVector_int #include "HtVectorGeneric.h" #endif htdig-3.2.0b6/htlib/HtWordCodec.cc0100644006314600127310000002747710055635551016167 0ustar angusgbhtdig// // HtWordCodec.cc // // HtWordCodec: Given two lists of pair of "words" 'from' and 'to'; // simple one-to-one translations, use those lists to translate. // Only restriction are that no null (0) characters must be // used in "words", and that there is a character "joiner" that // does not appear in any word. One-to-one consistency may be // checked at construction. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtWordCodec.cc,v 1.9 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtWordCodec.h" // Do not use 0, so we can use "normal" string routines. // Values 1..4 are used to describe how many bytes are used to // keep the number. Do not use other than control-characters, // as the first character for internal encodings, so the user // can use "international" characters (128 .. 255) for cute // encodings to use across different configuration files and // databases. #define JOIN_CHAR 5 #define QUOTE_CHAR 6 #define FIRST_INTERNAL_SINGLECHAR 7 #define LAST_INTERNAL_SINGLECHAR 31 HtWordCodec::HtWordCodec() { myFrom = 0; myTo = 0; myFromMatch = 0; myToMatch = 0; } HtWordCodec::~HtWordCodec() { if (myFrom) delete myFrom; if (myTo) delete myTo; if (myFromMatch) delete myFromMatch; if (myToMatch) delete myToMatch; } // Straightforward filling of the encoding-lists. HtWordCodec::HtWordCodec(StringList *from, StringList *to, char joiner) { myFromMatch = new StringMatch; myToMatch = new StringMatch; myTo = to; myFrom = from; String to_pattern(myTo->Join(joiner)); // After being initialized with Join, the strings are not // null-terminated, but that is done through "operator char*". myToMatch->Pattern(to_pattern, joiner); String from_pattern(myFrom->Join(joiner)); myFromMatch->Pattern(from_pattern, joiner); } // This constructor is the most complicated function in this class. // It handles consistency checking for the supplied code-lists. // Cleanups for anything except myTo, myFrom, myToMatch is // necessary. The member myFromMatch is used as a sanity check // for member functions to see that the constructor was // successful in case the programmer forgets to check errmsg. HtWordCodec::HtWordCodec(StringList &requested_encodings, StringList &frequent_substrings, String &errmsg) { if ((requested_encodings.Count() % 2) != 0) { errmsg = "Expected pairs, got odd number of strings"; return; } myFrom = new StringList; myTo = new StringList; // Go through requested_encodings and fill myTo and myFrom. // Check that the "to" strings look remotely sane regarding // reserved characters. // Iteration temporaries. String *from; String *to; int n_of_pairs = requested_encodings.Count() / 2; requested_encodings.Start_Get(); while ((from = (String *) requested_encodings.Get_Next()) != NULL) { // Sanity check: Reserve empty strings as we cannot do // anything sane with them. int templen = from->length(); if (templen == 0) { errmsg = "Empty strings are not allowed"; return; } myFrom->Add(new String(*from)); // This must be non-null since we checked "oddness" above. to = (String *) requested_encodings.Get_Next(); templen = to->length(); if (templen == 0) { errmsg = "Empty strings are not allowed"; return; } // We just have to check that there's no JOIN_CHAR in the // string. Since no "to" is allowed to be part of any other // "to", there will be no ambiguity, even if one would // contain a QUOTE_CHAR (which is documented as invalid anyway). if (strchr(from->get(), JOIN_CHAR) != NULL) { errmsg = form("(\"%s\" =>) \"%s\" contains a reserved character (number %d)", from->get(), to->get(), int(JOIN_CHAR)); return; } // Loop over the other "to"-strings and check that this // string is not a substring of any other "to", or vice versa. // Return in error if it is so. int i; int count = myTo->Count(); for (i = 0; i < count; i++) { String *ith = (String *) myTo->Nth(i); // Just check if the shorter string is part of the // longer string. if (to->length() < ith->length() ? ith->indexOf(to->get()) != -1 : to->indexOf(ith->get()) != -1) { errmsg = form("\"%s\" => \"%s\" collides with (\"%s\" => \"%s\")", from, to, (*myFrom)[i], ith->get()); return; } } // All ok, just add this one. myTo->Add(new String(*to)); } // Check that none of the "to"-strings is a substring of any // of the "from" strings, since that's hard to support and // most probably is a user mistake anyway. StringMatch req_tos; String req_to_pattern(myTo->Join(JOIN_CHAR)); int which, length; // The StringMatch functions want the strings // zero-terminated, which is done through "operator char*". req_tos.Pattern(req_to_pattern, JOIN_CHAR); // Check the requested encodings. if (n_of_pairs != 0) { int i; for (i = 0; i < n_of_pairs; i++) { from = (String *) myFrom->Nth(i); if (req_tos.FindFirst(from->get(), which, length) != -1) { if (i != which) { errmsg = form("(\"%s\" => \"%s\") overlaps (\"%s\" => \"%s\")", (*myFrom)[which], (*myTo)[which], from->get(), (*myTo)[i]); } else { errmsg = form("Overlap in (\"%s\" => \"%s\")", from->get(), (*myTo)[i]); } return; } } } if (frequent_substrings.Count() != 0) { // Make a temporary search-pattern of the requested // from-strings. StringMatch req_froms; String req_from_pattern(myFrom->Join(JOIN_CHAR)); req_froms.Pattern(req_from_pattern, JOIN_CHAR); // Continue filling "to" and "from" from frequent_substrings and // internal encodings. If a frequent_substring is found in the // requested from-strings, it is ignored, but the internal // encoding is still ticked up, so that changes in // requested_encodings (e.g. url_part_aliases) do not change // an existing database (e.g. containing common_url_parts). int internal_encoding_no = 0; String *common_part; frequent_substrings.Start_Get(); String to; for (; (common_part = (String *) frequent_substrings.Get_Next()) != NULL; internal_encoding_no++) { int templen = common_part->length(); if (templen == 0) { errmsg = "Empty strings are not allowed"; return; } // Is a "From" string in it, or is a "To" string in it? // Note that checking if there are *any* requested // encodings (n_of_pairs) is not just an "optimization"; // it is necessary since StringMatch will return 0 (not // -1) if the pattern is empty (FIXME: changing that // breaks something else in another part of ht://Dig). if (n_of_pairs && (req_froms.FindFirst(common_part->get()) != -1 || req_tos.FindFirst(common_part->get()) != -1)) continue; to = 0; // Clear previous run. // Dream up an encoding without zeroes. // Use FIRST_INTERNAL_SINGLECHAR .. LAST_INTERNAL_SINGLECHAR // for the first encodings, as much as possible. long int number_to_store = internal_encoding_no + FIRST_INTERNAL_SINGLECHAR; if (number_to_store <= LAST_INTERNAL_SINGLECHAR) { to << char(number_to_store); } else { // Use // to code the rest. // Note that we assume eight-bit chars here, which // should be ok for all systems you run htdig on. // At least it helps clarity here. number_to_store -= LAST_INTERNAL_SINGLECHAR; // Make sure highest bit in every byte is "1" by // inserting one there. char to_store[sizeof(number_to_store)+1]; int j = 1; while (number_to_store > 0x7f) { number_to_store = ((number_to_store & ~0x7f) << 1) | 0x80 | (number_to_store & 0x7f); to_store[j++] = char(number_to_store); number_to_store >>= 8; } // Finally, store the highest byte. It too shall have // the highest bit set. This is the easiest way to // adjust it not to be QUOTE_CHAR. to_store[0] = j; to_store[j] = char(number_to_store | 0x80); to.append(to_store, j+1); } // Add to replacement pairs. myFrom->Add(new String(*common_part)); myTo->Add(new String(to)); } } // Now, add the quoted "to":s to the "to"-list, with the unquoted // "to":s to the "from"-list. This way we do not have to // check for quoting separately. Like this: // From To // foo : ! // bar : > // baz : $ // ! : \! // > : \> // $ : \$ // // Since we checked that none of the "To":s are in a "From" we // can do this. myTo->Start_Get(); int to_count = myTo->Count(); String *current; String temp; int i; for (i = 0; i < to_count; i++) { // It works to append *and* iterate through a // StringList, despite not having an iterator class. current = (String *) myTo->Nth(i); myFrom->Add(new String(*current)); temp = 0; // Reset any previous round. temp.append(char(QUOTE_CHAR)); temp.append(*current); myTo->Add(new String(temp)); } myFromMatch = new StringMatch; myToMatch = new StringMatch; String to_pattern(myTo->Join(JOIN_CHAR)); String from_pattern(myFrom->Join(JOIN_CHAR)); // StringMatch class has unchecked limits, better check them. // The length of each string in the pattern an the upper limit // of the needs. if (to_pattern.length() - (myTo->Count() - 1) > 0xffff || from_pattern.length() - (myFrom->Count() - 1) > 0xffff) { errmsg = "Limit reached; use fewer encodings"; return; } myToMatch->Pattern(to_pattern, JOIN_CHAR); myFromMatch->Pattern(from_pattern, JOIN_CHAR); errmsg = 0; } // We only need one "coding" function, since quoting and unquoting is // handled through the to- and from-lists. String HtWordCodec::code(const String &orig_string, StringMatch &match, StringList &replacements) const { String retval; String tempinput; int offset, which, length; const char *orig; // Get a null-terminated string, usable for FindFirst to look at. orig = orig_string.get(); // Sanity check. If bad use, just return empty strings. if (myFromMatch == NULL) { return retval; } // Need to check if "replacements" is empty; that is, if no // transformations should be done. FindFirst() does not return // -1 in this case, it returns 0. if (replacements.Count() == 0) return orig_string; // Find the encodings and replace them. while ((offset = match.FindFirst(orig, which, length)) != -1) { // Append the previous part that was not part of a code. retval.append(orig, offset); // Replace with the original string. retval.append(replacements[which]); orig += offset + length; } // Add the final non-matched part. retval.append(orig); return retval; } // The assymetry is caused by swapping both the matching and // replacement lists. String HtWordCodec::decode(const String &orig) const { return code(orig, *myToMatch, *myFrom); } String HtWordCodec::encode(const String &orig) const { return code(orig, *myFromMatch, *myTo); } // End of HtWordCodec.cc htdig-3.2.0b6/htlib/HtWordCodec.h0100644006314600127310000000505710055635551016017 0ustar angusgbhtdig// // HtWordCodec.h // // HtWordCodec: Given two lists of pair of "words" 'from' and 'to'; // simple one-to-one translations, use those lists to translate. // Only restriction are that no null (0) characters must be // used in "words", and that there is a character "joiner" that // does not appear in any word. One-to-one consistency may be // checked at construction. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtWordCodec.h,v 1.6 2004/05/28 13:15:21 lha Exp $ // #ifndef __HtWordCodec_h #define __HtWordCodec_h #include "HtCodec.h" #include "StringList.h" #include "StringMatch.h" class HtWordCodec : public HtCodec { public: HtWordCodec(); virtual ~HtWordCodec(); // Set the lists of asymmetric pairs of "words" in "from" and // "to", using: // * one list of requested encodings with two consecutive // items "to" and "from" per translation // * one list of just words which HtWordCodec will generate // space-saving encodings for. // Either may be empty. // Items in frequent_substrings will be silently ignored if // they collide with anything in requested_encoding_pairs. // CodingError is empty on success, or has a failure message. HtWordCodec(StringList &requested_encodings, StringList &frequest_substrings, String &errmsg); // *Or*, set the lists directly, without checking coding // consistency. HtWordCodec will delete these lists when // destroyed. Not really recommended, but this class would be // incomplete without it. HtWordCodec (StringList *from, StringList *to, char joiner = char(1)); // Same as those in the parent class. Each string to // encode/decode may contain zero or more of words from the // lists. Those words will be replaced. virtual String encode(const String &uncoded) const; virtual String decode(const String &coded) const; private: HtWordCodec(const HtWordCodec &); // Not supposed to be implemented. void operator= (const HtWordCodec &); // Not supposed to be implemented. StringList *myFrom; StringList *myTo; StringMatch *myFromMatch; StringMatch *myToMatch; // Do coding/decoding symmetrically using the provided lookup and lists. String code(const String &, StringMatch& match, StringList& replacements) const; }; #endif /* __HtWordCodec_h */ htdig-3.2.0b6/htlib/HtWordType.cc0100644006314600127310000000260010055635551016050 0ustar angusgbhtdig// // HtWordType.h // // functions for determining valid words/characters // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtWordType.cc,v 1.11 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtWordType.h" #include "WordType.h" int HtIsWordChar(char c) { return WordType::Instance()->IsChar(c); } int HtIsStrictWordChar(char c) { return WordType::Instance()->IsStrictChar(c); } int HtWordNormalize(String &w) { return WordType::Instance()->Normalize(w); } int HtStripPunctuation(String &w) { return WordType::Instance()->StripPunctuation(w); } // much like strtok(), and destructive of the source string like strtok(), // but does word separation by our rules. char * HtWordToken(char *str) { unsigned char *text = (unsigned char *)str; char *ret = 0; static unsigned char *prev = 0; if (!text) text = prev; while (text && *text && !HtIsStrictWordChar(*text)) text++; if (text && *text) { ret = (char *)text; while (*text && HtIsWordChar(*text)) text++; if (*text) *text++ = '\0'; } prev = text; return ret; } htdig-3.2.0b6/htlib/HtWordType.h0100644006314600127310000000140610055635551015715 0ustar angusgbhtdig// // HtWordType.h // // functions for determining valid words/characters // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtWordType.h,v 1.12 2004/05/28 13:15:21 lha Exp $ // #ifndef _HtWordType_h #define _HtWordType_h #include "htString.h" extern int HtIsWordChar(char c); extern int HtIsStrictWordChar(char c); extern int HtWordNormalize(String &w); extern int HtStripPunctuation(String &w); // Like strtok(), but using our rules for word separation. extern char *HtWordToken(char *s); #endif /* _HtWordType_h */ htdig-3.2.0b6/htlib/IntObject.cc0100644006314600127310000000146210055635551015665 0ustar angusgbhtdig// // IntObject.cc // // IntObject: int variable encapsulated in Object derived class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: IntObject.cc,v 1.5 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "IntObject.h" //******************************************************************************* // IntObject::IntObject() // IntObject::IntObject() { } //******************************************************************************* // IntObject::~IntObject() // IntObject::~IntObject() { } htdig-3.2.0b6/htlib/IntObject.h0100644006314600127310000000135710055635551015532 0ustar angusgbhtdig// // IntObject.h // // IntObject: int variable encapsulated in Object derived class // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: IntObject.h,v 1.7 2004/05/28 13:15:21 lha Exp $ // #ifndef _IntObject_h_ #define _IntObject_h_ #include "Object.h" class IntObject : public Object { public: // // Construction/Destruction // IntObject(); IntObject(int v) { value = v; } ~IntObject(); int Value() {return value;} void Value(int v) {value = v;} private: int value; }; #endif htdig-3.2.0b6/htlib/List.cc0100644006314600127310000002260110055635551014715 0ustar angusgbhtdig// // List.cc // // List: A List class which holds objects of type Object. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: List.cc,v 1.9 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "List.h" class listnode { public: listnode *next; Object *object; }; //********************************************************************* // List::List() // Constructor // List::List() { head = tail = 0; number = 0; } //********************************************************************* // List::~List() // Destructor // List::~List() { Destroy(); } //********************************************************************* // void List::Release() // Release all the objects from our list. // void List::Release() { listnode *node; while (head) { node = head; head = head->next; delete node; } head = tail = 0; number = 0; cursor.Clear(); } //********************************************************************* // void List::Destroy() // Delete all the objects from our list. // void List::Destroy() { listnode *node; while (head) { node = head; head = head->next; delete node->object; delete node; } head = tail = 0; number = 0; cursor.Clear(); } //********************************************************************* // void List::Add(Object *object) // Add an object to the list. // void List::Add(Object *object) { listnode *node = new listnode; node->next = 0; node->object = object; if (tail) { tail->next = node; tail = node; } else { head = tail = node; } number++; } //********************************************************************* // void List::Insert(Object *object, int position) // Add an object to the list. // void List::Insert(Object *object, int position) { listnode *node = new listnode; node->next = 0; node->object = object; listnode *ln = head; listnode *prev = 0; for (int i = 0; i < position && ln; i++, ln = ln->next) prev = ln; if (!ln) { if (tail) tail->next = node; tail = node; // // The list is empty. This is a simple case, then. // if (!head) head = node; } else { if (ln == head) { node->next = head; head = node; } else { node->next = ln; prev->next = node; } } cursor.current_index = -1; number++; } //********************************************************************* // void List::Assign(Object *object, int position) // Assign a new value to an index. // void List::Assign(Object *object, int position) { // // First make sure that there is something there! // while (number < position + 1) { Add(0); } // // Now find the listnode to put the new object in // listnode *temp = head; for (int i = 0; temp && i < position; i++) { temp = temp->next; } cursor.current_index = -1; delete temp->object; temp->object = object; } //********************************************************************* // int List::Remove(Object *object) // Remove an object from the list. // int List::Remove(Object *object) { listnode *node = head; listnode *prev = 0; while (node) { if (node->object == object) { // // Found it! // // // If we are in the middle of a Get_Next() sequence, we need to // fix up any problems with the current node. // if (cursor.current == node) { cursor.current = node->next; } if (head == tail) { head = tail = 0; } else if (head == node) { head = head->next; } else if (tail == node) { tail = prev; tail->next = 0; } else { prev->next = node->next; } delete node; number--; cursor.current_index = -1; return 1; } prev = node; node = node->next; } return 0; } //********************************************************************* // int List::Remove(int position, int action /* = LIST_REMOVE_DESTROY */) { Object *o = List::operator[](position); if(action == LIST_REMOVE_DESTROY) delete o; return List::Remove(o); } //********************************************************************* // Object *List::Get_Next() // Return the next object in the list. // Object *List::Get_Next(ListCursor& cursor) const { listnode *temp = cursor.current; if (cursor.current) { cursor.prev = cursor.current; cursor.current = cursor.current->next; if (cursor.current_index >= 0) cursor.current_index++; } else return 0; return temp->object; } //********************************************************************* // Object *List::Get_First() // Return the first object in the list. // Object *List::Get_First() { if (head) return head->object; else return 0; } //********************************************************************* // int List::Index(Object *obj) // Return the index of an object in the list. // int List::Index(Object *obj) { listnode *temp = head; int index = 0; while (temp && temp->object != obj) { temp = temp->next; index++; } if (index >= number) return -1; else return index; } //********************************************************************* // Object *List::Next(Object *prev) // Return the next object in the list. Using this, the list will // appear as a circular list. // Object *List::Next(Object *prev) { listnode *node = head; while (node) { if (node->object == prev) { node = node->next; if (!node) return head->object; else return node->object; } node = node->next; } return 0; } //********************************************************************* // Object *List::Previous(Object *next) // Return the next object in the list. Using this, the list will // appear as a circular list. // Object *List::Previous(Object *next) { listnode *node = head; listnode *prev = 0; while (node) { if (node->object == next) { if (!prev) return 0; else return prev->object; } prev = node; node = node->next; } return 0; } //********************************************************************* // Return the nth object in the list. // const Object *List::Nth(ListCursor& cursor, int n) const { if (n < 0 || n >= number) return 0; listnode *temp = head; if (cursor.current_index == n) return cursor.current->object; if (cursor.current && cursor.current_index >= 0 && n == cursor.current_index + 1) { cursor.prev = cursor.current; cursor.current = cursor.current->next; if (!cursor.current) { cursor.current_index = -1; return 0; } cursor.current_index = n; return cursor.current->object; } for (int i = 0; temp && i < n; i++) { temp = temp->next; } if (temp) { cursor.current_index = n; cursor.current = temp; return temp->object; } else return 0; } //********************************************************************* // Object *List::Last() // Return the last object inserted. // Object *List::Last() { if (tail) { return tail->object; } return 0; } //********************************************************************* // Object *List::Pop(int action /* = LIST_REMOVE_DESTROY */) { Object *o = 0; listnode *ln = head; listnode *prev = 0; if (tail) { if(action == LIST_REMOVE_DESTROY) { delete tail->object; } else { o = tail->object; } if(head == tail) { head = tail = 0; } else { for (int i = 0; ln != tail; i++, ln = ln->next) prev = ln; tail = prev; tail->next = 0; } } return o; } //********************************************************************* // Object *List::Copy() const // Return a deep copy of the list. // Object *List::Copy() const { List *list = new List; ListCursor cursor; Start_Get(cursor); Object *obj; while ((obj = Get_Next(cursor))) { list->Add(obj->Copy()); } return list; } //********************************************************************* // List &List::operator=(List &list) // Return a deep copy of the list. // List &List::operator=(List &list) { Destroy(); list.Start_Get(); Object *obj; while ((obj = list.Get_Next())) { Add(obj->Copy()); } return *this; } //********************************************************************* // void AppendList(List &list) // Move contents of other list to the end of this list, and empty the // other list. // void List::AppendList(List &list) { // Never mind an empty list or ourselves. if (list.number == 0 || &list == this) return; // Correct our pointers in head and tail. if (tail) { // Link in other list. tail->next = list.head; // Update members for added contents. number += list.number; tail = list.tail; } else { head = list.head; tail = list.tail; number = list.number; } // Clear others members to be an empty list. list.head = list.tail = 0; list.cursor.current = 0; list.cursor.current_index = -1; list.number = 0; } htdig-3.2.0b6/htlib/List.h0100644006314600127310000001211210055635551014553 0ustar angusgbhtdig// // List.h // // List: A List class which holds objects of type Object. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: List.h,v 1.9 2004/05/28 13:15:21 lha Exp $ // #ifndef _List_h_ #define _List_h_ #include "Object.h" // // Behaviour of the Remove method. See comment before method // declaration for more information. // #define LIST_REMOVE_DESTROY 1 #define LIST_REMOVE_RELEASE 2 class List; class listnode; class ListCursor { public: ListCursor() { current = 0; prev = 0; current_index = -1; } void Clear() { current = 0; prev = 0; current_index = -1; } // // Support for the Start_Get and Get_Next routines // listnode *current; listnode *prev; int current_index; }; class List : public Object { public: // // Constructor/Destructor // List(); virtual ~List(); // // Insert at beginning of list. // virtual void Unshift(Object *o) { Insert(o, 0); } // // Remove from the beginning of the list and return the // object. // virtual Object* Shift(int action = LIST_REMOVE_DESTROY) { Object* o = Nth(0); if(Remove(0, action) == NOTOK) return 0; return o; } // // Append an Object to the end of the list // virtual void Push(Object *o) { Add(o); } // // Remove the last object from the list and return it. // virtual Object *Pop(int action = LIST_REMOVE_DESTROY); // // Add() will append an Object to the end of the list // virtual void Add(Object *); // // Insert() will insert an object at the given position. If the // position is larger than the number of objects in the list, the // object is appended; no new objects are created between the end // of the list and the given position. // virtual void Insert(Object *, int position); // // Assign() will replace the object already at the given position // with the new object. If there is no object at the position,the // list is extended with nil objects until the position is reached // and then the given object is put there. (This really makes the // List analogous to a dynamic array...) // virtual void Assign(Object *, int position); // // Find the given object in the list and remove it from the list. // The object will NOT be deleted. If the object is not found, // NOTOK will be returned, else OK. // virtual int Remove(Object *); // // Remove object at position from the list. If action is // LIST_REMOVE_DESTROY delete the object stored at position. // If action is LIST_REMOVE_RELEASE the object is not deleted. // If the object is not found, // NOTOK will be returned, else OK. // virtual int Remove(int position, int action = LIST_REMOVE_DESTROY); // // Release() will set the list to empty. This call will NOT // delete objects that were in the list before this call. // virtual void Release(); // // Destroy() will delete all the objects in the list. This is // equivalent to calling the destructor // virtual void Destroy(); // // List traversel // void Start_Get() { Start_Get(cursor); } void Start_Get(ListCursor& cursor0) const { cursor0.current = head; cursor0.prev = 0; cursor0.current_index = -1;} Object *Get_Next() { return Get_Next(cursor); } Object *Get_Next(ListCursor& cursor) const; Object *Get_First(); Object *Next(Object *current); Object *Previous(Object *current); Object *Last(); // // Direct access to list items. This can only be used to retrieve // objects from the list. To assign new objects, use Insert(), // Add(), or Assign(). // Object *operator[] (int n) { return Nth(n); } const Object *operator[] (int n) const { return Nth(((List*)this)->cursor, n); } const Object *Nth(ListCursor& cursor, int n) const; const Object *Nth(int n) const { return Nth(((List*)this)->cursor, n); } Object *Nth(int n) { return (Object*)((List*)this)->Nth(((List*)this)->cursor, n); } // // Access to the number of elements // int Count() const { return number; } // // Get the index number of an object. If the object is not found, // returnes -1 // int Index(Object *); // // Deep copy member function // Object *Copy() const; // // Assignment // List &operator= (List *list) {return *this = *list;} List &operator= (List &list); // Move one list to the end of another, emptying the other list. void AppendList (List &list); protected: // // Pointers into the list // listnode *head; listnode *tail; // // For list traversal it is nice to know where we are... // ListCursor cursor; // // Its nice to keep track of how many things we contain... // int number; }; #endif htdig-3.2.0b6/htlib/Makefile.am0100644006314600127310000000264607723256616015547 0ustar angusgbhtdiginclude $(top_srcdir)/Makefile.config pkglib_LTLIBRARIES = libht.la libht_la_SOURCES = Configuration.cc Database.cc Dictionary.cc \ DB2_db.cc IntObject.cc List.cc Object.cc \ ParsedString.cc Queue.cc QuotedStringList.cc Stack.cc \ String.cc StringList.cc StringMatch.cc String_fmt.cc \ good_strtok.cc strcasecmp.cc \ mktime.c strptime.cc timegm.c \ getcwd.c memcpy.c memmove.c raise.c strerror.c \ HtCodec.cc HtWordCodec.cc \ HtVector.cc HtHeap.cc \ HtPack.cc HtDateTime.cc HtRegex.cc HtRegexList.cc \ HtRegexReplace.cc HtRegexReplaceList.cc \ HtVectorGeneric.cc HtMaxMin.cc HtWordType.cc \ myqsort.c \ md5.cc mhash_md5.c libht_la_LIBADD=@LTLIBOBJS@ # this includes regex.c libht_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ clib.h \ Configuration.h \ DB2_db.h \ Database.h \ Dictionary.h \ HtCodec.h \ HtDateTime.h \ HtHeap.h \ HtPack.h \ HtRegex.h \ HtRegexList.h \ HtRegexReplace.h \ HtRegexReplaceList.h \ HtVector.h \ HtWordCodec.h \ IntObject.h \ List.h \ Object.h \ ParsedString.h \ Queue.h \ QuotedStringList.h \ Stack.h \ StringList.h \ StringMatch.h \ good_strtok.h \ htString.h \ lib.h \ gregex.h \ HtVectorGeneric.h \ HtVectorGenericCode.h \ HtVector_int.h \ HtVector_String.h \ HtMaxMin.h \ HtTime.h \ HtWordType.h \ HtRandom.h \ ber.h \ libdefs.h \ myqsort.h \ mhash_md5.h \ md5.h htdig-3.2.0b6/htlib/Makefile.in0100644006314600127310000004070410063260372015536 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la pkglib_LTLIBRARIES = libht.la libht_la_SOURCES = Configuration.cc Database.cc Dictionary.cc \ DB2_db.cc IntObject.cc List.cc Object.cc \ ParsedString.cc Queue.cc QuotedStringList.cc Stack.cc \ String.cc StringList.cc StringMatch.cc String_fmt.cc \ good_strtok.cc strcasecmp.cc \ mktime.c strptime.cc timegm.c \ getcwd.c memcpy.c memmove.c raise.c strerror.c \ HtCodec.cc HtWordCodec.cc \ HtVector.cc HtHeap.cc \ HtPack.cc HtDateTime.cc HtRegex.cc HtRegexList.cc \ HtRegexReplace.cc HtRegexReplaceList.cc \ HtVectorGeneric.cc HtMaxMin.cc HtWordType.cc \ myqsort.c \ md5.cc mhash_md5.c libht_la_LIBADD = @LTLIBOBJS@ # this includes regex.c libht_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ clib.h \ Configuration.h \ DB2_db.h \ Database.h \ Dictionary.h \ HtCodec.h \ HtDateTime.h \ HtHeap.h \ HtPack.h \ HtRegex.h \ HtRegexList.h \ HtRegexReplace.h \ HtRegexReplaceList.h \ HtVector.h \ HtWordCodec.h \ IntObject.h \ List.h \ Object.h \ ParsedString.h \ Queue.h \ QuotedStringList.h \ Stack.h \ StringList.h \ StringMatch.h \ good_strtok.h \ htString.h \ lib.h \ gregex.h \ HtVectorGeneric.h \ HtVectorGenericCode.h \ HtVector_int.h \ HtVector_String.h \ HtMaxMin.h \ HtTime.h \ HtWordType.h \ HtRandom.h \ ber.h \ libdefs.h \ myqsort.h \ mhash_md5.h \ md5.h subdir = htlib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(pkglib_LTLIBRARIES) libht_la_DEPENDENCIES = @LTLIBOBJS@ am_libht_la_OBJECTS = Configuration.lo Database.lo Dictionary.lo \ DB2_db.lo IntObject.lo List.lo Object.lo ParsedString.lo \ Queue.lo QuotedStringList.lo Stack.lo String.lo StringList.lo \ StringMatch.lo String_fmt.lo good_strtok.lo strcasecmp.lo \ mktime.lo strptime.lo timegm.lo getcwd.lo memcpy.lo memmove.lo \ raise.lo strerror.lo HtCodec.lo HtWordCodec.lo HtVector.lo \ HtHeap.lo HtPack.lo HtDateTime.lo HtRegex.lo HtRegexList.lo \ HtRegexReplace.lo HtRegexReplaceList.lo HtVectorGeneric.lo \ HtMaxMin.lo HtWordType.lo myqsort.lo md5.lo mhash_md5.lo libht_la_OBJECTS = $(am_libht_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libht_la_SOURCES) HEADERS = $(pkginclude_HEADERS) DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am malloc.c memcmp.c \ realloc.c regex.c snprintf.c vsnprintf.c SOURCES = $(libht_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htlib/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libht.la: $(libht_la_OBJECTS) $(libht_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libht_la_LDFLAGS) $(libht_la_OBJECTS) $(libht_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .c.lo: $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f"; \ $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \ rm -f $(DESTDIR)$(pkgincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkgincludedir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS \ uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgincludeHEADERS install-pkglibLTLIBRARIES \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am \ uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES # 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: htdig-3.2.0b6/htlib/Makefile.win320100644006314600127310000000211207676423103016072 0ustar angusgbhtdig TARGET = $(LIBDIR)/libht$(LIBSFX) # ---------------------------------------------------------------------------- # add new library members to this list # ---------------------------------------------------------------------------- include ../Makedefs.win32 CXXSRC = Configuration.cc Database.cc Dictionary.cc DB2_db.cc \ IntObject.cc List.cc Object.cc ParsedString.cc Queue.cc \ QuotedStringList.cc Stack.cc String.cc StringList.cc \ StringMatch.cc String_fmt.cc good_strtok.cc strcasecmp.cc \ strptime.cc HtCodec.cc HtWordCodec.cc HtVector.cc HtHeap.cc \ HtPack.cc HtDateTime.cc HtRegex.cc HtRegexList.cc \ HtRegexReplace.cc HtRegexReplaceList.cc HtVectorGeneric.cc \ HtMaxMin.cc HtWordType.cc md5.cc SRC = mktime.c mhash_md5.c timegm.c getcwd.c memcmp.c memcpy.c \ memmove.c raise.c strerror.c myqsort.c ifdef WINDIR SRC += regex_win32.c getopt_local.c CXXSRC += filecopy.cc endif CPPFLAGS += -DHAVE_CONFIG_H -I../db -I. -I../htword -I../htcommon $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) include ../Makerules.win32 htdig-3.2.0b6/htlib/Object.cc0100644006314600127310000000276510055635551015221 0ustar angusgbhtdig// // Object.cc // // Object: This baseclass defines how an object should behave. // This includes the ability to be put into a list // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Object.cc,v 1.6 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Object.h" #include //*************************************************************************** // Object::Object() // #ifdef NOINLINE Object::Object() { } //*************************************************************************** // Object::~Object() // Object::~Object() { } //*************************************************************************** // int Object::compare(Object *) // int Object::compare(Object *) { return 0; } //*************************************************************************** // Object *Object::Copy() // Object *Object::Copy() { return new Object; } //*************************************************************************** // void Object::Serialize(String &) // void Object::Serialize(String &) { } //*************************************************************************** // void Object::Deserialize(String &, int &) // void Object::Deserialize(String &, int &) { } #endif htdig-3.2.0b6/htlib/Object.h0100644006314600127310000000226610055635551015057 0ustar angusgbhtdig// // Object.h // // Object: This baseclass defines how an object should behave. // This includes the ability to be put into a list // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Object.h,v 1.9 2004/05/28 13:15:21 lha Exp $ // #ifndef _Object_h_ #define _Object_h_ #include "lib.h" #include class String; class Object { public: // // Constructor/Destructor // Object() {} virtual ~Object() {} // // To ensure a consistent comparison interface and to allow comparison // of all kinds of different objects, we will define a comparison functions. // virtual int compare(const Object &) const { return 0;} // // To allow a deep copy of data structures we will define a standard interface... // This member will return a copy of itself, freshly allocated and deep copied. // virtual Object *Copy() const { fprintf(stderr, "Object::Copy: derived class does not implement Copy\n"); return new Object(); } }; #endif htdig-3.2.0b6/htlib/ParsedString.cc0100644006314600127310000001011610055635551016405 0ustar angusgbhtdig// // ParsedString.cc // // ParsedString: Contains a string. The string my contain $var, ${var}, $(var) // `filename`. The get method will expand those using the // dictionary given in argument. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ParsedString.cc,v 1.9 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "ParsedString.h" #include #include //***************************************************************************** // ParsedString::ParsedString() // ParsedString::ParsedString() { } //***************************************************************************** // ParsedString::ParsedString(const String& s) { value = s; } //***************************************************************************** // ParsedString::~ParsedString() // ParsedString::~ParsedString() { } //***************************************************************************** // void ParsedString::set(const String& str) { value = str; } //***************************************************************************** // Return a fully parsed string. // // Allowed syntax: // $var // ${var} // $(var) // `filename` // // The filename can also contain variables // const String ParsedString::get(const Dictionary &dict) const { String variable; String parsed; ParsedString *temp; const char *str = value.get(); char delim = ' '; int need_delim = 0; while (*str) { if (*str == '$') { // // A dollar sign starts a variable. // str++; need_delim = 1; if (*str == '{') delim = '}'; else if (*str == '(') delim = ')'; else need_delim = 0; if (need_delim) str++; variable.trunc(); while (isalnum(*str) || *str == '_' || *str == '-') { variable << *str++; } if (*str) { if (need_delim && *str == delim) { // // Found end of variable // temp = (ParsedString *) dict[variable]; if (temp) parsed << temp->get(dict); str++; } else if (need_delim) { // // Error. Probably an illegal value in the name We'll // assume the variable ended here. // temp = (ParsedString *) dict[variable]; if (temp) parsed << temp->get(dict); } else { // // This variable didn't have a delimiter. // temp = (ParsedString *) dict[variable]; if (temp) parsed << temp->get(dict); } } else { // // End of string reached. We'll assume that this is also // the end of the variable // temp = (ParsedString *) dict[variable]; if (temp) parsed << temp->get(dict); } } else if (*str == '`') { // // Back-quote delimits a filename which we need to insert // str++; variable.trunc(); while (*str && *str != '`') { variable << *str++; } if (*str == '`') str++; ParsedString filename(variable); variable.trunc(); getFileContents(variable, filename.get(dict)); parsed << variable; } else if (*str == '\\') { // // Backslash escapes the next character // str++; if (*str) parsed << *str++; } else { // // Normal character // parsed << *str++; } } return parsed; } void ParsedString::getFileContents(String &str, const String& filename) const { FILE *fl = fopen(filename, "r"); char buffer[1000]; if (!fl) return; while (fgets(buffer, sizeof(buffer), fl)) { String s(buffer); s.chop("\r\n\t "); str << s << ' '; } str.chop(1); fclose(fl); } htdig-3.2.0b6/htlib/ParsedString.h0100644006314600127310000000201710055635551016250 0ustar angusgbhtdig// // ParsedString.h // // ParsedString: Contains a string. The string my contain $var, ${var}, $(var) // `filename`. The get method will expand those using the // dictionary given in argument. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ParsedString.h,v 1.9 2004/05/28 13:15:21 lha Exp $ #ifndef _ParsedString_h_ #define _ParsedString_h_ #include "Object.h" #include "htString.h" #include "Dictionary.h" class ParsedString : public Object { public: // // Construction/Destruction // ParsedString(); ParsedString(const String& s); ~ParsedString(); void set(const String& s); const String get(const Dictionary &d) const; private: String value; void getFileContents(String &str, const String& filename) const; }; #endif htdig-3.2.0b6/htlib/Queue.cc0100644006314600127310000000405610055635551015072 0ustar angusgbhtdig// // Queue.cc // // Queue: This class implements a linked list of objects. It itself is also an // object // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Queue.cc,v 1.6 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Queue.h" struct Queuenode { Queuenode *next; Object *obj; }; //*************************************************************************** // Queue::Queue() // Queue::Queue() { head = tail = 0; size = 0; } //*************************************************************************** // Queue::~Queue() // Queue::~Queue() { destroy(); } //*************************************************************************** // void Queue::destroy() // void Queue::destroy() { while (head) { Object *obj = pop(); delete obj; } size = 0; head = tail = 0; } //*************************************************************************** // void Queue::push(Object *obj) // Push an object onto the Queue. // void Queue::push(Object *obj) { Queuenode *node = new Queuenode; node->obj = obj; node->next = 0; if (tail) ((Queuenode *) tail)->next = node; tail = node; if (!head) head = tail; size++; } //*************************************************************************** // Object *Queue::pop() // Return the object at the head of the Queue and remove it // Object *Queue::pop() { if (size == 0) return 0; Queuenode *node = (Queuenode *) head; Object *obj = node->obj; head = (void *) node->next; delete node; size--; if (!head) tail = 0; return obj; } //*************************************************************************** // Object *Queue::peek() // Return the object at the top of the Queue. // Object *Queue::peek() { if (size == 0) return 0; return ((Queuenode *)head)->obj; } htdig-3.2.0b6/htlib/Queue.h0100644006314600127310000000164210055635551014732 0ustar angusgbhtdig// // Queue.h // // Queue: This class implements a linked list of objects. It itself is also an // object // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Queue.h,v 1.6 2004/05/28 13:15:21 lha Exp $ // #ifndef _Queue_h_ #define _Queue_h_ #include "Object.h" class Queue : public Object { public: // // Constructors/Destructor // Queue(); ~Queue(); // // Queue access // void push(Object *obj); Object *peek(); Object *pop(); int Size() {return size;} // // Queue destruction // void destroy(); protected: // // These variables are to keep track of the linked list // void *head; void *tail; int size; }; #endif htdig-3.2.0b6/htlib/QuotedStringList.cc0100644006314600127310000000351210055635551017266 0ustar angusgbhtdig// // QuotedStringList.cc // // QuotedStringList: Fed with a string it will extract separator delimited // words and store them in a list. The words may be // delimited by " or ', hence the name. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QuotedStringList.cc,v 1.7 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "QuotedStringList.h" //***************************************************************************** QuotedStringList::QuotedStringList() { } //***************************************************************************** int QuotedStringList::Create(const char *str, const char *sep, int single) { char quote = 0; int quoted = 0; String word; while (str && *str) { if (*str == '\\') { if (!str[1]) break; word << *++str; } else if (*str == quote) { quote = 0; } else if (!quote && (*str == '"' || *str == '\'')) { quote = *str; quoted++; } else if (quote == 0 && strchr(sep, *str)) { Add(new String(word)); word = 0; quoted = 0; if (!single) { while (strchr(sep, *str)) str++; str--; } } else word << *str; str++; } // // Add the last word to the list // if (word.length() || quoted) Add(new String(word)); return Count(); } //***************************************************************************** int QuotedStringList::Create(const char *str, char sep, int single) { char t[2] = "1"; t[0] = sep; return Create(str, t, single); } htdig-3.2.0b6/htlib/QuotedStringList.h0100644006314600127310000000317110055635551017131 0ustar angusgbhtdig// // QuotedStringList.h // // QuotedStringList: Fed with a string it will extract separator delimited // words and store them in a list. The words may be // delimited by " or ', hence the name. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QuotedStringList.h,v 1.7 2004/05/28 13:15:21 lha Exp $ // #ifndef _QuotedStringList_h_ #define _QuotedStringList_h_ #include "StringList.h" class QuotedStringList : public StringList { public: // // Construction/Destruction // QuotedStringList(); // // Creation of a String from a string or String // QuotedStringList(const char *str, char sep = '\t', int single = 0) { Create(str, sep, single); } QuotedStringList(const String &str, char sep = '\t', int single = 0) { Create(str, sep, single); } QuotedStringList(const char *str, const char *sep, int single = 0) { Create(str, sep, single); } QuotedStringList(const String &str, const char *sep, int single = 0) { Create(str, sep, single); } int Create(const char *str, char sep = '\t', int single = 0); int Create(const String &str, char sep = '\t', int single = 0) { return Create(str.get(), sep, single); } int Create(const char *str, const char *sep, int single = 0); int Create(const String &str, const char *sep, int single = 0) { return Create(str.get(), sep, single); } private: }; #endif htdig-3.2.0b6/htlib/Stack.cc0100644006314600127310000000401010055635551015041 0ustar angusgbhtdig// // Stack.cc // // Stack: This class implements a linked list of objects. It itself is also an // object // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Stack.cc,v 1.5 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Stack.h" struct stacknode { stacknode *next; Object *obj; }; //*************************************************************************** // Stack::Stack() // Stack::Stack() { sp = 0; size = 0; } //*************************************************************************** // Stack::~Stack() // Stack::~Stack() { while (sp) { Object *obj = pop(); delete obj; } } //*************************************************************************** // void Stack::destroy() // void Stack::destroy() { while (sp) { Object *obj = pop(); delete obj; } } //*************************************************************************** // void Stack::push(Object *obj) // PURPOSE: // Push an object onto the stack. // void Stack::push(Object *obj) { stacknode *node = new stacknode; node->obj = obj; node->next = (stacknode *) sp; sp = node; size++; } //*************************************************************************** // Object *Stack::pop() // PURPOSE: // Return the object at the top of the stack and remove it from the stack. // Object *Stack::pop() { if (size == 0) return 0; stacknode *node = (stacknode *) sp; Object *obj = node->obj; sp = (void *) node->next; delete node; size--; return obj; } //*************************************************************************** // Object *Stack::peek() // PURPOSE: // Return the object at the top of the stack. // Object *Stack::peek() { if (size == 0) return 0; return ((stacknode *)sp)->obj; } htdig-3.2.0b6/htlib/Stack.h0100644006314600127310000000162210055635551014711 0ustar angusgbhtdig// // Stack.h // // Stack: This class implements a linked list of objects. It itself is also an // object // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Stack.h,v 1.6 2004/05/28 13:15:21 lha Exp $ // #ifndef _Stack_h_ #define _Stack_h_ #include "Object.h" class Stack : public Object { public: // // Constructors/Destructor // Stack(); ~Stack(); // // Stack access // void push(Object *obj); Object *peek(); Object *pop(); int Size() {return size;} // // Stack destruction // void destroy(); protected: // // These variables are to keep track of the linked list // void *sp; int size; }; #endif htdig-3.2.0b6/htlib/String.cc0100644006314600127310000003054410055635551015255 0ustar angusgbhtdig// // String.cc // // String: (interface in htString.h) Just Another String class. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: String.cc,v 1.40 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htString.h" #include "Object.h" #ifndef _MSC_VER /* _WIN32 */ #include #else #include #endif #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include #include const int MinimumAllocationSize = 4; // Should be power of two. #ifdef NOINLINE String::String() { Length = Allocated = 0; Data = 0; } #endif String::String(int init) { Length = 0; Allocated = init >= MinimumAllocationSize ? init : MinimumAllocationSize; Data = new char[Allocated]; } String::String(const char *s) { Allocated = Length = 0; Data = 0; int len; if (s) { len = strlen(s); copy(s, len, len); } } String::String(const char *s, int len) { Allocated = Length = 0; Data = 0; if (s && len > 0) copy(s, len, len); } String::String(const String &s) { Allocated = Length = 0; Data = 0; if (s.length() > 0) copy(s.Data, s.length(), s.length()); } // // This can be used for performance reasons if it is known the // String will need to grow. // String::String(const String &s, int allocation_hint) { Allocated = Length = 0; Data = 0; if (s.length() != 0) { if (allocation_hint < s.length()) allocation_hint = s.length(); copy(s.Data, s.length(), allocation_hint); } } String::~String() { if (Allocated) delete [] Data; } void String::operator = (const String &s) { if (s.length() > 0) { allocate_space(s.length()); Length = s.length(); copy_data_from(s.Data, Length); } else { Length = 0; } } void String::operator = (const char *s) { if (s) { int len = strlen(s); allocate_fix_space(len); Length = len; copy_data_from(s, Length); } else Length = 0; } void String::append(const String &s) { if (s.length() == 0) return; int new_len = Length + s.length(); reallocate_space(new_len); copy_data_from(s.Data, s.length(), Length); Length = new_len; } void String::append(const char *s) { if (!s) return; append(s,strlen(s)); } void String::append(const char *s, int slen) { if (!s || !slen) return; // if ( slen == 1 ) // { // append(*s); // return; // } int new_len = Length + slen; if (new_len + 1 > Allocated) reallocate_space(new_len); copy_data_from(s, slen, Length); Length = new_len; } void String::append(char ch) { int new_len = Length +1; if (new_len + 1 > Allocated) reallocate_space(new_len); Data[Length] = ch; Length = new_len; } int String::compare(const String& obj) const { int len; int result; const char *p1 = Data; const char *p2 = obj.Data; len = Length; result = 0; if (Length > obj.Length) { result = 1; len = obj.Length; } else if (Length < obj.Length) result = -1; while (len) { if (*p1 > *p2) return 1; if (*p1 < *p2) return -1; p1++; p2++; len--; } // // Strings are equal up to the shortest length. // The result depends upon the length difference. // return result; } int String::nocase_compare(const String &s) const { const char *p1 = get(); const char *p2 = s.get(); return mystrcasecmp(p1, p2); } int String::Write(int fd) const { int left = Length; char *wptr = Data; while (left) { int result = write(fd, wptr, left); if (result < 0) return result; left -= result; wptr += result; } return left; } const char *String::get() const { static const char *null = ""; if (!Allocated) return null; Data[Length] = '\0'; // We always leave room for this. return Data; } char *String::get() { static char *null = ""; if (!Allocated) return null; Data[Length] = '\0'; // We always leave room for this. return Data; } char *String::new_char() const { char *r; if (!Allocated) { r = new char[1]; *r = '\0'; return r; } Data[Length] = '\0'; // We always leave room for this. r = new char[Length + 1]; strcpy(r, Data); return r; } int String::as_integer(int def) const { if (Length <= 0) return def; Data[Length] = '\0'; return atoi(Data); } double String::as_double(double def) const { if (Length <= 0) return def; Data[Length] = '\0'; return atof(Data); } String String::sub(int start, int len) const { if (start > Length) return 0; if (len > Length - start) len = Length - start; return String(Data + start, len); } String String::sub(int start) const { return sub(start, Length - start); } int String::indexOf(const char *str) const { char *c; // // Set the first char after string end to zero to prevent finding // substrings including symbols after actual end of string // if (!Allocated) return -1; Data[Length] = '\0'; /* OLD CODE: for (i = 0; i < Length; i++) */ #ifdef HAVE_STRSTR if ((c = strstr(Data, str)) != NULL) return(c -Data); #else int len = strlen(str); int i; for (i = 0; i <= Length-len; i++) { if (strncmp(&Data[i], str, len) == 0) return i; } #endif return -1; } int String::indexOf(char ch) const { int i; for (i = 0; i < Length; i++) { if (Data[i] == ch) return i; } return -1; } int String::indexOf(char ch, int pos) const { if (pos >= Length) return -1; for (int i = pos; i < Length; i++) { if (Data[i] == ch) return i; } return -1; } int String::lastIndexOf(char ch, int pos) const { if (pos >= Length) return -1; while (pos >= 0) { if (Data[pos] == ch) return pos; pos--; } return -1; } int String::lastIndexOf(char ch) const { return lastIndexOf(ch, Length - 1); } #ifdef NOINLINE String &String::operator << (const char *str) { append(str); return *this; } String &String::operator << (char ch) { append(&ch, 1); return *this; } #endif String &String::operator << (int i) { char str[20]; sprintf(str, "%d", i); append(str); return *this; } String &String::operator << (unsigned int i) { char str[20]; sprintf(str, "%u", i); append(str); return *this; } String &String::operator << (long l) { char str[20]; sprintf(str, "%ld", l); append(str); return *this; } String &String::operator << (const String &s) { append(s.get(), s.length()); return *this; } char String::operator >> (char c) { c = '\0'; if (Allocated && Length) { c = Data[Length - 1]; Data[Length - 1] = '\0'; Length--; } return c; } int String::lowercase() { int converted = 0; for (int i = 0; i < Length; i++) { if (isupper((unsigned char)Data[i])) { Data[i] = tolower((unsigned char)Data[i]); converted++; } } return converted; } int String::uppercase() { int converted = 0; for (int i = 0; i < Length; i++) { if (islower((unsigned char)Data[i])) { Data[i] = toupper((unsigned char)Data[i]); converted++; } } return converted; } void String::replace(char c1, char c2) { for (int i = 0; i < Length; i++) if (Data[i] == c1) Data[i] = c2; } int String::remove(const char *chars) { if (Length <= 0) return 0; char *good, *bad; int skipped = 0; good = bad = Data; for (int i = 0; i < Length; i++) { if (strchr(chars, *bad)) skipped++; else *good++ = *bad; bad++; } Length -= skipped; return skipped; } String &String::chop(int n) { Length -= n; if (Length < 0) Length = 0; return *this; } String &String::chop(char ch) { while (Length > 0 && Data[Length - 1] == ch) Length--; return *this; } String &String::chop(const char *str) { while (Length > 0 && strchr(str, Data[Length - 1])) Length--; return *this; } void String::Serialize(String &dest) { dest.append((char *) &Length, sizeof(Length)); dest.append(get(), Length); } void String::Deserialize(String &source, int &index) { memcpy((char *) &Length, (char *) source.get() + index, sizeof(Length)); index += sizeof(Length); allocate_fix_space(Length); copy_data_from(source.get() + index, Length); index += Length; } //------------------------------------------------------------------------ // Non member operators. // String operator + (const String &a, const String &b) { String result(a, a.length() + b.length()); result.append(b); return result; } int operator == (const String &a, const String &b) { if (a.Length != b.Length) return 0; return a.compare(b) == 0; } int operator != (const String &a, const String &b) { return a.compare(b) != 0; } int operator < (const String &a, const String &b) { return a.compare(b) == -1; } int operator > (const String &a, const String &b) { return a.compare(b) == 1; } int operator <= (const String &a, const String &b) { return a.compare(b) <= 0; } int operator >= (const String &a, const String &b) { return a.compare(b) >= 0; } #ifndef NOSTREAM ostream &operator << (ostream &o, const String &s) { o.write(s.Data, s.length()); return o; } #endif /* NOSTREAM */ //------------------------------------------------------------------------ // Private Methods. // void String::copy_data_from(const char *s, int len, int dest_offset) { memcpy(Data + dest_offset, s, len); } void String::allocate_space(int len) { len++; // In case we want to add a null. if (len <= Allocated) return; if (Allocated) delete [] Data; Allocated = MinimumAllocationSize; while (Allocated < len) Allocated <<= 1; Data = new char[Allocated]; } void String::allocate_fix_space(int len) { len++; // In case we want to add a null. if (len <= Allocated) return; if (Allocated) delete [] Data; Allocated = len; if (Allocated < MinimumAllocationSize) Allocated = MinimumAllocationSize; Data = new char[Allocated]; } void String::reallocate_space(int len) { char *old_data = 0; int old_data_len = 0; if (Allocated) { old_data = Data; old_data_len = Length; Allocated = 0; } allocate_space(len); if (old_data) { copy_data_from(old_data, old_data_len); delete [] old_data; } } void String::copy(const char *s, int len, int allocation_hint) { if (len == 0 || allocation_hint == 0) return; // We're not actually copying anything! allocate_fix_space(allocation_hint); Length = len; copy_data_from(s, len); } #ifndef NOSTREAM void String::debug(ostream &o) { o << "Length: " << Length << " Allocated: " << Allocated << " Data: " << ((void*) Data) << " '" << *this << "'\n"; } #endif /* NOSTREAM */ int String::readLine(FILE *in) { Length = 0; allocate_fix_space(2048); while (fgets(Data + Length, Allocated - Length, in)) { Length += strlen(Data + Length); if (Length == 0) continue; if (Data[Length - 1] == '\n') { // // A full line has been read. Return it. // chop('\n'); return 1; } if (Allocated > Length + 1) { // // Not all available space filled. Probably EOF? // continue; } // // Only a partial line was read. Increase available space in // string and read some more. // reallocate_space(Allocated << 1); } chop('\n'); return Length > 0; } #ifndef NOSTREAM istream &operator >> (istream &in, String &line) { line.Length = 0; line.allocate_fix_space(2048); for (;;) { in.clear(); in.getline(line.Data + line.Length, line.Allocated - line.Length); line.Length += strlen(line.Data + line.Length); // if read whole line, or eof, or read fewer chars than the max... if (!in.fail() || in.eof() || line.Length + 1 < line.Allocated) break; // // Only a partial line was read. Increase available space in // string and read some more. // line.reallocate_space(line.Allocated << 1); } return in; } #endif /* NOSTREAM */ htdig-3.2.0b6/htlib/StringList.cc0100644006314600127310000000751710055635551016115 0ustar angusgbhtdig// // StringList.cc // // StringList: Specialized List containing String objects. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: StringList.cc,v 1.14 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "StringList.h" #include "htString.h" #include "List.h" #include //***************************************************************************** // StringList::StringList() // StringList::StringList() { } //***************************************************************************** // int StringList::Create(const char *str, char *sep) // int StringList::Create(const char *str, const char *sep) { String word; while (str && *str) { if (strchr(sep, *str)) { if (word.length()) { List::Add(new String(word)); word = 0; } } else word << *str; str++; } // // Add the last word to the list // if (word.length()) List::Add(new String(word)); return Count(); } //***************************************************************************** // int StringList::Create(const char *str, char sep) // int StringList::Create(const char *str, char sep) { String word; while (str && *str) { if (*str == sep) { if (word.length()) { List::Add(new String(word)); word = 0; } } else word << *str; str++; } // // Add the last word to the list // if (word.length()) List::Add(new String(word)); return Count(); } //***************************************************************************** // char *StringList::operator [] (int n) // char *StringList::operator [] (int n) { String *str = (String *) Nth(n); if (str) return str->get(); else return 0; } //***************************************************************************** // void StringList::Add(const char *str) // void StringList::Add(const char *str) { List::Add(new String(str)); } //***************************************************************************** // void StringList::Assign(const char *str, int pos) // void StringList::Assign(const char *str, int pos) { List::Assign(new String(str), pos); } //***************************************************************************** // void StringList::Insert(const char *str, int pos) // void StringList::Insert(const char *str, int pos) { List::Insert(new String(str), pos); } //***************************************************************************** // static int StringCompare(const void *a, const void *b) // static int StringCompare(const void *a, const void *b) { String *sa, *sb; sa = *((String **) a); sb = *((String **) b); return strcmp(sa->get(), sb->get()); } //***************************************************************************** // void StringList::Sort(int direction) // void StringList::Sort(int) { String **array = new String*[Count()]; int i; int n = Count(); ListCursor cursor; Start_Get(cursor); Object *obj; for(i = 0; i < n && (obj = Get_Next(cursor)); i++) { array[i] = (String*)obj; } qsort((char *) array, (size_t) n, (size_t) sizeof(String *), StringCompare); Release(); for (i = 0; i < n; i++) { List::Add(array[i]); } delete array; } //***************************************************************************** // String StringList::Join(char sep) const // String StringList::Join(char sep) const { String str; int i; for (i=0; i < number; i++) { if (str.length()) str.append(sep); str.append(*((const String *) Nth(i))); } return str; } htdig-3.2.0b6/htlib/StringList.h0100644006314600127310000000376510055635551015760 0ustar angusgbhtdig// // StringList.h // // StringList: Specialized List containing String objects. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: StringList.h,v 1.12 2004/05/28 13:15:21 lha Exp $ // #ifndef _StringList_h_ #define _StringList_h_ #include "Object.h" #include "List.h" #include "htString.h" class StringList : public List { public: // // Construction/Destruction // StringList(); // // Creation of a String from a string or String // StringList(const char *str, char sep = '\t') { Create(str, sep); } StringList(const String &str, char sep = '\t') { Create(str, sep); } StringList(const char *str, const char *sep) { Create(str, sep); } StringList(const String &str, const char *sep) { Create(str, sep); } int Create(const char *str, char sep = '\t'); int Create(const String &str, char sep = '\t') { return Create(str.get(), sep); } int Create(const char *str, const char *sep); int Create(const String &str, const char *sep) { return Create(str.get(), sep); } // // Standard List operations... // void Add(const char *); void Add(String *obj) { List::Add(obj); } void Insert(const char *, int pos); void Insert(String *obj, int pos) { List::Insert(obj, pos); } void Assign(const char *, int pos); void Assign(String *obj, int pos) { List::Assign(obj, pos); } // // Since we know we only store strings, we can reliably sort them. // If direction is 1, the sort will be in descending order // void Sort(int direction = 0); // // Join the Elements of the StringList together // String Join(char) const; // // Getting at the parts of the StringList // char *operator [] (int n); private: }; #endif htdig-3.2.0b6/htlib/StringMatch.cc0100644006314600127310000003233410055635551016231 0ustar angusgbhtdig// // StringMatch.cc // // StringMatch: This class provides an interface to a fairly specialized string // lookup facility. It is intended to be used as a replace for any // regualr expression matching when the pattern string is in the form: // // |||... // // Just like regular expression routines, the pattern needs to be // compiled before it can be used. This is done using the Pattern() // member function. Once the pattern has been compiled, the member // function Find() can be used to search for the pattern in a string. // If a string has been found, the "which" and "length" parameters // will be set to the string index and string length respectively. // (The string index is counted starting from 0) The return value of // Find() is the position at which the string was found or -1 if no // strings could be found. If a case insensitive match needs to be // performed, call the IgnoreCase() member function before calling // Pattern(). This function will setup a character translation table // which will convert all uppercase characters to lowercase. If some // other translation is required, the TranslationTable() member // function can be called to provide a custom table. This table needs // to be 256 characters. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: StringMatch.cc,v 1.18 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "StringMatch.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // // Entries in the state table can either be normal or final. // Final states have an match index encoded in them. This number // is shifted left by INDEX_SHIFT bits. // #define MATCH_INDEX_MASK 0xffff0000 #define STATE_MASK 0x0000ffff #define INDEX_SHIFT 16 //***************************************************************************** // StringMatch::StringMatch() // StringMatch::StringMatch() { // // Clear out the state table pointers // for (int i = 0; i < 256; i++) table[i] = 0; local_alloc = 0; trans = 0; } //***************************************************************************** // StringMatch::~StringMatch() // StringMatch::~StringMatch() { for (int i = 0; i < 256; i++) delete [] table[i]; if (local_alloc) delete [] trans; } //***************************************************************************** // void StringMatch::Pattern(char *pattern) // Compile the given pattern into a state transition table // void StringMatch::Pattern(char *pattern, char sep) { if (!pattern || !*pattern) { // // No pattern to compile... // return; } // // Allocate enough space in the state table to hold the worst case // patterns... // int n = strlen(pattern); // ...but since the state table does not need an extra state // for each string in the pattern, we can subtract the number // of separators. Wins for small but numerous strings in // the pattern. char *tmpstr; for (tmpstr = pattern; (tmpstr = strchr(tmpstr, sep)) != NULL; tmpstr++) // Pass the separator. n--; int i; for (i = 0; i < 256; i++) { table[i] = new int[n]; memset((unsigned char *) table[i], 0, n * sizeof(int)); } for (i = 0; i < n; i++) table[0][i] = i; // "no-op" states for null char, to be ignored // // Set up a standard case translation table if needed. // if (!trans) { trans = new unsigned char[256]; for (i = 0; i < 256; i++) { trans[i] = (unsigned char)i; } local_alloc = 1; } // // Go though each of the patterns and build entries in the table. // int state = 0; int totalStates = 0; unsigned char previous = 0; int previousState = 0; int previousValue = 0; int index = 1; unsigned char chr; while ((unsigned char)*pattern) { #if 0 if (totalStates > n) { cerr << "Fatal! Miscalculation of number of states" << endl; exit (2); } #endif chr = trans[(unsigned char)*pattern]; if (chr == 0) { pattern++; continue; } if (chr == sep) { // // Next pattern // table[previous][previousState] = previousValue | (index << INDEX_SHIFT); index++; state = 0; // totalStates--; } else { previousValue = table[chr][state]; previousState = state; if (previousValue) { if (previousValue & MATCH_INDEX_MASK) { if (previousValue & STATE_MASK) { state = previousValue & STATE_MASK; } else { table[chr][state] |= ++totalStates; state = totalStates; } } else { state = previousValue & STATE_MASK; } } else { table[chr][state] = ++totalStates; state = totalStates; } } previous = chr; pattern++; } table[previous][previousState] = previousValue | (index << INDEX_SHIFT); } //***************************************************************************** // int StringMatch::FindFirst(const char *string, int &which, int &length) // Attempt to find the first occurance of the previous compiled patterns. // int StringMatch::FindFirst(const char *string, int &which, int &length) { which = -1; length = -1; if (!table[0]) return 0; int state = 0, new_state = 0; int pos = 0; int start_pos = 0; while ((unsigned char)string[pos]) { new_state = table[trans[(unsigned char)string[pos] & 0xff]][state]; if (new_state) { if (state == 0) { // // Keep track of where we started comparing so that we can // come back to this point later if we didn't match anything // start_pos = pos; } } else { // // We came back to 0 state. This means we didn't match anything. // if (state) { // But we may already have a match, and are just being greedy. if (which != -1) return start_pos; pos = start_pos + 1; } else pos++; state = 0; continue; } state = new_state; if (state & MATCH_INDEX_MASK) { // // Matched one of the patterns. // Determine which and return. // which = ((unsigned int) (state & MATCH_INDEX_MASK) >> INDEX_SHIFT) - 1; length = pos - start_pos + 1; state &= STATE_MASK; // Continue to find the longest, if there is one. if (state == 0) return start_pos; } pos++; } // Maybe we were too greedy. if (which != -1) return start_pos; return -1; } //***************************************************************************** // int StringMatch::Compare(const char *string, int &which, int &length) // int StringMatch::Compare(const char *string, int &which, int &length) { which = -1; length = -1; if (!table[0]) return 0; int state = 0, new_state = 0; int pos = 0; int start_pos = 0; // // Skip to at least the start of a word. // while ((unsigned char)string[pos]) { new_state = table[trans[string[pos]]][state]; if (new_state) { if (state == 0) { start_pos = pos; } } else { // We may already have a match, and are just being greedy. if (which != -1) return 1; return 0; } state = new_state; if (state & MATCH_INDEX_MASK) { // // Matched one of the patterns. // which = ((unsigned int) (state & MATCH_INDEX_MASK) >> INDEX_SHIFT) - 1; length = pos - start_pos + 1; // Continue to find the longest, if there is one. state &= STATE_MASK; if (state == 0) return 1; } pos++; } // Maybe we were too greedy. if (which != -1) return 1; return 0; } //***************************************************************************** // int StringMatch::FindFirstWord(char *string) // int StringMatch::FindFirstWord(const char *string) { int dummy; return FindFirstWord(string, dummy, dummy); } //***************************************************************************** // int StringMatch::CompareWord(const char *string) // int StringMatch::CompareWord(const char *string) { int dummy; return CompareWord(string, dummy, dummy); } //***************************************************************************** // int StringMatch::FindFirstWord(char *string, int &which, int &length) // Attempt to find the first occurance of the previous compiled patterns. // int StringMatch::FindFirstWord(const char *string, int &which, int &length) { which = -1; length = -1; int state = 0, new_state = 0; int pos = 0; int start_pos = 0; int is_word = 1; // // Skip to at least the start of a word. // while ((unsigned char)string[pos]) { new_state = table[trans[(unsigned char)string[pos]]][state]; if (new_state) { if (state == 0) { start_pos = pos; } } else { // // We came back to 0 state. This means we didn't match anything. // if (state) { pos = start_pos + 1; } else pos++; state = 0; continue; } state = new_state; if (state & MATCH_INDEX_MASK) { // // Matched one of the patterns. // is_word = 1; if (start_pos != 0) { if (HtIsStrictWordChar((unsigned char)string[start_pos - 1])) is_word = 0; } if (HtIsStrictWordChar((unsigned char)string[pos + 1])) is_word = 0; if (is_word) { // // Determine which and return. // which = ((unsigned int) (state & MATCH_INDEX_MASK) >> INDEX_SHIFT) - 1; length = pos - start_pos + 1; return start_pos; } else { // // Not at the end of word. Continue searching. // if (state & STATE_MASK) { state &= STATE_MASK; } else { pos = start_pos + 1; state = 0; } } } pos++; } return -1; } //***************************************************************************** // int StringMatch::CompareWord(const char *string, int &which, int &length) // int StringMatch::CompareWord(const char *string, int &which, int &length) { which = -1; length = -1; if (!table[0]) return 0; int state = 0; int position = 0; // // Skip to at least the start of a word. // while ((unsigned char)string[position]) { state = table[trans[(unsigned char)string[position]]][state]; if (state == 0) { return 0; } if (state & MATCH_INDEX_MASK) { // // Matched one of the patterns. See if it is a word. // int isWord = 1; if ((unsigned char)string[position + 1]) { if (HtIsStrictWordChar((unsigned char)string[position + 1])) isWord = 0; } if (isWord) { which = ((unsigned int) (state & MATCH_INDEX_MASK) >> INDEX_SHIFT) - 1; length = position + 1; return 1; } else { // // Not at the end of a word. Continue searching. // if ((state & STATE_MASK) != 0) { state &= STATE_MASK; } else { return 0; } } } position++; } return 0; } //***************************************************************************** // void StringMatch::TranslationTable(char *table) // void StringMatch::TranslationTable(char *table) { if (local_alloc) delete [] trans; trans = (unsigned char *) table; local_alloc = 0; } //***************************************************************************** // void StringMatch::IgnoreCase() // Set up the case translation table to convert uppercase to lowercase // void StringMatch::IgnoreCase() { if (!local_alloc || !trans) { trans = new unsigned char[256]; for (int i = 0; i < 256; i++) trans[i] = (unsigned char)i; local_alloc = 1; } for (int i = 0; i < 256; i++) if (isupper((unsigned char)i)) trans[i] = tolower((unsigned char)i); } //***************************************************************************** // void StringMatch::IgnorePunct(char *punct) // Set up the character translation table to ignore punctuation // void StringMatch::IgnorePunct(char *punct) { if (!local_alloc || !trans) { trans = new unsigned char[256]; for (int i = 0; i < 256; i++) trans[i] = (unsigned char)i; local_alloc = 1; } if (punct) for (int i = 0; punct[i]; i++) trans[(unsigned char)punct[i]] = 0; else for (int i = 0; i < 256; i++) if (HtIsWordChar(i) && !HtIsStrictWordChar(i)) trans[i] = 0; } //***************************************************************************** // int StringMatch::FindFirst(const char *source) // int StringMatch::FindFirst(const char *source) { int dummy; return FindFirst(source, dummy, dummy); } //***************************************************************************** // int StringMatch::Compare(const char *source) // int StringMatch::Compare(const char *source) { int dummy; return Compare(source, dummy, dummy); } htdig-3.2.0b6/htlib/StringMatch.h0100644006314600127310000001031610055635551016067 0ustar angusgbhtdig// // StringMatch.h // // StringMatch: This class provides an interface to a fairly specialized string // lookup facility. It is intended to be used as a replace for any // regular expression matching when the pattern string is in the form: // // |||... // // Just like regular expression routines, the pattern needs to be // compiled before it can be used. This is done using the Pattern() // member function. Once the pattern has been compiled, the member // function Find() can be used to search for the pattern in a string. // If a string has been found, the "which" and "length" parameters // will be set to the string index and string length respectively. // (The string index is counted starting from 0) The return value of // Find() is the position at which the string was found or -1 if no // strings could be found. If a case insensitive match needs to be // performed, call the IgnoreCase() member function before calling // Pattern(). This function will setup a character translation table // which will convert all uppercase characters to lowercase. If some // other translation is required, the TranslationTable() member // function can be called to provide a custom table. This table needs // to be 256 characters. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: StringMatch.h,v 1.13 2004/05/28 13:15:21 lha Exp $ // #ifndef _StringMatch_h_ #define _StringMatch_h_ #include "Object.h" #include "HtWordType.h" class StringMatch : public Object { public: // // Construction/Destruction // StringMatch(); ~StringMatch(); // // Set the pattern to search for. If given as a string needs to // be in the form ||... If in the form of a // List, it should be a list of String objects. // void Pattern(char *pattern, char sep = '|'); // // Search for any of the strings in the pattern in the given // string The return value is the offset in the source a pattern // was found. In this case, the which variable will be set to the // index of the pattern string and length will be set to the // length of that pattern string. If none of the pattern strings // could be found, the return value will be -1 // int FindFirst(const char *string, int &which, int &length); int FindFirst(const char *string); int FindFirstWord(const char *string, int &which, int &length); int FindFirstWord(const char *string); // // If you are interested in matching instead of searching, use // the following. Same parameters except that the return value will // be 1 if there was a match, 0 if there was not. // int Compare(const char *string, int &which, int &length); int Compare(const char *string); int CompareWord(const char *string, int &which, int &length); int CompareWord(const char *string); // // Provide a character translation table which will be applied to // both the pattern and the input string. This table should be an // array of 256 characters. If is the caller's responsibility to // manage this table's allocation. The table should remain valid // until this object has been destroyed. // void TranslationTable(char *table); // // Build a local translation table which maps all uppercase // characters to lowercase // void IgnoreCase(); // // Build a local translation table which ignores all given punctuation // characters // void IgnorePunct(char *punct = (char*)NULL); // // Determine if there is a pattern associated with this Match object. // int hasPattern() {return table[0] != 0;} protected: int *table[256]; unsigned char *trans; int local_alloc; }; #endif htdig-3.2.0b6/htlib/String_fmt.cc0100644006314600127310000000237010055635551016117 0ustar angusgbhtdig// // String_fmt.cc // // String_fmt: Formatting functions for the String class. Those functions // are also used in other files, they are not purely internal // to the String class. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: String_fmt.cc,v 1.11 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htString.h" #include #include #ifdef _MSC_VER /* _WIN32 */ #define vsnprintf _vsnprintf #endif static char buf[10000]; //***************************************************************************** // char *form(char *fmt, ...) // char *form(const char *fmt, ...) { va_list args; va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); return buf; } //***************************************************************************** // char *vform(char *fmt, va_list args) // char *vform(const char *fmt, va_list args) { vsnprintf(buf, sizeof(buf), fmt, args); return buf; } htdig-3.2.0b6/htlib/ber.h0100644006314600127310000000350510055635551014416 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifndef _ber_h #define _ber_h #include #include typedef unsigned int ber_t; #define BER_MAX_BYTES (sizeof(ber_t) + 1) inline int ber_buf2value(const unsigned char* buf, int buf_len, ber_t& result) { result = 0; unsigned int bits = 0; int length = 1; while(*buf & 0x80) { if(bits > sizeof(ber_t) * 8) return EINVAL; result |= (*buf & 0x7f) << bits; bits += 7; buf++; length++; if(length > buf_len) return EINVAL; } result |= (*buf & 0x7f) << bits; return length; } inline int ber_file2value(FILE* fp, ber_t& result) { result = 0; unsigned int bits = 0; int c; int length = 1; while((c = fgetc(fp)) != EOF && (c & 0x80)) { if(bits > sizeof(ber_t) * 8) return EINVAL; result |= (c & 0x7f) << bits; bits += 7; length++; } if(c == EOF) return EINVAL; result |= (c & 0x7f) << bits; return length; } inline int ber_value2buf(unsigned char* buf, int buf_len, ber_t value) { if(buf_len <= 0) return EINVAL; int buf_idx = 0; buf[buf_idx++] = (value & 0x7f); while(value >>= 7) { if(buf_idx >= buf_len) return EINVAL; buf[buf_idx - 1] |= 0x80; buf[buf_idx++] = (value & 0x7f); } return buf_idx; } inline int ber_value2file(FILE* fp, ber_t value) { int length = 1; unsigned char current; current = (value & 0x7f); while(value >>= 7) { current |= 0x80; if(fputc(current, fp) == EOF) return EINVAL; current = (value & 0x7f); length++; } if(fputc(current, fp) == EOF) return EINVAL; return length; } #endif /* _ber_h */ htdig-3.2.0b6/htlib/clib.h0100644006314600127310000000162210055635551014555 0ustar angusgbhtdig/* Part of the ht://Dig package Copyright (c) 1999-2004 The ht://Dig Group For copyright details, see the file COPYING in your distribution or the GNU Library General Public License (LGPL) version 2 or later */ #ifndef _clib_h_ #define _clib_h_ #include extern "C" { #ifndef HAVE_GETCWD char *getcwd(char *, size_t); #endif #ifndef HAVE_MEMCMP int memcmp(const void *, const void *, size_t); #endif #ifndef HAVE_MEMCPY void *memcpy(void *, const void *, size_t); #endif #ifndef HAVE_MEMMOVE void *memmove(void *, const void *, size_t); #endif #ifndef HAVE_RAISE int raise (int); #endif #ifndef HAVE_SNPRINTF int snprintf(char *, size_t, const char *, ...); #endif #ifndef HAVE_STRERROR char *strerror(int); #endif #ifndef HAVE_VSNPRINTF int vsnprintf(char *, size_t, const char *, ...); #endif } #endif /* _clib_h_ */ htdig-3.2.0b6/htlib/filecopy.cc0100644006314600127310000000561707676127430015633 0ustar angusgbhtdig// // filecopy.c // // Copies files from one file to another. // Contains both Unix & Native Win32 Implementations // // Part of the ht://Dig package // Copyright (c) 2003 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // Copyright (c) 2002 RightNow Technologies, Inc. // Donated to The ht://Dig Group under LGPL License #include #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #else /* UNIX */ #include #include #include #include #include #include #endif /* _WIN32 | UNIX */ #include "filecopy.h" //---------------------------------------------------------------------- // int file_copy (char * from, char * to, char flags) //---------------------------------------------------------------------- // // copy file 'from' -> 'to' // // set flags to FILECOPY_OVERWRITE_ON to overwrite the 'to' file if // it exists // // set flags to FILECOPY_OVERWRITE_OFF to not overwrite the 'to' file // if it exists // // returns 0/FALSE if unsucessful // returns 1/TRUE if sucessful // // #ifdef _WIN32 int file_copy (char * from, char * to, char flags) { if (flags == FILECOPY_OVERWRITE_ON) { //overwrite if (TRUE != (CopyFile(from , to, FALSE))) return (FALSE); } else if (flags == FILECOPY_OVERWRITE_OFF) { //don't overwrite if (TRUE != (CopyFile(from , to, TRUE))) return (FALSE); } else //bad flag { return (FALSE); } return (TRUE); } #else //UNIX int file_copy (char * from, char * to, char flags) { size_t nmemb; //int nmemb; FILE *ifp, *ofp; char buf[BUFSIZ]; if (flags == FILECOPY_OVERWRITE_OFF) { if (access(to, F_OK) == 0) { //OUTLOG((FUNC, TRWRN, "file %s already exists\n", to)); return(FALSE); } else if (errno != ENOENT) { //OUTLOG((FUNC, TRERR, "access(%s, F_OK) failed\n", to)); return(FALSE); } } if ((ifp=fopen(from, "r")) == NULL) { //OUTLOG((FUNC, TRERR, "%s doesn't exist\n", from)); return(FALSE); } if ((ofp=fopen(to, "w+")) == NULL) { //OUTLOG((FUNC, TRERR, "can't create %s\n", to)); fclose(ifp); return(FALSE); } while ((nmemb=fread(buf, 1, sizeof(buf), ifp)) > 0) { if (fwrite(buf, 1, nmemb, ofp) != nmemb) { //OUTLOG((FUNC, TRERR, "fwrite failed\n")); fclose(ifp); fclose(ofp); return(FALSE); } } fclose(ifp); fclose(ofp); return (TRUE); } #endif /* _WIN32 | UNIX */ htdig-3.2.0b6/htlib/filecopy.h0100644006314600127310000000151307676127430015464 0ustar angusgbhtdig// // filecopy.h // // Copies files from one file to another. // Contains both Unix & Native Win32 Implementations // // Part of the ht://Dig package // Copyright (c) 2003 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // Copyright (c) 2002 RightNow Technologies, Inc. // Donated to The ht://Dig Group under LGPL License #ifdef __cplusplus //extern "C" { #endif #ifndef FILECOPY_H #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #define FILECOPY_OVERWRITE_ON 1 #define FILECOPY_OVERWRITE_OFF 2 int file_copy (char * from, char * to, char flags); #ifdef __cplusplus //} #endif #endif /* FILECOPY_H */ htdig-3.2.0b6/htlib/getcwd.c0100644006314600127310000001606710055635551015125 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #include #include #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #ifndef HAVE_GETCWD #define ISDOT(dp) \ (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) #ifndef dirfd #define dirfd(dirp) ((dirp)->dd_fd) #endif /* * getcwd -- * Get the current working directory. * * PUBLIC: #ifndef HAVE_GETCWD * PUBLIC: char *getcwd __P((char *, size_t)); * PUBLIC: #endif */ char * getcwd(pt, size) char *pt; size_t size; { register struct dirent *dp; register DIR *dir; register dev_t dev; register ino_t ino; register int first; register char *bpt, *bup; struct stat s; dev_t root_dev; ino_t root_ino; size_t ptsize, upsize; int ret, save_errno; char *ept, *eup, *up; /* * If no buffer specified by the user, allocate one as necessary. * If a buffer is specified, the size has to be non-zero. The path * is built from the end of the buffer backwards. */ if (pt) { ptsize = 0; if (!size) { __os_set_errno(EINVAL); return (NULL); } if (size == 1) { __os_set_errno(ERANGE); return (NULL); } ept = pt + size; } else { if ((ret = __os_malloc(ptsize = 1024 - 4, NULL, &pt)) != 0) { __os_set_errno(ret); return (NULL); } ept = pt + ptsize; } bpt = ept - 1; *bpt = '\0'; /* * Allocate bytes (1024 - malloc space) for the string of "../"'s. * Should always be enough (it's 340 levels). If it's not, allocate * as necessary. Special case the first stat, it's ".", not "..". */ if ((ret = __os_malloc(upsize = 1024 - 4, NULL, &up)) != 0) goto err; eup = up + 1024; bup = up; up[0] = '.'; up[1] = '\0'; /* Save root values, so know when to stop. */ if (stat("/", &s)) goto err; root_dev = s.st_dev; root_ino = s.st_ino; __os_set_errno(0); /* XXX readdir has no error return. */ for (first = 1;; first = 0) { /* Stat the current level. */ if (lstat(up, &s)) goto err; /* Save current node values. */ ino = s.st_ino; dev = s.st_dev; /* Check for reaching root. */ if (root_dev == dev && root_ino == ino) { *--bpt = PATH_SEPARATOR[0]; /* * It's unclear that it's a requirement to copy the * path to the beginning of the buffer, but it's always * been that way and stuff would probably break. */ bcopy(bpt, pt, ept - bpt); __os_free(up, upsize); return (pt); } /* * Build pointer to the parent directory, allocating memory * as necessary. Max length is 3 for "../", the largest * possible component name, plus a trailing NULL. */ if (bup + 3 + MAXNAMLEN + 1 >= eup) { if (__os_realloc(upsize *= 2, NULL, &up) != 0) goto err; bup = up; eup = up + upsize; } *bup++ = '.'; *bup++ = '.'; *bup = '\0'; /* Open and stat parent directory. */ if (!(dir = opendir(up)) || fstat(dirfd(dir), &s)) goto err; /* Add trailing slash for next directory. */ *bup++ = PATH_SEPARATOR[0]; /* * If it's a mount point, have to stat each element because * the inode number in the directory is for the entry in the * parent directory, not the inode number of the mounted file. */ save_errno = 0; if (s.st_dev == dev) { for (;;) { if (!(dp = readdir(dir))) goto notfound; if (dp->d_fileno == ino) break; } } else for (;;) { if (!(dp = readdir(dir))) goto notfound; if (ISDOT(dp)) continue; bcopy(dp->d_name, bup, dp->d_namlen + 1); /* Save the first error for later. */ if (lstat(up, &s)) { if (save_errno == 0) save_errno = __os_get_errno(); __os_set_errno(0); continue; } if (s.st_dev == dev && s.st_ino == ino) break; } /* * Check for length of the current name, preceding slash, * leading slash. */ if (bpt - pt < dp->d_namlen + (first ? 1 : 2)) { size_t len, off; if (!ptsize) { __os_set_errno(ERANGE); goto err; } off = bpt - pt; len = ept - bpt; if (__os_realloc(ptsize *= 2, NULL, &pt) != 0) goto err; bpt = pt + off; ept = pt + ptsize; bcopy(bpt, ept - len, len); bpt = ept - len; } if (!first) *--bpt = PATH_SEPARATOR[0]; bpt -= dp->d_namlen; bcopy(dp->d_name, bpt, dp->d_namlen); (void)closedir(dir); /* Truncate any file name. */ *bup = '\0'; } notfound: /* * If readdir set errno, use it, not any saved error; otherwise, * didn't find the current directory in its parent directory, set * errno to ENOENT. */ if (__os_get_errno() == 0) __os_set_errno(save_errno == 0 ? ENOENT : save_errno); /* FALLTHROUGH */ err: if (ptsize) __os_free(pt, ptsize); __os_free(up, upsize); return (NULL); } #endif /* HAVE_GETCWD */ htdig-3.2.0b6/htlib/getopt_local.c0100644006314600127310000000551710000513630016301 0ustar angusgbhtdig/* getopt_local.c */ /* Public Domain getopt clone */ /* Part of the ht://Dig package */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later or later */ /* */ /* Added to HtDig code June 2003 by Neal Richter, RightNow Technologies */ /* ** This getopt behaves pretty much like you would expect. ** It does handle arguments like '-ab-' a little differently ** then normal; I think the -- 'stop option processing' should ** be treated like just another option, so that's what mine does. ** Other getopts seem to ignore the second '-' in '-ab-'. ** ** I hereby place this version of getopt in ** the public domain. Do with this what you will. ** I'm sure there is a nicer and faster version out there ** somewhere but I don't care! ** ** Robert Osborne, May 1991. */ #include #include "getopt_local.h" #ifdef GETOPT_LOCAL int optind = 1; int opterr = 1; char *optarg = (char *) 0; static char *next_arg = (char *) 0; #define NO_OPT 0 #define OPT_PLAIN 1 #define OPT_ARG 2 /* ----- getopt -------------------------------------- Oct 23, 1999 21:48 --- */ int getopt(int argc, char *argv[], char *optstring) { int ret; int which = NO_OPT; if (next_arg == (char*) 0) { if (argv[optind] == (char *) 0 || argv[optind][0] != '-') return -1; next_arg = &argv[optind][1]; } if ((*next_arg == '\0') || (*next_arg == '-')) { optind++; return -1; } while(*optstring) if (*next_arg == *optstring++) which = (*optstring == ':') ? OPT_ARG : OPT_PLAIN; switch (which) { case NO_OPT: case OPT_PLAIN: ret = *next_arg++; if (*next_arg == '\0') { optind++; next_arg = (char *)0; } if (which == OPT_PLAIN) return ret; if (opterr) fprintf(stderr, "%s: illegal option -- %c\n", argv[0], ret); return '?'; case OPT_ARG: ret = *next_arg++; optind++; if (*next_arg != '\0') { optarg = next_arg; next_arg = (char*) 0; return ret; } if (argv[optind] != (char*) 0) { optarg = argv[optind]; optind++; next_arg = (char*) 0; return ret; } next_arg = (char*) 0; if (opterr) fprintf(stderr, "%s: option requires an option -- %c\n", argv[0], ret); return '?'; } return(-1); } #elif defined(_MSC_VER) /* _WIN32 */ #error _MSC_VER but !GETOPT_LOCAL #endif /* GETOPT_LOCAL */ htdig-3.2.0b6/htlib/getopt_local.h0100644006314600127310000000240710000513630016301 0ustar angusgbhtdig/* getopt_local.h */ /* Public Domain getopt clone */ /* Part of the ht://Dig package */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later or later */ /* */ /* Added to HtDig code June 2003 by Neal Richter, RightNow Technologies */ /* ** This getopt behaves pretty much like you would expect. ** It does handle arguments like '-ab-' a little differently ** then normal; I think the -- 'stop option processing' should ** be treated like just another option, so that's what mine does. ** Other getopts seem to ignore the second '-' in '-ab-'. ** ** I hereby place this version of getopt in ** the public domain. Do with this what you will. ** I'm sure there is a nicer and faster version out there ** somewhere but I don't care! ** ** Robert Osborne, May 1991. */ #ifndef GETOPT_LOCAL_H #define GETOPT_LOCAL_H #define GETOPT_LOCAL #ifdef __cplusplus extern "C" { #endif /* header for getopt_local.c */ extern int optind; extern int opterr; extern char *optarg; int getopt(int, char *[], char *); #ifdef __cplusplus } #endif #endif /* GETOPT_LOCAL_H */ htdig-3.2.0b6/htlib/good_strtok.cc0100644006314600127310000000221210055635551016334 0ustar angusgbhtdig// // good_strtok.cc // // good_strtok: The good_strtok() function is very similar to the // standard strtok() library function, except that good_strtok() // will only skip over 1 separator if it finds one. This is // needed when parsing strings with empty fields. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: good_strtok.cc,v 1.7 2004/05/28 13:15:21 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" // // Perform the same function as the standard strtok() function except that // multiple separators are NOT collapsed into one. // char *good_strtok(char *str, char term) { static char *string; if (str) { string = str; } if (string == NULL || *string == '\0') return NULL; char *p = string; while (*string && *string!=term) string++; if (*string) *string++ = '\0'; return p; } htdig-3.2.0b6/htlib/good_strtok.h0100644006314600127310000000134410055635551016203 0ustar angusgbhtdig// // good_strtok.h // // good_strtok: The good_strtok() function is very similar to the // standard strtok() library function, except that good_strtok() // will only skip over 1 separator if it finds one. This is // needed when parsing strings with empty fields. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: good_strtok.h,v 1.7 2004/05/28 13:15:21 lha Exp $ // #ifndef _good_strtok_h_ #define _good_strtok_h_ char *good_strtok(char *, char); #endif htdig-3.2.0b6/htlib/gregex.h0100644006314600127310000005216710055635551015137 0ustar angusgbhtdig// Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // /* Definitions for data structures and routines for the regular expression library, version 0.12. Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _REGEX_H #define _REGEX_H 1 /* Allow the use in C++ code. */ #ifdef __cplusplus extern "C" { #endif /* POSIX says that must be included (by the caller) before . */ #if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS /* VMS doesn't have `size_t' in , even though POSIX says it should be there. */ # include #endif /* The following two types have to be signed and unsigned integer type wide enough to hold a value of a pointer. For most ANSI compilers ptrdiff_t and size_t should be likely OK. Still size of these two types is 2 for Microsoft C. Ugh... */ typedef long int s_reg_t; typedef unsigned long int active_reg_t; /* The following bits are used to determine the regexp syntax we recognize. The set/not-set meanings are chosen so that Emacs syntax remains the value 0. The bits are given in alphabetical order, and the definitions shifted by one from the previous bit; thus, when we add or remove a bit, only one other definition need change. */ typedef unsigned long int reg_syntax_t; /* If this bit is not set, then \ inside a bracket expression is literal. If set, then such a \ quotes the following character. */ #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) /* If this bit is not set, then + and ? are operators, and \+ and \? are literals. If set, then \+ and \? are operators and + and ? are literals. */ #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) /* If this bit is set, then character classes are supported. They are: [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. If not set, then character classes are not supported. */ #define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) /* If this bit is set, then ^ and $ are always anchors (outside bracket expressions, of course). If this bit is not set, then it depends: ^ is an anchor if it is at the beginning of a regular expression or after an open-group or an alternation operator; $ is an anchor if it is at the end of a regular expression, or before a close-group or an alternation operator. This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because POSIX draft 11.2 says that * etc. in leading positions is undefined. We already implemented a previous draft which made those constructs invalid, though, so we haven't changed the code back. */ #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) /* If this bit is set, then special characters are always special regardless of where they are in the pattern. If this bit is not set, then special characters are special only in some contexts; otherwise they are ordinary. Specifically, * + ? and intervals are only special when not after the beginning, open-group, or alternation operator. */ #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) /* If this bit is set, then *, +, ?, and { cannot be first in an re or immediately after an alternation or begin-group operator. */ #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) /* If this bit is set, then . matches newline. If not set, then it doesn't. */ #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) /* If this bit is set, then . doesn't match NUL. If not set, then it does. */ #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) /* If this bit is set, nonmatching lists [^...] do not match newline. If not set, they do. */ #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) /* If this bit is set, either \{...\} or {...} defines an interval, depending on RE_NO_BK_BRACES. If not set, \{, \}, {, and } are literals. */ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) /* If this bit is set, +, ? and | aren't recognized as operators. If not set, they are. */ #define RE_LIMITED_OPS (RE_INTERVALS << 1) /* If this bit is set, newline is an alternation operator. If not set, newline is literal. */ #define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) /* If this bit is set, then `{...}' defines an interval, and \{ and \} are literals. If not set, then `\{...\}' defines an interval. */ #define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) /* If this bit is set, (...) defines a group, and \( and \) are literals. If not set, \(...\) defines a group, and ( and ) are literals. */ #define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) /* If this bit is set, then \ matches . If not set, then \ is a back-reference. */ #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) /* If this bit is set, then | is an alternation operator, and \| is literal. If not set, then \| is an alternation operator, and | is literal. */ #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) /* If this bit is set, then an ending range point collating higher than the starting range point, as in [z-a], is invalid. If not set, then when ending range point collates higher than the starting range point, the range is ignored. */ #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) /* If this bit is set, then an unmatched ) is ordinary. If not set, then an unmatched ) is invalid. */ #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) /* If this bit is set, succeed as soon as we match the whole pattern, without further backtracking. */ #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) /* If this bit is set, do not process the GNU regex operators. If not set, then the GNU regex operators are recognized. */ #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) /* If this bit is set, turn on internal regex debugging. If not set, and debugging was on, turn it off. This only works if regex.c is compiled -DDEBUG. We define this bit always, so that all that's needed to turn on debugging is to recompile regex.c; the calling code can always have this bit set, and it won't affect anything in the normal case. */ #define RE_DEBUG (RE_NO_GNU_OPS << 1) /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect already-compiled regexps. */ extern reg_syntax_t re_syntax_options; /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so don't delete them!) */ /* [[[begin syntaxes]]] */ #define RE_SYNTAX_EMACS 0 #define RE_SYNTAX_AWK \ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) #define RE_SYNTAX_GNU_AWK \ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS)) #define RE_SYNTAX_POSIX_AWK \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ | RE_INTERVALS | RE_NO_GNU_OPS) #define RE_SYNTAX_GREP \ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ | RE_NEWLINE_ALT) #define RE_SYNTAX_EGREP \ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ | RE_NO_BK_VBAR) #define RE_SYNTAX_POSIX_EGREP \ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC /* Syntax bits common to both basic and extended POSIX regex syntax. */ #define _RE_SYNTAX_POSIX_COMMON \ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ | RE_INTERVALS | RE_NO_EMPTY_RANGES) #define RE_SYNTAX_POSIX_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this isn't minimal, since other operators, such as \`, aren't disabled. */ #define RE_SYNTAX_POSIX_MINIMAL_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) #define RE_SYNTAX_POSIX_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ | RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD) /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is removed and RE_NO_BK_REFS is added. */ #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) /* [[[end syntaxes]]] */ /* Maximum number of duplicates an interval can allow. Some systems (erroneously) define this in other header files, but we want our value, so remove any previous define. */ #ifdef RE_DUP_MAX # undef RE_DUP_MAX #endif /* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */ #define RE_DUP_MAX (0x7fff) /* POSIX `cflags' bits (i.e., information for `regcomp'). */ /* If this bit is set, then use extended regular expression syntax. If not set, then use basic regular expression syntax. */ #define REG_EXTENDED 1 /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ #define REG_ICASE (REG_EXTENDED << 1) /* If this bit is set, then anchors do not match at newline characters in the string. If not set, then anchors do match at newlines. */ #define REG_NEWLINE (REG_ICASE << 1) /* If this bit is set, then report only success or fail in regexec. If not set, then returns differ between not matching and errors. */ #define REG_NOSUB (REG_NEWLINE << 1) /* POSIX `eflags' bits (i.e., information for regexec). */ /* If this bit is set, then the beginning-of-line operator doesn't match the beginning of the string (presumably because it's not the beginning of a line). If not set, then the beginning-of-line operator does match the beginning of the string. */ #define REG_NOTBOL 1 /* Like REG_NOTBOL, except for the end-of-line. */ #define REG_NOTEOL (1 << 1) /* If any error codes are removed, changed, or added, update the `re_error_msg' table in regex.c. */ typedef enum { #ifdef _XOPEN_SOURCE REG_ENOSYS = -1, /* This will never happen for this implementation. */ #endif REG_NOERROR = 0, /* Success. */ REG_NOMATCH, /* Didn't find a match (for regexec). */ /* POSIX regcomp return error codes. (In the order listed in the standard.) */ REG_BADPAT, /* Invalid pattern. */ REG_ECOLLATE, /* Not implemented. */ REG_ECTYPE, /* Invalid character class name. */ REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ REG_EBRACK, /* Unmatched left bracket. */ REG_EPAREN, /* Parenthesis imbalance. */ REG_EBRACE, /* Unmatched \{. */ REG_BADBR, /* Invalid contents of \{\}. */ REG_ERANGE, /* Invalid range end. */ REG_ESPACE, /* Ran out of memory. */ REG_BADRPT, /* No preceding re for repetition op. */ /* Error codes we've added. */ REG_EEND, /* Premature end. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ } reg_errcode_t; /* This data structure represents a compiled pattern. Before calling the pattern compiler, the fields `buffer', `allocated', `fastmap', `translate', and `no_sub' can be set. After the pattern has been compiled, the `re_nsub' field is available. All other fields are private to the regex routines. */ #ifndef RE_TRANSLATE_TYPE # define RE_TRANSLATE_TYPE char * #endif struct re_pattern_buffer { /* [[[begin pattern_buffer]]] */ /* Space that holds the compiled pattern. It is declared as `unsigned char *' because its elements are sometimes used as array indexes. */ unsigned char *buffer; /* Number of bytes to which `buffer' points. */ unsigned long int allocated; /* Number of bytes actually used in `buffer'. */ unsigned long int used; /* Syntax setting with which the pattern was compiled. */ reg_syntax_t syntax; /* Pointer to a fastmap, if any, otherwise zero. re_search uses the fastmap, if there is one, to skip over impossible starting points for matches. */ char *fastmap; /* Either a translate table to apply to all characters before comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ RE_TRANSLATE_TYPE translate; /* Number of subexpressions found by the compiler. */ size_t re_nsub; /* Zero if this pattern cannot match the empty string, one else. Well, in truth it's used only in `re_search_2', to see whether or not we should use the fastmap, so we don't set this absolutely perfectly; see `re_compile_fastmap' (the `duplicate' case). */ unsigned can_be_null : 1; /* If REGS_UNALLOCATED, allocate space in the `regs' structure for `max (RE_NREGS, re_nsub + 1)' groups. If REGS_REALLOCATE, reallocate space if necessary. If REGS_FIXED, use what's there. */ #define REGS_UNALLOCATED 0 #define REGS_REALLOCATE 1 #define REGS_FIXED 2 unsigned regs_allocated : 2; /* Set to zero when `regex_compile' compiles a pattern; set to one by `re_compile_fastmap' if it updates the fastmap. */ unsigned fastmap_accurate : 1; /* If set, `re_match_2' does not return information about subexpressions. */ unsigned no_sub : 1; /* If set, a beginning-of-line anchor doesn't match at the beginning of the string. */ unsigned not_bol : 1; /* Similarly for an end-of-line anchor. */ unsigned not_eol : 1; /* If true, an anchor at a newline matches. */ unsigned newline_anchor : 1; /* [[[end pattern_buffer]]] */ }; typedef struct re_pattern_buffer regex_t; /* Type for byte offsets within the string. POSIX mandates this. */ typedef int regoff_t; /* This is the structure we store register match data in. See regex.texinfo for a full description of what registers match. */ struct re_registers { unsigned num_regs; regoff_t *start; regoff_t *end; }; /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, `re_match_2' returns information about at least this many registers the first time a `regs' structure is passed. */ #ifndef RE_NREGS # define RE_NREGS 30 #endif /* POSIX specification for registers. Aside from the different names than `re_registers', POSIX uses an array of structures, instead of a structure of arrays. */ typedef struct { regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ } regmatch_t; /* Declarations for routines. */ /* To avoid duplicating every routine declaration -- once with a prototype (if we are ANSI), and once without (if we aren't) -- we use the following macro to declare argument types. This unfortunately clutters up the declarations a bit, but I think it's worth it. */ #if defined(__STDC__) # define _RE_ARGS(args) args #else /* not __STDC__ */ # define _RE_ARGS(args) () #endif /* not __STDC__ */ /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the `re_syntax_options' variable. */ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ extern const char *re_compile_pattern _RE_ARGS ((const char *pattern, size_t length, struct re_pattern_buffer *buffer)); /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); /* Search in the string STRING (with length LENGTH) for the pattern compiled into BUFFER. Start searching at position START, for RANGE characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ extern int re_search _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs)); /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ extern int re_search_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop)); /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ extern int re_match _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs)); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ extern int re_match_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop)); /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated with malloc, and must each be at least `NUM_REGS * sizeof (regoff_t)' bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ extern void re_set_registers _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)); #if defined _REGEX_RE_COMP || defined _LIBC # ifndef _CRAY /* 4.2 bsd compatibility. */ extern char *re_comp _RE_ARGS ((const char *)); extern int re_exec _RE_ARGS ((const char *)); # endif #endif /* GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". */ #ifndef __restrict # if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) # if defined restrict || 199901L <= __STDC_VERSION__ # define __restrict restrict # else # define __restrict # endif # endif #endif /* For now unconditionally define __restrict_arr to expand to nothing. Ideally we would have a test for the compiler which allows defining it to restrict. */ #ifndef __restrict_arr # define __restrict_arr #endif /* POSIX compatibility. */ extern int regcomp _RE_ARGS ((regex_t *__restrict __preg, const char *__restrict __pattern, int __cflags)); extern int regexec _RE_ARGS ((const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[__restrict_arr], int __eflags)); extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg, char *__errbuf, size_t __errbuf_size)); extern void regfree _RE_ARGS ((regex_t *__preg)); #ifdef __cplusplus } #endif /* C++ */ #endif /* regex.h */ /* Local variables: make-backup-files: t version-control: t trim-versions-without-asking: nil End: */ htdig-3.2.0b6/htlib/htString.h0100644006314600127310000001475210055635551015456 0ustar angusgbhtdig// // htString.h // // htString: (implementation in String.cc) Just Another String class. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htString.h,v 1.24 2004/05/28 13:15:21 lha Exp $ // #ifndef __String_h #define __String_h #include "Object.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ class String : public Object { public: String() { Length = 0; Allocated = 0; Data = 0; } // Create an empty string String(int init); // initial allocated length String(const char *s); // from null terminated s String(const char *s, int len); // from s with length len String(const String &s); // Copy constructor // // This can be used for performance reasons if it is known the // String will need to grow. // String(const String &s, int allocation_hint); ~String(); inline int length() const; char *get(); const char *get() const; operator char*() { return get(); } operator const char*() const { return get(); } // // Interpretation // int as_integer(int def = 0) const; double as_double(double def = 0) const; int empty() const { return length() == 0; } // // If it is not posible to use the constructor with an initial // allocation size, use the following member to set the size. // void allocate(int init) {reallocate_space(init);} // // allocate space for a new char *, and copy the String in. // char *new_char() const; // // Assignment // inline String& set(const char *s, int l) { trunc(); append(s, l); return *this; } inline String& set(char *s) { trunc(); append(s, strlen(s)); return *this; } void operator = (const String &s); void operator = (const char *s); inline void operator += (const String &s) { append(s); } inline void operator += (const char *s) { append(s); } // // Appending // inline String &operator << (const char *); inline String &operator << (char); inline String &operator << (unsigned char c) {return *this<<(char)c;} String &operator << (int); String &operator << (unsigned int); String &operator << (long); inline String &operator << (short i) {return *this<<(int)i;} String &operator << (const String &); String &operator << (const String *s) {return *this << *s;} // // Access to specific characters // inline char &operator [] (int n); inline char operator [] (int n) const; inline char Nth (int n) { return (*this)[n]; } inline char last() const { return Length > 0 ? Data[Length - 1] : '\0'; } // // Removing // char operator >> (char c); // // Comparison // Return: // 0 : 'this' is equal to 's'. // -1 : 'this' is less than 's'. // 1 : 'this' is greater than 's'. // int compare(const Object& s) const { return compare((const String&)s); } int compare(const String& s) const; int nocase_compare(const String &s) const; // // Searching for parts // int lastIndexOf(char c) const; int lastIndexOf(char c, int pos) const; int indexOf(char c) const; int indexOf(char c, int pos) const; int indexOf(const char *) const; int indexOf(const char *, int pos) const; // // Manipulation // void append(const String &s); void append(const char *s); void append(const char *s, int n); void append(char ch); inline String &trunc() { Length = 0; return *this; } String &chop(int n = 1); String &chop(char ch = '\n'); String &chop(const char *str = (char *)"\r\n"); // // SubStrings // // The string starting at postion 'start' and length 'len'. // String sub(int start, int len) const; String sub(int start) const; // // IO // int Write(int fd) const; #ifndef NOSTREAM void debug(ostream &o); #endif /* NOSTREAM */ // // Non-member operators // friend String operator + (const String &a, const String &b); friend int operator == (const String &a, const String &b); friend int operator != (const String &a, const String &b); friend int operator < (const String &a, const String &b); friend int operator > (const String &a, const String &b); friend int operator <= (const String &a, const String &b); friend int operator >= (const String &a, const String &b); #ifndef NOSTREAM friend ostream &operator << (ostream &o, const String &s); friend istream &operator >> (istream &in, String &line); #endif /* NOSTREAM */ int readLine(FILE *in); int lowercase(); int uppercase(); void replace(char c1, char c2); int remove(const char *); Object *Copy() const { return new String(*this); } // // Persistent storage support // void Serialize(String &); void Deserialize(String &, int &); private: int Length; // Current Length int Allocated; // Total space allocated char *Data; // The actual contents void copy_data_from(const char *s, int len, int dest_offset = 0); void copy(const char *s, int len, int allocation_hint); // // Possibly make Data bigger. // void reallocate_space(int len); // // Allocate some space for the data. Delete Data if it // has been allocated. // void allocate_space(int len); // Allocate some space without rounding void allocate_fix_space(int len); friend class StringIndex; }; extern char *form(const char *, ...); extern char *vform(const char *, va_list); // // Inline methods. // inline String &String::operator << (const char *str) { append(str); return *this; } inline String &String::operator << (char ch) { append(ch); return *this; } inline int String::length() const { return Length; } inline char String::operator [] (int n) const { if(n < 0) n = Length + n; if(n >= Length || n < 0) return '\0'; return Data[n]; } static char null = '\0'; inline char &String::operator [] (int n) { if(n < 0) n = Length + n; if(n >= Length || n < 0) return null; return Data[n]; } // // Non friend, non member operators // #endif htdig-3.2.0b6/htlib/lib.h0100644006314600127310000000417310055635551014416 0ustar angusgbhtdig// // lib.h // // lib: Contains typical declarations and header inclusions used by // most sources in this directory. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: lib.h,v 1.16 2004/05/28 13:15:21 lha Exp $ // #ifndef _lib_h #define _lib_h #ifndef _MSC_VER /* _WIN32 */ #include "clib.h" #endif #include #ifdef _MSC_VER /* _WIN32 */ #include "dirent_local.h" #define S_ISDIR(v) ((v)&_S_IFDIR) #define S_ISREG(v) ((v)&_S_IFREG) #else #include // for scandir #endif #ifdef _MSC_VER /* _WIN32 */ #include #include #define S_IFIFO _S_IFIFO // pipe #define S_IFBLK 0060000 // block special #define S_IFLNK 0120000 // symbolic link #define S_IFSOCK 0140000 // socket #define S_IFWHT 0160000 // whiteout #define R_OK 02 #define popen _popen #define pclose _pclose #define lstat stat #define readlink(x,y,z) {-1} #define sleep(t) _sleep((t) * 1000) #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif // // Other defines used throughout the library // #define OK 0 #define NOTOK (-1) // // To get rid of inconsistencies between different machines we will ALWAYS // use our own version of the following routines // int mystrcasecmp(const char *, const char *); int mystrncasecmp(const char *, const char *, int); // // The standard strstr() function is limited in that it does case-sensitive // searches. This version will ignore case. // const char *mystrcasestr(const char *s, const char *pattern); // // Too many problems with system strptime() functions... Just use our own // version of it. // char *mystrptime(const char *buf, const char *fmt, struct tm *tm); // // timegm() is quite rare, so provide our own. // extern "C" time_t Httimegm(struct tm *tm); #endif htdig-3.2.0b6/htlib/libdefs.h0100644006314600127310000000331310000513630015232 0ustar angusgbhtdig#ifndef LIBDEFS_H #define LIBDEFS_H /* {{{ includes */ #ifdef _MSC_VER /* _WIN32 */ #include #endif #include "htconfig.h" #ifdef STDC_HEADERS #include #include #include #endif /* }}} */ /* {{{ typedefs */ #if SIZEOF_UNSIGNED_LONG_INT == 8 typedef unsigned long word64; #define TIGER_64BIT #elif SIZEOF_UNSIGNED_LONG_LONG_INT == 8 #ifndef _MSC_VER /* _WIN32 */ typedef unsigned long long word64; #else //ifdef _MSC_VER /* _WIN32 */ typedef DWORD64 word64; #endif #else #error "Cannot find a 64 bit integer in your system, sorry." #endif #if SIZEOF_UNSIGNED_LONG_INT == 4 typedef unsigned long word32; #elif SIZEOF_UNSIGNED_INT == 4 typedef unsigned int word32; #else #error "Cannot find a 32 bit integer in your system, sorry." #endif #if SIZEOF_UNSIGNED_INT == 2 typedef unsigned int word16; #elif SIZEOF_UNSIGNED_SHORT_INT == 2 typedef unsigned short word16; #else #error "Cannot find a 16 bit integer in your system, sorry." #endif #if SIZEOF_UNSIGNED_CHAR == 1 typedef unsigned char word8; #else #error "Cannot find an 8 bit char in your system, sorry." #endif typedef word8 byte; typedef word32 dword; /* }}} */ /* {{{ macros and defines */ #define RAND32 (word32) ((word32)rand() << 17 ^ (word32)rand() << 9 ^ rand()) #ifndef HAVE_MEMMOVE #ifdef HAVE_BCOPY #define memmove(d, s, n) bcopy ((s), (d), (n)) #else #error "Neither memmove nor bcopy exists on your system." #endif #endif #define ENCRYPT 0 #define DECRYPT 1 /* }}} */ /* {{{ prototypes */ void Bzero(void *s, int n); word32 byteswap(word32 x); int BreakToThree(void *key, unsigned int keylen, void *keyword1, void *keyword2, void *keyword3); /* }}} */ #endif htdig-3.2.0b6/htlib/malloc.c0100644006314600127310000000215207723250454015110 0ustar angusgbhtdig /* Work around bug on some systems where malloc (0) fails. Copyright (C) 1997, 1998 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. */ /* written by Jim Meyering */ #if HAVE_CONFIG_H # include #endif #undef malloc #include char *malloc (); /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ char * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); } htdig-3.2.0b6/htlib/md5.cc0100644006314600127310000000136307521550534014472 0ustar angusgbhtdig#include #include #include extern "C" { #include "mhash_md5.h" } #define MD5_LENGTH 16 void md5(char *rhash, char *buf, int len, time_t *date, bool debug) { int i; MD5_CTX *td; unsigned char *hash; td = (MD5_CTX *)malloc(sizeof(MD5_CTX)); MD5Init( td); // td = mhash_init(MHASH_MD5); MD5Update(td,(unsigned char *) buf, len); // mhash(td, buf, len); if (date) { MD5Update(td,(unsigned char *)date, sizeof(*date)); } hash = (unsigned char *)MD5Final(td); // hash = (char *)mhash_end(td); memcpy(rhash,hash,MD5_LENGTH); if (debug) { printf(" "); for (i = 0; i < MD5_LENGTH; i++) { printf("%.2x", hash[i]); } printf(" "); } delete td; } htdig-3.2.0b6/htlib/md5.h0100644006314600127310000000013407427026544014333 0ustar angusgbhtdig#define MD5_LENGTH 16 void md5(char *rhash, char *buf, int len, time_t *date, bool debug); htdig-3.2.0b6/htlib/memcmp.c0100644006314600127310000000501210055635551015112 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #ifndef HAVE_MEMCMP /* * memcmp -- * * PUBLIC: #ifndef HAVE_MEMCMP * PUBLIC: int memcmp __P((const void *, const void *, size_t)); * PUBLIC: #endif */ int memcmp(s1, s2, n) char *s1, *s2; size_t n; { if (n != 0) { unsigned char *p1 = (unsigned char *)s1, *p2 = (unsigned char *)s2; do { if (*p1++ != *p2++) return (*--p1 - *--p2); } while (--n != 0); } return (0); } #endif /* HAVE_MEMCMP */ htdig-3.2.0b6/htlib/memcpy.c0100644006314600127310000001027610055635551015136 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_SYSTEM_INCLUDES #include #endif #ifndef HAVE_MEMCPY /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */ typedef int word; /* "word" used for optimal copy speed */ #undef wsize #define wsize sizeof(word) #undef wmask #define wmask (wsize - 1) /* * Copy a block of memory, handling overlap. * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ /* * PUBLIC: #ifndef HAVE_MEMCPY * PUBLIC: void *memcpy __P((void *, const void *, size_t)); * PUBLIC: #endif */ void * memcpy(dst0, src0, length) void *dst0; const void *src0; register size_t length; { register char *dst = dst0; register const char *src = src0; register size_t t; if (length == 0 || dst == src) /* nothing to do */ goto done; /* * Macros: loop-t-times; and loop-t-times, t>0 */ #undef TLOOP #define TLOOP(s) if (t) TLOOP1(s) #undef TLOOP1 #define TLOOP1(s) do { s; } while (--t) if ((unsigned long)dst < (unsigned long)src) { /* * Copy forward. */ t = (int)src; /* only need low bits */ if ((t | (int)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ if ((t ^ (int)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); length -= t; TLOOP1(*dst++ = *src++); } /* * Copy whole words, then mop up any trailing bytes. */ t = length / wsize; TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize); t = length & wmask; TLOOP(*dst++ = *src++); } else { /* * Copy backwards. Otherwise essentially the same. * Alignment works as before, except that it takes * (t&wmask) bytes to align, not wsize-(t&wmask). */ src += length; dst += length; t = (int)src; if ((t | (int)dst) & wmask) { if ((t ^ (int)dst) & wmask || length <= wsize) t = length; else t &= wmask; length -= t; TLOOP1(*--dst = *--src); } t = length / wsize; TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src); t = length & wmask; TLOOP(*--dst = *--src); } done: return (dst0); } #endif /* HAVE_MEMCPY */ htdig-3.2.0b6/htlib/memmove.c0100644006314600127310000001030110055635551015276 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef NO_SYSTEM_INCLUDES #include #endif #ifndef HAVE_MEMMOVE /* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */ typedef int word; /* "word" used for optimal copy speed */ #undef wsize #define wsize sizeof(word) #undef wmask #define wmask (wsize - 1) /* * Copy a block of memory, handling overlap. * This is the routine that actually implements * (the portable versions of) bcopy, memcpy, and memmove. */ /* * PUBLIC: #ifndef HAVE_MEMMOVE * PUBLIC: void *memmove __P((void *, const void *, size_t)); * PUBLIC: #endif */ void * memmove(dst0, src0, length) void *dst0; const void *src0; register size_t length; { register char *dst = dst0; register const char *src = src0; register size_t t; if (length == 0 || dst == src) /* nothing to do */ goto done; /* * Macros: loop-t-times; and loop-t-times, t>0 */ #undef TLOOP #define TLOOP(s) if (t) TLOOP1(s) #undef TLOOP1 #define TLOOP1(s) do { s; } while (--t) if ((unsigned long)dst < (unsigned long)src) { /* * Copy forward. */ t = (int)src; /* only need low bits */ if ((t | (int)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ if ((t ^ (int)dst) & wmask || length < wsize) t = length; else t = wsize - (t & wmask); length -= t; TLOOP1(*dst++ = *src++); } /* * Copy whole words, then mop up any trailing bytes. */ t = length / wsize; TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize); t = length & wmask; TLOOP(*dst++ = *src++); } else { /* * Copy backwards. Otherwise essentially the same. * Alignment works as before, except that it takes * (t&wmask) bytes to align, not wsize-(t&wmask). */ src += length; dst += length; t = (int)src; if ((t | (int)dst) & wmask) { if ((t ^ (int)dst) & wmask || length <= wsize) t = length; else t &= wmask; length -= t; TLOOP1(*--dst = *--src); } t = length / wsize; TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src); t = length & wmask; TLOOP(*--dst = *--src); } done: return (dst0); } #endif /* HAVE_MEMOVE */ htdig-3.2.0b6/htlib/mhash_md5.c0100644006314600127310000003031110055635551015501 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* This is a slightly modified version */ #include "mhash_md5.h" /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST((word32[4], unsigned char[64])); static void Encode PROTO_LIST ((unsigned char *, word32 *, unsigned int)); static void Decode PROTO_LIST ((word32 *, unsigned char *, unsigned int)); static void MD5_memcpy PROTO_LIST((POINTER, POINTER, unsigned int)); static void MD5_memset PROTO_LIST((POINTER, int, unsigned int)); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (word32)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (word32)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (word32)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (word32)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void MD5Init(context) MD5_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void MD5Update(context, input, inputLen) MD5_CTX *context; /* context */ const unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int) ((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((word32) inputLen << 3)) < ((word32) inputLen << 3)) context->count[1]++; context->count[1] += ((word32) inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { MD5_memcpy ((POINTER) & context->buffer[index], (POINTER) input, partLen); MD5Transform(context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform(context->state, (unsigned char *) &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ MD5_memcpy ((POINTER) & context->buffer[index], (POINTER) & input[i], inputLen - i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void * MD5Final(context) MD5_CTX *context; /* context */ { unsigned char bits[8]; unsigned int index, padLen; unsigned char *digest = malloc(16); /* Save number of bits */ Encode(bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD5Update(context, PADDING, padLen); /* Append length (before padding) */ MD5Update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, 16); /* Zeroize sensitive information. */ MD5_memset((POINTER) context, 0, sizeof(*context)); return digest; } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform(state, block) word32 state[4]; unsigned char block[64]; { word32 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode(x, block, 64); /* Round 1 */ FF(a, b, c, d, x[0], S11, 0xd76aa478); /* 1 */ FF(d, a, b, c, x[1], S12, 0xe8c7b756); /* 2 */ FF(c, d, a, b, x[2], S13, 0x242070db); /* 3 */ FF(b, c, d, a, x[3], S14, 0xc1bdceee); /* 4 */ FF(a, b, c, d, x[4], S11, 0xf57c0faf); /* 5 */ FF(d, a, b, c, x[5], S12, 0x4787c62a); /* 6 */ FF(c, d, a, b, x[6], S13, 0xa8304613); /* 7 */ FF(b, c, d, a, x[7], S14, 0xfd469501); /* 8 */ FF(a, b, c, d, x[8], S11, 0x698098d8); /* 9 */ FF(d, a, b, c, x[9], S12, 0x8b44f7af); /* 10 */ FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG(a, b, c, d, x[1], S21, 0xf61e2562); /* 17 */ GG(d, a, b, c, x[6], S22, 0xc040b340); /* 18 */ GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG(b, c, d, a, x[0], S24, 0xe9b6c7aa); /* 20 */ GG(a, b, c, d, x[5], S21, 0xd62f105d); /* 21 */ GG(d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG(b, c, d, a, x[4], S24, 0xe7d3fbc8); /* 24 */ GG(a, b, c, d, x[9], S21, 0x21e1cde6); /* 25 */ GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG(c, d, a, b, x[3], S23, 0xf4d50d87); /* 27 */ GG(b, c, d, a, x[8], S24, 0x455a14ed); /* 28 */ GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG(d, a, b, c, x[2], S22, 0xfcefa3f8); /* 30 */ GG(c, d, a, b, x[7], S23, 0x676f02d9); /* 31 */ GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH(a, b, c, d, x[5], S31, 0xfffa3942); /* 33 */ HH(d, a, b, c, x[8], S32, 0x8771f681); /* 34 */ HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH(a, b, c, d, x[1], S31, 0xa4beea44); /* 37 */ HH(d, a, b, c, x[4], S32, 0x4bdecfa9); /* 38 */ HH(c, d, a, b, x[7], S33, 0xf6bb4b60); /* 39 */ HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH(d, a, b, c, x[0], S32, 0xeaa127fa); /* 42 */ HH(c, d, a, b, x[3], S33, 0xd4ef3085); /* 43 */ HH(b, c, d, a, x[6], S34, 0x4881d05); /* 44 */ HH(a, b, c, d, x[9], S31, 0xd9d4d039); /* 45 */ HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH(b, c, d, a, x[2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II(a, b, c, d, x[0], S41, 0xf4292244); /* 49 */ II(d, a, b, c, x[7], S42, 0x432aff97); /* 50 */ II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II(b, c, d, a, x[5], S44, 0xfc93a039); /* 52 */ II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II(d, a, b, c, x[3], S42, 0x8f0ccc92); /* 54 */ II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II(b, c, d, a, x[1], S44, 0x85845dd1); /* 56 */ II(a, b, c, d, x[8], S41, 0x6fa87e4f); /* 57 */ II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II(c, d, a, b, x[6], S43, 0xa3014314); /* 59 */ II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II(a, b, c, d, x[4], S41, 0xf7537e82); /* 61 */ II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II(c, d, a, b, x[2], S43, 0x2ad7d2bb); /* 63 */ II(b, c, d, a, x[9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ MD5_memset((POINTER) x, 0, sizeof(x)); } /* Encodes input (word32) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode(output, input, len) unsigned char *output; word32 *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char) (input[i] & 0xff); output[j + 1] = (unsigned char) ((input[i] >> 8) & 0xff); output[j + 2] = (unsigned char) ((input[i] >> 16) & 0xff); output[j + 3] = (unsigned char) ((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (word32). Assumes len is a multiple of 4. */ static void Decode(output, input, len) word32 *output; unsigned char *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((word32) input[j]) | (((word32) input[j + 1]) << 8) | (((word32) input[j + 2]) << 16) | (((word32) input[j + 3]) << 24); } /* Note: Replace "for loop" with standard memcpy if possible. */ static void MD5_memcpy(output, input, len) POINTER output; POINTER input; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset(output, value, len) POINTER output; int value; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) ((char *) output)[i] = (char) value; } htdig-3.2.0b6/htlib/mhash_md5.h0100644006314600127310000000450410055635551015513 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef MHASH_MD5_H #define MHASH_MD5_H #include /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef PROTOTYPES #define PROTOTYPES 1 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif /* MD5 context. */ typedef struct { word32 state[4]; /* state (ABCD) */ word32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ word8 buffer[64]; /* input buffer */ } MD5_CTX; void MD5Init PROTO_LIST((MD5_CTX *)); void MD5Update PROTO_LIST((MD5_CTX *, const unsigned char *, unsigned int)); void *MD5Final PROTO_LIST((MD5_CTX *)); #endif htdig-3.2.0b6/htlib/mktime.c0100644006314600127310000003610010055635551015124 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /* Convert a `struct tm' to a time_t value. Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert (eggert@twinsun.com). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Define this to have a standalone program to test this implementation of mktime. */ /* #define DEBUG 1 */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #ifdef _LIBC # define HAVE_LIMITS_H 1 # define STDC_HEADERS 1 #endif /* Assume that leap seconds are possible, unless told otherwise. If the host has a `zic' command with a `-L leapsecondfilename' option, then it supports leap seconds; otherwise it probably doesn't. */ #ifndef LEAP_SECONDS_POSSIBLE # define LEAP_SECONDS_POSSIBLE 1 #endif #include /* Some systems define `time_t' here. */ #include #if HAVE_LIMITS_H # include #endif #if DEBUG # include # if STDC_HEADERS # include # endif /* Make it work even if the system's libc has its own mktime routine. */ # define mktime my_mktime #endif /* DEBUG */ #ifndef __P # if defined __GNUC__ || (defined __STDC__ && __STDC__) # define __P(args) args # else # define __P(args) () # endif /* GCC. */ #endif /* Not __P. */ #ifndef CHAR_BIT # define CHAR_BIT 8 #endif /* The extra casts work around common compiler bugs. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The outer cast is needed to work around a bug in Cray C 5.0.3.0. It is necessary at least when t == time_t. */ #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)) #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) #ifndef INT_MIN # define INT_MIN TYPE_MINIMUM (int) #endif #ifndef INT_MAX # define INT_MAX TYPE_MAXIMUM (int) #endif #ifndef TIME_T_MIN # define TIME_T_MIN TYPE_MINIMUM (time_t) #endif #ifndef TIME_T_MAX # define TIME_T_MAX TYPE_MAXIMUM (time_t) #endif #define TM_YEAR_BASE 1900 #define EPOCH_YEAR 1970 #ifndef __isleap /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #endif /* How many days come before each month (0-12). */ const unsigned short int __mon_yday[2][13] = { /* Normal years. */ { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, /* Leap years. */ { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; #ifdef _LIBC # define my_mktime_localtime_r __localtime_r #else /* If we're a mktime substitute in a GNU program, then prefer localtime to localtime_r, since many localtime_r implementations are buggy. */ static struct tm * my_mktime_localtime_r (const time_t *t, struct tm *tp) { struct tm *l = localtime (t); if (! l) return 0; *tp = *l; return tp; } #endif /* ! _LIBC */ /* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP), measured in seconds, ignoring leap seconds. YEAR uses the same numbering as TM->tm_year. All values are in range, except possibly YEAR. If TP is null, return a nonzero value. If overflow occurs, yield the low order bits of the correct answer. */ static time_t ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp) { if (!tp) return 1; else { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow. time_t overflow is OK, since only the low order bits of the correct time_t answer are needed. Don't convert to time_t until after all divisions are done, since time_t might be unsigned. */ int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3); int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = a100 >> 2; int b400 = b100 >> 2; int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); time_t years = year - (time_t) tp->tm_year; time_t days = (365 * years + intervening_leap_days + (yday - tp->tm_yday)); return (60 * (60 * (24 * days + (hour - tp->tm_hour)) + (min - tp->tm_min)) + (sec - tp->tm_sec)); } } /* Use CONVERT to convert *T to a broken down time in *TP. If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. */ static struct tm * ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), time_t *t, struct tm *tp) { struct tm *r; if (! (r = (*convert) (t, tp)) && *t) { time_t bad = *t; time_t ok = 0; struct tm tm; /* BAD is a known unconvertible time_t, and OK is a known good one. Use binary search to narrow the range between BAD and OK until they differ by 1. */ while (bad != ok + (bad < 0 ? -1 : 1)) { time_t mid = *t = (bad < 0 ? bad + ((ok - bad) >> 1) : ok + ((bad - ok) >> 1)); if ((r = (*convert) (t, tp))) { tm = *r; ok = mid; } else bad = mid; } if (!r && ok) { /* The last conversion attempt failed; revert to the most recent successful attempt. */ *t = ok; *tp = tm; r = tp; } } return r; } /* Convert *TP to a time_t value, inverting the monotonic and mostly-unit-linear conversion function CONVERT. Use *OFFSET to keep track of a guess at the offset of the result, compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. */ time_t __mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), time_t *offset) { time_t t, dt, t0, t1, t2; struct tm tm; /* The maximum number of probes (calls to CONVERT) should be enough to handle any combinations of time zone rule changes, solar time, leap seconds, and oscillations around a spring-forward gap. POSIX.1 prohibits leap seconds, but some hosts have them anyway. */ int remaining_probes = 6; /* Time requested. Copy it in case CONVERT modifies *TP; this can occur if TP is localtime's returned value and CONVERT is localtime. */ int sec = tp->tm_sec; int min = tp->tm_min; int hour = tp->tm_hour; int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; int isdst = tp->tm_isdst; /* Ensure that mon is in range, and set year accordingly. */ int mon_remainder = mon % 12; int negative_mon_remainder = mon_remainder < 0; int mon_years = mon / 12 - negative_mon_remainder; int year = year_requested + mon_years; /* The other values need not be in range: the remaining code handles minor overflows correctly, assuming int and time_t arithmetic wraps around. Major overflows are caught at the end. */ /* Calculate day of year from year, month, and day of month. The result need not be in range. */ int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)] [mon_remainder + 12 * negative_mon_remainder]) + mday - 1); int sec_requested = sec; #if LEAP_SECONDS_POSSIBLE /* Handle out-of-range seconds specially, since ydhms_tm_diff assumes every minute has 60 seconds. */ if (sec < 0) sec = 0; if (59 < sec) sec = 59; #endif /* Invert CONVERT by probing. First assume the same offset as last time. Then repeatedly use the error to improve the guess. */ tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE; tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0; t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm); for (t = t1 = t2 = t0 + *offset; (dt = ydhms_tm_diff (year, yday, hour, min, sec, ranged_convert (convert, &t, &tm))); t1 = t2, t2 = t, t += dt) if (t == t1 && t != t2 && (isdst < 0 || tm.tm_isdst < 0 || (isdst != 0) != (tm.tm_isdst != 0))) /* We can't possibly find a match, as we are oscillating between two values. The requested time probably falls within a spring-forward gap of size DT. Follow the common practice in this case, which is to return a time that is DT away from the requested time, preferring a time whose tm_isdst differs from the requested value. In practice, this is more useful than returning -1. */ break; else if (--remaining_probes == 0) return -1; /* If we have a match, check whether tm.tm_isdst has the requested value, if any. */ if (dt == 0 && isdst != tm.tm_isdst && 0 <= isdst && 0 <= tm.tm_isdst) { /* tm.tm_isdst has the wrong value. Look for a neighboring time with the right value, and use its UTC offset. Heuristic: probe the previous three calendar quarters (approximately), looking for the desired isdst. This isn't perfect, but it's good enough in practice. */ int quarter = 7889238; /* seconds per average 1/4 Gregorian year */ int i; /* If we're too close to the time_t limit, look in future quarters. */ if (t < TIME_T_MIN + 3 * quarter) quarter = -quarter; for (i = 1; i <= 3; i++) { time_t ot = t - i * quarter; struct tm otm; ranged_convert (convert, &ot, &otm); if (otm.tm_isdst == isdst) { /* We found the desired tm_isdst. Extrapolate back to the desired time. */ t = ot + ydhms_tm_diff (year, yday, hour, min, sec, &otm); ranged_convert (convert, &t, &tm); break; } } } *offset = t - t0; #if LEAP_SECONDS_POSSIBLE if (sec_requested != tm.tm_sec) { /* Adjust time to reflect the tm_sec requested, not the normalized value. Also, repair any damage from a false match due to a leap second. */ t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60); if (! (*convert) (&t, &tm)) return -1; } #endif if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3) { /* time_t isn't large enough to rule out overflows in ydhms_tm_diff, so check for major overflows. A gross check suffices, since if t has overflowed, it is off by a multiple of TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of the difference that is bounded by a small value. */ double dyear = (double) year_requested + mon_years - tm.tm_year; double dday = 366 * dyear + mday; double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested; /* On Irix4.0.5 cc, dividing TIME_T_MIN by 3 does not produce correct results, ie., it erroneously gives a positive value of 715827882. Setting a variable first then doing math on it seems to work. (ghazi@caip.rutgers.edu) */ const time_t time_t_max = TIME_T_MAX; const time_t time_t_min = TIME_T_MIN; if (time_t_max / 3 - time_t_min / 3 < (dsec < 0 ? - dsec : dsec)) return -1; } *tp = tm; return t; } static time_t localtime_offset; /* Convert *TP to a time_t value. */ time_t mymktime (tp) struct tm *tp; { #ifdef _LIBC /* POSIX.1 8.1.1 requires that whenever mktime() is called, the time zone names contained in the external variable `tzname' shall be set as if the tzset() function had been called. */ __tzset (); #endif return __mktime_internal (tp, my_mktime_localtime_r, &localtime_offset); } #ifdef weak_alias weak_alias (mktime, timelocal) #endif #if DEBUG static int not_equal_tm (a, b) struct tm *a; struct tm *b; { return ((a->tm_sec ^ b->tm_sec) | (a->tm_min ^ b->tm_min) | (a->tm_hour ^ b->tm_hour) | (a->tm_mday ^ b->tm_mday) | (a->tm_mon ^ b->tm_mon) | (a->tm_year ^ b->tm_year) | (a->tm_mday ^ b->tm_mday) | (a->tm_yday ^ b->tm_yday) | (a->tm_isdst ^ b->tm_isdst)); } static void print_tm (tp) struct tm *tp; { if (tp) printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min, tp->tm_sec, tp->tm_yday, tp->tm_wday, tp->tm_isdst); else printf ("0"); } static int check_result (tk, tmk, tl, lt) time_t tk; struct tm tmk; time_t tl; struct tm *lt; { if (tk != tl || !lt || not_equal_tm (&tmk, lt)) { printf ("mktime ("); print_tm (&tmk); printf (")\nyields ("); print_tm (lt); printf (") == %ld, should be %ld\n", (long) tl, (long) tk); return 1; } return 0; } int main (argc, argv) int argc; char **argv; { int status = 0; struct tm tm, tmk, tml; struct tm *lt; time_t tk, tl; char trailer; if ((argc == 3 || argc == 4) && (sscanf (argv[1], "%d-%d-%d%c", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) == 3) && (sscanf (argv[2], "%d:%d:%d%c", &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) == 3)) { tm.tm_year -= TM_YEAR_BASE; tm.tm_mon--; tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); tmk = tm; tl = mktime (&tmk); lt = localtime (&tl); if (lt) { tml = *lt; lt = &tml; } printf ("mktime returns %ld == ", (long) tl); print_tm (&tmk); printf ("\n"); status = check_result (tl, tmk, tl, lt); } else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) { time_t from = atol (argv[1]); time_t by = atol (argv[2]); time_t to = atol (argv[3]); if (argc == 4) for (tl = from; tl <= to; tl += by) { lt = localtime (&tl); if (lt) { tmk = tml = *lt; tk = mktime (&tmk); status |= check_result (tk, tmk, tl, tml); } else { printf ("localtime (%ld) yields 0\n", (long) tl); status = 1; } } else for (tl = from; tl <= to; tl += by) { /* Null benchmark. */ lt = localtime (&tl); if (lt) { tmk = tml = *lt; tk = tl; status |= check_result (tk, tmk, tl, tml); } else { printf ("localtime (%ld) yields 0\n", (long) tl); status = 1; } } } else printf ("Usage:\ \t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ \t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ \t%s FROM BY TO - # Do not test those values (for benchmark).\n", argv[0], argv[0], argv[0]); return status; } #endif /* DEBUG */ /* Local Variables: compile-command: "gcc -DDEBUG -DHAVE_LIMITS_H -DSTDC_HEADERS -Wall -W -O -g mktime.c -o mktime" End: */ htdig-3.2.0b6/htlib/myqsort.c0100644006314600127310000002076610055635552015370 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Douglas C. Schmidt (schmidt@ics.uci.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Standard qsort function modified to add a user data argument to * the comparison function. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include "myqsort.h" /* Byte-wise swap two items of size SIZE. */ #define SWAP(a, b, size) \ do \ { \ register size_t __size = (size); \ register char *__a = (a), *__b = (b); \ do \ { \ char __tmp = *__a; \ *__a++ = *__b; \ *__b++ = __tmp; \ } while (--__size > 0); \ } while (0) /* Discontinue quicksort algorithm when partition gets below this size. This particular magic number was chosen to work best on a Sun 4/260. */ #define MAX_THRESH 4 /* Stack node declarations used to store unfulfilled partition obligations. */ typedef struct { char *lo; char *hi; } stack_node; /* The next 4 #defines implement a very fast in-line stack abstraction. */ #define STACK_SIZE (8 * sizeof(unsigned long int)) #define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top)) #define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi))) #define STACK_NOT_EMPTY (stack < top) /* Order size using quicksort. This implementation incorporates four optimizations discussed in Sedgewick: 1. Non-recursive, using an explicit stack of pointer that store the next array partition to sort. To save time, this maximum amount of space required to store an array of MAX_INT is allocated on the stack. Assuming a 32-bit integer, this needs only 32 * sizeof(stack_node) == 136 bits. Pretty cheap, actually. 2. Chose the pivot element using a median-of-three decision tree. This reduces the probability of selecting a bad pivot value and eliminates certain extraneous comparisons. 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving insertion sort to order the MAX_THRESH items within each partition. This is a big win, since insertion sort is faster for small, mostly sorted array segments. 4. The larger of the two sub-partitions is always pushed onto the stack first, with the algorithm then concentrating on the smaller partition. This *guarantees* no more than log (n) stack size is needed (actually O(1) in this case)! */ void myqsort(void *const pbase, size_t total_elems, size_t size, myqsort_cmp cmp, void *data) { register char *base_ptr = (char *) pbase; /* Allocating SIZE bytes for a pivot buffer facilitates a better algorithm below since we can do comparisons directly on the pivot. */ char *pivot_buffer = (char *) malloc (size); const size_t max_thresh = MAX_THRESH * size; if (total_elems == 0) { /* Avoid lossage with unsigned arithmetic below. */ free(pivot_buffer); return; } if (total_elems > MAX_THRESH) { char *lo = base_ptr; char *hi = &lo[size * (total_elems - 1)]; /* Largest size needed for 32-bit int!!! */ stack_node stack[STACK_SIZE]; stack_node *top = stack + 1; while (STACK_NOT_EMPTY) { char *left_ptr; char *right_ptr; char *pivot = pivot_buffer; /* Select median value from among LO, MID, and HI. Rearrange LO and HI so the three values are sorted. This lowers the probability of picking a pathological pivot value and skips a comparison for both the LEFT_PTR and RIGHT_PTR. */ char *mid = lo + size * ((hi - lo) / size >> 1); if ((*cmp) (data, (void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); if ((*cmp) (data, (void *) hi, (void *) mid) < 0) SWAP (mid, hi, size); else goto jump_over; if ((*cmp) (data, (void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); jump_over:; memcpy (pivot, mid, size); pivot = pivot_buffer; left_ptr = lo + size; right_ptr = hi - size; /* Here's the famous ``collapse the walls'' section of quicksort. Gotta like those tight inner loops! They are the main reason that this algorithm runs much faster than others. */ do { while ((*cmp) (data, (void *) left_ptr, (void *) pivot) < 0) left_ptr += size; while ((*cmp) (data, (void *) pivot, (void *) right_ptr) < 0) right_ptr -= size; if (left_ptr < right_ptr) { SWAP (left_ptr, right_ptr, size); left_ptr += size; right_ptr -= size; } else if (left_ptr == right_ptr) { left_ptr += size; right_ptr -= size; break; } } while (left_ptr <= right_ptr); /* Set up pointers for next iteration. First determine whether left and right partitions are below the threshold size. If so, ignore one or both. Otherwise, push the larger partition's bounds on the stack and continue sorting the smaller one. */ if ((size_t) (right_ptr - lo) <= max_thresh) { if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore both small partitions. */ POP (lo, hi); else /* Ignore small left partition. */ lo = left_ptr; } else if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore small right partition. */ hi = right_ptr; else if ((right_ptr - lo) > (hi - left_ptr)) { /* Push larger left partition indices. */ PUSH (lo, right_ptr); lo = left_ptr; } else { /* Push larger right partition indices. */ PUSH (left_ptr, hi); hi = right_ptr; } } } /* Once the BASE_PTR array is partially sorted by quicksort the rest is completely sorted using insertion sort, since this is efficient for partitions below MAX_THRESH size. BASE_PTR points to the beginning of the array to sort, and END_PTR points at the very last element in the array (*not* one beyond it!). */ #define min(x, y) ((x) < (y) ? (x) : (y)) { char *const end_ptr = &base_ptr[size * (total_elems - 1)]; char *tmp_ptr = base_ptr; char *thresh = min(end_ptr, base_ptr + max_thresh); register char *run_ptr; /* Find smallest element in first threshold and place it at the array's beginning. This is the smallest array element, and the operation speeds up insertion sort's inner loop. */ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) if ((*cmp) (data, (void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr = run_ptr; if (tmp_ptr != base_ptr) SWAP (tmp_ptr, base_ptr, size); /* Insertion sort, running from left-hand-side up to right-hand-side. */ run_ptr = base_ptr + size; while ((run_ptr += size) <= end_ptr) { tmp_ptr = run_ptr - size; while ((*cmp) (data, (void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr -= size; tmp_ptr += size; if (tmp_ptr != run_ptr) { char *trav; trav = run_ptr + size; while (--trav >= run_ptr) { char c = *trav; char *hi, *lo; for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) *hi = *lo; *hi = c; } } } } free(pivot_buffer); } htdig-3.2.0b6/htlib/myqsort.h0100644006314600127310000000110510055635552015357 0ustar angusgbhtdig/* * Part of the ht://Dig package * Copyright (c) 1999-2004 The ht://Dig Group * For copyright details, see the file COPYING in your distribution * or the GNU Library General Public License (LGPL) version 2 or later * */ #ifndef _myqsort_h #define _myqsort_h #ifdef __cplusplus extern "C" { #endif typedef int (*myqsort_cmp)(void *data, void *a, void *b); void myqsort(void *const pbase, size_t total_elems, size_t size, myqsort_cmp cmp, void *data); #ifdef __cplusplus } #endif #endif /* _myqsort_h */ htdig-3.2.0b6/htlib/raise.c0100644006314600127310000000150510055635552014743 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef HAVE_RAISE #ifndef NO_SYSTEM_INCLUDES #include #include #endif /* * raise -- * Send a signal to the current process. * * PUBLIC: #ifndef HAVE_RAISE * PUBLIC: int raise __P((int)); * PUBLIC: #endif */ int raise(s) int s; { return (kill(getpid(), s)); } #endif /* HAVE_RAISE */ htdig-3.2.0b6/htlib/realloc.c0100644006314600127310000001036407707034127015265 0ustar angusgbhtdig/* Change the size of a block allocated by `malloc'. Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc. Written May 1989 by Mike Haertel. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be reached (Email) at the address mike@ai.mit.edu, or (US mail) as Mike Haertel c/o Free Software Foundation. */ #ifndef _MALLOC_INTERNAL #define _MALLOC_INTERNAL #include #endif #define min(A, B) ((A) < (B) ? (A) : (B)) /* Debugging hook for realloc. */ __ptr_t (*__realloc_hook) __P ((__ptr_t __ptr, size_t __size)); /* Resize the given region to the new size, returning a pointer to the (possibly moved) region. This is optimized for speed; some benchmarks seem to indicate that greater compactness is achieved by unconditionally allocating and copying to a new region. This module has incestuous knowledge of the internals of both free and malloc. */ __ptr_t realloc (ptr, size) __ptr_t ptr; size_t size; { __ptr_t result; int type; size_t block, blocks, oldlimit; if (size == 0) { free (ptr); return malloc (0); } else if (ptr == NULL) return malloc (size); if (__realloc_hook != NULL) return (*__realloc_hook) (ptr, size); block = BLOCK (ptr); type = _heapinfo[block].busy.type; switch (type) { case 0: /* Maybe reallocate a large block to a small fragment. */ if (size <= BLOCKSIZE / 2) { result = malloc (size); if (result != NULL) { memcpy (result, ptr, size); free (ptr); return result; } } /* The new size is a large allocation as well; see if we can hold it in place. */ blocks = BLOCKIFY (size); if (blocks < _heapinfo[block].busy.info.size) { /* The new size is smaller; return excess memory to the free list. */ _heapinfo[block + blocks].busy.type = 0; _heapinfo[block + blocks].busy.info.size = _heapinfo[block].busy.info.size - blocks; _heapinfo[block].busy.info.size = blocks; free (ADDRESS (block + blocks)); result = ptr; } else if (blocks == _heapinfo[block].busy.info.size) /* No size change necessary. */ result = ptr; else { /* Won't fit, so allocate a new region that will. Free the old region first in case there is sufficient adjacent free space to grow without moving. */ blocks = _heapinfo[block].busy.info.size; /* Prevent free from actually returning memory to the system. */ oldlimit = _heaplimit; _heaplimit = 0; free (ptr); _heaplimit = oldlimit; result = malloc (size); if (result == NULL) { /* Now we're really in trouble. We have to unfree the thing we just freed. Unfortunately it might have been coalesced with its neighbors. */ if (_heapindex == block) (void) malloc (blocks * BLOCKSIZE); else { __ptr_t previous = malloc ((block - _heapindex) * BLOCKSIZE); (void) malloc (blocks * BLOCKSIZE); free (previous); } return NULL; } if (ptr != result) memmove (result, ptr, blocks * BLOCKSIZE); } break; default: /* Old size is a fragment; type is logarithm to base two of the fragment size. */ if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) /* The new size is the same kind of fragment. */ result = ptr; else { /* The new size is different; allocate a new space, and copy the lesser of the new size and the old. */ result = malloc (size); if (result == NULL) return NULL; memcpy (result, ptr, min (size, (size_t) 1 << type)); free (ptr); } break; } return result; } htdig-3.2.0b6/htlib/regex.c0100644006314600127310000075160710055635552014771 0ustar angusgbhtdig/* Part of the ht://Dig package * /* Copyright (c) 1999-2004 The ht://Dig Group * /* For copyright details, see the file COPYING in your distribution * /* or the GNU Library General Public License (LGPL) version 2 or later * /* * /* Extended regular expression matching and search library, version 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) Copyright (C) 1993-1999, 2000, 2001 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* AIX requires this to be the first thing in the file. */ #if defined _AIX && !defined REGEX_MALLOC #pragma alloca #endif #undef _GNU_SOURCE #define _GNU_SOURCE #ifdef HAVE_CONFIG_H # include "htconfig.h" #endif #ifdef _MSC_VER /* _WIN32 */ #define alloca _alloca #endif #ifndef PARAMS # if defined __GNUC__ || (defined __STDC__ && __STDC__) # define PARAMS(args) args # else # define PARAMS(args) () # endif /* GCC. */ #endif /* Not PARAMS. */ #if defined STDC_HEADERS && !defined emacs # include #else /* We need this for `regex.h', and perhaps for the Emacs include files. */ # include #endif #define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC) /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || WIDE_CHAR_SUPPORT /* Solaris 2.5 has a bug: must be included before . */ # include # include #endif /* This is for multi byte string support. */ #ifdef MBS_SUPPORT # define CHAR_TYPE wchar_t # define US_CHAR_TYPE wchar_t/* unsigned character type */ # define COMPILED_BUFFER_VAR wc_buffer # define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ # define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_TYPE)+1) # define PUT_CHAR(c) \ do { \ if (MC_CUR_MAX == 1) \ putchar (c); \ else \ printf ("%C", (wint_t) c); /* Should we use wide stream?? */ \ } while (0) # define TRUE 1 # define FALSE 0 #else # define CHAR_TYPE char # define US_CHAR_TYPE unsigned char /* unsigned character type */ # define COMPILED_BUFFER_VAR bufp->buffer # define OFFSET_ADDRESS_SIZE 2 # define PUT_CHAR(c) putchar (c) #endif /* MBS_SUPPORT */ #ifdef _LIBC /* We have to keep the namespace clean. */ # define regfree(preg) __regfree (preg) # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) # define regerror(errcode, preg, errbuf, errbuf_size) \ __regerror(errcode, preg, errbuf, errbuf_size) # define re_set_registers(bu, re, nu, st, en) \ __re_set_registers (bu, re, nu, st, en) # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) # define re_match(bufp, string, size, pos, regs) \ __re_match (bufp, string, size, pos, regs) # define re_search(bufp, string, size, startpos, range, regs) \ __re_search (bufp, string, size, startpos, range, regs) # define re_compile_pattern(pattern, length, bufp) \ __re_compile_pattern (pattern, length, bufp) # define re_set_syntax(syntax) __re_set_syntax (syntax) # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) # define btowc __btowc /* We are also using some library internals. */ # include # include # include # include #endif /* This is for other GNU distributions with internationalized messages. */ #if HAVE_LIBINTL_H || defined _LIBC # include # ifdef _LIBC # undef gettext # define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES) # endif #else # define gettext(msgid) (msgid) #endif #ifndef gettext_noop /* This define is so xgettext can find the internationalizable strings. */ # define gettext_noop(String) String #endif /* The `emacs' switch turns on certain matching commands that make sense only in Emacs. */ #ifdef emacs # include "lisp.h" # include "buffer.h" # include "syntax.h" #else /* not emacs */ /* If we are not linking with Emacs proper, we can't use the relocating allocator even if config.h says that we can. */ # undef REL_ALLOC # if defined STDC_HEADERS || defined _LIBC # include # else char *malloc (); char *realloc (); # endif /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. If nothing else has been done, use the method below. */ # ifdef INHIBIT_STRING_HEADER # if !(defined HAVE_BZERO && defined HAVE_BCOPY) # if !defined bzero && !defined bcopy # undef INHIBIT_STRING_HEADER # endif # endif # endif /* This is the normal way of making sure we have a bcopy and a bzero. This is used in most programs--a few other programs avoid this by defining INHIBIT_STRING_HEADER. */ # ifndef INHIBIT_STRING_HEADER # if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC # include # ifndef bzero # ifndef _LIBC # define bzero(s, n) (memset (s, '\0', n), (s)) # else # define bzero(s, n) __bzero (s, n) # endif # endif # else # include # ifndef memcmp # define memcmp(s1, s2, n) bcmp (s1, s2, n) # endif # ifndef memcpy # define memcpy(d, s, n) (bcopy (s, d, n), (d)) # endif # endif # endif /* Define the syntax stuff for \<, \>, etc. */ /* This must be nonzero for the wordchar and notwordchar pattern commands in re_match_2. */ # ifndef Sword # define Sword 1 # endif # ifdef SWITCH_ENUM_BUG # define SWITCH_ENUM_CAST(x) ((int)(x)) # else # define SWITCH_ENUM_CAST(x) (x) # endif #endif /* not emacs */ #if defined _LIBC || HAVE_LIMITS_H # include #endif #ifndef MB_LEN_MAX # define MB_LEN_MAX 1 #endif /* Get the interface, including the syntax bits. */ #include /* isalpha etc. are used for the character classes. */ #include /* Jim Meyering writes: "... Some ctype macros are valid only for character codes that isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when using /bin/cc or gcc but without giving an ansi option). So, all ctype uses should be through macros like ISPRINT... If STDC_HEADERS is defined, then autoconf has verified that the ctype macros don't need to be guarded with references to isascii. ... Defining isascii to 1 should let any compiler worth its salt eliminate the && through constant folding." Solaris defines some of these symbols so we must undefine them first. */ #undef ISASCII #if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) # define ISASCII(c) 1 #else # define ISASCII(c) isascii(c) #endif #ifdef isblank # define ISBLANK(c) (ISASCII (c) && isblank (c)) #else # define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph # define ISGRAPH(c) (ISASCII (c) && isgraph (c)) #else # define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) #endif #undef ISPRINT #define ISPRINT(c) (ISASCII (c) && isprint (c)) #define ISDIGIT(c) (ISASCII (c) && isdigit (c)) #define ISALNUM(c) (ISASCII (c) && isalnum (c)) #define ISALPHA(c) (ISASCII (c) && isalpha (c)) #define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) #define ISLOWER(c) (ISASCII (c) && islower (c)) #define ISPUNCT(c) (ISASCII (c) && ispunct (c)) #define ISSPACE(c) (ISASCII (c) && isspace (c)) #define ISUPPER(c) (ISASCII (c) && isupper (c)) #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) #ifdef _tolower # define TOLOWER(c) _tolower(c) #else # define TOLOWER(c) tolower(c) #endif #ifndef NULL # define NULL (void *)0 #endif /* We remove any previous definition of `SIGN_EXTEND_CHAR', since ours (we hope) works properly with all combinations of machines, compilers, `char' and `unsigned char' argument types. (Per Bothner suggested the basic approach.) */ #undef SIGN_EXTEND_CHAR #if __STDC__ # define SIGN_EXTEND_CHAR(c) ((signed char) (c)) #else /* not __STDC__ */ /* As in Harbison and Steele. */ # define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) #endif #ifndef emacs /* How many characters in the character set. */ # define CHAR_SET_SIZE 256 # ifdef SYNTAX_TABLE extern char *re_syntax_table; # else /* not SYNTAX_TABLE */ static char re_syntax_table[CHAR_SET_SIZE]; static void init_syntax_once PARAMS ((void)); static void init_syntax_once () { register int c; static int done = 0; if (done) return; bzero (re_syntax_table, sizeof re_syntax_table); for (c = 0; c < CHAR_SET_SIZE; ++c) if (ISALNUM (c)) re_syntax_table[c] = Sword; re_syntax_table['_'] = Sword; done = 1; } # endif /* not SYNTAX_TABLE */ # define SYNTAX(c) re_syntax_table[(unsigned char) (c)] #endif /* emacs */ /* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we use `alloca' instead of `malloc'. This is because using malloc in re_search* or re_match* could cause memory leaks when C-g is used in Emacs; also, malloc is slower and causes storage fragmentation. On the other hand, malloc is more portable, and easier to debug. Because we sometimes use alloca, some routines have to be macros, not functions -- `alloca'-allocated space disappears at the end of the function it is called in. */ #ifdef REGEX_MALLOC # define REGEX_ALLOCATE malloc # define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) # define REGEX_FREE free #else /* not REGEX_MALLOC */ /* Emacs already defines alloca, sometimes. */ # ifndef alloca /* Make alloca work the best possible way. */ # ifdef __GNUC__ # define alloca __builtin_alloca # else /* not __GNUC__ */ # if HAVE_ALLOCA_H # include # endif /* HAVE_ALLOCA_H */ # endif /* not __GNUC__ */ # endif /* not alloca */ # define REGEX_ALLOCATE alloca /* Assumes a `char *destination' variable. */ # define REGEX_REALLOCATE(source, osize, nsize) \ (destination = (char *) alloca (nsize), \ memcpy (destination, source, osize)) /* No need to do anything to free, after alloca. */ # define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ #endif /* not REGEX_MALLOC */ /* Define how to allocate the failure stack. */ #if defined REL_ALLOC && defined REGEX_MALLOC # define REGEX_ALLOCATE_STACK(size) \ r_alloc (&failure_stack_ptr, (size)) # define REGEX_REALLOCATE_STACK(source, osize, nsize) \ r_re_alloc (&failure_stack_ptr, (nsize)) # define REGEX_FREE_STACK(ptr) \ r_alloc_free (&failure_stack_ptr) #else /* not using relocating allocator */ # ifdef REGEX_MALLOC # define REGEX_ALLOCATE_STACK malloc # define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) # define REGEX_FREE_STACK free # else /* not REGEX_MALLOC */ # define REGEX_ALLOCATE_STACK alloca # define REGEX_REALLOCATE_STACK(source, osize, nsize) \ REGEX_REALLOCATE (source, osize, nsize) /* No need to explicitly free anything. */ # define REGEX_FREE_STACK(arg) # endif /* not REGEX_MALLOC */ #endif /* not using relocating allocator */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside `string1' or just past its end. This works if PTR is NULL, which is a good thing. */ #define FIRST_STRING_P(ptr) \ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) /* (Re)Allocate N items of type T using malloc, or fail. */ #define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) #define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) #define RETALLOC_IF(addr, n, t) \ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) #define BYTEWIDTH 8 /* In bits. */ #define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) #undef MAX #undef MIN #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef char boolean; #define false 0 #define true 1 static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop)); /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its arguments. Zero bytes may appear in the compiled regular expression. */ typedef enum { no_op = 0, /* Succeed right away--no more backtracking. */ succeed, /* Followed by one byte giving n, then by n literal bytes. */ exactn, #ifdef MBS_SUPPORT /* Same as exactn, but contains binary data. */ exactn_bin, #endif /* Matches any (more or less) character. */ anychar, /* Matches any one char belonging to specified set. First following byte is number of bitmap bytes. Then come bytes for a bitmap saying which chars are in. Bits in each byte are ordered low-bit-first. A character is in the set if its bit is 1. A character too large to have a bit in the map is automatically not in the set. */ /* ifdef MBS_SUPPORT, following element is length of character classes, length of collating symbols, length of equivalence classes, length of character ranges, and length of characters. Next, character class element, collating symbols elements, equivalence class elements, range elements, and character elements follow. See regex_compile function. */ charset, /* Same parameters as charset, but match any character that is not one of those specified. */ charset_not, /* Start remembering the text that is matched, for storing in a register. Followed by one byte with the register number, in the range 0 to one less than the pattern buffer's re_nsub field. Then followed by one byte with the number of groups inner to this one. (This last has to be part of the start_memory only because we need it in the on_failure_jump of re_match_2.) */ start_memory, /* Stop remembering the text that is matched and store it in a memory register. Followed by one byte with the register number, in the range 0 to one less than `re_nsub' in the pattern buffer, and one byte with the number of inner groups, just like `start_memory'. (We need the number of inner groups here because we don't have any easy way of finding the corresponding start_memory when we're at a stop_memory.) */ stop_memory, /* Match a duplicate of something remembered. Followed by one byte containing the register number. */ duplicate, /* Fail unless at beginning of line. */ begline, /* Fail unless at end of line. */ endline, /* Succeeds if at beginning of buffer (if emacs) or at beginning of string to be matched (if not). */ begbuf, /* Analogously, for end of buffer/string. */ endbuf, /* Followed by two byte relative address to which to jump. */ jump, /* Same as jump, but marks the end of an alternative. */ jump_past_alt, /* Followed by two-byte relative address of place to resume at in case of failure. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ on_failure_jump, /* Like on_failure_jump, but pushes a placeholder instead of the current string position when executed. */ on_failure_keep_string_jump, /* Throw away latest failure point and then jump to following two-byte relative address. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ pop_failure_jump, /* Change to pop_failure_jump if know won't have to backtrack to match; otherwise change to jump. This is used to jump back to the beginning of a repeat. If what follows this jump clearly won't match what the repeat does, such that we can be sure that there is no use backtracking out of repetitions already matched, then we change it to a pop_failure_jump. Followed by two-byte address. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ maybe_pop_jump, /* Jump to following two-byte address, and push a dummy failure point. This failure point will be thrown away if an attempt is made to use it for a failure. A `+' construct makes this before the first repeat. Also used as an intermediary kind of jump when compiling an alternative. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ dummy_failure_jump, /* Push a dummy failure point and continue. Used at the end of alternatives. */ push_dummy_failure, /* Followed by two-byte relative address and two-byte number n. After matching N times, jump to the address upon failure. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ succeed_n, /* Followed by two-byte relative address, and two-byte number n. Jump to the address N times, then fail. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ jump_n, /* Set the following two-byte relative address to the subsequent two-byte number. The address *includes* the two bytes of number. */ /* ifdef MBS_SUPPORT, the size of address is 1. */ set_number_at, wordchar, /* Matches any word-constituent character. */ notwordchar, /* Matches any char that is not a word-constituent. */ wordbeg, /* Succeeds if at word beginning. */ wordend, /* Succeeds if at word end. */ wordbound, /* Succeeds if at a word boundary. */ notwordbound /* Succeeds if not at a word boundary. */ #ifdef emacs ,before_dot, /* Succeeds if before point. */ at_dot, /* Succeeds if at point. */ after_dot, /* Succeeds if after point. */ /* Matches any character whose syntax is specified. Followed by a byte which contains a syntax code, e.g., Sword. */ syntaxspec, /* Matches any character whose syntax is not that specified. */ notsyntaxspec #endif /* emacs */ } re_opcode_t; /* Common operations on the compiled pattern. */ /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ /* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ #ifdef MBS_SUPPORT # define STORE_NUMBER(destination, number) \ do { \ *(destination) = (US_CHAR_TYPE)(number); \ } while (0) #else # define STORE_NUMBER(destination, number) \ do { \ (destination)[0] = (number) & 0377; \ (destination)[1] = (number) >> 8; \ } while (0) #endif /* MBS_SUPPORT */ /* Same as STORE_NUMBER, except increment DESTINATION to the byte after where the number is stored. Therefore, DESTINATION must be an lvalue. */ /* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ #define STORE_NUMBER_AND_INCR(destination, number) \ do { \ STORE_NUMBER (destination, number); \ (destination) += OFFSET_ADDRESS_SIZE; \ } while (0) /* Put into DESTINATION a number stored in two contiguous bytes starting at SOURCE. */ /* ifdef MBS_SUPPORT, we store NUMBER in 1 element. */ #ifdef MBS_SUPPORT # define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source); \ } while (0) #else # define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) #endif #ifdef DEBUG static void extract_number _RE_ARGS ((int *dest, US_CHAR_TYPE *source)); static void extract_number (dest, source) int *dest; US_CHAR_TYPE *source; { #ifdef MBS_SUPPORT *dest = *source; #else int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *dest += temp << 8; #endif } # ifndef EXTRACT_MACROS /* To debug the macros. */ # undef EXTRACT_NUMBER # define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) # endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. SOURCE must be an lvalue. */ #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ (source) += OFFSET_ADDRESS_SIZE; \ } while (0) #ifdef DEBUG static void extract_number_and_incr _RE_ARGS ((int *destination, US_CHAR_TYPE **source)); static void extract_number_and_incr (destination, source) int *destination; US_CHAR_TYPE **source; { extract_number (destination, *source); *source += OFFSET_ADDRESS_SIZE; } # ifndef EXTRACT_MACROS # undef EXTRACT_NUMBER_AND_INCR # define EXTRACT_NUMBER_AND_INCR(dest, src) \ extract_number_and_incr (&dest, &src) # endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the main program in `iregex.c', you can enter patterns and strings interactively. And if linked with the main program in `main.c' and the other test files, you can run the already-written tests. */ #ifdef DEBUG /* We use standard I/O for debugging. */ # include /* It is useful to test things that ``must'' be true when debugging. */ # include static int debug; # define DEBUG_STATEMENT(e) e # define DEBUG_PRINT1(x) if (debug) printf (x) # define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) # define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) # define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ if (debug) print_partial_compiled_pattern (s, e) # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ if (debug) print_double_string (w, s1, sz1, s2, sz2) /* Print the fastmap in human-readable form. */ void print_fastmap (fastmap) char *fastmap; { unsigned was_a_range = 0; unsigned i = 0; while (i < (1 << BYTEWIDTH)) { if (fastmap[i++]) { was_a_range = 0; putchar (i - 1); while (i < (1 << BYTEWIDTH) && fastmap[i]) { was_a_range = 1; i++; } if (was_a_range) { printf ("-"); putchar (i - 1); } } } putchar ('\n'); } /* Print a compiled pattern string in human-readable form, starting at the START pointer into it and ending just before the pointer END. */ void print_partial_compiled_pattern (start, end) US_CHAR_TYPE *start; US_CHAR_TYPE *end; { int mcnt, mcnt2; US_CHAR_TYPE *p1; US_CHAR_TYPE *p = start; US_CHAR_TYPE *pend = end; if (start == NULL) { printf ("(null)\n"); return; } /* Loop over pattern commands. */ while (p < pend) { #ifdef _LIBC printf ("%td:\t", p - start); #else printf ("%ld:\t", (long int) (p - start)); #endif switch ((re_opcode_t) *p++) { case no_op: printf ("/no_op"); break; case exactn: mcnt = *p++; printf ("/exactn/%d", mcnt); do { putchar ('/'); PUT_CHAR (*p++); } while (--mcnt); break; #ifdef MBS_SUPPORT case exactn_bin: mcnt = *p++; printf ("/exactn_bin/%d", mcnt); do { printf("/%lx", (long int) *p++); } while (--mcnt); break; #endif /* MBS_SUPPORT */ case start_memory: mcnt = *p++; printf ("/start_memory/%d/%ld", mcnt, (long int) *p++); break; case stop_memory: mcnt = *p++; printf ("/stop_memory/%d/%ld", mcnt, (long int) *p++); break; case duplicate: printf ("/duplicate/%ld", (long int) *p++); break; case anychar: printf ("/anychar"); break; case charset: case charset_not: { #ifdef MBS_SUPPORT int i, length; wchar_t *workp = p; printf ("/charset [%s", (re_opcode_t) *(workp - 1) == charset_not ? "^" : ""); p += 5; length = *workp++; /* the length of char_classes */ for (i=0 ; ibuffer; print_partial_compiled_pattern (buffer, buffer + bufp->used / sizeof(US_CHAR_TYPE)); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, bufp->allocated); if (bufp->fastmap_accurate && bufp->fastmap) { printf ("fastmap: "); print_fastmap (bufp->fastmap); } #ifdef _LIBC printf ("re_nsub: %Zd\t", bufp->re_nsub); #else printf ("re_nsub: %ld\t", (long int) bufp->re_nsub); #endif printf ("regs_alloc: %d\t", bufp->regs_allocated); printf ("can_be_null: %d\t", bufp->can_be_null); printf ("newline_anchor: %d\n", bufp->newline_anchor); printf ("no_sub: %d\t", bufp->no_sub); printf ("not_bol: %d\t", bufp->not_bol); printf ("not_eol: %d\t", bufp->not_eol); printf ("syntax: %lx\n", bufp->syntax); /* Perhaps we should print the translate table? */ } void print_double_string (where, string1, size1, string2, size2) const CHAR_TYPE *where; const CHAR_TYPE *string1; const CHAR_TYPE *string2; int size1; int size2; { int this_char; if (where == NULL) printf ("(null)"); else { if (FIRST_STRING_P (where)) { for (this_char = where - string1; this_char < size1; this_char++) PUT_CHAR (string1[this_char]); where = string2; } for (this_char = where - string2; this_char < size2; this_char++) PUT_CHAR (string2[this_char]); } } void printchar (c) int c; { putc (c, stderr); } #else /* not DEBUG */ # undef assert # define assert(e) # define DEBUG_STATEMENT(e) # define DEBUG_PRINT1(x) # define DEBUG_PRINT2(x1, x2) # define DEBUG_PRINT3(x1, x2, x3) # define DEBUG_PRINT4(x1, x2, x3, x4) # define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) # define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) #endif /* not DEBUG */ #ifdef MBS_SUPPORT /* This convert a multibyte string to a wide character string. And write their correspondances to offset_buffer(see below) and write whether each wchar_t is binary data to is_binary. This assume invalid multibyte sequences as binary data. We assume offset_buffer and is_binary is already allocated enough space. */ static size_t convert_mbs_to_wcs (CHAR_TYPE *dest, const unsigned char* src, size_t len, int *offset_buffer, char *is_binary); static size_t convert_mbs_to_wcs (dest, src, len, offset_buffer, is_binary) CHAR_TYPE *dest; const unsigned char* src; size_t len; /* the length of multibyte string. */ /* It hold correspondances between src(char string) and dest(wchar_t string) for optimization. e.g. src = "xxxyzz" dest = {'X', 'Y', 'Z'} (each "xxx", "y" and "zz" represent one multibyte character corresponding to 'X', 'Y' and 'Z'.) offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")} = {0, 3, 4, 6} */ int *offset_buffer; char *is_binary; { wchar_t *pdest = dest; const unsigned char *psrc = src; size_t wc_count = 0; if (MB_CUR_MAX == 1) { /* We don't need conversion. */ for ( ; wc_count < len ; ++wc_count) { *pdest++ = *psrc++; is_binary[wc_count] = FALSE; offset_buffer[wc_count] = wc_count; } offset_buffer[wc_count] = wc_count; } else { /* We need conversion. */ mbstate_t mbs; int consumed; size_t mb_remain = len; size_t mb_count = 0; /* Initialize the conversion state. */ memset (&mbs, 0, sizeof (mbstate_t)); offset_buffer[0] = 0; for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed, psrc += consumed) { consumed = mbrtowc (pdest, psrc, mb_remain, &mbs); if (consumed <= 0) /* failed to convert. maybe src contains binary data. So we consume 1 byte manualy. */ { *pdest = *psrc; consumed = 1; is_binary[wc_count] = TRUE; } else is_binary[wc_count] = FALSE; /* In sjis encoding, we use yen sign as escape character in place of reverse solidus. So we convert 0x5c(yen sign in sjis) to not 0xa5(yen sign in UCS2) but 0x5c(reverse solidus in UCS2). */ if (consumed == 1 && (int) *psrc == 0x5c && (int) *pdest == 0xa5) *pdest = (wchar_t) *psrc; offset_buffer[wc_count + 1] = mb_count += consumed; } } return wc_count; } #endif /* MBS_SUPPORT */ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs become read-only after dumping. */ reg_syntax_t re_syntax_options; /* Specify the precise syntax of regexps for compilation. This provides for compatibility for various utilities which historically have different, incompatible syntaxes. The argument SYNTAX is a bit mask comprised of the various bits defined in regex.h. We return the old syntax. */ reg_syntax_t re_set_syntax (syntax) reg_syntax_t syntax; { reg_syntax_t ret = re_syntax_options; re_syntax_options = syntax; #ifdef DEBUG if (syntax & RE_DEBUG) debug = 1; else if (debug) /* was on but now is not */ debug = 0; #endif /* DEBUG */ return ret; } #ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) #endif /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ static const char re_error_msgid[] = { #define REG_NOERROR_IDX 0 gettext_noop ("Success") /* REG_NOERROR */ "\0" #define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success") gettext_noop ("No match") /* REG_NOMATCH */ "\0" #define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match") gettext_noop ("Invalid regular expression") /* REG_BADPAT */ "\0" #define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression") gettext_noop ("Invalid collation character") /* REG_ECOLLATE */ "\0" #define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character") gettext_noop ("Invalid character class name") /* REG_ECTYPE */ "\0" #define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name") gettext_noop ("Trailing backslash") /* REG_EESCAPE */ "\0" #define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash") gettext_noop ("Invalid back reference") /* REG_ESUBREG */ "\0" #define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference") gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */ "\0" #define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^") gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */ "\0" #define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(") gettext_noop ("Unmatched \\{") /* REG_EBRACE */ "\0" #define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{") gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */ "\0" #define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}") gettext_noop ("Invalid range end") /* REG_ERANGE */ "\0" #define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end") gettext_noop ("Memory exhausted") /* REG_ESPACE */ "\0" #define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted") gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */ "\0" #define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression") gettext_noop ("Premature end of regular expression") /* REG_EEND */ "\0" #define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression") gettext_noop ("Regular expression too big") /* REG_ESIZE */ "\0" #define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big") gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ }; static const size_t re_error_msgid_idx[] = { REG_NOERROR_IDX, REG_NOMATCH_IDX, REG_BADPAT_IDX, REG_ECOLLATE_IDX, REG_ECTYPE_IDX, REG_EESCAPE_IDX, REG_ESUBREG_IDX, REG_EBRACK_IDX, REG_EPAREN_IDX, REG_EBRACE_IDX, REG_BADBR_IDX, REG_ERANGE_IDX, REG_ESPACE_IDX, REG_BADRPT_IDX, REG_EEND_IDX, REG_ESIZE_IDX, REG_ERPAREN_IDX }; /* Avoiding alloca during matching, to placate r_alloc. */ /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the searching and matching functions should not call alloca. On some systems, alloca is implemented in terms of malloc, and if we're using the relocating allocator routines, then malloc could cause a relocation, which might (if the strings being searched are in the ralloc heap) shift the data out from underneath the regexp routines. Here's another reason to avoid allocation: Emacs processes input from X in a signal handler; processing X input may call malloc; if input arrives while a matching routine is calling malloc, then we're scrod. But Emacs can't just block input while calling matching routines; then we don't notice interrupts when they come in. So, Emacs blocks input around all regexp calls except the matching calls, which it leaves unprotected, in the faith that they will not malloc. */ /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE /* When using GNU C, we are not REALLY using the C alloca, no matter what config.h may say. So don't take precautions for it. */ #ifdef __GNUC__ # undef C_ALLOCA #endif /* The match routines may not allocate if (1) they would do it with malloc and (2) it's not safe for them to use malloc. Note that if REL_ALLOC is defined, matching would not use malloc for the failure stack, but we would still use it for the register vectors; so REL_ALLOC should not affect this. */ #if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs # undef MATCH_MAY_ALLOCATE #endif /* Failure stack declarations and macros; both re_compile_fastmap and re_match_2 use a failure stack. These have to be macros because of REGEX_ALLOCATE_STACK. */ /* Number of failure points for which to initially allocate space when matching. If this number is exceeded, we allocate more space, so it is not a hard limit. */ #ifndef INIT_FAILURE_ALLOC # define INIT_FAILURE_ALLOC 5 #endif /* Roughly the maximum number of failure points on the stack. Would be exactly that if always used MAX_FAILURE_ITEMS items each time we failed. This is a variable only so users of regex can assign to it; we never change it ourselves. */ #ifdef INT_IS_16BIT # if defined MATCH_MAY_ALLOCATE /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ long int re_max_failures = 4000; # else long int re_max_failures = 2000; # endif union fail_stack_elt { US_CHAR_TYPE *pointer; long int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned long int size; unsigned long int avail; /* Offset of next open position. */ } fail_stack_type; #else /* not INT_IS_16BIT */ # if defined MATCH_MAY_ALLOCATE /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ int re_max_failures = 4000; # else int re_max_failures = 2000; # endif union fail_stack_elt { US_CHAR_TYPE *pointer; int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } fail_stack_type; #endif /* INT_IS_16BIT */ #define FAIL_STACK_EMPTY() (fail_stack.avail == 0) #define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) #define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) /* Define macros to initialize and free the failure stack. Do `return -2' if the alloc fails. */ #ifdef MATCH_MAY_ALLOCATE # define INIT_FAIL_STACK() \ do { \ fail_stack.stack = (fail_stack_elt_t *) \ REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ \ if (fail_stack.stack == NULL) \ return -2; \ \ fail_stack.size = INIT_FAILURE_ALLOC; \ fail_stack.avail = 0; \ } while (0) # define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) #else # define INIT_FAIL_STACK() \ do { \ fail_stack.avail = 0; \ } while (0) # define RESET_FAIL_STACK() #endif /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. Return 1 if succeeds, and 0 if either ran out of memory allocating space for it or it was already too large. REGEX_REALLOCATE_STACK requires `destination' be declared. */ #define DOUBLE_FAIL_STACK(fail_stack) \ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ ? 0 \ : ((fail_stack).stack = (fail_stack_elt_t *) \ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ (fail_stack).size * sizeof (fail_stack_elt_t), \ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ \ (fail_stack).stack == NULL \ ? 0 \ : ((fail_stack).size <<= 1, \ 1))) /* Push pointer POINTER on FAIL_STACK. Return 1 if was able to do so and 0 if ran out of memory allocating space to do so. */ #define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ ((FAIL_STACK_FULL () \ && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ ? 0 \ : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ 1)) /* Push a pointer value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_POINTER(item) \ fail_stack.stack[fail_stack.avail++].pointer = (US_CHAR_TYPE *) (item) /* This pushes an integer-valued item onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_INT(item) \ fail_stack.stack[fail_stack.avail++].integer = (item) /* Push a fail_stack_elt_t value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_ELT(item) \ fail_stack.stack[fail_stack.avail++] = (item) /* These three POP... operations complement the three PUSH... operations. All assume that `fail_stack' is nonempty. */ #define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer #define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer #define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] /* Used to omit pushing failure point id's when we're not debugging. */ #ifdef DEBUG # define DEBUG_PUSH PUSH_FAILURE_INT # define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT () #else # define DEBUG_PUSH(item) # define DEBUG_POP(item_addr) #endif /* Push the information about the state we will need if we ever fail back to it. Requires variables fail_stack, regstart, regend, reg_info, and num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination' be declared. Does `return FAILURE_CODE' if runs out of memory. */ #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ do { \ char *destination; \ /* Must be int, so when we don't save any registers, the arithmetic \ of 0 + -1 isn't done as unsigned. */ \ /* Can't be int, since there is not a shred of a guarantee that int \ is wide enough to hold a value of something to which pointer can \ be assigned */ \ active_reg_t this_reg; \ \ DEBUG_STATEMENT (failure_id++); \ DEBUG_STATEMENT (nfailure_points_pushed++); \ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ \ DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ \ /* Ensure we have enough space allocated for what we will push. */ \ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ { \ if (!DOUBLE_FAIL_STACK (fail_stack)) \ return failure_code; \ \ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ (fail_stack).size); \ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ } \ \ /* Push the info, starting with the registers. */ \ DEBUG_PRINT1 ("\n"); \ \ if (1) \ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ this_reg++) \ { \ DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \ DEBUG_STATEMENT (num_regs_pushed++); \ \ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ PUSH_FAILURE_POINTER (regstart[this_reg]); \ \ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ PUSH_FAILURE_POINTER (regend[this_reg]); \ \ DEBUG_PRINT2 (" info: %p\n ", \ reg_info[this_reg].word.pointer); \ DEBUG_PRINT2 (" match_null=%d", \ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ DEBUG_PRINT2 (" matched_something=%d", \ MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT2 (" ever_matched=%d", \ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT1 ("\n"); \ PUSH_FAILURE_ELT (reg_info[this_reg].word); \ } \ \ DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\ PUSH_FAILURE_INT (lowest_active_reg); \ \ DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ DEBUG_PRINT2 (" Pushing string %p: `", string_place); \ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ size2); \ DEBUG_PRINT1 ("'\n"); \ PUSH_FAILURE_POINTER (string_place); \ \ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ DEBUG_PUSH (failure_id); \ } while (0) /* This is the number of items that are pushed and popped on the stack for each register. */ #define NUM_REG_ITEMS 3 /* Individual items aside from the registers. */ #ifdef DEBUG # define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ #else # define NUM_NONREG_ITEMS 4 #endif /* We push at most this many items on the stack. */ /* We used to use (num_regs - 1), which is the number of registers this regexp will save; but that was changed to 5 to avoid stack overflow for a regexp with lots of parens. */ #define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS) /* We actually push this many items. */ #define NUM_FAILURE_ITEMS \ (((0 \ ? 0 : highest_active_reg - lowest_active_reg + 1) \ * NUM_REG_ITEMS) \ + NUM_NONREG_ITEMS) /* How many items can still be added to the stack without overflowing it. */ #define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) /* Pops what PUSH_FAIL_STACK pushes. We restore into the parameters, all of which should be lvalues: STR -- the saved data position. PAT -- the saved pattern position. LOW_REG, HIGH_REG -- the highest and lowest active registers. REGSTART, REGEND -- arrays of string positions. REG_INFO -- array of information about each subexpression. Also assumes the variables `fail_stack' and (if debugging), `bufp', `pend', `string1', `size1', `string2', and `size2'. */ #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ { \ DEBUG_STATEMENT (unsigned failure_id;) \ active_reg_t this_reg; \ const US_CHAR_TYPE *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ /* Remove failure points and point to how many regs pushed. */ \ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ \ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ \ DEBUG_POP (&failure_id); \ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ \ /* If the saved string location is NULL, it came from an \ on_failure_keep_string_jump opcode, and we want to throw away the \ saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ str = (const CHAR_TYPE *) string_temp; \ \ DEBUG_PRINT2 (" Popping string %p: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ pat = (US_CHAR_TYPE *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ high_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \ \ low_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \ \ if (1) \ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ { \ DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \ \ reg_info[this_reg].word = POP_FAILURE_ELT (); \ DEBUG_PRINT2 (" info: %p\n", \ reg_info[this_reg].word.pointer); \ \ regend[this_reg] = (const CHAR_TYPE *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \ \ regstart[this_reg] = (const CHAR_TYPE *) POP_FAILURE_POINTER ();\ DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \ } \ else \ { \ for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ { \ reg_info[this_reg].word.integer = 0; \ regend[this_reg] = 0; \ regstart[this_reg] = 0; \ } \ highest_active_reg = high_reg; \ } \ \ set_regs_matched_done = 0; \ DEBUG_STATEMENT (nfailure_points_popped++); \ } /* POP_FAILURE_POINT */ /* Structure for per-register (a.k.a. per-group) information. Other register information, such as the starting and ending positions (which are addresses), and the list of inner groups (which is a bits list) are maintained in separate variables. We are making a (strictly speaking) nonportable assumption here: that the compiler will pack our bit fields into something that fits into the type of `word', i.e., is something that fits into one item on the failure stack. */ /* Declarations and macros for re_match_2. */ typedef union { fail_stack_elt_t word; struct { /* This field is one if this group can match the empty string, zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ #define MATCH_NULL_UNSET_VALUE 3 unsigned match_null_string_p : 2; unsigned is_active : 1; unsigned matched_something : 1; unsigned ever_matched_something : 1; } bits; } register_info_type; #define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) #define IS_ACTIVE(R) ((R).bits.is_active) #define MATCHED_SOMETHING(R) ((R).bits.matched_something) #define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) /* Call this when have matched a real character; it sets `matched' flags for the subexpressions which we are currently inside. Also records that those subexprs have matched. */ #define SET_REGS_MATCHED() \ do \ { \ if (!set_regs_matched_done) \ { \ active_reg_t r; \ set_regs_matched_done = 1; \ for (r = lowest_active_reg; r <= highest_active_reg; r++) \ { \ MATCHED_SOMETHING (reg_info[r]) \ = EVER_MATCHED_SOMETHING (reg_info[r]) \ = 1; \ } \ } \ } \ while (0) /* Registers are set to a sentinel when they haven't yet matched. */ static CHAR_TYPE reg_unset_dummy; #define REG_UNSET_VALUE (®_unset_dummy) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) /* Subroutine declarations and macros for regex_compile. */ static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)); static void store_op1 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, int arg)); static void store_op2 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, int arg1, int arg2)); static void insert_op1 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, int arg, US_CHAR_TYPE *end)); static void insert_op2 _RE_ARGS ((re_opcode_t op, US_CHAR_TYPE *loc, int arg1, int arg2, US_CHAR_TYPE *end)); static boolean at_begline_loc_p _RE_ARGS ((const CHAR_TYPE *pattern, const CHAR_TYPE *p, reg_syntax_t syntax)); static boolean at_endline_loc_p _RE_ARGS ((const CHAR_TYPE *p, const CHAR_TYPE *pend, reg_syntax_t syntax)); #ifdef MBS_SUPPORT static reg_errcode_t compile_range _RE_ARGS ((CHAR_TYPE range_start, const CHAR_TYPE **p_ptr, const CHAR_TYPE *pend, char *translate, reg_syntax_t syntax, US_CHAR_TYPE *b, CHAR_TYPE *char_set)); static void insert_space _RE_ARGS ((int num, CHAR_TYPE *loc, CHAR_TYPE *end)); #else static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start, const CHAR_TYPE **p_ptr, const CHAR_TYPE *pend, char *translate, reg_syntax_t syntax, US_CHAR_TYPE *b)); #endif /* MBS_SUPPORT */ /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ /* ifdef MBS_SUPPORT, we translate only if character <= 0xff, because it is impossible to allocate 4GB array for some encodings which have 4 byte character_set like UCS4. */ #ifndef PATFETCH # ifdef MBS_SUPPORT # define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (US_CHAR_TYPE) *p++; \ if (translate && (c <= 0xff)) c = (US_CHAR_TYPE) translate[c]; \ } while (0) # else # define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) # endif /* MBS_SUPPORT */ #endif /* Fetch the next character in the uncompiled pattern, with no translation. */ #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ c = (US_CHAR_TYPE) *p++; \ } while (0) /* Go backwards one character in the pattern. */ #define PATUNFETCH p-- /* If `translate' is non-null, return translate[D], else just D. We cast the subscript to translate because some data is declared as `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ /* ifdef MBS_SUPPORT, we translate only if character <= 0xff, because it is impossible to allocate 4GB array for some encodings which have 4 byte character_set like UCS4. */ #ifndef TRANSLATE # ifdef MBS_SUPPORT # define TRANSLATE(d) \ ((translate && ((US_CHAR_TYPE) (d)) <= 0xff) \ ? (char) translate[(unsigned char) (d)] : (d)) #else # define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) # endif /* MBS_SUPPORT */ #endif /* Macros for outputting the compiled pattern into `buffer'. */ /* If the buffer isn't allocated when it comes in, use this. */ #define INIT_BUF_SIZE (32 * sizeof(US_CHAR_TYPE)) /* Make sure we have at least N more bytes of space in buffer. */ #ifdef MBS_SUPPORT # define GET_BUFFER_SPACE(n) \ while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR \ + (n)*sizeof(CHAR_TYPE)) > bufp->allocated) \ EXTEND_BUFFER () #else # define GET_BUFFER_SPACE(n) \ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ EXTEND_BUFFER () #endif /* MBS_SUPPORT */ /* Make sure we have one more byte of buffer space and then add C to it. */ #define BUF_PUSH(c) \ do { \ GET_BUFFER_SPACE (1); \ *b++ = (US_CHAR_TYPE) (c); \ } while (0) /* Ensure we have two more bytes of buffer space and then append C1 and C2. */ #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ *b++ = (US_CHAR_TYPE) (c1); \ *b++ = (US_CHAR_TYPE) (c2); \ } while (0) /* As with BUF_PUSH_2, except for three bytes. */ #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ *b++ = (US_CHAR_TYPE) (c1); \ *b++ = (US_CHAR_TYPE) (c2); \ *b++ = (US_CHAR_TYPE) (c3); \ } while (0) /* Store a jump with opcode OP at LOC to location TO. We store a relative address offset by the three bytes the jump itself occupies. */ #define STORE_JUMP(op, loc, to) \ store_op1 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE))) /* Likewise, for a two-argument jump. */ #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg) /* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP(op, loc, to) \ insert_op1 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), b) /* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP2(op, loc, to, arg) \ insert_op2 (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)),\ arg, b) /* This is not an arbitrary limit: the arguments which represent offsets into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ /* Any other compiler which, like MSC, has allocation limit below 2^16 bytes will have to use approach similar to what was done below for MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up reallocating to 0 bytes. Such thing is not going to work too well. You have been warned!! */ #if defined _MSC_VER && !defined WIN32 /* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. The REALLOC define eliminates a flurry of conversion warnings, but is not required. */ # define MAX_BUF_SIZE 65500L # define REALLOC(p,s) realloc ((p), (size_t) (s)) #else # define MAX_BUF_SIZE (1L << 16) # define REALLOC(p,s) realloc ((p), (s)) #endif /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #if __BOUNDED_POINTERS__ # define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated) # define MOVE_BUFFER_POINTER(P) \ (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr) # define ELSE_EXTEND_BUFFER_HIGH_BOUND \ else \ { \ SET_HIGH_BOUND (b); \ SET_HIGH_BOUND (begalt); \ if (fixup_alt_jump) \ SET_HIGH_BOUND (fixup_alt_jump); \ if (laststart) \ SET_HIGH_BOUND (laststart); \ if (pending_exact) \ SET_HIGH_BOUND (pending_exact); \ } #else # define MOVE_BUFFER_POINTER(P) (P) += incr # define ELSE_EXTEND_BUFFER_HIGH_BOUND #endif #ifdef MBS_SUPPORT # define EXTEND_BUFFER() \ do { \ US_CHAR_TYPE *old_buffer = COMPILED_BUFFER_VAR; \ int wchar_count; \ if (bufp->allocated + sizeof(US_CHAR_TYPE) > MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ bufp->allocated = MAX_BUF_SIZE; \ /* How many characters the new buffer can have? */ \ wchar_count = bufp->allocated / sizeof(US_CHAR_TYPE); \ if (wchar_count == 0) wchar_count = 1; \ /* Truncate the buffer to CHAR_TYPE align. */ \ bufp->allocated = wchar_count * sizeof(US_CHAR_TYPE); \ RETALLOC (COMPILED_BUFFER_VAR, wchar_count, US_CHAR_TYPE); \ bufp->buffer = (char*)COMPILED_BUFFER_VAR; \ if (COMPILED_BUFFER_VAR == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != COMPILED_BUFFER_VAR) \ { \ int incr = COMPILED_BUFFER_VAR - old_buffer; \ MOVE_BUFFER_POINTER (b); \ MOVE_BUFFER_POINTER (begalt); \ if (fixup_alt_jump) \ MOVE_BUFFER_POINTER (fixup_alt_jump); \ if (laststart) \ MOVE_BUFFER_POINTER (laststart); \ if (pending_exact) \ MOVE_BUFFER_POINTER (pending_exact); \ } \ ELSE_EXTEND_BUFFER_HIGH_BOUND \ } while (0) #else # define EXTEND_BUFFER() \ do { \ US_CHAR_TYPE *old_buffer = COMPILED_BUFFER_VAR; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ bufp->allocated = MAX_BUF_SIZE; \ bufp->buffer = (US_CHAR_TYPE *) REALLOC (COMPILED_BUFFER_VAR, \ bufp->allocated); \ if (COMPILED_BUFFER_VAR == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != COMPILED_BUFFER_VAR) \ { \ int incr = COMPILED_BUFFER_VAR - old_buffer; \ MOVE_BUFFER_POINTER (b); \ MOVE_BUFFER_POINTER (begalt); \ if (fixup_alt_jump) \ MOVE_BUFFER_POINTER (fixup_alt_jump); \ if (laststart) \ MOVE_BUFFER_POINTER (laststart); \ if (pending_exact) \ MOVE_BUFFER_POINTER (pending_exact); \ } \ ELSE_EXTEND_BUFFER_HIGH_BOUND \ } while (0) #endif /* MBS_SUPPORT */ /* Since we have one byte reserved for the register number argument to {start,stop}_memory, the maximum number of groups we can report things about is what fits in that byte. */ #define MAX_REGNUM 255 /* But patterns can have more than `MAX_REGNUM' registers. We just ignore the excess. */ typedef unsigned regnum_t; /* Macros for the compile stack. */ /* Since offsets can go either forwards or backwards, this type needs to be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ /* int may be not enough when sizeof(int) == 2. */ typedef long pattern_offset_t; typedef struct { pattern_offset_t begalt_offset; pattern_offset_t fixup_alt_jump; pattern_offset_t inner_group_offset; pattern_offset_t laststart_offset; regnum_t regnum; } compile_stack_elt_t; typedef struct { compile_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } compile_stack_type; #define INIT_COMPILE_STACK_SIZE 32 #define COMPILE_STACK_EMPTY (compile_stack.avail == 0) #define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) /* Set the bit for character C in a list. */ #define SET_LIST_BIT(c) \ (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) /* Get the next unsigned number in the uncompiled pattern. */ #define GET_UNSIGNED_NUMBER(num) \ { if (p != pend) \ { \ PATFETCH (c); \ while ('0' <= c && c <= '9') \ { \ if (num < 0) \ num = 0; \ num = num * 10 + c - '0'; \ if (p == pend) \ break; \ PATFETCH (c); \ } \ } \ } #if defined _LIBC || WIDE_CHAR_SUPPORT /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX # else /* This shouldn't happen but some implementation might still have this problem. Use a reasonable default value. */ # define CHAR_CLASS_MAX_LENGTH 256 # endif # ifdef _LIBC # define IS_CHAR_CLASS(string) __wctype (string) # else # define IS_CHAR_CLASS(string) wctype (string) # endif #else # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ # define IS_CHAR_CLASS(string) \ (STREQ (string, "alpha") || STREQ (string, "upper") \ || STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) #endif #ifndef MATCH_MAY_ALLOCATE /* If we cannot allocate large objects within re_match_2_internal, we make the fail stack and register vectors global. The fail stack, we grow to the maximum size when a regexp is compiled. The register vectors, we adjust in size each time we compile a regexp, according to the number of registers it needs. */ static fail_stack_type fail_stack; /* Size with which the following vectors are currently allocated. That is so we can make them bigger as needed, but never make them smaller. */ static int regs_allocated_size; static const char ** regstart, ** regend; static const char ** old_regstart, ** old_regend; static const char **best_regstart, **best_regend; static register_info_type *reg_info; static const char **reg_dummy; static register_info_type *reg_info_dummy; /* Make the register vectors big enough for NUM_REGS registers, but don't make them smaller. */ static regex_grow_registers (num_regs) int num_regs; { if (num_regs > regs_allocated_size) { RETALLOC_IF (regstart, num_regs, const char *); RETALLOC_IF (regend, num_regs, const char *); RETALLOC_IF (old_regstart, num_regs, const char *); RETALLOC_IF (old_regend, num_regs, const char *); RETALLOC_IF (best_regstart, num_regs, const char *); RETALLOC_IF (best_regend, num_regs, const char *); RETALLOC_IF (reg_info, num_regs, register_info_type); RETALLOC_IF (reg_dummy, num_regs, const char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; } } #endif /* not MATCH_MAY_ALLOCATE */ static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type compile_stack, regnum_t regnum)); /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. If it succeeds, results are put in BUFP (if it returns an error, the contents of BUFP are undefined): `buffer' is the compiled pattern; `syntax' is set to SYNTAX; `used' is set to the length of the compiled pattern; `fastmap_accurate' is zero; `re_nsub' is the number of subexpressions in PATTERN; `not_bol' and `not_eol' are zero; The `fastmap' and `newline_anchor' fields are neither examined nor set. */ /* Return, freeing storage we allocated. */ #ifdef MBS_SUPPORT # define FREE_STACK_RETURN(value) \ return (free(pattern), free(mbs_offset), free(is_binary), free (compile_stack.stack), value) #else # define FREE_STACK_RETURN(value) \ return (free (compile_stack.stack), value) #endif /* MBS_SUPPORT */ static reg_errcode_t #ifdef MBS_SUPPORT regex_compile (cpattern, csize, syntax, bufp) const char *cpattern; size_t csize; #else regex_compile (pattern, size, syntax, bufp) const char *pattern; size_t size; #endif /* MBS_SUPPORT */ reg_syntax_t syntax; struct re_pattern_buffer *bufp; { /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so they can be reliably used as array indices. */ register US_CHAR_TYPE c, c1; #ifdef MBS_SUPPORT /* A temporary space to keep wchar_t pattern and compiled pattern. */ CHAR_TYPE *pattern, *COMPILED_BUFFER_VAR; size_t size; /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ int *mbs_offset = NULL; /* It hold whether each wchar_t is binary data or not. */ char *is_binary = NULL; /* A flag whether exactn is handling binary data or not. */ char is_exactn_bin = FALSE; #endif /* MBS_SUPPORT */ /* A random temporary spot in PATTERN. */ const CHAR_TYPE *p1; /* Points to the end of the buffer, where we should append. */ register US_CHAR_TYPE *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ #ifdef MBS_SUPPORT const CHAR_TYPE *p; const CHAR_TYPE *pend; #else const CHAR_TYPE *p = pattern; const CHAR_TYPE *pend = pattern + size; #endif /* MBS_SUPPORT */ /* How to translate the characters in the pattern. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match character can be added to that command or if the character requires a new `exactn' command. */ US_CHAR_TYPE *pending_exact = 0; /* Address of start of the most recently finished expression. This tells, e.g., postfix * where to find the start of its operand. Reset at the beginning of groups and alternatives. */ US_CHAR_TYPE *laststart = 0; /* Address of beginning of regexp, or inside of last group. */ US_CHAR_TYPE *begalt; /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ #ifdef MBS_SUPPORT const US_CHAR_TYPE *beg_interval; #else const char *beg_interval; #endif /* MBS_SUPPORT */ /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the last -- ends with a forward jump of this sort. */ US_CHAR_TYPE *fixup_alt_jump = 0; /* Counts open-groups as they are encountered. Remembered for the matching close-group on the compile stack, so the same register number is put in the stop_memory as the start_memory. */ regnum_t regnum = 0; #ifdef MBS_SUPPORT /* Initialize the wchar_t PATTERN and offset_buffer. */ p = pend = pattern = TALLOC(csize, CHAR_TYPE); mbs_offset = TALLOC(csize + 1, int); is_binary = TALLOC(csize + 1, char); if (pattern == NULL || mbs_offset == NULL || is_binary == NULL) { if (pattern) free(pattern); if (mbs_offset) free(mbs_offset); if (is_binary) free(is_binary); return REG_ESPACE; } size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary); pend = p + size; if (size < 0) { if (pattern) free(pattern); if (mbs_offset) free(mbs_offset); if (is_binary) free(is_binary); return REG_BADPAT; } #endif #ifdef DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) { unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) PUT_CHAR (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ /* Initialize the compile stack. */ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); if (compile_stack.stack == NULL) { #ifdef MBS_SUPPORT if (pattern) free(pattern); if (mbs_offset) free(mbs_offset); if (is_binary) free(is_binary); #endif return REG_ESPACE; } compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; /* Initialize the pattern buffer. */ bufp->syntax = syntax; bufp->fastmap_accurate = 0; bufp->not_bol = bufp->not_eol = 0; /* Set `used' to zero, so that if we return an error, the pattern printer (for debugging) will think there's no pattern. We reset it at the end. */ bufp->used = 0; /* Always count groups, whether or not bufp->no_sub is set. */ bufp->re_nsub = 0; #if !defined emacs && !defined SYNTAX_TABLE /* Initialize the syntax table. */ init_syntax_once (); #endif if (bufp->allocated == 0) { if (bufp->buffer) { /* If zero allocated, but buffer is non-null, try to realloc enough space. This loses if buffer's address is bogus, but that is the user's responsibility. */ #ifdef MBS_SUPPORT /* Free bufp->buffer and allocate an array for wchar_t pattern buffer. */ free(bufp->buffer); COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(US_CHAR_TYPE), US_CHAR_TYPE); #else RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, US_CHAR_TYPE); #endif /* MBS_SUPPORT */ } else { /* Caller did not allocate a buffer. Do it for them. */ COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(US_CHAR_TYPE), US_CHAR_TYPE); } if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE); #ifdef MBS_SUPPORT bufp->buffer = (char*)COMPILED_BUFFER_VAR; #endif /* MBS_SUPPORT */ bufp->allocated = INIT_BUF_SIZE; } #ifdef MBS_SUPPORT else COMPILED_BUFFER_VAR = (US_CHAR_TYPE*) bufp->buffer; #endif begalt = b = COMPILED_BUFFER_VAR; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) { PATFETCH (c); switch (c) { case '^': { if ( /* If at start of pattern, it's an operator. */ p == pattern + 1 /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's come before. */ || at_begline_loc_p (pattern, p, syntax)) BUF_PUSH (begline); else goto normal_char; } break; case '$': { if ( /* If at end of pattern, it's an operator. */ p == pend /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's next. */ || at_endline_loc_p (p, pend, syntax)) BUF_PUSH (endline); else goto normal_char; } break; case '+': case '?': if ((syntax & RE_BK_PLUS_QM) || (syntax & RE_LIMITED_OPS)) goto normal_char; handle_plus: case '*': /* If there is no previous pattern... */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (!(syntax & RE_CONTEXT_INDEP_OPS)) goto normal_char; } { /* Are we optimizing this jump? */ boolean keep_string_p = false; /* 1 means zero (many) matches is allowed. */ char zero_times_ok = 0, many_times_ok = 0; /* If there is a sequence of repetition chars, collapse it down to just one (the right one). We can't combine interval operators with these because of, e.g., `a{2}*', which should only match an even number of `a's. */ for (;;) { zero_times_ok |= c != '+'; many_times_ok |= c != '?'; if (p == pend) break; PATFETCH (c); if (c == '*' || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) ; else if (syntax & RE_BK_PLUS_QM && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); if (!(c1 == '+' || c1 == '?')) { PATUNFETCH; PATUNFETCH; break; } c = c1; } else { PATUNFETCH; break; } /* If we get here, we found another repeat character. */ } /* Star, etc. applied to an empty pattern is equivalent to an empty pattern. */ if (!laststart) break; /* Now we know whether or not zero matches is allowed and also whether or not two or more matches is allowed. */ if (many_times_ok) { /* More than one repetition is allowed, so put in at the end a backward relative jump from `b' to before the next jump we're going to put in below (which jumps from laststart to after this jump). But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., instead of the beginning of the loop. This way we only push a failure point once, instead of every time through the loop. */ assert (p - 1 > pattern); /* Allocate the space for the jump. */ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); /* We know we are not at the first character of the pattern, because laststart was nonzero. And we've already incremented `p', by the way, to be the character after the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') && zero_times_ok && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ STORE_JUMP (jump, b, laststart); keep_string_p = true; } else /* Anything else. */ STORE_JUMP (maybe_pop_jump, b, laststart - (1 + OFFSET_ADDRESS_SIZE)); /* We've added more stuff to the buffer. */ b += 1 + OFFSET_ADDRESS_SIZE; } /* On failure, jump from laststart to b + 3, which will be the end of the buffer after this jump is inserted. */ /* ifdef MBS_SUPPORT, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of 'b + 3'. */ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, laststart, b + 1 + OFFSET_ADDRESS_SIZE); pending_exact = 0; b += 1 + OFFSET_ADDRESS_SIZE; if (!zero_times_ok) { /* At least one repetition is required, so insert a `dummy_failure_jump' before the initial `on_failure_jump' instruction of the loop. This effects a skip over that instruction the first time we hit that loop. */ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); INSERT_JUMP (dummy_failure_jump, laststart, laststart + 2 + 2 * OFFSET_ADDRESS_SIZE); b += 1 + OFFSET_ADDRESS_SIZE; } } break; case '.': laststart = b; BUF_PUSH (anychar); break; case '[': { boolean had_char_class = false; #ifdef MBS_SUPPORT CHAR_TYPE range_start = 0xffffffff; #else unsigned int range_start = 0xffffffff; #endif if (p == pend) FREE_STACK_RETURN (REG_EBRACK); #ifdef MBS_SUPPORT /* We assume a charset(_not) structure as a wchar_t array. charset[0] = (re_opcode_t) charset(_not) charset[1] = l (= length of char_classes) charset[2] = m (= length of collating_symbols) charset[3] = n (= length of equivalence_classes) charset[4] = o (= length of char_ranges) charset[5] = p (= length of chars) charset[6] = char_class (wctype_t) charset[6+CHAR_CLASS_SIZE] = char_class (wctype_t) ... charset[l+5] = char_class (wctype_t) charset[l+6] = collating_symbol (wchar_t) ... charset[l+m+5] = collating_symbol (wchar_t) ifdef _LIBC we use the index if _NL_COLLATE_SYMB_EXTRAMB instead of wchar_t string. charset[l+m+6] = equivalence_classes (wchar_t) ... charset[l+m+n+5] = equivalence_classes (wchar_t) ifdef _LIBC we use the index in _NL_COLLATE_WEIGHT instead of wchar_t string. charset[l+m+n+6] = range_start charset[l+m+n+7] = range_end ... charset[l+m+n+2o+4] = range_start charset[l+m+n+2o+5] = range_end ifdef _LIBC we use the value looked up in _NL_COLLATE_COLLSEQ instead of wchar_t character. charset[l+m+n+2o+6] = char ... charset[l+m+n+2o+p+5] = char */ /* We need at least 6 spaces: the opcode, the length of char_classes, the length of collating_symbols, the length of equivalence_classes, the length of char_ranges, the length of chars. */ GET_BUFFER_SPACE (6); /* Save b as laststart. And We use laststart as the pointer to the first element of the charset here. In other words, laststart[i] indicates charset[i]. */ laststart = b; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ BUF_PUSH (*p == '^' ? charset_not : charset); if (*p == '^') p++; /* Push the length of char_classes, the length of collating_symbols, the length of equivalence_classes, the length of char_ranges and the length of chars. */ BUF_PUSH_3 (0, 0, 0); BUF_PUSH_2 (0, 0); /* Remember the first position in the bracket expression. */ p1 = p; /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-6] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) { BUF_PUSH('\n'); laststart[5]++; /* Update the length of characters */ } /* Read in characters and ranges, setting map bits. */ for (;;) { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); PATFETCH (c); /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); BUF_PUSH(c1); laststart[5]++; /* Update the length of chars */ range_start = c1; continue; } /* Could be the end of the bracket expression. If it's not (i.e., when the bracket expression is `[]' so far), the ']' character bit gets set way below. */ if (c == ']' && p != p1 + 1) break; /* Look ahead to see if it's a range when the last thing was a character class. */ if (had_char_class && c == '-' && *p != ']') FREE_STACK_RETURN (REG_ERANGE); /* Look ahead to see if it's a range when the last thing was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret; /* Allocate the space for range_start and range_end. */ GET_BUFFER_SPACE (2); /* Update the pointer to indicate end of buffer. */ b += 2; ret = compile_range (range_start, &p, pend, translate, syntax, b, laststart); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); range_start = 0xffffffff; } else if (p[0] == '-' && p[1] != ']') { /* This handles ranges made up of characters only. */ reg_errcode_t ret; /* Move past the `-'. */ PATFETCH (c1); /* Allocate the space for range_start and range_end. */ GET_BUFFER_SPACE (2); /* Update the pointer to indicate end of buffer. */ b += 2; ret = compile_range (c, &p, pend, translate, syntax, b, laststart); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); range_start = 0xffffffff; } /* See if we're at the beginning of a possible character class. */ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') { /* Leave room for the null. */ char str[CHAR_CLASS_MAX_LENGTH + 1]; PATFETCH (c); c1 = 0; /* If pattern is `[[:'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if ((c == ':' && *p == ']') || p == pend) break; if (c1 < CHAR_CLASS_MAX_LENGTH) str[c1++] = c; else /* This is in any case an invalid class name. */ str[0] = '\0'; } str[c1] = '\0'; /* If isn't a word bracketed by `[:' and `:]': undo the ending character, the letters, and leave the leading `:' and `[' (but store them as character). */ if (c == ':' && *p == ']') { wctype_t wt; uintptr_t alignedp; /* Query the character class as wctype_t. */ wt = IS_CHAR_CLASS (str); if (wt == 0) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); /* Allocate the space for character class. */ GET_BUFFER_SPACE(CHAR_CLASS_SIZE); /* Update the pointer to indicate end of buffer. */ b += CHAR_CLASS_SIZE; /* Move data which follow character classes not to violate the data. */ insert_space(CHAR_CLASS_SIZE, laststart + 6 + laststart[1], b - 1); alignedp = ((uintptr_t)(laststart + 6 + laststart[1]) + __alignof__(wctype_t) - 1) & ~(uintptr_t)(__alignof__(wctype_t) - 1); /* Store the character class. */ *((wctype_t*)alignedp) = wt; /* Update length of char_classes */ laststart[1] += CHAR_CLASS_SIZE; had_char_class = true; } else { c1++; while (c1--) PATUNFETCH; BUF_PUSH ('['); BUF_PUSH (':'); laststart[5] += 2; /* Update the length of characters */ range_start = ':'; had_char_class = false; } } else if (syntax & RE_CHAR_CLASSES && c == '[' && (*p == '=' || *p == '.')) { CHAR_TYPE str[128]; /* Should be large enough. */ CHAR_TYPE delim = *p; /* '=' or '.' */ # ifdef _LIBC uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); # endif PATFETCH (c); c1 = 0; /* If pattern is `[[=' or '[[.'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if ((c == delim && *p == ']') || p == pend) break; if (c1 < sizeof (str) - 1) str[c1++] = c; else /* This is in any case an invalid class name. */ str[0] = '\0'; } str[c1] = '\0'; if (c == delim && *p == ']' && str[0] != '\0') { unsigned int i, offset; /* If we have no collation data we use the default collation in which each character is in a class by itself. It also means that ASCII is the character set and therefore we cannot have character with more than one byte in the multibyte representation. */ /* If not defined _LIBC, we push the name and `\0' for the sake of matching performance. */ int datasize = c1 + 1; # ifdef _LIBC int32_t idx = 0; if (nrules == 0) # endif { if (c1 != 1) FREE_STACK_RETURN (REG_ECOLLATE); } # ifdef _LIBC else { const int32_t *table; const int32_t *weights; const int32_t *extra; const int32_t *indirect; wint_t *cp; /* This #include defines a local function! */ # include if(delim == '=') { /* We push the index for equivalence class. */ cp = (wint_t*)str; table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); weights = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); extra = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); idx = findidx ((const wint_t**)&cp); if (idx == 0 || cp < (wint_t*) str + c1) /* This is no valid character. */ FREE_STACK_RETURN (REG_ECOLLATE); str[0] = (wchar_t)idx; } else /* delim == '.' */ { /* We push collation sequence value for collating symbol. */ int32_t table_size; const int32_t *symb_table; const unsigned char *extra; int32_t idx; int32_t elem; int32_t second; int32_t hash; char char_str[c1]; /* We have to convert the name to a single-byte string. This is possible since the names consist of ASCII characters and the internal representation is UCS4. */ for (i = 0; i < c1; ++i) char_str[i] = str[i]; table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB); symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); /* Locate the character in the hashing table. */ hash = elem_hash (char_str, c1); idx = 0; elem = hash % table_size; second = hash % (table_size - 2); while (symb_table[2 * elem] != 0) { /* First compare the hashing value. */ if (symb_table[2 * elem] == hash && c1 == extra[symb_table[2 * elem + 1]] && memcmp (str, &extra[symb_table[2 * elem + 1] + 1], c1) == 0) { /* Yep, this is the entry. */ idx = symb_table[2 * elem + 1]; idx += 1 + extra[idx]; break; } /* Next entry. */ elem += second; } if (symb_table[2 * elem] != 0) { /* Compute the index of the byte sequence in the table. */ idx += 1 + extra[idx]; /* Adjust for the alignment. */ idx = (idx + 3) & ~4; str[0] = (wchar_t) idx + 4; } else if (symb_table[2 * elem] == 0 && c1 == 1) { /* No valid character. Match it as a single byte character. */ had_char_class = false; BUF_PUSH(str[0]); /* Update the length of characters */ laststart[5]++; range_start = str[0]; /* Throw away the ] at the end of the collating symbol. */ PATFETCH (c); /* exit from the switch block. */ continue; } else FREE_STACK_RETURN (REG_ECOLLATE); } datasize = 1; } # endif /* Throw away the ] at the end of the equivalence class (or collating symbol). */ PATFETCH (c); /* Allocate the space for the equivalence class (or collating symbol) (and '\0' if needed). */ GET_BUFFER_SPACE(datasize); /* Update the pointer to indicate end of buffer. */ b += datasize; if (delim == '=') { /* equivalence class */ /* Calculate the offset of char_ranges, which is next to equivalence_classes. */ offset = laststart[1] + laststart[2] + laststart[3] +6; /* Insert space. */ insert_space(datasize, laststart + offset, b - 1); /* Write the equivalence_class and \0. */ for (i = 0 ; i < datasize ; i++) laststart[offset + i] = str[i]; /* Update the length of equivalence_classes. */ laststart[3] += datasize; had_char_class = true; } else /* delim == '.' */ { /* collating symbol */ /* Calculate the offset of the equivalence_classes, which is next to collating_symbols. */ offset = laststart[1] + laststart[2] + 6; /* Insert space and write the collationg_symbol and \0. */ insert_space(datasize, laststart + offset, b-1); for (i = 0 ; i < datasize ; i++) laststart[offset + i] = str[i]; /* In re_match_2_internal if range_start < -1, we assume -range_start is the offset of the collating symbol which is specified as the character of the range start. So we assign -(laststart[1] + laststart[2] + 6) to range_start. */ range_start = -(laststart[1] + laststart[2] + 6); /* Update the length of collating_symbol. */ laststart[2] += datasize; had_char_class = false; } } else { c1++; while (c1--) PATUNFETCH; BUF_PUSH ('['); BUF_PUSH (delim); laststart[5] += 2; /* Update the length of characters */ range_start = delim; had_char_class = false; } } else { had_char_class = false; BUF_PUSH(c); laststart[5]++; /* Update the length of characters */ range_start = c; } } #else /* not MBS_SUPPORT */ /* Ensure that we have enough space to push a charset: the opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); laststart = b; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ BUF_PUSH (*p == '^' ? charset_not : charset); if (*p == '^') p++; /* Remember the first position in the bracket expression. */ p1 = p; /* Push the number of bytes in the bitmap. */ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_LIST_BIT ('\n'); /* Read in characters and ranges, setting map bits. */ for (;;) { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); PATFETCH (c); /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); SET_LIST_BIT (c1); range_start = c1; continue; } /* Could be the end of the bracket expression. If it's not (i.e., when the bracket expression is `[]' so far), the ']' character bit gets set way below. */ if (c == ']' && p != p1 + 1) break; /* Look ahead to see if it's a range when the last thing was a character class. */ if (had_char_class && c == '-' && *p != ']') FREE_STACK_RETURN (REG_ERANGE); /* Look ahead to see if it's a range when the last thing was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret = compile_range (range_start, &p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); range_start = 0xffffffff; } else if (p[0] == '-' && p[1] != ']') { /* This handles ranges made up of characters only. */ reg_errcode_t ret; /* Move past the `-'. */ PATFETCH (c1); ret = compile_range (c, &p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); range_start = 0xffffffff; } /* See if we're at the beginning of a possible character class. */ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') { /* Leave room for the null. */ char str[CHAR_CLASS_MAX_LENGTH + 1]; PATFETCH (c); c1 = 0; /* If pattern is `[[:'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if ((c == ':' && *p == ']') || p == pend) break; if (c1 < CHAR_CLASS_MAX_LENGTH) str[c1++] = c; else /* This is in any case an invalid class name. */ str[0] = '\0'; } str[c1] = '\0'; /* If isn't a word bracketed by `[:' and `:]': undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') { # if defined _LIBC || WIDE_CHAR_SUPPORT boolean is_lower = STREQ (str, "lower"); boolean is_upper = STREQ (str, "upper"); wctype_t wt; int ch; wt = IS_CHAR_CLASS (str); if (wt == 0) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) { # ifdef _LIBC if (__iswctype (__btowc (ch), wt)) SET_LIST_BIT (ch); # else if (iswctype (btowc (ch), wt)) SET_LIST_BIT (ch); # endif if (translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; # else int ch; boolean is_alnum = STREQ (str, "alnum"); boolean is_alpha = STREQ (str, "alpha"); boolean is_blank = STREQ (str, "blank"); boolean is_cntrl = STREQ (str, "cntrl"); boolean is_digit = STREQ (str, "digit"); boolean is_graph = STREQ (str, "graph"); boolean is_lower = STREQ (str, "lower"); boolean is_print = STREQ (str, "print"); boolean is_punct = STREQ (str, "punct"); boolean is_space = STREQ (str, "space"); boolean is_upper = STREQ (str, "upper"); boolean is_xdigit = STREQ (str, "xdigit"); if (!IS_CHAR_CLASS (str)) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { /* This was split into 3 if's to avoid an arbitrary limit in some compiler. */ if ( (is_alnum && ISALNUM (ch)) || (is_alpha && ISALPHA (ch)) || (is_blank && ISBLANK (ch)) || (is_cntrl && ISCNTRL (ch))) SET_LIST_BIT (ch); if ( (is_digit && ISDIGIT (ch)) || (is_graph && ISGRAPH (ch)) || (is_lower && ISLOWER (ch)) || (is_print && ISPRINT (ch))) SET_LIST_BIT (ch); if ( (is_punct && ISPUNCT (ch)) || (is_space && ISSPACE (ch)) || (is_upper && ISUPPER (ch)) || (is_xdigit && ISXDIGIT (ch))) SET_LIST_BIT (ch); if ( translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; # endif /* libc || wctype.h */ } else { c1++; while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT (':'); range_start = ':'; had_char_class = false; } } else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=') { unsigned char str[MB_LEN_MAX + 1]; # ifdef _LIBC uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); # endif PATFETCH (c); c1 = 0; /* If pattern is `[[='. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if ((c == '=' && *p == ']') || p == pend) break; if (c1 < MB_LEN_MAX) str[c1++] = c; else /* This is in any case an invalid class name. */ str[0] = '\0'; } str[c1] = '\0'; if (c == '=' && *p == ']' && str[0] != '\0') { /* If we have no collation data we use the default collation in which each character is in a class by itself. It also means that ASCII is the character set and therefore we cannot have character with more than one byte in the multibyte representation. */ # ifdef _LIBC if (nrules == 0) # endif { if (c1 != 1) FREE_STACK_RETURN (REG_ECOLLATE); /* Throw away the ] at the end of the equivalence class. */ PATFETCH (c); /* Set the bit for the character. */ SET_LIST_BIT (str[0]); } # ifdef _LIBC else { /* Try to match the byte sequence in `str' against those known to the collate implementation. First find out whether the bytes in `str' are actually from exactly one character. */ const int32_t *table; const unsigned char *weights; const unsigned char *extra; const int32_t *indirect; int32_t idx; const unsigned char *cp = str; int ch; /* This #include defines a local function! */ # include table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); idx = findidx (&cp); if (idx == 0 || cp < str + c1) /* This is no valid character. */ FREE_STACK_RETURN (REG_ECOLLATE); /* Throw away the ] at the end of the equivalence class. */ PATFETCH (c); /* Now we have to go throught the whole table and find all characters which have the same first level weight. XXX Note that this is not entirely correct. we would have to match multibyte sequences but this is not possible with the current implementation. */ for (ch = 1; ch < 256; ++ch) /* XXX This test would have to be changed if we would allow matching multibyte sequences. */ if (table[ch] > 0) { int32_t idx2 = table[ch]; size_t len = weights[idx2]; /* Test whether the lenghts match. */ if (weights[idx] == len) { /* They do. New compare the bytes of the weight. */ size_t cnt = 0; while (cnt < len && (weights[idx + 1 + cnt] == weights[idx2 + 1 + cnt])) ++cnt; if (cnt == len) /* They match. Mark the character as acceptable. */ SET_LIST_BIT (ch); } } } # endif had_char_class = true; } else { c1++; while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT ('='); range_start = '='; had_char_class = false; } } else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.') { unsigned char str[128]; /* Should be large enough. */ # ifdef _LIBC uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); # endif PATFETCH (c); c1 = 0; /* If pattern is `[[.'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if ((c == '.' && *p == ']') || p == pend) break; if (c1 < sizeof (str)) str[c1++] = c; else /* This is in any case an invalid class name. */ str[0] = '\0'; } str[c1] = '\0'; if (c == '.' && *p == ']' && str[0] != '\0') { /* If we have no collation data we use the default collation in which each character is the name for its own class which contains only the one character. It also means that ASCII is the character set and therefore we cannot have character with more than one byte in the multibyte representation. */ # ifdef _LIBC if (nrules == 0) # endif { if (c1 != 1) FREE_STACK_RETURN (REG_ECOLLATE); /* Throw away the ] at the end of the equivalence class. */ PATFETCH (c); /* Set the bit for the character. */ SET_LIST_BIT (str[0]); range_start = ((const unsigned char *) str)[0]; } # ifdef _LIBC else { /* Try to match the byte sequence in `str' against those known to the collate implementation. First find out whether the bytes in `str' are actually from exactly one character. */ int32_t table_size; const int32_t *symb_table; const unsigned char *extra; int32_t idx; int32_t elem; int32_t second; int32_t hash; table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB); symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); /* Locate the character in the hashing table. */ hash = elem_hash (str, c1); idx = 0; elem = hash % table_size; second = hash % (table_size - 2); while (symb_table[2 * elem] != 0) { /* First compare the hashing value. */ if (symb_table[2 * elem] == hash && c1 == extra[symb_table[2 * elem + 1]] && memcmp (str, &extra[symb_table[2 * elem + 1] + 1], c1) == 0) { /* Yep, this is the entry. */ idx = symb_table[2 * elem + 1]; idx += 1 + extra[idx]; break; } /* Next entry. */ elem += second; } if (symb_table[2 * elem] == 0) /* This is no valid character. */ FREE_STACK_RETURN (REG_ECOLLATE); /* Throw away the ] at the end of the equivalence class. */ PATFETCH (c); /* Now add the multibyte character(s) we found to the accept list. XXX Note that this is not entirely correct. we would have to match multibyte sequences but this is not possible with the current implementation. Also, we have to match collating symbols, which expand to more than one file, as a whole and not allow the individual bytes. */ c1 = extra[idx++]; if (c1 == 1) range_start = extra[idx]; while (c1-- > 0) { SET_LIST_BIT (extra[idx]); ++idx; } } # endif had_char_class = false; } else { c1++; while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT ('.'); range_start = '.'; had_char_class = false; } } else { had_char_class = false; SET_LIST_BIT (c); range_start = c; } } /* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; b += b[-1]; #endif /* MBS_SUPPORT */ } break; case '(': if (syntax & RE_NO_BK_PARENS) goto handle_open; else goto normal_char; case ')': if (syntax & RE_NO_BK_PARENS) goto handle_close; else goto normal_char; case '\n': if (syntax & RE_NEWLINE_ALT) goto handle_alt; else goto normal_char; case '|': if (syntax & RE_NO_BK_VBAR) goto handle_alt; else goto normal_char; case '{': if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) goto handle_interval; else goto normal_char; case '\\': if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); /* Do not translate the character after the \, so that we can distinguish, e.g., \B from \b, even if we normally would translate, e.g., B to b. */ PATFETCH_RAW (c); switch (c) { case '(': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; handle_open: bufp->re_nsub++; regnum++; if (COMPILE_STACK_FULL) { RETALLOC (compile_stack.stack, compile_stack.size << 1, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; compile_stack.size <<= 1; } /* These are the values to restore when we hit end of this group. They are all relative offsets, so that if the whole pattern moves because of realloc, they will still be valid. */ COMPILE_STACK_TOP.begalt_offset = begalt - COMPILED_BUFFER_VAR; COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - COMPILED_BUFFER_VAR + 1 : 0; COMPILE_STACK_TOP.laststart_offset = b - COMPILED_BUFFER_VAR; COMPILE_STACK_TOP.regnum = regnum; /* We will eventually replace the 0 with the number of groups inner to this one. But do not push a start_memory for groups beyond the last one we can represent in the compiled pattern. */ if (regnum <= MAX_REGNUM) { COMPILE_STACK_TOP.inner_group_offset = b - COMPILED_BUFFER_VAR + 2; BUF_PUSH_3 (start_memory, regnum, 0); } compile_stack.avail++; fixup_alt_jump = 0; laststart = 0; begalt = b; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; break; case ')': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_backslash; else FREE_STACK_RETURN (REG_ERPAREN); } handle_close: if (fixup_alt_jump) { /* Push a dummy failure point at the end of the alternative for a possible future `pop_failure_jump' to pop. See comments at `push_dummy_failure' in `re_match_2'. */ BUF_PUSH (push_dummy_failure); /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); } /* See similar code for backslashed left paren above. */ if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_char; else FREE_STACK_RETURN (REG_ERPAREN); } /* Since we just checked for an empty stack above, this ``can't happen''. */ assert (compile_stack.avail != 0); { /* We don't just want to restore into `regnum', because later groups should continue to be numbered higher, as in `(ab)c(de)' -- the second group is #2. */ regnum_t this_group_regnum; compile_stack.avail--; begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; laststart = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; /* We're at the end of the group, so now we know how many groups were inside this one. */ if (this_group_regnum <= MAX_REGNUM) { US_CHAR_TYPE *inner_group_loc = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.inner_group_offset; *inner_group_loc = regnum - this_group_regnum; BUF_PUSH_3 (stop_memory, this_group_regnum, regnum - this_group_regnum); } } break; case '|': /* `\|'. */ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) goto normal_backslash; handle_alt: if (syntax & RE_LIMITED_OPS) goto normal_char; /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); INSERT_JUMP (on_failure_jump, begalt, b + 2 + 2 * OFFSET_ADDRESS_SIZE); pending_exact = 0; b += 1 + OFFSET_ADDRESS_SIZE; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that jump so it will jump to this alternative's analogous jump (put in below, which in turn will jump to the next (if any) alternative's such jump, etc.). The last such jump jumps to the correct final destination. A picture: _____ _____ | | | | | v | v a | b | c If we are at `b', then fixup_alt_jump right now points to a three-byte space after `a'. We'll put in the jump, set fixup_alt_jump to right after `b', and leave behind three bytes which we'll fill in when we get to after `c'. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); /* Mark and leave space for a jump after this alternative, to be filled in later either by next alternative or when know we're at the end of a series of alternatives. */ fixup_alt_jump = b; GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); b += 1 + OFFSET_ADDRESS_SIZE; laststart = 0; begalt = b; break; case '{': /* If \{ is a literal. */ if (!(syntax & RE_INTERVALS) /* If we're at `\{' and it's not the open-interval operator. */ || (syntax & RE_NO_BK_BRACES)) goto normal_backslash; handle_interval: { /* If got here, then the syntax allows intervals. */ /* At least (most) this many matches must be made. */ int lower_bound = -1, upper_bound = -1; beg_interval = p - 1; if (p == pend) { if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) goto unfetch_interval; else FREE_STACK_RETURN (REG_EBRACE); } GET_UNSIGNED_NUMBER (lower_bound); if (c == ',') { GET_UNSIGNED_NUMBER (upper_bound); if ((!(syntax & RE_NO_BK_BRACES) && c != '\\') || ((syntax & RE_NO_BK_BRACES) && c != '}')) FREE_STACK_RETURN (REG_BADBR); if (upper_bound < 0) upper_bound = RE_DUP_MAX; } else /* Interval such as `{1}' => match exactly once. */ upper_bound = lower_bound; if (lower_bound < 0 || upper_bound > RE_DUP_MAX || lower_bound > upper_bound) { if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } if (!(syntax & RE_NO_BK_BRACES)) { if (c != '\\') FREE_STACK_RETURN (REG_EBRACE); PATFETCH (c); } if (c != '}') { if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } /* We just parsed a valid interval. */ /* If it's invalid to have no preceding re. */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (syntax & RE_CONTEXT_INDEP_OPS) laststart = b; else goto unfetch_interval; } /* If the upper bound is zero, don't want to succeed at all; jump from `laststart' to `b + 3', which will be the end of the buffer after we insert the jump. */ /* ifdef MBS_SUPPORT, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of 'b + 3'. */ if (upper_bound == 0) { GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE); INSERT_JUMP (jump, laststart, b + 1 + OFFSET_ADDRESS_SIZE); b += 1 + OFFSET_ADDRESS_SIZE; } /* Otherwise, we have a nontrivial interval. When we're all done, the pattern will look like: set_number_at set_number_at succeed_n jump_n (The upper bound and `jump_n' are omitted if `upper_bound' is 1, though.) */ else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ unsigned nbytes = 2 + 4 * OFFSET_ADDRESS_SIZE + (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE); GET_BUFFER_SPACE (nbytes); /* Initialize lower bound of the `succeed_n', even though it will be set during matching by its attendant `set_number_at' (inserted next), because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, b + 1 + 2 * OFFSET_ADDRESS_SIZE + (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE) , lower_bound); b += 1 + 2 * OFFSET_ADDRESS_SIZE; /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ /* ifdef MBS_SUPPORT, The '1+2*OFFSET_ADDRESS_SIZE' is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE' of the following `succeed_n'. */ insert_op2 (set_number_at, laststart, 1 + 2 * OFFSET_ADDRESS_SIZE, lower_bound, b); b += 1 + 2 * OFFSET_ADDRESS_SIZE; if (upper_bound > 1) { /* More than one repetition is allowed, so append a backward jump to the `succeed_n' that starts this interval. When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ STORE_JUMP2 (jump_n, b, laststart + 2 * OFFSET_ADDRESS_SIZE + 1, upper_bound - 1); b += 1 + 2 * OFFSET_ADDRESS_SIZE; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as an absolute address. `laststart' will be the `set_number_at' we're about to insert; `laststart+3' the number to set, the source for the relative address. But we are inserting into the middle of the pattern -- so everything is getting moved up by 5. Conclusion: (b - 2) - (laststart + 3) + 5, i.e., b - laststart. We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ insert_op2 (set_number_at, laststart, b - laststart, upper_bound - 1, b); b += 1 + 2 * OFFSET_ADDRESS_SIZE; } } pending_exact = 0; beg_interval = NULL; } break; unfetch_interval: /* If an invalid interval, match the characters as literals. */ assert (beg_interval); p = beg_interval; beg_interval = NULL; /* normal_char and normal_backslash need `c'. */ PATFETCH (c); if (!(syntax & RE_NO_BK_BRACES)) { if (p > pattern && p[-1] == '\\') goto normal_backslash; } goto normal_char; #ifdef emacs /* There is no way to specify the before_dot and after_dot operators. rms says this is ok. --karl */ case '=': BUF_PUSH (at_dot); break; case 's': laststart = b; PATFETCH (c); BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); break; case 'S': laststart = b; PATFETCH (c); BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); break; #endif /* emacs */ case 'w': if (syntax & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (wordchar); break; case 'W': if (syntax & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (notwordchar); break; case '<': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbeg); break; case '>': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordend); break; case 'b': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbound); break; case 'B': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (notwordbound); break; case '`': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (begbuf); break; case '\'': if (syntax & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (endbuf); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (syntax & RE_NO_BK_REFS) goto normal_char; c1 = c - '0'; if (c1 > regnum) FREE_STACK_RETURN (REG_ESUBREG); /* Can't back reference to a subexpression if inside of it. */ if (group_in_compile_stack (compile_stack, (regnum_t) c1)) goto normal_char; laststart = b; BUF_PUSH_2 (duplicate, c1); break; case '+': case '?': if (syntax & RE_BK_PLUS_QM) goto handle_plus; else goto normal_backslash; default: normal_backslash: /* You might think it would be useful for \ to mean not to translate; but if we don't translate it it will never match anything. */ c = TRANSLATE (c); goto normal_char; } break; default: /* Expects the character in `c'. */ normal_char: /* If no exactn currently being built. */ if (!pending_exact #ifdef MBS_SUPPORT /* If last exactn handle binary(or character) and new exactn handle character(or binary). */ || is_exactn_bin != is_binary[p - 1 - pattern] #endif /* MBS_SUPPORT */ /* If last exactn not at current position. */ || pending_exact + *pending_exact + 1 != b /* We have only one byte following the exactn for the count. */ || *pending_exact == (1 << BYTEWIDTH) - 1 /* If followed by a repetition operator. */ || *p == '*' || *p == '^' || ((syntax & RE_BK_PLUS_QM) ? *p == '\\' && (p[1] == '+' || p[1] == '?') : (*p == '+' || *p == '?')) || ((syntax & RE_INTERVALS) && ((syntax & RE_NO_BK_BRACES) ? *p == '{' : (p[0] == '\\' && p[1] == '{')))) { /* Start building a new exactn. */ laststart = b; #ifdef MBS_SUPPORT /* Is this exactn binary data or character? */ is_exactn_bin = is_binary[p - 1 - pattern]; if (is_exactn_bin) BUF_PUSH_2 (exactn_bin, 0); else BUF_PUSH_2 (exactn, 0); #else BUF_PUSH_2 (exactn, 0); #endif /* MBS_SUPPORT */ pending_exact = b - 1; } BUF_PUSH (c); (*pending_exact)++; break; } /* switch (c) */ } /* while p != pend */ /* Through the pattern now. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); if (!COMPILE_STACK_EMPTY) FREE_STACK_RETURN (REG_EPAREN); /* If we don't want backtracking, force success the first time we reach the end of the compiled pattern. */ if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); #ifdef MBS_SUPPORT free (pattern); free (mbs_offset); free (is_binary); #endif free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ #ifdef MBS_SUPPORT bufp->used = (uintptr_t) b - (uintptr_t) COMPILED_BUFFER_VAR; #else bufp->used = b - bufp->buffer; #endif #ifdef DEBUG if (debug) { DEBUG_PRINT1 ("\nCompiled pattern: \n"); print_compiled_pattern (bufp); } #endif /* DEBUG */ #ifndef MATCH_MAY_ALLOCATE /* Initialize the failure stack to the largest possible stack. This isn't necessary unless we're trying to avoid calling alloca in the search and match routines. */ { int num_regs = bufp->re_nsub + 1; /* Since DOUBLE_FAIL_STACK refuses to double only if the current size is strictly greater than re_max_failures, the largest possible stack is 2 * re_max_failures failure points. */ if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS)) { fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); # ifdef emacs if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) xmalloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) xrealloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); # else /* not emacs */ if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) malloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) realloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); # endif /* not emacs */ } regex_grow_registers (num_regs); } #endif /* not MATCH_MAY_ALLOCATE */ return REG_NOERROR; } /* regex_compile */ /* Subroutines for `regex_compile'. */ /* Store OP at LOC followed by two-byte integer parameter ARG. */ /* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ static void store_op1 (op, loc, arg) re_opcode_t op; US_CHAR_TYPE *loc; int arg; { *loc = (US_CHAR_TYPE) op; STORE_NUMBER (loc + 1, arg); } /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ /* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ static void store_op2 (op, loc, arg1, arg2) re_opcode_t op; US_CHAR_TYPE *loc; int arg1, arg2; { *loc = (US_CHAR_TYPE) op; STORE_NUMBER (loc + 1, arg1); STORE_NUMBER (loc + 1 + OFFSET_ADDRESS_SIZE, arg2); } /* Copy the bytes from LOC to END to open up three bytes of space at LOC for OP followed by two-byte integer parameter ARG. */ /* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ static void insert_op1 (op, loc, arg, end) re_opcode_t op; US_CHAR_TYPE *loc; int arg; US_CHAR_TYPE *end; { register US_CHAR_TYPE *pfrom = end; register US_CHAR_TYPE *pto = end + 1 + OFFSET_ADDRESS_SIZE; while (pfrom != loc) *--pto = *--pfrom; store_op1 (op, loc, arg); } /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ /* ifdef MBS_SUPPORT, integer parameter is 1 wchar_t. */ static void insert_op2 (op, loc, arg1, arg2, end) re_opcode_t op; US_CHAR_TYPE *loc; int arg1, arg2; US_CHAR_TYPE *end; { register US_CHAR_TYPE *pfrom = end; register US_CHAR_TYPE *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE; while (pfrom != loc) *--pto = *--pfrom; store_op2 (op, loc, arg1, arg2); } /* P points to just after a ^ in PATTERN. Return true if that ^ comes after an alternative or a begin-subexpression. We assume there is at least one character before the ^. */ static boolean at_begline_loc_p (pattern, p, syntax) const CHAR_TYPE *pattern, *p; reg_syntax_t syntax; { const CHAR_TYPE *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); } /* The dual of at_begline_loc_p. This one is for $. We assume there is at least one character after the $, i.e., `P < PEND'. */ static boolean at_endline_loc_p (p, pend, syntax) const CHAR_TYPE *p, *pend; reg_syntax_t syntax; { const CHAR_TYPE *next = p; boolean next_backslash = *next == '\\'; const CHAR_TYPE *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' : next_backslash && next_next && *next_next == ')') /* Before an alternative? */ || (syntax & RE_NO_BK_VBAR ? *next == '|' : next_backslash && next_next && *next_next == '|'); } /* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */ static boolean group_in_compile_stack (compile_stack, regnum) compile_stack_type compile_stack; regnum_t regnum; { int this_element; for (this_element = compile_stack.avail - 1; this_element >= 0; this_element--) if (compile_stack.stack[this_element].regnum == regnum) return true; return false; } #ifdef MBS_SUPPORT /* This insert space, which size is "num", into the pattern at "loc". "end" must point the end of the allocated buffer. */ static void insert_space (num, loc, end) int num; CHAR_TYPE *loc; CHAR_TYPE *end; { register CHAR_TYPE *pto = end; register CHAR_TYPE *pfrom = end - num; while (pfrom >= loc) *pto-- = *pfrom--; } #endif /* MBS_SUPPORT */ #ifdef MBS_SUPPORT static reg_errcode_t compile_range (range_start_char, p_ptr, pend, translate, syntax, b, char_set) CHAR_TYPE range_start_char; const CHAR_TYPE **p_ptr, *pend; CHAR_TYPE *char_set, *b; RE_TRANSLATE_TYPE translate; reg_syntax_t syntax; { const CHAR_TYPE *p = *p_ptr; CHAR_TYPE range_start, range_end; reg_errcode_t ret; # ifdef _LIBC uint32_t nrules; uint32_t start_val, end_val; # endif if (p == pend) return REG_ERANGE; # ifdef _LIBC nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); if (nrules != 0) { const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); const unsigned char *extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); if (range_start_char < -1) { /* range_start is a collating symbol. */ int32_t *wextra; /* Retreive the index and get collation sequence value. */ wextra = (int32_t*)(extra + char_set[-range_start_char]); start_val = wextra[1 + *wextra]; } else start_val = collseq_table_lookup(collseq, TRANSLATE(range_start_char)); end_val = collseq_table_lookup (collseq, TRANSLATE (p[0])); /* Report an error if the range is empty and the syntax prohibits this. */ ret = ((syntax & RE_NO_EMPTY_RANGES) && (start_val > end_val))? REG_ERANGE : REG_NOERROR; /* Insert space to the end of the char_ranges. */ insert_space(2, b - char_set[5] - 2, b - 1); *(b - char_set[5] - 2) = (wchar_t)start_val; *(b - char_set[5] - 1) = (wchar_t)end_val; char_set[4]++; /* ranges_index */ } else # endif { range_start = (range_start_char >= 0)? TRANSLATE (range_start_char): range_start_char; range_end = TRANSLATE (p[0]); /* Report an error if the range is empty and the syntax prohibits this. */ ret = ((syntax & RE_NO_EMPTY_RANGES) && (range_start > range_end))? REG_ERANGE : REG_NOERROR; /* Insert space to the end of the char_ranges. */ insert_space(2, b - char_set[5] - 2, b - 1); *(b - char_set[5] - 2) = range_start; *(b - char_set[5] - 1) = range_end; char_set[4]++; /* ranges_index */ } /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ (*p_ptr)++; return ret; } #else /* Read the ending character of a range (in a bracket expression) from the uncompiled pattern *P_PTR (which ends at PEND). We assume the starting character is in `P[-2]'. (`P[-1]' is the character `-'.) Then we set the translation of all bits between the starting and ending characters (inclusive) in the compiled pattern B. Return an error code. We use these short variable names so we can use the same macros as `regex_compile' itself. */ static reg_errcode_t compile_range (range_start_char, p_ptr, pend, translate, syntax, b) unsigned int range_start_char; const char **p_ptr, *pend; RE_TRANSLATE_TYPE translate; reg_syntax_t syntax; unsigned char *b; { unsigned this_char; const char *p = *p_ptr; reg_errcode_t ret; # if _LIBC const unsigned char *collseq; unsigned int start_colseq; unsigned int end_colseq; # else unsigned end_char; # endif if (p == pend) return REG_ERANGE; /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ (*p_ptr)++; /* Report an error if the range is empty and the syntax prohibits this. */ ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; # if _LIBC collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB); start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)]; end_colseq = collseq[(unsigned char) TRANSLATE (p[0])]; for (this_char = 0; this_char <= (unsigned char) -1; ++this_char) { unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)]; if (start_colseq <= this_colseq && this_colseq <= end_colseq) { SET_LIST_BIT (TRANSLATE (this_char)); ret = REG_NOERROR; } } # else /* Here we see why `this_char' has to be larger than an `unsigned char' -- we would otherwise go into an infinite loop, since all characters <= 0xff. */ range_start_char = TRANSLATE (range_start_char); /* TRANSLATE(p[0]) is casted to char (not unsigned char) in TRANSLATE, and some compilers cast it to int implicitly, so following for_loop may fall to (almost) infinite loop. e.g. If translate[p[0]] = 0xff, end_char may equals to 0xffffffff. To avoid this, we cast p[0] to unsigned int and truncate it. */ end_char = ((unsigned)TRANSLATE(p[0]) & ((1 << BYTEWIDTH) - 1)); for (this_char = range_start_char; this_char <= end_char; ++this_char) { SET_LIST_BIT (TRANSLATE (this_char)); ret = REG_NOERROR; } # endif return ret; } #endif /* MBS_SUPPORT */ /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible characters can start a string that matches the pattern. This fastmap is used by re_search to skip quickly over impossible starting points. The caller must supply the address of a (1 << BYTEWIDTH)-byte data area as BUFP->fastmap. We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in the pattern buffer. Returns 0 if we succeed, -2 if an internal error. */ #ifdef MBS_SUPPORT /* local function for re_compile_fastmap. truncate wchar_t character to char. */ static unsigned char truncate_wchar (CHAR_TYPE c); static unsigned char truncate_wchar (c) CHAR_TYPE c; { unsigned char buf[MB_LEN_MAX]; int retval = wctomb(buf, c); return retval > 0 ? buf[0] : (unsigned char)c; } #endif /* MBS_SUPPORT */ int re_compile_fastmap (bufp) struct re_pattern_buffer *bufp; { int j, k; #ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; #endif #ifndef REGEX_MALLOC char *destination; #endif register char *fastmap = bufp->fastmap; #ifdef MBS_SUPPORT /* We need to cast pattern to (wchar_t*), because we casted this compiled pattern to (char*) in regex_compile. */ US_CHAR_TYPE *pattern = (US_CHAR_TYPE*)bufp->buffer; register US_CHAR_TYPE *pend = (US_CHAR_TYPE*) (bufp->buffer + bufp->used); #else US_CHAR_TYPE *pattern = bufp->buffer; register US_CHAR_TYPE *pend = pattern + bufp->used; #endif /* MBS_SUPPORT */ US_CHAR_TYPE *p = pattern; #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* Assume that each path through the pattern can be null until proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't match the empty string. */ boolean path_can_be_null = true; /* We aren't doing a `succeed_n' to begin with. */ boolean succeed_n_p = false; assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; while (1) { if (p == pend || *p == succeed) { /* We have reached the (effective) end of pattern. */ if (!FAIL_STACK_EMPTY ()) { bufp->can_be_null |= path_can_be_null; /* Reset for next path. */ path_can_be_null = true; p = fail_stack.stack[--fail_stack.avail].pointer; continue; } else break; } /* We should never be about to go beyond the end of the pattern. */ assert (p < pend); switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* I guess the idea here is to simply not bother with a fastmap if a backreference is used, since it's too hard to figure out the fastmap for the corresponding group. Setting `can_be_null' stops `re_search_2' from using the fastmap, so that is all we do. */ case duplicate: bufp->can_be_null = 1; goto done; /* Following are the cases which match a character. These end with `break'. */ #ifdef MBS_SUPPORT case exactn: fastmap[truncate_wchar(p[1])] = 1; break; case exactn_bin: fastmap[p[1]] = 1; break; #else case exactn: fastmap[p[1]] = 1; break; #endif /* MBS_SUPPORT */ #ifdef MBS_SUPPORT /* It is hard to distinguish fastmap from (multi byte) characters which depends on current locale. */ case charset: case charset_not: case wordchar: case notwordchar: bufp->can_be_null = 1; goto done; #else case charset: for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) fastmap[j] = 1; break; case charset_not: /* Chars beyond end of map must be allowed. */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) fastmap[j] = 1; break; case wordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == Sword) fastmap[j] = 1; break; case notwordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != Sword) fastmap[j] = 1; break; #endif case anychar: { int fastmap_newline = fastmap['\n']; /* `.' matches anything ... */ for (j = 0; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; /* ... except perhaps newline. */ if (!(bufp->syntax & RE_DOT_NEWLINE)) fastmap['\n'] = fastmap_newline; /* Return if we have already set `can_be_null'; if we have, then the fastmap is irrelevant. Something's wrong here. */ else if (bufp->can_be_null) goto done; /* Otherwise, have to check alternative paths. */ break; } #ifdef emacs case syntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == (enum syntaxcode) k) fastmap[j] = 1; break; case notsyntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != (enum syntaxcode) k) fastmap[j] = 1; break; /* All cases after this match the empty string. These end with `continue'. */ case before_dot: case at_dot: case after_dot: continue; #endif /* emacs */ case no_op: case begline: case endline: case begbuf: case endbuf: case wordbound: case notwordbound: case wordbeg: case wordend: case push_dummy_failure: continue; case jump_n: case pop_failure_jump: case maybe_pop_jump: case jump: case jump_past_alt: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); p += j; if (j > 0) continue; /* Jump backward implies we just went through the body of a loop and matched nothing. Opcode jumped to should be `on_failure_jump' or `succeed_n'. Just treat it like an ordinary jump. For a * loop, it has pushed its failure point already; if so, discard that as redundant. */ if ((re_opcode_t) *p != on_failure_jump && (re_opcode_t) *p != succeed_n) continue; p++; EXTRACT_NUMBER_AND_INCR (j, p); p += j; /* If what's on the stack is where we are now, pop it. */ if (!FAIL_STACK_EMPTY () && fail_stack.stack[fail_stack.avail - 1].pointer == p) fail_stack.avail--; continue; case on_failure_jump: case on_failure_keep_string_jump: handle_on_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); /* For some patterns, e.g., `(a?)?', `p+j' here points to the end of the pattern. We don't want to push such a point, since when we restore it above, entering the switch will increment `p' past the end of the pattern. We don't need to push such a point since we obviously won't find any more fastmap entries beyond `pend'. Such a pattern can match the null string, though. */ if (p + j < pend) { if (!PUSH_PATTERN_OP (p + j, fail_stack)) { RESET_FAIL_STACK (); return -2; } } else bufp->can_be_null = 1; if (succeed_n_p) { EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ succeed_n_p = false; } continue; case succeed_n: /* Get to the number of times to succeed. */ p += OFFSET_ADDRESS_SIZE; /* Increment p past the n for when k != 0. */ EXTRACT_NUMBER_AND_INCR (k, p); if (k == 0) { p -= 2 * OFFSET_ADDRESS_SIZE; succeed_n_p = true; /* Spaghetti code alert. */ goto handle_on_failure_jump; } continue; case set_number_at: p += 2 * OFFSET_ADDRESS_SIZE; continue; case start_memory: case stop_memory: p += 2; continue; default: abort (); /* We have listed all the cases. */ } /* switch *p++ */ /* Getting here means we have found the possible starting characters for one path of the pattern -- and that the empty string does not match. We need not follow this path further. Instead, look at the next alternative (remembered on the stack), or quit if no more. The test at the top of the loop does these things. */ path_can_be_null = false; p = pend; } /* while p */ /* Set `can_be_null' for the last path (also the first path, if the pattern is empty). */ bufp->can_be_null |= path_can_be_null; done: RESET_FAIL_STACK (); return 0; } /* re_compile_fastmap */ #ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) #endif /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated using the malloc library routine, and must each be at least NUM_REGS * sizeof (regoff_t) bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ void re_set_registers (bufp, regs, num_regs, starts, ends) struct re_pattern_buffer *bufp; struct re_registers *regs; unsigned num_regs; regoff_t *starts, *ends; { if (num_regs) { bufp->regs_allocated = REGS_REALLOCATE; regs->num_regs = num_regs; regs->start = starts; regs->end = ends; } else { bufp->regs_allocated = REGS_UNALLOCATED; regs->num_regs = 0; regs->start = regs->end = (regoff_t *) 0; } } #ifdef _LIBC weak_alias (__re_set_registers, re_set_registers) #endif /* Searching routines. */ /* Like re_search_2, below, but only one string is specified, and doesn't let you say where to stop matching. */ int re_search (bufp, string, size, startpos, range, regs) struct re_pattern_buffer *bufp; const char *string; int size, startpos, range; struct re_registers *regs; { return re_search_2 (bufp, NULL, 0, string, size, startpos, range, regs, size); } #ifdef _LIBC weak_alias (__re_search, re_search) #endif /* Using the compiled pattern in BUFP->buffer, first tries to match the virtual concatenation of STRING1 and STRING2, starting first at index STARTPOS, then at STARTPOS + 1, and so on. STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. RANGE is how far to scan while trying to match. RANGE = 0 means try only at STARTPOS; in general, the last start tried is STARTPOS + RANGE. In REGS, return the indices of the virtual concatenation of STRING1 and STRING2 that matched the entire BUFP->buffer and its contained subexpressions. Do not consider matching one past the index STOP in the virtual concatenation of STRING1 and STRING2. We return either the position in the strings at which the match was found, -1 if no match, or -2 if error (such as failure stack overflow). */ int re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int startpos; int range; struct re_registers *regs; int stop; { int val; register char *fastmap = bufp->fastmap; register RE_TRANSLATE_TYPE translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) return -1; /* Fix up RANGE if it might eventually take us outside the virtual concatenation of STRING1 and STRING2. Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ if (endpos < 0) range = 0 - startpos; else if (endpos > total_size) range = total_size - startpos; /* If the search isn't to be a backwards one, don't waste time in a search for a pattern that must be anchored. */ if (bufp->used > 0 && range > 0 && ((re_opcode_t) bufp->buffer[0] == begbuf /* `begline' is like `begbuf' if it cannot match at newlines. */ || ((re_opcode_t) bufp->buffer[0] == begline && !bufp->newline_anchor))) { if (startpos > 0) return -1; else range = 1; } #ifdef emacs /* In a forward search for something that starts with \=. don't keep searching past point. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) { range = PT - startpos; if (range <= 0) return -1; } #endif /* emacs */ /* Update the fastmap now if not correct already. */ if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp) == -2) return -2; /* Loop through the string, looking for a place to start matching. */ for (;;) { /* If a fastmap is supplied, skip quickly over characters that cannot be the start of a match. If the pattern can match the null string, however, we don't need to skip characters; we want the first null string. */ if (fastmap && startpos < total_size && !bufp->can_be_null) { if (range > 0) /* Searching forwards. */ { register const char *d; register int lim = 0; int irange = range; if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); d = (startpos >= size1 ? string2 - size1 : string1) + startpos; /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) while (range > lim && !fastmap[(unsigned char) translate[(unsigned char) *d++]]) range--; else while (range > lim && !fastmap[(unsigned char) *d++]) range--; startpos += irange - range; } else /* Searching backwards. */ { register CHAR_TYPE c = (size1 == 0 || startpos >= size1 ? string2[startpos - size1] : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; } } /* If can't match the null string, and that's all we have left, fail. */ if (range >= 0 && startpos == total_size && fastmap && !bufp->can_be_null) return -1; val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop); #ifndef REGEX_MALLOC # ifdef C_ALLOCA alloca (0); # endif #endif if (val >= 0) return startpos; if (val == -2) return -2; advance: if (!range) break; else if (range > 0) { range--; startpos++; } else { range++; startpos--; } } return -1; } /* re_search_2 */ #ifdef _LIBC weak_alias (__re_search_2, re_search_2) #endif #ifdef MBS_SUPPORT /* This converts PTR, a pointer into one of the search wchar_t strings `string1' and `string2' into an multibyte string offset from the beginning of that string. We use mbs_offset to optimize. See convert_mbs_to_wcs. */ # define POINTER_TO_OFFSET(ptr) \ (FIRST_STRING_P (ptr) \ ? ((regoff_t)(mbs_offset1 != NULL? mbs_offset1[(ptr)-string1] : 0)) \ : ((regoff_t)((mbs_offset2 != NULL? mbs_offset2[(ptr)-string2] : 0) \ + csize1))) #else /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ # define POINTER_TO_OFFSET(ptr) \ (FIRST_STRING_P (ptr) \ ? ((regoff_t) ((ptr) - string1)) \ : ((regoff_t) ((ptr) - string2 + size1))) #endif /* MBS_SUPPORT */ /* Macros for dealing with the split strings in re_match_2. */ #define MATCHING_IN_FIRST_STRING (dend == end_match_1) /* Call before fetching a character with *d. This switches over to string2 if necessary. */ #define PREFETCH() \ while (d == dend) \ { \ /* End of string2 => fail. */ \ if (dend == end_match_2) \ goto fail; \ /* End of string1 => advance to string2. */ \ d = string2; \ dend = end_match_2; \ } /* Test if at very beginning or at very end of the virtual concatenation of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) #define AT_STRINGS_END(d) ((d) == end2) /* Test if D points to a character which is word-constituent. We have two special cases to check for: if past the end of string1, look at the first character in string2; and if before the beginning of string2, look at the last character in string1. */ #ifdef MBS_SUPPORT /* Use internationalized API instead of SYNTAX. */ # define WORDCHAR_P(d) \ (iswalnum ((wint_t)((d) == end1 ? *string2 \ : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0) #else # define WORDCHAR_P(d) \ (SYNTAX ((d) == end1 ? *string2 \ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) #endif /* MBS_SUPPORT */ /* Disabled due to a compiler bug -- see comment at case wordbound */ #if 0 /* Test if the character before D and the one at D differ with respect to being word-constituent. */ #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) #endif /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE # define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL # ifdef MBS_SUPPORT # define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR (regstart); \ FREE_VAR (regend); \ FREE_VAR (old_regstart); \ FREE_VAR (old_regend); \ FREE_VAR (best_regstart); \ FREE_VAR (best_regend); \ FREE_VAR (reg_info); \ FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ FREE_VAR (string1); \ FREE_VAR (string2); \ FREE_VAR (mbs_offset1); \ FREE_VAR (mbs_offset2); \ } while (0) # else /* not MBS_SUPPORT */ # define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR (regstart); \ FREE_VAR (regend); \ FREE_VAR (old_regstart); \ FREE_VAR (old_regend); \ FREE_VAR (best_regstart); \ FREE_VAR (best_regend); \ FREE_VAR (reg_info); \ FREE_VAR (reg_dummy); \ FREE_VAR (reg_info_dummy); \ } while (0) # endif /* MBS_SUPPORT */ #else # define FREE_VAR(var) if (var) free (var); var = NULL # ifdef MBS_SUPPORT # define FREE_VARIABLES() \ do { \ FREE_VAR (string1); \ FREE_VAR (string2); \ FREE_VAR (mbs_offset1); \ FREE_VAR (mbs_offset2); \ } while (0) # else # define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ # endif /* MBS_SUPPORT */ #endif /* not MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because we use only one byte in the pattern for the register number), we can use numbers larger than 255. They must differ by 1, because of NUM_FAILURE_ITEMS above. And the value for the lowest register must be larger than the value for the highest register, so we do not try to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) /* Matching routines. */ #ifndef emacs /* Emacs never uses this. */ /* re_match is like re_match_2 except it takes only a single string. */ int re_match (bufp, string, size, pos, regs) struct re_pattern_buffer *bufp; const char *string; int size, pos; struct re_registers *regs; { int result = re_match_2_internal (bufp, NULL, 0, string, size, pos, regs, size); # ifndef REGEX_MALLOC # ifdef C_ALLOCA alloca (0); # endif # endif return result; } # ifdef _LIBC weak_alias (__re_match, re_match) # endif #endif /* not emacs */ static boolean group_match_null_string_p _RE_ARGS ((US_CHAR_TYPE **p, US_CHAR_TYPE *end, register_info_type *reg_info)); static boolean alt_match_null_string_p _RE_ARGS ((US_CHAR_TYPE *p, US_CHAR_TYPE *end, register_info_type *reg_info)); static boolean common_op_match_null_string_p _RE_ARGS ((US_CHAR_TYPE **p, US_CHAR_TYPE *end, register_info_type *reg_info)); static int bcmp_translate _RE_ARGS ((const CHAR_TYPE *s1, const CHAR_TYPE *s2, int len, char *translate)); /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 and SIZE2, respectively). We start matching at POS, and stop matching at STOP. If REGS is non-null and the `no_sub' field of BUFP is nonzero, we store offsets for the substring each group matched in REGS. See the documentation for exactly how many groups we fill. We return -1 if no match, -2 if an internal error (such as the failure stack overflowing). Otherwise, we return the length of the matched substring. */ int re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; int pos; struct re_registers *regs; int stop; { int result = re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop); #ifndef REGEX_MALLOC # ifdef C_ALLOCA alloca (0); # endif #endif return result; } #ifdef _LIBC weak_alias (__re_match_2, re_match_2) #endif #ifdef MBS_SUPPORT static int count_mbs_length PARAMS ((int *, int)); /* This check the substring (from 0, to length) of the multibyte string, to which offset_buffer correspond. And count how many wchar_t_characters the substring occupy. We use offset_buffer to optimization. See convert_mbs_to_wcs. */ static int count_mbs_length(offset_buffer, length) int *offset_buffer; int length; { int wcs_size; /* Check whether the size is valid. */ if (length < 0) return -1; if (offset_buffer == NULL) return 0; for (wcs_size = 0 ; offset_buffer[wcs_size] != -1 ; wcs_size++) { if (offset_buffer[wcs_size] == length) return wcs_size; if (offset_buffer[wcs_size] > length) /* It is a fragment of a wide character. */ return -1; } /* We reached at the sentinel. */ return -1; } #endif /* MBS_SUPPORT */ /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int #ifdef MBS_SUPPORT re_match_2_internal (bufp, cstring1, csize1, cstring2, csize2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *cstring1, *cstring2; int csize1, csize2; #else re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; #endif int pos; struct re_registers *regs; int stop; { /* General temporaries. */ int mcnt; US_CHAR_TYPE *p1; #ifdef MBS_SUPPORT /* We need wchar_t* buffers correspond to string1, string2. */ CHAR_TYPE *string1 = NULL, *string2 = NULL; /* We need the size of wchar_t buffers correspond to csize1, csize2. */ int size1 = 0, size2 = 0; /* offset buffer for optimizatoin. See convert_mbs_to_wc. */ int *mbs_offset1 = NULL, *mbs_offset2 = NULL; /* They hold whether each wchar_t is binary data or not. */ char *is_binary = NULL; #endif /* MBS_SUPPORT */ /* Just past the end of the corresponding string. */ const CHAR_TYPE *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ const CHAR_TYPE *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ const CHAR_TYPE *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ #ifdef MBS_SUPPORT US_CHAR_TYPE *pattern, *p; register US_CHAR_TYPE *pend; #else US_CHAR_TYPE *p = bufp->buffer; register US_CHAR_TYPE *pend = p + bufp->used; #endif /* MBS_SUPPORT */ /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ US_CHAR_TYPE *just_past_start_mem = 0; /* We use this to map every character in the string. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of restart, regend, and reg_info for all registers corresponding to the subexpressions we're currently inside, plus the number of such registers, and, finally, two char *'s. The first char * is where to resume scanning the pattern; the second one is where to resume scanning the strings. If the latter is zero, the failure point is a ``dummy''; if a failure happens and the failure point is a dummy, it gets discarded and the next next one is tried. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ fail_stack_type fail_stack; #endif #ifdef DEBUG static unsigned failure_id; unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* We fill all the registers internally, independent of what we return, for use in backreferences. The number here includes an element for register zero. */ size_t num_regs = bufp->re_nsub + 1; /* The currently active registers. */ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG; active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG; /* Information on the contents of registers. These are pointers into the input strings; they record just what was matched (on this attempt) by a subexpression part of the pattern, that is, the regnum-th regstart pointer points to where in the pattern we began matching and the regnum-th regend points to right after where we stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const CHAR_TYPE **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to match anything, then the register for its start will need to be restored because it will have been set to wherever in the string we are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const CHAR_TYPE **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly nested) subexpressions we are currently in. The matched_something field of reg_info[reg_num] helps us tell whether or not we have matched any of the pattern so far this time through the reg_num-th subexpression. These two fields get reset each time through any loop their register is in. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ register_info_type *reg_info; #endif /* The following record the register info as found in the above variables when we find a match better than any we've seen before. This happens as we backtrack through the failure points, which in turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const CHAR_TYPE **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything else (see below). Also, we never need info about register 0 for any of the other register vectors, and it seems rather a kludge to treat `best_regend' differently than the rest. So we keep track of the end of the best match so far in a separate variable. We initialize this to NULL so that when we backtrack the first time and need to test it, it's not garbage. */ const CHAR_TYPE *match_end = NULL; /* This helps SET_REGS_MATCHED avoid doing redundant work. */ int set_regs_matched_done = 0; /* Used when we pop values we don't care about. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const CHAR_TYPE **reg_dummy; register_info_type *reg_info_dummy; #endif #ifdef DEBUG /* Counts the total number of registers pushed. */ unsigned num_regs_pushed = 0; #endif DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); INIT_FAIL_STACK (); #ifdef MATCH_MAY_ALLOCATE /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole pattern), even though we never use it, since it simplifies the array indexing. We should fix this. */ if (bufp->re_nsub) { regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); old_regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); old_regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); best_regstart = REGEX_TALLOC (num_regs, const CHAR_TYPE *); best_regend = REGEX_TALLOC (num_regs, const CHAR_TYPE *); reg_info = REGEX_TALLOC (num_regs, register_info_type); reg_dummy = REGEX_TALLOC (num_regs, const CHAR_TYPE *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info && best_regstart && best_regend && reg_dummy && reg_info_dummy)) { FREE_VARIABLES (); return -2; } } else { /* We must initialize all our variables to NULL, so that `FREE_VARIABLES' doesn't try to free them. */ regstart = regend = old_regstart = old_regend = best_regstart = best_regend = reg_dummy = NULL; reg_info = reg_info_dummy = (register_info_type *) NULL; } #endif /* MATCH_MAY_ALLOCATE */ /* The starting position is bogus. */ #ifdef MBS_SUPPORT if (pos < 0 || pos > csize1 + csize2) #else if (pos < 0 || pos > size1 + size2) #endif { FREE_VARIABLES (); return -1; } #ifdef MBS_SUPPORT /* Allocate wchar_t array for string1 and string2 and fill them with converted string. */ if (csize1 != 0) { string1 = REGEX_TALLOC (csize1 + 1, CHAR_TYPE); mbs_offset1 = REGEX_TALLOC (csize1 + 1, int); is_binary = REGEX_TALLOC (csize1 + 1, char); if (!string1 || !mbs_offset1 || !is_binary) { FREE_VAR (string1); FREE_VAR (mbs_offset1); FREE_VAR (is_binary); return -2; } size1 = convert_mbs_to_wcs(string1, cstring1, csize1, mbs_offset1, is_binary); string1[size1] = L'\0'; /* for a sentinel */ FREE_VAR (is_binary); } if (csize2 != 0) { string2 = REGEX_TALLOC (csize2 + 1, CHAR_TYPE); mbs_offset2 = REGEX_TALLOC (csize2 + 1, int); is_binary = REGEX_TALLOC (csize2 + 1, char); if (!string2 || !mbs_offset2 || !is_binary) { FREE_VAR (string1); FREE_VAR (mbs_offset1); FREE_VAR (string2); FREE_VAR (mbs_offset2); FREE_VAR (is_binary); return -2; } size2 = convert_mbs_to_wcs(string2, cstring2, csize2, mbs_offset2, is_binary); string2[size2] = L'\0'; /* for a sentinel */ FREE_VAR (is_binary); } /* We need to cast pattern to (wchar_t*), because we casted this compiled pattern to (char*) in regex_compile. */ p = pattern = (CHAR_TYPE*)bufp->buffer; pend = (CHAR_TYPE*)(bufp->buffer + bufp->used); #endif /* MBS_SUPPORT */ /* Initialize subexpression text positions to -1 to mark ones that no start_memory/stop_memory has been seen for. Also initialize the register information struct. */ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = regend[mcnt] = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; IS_ACTIVE (reg_info[mcnt]) = 0; MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) { string2 = string1; size2 = size1; string1 = 0; size1 = 0; } end1 = string1 + size1; end2 = string2 + size2; /* Compute where to stop matching, within the two strings. */ #ifdef MBS_SUPPORT if (stop <= csize1) { mcnt = count_mbs_length(mbs_offset1, stop); end_match_1 = string1 + mcnt; end_match_2 = string2; } else { end_match_1 = end1; mcnt = count_mbs_length(mbs_offset2, stop-csize1); end_match_2 = string2 + mcnt; } if (mcnt < 0) { /* count_mbs_length return error. */ FREE_VARIABLES (); return -1; } #else if (stop <= size1) { end_match_1 = string1 + stop; end_match_2 = string2; } else { end_match_1 = end1; end_match_2 = string2 + stop - size1; } #endif /* MBS_SUPPORT */ /* `p' scans through the pattern as `d' scans through the data. `dend' is the end of the input string that `d' points within. `d' is advanced into the following input string whenever necessary, but this happens before fetching; therefore, at the beginning of the loop, `d' can be pointing at the end of a string, but it cannot equal `string2'. */ #ifdef MBS_SUPPORT if (size1 > 0 && pos <= csize1) { mcnt = count_mbs_length(mbs_offset1, pos); d = string1 + mcnt; dend = end_match_1; } else { mcnt = count_mbs_length(mbs_offset2, pos-csize1); d = string2 + mcnt; dend = end_match_2; } if (mcnt < 0) { /* count_mbs_length return error. */ FREE_VARIABLES (); return -1; } #else if (size1 > 0 && pos <= size1) { d = string1 + pos; dend = end_match_1; } else { d = string2 + pos - size1; dend = end_match_2; } #endif /* MBS_SUPPORT */ DEBUG_PRINT1 ("The compiled pattern is:\n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); DEBUG_PRINT1 ("'\n"); /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match fails at this starting point in the input data. */ for (;;) { #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif if (p == pend) { /* End of pattern means we might have succeeded. */ DEBUG_PRINT1 ("end of pattern ... "); /* If we haven't matched the entire string, and we want the longest match, try backtracking. */ if (d != end_match_2) { /* 1 if this match ends in the same string (string1 or string2) as the best previous match. */ boolean same_str_p = (FIRST_STRING_P (match_end) == MATCHING_IN_FIRST_STRING); /* 1 if this match is the best seen so far. */ boolean best_match_p; /* AIX compiler got confused when this was combined with the previous declaration. */ if (same_str_p) best_match_p = d > match_end; else best_match_p = !MATCHING_IN_FIRST_STRING; DEBUG_PRINT1 ("backtracking.\n"); if (!FAIL_STACK_EMPTY ()) { /* More failure points to try. */ /* If exceeds best match so far, save it. */ if (!best_regs_set || best_match_p) { best_regs_set = true; match_end = d; DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { best_regstart[mcnt] = regstart[mcnt]; best_regend[mcnt] = regend[mcnt]; } } goto fail; } /* If no failure points, don't restore garbage. And if last match is real best match, don't restore second best one. */ else if (best_regs_set && !best_match_p) { restore_best_regs: /* Restore best match. It may happen that `dend == end_match_1' while the restored d is in string2. For example, the pattern `x.*y.*z' against the strings `x-' and `y-z-', if the two strings are not consecutive in memory. */ DEBUG_PRINT1 ("Restoring best registers.\n"); d = match_end; dend = ((d >= string1 && d <= end1) ? end_match_1 : end_match_2); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = best_regstart[mcnt]; regend[mcnt] = best_regend[mcnt]; } } } /* d != end_match_2 */ succeed_label: DEBUG_PRINT1 ("Accepting match.\n"); /* If caller wants register contents data back, do it. */ if (regs && !bufp->no_sub) { /* Have the register data arrays been allocated? */ if (bufp->regs_allocated == REGS_UNALLOCATED) { /* No. So allocate them with malloc. We need one extra element beyond `num_regs' for the `-1' marker GNU code uses. */ regs->num_regs = MAX (RE_NREGS, num_regs + 1); regs->start = TALLOC (regs->num_regs, regoff_t); regs->end = TALLOC (regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } bufp->regs_allocated = REGS_REALLOCATE; } else if (bufp->regs_allocated == REGS_REALLOCATE) { /* Yes. If we need more elements than were already allocated, reallocate them. If we need fewer, just leave it alone. */ if (regs->num_regs < num_regs + 1) { regs->num_regs = num_regs + 1; RETALLOC (regs->start, regs->num_regs, regoff_t); RETALLOC (regs->end, regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } } } else { /* These braces fend off a "empty body in an else-statement" warning under GCC when assert expands to nothing. */ assert (bufp->regs_allocated == REGS_FIXED); } /* Convert the pointer data in `regstart' and `regend' to indices. Register zero has to be set differently, since we haven't kept track of any info for it. */ if (regs->num_regs > 0) { regs->start[0] = pos; #ifdef MBS_SUPPORT if (MATCHING_IN_FIRST_STRING) regs->end[0] = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0; else regs->end[0] = csize1 + (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0); #else regs->end[0] = (MATCHING_IN_FIRST_STRING ? ((regoff_t) (d - string1)) : ((regoff_t) (d - string2 + size1))); #endif /* MBS_SUPPORT */ } /* Go through the first `min (num_regs, regs->num_regs)' registers, since that is all we initialized. */ for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs); mcnt++) { if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) regs->start[mcnt] = regs->end[mcnt] = -1; else { regs->start[mcnt] = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); regs->end[mcnt] = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); } } /* If the regs structure we return has more elements than were in the pattern, set the extra elements to -1. If we (re)allocated the registers, this is the case, because we always allocate enough to have at least one -1 at the end. */ for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++) regs->start[mcnt] = regs->end[mcnt] = -1; } /* regs && !bufp->no_sub */ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", nfailure_points_pushed, nfailure_points_popped, nfailure_points_pushed - nfailure_points_popped); DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); #ifdef MBS_SUPPORT if (MATCHING_IN_FIRST_STRING) mcnt = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0; else mcnt = (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0) + csize1; mcnt -= pos; #else mcnt = d - pos - (MATCHING_IN_FIRST_STRING ? string1 : string2 - size1); #endif /* MBS_SUPPORT */ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); FREE_VARIABLES (); return mcnt; } /* Otherwise match next pattern command. */ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* Ignore these. Used to ignore the n of succeed_n's which currently have n == 0. */ case no_op: DEBUG_PRINT1 ("EXECUTING no_op.\n"); break; case succeed: DEBUG_PRINT1 ("EXECUTING succeed.\n"); goto succeed_label; /* Match the next n pattern characters exactly. The following byte in the pattern defines n, and the n bytes after that are the characters to match. */ case exactn: #ifdef MBS_SUPPORT case exactn_bin: #endif mcnt = *p++; DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); /* This is written out as an if-else so we don't waste time testing `translate' inside the loop. */ if (translate) { do { PREFETCH (); #ifdef MBS_SUPPORT if (*d <= 0xff) { if ((US_CHAR_TYPE) translate[(unsigned char) *d++] != (US_CHAR_TYPE) *p++) goto fail; } else { if (*d++ != (CHAR_TYPE) *p++) goto fail; } #else if ((US_CHAR_TYPE) translate[(unsigned char) *d++] != (US_CHAR_TYPE) *p++) goto fail; #endif /* MBS_SUPPORT */ } while (--mcnt); } else { do { PREFETCH (); if (*d++ != (CHAR_TYPE) *p++) goto fail; } while (--mcnt); } SET_REGS_MATCHED (); break; /* Match any character except possibly a newline or a null. */ case anychar: DEBUG_PRINT1 ("EXECUTING anychar.\n"); PREFETCH (); if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) goto fail; SET_REGS_MATCHED (); DEBUG_PRINT2 (" Matched `%ld'.\n", (long int) *d); d++; break; case charset: case charset_not: { register US_CHAR_TYPE c; #ifdef MBS_SUPPORT unsigned int i, char_class_length, coll_symbol_length, equiv_class_length, ranges_length, chars_length, length; CHAR_TYPE *workp, *workp2, *charset_top; #define WORK_BUFFER_SIZE 128 CHAR_TYPE str_buf[WORK_BUFFER_SIZE]; # ifdef _LIBC uint32_t nrules; # endif /* _LIBC */ #endif /* MBS_SUPPORT */ boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ #ifdef MBS_SUPPORT # ifdef _LIBC nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); # endif /* _LIBC */ charset_top = p - 1; char_class_length = *p++; coll_symbol_length = *p++; equiv_class_length = *p++; ranges_length = *p++; chars_length = *p++; /* p points charset[6], so the address of the next instruction (charset[l+m+n+2o+k+p']) equals p[l+m+n+2*o+p'], where l=length of char_classes, m=length of collating_symbol, n=equivalence_class, o=length of char_range, p'=length of character. */ workp = p; /* Update p to indicate the next instruction. */ p += char_class_length + coll_symbol_length+ equiv_class_length + 2*ranges_length + chars_length; /* match with char_class? */ for (i = 0; i < char_class_length ; i += CHAR_CLASS_SIZE) { wctype_t wctype; uintptr_t alignedp = ((uintptr_t)workp + __alignof__(wctype_t) - 1) & ~(uintptr_t)(__alignof__(wctype_t) - 1); wctype = *((wctype_t*)alignedp); workp += CHAR_CLASS_SIZE; if (iswctype((wint_t)c, wctype)) goto char_set_matched; } /* match with collating_symbol? */ # ifdef _LIBC if (nrules != 0) { const unsigned char *extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); for (workp2 = workp + coll_symbol_length ; workp < workp2 ; workp++) { int32_t *wextra; wextra = (int32_t*)(extra + *workp++); for (i = 0; i < *wextra; ++i) if (TRANSLATE(d[i]) != wextra[1 + i]) break; if (i == *wextra) { /* Update d, however d will be incremented at char_set_matched:, we decrement d here. */ d += i - 1; goto char_set_matched; } } } else /* (nrules == 0) */ # endif /* If we can't look up collation data, we use wcscoll instead. */ { for (workp2 = workp + coll_symbol_length ; workp < workp2 ;) { const CHAR_TYPE *backup_d = d, *backup_dend = dend; length = wcslen(workp); /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ if (wcscoll(workp, d) > 0) { workp += length + 1; continue; } /* First, we compare the collating symbol with the first character of the string. If it don't match, we add the next character to the compare buffer in turn. */ for (i = 0 ; i < WORK_BUFFER_SIZE-1 ; i++, d++) { int match; if (d == dend) { if (dend == end_match_2) break; d = string2; dend = end_match_2; } /* add next character to the compare buffer. */ str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; match = wcscoll(workp, str_buf); if (match == 0) goto char_set_matched; if (match < 0) /* (str_buf > workp) indicate (str_buf + X > workp), because for all X (str_buf + X > str_buf). So we don't need continue this loop. */ break; /* Otherwise(str_buf < workp), (str_buf+next_character) may equals (workp). So we continue this loop. */ } /* not matched */ d = backup_d; dend = backup_dend; workp += length + 1; } } /* match with equivalence_class? */ # ifdef _LIBC if (nrules != 0) { const CHAR_TYPE *backup_d = d, *backup_dend = dend; /* Try to match the equivalence class against those known to the collate implementation. */ const int32_t *table; const int32_t *weights; const int32_t *extra; const int32_t *indirect; int32_t idx, idx2; wint_t *cp; size_t len; /* This #include defines a local function! */ # include table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); weights = (const wint_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); extra = (const wint_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); /* Write 1 collating element to str_buf, and get its index. */ idx2 = 0; for (i = 0 ; idx2 == 0 && i < WORK_BUFFER_SIZE - 1; i++) { cp = (wint_t*)str_buf; if (d == dend) { if (dend == end_match_2) break; d = string2; dend = end_match_2; } str_buf[i] = TRANSLATE(*(d+i)); str_buf[i+1] = '\0'; /* sentinel */ idx2 = findidx ((const wint_t**)&cp); } /* Update d, however d will be incremented at char_set_matched:, we decrement d here. */ d = backup_d + ((wchar_t*)cp - (wchar_t*)str_buf - 1); if (d >= dend) { if (dend == end_match_2) d = dend; else { d = string2; dend = end_match_2; } } len = weights[idx2]; for (workp2 = workp + equiv_class_length ; workp < workp2 ; workp++) { idx = (int32_t)*workp; /* We already checked idx != 0 in regex_compile. */ if (idx2 != 0 && len == weights[idx]) { int cnt = 0; while (cnt < len && (weights[idx + 1 + cnt] == weights[idx2 + 1 + cnt])) ++cnt; if (cnt == len) goto char_set_matched; } } /* not matched */ d = backup_d; dend = backup_dend; } else /* (nrules == 0) */ # endif /* If we can't look up collation data, we use wcscoll instead. */ { for (workp2 = workp + equiv_class_length ; workp < workp2 ;) { const CHAR_TYPE *backup_d = d, *backup_dend = dend; length = wcslen(workp); /* If wcscoll(the collating symbol, whole string) > 0, any substring of the string never match with the collating symbol. */ if (wcscoll(workp, d) > 0) { workp += length + 1; break; } /* First, we compare the equivalence class with the first character of the string. If it don't match, we add the next character to the compare buffer in turn. */ for (i = 0 ; i < WORK_BUFFER_SIZE - 1 ; i++, d++) { int match; if (d == dend) { if (dend == end_match_2) break; d = string2; dend = end_match_2; } /* add next character to the compare buffer. */ str_buf[i] = TRANSLATE(*d); str_buf[i+1] = '\0'; match = wcscoll(workp, str_buf); if (match == 0) goto char_set_matched; if (match < 0) /* (str_buf > workp) indicate (str_buf + X > workp), because for all X (str_buf + X > str_buf). So we don't need continue this loop. */ break; /* Otherwise(str_buf < workp), (str_buf+next_character) may equals (workp). So we continue this loop. */ } /* not matched */ d = backup_d; dend = backup_dend; workp += length + 1; } } /* match with char_range? */ #ifdef _LIBC if (nrules != 0) { uint32_t collseqval; const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); collseqval = collseq_table_lookup (collseq, c); for (; workp < p - chars_length ;) { uint32_t start_val, end_val; /* We already compute the collation sequence value of the characters (or collating symbols). */ start_val = (uint32_t) *workp++; /* range_start */ end_val = (uint32_t) *workp++; /* range_end */ if (start_val <= collseqval && collseqval <= end_val) goto char_set_matched; } } else #endif { /* We set range_start_char at str_buf[0], range_end_char at str_buf[4], and compared char at str_buf[2]. */ str_buf[1] = 0; str_buf[2] = c; str_buf[3] = 0; str_buf[5] = 0; for (; workp < p - chars_length ;) { wchar_t *range_start_char, *range_end_char; /* match if (range_start_char <= c <= range_end_char). */ /* If range_start(or end) < 0, we assume -range_start(end) is the offset of the collating symbol which is specified as the character of the range start(end). */ /* range_start */ if (*workp < 0) range_start_char = charset_top - (*workp++); else { str_buf[0] = *workp++; range_start_char = str_buf; } /* range_end */ if (*workp < 0) range_end_char = charset_top - (*workp++); else { str_buf[4] = *workp++; range_end_char = str_buf + 4; } if (wcscoll(range_start_char, str_buf+2) <= 0 && wcscoll(str_buf+2, range_end_char) <= 0) goto char_set_matched; } } /* match with char? */ for (; workp < p ; workp++) if (c == *workp) goto char_set_matched; not = !not; char_set_matched: if (not) goto fail; #else /* Cast to `unsigned' instead of `unsigned char' in case the bit list is a full 32 bytes long. */ if (c < (unsigned) (*p * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; p += 1 + *p; if (!not) goto fail; #undef WORK_BUFFER_SIZE #endif /* MBS_SUPPORT */ SET_REGS_MATCHED (); d++; break; } /* The beginning of a group is represented by start_memory. The arguments are the register number in the next byte, and the number of groups inner to this one in the next. The text matched within the group is recorded (in the internal registers data structure) under the register number. */ case start_memory: DEBUG_PRINT3 ("EXECUTING start_memory %ld (%ld):\n", (long int) *p, (long int) p[1]); /* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[*p]) = group_match_null_string_p (&p1, pend, reg_info); /* Save the position in the string where we were the last time we were at this open-group operator in case the group is operated upon by a repetition operator, e.g., with `(a*)*b' against `ab'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regstart[*p]) ? d : regstart[*p] : regstart[*p]; DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p])); regstart[*p] = d; DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); IS_ACTIVE (reg_info[*p]) = 1; MATCHED_SOMETHING (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* This is the new highest active register. */ highest_active_reg = *p; /* If nothing was active before, this is the new lowest active register. */ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *p; /* Move past the register number and inner group count. */ p += 2; just_past_start_mem = p; break; /* The stop_memory opcode represents the end of a group. Its arguments are the same as start_memory's: the register number, and the number of inner groups. */ case stop_memory: DEBUG_PRINT3 ("EXECUTING stop_memory %ld (%ld):\n", (long int) *p, (long int) p[1]); /* We need to save the string position the last time we were at this close-group operator in case the group is operated upon by a repetition operator, e.g., with `((a*)*(b*)*)*' against `aba'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p])); regend[*p] = d; DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); /* This register isn't active anymore. */ IS_ACTIVE (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* If this was the only register active, nothing is active anymore. */ if (lowest_active_reg == highest_active_reg) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else { /* We must scan for the new highest active register, since it isn't necessarily one less than now: consider (a(b)c(d(e)f)g). When group 3 ends, after the f), the new highest active register is 1. */ US_CHAR_TYPE r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; /* If we end up at register zero, that means that we saved the registers as the result of an `on_failure_jump', not a `start_memory', and we jumped to past the innermost `stop_memory'. For example, in ((.)*) we save registers 1 and 2 as a result of the *, but when we pop back to the second ), we are at the stop_memory 1. Thus, nothing is active. */ if (r == 0) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else highest_active_reg = r; } /* If just failed to match something this time around with a group that's operated on by a repetition operator, try to force exit from the ``loop'', and restore the register information for this group that we had before trying this last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) || just_past_start_mem == p - 1) && (p + 2) < pend) { boolean is_a_jump_n = false; p1 = p + 2; mcnt = 0; switch ((re_opcode_t) *p1++) { case jump_n: is_a_jump_n = true; case pop_failure_jump: case maybe_pop_jump: case jump: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) p1 += OFFSET_ADDRESS_SIZE; break; default: /* do nothing */ ; } p1 += mcnt; /* If the next operation is a jump backwards in the pattern to an on_failure_jump right before the start_memory corresponding to this stop_memory, exit from the loop by forcing a failure after pushing on the stack the on_failure_jump's jump in the pattern, and d. */ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump && (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == start_memory && p1[2+OFFSET_ADDRESS_SIZE] == *p) { /* If this group ever matched anything, then restore what its registers were before trying this last failed match, e.g., with `(a*)*b' against `ab' for regstart[1], and, e.g., with `((a*)*(b*)*)*' against `aba' for regend[3]. Also restore the registers for inner groups for, e.g., `((a*)(b*))*' against `aba' (register 3 would otherwise get trashed). */ if (EVER_MATCHED_SOMETHING (reg_info[*p])) { unsigned r; EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; /* Restore this and inner groups' (if any) registers. */ for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1); r++) { regstart[r] = old_regstart[r]; /* xx why this test? */ if (old_regend[r] >= regstart[r]) regend[r] = old_regend[r]; } } p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); PUSH_FAILURE_POINT (p1 + mcnt, d, -2); goto fail; } } /* Move past the register number and the inner group count. */ p += 2; break; /* \ has been turned into a `duplicate' command which is followed by the numeric value of as the register number. */ case duplicate: { register const CHAR_TYPE *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); /* Can't back reference a group which we've never matched. */ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) goto fail; /* Where in input to try to start matching. */ d2 = regstart[regno]; /* Where to stop matching; if both the place to start and the place to stop matching are in the same string, then set to the place to stop, otherwise, for now have to use the end of the first string. */ dend2 = ((FIRST_STRING_P (regstart[regno]) == FIRST_STRING_P (regend[regno])) ? regend[regno] : end_match_1); for (;;) { /* If necessary, advance to next segment in register contents. */ while (d2 == dend2) { if (dend2 == end_match_2) break; if (dend2 == regend[regno]) break; /* End of string1 => advance to string2. */ d2 = string2; dend2 = regend[regno]; } /* At end of register contents => success */ if (d2 == dend2) break; /* If necessary, advance to next segment in data. */ PREFETCH (); /* How many characters left in this segment to match. */ mcnt = dend - d; /* Want how many consecutive characters we can match in one shot, so, if necessary, adjust the count. */ if (mcnt > dend2 - d2) mcnt = dend2 - d2; /* Compare that many; failure if mismatch, else move past them. */ if (translate ? bcmp_translate (d, d2, mcnt, translate) : memcmp (d, d2, mcnt*sizeof(US_CHAR_TYPE))) goto fail; d += mcnt, d2 += mcnt; /* Do this because we've match some characters. */ SET_REGS_MATCHED (); } } break; /* begline matches the empty string at the beginning of the string (unless `not_bol' is set in `bufp'), and, if `newline_anchor' is set, after newlines. */ case begline: DEBUG_PRINT1 ("EXECUTING begline.\n"); if (AT_STRINGS_BEG (d)) { if (!bufp->not_bol) break; } else if (d[-1] == '\n' && bufp->newline_anchor) { break; } /* In all other cases, we fail. */ goto fail; /* endline is the dual of begline. */ case endline: DEBUG_PRINT1 ("EXECUTING endline.\n"); if (AT_STRINGS_END (d)) { if (!bufp->not_eol) break; } /* We have to ``prefetch'' the next character. */ else if ((d == end1 ? *string2 : *d) == '\n' && bufp->newline_anchor) { break; } goto fail; /* Match at the very beginning of the data. */ case begbuf: DEBUG_PRINT1 ("EXECUTING begbuf.\n"); if (AT_STRINGS_BEG (d)) break; goto fail; /* Match at the very end of the data. */ case endbuf: DEBUG_PRINT1 ("EXECUTING endbuf.\n"); if (AT_STRINGS_END (d)) break; goto fail; /* on_failure_keep_string_jump is used to optimize `.*\n'. It pushes NULL as the value for the string on the stack. Then `pop_failure_point' will keep the current value for the string, instead of restoring it. To see why, consider matching `foo\nbar' against `.*\n'. The .* matches the foo; then the . fails against the \n. But the next thing we want to do is match the \n against the \n; if we restored the string value, we would be back at the foo. Because this is used only in specific cases, we don't need to check all the things that `on_failure_jump' does, to make sure the right things get saved on the stack. Hence we don't share its code. The only reason to push anything on the stack at all is that otherwise we would have to change `anychar's code to do something besides goto fail in this case; that seems worse than this. */ case on_failure_keep_string_jump: DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); #endif PUSH_FAILURE_POINT (p + mcnt, NULL, -2); break; /* Uses of on_failure_jump: Each alternative starts with an on_failure_jump that points to the beginning of the next alternative. Each alternative except the last ends with a jump that in effect jumps past the rest of the alternatives. (They really jump to the ending jump of the following alternative, because tensioning these jumps is a hassle.) Repeats start with an on_failure_jump that points past both the repetition text and either the following jump or pop_failure_jump back to this on_failure_jump. */ case on_failure_jump: on_failure: DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); #endif /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information for that group and all inner ones, so that if we fail back to this point, the group's information will be correct. For example, in \(a*\)*\1, we need the preceding group, and in \(zz\(a*\)b*\)\2, we need the inner group. */ /* We can't use `p' to check ahead because we push a failure point to `p + mcnt' after we do this. */ p1 = p; /* We need to skip no_op's before we look for the start_memory in case this on_failure_jump is happening as the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 against aba. */ while (p1 < pend && (re_opcode_t) *p1 == no_op) p1++; if (p1 < pend && (re_opcode_t) *p1 == start_memory) { /* We have a new highest active register now. This will get reset at the start_memory we are about to get to, but we will have saved all the registers relevant to this repetition op, as described above. */ highest_active_reg = *(p1 + 1) + *(p1 + 2); if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *(p1 + 1); } DEBUG_PRINT1 (":\n"); PUSH_FAILURE_POINT (p + mcnt, d, -2); break; /* A smart repeat ends with `maybe_pop_jump'. We change it to either `pop_failure_jump' or `jump'. */ case maybe_pop_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); { register US_CHAR_TYPE *p2 = p; /* Compare the beginning of the repeat with what in the pattern follows its end. If we can establish that there is nothing that they would both match, i.e., that we would have to backtrack because of (as in, e.g., `a*a') then we can change to pop_failure_jump, because we'll never have to backtrack. This is not true in the case of alternatives: in `(a|ab)*' we do need to backtrack to the `ab' alternative (e.g., if the string was `ab'). But instead of trying to detect that here, the alternative has put on a dummy failure point which is what we will end up popping. */ /* Skip over open/close-group commands. If what follows this loop is a ...+ construct, look at what begins its body, since we will have to match at least one of that. */ while (1) { if (p2 + 2 < pend && ((re_opcode_t) *p2 == stop_memory || (re_opcode_t) *p2 == start_memory)) p2 += 3; else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend && (re_opcode_t) *p2 == dummy_failure_jump) p2 += 2 + 2 * OFFSET_ADDRESS_SIZE; else break; } p1 = p + mcnt; /* p1[0] ... p1[2] are the `on_failure_jump' corresponding to the `maybe_finalize_jump' of this case. Examine what follows. */ /* If we're at the end of the pattern, we can change. */ if (p2 == pend) { /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code yet. */ p[-(1+OFFSET_ADDRESS_SIZE)] = (US_CHAR_TYPE) pop_failure_jump; DEBUG_PRINT1 (" End of pattern: change to `pop_failure_jump'.\n"); } else if ((re_opcode_t) *p2 == exactn #ifdef MBS_SUPPORT || (re_opcode_t) *p2 == exactn_bin #endif || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { register US_CHAR_TYPE c = *p2 == (US_CHAR_TYPE) endline ? '\n' : p2[2]; if (((re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn #ifdef MBS_SUPPORT || (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn_bin #endif ) && p1[3+OFFSET_ADDRESS_SIZE] != c) { p[-(1+OFFSET_ADDRESS_SIZE)] = (US_CHAR_TYPE) pop_failure_jump; #ifdef MBS_SUPPORT if (MB_CUR_MAX != 1) DEBUG_PRINT3 (" %C != %C => pop_failure_jump.\n", (wint_t) c, (wint_t) p1[3+OFFSET_ADDRESS_SIZE]); else #endif DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", (char) c, (char) p1[3+OFFSET_ADDRESS_SIZE]); } #ifndef MBS_SUPPORT else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { int not = (re_opcode_t) p1[3] == charset_not; if (c < (unsigned) (p1[4] * BYTEWIDTH) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; /* `not' is equal to 1 if c would match, which means that we can't change to pop_failure_jump. */ if (!not) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } #endif /* not MBS_SUPPORT */ } #ifndef MBS_SUPPORT else if ((re_opcode_t) *p2 == charset) { /* We win if the first character of the loop is not part of the charset. */ if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] && (p2[2 + p1[5] / BYTEWIDTH] & (1 << (p1[5] % BYTEWIDTH))))) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } else if ((re_opcode_t) p1[3] == charset_not) { int idx; /* We win if the charset_not inside the loop lists every character listed in the charset after. */ for (idx = 0; idx < (int) p2[1]; idx++) if (! (p2[2 + idx] == 0 || (idx < (int) p1[4] && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) break; if (idx == p2[1]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } else if ((re_opcode_t) p1[3] == charset) { int idx; /* We win if the charset inside the loop has no overlap with the one after the loop. */ for (idx = 0; idx < (int) p2[1] && idx < (int) p1[4]; idx++) if ((p2[2 + idx] & p1[5 + idx]) != 0) break; if (idx == p2[1] || idx == p1[4]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } } #endif /* not MBS_SUPPORT */ } p -= OFFSET_ADDRESS_SIZE; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { p[-1] = (US_CHAR_TYPE) jump; DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } /* Note fall through. */ /* The end of a simple repeat has a pop_failure_jump back to its matching on_failure_jump, where the latter will push a failure point. The pop_failure_jump takes off failure points put on by this pop_failure_jump's matching on_failure_jump; we got through the pattern to here from the matching on_failure_jump, so didn't fail. */ case pop_failure_jump: { /* We need to pass separate storage for the lowest and highest registers, even though we don't care about the actual values. Otherwise, we will restore only one register from the stack, since lowest will == highest in `pop_failure_point'. */ active_reg_t dummy_low_reg, dummy_high_reg; US_CHAR_TYPE *pdummy = NULL; const CHAR_TYPE *sdummy = NULL; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); } /* Note fall through. */ unconditional_jump: #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif /* Note fall through. */ /* Unconditionally jump (without popping any failure points). */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ #ifdef _LIBC DEBUG_PRINT2 ("(to %p).\n", p); #else DEBUG_PRINT2 ("(to 0x%x).\n", p); #endif break; /* We need this opcode so we can detect where alternatives end in `group_match_null_string_p' et al. */ case jump_past_alt: DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); goto unconditional_jump; /* Normally, the on_failure_jump pushes a failure point, which then gets popped at pop_failure_jump. We will end up at pop_failure_jump, also, and with a pattern of, say, `a+', we are skipping over the on_failure_jump, so we have to push something meaningless for pop_failure_jump to pop. */ case dummy_failure_jump: DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); /* It doesn't matter what we push for the string here. What the code at `fail' tests is the value for the pattern. */ PUSH_FAILURE_POINT (NULL, NULL, -2); goto unconditional_jump; /* At the end of an alternative, we need to push a dummy failure point in case we are followed by a `pop_failure_jump', because we don't want the failure point for the alternative to be popped. For example, matching `(a|ab)*' against `aab' requires that we match the `ab' alternative. */ case push_dummy_failure: DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); /* See comments just above at `dummy_failure_jump' about the two zeroes. */ PUSH_FAILURE_POINT (NULL, NULL, -2); break; /* Have to succeed matching what follows at least n times. After that, handle like `on_failure_jump'. */ case succeed_n: EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); assert (mcnt >= 0); /* Originally, this is how many times we HAVE to succeed. */ if (mcnt > 0) { mcnt--; p += OFFSET_ADDRESS_SIZE; STORE_NUMBER_AND_INCR (p, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE , mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - OFFSET_ADDRESS_SIZE , mcnt); #endif } else if (mcnt == 0) { #ifdef _LIBC DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p + OFFSET_ADDRESS_SIZE); #else DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p + OFFSET_ADDRESS_SIZE); #endif /* _LIBC */ #ifdef MBS_SUPPORT p[1] = (US_CHAR_TYPE) no_op; #else p[2] = (US_CHAR_TYPE) no_op; p[3] = (US_CHAR_TYPE) no_op; #endif /* MBS_SUPPORT */ goto on_failure; } break; case jump_n: EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE); DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); /* Originally, this is how many times we CAN jump. */ if (mcnt) { mcnt--; STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + OFFSET_ADDRESS_SIZE, mcnt); #endif /* _LIBC */ goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ else p += 2 * OFFSET_ADDRESS_SIZE; break; case set_number_at: { DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); #endif STORE_NUMBER (p1, mcnt); break; } #if 0 /* The DEC Alpha C compiler 3.x generates incorrect code for the test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of AT_WORD_BOUNDARY, so this code is disabled. Expanding the macro and introducing temporary variables works around the bug. */ case wordbound: DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_WORD_BOUNDARY (d)) break; goto fail; case notwordbound: DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_WORD_BOUNDARY (d)) goto fail; break; #else case wordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) break; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) break; goto fail; } case notwordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) goto fail; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) goto fail; break; } #endif case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) break; goto fail; case wordend: DEBUG_PRINT1 ("EXECUTING wordend.\n"); if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) break; goto fail; #ifdef emacs case before_dot: DEBUG_PRINT1 ("EXECUTING before_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) >= point) goto fail; break; case at_dot: DEBUG_PRINT1 ("EXECUTING at_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) != point) goto fail; break; case after_dot: DEBUG_PRINT1 ("EXECUTING after_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) <= point) goto fail; break; case syntaxspec: DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); mcnt = *p++; goto matchsyntax; case wordchar: DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); mcnt = (int) Sword; matchsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; case notsyntaxspec: DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); mcnt = *p++; goto matchnotsyntax; case notwordchar: DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); mcnt = (int) Sword; matchnotsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; #else /* not emacs */ case wordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); PREFETCH (); if (!WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); PREFETCH (); if (WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; #endif /* not emacs */ default: abort (); } continue; /* Successfully executed one pattern command; keep going. */ /* We goto here if a matching operation fails. */ fail: if (!FAIL_STACK_EMPTY ()) { /* A restart point is known. Restore to that state. */ DEBUG_PRINT1 ("\nFAIL:\n"); POP_FAILURE_POINT (d, p, lowest_active_reg, highest_active_reg, regstart, regend, reg_info); /* If this failure point is a dummy, try the next one. */ if (!p) goto fail; /* If we failed to the end of the pattern, don't examine *p. */ assert (p <= pend); if (p < pend) { boolean is_a_jump_n = false; /* If failed to a backwards jump that's part of a repetition loop, need to pop this failure point and use the next one. */ switch ((re_opcode_t) *p) { case jump_n: is_a_jump_n = true; case maybe_pop_jump: case pop_failure_jump: case jump: p1 = p + 1; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) || (!is_a_jump_n && (re_opcode_t) *p1 == on_failure_jump)) goto fail; break; default: /* do nothing */ ; } } if (d >= string1 && d <= end1) dend = end_match_1; } else break; /* Matching at this starting point really fails. */ } /* for (;;) */ if (best_regs_set) goto restore_best_regs; FREE_VARIABLES (); return -1; /* Failure to match. */ } /* re_match_2 */ /* Subroutine definitions for re_match_2. */ /* We are passed P pointing to a register number after a start_memory. Return true if the pattern up to the corresponding stop_memory can match the empty string, and false otherwise. If we find the matching stop_memory, sets P to point to one past its number. Otherwise, sets P to an undefined byte less than or equal to END. We don't handle duplicates properly (yet). */ static boolean group_match_null_string_p (p, end, reg_info) US_CHAR_TYPE **p, *end; register_info_type *reg_info; { int mcnt; /* Point to after the args to the start_memory. */ US_CHAR_TYPE *p1 = *p + 2; while (p1 < end) { /* Skip over opcodes that can match nothing, and return true or false, as appropriate, when we get to one that can't, or to the matching stop_memory. */ switch ((re_opcode_t) *p1) { /* Could be either a loop or a series of alternatives. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); /* If the next operation is not a jump backwards in the pattern. */ if (mcnt >= 0) { /* Go through the on_failure_jumps of the alternatives, seeing if any of the alternatives cannot match nothing. The last alternative starts with only a jump, whereas the rest start with on_failure_jump and end with a jump, e.g., here is the pattern for `a|b|c': /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 /exactn/1/c So, we have to first go through the first (n-1) alternatives and then deal with the last one separately. */ /* Deal with the first (n-1) alternatives, which start with an on_failure_jump (see above) that jumps to right past a jump_past_alt. */ while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] == jump_past_alt) { /* `mcnt' holds how many bytes long the alternative is, including the ending `jump_past_alt' and its number. */ if (!alt_match_null_string_p (p1, p1 + mcnt - (1 + OFFSET_ADDRESS_SIZE), reg_info)) return false; /* Move to right after this alternative, including the jump_past_alt. */ p1 += mcnt; /* Break if it's the beginning of an n-th alternative that doesn't begin with an on_failure_jump. */ if ((re_opcode_t) *p1 != on_failure_jump) break; /* Still have to check that it's not an n-th alternative that starts with an on_failure_jump. */ p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] != jump_past_alt) { /* Get to the beginning of the n-th alternative. */ p1 -= 1 + OFFSET_ADDRESS_SIZE; break; } } /* Deal with the last alternative: go back and get number of the `jump_past_alt' just before it. `mcnt' contains the length of the alternative. */ EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE); if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) return false; p1 += mcnt; /* Get past the n-th alternative. */ } /* if mcnt > 0 */ break; case stop_memory: assert (p1[1] == **p); *p = p1 + 2; return true; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return false; } /* group_match_null_string_p */ /* Similar to group_match_null_string_p, but doesn't deal with alternatives: It expects P to be the first byte of a single alternative and END one byte past the last. The alternative can contain groups. */ static boolean alt_match_null_string_p (p, end, reg_info) US_CHAR_TYPE *p, *end; register_info_type *reg_info; { int mcnt; US_CHAR_TYPE *p1 = p; while (p1 < end) { /* Skip over opcodes that can match nothing, and break when we get to one that can't. */ switch ((re_opcode_t) *p1) { /* It's a loop. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; break; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return true; } /* alt_match_null_string_p */ /* Deals with the ops common to group_match_null_string_p and alt_match_null_string_p. Sets P to one after the op and its arguments, if any. */ static boolean common_op_match_null_string_p (p, end, reg_info) US_CHAR_TYPE **p, *end; register_info_type *reg_info; { int mcnt; boolean ret; int reg_no; US_CHAR_TYPE *p1 = *p; switch ((re_opcode_t) *p1++) { case no_op: case begline: case endline: case begbuf: case endbuf: case wordbeg: case wordend: case wordbound: case notwordbound: #ifdef emacs case before_dot: case at_dot: case after_dot: #endif break; case start_memory: reg_no = *p1; assert (reg_no > 0 && reg_no <= MAX_REGNUM); ret = group_match_null_string_p (&p1, end, reg_info); /* Have to set this here in case we're checking a group which contains a group and a back reference to it. */ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; if (!ret) return false; break; /* If this is an optimized succeed_n for zero times, make the jump. */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt >= 0) p1 += mcnt; else return false; break; case succeed_n: /* Get to the number of times to succeed. */ p1 += OFFSET_ADDRESS_SIZE; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt == 0) { p1 -= 2 * OFFSET_ADDRESS_SIZE; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; } else return false; break; case duplicate: if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) return false; break; case set_number_at: p1 += 2 * OFFSET_ADDRESS_SIZE; default: /* All other opcodes mean we cannot match the empty string. */ return false; } *p = p1; return true; } /* common_op_match_null_string_p */ /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN bytes; nonzero otherwise. */ static int bcmp_translate (s1, s2, len, translate) const CHAR_TYPE *s1, *s2; register int len; RE_TRANSLATE_TYPE translate; { register const US_CHAR_TYPE *p1 = (const US_CHAR_TYPE *) s1; register const US_CHAR_TYPE *p2 = (const US_CHAR_TYPE *) s2; while (len) { #ifdef MBS_SUPPORT if (((*p1<=0xff)?translate[*p1++]:*p1++) != ((*p2<=0xff)?translate[*p2++]:*p2++)) return 1; #else if (translate[*p1++] != translate[*p2++]) return 1; #endif /* MBS_SUPPORT */ len--; } return 0; } /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it compiles PATTERN (of length SIZE) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. We call regex_compile to do the actual compilation. */ const char * re_compile_pattern (pattern, length, bufp) const char *pattern; size_t length; struct re_pattern_buffer *bufp; { reg_errcode_t ret; /* GNU code is written to assume at least RE_NREGS registers will be set (and at least one extra will be -1). */ bufp->regs_allocated = REGS_UNALLOCATED; /* And GNU code determines whether or not to get register information by passing null for the REGS argument to re_match, etc., not by setting no_sub. */ bufp->no_sub = 0; /* Match anchors at newline. */ bufp->newline_anchor = 1; ret = regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]); } #ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) #endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ #if defined _REGEX_RE_COMP || defined _LIBC /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; char * #ifdef _LIBC /* Make these definitions weak in libc, so POSIX programs can redefine these names if they don't use our functions, and still use regcomp/regexec below without link errors. */ weak_function #endif re_comp (s) const char *s; { reg_errcode_t ret; if (!s) { if (!re_comp_buf.buffer) return gettext ("No previous regular expression"); return 0; } if (!re_comp_buf.buffer) { re_comp_buf.buffer = (unsigned char *) malloc (200); if (re_comp_buf.buffer == NULL) return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) REG_ESPACE]); re_comp_buf.allocated = 200; re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); if (re_comp_buf.fastmap == NULL) return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) REG_ESPACE]); } /* Since `re_exec' always passes NULL for the `regs' argument, we don't need to initialize the pattern buffer fields which affect it. */ /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); if (!ret) return NULL; /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]); } int #ifdef _LIBC weak_function #endif re_exec (s) const char *s; { const int len = strlen (s); return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } #endif /* _REGEX_RE_COMP */ /* POSIX.2 functions. Don't define these for Emacs. */ #ifndef emacs /* regcomp takes a regular expression as a string and compiles it. PREG is a regex_t *. We do not expect any fields to be initialized, since POSIX says we shouldn't. Thus, we set `buffer' to the compiled pattern; `used' to the length of the compiled pattern; `syntax' to RE_SYNTAX_POSIX_EXTENDED if the REG_EXTENDED bit in CFLAGS is set; otherwise, to RE_SYNTAX_POSIX_BASIC; `newline_anchor' to REG_NEWLINE being set in CFLAGS; `fastmap' to an allocated space for the fastmap; `fastmap_accurate' to zero; `re_nsub' to the number of subexpressions in PATTERN. PATTERN is the address of the pattern string. CFLAGS is a series of bits which affect compilation. If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we use POSIX basic syntax. If REG_NEWLINE is set, then . and [^...] don't match newline. Also, regexec will try a match beginning after every newline. If REG_ICASE is set, then we considers upper- and lowercase versions of letters to be equivalent when matching. If REG_NOSUB is set, then when PREG is passed to regexec, that routine will report only success or failure, and nothing about the registers. It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for the return codes and their meanings.) */ int regcomp (preg, pattern, cflags) regex_t *preg; const char *pattern; int cflags; { reg_errcode_t ret; reg_syntax_t syntax = (cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; preg->used = 0; /* Try to allocate space for the fastmap. */ preg->fastmap = (char *) malloc (1 << BYTEWIDTH); if (cflags & REG_ICASE) { unsigned i; preg->translate = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE * sizeof (*(RE_TRANSLATE_TYPE)0)); if (preg->translate == NULL) return (int) REG_ESPACE; /* Map uppercase characters to corresponding lowercase ones. */ for (i = 0; i < CHAR_SET_SIZE; i++) preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i; } else preg->translate = NULL; /* If REG_NEWLINE is set, newlines are treated differently. */ if (cflags & REG_NEWLINE) { /* REG_NEWLINE implies neither . nor [^...] match newline. */ syntax &= ~RE_DOT_NEWLINE; syntax |= RE_HAT_LISTS_NOT_NEWLINE; /* It also changes the matching behavior. */ preg->newline_anchor = 1; } else preg->newline_anchor = 0; preg->no_sub = !!(cflags & REG_NOSUB); /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ ret = regex_compile (pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ if (ret == REG_ERPAREN) ret = REG_EPAREN; if (ret == REG_NOERROR && preg->fastmap) { /* Compute the fastmap now, since regexec cannot modify the pattern buffer. */ if (re_compile_fastmap (preg) == -2) { /* Some error occurred while computing the fastmap, just forget about it. */ free (preg->fastmap); preg->fastmap = NULL; } } return (int) ret; } #ifdef _LIBC weak_alias (__regcomp, regcomp) #endif /* regexec searches for a given pattern, specified by PREG, in the string STRING. If NMATCH is zero or REG_NOSUB was set in the cflags argument to `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at least NMATCH elements, and we set them to the offsets of the corresponding matched substrings. EFLAGS specifies `execution flags' which affect matching: if REG_NOTBOL is set, then ^ does not match at the beginning of the string; if REG_NOTEOL is set, then $ does not match at the end. We return 0 if we find a match and REG_NOMATCH if not. */ int regexec (preg, string, nmatch, pmatch, eflags) const regex_t *preg; const char *string; size_t nmatch; regmatch_t pmatch[]; int eflags; { int ret; struct re_registers regs; regex_t private_preg; int len = strlen (string); boolean want_reg_info = !preg->no_sub && nmatch > 0; private_preg = *preg; private_preg.not_bol = !!(eflags & REG_NOTBOL); private_preg.not_eol = !!(eflags & REG_NOTEOL); /* The user has told us exactly how many registers to return information about, via `nmatch'. We have to pass that on to the matching routines. */ private_preg.regs_allocated = REGS_FIXED; if (want_reg_info) { regs.num_regs = nmatch; regs.start = TALLOC (nmatch * 2, regoff_t); if (regs.start == NULL) return (int) REG_NOMATCH; regs.end = regs.start + nmatch; } /* Perform the searching operation. */ ret = re_search (&private_preg, string, len, /* start: */ 0, /* range: */ len, want_reg_info ? ®s : (struct re_registers *) 0); /* Copy the register information to the POSIX structure. */ if (want_reg_info) { if (ret >= 0) { unsigned r; for (r = 0; r < nmatch; r++) { pmatch[r].rm_so = regs.start[r]; pmatch[r].rm_eo = regs.end[r]; } } /* If we needed the temporary register info, free the space now. */ free (regs.start); } /* We want zero return to mean success, unlike `re_search'. */ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; } #ifdef _LIBC weak_alias (__regexec, regexec) #endif /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t regerror (errcode, preg, errbuf, errbuf_size) int errcode; const regex_t *preg; char *errbuf; size_t errbuf_size; { const char *msg; size_t msg_size; if (errcode < 0 || errcode >= (int) (sizeof (re_error_msgid_idx) / sizeof (re_error_msgid_idx[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ abort (); msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]); msg_size = strlen (msg) + 1; /* Includes the null. */ if (errbuf_size != 0) { if (msg_size > errbuf_size) { #if defined HAVE_MEMPCPY || defined _LIBC *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0'; #else memcpy (errbuf, msg, errbuf_size - 1); errbuf[errbuf_size - 1] = 0; #endif } else memcpy (errbuf, msg, msg_size); } return msg_size; } #ifdef _LIBC weak_alias (__regerror, regerror) #endif /* Free dynamically allocated space used by PREG. */ void regfree (preg) regex_t *preg; { if (preg->buffer != NULL) free (preg->buffer); preg->buffer = NULL; preg->allocated = 0; preg->used = 0; if (preg->fastmap != NULL) free (preg->fastmap); preg->fastmap = NULL; preg->fastmap_accurate = 0; if (preg->translate != NULL) free (preg->translate); preg->translate = NULL; } #ifdef _LIBC weak_alias (__regfree, regfree) #endif #endif /* not emacs */ htdig-3.2.0b6/htlib/regex_win32.c0100644006314600127310000071615110000513631015765 0ustar angusgbhtdig/* LGPLd GNU regex for Native WIN32 */ /* Part of the ht://Dig package */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later or later */ /* */ /* Added June 2003 Neal Richter, RightNow Technologies */ /* note that this version is significantly different from the original */ /* version 0.12 GNU source code. It compiles and works on Native WIN32. */ /* Extended regular expression matching and search library, version 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined(_WIN32) #pragma warning(disable: 4018 4101) #endif /* AIX requires this to be the first thing in the file. */ #if defined (_AIX) && !defined (REGEX_MALLOC) #pragma alloca #endif #undef _GNU_SOURCE #define _GNU_SOURCE #if defined(LINUX) #define STDC_HEADERS #endif #if defined(STDC_HEADERS) && !defined(emacs) #include #else /* We need this for `regex.h', and perhaps for the Emacs include files. */ #include #endif /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) # include # include #endif /* This is for other GNU distributions with internationalized messages. */ #if HAVE_LIBINTL_H || defined (_LIBC) # include #else # define gettext(msgid) (msgid) #endif #ifndef gettext_noop /* This define is so xgettext can find the internationalizable strings. */ #define gettext_noop(String) String #endif /* The `emacs' switch turns on certain matching commands that make sense only in Emacs. */ #ifdef emacs #include "lisp.h" #include "buffer.h" #include "syntax.h" #else /* not emacs */ /* If we are not linking with Emacs proper, we can't use the relocating allocator even if config.h says that we can. */ #undef REL_ALLOC #if defined (STDC_HEADERS) || defined (_LIBC) || defined(_WIN32) #include #else char *malloc (); char *realloc (); void free(); #endif /* When used in Emacs's lib-src, we need to get bzero and bcopy somehow. If nothing else has been done, use the method below. */ #ifdef INHIBIT_STRING_HEADER #if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY)) #if !defined (bzero) && !defined (bcopy) #undef INHIBIT_STRING_HEADER #endif #endif #endif #include /* This is the normal way of making sure we have a bcopy and a bzero. This is used in most programs--a few other programs avoid this by defining INHIBIT_STRING_HEADER. */ #ifndef INHIBIT_STRING_HEADER #if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC) || defined (_WIN32) #ifndef bcmp #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) #endif #ifndef bcopy #define bcopy(s, d, n) memcpy ((d), (s), (n)) #endif #ifndef bzero #define bzero(s, n) memset ((s), 0, (n)) #endif #else #include #endif #endif /* Define the syntax stuff for \<, \>, etc. */ /* This must be nonzero for the wordchar and notwordchar pattern commands in re_match_2. */ #ifndef Sword #define Sword 1 #endif #ifdef SWITCH_ENUM_BUG #define SWITCH_ENUM_CAST(x) ((int)(x)) #else #define SWITCH_ENUM_CAST(x) (x) #endif #ifdef SYNTAX_TABLE extern char *re_syntax_table; #else /* not SYNTAX_TABLE */ /* How many characters in the character set. */ #define CHAR_SET_SIZE 256 static char re_syntax_table[CHAR_SET_SIZE]; static void init_syntax_once () { register int c; static int done = 0; if (done) return; bzero (re_syntax_table, sizeof re_syntax_table); for (c = 'a'; c <= 'z'; c++) re_syntax_table[c] = Sword; for (c = 'A'; c <= 'Z'; c++) re_syntax_table[c] = Sword; for (c = '0'; c <= '9'; c++) re_syntax_table[c] = Sword; re_syntax_table['_'] = Sword; done = 1; } #endif /* not SYNTAX_TABLE */ #define SYNTAX(c) re_syntax_table[c] #endif /* not emacs */ /* Get the interface, including the syntax bits. */ /* #include "regex.h" */ #include "regex_win32.h" /* isalpha etc. are used for the character classes. */ #include /* Jim Meyering writes: "... Some ctype macros are valid only for character codes that isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when using /bin/cc or gcc but without giving an ansi option). So, all ctype uses should be through macros like ISPRINT... If STDC_HEADERS is defined, then autoconf has verified that the ctype macros don't need to be guarded with references to isascii. ... Defining isascii to 1 should let any compiler worth its salt eliminate the && through constant folding." */ #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) #define ISASCII(c) 1 #else #define ISASCII(c) isascii(c) #endif #ifdef isblank #define ISBLANK(c) (ISASCII (c) && isblank (c)) #else #define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph #define ISGRAPH(c) (ISASCII (c) && isgraph (c)) #else #define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) #endif #define ISPRINT(c) (ISASCII (c) && isprint (c)) #define ISDIGIT(c) (ISASCII (c) && isdigit (c)) #define ISALNUM(c) (ISASCII (c) && isalnum (c)) #define ISALPHA(c) (ISASCII (c) && isalpha (c)) #define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) #define ISLOWER(c) (ISASCII (c) && islower (c)) #define ISPUNCT(c) (ISASCII (c) && ispunct (c)) #define ISSPACE(c) (ISASCII (c) && isspace (c)) #define ISUPPER(c) (ISASCII (c) && isupper (c)) #define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) #ifndef NULL #define NULL (void *)0 #endif /* We remove any previous definition of `SIGN_EXTEND_CHAR', since ours (we hope) works properly with all combinations of machines, compilers, `char' and `unsigned char' argument types. (Per Bothner suggested the basic approach.) */ #undef SIGN_EXTEND_CHAR #if __STDC__ #define SIGN_EXTEND_CHAR(c) ((signed char) (c)) #else /* not __STDC__ */ /* As in Harbison and Steele. */ #define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) #endif /* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we use `alloca' instead of `malloc'. This is because using malloc in re_search* or re_match* could cause memory leaks when C-g is used in Emacs; also, malloc is slower and causes storage fragmentation. On the other hand, malloc is more portable, and easier to debug. Because we sometimes use alloca, some routines have to be macros, not functions -- `alloca'-allocated space disappears at the end of the function it is called in. */ #if defined(REGEX_MALLOC) || defined(_WIN32) #define REGEX_ALLOCATE malloc #define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) #define REGEX_FREE free #define REGEX_MALLOC #else /* not REGEX_MALLOC */ /* Emacs already defines alloca, sometimes. */ #ifndef alloca /* Make alloca work the best possible way. */ #ifdef __GNUC__ #define alloca __builtin_alloca #else /* not __GNUC__ */ #if HAVE_ALLOCA_H #include #else /* not __GNUC__ or HAVE_ALLOCA_H */ #if 0 /* It is a bad idea to declare alloca. We always cast the result. */ #ifndef _AIX /* Already did AIX, up at the top. */ char *alloca (); #endif /* not _AIX */ #endif #endif /* not HAVE_ALLOCA_H */ #endif /* not __GNUC__ */ #endif /* not alloca */ #define REGEX_ALLOCATE alloca /* Assumes a `char *destination' variable. */ #define REGEX_REALLOCATE(source, osize, nsize) \ (destination = (char *) alloca (nsize), \ bcopy (source, destination, osize), \ destination) /* No need to do anything to free, after alloca. */ #define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */ #endif /* not REGEX_MALLOC */ /* Define how to allocate the failure stack. */ #if defined (REL_ALLOC) && defined (REGEX_MALLOC) #define REGEX_ALLOCATE_STACK(size) \ r_alloc (&failure_stack_ptr, (size)) #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ r_re_alloc (&failure_stack_ptr, (nsize)) #define REGEX_FREE_STACK(ptr) \ r_alloc_free (&failure_stack_ptr) #else /* not using relocating allocator */ #ifdef REGEX_MALLOC #define REGEX_ALLOCATE_STACK malloc #define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize) #define REGEX_FREE_STACK free #else /* not REGEX_MALLOC */ #define REGEX_ALLOCATE_STACK alloca #define REGEX_REALLOCATE_STACK(source, osize, nsize) \ REGEX_REALLOCATE (source, osize, nsize) /* No need to explicitly free anything. */ #define REGEX_FREE_STACK(arg) #endif /* not REGEX_MALLOC */ #endif /* not using relocating allocator */ /* True if `size1' is non-NULL and PTR is pointing anywhere inside `string1' or just past its end. This works if PTR is NULL, which is a good thing. */ #define FIRST_STRING_P(ptr) \ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) /* (Re)Allocate N items of type T using malloc, or fail. */ #define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) #define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) #define RETALLOC_IF(addr, n, t) \ if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) #define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) #define BYTEWIDTH 8 /* In bits. */ #define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) #undef MAX #undef MIN #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) typedef char boolean; #define false 0 #define true 1 static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop); /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its arguments. Zero bytes may appear in the compiled regular expression. */ typedef enum { no_op = 0, /* Succeed right away--no more backtracking. */ succeed, /* Followed by one byte giving n, then by n literal bytes. */ exactn, /* Matches any (more or less) character. */ anychar, /* Matches any one char belonging to specified set. First following byte is number of bitmap bytes. Then come bytes for a bitmap saying which chars are in. Bits in each byte are ordered low-bit-first. A character is in the set if its bit is 1. A character too large to have a bit in the map is automatically not in the set. */ charset, /* Same parameters as charset, but match any character that is not one of those specified. */ charset_not, /* Start remembering the text that is matched, for storing in a register. Followed by one byte with the register number, in the range 0 to one less than the pattern buffer's re_nsub field. Then followed by one byte with the number of groups inner to this one. (This last has to be part of the start_memory only because we need it in the on_failure_jump of re_match_2.) */ start_memory, /* Stop remembering the text that is matched and store it in a memory register. Followed by one byte with the register number, in the range 0 to one less than `re_nsub' in the pattern buffer, and one byte with the number of inner groups, just like `start_memory'. (We need the number of inner groups here because we don't have any easy way of finding the corresponding start_memory when we're at a stop_memory.) */ stop_memory, /* Match a duplicate of something remembered. Followed by one byte containing the register number. */ duplicate, /* Fail unless at beginning of line. */ begline, /* Fail unless at end of line. */ endline, /* Succeeds if at beginning of buffer (if emacs) or at beginning of string to be matched (if not). */ begbuf, /* Analogously, for end of buffer/string. */ endbuf, /* Followed by two byte relative address to which to jump. */ jump, /* Same as jump, but marks the end of an alternative. */ jump_past_alt, /* Followed by two-byte relative address of place to resume at in case of failure. */ on_failure_jump, /* Like on_failure_jump, but pushes a placeholder instead of the current string position when executed. */ on_failure_keep_string_jump, /* Throw away latest failure point and then jump to following two-byte relative address. */ pop_failure_jump, /* Change to pop_failure_jump if know won't have to backtrack to match; otherwise change to jump. This is used to jump back to the beginning of a repeat. If what follows this jump clearly won't match what the repeat does, such that we can be sure that there is no use backtracking out of repetitions already matched, then we change it to a pop_failure_jump. Followed by two-byte address. */ maybe_pop_jump, /* Jump to following two-byte address, and push a dummy failure point. This failure point will be thrown away if an attempt is made to use it for a failure. A `+' construct makes this before the first repeat. Also used as an intermediary kind of jump when compiling an alternative. */ dummy_failure_jump, /* Push a dummy failure point and continue. Used at the end of alternatives. */ push_dummy_failure, /* Followed by two-byte relative address and two-byte number n. After matching N times, jump to the address upon failure. */ succeed_n, /* Followed by two-byte relative address, and two-byte number n. Jump to the address N times, then fail. */ jump_n, /* Set the following two-byte relative address to the subsequent two-byte number. The address *includes* the two bytes of number. */ set_number_at, wordchar, /* Matches any word-constituent character. */ notwordchar, /* Matches any char that is not a word-constituent. */ wordbeg, /* Succeeds if at word beginning. */ wordend, /* Succeeds if at word end. */ wordbound, /* Succeeds if at a word boundary. */ notwordbound /* Succeeds if not at a word boundary. */ #ifdef emacs ,before_dot, /* Succeeds if before point. */ at_dot, /* Succeeds if at point. */ after_dot, /* Succeeds if after point. */ /* Matches any character whose syntax is specified. Followed by a byte which contains a syntax code, e.g., Sword. */ syntaxspec, /* Matches any character whose syntax is not that specified. */ notsyntaxspec #endif /* emacs */ } re_opcode_t; /* Common operations on the compiled pattern. */ /* Store NUMBER in two contiguous bytes starting at DESTINATION. */ #define STORE_NUMBER(destination, number) \ do { \ (destination)[0] = (number) & 0377; \ (destination)[1] = (number) >> 8; \ } while (0) /* Same as STORE_NUMBER, except increment DESTINATION to the byte after where the number is stored. Therefore, DESTINATION must be an lvalue. */ #define STORE_NUMBER_AND_INCR(destination, number) \ do { \ STORE_NUMBER (destination, number); \ (destination) += 2; \ } while (0) /* Put into DESTINATION a number stored in two contiguous bytes starting at SOURCE. */ #define EXTRACT_NUMBER(destination, source) \ do { \ (destination) = *(source) & 0377; \ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ } while (0) #ifdef DEBUG static void extract_number _RE_ARGS ((int *dest, unsigned char *source)); static void extract_number (dest, source) int *dest; unsigned char *source; { int temp = SIGN_EXTEND_CHAR (*(source + 1)); *dest = *source & 0377; *dest += temp << 8; } #ifndef EXTRACT_MACROS /* To debug the macros. */ #undef EXTRACT_NUMBER #define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) #endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. SOURCE must be an lvalue. */ #define EXTRACT_NUMBER_AND_INCR(destination, source) \ do { \ EXTRACT_NUMBER (destination, source); \ (source) += 2; \ } while (0) #ifdef DEBUG static void extract_number_and_incr _RE_ARGS ((int *destination, unsigned char **source)); static void extract_number_and_incr (destination, source) int *destination; unsigned char **source; { extract_number (destination, *source); *source += 2; } #ifndef EXTRACT_MACROS #undef EXTRACT_NUMBER_AND_INCR #define EXTRACT_NUMBER_AND_INCR(dest, src) \ extract_number_and_incr (&dest, &src) #endif /* not EXTRACT_MACROS */ #endif /* DEBUG */ /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the main program in `iregex.c', you can enter patterns and strings interactively. And if linked with the main program in `main.c' and the other test files, you can run the already-written tests. */ #ifdef DEBUG /* We use standard I/O for debugging. */ #include /* It is useful to test things that ``must'' be true when debugging. */ #include static int debug = 0; #define DEBUG_STATEMENT(e) e #define DEBUG_PRINT1(x) if (debug) printf (x) #define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) #define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) #define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ if (debug) print_partial_compiled_pattern (s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ if (debug) print_double_string (w, s1, sz1, s2, sz2) /* Print the fastmap in human-readable form. */ void print_fastmap (fastmap) char *fastmap; { unsigned was_a_range = 0; unsigned i = 0; while (i < (1 << BYTEWIDTH)) { if (fastmap[i++]) { was_a_range = 0; putchar (i - 1); while (i < (1 << BYTEWIDTH) && fastmap[i]) { was_a_range = 1; i++; } if (was_a_range) { printf ("-"); putchar (i - 1); } } } putchar ('\n'); } /* Print a compiled pattern string in human-readable form, starting at the START pointer into it and ending just before the pointer END. */ void print_partial_compiled_pattern (start, end) unsigned char *start; unsigned char *end; { int mcnt, mcnt2; unsigned char *p1; unsigned char *p = start; unsigned char *pend = end; if (start == NULL) { printf ("(null)\n"); return; } /* Loop over pattern commands. */ while (p < pend) { printf ("%d:\t", p - start); switch ((re_opcode_t) *p++) { case no_op: printf ("/no_op"); break; case exactn: mcnt = *p++; printf ("/exactn/%d", mcnt); do { putchar ('/'); putchar (*p++); } while (--mcnt); break; case start_memory: mcnt = *p++; printf ("/start_memory/%d/%d", mcnt, *p++); break; case stop_memory: mcnt = *p++; printf ("/stop_memory/%d/%d", mcnt, *p++); break; case duplicate: printf ("/duplicate/%d", *p++); break; case anychar: printf ("/anychar"); break; case charset: case charset_not: { register int c, last = -100; register int in_range = 0; printf ("/charset [%s", (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); assert (p + *p < pend); for (c = 0; c < 256; c++) if (c / 8 < *p && (p[1 + (c/8)] & (1 << (c % 8)))) { /* Are we starting a range? */ if (last + 1 == c && ! in_range) { putchar ('-'); in_range = 1; } /* Have we broken a range? */ else if (last + 1 != c && in_range) { putchar (last); in_range = 0; } if (! in_range) putchar (c); last = c; } if (in_range) putchar (last); putchar (']'); p += 1 + *p; } break; case begline: printf ("/begline"); break; case endline: printf ("/endline"); break; case on_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/on_failure_jump to %d", p + mcnt - start); break; case on_failure_keep_string_jump: extract_number_and_incr (&mcnt, &p); printf ("/on_failure_keep_string_jump to %d", p + mcnt - start); break; case dummy_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/dummy_failure_jump to %d", p + mcnt - start); break; case push_dummy_failure: printf ("/push_dummy_failure"); break; case maybe_pop_jump: extract_number_and_incr (&mcnt, &p); printf ("/maybe_pop_jump to %d", p + mcnt - start); break; case pop_failure_jump: extract_number_and_incr (&mcnt, &p); printf ("/pop_failure_jump to %d", p + mcnt - start); break; case jump_past_alt: extract_number_and_incr (&mcnt, &p); printf ("/jump_past_alt to %d", p + mcnt - start); break; case jump: extract_number_and_incr (&mcnt, &p); printf ("/jump to %d", p + mcnt - start); break; case succeed_n: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/succeed_n to %d, %d times", p1 - start, mcnt2); break; case jump_n: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/jump_n to %d, %d times", p1 - start, mcnt2); break; case set_number_at: extract_number_and_incr (&mcnt, &p); p1 = p + mcnt; extract_number_and_incr (&mcnt2, &p); printf ("/set_number_at location %d to %d", p1 - start, mcnt2); break; case wordbound: printf ("/wordbound"); break; case notwordbound: printf ("/notwordbound"); break; case wordbeg: printf ("/wordbeg"); break; case wordend: printf ("/wordend"); #ifdef emacs case before_dot: printf ("/before_dot"); break; case at_dot: printf ("/at_dot"); break; case after_dot: printf ("/after_dot"); break; case syntaxspec: printf ("/syntaxspec"); mcnt = *p++; printf ("/%d", mcnt); break; case notsyntaxspec: printf ("/notsyntaxspec"); mcnt = *p++; printf ("/%d", mcnt); break; #endif /* emacs */ case wordchar: printf ("/wordchar"); break; case notwordchar: printf ("/notwordchar"); break; case begbuf: printf ("/begbuf"); break; case endbuf: printf ("/endbuf"); break; default: printf ("?%d", *(p-1)); } putchar ('\n'); } printf ("%d:\tend of pattern.\n", p - start); } void print_compiled_pattern (bufp) struct re_pattern_buffer *bufp; { unsigned char *buffer = bufp->buffer; print_partial_compiled_pattern (buffer, buffer + bufp->used); printf ("%ld bytes used/%ld bytes allocated.\n", bufp->used, bufp->allocated); if (bufp->fastmap_accurate && bufp->fastmap) { printf ("fastmap: "); print_fastmap (bufp->fastmap); } printf ("re_nsub: %d\t", bufp->re_nsub); printf ("regs_alloc: %d\t", bufp->regs_allocated); printf ("can_be_null: %d\t", bufp->can_be_null); printf ("newline_anchor: %d\n", bufp->newline_anchor); printf ("no_sub: %d\t", bufp->no_sub); printf ("not_bol: %d\t", bufp->not_bol); printf ("not_eol: %d\t", bufp->not_eol); printf ("syntax: %lx\n", bufp->syntax); /* Perhaps we should print the translate table? */ } void print_double_string (where, string1, size1, string2, size2) const char *where; const char *string1; const char *string2; int size1; int size2; { int this_char; if (where == NULL) printf ("(null)"); else { if (FIRST_STRING_P (where)) { for (this_char = where - string1; this_char < size1; this_char++) putchar (string1[this_char]); where = string2; } for (this_char = where - string2; this_char < size2; this_char++) putchar (string2[this_char]); } } void printchar (c) int c; { putc (c, stderr); } #else /* not DEBUG */ #undef assert #define assert(e) #define DEBUG_STATEMENT(e) #define DEBUG_PRINT1(x) #define DEBUG_PRINT2(x1, x2) #define DEBUG_PRINT3(x1, x2, x3) #define DEBUG_PRINT4(x1, x2, x3, x4) #define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) #define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) #endif /* not DEBUG */ /* Set by `re_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own syntax, so it can be changed between regex compilations. */ /* This has no initializer because initialized variables in Emacs become read-only after dumping. */ reg_syntax_t re_syntax_options; /* Specify the precise syntax of regexps for compilation. This provides for compatibility for various utilities which historically have different, incompatible syntaxes. The argument SYNTAX is a bit mask comprised of the various bits defined in regex.h. We return the old syntax. */ reg_syntax_t re_set_syntax(reg_syntax_t syntax) { reg_syntax_t ret = re_syntax_options; re_syntax_options = syntax; #ifdef DEBUG if (syntax & RE_DEBUG) debug = 1; else if (debug) /* was on but now is not */ debug = 0; #endif /* DEBUG */ return ret; } /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ static const char *re_error_msgid[] = { gettext_noop ("Success"), /* REG_NOERROR */ gettext_noop ("No match"), /* REG_NOMATCH */ gettext_noop ("Invalid regular expression"), /* REG_BADPAT */ gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */ gettext_noop ("Invalid character class name"), /* REG_ECTYPE */ gettext_noop ("Trailing backslash"), /* REG_EESCAPE */ gettext_noop ("Invalid back reference"), /* REG_ESUBREG */ gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */ gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */ gettext_noop ("Unmatched \\{"), /* REG_EBRACE */ gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */ gettext_noop ("Invalid range end"), /* REG_ERANGE */ gettext_noop ("Memory exhausted"), /* REG_ESPACE */ gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */ gettext_noop ("Premature end of regular expression"), /* REG_EEND */ gettext_noop ("Regular expression too big"), /* REG_ESIZE */ gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ }; /* Avoiding alloca during matching, to placate r_alloc. */ /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the searching and matching functions should not call alloca. On some systems, alloca is implemented in terms of malloc, and if we're using the relocating allocator routines, then malloc could cause a relocation, which might (if the strings being searched are in the ralloc heap) shift the data out from underneath the regexp routines. Here's another reason to avoid allocation: Emacs processes input from X in a signal handler; processing X input may call malloc; if input arrives while a matching routine is calling malloc, then we're scrod. But Emacs can't just block input while calling matching routines; then we don't notice interrupts when they come in. So, Emacs blocks input around all regexp calls except the matching calls, which it leaves unprotected, in the faith that they will not malloc. */ /* Normally, this is fine. */ #define MATCH_MAY_ALLOCATE /* When using GNU C, we are not REALLY using the C alloca, no matter what config.h may say. So don't take precautions for it. */ #ifdef __GNUC__ #undef C_ALLOCA #endif /* The match routines may not allocate if (1) they would do it with malloc and (2) it's not safe for them to use malloc. Note that if REL_ALLOC is defined, matching would not use malloc for the failure stack, but we would still use it for the register vectors; so REL_ALLOC should not affect this. */ #if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs) #undef MATCH_MAY_ALLOCATE #endif /* Failure stack declarations and macros; both re_compile_fastmap and re_match_2 use a failure stack. These have to be macros because of REGEX_ALLOCATE_STACK. */ /* Number of failure points for which to initially allocate space when matching. If this number is exceeded, we allocate more space, so it is not a hard limit. */ #ifndef INIT_FAILURE_ALLOC #define INIT_FAILURE_ALLOC 5 #endif /* Roughly the maximum number of failure points on the stack. Would be exactly that if always used MAX_FAILURE_ITEMS items each time we failed. This is a variable only so users of regex can assign to it; we never change it ourselves. */ #ifdef INT_IS_16BIT #if defined (MATCH_MAY_ALLOCATE) /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ static long int re_max_failures = 4000; #else static long int re_max_failures = 2000; #endif union fail_stack_elt { unsigned char *pointer; long int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned long int size; unsigned long int avail; /* Offset of next open position. */ } fail_stack_type; #else /* not INT_IS_16BIT */ #if defined (MATCH_MAY_ALLOCATE) /* 4400 was enough to cause a crash on Alpha OSF/1, whose default stack limit is 2mb. */ static int re_max_failures = 20000; #else static int re_max_failures = 2000; #endif union fail_stack_elt { unsigned char *pointer; int integer; }; typedef union fail_stack_elt fail_stack_elt_t; typedef struct { fail_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } fail_stack_type; #endif /* INT_IS_16BIT */ #define FAIL_STACK_EMPTY() (fail_stack.avail == 0) #define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) #define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) /* Define macros to initialize and free the failure stack. Do `return -2' if the alloc fails. */ #ifdef MATCH_MAY_ALLOCATE #define INIT_FAIL_STACK() \ do { \ fail_stack.stack = (fail_stack_elt_t *) \ REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ \ if (fail_stack.stack == NULL) \ return -2; \ \ fail_stack.size = INIT_FAILURE_ALLOC; \ fail_stack.avail = 0; \ } while (0) #define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack) #else #define INIT_FAIL_STACK() \ do { \ fail_stack.avail = 0; \ } while (0) #define RESET_FAIL_STACK() #endif /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. Return 1 if succeeds, and 0 if either ran out of memory allocating space for it or it was already too large. REGEX_REALLOCATE_STACK requires `destination' be declared. */ #define DOUBLE_FAIL_STACK(fail_stack) \ ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \ ? 0 \ : ((fail_stack).stack = (fail_stack_elt_t *) \ REGEX_REALLOCATE_STACK ((fail_stack).stack, \ (fail_stack).size * sizeof (fail_stack_elt_t), \ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ \ (fail_stack).stack == NULL \ ? 0 \ : ((fail_stack).size <<= 1, \ 1))) /* Push pointer POINTER on FAIL_STACK. Return 1 if was able to do so and 0 if ran out of memory allocating space to do so. */ #define PUSH_PATTERN_OP(POINTER, FAIL_STACK) \ ((FAIL_STACK_FULL () \ && !DOUBLE_FAIL_STACK (FAIL_STACK)) \ ? 0 \ : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER, \ 1)) /* Push a pointer value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_POINTER(item) \ fail_stack.stack[fail_stack.avail++].pointer = (unsigned char *) (item) /* This pushes an integer-valued item onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_INT(item) \ fail_stack.stack[fail_stack.avail++].integer = (item) /* Push a fail_stack_elt_t value onto the failure stack. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_ELT(item) \ fail_stack.stack[fail_stack.avail++] = (item) /* These three POP... operations complement the three PUSH... operations. All assume that `fail_stack' is nonempty. */ #define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer #define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer #define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail] /* Used to omit pushing failure point id's when we're not debugging. */ #ifdef DEBUG #define DEBUG_PUSH PUSH_FAILURE_INT #define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT () #else #define DEBUG_PUSH(item) #define DEBUG_POP(item_addr) #endif /* Push the information about the state we will need if we ever fail back to it. Requires variables fail_stack, regstart, regend, reg_info, and num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be declared. Does `return FAILURE_CODE' if runs out of memory. */ #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ do { \ char *destination; \ /* Must be int, so when we don't save any registers, the arithmetic \ of 0 + -1 isn't done as unsigned. */ \ /* Can't be int, since there is not a shred of a guarantee that int \ is wide enough to hold a value of something to which pointer can \ be assigned */ \ s_reg_t this_reg; \ \ DEBUG_STATEMENT (failure_id++); \ DEBUG_STATEMENT (nfailure_points_pushed++); \ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ \ DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ \ /* Ensure we have enough space allocated for what we will push. */ \ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ { \ if (!DOUBLE_FAIL_STACK (fail_stack)) \ return failure_code; \ \ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ (fail_stack).size); \ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ } \ \ /* Push the info, starting with the registers. */ \ DEBUG_PRINT1 ("\n"); \ \ if (1) \ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ this_reg++) \ { \ DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ DEBUG_STATEMENT (num_regs_pushed++); \ \ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ PUSH_FAILURE_POINTER (regstart[this_reg]); \ \ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ PUSH_FAILURE_POINTER (regend[this_reg]); \ \ DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \ DEBUG_PRINT2 (" match_null=%d", \ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ DEBUG_PRINT2 (" matched_something=%d", \ MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT2 (" ever_matched=%d", \ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ DEBUG_PRINT1 ("\n"); \ PUSH_FAILURE_ELT (reg_info[this_reg].word); \ } \ \ DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ PUSH_FAILURE_INT (lowest_active_reg); \ \ DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ size2); \ DEBUG_PRINT1 ("'\n"); \ PUSH_FAILURE_POINTER (string_place); \ \ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ DEBUG_PUSH (failure_id); \ } while (0) /* This is the number of items that are pushed and popped on the stack for each register. */ #define NUM_REG_ITEMS 3 /* Individual items aside from the registers. */ #ifdef DEBUG #define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ #else #define NUM_NONREG_ITEMS 4 #endif /* We push at most this many items on the stack. */ /* We used to use (num_regs - 1), which is the number of registers this regexp will save; but that was changed to 5 to avoid stack overflow for a regexp with lots of parens. */ #define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS) /* We actually push this many items. */ #define NUM_FAILURE_ITEMS \ (((0 \ ? 0 : highest_active_reg - lowest_active_reg + 1) \ * NUM_REG_ITEMS) \ + NUM_NONREG_ITEMS) /* How many items can still be added to the stack without overflowing it. */ #define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) /* Pops what PUSH_FAIL_STACK pushes. We restore into the parameters, all of which should be lvalues: STR -- the saved data position. PAT -- the saved pattern position. LOW_REG, HIGH_REG -- the highest and lowest active registers. REGSTART, REGEND -- arrays of string positions. REG_INFO -- array of information about each subexpression. Also assumes the variables `fail_stack' and (if debugging), `bufp', `pend', `string1', `size1', `string2', and `size2'. */ #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ { \ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ s_reg_t this_reg; \ const unsigned char *string_temp; \ \ assert (!FAIL_STACK_EMPTY ()); \ \ /* Remove failure points and point to how many regs pushed. */ \ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ \ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ \ DEBUG_POP (&failure_id); \ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ \ /* If the saved string location is NULL, it came from an \ on_failure_keep_string_jump opcode, and we want to throw away the \ saved NULL, thus retaining our current position in the string. */ \ string_temp = POP_FAILURE_POINTER (); \ if (string_temp != NULL) \ str = (const char *) string_temp; \ \ DEBUG_PRINT2 (" Popping string 0x%x: `", str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ pat = (unsigned char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ high_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ \ low_reg = (active_reg_t) POP_FAILURE_INT (); \ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ \ if (1) \ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ { \ DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ \ reg_info[this_reg].word = POP_FAILURE_ELT (); \ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \ \ regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ \ regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ } \ else \ { \ for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \ { \ reg_info[this_reg].word.integer = 0; \ regend[this_reg] = 0; \ regstart[this_reg] = 0; \ } \ highest_active_reg = high_reg; \ } \ \ set_regs_matched_done = 0; \ DEBUG_STATEMENT (nfailure_points_popped++); \ } /* POP_FAILURE_POINT */ /* Structure for per-register (a.k.a. per-group) information. Other register information, such as the starting and ending positions (which are addresses), and the list of inner groups (which is a bits list) are maintained in separate variables. We are making a (strictly speaking) nonportable assumption here: that the compiler will pack our bit fields into something that fits into the type of `word', i.e., is something that fits into one item on the failure stack. */ /* Declarations and macros for re_match_2. */ typedef union { fail_stack_elt_t word; struct { /* This field is one if this group can match the empty string, zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ #define MATCH_NULL_UNSET_VALUE 3 unsigned match_null_string_p : 2; unsigned is_active : 1; unsigned matched_something : 1; unsigned ever_matched_something : 1; } bits; } register_info_type; #define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) #define IS_ACTIVE(R) ((R).bits.is_active) #define MATCHED_SOMETHING(R) ((R).bits.matched_something) #define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) /* Call this when have matched a real character; it sets `matched' flags for the subexpressions which we are currently inside. Also records that those subexprs have matched. */ #define SET_REGS_MATCHED() \ do \ { \ if (!set_regs_matched_done) \ { \ active_reg_t r; \ set_regs_matched_done = 1; \ for (r = lowest_active_reg; r <= highest_active_reg; r++) \ { \ MATCHED_SOMETHING (reg_info[r]) \ = EVER_MATCHED_SOMETHING (reg_info[r]) \ = 1; \ } \ } \ } \ while (0) /* Registers are set to a sentinel when they haven't yet matched. */ static char reg_unset_dummy; #define REG_UNSET_VALUE (®_unset_dummy) #define REG_UNSET(e) ((e) == REG_UNSET_VALUE) /* Subroutine declarations and macros for regex_compile. */ static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)); static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2)); static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg, unsigned char *end)); static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end)); static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p, reg_syntax_t syntax)); static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax)); static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b)); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant string passed to us by the user to an unsigned char that we can use as an array index (in, e.g., `translate'). */ #ifndef PATFETCH #define PATFETCH(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ if (translate) c = (unsigned char) translate[c]; \ } while (0) #endif /* Fetch the next character in the uncompiled pattern, with no translation. */ #define PATFETCH_RAW(c) \ do {if (p == pend) return REG_EEND; \ c = (unsigned char) *p++; \ } while (0) /* Go backwards one character in the pattern. */ #define PATUNFETCH p-- /* If `translate' is non-null, return translate[D], else just D. We cast the subscript to translate because some data is declared as `char *', to avoid warnings when a string constant is passed. But when we use a character as a subscript we must make it unsigned. */ #ifndef TRANSLATE #define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) #endif /* Macros for outputting the compiled pattern into `buffer'. */ /* If the buffer isn't allocated when it comes in, use this. */ #define INIT_BUF_SIZE 32 /* Make sure we have at least N more bytes of space in buffer. */ #define GET_BUFFER_SPACE(n) \ while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated) \ EXTEND_BUFFER () /* Make sure we have one more byte of buffer space and then add C to it. */ #define BUF_PUSH(c) \ do { \ GET_BUFFER_SPACE (1); \ *b++ = (unsigned char) (c); \ } while (0) /* Ensure we have two more bytes of buffer space and then append C1 and C2. */ #define BUF_PUSH_2(c1, c2) \ do { \ GET_BUFFER_SPACE (2); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ } while (0) /* As with BUF_PUSH_2, except for three bytes. */ #define BUF_PUSH_3(c1, c2, c3) \ do { \ GET_BUFFER_SPACE (3); \ *b++ = (unsigned char) (c1); \ *b++ = (unsigned char) (c2); \ *b++ = (unsigned char) (c3); \ } while (0) /* Store a jump with opcode OP at LOC to location TO. We store a relative address offset by the three bytes the jump itself occupies. */ #define STORE_JUMP(op, loc, to) \ store_op1 (op, loc, (int) ((to) - (loc) - 3)) /* Likewise, for a two-argument jump. */ #define STORE_JUMP2(op, loc, to, arg) \ store_op2 (op, loc, (int) ((to) - (loc) - 3), arg) /* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP(op, loc, to) \ insert_op1 (op, loc, (int) ((to) - (loc) - 3), b) /* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ #define INSERT_JUMP2(op, loc, to, arg) \ insert_op2 (op, loc, (int) ((to) - (loc) - 3), arg, b) /* This is not an arbitrary limit: the arguments which represent offsets into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ /* Any other compiler which, like MSC, has allocation limit below 2^16 bytes will have to use approach similar to what was done below for MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up reallocating to 0 bytes. Such thing is not going to work too well. You have been warned!! */ #if defined(_MSC_VER) && !defined(_WIN32) /* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. The REALLOC define eliminates a flurry of conversion warnings, but is not required. */ #define MAX_BUF_SIZE 65500L #define REALLOC(p,s) realloc ((p), (size_t) (s)) #else #define MAX_BUF_SIZE (1L << 16) #define REALLOC(p,s) realloc ((p), (s)) #endif /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the correct places in the new one. If extending the buffer results in it being larger than MAX_BUF_SIZE, then flag memory exhausted. */ #define EXTEND_BUFFER() \ do { \ unsigned char *old_buffer = bufp->buffer; \ if (bufp->allocated == MAX_BUF_SIZE) \ return REG_ESIZE; \ bufp->allocated <<= 1; \ if (bufp->allocated > MAX_BUF_SIZE) \ bufp->allocated = MAX_BUF_SIZE; \ bufp->buffer = (unsigned char *) REALLOC (bufp->buffer, bufp->allocated);\ if (bufp->buffer == NULL) \ return REG_ESPACE; \ /* If the buffer moved, move all the pointers into it. */ \ if (old_buffer != bufp->buffer) \ { \ b = (b - old_buffer) + bufp->buffer; \ begalt = (begalt - old_buffer) + bufp->buffer; \ if (fixup_alt_jump) \ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ if (laststart) \ laststart = (laststart - old_buffer) + bufp->buffer; \ if (pending_exact) \ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ } \ } while (0) /* Since we have one byte reserved for the register number argument to {start,stop}_memory, the maximum number of groups we can report things about is what fits in that byte. */ #define MAX_REGNUM 255 /* But patterns can have more than `MAX_REGNUM' registers. We just ignore the excess. */ typedef unsigned regnum_t; /* Macros for the compile stack. */ /* Since offsets can go either forwards or backwards, this type needs to be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ /* int may be not enough when sizeof(int) == 2. */ typedef long pattern_offset_t; typedef struct { pattern_offset_t begalt_offset; pattern_offset_t fixup_alt_jump; pattern_offset_t inner_group_offset; pattern_offset_t laststart_offset; regnum_t regnum; } compile_stack_elt_t; typedef struct { compile_stack_elt_t *stack; unsigned size; unsigned avail; /* Offset of next open position. */ } compile_stack_type; #define INIT_COMPILE_STACK_SIZE 32 #define COMPILE_STACK_EMPTY (compile_stack.avail == 0) #define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) /* Set the bit for character C in a list. */ #define SET_LIST_BIT(c) \ (b[((unsigned char) (c)) / BYTEWIDTH] \ |= 1 << (((unsigned char) c) % BYTEWIDTH)) /* Get the next unsigned number in the uncompiled pattern. */ #define GET_UNSIGNED_NUMBER(num) \ { if (p != pend) \ { \ PATFETCH (c); \ while (ISDIGIT (c)) \ { \ if (num < 0) \ num = 0; \ num = num * 10 + c - '0'; \ if (p == pend) \ break; \ PATFETCH (c); \ } \ } \ } #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX # else /* This shouldn't happen but some implementation might still have this problem. Use a reasonable default value. */ # define CHAR_CLASS_MAX_LENGTH 256 # endif # define IS_CHAR_CLASS(string) wctype (string) #else # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ # define IS_CHAR_CLASS(string) \ (STREQ (string, "alpha") || STREQ (string, "upper") \ || STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) #endif #ifndef MATCH_MAY_ALLOCATE /* If we cannot allocate large objects within re_match_2_internal, we make the fail stack and register vectors global. The fail stack, we grow to the maximum size when a regexp is compiled. The register vectors, we adjust in size each time we compile a regexp, according to the number of registers it needs. */ static fail_stack_type fail_stack; /* Size with which the following vectors are currently allocated. That is so we can make them bigger as needed, but never make them smaller. */ static int regs_allocated_size; static const char ** regstart, ** regend; static const char ** old_regstart, ** old_regend; static const char **best_regstart, **best_regend; static register_info_type *reg_info; static const char **reg_dummy; static register_info_type *reg_info_dummy; /* Make the register vectors big enough for NUM_REGS registers, but don't make them smaller. */ static regex_grow_registers (num_regs) int num_regs; { if (num_regs > regs_allocated_size) { RETALLOC_IF (regstart, num_regs, const char *); RETALLOC_IF (regend, num_regs, const char *); RETALLOC_IF (old_regstart, num_regs, const char *); RETALLOC_IF (old_regend, num_regs, const char *); RETALLOC_IF (best_regstart, num_regs, const char *); RETALLOC_IF (best_regend, num_regs, const char *); RETALLOC_IF (reg_info, num_regs, register_info_type); RETALLOC_IF (reg_dummy, num_regs, const char *); RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); regs_allocated_size = num_regs; } } #endif /* not MATCH_MAY_ALLOCATE */ static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type compile_stack, regnum_t regnum)); /* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. Returns one of error codes defined in `regex.h', or zero for success. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. If it succeeds, results are put in BUFP (if it returns an error, the contents of BUFP are undefined): `buffer' is the compiled pattern; `syntax' is set to SYNTAX; `used' is set to the length of the compiled pattern; `fastmap_accurate' is zero; `re_nsub' is the number of subexpressions in PATTERN; `not_bol' and `not_eol' are zero; The `fastmap' and `newline_anchor' fields are neither examined nor set. */ /* Return, freeing storage we allocated. */ #define FREE_STACK_RETURN(value) \ return (free (compile_stack.stack), value) static reg_errcode_t regex_compile (const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) { /* We fetch characters from PATTERN here. Even though PATTERN is `char *' (i.e., signed), we declare these variables as unsigned, so they can be reliably used as array indices. */ register unsigned char c, c1; /* A random temporary spot in PATTERN. */ const char *p1; /* Points to the end of the buffer, where we should append. */ register unsigned char *b; /* Keeps track of unclosed groups. */ compile_stack_type compile_stack; /* Points to the current (ending) position in the pattern. */ const char *p = pattern; const char *pend = pattern + size; /* How to translate the characters in the pattern. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Address of the count-byte of the most recently inserted `exactn' command. This makes it possible to tell if a new exact-match character can be added to that command or if the character requires a new `exactn' command. */ unsigned char *pending_exact = 0; /* Address of start of the most recently finished expression. This tells, e.g., postfix * where to find the start of its operand. Reset at the beginning of groups and alternatives. */ unsigned char *laststart = 0; /* Address of beginning of regexp, or inside of last group. */ unsigned char *begalt; /* Place in the uncompiled pattern (i.e., the {) to which to go back if the interval is invalid. */ const char *beg_interval; /* Address of the place where a forward jump should go to the end of the containing expression. Each alternative of an `or' -- except the last -- ends with a forward jump of this sort. */ unsigned char *fixup_alt_jump = 0; /* Counts open-groups as they are encountered. Remembered for the matching close-group on the compile stack, so the same register number is put in the stop_memory as the start_memory. */ regnum_t regnum = 0; #ifdef DEBUG DEBUG_PRINT1 ("\nCompiling pattern: "); if (debug) { unsigned debug_count; for (debug_count = 0; debug_count < size; debug_count++) putchar (pattern[debug_count]); putchar ('\n'); } #endif /* DEBUG */ /* Initialize the compile stack. */ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; compile_stack.size = INIT_COMPILE_STACK_SIZE; compile_stack.avail = 0; /* Initialize the pattern buffer. */ bufp->syntax = syntax; bufp->fastmap_accurate = 0; bufp->not_bol = bufp->not_eol = 0; /* Set `used' to zero, so that if we return an error, the pattern printer (for debugging) will think there's no pattern. We reset it at the end. */ bufp->used = 0; /* Always count groups, whether or not bufp->no_sub is set. */ bufp->re_nsub = 0; #if !defined (emacs) && !defined (SYNTAX_TABLE) /* Initialize the syntax table. */ init_syntax_once (); #endif if (bufp->allocated == 0) { if (bufp->buffer) { /* If zero allocated, but buffer is non-null, try to realloc enough space. This loses if buffer's address is bogus, but that is the user's responsibility. */ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); } else { /* Caller did not allocate a buffer. Do it for them. */ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); } if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE); bufp->allocated = INIT_BUF_SIZE; } begalt = b = bufp->buffer; /* Loop through the uncompiled pattern until we're at the end. */ while (p != pend) { PATFETCH (c); switch (c) { case '^': { if ( /* If at start of pattern, it's an operator. */ p == pattern + 1 /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's come before. */ || at_begline_loc_p (pattern, p, syntax)) BUF_PUSH (begline); else goto normal_char; } break; case '$': { if ( /* If at end of pattern, it's an operator. */ p == pend /* If context independent, it's an operator. */ || syntax & RE_CONTEXT_INDEP_ANCHORS /* Otherwise, depends on what's next. */ || at_endline_loc_p (p, pend, syntax)) BUF_PUSH (endline); else goto normal_char; } break; case '+': case '?': if ((syntax & RE_BK_PLUS_QM) || (syntax & RE_LIMITED_OPS)) goto normal_char; handle_plus: case '*': /* If there is no previous pattern... */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (!(syntax & RE_CONTEXT_INDEP_OPS)) goto normal_char; } { /* Are we optimizing this jump? */ boolean keep_string_p = false; /* 1 means zero (many) matches is allowed. */ char zero_times_ok = 0, many_times_ok = 0; /* If there is a sequence of repetition chars, collapse it down to just one (the right one). We can't combine interval operators with these because of, e.g., `a{2}*', which should only match an even number of `a's. */ for (;;) { zero_times_ok |= c != '+'; many_times_ok |= c != '?'; if (p == pend) break; PATFETCH (c); if (c == '*' || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) ; else if (syntax & RE_BK_PLUS_QM && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); if (!(c1 == '+' || c1 == '?')) { PATUNFETCH; PATUNFETCH; break; } c = c1; } else { PATUNFETCH; break; } /* If we get here, we found another repeat character. */ } /* Star, etc. applied to an empty pattern is equivalent to an empty pattern. */ if (!laststart) break; /* Now we know whether or not zero matches is allowed and also whether or not two or more matches is allowed. */ if (many_times_ok) { /* More than one repetition is allowed, so put in at the end a backward relative jump from `b' to before the next jump we're going to put in below (which jumps from laststart to after this jump). But if we are at the `*' in the exact sequence `.*\n', insert an unconditional jump backwards to the ., instead of the beginning of the loop. This way we only push a failure point once, instead of every time through the loop. */ assert (p - 1 > pattern); /* Allocate the space for the jump. */ GET_BUFFER_SPACE (3); /* We know we are not at the first character of the pattern, because laststart was nonzero. And we've already incremented `p', by the way, to be the character after the `*'. Do we have to do something analogous here for null bytes, because of RE_DOT_NOT_NULL? */ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') && zero_times_ok && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') && !(syntax & RE_DOT_NEWLINE)) { /* We have .*\n. */ STORE_JUMP (jump, b, laststart); keep_string_p = true; } else /* Anything else. */ STORE_JUMP (maybe_pop_jump, b, laststart - 3); /* We've added more stuff to the buffer. */ b += 3; } /* On failure, jump from laststart to b + 3, which will be the end of the buffer after this jump is inserted. */ GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump : on_failure_jump, laststart, b + 3); pending_exact = 0; b += 3; if (!zero_times_ok) { /* At least one repetition is required, so insert a `dummy_failure_jump' before the initial `on_failure_jump' instruction of the loop. This effects a skip over that instruction the first time we hit that loop. */ GET_BUFFER_SPACE (3); INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); b += 3; } } break; case '.': laststart = b; BUF_PUSH (anychar); break; case '[': { boolean had_char_class = false; if (p == pend) FREE_STACK_RETURN (REG_EBRACK); /* Ensure that we have enough space to push a charset: the opcode, the length count, and the bitset; 34 bytes in all. */ GET_BUFFER_SPACE (34); laststart = b; /* We test `*p == '^' twice, instead of using an if statement, so we only need one BUF_PUSH. */ BUF_PUSH (*p == '^' ? charset_not : charset); if (*p == '^') p++; /* Remember the first position in the bracket expression. */ p1 = p; /* Push the number of bytes in the bitmap. */ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); /* Clear the whole map. */ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); /* charset_not matches newline according to a syntax bit. */ if ((re_opcode_t) b[-2] == charset_not && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) SET_LIST_BIT ('\n'); /* Read in characters and ranges, setting map bits. */ for (;;) { if (p == pend) FREE_STACK_RETURN (REG_EBRACK); PATFETCH (c); /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); SET_LIST_BIT (c1); continue; } /* Could be the end of the bracket expression. If it's not (i.e., when the bracket expression is `[]' so far), the ']' character bit gets set way below. */ if (c == ']' && p != p1 + 1) break; /* Look ahead to see if it's a range when the last thing was a character class. */ if (had_char_class && c == '-' && *p != ']') FREE_STACK_RETURN (REG_ERANGE); /* Look ahead to see if it's a range when the last thing was a character: if this is a hyphen not at the beginning or the end of a list, then it's the range operator. */ if (c == '-' && !(p - 2 >= pattern && p[-2] == '[') && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') && *p != ']') { reg_errcode_t ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } else if (p[0] == '-' && p[1] != ']') { /* This handles ranges made up of characters only. */ reg_errcode_t ret; /* Move past the `-'. */ PATFETCH (c1); ret = compile_range (&p, pend, translate, syntax, b); if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); } /* See if we're at the beginning of a possible character class. */ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') { /* Leave room for the null. */ char str[CHAR_CLASS_MAX_LENGTH + 1]; PATFETCH (c); c1 = 0; /* If pattern is `[[:'. */ if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (;;) { PATFETCH (c); if (c == ':' || c == ']' || p == pend || c1 == CHAR_CLASS_MAX_LENGTH) break; str[c1++] = c; } str[c1] = '\0'; /* If isn't a word bracketed by `[:' and:`]': undo the ending character, the letters, and leave the leading `:' and `[' (but set bits for them). */ if (c == ':' && *p == ']') { #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) boolean is_lower = STREQ (str, "lower"); boolean is_upper = STREQ (str, "upper"); wctype_t wt; int ch; wt = wctype (str); if (wt == 0) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) { if (iswctype (btowc (ch), wt)) SET_LIST_BIT (ch); if (translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; #else int ch; boolean is_alnum = STREQ (str, "alnum"); boolean is_alpha = STREQ (str, "alpha"); boolean is_blank = STREQ (str, "blank"); boolean is_cntrl = STREQ (str, "cntrl"); boolean is_digit = STREQ (str, "digit"); boolean is_graph = STREQ (str, "graph"); boolean is_lower = STREQ (str, "lower"); boolean is_print = STREQ (str, "print"); boolean is_punct = STREQ (str, "punct"); boolean is_space = STREQ (str, "space"); boolean is_upper = STREQ (str, "upper"); boolean is_xdigit = STREQ (str, "xdigit"); if (!IS_CHAR_CLASS (str)) FREE_STACK_RETURN (REG_ECTYPE); /* Throw away the ] at the end of the character class. */ PATFETCH (c); if (p == pend) FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { /* This was split into 3 if's to avoid an arbitrary limit in some compiler. */ if ( (is_alnum && ISALNUM (ch)) || (is_alpha && ISALPHA (ch)) || (is_blank && ISBLANK (ch)) || (is_cntrl && ISCNTRL (ch))) SET_LIST_BIT (ch); if ( (is_digit && ISDIGIT (ch)) || (is_graph && ISGRAPH (ch)) || (is_lower && ISLOWER (ch)) || (is_print && ISPRINT (ch))) SET_LIST_BIT (ch); if ( (is_punct && ISPUNCT (ch)) || (is_space && ISSPACE (ch)) || (is_upper && ISUPPER (ch)) || (is_xdigit && ISXDIGIT (ch))) SET_LIST_BIT (ch); if ( translate && (is_upper || is_lower) && (ISUPPER (ch) || ISLOWER (ch))) SET_LIST_BIT (ch); } had_char_class = true; #endif /* libc || wctype.h */ } else { c1++; while (c1--) PATUNFETCH; SET_LIST_BIT ('['); SET_LIST_BIT (':'); had_char_class = false; } } else { had_char_class = false; SET_LIST_BIT (c); } } /* Discard any (non)matching list bytes that are all 0 at the end of the map. Decrease the map-length byte too. */ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; b += b[-1]; } break; case '(': if (syntax & RE_NO_BK_PARENS) goto handle_open; else goto normal_char; case ')': if (syntax & RE_NO_BK_PARENS) goto handle_close; else goto normal_char; case '\n': if (syntax & RE_NEWLINE_ALT) goto handle_alt; else goto normal_char; case '|': if (syntax & RE_NO_BK_VBAR) goto handle_alt; else goto normal_char; case '{': if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) goto handle_interval; else goto normal_char; case '\\': if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); /* Do not translate the character after the \, so that we can distinguish, e.g., \B from \b, even if we normally would translate, e.g., B to b. */ PATFETCH_RAW (c); switch (c) { case '(': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; handle_open: bufp->re_nsub++; regnum++; if (COMPILE_STACK_FULL) { RETALLOC (compile_stack.stack, compile_stack.size << 1, compile_stack_elt_t); if (compile_stack.stack == NULL) return REG_ESPACE; compile_stack.size <<= 1; } /* These are the values to restore when we hit end of this group. They are all relative offsets, so that if the whole pattern moves because of realloc, they will still be valid. */ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; COMPILE_STACK_TOP.fixup_alt_jump = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; COMPILE_STACK_TOP.regnum = regnum; /* We will eventually replace the 0 with the number of groups inner to this one. But do not push a start_memory for groups beyond the last one we can represent in the compiled pattern. */ if (regnum <= MAX_REGNUM) { COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; BUF_PUSH_3 (start_memory, regnum, 0); } compile_stack.avail++; fixup_alt_jump = 0; laststart = 0; begalt = b; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; break; case ')': if (syntax & RE_NO_BK_PARENS) goto normal_backslash; if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_backslash; else FREE_STACK_RETURN (REG_ERPAREN); } handle_close: if (fixup_alt_jump) { /* Push a dummy failure point at the end of the alternative for a possible future `pop_failure_jump' to pop. See comments at `push_dummy_failure' in `re_match_2'. */ BUF_PUSH (push_dummy_failure); /* We allocated space for this jump when we assigned to `fixup_alt_jump', in the `handle_alt' case below. */ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); } /* See similar code for backslashed left paren above. */ if (COMPILE_STACK_EMPTY) { if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) goto normal_char; else FREE_STACK_RETURN (REG_ERPAREN); } /* Since we just checked for an empty stack above, this ``can't happen''. */ assert (compile_stack.avail != 0); { /* We don't just want to restore into `regnum', because later groups should continue to be numbered higher, as in `(ab)c(de)' -- the second group is #2. */ regnum_t this_group_regnum; compile_stack.avail--; begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; /* If we've reached MAX_REGNUM groups, then this open won't actually generate any code, so we'll have to clear pending_exact explicitly. */ pending_exact = 0; /* We're at the end of the group, so now we know how many groups were inside this one. */ if (this_group_regnum <= MAX_REGNUM) { unsigned char *inner_group_loc = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; *inner_group_loc = regnum - this_group_regnum; BUF_PUSH_3 (stop_memory, this_group_regnum, regnum - this_group_regnum); } } break; case '|': /* `\|'. */ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) goto normal_backslash; handle_alt: if (syntax & RE_LIMITED_OPS) goto normal_char; /* Insert before the previous alternative a jump which jumps to this alternative if the former fails. */ GET_BUFFER_SPACE (3); INSERT_JUMP (on_failure_jump, begalt, b + 6); pending_exact = 0; b += 3; /* The alternative before this one has a jump after it which gets executed if it gets matched. Adjust that jump so it will jump to this alternative's analogous jump (put in below, which in turn will jump to the next (if any) alternative's such jump, etc.). The last such jump jumps to the correct final destination. A picture: _____ _____ | | | | | v | v a | b | c If we are at `b', then fixup_alt_jump right now points to a three-byte space after `a'. We'll put in the jump, set fixup_alt_jump to right after `b', and leave behind three bytes which we'll fill in when we get to after `c'. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); /* Mark and leave space for a jump after this alternative, to be filled in later either by next alternative or when know we're at the end of a series of alternatives. */ fixup_alt_jump = b; GET_BUFFER_SPACE (3); b += 3; laststart = 0; begalt = b; break; case '{': /* If \{ is a literal. */ if (!(syntax & RE_INTERVALS) /* If we're at `\{' and it's not the open-interval operator. */ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) || (p - 2 == pattern && p == pend)) goto normal_backslash; handle_interval: { /* If got here, then the syntax allows intervals. */ /* At least (most) this many matches must be made. */ int lower_bound = -1, upper_bound = -1; beg_interval = p - 1; if (p == pend) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_EBRACE); } GET_UNSIGNED_NUMBER (lower_bound); if (c == ',') { GET_UNSIGNED_NUMBER (upper_bound); if (upper_bound < 0) upper_bound = RE_DUP_MAX; } else /* Interval such as `{1}' => match exactly once. */ upper_bound = lower_bound; if (lower_bound < 0 || upper_bound > RE_DUP_MAX || lower_bound > upper_bound) { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } if (!(syntax & RE_NO_BK_BRACES)) { if (c != '\\') FREE_STACK_RETURN (REG_EBRACE); PATFETCH (c); } if (c != '}') { if (syntax & RE_NO_BK_BRACES) goto unfetch_interval; else FREE_STACK_RETURN (REG_BADBR); } /* We just parsed a valid interval. */ /* If it's invalid to have no preceding re. */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) FREE_STACK_RETURN (REG_BADRPT); else if (syntax & RE_CONTEXT_INDEP_OPS) laststart = b; else goto unfetch_interval; } /* If the upper bound is zero, don't want to succeed at all; jump from `laststart' to `b + 3', which will be the end of the buffer after we insert the jump. */ if (upper_bound == 0) { GET_BUFFER_SPACE (3); INSERT_JUMP (jump, laststart, b + 3); b += 3; } /* Otherwise, we have a nontrivial interval. When we're all done, the pattern will look like: set_number_at set_number_at succeed_n jump_n (The upper bound and `jump_n' are omitted if `upper_bound' is 1, though.) */ else { /* If the upper bound is > 1, we need to insert more at the end of the loop. */ unsigned nbytes = 10 + (upper_bound > 1) * 10; GET_BUFFER_SPACE (nbytes); /* Initialize lower bound of the `succeed_n', even though it will be set during matching by its attendant `set_number_at' (inserted next), because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, b + 5 + (upper_bound > 1) * 5, lower_bound); b += 5; /* Code to initialize the lower bound. Insert before the `succeed_n'. The `5' is the last two bytes of this `set_number_at', plus 3 bytes of the following `succeed_n'. */ insert_op2 (set_number_at, laststart, 5, lower_bound, b); b += 5; if (upper_bound > 1) { /* More than one repetition is allowed, so append a backward jump to the `succeed_n' that starts this interval. When we've reached this during matching, we'll have matched the interval once, so jump back only `upper_bound - 1' times. */ STORE_JUMP2 (jump_n, b, laststart + 5, upper_bound - 1); b += 5; /* The location we want to set is the second parameter of the `jump_n'; that is `b-2' as an absolute address. `laststart' will be the `set_number_at' we're about to insert; `laststart+3' the number to set, the source for the relative address. But we are inserting into the middle of the pattern -- so everything is getting moved up by 5. Conclusion: (b - 2) - (laststart + 3) + 5, i.e., b - laststart. We insert this at the beginning of the loop so that if we fail during matching, we'll reinitialize the bounds. */ insert_op2 (set_number_at, laststart, b - laststart, upper_bound - 1, b); b += 5; } } pending_exact = 0; beg_interval = NULL; } break; unfetch_interval: /* If an invalid interval, match the characters as literals. */ assert (beg_interval); p = beg_interval; beg_interval = NULL; /* normal_char and normal_backslash need `c'. */ PATFETCH (c); if (!(syntax & RE_NO_BK_BRACES)) { if (p > pattern && p[-1] == '\\') goto normal_backslash; } goto normal_char; #ifdef emacs /* There is no way to specify the before_dot and after_dot operators. rms says this is ok. --karl */ case '=': BUF_PUSH (at_dot); break; case 's': laststart = b; PATFETCH (c); BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); break; case 'S': laststart = b; PATFETCH (c); BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); break; #endif /* emacs */ case 'w': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (wordchar); break; case 'W': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; laststart = b; BUF_PUSH (notwordchar); break; case '<': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbeg); break; case '>': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordend); break; case 'b': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (wordbound); break; case 'B': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (notwordbound); break; case '`': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (begbuf); break; case '\'': if (re_syntax_options & RE_NO_GNU_OPS) goto normal_char; BUF_PUSH (endbuf); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (syntax & RE_NO_BK_REFS) goto normal_char; c1 = c - '0'; if (c1 > regnum) FREE_STACK_RETURN (REG_ESUBREG); /* Can't back reference to a subexpression if inside of it. */ if (group_in_compile_stack (compile_stack, (regnum_t) c1)) goto normal_char; laststart = b; BUF_PUSH_2 (duplicate, c1); break; case '+': case '?': if (syntax & RE_BK_PLUS_QM) goto handle_plus; else goto normal_backslash; default: normal_backslash: /* You might think it would be useful for \ to mean not to translate; but if we don't translate it it will never match anything. */ c = TRANSLATE (c); goto normal_char; } break; default: /* Expects the character in `c'. */ normal_char: /* If no exactn currently being built. */ if (!pending_exact /* If last exactn not at current position. */ || pending_exact + *pending_exact + 1 != b /* We have only one byte following the exactn for the count. */ || *pending_exact == (1 << BYTEWIDTH) - 1 /* If followed by a repetition operator. */ || *p == '*' || *p == '^' || ((syntax & RE_BK_PLUS_QM) ? *p == '\\' && (p[1] == '+' || p[1] == '?') : (*p == '+' || *p == '?')) || ((syntax & RE_INTERVALS) && ((syntax & RE_NO_BK_BRACES) ? *p == '{' : (p[0] == '\\' && p[1] == '{')))) { /* Start building a new exactn. */ laststart = b; BUF_PUSH_2 (exactn, 0); pending_exact = b - 1; } BUF_PUSH (c); (*pending_exact)++; break; } /* switch (c) */ } /* while p != pend */ /* Through the pattern now. */ if (fixup_alt_jump) STORE_JUMP (jump_past_alt, fixup_alt_jump, b); if (!COMPILE_STACK_EMPTY) FREE_STACK_RETURN (REG_EPAREN); /* If we don't want backtracking, force success the first time we reach the end of the compiled pattern. */ if (syntax & RE_NO_POSIX_BACKTRACKING) BUF_PUSH (succeed); free (compile_stack.stack); /* We have succeeded; set the length of the buffer. */ bufp->used = b - bufp->buffer; #ifdef DEBUG if (debug) { DEBUG_PRINT1 ("\nCompiled pattern: \n"); print_compiled_pattern (bufp); } #endif /* DEBUG */ #ifndef MATCH_MAY_ALLOCATE /* Initialize the failure stack to the largest possible stack. This isn't necessary unless we're trying to avoid calling alloca in the search and match routines. */ { int num_regs = bufp->re_nsub + 1; /* Since DOUBLE_FAIL_STACK refuses to double only if the current size is strictly greater than re_max_failures, the largest possible stack is 2 * re_max_failures failure points. */ if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS)) { fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); #ifdef emacs if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) xmalloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) xrealloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); #else /* not emacs */ if (! fail_stack.stack) fail_stack.stack = (fail_stack_elt_t *) malloc (fail_stack.size * sizeof (fail_stack_elt_t)); else fail_stack.stack = (fail_stack_elt_t *) realloc (fail_stack.stack, (fail_stack.size * sizeof (fail_stack_elt_t))); #endif /* not emacs */ } regex_grow_registers (num_regs); } #endif /* not MATCH_MAY_ALLOCATE */ return REG_NOERROR; } /* regex_compile */ /* Subroutines for `regex_compile'. */ /* Store OP at LOC followed by two-byte integer parameter ARG. */ static void store_op1 (re_opcode_t op, unsigned char *loc, int arg) { *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg); } /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ static void store_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2) { *loc = (unsigned char) op; STORE_NUMBER (loc + 1, arg1); STORE_NUMBER (loc + 3, arg2); } /* Copy the bytes from LOC to END to open up three bytes of space at LOC for OP followed by two-byte integer parameter ARG. */ static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end) { register unsigned char *pfrom = end; register unsigned char *pto = end + 3; while (pfrom != loc) *--pto = *--pfrom; store_op1 (op, loc, arg); } /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end) { register unsigned char *pfrom = end; register unsigned char *pto = end + 5; while (pfrom != loc) *--pto = *--pfrom; store_op2 (op, loc, arg1, arg2); } /* P points to just after a ^ in PATTERN. Return true if that ^ comes after an alternative or a begin-subexpression. We assume there is at least one character before the ^. */ static boolean at_begline_loc_p(const char *pattern, const char *p, reg_syntax_t syntax) { const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; return /* After a subexpression? */ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) /* After an alternative? */ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); } /* The dual of at_begline_loc_p. This one is for $. We assume there is at least one character after the $, i.e., `P < PEND'. */ static boolean at_endline_loc_p(const char *p, const char *pend, reg_syntax_t syntax) { const char *next = p; boolean next_backslash = *next == '\\'; const char *next_next = p + 1 < pend ? p + 1 : 0; return /* Before a subexpression? */ (syntax & RE_NO_BK_PARENS ? *next == ')' : next_backslash && next_next && *next_next == ')') /* Before an alternative? */ || (syntax & RE_NO_BK_VBAR ? *next == '|' : next_backslash && next_next && *next_next == '|'); } /* Returns true if REGNUM is in one of COMPILE_STACK's elements and false if it's not. */ static boolean group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum) { int this_element; for (this_element = compile_stack.avail - 1; this_element >= 0; this_element--) if (compile_stack.stack[this_element].regnum == regnum) return true; return false; } /* Read the ending character of a range (in a bracket expression) from the uncompiled pattern *P_PTR (which ends at PEND). We assume the starting character is in `P[-2]'. (`P[-1]' is the character `-'.) Then we set the translation of all bits between the starting and ending characters (inclusive) in the compiled pattern B. Return an error code. We use these short variable names so we can use the same macros as `regex_compile' itself. */ static reg_errcode_t compile_range(const char **p_ptr, const char *pend, RE_TRANSLATE_TYPE translate, reg_syntax_t syntax, unsigned char *b) { unsigned this_char; const char *p = *p_ptr; unsigned int range_start, range_end; if (p == pend) return REG_ERANGE; /* Even though the pattern is a signed `char *', we need to fetch with unsigned char *'s; if the high bit of the pattern character is set, the range endpoints will be negative if we fetch using a signed char *. We also want to fetch the endpoints without translating them; the appropriate translation is done in the bit-setting loop below. */ /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */ range_start = ((const unsigned char *) p)[-2]; range_end = ((const unsigned char *) p)[0]; /* Have to increment the pointer into the pattern string, so the caller isn't still at the ending character. */ (*p_ptr)++; /* If the start is after the end, the range is empty. */ if (range_start > range_end) return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; /* Here we see why `this_char' has to be larger than an `unsigned char' -- the range is inclusive, so if `range_end' == 0xff (assuming 8-bit characters), we would otherwise go into an infinite loop, since all characters <= 0xff. */ for (this_char = range_start; this_char <= range_end; this_char++) { SET_LIST_BIT (TRANSLATE (this_char)); } return REG_NOERROR; } /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible characters can start a string that matches the pattern. This fastmap is used by re_search to skip quickly over impossible starting points. The caller must supply the address of a (1 << BYTEWIDTH)-byte data area as BUFP->fastmap. We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in the pattern buffer. Returns 0 if we succeed, -2 if an internal error. */ int re_compile_fastmap(struct re_pattern_buffer *bufp) { int j, k; #ifdef MATCH_MAY_ALLOCATE fail_stack_type fail_stack; #endif #ifndef REGEX_MALLOC char *destination; #endif register char *fastmap = bufp->fastmap; unsigned char *pattern = bufp->buffer; unsigned char *p = pattern; register unsigned char *pend = pattern + bufp->used; #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* Assume that each path through the pattern can be null until proven otherwise. We set this false at the bottom of switch statement, to which we get only if a particular path doesn't match the empty string. */ boolean path_can_be_null = true; /* We aren't doing a `succeed_n' to begin with. */ boolean succeed_n_p = false; assert (fastmap != NULL && p != NULL); INIT_FAIL_STACK (); bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ bufp->fastmap_accurate = 1; /* It will be when we're done. */ bufp->can_be_null = 0; while (1) { if (p == pend || *p == succeed) { /* We have reached the (effective) end of pattern. */ if (!FAIL_STACK_EMPTY ()) { bufp->can_be_null |= path_can_be_null; /* Reset for next path. */ path_can_be_null = true; p = fail_stack.stack[--fail_stack.avail].pointer; continue; } else break; } /* We should never be about to go beyond the end of the pattern. */ assert (p < pend); switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* I guess the idea here is to simply not bother with a fastmap if a backreference is used, since it's too hard to figure out the fastmap for the corresponding group. Setting `can_be_null' stops `re_search_2' from using the fastmap, so that is all we do. */ case duplicate: bufp->can_be_null = 1; goto done; /* Following are the cases which match a character. These end with `break'. */ case exactn: fastmap[p[1]] = 1; break; case charset: for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) fastmap[j] = 1; break; case charset_not: /* Chars beyond end of map must be allowed. */ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) fastmap[j] = 1; break; case wordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == Sword) fastmap[j] = 1; break; case notwordchar: for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != Sword) fastmap[j] = 1; break; case anychar: { int fastmap_newline = fastmap['\n']; /* `.' matches anything ... */ for (j = 0; j < (1 << BYTEWIDTH); j++) fastmap[j] = 1; /* ... except perhaps newline. */ if (!(bufp->syntax & RE_DOT_NEWLINE)) fastmap['\n'] = fastmap_newline; /* Return if we have already set `can_be_null'; if we have, then the fastmap is irrelevant. Something's wrong here. */ else if (bufp->can_be_null) goto done; /* Otherwise, have to check alternative paths. */ break; } #ifdef emacs case syntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) == (enum syntaxcode) k) fastmap[j] = 1; break; case notsyntaxspec: k = *p++; for (j = 0; j < (1 << BYTEWIDTH); j++) if (SYNTAX (j) != (enum syntaxcode) k) fastmap[j] = 1; break; /* All cases after this match the empty string. These end with `continue'. */ case before_dot: case at_dot: case after_dot: continue; #endif /* emacs */ case no_op: case begline: case endline: case begbuf: case endbuf: case wordbound: case notwordbound: case wordbeg: case wordend: case push_dummy_failure: continue; case jump_n: case pop_failure_jump: case maybe_pop_jump: case jump: case jump_past_alt: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); p += j; if (j > 0) continue; /* Jump backward implies we just went through the body of a loop and matched nothing. Opcode jumped to should be `on_failure_jump' or `succeed_n'. Just treat it like an ordinary jump. For a * loop, it has pushed its failure point already; if so, discard that as redundant. */ if ((re_opcode_t) *p != on_failure_jump && (re_opcode_t) *p != succeed_n) continue; p++; EXTRACT_NUMBER_AND_INCR (j, p); p += j; /* If what's on the stack is where we are now, pop it. */ if (!FAIL_STACK_EMPTY () && fail_stack.stack[fail_stack.avail - 1].pointer == p) fail_stack.avail--; continue; case on_failure_jump: case on_failure_keep_string_jump: handle_on_failure_jump: EXTRACT_NUMBER_AND_INCR (j, p); /* For some patterns, e.g., `(a?)?', `p+j' here points to the end of the pattern. We don't want to push such a point, since when we restore it above, entering the switch will increment `p' past the end of the pattern. We don't need to push such a point since we obviously won't find any more fastmap entries beyond `pend'. Such a pattern can match the null string, though. */ if (p + j < pend) { if (!PUSH_PATTERN_OP (p + j, fail_stack)) { RESET_FAIL_STACK (); return -2; } } else bufp->can_be_null = 1; if (succeed_n_p) { EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ succeed_n_p = false; } continue; case succeed_n: /* Get to the number of times to succeed. */ p += 2; /* Increment p past the n for when k != 0. */ EXTRACT_NUMBER_AND_INCR (k, p); if (k == 0) { p -= 4; succeed_n_p = true; /* Spaghetti code alert. */ goto handle_on_failure_jump; } continue; case set_number_at: p += 4; continue; case start_memory: case stop_memory: p += 2; continue; default: abort (); /* We have listed all the cases. */ } /* switch *p++ */ /* Getting here means we have found the possible starting characters for one path of the pattern -- and that the empty string does not match. We need not follow this path further. Instead, look at the next alternative (remembered on the stack), or quit if no more. The test at the top of the loop does these things. */ path_can_be_null = false; p = pend; } /* while p */ /* Set `can_be_null' for the last path (also the first path, if the pattern is empty). */ bufp->can_be_null |= path_can_be_null; done: RESET_FAIL_STACK (); return 0; } /* re_compile_fastmap */ /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated using the malloc library routine, and must each be at least NUM_REGS * sizeof (regoff_t) bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ void re_set_registers(struct re_pattern_buffer *bufp, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends) { if (num_regs) { bufp->regs_allocated = REGS_REALLOCATE; regs->num_regs = num_regs; regs->start = starts; regs->end = ends; } else { bufp->regs_allocated = REGS_UNALLOCATED; regs->num_regs = 0; regs->start = regs->end = (regoff_t *) 0; } } /* Searching routines. */ /* Like re_search_2, below, but only one string is specified, and doesn't let you say where to stop matching. */ int re_search(struct re_pattern_buffer *bufp, const char *string, int size, int startpos, int range, struct re_registers *regs) { return re_search_2 (bufp, NULL, 0, string, size, startpos, range, regs, size); } /* Using the compiled pattern in BUFP->buffer, first tries to match the virtual concatenation of STRING1 and STRING2, starting first at index STARTPOS, then at STARTPOS + 1, and so on. STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. RANGE is how far to scan while trying to match. RANGE = 0 means try only at STARTPOS; in general, the last start tried is STARTPOS + RANGE. In REGS, return the indices of the virtual concatenation of STRING1 and STRING2 that matched the entire BUFP->buffer and its contained subexpressions. Do not consider matching one past the index STOP in the virtual concatenation of STRING1 and STRING2. We return either the position in the strings at which the match was found, -1 if no match, or -2 if error (such as failure stack overflow). */ int re_search_2(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int startpos, int range, struct re_registers *regs, int stop) { int val; register char *fastmap = bufp->fastmap; register RE_TRANSLATE_TYPE translate = bufp->translate; int total_size = size1 + size2; int endpos = startpos + range; /* Check for out-of-range STARTPOS. */ if (startpos < 0 || startpos > total_size) return -1; /* Fix up RANGE if it might eventually take us outside the virtual concatenation of STRING1 and STRING2. Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ if (endpos < 0) range = 0 - startpos; else if (endpos > total_size) range = total_size - startpos; /* If the search isn't to be a backwards one, don't waste time in a search for a pattern that must be anchored. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) { if (startpos > 0) return -1; else range = 1; } #ifdef emacs /* In a forward search for something that starts with \=. don't keep searching past point. */ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0) { range = PT - startpos; if (range <= 0) return -1; } #endif /* emacs */ /* Update the fastmap now if not correct already. */ if (fastmap && !bufp->fastmap_accurate) if (re_compile_fastmap (bufp) == -2) return -2; /* Loop through the string, looking for a place to start matching. */ for (;;) { /* If a fastmap is supplied, skip quickly over characters that cannot be the start of a match. If the pattern can match the null string, however, we don't need to skip characters; we want the first null string. */ if (fastmap && startpos < total_size && !bufp->can_be_null) { if (range > 0) /* Searching forwards. */ { register const char *d; register int lim = 0; int irange = range; if (startpos < size1 && startpos + range >= size1) lim = range - (size1 - startpos); d = (startpos >= size1 ? string2 - size1 : string1) + startpos; /* Written out as an if-else to avoid testing `translate' inside the loop. */ if (translate) while (range > lim && !fastmap[(unsigned char) translate[(unsigned char) *d++]]) range--; else while (range > lim && !fastmap[(unsigned char) *d++]) range--; startpos += irange - range; } else /* Searching backwards. */ { register char c = (size1 == 0 || startpos >= size1 ? string2[startpos - size1] : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; } } /* If can't match the null string, and that's all we have left, fail. */ if (range >= 0 && startpos == total_size && fastmap && !bufp->can_be_null) return -1; val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif if (val >= 0) return startpos; if (val == -2) return -2; advance: if (!range) break; else if (range > 0) { range--; startpos++; } else { range++; startpos--; } } return -1; } /* re_search_2 */ /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ #define POINTER_TO_OFFSET(ptr) \ (FIRST_STRING_P (ptr) \ ? ((regoff_t) ((ptr) - string1)) \ : ((regoff_t) ((ptr) - string2 + size1))) /* Macros for dealing with the split strings in re_match_2. */ #define MATCHING_IN_FIRST_STRING (dend == end_match_1) /* Call before fetching a character with *d. This switches over to string2 if necessary. */ #define PREFETCH() \ while (d == dend) \ { \ /* End of string2 => fail. */ \ if (dend == end_match_2) \ goto fail; \ /* End of string1 => advance to string2. */ \ d = string2; \ dend = end_match_2; \ } /* Test if at very beginning or at very end of the virtual concatenation of `string1' and `string2'. If only one string, it's `string2'. */ #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) #define AT_STRINGS_END(d) ((d) == end2) /* Test if D points to a character which is word-constituent. We have two special cases to check for: if past the end of string1, look at the first character in string2; and if before the beginning of string2, look at the last character in string1. */ #define WORDCHAR_P(d) \ (SYNTAX ((d) == end1 ? *string2 \ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ == Sword) /* Disabled due to a compiler bug -- see comment at case wordbound */ #if 0 /* Test if the character before D and the one at D differ with respect to being word-constituent. */ #define AT_WORD_BOUNDARY(d) \ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) #endif /* Free everything we malloc. */ #ifdef MATCH_MAY_ALLOCATE #define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL #define FREE_VARIABLES() \ do { \ REGEX_FREE_STACK (fail_stack.stack); \ FREE_VAR ((void*) regstart); \ FREE_VAR ((void*) regend); \ FREE_VAR ((void*) old_regstart); \ FREE_VAR ((void*) old_regend); \ FREE_VAR ((void*) best_regstart); \ FREE_VAR ((void*) best_regend); \ FREE_VAR ((void*) reg_info); \ FREE_VAR ((void*) reg_dummy); \ FREE_VAR ((void*) reg_info_dummy); \ } while (0) #else #define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */ #endif /* not MATCH_MAY_ALLOCATE */ /* These values must meet several constraints. They must not be valid register values; since we have a limit of 255 registers (because we use only one byte in the pattern for the register number), we can use numbers larger than 255. They must differ by 1, because of NUM_FAILURE_ITEMS above. And the value for the lowest register must be larger than the value for the highest register, so we do not try to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) /* Matching routines. */ #ifndef emacs /* Emacs never uses this. */ /* re_match is like re_match_2 except it takes only a single string. */ int re_match(struct re_pattern_buffer *bufp, const char *string, int size, int pos, struct re_registers *regs) { int result = re_match_2_internal (bufp, NULL, 0, string, size, pos, regs, size); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif return result; } #endif /* not emacs */ static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info)); static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p, unsigned char *end, register_info_type *reg_info)); static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info)); static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2, int len, char *translate)); /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 and SIZE2, respectively). We start matching at POS, and stop matching at STOP. If REGS is non-null and the `no_sub' field of BUFP is nonzero, we store offsets for the substring each group matched in REGS. See the documentation for exactly how many groups we fill. We return -1 if no match, -2 if an internal error (such as the failure stack overflowing). Otherwise, we return the length of the matched substring. */ int re_match_2(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop) { int result = re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop); #ifndef REGEX_MALLOC #ifdef C_ALLOCA alloca (0); #endif #endif return result; } /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1, int size1, const char *string2, int size2, int pos, struct re_registers *regs, int stop) { /* General temporaries. */ int mcnt; unsigned char *p1; /* Just past the end of the corresponding string. */ const char *end1, *end2; /* Pointers into string1 and string2, just past the last characters in each to consider matching. */ const char *end_match_1, *end_match_2; /* Where we are in the data, and the end of the current string. */ const char *d, *dend; /* Where we are in the pattern, and the end of the pattern. */ unsigned char *p = bufp->buffer; register unsigned char *pend = p + bufp->used; /* Mark the opcode just after a start_memory, so we can test for an empty subpattern when we get to the stop_memory. */ unsigned char *just_past_start_mem = 0; /* We use this to map every character in the string. */ RE_TRANSLATE_TYPE translate = bufp->translate; /* Failure point stack. Each place that can handle a failure further down the line pushes a failure point on this stack. It consists of restart, regend, and reg_info for all registers corresponding to the subexpressions we're currently inside, plus the number of such registers, and, finally, two char *'s. The first char * is where to resume scanning the pattern; the second one is where to resume scanning the strings. If the latter is zero, the failure point is a ``dummy''; if a failure happens and the failure point is a dummy, it gets discarded and the next next one is tried. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ fail_stack_type fail_stack; #endif #ifdef DEBUG static unsigned failure_id = 0; unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; #endif #ifdef REL_ALLOC /* This holds the pointer to the failure stack, when it is allocated relocatably. */ fail_stack_elt_t *failure_stack_ptr; #endif /* We fill all the registers internally, independent of what we return, for use in backreferences. The number here includes an element for register zero. */ size_t num_regs = bufp->re_nsub + 1; /* The currently active registers. */ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG; active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG; /* Information on the contents of registers. These are pointers into the input strings; they record just what was matched (on this attempt) by a subexpression part of the pattern, that is, the regnum-th regstart pointer points to where in the pattern we began matching and the regnum-th regend points to right after where we stopped matching the regnum-th subexpression. (The zeroth register keeps track of what the whole pattern matches.) */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **regstart, **regend; #endif /* If a group that's operated upon by a repetition operator fails to match anything, then the register for its start will need to be restored because it will have been set to wherever in the string we are when we last see its open-group operator. Similarly for a register's end. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **old_regstart, **old_regend; #endif /* The is_active field of reg_info helps us keep track of which (possibly nested) subexpressions we are currently in. The matched_something field of reg_info[reg_num] helps us tell whether or not we have matched any of the pattern so far this time through the reg_num-th subexpression. These two fields get reset each time through any loop their register is in. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ register_info_type *reg_info; #endif /* The following record the register info as found in the above variables when we find a match better than any we've seen before. This happens as we backtrack through the failure points, which in turn happens only if we have not yet matched the entire string. */ unsigned best_regs_set = false; #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **best_regstart, **best_regend; #endif /* Logically, this is `best_regend[0]'. But we don't want to have to allocate space for that if we're not allocating space for anything else (see below). Also, we never need info about register 0 for any of the other register vectors, and it seems rather a kludge to treat `best_regend' differently than the rest. So we keep track of the end of the best match so far in a separate variable. We initialize this to NULL so that when we backtrack the first time and need to test it, it's not garbage. */ const char *match_end = NULL; /* This helps SET_REGS_MATCHED avoid doing redundant work. */ int set_regs_matched_done = 0; /* Used when we pop values we don't care about. */ #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ const char **reg_dummy; register_info_type *reg_info_dummy; #endif #ifdef DEBUG /* Counts the total number of registers pushed. */ unsigned num_regs_pushed = 0; #endif DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); INIT_FAIL_STACK (); #ifdef MATCH_MAY_ALLOCATE /* Do not bother to initialize all the register variables if there are no groups in the pattern, as it takes a fair amount of time. If there are groups, we include space for register 0 (the whole pattern), even though we never use it, since it simplifies the array indexing. We should fix this. */ if (bufp->re_nsub) { regstart = REGEX_TALLOC (num_regs, const char *); regend = REGEX_TALLOC (num_regs, const char *); old_regstart = REGEX_TALLOC (num_regs, const char *); old_regend = REGEX_TALLOC (num_regs, const char *); best_regstart = REGEX_TALLOC (num_regs, const char *); best_regend = REGEX_TALLOC (num_regs, const char *); reg_info = REGEX_TALLOC (num_regs, register_info_type); reg_dummy = REGEX_TALLOC (num_regs, const char *); reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); if (!(regstart && regend && old_regstart && old_regend && reg_info && best_regstart && best_regend && reg_dummy && reg_info_dummy)) { FREE_VARIABLES (); return -2; } } else { /* We must initialize all our variables to NULL, so that `FREE_VARIABLES' doesn't try to free them. */ regstart = regend = old_regstart = old_regend = best_regstart = best_regend = reg_dummy = NULL; reg_info = reg_info_dummy = (register_info_type *) NULL; } #endif /* MATCH_MAY_ALLOCATE */ /* The starting position is bogus. */ if (pos < 0 || pos > size1 + size2) { FREE_VARIABLES (); return -1; } /* Initialize subexpression text positions to -1 to mark ones that no start_memory/stop_memory has been seen for. Also initialize the register information struct. */ for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = regend[mcnt] = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; IS_ACTIVE (reg_info[mcnt]) = 0; MATCHED_SOMETHING (reg_info[mcnt]) = 0; EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; } /* We move `string1' into `string2' if the latter's empty -- but not if `string1' is null. */ if (size2 == 0 && string1 != NULL) { string2 = string1; size2 = size1; string1 = 0; size1 = 0; } end1 = string1 + size1; end2 = string2 + size2; /* Compute where to stop matching, within the two strings. */ if (stop <= size1) { end_match_1 = string1 + stop; end_match_2 = string2; } else { end_match_1 = end1; end_match_2 = string2 + stop - size1; } /* `p' scans through the pattern as `d' scans through the data. `dend' is the end of the input string that `d' points within. `d' is advanced into the following input string whenever necessary, but this happens before fetching; therefore, at the beginning of the loop, `d' can be pointing at the end of a string, but it cannot equal `string2'. */ if (size1 > 0 && pos <= size1) { d = string1 + pos; dend = end_match_1; } else { d = string2 + pos - size1; dend = end_match_2; } DEBUG_PRINT1 ("The compiled pattern is:\n"); DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); DEBUG_PRINT1 ("The string to match is: `"); DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); DEBUG_PRINT1 ("'\n"); /* This loops over pattern commands. It exits by returning from the function if the match is complete, or it drops through if the match fails at this starting point in the input data. */ for (;;) { #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif if (p == pend) { /* End of pattern means we might have succeeded. */ DEBUG_PRINT1 ("end of pattern ... "); /* If we haven't matched the entire string, and we want the longest match, try backtracking. */ if (d != end_match_2) { /* 1 if this match ends in the same string (string1 or string2) as the best previous match. */ boolean same_str_p = (FIRST_STRING_P (match_end) == MATCHING_IN_FIRST_STRING); /* 1 if this match is the best seen so far. */ boolean best_match_p; /* AIX compiler got confused when this was combined with the previous declaration. */ if (same_str_p) best_match_p = d > match_end; else best_match_p = !MATCHING_IN_FIRST_STRING; DEBUG_PRINT1 ("backtracking.\n"); if (!FAIL_STACK_EMPTY ()) { /* More failure points to try. */ /* If exceeds best match so far, save it. */ if (!best_regs_set || best_match_p) { best_regs_set = true; match_end = d; DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { best_regstart[mcnt] = regstart[mcnt]; best_regend[mcnt] = regend[mcnt]; } } goto fail; } /* If no failure points, don't restore garbage. And if last match is real best match, don't restore second best one. */ else if (best_regs_set && !best_match_p) { restore_best_regs: /* Restore best match. It may happen that `dend == end_match_1' while the restored d is in string2. For example, the pattern `x.*y.*z' against the strings `x-' and `y-z-', if the two strings are not consecutive in memory. */ DEBUG_PRINT1 ("Restoring best registers.\n"); d = match_end; dend = ((d >= string1 && d <= end1) ? end_match_1 : end_match_2); for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++) { regstart[mcnt] = best_regstart[mcnt]; regend[mcnt] = best_regend[mcnt]; } } } /* d != end_match_2 */ succeed_label: DEBUG_PRINT1 ("Accepting match.\n"); /* If caller wants register contents data back, do it. */ if (regs && !bufp->no_sub) { /* Have the register data arrays been allocated? */ if (bufp->regs_allocated == REGS_UNALLOCATED) { /* No. So allocate them with malloc. We need one extra element beyond `num_regs' for the `-1' marker GNU code uses. */ regs->num_regs = MAX (RE_NREGS, num_regs + 1); regs->start = TALLOC (regs->num_regs, regoff_t); regs->end = TALLOC (regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } bufp->regs_allocated = REGS_REALLOCATE; } else if (bufp->regs_allocated == REGS_REALLOCATE) { /* Yes. If we need more elements than were already allocated, reallocate them. If we need fewer, just leave it alone. */ if (regs->num_regs < num_regs + 1) { regs->num_regs = num_regs + 1; RETALLOC (regs->start, regs->num_regs, regoff_t); RETALLOC (regs->end, regs->num_regs, regoff_t); if (regs->start == NULL || regs->end == NULL) { FREE_VARIABLES (); return -2; } } } else { /* These braces fend off a "empty body in an else-statement" warning under GCC when assert expands to nothing. */ assert (bufp->regs_allocated == REGS_FIXED); } /* Convert the pointer data in `regstart' and `regend' to indices. Register zero has to be set differently, since we haven't kept track of any info for it. */ if (regs->num_regs > 0) { regs->start[0] = pos; regs->end[0] = (MATCHING_IN_FIRST_STRING ? ((regoff_t) (d - string1)) : ((regoff_t) (d - string2 + size1))); } /* Go through the first `min (num_regs, regs->num_regs)' registers, since that is all we initialized. */ for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs); mcnt++) { if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) regs->start[mcnt] = regs->end[mcnt] = -1; else { regs->start[mcnt] = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); regs->end[mcnt] = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); } } /* If the regs structure we return has more elements than were in the pattern, set the extra elements to -1. If we (re)allocated the registers, this is the case, because we always allocate enough to have at least one -1 at the end. */ for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++) regs->start[mcnt] = regs->end[mcnt] = -1; } /* regs && !bufp->no_sub */ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", nfailure_points_pushed, nfailure_points_popped, nfailure_points_pushed - nfailure_points_popped); DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); mcnt = d - pos - (MATCHING_IN_FIRST_STRING ? string1 : string2 - size1); DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); FREE_VARIABLES (); return mcnt; } /* Otherwise match next pattern command. */ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) { /* Ignore these. Used to ignore the n of succeed_n's which currently have n == 0. */ case no_op: DEBUG_PRINT1 ("EXECUTING no_op.\n"); break; case succeed: DEBUG_PRINT1 ("EXECUTING succeed.\n"); goto succeed_label; /* Match the next n pattern characters exactly. The following byte in the pattern defines n, and the n bytes after that are the characters to match. */ case exactn: mcnt = *p++; DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); /* This is written out as an if-else so we don't waste time testing `translate' inside the loop. */ if (translate) { do { PREFETCH (); if ((unsigned char) translate[(unsigned char) *d++] != (unsigned char) *p++) goto fail; } while (--mcnt); } else { do { PREFETCH (); if (*d++ != (char) *p++) goto fail; } while (--mcnt); } SET_REGS_MATCHED (); break; /* Match any character except possibly a newline or a null. */ case anychar: DEBUG_PRINT1 ("EXECUTING anychar.\n"); PREFETCH (); if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) goto fail; SET_REGS_MATCHED (); DEBUG_PRINT2 (" Matched `%d'.\n", *d); d++; break; case charset: case charset_not: { register unsigned char c; boolean not = (re_opcode_t) *(p - 1) == charset_not; DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); PREFETCH (); c = TRANSLATE (*d); /* The character to match. */ /* Cast to `unsigned' instead of `unsigned char' in case the bit list is a full 32 bytes long. */ if (c < (unsigned) (*p * BYTEWIDTH) && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; p += 1 + *p; if (!not) goto fail; SET_REGS_MATCHED (); d++; break; } /* The beginning of a group is represented by start_memory. The arguments are the register number in the next byte, and the number of groups inner to this one in the next. The text matched within the group is recorded (in the internal registers data structure) under the register number. */ case start_memory: DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]); /* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[*p]) = group_match_null_string_p (&p1, pend, reg_info); /* Save the position in the string where we were the last time we were at this open-group operator in case the group is operated upon by a repetition operator, e.g., with `(a*)*b' against `ab'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regstart[*p]) ? d : regstart[*p] : regstart[*p]; DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p])); regstart[*p] = d; DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); IS_ACTIVE (reg_info[*p]) = 1; MATCHED_SOMETHING (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* This is the new highest active register. */ highest_active_reg = *p; /* If nothing was active before, this is the new lowest active register. */ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *p; /* Move past the register number and inner group count. */ p += 2; just_past_start_mem = p; break; /* The stop_memory opcode represents the end of a group. Its arguments are the same as start_memory's: the register number, and the number of inner groups. */ case stop_memory: DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]); /* We need to save the string position the last time we were at this close-group operator in case the group is operated upon by a repetition operator, e.g., with `((a*)*(b*)*)*' against `aba'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p])); regend[*p] = d; DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); /* This register isn't active anymore. */ IS_ACTIVE (reg_info[*p]) = 0; /* Clear this whenever we change the register activity status. */ set_regs_matched_done = 0; /* If this was the only register active, nothing is active anymore. */ if (lowest_active_reg == highest_active_reg) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else { /* We must scan for the new highest active register, since it isn't necessarily one less than now: consider (a(b)c(d(e)f)g). When group 3 ends, after the f), the new highest active register is 1. */ unsigned char r = *p - 1; while (r > 0 && !IS_ACTIVE (reg_info[r])) r--; /* If we end up at register zero, that means that we saved the registers as the result of an `on_failure_jump', not a `start_memory', and we jumped to past the innermost `stop_memory'. For example, in ((.)*) we save registers 1 and 2 as a result of the *, but when we pop back to the second ), we are at the stop_memory 1. Thus, nothing is active. */ if (r == 0) { lowest_active_reg = NO_LOWEST_ACTIVE_REG; highest_active_reg = NO_HIGHEST_ACTIVE_REG; } else highest_active_reg = r; } /* If just failed to match something this time around with a group that's operated on by a repetition operator, try to force exit from the ``loop'', and restore the register information for this group that we had before trying this last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) || just_past_start_mem == p - 1) && (p + 2) < pend) { boolean is_a_jump_n = false; p1 = p + 2; mcnt = 0; switch ((re_opcode_t) *p1++) { case jump_n: is_a_jump_n = true; case pop_failure_jump: case maybe_pop_jump: case jump: case dummy_failure_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (is_a_jump_n) p1 += 2; break; default: /* do nothing */ ; } p1 += mcnt; /* If the next operation is a jump backwards in the pattern to an on_failure_jump right before the start_memory corresponding to this stop_memory, exit from the loop by forcing a failure after pushing on the stack the on_failure_jump's jump in the pattern, and d. */ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) { /* If this group ever matched anything, then restore what its registers were before trying this last failed match, e.g., with `(a*)*b' against `ab' for regstart[1], and, e.g., with `((a*)*(b*)*)*' against `aba' for regend[3]. Also restore the registers for inner groups for, e.g., `((a*)(b*))*' against `aba' (register 3 would otherwise get trashed). */ if (EVER_MATCHED_SOMETHING (reg_info[*p])) { unsigned r; EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; /* Restore this and inner groups' (if any) registers. */ for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1); r++) { regstart[r] = old_regstart[r]; /* xx why this test? */ if (old_regend[r] >= regstart[r]) regend[r] = old_regend[r]; } } p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); PUSH_FAILURE_POINT (p1 + mcnt, d, -2); goto fail; } } /* Move past the register number and the inner group count. */ p += 2; break; /* \ has been turned into a `duplicate' command which is followed by the numeric value of as the register number. */ case duplicate: { register const char *d2, *dend2; int regno = *p++; /* Get which register to match against. */ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); /* Can't back reference a group which we've never matched. */ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) goto fail; /* Where in input to try to start matching. */ d2 = regstart[regno]; /* Where to stop matching; if both the place to start and the place to stop matching are in the same string, then set to the place to stop, otherwise, for now have to use the end of the first string. */ dend2 = ((FIRST_STRING_P (regstart[regno]) == FIRST_STRING_P (regend[regno])) ? regend[regno] : end_match_1); for (;;) { /* If necessary, advance to next segment in register contents. */ while (d2 == dend2) { if (dend2 == end_match_2) break; if (dend2 == regend[regno]) break; /* End of string1 => advance to string2. */ d2 = string2; dend2 = regend[regno]; } /* At end of register contents => success */ if (d2 == dend2) break; /* If necessary, advance to next segment in data. */ PREFETCH (); /* How many characters left in this segment to match. */ mcnt = dend - d; /* Want how many consecutive characters we can match in one shot, so, if necessary, adjust the count. */ if (mcnt > dend2 - d2) mcnt = dend2 - d2; /* Compare that many; failure if mismatch, else move past them. */ if (translate ? bcmp_translate (d, d2, mcnt, translate) : bcmp (d, d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; /* Do this because we've match some characters. */ SET_REGS_MATCHED (); } } break; /* begline matches the empty string at the beginning of the string (unless `not_bol' is set in `bufp'), and, if `newline_anchor' is set, after newlines. */ case begline: DEBUG_PRINT1 ("EXECUTING begline.\n"); if (AT_STRINGS_BEG (d)) { if (!bufp->not_bol) break; } else if (d[-1] == '\n' && bufp->newline_anchor) { break; } /* In all other cases, we fail. */ goto fail; /* endline is the dual of begline. */ case endline: DEBUG_PRINT1 ("EXECUTING endline.\n"); if (AT_STRINGS_END (d)) { if (!bufp->not_eol) break; } /* We have to ``prefetch'' the next character. */ else if ((d == end1 ? *string2 : *d) == '\n' && bufp->newline_anchor) { break; } goto fail; /* Match at the very beginning of the data. */ case begbuf: DEBUG_PRINT1 ("EXECUTING begbuf.\n"); if (AT_STRINGS_BEG (d)) break; goto fail; /* Match at the very end of the data. */ case endbuf: DEBUG_PRINT1 ("EXECUTING endbuf.\n"); if (AT_STRINGS_END (d)) break; goto fail; /* on_failure_keep_string_jump is used to optimize `.*\n'. It pushes NULL as the value for the string on the stack. Then `pop_failure_point' will keep the current value for the string, instead of restoring it. To see why, consider matching `foo\nbar' against `.*\n'. The .* matches the foo; then the . fails against the \n. But the next thing we want to do is match the \n against the \n; if we restored the string value, we would be back at the foo. Because this is used only in specific cases, we don't need to check all the things that `on_failure_jump' does, to make sure the right things get saved on the stack. Hence we don't share its code. The only reason to push anything on the stack at all is that otherwise we would have to change `anychar's code to do something besides goto fail in this case; that seems worse than this. */ case on_failure_keep_string_jump: DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); #endif PUSH_FAILURE_POINT (p + mcnt, NULL, -2); break; /* Uses of on_failure_jump: Each alternative starts with an on_failure_jump that points to the beginning of the next alternative. Each alternative except the last ends with a jump that in effect jumps past the rest of the alternatives. (They really jump to the ending jump of the following alternative, because tensioning these jumps is a hassle.) Repeats start with an on_failure_jump that points past both the repetition text and either the following jump or pop_failure_jump back to this on_failure_jump. */ case on_failure_jump: on_failure: DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt); #else DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); #endif /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information for that group and all inner ones, so that if we fail back to this point, the group's information will be correct. For example, in \(a*\)*\1, we need the preceding group, and in \(zz\(a*\)b*\)\2, we need the inner group. */ /* We can't use `p' to check ahead because we push a failure point to `p + mcnt' after we do this. */ p1 = p; /* We need to skip no_op's before we look for the start_memory in case this on_failure_jump is happening as the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 against aba. */ while (p1 < pend && (re_opcode_t) *p1 == no_op) p1++; if (p1 < pend && (re_opcode_t) *p1 == start_memory) { /* We have a new highest active register now. This will get reset at the start_memory we are about to get to, but we will have saved all the registers relevant to this repetition op, as described above. */ highest_active_reg = *(p1 + 1) + *(p1 + 2); if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) lowest_active_reg = *(p1 + 1); } DEBUG_PRINT1 (":\n"); PUSH_FAILURE_POINT (p + mcnt, d, -2); break; /* A smart repeat ends with `maybe_pop_jump'. We change it to either `pop_failure_jump' or `jump'. */ case maybe_pop_jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); { register unsigned char *p2 = p; /* Compare the beginning of the repeat with what in the pattern follows its end. If we can establish that there is nothing that they would both match, i.e., that we would have to backtrack because of (as in, e.g., `a*a') then we can change to pop_failure_jump, because we'll never have to backtrack. This is not true in the case of alternatives: in `(a|ab)*' we do need to backtrack to the `ab' alternative (e.g., if the string was `ab'). But instead of trying to detect that here, the alternative has put on a dummy failure point which is what we will end up popping. */ /* Skip over open/close-group commands. If what follows this loop is a ...+ construct, look at what begins its body, since we will have to match at least one of that. */ while (1) { if (p2 + 2 < pend && ((re_opcode_t) *p2 == stop_memory || (re_opcode_t) *p2 == start_memory)) p2 += 3; else if (p2 + 6 < pend && (re_opcode_t) *p2 == dummy_failure_jump) p2 += 6; else break; } p1 = p + mcnt; /* p1[0] ... p1[2] are the `on_failure_jump' corresponding to the `maybe_finalize_jump' of this case. Examine what follows. */ /* If we're at the end of the pattern, we can change. */ if (p2 == pend) { /* Consider what happens when matching ":\(.*\)" against ":/". I don't really understand this code yet. */ p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" End of pattern: change to `pop_failure_jump'.\n"); } else if ((re_opcode_t) *p2 == exactn || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) { register unsigned char c = *p2 == (unsigned char) endline ? '\n' : p2[2]; if ((re_opcode_t) p1[3] == exactn && p1[5] != c) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", c, p1[5]); } else if ((re_opcode_t) p1[3] == charset || (re_opcode_t) p1[3] == charset_not) { int not = (re_opcode_t) p1[3] == charset_not; if (c < (unsigned char) (p1[4] * BYTEWIDTH) && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) not = !not; /* `not' is equal to 1 if c would match, which means that we can't change to pop_failure_jump. */ if (!not) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } } else if ((re_opcode_t) *p2 == charset) { #ifdef DEBUG register unsigned char c = *p2 == (unsigned char) endline ? '\n' : p2[2]; #endif #if 0 if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5] && (p2[2 + p1[5] / BYTEWIDTH] & (1 << (p1[5] % BYTEWIDTH))))) #else if ((re_opcode_t) p1[3] == exactn && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4] && (p2[2 + p1[4] / BYTEWIDTH] & (1 << (p1[4] % BYTEWIDTH))))) #endif { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", c, p1[5]); } else if ((re_opcode_t) p1[3] == charset_not) { int idx; /* We win if the charset_not inside the loop lists every character listed in the charset after. */ for (idx = 0; idx < (int) p2[1]; idx++) if (! (p2[2 + idx] == 0 || (idx < (int) p1[4] && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) break; if (idx == p2[1]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } else if ((re_opcode_t) p1[3] == charset) { int idx; /* We win if the charset inside the loop has no overlap with the one after the loop. */ for (idx = 0; idx < (int) p2[1] && idx < (int) p1[4]; idx++) if ((p2[2 + idx] & p1[5 + idx]) != 0) break; if (idx == p2[1] || idx == p1[4]) { p[-3] = (unsigned char) pop_failure_jump; DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); } } } } p -= 2; /* Point at relative address again. */ if ((re_opcode_t) p[-1] != pop_failure_jump) { p[-1] = (unsigned char) jump; DEBUG_PRINT1 (" Match => jump.\n"); goto unconditional_jump; } /* Note fall through. */ /* The end of a simple repeat has a pop_failure_jump back to its matching on_failure_jump, where the latter will push a failure point. The pop_failure_jump takes off failure points put on by this pop_failure_jump's matching on_failure_jump; we got through the pattern to here from the matching on_failure_jump, so didn't fail. */ case pop_failure_jump: { /* We need to pass separate storage for the lowest and highest registers, even though we don't care about the actual values. Otherwise, we will restore only one register from the stack, since lowest will == highest in `pop_failure_point'. */ active_reg_t dummy_low_reg, dummy_high_reg; unsigned char *pdummy; const char *sdummy; DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); POP_FAILURE_POINT (sdummy, pdummy, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); } /* Note fall through. */ unconditional_jump: #ifdef _LIBC DEBUG_PRINT2 ("\n%p: ", p); #else DEBUG_PRINT2 ("\n0x%x: ", p); #endif /* Note fall through. */ /* Unconditionally jump (without popping any failure points). */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ #ifdef _LIBC DEBUG_PRINT2 ("(to %p).\n", p); #else DEBUG_PRINT2 ("(to 0x%x).\n", p); #endif break; /* We need this opcode so we can detect where alternatives end in `group_match_null_string_p' et al. */ case jump_past_alt: DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); goto unconditional_jump; /* Normally, the on_failure_jump pushes a failure point, which then gets popped at pop_failure_jump. We will end up at pop_failure_jump, also, and with a pattern of, say, `a+', we are skipping over the on_failure_jump, so we have to push something meaningless for pop_failure_jump to pop. */ case dummy_failure_jump: DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); /* It doesn't matter what we push for the string here. What the code at `fail' tests is the value for the pattern. */ PUSH_FAILURE_POINT (0, 0, -2); goto unconditional_jump; /* At the end of an alternative, we need to push a dummy failure point in case we are followed by a `pop_failure_jump', because we don't want the failure point for the alternative to be popped. For example, matching `(a|ab)*' against `aab' requires that we match the `ab' alternative. */ case push_dummy_failure: DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); /* See comments just above at `dummy_failure_jump' about the two zeroes. */ PUSH_FAILURE_POINT (0, 0, -2); break; /* Have to succeed matching what follows at least n times. After that, handle like `on_failure_jump'. */ case succeed_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); assert (mcnt >= 0); /* Originally, this is how many times we HAVE to succeed. */ if (mcnt > 0) { mcnt--; p += 2; STORE_NUMBER_AND_INCR (p, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p - 2, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p - 2, mcnt); #endif } else if (mcnt == 0) { #ifdef _LIBC DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2); #else DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); #endif p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; goto on_failure; } break; case jump_n: EXTRACT_NUMBER (mcnt, p + 2); DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); /* Originally, this is how many times we CAN jump. */ if (mcnt) { mcnt--; STORE_NUMBER (p + 2, mcnt); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p + 2, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p + 2, mcnt); #endif goto unconditional_jump; } /* If don't have to jump any more, skip over the rest of command. */ else p += 4; break; case set_number_at: { DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); #ifdef _LIBC DEBUG_PRINT3 (" Setting %p to %d.\n", p1, mcnt); #else DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); #endif STORE_NUMBER (p1, mcnt); break; } #if 0 /* The DEC Alpha C compiler 3.x generates incorrect code for the test WORDCHAR_P (d - 1) != WORDCHAR_P (d) in the expansion of AT_WORD_BOUNDARY, so this code is disabled. Expanding the macro and introducing temporary variables works around the bug. */ case wordbound: DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_WORD_BOUNDARY (d)) break; goto fail; case notwordbound: DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_WORD_BOUNDARY (d)) goto fail; break; #else case wordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING wordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) break; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) break; goto fail; } case notwordbound: { boolean prevchar, thischar; DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)) goto fail; prevchar = WORDCHAR_P (d - 1); thischar = WORDCHAR_P (d); if (prevchar != thischar) goto fail; break; } #endif case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) break; goto fail; case wordend: DEBUG_PRINT1 ("EXECUTING wordend.\n"); if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) break; goto fail; #ifdef emacs case before_dot: DEBUG_PRINT1 ("EXECUTING before_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) >= point) goto fail; break; case at_dot: DEBUG_PRINT1 ("EXECUTING at_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) != point) goto fail; break; case after_dot: DEBUG_PRINT1 ("EXECUTING after_dot.\n"); if (PTR_CHAR_POS ((unsigned char *) d) <= point) goto fail; break; case syntaxspec: DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); mcnt = *p++; goto matchsyntax; case wordchar: DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); mcnt = (int) Sword; matchsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; case notsyntaxspec: DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); mcnt = *p++; goto matchnotsyntax; case notwordchar: DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); mcnt = (int) Sword; matchnotsyntax: PREFETCH (); /* Can't use *d++ here; SYNTAX may be an unsafe macro. */ d++; if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt) goto fail; SET_REGS_MATCHED (); break; #else /* not emacs */ case wordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); PREFETCH (); if (!WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; case notwordchar: DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); PREFETCH (); if (WORDCHAR_P (d)) goto fail; SET_REGS_MATCHED (); d++; break; #endif /* not emacs */ default: abort (); } continue; /* Successfully executed one pattern command; keep going. */ /* We goto here if a matching operation fails. */ fail: if (!FAIL_STACK_EMPTY ()) { /* A restart point is known. Restore to that state. */ DEBUG_PRINT1 ("\nFAIL:\n"); POP_FAILURE_POINT (d, p, lowest_active_reg, highest_active_reg, regstart, regend, reg_info); /* If this failure point is a dummy, try the next one. */ if (!p) goto fail; /* If we failed to the end of the pattern, don't examine *p. */ assert (p <= pend); if (p < pend) { boolean is_a_jump_n = false; /* If failed to a backwards jump that's part of a repetition loop, need to pop this failure point and use the next one. */ switch ((re_opcode_t) *p) { case jump_n: is_a_jump_n = true; case maybe_pop_jump: case pop_failure_jump: case jump: p1 = p + 1; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) || (!is_a_jump_n && (re_opcode_t) *p1 == on_failure_jump)) goto fail; break; default: /* do nothing */ ; } } if (d >= string1 && d <= end1) dend = end_match_1; } else break; /* Matching at this starting point really fails. */ } /* for (;;) */ if (best_regs_set) goto restore_best_regs; FREE_VARIABLES (); return -1; /* Failure to match. */ } /* re_match_2 */ /* Subroutine definitions for re_match_2. */ /* We are passed P pointing to a register number after a start_memory. Return true if the pattern up to the corresponding stop_memory can match the empty string, and false otherwise. If we find the matching stop_memory, sets P to point to one past its number. Otherwise, sets P to an undefined byte less than or equal to END. We don't handle duplicates properly (yet). */ static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info) { int mcnt; /* Point to after the args to the start_memory. */ unsigned char *p1 = *p + 2; while (p1 < end) { /* Skip over opcodes that can match nothing, and return true or false, as appropriate, when we get to one that can't, or to the matching stop_memory. */ switch ((re_opcode_t) *p1) { /* Could be either a loop or a series of alternatives. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); /* If the next operation is not a jump backwards in the pattern. */ if (mcnt >= 0) { /* Go through the on_failure_jumps of the alternatives, seeing if any of the alternatives cannot match nothing. The last alternative starts with only a jump, whereas the rest start with on_failure_jump and end with a jump, e.g., here is the pattern for `a|b|c': /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 /exactn/1/c So, we have to first go through the first (n-1) alternatives and then deal with the last one separately. */ /* Deal with the first (n-1) alternatives, which start with an on_failure_jump (see above) that jumps to right past a jump_past_alt. */ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt) { /* `mcnt' holds how many bytes long the alternative is, including the ending `jump_past_alt' and its number. */ if (!alt_match_null_string_p (p1, p1 + mcnt - 3, reg_info)) return false; /* Move to right after this alternative, including the jump_past_alt. */ p1 += mcnt; /* Break if it's the beginning of an n-th alternative that doesn't begin with an on_failure_jump. */ if ((re_opcode_t) *p1 != on_failure_jump) break; /* Still have to check that it's not an n-th alternative that starts with an on_failure_jump. */ p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if ((re_opcode_t) p1[mcnt-3] != jump_past_alt) { /* Get to the beginning of the n-th alternative. */ p1 -= 3; break; } } /* Deal with the last alternative: go back and get number of the `jump_past_alt' just before it. `mcnt' contains the length of the alternative. */ EXTRACT_NUMBER (mcnt, p1 - 2); if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) return false; p1 += mcnt; /* Get past the n-th alternative. */ } /* if mcnt > 0 */ break; case stop_memory: assert (p1[1] == **p); *p = p1 + 2; return true; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return false; } /* group_match_null_string_p */ /* Similar to group_match_null_string_p, but doesn't deal with alternatives: It expects P to be the first byte of a single alternative and END one byte past the last. The alternative can contain groups. */ static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info) { int mcnt; unsigned char *p1 = p; while (p1 < end) { /* Skip over opcodes that can match nothing, and break when we get to one that can't. */ switch ((re_opcode_t) *p1) { /* It's a loop. */ case on_failure_jump: p1++; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; break; default: if (!common_op_match_null_string_p (&p1, end, reg_info)) return false; } } /* while p1 < end */ return true; } /* alt_match_null_string_p */ /* Deals with the ops common to group_match_null_string_p and alt_match_null_string_p. Sets P to one after the op and its arguments, if any. */ static boolean common_op_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info) { int mcnt; boolean ret; int reg_no; unsigned char *p1 = *p; switch ((re_opcode_t) *p1++) { case no_op: case begline: case endline: case begbuf: case endbuf: case wordbeg: case wordend: case wordbound: case notwordbound: #ifdef emacs case before_dot: case at_dot: case after_dot: #endif break; case start_memory: reg_no = *p1; assert (reg_no > 0 && reg_no <= MAX_REGNUM); ret = group_match_null_string_p (&p1, end, reg_info); /* Have to set this here in case we're checking a group which contains a group and a back reference to it. */ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; if (!ret) return false; break; /* If this is an optimized succeed_n for zero times, make the jump. */ case jump: EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt >= 0) p1 += mcnt; else return false; break; case succeed_n: /* Get to the number of times to succeed. */ p1 += 2; EXTRACT_NUMBER_AND_INCR (mcnt, p1); if (mcnt == 0) { p1 -= 4; EXTRACT_NUMBER_AND_INCR (mcnt, p1); p1 += mcnt; } else return false; break; case duplicate: if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) return false; break; case set_number_at: p1 += 4; default: /* All other opcodes mean we cannot match the empty string. */ return false; } *p = p1; return true; } /* common_op_match_null_string_p */ /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN bytes; nonzero otherwise. */ static int bcmp_translate(const char *s1, const char *s2, register int len, RE_TRANSLATE_TYPE translate) { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; while (len) { if (translate[*p1++] != translate[*p2++]) return 1; len--; } return 0; } /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it compiles PATTERN (of length SIZE) and puts the result in BUFP. Returns 0 if the pattern was valid, otherwise an error string. Assumes the `allocated' (and perhaps `buffer') and `translate' fields are set in BUFP on entry. We call regex_compile to do the actual compilation. */ const char * re_compile_pattern(const char *pattern, size_t length, struct re_pattern_buffer *bufp) { reg_errcode_t ret; /* GNU code is written to assume at least RE_NREGS registers will be set (and at least one extra will be -1). */ bufp->regs_allocated = REGS_UNALLOCATED; /* And GNU code determines whether or not to get register information by passing null for the REGS argument to re_match, etc., not by setting no_sub. */ bufp->no_sub = 0; /* Match anchors at newline. */ bufp->newline_anchor = 1; ret = regex_compile (pattern, length, re_syntax_options, bufp); if (!ret) return NULL; return gettext (re_error_msgid[(int) ret]); } /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ #if defined (_REGEX_RE_COMP) || defined (_LIBC) /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; char * #ifdef _LIBC /* Make these definitions weak in libc, so POSIX programs can redefine these names if they don't use our functions, and still use regcomp/regexec below without link errors. */ weak_function #endif re_comp (s) const char *s; { reg_errcode_t ret; if (!s) { if (!re_comp_buf.buffer) return gettext ("No previous regular expression"); return 0; } if (!re_comp_buf.buffer) { re_comp_buf.buffer = (unsigned char *) malloc (200); if (re_comp_buf.buffer == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); re_comp_buf.allocated = 200; re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); if (re_comp_buf.fastmap == NULL) return gettext (re_error_msgid[(int) REG_ESPACE]); } /* Since `re_exec' always passes NULL for the `regs' argument, we don't need to initialize the pattern buffer fields which affect it. */ /* Match anchors at newlines. */ re_comp_buf.newline_anchor = 1; ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); if (!ret) return NULL; /* Yes, we're discarding `const' here if !HAVE_LIBINTL. */ return (char *) gettext (re_error_msgid[(int) ret]); } int #ifdef _LIBC weak_function #endif re_exec (s) const char *s; { const int len = strlen (s); return 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); } #endif /* _REGEX_RE_COMP */ /* POSIX.2 functions. Don't define these for Emacs. */ #ifndef emacs /* regcomp takes a regular expression as a string and compiles it. PREG is a regex_t *. We do not expect any fields to be initialized, since POSIX says we shouldn't. Thus, we set `buffer' to the compiled pattern; `used' to the length of the compiled pattern; `syntax' to RE_SYNTAX_POSIX_EXTENDED if the REG_EXTENDED bit in CFLAGS is set; otherwise, to RE_SYNTAX_POSIX_BASIC; `newline_anchor' to REG_NEWLINE being set in CFLAGS; `fastmap' and `fastmap_accurate' to zero; `re_nsub' to the number of subexpressions in PATTERN. PATTERN is the address of the pattern string. CFLAGS is a series of bits which affect compilation. If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we use POSIX basic syntax. If REG_NEWLINE is set, then . and [^...] don't match newline. Also, regexec will try a match beginning after every newline. If REG_ICASE is set, then we considers upper- and lowercase versions of letters to be equivalent when matching. If REG_NOSUB is set, then when PREG is passed to regexec, that routine will report only success or failure, and nothing about the registers. It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for the return codes and their meanings.) */ int regcomp(regex_t *preg, const char *pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax = (cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; /* regex_compile will allocate the space for the compiled pattern. */ preg->buffer = 0; preg->allocated = 0; preg->used = 0; /* Don't bother to use a fastmap when searching. This simplifies the REG_NEWLINE case: if we used a fastmap, we'd have to put all the characters after newlines into the fastmap. This way, we just try every character. */ preg->fastmap = 0; if (cflags & REG_ICASE) { unsigned i; preg->translate = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE * sizeof (*(RE_TRANSLATE_TYPE)0)); if (preg->translate == NULL) return (int) REG_ESPACE; /* Map uppercase characters to corresponding lowercase ones. */ for (i = 0; i < CHAR_SET_SIZE; i++) preg->translate[i] = ISUPPER (i) ? tolower (i) : i; } else preg->translate = NULL; /* If REG_NEWLINE is set, newlines are treated differently. */ if (cflags & REG_NEWLINE) { /* REG_NEWLINE implies neither . nor [^...] match newline. */ syntax &= ~RE_DOT_NEWLINE; syntax |= RE_HAT_LISTS_NOT_NEWLINE; /* It also changes the matching behavior. */ preg->newline_anchor = 1; } else preg->newline_anchor = 0; preg->no_sub = !!(cflags & REG_NOSUB); /* POSIX says a null character in the pattern terminates it, so we can use strlen here in compiling the pattern. */ ret = regex_compile (pattern, strlen (pattern), syntax, preg); /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ if (ret == REG_ERPAREN) ret = REG_EPAREN; return (int) ret; } /* regexec searches for a given pattern, specified by PREG, in the string STRING. If NMATCH is zero or REG_NOSUB was set in the cflags argument to `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at least NMATCH elements, and we set them to the offsets of the corresponding matched substrings. EFLAGS specifies `execution flags' which affect matching: if REG_NOTBOL is set, then ^ does not match at the beginning of the string; if REG_NOTEOL is set, then $ does not match at the end. We return 0 if we find a match and REG_NOMATCH if not. */ int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) { int ret; struct re_registers regs; regex_t private_preg; int len = strlen (string); boolean want_reg_info = !preg->no_sub && nmatch > 0; private_preg = *preg; private_preg.not_bol = !!(eflags & REG_NOTBOL); private_preg.not_eol = !!(eflags & REG_NOTEOL); /* The user has told us exactly how many registers to return information about, via `nmatch'. We have to pass that on to the matching routines. */ private_preg.regs_allocated = REGS_FIXED; if (want_reg_info) { regs.num_regs = nmatch; regs.start = TALLOC (nmatch, regoff_t); regs.end = TALLOC (nmatch, regoff_t); if (regs.start == NULL || regs.end == NULL) return (int) REG_NOMATCH; } /* Perform the searching operation. */ ret = re_search (&private_preg, string, len, /* start: */ 0, /* range: */ len, want_reg_info ? ®s : (struct re_registers *) 0); /* Copy the register information to the POSIX structure. */ if (want_reg_info) { if (ret >= 0) { unsigned r; for (r = 0; r < nmatch; r++) { pmatch[r].rm_so = regs.start[r]; pmatch[r].rm_eo = regs.end[r]; } } /* If we needed the temporary register info, free the space now. */ free (regs.start); free (regs.end); } /* We want zero return to mean success, unlike `re_search'. */ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; } /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) { const char *msg; size_t msg_size; if (errcode < 0 || errcode >= (int) (sizeof (re_error_msgid) / sizeof (re_error_msgid[0]))) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. Dump core so we can fix it. */ abort (); msg = gettext (re_error_msgid[errcode]); msg_size = strlen (msg) + 1; /* Includes the null. */ if (errbuf_size != 0) { if (msg_size > errbuf_size) { strncpy (errbuf, msg, errbuf_size - 1); errbuf[errbuf_size - 1] = 0; } else strcpy (errbuf, msg); } return msg_size; } /* Free dynamically allocated space used by PREG. */ void regfree(regex_t *preg) { if (preg->buffer != NULL) free (preg->buffer); preg->buffer = NULL; preg->allocated = 0; preg->used = 0; if (preg->fastmap != NULL) free (preg->fastmap); preg->fastmap = NULL; preg->fastmap_accurate = 0; if (preg->translate != NULL) free (preg->translate); preg->translate = NULL; } #endif /* not emacs */ htdig-3.2.0b6/htlib/regex_win32.h0100644006314600127310000005515410000513631015771 0ustar angusgbhtdig/* LGPLd GNU regex for Native WIN32 */ /* Part of the ht://Dig package */ /* Copyright (c) 2003 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later or later */ /* */ /* Added June 2003 Neal Richter, RightNow Technologies */ /* note that this version is significantly different from the original */ /* version 0.12 GNU source code. It compiles and works on Native WIN32. */ /* Definitions for data structures and routines for the regular expression library, version 0.12. Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __REGEXP_LIBRARY_H__ #define __REGEXP_LIBRARY_H__ /* Allow the use in C++ code. */ #ifdef __cplusplus extern "C" { #endif #include /* POSIX says that must be included (by the caller) before . */ #if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS) /* VMS doesn't have `size_t' in , even though POSIX says it should be there. */ #include #endif /* The following two types have to be signed and unsigned integer type wide enough to hold a value of a pointer. For most ANSI compilers ptrdiff_t and size_t should be likely OK. Still size of these two types is 2 for Microsoft C. Ugh... */ typedef long int s_reg_t; typedef unsigned long int active_reg_t; /* The following bits are used to determine the regexp syntax we recognize. The set/not-set meanings are chosen so that Emacs syntax remains the value 0. The bits are given in alphabetical order, and the definitions shifted by one from the previous bit; thus, when we add or remove a bit, only one other definition need change. */ typedef unsigned long int reg_syntax_t; /* If this bit is not set, then \ inside a bracket expression is literal. If set, then such a \ quotes the following character. */ #define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) /* If this bit is not set, then + and ? are operators, and \+ and \? are literals. If set, then \+ and \? are operators and + and ? are literals. */ #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) /* If this bit is set, then character classes are supported. They are: [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. If not set, then character classes are not supported. */ #define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) /* If this bit is set, then ^ and $ are always anchors (outside bracket expressions, of course). If this bit is not set, then it depends: ^ is an anchor if it is at the beginning of a regular expression or after an open-group or an alternation operator; $ is an anchor if it is at the end of a regular expression, or before a close-group or an alternation operator. This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because POSIX draft 11.2 says that * etc. in leading positions is undefined. We already implemented a previous draft which made those constructs invalid, though, so we haven't changed the code back. */ #define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) /* If this bit is set, then special characters are always special regardless of where they are in the pattern. If this bit is not set, then special characters are special only in some contexts; otherwise they are ordinary. Specifically, * + ? and intervals are only special when not after the beginning, open-group, or alternation operator. */ #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) /* If this bit is set, then *, +, ?, and { cannot be first in an re or immediately after an alternation or begin-group operator. */ #define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) /* If this bit is set, then . matches newline. If not set, then it doesn't. */ #define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) /* If this bit is set, then . doesn't match NUL. If not set, then it does. */ #define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) /* If this bit is set, nonmatching lists [^...] do not match newline. If not set, they do. */ #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) /* If this bit is set, either \{...\} or {...} defines an interval, depending on RE_NO_BK_BRACES. If not set, \{, \}, {, and } are literals. */ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) /* If this bit is set, +, ? and | aren't recognized as operators. If not set, they are. */ #define RE_LIMITED_OPS (RE_INTERVALS << 1) /* If this bit is set, newline is an alternation operator. If not set, newline is literal. */ #define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) /* If this bit is set, then `{...}' defines an interval, and \{ and \} are literals. If not set, then `\{...\}' defines an interval. */ #define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) /* If this bit is set, (...) defines a group, and \( and \) are literals. If not set, \(...\) defines a group, and ( and ) are literals. */ #define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) /* If this bit is set, then \ matches . If not set, then \ is a back-reference. */ #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) /* If this bit is set, then | is an alternation operator, and \| is literal. If not set, then \| is an alternation operator, and | is literal. */ #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) /* If this bit is set, then an ending range point collating higher than the starting range point, as in [z-a], is invalid. If not set, then when ending range point collates higher than the starting range point, the range is ignored. */ #define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) /* If this bit is set, then an unmatched ) is ordinary. If not set, then an unmatched ) is invalid. */ #define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) /* If this bit is set, succeed as soon as we match the whole pattern, without further backtracking. */ #define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1) /* If this bit is set, do not process the GNU regex operators. If not set, then the GNU regex operators are recognized. */ #define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1) /* If this bit is set, turn on internal regex debugging. If not set, and debugging was on, turn it off. This only works if regex.c is compiled -DDEBUG. We define this bit always, so that all that's needed to turn on debugging is to recompile regex.c; the calling code can always have this bit set, and it won't affect anything in the normal case. */ #define RE_DEBUG (RE_NO_GNU_OPS << 1) /* This global variable defines the particular regexp syntax to use (for some interfaces). When a regexp is compiled, the syntax used is stored in the pattern buffer, so changing this does not affect already-compiled regexps. */ extern reg_syntax_t re_syntax_options; /* Define combinations of the above bits for the standard possibilities. (The [[[ comments delimit what gets put into the Texinfo file, so don't delete them!) */ /* [[[begin syntaxes]]] */ #define RE_SYNTAX_EMACS 0 #define RE_SYNTAX_AWK \ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS) #define RE_SYNTAX_GNU_AWK \ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS)) #define RE_SYNTAX_POSIX_AWK \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ | RE_INTERVALS | RE_NO_GNU_OPS) #define RE_SYNTAX_GREP \ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ | RE_NEWLINE_ALT) #define RE_SYNTAX_EGREP \ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ | RE_NO_BK_VBAR) #define RE_SYNTAX_POSIX_EGREP \ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ #define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC #define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC /* Syntax bits common to both basic and extended POSIX regex syntax. */ #define _RE_SYNTAX_POSIX_COMMON \ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ | RE_INTERVALS | RE_NO_EMPTY_RANGES) #define RE_SYNTAX_POSIX_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this isn't minimal, since other operators, such as \`, aren't disabled. */ #define RE_SYNTAX_POSIX_MINIMAL_BASIC \ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) #define RE_SYNTAX_POSIX_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ | RE_UNMATCHED_RIGHT_PAREN_ORD) /* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ #define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ | RE_NO_BK_PARENS | RE_NO_BK_REFS \ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) /* [[[end syntaxes]]] */ /* Maximum number of duplicates an interval can allow. Some systems (erroneously) define this in other header files, but we want our value, so remove any previous define. */ #ifdef RE_DUP_MAX #undef RE_DUP_MAX #endif /* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */ #define RE_DUP_MAX (0x7fff) /* POSIX `cflags' bits (i.e., information for `regcomp'). */ /* If this bit is set, then use extended regular expression syntax. If not set, then use basic regular expression syntax. */ #define REG_EXTENDED 1 /* If this bit is set, then ignore case when matching. If not set, then case is significant. */ #define REG_ICASE (REG_EXTENDED << 1) /* If this bit is set, then anchors do not match at newline characters in the string. If not set, then anchors do match at newlines. */ #define REG_NEWLINE (REG_ICASE << 1) /* If this bit is set, then report only success or fail in regexec. If not set, then returns differ between not matching and errors. */ #define REG_NOSUB (REG_NEWLINE << 1) /* POSIX `eflags' bits (i.e., information for regexec). */ /* If this bit is set, then the beginning-of-line operator doesn't match the beginning of the string (presumably because it's not the beginning of a line). If not set, then the beginning-of-line operator does match the beginning of the string. */ #define REG_NOTBOL 1 /* Like REG_NOTBOL, except for the end-of-line. */ #define REG_NOTEOL (1 << 1) /* If any error codes are removed, changed, or added, update the `re_error_msg' table in regex.c. */ typedef enum { REG_NOERROR = 0, /* Success. */ REG_NOMATCH, /* Didn't find a match (for regexec). */ /* POSIX regcomp return error codes. (In the order listed in the standard.) */ REG_BADPAT, /* Invalid pattern. */ REG_ECOLLATE, /* Not implemented. */ REG_ECTYPE, /* Invalid character class name. */ REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ REG_EBRACK, /* Unmatched left bracket. */ REG_EPAREN, /* Parenthesis imbalance. */ REG_EBRACE, /* Unmatched \{. */ REG_BADBR, /* Invalid contents of \{\}. */ REG_ERANGE, /* Invalid range end. */ REG_ESPACE, /* Ran out of memory. */ REG_BADRPT, /* No preceding re for repetition op. */ /* Error codes we've added. */ REG_EEND, /* Premature end. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ } reg_errcode_t; /* This data structure represents a compiled pattern. Before calling the pattern compiler, the fields `buffer', `allocated', `fastmap', `translate', and `no_sub' can be set. After the pattern has been compiled, the `re_nsub' field is available. All other fields are private to the regex routines. */ #ifndef RE_TRANSLATE_TYPE #define RE_TRANSLATE_TYPE char * #endif struct re_pattern_buffer { /* [[[begin pattern_buffer]]] */ /* Space that holds the compiled pattern. It is declared as `unsigned char *' because its elements are sometimes used as array indexes. */ unsigned char *buffer; /* Number of bytes to which `buffer' points. */ unsigned long int allocated; /* Number of bytes actually used in `buffer'. */ unsigned long int used; /* Syntax setting with which the pattern was compiled. */ reg_syntax_t syntax; /* Pointer to a fastmap, if any, otherwise zero. re_search uses the fastmap, if there is one, to skip over impossible starting points for matches. */ char *fastmap; /* Either a translate table to apply to all characters before comparing them, or zero for no translation. The translation is applied to a pattern when it is compiled and to a string when it is matched. */ RE_TRANSLATE_TYPE translate; /* Number of subexpressions found by the compiler. */ size_t re_nsub; /* Zero if this pattern cannot match the empty string, one else. Well, in truth it's used only in `re_search_2', to see whether or not we should use the fastmap, so we don't set this absolutely perfectly; see `re_compile_fastmap' (the `duplicate' case). */ unsigned can_be_null : 1; /* If REGS_UNALLOCATED, allocate space in the `regs' structure for `max (RE_NREGS, re_nsub + 1)' groups. If REGS_REALLOCATE, reallocate space if necessary. If REGS_FIXED, use what's there. */ #define REGS_UNALLOCATED 0 #define REGS_REALLOCATE 1 #define REGS_FIXED 2 unsigned regs_allocated : 2; /* Set to zero when `regex_compile' compiles a pattern; set to one by `re_compile_fastmap' if it updates the fastmap. */ unsigned fastmap_accurate : 1; /* If set, `re_match_2' does not return information about subexpressions. */ unsigned no_sub : 1; /* If set, a beginning-of-line anchor doesn't match at the beginning of the string. */ unsigned not_bol : 1; /* Similarly for an end-of-line anchor. */ unsigned not_eol : 1; /* If true, an anchor at a newline matches. */ unsigned newline_anchor : 1; /* [[[end pattern_buffer]]] */ }; typedef struct re_pattern_buffer regex_t; /* Type for byte offsets within the string. POSIX mandates this. */ typedef int regoff_t; /* This is the structure we store register match data in. See regex.texinfo for a full description of what registers match. */ struct re_registers { unsigned num_regs; regoff_t *start; regoff_t *end; }; /* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, `re_match_2' returns information about at least this many registers the first time a `regs' structure is passed. */ #ifndef RE_NREGS #define RE_NREGS 30 #endif /* POSIX specification for registers. Aside from the different names than `re_registers', POSIX uses an array of structures, instead of a structure of arrays. */ typedef struct { regoff_t rm_so; /* Byte offset from string's start to substring's start. */ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ } regmatch_t; /* Declarations for routines. */ /* To avoid duplicating every routine declaration -- once with a prototype (if we are ANSI), and once without (if we aren't) -- we use the following macro to declare argument types. This unfortunately clutters up the declarations a bit, but I think it's worth it. */ #if defined(__STDC__) || defined(_WIN32) #define _RE_ARGS(args) args #else /* not __STDC__ */ #define _RE_ARGS(args) () #endif /* not __STDC__ */ /* Sets the current default syntax to SYNTAX, and return the old syntax. You can also simply assign to the `re_syntax_options' variable. */ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); /* Compile the regular expression PATTERN, with length LENGTH and syntax given by the global `re_syntax_options', into the buffer BUFFER. Return NULL if successful, and an error string if not. */ extern const char *re_compile_pattern _RE_ARGS ((const char *pattern, size_t length, struct re_pattern_buffer *buffer)); /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); /* Search in the string STRING (with length LENGTH) for the pattern compiled into BUFFER. Start searching at position START, for RANGE characters. Return the starting position of the match, -1 for no match, or -2 for an internal error. Also return register information in REGS (if REGS and BUFFER->no_sub are nonzero). */ extern int re_search _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs)); /* Like `re_search', but search in the concatenation of STRING1 and STRING2. Also, stop searching at index START + STOP. */ extern int re_search_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop)); /* Like `re_search', but return how many characters in STRING the regexp in BUFFER matched, starting at position START. */ extern int re_match _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs)); /* Relates to `re_match' as `re_search_2' relates to `re_search'. */ extern int re_match_2 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop)); /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using BUFFER and REGS will use this memory for recording register information. STARTS and ENDS must be allocated with malloc, and must each be at least `NUM_REGS * sizeof (regoff_t)' bytes long. If NUM_REGS == 0, then subsequent matches should allocate their own register data. Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ extern void re_set_registers _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends)); #ifdef _REGEX_RE_COMP #ifndef _CRAY /* 4.2 bsd compatibility. */ extern char *re_comp _RE_ARGS ((const char *)); extern int re_exec _RE_ARGS ((const char *)); #endif #endif /* POSIX compatibility. */ int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags)); int regexec _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)); size_t regerror _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)); void regfree _RE_ARGS ((regex_t *preg)); #ifdef __cplusplus } #endif /* C++ */ #endif /* not __REGEXP_LIBRARY_H__ */ /* Local variables: make-backup-files: t version-control: t trim-versions-without-asking: nil End: */ htdig-3.2.0b6/htlib/snprintf.c0100644006314600127310000000261710055635552015510 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef HAVE_SNPRINTF #ifndef NO_SYSTEM_INCLUDES #include #include #ifdef __STDC__ #include #else #include #endif #endif /* * snprintf -- * Bounded version of sprintf. * * PUBLIC: #ifndef HAVE_SNPRINTF * PUBLIC: #ifdef __STDC__ * PUBLIC: int snprintf __P((char *, size_t, const char *, ...)); * PUBLIC: #else * PUBLIC: int snprintf(); * PUBLIC: #endif * PUBLIC: #endif */ int #ifdef __STDC__ snprintf(char *str, size_t n, const char *fmt, ...) #else snprintf(str, n, fmt, va_alist) char *str; size_t n; const char *fmt; va_dcl #endif { va_list ap; int rval; n = 0; #ifdef __STDC__ va_start(ap, fmt); #else va_start(ap); #endif #ifdef SPRINTF_RET_CHARPNT (void)vsprintf(str, fmt, ap); va_end(ap); return (strlen(str)); #else rval = vsprintf(str, fmt, ap); va_end(ap); return (rval); #endif } #endif /* HAVE_SNPRINTF */ htdig-3.2.0b6/htlib/strcasecmp.cc0100644006314600127310000000416010055635552016147 0ustar angusgbhtdig// // strcasecmp.cc // // strcasecmp: replacement of the strcasecmp functions for architectures that do // not have it. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: strcasecmp.cc,v 1.10 2004/05/28 13:15:22 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" #include //***************************************************************************** // int mystrcasecmp(const char *str1, const char *str2) { if (!str1 && !str2) return 0; if (!str1) return 1; if (!str2) return -1; while (*str1 && *str2 && tolower((unsigned char)*str1) == tolower((unsigned char)*str2)) { str1++; str2++; } return tolower((unsigned char)*str1) - tolower((unsigned char)*str2); } //#define tolower(ch) (isupper(ch) ? (ch) + 'a' - 'A' : (ch)) //***************************************************************************** // int mystrncasecmp(const char *str1, const char *str2, int n) { if (!str1 && !str2) return 0; if (!str1) return 1; if (!str2) return -1; if (n < 0) return 0; while (n && *str1 && *str2 && tolower((unsigned char)*str1) == tolower((unsigned char)*str2)) { str1++; str2++; n--; } return n == 0 ? 0 : tolower((unsigned char)*str1) - tolower((unsigned char)*str2); } //***************************************************************************** // char *strdup(char *str) // char *strdup(char *str) { char *p = new char[strlen(str) + 1]; strcpy(p, str); return p; } //***************************************************************************** // char *mystrcasestr(const char *s, const char *pattern) // const char * mystrcasestr(const char *s, const char *pattern) { int length = strlen(pattern); while (*s) { if (mystrncasecmp(s, pattern, length) == 0) return s; s++; } return 0; } htdig-3.2.0b6/htlib/strerror.c0100644006314600127310000000551410055635552015526 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef HAVE_STRERROR /* * strerror -- * Return the string associated with an errno. * * PUBLIC: #ifndef HAVE_STRERROR * PUBLIC: char *strerror __P((int)); * PUBLIC: #endif */ char * strerror(num) int num; { extern int sys_nerr; extern char *sys_errlist[]; #undef UPREFIX #define UPREFIX "Unknown error: " static char ebuf[40] = UPREFIX; /* 64-bit number + slop */ int errnum; char *p, *t, tmp[40]; errnum = num; /* convert to unsigned */ if (errnum < sys_nerr) return(sys_errlist[errnum]); /* Do this by hand, so we don't include stdio(3). */ t = tmp; do { *t++ = "0123456789"[errnum % 10]; } while (errnum /= 10); for (p = ebuf + sizeof(UPREFIX) - 1;;) { *p++ = *--t; if (t <= tmp) break; } return(ebuf); } #endif /* HAVE_STRERROR */ htdig-3.2.0b6/htlib/strptime.cc0100644006314600127310000001747610055635552015670 0ustar angusgbhtdig// Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // /* * Copyright (c) 1994 Powerdog Industries. All rights reserved. * * Redistribution and use in source and binary forms, without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgement: * This product includes software developed by Powerdog Industries. * 4. The name of Powerdog Industries may not be used to endorse or * promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY POWERDOG INDUSTRIES ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE POWERDOG INDUSTRIES BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint /* static char copyright[] = "@(#) Copyright (c) 1994 Powerdog Industries. All rights reserved."; static char sccsid[] = "@(#)strptime.c 1.0 (Powerdog) 94/03/27"; */ #endif /* not lint */ #include #include #include #include #include #define asizeof(a) ((int)(sizeof (a) / sizeof ((a)[0]))) struct mydtconv { char *abbrev_month_names[12]; char *month_names[12]; char *abbrev_weekday_names[7]; char *weekday_names[7]; char *time_format; char *sdate_format; char *dtime_format; char *am_string; char *pm_string; char *ldate_format; }; static struct mydtconv En_US = { { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }, { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }, { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }, "%H:%M:%S", "%m/%d/%y", "%a %b %e %T %Z %Y", "AM", "PM", "%A, %B, %e, %Y" }; char * mystrptime(const char *buf, const char *fmt, struct tm *tm) { char c; const char *ptr; int i, len = 0; ptr = fmt; while (*ptr != 0) { if (*buf == 0) break; c = *ptr++; if (c != '%') { if (isspace(c)) while (*buf != 0 && isspace(*buf)) buf++; else if (c != *buf++) return 0; continue; } c = *ptr++; switch (c) { case 0: case '%': if (*buf++ != '%') return 0; break; case 'C': buf = mystrptime(buf, En_US.ldate_format, tm); if (buf == 0) return 0; break; case 'c': buf = mystrptime(buf, "%x %X", tm); if (buf == 0) return 0; break; case 'D': buf = mystrptime(buf, "%m/%d/%y", tm); if (buf == 0) return 0; break; case 'R': buf = mystrptime(buf, "%H:%M", tm); if (buf == 0) return 0; break; case 'r': buf = mystrptime(buf, "%I:%M:%S %p", tm); if (buf == 0) return 0; break; case 'T': buf = mystrptime(buf, "%H:%M:%S", tm); if (buf == 0) return 0; break; case 'X': buf = mystrptime(buf, En_US.time_format, tm); if (buf == 0) return 0; break; case 'x': buf = mystrptime(buf, En_US.sdate_format, tm); if (buf == 0) return 0; break; case 'j': if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (i > 365) return 0; tm->tm_yday = i; break; case 'M': case 'S': if (*buf == 0 || isspace(*buf)) break; if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (i > 59) return 0; if (c == 'M') tm->tm_min = i; else tm->tm_sec = i; if (*buf != 0 && isspace(*buf)) while (*ptr != 0 && !isspace(*ptr)) ptr++; break; case 'H': case 'I': case 'k': case 'l': if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (c == 'H' || c == 'k') { if (i > 23) return 0; } else if (i > 11) return 0; tm->tm_hour = i; if (*buf != 0 && isspace(*buf)) while (*ptr != 0 && !isspace(*ptr)) ptr++; break; case 'p': len = strlen(En_US.am_string); if (mystrncasecmp(buf, En_US.am_string, len) == 0) { if (tm->tm_hour > 12) return 0; if (tm->tm_hour == 12) tm->tm_hour = 0; buf += len; break; } len = strlen(En_US.pm_string); if (mystrncasecmp(buf, En_US.pm_string, len) == 0) { if (tm->tm_hour > 12) return 0; if (tm->tm_hour != 12) tm->tm_hour += 12; buf += len; break; } return 0; case 'A': case 'a': for (i = 0; i < asizeof(En_US.weekday_names); i++) { len = strlen(En_US.weekday_names[i]); if (mystrncasecmp(buf, En_US.weekday_names[i], len) == 0) break; len = strlen(En_US.abbrev_weekday_names[i]); if (mystrncasecmp(buf, En_US.abbrev_weekday_names[i], len) == 0) break; } if (i == asizeof(En_US.weekday_names)) return 0; tm->tm_wday = i; buf += len; break; case 'd': case 'e': if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (i > 31) return 0; tm->tm_mday = i; if (*buf != 0 && isspace(*buf)) while (*ptr != 0 && !isspace(*ptr)) ptr++; break; case 'B': case 'b': case 'h': for (i = 0; i < asizeof(En_US.month_names); i++) { len = strlen(En_US.month_names[i]); if (mystrncasecmp(buf, En_US.month_names[i], len) == 0) break; len = strlen(En_US.abbrev_month_names[i]); if (mystrncasecmp(buf, En_US.abbrev_month_names[i], len) == 0) break; } if (i == asizeof(En_US.month_names)) return 0; tm->tm_mon = i; buf += len; break; case 'm': if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (i < 1 || i > 12) return 0; tm->tm_mon = i - 1; if (*buf != 0 && isspace(*buf)) while (*ptr != 0 && !isspace(*ptr)) ptr++; break; case 'Y': case 'y': if (*buf == 0 || isspace(*buf)) break; if (!isdigit(*buf)) return 0; for (i = 0; *buf != 0 && isdigit(*buf); buf++) { i *= 10; i += *buf - '0'; } if (c == 'y' && i < 69) /* Unix Epoch pivot year */ i += 100; if (c == 'Y') i -= 1900; if (i < 0) return 0; tm->tm_year = i; if (*buf != 0 && isspace(*buf)) while (*ptr != 0 && !isspace(*ptr)) ptr++; break; } } return (char *) buf; } htdig-3.2.0b6/htlib/timegm.c0100644006314600127310000000733110055635552015125 0ustar angusgbhtdig/* timegm.cc timegm: Portable version of timegm (mytimegm) for ht://Dig Based on a version from the GNU C Library and a previous implementation for ht://Dig Part of the ht://Dig package Copyright (c) 1999-2004 The ht://Dig Group For copyright details, see the file COPYING in your distribution or the GNU Library General Public License (LGPL) version 2 or later $Id: timegm.c,v 1.18 2004/05/28 13:15:22 lha Exp $ */ /* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert (eggert@twinsun.com). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* #define TEST_TIMEGM */ #include #ifdef TEST_TIMEGM #include #include #endif static struct tm *my_mktime_gmtime_r (const time_t *t, struct tm *tp); static struct tm *my_mktime_gmtime_r (const time_t *t, struct tm *tp) { struct tm *l = gmtime (t); if (! l) return 0; *tp = *l; return tp; } time_t __mktime_internal(struct tm *, struct tm *(*) (const time_t *, struct tm *), time_t *); time_t Httimegm(tmp) struct tm *tmp; { static time_t gmtime_offset; tmp->tm_isdst = 0; return __mktime_internal (tmp, my_mktime_gmtime_r, &gmtime_offset); } #ifdef TEST_TIMEGM void parse_time(char *s, struct tm *tm) { sscanf(s, "%d.%d.%d %d:%d:%d", &tm->tm_year, &tm->tm_mon, &tm->tm_mday, &tm->tm_hour, &tm->tm_min, &tm->tm_sec); tm->tm_year -= 1900; tm->tm_mon--; } void print_time(struct tm *tm) { fprintf(stderr, "%04d.%02d.%02d %02d:%02d:%02d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); } int time_equal(struct tm *tm1, struct tm *tm2) { return ((tm1->tm_year == tm2->tm_year) && (tm1->tm_mon == tm2->tm_mon) && (tm1->tm_mday == tm2->tm_mday) && (tm1->tm_hour == tm2->tm_hour) && (tm1->tm_min == tm2->tm_min) && (tm1->tm_sec == tm2->tm_sec)); } int main(void) { char *test_dates[] = { "1970.01.01 00:00:00", "1970.01.01 00:00:01", "1972.02.05 23:59:59", "1972.02.28 00:59:59", "1972.02.28 23:59:59", "1972.02.29 00:00:00", "1972.03.01 13:00:04", "1973.03.01 12:00:00", "1980.01.01 00:00:05", "1984.12.31 23:00:00", "1997.06.05 17:55:35", "1999.12.31 23:00:00", "2000.01.01 00:00:05", "2000.02.28 23:00:05", "2000.02.29 23:00:05", "2000.03.01 00:00:05", "2007.06.05 17:55:35", "2038.01.19 03:14:07", 0 }; int i, ok = 1; struct tm orig, *conv; time_t t; for (i = 0; (test_dates[i]); i++) { parse_time(test_dates[i], &orig); t = Httimegm(&orig); conv = gmtime(&t); if (!time_equal(&orig, conv)) { fprintf(stderr, "timegm() test failed!\n Original: "); print_time(&orig); fprintf(stderr, "\n Converted: "); print_time(conv); fprintf(stderr, "\n time_t: %ld\n", (long) t); ok = 0; } } exit(ok ? 0 : 1); } #endif htdig-3.2.0b6/htlib/vsnprintf.c0100644006314600127310000000210510055635552015666 0ustar angusgbhtdig/* Part of the ht://Dig package */ /* Copyright (c) 1999-2004 The ht://Dig Group */ /* For copyright details, see the file COPYING in your distribution */ /* or the GNU Library General Public License (LGPL) version 2 or later */ /* */ /*- * See the file LICENSE for redistribution information. * * Copyright (c) 1996, 1997, 1998, 1999 * Sleepycat Software. All rights reserved. */ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifndef HAVE_VSNPRINTF #ifndef NO_SYSTEM_INCLUDES #include #include #ifdef __STDC__ #include #else #include #endif #endif /* * vsnprintf -- * Bounded version of vsprintf. * * PUBLIC: #ifndef HAVE_VSNPRINTF * PUBLIC: int vsnprintf(); * PUBLIC: #endif */ int vsnprintf(str, n, fmt, ap) char *str; size_t n; const char *fmt; va_list ap; { n = 0; #ifdef SPRINTF_RET_CHARPNT (void)vsprintf(str, fmt, ap); return (strlen(str)); #else return (vsprintf(str, fmt, ap)); #endif } #endif /* HAVE_VSNPRINTF */ htdig-3.2.0b6/htmerge/0040755006314600127310000000000010063260370014016 5ustar angusgbhtdightdig-3.2.0b6/htmerge/.sniffdir/0040755006314600127310000000000010063260370015700 5ustar angusgbhtdightdig-3.2.0b6/htnet/0040755006314600127310000000000010063260370013505 5ustar angusgbhtdightdig-3.2.0b6/htnet/.cvsignore0100644006314600127310000000005506773673600015523 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htdig-3.2.0b6/htnet/Connection.cc0100644006314600127310000004535510055635552016135 0ustar angusgbhtdig// // Connection.cc // // Connection: This class forms a easy to use interface to the berkeley // tcp socket library. All the calls are basically the same, // but the parameters do not have any stray _addr or _in // mixed in... // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Connection.cc,v 1.10 2004/05/28 13:15:22 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Connection.h" #include "Object.h" #include "List.h" #include #include #include #ifdef _MSC_VER /* _WIN32 */ #include #include #define EALREADY WSAEALREADY #define EISCONN WSAEISCONN #else #include #include // For inet_ntoa #include #include #include #include #endif #ifndef _MSC_VER /* _WIN32 */ #include #include #else #include #endif #include #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif typedef void (*SIGNAL_HANDLER) (...); #ifndef _MSC_VER /* _WIN32 */ extern "C" { int rresvport(int *); } #endif #undef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) List all_connections; //************************************************************************* // Connection::Connection(int socket) // - Default constructor // PURPOSE: // Create a connection from just a socket. // PARAMETERS: // int socket: obvious!!!! // //************************************************************************* Connection::Connection(int socket) : pos(0), pos_max(0), sock(socket), connected(0), peer(""), server_name(""), server_ip_address(""), need_io_stop(0), timeout_value(0), retry_value(1), wait_time(5) // wait 5 seconds after a failed connection attempt { Win32Socket_Init(); if (socket > 0) { GETPEERNAME_LENGTH_T length = sizeof(server); if (getpeername(socket, (struct sockaddr *)&server, &length) < 0) perror("getpeername"); } all_connections.Add(this); } // Copy constructor Connection::Connection(const Connection& rhs) : pos(rhs.pos), pos_max(rhs.pos_max), sock(rhs.sock), connected(rhs.connected), peer(rhs.peer), server_name(rhs.server_name), server_ip_address(rhs.server_ip_address), need_io_stop(rhs.need_io_stop), timeout_value(rhs.timeout_value), retry_value(rhs.retry_value), wait_time(rhs.wait_time) // wait 5 seconds after a failed connection attempt { all_connections.Add(this); } //***************************************************************************** // Connection::~Connection() // Connection::~Connection() { all_connections.Remove(this); this->Close(); } //***************************************************************************** // int Connection::Win32Socket_init(void) // // This function is only used when Code is compiled as a Native Windows // application // // The native Windows socket system needs to be initialized. // int Connection::Win32Socket_Init(void) { #ifdef _MSC_VER /* _WIN32 */ WORD wVersionRequested; WSADATA wsaData; wVersionRequested = MAKEWORD(2, 2); if (WSAStartup(wVersionRequested, &wsaData)) return(-1); if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2 ) { WSACleanup(); return(-1); } #endif return(0); } //***************************************************************************** // int Connection::Open(int priv) // int Connection::Open(int priv) { if (priv) { int aport = IPPORT_RESERVED - 1; // Native Windows (MSVC) has no rresvport #ifndef _MSC_VER /* _WIN32 */ sock = rresvport(&aport); #else return NOTOK; #endif } else { sock = socket(AF_INET, SOCK_STREAM, 0); //cout << "socket() sock=" << sock << endl; } if (sock == NOTOK) return NOTOK; int on = 1; setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on)); server.sin_family = AF_INET; return OK; } //***************************************************************************** // int Connection::Ndelay() // int Connection::Ndelay() { #ifndef _MSC_VER /* _WIN32 */ return fcntl(sock, F_SETFL, FNDELAY); #else // Note: This function is never called // TODO: Look into ioctsocket(..) of Win32 Socket API return(0); #endif } //***************************************************************************** // int Connection::Nondelay() // int Connection::Nondelay() { #ifndef _MSC_VER /* _WIN32 */ return fcntl(sock, F_SETFL, 0); #else // Note: This function is never called // TODO: Look into ioctsocket(..) of Win32 Socket API return(0); #endif } //***************************************************************************** // int Connection::Timeout(int value) // int Connection::Timeout(int value) { int oval = timeout_value; timeout_value = value; return oval; } //***************************************************************************** // int Connection::retries(int value) // int Connection::Retries(int value) { int oval = retry_value; retry_value = value; return oval; } //***************************************************************************** // int Connection::Close() // int Connection::Close() { connected = 0; if (sock >= 0) { int ret = close(sock); sock = -1; return ret; } return NOTOK; } //***************************************************************************** // int Connection::Assign_Port(int port) // int Connection::Assign_Port(int port) { server.sin_port = htons(port); return OK; } //***************************************************************************** // int Connection::Assign_Port(char *service) // int Connection::Assign_Port(const String &service) { struct servent *sp; sp = getservbyname(service, "tcp"); if (sp == 0) { return NOTOK; } server.sin_port = sp->s_port; return OK; } //***************************************************************************** // int Connection::Assign_Server(unsigned int addr) // int Connection::Assign_Server(unsigned int addr) { server.sin_addr.s_addr = addr; return OK; } #ifndef _MSC_VER /* _WIN32 */ //extern "C" unsigned int inet_addr(char *); #endif //***************************************************************************** // int Connection::Assign_Server(const String& name) { struct hostent *hp; char **alias_list; unsigned int addr; // // inet_addr arg IS const char even though prototype says otherwise // addr = inet_addr((char*)name.get()); if (addr == (unsigned int)~0) { // Gets the host given a string hp = gethostbyname(name); if (hp == 0) return NOTOK; alias_list = hp->h_aliases; memcpy((char *)&server.sin_addr, (char *)hp->h_addr, hp->h_length); } else { memcpy((char *)&server.sin_addr, (char *)&addr, sizeof(addr)); } server_name = name.get(); server_ip_address = inet_ntoa(server.sin_addr); return OK; } // // Do nothing, we are only interested in the EINTR return of the // running system call. // static void handler_timeout(int) { } //***************************************************************************** // int Connection::Connect() // int Connection::Connect() { int status; int retries = retry_value; while (retries--) { #ifndef _MSC_VER /* _WIN32 */ // // Set an alarm to make sure the connect() call times out // appropriately This ensures the call won't hang on a // dead server or bad DNS call. // Save the previous alarm signal handling policy, if any. // struct sigaction action; struct sigaction old_action; memset((char*)&action, '\0', sizeof(struct sigaction)); memset((char*)&old_action, '\0', sizeof(struct sigaction)); action.sa_handler = handler_timeout; sigaction(SIGALRM, &action, &old_action); alarm(timeout_value); #endif status = connect(sock, (struct sockaddr *)&server, sizeof(server)); // // Disable alarm and restore previous policy if any // #ifndef _MSC_VER /* _WIN32 */ alarm(0); sigaction(SIGALRM, &old_action, 0); #endif if (status == 0 || errno == EALREADY || errno == EISCONN) { connected = 1; return OK; } // // Only loop if timed out. Other errors are fatal. // if (status < 0 && errno != EINTR) break; // cout << " <" << ::strerror(errno) << "> "; close(sock); Open(); sleep(wait_time); } #if 0 if (status == ECONNREFUSED) { // // For the case where the connection attempt is refused, we need // to close the socket and create a new one in order to do any // more with it. // Close(sock); Open(); } #else close(sock); Open(0); #endif connected = 0; return NOTOK; } //***************************************************************************** // int Connection::Bind() // int Connection::Bind() { if (bind(sock, (struct sockaddr *)&server, sizeof(server)) == NOTOK) { return NOTOK; } return OK; } //***************************************************************************** // int Connection::Get_Port() // int Connection::Get_Port() { GETPEERNAME_LENGTH_T length = sizeof(server); if (getsockname(sock, (struct sockaddr *)&server, &length) == NOTOK) { return NOTOK; } return ntohs(server.sin_port); } //***************************************************************************** // int Connection::Listen(int n) // int Connection::Listen(int n) { return listen(sock, n); } //***************************************************************************** // Connection *Connection::Accept(int priv) // Connection *Connection::Accept(int priv) { int newsock; while (1) { newsock = accept(sock, (struct sockaddr *)0, (GETPEERNAME_LENGTH_T *)0); if (newsock == NOTOK && errno == EINTR) continue; break; } if (newsock == NOTOK) return (Connection *)0; Connection *newconnect = new Connection; newconnect->sock = newsock; GETPEERNAME_LENGTH_T length = sizeof(newconnect->server); getpeername(newsock, (struct sockaddr *)&newconnect->server, &length); if (priv && newconnect->server.sin_port >= IPPORT_RESERVED) { delete newconnect; return (Connection *)0; } return newconnect; } //************************************************************************* // Connection *Connection::Accept_Privileged() // PURPOSE: // Accept in incoming connection but only if it is from a // privileged port // Connection * Connection::Accept_Privileged() { return Accept(1); } //***************************************************************************** // int Connection::read_char() // int Connection::Read_Char() { if (pos >= pos_max) { pos_max = Read_Partial(buffer, sizeof(buffer)); pos = 0; if (pos_max <= 0) { return -1; } } return buffer[pos++] & 0xff; } //***************************************************************************** // String *Connection::Read_Line(String &s, char *terminator) // String *Connection::Read_Line(String &s, char *terminator) { int termseq = 0; s = 0; for (;;) { int ch = Read_Char(); if (ch < 0) { // // End of file reached. If we still have stuff in the input buffer // we need to return it first. When we get called again we will // return 0 to let the caller know about the EOF condition. // if (s.length()) break; else return (String *) 0; } else if (terminator[termseq] && ch == terminator[termseq]) { // // Got one of the terminator characters. We will not put // it in the string but keep track of the fact that we // have seen it. // termseq++; if (!terminator[termseq]) break; } else { s << (char) ch; } } return &s; } //***************************************************************************** // String *Connection::read_line(char *terminator) // String *Connection::Read_Line(char *terminator) { String *s; s = new String; return Read_Line(*s, terminator); } //***************************************************************************** // char *Connection::read_line(char *buffer, int maxlength, char *terminator) // char *Connection::Read_Line(char *buffer, int maxlength, char *terminator) { char *start = buffer; int termseq = 0; while (maxlength > 0) { int ch = Read_Char(); if (ch < 0) { // // End of file reached. If we still have stuff in the input buffer // we need to return it first. When we get called again, we will // return 0 to let the caller know about the EOF condition. // if (buffer > start) break; else return (char *) 0; } else if (terminator[termseq] && ch == terminator[termseq]) { // // Got one of the terminator characters. We will not put // it in the string but keep track of the fact that we // have seen it. // termseq++; if (!terminator[termseq]) break; } else { *buffer++ = ch; maxlength--; } } *buffer = '\0'; return start; } //***************************************************************************** // int Connection::write_line(char *str, char *eol) // int Connection::Write_Line(char *str, char *eol) { int n, nn; if ((n = Write(str)) < 0) return -1; if ((nn = Write(eol)) < 0) return -1; return n + nn; } //***************************************************************************** // int Connection::Write(char *buffer, int length) // int Connection::Write(char *buffer, int length) { int nleft, nwritten; if (length == -1) length = strlen(buffer); nleft = length; while (nleft > 0) { nwritten = Write_Partial(buffer, nleft); if (nwritten < 0 && errno == EINTR) continue; if (nwritten <= 0) return nwritten; nleft -= nwritten; buffer += nwritten; } return length - nleft; } //***************************************************************************** // int Connection::Read(char *buffer, int length) // int Connection::Read(char *buffer, int length) { int nleft, nread; nleft = length; // // If there is data in our internal input buffer, use that first. // if (pos < pos_max) { int n = MIN(length, pos_max - pos); memcpy(buffer, &this->buffer[pos], n); pos += n; buffer += n; nleft -= n; } while (nleft > 0) { nread = Read_Partial(buffer, nleft); if (nread < 0 && errno == EINTR) continue; if (nread < 0) return -1; else if (nread == 0) break; nleft -= nread; buffer += nread; } return length - nleft; } void Connection::Flush() { pos = pos_max = 0; } //************************************************************************* // int Connection::Read_Partial(char *buffer, int maxlength) // PURPOSE: // Read at most from the current TCP connection. // This is equivalent to the workings of the standard read() // system call // PARAMETERS: // char *buffer: Buffer to read the data into // int maxlength: Maximum number of bytes to read into the buffer // RETURN VALUE: // The actual number of bytes read in. // ASSUMPTIONS: // The connection has been previously established. // FUNCTIONS USED: // read() // int Connection::Read_Partial(char *buffer, int maxlength) { int count; need_io_stop = 0; do { errno = 0; if (timeout_value > 0) { FD_SET_T fds; FD_ZERO(&fds); FD_SET(sock, &fds); timeval tv; tv.tv_sec = timeout_value; tv.tv_usec = 0; int selected = select(sock+1, &fds, 0, 0, &tv); if (selected <= 0) need_io_stop++; } if (!need_io_stop) count = recv(sock, buffer, maxlength, 0); else count = -1; // Input timed out } while (count <= 0 && errno == EINTR && !need_io_stop); need_io_stop = 0; return count; } //************************************************************************* // int Connection::Write_Partial(char *buffer, int maxlength) // int Connection::Write_Partial(char *buffer, int maxlength) { int count; do { count = send(sock, buffer, maxlength, 0); } while (count < 0 && errno == EINTR && !need_io_stop); need_io_stop = 0; return count; } //************************************************************************* // char * Connection::Socket_as_String() // PURPOSE: // Return the numeric ASCII equivalent of the socket number. // This is needed to pass the socket to another program // char * Connection::Socket_as_String() { char *buffer = new char[20]; sprintf(buffer, "%d", sock); return buffer; } #ifndef _MSC_VER /* _WIN32 */ extern "C" char *inet_ntoa(struct in_addr); #endif //************************************************************************* // char *Connection::Get_Peername() // const char* Connection::Get_Peername() { if (peer.empty()) { struct sockaddr_in p; GETPEERNAME_LENGTH_T length = sizeof(p); struct hostent *hp; if (getpeername(sock, (struct sockaddr *) &p, &length) < 0) { return 0; } length = sizeof(p.sin_addr); hp = gethostbyaddr((const char *) &p.sin_addr, length, AF_INET); if (hp) peer = (char *) hp->h_name; else peer = (char *) inet_ntoa(p.sin_addr); } return (const char*) peer.get(); } //************************************************************************* // char *Connection::Get_PeerIP() // const char* Connection::Get_PeerIP() const { struct sockaddr_in p; GETPEERNAME_LENGTH_T length = sizeof(p); if (getpeername(sock, (struct sockaddr *) &p, &length) < 0) { return 0; } return (const char*) inet_ntoa(p.sin_addr); } #ifdef NEED_PROTO_GETHOSTNAME extern "C" int gethostname(char *name, int namelen); #endif //************************************************************************* // unsigned int GetHostIP(char *ip, int length) // unsigned int GetHostIP(char *ip, int length) { char hostname[100]; if (gethostname(hostname, sizeof(hostname)) == NOTOK) return 0; struct hostent *ent = gethostbyname(hostname); if (!ent) return 0; struct in_addr addr; memcpy((char *) &addr.s_addr, ent->h_addr, sizeof(addr)); if (ip) strncpy(ip, inet_ntoa(addr), length); return addr.s_addr; } //************************************************************************* // int Connection::WaitTime(unsigned int _wt) // int Connection::WaitTime(unsigned int _wt) { wait_time = _wt; return OK; } htdig-3.2.0b6/htnet/Connection.h0100644006314600127310000001013010055635552015756 0ustar angusgbhtdig// // Connection.h // // Connection: This class forms a easy to use interface to the berkeley // tcp socket library. All the calls are basically the same, // but the parameters do not have any stray _addr or _in // mixed in... // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Connection.h,v 1.10 2004/05/28 13:15:22 lha Exp $ // #ifndef _Connection_h_ #define _Connection_h_ #include "Object.h" #include "htString.h" #include #include #ifdef _MSC_VER /* _WIN32 */ #include #else #include #include #include #endif class Connection : public Object { public: // Constructors & Destructors Connection(int socket = -1); // Default constructor Connection(const Connection& rhs); // Copy constructor ~Connection(); // (De)initialization int Win32Socket_Init(void); int Open(int priv = 0); virtual int Close(); int Ndelay(); int Nondelay(); int Timeout(int value); int Retries(int value); int WaitTime(unsigned int _wt); // Port stuff int Assign_Port(int port = 0); int Assign_Port(const String& service); int Get_Port(); inline int Is_Privileged(); // Host stuff int Assign_Server(const String& name); int Assign_Server(unsigned int addr = INADDR_ANY); const String &Get_Server() const { return server_name; } const String &Get_Server_IPAddress() const { return server_ip_address; } // Connection establishment virtual int Connect(); Connection *Accept(int priv = 0); Connection *Accept_Privileged(); // Registration things int Bind(); int Listen(int n = 5); // IO String* Read_Line(String &, char *terminator = (char *)"\n"); char* Read_Line(char *buffer, int maxlength, char *terminator=(char *)"\n"); String* Read_Line(char *terminator = (char *)"\n"); virtual int Read_Char(); int Write_Line(char *buffer, char *eol = (char *)"\n"); int Write(char *buffer, int maxlength = -1); int Read(char *buffer, int maxlength); virtual int Read_Partial(char *buffer, int maxlength); virtual int Write_Partial(char *buffer, int maxlength); void Stop_IO() {need_io_stop = 1;} // Access to socket number char *Socket_as_String(); int Get_Socket() { return sock; } int IsOpen() { return sock >= 0; } int IsConnected() { return connected; } // Access to info about remote socket const char* Get_PeerIP() const; const char* Get_Peername(); // A method to re-initialize the buffer virtual void Flush(); private: // // For buffered IO we will need a buffer // enum {BUFFER_SIZE = 8192}; char buffer[BUFFER_SIZE]; int pos, pos_max; // Assignment operator declared private for preventing any use Connection& operator+ (const Connection& rhs) { return *this; } protected: int sock; struct sockaddr_in server; int connected; String peer; String server_name; String server_ip_address; int need_io_stop; int timeout_value; int retry_value; unsigned int wait_time; // time to wait after an // unsuccessful connection }; //************************************************************************* // inline int Connection::Is_Privileged() // PURPOSE: // Return whether the port is priveleged or not. // inline int Connection::Is_Privileged() { return server.sin_port < 1023; } // // Get arround the lack of gethostip() library call... There is a gethostname() // call but we want the IP address, not the name! // The call will put the ASCII string representing the IP address in the supplied // buffer and it will also return the 4 byte unsigned long equivalent of it. // The ip buffer can be null... // unsigned int gethostip(char *ip = 0, int length = 0); #endif htdig-3.2.0b6/htnet/HtCookie.cc0100644006314600127310000002552410055635552015537 0ustar angusgbhtdig// // HtCookie.cc // // HtCookie: This class represents a HTTP cookie. // // HtCookie.cc // // by Robert La Ferla. Started 12/5/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // Cookies input file by G.Bartolini - since 27 Jan 2003 // //////////////////////////////////////////////////////////// // // The HtCookie class represents a single HTTP cookie. // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // // This class also manages the creation of a cookie from a line // of a cookie file format, which is a text file as proposed by Netscape; // each line contains a name-value pair for a cookie. // Fields within a single line are separated by the 'tab' character; // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookie.cc,v 1.14 2004/05/28 13:15:22 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtCookie.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ /////// // Static variables initialization /////// // Debug level int HtCookie::debug = 0; // Precompiled constants regarding the cookies file format (field order) #define COOKIES_FILE_DOMAIN 0 #define COOKIES_FILE_FLAG 1 #define COOKIES_FILE_PATH 2 #define COOKIES_FILE_SECURE 3 #define COOKIES_FILE_EXPIRES 4 #define COOKIES_FILE_NAME 5 #define COOKIES_FILE_VALUE 6 // Default constructor HtCookie::HtCookie() : name(0), value(0), path(0), domain(0), expires(0), isSecure(false), isDomainValid(true), srcURL(0), issue_time(), max_age(-1), rfc_version(0) { } // Constructor that accepts a name and a value // and the calling URL HtCookie::HtCookie(const String &aName, const String &aValue, const String& aURL) : name(aName), value(aValue), path(0), domain(0), expires(0), isSecure(false), isDomainValid(true), srcURL(aURL), issue_time(), max_age(-1), rfc_version(0) { } // Constructor from a server response header HtCookie::HtCookie(const String &setCookieLine, const String& aURL) : name(0), value(0), path(0), domain(0), expires(0), isSecure(false), isDomainValid(true), srcURL(aURL), issue_time(), max_age(-1), rfc_version(0) { String cookieLineStr(setCookieLine); char * token; const char * str; if (debug > 5) cout << "Creating cookie from response header: " << cookieLineStr << endl; // Parse the cookie line token = strtok(cookieLineStr, "="); if (token != NULL) { SetName(token); token = strtok(NULL, ";"); SetValue(token); } // Get all the fields returned by the server while ((str = strtok(NULL, "="))) { const char * ctoken; token = stripAllWhitespace(str); if (mystrcasecmp(token, "path") == 0) { // Let's grab the path ctoken = strtok(NULL, ";"); SetPath(ctoken); } else if (mystrcasecmp(token, "expires") == 0) { // Let's grab the expiration date HtDateTime dt; ctoken = strtok(NULL, ";"); if (ctoken && SetDate(ctoken, dt)) SetExpires(&dt); else SetExpires(0); } else if (mystrcasecmp(token, "secure") == 0) SetIsSecure(true); else if (mystrcasecmp(token, "domain") == 0) { ctoken = strtok(NULL, ";"); SetDomain(ctoken); } else if (mystrcasecmp(token, "max-age") == 0) { ctoken = strtok(NULL, ";"); SetMaxAge(atoi(ctoken)); } else if (mystrcasecmp(token, "version") == 0) { ctoken = strtok(NULL, ";"); SetVersion(atoi(ctoken)); } if (token) delete[](token); } if (debug>3) printDebug(); } // Constructor from a line of a cookie file (according to Netscape format) HtCookie::HtCookie(const String &CookieFileLine) : name(0), value(0), path(0), domain(0), expires(0), isSecure(false), isDomainValid(true), srcURL(0), issue_time(), max_age(-1), rfc_version(0) { String cookieLineStr(CookieFileLine); char * token; const char * str; if (debug > 5) cout << "Creating cookie from a cookie file line: " << cookieLineStr << endl; // Parse the cookie line if ((str = strtok(cookieLineStr, "\t"))) { int num_field = 0; int expires_value; // Holds the expires value that will be read // According to the field number, set the appropriate object member's value do { token = stripAllWhitespace(str); switch(num_field) { case COOKIES_FILE_DOMAIN: SetDomain(token); break; case COOKIES_FILE_FLAG: // Ignored break; case COOKIES_FILE_PATH: SetPath(token); break; case COOKIES_FILE_SECURE: if (mystrcasecmp(token, "false")) SetIsSecure(true); else SetIsSecure(false); break; case COOKIES_FILE_EXPIRES: if ((expires_value = atoi(token) > 0)) // Sets the expires value only if > 0 { time_t tmp = atoi(token); // avoid ambiguous arg list expires = new HtDateTime(tmp); } break; case COOKIES_FILE_NAME: SetName(token); break; case COOKIES_FILE_VALUE: SetValue(token); break; } ++num_field; } while((str = strtok(NULL, "\t"))); } if (debug>3) printDebug(); } // Copy constructor HtCookie::HtCookie(const HtCookie& rhs) : name(rhs.name), value(rhs.value), path(rhs.path), domain(rhs.domain), expires(0), isSecure(rhs.isSecure), isDomainValid(rhs.isDomainValid), srcURL(rhs.srcURL), issue_time(rhs.issue_time), max_age(rhs.max_age), rfc_version(rhs.rfc_version) { if (rhs.expires) expires = new HtDateTime(*rhs.expires); } // Destructor HtCookie::~HtCookie() { // Delete the DateTime info if (expires) delete expires; } // Set the expires datetime void HtCookie::SetExpires(const HtDateTime *aDateTime) { // // If expires has not yet been set, // we just copy the reference // otherwise, we just change the contents // of our internal attribute // // We don't have a valid datetime, it's null if (!aDateTime) { if (expires) delete expires; expires=0; } else { // We do have a valid datetime // Let's check whether expires has already been created if (!expires) expires = new HtDateTime(*aDateTime); // No ... let's create it and copy it } } // Strip all the whitespaces char * HtCookie::stripAllWhitespace(const char * str) { int len; int i; int j; char * newstr; len = strlen(str); newstr = new char[len + 1]; j = 0; for (i = 0; i < len; i++) { char c; c = str[i]; if (isspace(c) == 0) newstr[j++] = c; } newstr[j++] = (char)0; return newstr; } // Copy operator overload const HtCookie &HtCookie::operator = (const HtCookie &rhs) { // Prevent from copying itself if (this == &rhs) return *this; // Copy all the values name = rhs.name; value = rhs.value; path = rhs.path; domain = rhs.domain; srcURL = rhs.srcURL; // Set the expiration time SetExpires(rhs.expires); isSecure = rhs.isSecure; isDomainValid = rhs.isDomainValid; issue_time = rhs.issue_time; max_age = rhs.max_age; return *this; } // Print a debug message ostream& HtCookie::printDebug(ostream &out) { out << " - "; out << "NAME=" << name << " VALUE=" << value << " PATH=" << path; if (expires) out << " EXPIRES=" << expires->GetRFC850(); if (domain.length()) out << " DOMAIN=" << domain << " (" << (isDomainValid?"VALID":"INVALID") << ")"; if (max_age >= 0) out << " MAX-AGE=" << max_age; if (isSecure) out << " SECURE"; if (srcURL.length() > 0) out << " - Issued by: " << srcURL; out << endl; return out; } // // Set the date time value of a cookie's expires // Given an HtDateTime object and a datestring // It returns true if everything goes ok // and false otherwise. // int HtCookie::SetDate(const char *datestring, HtDateTime &dt) { if (!datestring) // for any reason we don't have a string for the date return 0; // and we exit DateFormat df; while (*datestring && isspace(*datestring)) datestring++; // skip initial spaces df = RecognizeDateFormat(datestring); if (df == DateFormat_NotRecognized) { // Not recognized if (debug > 0) cout << "Cookie '" << name << "' date format not recognized: " << datestring << endl; return false; } dt.ToGMTime(); // Set to GM time switch(df) { // Asc Time format case DateFormat_AscTime: dt.SetAscTime((char *)datestring); break; // RFC 1123 case DateFormat_RFC1123: dt.SetRFC1123((char *)datestring); break; // RFC 850 case DateFormat_RFC850: dt.SetRFC850((char *)datestring); break; default: if (debug > 0) cout << "Cookie '" << name << "' date format not handled: " << (int)df << endl; break; } return !(df==DateFormat_NotRecognized); } // Recognize the date sent by the server // // The expires attribute specifies a date string that defines the valid life time // of that cookie. Once the expiration date has been reached, the cookie will no // longer be stored or given out. // // The date string is formatted as: // Wdy, DD-Mon-YYYY HH:MM:SS GMT // This is based on RFC 822, RFC 850, RFC 1036, and RFC 1123, with the variations // that the only legal time zone is GMT and the separators between the elements // of the date must be dashes. // HtCookie::DateFormat HtCookie::RecognizeDateFormat(const char *datestring) { register const char *s; if (datestring) { if ((s=strchr(datestring, ','))) { // A comma is present. // Two chances: RFC1123 or RFC850 if(strchr(s, '-')) return DateFormat_RFC850; // RFC 850 recognized else return DateFormat_RFC1123; // RFC 1123 recognized } else { // No comma present // Let's try C Asctime: Sun Nov 6 08:49:37 1994 if (strlen(datestring) == 24) { return DateFormat_AscTime; } } } return DateFormat_NotRecognized; } htdig-3.2.0b6/htnet/HtCookie.h0100644006314600127310000001037610055635553015401 0ustar angusgbhtdig// // HtCookie.h // // HtCookie: Class for cookies // // by Robert La Ferla. Started 12/5/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // Cookies input file by G.Bartolini - since 27 Jan 2003 // //////////////////////////////////////////////////////////// // // The HtCookie class represents a single HTTP cookie. // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // // This class also manages the creation of a cookie from a line // of a cookie file format, which is a text file as proposed by Netscape; // each line contains a name-value pair for a cookie. // Fields within a single line are separated by the 'tab' character; // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookie.h,v 1.10 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTCOOKIE_H #define _HTCOOKIE_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "htString.h" #include "HtDateTime.h" class HtCookie : public Object { public: /////// // Construction/Destruction /////// HtCookie(); // default constructor HtCookie(const String &setCookieLine, const String& aURL); HtCookie(const String &aName, const String &aValue, const String& aURL); HtCookie(const String &line); // From a line of cookie file HtCookie(const HtCookie& rhs); // default constructor ~HtCookie(); // Destructor /////// // Public Interface /////// void SetName(const String &aName) { name = aName; } void SetValue(const String &aValue) { value = aValue; } void SetPath(const String &aPath) { path = aPath; } void SetDomain(const String &aDomain) { domain = aDomain; } void SetExpires(const HtDateTime *aDateTime); void SetIsSecure(const bool flag) { isSecure = flag; } void SetIsDomainValid(const bool flag) { isDomainValid = flag; } void SetSrcURL(const String &aURL) { srcURL = aURL; } void SetMaxAge(const int ma) { max_age = ma; } void SetVersion(const int vs) { rfc_version = vs; } const String &GetName() const { return name; } const String &GetValue()const { return value; } const String &GetPath()const { return path; } const String &GetDomain()const { return domain; } const HtDateTime *GetExpires() const { return expires; } const bool getIsSecure() const { return isSecure; } const bool getIsDomainValid() const { return isDomainValid; } const String &GetSrcURL()const { return srcURL; } const int GetMaxAge()const { return max_age; } const HtDateTime &GetIssueTime() const { return issue_time; } const int GetVersion() const { return rfc_version; } // Print debug info #ifndef _MSC_VER /* _WIN32 */ virtual ostream &printDebug(ostream &out = std::cout); #else virtual ostream &printDebug(ostream &out = cout); #endif // Set the debug level static void SetDebugLevel (int d) { debug=d;} // Copy operator overload const HtCookie &operator = (const HtCookie &rhs); protected: /////// // Date formats enumeration /////// enum DateFormat { DateFormat_RFC1123, DateFormat_RFC850, DateFormat_AscTime, DateFormat_NotRecognized }; /////// // Protected methods /////// char * stripAllWhitespace(const char * str); int SetDate(const char * datestring, HtDateTime &dt); DateFormat RecognizeDateFormat(const char * datestring); String name; String value; String path; String domain; HtDateTime * expires; bool isSecure; bool isDomainValid; String srcURL; HtDateTime issue_time; // When the cookie has been created int max_age; // rfc2109: lifetime of the cookie, in seconds int rfc_version; /////// // Debug level /////// static int debug; }; #endif htdig-3.2.0b6/htnet/HtCookieInFileJar.cc0100644006314600127310000001032610055635553017256 0ustar angusgbhtdig/////////////////////////////////////////////////////////////// // // File: HtCookieInFileJar.cc - Definition of class 'HtCookieInFileJar' // // Author: Gabriele Bartolini // Started: Mon Jan 27 14:38:42 CET 2003 // // Class which allows a cookie file to be imported in memory // for ht://Check and ht://Dig applications. // // The cookie file format is a text file, as proposed by Netscape, // and each line contains a name-value pair for a cookie. // Fields within a single line are separated by the 'tab' character; // Here is the format for a line, as taken from http://www.cookiecentral.com/faq/#3.5: // // domain - The domain that created AND that can read the variable. // flag - A TRUE/FALSE value indicating if all machines within a given domain // can access the variable. This value is set automatically by the browser, // depending on the value you set for domain. // path - The path within the domain that the variable is valid for. // secure - A TRUE/FALSE value indicating if a secure connection with the // domain is needed to access the variable. // expiration - The UNIX time that the variable will expire on. UNIX time is // defined as the number of seconds since Jan 1, 1970 00:00:00 GMT. // name - The name of the variable. // value - The value of the variable. // // /////////////////////////////////////////////////////////////// // // Part of the ht://Check // Copyright (c) 1999-2004 Comune di Prato, Italia // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // /////////////////////////////////////////////////////////////// // $Id: HtCookieInFileJar.cc,v 1.5 2004/05/28 13:15:23 lha Exp $ /////////////////////////////////////////////////////////////// #ifndef __HtCookieInFileJar_H #include "HtCookieInFileJar.h" #endif #include #define MAX_COOKIE_LINE 16384 // Costruttore (default constructor) HtCookieInFileJar::HtCookieInFileJar(const String& fn, int& result) : _filename(fn) { result = Load(); } // Costruttore di copia (copy constructor) HtCookieInFileJar::HtCookieInFileJar(const HtCookieInFileJar& rhs) { } // Distruttore HtCookieInFileJar::~HtCookieInFileJar() { } // Operatore di assegnamento (assignment operator) HtCookieInFileJar& HtCookieInFileJar::operator=(const HtCookieInFileJar& rhs) { if (this == &rhs) return *this; // Code for attributes copy return *this; // ritorna se stesso } // Loads the contents of a cookies file into memory int HtCookieInFileJar::Load() { FILE *f = fopen((const char *)_filename, "r"); if (f == NULL) return -1; char buf[MAX_COOKIE_LINE]; while(fgets(buf, MAX_COOKIE_LINE, f)) { if (*buf && *buf != '#' && (strlen(buf) > 10)) // 10 is an indicative value { HtCookie *Cookie = new HtCookie(buf); // Interface to the insert method // If the cookie is not valid or has not been added, we'd better delete it if (!Cookie->GetName().length() || !AddCookieForHost (Cookie, Cookie->GetSrcURL())) { if (debug > 2) cout << "Discarded cookie line: " << buf; delete Cookie; } } } return 0; } // Outputs a summary of the cookies that have been imported ostream &HtCookieInFileJar::ShowSummary(ostream &out) { char * key; int num_cookies = 0; // Global number of cookies cookieDict->Start_Get(); out << endl << "Cookies that have been correctly imported from: " << _filename << endl; while ((key = cookieDict->Get_Next())) { List * list; HtCookie * cookie; list = (List *)cookieDict->Find(key); list->Start_Get(); while ((cookie = (HtCookie *)list->Get_Next())) { ++num_cookies; out << " " << num_cookies << ". " << cookie->GetName() << ": " << cookie->GetValue() << " (Domain: " << cookie->GetDomain(); if (debug > 1) { out << " - Path: " << cookie->GetPath(); if (cookie->GetExpires()) out << " - Expires: " << cookie->GetExpires()->GetRFC850(); } out << ")" << endl; } // Global number of cookies } return out; } /////////////////////////////////////////////////////////////// htdig-3.2.0b6/htnet/HtCookieInFileJar.h0100644006314600127310000000537610055635553017131 0ustar angusgbhtdig/////////////////////////////////////////////////////////////// // // File: HtCookieInFileJar.h - Declaration of class 'HtCookieInFileJar' // // Author: Gabriele Bartolini // Started: Mon Jan 27 14:38:42 CET 2003 // // Class which allows a cookie file to be imported in memory // for ht://Check and ht://Dig applications. // // The cookie file format is a text file, as proposed by Netscape, // and each line contains a name-value pair for a cookie. // Fields within a single line are separated by the 'tab' character; // Here is the format for a line, as taken from http://www.cookiecentral.com/faq/#3.5: // // domain - The domain that created AND that can read the variable. // flag - A TRUE/FALSE value indicating if all machines within a given domain // can access the variable. This value is set automatically by the browser, // depending on the value you set for domain. // path - The path within the domain that the variable is valid for. // secure - A TRUE/FALSE value indicating if a secure connection with the // domain is needed to access the variable. // expiration - The UNIX time that the variable will expire on. UNIX time is // defined as the number of seconds since Jan 1, 1970 00:00:00 GMT. // name - The name of the variable. // value - The value of the variable. // /////////////////////////////////////////////////////////////// // // Part of the ht://Check // Copyright (c) 1999-2004 Comune di Prato, Italia // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // /////////////////////////////////////////////////////////////// // $Id: HtCookieInFileJar.h,v 1.5 2004/05/28 13:15:23 lha Exp $ /////////////////////////////////////////////////////////////// #ifndef __HtCookieInFileJar_H #define __HtCookieInFileJar_H #include "HtCookieMemJar.h" #include "htString.h" class HtCookieInFileJar: public HtCookieMemJar { // Public Interface public: // Default constructor HtCookieInFileJar(const String& fn, int& result); // Copy constructor HtCookieInFileJar(const HtCookieInFileJar& rhs); // Destructor ~HtCookieInFileJar(); // Assignment operator HtCookieInFileJar& operator=(const HtCookieInFileJar& rhs); // Show stats #ifdef _MSC_VER /* _WIN32 */ virtual ostream &ShowSummary (ostream &out = cout); #else virtual ostream &ShowSummary (ostream &out = std::cout); #endif // Protected attributes protected: String _filename; // Filename int Load(); // Load the contents of a cookies file into memory }; #endif /////////////////////////////////////////////////////////////// htdig-3.2.0b6/htnet/HtCookieJar.cc0100644006314600127310000001033710055635553016171 0ustar angusgbhtdig// // HtCookieJar.cc // // HtCookieJar: This class stores/retrieves cookies. // // by Robert La Ferla. Started 12/9/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // //////////////////////////////////////////////////////////// // // The HtCookieJar class stores/retrieves cookies. // It's an abstract class though, which has to be the interface // for HtHTTP class. // // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookieJar.cc,v 1.6 2004/05/28 13:15:23 lha Exp $ // #include "HtCookieJar.h" /////// // Static variables initialization /////// // Debug level int HtCookieJar::debug = 0; /////// // Writes the HTTP request line given a cookie // in a flexible way (chooses between the RFC2109 // and the specification given by Netscape) /////// // // RFC2109: The syntax for the header is: // cookie = "Cookie:" cookie-version // 1*((";" | ",") cookie-value) // cookie-value = NAME "=" VALUE [";" path] [";" domain] // cookie-version = "$Version" "=" value // NAME = attr // VALUE = value // path = "$Path" "=" value // domain = "$Domain" "=" value // int HtCookieJar::WriteCookieHTTPRequest(const HtCookie &Cookie, String &RequestString, const int &NumCookies) { switch (Cookie.GetVersion()) { // RFC2109 Version case 1: // Writes the string to be sent to the web server if (NumCookies == 1) RequestString << "Cookie: $Version=\"1\"; "; else RequestString << "; " ; // Print complete debug info if (debug > 6) { cout << "Cookie (RFC2109) info: NAME=" << Cookie.GetName() << " VALUE="<< Cookie.GetValue() << " PATH=" << Cookie.GetPath(); if (Cookie.GetExpires()) cout << " EXPIRES=" << Cookie.GetExpires()->GetRFC850(); cout << endl; } // Prepare cookie line for HTTP protocol RequestString << Cookie.GetName() << "=" << Cookie.GetValue(); if (Cookie.GetPath().length() > 0) RequestString << " ;$Path=" << Cookie.GetPath(); if (Cookie.GetDomain().length() > 0) RequestString << " ;$Domain=" << Cookie.GetDomain(); break; // Netscape specification case 0: // Writes the string to be sent to the web server if (NumCookies == 1) RequestString << "Cookie: "; else RequestString << "; " ; // Print complete debug info if (debug > 6) { cout << "Cookie (Netscape spec) info: NAME=" << Cookie.GetName() << " VALUE=" << Cookie.GetValue() << " PATH=" << Cookie.GetPath(); if (Cookie.GetExpires()) cout << " EXPIRES=" << Cookie.GetExpires()->GetRFC850(); cout << endl; } // Prepare cookie line for HTTP protocol RequestString << Cookie.GetName() << "=" << Cookie.GetValue(); break; } return true; } int HtCookieJar::GetDomainMinNumberOfPeriods(const String& domain) const { // Well ... if a domain has been specified, we need some check-ups // as the standard says. static char* TopLevelDomains[] = { "com", "edu", "net", "org", "gov", "mil", "int", 0}; const char* s = strrchr(domain.get(), '.'); if (!s) // no 'dot' has been found. Not valid return 0; if (! *(++s)) // nothing after the dot. Not Valid return 0; for (char** p = TopLevelDomains; *p; ++p) { if (!strncmp(*p, s, strlen(*p))) return 2; } return 3; // By default the minimum value } htdig-3.2.0b6/htnet/HtCookieJar.h0100644006314600127310000000625710055635553016041 0ustar angusgbhtdig// // HtCookieJar.h // // HtCookieJar: Abstract Class for storing/retrieving cookies // // by Robert La Ferla. Started 12/9/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // //////////////////////////////////////////////////////////// // // The HtCookieJar class stores/retrieves cookies. // It's an abstract class though, which has to be the interface // for HtHTTP class. // // The class has only 2 access point from the outside: // - a method for cookies insertion (AddCookie()); // - a method for getting the HTTP request for cookies // (SetHTTPRequest_CookiesString). // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookieJar.h,v 1.6 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTCOOKIE_JAR_H #define _HTCOOKIE_JAR_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "htString.h" #include "HtCookie.h" #include "URL.h" // for ShowSummary() #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ class HtCookieJar : public Object { public: /////// // Construction/Destruction /////// HtCookieJar() {}; // empty virtual ~HtCookieJar() {}; // empty /////// // Interface methods /////// // This method allow the insertion of a cookie // into the jar. virtual int AddCookie(const String &CookieString, const URL &url) = 0; // Set the request string to be sent to an HTTP server // for cookies. It manages all the process regarding // domains and subdomains. virtual int SetHTTPRequest_CookiesString(const URL &_url, String &RequestString) = 0; // Get the next cookie virtual const HtCookie* NextCookie() = 0; // Reset the iterator virtual void ResetIterator() = 0; // Get the minimum number of periods from a specified domain // returns 0 if not valid virtual int GetDomainMinNumberOfPeriods(const String& domain) const; // Set its debug level and HtCookie class' static void SetDebugLevel (int d) { debug=d; // internal one HtCookie::SetDebugLevel(d); // HtCookie's debug level } // Show summary (abstract) virtual ostream &ShowSummary (ostream &out) = 0; protected: /////// // Protected attributes /////// // Writes the HTTP request line given a cookie virtual int WriteCookieHTTPRequest(const HtCookie &Cookie, String &RequestString, const int &NumCookies); // Print debug info virtual void printDebug() = 0; /////// // Debug level /////// static int debug; }; #endif htdig-3.2.0b6/htnet/HtCookieMemJar.cc0100644006314600127310000003722110055635553016631 0ustar angusgbhtdig // HtCookieMemJar.cc // // HtCookieMemJar: This class stores/retrieves cookies. // // by Robert La Ferla. Started 12/9/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // //////////////////////////////////////////////////////////// // // The HtCookieMemJar class stores/retrieves cookies // directly into memory. It is derived from HtCookieJar class. // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookieMemJar.cc,v 1.10 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "HtCookieMemJar.h" #include "HtCookie.h" #include "List.h" #include "Dictionary.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // Constructor HtCookieMemJar::HtCookieMemJar() : _key(0), _list(0), _idx(0) { cookieDict = new Dictionary(); cookieDict->Start_Get(); // reset the iterator } // Copy constructor HtCookieMemJar::HtCookieMemJar(const HtCookieMemJar& rhs) : _key(0), _list(0), _idx(0) { if (rhs.cookieDict) { // Let's perform a deep copy of the 'jar' cookieDict = new Dictionary(); rhs.cookieDict->Start_Get(); // Let's walk the domains while (char* d = rhs.cookieDict->Get_Next()) { List* l = new List(); cookieDict->Add(d, l); // add that domain // Let's walk the cookies for that domain if (List* rhsl = (List*) rhs.cookieDict->Find(d)) { rhsl->Start_Get(); while (HtCookie* cookie = ((HtCookie *)rhsl->Get_Next())) { HtCookie* new_cookie = new HtCookie(*cookie); l->Add((Object *)new_cookie); // add this cookie } } } } else cookieDict = new Dictionary(); cookieDict->Start_Get(); // reset the iterator } // Destructor HtCookieMemJar::~HtCookieMemJar() { if (debug>4) printDebug(); if (cookieDict) delete cookieDict; } // Add a cookie to the Jar int HtCookieMemJar::AddCookie(const String &CookieString, const URL &url) { // Builds a new Cookie object HtCookie *Cookie = new HtCookie(CookieString, url.get()); // Interface to the insert method // If the cookie has not been added, we'd better delete it if (!AddCookieForHost (Cookie, url.host())) delete Cookie; return true; } // Add a cookie to a host int HtCookieMemJar::AddCookieForHost(HtCookie *cookie, String HostName) { List *list; // pointer to the Cookie list of an exact host HtCookie *theCookie; bool inList = false; ///////////////////////////////////////////////////////////// // That's an abstract from the Netscape Cookies specification ///////////////////////////////////////////////////////////// // // When searching the cookie list for valid cookies, // a comparison of the domain attributes of the cookie // is made with the Internet domain name of the host from which the URL // will be fetched. If there is a tail match, then the cookie // will go through path matching to see if it should be sent. // // "Tail matching" means that domain attribute is matched against // the tail of the fully qualified domain name of the host. // A domain attribute of "acme.com" would match host names "anvil.acme.com" // as well as "shipping.crate.acme.com". // // Only hosts within the specified domain can set a cookie // for a domain and domains must have at least two (2) // or three (3) periods in them to prevent domains of // the form: ".com", ".edu", and "va.us". // // Any domain that fails within one of the seven special top level domains // listed below only require two periods. // Any other domain requires at least three. // // The seven special top level domains are: // "COM", "EDU", "NET", "ORG", "GOV", "MIL", and "INT". // // The default value of domain is the host name of the // server which generated the cookie response. // ///////////////////////////////////////////////////////////// // Let's get the domain of the cookie String Domain(cookie->GetDomain()); // Lowercase the HostName HostName.lowercase(); if (!Domain.length()) Domain = HostName; else { Domain.lowercase(); // lowercase the domain // The cookie's domain must have a minimum number of periods // inside, as stated by the abstract cited above int minimum_periods = GetDomainMinNumberOfPeriods(Domain); if (!minimum_periods) { if (debug > 2) cout << "Cookie - Invalid domain " << "(minimum number of periods): " << Domain << endl; cookie->SetIsDomainValid(false); } else { // Let's see if the domain is now valid const char* s = Domain.get(); const char* r = s + strlen(s) - 1; // go to the last char int num_periods = 1; // at minimum is one while (r > s && *r) { if (*r == '.' && *(r+1) && *(r+1) != '.') ++num_periods; // when a 'dot' is found increment // the number of periods --r; } if (num_periods >= minimum_periods) // here is a so-far valid domain { while (*r && *r == '.') ++r; // goes beyond the first dot if (r>s) Domain.set((char*) r); // Set the new 'shorter' domain if (HostName.indexOf(Domain.get()) != -1) { if (debug > 2) cout << "Cookie - valid domain: " << Domain << endl; } else if (HostName.length() == 0) { if (debug > 2) cout << "Imported cookie - valid domain: " << Domain << endl; } else { cookie->SetIsDomainValid(false); if (debug > 2) cout << "Cookie - Invalid domain " << "(host not within the specified domain): " << Domain << endl; } } else { cookie->SetIsDomainValid(false); if (debug > 2) cout << "Cookie - Invalid domain " << "(minimum number of periods): " << Domain << endl; } } } if (! cookie->getIsDomainValid()) // Not a valid domain Domain = HostName; // Set the default // Is the host in the dictionary? if (cookieDict->Exists(Domain) == 0) { // No, add a list instance list = new List(); cookieDict->Add(Domain, list); } else list = (List *)cookieDict->Find(Domain); // Is cookie already in list? list->Start_Get(); // Let's start looking for it // The match is made on the name and the path if (debug > 5) cout << "- Let's go searching for the cookie '" << cookie->GetName() << "' in the list" << endl; while (!inList && (theCookie = (HtCookie *)list->Get_Next())) { if ( (theCookie->GetName().compare(cookie->GetName()) == 0 ) && ( theCookie->GetPath().compare(cookie->GetPath()) == 0 )) { // The cookie has been found inList = true; // Let's update the expiration datetime if (debug > 5) cout << " - Found: Update cookie expire time." << endl; theCookie->SetExpires(cookie->GetExpires()); } } // Well ... the cookie wasn't in the list. Until now! ;-) // Let's go add it! if (inList == false) { if (debug > 5) cout << " - Not Found: let's go add it." << endl; list->Add((Object *)cookie); } return !inList; } // Retrieve all cookies that are valid for a domain List * HtCookieMemJar::cookiesForDomain(const String &DomainName) { List * list; list = (List *)cookieDict->Find(DomainName); return list; } int HtCookieMemJar::SetHTTPRequest_CookiesString(const URL &_url, String &RequestString) { // Let's split the URL domain and get all of the subdomains. // For instance: // - bar.com // - foo.bar.com // - www.foo.bar.com String Domain(_url.host()); Domain.lowercase(); int minimum_periods = GetDomainMinNumberOfPeriods(Domain); if (debug > 3) cout << "Looking for cookies - Domain: " << Domain << " (Minimum periods: " << minimum_periods << ")" << endl; // Let's get the subdomains, starting from the end const char* s = Domain.get(); const char* r = s + strlen(s) - 1; // go to the last char int num_periods = 1; // at minimum is one while (r > s && *r) { if (*r == '.' && *(r+1) && *(r+1) != '.') { ++num_periods; // when a 'dot' is found increment // the number of periods if (num_periods > minimum_periods) // here is a so-far valid domain { const String SubDomain(r+1); if (debug > 3) cout << "Trying to find cookies for subdomain: " << SubDomain << endl; if (cookieDict->Exists(SubDomain)) WriteDomainCookiesString(_url, SubDomain, RequestString); } } --r; } if (num_periods >= minimum_periods && cookieDict->Exists(Domain)) // Let's send cookies for this domain to the Web server ... WriteDomainCookiesString(_url, Domain, RequestString); return true; } ///////////////////////////////////////////////////////////// // That's an abstract from the Netscape Cookies specification ///////////////////////////////////////////////////////////// // // // When requesting a URL from an HTTP server, the browser will match // the URL against all cookies and if any of them match, // a line containing the name/value pairs of all matching cookies // will be included in the HTTP request. // // Here is the format of that line: // Cookie: NAME1=OPAQUE_STRING1; NAME2=OPAQUE_STRING2 ... // // This method writes on a string (RequestString) the headers // for cookies settings as defined by Netscape standard // ///////////////////////////////////////////////////////////// int HtCookieMemJar::WriteDomainCookiesString(const URL &_url, const String &Domain, String &RequestString) { // Cookie support. We need a list of cookies and a cookie object List *cookieList; HtCookie *cookie; const HtDateTime now; // Instant time, used for checking // cookies expiration time // Let's find all the valid cookies depending on the specified domain cookieList = cookiesForDomain(Domain); if (cookieList) { // Let's store the number of cookies eventually sent int NumCookies = 0; if (debug > 5) cout << "Found a cookie list for: '" << Domain << "'" << endl; // Let's crawl the list for getting the 'path' matching ones cookieList->Start_Get(); while ((cookie = (HtCookie *)cookieList->Get_Next())) { const String cookiePath = cookie->GetPath(); const String urlPath = _url.path(); // // Let's see if the cookie has expired // by checking the Expires value of it // If it's not empty and the datetime // is before now. // // Another way of determining whether a // cookie is expired is checking the // max_age property that is to say: // (now - issuetime <= maxage). // const bool expired = (cookie->GetExpires() && (*(cookie->GetExpires()) < now)) // Expires || (HtDateTime::GetDiff(now, cookie->GetIssueTime()) <= cookie->GetMaxAge()); // Max-age if (debug > 5) cout << "Trying to match paths and expiration time: " << urlPath << " in " << cookiePath; // Is the path matching if (!expired && !strncmp(cookiePath, urlPath, cookiePath.length())) { if (debug > 5) cout << " (passed)" << endl; ++NumCookies; // Write the string by passing the cookie to the superclass' method WriteCookieHTTPRequest(*cookie, RequestString, NumCookies); } else if (debug > 5) cout << " (discarded)" << endl; } // Have we sent one cookie at least? if (NumCookies > 0) RequestString <<"\r\n"; } // That's the end of function return true; } // Debug info void HtCookieMemJar::printDebug() { char * key; cookieDict->Start_Get(); cout << "Summary of the cookies stored so far" << endl; while ((key = cookieDict->Get_Next())) { List * list; HtCookie * cookie; cout << " - View cookies for: '" << key << "'" << endl; list = (List *)cookieDict->Find(key); list->Start_Get(); while ((cookie = (HtCookie *)list->Get_Next())) cookie->printDebug(); } } /////// // Show the summary of the stored cookies /////// ostream &HtCookieMemJar::ShowSummary(ostream &out) { char * key; int num_cookies = 0; // Global number of cookies int num_server = 0; // Number of servers with cookies cookieDict->Start_Get(); out << endl << "Summary of the cookies" << endl; out << "======================" << endl; while ((key = cookieDict->Get_Next())) { List * list; HtCookie * cookie; int num_cookies_server = 0; ++num_server; // Number of servers with cookies out << " Host: '" << key << "'" << endl; list = (List *)cookieDict->Find(key); list->Start_Get(); while ((cookie = (HtCookie *)list->Get_Next())) { ++num_cookies_server; cookie->printDebug(); } out << " Number of cookies: " << num_cookies_server << endl << endl; // Global number of cookies num_cookies += num_cookies_server; } out << "Total number of cookies: " << num_cookies << endl; out << "Servers with cookies: " << num_server << endl << endl; return out; } // Get the next cookie. It is a bit tricky, but for now it is good const HtCookie* HtCookieMemJar::NextCookie() { if (!cookieDict) return 0; if (!_idx && (_key = cookieDict->Get_Next()) && (_list = (List *)cookieDict->Find(_key))) _list->Start_Get(); // the first time we position at the beginning ++_idx; if (!_key) return 0; // ends if (!_list) return 0; // ends #ifdef _MSC_VER /* _WIN32 */ const HtCookie *cookie = ((const HtCookie*)_list->Get_Next()); // Cookie object #else const HtCookie* cookie( (const HtCookie*)(_list->Get_Next()) ); // Cookie object #endif if (cookie) return cookie; else { // Non ci sono cookie per l'host. Si passa a quello seguente if ((_key = cookieDict->Get_Next()) && (_list = (List *)cookieDict->Find(_key))) { _list->Start_Get(); if ((cookie = (const HtCookie*)_list->Get_Next())) return cookie; } } return 0; } // Reset the iterator void HtCookieMemJar::ResetIterator() { cookieDict->Start_Get(); _idx = 0; } htdig-3.2.0b6/htnet/HtCookieMemJar.h0100644006314600127310000000577110055635553016500 0ustar angusgbhtdig// // HtCookieMemJar.h // // HtCookieMemJar: Class for storing/retrieving cookies // // by Robert La Ferla. Started 12/9/2000. // Reviewed by G.Bartolini - since 24 Feb 2001 // //////////////////////////////////////////////////////////// // // The HtCookieMemJar class stores/retrieves cookies // directly into memory. // // See "PERSISTENT CLIENT STATE HTTP COOKIES" Specification // at http://www.netscape.com/newsref/std/cookie_spec.html // Modified according to RFC2109 (max age and version attributes) // /////// // // Part of the ht://Dig package // Part of the ht://Check package // Copyright (c) 2001-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtCookieMemJar.h,v 1.9 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTCOOKIE_MEM_JAR_H #define _HTCOOKIE_MEM_JAR_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "htString.h" #include "Dictionary.h" #include "List.h" #include "HtCookieJar.h" // for ShowSummary() #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ class HtCookieMemJar : public HtCookieJar { public: /////// // Construction/Destruction /////// HtCookieMemJar(); HtCookieMemJar(const HtCookieMemJar& rhs); virtual ~HtCookieMemJar(); /////// // Interface methods /////// // Set the request string to be sent to an HTTP server // for cookies. It manages all the process regarding // domains and subdomains. virtual int SetHTTPRequest_CookiesString(const URL &_url, String &RequestString); virtual int AddCookie(const String &CookieString, const URL &url); // Get the next cookie virtual const HtCookie* NextCookie(); // Reset the iterator virtual void ResetIterator(); // Show stats #ifdef _MSC_VER /* _WIN32 */ virtual ostream &ShowSummary (ostream &out = cout); #else virtual ostream &ShowSummary (ostream &out = std::cout); #endif void printDebug(); protected: /////// // Protected methods /////// // Passed a domain, this method writes all the cookies // directly in the request string for HTTP. int WriteDomainCookiesString(const URL &_url, const String &Domain, String &RequestString); // Get a list of the cookies for a domain List *cookiesForDomain(const String &DomainName); // Add a cookie in memory int AddCookieForHost(HtCookie *cookie, String HostName); /////// // Protected attributes /////// /////// // Internal dictionary of cookies /////// Dictionary * cookieDict; char* _key; // For iteration purposes List* _list; // ditto int _idx; // ditto }; #endif htdig-3.2.0b6/htnet/HtFTP.cc0100644006314600127310000001415110055635553014752 0ustar angusgbhtdig// // HtFTP.cc // // HtFTP: Interface classes for retriving documents from FTP servers // // Including: // - Generic class // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtFTP.cc,v 1.7 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" #include "Transport.h" #include "HtFTP.h" #include "Dictionary.h" #include "StringList.h" #include "defaults.h" // for config #include #include #include #include // for sscanf #include #ifdef HAVE_STD #include #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #include #endif /* HAVE_STD */ #ifndef _MSC_VER /* _WIN32 */ #include #endif #ifdef _MSC_VER /* _WIN32 */ #include "dirent_local.h" #else #include // for scandir #endif /////// // HtFTP_Response class /////// // Construction HtFTP_Response::HtFTP_Response() { } // Destruction HtFTP_Response::~HtFTP_Response() { } /////// // HtFTP generic class // // /////// // Construction HtFTP::HtFTP() { } // Destruction HtFTP::~HtFTP() { // It's empty } /////// // Manages the requesting process /////// //NB: HtFTP::DocStatus = return-value (defineret i Transport.h // Husk HtFTP er nedarvet fra Transport klassen HtFTP::DocStatus HtFTP::Request() { HtConfiguration* config= HtConfiguration::config(); static Dictionary *mime_map = 0; // har vi brug for denne mime_map i denne klasse? // hvis ja, burde den ikke laves til function i HtConfiguration if (!mime_map) // generate mime_map from the current configuration { mime_map = new Dictionary(); ifstream in(config->Find("mime_types").get()); if (in) { String line; while (in >> line) { line.chop("\n\r \t"); int cmt; if ((cmt = line.indexOf('#')) >= 0) line = line.sub(0, cmt); StringList split_line(line, "\t "); // Let's cache mime type to lesser the number of // operator [] callings String mime_type = split_line[0]; // Fill map with values. for (int i = 1; i < split_line.Count(); i++) mime_map->Add(split_line[i], new String(mime_type)); } } } // Reset the response _response.Reset(); struct stat stat_buf; // Check that it exists, and is a regular file or directory // Should we allow FIFO's? if ( stat(_url.path(), &stat_buf) != 0 || !(S_ISREG(stat_buf.st_mode) || S_ISDIR(stat_buf.st_mode)) ) return Transport::Document_not_found; // Now handle directories with a pseudo-HTML document (and appropriate noindex) if ( S_ISDIR(stat_buf.st_mode) ) { _response._content_type = "text/html"; _response._contents = "\n"; struct dirent *namelist; DIR *dirList; String filename; if (( dirList = opendir(_url.path()) )) { while (( namelist = readdir(dirList) )) { filename = _url.path(); filename << namelist->d_name; if ( namelist->d_name[0] != '.' && stat(filename.get(), &stat_buf) == 0 ) { if (S_ISDIR(stat_buf.st_mode)) _response._contents << "d_name << "/\">\n"; else _response._contents << "d_name << "\">\n"; } } closedir(dirList); } _response._contents << "\n"; if (debug > 4) cout << " Directory listing: " << endl << _response._contents << endl; _response._content_length = stat_buf.st_size; _response._document_length = _response._contents.length(); _response._modification_time = new HtDateTime(stat_buf.st_mtime); _response._status_code = 0; return Transport::Document_ok; } if (_modification_time && *_modification_time >= HtDateTime(stat_buf.st_mtime)) return Transport::Document_not_changed; const char *ext = strrchr(_url.path(), '.'); if (ext == NULL) return Transport::Document_not_local; if (mime_map && mime_map->Count()) { String *mime_type = (String *)mime_map->Find(ext + 1); if (mime_type) _response._content_type = *mime_type; else return Transport::Document_not_local; } else { if ((mystrcasecmp(ext, ".html") == 0) || (mystrcasecmp(ext, ".htm") == 0)) _response._content_type = "text/html"; else if (mystrcasecmp(ext, ".txt") == 0) _response._content_type = "text/plain"; else return Transport::Document_not_local; } _response._modification_time = new HtDateTime(stat_buf.st_mtime); FILE *f = fopen((const char *)_url.path(), "r"); if (f == NULL) return Document_not_found; char docBuffer[8192]; int bytesRead; while ((bytesRead = fread(docBuffer, 1, sizeof(docBuffer), f)) > 0) { if (_response._contents.length() + bytesRead > _max_document_size) bytesRead = _max_document_size - _response._contents.length(); _response._contents.append(docBuffer, bytesRead); if (_response._contents.length() >= _max_document_size) break; } fclose(f); _response._content_length = stat_buf.st_size; _response._document_length = _response._contents.length(); _response._status_code = 0; if (debug > 2) cout << "Read a total of " << _response._document_length << " bytes\n"; return Transport::Document_ok; } HtFTP::DocStatus HtFTP::GetDocumentStatus() { // Let's give a look at the return status code if (_response._status_code == -1) return Transport::Document_not_found; return Transport::Document_ok; } htdig-3.2.0b6/htnet/HtFTP.h0100644006314600127310000000473010055635553014616 0ustar angusgbhtdig// // HtFTP.h // // HtFTP: Class for FTP protocol access (derived from Transport) // // Søren Vejrup Carlsen, based on from HtFTP.h by Alexis Mikhailov // started: 26.08.2002 // // //////////////////////////////////////////////////////////// // // The HtFTP class should provide an interface for retrieving documents // from FTP-servers. It derives from Transport class. // /////// // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtFTP.h,v 1.3 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTFTP_H #define _HTFTP_H #include "Transport.h" #include "URL.h" #include "htString.h" // In advance declarations class HtFTP; class HtFTP_Response : public Transport_Response { friend class HtFTP; // declaring friendship public: /////// // Construction / Destruction /////// HtFTP_Response(); ~HtFTP_Response(); }; class HtFTP : public Transport { public: /////// // Construction/Destruction /////// HtFTP(); ~HtFTP(); // Information about the method to be used in the request // manages a Transport request (method inherited from Transport class) virtual DocStatus Request (); /////// // Interface for resource retrieving /////// // Set and get the document to be retrieved void SetRequestURL(URL &u) { _url = u;} URL GetRequestURL () { return _url;} // Set and get the referring URL void SetRefererURL (URL u) { _referer = u;} URL GetRefererURL () { return _referer;} /////// // Interface for the HTTP Response /////// // We have a valid response only if the status code is not equal to // initialization value Transport_Response *GetResponse() { if (_response._status_code != -1) return &_response; else return NULL;} // Get the document status virtual DocStatus GetDocumentStatus(); protected: /////// // Member attributes /////// /////// // Http single Request information (Member attributes) /////// URL _url; // URL to retrieve URL _referer; // Referring URL /////// // Http Response information /////// HtFTP_Response _response; // Object where response // information will be stored into }; #endif htdig-3.2.0b6/htnet/HtFile.cc0100644006314600127310000002153310055635553015202 0ustar angusgbhtdig// // HtFile.cc // // HtFile: Interface classes for retriving local documents // // Including: // - Generic class // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtFile.cc,v 1.13 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" #include "Transport.h" #include "HtFile.h" #include "Dictionary.h" #include "StringList.h" #include "defaults.h" // for config #include #include #include #ifdef HAVE_STD #include #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #include #endif /* HAVE_STD */ #include // for sscanf #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #ifdef _MSC_VER /* _WIN32 */ #include "dirent_local.h" #else #include // for scandir #endif #ifdef _MSC_VER /* _WIN32 */ #define popen _popen #define pclose _pclose #define lstat stat #define readlink(x,y,z) {-1} #endif /////// // HtFile_Response class /////// // Construction HtFile_Response::HtFile_Response() { } // Destruction HtFile_Response::~HtFile_Response() { } /////// // HtFile generic class // // /////// // Construction HtFile::HtFile() { } // Destruction HtFile::~HtFile() { // It's empty } // Return mime type indicated by extension ext (which is assumed not // to contain the '.'), or NULL if ext is not a know mime type. const String *HtFile::Ext2Mime (const char *ext) { static Dictionary *mime_map = 0; if (!mime_map) { HtConfiguration* config= HtConfiguration::config(); mime_map = new Dictionary(); if (!mime_map) return NULL; if (debug > 2) cout << "MIME types: " << config->Find("mime_types").get() << endl; ifstream in(config->Find("mime_types").get()); if (in) { String line; while (in >> line) { line.chop("\n\r \t"); int cmt; if ((cmt = line.indexOf('#')) >= 0) line = line.sub(0, cmt); StringList split_line(line, "\t "); // Let's cache mime type to lesser the number of // operator [] callings String mime_type = split_line[0]; // Fill map with values. for (int i = 1; i < split_line.Count(); i++) { if (debug > 3) cout << "MIME: " << split_line[i] << "\t-> " << mime_type << endl; mime_map->Add(split_line[i], new String(mime_type)); } } } else { if (debug > 2) cout << "MIME types file not found. Using default types.\n"; mime_map->Add(String("html"), new String("text/html")); mime_map->Add(String("htm"), new String("text/html")); mime_map->Add(String("txt"), new String("text/plain")); mime_map->Add(String("asc"), new String("text/plain")); mime_map->Add(String("pdf"), new String("application/pdf")); mime_map->Add(String("ps"), new String("application/postscript")); mime_map->Add(String("eps"), new String("application/postscript")); } } // return MIME type, or NULL if not found return (String *)mime_map->Find(ext); } // Return mime type of the file named 'fname'. // If the type can't be determined, "application/x-unknown" is returned. String HtFile::File2Mime (const char *fname) { HtConfiguration* config= HtConfiguration::config(); // default to "can't identify" char content_type [100] = "application/x-unknown\n"; String cmd = config->Find ("content_classifier"); if (cmd.get() && *cmd) { cmd << " \"" << fname << '\"'; // allow file names to have spaces FILE *fileptr; if ( (fileptr = popen (cmd.get(), "r")) != NULL ) { fgets (content_type, sizeof (content_type), fileptr); pclose (fileptr); } } // Remove trailing newline, charset or language information int delim = strcspn (content_type, ",; \n\t"); content_type [delim] = '\0'; if (debug > 1) cout << "Mime type: " << fname << ' ' << content_type << endl; return (String (content_type)); } /////// // Manages the requesting process /////// HtFile::DocStatus HtFile::Request() { // Reset the response _response.Reset(); struct stat stat_buf; String path (_url.path()); decodeURL (path); // Convert '%20' to ' ' etc // Check that it exists, and is a regular file or directory // Don't allow symbolic links to directories; they mess up '../'. // Should we allow FIFO's? if ( stat(path.get(), &stat_buf) != 0 || !(S_ISREG(stat_buf.st_mode) || S_ISDIR(stat_buf.st_mode)) ) { return Transport::Document_not_found; } // Now handle directories with a pseudo-HTML document (and appropriate noindex) if ( S_ISDIR(stat_buf.st_mode) ) { _response._content_type = "text/html"; _response._contents = "\n"; struct dirent *namelist; DIR *dirList; String filename; String encodedName; if (( dirList = opendir(path.get()) )) { while (( namelist = readdir(dirList) )) { filename = path; filename << namelist->d_name; if ( namelist->d_name[0] != '.' && lstat(filename.get(), &stat_buf) == 0 ) { // Recursively resolve symbolic links. // Could leave "absolute" links, or even all not // containing '../'. That would allow "aliasing" of // directories without causing loops. int i; // avoid infinite loops for (i=0; (stat_buf.st_mode & S_IFMT) == S_IFLNK && i<10; i++) { char link [100]; int count = readlink(filename.get(), link, sizeof(link)-1); if (count < 0) break; link [count] = '\0'; encodedName = link; encodeURL (encodedName); URL newURL (encodedName, _url); // resolve relative paths filename = newURL.path(); decodeURL (filename); if (debug > 2) cout << "Link to " << link << " gives " << filename.get() << endl; lstat(filename.get(), &stat_buf); } // filename now only sym-link if nested too deeply or I/O err. encodeURL (filename, UNRESERVED "/"); // convert ' ' to '%20' etc., but leave "/" intact if (S_ISDIR(stat_buf.st_mode)) _response._contents << "\n"; else if (S_ISREG(stat_buf.st_mode)) _response._contents << "\n"; } } closedir(dirList); } _response._contents << "\n"; if (debug > 4) cout << " Directory listing: " << endl << _response._contents << endl; _response._content_length = stat_buf.st_size; _response._document_length = _response._contents.length(); _response._modification_time = new HtDateTime(stat_buf.st_mtime); _response._status_code = 0; return Transport::Document_ok; } if (_modification_time && *_modification_time >= HtDateTime(stat_buf.st_mtime)) return Transport::Document_not_changed; bool unknown_ext = false; char *ext = strrchr(path.get(), '.'); if (ext == NULL) unknown_ext = true; else { const String *mime_type = Ext2Mime(ext + 1); if (mime_type) _response._content_type = *mime_type; else unknown_ext = true; } if (unknown_ext) { _response._content_type = File2Mime (path.get()); if (!strncmp (_response._content_type.get(), "application/x-", 14)) return Transport::Document_not_local; } _response._modification_time = new HtDateTime(stat_buf.st_mtime); FILE *f = fopen((const char *)path.get(), "r"); if (f == NULL) return Document_not_found; char docBuffer[8192]; int bytesRead; while ((bytesRead = fread(docBuffer, 1, sizeof(docBuffer), f)) > 0) { if (_response._contents.length() + bytesRead > _max_document_size) bytesRead = _max_document_size - _response._contents.length(); _response._contents.append(docBuffer, bytesRead); if (_response._contents.length() >= _max_document_size) break; } fclose(f); _response._content_length = stat_buf.st_size; _response._document_length = _response._contents.length(); _response._status_code = 0; if (debug > 2) cout << "Read a total of " << _response._document_length << " bytes\n"; return Transport::Document_ok; } HtFile::DocStatus HtFile::GetDocumentStatus() { // Let's give a look at the return status code if (_response._status_code == -1) return Transport::Document_not_found; return Transport::Document_ok; } htdig-3.2.0b6/htnet/HtFile.h0100644006314600127310000000534110055635553015043 0ustar angusgbhtdig// // HtFile.h // // HtFile: Class for local files (derived from Transport) // // Alexis Mikhailov, from HtHTTP.h by Gabriele Bartolini - Prato - Italia // started: 03.05.1999 // // //////////////////////////////////////////////////////////// // // The HtFile class should provide an interface for retrieving local // documents. It derives from Transport class. // /////// // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtFile.h,v 1.6 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTFILE_H #define _HTFILE_H #include "Transport.h" #include "URL.h" #include "htString.h" // In advance declarations class HtFile; class HtFile_Response : public Transport_Response { friend class HtFile; // declaring friendship public: /////// // Construction / Destruction /////// HtFile_Response(); ~HtFile_Response(); }; class HtFile : public Transport { public: /////// // Construction/Destruction /////// HtFile(); ~HtFile(); // Information about the method to be used in the request // manages a Transport request (method inherited from Transport class) virtual DocStatus Request (); // Determine Mime type of file from its extension static const String *Ext2Mime (const char *); // Determine Mime type of file from its contents static String File2Mime (const char *); /////// // Interface for resource retrieving /////// /////// // Interface for resource retrieving /////// // Set and get the document to be retrieved void SetRequestURL(URL &u) { _url = u;} URL GetRequestURL () { return _url;} // Set and get the referring URL void SetRefererURL (URL u) { _referer = u;} URL GetRefererURL () { return _referer;} /////// // Interface for the HTTP Response /////// // We have a valid response only if the status code is not equal to // initialization value Transport_Response *GetResponse() { if (_response._status_code != -1) return &_response; else return NULL;} // Get the document status virtual DocStatus GetDocumentStatus(); protected: /////// // Member attributes /////// /////// // Http single Request information (Member attributes) /////// URL _url; // URL to retrieve URL _referer; // Referring URL /////// // Http Response information /////// HtFile_Response _response; // Object where response // information will be stored into }; #endif htdig-3.2.0b6/htnet/HtHTTP.cc0100644006314600127310000006540510055635553015110 0ustar angusgbhtdig// // HtHTTP.cc // // HtHTTP: Interface classes for HTTP messaging // // Including: // - Generic class // - Response message class // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTP.cc,v 1.27 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" #include "Transport.h" #include "HtHTTP.h" #include #include #include #include // for sscanf // for setw() #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #if 1 typedef void (*SIGNAL_HANDLER) (...); #else typedef SIG_PF SIGNAL_HANDLER; #endif // User Agent String HtHTTP::_user_agent = 0; // Stats information int HtHTTP::_tot_seconds = 0; int HtHTTP::_tot_requests = 0; int HtHTTP::_tot_bytes = 0; // flag that manage the option of 'HEAD' before 'GET' bool HtHTTP::_head_before_get = true; // Handler of the CanParse function int (* HtHTTP::CanBeParsed) (char *) = 0; // Cookies jar HtCookieJar *HtHTTP::_cookie_jar = 0; // Set to 0 by default /////// // HtHTTP_Response class // // Response message sent by the remote HTTP server /////// // Construction HtHTTP_Response::HtHTTP_Response() : _version(0), _transfer_encoding(0), _server(0), _hdrconnection(0), _content_language(0) { } // Destruction HtHTTP_Response::~HtHTTP_Response() { } void HtHTTP_Response::Reset() { // Call the base class method in order to reset // the base class attributes Transport_Response::Reset(); // Initialize the version, transfer-encoding, location and server strings _version.trunc(); _transfer_encoding.trunc(); _hdrconnection.trunc(); _server.trunc(); _content_language.trunc(); } /////// // HtHTTP generic class // // /////// // Construction HtHTTP::HtHTTP(Connection& connection) : Transport(&connection), _Method(Method_GET), // Default Method Request _bytes_read(0), _accept_language(0), _persistent_connection_allowed(true), _persistent_connection_possible(false), _send_cookies(true) { } // Destruction HtHTTP::~HtHTTP() { } /////// // Manages the requesting process /////// Transport::DocStatus HtHTTP::Request() { DocStatus result = Document_ok; /////// // We make a double request (HEAD and, maybe, GET) // Depending on the /////// if (HeadBeforeGet() && // Option value to true _Method == Method_GET) // Initial request method is GET { if (debug>3) cout << " Making a HEAD call before the GET" << endl; _Method = Method_HEAD; result = HTTPRequest(); _Method = Method_GET; } if (result == Document_ok) result = HTTPRequest(); if(result == Document_no_header && isPersistentConnectionAllowed()) { // Sometimes, the parsing phase of the header of the response // that the server gives us back, fails and a // error is raised. This happens with HTTP/1.1 persistent // connections, usually because the previous response stream // has not yet been flushed, so the buffer still contains // data regarding the last document retrieved. That sucks alot! // The only thing to do is to lose persistent connections benefits // for this document, so close the connection and 'GET' it again. CloseConnection(); // Close a previous connection if (debug>0) cout << "! Impossible to get the HTTP header line." << endl << " Connection closed. Try to get it again." << endl; result = HTTPRequest(); // Get the document again } return result; } /////// // Sends an HTTP 1/1 request /////// Transport::DocStatus HtHTTP::HTTPRequest() { static Transport::DocStatus DocumentStatus; bool ShouldTheBodyBeRead = true; SetBodyReadingController(&HtHTTP::ReadBody); // Reset the response _response.Reset(); // Flush the connection FlushConnection(); _bytes_read=0; if( debug > 4) cout << "Try to get through to host " << _url.host() << " (port " << _url.port() << ")" << endl; ConnectionStatus result; // Assign the timeout AssignConnectionTimeOut(); // Assign number of retries AssignConnectionRetries(); // Assign connection wait time AssignConnectionWaitTime(); // Start the timer _start_time.SettoNow(); result = EstablishConnection(); if(result != Connection_ok && result != Connection_already_up) { switch (result) { // Open failed case Connection_open_failed: if (debug>1) cout << "Unable to open the connection with host: " << _url.host() << " (port " << _url.port() << ")" << endl; CloseConnection(); return FinishRequest(Document_no_connection); break; // Server not reached case Connection_no_server: if (debug>1) cout << "Unable to find the host: " << _url.host() << " (port " << _url.port() << ")" << endl; CloseConnection(); return FinishRequest(Document_no_host); break; // Port not reached case Connection_no_port: if (debug>1) cout << "Unable to connect with the port " << _url.port() << " of the host: " << _url.host() << endl; CloseConnection(); return FinishRequest(Document_no_port); break; // Connection failed case Connection_failed: if (debug>1) cout << "Unable to establish the connection with host: " << _url.host() << " (port " << _url.port() << ")" << endl; CloseConnection(); return FinishRequest(Document_no_connection); break; // Other reason default: if (debug>1) cout << "connection failed with unexpected result: result = " << (int)result << ", " << _url.host() << " (port " << _url.port() << ")" << endl; CloseConnection(); return FinishRequest(Document_other_error); break; } return FinishRequest(Document_other_error); } // Visual comments about the result of the connection if (debug > 5) switch(result) { case Connection_already_up: cout << "Taking advantage of persistent connections" << endl; break; case Connection_ok: cout << "New connection open successfully" << endl; break; default: cout << "Unexptected value: " << (int)result << endl; break; } String command; switch(_Method) { case Method_GET: command = "GET "; break; case Method_HEAD: command = "HEAD "; ShouldTheBodyBeRead = false; break; } // Set the request command SetRequestCommand(command); if (debug > 6) cout << "Request\n" << command; // Writes the command ConnectionWrite(command); // Parse the header if (ParseHeader() == -1) // Connection down { // The connection probably fell down !?! if ( debug > 4 ) cout << setw(5) << Transport::GetTotOpen() << " - " << "Connection fell down ... let's close it" << endl; CloseConnection(); // Let's close the connection which is down now // Return that the connection has fallen down during the request return FinishRequest(Document_connection_down); } if (_response._status_code == -1) { // Unable to retrieve the status line if ( debug > 4 ) cout << "Unable to retrieve or parse the status line" << endl; return FinishRequest(Document_no_header); } if (debug > 3) { cout << "Retrieving document " << _url.path() << " on host: " << _url.host() << ":" << _url.port() << endl; cout << "Http version : " << _response._version << endl; cout << "Server : " << _response._version << endl; cout << "Status Code : " << _response._status_code << endl; cout << "Reason : " << _response._reason_phrase << endl; if (_response.GetAccessTime()) cout << "Access Time : " << _response.GetAccessTime()->GetRFC1123() << endl; if (_response.GetModificationTime()) cout << "Modification Time : " << _response.GetModificationTime()->GetRFC1123() << endl; cout << "Content-type : " << _response.GetContentType() << endl; if (_response._transfer_encoding.length()) cout << "Transfer-encoding : " << _response._transfer_encoding << endl; if (_response._content_language.length()) cout << "Content-Language : " << _response._content_language << endl; if (_response._hdrconnection.length()) cout << "Connection : " << _response._hdrconnection << endl; } // Check if persistent connection are possible CheckPersistentConnection(_response); if (debug > 4) cout << "Persistent connection: " << (_persistent_connection_possible ? "would be accepted" : "not accepted") << endl; DocumentStatus = GetDocumentStatus(_response); // We read the body only if the document has been found if (DocumentStatus != Document_ok) { ShouldTheBodyBeRead=false; } // For now a chunked response MUST BE retrieved if (mystrncasecmp ((char*)_response._transfer_encoding, "chunked", 7) == 0) { // Change the controller of the body reading SetBodyReadingController(&HtHTTP::ReadChunkedBody); } // If "ShouldTheBodyBeRead" is set to true and // If the document is parsable, we can read the body // otherwise it is not worthwhile if (ShouldTheBodyBeRead) { if ( debug > 4 ) cout << "Reading the body of the response" << endl; // We use a int (HtHTTP::*)() function pointer if ( (this->*_readbody)() == -1 ) { // The connection probably fell down !?! if ( debug > 4 ) cout << setw(5) << Transport::GetTotOpen() << " - " << "Connection fell down ... let's close it" << endl; CloseConnection(); // Let's close the connection which is down now // Return that the connection has fallen down during the request return FinishRequest(Document_connection_down); } if ( debug > 6 ) cout << "Contents:" << endl << _response.GetContents(); // Check if the stream returned by the server has not been completely read if (_response._document_length != _response._content_length && _response._document_length == _max_document_size) { // Max document size reached if (debug > 4) cout << "Max document size (" << GetRequestMaxDocumentSize() << ") reached "; if (isPersistentConnectionUp()) { // Only have to close persistent connection when we didn't read // all the input. For now, we always read all chunked input... if (mystrncasecmp ((char*)_response._transfer_encoding, "chunked", 7) != 0) { if (debug > 4) cout << "- connection closed. "; CloseConnection(); } } if (debug > 4) cout << endl; } // Make sure our content-length makes sense, if none given... if (_response._content_length < _response._document_length) _response._content_length = _response._document_length; } else if ( debug > 4 ) cout << "Body not retrieved" << endl; // Close the connection (if there's no persistent connection) if( ! isPersistentConnectionUp() ) { if ( debug > 4 ) cout << setw(5) << Transport::GetTotOpen() << " - " << "Connection closed (No persistent connection)" << endl; CloseConnection(); } else { // Persistent connection is active // If the document is not parsable and we asked for it with a 'GET' // method, the stream's not been completely read. if (DocumentStatus == Document_not_parsable && _Method == Method_GET) { // We have to close the connection. if ( debug > 4 ) cout << "Connection must be closed (stream not completely read)" << endl; CloseConnection(); } else if ( debug > 4 ) cout << "Connection stays up ... (Persistent connection)" << endl; } // Check the doc_status and return a value return FinishRequest(DocumentStatus); } HtHTTP::ConnectionStatus HtHTTP::EstablishConnection() { int result; // Open the connection result=OpenConnection(); if (!result) return Connection_open_failed; // Connection failed else if(debug > 4) { cout << setw(5) << Transport::GetTotOpen() << " - "; if (result == -1) cout << "Connection already open. No need to re-open." << endl; else cout << "Open of the connection ok" << endl; } if(result==1) // New connection open { // Assign the remote host to the connection if ( !AssignConnectionServer() ) return Connection_no_server; else if (debug > 4) cout << "\tAssigned the remote host " << _url.host() << endl; // Assign the port of the remote host if ( !AssignConnectionPort() ) return Connection_no_port; else if (debug > 4) cout << "\tAssigned the port " << _url.port() << endl; } // Connect if (! (result = Connect())) return Connection_failed; else if (result == -1) return Connection_already_up; // Persistent else return Connection_ok; // New connection } // Set the string of the HTTP message request void HtHTTP::SetRequestCommand(String &cmd) { // Initialize it if (_useproxy) { cmd << _url.get() << " HTTP/1.1\r\n"; } else cmd << _url.path() << " HTTP/1.1\r\n"; // Insert the "virtual" host to which ask the document cmd << "Host: " << _url.host(); if (_url.port() != 0 && _url.port() != _url.DefaultPort()) cmd << ":" << _url.port(); cmd << "\r\n"; // Insert the User Agent if (_user_agent.length()) cmd << "User-Agent: " << _user_agent << "\r\n"; // Referer if (_referer.get().length()) cmd << "Referer: " << _referer.get() << "\r\n"; // Accept-Language if (_accept_language.length()) cmd << "Accept-language: " << _accept_language << "\r\n"; // Authentication if (_credentials.length()) cmd << "Authorization: Basic " << _credentials << "\r\n"; // Proxy Authentication if (_useproxy && _proxy_credentials.length()) cmd << "Proxy-Authorization: Basic " << _proxy_credentials << "\r\n"; // Accept-Encoding: waiting to handle the gzip and compress formats, we // just send an empty header which, according to the HTTP 1/1 standard, // should let the server know that we only accept the 'identity' case // (no encoding of the document) cmd << "Accept-Encoding: \r\n"; // A date has been passed to check if the server one is newer than // the one we already own. if(_modification_time && *_modification_time > 0) { _modification_time->ToGMTime(); cmd << "If-Modified-Since: " << _modification_time->GetRFC1123() << "\r\n"; } /////// // Cookies! Let's go eat them! ;-) /////// // The method returns all the valid cookies and writes them // directly into the request string, as a list of headers if (_send_cookies && _cookie_jar) _cookie_jar->SetHTTPRequest_CookiesString(_url, cmd); // Let's close the command cmd << "\r\n"; } //***************************************************************************** // int HtHTTP::ParseHeader() // Parse the header of the document // int HtHTTP::ParseHeader() { String line = 0; int inHeader = 1; if (_response._modification_time) { delete _response._modification_time; _response._modification_time=0; } while (inHeader) { line.trunc(); if(! _connection->Read_Line(line, "\n")) return -1; // Connection down _bytes_read+=line.length(); line.chop('\r'); if (line.length() == 0) inHeader = 0; else { // Found a not-empty line if (debug > 2) cout << "Header line: " << line << endl; // Status - Line check char *token = line.get(); while (*token && !isspace(*token) && *token != ':') ++token; while (*token && (isspace(*token) || *token == ':')) ++token; if(!strncmp((char*)line, "HTTP/", 5)) { // Here is the status-line // store the HTTP version returned by the server _response._version = strtok(line, " "); // Store the status code _response._status_code = atoi(strtok(0, " ")); // Store the reason phrase _response._reason_phrase = strtok(0, "\n"); } else if( ! mystrncasecmp((char*)line, "server:", 7)) { // Server info // Set the server info token = strtok(token, "\n\t"); if (token && *token) _response._server = token; } else if( ! mystrncasecmp((char*)line, "last-modified:", 14)) { // Modification date sent by the server // Set the response modification time token = strtok(token, "\n\t"); if (token && *token) _response._modification_time = NewDate(token); } else if( ! mystrncasecmp((char*)line, "date:", 5)) { // Access date time sent by the server // Set the response access time token = strtok(token, "\n\t"); if (token && *token) _response._access_time = NewDate(token); } else if( ! mystrncasecmp((char*)line, "content-type:", 13)) { // Content - type token = strtok(token, "\n\t"); if (token && *token) _response._content_type = token; } else if( ! mystrncasecmp((char*)line, "content-length:", 15)) { // Content - length token = strtok(token, "\n\t"); if (token && *token) _response._content_length = atoi(token); } else if( ! mystrncasecmp((char*)line, "transfer-encoding:", 18)) { // Transfer-encoding token = strtok(token, "\n\t"); if (token && *token) _response._transfer_encoding = token; } else if( ! mystrncasecmp((char*)line, "location:", 9)) { // Found a location directive - redirect in act token = strtok(token, "\n\t"); if (token && *token) _response._location = token; } else if( ! mystrncasecmp((char*)line, "connection:", 11)) { // Ooops ... found a Connection clause token = strtok(token, "\n\t"); if (token && *token) _response._hdrconnection = token; } else if( ! mystrncasecmp((char*)line, "content-language:", 17)) { // Found a content-language directive token = strtok(token, "\n\t"); if (token && *token) _response._content_language = token; } else if( ! mystrncasecmp((char*)line, "set-cookie:", 11)) { // Found a cookie // Are cookies enabled? if (_send_cookies && _cookie_jar) { token = strtok(token, "\n\t"); if (token && *token) { // Insert the cookie into the jar _cookie_jar->AddCookie(token, _url); } } } else { // Discarded if (debug > 3) cout << "Discarded header line: " << line << endl; } } } if (_response._modification_time == 0) { if (debug > 3) cout << "No modification time returned: assuming now" << endl; //Set the modification time _response._modification_time = new HtDateTime; _response._modification_time->ToGMTime(); // Set to GM time } return 1; } // Check for a document to be parsable // It all depends on the content-type directive returned by the server bool HtHTTP::isParsable(const char *content_type) { // Here I can decide what kind of document I can parse // depending on the value of Transport:_default_parser_content_type // and the rest are determined by the external_parser settings if( ! mystrncasecmp (_default_parser_content_type.get(), content_type, _default_parser_content_type.length()) ) return true; // External function that checks if a document is parsable or not. // CanBeParsed should point to a function that returns an int value, // given a char * containing the content-type. if (CanBeParsed && (*CanBeParsed)( (char *) content_type) ) return true; return false; } // Check for a possibile persistent connection // on the return message's HTTP version basis void HtHTTP::CheckPersistentConnection(HtHTTP_Response &response) { const char *version = response.GetVersion(); if( ! mystrncasecmp ("HTTP/1.1", version, 8)) { const char *connection = response.GetConnectionInfo(); if( ! mystrncasecmp ("close", connection, 5)) _persistent_connection_possible=false; // Server wants to close else _persistent_connection_possible=true; } else _persistent_connection_possible=false; } HtHTTP::DocStatus HtHTTP::FinishRequest (HtHTTP::DocStatus ds) { int seconds; // Set the finish time _end_time.SettoNow(); // Let's add the number of seconds needed by the request seconds=HtDateTime::GetDiff(_end_time, _start_time); _tot_seconds += seconds; _tot_requests ++; _tot_bytes += _bytes_read; if (debug > 2) cout << "Request time: " << seconds << " secs" << endl; return ds; } HtHTTP::DocStatus HtHTTP::GetDocumentStatus(HtHTTP_Response &r) { // Let's give a look at the return status code HtHTTP::DocStatus returnStatus=Document_not_found; int statuscode; statuscode=r.GetStatusCode(); if(statuscode==200) { returnStatus = Document_ok; // OK // Is it parsable? if (! isParsable ((const char*)r.GetContentType()) ) returnStatus=Document_not_parsable; } else if(statuscode > 200 && statuscode < 300) returnStatus = Document_ok; // Successful 2xx else if(statuscode==304) returnStatus = Document_not_changed; // Not modified else if(statuscode > 300 && statuscode < 400) returnStatus = Document_redirect; // Redirection 3xx else if(statuscode==401) returnStatus = Document_not_authorized; // Unauthorized // Exit the function return returnStatus; } void HtHTTP::SetCredentials (const String& s) { Transport::SetHTTPBasicAccessAuthorizationString(_credentials, s); } void HtHTTP::SetProxyCredentials (const String& s) { Transport::SetHTTPBasicAccessAuthorizationString(_proxy_credentials, s); } int HtHTTP::ReadBody() { _response._contents = 0; // Initialize the string char docBuffer[8192]; int bytesRead = 0; int bytesToGo = _response._content_length; if (bytesToGo < 0 || bytesToGo > _max_document_size) bytesToGo = _max_document_size; while (bytesToGo > 0) { int len = bytesToGo< (int)sizeof(docBuffer) ? bytesToGo : (int)sizeof(docBuffer); bytesRead = _connection->Read(docBuffer, len); if (bytesRead <= 0) break; _response._contents.append(docBuffer, bytesRead); bytesToGo -= bytesRead; _bytes_read+=bytesRead; } // Set document length _response._document_length = _response._contents.length(); return bytesRead; } int HtHTTP::ReadChunkedBody() { // Chunked Transfer decoding // as shown in the RFC2616 (HTTP/1.1) - 19.4.6 #define BSIZE 8192 int length = 0; // initialize the length unsigned int chunk_size; String ChunkHeader = 0; char buffer[BSIZE+1]; int chunk, rsize; _response._contents.trunc(); // Initialize the string // Read chunk-size and CRLF if (!_connection->Read_Line(ChunkHeader, "\r\n")) return -1; sscanf ((char *)ChunkHeader, "%x", &chunk_size); if (debug>4) cout << "Initial chunk-size: " << chunk_size << endl; while (chunk_size > 0) { chunk = chunk_size; do { if (chunk > BSIZE) { rsize = BSIZE; if (debug>4) cout << "Read chunk partial: left=" << chunk << endl; } else { rsize = chunk; } chunk -= rsize; // Read Chunk data if (_connection->Read(buffer, rsize) == -1) return -1; length+=rsize; // Append the chunk-data to the contents of the response // ... but not more than _max_document_size... if (rsize > _max_document_size-_response._contents.length()) rsize = _max_document_size-_response._contents.length(); buffer[rsize] = 0; _response._contents.append(buffer, rsize); } while (chunk); // if (_connection->Read(buffer, chunk_size) == -1) // return -1; // Read CRLF - to be ignored if (!_connection->Read_Line(ChunkHeader, "\r\n")) return -1; // Read chunk-size and CRLF if (!_connection->Read_Line(ChunkHeader, "\r\n")) return -1; sscanf ((char *)ChunkHeader, "%x", &chunk_size); if (debug>4) cout << "Chunk-size: " << chunk_size << endl; } ChunkHeader = 0; // Ignoring next part of the body - the TRAILER // (it contains further headers - not implemented) // Set content length _response._content_length = length; // Set document length _response._document_length = _response._contents.length(); return length; } /////// // Show the statistics /////// ostream &HtHTTP::ShowStatistics (ostream &out) { Transport::ShowStatistics(out); // call the base class method out << " HTTP Requests : " << GetTotRequests() << endl; out << " HTTP KBytes requested : " << (double)GetTotBytes()/1024 << endl; out << " HTTP Average request time : " << GetAverageRequestTime() << " secs" << endl; out << " HTTP Average speed : " << GetAverageSpeed()/1024 << " KBytes/secs" << endl; return out; } htdig-3.2.0b6/htnet/HtHTTP.h0100644006314600127310000002444410055635553014750 0ustar angusgbhtdig// // HtHTTP.h // // HtHTTP: Class for HTTP messaging (derived from Transport) // // Gabriele Bartolini - Prato - Italia // started: 03.05.1999 // // //////////////////////////////////////////////////////////// // // The HtHTTP class should provide (as I hope) an interface for // retrieving document on the Web. It derives from Transport class. // // It should be HTTP/1.1 compatible. // // It also let us take advantage of persitent connections use, // and optimize request times (specially if directed to the same // server). // // HtHTTP use another class to store the response returned by the // remote server. // // Now cookies management is enabled. // /////// // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTP.h,v 1.15 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTHTTP_H #define _HTHTTP_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Transport.h" // Cookie support #include "HtCookie.h" #include "HtCookieJar.h" #include "URL.h" #include "htString.h" // for HtHTTP::ShowStatistics#ifdef HAVE_STD #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // In advance declarations class HtHTTP; class HtHTTP_Response : public Transport_Response { friend class HtHTTP; // declaring friendship public: /////// // Construction / Destruction /////// HtHTTP_Response(); ~HtHTTP_Response(); /////// // Interface /////// // Reset void Reset(); // Get the HTTP version const String &GetVersion() const { return _version; } // Get the Transfer-encoding const String &GetTransferEncoding() const { return _transfer_encoding; } // Get server info const String &GetServer() const { return _server; } // Get Connection info const String &GetConnectionInfo() const { return _hdrconnection; } // Get Content language const String &GetContentLanguage() const { return _content_language; } protected: // Status line information String _version; // HTTP Version // Other header information String _transfer_encoding; // Transfer-encoding String _server; // Server string returned String _hdrconnection; // Connection header String _content_language; // Content-language }; class HtHTTP : public Transport { private: HtHTTP() {} // Declared private - avoids default constructor to be created // in some cases by the compiler. public: /////// // Construction/Destruction /////// HtHTTP(Connection&); virtual ~HtHTTP() = 0; // Information about the method to be used in the request enum Request_Method { Method_GET, Method_HEAD }; /////// // Sends an HTTP request message /////// // manages a Transport request (method inherited from Transport class) virtual DocStatus Request (); // Sends a request message for HTTP virtual DocStatus HTTPRequest (); /////// // Control of member the variables /////// /////// // Set the Request Method /////// void SetRequestMethod (Request_Method rm) { _Method = rm; } Request_Method GetRequestMethod() { return _Method; } /////// // Interface for resource retrieving /////// // Set and get the document to be retrieved void SetRequestURL(const URL &u) { _url = u;} URL GetRequestURL () { return _url;} // Set and get the referring URL void SetRefererURL (const URL& u) { _referer = u;} URL GetRefererURL () { return _referer;} // Set and get the accept-language string void SetAcceptLanguage (const String& al) { _accept_language = al; } URL GetAcceptLanguage () { return _accept_language; } // Info for multiple requests (static) // Get the User agent string static void SetRequestUserAgent (const String &s) { _user_agent=s; } static const String &GetRequestUserAgent() { return _user_agent; } // Set (Basic) Authentication Credentials virtual void SetCredentials (const String& s); // Set (Basic) Authentication Credentials for the HTTP Proxy virtual void SetProxyCredentials (const String& s); /////// // Interface for the HTTP Response /////// // We have a valid response only if the status code is not equal to // initialization value Transport_Response *GetResponse() { if (_response._status_code != -1) return &_response; else return 0;} // Get the document status virtual DocStatus GetDocumentStatus() { return GetDocumentStatus (_response); } // It's a static method static DocStatus GetDocumentStatus(HtHTTP_Response &); /////// // Persistent connection choices interface /////// // Is allowed bool isPersistentConnectionAllowed() {return _persistent_connection_allowed;} // Is possible bool isPersistentConnectionPossible() {return _persistent_connection_possible;} // Check if a persistent connection is possible depending on the HTTP response void CheckPersistentConnection(HtHTTP_Response &); // Is Up (is both allowed and permitted by the server too) bool isPersistentConnectionUp() { return isConnected() && isPersistentConnectionAllowed() && isPersistentConnectionPossible(); } // Allow Persistent Connection void AllowPersistentConnection() { _persistent_connection_allowed=true; } // Disable Persistent Connection void DisablePersistentConnection() { _persistent_connection_allowed=false; } // Allow Cookies void AllowCookies() { _send_cookies=true; } // Disable Persistent Connection void DisableCookies() { _send_cookies=false; } /////// // Set the cookie manager class (that is to say the class) /////// // It's set only if not done before static void SetCookieJar(HtCookieJar *cj) { _cookie_jar = cj; } /////// // Manage statistics /////// static int GetTotSeconds () { return _tot_seconds; } static int GetTotRequests () { return _tot_requests; } static int GetTotBytes () { return _tot_bytes; } static double GetAverageRequestTime () { return _tot_seconds?( ((double) _tot_seconds) / _tot_requests) : 0; } static float GetAverageSpeed () { return _tot_bytes?( ((double) _tot_bytes) / _tot_seconds) : 0; } static void ResetStatistics () { _tot_seconds=0; _tot_requests=0; _tot_bytes=0;} // Show stats static ostream &ShowStatistics (ostream &out); /////// // Set the _head_before_get option // make a request to be made up of a HEAD call and then, // if necessary, a GET call /////// static void EnableHeadBeforeGet() { _head_before_get = true; } static void DisableHeadBeforeGet() { _head_before_get = false; } static bool HeadBeforeGet() { return _head_before_get; } /////// // Set the controller for the parsing check. That is to say // that External function that checks if a document is parsable or not. // CanBeParsed static attribute should point to a function // that returns an int value, given a char * containing the content-type. /////// static void SetParsingController (int (*f)(char*)) { CanBeParsed = f; } protected: /////// // Member attributes /////// Request_Method _Method; /////// // Http single Request information (Member attributes) /////// int _bytes_read; // Bytes read URL _url; // URL to retrieve URL _referer; // Referring URL String _accept_language; // accept-language directive /////// // Http multiple Request information /////// static String _user_agent; // User agent /////// // Http Response information /////// HtHTTP_Response _response; // Object where response // information will be stored into /////// // Allow or not a persistent connection (user choice) /////// bool _persistent_connection_allowed; /////// // Is a persistent connection possible (with this http server)? /////// bool _persistent_connection_possible; /////// // Are cookies enabled? /////// bool _send_cookies; /////// // Option that, if set to true, make a request to be made up // of a HEAD call and then, if necessary, a GET call /////// static bool _head_before_get; /////// // Manager of the body reading /////// int (HtHTTP::*_readbody) (); /////// // Enum /////// // Information about the status of a connection enum ConnectionStatus { Connection_ok, Connection_already_up, Connection_open_failed, Connection_no_server, Connection_no_port, Connection_failed }; /////// // Protected Services or method (Hidden by outside) /////// /////// // Establish the connection /////// ConnectionStatus EstablishConnection (); /////// // Set the string of the command containing the request /////// void SetRequestCommand(String &); /////// // Parse the header returned by the server /////// int ParseHeader(); /////// // Check if a document is parsable looking the content-type info /////// static bool isParsable(const char *); /////// // Read the body returned by the server /////// void SetBodyReadingController (int (HtHTTP::*f)()) { _readbody = f; } int ReadBody(); int ReadChunkedBody(); // Read the body of a chunked encoded-response // Finish the request and return a DocStatus value; DocStatus FinishRequest (DocStatus); /////// // Static attributes and methods /////// // Unique cookie Jar static HtCookieJar *_cookie_jar; // Jar containing all of the cookies static int _tot_seconds; // Requests last (in seconds) static int _tot_requests; // Number of requests static int _tot_bytes; // Number of bytes read // This is a pointer to function that check if a ContentType // is parsable or less. static int (*CanBeParsed) (char *); }; #endif htdig-3.2.0b6/htnet/HtHTTPBasic.cc0100644006314600127310000000164510055635553016046 0ustar angusgbhtdig// // HtHTTPBasic.cc // // HtHTTPBasic: Class for HTTP messaging (derived from Transport) // Does not handle HTTPS connections -- use HtHTTPSecure // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTPBasic.cc,v 1.5 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include "HtHTTPBasic.h" // HtHTTPBasic constructor // HtHTTPBasic::HtHTTPBasic() : HtHTTP(*(new Connection())) // Creates a new connection { } // HtHTTPBasic destructor // HtHTTPBasic::~HtHTTPBasic() { } htdig-3.2.0b6/htnet/HtHTTPBasic.h0100644006314600127310000000142710055635553015706 0ustar angusgbhtdig// // HtHTTPBasic.h // // HtHTTPBasic: Class for HTTP messaging (derived from Transport) // Does not handle HTTPS connections -- use HtHTTPSecure // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTPBasic.h,v 1.4 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTHTTPBASIC_H #define _HTHTTPBASIC_H #include "HtHTTP.h" // We inherrit from this #include "Transport.h" #include "Connection.h" #include "URL.h" #include "htString.h" class HtHTTPBasic : public HtHTTP { public: HtHTTPBasic(); ~HtHTTPBasic(); }; #endif htdig-3.2.0b6/htnet/HtHTTPSecure.cc0100644006314600127310000000170610055635553016251 0ustar angusgbhtdig// // HtHTTPSecure.cc // // HtHTTPSecure: Class for HTTP/HTTPS messaging (derived from Transport) // Uses an SSLConnection for secure connections. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTPSecure.cc,v 1.5 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_SSL_H #include "HtHTTPSecure.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // HtHTTPSecure constructor // HtHTTPSecure::HtHTTPSecure() : HtHTTP(*(new SSLConnection())) // Create a new "secure" connection { } // HtHTTPSecure destructor // HtHTTPSecure::~HtHTTPSecure() { } #endif htdig-3.2.0b6/htnet/HtHTTPSecure.h0100644006314600127310000000142010055635553016104 0ustar angusgbhtdig// // HtHTTPSecure.h // // HtHTTPSecure: Class for HTTP/HTTPS messaging (derived from Transport) // Uses an SSLConnection for secure connections. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtHTTPSecure.h,v 1.4 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTHTTPSECURE_H #define _HTHTTPSECURE_H #include "HtHTTP.h" #include "Transport.h" #include "SSLConnection.h" #include "URL.h" #include "htString.h" #ifdef HAVE_SSL_H class HtHTTPSecure : public HtHTTP { public: HtHTTPSecure(); ~HtHTTPSecure(); }; #endif #endif htdig-3.2.0b6/htnet/HtNNTP.cc0100644006314600127310000001201310055635553015073 0ustar angusgbhtdig// // HtNNTP.cc // // HtNNTP: Interface classes for NNTP messaging // // Gabriele Bartolini - Prato - Italia // started: 01.08.2000 // // Including: // - Generic class // - Response message class // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtNNTP.cc,v 1.5 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "lib.h" #include "Transport.h" #include "HtNNTP.h" #include #include #include #include // for sscanf // for setw() #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #if 1 typedef void (*SIGNAL_HANDLER) (...); #else typedef SIG_PF SIGNAL_HANDLER; #endif // Stats information int HtNNTP::_tot_seconds = 0; int HtNNTP::_tot_requests = 0; int HtNNTP::_tot_bytes = 0; /////// // HtNNTP_Response class // // Response message sent by the remote NNTP server /////// // Construction HtNNTP_Response::HtNNTP_Response() { } // Destruction HtNNTP_Response::~HtNNTP_Response() { } void HtNNTP_Response::Reset() { // Call the base class method in order to reset // the base class attributes Transport_Response::Reset(); } /////// // HtNNTP generic class // // /////// // Construction HtNNTP::HtNNTP() : Transport(new Connection()), _bytes_read(0), _useproxy(0) { } // Destruction HtNNTP::~HtNNTP() { // Free the connection // CloseConnection(); if (_connection) delete _connection; _connection = 0; } /////// // Manages the requesting process /////// Transport::DocStatus HtNNTP::Request() { DocStatus result = Document_ok; _response.Reset(); // Reset the response return result; } void HtNNTP::SetRequestCommand(String &cmd) { cmd << "\r\n"; } //***************************************************************************** // int HtNNTP::ParseHeader() // Parse the header of the document // int HtNNTP::ParseHeader() { String line = 0; int inHeader = 1; if (_response._modification_time) { delete _response._modification_time; _response._modification_time=NULL; } while (inHeader) { line.trunc(); if(! _connection->Read_Line(line, "\n")) return -1; // Connection down _bytes_read+=line.length(); line.chop('\r'); if (line.length() == 0) inHeader = 0; else { // Found a not-empty line if (debug > 3) cout << "Header line: " << line << endl; // Status - Line check char *token = line.get(); while (*token && !isspace(*token)) token++; while (*token && isspace(*token)) token++; } } if (_response._modification_time == NULL) { if (debug > 3) cout << "No modification time returned: assuming now" << endl; //Set the modification time _response._modification_time = new HtDateTime; _response._modification_time->ToGMTime(); // Set to GM time } return 1; } HtNNTP::DocStatus HtNNTP::GetDocumentStatus(HtNNTP_Response &r) { // Let's give a look at the return status code HtNNTP::DocStatus returnStatus=Document_not_found; int statuscode; statuscode=r.GetStatusCode(); if(statuscode==200) { returnStatus = Document_ok; // OK } // Exit the function return returnStatus; } int HtNNTP::ReadBody() { _response._contents = 0; // Initialize the string char docBuffer[8192]; int bytesRead = 0; int bytesToGo = _response._content_length; if (bytesToGo < 0 || bytesToGo > _max_document_size) bytesToGo = _max_document_size; if( _connection == NULL ) { cout << "HtNNTP::ReadBody: _connection is NULL\n"; exit(0); } while (bytesToGo > 0) { int len = bytesToGo< (int)sizeof(docBuffer) ? bytesToGo : (int)sizeof(docBuffer); bytesRead = _connection->Read(docBuffer, len); if (bytesRead <= 0) break; _response._contents.append(docBuffer, bytesRead); bytesToGo -= bytesRead; _bytes_read+=bytesRead; } // Set document length _response._document_length = _response._contents.length(); return bytesRead; } /////// // Show the statistics /////// ostream &HtNNTP::ShowStatistics (ostream &out) { Transport::ShowStatistics(out); // call the base class method out << " NNTP Requests : " << GetTotRequests() << endl; out << " NNTP KBytes requested : " << (double)GetTotBytes()/1024 << endl; out << " NNTP Average request time : " << GetAverageRequestTime() << " secs" << endl; out << " NNTP Average speed : " << GetAverageSpeed()/1024 << " KBytes/secs" << endl; return out; } htdig-3.2.0b6/htnet/HtNNTP.h0100644006314600127310000000730710055635553014747 0ustar angusgbhtdig// // HtNNTP.h // // HtNNTP: Class for NNTP messaging (derived from Transport) // // Gabriele Bartolini - Prato - Italia // started: 01.08.2000 // // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the General GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtNNTP.h,v 1.5 2004/05/28 13:15:23 lha Exp $ // #ifndef _HTNNTP_H #define _HTNNTP_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Transport.h" #include "URL.h" #include "htString.h" // for HtNNTP::ShowStatistics #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // In advance declarations class HtNNTP; class HtNNTP_Response : public Transport_Response { friend class HtNNTP; // declaring friendship public: /////// // Construction / Destruction /////// HtNNTP_Response(); ~HtNNTP_Response(); /////// // Interface /////// // Reset void Reset(); protected: // Other header information }; class HtNNTP : public Transport { public: /////// // Construction/Destruction /////// HtNNTP(); ~HtNNTP(); /////// // Sends an NNTP request message /////// // manages a Transport request (method inherited from Transport class) virtual DocStatus Request (); /////// // Control of member the variables /////// /////// // Interface for resource retrieving /////// // Set and get the document to be retrieved void SetRequestURL(URL &u) { _url = u;} URL GetRequestURL () { return _url;} Transport_Response *GetResponse() { if (_response._status_code != -1) return &_response; else return NULL; } // Get the document status virtual DocStatus GetDocumentStatus() { return GetDocumentStatus (_response); } // It's a static method static DocStatus GetDocumentStatus(HtNNTP_Response &); // Manage statistics static int GetTotSeconds () { return _tot_seconds; } static int GetTotRequests () { return _tot_requests; } static int GetTotBytes () { return _tot_bytes; } static double GetAverageRequestTime () { return _tot_seconds?( ((double) _tot_seconds) / _tot_requests) : 0; } static float GetAverageSpeed () { return _tot_bytes?( ((double) _tot_bytes) / _tot_seconds) : 0; } static void ResetStatistics () { _tot_seconds=0; _tot_requests=0; _tot_bytes=0;} // Show stats static ostream &ShowStatistics (ostream &out); // Proxy settings void SetProxy(int aUse) { _useproxy=aUse; } protected: /////// // Member attributes /////// /////// // NNTP single Request information (Member attributes) /////// int _bytes_read; // Bytes read URL _url; // URL to retrieve int _useproxy; // Shall we use a proxy? /////// // NNTP Response information /////// HtNNTP_Response _response; // Object where response // information will be stored into /////// // Set the string of the command containing the request /////// void SetRequestCommand(String &); /////// // Parse the header returned by the server /////// int ParseHeader(); /////// // Read the body returned by the server /////// int ReadBody(); /////// // Static attributes and methods /////// static int _tot_seconds; // Requests last (in seconds) static int _tot_requests; // Number of requests static int _tot_bytes; // Number of bytes read }; #endif htdig-3.2.0b6/htnet/Makefile.am0100644006314600127310000000116407723256616015561 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config pkglib_LTLIBRARIES = libhtnet.la libhtnet_la_SOURCES = Connection.cc Transport.cc HtHTTP.cc HtFile.cc \ HtNNTP.cc HtFTP.cc HtCookie.cc HtCookieJar.cc HtCookieMemJar.cc \ HtCookieInFileJar.cc HtHTTPBasic.cc HtHTTPSecure.cc SSLConnection.cc libhtnet_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ Connection.h \ Transport.h \ HtHTTP.h \ HtFile.h \ HtFTP.h \ HtNNTP.h \ HtCookie.h \ HtCookieJar.h \ HtCookieMemJar.h \ HtCookieInFileJar.h \ HtHTTPBasic.h \ HtHTTPSecure.h \ SSLConnection.h htdig-3.2.0b6/htnet/Makefile.in0100644006314600127310000003526610063260372015565 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la pkglib_LTLIBRARIES = libhtnet.la libhtnet_la_SOURCES = Connection.cc Transport.cc HtHTTP.cc HtFile.cc \ HtNNTP.cc HtFTP.cc HtCookie.cc HtCookieJar.cc HtCookieMemJar.cc \ HtCookieInFileJar.cc HtHTTPBasic.cc HtHTTPSecure.cc SSLConnection.cc libhtnet_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ Connection.h \ Transport.h \ HtHTTP.h \ HtFile.h \ HtFTP.h \ HtNNTP.h \ HtCookie.h \ HtCookieJar.h \ HtCookieMemJar.h \ HtCookieInFileJar.h \ HtHTTPBasic.h \ HtHTTPSecure.h \ SSLConnection.h subdir = htnet ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(pkglib_LTLIBRARIES) libhtnet_la_LIBADD = am_libhtnet_la_OBJECTS = Connection.lo Transport.lo HtHTTP.lo HtFile.lo \ HtNNTP.lo HtFTP.lo HtCookie.lo HtCookieJar.lo HtCookieMemJar.lo \ HtCookieInFileJar.lo HtHTTPBasic.lo HtHTTPSecure.lo \ SSLConnection.lo libhtnet_la_OBJECTS = $(am_libhtnet_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libhtnet_la_SOURCES) HEADERS = $(pkginclude_HEADERS) DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am SOURCES = $(libhtnet_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htnet/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhtnet.la: $(libhtnet_la_OBJECTS) $(libhtnet_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libhtnet_la_LDFLAGS) $(libhtnet_la_OBJECTS) $(libhtnet_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f"; \ $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \ rm -f $(DESTDIR)$(pkgincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkgincludedir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS \ uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgincludeHEADERS install-pkglibLTLIBRARIES \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am \ uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES # 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: htdig-3.2.0b6/htnet/Makefile.win320100644006314600127310000000117607675642172016133 0ustar angusgbhtdig TARGET = $(LIBDIR)/libhtnet$(LIBSFX) # ---------------------------------------------------------------------------- # add new library members to this list # ---------------------------------------------------------------------------- include ../Makedefs.win32 CXXSRC = Connection.cc Transport.cc HtHTTP.cc HtFile.cc HtNNTP.cc \ HtCookie.cc HtCookieJar.cc HtCookieMemJar.cc HtHTTPBasic.cc \ HtHTTPSecure.cc SSLConnection.cc HtFTP.cc HtCookieInFileJar.cc CPPFLAGS += -DHAVE_CONFIG_H -I../db -I../htlib -I../htword -I../htcommon $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) include ../Makerules.win32 htdig-3.2.0b6/htnet/SSLConnection.cc0100644006314600127310000000637610055635553016520 0ustar angusgbhtdig// // SSLConnection.cc // // SSLConnection: This class forms a easy to use interface to the // socket interface using SSL connection encryption. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SSLConnection.cc,v 1.6 2004/05/28 13:15:23 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_SSL_H #include "SSLConnection.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // Global needed only once in HtDig // SSL_CTX *SSLConnection::ctx = NULL; SSLConnection::SSLConnection() { InitSSL(); } SSLConnection::SSLConnection(int socket) { InitSSL(); } void SSLConnection::InitSSL() { if( ctx == NULL ) { // Add in the OpenSSL algorithms ?? // OpenSSL_add_ssl_algorithms(); // Load the error strings ... openssl says so // SSL_load_error_strings(); // New CTX, either v3 but can default to v2 // ctx = SSL_CTX_new (SSLv23_client_method()); if( ctx == NULL ) { cout << "ctx NULL" << endl; exit(1); } } } SSLConnection::~SSLConnection() { if( ctx != NULL ) SSL_CTX_free (ctx); ctx = NULL; } int SSLConnection::Connect() { // Run the standard connect // int ret = Connection::Connect(); if( ret != OK ) return ret; // Now start SSL negotiation // ssl = SSL_new (ctx); // Attach ssl to socket // SSL_set_fd (ssl, sock); int err = SSL_connect (ssl); if( err == -1) { // cout << "SSL_connect failed!" << endl; // Close the socket // Connection::Close(); return NOTOK; } return OK; } int SSLConnection::Close() { // First kill the SSL stuff // SSL_shutdown (ssl); /* send SSL/TLS close_notify */ /* Clean up. */ // Now call the Connection Close // int ret = Connection::Close(); if( ret == OK ) { SSL_free (ssl); } return ret; } int SSLConnection::Read_Partial(char *buffer, int maxlength) { int count; need_io_stop = 0; do { errno = 0; if (timeout_value > 0) { FD_SET_T fds; FD_ZERO(&fds); FD_SET(sock, &fds); timeval tv; tv.tv_sec = timeout_value; tv.tv_usec = 0; int selected = select(sock+1, &fds, 0, 0, &tv); if (selected <= 0) need_io_stop++; } if (!need_io_stop) count = SSL_read(ssl, buffer, maxlength); else count = -1; // Input timed out } while (count <= 0 && errno == EINTR && !need_io_stop); need_io_stop = 0; return count; } //************************************************************************* // int Connection::Write_Partial(char *buffer, int maxlength) // int SSLConnection::Write_Partial(char *buffer, int maxlength) { int count; do { count = SSL_write(ssl, buffer, maxlength); } while (count < 0 && errno == EINTR && !need_io_stop); need_io_stop = 0; return count; } #endif htdig-3.2.0b6/htnet/SSLConnection.h0100644006314600127310000000206210055635553016346 0ustar angusgbhtdig// // SSLConnection.cc // // SSLConnection: This class forms a easy to use interface to the // socket interface using SSL connection encryption. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SSLConnection.h,v 1.5 2004/05/28 13:15:23 lha Exp $ // #ifndef _SSLConnection_h_ #define _SSLConnection_h_ #include "Connection.h" #ifdef HAVE_SSL_H #include #include #include #include #include class SSLConnection : public Connection { public: SSLConnection(); SSLConnection(int socket); ~SSLConnection(); protected: static SSL_CTX *ctx; SSL *ssl; void InitSSL(); int Connect(); int Close(); int Read_Partial( char *buffer, int maxlength ); int Write_Partial( char *buffer, int maxlength ); }; #endif #endif htdig-3.2.0b6/htnet/Transport.cc0100644006314600127310000002503410055635553016023 0ustar angusgbhtdig// // Transport.cc // // Transport: A virtual transport interface class for accessing // remote documents. Used to grab URLs based on the // scheme (e.g. http://, ftp://...) // // Keep constructor and destructor in a file of its own. // Also takes care of the lower-level connection code. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Transport.cc,v 1.12 2004/05/28 13:15:23 lha Exp $ // // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Transport.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #define DEFAULT_CONNECTION_TIMEOUT 15 /////// // Static variables initialization /////// // Debug level int Transport::debug = 0; // Default parser content-type string String Transport::_default_parser_content_type = 0; // Statistics int Transport::_tot_open = 0; int Transport::_tot_close = 0; int Transport::_tot_changes = 0; /////// // Transport_Response class definition /////// /////// // Class Constructor /////// Transport_Response::Transport_Response() { // Initialize the pointers to the HtDateTime objs _modification_time = 0; _access_time = 0; // Set the content length and the return status code to negative values _content_length = -1; _status_code = -1; // Also set the document length, but to zero instead of -1 _document_length = 0; // Zeroes the contents and the content-type _contents = 0; _content_type = 0; // Initialize the reason_phrase _reason_phrase = 0; // Initialize the location _location = 0; } /////// // Empty destructor /////// Transport_Response::~Transport_Response() { // Free memory correctly if(_modification_time) { delete _modification_time; _modification_time=0; } if(_access_time) { delete _access_time; _access_time=0; } } void Transport_Response::Reset() { // Reset all the field of the object // Check if an HtDateTime object exists, and delete it if(_modification_time) { delete _modification_time; _modification_time=0; } if(_access_time) { delete _access_time; _access_time=0; } // Set the content length to a negative value _content_length=-1; // Also set the document length, but to zero instead of -1 _document_length=0; // Zeroes the contents and content type strings _contents.trunc(); _content_type.trunc(); // Set the return status code to a negative value _status_code=-1; // Zeroes the reason phrase of the s.c. _reason_phrase.trunc(); // Reset the location _location.trunc(); } /////// // Transport class definition /////// /////// // Constructor /////// Transport::Transport(Connection* connection) : _connection(connection), _host(0), _ip_address(0), _port(-1), _timeout(DEFAULT_CONNECTION_TIMEOUT), _retries(1), _wait_time(5), _modification_time(0), _max_document_size(0), _credentials(0), _useproxy(0), _proxy_credentials(0) { } /////// // Destructor /////// Transport::~Transport() { // Close the connection that was still up if (CloseConnection()) if ( debug > 4 ) cout << setw(5) << GetTotOpen() << " - " << "Closing previous connection with the remote host" << endl; if (_connection) delete (_connection); } /////// // Show the statistics /////// ostream &Transport::ShowStatistics (ostream &out) { out << " Connections opened : " << GetTotOpen() << endl; out << " Connections closed : " << GetTotClose() << endl; out << " Changes of server : " << GetTotServerChanges() << endl; return out; } /////// // Connection Management /////// // Open the connection // Returns // - 0 if failed // - -1 if already open // - 1 if ok int Transport::OpenConnection() { if (!_connection) return 0; if(_connection->IsOpen() && _connection->IsConnected()) return -1; // Already open and connection is up // No open connection // Let's open a new one if(_connection->Open() == NOTOK) return 0; // failed _tot_open ++; return 1; } // Assign the server to the connection int Transport::AssignConnectionServer() { if (debug > 5) cout << "\tAssigning the server (" << _host << ") to the TCP connection" << endl; if( _connection == 0 ) { cout << "Transport::AssignConnectionServer: _connection is NULL\n"; exit(0); } if (_connection->Assign_Server(_host) == NOTOK) return 0; _ip_address = _connection->Get_Server_IPAddress(); return 1; } // Assign the remote server port to the connection int Transport::AssignConnectionPort() { if (debug > 5) cout << "\tAssigning the port (" << _port << ") to the TCP connection" << endl; if( _connection == 0 ) { cout << "Transport::AssignConnectionPort: _connection is NULL\n"; exit(0); } if (_connection->Assign_Port(_port) == NOTOK) return 0; return 1; } // Connect // Returns // - 0 if failed // - -1 if already connected // - 1 if ok int Transport::Connect() { if (debug > 5) cout << "\tConnecting via TCP to (" << _host << ":" << _port << ")" << endl; if (isConnected()) return -1; // Already connected if( _connection == 0 ) { cout << "Transport::Connection: _connection is NULL\n"; exit(0); } if ( _connection->Connect() == NOTOK) return 0; // Connection failed return 1; // Connected } // Flush the connection void Transport::FlushConnection() { if(_connection) { _connection->Flush(); } } // Close the connection // Returns // - 0 if not open // - 1 if closed ok int Transport::CloseConnection() { if( _connection == 0 ) { // We can't treat this as a fatal error, because CloseConnection() // may be called from our destructor after _connection already deleted. // cout << "Transport::CloseConnection: _connection is NULL\n"; // exit(0); return 0; } if(_connection->IsOpen()) _connection->Close(); // Close the connection else return 0; _tot_close ++; return 1; } void Transport::SetConnection (const String &host, int port) { if (_port != -1) { // Already initialized // Let's check if the server or the port are changed bool ischanged = false; // Checking the connection server if(_host != host) // server is gonna change ischanged=true; // Checking the connection port if( _port != port ) // the port is gonna change ischanged=true; if (ischanged) { // Let's close any pendant connection with the old // server / port pair _tot_changes ++; if ( debug > 4 ) cout << setw(5) << GetTotOpen() << " - " << "Change of server. Previous connection closed." << endl; CloseConnection(); } } // Copy the host and port information to the object _host = host; _port = port; } // Create a new date time object containing the date specified in a string HtDateTime *Transport::NewDate(const char *datestring) { while(isspace(*datestring)) datestring++; // skip initial spaces DateFormat df = RecognizeDateFormat (datestring); if(df == DateFormat_NotRecognized) { // Not recognized if(debug > 0) cout << "Date Format not recognized: " << datestring << endl; return 0; } HtDateTime *dt = new HtDateTime; dt->ToGMTime(); // Set to GM time switch(df) { // Asc Time format case DateFormat_AscTime: dt->SetAscTime((char *)datestring); break; // RFC 1123 case DateFormat_RFC1123: dt->SetRFC1123((char *)datestring); break; // RFC 850 case DateFormat_RFC850: dt->SetRFC850((char *)datestring); break; default: cout << "Date Format not handled: " << (int)df << endl; break; } return dt; } // Recognize the possible date format sent by the server Transport::DateFormat Transport::RecognizeDateFormat (const char *datestring) { register const char *s; if((s=strchr(datestring, ','))) { // A comma is present. // Two chances: RFC1123 or RFC850 if(strchr(s, '-')) return DateFormat_RFC850; // RFC 850 recognized else return DateFormat_RFC1123; // RFC 1123 recognized } else { // No comma present // Let's try C Asctime: Sun Nov 6 08:49:37 1994 if(strlen(datestring) == 24) return DateFormat_AscTime; } return DateFormat_NotRecognized; } // This method is used to write into 'dest' the credentials contained in 's' // according to the HTTP Basic access authorization [RFC2617] // It is written in this abstract class because it is used also // when dealing with HTTP proxies, no matter what protocol we are // using (HTTP now, but FTP in the future). void Transport::SetHTTPBasicAccessAuthorizationString(String &dest, const String& s) { static char tbl[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; dest.trunc(); const char *p; int n = s.length(); int ch; for (p = s.get(); n > 2; n -= 3, p += 3) { ch = *p >> 2; dest << tbl[ch & 077]; ch = ((*p << 4) & 060) | ((p[1] >> 4) & 017); dest << tbl[ch & 077]; ch = ((p[1] << 2) & 074) | ((p[2] >> 6) & 03); dest << tbl[ch & 077]; ch = p[2] & 077; dest << tbl[ch & 077]; } if (n != 0) { char c1 = *p; char c2 = n == 1 ? 0 : p[1]; ch = c1 >> 2; dest << tbl[ch & 077]; ch = ((c1 << 4) & 060) | ((c2 >> 4) & 017); dest << tbl[ch & 077]; if (n == 1) dest << '='; else { ch = (c2 << 2) & 074; dest << tbl[ch & 077]; } dest << '='; } } // End of Transport.cc (it's a virtual class anyway!) htdig-3.2.0b6/htnet/Transport.h0100644006314600127310000002436410055635553015672 0ustar angusgbhtdig// // Transport.h // // Transport: A virtual transport interface class for accessing // remote documents. Used to grab URLs based on the // scheme (e.g. http://, ftp://...) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Transport.h,v 1.12 2004/05/28 13:15:23 lha Exp $ // // #ifndef _Transport_H #define _Transport_H #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "HtDateTime.h" #include "htString.h" #include "URL.h" #include "Connection.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // Declare in advance class Transport; // But first, something completely different. Here's the response class class Transport_Response : public Object { friend class Transport; // declaring friendship public: /////// // Construction / Destruction /////// Transport_Response(); virtual ~Transport_Response(); // Reset the information stored virtual void Reset(); // This function must be defined // Get the contents virtual const String &GetContents() const { return _contents; } // Get the modification time object pointer virtual HtDateTime *GetModificationTime() const { return _modification_time; } // Get the access time object pointer virtual HtDateTime *GetAccessTime() const { return _access_time; } // Get the Content type virtual const String &GetContentType() const { return _content_type; } // Get the Content length virtual int GetContentLength() const { return _content_length; } // Get the Document length (really stored) virtual int GetDocumentLength() const { return _document_length; } // Get the Status Code virtual int GetStatusCode() const { return _status_code; } // Get the Status Code reason phrase virtual const String &GetReasonPhrase() { return _reason_phrase; } // Get the location (redirect) virtual const String &GetLocation() { return _location; } protected: // Body of the response message String _contents; // Contents of the document HtDateTime *_modification_time; // Modification time returned by the server HtDateTime *_access_time; // Access time returned by the server String _content_type; // Content-type returned by the server int _content_length; // Content-length returned by the server int _document_length; // Length really stored int _status_code; // return Status code String _reason_phrase; // status code reason phrase String _location; // Location (in case of redirect) }; /////// // Transport class declaration /////// class Transport : public Object { public: /////// // Construction / Destruction /////// Transport(Connection* _connection = 0); virtual ~Transport(); /////// // Enumeration of possible return status of a resource retrieving /////// enum DocStatus { Document_ok, Document_not_changed, Document_not_found, Document_not_parsable, Document_redirect, Document_not_authorized, Document_no_connection, Document_connection_down, Document_no_header, Document_no_host, Document_no_port, Document_not_local, Document_not_recognized_service, // Transport service not recognized Document_other_error // General error (memory) }; /////// // Connects to an host and a port // Overloaded methods provided in order to take // the info from a URL obj or ptr /////// // Set Connection parameters virtual void SetConnection (const String &host, int port); // from a URL pointer virtual void SetConnection (URL *u) { SetConnection (u->host(), u->port()); } // from a URL object virtual void SetConnection (URL &u) { SetConnection (&u); } // Make the request virtual DocStatus Request() = 0; // different in derived classes // Get the date time information about the request const HtDateTime *GetStartTime() const { return &_start_time; } const HtDateTime *GetEndTime() const { return &_end_time; } // Set and get the connection time out value void SetTimeOut ( int t ) { _timeout=t; } int GetTimeOut () { return _timeout; } // Set and get the connection retry number void SetRetry ( int r ) { _retries=r; } int GetRetry () { return _retries; } // Set and get the wait time after a failed connection void SetWaitTime ( unsigned int t ) { _wait_time = t; } unsigned int GetWaitTime () { return _wait_time; } // Get the Connection Host const String &GetHost() { return _host; } // Get the Connection IP Address const String &GetHostIPAddress() { return _ip_address; } // Get the Connection Port int GetPort() { return _port; } // Set and get the credentials // Likely to vary based on transport protocol virtual void SetCredentials (const String& s) { _credentials = s;} virtual String GetCredentials () { return _credentials;} // Proxy settings virtual void SetProxy(int aUse) { _useproxy=aUse; } // Proxy credentials virtual void SetProxyCredentials (const String& s) { _proxy_credentials = s;} virtual String GetProxyCredentials () { return _proxy_credentials;} // Set the modification date and time for If-Modified-Since void SetRequestModificationTime (HtDateTime *p) { _modification_time=p; } void SetRequestModificationTime (HtDateTime &p) { SetRequestModificationTime (&p) ;} // Get the modification date time HtDateTime *GetRequestModificationTime () { return _modification_time; } // Get and set the max document size to be retrieved void SetRequestMaxDocumentSize (int s) { _max_document_size=s; } int GetRequestMaxDocumentSize() const { return _max_document_size; } virtual Transport_Response *GetResponse() = 0; virtual DocStatus GetDocumentStatus() = 0; /////// // Querying the status of the connection /////// // Are we still connected? // This is the only part regarding // a connection that's got a public access virtual bool isConnected(){ return _connection?_connection->IsConnected():0; } // Set the default parser string for the content-type static void SetDefaultParserContentType (const String &ct) { _default_parser_content_type = ct; } // Set the debug level static void SetDebugLevel (int d) { debug=d;} // Get statistics info static int GetTotOpen () { return _tot_open; } static int GetTotClose () { return _tot_close; } static int GetTotServerChanges () { return _tot_changes; } protected: /////// // Services about a Transport layer connection // They're invisible from outside /////// // Open the connection virtual int OpenConnection(); // Assign the host and the port for the connection int AssignConnectionServer(); int AssignConnectionPort(); // Connect to the specified host and port int Connect(); // Write a message inline int ConnectionWrite(char *cmd) { return _connection?_connection->Write(cmd):0; } // Assign the timeout to the connection (returns the old value) inline int AssignConnectionTimeOut() { return _connection?_connection->Timeout(_timeout):0; } // Assign the retry number to the connection (returns the old value) inline int AssignConnectionRetries() { return _connection?_connection->Retries(_retries):0; } // Assign the wait time (after a failure) to the connection inline int AssignConnectionWaitTime() { return _connection?_connection->WaitTime(_wait_time):0; } // Flush the connection void FlushConnection(); // Close the connection int CloseConnection(); // Reset Stats static void ResetStatistics () { _tot_open=0; _tot_close=0; _tot_changes=0;} // Show stats static ostream &ShowStatistics (ostream &out); // Methods for manipulating date strings -- useful for subclasses enum DateFormat { DateFormat_RFC1123, DateFormat_RFC850, DateFormat_AscTime, DateFormat_NotRecognized }; // Create a new HtDateTime object HtDateTime *NewDate(const char *); // Recognize Date Format DateFormat RecognizeDateFormat (const char *); protected: Connection *_connection; // Connection object String _host; // TCP Connection host String _ip_address; // TCP Connection host (IP Address) int _port; // TCP Connection port int _timeout; // Connection timeout int _retries; // Connection retry limit unsigned int _wait_time; // Connection wait time (if failed) HtDateTime *_modification_time; // Stored modification time if avail. int _max_document_size; // Max document size to retrieve String _credentials; // Credentials for this connection int _useproxy; // if true, GET should include full url, // not path only String _proxy_credentials; // Credentials for this proxy connection HtDateTime _start_time; // Start time of the request HtDateTime _end_time; // end time of the request /////// // Default parser content-type // This string is matched in order to determine // what content type can be considered parsed // directly by the internal indexer (not by using // any external parser) /////// static String _default_parser_content_type; /////// // Debug level /////// static int debug; // Statistics about requests static int _tot_open; // Number of connections opened static int _tot_close; // Number of connections closed static int _tot_changes; // Number of server changes // Use the HTTP Basic Digest Access Authentication method to write a String // to be used for credentials (both HTTP and HTTP PROXY authentication) static void SetHTTPBasicAccessAuthorizationString(String &dest, const String& s); }; #endif htdig-3.2.0b6/htnotify/0040755006314600127310000000000010063260370014227 5ustar angusgbhtdightdig-3.2.0b6/htnotify/.sniffdir/0040755006314600127310000000000010063260370016111 5ustar angusgbhtdightdig-3.2.0b6/htsearch/0040755006314600127310000000000010063260370014164 5ustar angusgbhtdightdig-3.2.0b6/htsearch/.sniffdir/0040755006314600127310000000000010063260370016046 5ustar angusgbhtdightdig-3.2.0b6/htsearch/.cvsignore0100644006314600127310000000006606772705364016206 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htsearch htdig-3.2.0b6/htsearch/AndQuery.cc0100644006314600127310000000573010055635554016240 0ustar angusgbhtdig// // AndQuery.cc // // AndQuery: an operator query that does 'and' combination // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: AndQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "AndQuery.h" // // l r and // ---------------------- // 0 0 0 // 0 b 0 // 0 x 0 // a 0 0 // a b intersect(a,b) // a x a // x 0 0 // x b b // x x x // // i.e. some 0 => 0 // ignores can be left out of intersection // the shorter of the result lists is put apart for intersection // this optimises the intersection process // ResultList * AndQuery::Evaluate() { ResultList *result = 0; ResultList *shorter = 0; operands.Start_Get(); Query *operand = (Query *) operands.Get_Next(); while(operand && !shorter) { result = operand->GetResults(); if(!result) { break; } if(!result->IsIgnore()) { shorter = result; } operand = (Query *) operands.Get_Next(); } if(shorter) { List longer; while(operand && result) { result = operand->GetResults(); if(result && !result->IsIgnore()) { if(result->Count() < shorter->Count()) { longer.Add(shorter); shorter = result; } else { longer.Add(result); } } operand = (Query *) operands.Get_Next(); } if(longer.Count()) { result = Intersection(*shorter, longer); longer.Release(); } else { result = new ResultList(*shorter); } } return result; } // // return a result list containing only the matches common to // all input parameters. // // l is iterated, matches from l are searched in all elements of rs // // // foreach match in shorter // confirm the match in each lists // if confirmed // copy all matches in result // // the shorter of the input lists is assumed to be in the first parameter // this is a modest optimisation in order to minimise iteration // ResultList * AndQuery::Intersection(const ResultList &shorter, const List &lists) { ResultList *result = 0; DictionaryCursor c; shorter.Start_Get(c); DocMatch *match = (DocMatch *)shorter.Get_NextElement(c); while(match) { List confirms; ListCursor lc; lists.Start_Get(lc); ResultList *list = (ResultList *)lists.Get_Next(lc); while(list) { DocMatch *confirm = list->find(match->GetId()); if(confirm) { confirms.Add(confirm); } list = (ResultList *)lists.Get_Next(lc); } if(confirms.Count() == lists.Count()) { if(!result) { result = new ResultList; } DocMatch *copy = new DocMatch(*match); confirms.Start_Get(); DocMatch *confirm = (DocMatch *)confirms.Get_Next(); while(confirm) { copy->Merge(*confirm); confirm = (DocMatch *)confirms.Get_Next(); } result->add(copy); } confirms.Release(); match = (DocMatch *)shorter.Get_NextElement(c); } return result; } htdig-3.2.0b6/htsearch/AndQuery.h0100644006314600127310000000163110055635554016076 0ustar angusgbhtdig#ifndef _AndQuery_h_ #define _AndQuery_h_ // // AndQuery.h // // AndQuery: an operator query that does 'and' combination // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: AndQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "OperatorQuery.h" // // and query // class AndQuery : public OperatorQuery { public: private: // evaluate operands and intersect results ResultList *Evaluate(); // create an intersection of the operand results ResultList *Intersection(const ResultList &shorter, const List &longer); // used by GetLogicalWords String OperatorString() const { return String("and"); } }; #endif htdig-3.2.0b6/htsearch/AndQueryParser.h0100644006314600127310000000131210055635554017247 0ustar angusgbhtdig#ifndef _AndQueryParser_h_ #define _AndQueryParser_h_ // // AndQueryParser.h // // AndQueryParser: a simple query parser for 'all words' queries // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: AndQueryParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "SimpleQueryParser.h" #include "AndQuery.h" class AndQueryParser : public SimpleQueryParser { public: AndQueryParser() {} private: OperatorQuery *MakeQuery() { return new AndQuery; } }; #endif htdig-3.2.0b6/htsearch/BooleanLexer.cc0100644006314600127310000000237510055635554017071 0ustar angusgbhtdig// // BooleanLexer.cc // // BooleanLexer: lexical analyzer for boolean query expressions. // defines terminal symbols // "word", and, or, not, near, (, ), / // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: BooleanLexer.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "BooleanLexer.h" bool BooleanLexer::IsOr() const { return current == String("or"); } bool BooleanLexer::IsAnd() const { return current == String("and"); } bool BooleanLexer::IsNot() const { return current == String("not"); } bool BooleanLexer::IsNear() const { return current == String("near"); } bool BooleanLexer::IsSlash() const { return current == String("/"); } bool BooleanLexer::IsLeftParen() const { return current == String("("); } bool BooleanLexer::IsRightParen() const { return current == String(")"); } bool BooleanLexer::IsWord() const { return !IsEnd() && !IsQuote() && !IsRightParen() && !IsLeftParen() && !IsSlash() && !IsAnd() && !IsOr() && !IsAnd() && !IsNot() && !IsNear(); } htdig-3.2.0b6/htsearch/BooleanLexer.h0100644006314600127310000000225110055635554016724 0ustar angusgbhtdig#ifndef _BooleanLexer_h_ #define _BooleanLexer_h_ // // BooleanLexer.h // // BooleanLexer: lexical analyzer for boolean query expressions. // defines terminal symbols // "word", and, or, not, near, (, ), / // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: BooleanLexer.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryLexer.h" class BooleanLexer : public QueryLexer { public: // is the current token a word? bool IsWord() const; // is the current token the 'and' keyword? bool IsAnd() const; // is the current token the 'or' keyword? bool IsOr() const; // is the current token the 'near' keyword? bool IsNear() const; // is the current token the 'not' keyword? bool IsNot() const; // is the current token the '(' sign? bool IsLeftParen() const; // is the current token the ')' sign? bool IsRightParen() const; // is the current token the '/' sign? bool IsSlash() const; }; #endif htdig-3.2.0b6/htsearch/BooleanQueryParser.cc0100644006314600127310000000674310055635554020277 0ustar angusgbhtdig// // BooleanQueryParser.cc // // BooleanQueryParser: Query parser for full-blown boolean expressions // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: BooleanQueryParser.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "BooleanQueryParser.h" #include "OrQuery.h" #include "NotQuery.h" #include "AndQuery.h" #include "NearQuery.h" #include "PhraseQuery.h" #include "FuzzyExpander.h" // // expr == andlist ( 'or' andlist ) // Query * BooleanQueryParser::ParseExpression() { Query *result = 0; Query *term = ParseAnd(); if(term) { if(token.IsOr()) { result = new OrQuery; result->Add(term); while(term && token.IsOr()) { token.Next(); term = ParseAnd(); if(term) { result->Add(term); } } } else { result = term; } } if(!term && result) { delete result; result = 0; } return result; } // // notlist = nearlist { 'not' nearlist } // Query * BooleanQueryParser::ParseNot() { Query *result = 0; Query *near = ParseNear(); if(near) { if(token.IsNot()) { result = new NotQuery(); result->Add(near); while(near && token.IsNot()) { token.Next(); near = ParseNear(); if(near) { result->Add(near); } } } else { result = near; } } if(!near && result) { delete result; result = 0; } return result; } // // andlist = notlist { 'and' notlist } // Query * BooleanQueryParser::ParseAnd() { Query *result = 0; Query *notList = ParseNot(); if(notList) { if(token.IsAnd()) { result = new AndQuery(); result->Add(notList); while(notList && token.IsAnd()) { token.Next(); notList = ParseNot(); if(notList) { result->Add(notList); } } } else { result = notList; } } if(!notList && result) { delete result; result = 0; } return result; } // // near == factor { 'near' [ '/' number ] factor } // 'near' query is binary // Query * BooleanQueryParser::ParseNear() { Query *result = ParseFactor(); while(result && token.IsNear()) { token.Next(); int distance = 10; // config["default_near_distance"]; if(token.IsSlash()) { distance = 0; token.Next(); if(token.IsWord()) { distance = token.Value().as_integer(); token.Next(); } } if(distance > 0) { Query *right = ParseFactor(); if(right) { Query *tmp = new NearQuery(distance); tmp->Add(result); tmp->Add(right); result = tmp; } else { delete result; result = 0; } } else { Expected("a distance > 0 for 'Near'"); delete result; result = 0; } } return result; } // // factor == word | '"' phrase '"' | '(' expression ')' // Query * BooleanQueryParser::ParseFactor() { Query *result = 0; if(token.IsWord()) { result = ParseWord(); } else if(token.IsQuote()) { token.Next(); result = ParsePhrase(); if(result) { if(token.IsQuote()) { token.Next(); } else { Expected("closing \""); delete result; result = 0; } } } else if(token.IsLeftParen()) { token.Next(); result = ParseExpression(); if(result) { if(token.IsRightParen()) { token.Next(); } else { Expected(")"); delete result; result = 0; } } } else { Expected("'(', '\"', or a word"); } return result; } htdig-3.2.0b6/htsearch/BooleanQueryParser.h0100644006314600127310000000176010055635554020133 0ustar angusgbhtdig#ifndef _BooleanQueryParser_h_ #define _BooleanQueryParser_h_ // // BooleanQueryParser.h // // BooleanQueryParser: Query parser for full-blown boolean expressions // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: BooleanQueryParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryParser.h" #include "BooleanLexer.h" class BooleanQueryParser : public QueryParser { public: BooleanQueryParser() {} ~BooleanQueryParser() {} private: // recursive parse levels // returning constructed query trees Query *ParseExpression(); Query *ParseAnd(); Query *ParseNot(); Query *ParseNear(); Query *ParseFactor(); // lexer access needed by parent class QueryLexer &Token() { return token; } // the lexical analyzer BooleanLexer token; }; #endif htdig-3.2.0b6/htsearch/Collection.cc0100644006314600127310000000376210055635554016606 0ustar angusgbhtdig// // Collection.cc // // Collection: Specifies a list of databases to use in the search // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Collection.cc,v 1.7 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htsearch.h" #include "Collection.h" #include "ResultMatch.h" #include "WeightWord.h" #include "StringMatch.h" #include "QuotedStringList.h" #include "URL.h" #include "HtURLCodec.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include //***************************************************************************** // Collection::Collection(const char *name, const char *word_file, const char *index_file, const char *doc_file, const char *doc_excerpt) { collectionName = name; wordFile = word_file; indexFile = index_file; docFile = doc_file; docExcerpt = doc_excerpt; matches = NULL; searchWords = NULL; searchWordsPattern = NULL; isopen = 0; } Collection::~Collection() { if(matches) delete matches; if(searchWords) delete searchWords; if(searchWordsPattern) delete searchWordsPattern; Close(); } void Collection::Open() { if (!isopen) { docDB.Read(docFile, indexFile, docExcerpt); } isopen = 1; } void Collection::Close() { if (isopen) { docDB.Close(); } isopen = 0; } DocumentRef * Collection::getDocumentRef(int id) { Open(); return docDB[id]; } int Collection::ReadExcerpt(DocumentRef &ref) { Open(); return docDB.ReadExcerpt(ref); } htdig-3.2.0b6/htsearch/Collection.h0100644006314600127310000000404510055635554016443 0ustar angusgbhtdig// // Collection.h // // Collection: Specifies a list of databases to use in the search // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Collection.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifndef _Collection_h_ #define _Collection_h_ #include "Object.h" #include "ResultList.h" #include "ResultMatch.h" #include "TemplateList.h" #include "cgi.h" #include "StringMatch.h" #include "List.h" #include "DocumentDB.h" #include "Database.h" #include "Dictionary.h" class Collection : public Object { public: // // Construction/Destruction // Collection(const char *name, const char *wordFile, const char *indexFile, const char *docFile, const char *docExcerpt); ~Collection(); void Collection::Open(); void Collection::Close(); char *getWordFile() { return wordFile.get(); } DocumentRef *getDocumentRef(int id); ResultList *getResultList() { return matches; } void setResultList(ResultList *list) { matches = list; } List *getSearchWords() { return searchWords; } void setSearchWords(List *list) { searchWords = list; } StringMatch *getSearchWordsPattern() { return searchWordsPattern;} void setSearchWordsPattern(StringMatch *smatch) { searchWordsPattern = smatch; } int ReadExcerpt(DocumentRef &ref); protected: String collectionName; String wordFile; String indexFile; String docFile; String docExcerpt; ResultList *matches; List *searchWords; StringMatch *searchWordsPattern; DocumentDB docDB; // Database *docIndex; int isopen; }; #endif // _Collection_h_ htdig-3.2.0b6/htsearch/Display.cc0100644006314600127310000015474710055635554016132 0ustar angusgbhtdig// // Display.cc // // Display: Takes results of search and fills in the HTML templates // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Display.cc,v 1.122 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htsearch.h" #include "Display.h" #include "ResultMatch.h" #include "WeightWord.h" #include "StringMatch.h" #include "QuotedStringList.h" #include "URL.h" #include "HtSGMLCodec.h" #include "HtURLCodec.h" #include "HtURLRewriter.h" #include "WordType.h" #include "Collection.h" #include "HtURLSeedScore.h" //#include "HtURLRewriter.h" #include "SplitMatches.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include // for abs #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include #include #include #if !defined(DBL_MAX) # if defined (MAXDOUBLE) # define DBL_MAX MAXDOUBLE # elif defined(HUGE_VAL) # define DBL_MAX HUGE_VAL # elif defined(MAXFLOAT) # define DBL_MAX MAXFLOAT # else # define DBL_MAX 1e37 # endif #endif //***************************************************************************** // Display::Display(Dictionary *collections) { HtConfiguration* config= HtConfiguration::config(); selected_collections = collections; limitTo = 0; excludeFrom = 0; // needExcerpt = 0; templateError = 0; maxStars = config->Value("max_stars"); maxScore = -DBL_MAX; minScore = DBL_MAX; setupImages(); setupTemplates(); if (!templates.createFromString(config->Find("template_map"))) { // Error in createFromString. // Let's try the default template_map config->Add("template_map", "Long builtin-long builtin-long Short builtin-short builtin-short"); if (!templates.createFromString(config->Find("template_map"))) { // Unrecoverable Error // (No idea why this would happen) templateError = 1; } } currentTemplate = templates.get(config->Find("template_name")); if (!currentTemplate) { // // Must have been some error. Resort to the builtin-long (slot 0) // currentTemplate = (Template *) templates.templates[0]; } if (!currentTemplate) { // // Another error!? Time to bail out... // templateError = 1; } // if (mystrcasestr(currentTemplate->getMatchTemplate(), "excerpt")) // needExcerpt = 1; } //***************************************************************************** Display::~Display() { // docDB.Close(); } //***************************************************************************** // void Display::display(int pageNumber) { HtConfiguration* config= HtConfiguration::config(); int good_sort = 0; good_sort = ResultMatch::setSortType(config->Find("sort")); if (!good_sort) { // Must temporarily stash the message in a String, since // displaySyntaxError will overwrite the static temp used in form. String s(form("No such sort method: `%s'", (const char*)config->Find("sort"))); displaySyntaxError(s); return; } List *matches = buildMatchList(); int currentMatch = 0; int numberDisplayed = 0; ResultMatch *match = 0; int number = 0; number = config->Value("matches_per_page"); if (number <= 0) number = 10; int startAt = (pageNumber - 1) * number; if (config->Boolean("logging")) { logSearch(pageNumber, matches); } displayHTTPheaders(); setVariables(pageNumber, matches); // // The first match is guaranteed to have the highest score of // all the matches. We use this to compute the number of stars // to display for all the other matches. // match = (ResultMatch *) (*matches)[0]; if (!match) { // // No matches. // delete matches; // if( config->Boolean("nph") ) cout << "HTTP/1.0 200 OK\r\n"; // cout << "Content-type: text/html\r\n\r\n"; displayNomatch(); return; } // maxScore = match->getScore(); // now done in buildMatchList() // if( config->Boolean("nph") ) cout << "HTTP/1.0 200 OK\r\n"; // cout << "Content-type: text/html\r\n\r\n"; String wrap_file = config->Find("search_results_wrapper"); String *wrapper = 0; char *header = 0, *footer = 0; if (wrap_file.length()) { wrapper = readFile(wrap_file.get()); if (wrapper && wrapper->length()) { char wrap_sepr[] = "HTSEARCH_RESULTS"; char *h = wrapper->get(); char *p = strstr(h, wrap_sepr); if (p) { if (p > h && p[-1] == '$') { footer = p + strlen(wrap_sepr); header = h; p[-1] = '\0'; } else if (p > h+1 && p[-2] == '$' && (p[-1] == '(' || p[-1] == '{') && (p[strlen(wrap_sepr)] == ')' || p[strlen(wrap_sepr)] == '}')) { footer = p + strlen(wrap_sepr) + 1; header = h; p[-2] = '\0'; } } } } if (header) expandVariables(header); else displayHeader(); // // Display the window of matches requested. // if (!currentTemplate->getStartTemplate().empty()) { expandVariables(currentTemplate->getStartTemplate()); } matches->Start_Get(); while ((match = (ResultMatch *)matches->Get_Next()) && numberDisplayed < number) { if (currentMatch >= startAt) { // DocumentRef *ref = docDB[match->getID()]; Collection *collection = match->getCollection(); DocumentRef *ref = collection->getDocumentRef(match->getID()); if (!ref || ref->DocState() != Reference_normal) continue; // The document isn't present or shouldn't be displayed ref->DocAnchor(match->getAnchor()); ref->DocScore(match->getScore()); displayMatch(match, ref, currentMatch+1); numberDisplayed++; delete ref; } currentMatch++; } if (!currentTemplate->getEndTemplate().empty()) { expandVariables(currentTemplate->getEndTemplate()); } if (footer) expandVariables(footer); else displayFooter(); if (wrapper) delete wrapper; delete matches; } //***************************************************************************** // Return true if the specified URL should be counted towards the results. int Display::includeURL(const String& url) { if (limitTo && limitTo->match(url, 1, 0) == 0) return 0; else { if (excludeFrom && excludeFrom->match(url, 0, 0) != 0) return 0; else return 1; } } //***************************************************************************** void Display::displayMatch(ResultMatch *match, DocumentRef *ref, int current) { HtConfiguration* config= HtConfiguration::config(); String *str = 0; char *coded_url = ref->DocURL(); String url = HtURLCodec::instance()->decode(coded_url); HtURLRewriter::instance()->replace(url); ref->DocURL(url.get()); // for star_patterns & template_patterns match vars.Add("URL", new String(url.get())); vars.Remove("ANCHOR"); // get rid of any previous setting int iA = ref->DocAnchor(); String *anchor = 0; int fanchor = 0; if (iA > 0) // if an anchor was found { List *anchors = ref->DocAnchors(); if (anchors->Count() >= iA) { anchor = new String(); fanchor = 1; *anchor << "#" << ((String*) (*anchors)[iA-1])->get(); vars.Add("ANCHOR", anchor); } } // // no condition for determining excerpt any more: // we need it anyway to see if an anchor is relevant // int first = -1; String urlanchor(url); if (anchor) urlanchor << anchor; vars.Add("EXCERPT", excerpt(match, ref, urlanchor, fanchor, first)); // // anchor only relevant if an excerpt was found, i.e., // the search expression matches the body of the document // instead of only META keywords. // if (first < 0) { vars.Remove("ANCHOR"); } vars.Add("METADESCRIPTION", new String(ref->DocMetaDsc())); vars.Add("SCORE", new String(form("%f", ref->DocScore()))); vars.Add("CURRENT", new String(form("%d", current))); char *title = ref->DocTitle(); if (!title || !*title) { if ( strcmp(config->Find("no_title_text"), "filename") == 0 ) { // use actual file name title = strrchr(url.get(), '/'); if (title) { title++; // Skip slash str = new String(form("[%s]", title)); decodeURL(*str); // convert %20 to space, etc } else // URL without '/' ?? str = new String("[No title]"); } else // use configure 'no title' text str = new String(config->Find("no_title_text")); } else str = new String(title); vars.Add("TITLE", str); vars.Add("STARSRIGHT", generateStars(ref, 1)); vars.Add("STARSLEFT", generateStars(ref, 0)); vars.Add("SIZE", new String(form("%d", ref->DocSize()))); vars.Add("SIZEK", new String(form("%d", (ref->DocSize() + 1023) / 1024))); if (maxScore != 0 && maxScore != minScore) { int percent = (int)((ref->DocScore() - minScore) * 100 / (maxScore - minScore)); if (percent <= 0) percent = 1; vars.Add("PERCENT", new String(form("%d", percent))); } else vars.Add("PERCENT", new String("100")); { str = new String(); char buffer[100]; time_t t = ref->DocTime(); if (t) { struct tm *tm = localtime(&t); String datefmt = config->Find("date_format"); const String locale = config->Find("locale"); if (datefmt.empty()) { if (config->Boolean("iso_8601")) datefmt = "%Y-%m-%d %H:%M:%S %Z"; else datefmt = "%x"; } if (!locale.empty()) { setlocale(LC_TIME,locale); } strftime(buffer, sizeof(buffer), (char*)datefmt, tm); *str << buffer; } vars.Add("MODIFIED", str); } vars.Add("HOPCOUNT", new String(form("%d", ref->DocHopCount()))); vars.Add("DOCID", new String(form("%d", ref->DocID()))); vars.Add("BACKLINKS", new String(form("%d", ref->DocBackLinks()))); { str = new String(); List *list = ref->Descriptions(); int n = list->Count(); for (int i = 0; i < n; i++) { *str << ((String*) (*list)[i])->get() << "
    "; } vars.Add("DESCRIPTIONS", str); String *description = new String(); if (list->Count()) *description << ((String*) (*list)[0]); vars.Add("DESCRIPTION", description); } int index = 0; int length = 0; int status = -1; if (URLtemplate.hasPattern()) status = URLtemplate.FindFirst(ref->DocURL(), index, length); if (status >= 0 && index >= 0) displayParsedFile( ((String*) URLtemplateList[index])->get() ); else expandVariables(currentTemplate->getMatchTemplate()); } //***************************************************************************** void Display::setVariables(int pageNumber, List *matches) { HtConfiguration* config= HtConfiguration::config(); String tmp; int i; int nMatches = 0; if (matches) nMatches = matches->Count(); int matchesPerPage = config->Value("matches_per_page"); if (matchesPerPage <= 0) matchesPerPage = 10; int nPages = (nMatches + matchesPerPage - 1) / matchesPerPage; if (nPages > config->Value("maximum_pages", 10)) nPages = config->Value("maximum_pages", 10); if (nPages < 1) nPages = 1; // We always have at least one page... vars.Add("MATCHES_PER_PAGE", new String(config->Find("matches_per_page"))); vars.Add("MAX_STARS", new String(config->Find("max_stars"))); vars.Add("CONFIG", new String(config->Find("config"))); vars.Add("VERSION", new String(config->Find("version"))); vars.Add("RESTRICT", new String(config->Find("restrict"))); vars.Add("EXCLUDE", new String(config->Find("exclude"))); vars.Add("KEYWORDS", new String(config->Find("keywords"))); vars.Add("MATCHES", new String(form("%d", nMatches))); vars.Add("PLURAL_MATCHES", new String((nMatches == 1) ? (char *)"" : (const char *) config->Find("plural_suffix"))); vars.Add("PAGE", new String(form("%d", pageNumber))); vars.Add("PAGES", new String(form("%d", nPages))); vars.Add("FIRSTDISPLAYED", new String(form("%d", (pageNumber - 1) * matchesPerPage + 1))); if (nPages > 1) vars.Add("PAGEHEADER", new String(config->Find("page_list_header"))); else vars.Add("PAGEHEADER", new String(config->Find("no_page_list_header"))); i = pageNumber * matchesPerPage; if (i > nMatches) i = nMatches; vars.Add("LASTDISPLAYED", new String(form("%d", i))); if (config->Find("script_name").length() != 0) { vars.Add("CGI", new String(config->Find("script_name"))); } else { vars.Add("CGI", new String(getenv("SCRIPT_NAME"))); } vars.Add("STARTYEAR", new String(config->Find("startyear"))); vars.Add("STARTMONTH", new String(config->Find("startmonth"))); vars.Add("STARTDAY", new String(config->Find("startday"))); vars.Add("ENDYEAR", new String(config->Find("endyear"))); vars.Add("ENDMONTH", new String(config->Find("endmonth"))); vars.Add("ENDDAY", new String(config->Find("endday"))); String *str; char *format = input->get("format"); String *in; vars.Add("SELECTED_FORMAT", new String(format)); str = new String(); *str << "\n"; vars.Add("FORMAT", str); str = new String(); tmp = config->Find("match_method"); vars.Add("SELECTED_METHOD", new String(tmp)); QuotedStringList ml(config->Find("method_names"), " \t\r\n"); *str << "\n"; vars.Add("METHOD", str); ////////////////// Multiple database support ////////////////////// // Emit collection table. Ensure that previously selected collections // are "checked". // Collections are specified in the config file with the // "collection_names" attribute. An example of the corresponding snippet // in the config file is as follows: // // collection_names: htdig_docs htdig_bugs // // htdig_bugs and htdig_docs are the two collections (databases) and // their corresponding config files are: $CONFIG_DIR/htdig_bugs.conf and // $CONFIG_DIR/htdig_docs.conf respectively. // QuotedStringList clist(config->Find("collection_names"), " \t\r\n"); for (i =0; i < clist.Count(); i++) { String config_name = clist[i]; for (int j=0; j < collectionList.Count(); j++) { if (strcmp(config_name.get(), collectionList[j]) == 0) { str = new String(); *str << "checked"; String collection_id = "COLLECTION_"; collection_id << config_name; vars.Add(collection_id, str); break; } } } ////////////////// Multiple database support ////////////////////// str = new String(); QuotedStringList sl(config->Find("sort_names"), " \t\r\n"); const String st = config->Find("sort"); StringMatch datetime; datetime.IgnoreCase(); datetime.Pattern("date|time"); *str << "\n"; vars.Add("SORT", str); vars.Add("SELECTED_SORT", new String(st)); // Handle user-defined select lists. // Uses octuples containing these values: // // // e.g.: // METHOD_LIST method method_names 2 1 2 match_method "" // FORMAT_LIST format template_map 3 2 1 template_name "" // EXCLUDE_LIST exclude exclude_names 2 1 2 exclude "" // MATCH_LIST matchesperpage matches_per_page_list 1 1 1 // matches_per_page "Previous Amount" QuotedStringList builds(config->Find("build_select_lists"), " \t\r\n"); for (int b = 0; b <= builds.Count()-8; b += 8) { int ntuple = atoi(builds[b+3]); int ivalue = atoi(builds[b+4]); int ilabel = atoi(builds[b+5]); int nsel = 0; int mult = 0, asinput = 0; const char *cp; char sepc = '\001'; String currval; String pre, post; QuotedStringList nameopt(builds[b], ",", 1); QuotedStringList namelist(config->Find(builds[b+2]), " \t\r\n"); if (ntuple > 0 && ivalue > 0 && ivalue <= ntuple && ilabel > 0 && ilabel <= ntuple && namelist.Count() % ntuple == 0 && nameopt.Count() > 0) { if (strcmp(builds[b+1], "restrict") == 0 || strcmp(builds[b+1], "exclude") == 0) sepc = '|'; if (nameopt.Count() == 1) ; // default is single select else if (mystrcasecmp(nameopt[1], "multiple") == 0) mult = 1; else if (mystrcasecmp(nameopt[1], "radio") == 0) asinput = 1; else if (mystrcasecmp(nameopt[1], "checkbox") == 0) { mult = 1; asinput = 1; } if (nameopt.Count() > 2) pre = nameopt[2]; else pre = ""; if (nameopt.Count() > 3) post = nameopt[3]; else post = ""; str = new String(); if (!asinput) { *str << "get(builds[b+1]) << "\" checked>" << builds[b+7] << post << '\n'; else *str << pre << "get(builds[b+1]) << "\" checked>" << builds[b+7] << post << '\n'; } if (!asinput) *str << "\n"; vars.Add(nameopt[0], str); } } // // If a paged output is required, set the appropriate variables // if (nPages > 1) { if (pageNumber > 1) { str = new String("" << config->Find("prev_page_text") << ""; } else { str = new String(config->Find("no_prev_page_text")); } vars.Add("PREVPAGE", str); if (pageNumber < nPages) { str = new String("" << config->Find("next_page_text") << ""; } else { str = new String(config->Find("no_next_page_text")); } vars.Add("NEXTPAGE", str); str = new String(); char *p; QuotedStringList pnt(config->Find("page_number_text"), " \t\r\n"); QuotedStringList npnt(config->Find("no_page_number_text"), " \t\r\n"); QuotedStringList sep(config->Find("page_number_separator"), " \t\r\n"); if (nPages > config->Value("maximum_page_buttons", 10)) nPages = config->Value("maximum_page_buttons", 10); for (i = 1; i <= nPages; i++) { if (i == pageNumber) { p = npnt[i - 1]; if (!p) p = form("%d", i); *str << p; } else { p = pnt[i - 1]; if (!p) p = form("%d", i); *str << "" << p << ""; } if (i != nPages && sep.Count() > 0) *str << sep[(i-1)%sep.Count()]; else if (i != nPages && sep.Count() <= 0) *str << " "; } vars.Add("PAGELIST", str); } StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); String* key; for (i= 0; i < form_vars.Count(); i++) { if(!config->Find(form_vars[i]).empty()) { key= new String(form_vars[i]); key->uppercase(); vars.Add(key->get(), new String(config->Find(form_vars[i]))); } } } //***************************************************************************** void Display::createURL(String &url, int pageNumber) { HtConfiguration* config= HtConfiguration::config(); String s; int i; #define encodeInput(name) (s = input->get(name), encodeURL(s), s.get()) if (!config->Find("script_name").empty()) { url << config->Find("script_name"); } else { url << getenv("SCRIPT_NAME"); } url << '?'; if (input->exists("restrict")) url << "restrict=" << encodeInput("restrict") << ';'; if (input->exists("exclude")) url << "exclude=" << encodeInput("exclude") << ';'; // Not needed: The next loop below handles this output //if (input->exists("config")) // url << "config=" << encodeInput("config") << ';'; // Put out all specified collections. If none selected, resort to // default behaviour. char *config_name = collectionList[0]; String config_encoded; if (config_name && config_name[0] == '\0') config_name = NULL; if (config_name) { for (i = 0; i < collectionList.Count(); i++) { config_name = collectionList[i]; config_encoded = config_name; encodeURL(config_encoded); url << "config=" << config_encoded << ';'; } } if (input->exists("method")) url << "method=" << encodeInput("method") << ';'; if (input->exists("format")) url << "format=" << encodeInput("format") << ';'; if (input->exists("sort")) url << "sort=" << encodeInput("sort") << ';'; if (input->exists("matchesperpage")) url << "matchesperpage=" << encodeInput("matchesperpage") << ';'; if (input->exists("keywords")) url << "keywords=" << encodeInput("keywords") << ';'; if (input->exists("words")) url << "words=" << encodeInput("words") << ';'; if (input->exists("startyear")) url << "startyear=" << encodeInput("startyear") << ';'; if (input->exists("startmonth")) url << "startmonth=" << encodeInput("startmonth") << ';'; if (input->exists("startday")) url << "startday=" << encodeInput("startday") << ';'; if (input->exists("endyear")) url << "endyear=" << encodeInput("endyear") << ';'; if (input->exists("endmonth")) url << "endmonth=" << encodeInput("endmonth") << ';'; if (input->exists("endday")) url << "endday=" << encodeInput("endday") << ';'; StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); for (i= 0; i < form_vars.Count(); i++) { if (input->exists(form_vars[i])) { s = form_vars[i]; encodeURL(s); // shouldn't be needed, but just in case url << s << '='; url << encodeInput(form_vars[i]) << ';'; } } url << "page=" << pageNumber; } //***************************************************************************** void Display::displayHTTPheaders() { HtConfiguration* config= HtConfiguration::config(); String content_type = config->Find("search_results_contenttype"); if (config->Boolean("nph")) cout << "HTTP/1.0 200 OK\r\n"; if (content_type.length()) cout << "Content-type: " << content_type << "\r\n\r\n"; } //***************************************************************************** void Display::displayHeader() { HtConfiguration* config= HtConfiguration::config(); displayParsedFile(config->Find("search_results_header")); } //***************************************************************************** void Display::displayFooter() { HtConfiguration* config= HtConfiguration::config(); displayParsedFile(config->Find("search_results_footer")); } //***************************************************************************** void Display::displayNomatch() { HtConfiguration* config= HtConfiguration::config(); displayParsedFile(config->Find("nothing_found_file")); } //***************************************************************************** void Display::displaySyntaxError(const String& message) { HtConfiguration* config= HtConfiguration::config(); displayHTTPheaders(); setVariables(0, 0); vars.Add("SYNTAXERROR", new String(message)); displayParsedFile(config->Find("syntax_error_file")); } //***************************************************************************** void Display::displayParsedFile(const String& filename) { FILE *fl = fopen(filename, "r"); char buffer[1000]; while (fl && fgets(buffer, sizeof(buffer), fl)) { expandVariables(buffer); } if (fl) fclose(fl); else if (debug) cerr << "displayParsedFile: Can't open " << filename << endl; } //***************************************************************************** // If the result templates need to depend on the URL of the match, we need // an efficient way to determine which template file to use. To do this, we // will build a StringMatch object with all the URL patterns and also // a List parallel to that pattern that contains the actual template file // names to use for each URL. // void Display::setupTemplates() { HtConfiguration* config= HtConfiguration::config(); String templatePatterns = config->Find("template_patterns"); if (!templatePatterns.empty()) { // // The templatePatterns string will have pairs of values. The first // value of a pair will be a pattern, the second value will be a // result template file name. // char *token = strtok(templatePatterns, " \t\r\n"); String pattern; while (token) { // // First token is a pattern... // pattern << token << '|'; // // Second token is an URL // token = strtok(0, " \t\r\n"); URLtemplateList.Add(new String(token)); if (token) token = strtok(0, " \t\r\n"); } pattern.chop(1); URLtemplate.Pattern(pattern); } } //***************************************************************************** // If the star images need to depend on the URL of the match, we need // an efficient way to determine which image to use. To do this, we // will build a StringMatch object with all the URL patterns and also // a List parallel to that pattern that contains the actual images to // use for each URL. // void Display::setupImages() { HtConfiguration* config= HtConfiguration::config(); String starPatterns = config->Find("star_patterns"); if (!starPatterns.empty()) { // // The starPatterns string will have pairs of values. The first // value of a pair will be a pattern, the second value will be an // URL to an image. // char *token = strtok(starPatterns, " \t\r\n"); String pattern; while (token) { // // First token is a pattern... // pattern << token << '|'; // // Second token is an URL // token = strtok(0, " \t\r\n"); URLimageList.Add(new String(token)); if (token) token = strtok(0, " \t\r\n"); } pattern.chop(1); URLimage.Pattern(pattern); } } //***************************************************************************** String * Display::generateStars(DocumentRef *ref, int right) { int i; String *result = new String(); HtConfiguration* config= HtConfiguration::config(); if (!config->Boolean("use_star_image", 1)) return result; String image = config->Find("star_image"); const String blank = config->Find("star_blank"); double score; if (maxScore != 0 && maxScore != minScore) { score = (ref->DocScore() - minScore) / (maxScore - minScore); if(debug) cerr << "generateStars: doc, min, max " << ref->DocScore() << ", " << minScore << ", " << maxScore <DocScore(); score = 1; } int nStars = int(score * (maxStars - 1) + 0.5) + 1; vars.Add("NSTARS", new String(form("%.d", nStars))); if(debug) cerr << "generateStars: nStars " << nStars << " of " << maxStars <"; } } int match = 0; int length = 0; int status; if (URLimage.hasPattern()) status = URLimage.FindFirst(ref->DocURL(), match, length); else status = -1; if (status >= 0 && match >= 0) { image = ((String*) URLimageList[match])->get(); } for (i = 0; i < nStars; i++) { *result << "\"*\""; } if (!right) { for (i = 0; i < maxStars - nStars; i++) { *result << "\""; } } return result; } //***************************************************************************** String * Display::readFile(const String& filename) { FILE *fl; String *s = new String(); char line[1024]; fl = fopen(filename, "r"); while (fl && fgets(line, sizeof(line), fl)) { *s << line; } if (fl) fclose(fl); else if (debug) cerr << "readFile: Can't open " << filename << endl; return s; } //***************************************************************************** void Display::expandVariables(const String& str_arg) { const char* str = str_arg; enum { StStart, StLiteral, StVarStart, StVarClose, StVarPlain, StGotVar } state = StStart; String var = ""; while (str && *str) { switch (state) { case StStart: if (*str == '\\') state = StLiteral; else if (*str == '$') state = StVarStart; else cout << *str; break; case StLiteral: cout << *str; state = StStart; break; case StVarStart: if (*str == '%' || *str == '=') var << *str; // code for URL-encoded/decoded variable else if (*str == '&') { var << *str; // code for SGML-encoded variable if (mystrncasecmp("&", str, 5) == 0) str += 4; } else if (*str == '(' || *str == '{') state = StVarClose; else if (isalnum(*str) || *str == '_' || *str == '-') { var << *str; state = StVarPlain; } else state = StStart; break; case StVarClose: if (*str == ')' || *str == '}') state = StGotVar; else if (isalnum(*str) || *str == '_' || *str == '-') var << *str; else state = StStart; break; case StVarPlain: if (isalnum(*str) || *str == '_' || *str == '-') var << *str; else { state = StGotVar; continue; } break; case StGotVar: // // We have a complete variable in var. Look it up and // see if we can find a good replacement for it. // outputVariable(var); var = ""; state = StStart; continue; } str++; } if (state == StGotVar || state == StVarPlain) { // // The end of string was reached, but we are still trying to // put a variable together. Since we now have a complete // variable, we will look up the value for it. // outputVariable(var); } } //***************************************************************************** void Display::outputVariable(const String& var) { String *temp; String value = ""; const char *ev, *name; // We have a complete variable name in var. Look it up and // see if we can find a good replacement for it, either in our // vars dictionary or in the environment variables. name = var; while (*name == '&' || *name == '%' || *name == '=') name++; temp = (String *) vars[name]; if (temp) value = *temp; else { ev = getenv(name); if (ev) value = ev; } while (--name >= var.get() && value.length()) { if (*name == '%') encodeURL(value); else if(*name == '&') value = HtSGMLCodec::instance()->decode(value); else // (*name == '=') decodeURL(value); } cout << value; } //***************************************************************************** List * Display::buildMatchList() { HtConfiguration* config= HtConfiguration::config(); char *cpid; String url; ResultMatch *thisMatch; SplitMatches matches(*config); double backlink_factor = config->Double("backlink_factor"); double date_factor = config->Double("date_factor"); double backlink_score = 0; double date_score = 0; double base_score = 0; // Additions made here by Mike Grommet ... tm startdate; // structure to hold the startdate specified by the user tm enddate; // structure to hold the enddate specified by the user time_t now = time((time_t *)0); // fill in all fields for mktime tm *lt = localtime(&now); // - Gilles's fix startdate = *lt; enddate = *lt; time_t eternity = ~(1<<(sizeof(time_t)*8-1)); // will be the largest value holdable by a time_t tm endoftime; // the time_t eternity will be converted into a tm, held by this variable time_t timet_startdate; time_t timet_enddate; int monthdays[] = {31,28,31,30,31,30,31,31,30,31,30,31}; // boolean to test to see if we need to build date information or not int dategiven = ((config->Value("startmonth")) || (config->Value("startday")) || (config->Value("startyear")) || (config->Value("endmonth")) || (config->Value("endday")) || (config->Value("endyear"))); // find the end of time lt = gmtime(&eternity); endoftime = *lt; if(dategiven) // user specified some sort of date information { int reldate = ((config->Value("startmonth") < 0) || (config->Value("startday") < 0) || (config->Value("startyear") < 0)); int t; // set up the startdate structure // see man mktime for details on the tm structure startdate.tm_sec = 0; startdate.tm_min = 0; startdate.tm_hour = 0; startdate.tm_yday = 0; startdate.tm_wday = 0; // The concept here is that if a user did not specify a part of a date, // then we will make assumtions... // For instance, suppose the user specified Feb, 1999 as the start // range, we take steps to make sure that the search range date starts // at Feb 1, 1999, // along these same lines: (these are in MM-DD-YYYY format) // Startdates: Date Becomes // 01-01 01-01-1970 // 01-1970 01-01-1970 // 04-1970 04-01-1970 // 1970 01-01-1970 // These things seem to work fine for start dates, as all months have // the same first day however the ending date can't work this way. if(config->Value("startday")) // form input specified a start day { t = config->Value("startday"); if (t < 0) { time_t then = now + (t * (24*60*60)); lt = localtime(&then); startdate.tm_mday = lt->tm_mday; startdate.tm_mon = lt->tm_mon; startdate.tm_year = lt->tm_year; } else startdate.tm_mday = t; // tm days are 1 based, they are passed in as 1 based } else if (!reldate) startdate.tm_mday = 1; // otherwise, no start day, default to 1 if(config->Value("startmonth")) // form input specified a start month { t = config->Value("startmonth"); if (t < 0) startdate.tm_mon += t; else startdate.tm_mon = t - 1; // tm months are zero based. They are passed in as 1 based while (startdate.tm_mon < 0) { startdate.tm_mon += 12; startdate.tm_year--; } } else if (!reldate) startdate.tm_mon = 0; // otherwise, no start month, default to 0 // year is handled a little differently... the tm_year structure // wants the tm_year in a format of year - 1900. // since we are going to convert these dates to a time_t, // a time_t value of zero, the earliest possible date // occurs Jan 1, 1970. If we allow dates < 1970, then we // could get negative time_t values right??? // (barring minor timezone offsets west of GMT, where Epoch is 12-31-69) if(config->Value("startyear")) // form input specified a start year { t = config->Value("startyear"); if (t < 0) startdate.tm_year += t; else { startdate.tm_year = config->Value("startyear") - 1900; if (startdate.tm_year < 69-1900) // correct for 2-digit years 00-68 startdate.tm_year += 2000; // - Gilles's fix if (startdate.tm_year < 0) // correct for 2-digit years 69-99 startdate.tm_year += 1900; } } else if (!reldate) startdate.tm_year = 1970-1900; // otherwise, no start day, specify start at 1970 reldate = ((config->Value("endmonth") < 0) || (config->Value("endday") < 0) || (config->Value("endyear") < 0)); // set up the enddate structure enddate.tm_sec = 59; // allow up to last second of end day enddate.tm_min = 59; // - Gilles's fix enddate.tm_hour = 23; enddate.tm_yday = 0; enddate.tm_wday = 0; if(config->Value("endday") < 0) // form input specified relative end day { // relative end day must be done before month or year t = config->Value("endday"); time_t then = now + (t * (24*60*60)); lt = localtime(&then); enddate.tm_mday = lt->tm_mday; enddate.tm_mon = lt->tm_mon; enddate.tm_year = lt->tm_year; } if(config->Value("endmonth")) // form input specified an end month { t = config->Value("endmonth"); if (t < 0) enddate.tm_mon += t; else enddate.tm_mon = t - 1; // tm months are zero based. They are passed in as 1 based while (enddate.tm_mon < 0) { enddate.tm_mon += 12; enddate.tm_year--; } } else if (!reldate) enddate.tm_mon = 11; // otherwise, no end month, default to 11 if(config->Value("endyear")) // form input specified a end year { t = config->Value("endyear"); if (t < 0) enddate.tm_year += t; else { enddate.tm_year = config->Value("endyear") - 1900; if (enddate.tm_year < 69-1900) // correct for 2-digit years 00-68 enddate.tm_year += 2000; // - Gilles's fix if (enddate.tm_year < 0) // correct for 2-digit years 69-99 enddate.tm_year += 1900; } } else if (!reldate) enddate.tm_year = endoftime.tm_year; // otherwise, no end year, specify end at the end of time allowable // Months have different number of days, and this makes things more // complicated than the startdate range. // Following the example above, here is what we want to happen: // Enddates: Date Becomes // 04-31 04-31-endoftime.tm_year // 05-1999 05-31-1999, may has 31 days... we want to search until the end of may so... // 1999 12-31-1999, search until the end of the year if(config->Value("endday") > 0) // form input specified an end day { enddate.tm_mday = config->Value("endday"); // tm days are 1 based, they are passed in as 1 based } else if (!reldate) { // otherwise, no end day, default to the end of the month enddate.tm_mday = monthdays[enddate.tm_mon]; if (enddate.tm_mon == 1) // February, so check for leap year if (((enddate.tm_year+1900) % 4 == 0 && (enddate.tm_year+1900) % 100 != 0) || (enddate.tm_year+1900) % 400 == 0) enddate.tm_mday += 1; // Feb. 29 - Gilles's fix } // Convert the tm values into time_t values. // Web servers specify modification times in GMT, but htsearch // displays these modification times in the server's local time zone. // For consistency, we would prefer to select based on this same // local time zone. - Gilles's fix timet_startdate = mktime(&startdate); timet_enddate = mktime(&enddate); // I'm not quite sure what behavior I want to happen if // someone reverses the start and end dates, and one of them is invalid. // for now, if there is a completely invalid date on the start or end // date, I will force the start date to time_t 0, and the end date to // the maximum that can be handled by a time_t. if(timet_startdate < 0) timet_startdate = 0; if(timet_enddate < 0) timet_enddate = eternity; // what if the user did something really goofy like choose an end date // that's before the start date if(timet_enddate < timet_startdate) // if so, then swap them so they are in order { time_t timet_temp = timet_enddate; timet_enddate = timet_startdate; timet_startdate = timet_temp; } } else // no date was specifed, so plug in some defaults { timet_startdate = 0; timet_enddate = eternity; } // ... MG URLSeedScore adjustments(*config); // If we knew where to pass it, this would be a good place to pass // on errors from adjustments.ErrMsg(). // Deal with all collections // selected_collections->Start_Get(); Collection *collection= NULL; while ((collection = (Collection *) selected_collections->Get_NextElement())) { ResultList *results = collection->getResultList(); if (results == NULL) continue; results->Start_Get(); while ((cpid = results->Get_Next())) { int id = atoi(cpid); // DocumentRef *thisRef = docDB[id]; DocMatch *dm = results->find(cpid); Collection *collection = NULL; if (dm) collection = dm->collection; if (collection == NULL) continue; DocumentRef *thisRef = collection->getDocumentRef(id); // // If it wasn't there, then ignore it // if (thisRef == 0) { continue; } url = thisRef->DocURL(); HtURLRewriter::instance()->replace(url); if (!includeURL(url.get())) { // Get rid of it to free the memory! delete thisRef; continue; } // Code added by Mike Grommet for date search ranges // check for valid date range. toss it out if it isn't relevant. if ((timet_startdate > 0 || timet_enddate < eternity) && (thisRef->DocTime() < timet_startdate || thisRef->DocTime() > timet_enddate)) { delete thisRef; continue; } thisMatch = ResultMatch::create(); thisMatch->setID(id); thisMatch->setCollection(collection); // // Assign the incomplete score to this match. This score was // computed from the word database only, no excerpt context was // known at that time, or info about the document itself, // so this still needs to be done. // // Moved up: DocMatch *dm = results->find(cpid); double score = dm->score; // We need to scale based on date relevance and backlinks // Other changes to the score can happen now // Or be calculated by the result match in getScore() // This formula derived through experimentation // We want older docs to have smaller values and the // ultimate values to be a reasonable size (max about 100) base_score = score; if (date_factor != 0.0) { // Macro for calculating the date factor (31536000 is the number of // seconds in a 365 days year). The formula gives less weight // as the distance between the date document and the current time // increases (the absolute value is for documents with future date) #define DATE_FACTOR(df, n, dd) ((df) * 100 / (1+(double)(abs((n) - (dd)) / 31536000))) date_score = DATE_FACTOR(date_factor, now, thisRef->DocTime()); score += date_score; } if (backlink_factor != 0.0) { int links = thisRef->DocLinks(); if (links == 0) links = 1; // It's a hack, but it helps... backlink_score = backlink_factor * (thisRef->DocBackLinks() / (double)links); score += backlink_score; } if (debug) { cerr << thisRef->DocURL() << "\n"; } thisMatch->setTime(thisRef->DocTime()); thisMatch->setTitle(thisRef->DocTitle()); score = adjustments.adjust_score(score, thisRef->DocURL()); score = log(1.0 + score); thisMatch->setScore(score); thisMatch->setAnchor(dm->anchor); // // Append this match to our list of matches. // if (score > 0.0) matches.Add(thisMatch, thisRef->DocURL()); // Get rid of it to free the memory! delete thisRef; if (debug) { cerr << " base_score " << base_score << " date_score " << date_score << " backlink_score " << backlink_score << "\n"; cerr << " score " << score << "(" << thisMatch->getScore() << "), maxScore " << maxScore <<", minScore " << minScore << endl; } if (maxScore < score) {if(debug) cerr << "Set maxScore = score" < score && score > 0.0) {if(debug) cerr << "Set minScore = score" <getCollection(); if (config->Boolean("use_meta_description",0) && strlen(ref->DocMetaDsc()) != 0) { // Set the head to point to description head = ref->DocMetaDsc(); use_meta_description = 1; } else { // docDB.ReadExcerpt(*ref); collection->ReadExcerpt(*ref); head = ref->DocHead(); // head points to the top } //head_string = HtSGMLCodec::instance()->decode(head); //head = head_string.get(); int which, length; char *temp = head; String part; String *text = new String(""); StringMatch *allWordsPattern = NULL; if (collection) allWordsPattern = collection->getSearchWordsPattern(); if (!allWordsPattern) return text; // htsearch displays the description when: // 1) a description has been found // 2) the option "use_meta_description" is set to true // If previous conditions are false and "excerpt_show_top" is set to true // it shows the whole head. Else, it acts as default. if (config->Boolean("excerpt_show_top", 0) || use_meta_description || !allWordsPattern->hasPattern()) first = 0; else first = allWordsPattern->FindFirstWord(head, which, length); if (first < 0 && config->Boolean("no_excerpt_show_top")) first = 0; // No excerpt, but we want to show the top. if (first < 0) { // // No excerpt available, don't show top, so display message // if (!config->Find("no_excerpt_text").empty()) { *text << config->Find("no_excerpt_text"); } } else if ( first == 0 || config->Value( "max_excerpts" ) == 1 ) { int headLength = strlen(head); int length = config->Value("excerpt_length", 50); char *start; char *end; WordType type(*config); if (!config->Boolean("add_anchors_to_excerpt")) // negate flag if it's on (anchor available) fanchor = 0; // // Figure out where to start the excerpt. Basically we go back // half the excerpt length from the first matched word // start = &temp[first] - length / 2; if (start < temp) start = temp; else { *text << config->Find("start_ellipses"); while (*start && type.IsStrictChar(*start)) start++; } // // Figure out the end of the excerpt. // end = start + length; if (end > temp + headLength) { end = temp + headLength; *text << hilight(match, start, urlanchor, fanchor); } else { while (*end && type.IsStrictChar(*end)) end++; *end = '\0'; *text << hilight(match, start, urlanchor, fanchor); *text << config->Find("end_ellipses"); } } else { *text = buildExcerpts( allWordsPattern, match, head, urlanchor, fanchor ); } return text; } // //***************************************************************************** // Handle cases where multiple document excerpts are requested. // const String Display::buildExcerpts( StringMatch *allWordsPattern, ResultMatch* match, char *head, String urlanchor, int fanchor ) { HtConfiguration* config= HtConfiguration::config(); if ( !config->Boolean( "add_anchors_to_excerpt" ) ) { fanchor = 0; } int headLength = strlen( head ); int excerptNum = config->Value( "max_excerpts", 1 ); int excerptLength = config->Value( "excerpt_length", 50 ); int lastPos = 0; int curPos = 0; String text; for ( int i = 0; i < excerptNum; ++i ) { int which, termLength; int nextPos = allWordsPattern->FindFirstWord( head + lastPos, which, termLength ); if ( nextPos < 0 ) { // Ran out of matching terms break; } else { // Determine offset from beginning of head curPos = lastPos + nextPos; } // Slip a break in since there is another excerpt coming if ( i != 0 ) { text << "
    "; } // Determine where excerpt starts char *start = &head[curPos] - excerptLength / 2; if ( start < head ) { start = head; } else { text << config->Find("start_ellipses"); while ( *start && HtIsStrictWordChar( *start ) ) { start++; } } // Determine where excerpt ends char *end = start + excerptLength; if ( end > head + headLength ) { end = head + headLength; text << hilight( match, start, urlanchor, fanchor ); } else { while ( *end && HtIsStrictWordChar( *end ) ) { end++; } // Save end char so that it can be restored char endChar = *end; *end = '\0'; text << hilight(match, start, urlanchor, fanchor); text << config->Find("end_ellipses"); *end = endChar; } // No more words left to examine in head if ( (lastPos = curPos + termLength) > headLength ) break; } return text; } //***************************************************************************** String Display::hilight(ResultMatch *match, const String& str_arg, const String& urlanchor, int fanchor) { HtConfiguration* config= HtConfiguration::config(); const String start_highlight = config->Find("start_highlight"); const String end_highlight = config->Find("end_highlight"); const String anchor_target = config->Find("anchor_target"); const char *str = str_arg; String result; int pos = 0; int which, length; WeightWord *ww; int first = 1; String s; #define SGMLencodedChars(p, l) (s = 0, s.append(p, l), HtSGMLCodec::instance()->decode(s)) result = 0; Collection *collection = match->getCollection(); StringMatch *allWordsPattern = NULL; if (collection) allWordsPattern = collection->getSearchWordsPattern(); List *searchWords = NULL; if (collection) searchWords = collection->getSearchWords(); if (!allWordsPattern || !searchWords) return result; while (allWordsPattern->hasPattern() && (pos = allWordsPattern->FindFirstWord(str, which, length)) >= 0) { //result.append(str, pos); result << SGMLencodedChars(str, pos); ww = (WeightWord *) (*searchWords)[which]; result << start_highlight; if (first && fanchor) { result << " 0) result << "target=\"" << anchor_target << "\" "; result << "href=\"" << urlanchor << "\">"; } //result.append(str + pos, length); result << SGMLencodedChars(str + pos, length); if (first && fanchor) result << ""; result << end_highlight; str += pos + length; first = 0; } //result.append(str); result << SGMLencodedChars(str, strlen(str)); return result; } //***************************************************************************** void Display::sort(List *matches) { HtConfiguration* config= HtConfiguration::config(); int numberOfMatches = matches->Count(); int i; if (numberOfMatches <= 1) return; ResultMatch **array = new ResultMatch*[numberOfMatches]; for (i = 0; i < numberOfMatches; i++) { array[i] = (ResultMatch *)(*matches)[i]; } matches->Release(); qsort((char *) array, numberOfMatches, sizeof(ResultMatch *), array[0]->getSortFun()); const String st = config->Find("sort"); if (!st.empty() && mystrncasecmp("rev", st, 3) == 0) { for (i = numberOfMatches; --i >= 0; ) matches->Add(array[i]); } else { for (i = 0; i < numberOfMatches; i++) matches->Add(array[i]); } delete [] array; } //***************************************************************************** void Display::logSearch(int page, List *matches) { //Note: This is Posix and dependent on a running syslogd.. //does not work for Win32 //TODO: Look into using native windows system logs instead #ifndef _MSC_VER /* _WIN32 */ HtConfiguration* config= HtConfiguration::config(); // Currently unused time_t t; int nMatches = 0; int level = LOG_LEVEL; int facility = LOG_FACILITY; char *host = getenv("REMOTE_HOST"); char *ref = getenv("HTTP_REFERER"); if (host == NULL) host = getenv("REMOTE_ADDR"); if (host == NULL) host = "-"; if (ref == NULL) ref = "-"; if (matches) nMatches = matches->Count(); openlog("htsearch", LOG_PID, facility); syslog(level, "%s [%s] (%s) [%s] [%s] (%d/%s) - %d -- %s\n", host, input->exists("config") ? input->get("config") : "default", (const char*)config->Find("match_method"), input->exists("words") ? input->get("words") : "", logicalWords.get(), nMatches, (const char*)config->Find("matches_per_page"), page, ref ); #endif } htdig-3.2.0b6/htsearch/Display.h0100644006314600127310000001275410055635554015763 0ustar angusgbhtdig// // Display.h // // Display: Takes results of search and fills in the HTML templates // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Display.h,v 1.27 2004/05/28 13:15:24 lha Exp $ // #ifndef _Display_h_ #define _Display_h_ #include "Object.h" #include "ResultList.h" #include "ResultMatch.h" #include "TemplateList.h" #include "cgi.h" #include "StringMatch.h" #include "List.h" #include "DocumentDB.h" #include "Database.h" #include "Dictionary.h" #include "HtRegex.h" class Display : public Object { public: // // Construction/Destruction // // Display(const String& docFile, const String& indexFile, const String& excerptFile); Display(Dictionary *selected_collections); ~Display(); void setStartTemplate(const String& templateName); void setMatchTemplate(const String& templateName); void setEndTemplate(const String& templateName); // inline void setResults(ResultList *results); // inline void setSearchWords(List *searchWords); inline void setLimit(HtRegex *); inline void setExclude(HtRegex *); // inline void setAllWordsPattern(StringMatch *); inline void setLogicalWords(char *); inline void setOriginalWords(char *); inline void setCGI(cgi *); void display(int pageNumber); void displayMatch(ResultMatch *match, DocumentRef *ref, int current); void displayHTTPheaders(); void displayHeader(); void displayFooter(); void displayNomatch(); void displaySyntaxError(const String &); int hasTemplateError() {return templateError;} protected: // // Multiple database support // Dictionary *selected_collections; // // Search Policy char *search_policy; // // The list of search results. // // ResultList *results; // // The database that contains documents. // // DocumentDB docDB; // // A list of words that we are searching for // // List *searchWords; // // Pattern that all result URLs must match or exclude // HtRegex *limitTo; HtRegex *excludeFrom; // // Pattern of all the words // // StringMatch *allWordsPattern; // // Variables for substitution into text are stored in a dictionary // Dictionary vars; // // Since the creation of excerpts is somewhat time consuming, we will // only compute them if they're actually going to be used. This is the // flag that tells us if we will need the excerpt. // int needExcerpt; // // Since we might have errors we cannot recover from, this tells us // what happened. // int templateError; // // To allow the result templates to be dependant on the match URL, we need // the following: // StringMatch URLtemplate; List URLtemplateList; // // To allow the star images to be dependant on the match URL, we need // the following: // StringMatch URLimage; List URLimageList; // // Maximum number of stars to display // int maxStars; double maxScore; double minScore; // // For display, we have different versions of the list of words. // String logicalWords; String originalWords; // // To be able to recreate the URL that will get to us again, we need // the info from the HTML form that called us. // cgi *input; // // Match output is done through templates. This is the interface to these // templates. // TemplateList templates; Template *currentTemplate; // // Methods... // List *buildMatchList(); void sort(List *); int includeURL(const String&); String *readFile(const String&); void expandVariables(const String&); void outputVariable(const String&); String *excerpt(ResultMatch *match, DocumentRef *ref, String urlanchor, int fanchor, int &first); const String buildExcerpts(StringMatch *allWordsPattern, ResultMatch *match, char *head, String urlanchor, int fanchor ); String hilight(ResultMatch *match, const String& str, const String& urlanchor, int fanchor); void setupTemplates(); void setupImages(); String *generateStars(DocumentRef *, int); void displayParsedFile(const String&); void setVariables(int, List *); void createURL(String &, int); void logSearch(int, List *); }; //***************************************************************************** inline void Display::setLimit(HtRegex *limit) { limitTo = limit; } inline void Display::setExclude(HtRegex *exclude) { excludeFrom = exclude; } #if 0 inline void Display::setAllWordsPattern(StringMatch *pattern) { allWordsPattern = pattern; } inline void Display::setResults(ResultList *results) { this->results = results; } inline void Display::setSearchWords(List *searchWords) { this->searchWords = searchWords; } #endif inline void Display::setLogicalWords(char *s) { logicalWords = s; vars.Add("LOGICAL_WORDS", new String(logicalWords)); } inline void Display::setOriginalWords(char *s) { originalWords = s; vars.Add("WORDS", new String(originalWords)); } inline void Display::setCGI(cgi *aCgi) { input = aCgi; } #endif htdig-3.2.0b6/htsearch/DocMatch.cc0100644006314600127310000001220510055635554016165 0ustar angusgbhtdig// DocMatch.cc // // DocMatch: Data object only. Contains information related to a given // document that was matched by a search. For instance, the // score of the document for this search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: DocMatch.cc,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "DocMatch.h" #include "HtConfiguration.h" #include "HtWordReference.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ //******************************************************************************* // DocMatch::DocMatch() // //******************************************************************************* // DocMatch::~DocMatch() // DocMatch::~DocMatch() { } // // merge with another match // sets anchor to the lower value // merges location lists // void DocMatch::Merge(const DocMatch &match) { if(match.anchor < anchor) { anchor = match.anchor; } AddLocations(match.GetLocations()); } // // adds locations to an existing list // avoiding duplicates, in location order // void DocMatch::AddLocations(const List *locs) { List *merge = new List; ListCursor c; locations->Start_Get(); locs->Start_Get(c); Location *a = (Location *)locations->Get_Next(); Location *b = (Location *)locs->Get_Next(c); while(a && b) { if(a->from < b->from) { merge->Add(a); a = (Location *)locations->Get_Next(); } else if(a->from > b->from) { merge->Add(new Location(*b)); b = (Location *)locs->Get_Next(c); } else // (a->from == b->from) { if(a->to < b->to) { merge->Add(new Location(*a)); merge->Add(new Location(*b)); } else if(a->to > b->to) { merge->Add(new Location(*b)); merge->Add(new Location(*a)); } else // (a->to == b->to) { merge->Add(new Location( a->from, a->to, a->flags, a->weight + b->weight)); } a = (Location *)locations->Get_Next(); b = (Location *)locs->Get_Next(c); } } while(a) { merge->Add(a); a = (Location *)locations->Get_Next(); } while(b) { merge->Add(new Location(*b)); b = (Location *)locs->Get_Next(c); } locations->Release(); delete locations; locations = merge; } // // set the location list // void DocMatch::SetLocations(List *locs) { delete locations; locations = locs; } // // copy constructor, copies locations // DocMatch::DocMatch(const DocMatch &other) { score = -1.0; //score = other.score; id = other.id; anchor = other.anchor; locations = new List; AddLocations(other.GetLocations()); } // // set weight of all locations // void DocMatch::SetWeight(double weight) { locations->Start_Get(); for(int i = 0; i < locations->Count(); i++) { Location *loc = (Location *)locations->Get_Next(); loc->weight = weight; } } // // debug dump // void DocMatch::Dump() { cerr << "DocMatch id: " << id << " {" << endl; locations->Start_Get(); for(int i = 0; i < locations->Count(); i++) { Location *loc = (Location *)locations->Get_Next(); cerr << "location [" << loc->from; cerr << ", " << loc->to << "] "; cerr << "weight " << loc->weight; cerr << " flags " << loc->flags; cerr << endl; } cerr << "score: " << GetScore() << endl << "}" << endl; } double DocMatch::GetScore() { HtConfiguration* config= HtConfiguration::config(); static double text_factor = config->Double("text_factor", 1); static double caps_factor = config->Double("caps_factor", 1); static double title_factor = config->Double("title_factor", 1); static double heading_factor = config->Double("heading_factor", 1); static double keywords_factor = config->Double("keywords_factor", 1); static double meta_desc_factor = config->Double("meta_description_factor", 1); static double author_factor = config->Double("author_factor", 1); static double description_factor = config->Double("description_factor", 1); static double url_text_factor = config->Double("url_text_factor", 1); if (score == -1.0) { score = 0.0; double locresult = 0.0; ListCursor c; locations->Start_Get(c); Location *loc = (Location *)locations->Get_Next(c); while(loc) { locresult = 0.0; if (loc->flags == FLAG_TEXT) locresult += text_factor; if (loc->flags & FLAG_CAPITAL) locresult += caps_factor; if (loc->flags & FLAG_TITLE) locresult += title_factor; if (loc->flags & FLAG_HEADING) locresult += heading_factor; if (loc->flags & FLAG_KEYWORDS) locresult += keywords_factor; if (loc->flags & FLAG_DESCRIPTION) locresult += meta_desc_factor; if (loc->flags & FLAG_AUTHOR) locresult += author_factor; if (loc->flags & FLAG_LINK_TEXT) locresult += description_factor; if (loc->flags & FLAG_URL) locresult += url_text_factor; score += loc->weight * locresult; loc = (Location *)locations->Get_Next(c); } } return score; } htdig-3.2.0b6/htsearch/DocMatch.h0100644006314600127310000000435110055635554016032 0ustar angusgbhtdig// // DocMatch.h // // DocMatch: Data object only. Contains information related to a given // document that was matched by a search. For instance, the // score of the document for this search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: DocMatch.h,v 1.9 2004/05/28 13:15:24 lha Exp $ // #ifndef _DocMatch_h_ #define _DocMatch_h_ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "List.h" class Collection; // // an element of the DocMatch location list // struct Location : public Object { Location(int f, int t, unsigned int l, double w = 1.0) : from(f), to(t), flags(l), weight(w) {} Location(const Location &l) : from(l.from), to(l.to), flags(l.flags), weight(l.weight) {} int from; int to; unsigned int flags; double weight; }; // // an element of a ResultList // class DocMatch : public Object { public: // default constructor DocMatch() : locations(new List), score(-1.0), id(0), anchor(0), collection(0) {} // copy constructor DocMatch(const DocMatch &); // destructor ~DocMatch(); // match join void Merge(const DocMatch &); // score accessor double GetScore(); void SetScore(double); // doc id accessors int GetId() const { return id; } void SetId(int x) { id = x; } // anchor accessors int GetAnchor() const { return anchor; } void SetAnchor(int x) { anchor = x; } // location list accessors const List *GetLocations() const { return locations; } void SetLocations(List *); void AddLocations(const List *); // add one location to the list // use with caution -- does not ensure {ordered} void AddLocation(Location *x) { locations->Add(x); } // set weight of all locations void SetWeight(double weight); // debug void Dump(); private: List *locations; // the rest should be private: // but is already used by the old htsearch public: double score; int id; int anchor; short int orMatches; Collection *collection; // Multiple databases }; #endif htdig-3.2.0b6/htsearch/ExactWordQuery.cc0100644006314600127310000000217310055635554017434 0ustar angusgbhtdig// // ExactWordQuery.cc // // ExactWordQuery: A Query tree leaf object. Wraps a database access // that generates ResultLists for word matches. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ExactWordQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "ExactWordQuery.h" #include "WordSearcher.h" // // the searcher object used by all instances // of ExactWord // WordSearcher * ExactWordQuery::searcher = 0; // // set the weight of the matches to my weight // void ExactWordQuery::AdjustWeight(ResultList &results) { results.SetWeight(weight); } // // tell the searcher to fetch my word in the database // return 0 if no matches // ResultList * ExactWordQuery::Evaluate() { ResultList *result = 0; if(searcher) { result = searcher->Search(word); } if(result && !result->Count() && !result->IsIgnore()) { delete result; result = 0; } return result; } htdig-3.2.0b6/htsearch/ExactWordQuery.h0100644006314600127310000000274010055635554017276 0ustar angusgbhtdig#ifndef _ExactWordQuery_h_ #define _ExactWordQuery_h_ // // ExactWordQuery.h // // ExactWordQuery: A Query tree leaf object. Wraps a database access // that generates ResultLists for word matches. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ExactWordQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Query.h" class WordSearcher; class ExactWordQuery : public Query { public: // construct for word w ExactWordQuery(const String &w) : word(w), weight(1.0) {} // destruct ~ExactWordQuery() {} // set the common db wrapper static void SetSearcher(WordSearcher *c) { searcher = c; } // weight accessor void SetWeight(double x) { weight = x; } double GetWeight() const { return weight; } private: // forbidden ExactWordQuery() {} // go search the db ResultList *Evaluate(); // set my weight to the list void AdjustWeight(ResultList &); // unparse String GetLogicalWords() const { return word; } // unique cache index String GetSignature() const { return String("Exact:")+GetLogicalWords(); } // i represent this String word; // my weight double weight; // db wrapper common to all word queries static WordSearcher *searcher; }; #endif htdig-3.2.0b6/htsearch/FuzzyExpander.h0100644006314600127310000000206510055635554017166 0ustar angusgbhtdig#ifndef _FuzzyExpander_h_ #define _FuzzyExpander_h_ // // FuzzyExpander.h // // FuzzyExpander: (abstract) root of a family of query factories. // They make fuzzy queries for given words // and store word weights to results // by using the existing fuzzy algorithms // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: FuzzyExpander.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // // // for details about the basic architectural pattern see the book: // Design Patterns, by the infamous GoF // Factory pattern // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "htString.h" class Query; // abstract class FuzzyExpander { public: FuzzyExpander() {} virtual ~FuzzyExpander() {} // generate a query for this word virtual Query *MakeQuery(const String &word) = 0; }; #endif htdig-3.2.0b6/htsearch/GParser.cc0100644006314600127310000000423410055635554016051 0ustar angusgbhtdig// // GParser.cc // // GParser: An alternate boolean parser, does not use operator precedence. // -- but why is it called G? :-) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: GParser.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "GParser.h" #include "OrQuery.h" #include "NearQuery.h" #include "AndQuery.h" #include "NotQuery.h" Query * GParser::ParseFactor() { Query *result = 0; if(token.IsWord()) { result = ParseWord(); } else if(token.IsQuote()) { token.Next(); result = ParsePhrase(); if(result) { if(token.IsQuote()) { token.Next(); } else { Expected("closing \""); delete result; result = 0; } } } else if(token.IsLeftParen()) { token.Next(); result = ParseExpression(); if(result) { if(token.IsRightParen()) { token.Next(); } else { Expected(")"); delete result; result = 0; } } } else { Expected("'(', '\"', or a word"); } return result; } OperatorQuery * GParser::MakeOperatorQuery(const String &op) const { cerr << "Making operator for " << op << endl; OperatorQuery *result = 0; if(op == String("or")) { result = new OrQuery; } else if(op == String("and")) { result = new AndQuery; } else if(op == String("not")) { result = new NotQuery; } else if(op == String("near")) { result = new NearQuery; } return result; } Query * GParser::ParseExpression() { List factors; Query *result = 0; String op = ""; Query *factor = ParseFactor(); if(factor) { result = factor; } while(factor && (token.IsOr() || token.IsAnd() || token.IsNot() || token.IsNear())) { if(op != token.Value()) { Query *previous = result; result = MakeOperatorQuery(token.Value()); result->Add(previous); op = token.Value(); } token.Next(); factor = ParseFactor(); if(factor) { result->Add(factor); } } if(!factor && result) { delete result; result = 0; } return result; } htdig-3.2.0b6/htsearch/GParser.h0100644006314600127310000000203610055635554015711 0ustar angusgbhtdig#ifndef _GParser_h_ #define _GParser_h_ // // GParser.h // // GParser: An alternate boolean parser, does not use operator precedence. // -- but why is it called G? :-) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: GParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryParser.h" #include "BooleanLexer.h" class OperatorQuery; class GParser : public QueryParser { public: GParser() {} ~GParser() {} private: // apply the single-level syntax Query *ParseExpression(); // apply the factor syntax Query *ParseFactor(); // return the adequate operator for an operator keyword OperatorQuery *MakeOperatorQuery(const String &op) const; // give the parent access to the lexical analyzer QueryLexer &Token() { return token; } // the lexer BooleanLexer token; }; #endif htdig-3.2.0b6/htsearch/HtURLSeedScore.cc0100644006314600127310000001255110055635554017242 0ustar angusgbhtdig// // HtURLSeedScore.cc // // URLSeedScore: // Holds a list of configured adjustments to be applied on a given // score and given URL. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: HtURLSeedScore.cc,v 1.6 2004/05/28 13:15:24 lha Exp $ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "StringList.h" #include "HtRegex.h" #include "HtURLSeedScore.h" #include #include // This class is only used in private members of URLSeedScore. // The OO-right thing would be to nest this inside the private // declaration of HtURLSeedScore, but that would cause portability // problems according to // . class ScoreAdjustItem : public Object { public: // Construct from a string applicable to StringMatch, and a string to // parse for a formula. ScoreAdjustItem(String &, String &); ~ScoreAdjustItem(); // Does this item match? inline bool Match(const String &s) { return match.match(s, 1, 0) != 0; } // Return the argument adjusted according to this item. double adjust_score(double orig) { return orig*my_mul_factor + my_add_constant; } // Error in parsing? Message given here if non-empty string. String& ErrMsg() { return myErrMsg; } private: double my_add_constant; double my_mul_factor; HtRegex match; static String myErrMsg; // These member functions are not supposed to be implemented, but // mentioned here as private so the compiler will not generate them if // someone puts in buggy code that would use them. ScoreAdjustItem(); ScoreAdjustItem(const ScoreAdjustItem &); void operator= (const ScoreAdjustItem &); }; // Definition of myErrMsg. String ScoreAdjustItem::myErrMsg(""); ScoreAdjustItem::ScoreAdjustItem(String &url_regex, String &formula) { double mul_factor = 1; double add_constant = 0; bool factor_found = false; bool constant_found = false; int chars_so_far; StringList l(url_regex.get(), '|'); match.setEscaped(l); // FIXME: Missing method to check if the regex was in error. // myErrMsg = form("%s is not a valid regex", url_regex.get()); char *s = formula.get(); // Parse the ([*]N[ ]*)?[+]?M format. if (s[0] == '*') { // Skip past the '*'. s++; // There is a mul_factor. Let's parse it. chars_so_far = 0; sscanf(s, "%lf%n", &mul_factor, &chars_so_far); // If '%lf' failed to match, then it will show up as either no // assignment to chars_so_far, or as writing 0 there. if (chars_so_far == 0) { myErrMsg = form("%s is not a valid adjustment formula", s); return; } // Skip past the number. s += chars_so_far; // Skip any whitespaces. while (isspace(*s)) s++; // Eat any plus-sign; it's redundant if alone, and may come before a // minus. if (*s == '+') s++; factor_found = true; } // If there's anything here, it must be the additive constant. if (*s) { chars_so_far = 0; sscanf(s, "%lf%n", &add_constant, &chars_so_far); // If '%lf' failed to match, then it will show up as either no // assignment to chars_so_far, or as writing 0 there. // We also need to check that it was the end of the input. if (chars_so_far == 0 || s[chars_so_far] != 0) { myErrMsg = form("%s is not a valid adjustment formula", formula.get()); return; } constant_found = true; } // Either part must be there. if (!factor_found && !constant_found) { myErrMsg = form("%s is not a valid formula", formula.get()); return; } my_add_constant = add_constant; my_mul_factor = mul_factor; } ScoreAdjustItem::~ScoreAdjustItem() { } URLSeedScore::URLSeedScore(Configuration &config) { char *config_item = "url_seed_score"; StringList sl(config[config_item], "\t \r\n"); myAdjustmentList = new List(); if (sl.Count() % 2) { myErrMsg = form("%s is not a list of pairs (odd number of items)", config_item); // We *could* continue, but that just means the error will be harder // to find, unless someone actually sees the error message. return; } // Parse each as in TemplateList::createFromString. for (int i = 0; i < sl.Count(); i += 2) { String url_regex = sl[i]; String adjust_formula = sl[i+1]; ScoreAdjustItem *adjust_item = new ScoreAdjustItem(url_regex, adjust_formula); if (adjust_item->ErrMsg().length() != 0) { // No point in continuing beyond the error; we might just // overwrite the first error. myErrMsg = form("While parsing %s: %s", config_item, adjust_item->ErrMsg().get()); return; } myAdjustmentList->Add(adjust_item); } } URLSeedScore::~URLSeedScore() { delete myAdjustmentList; } double URLSeedScore::noninline_adjust_score(double orig_score, const String &url) { List *adjlist = myAdjustmentList; ScoreAdjustItem *adjust_item; adjlist->Start_Get(); while ((adjust_item = (ScoreAdjustItem *) adjlist->Get_Next())) { // Use the first match only. if (adjust_item->Match(url)) return adjust_item->adjust_score(orig_score); } // We'll get here if no match was found. return orig_score; } htdig-3.2.0b6/htsearch/HtURLSeedScore.h0100644006314600127310000000322110055635554017076 0ustar angusgbhtdig// // HtURLSeedScore.h // // URLSeedScore: Constructed from a Configuration, see doc // for format of config item "url_seed_score". // Method "double adjust_score(double score, const String &url)" // returns an adjusted score, given the original score, or returns the // original score if there was no adjustment to do. // // $Id: HtURLSeedScore.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifndef __HtURLSeedScore_h #define __HtURLSeedScore_h #include "Configuration.h" #include "List.h" class URLSeedScore { public: URLSeedScore(Configuration &); ~URLSeedScore(); // Return the "adjusted" score. Use an inline method to avoid // function-call overhead when this feature is unused. double adjust_score(double score, const String& url) { return myAdjustmentList->Count() == 0 ? score : noninline_adjust_score(score, url); } // If an error was discovered during the parsing of // the configuration, this member gives a // nonempty String with an error message. const String& ErrMsg() { return myErrMsg; } private: double noninline_adjust_score(double score, const String& url); // These member functions are not supposed to be implemented. URLSeedScore(); URLSeedScore(const URLSeedScore &); void operator= (const URLSeedScore &); List *myAdjustmentList; String myErrMsg; }; #endif /* __HtURLSeedScore_h */ htdig-3.2.0b6/htsearch/Makefile.am0100644006314600127310000000301607723256616016236 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config bindir = $(CGIBIN_DIR) LOCAL_DEFINES = -DCONFIG_DIR=\"$(CONFIG_DIR)\" -I$(top_srcdir)/htfuzzy bin_PROGRAMS = htsearch qtest htsearch_SOURCES = Display.cc DocMatch.cc ResultList.cc ResultMatch.cc \ Template.cc TemplateList.cc WeightWord.cc htsearch.cc \ parser.cc Collection.cc SplitMatches.cc HtURLSeedScore.cc noinst_HEADERS = Display.h DocMatch.h ResultList.h ResultMatch.h \ Template.h TemplateList.h WeightWord.h htsearch.h parser.h \ Collection.h SplitMatches.h HtURLSeedScore.h \ WordSearcher.h AndQuery.h AndQueryParser.h BooleanLexer.h \ BooleanQueryParser.h ExactWordQuery.h FuzzyExpander.h GParser.h \ NearQuery.h NotQuery.h OperatorQuery.h OrFuzzyExpander.h \ OrQuery.h OrQueryParser.h PhraseQuery.h Query.h QueryCache.h \ QueryLexer.h QueryParser.h SimpleLexer.h SimpleQueryParser.h \ VolatileCache.h htsearch_DEPENDENCIES = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) htsearch_LDFLAGS = $(PROFILING) ${extra_ldflags} htsearch_LDADD = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) qtest_SOURCES = DocMatch.cc ResultList.cc AndQuery.cc \ BooleanLexer.cc BooleanQueryParser.cc ExactWordQuery.cc \ GParser.cc NearQuery.cc NotQuery.cc OperatorQuery.cc \ OrFuzzyExpander.cc OrQuery.cc PhraseQuery.cc Query.cc \ QueryLexer.cc QueryParser.cc SimpleQueryParser.cc VolatileCache.cc \ WordSearcher.cc qtest.cc qtest_DEPENDENCIES = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) qtest_LDFLAGS = $(PROFILING) ${extra_ldflags} qtest_LDADD = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) htdig-3.2.0b6/htsearch/Makefile.in0100644006314600127310000003650010063260372016234 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = $(CGIBIN_DIR) build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la LOCAL_DEFINES = -DCONFIG_DIR=\"$(CONFIG_DIR)\" -I$(top_srcdir)/htfuzzy bin_PROGRAMS = htsearch qtest htsearch_SOURCES = Display.cc DocMatch.cc ResultList.cc ResultMatch.cc \ Template.cc TemplateList.cc WeightWord.cc htsearch.cc \ parser.cc Collection.cc SplitMatches.cc HtURLSeedScore.cc noinst_HEADERS = Display.h DocMatch.h ResultList.h ResultMatch.h \ Template.h TemplateList.h WeightWord.h htsearch.h parser.h \ Collection.h SplitMatches.h HtURLSeedScore.h \ WordSearcher.h AndQuery.h AndQueryParser.h BooleanLexer.h \ BooleanQueryParser.h ExactWordQuery.h FuzzyExpander.h GParser.h \ NearQuery.h NotQuery.h OperatorQuery.h OrFuzzyExpander.h \ OrQuery.h OrQueryParser.h PhraseQuery.h Query.h QueryCache.h \ QueryLexer.h QueryParser.h SimpleLexer.h SimpleQueryParser.h \ VolatileCache.h htsearch_DEPENDENCIES = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) htsearch_LDFLAGS = $(PROFILING) ${extra_ldflags} htsearch_LDADD = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) qtest_SOURCES = DocMatch.cc ResultList.cc AndQuery.cc \ BooleanLexer.cc BooleanQueryParser.cc ExactWordQuery.cc \ GParser.cc NearQuery.cc NotQuery.cc OperatorQuery.cc \ OrFuzzyExpander.cc OrQuery.cc PhraseQuery.cc Query.cc \ QueryLexer.cc QueryParser.cc SimpleQueryParser.cc VolatileCache.cc \ WordSearcher.cc qtest.cc qtest_DEPENDENCIES = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) qtest_LDFLAGS = $(PROFILING) ${extra_ldflags} qtest_LDADD = $(top_builddir)/htfuzzy/libfuzzy.la $(HTLIBS) subdir = htsearch ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = htsearch$(EXEEXT) qtest$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_htsearch_OBJECTS = Display.$(OBJEXT) DocMatch.$(OBJEXT) \ ResultList.$(OBJEXT) ResultMatch.$(OBJEXT) Template.$(OBJEXT) \ TemplateList.$(OBJEXT) WeightWord.$(OBJEXT) htsearch.$(OBJEXT) \ parser.$(OBJEXT) Collection.$(OBJEXT) SplitMatches.$(OBJEXT) \ HtURLSeedScore.$(OBJEXT) htsearch_OBJECTS = $(am_htsearch_OBJECTS) am_qtest_OBJECTS = DocMatch.$(OBJEXT) ResultList.$(OBJEXT) \ AndQuery.$(OBJEXT) BooleanLexer.$(OBJEXT) \ BooleanQueryParser.$(OBJEXT) ExactWordQuery.$(OBJEXT) \ GParser.$(OBJEXT) NearQuery.$(OBJEXT) NotQuery.$(OBJEXT) \ OperatorQuery.$(OBJEXT) OrFuzzyExpander.$(OBJEXT) \ OrQuery.$(OBJEXT) PhraseQuery.$(OBJEXT) Query.$(OBJEXT) \ QueryLexer.$(OBJEXT) QueryParser.$(OBJEXT) \ SimpleQueryParser.$(OBJEXT) VolatileCache.$(OBJEXT) \ WordSearcher.$(OBJEXT) qtest.$(OBJEXT) qtest_OBJECTS = $(am_qtest_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(htsearch_SOURCES) $(qtest_SOURCES) HEADERS = $(noinst_HEADERS) DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am SOURCES = $(htsearch_SOURCES) $(qtest_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htsearch/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done htsearch$(EXEEXT): $(htsearch_OBJECTS) $(htsearch_DEPENDENCIES) @rm -f htsearch$(EXEEXT) $(CXXLINK) $(htsearch_LDFLAGS) $(htsearch_OBJECTS) $(htsearch_LDADD) $(LIBS) qtest$(EXEEXT): $(qtest_OBJECTS) $(qtest_DEPENDENCIES) @rm -f qtest$(EXEEXT) $(CXXLINK) $(qtest_LDFLAGS) $(qtest_OBJECTS) $(qtest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am # 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: htdig-3.2.0b6/htsearch/Makefile.win320100644006314600127310000000167507677124212016606 0ustar angusgbhtdig# # Makefile - makefile for htsearch # APP_NAME = Right Now Web CGI RNT_PRODUCT = rnw TARGET = $(BINDIR)/htsearch$(EXESFX) include ../Makedefs.win32 # ----------------------------------------------------------------------------- # add new executable members to this list CXXSRC = Display.cc DocMatch.cc ResultList.cc ResultMatch.cc \ Template.cc TemplateList.cc WeightWord.cc htsearch.cc parser.cc \ Collection.cc SplitMatches.cc HtURLSeedScore.cc CPPFLAGS += -DHAVE_CONFIG_H -I. -I../include -I../htlib -I../htcommon -I../htword -I../db -I../htnet LDLIBS = ../lib/$(ARCH)/libhtdb.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libhtnet.lib ../lib/$(ARCH)/libfuzzy.lib OTHERLIBS = ws2_32.lib L:/win32/lib/zlib114/zlib.lib DEPLIBS += $(LDLIBS) $(TARGET): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS) $(LDLIBS) $(OTHERLIBS) include ../Makerules.win32 htdig-3.2.0b6/htsearch/NearQuery.cc0100644006314600127310000000520310055635554016416 0ustar angusgbhtdig// // NearQuery.cc // // NearQuery: An operator query that filters matches by proximity. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: NearQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "NearQuery.h" String NearQuery::OperatorString() const { String s; s << "near/" << distance; return s; } // // l r nextTo // ----------------------- // 0 0 0 // 0 b 0 // 0 x 0 // a 0 0 // a b near(a, b) // a x a // x 0 0 // x b b // x x x // ResultList * NearQuery::Evaluate() { ResultList *result = 0; Query *left = (Query *)operands[0]; Query *right = (Query *)operands[1]; if(left && right) { ResultList *l = left->GetResults(); if(l) { ResultList *r = right->GetResults(); if(r) { if(l->IsIgnore()) { result = new ResultList(*r); } else if(r->IsIgnore()) { result = new ResultList(*l); } else { result = Near(*l, *r); } } } } return result; } ResultList * NearQuery::Near(const ResultList &l, const ResultList &r) { ResultList *result = 0; DictionaryCursor c; l.Start_Get(c); DocMatch *match = (DocMatch *)l.Get_NextElement(c); while(match) { DocMatch *confirm = r.find(match->GetId()); if(confirm) { List *locations = MergeLocations( *match->GetLocations(), *confirm->GetLocations()); if(locations) { if(!result) { result = new ResultList; } DocMatch *copy = new DocMatch(*match); copy->SetLocations(locations); result->add(copy); } } match = (DocMatch *)l.Get_NextElement(c); } return result; } // //: merge match positions in a 'near' operation // all combinations are tested; the pairs of positions near enough are kept // List * NearQuery::MergeLocations(const List &p, const List &q) { List *result = 0; ListCursor pc; p.Start_Get(pc); const Location *left = (const Location *)p.Get_Next(pc); while(left) { ListCursor qc; q.Start_Get(qc); const Location *right = (const Location *)q.Get_Next(qc); while(right) { int dist = right->from - left->to; if(dist < 1) { dist = left->from - right->to; if(dist < 1) { dist = 0; } } if(unsigned(dist) <= distance) { if(!result) { result = new List; } result->Add(new Location(*left)); result->Add(new Location(*right)); } right = (const Location *)q.Get_Next(qc); } left = (const Location *)p.Get_Next(pc); } return result; } htdig-3.2.0b6/htsearch/NearQuery.h0100644006314600127310000000223710055635554016264 0ustar angusgbhtdig#ifndef _NearQuery_h_ #define _NearQuery_h_ // // NearQuery.h // // NearQuery: An operator query that filters matches by proximity. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: NearQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "OperatorQuery.h" class NearQuery : public OperatorQuery { public: // binary fashion NearQuery(Query *left, Query *right, unsigned int dist) : distance(dist) { Add(left); Add(right); } // n-ary fashion -- will ignore operands for n>2 NearQuery(unsigned int dist = 10) : distance(dist) {} private: // get results from operands and filter ResultList *Evaluate(); // create a result with neighboring matches ResultList *Near(const ResultList &, const ResultList &); // merge neighboring location lists List *MergeLocations(const List &, const List &); String OperatorString() const; unsigned int distance; }; #endif htdig-3.2.0b6/htsearch/NotQuery.cc0100644006314600127310000000437010055635554016275 0ustar angusgbhtdig// // NotQuery.cc // // NotQuery: 'not' query operator (n-ary not!) // i.e. not(a, b, c, d...) == a except (b or c or d or...) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: NotQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "NotQuery.h" // // l r not // ------------------------- // 0 0 0 // 0 b 0 // 0 x 0 // a 0 a // a b diff(a,b) // a x a // x 0 x // x b x // x x x // // note l is the first operand, r is the rest // i.e. l = 0 => not = 0 // l = x => not = x // r = 0 => not = l // r = x => not = l // subtract otherwise // ResultList * NotQuery::Evaluate() { operands.Start_Get(); Query *operand = (Query *) operands.Get_Next(); ResultList *result = 0; ResultList *positive = operand->GetResults(); if(positive) { List negative; if(!positive->IsIgnore()) { operand = (Query *) operands.Get_Next(); while(operand) { ResultList *next = operand->GetResults(); if(next && !next->IsIgnore()) { negative.Add(next); } operand = (Query *) operands.Get_Next(); } } if(negative.Count()) { result = Subtract(*positive, negative); negative.Release(); } else { result = new ResultList(*positive); } } return result; } // // make a result list containing all matches in positive // with docId absent from negatives // ResultList * NotQuery::Subtract(const ResultList &positive, const List &negatives) { ResultList *result = 0; DictionaryCursor pc; positive.Start_Get(pc); DocMatch *match = (DocMatch *)positive.Get_NextElement(pc); while(match) { bool confirm = true; ListCursor lc; negatives.Start_Get(lc); ResultList *negative = (ResultList *)negatives.Get_Next(lc); while(confirm && negative) { if(negative->exists(match->GetId())) { confirm = false; } negative = (ResultList *)negatives.Get_Next(lc); } if(confirm) { if(!result) { result = new ResultList; } result->add(new DocMatch(*match)); } match = (DocMatch *)positive.Get_NextElement(pc); } return result; } htdig-3.2.0b6/htsearch/NotQuery.h0100644006314600127310000000164610055635554016142 0ustar angusgbhtdig#ifndef _NotQuery_h_ #define _NotQuery_h_ // // NotQuery.h // // NotQuery: 'not' query operator (n-ary not!) // i.e. not(a, b, c, d...) == a except (b or c or d or...) // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: NotQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "OperatorQuery.h" // // class NotQuery : public OperatorQuery { public: private: // evaluate operands and operate ResultList *Evaluate(); // create a difference of the operand results ResultList *Subtract(const ResultList &, const List &); // used by GetLogicalWords String OperatorString() const { return String("not"); } }; #endif htdig-3.2.0b6/htsearch/OperatorQuery.cc0100644006314600127310000000227710055635554017334 0ustar angusgbhtdig// // OperatorQuery.cc // // OperatorQuery: (abstract class) a query that combines result lists // returned by other queries kept in an operand list. // how they are combined is tbd by the concrete classes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OperatorQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "OperatorQuery.h" // // return a string with the query as a boolean expression // descends recursively over the operand // String OperatorQuery::GetLogicalWords() const { ListCursor c; String out; out << "("; if(operands.Count()) { operands.Start_Get(c); out << ((Query *) operands.Get_Next(c))->GetLogicalWords(); Query *next = (Query *) operands.Get_Next(c); while(next) { out << " " << OperatorString() << " "; if(next) { out << next->GetLogicalWords(); } else { out << "*nothing*"; } next = (Query *) operands.Get_Next(c); } } out << ")"; return out; } htdig-3.2.0b6/htsearch/OperatorQuery.h0100644006314600127310000000274610055635554017177 0ustar angusgbhtdig#ifndef _OperatorQuery_h_ #define _OperatorQuery_h_ // // OperatorQuery.h // // OperatorQuery: (abstract class) a query that combines result lists // returned by other queries kept in an operand list. // how they are combined is tbd by the concrete classes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OperatorQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // // // for details about the basic architectural pattern see the book: // Design Patterns, by the infamous GoF // Interpreter pattern // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Query.h" #include "List.h" // abstract class OperatorQuery : public Query { public: virtual ~OperatorQuery() { operands.Destroy(); } // add an operand to the operation void Add(Query *operand) { operands.Add(operand); } protected: OperatorQuery() {} // get results from operands and combine them ad-hoc virtual ResultList *Evaluate() = 0; // keyword name of the operation virtual String OperatorString() const = 0; // human-readable unparsed string virtual String GetLogicalWords() const; // cache index String GetSignature() const { return String("Compound:")+GetLogicalWords(); } // children query operands List operands; }; #endif htdig-3.2.0b6/htsearch/OrFuzzyExpander.cc0100644006314600127310000000417110055635554017625 0ustar angusgbhtdig// // OrFuzzyExpander.cc // // OrFuzzyExpander: a concrete Fuzzy expander that makes a OR with // all the results returned by the applicable Fuzzies. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OrFuzzyExpander.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "OrFuzzyExpander.h" #include "Dictionary.h" #include "ExactWordQuery.h" #include "OrQuery.h" extern int debug; // // creates a query with a OrQuery with all the // distinct fuzzy results // // additionally, sets fuzzy scores for used words // Query * OrFuzzyExpander::MakeQuery(const String &word) { Query *result = 0; Dictionary exacts; // for each configured fuzzy filters.Start_Get(); Fuzzy *fuzzy = (Fuzzy *)filters.Get_Next(); while(fuzzy) { // for each word expanded by fuzzy List words; String nonconst = word; fuzzy->getWords(nonconst, words); words.Start_Get(); String *w = (String *)words.Get_Next(); while(w) { // if not yet expanded by another fuzzy // add it to the big Or if(debug) cerr << "fuzzy " << word << "=" << *w << endl; ExactWordQuery *exact = (ExactWordQuery *)exacts[*w]; if(!exact) { exact = new ExactWordQuery(*w); exact->SetWeight(fuzzy->getWeight()); exacts.Add(*w, exact); } // otherwise, just adjust the weight else { exact->SetWeight( exact->GetWeight() + fuzzy->getWeight()); } w = (String *)words.Get_Next(); } fuzzy = (Fuzzy *)filters.Get_Next(); } // return the expanded query // a single word or // a Or with all the expanded words exacts.Start_Get(); Query *exact = (Query *)exacts.Get_NextElement(); if(exact) { result = exact; exact = (Query *)exacts.Get_NextElement(); } if(exact) { Query *tmp = result; result = new OrQuery; result->Add(tmp); while(exact) { result->Add(exact); exact = (Query *)exacts.Get_NextElement(); } } exacts.Release(); return result; } htdig-3.2.0b6/htsearch/OrFuzzyExpander.h0100644006314600127310000000212710055635554017466 0ustar angusgbhtdig#ifndef _OrFuzzyExpander_h_ #define _OrFuzzyExpander_h_ // // OrFuzzyExpander.h // // OrFuzzyExpander: a concrete Fuzzy expander that makes a OR with // all the results returned by the applicable Fuzzies. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OrFuzzyExpander.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "FuzzyExpander.h" #include "List.h" #include "Fuzzy.h" // // makes a Or query with all the fuzzy expansions // class Fuzzy; class OrFuzzyExpander : public FuzzyExpander { public: OrFuzzyExpander() {} virtual ~OrFuzzyExpander() { filters.Release(); } // use this filter void Add(Fuzzy *filter) { filters.Add(filter); } private: // generate a OrQuery with all fuzzies found Query *MakeQuery(const String &word); // Fuzzies to be used List filters; }; #endif htdig-3.2.0b6/htsearch/OrQuery.cc0100644006314600127310000000502610055635554016114 0ustar angusgbhtdig// // OrQuery.cc // // OrQuery: an operator query that merges all the results of its operands // i.e. does 'or' combination // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OrQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "OrQuery.h" // // return a ResultList containing an Or of the results of the operands // evaluate all operands to do so // // l r or // --------------------- // 0 0 0 // 0 b b // 0 x x // a 0 a // a b union(a,b) // a x a // x 0 x // x b b // x x x // // i.e. nulls and ignored are left out union // // Note that all operands are evaluated // Ignored operands are not included in the operation // the longer input result list is passed separately to Union // ResultList * OrQuery::Evaluate() { ResultList *result = 0; ResultList *longer = 0; List shorter; int ignores = 0; operands.Start_Get(); Query *operand = (Query *) operands.Get_Next(); while(operand) { ResultList *next = operand->GetResults(); if(next) { if(!next->IsIgnore()) { if(!longer || longer->Count() < next->Count()) { if(longer) { shorter.Add(longer); } longer = next; } else { shorter.Add(next); } } else { ignores++; } } operand = (Query *) operands.Get_Next(); } if(longer) { result = Union(*longer, shorter); shorter.Release(); } else if(ignores == operands.Count()) { result = new ResultList; result->Ignore(); } return result; } // // copy unique DocMatches to the resulting list // matches with the same docId are merged // the longer list is assumed to be the first parameter // this is a modest optimisation // ResultList * OrQuery::Union(const ResultList &longer, const List &lists) { ResultList *result = new ResultList(longer); ListCursor lc; lists.Start_Get(lc); ResultList *current = (ResultList *) lists.Get_Next(lc); while(current) { DictionaryCursor c; current->Start_Get(c); DocMatch *match = (DocMatch *) current->Get_NextElement(c); while(match) { DocMatch *previous = result->find(match->GetId()); if(previous) { previous->Merge(*match); } else { DocMatch *copy = new DocMatch(*match); result->add(copy); } match = (DocMatch *) current->Get_NextElement(c); } current = (ResultList *) lists.Get_Next(lc); } return result; } htdig-3.2.0b6/htsearch/OrQuery.h0100644006314600127310000000160510055635554015755 0ustar angusgbhtdig#ifndef _OrQuery_h_ #define _OrQuery_h_ // // OrQuery.h // // OrQuery: an operator query that merges all the results of its operands // i.e. does 'or' combination // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OrQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "OperatorQuery.h" class OrQuery : public OperatorQuery { public: private: // evaluate operands and join results ResultList *Evaluate(); // create a union of the operand results ResultList *Union(const ResultList &longer, const List &shorter); String OperatorString() const { return String("or"); } }; #endif htdig-3.2.0b6/htsearch/OrQueryParser.h0100644006314600127310000000127610055635554017136 0ustar angusgbhtdig#ifndef _OrQueryParser_h_ #define _OrQueryParser_h_ // // OrQueryParser.h // // OrQueryParser: a query parser for 'any word' (or) queries // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: OrQueryParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "SimpleQueryParser.h" #include "OrQuery.h" class OrQueryParser : public SimpleQueryParser { public: OrQueryParser() {} private: OperatorQuery *MakeQuery() { return new OrQuery; } }; #endif htdig-3.2.0b6/htsearch/PhraseQuery.cc0100644006314600127310000000675210055635554016765 0ustar angusgbhtdig// // PhraseQuery.cc // // PhraseQuery: an operator query that filters sequenced word matches // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: PhraseQuery.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "PhraseQuery.h" // // evaluate operands and make a result with matches if some. // ResultList * PhraseQuery::Evaluate() { ResultList *result = 0; operands.Start_Get(); Query *next = (Query *)operands.Get_Next(); if(next) { result = (ResultList *)next->GetResults(); next = (Query *)operands.Get_Next(); } if(result) { result = new ResultList(*result); } while(result && next) { ResultList *r = next->GetResults(); if(r) { if(result->IsIgnore()) { delete result; result = new ResultList(*r); } else if(!r->IsIgnore()) { ResultList *tmp = result; result = Near(*tmp, *r); delete tmp; } next = (Query *)operands.Get_Next(); } else { delete result; result = 0; } } return result; } String PhraseQuery::GetLogicalWords() const { ListCursor c; String out; out << "\""; if(operands.Count()) { operands.Start_Get(c); out << ((Query *) operands.Get_Next(c))->GetLogicalWords(); Query *next = (Query *) operands.Get_Next(c); while(next) { out << " "; if(next) { out << next->GetLogicalWords(); } else { out << "*nothing*"; } next = (Query *) operands.Get_Next(c); } } out << "\""; return out; } // // return a resultlist containing matches that are contiguous // ResultList * PhraseQuery::Near(const ResultList &l, const ResultList &r) { ResultList *result = 0; DictionaryCursor c; l.Start_Get(c); DocMatch *match = (DocMatch *)l.Get_NextElement(c); while(match) { DocMatch *confirm = r.find(match->GetId()); if(confirm) { List *locations = MergeLocations( *match->GetLocations(), *confirm->GetLocations()); if(locations) { if(!result) { result = new ResultList; } DocMatch *copy = new DocMatch(*match); copy->SetLocations(locations); result->add(copy); } } match = (DocMatch *)l.Get_NextElement(c); } return result; } // //: merge match positions in a 'next' operation // each position of left operand match is tested against right operand positions // if two contiguous positions are found, they are merged into a single one // beginning at the begin of the left operand // and ending and the end of the right operand // List * PhraseQuery::MergeLocations(const List &p, const List &q) { List *result = 0; ListCursor pc; p.Start_Get(pc); const Location *left = (const Location *)p.Get_Next(pc); while(left) { ListCursor qc; q.Start_Get(qc); const Location *right = (const Location *)q.Get_Next(qc); while(right) { if(left->to + 1 == right->from) { double prevsize = left->to - left->from + 1.0; double addsize = right->to - right->from + 1.0; double weight = ((left->weight * prevsize) + (right->weight * addsize)) / (right->to - left->from + 1.0); if(!result) { result = new List; } result->Add(new Location( left->from, right->to, left->flags & right->flags, weight)); break; } right = (const Location *)q.Get_Next(qc); } left = (const Location *)p.Get_Next(pc); } return result; } htdig-3.2.0b6/htsearch/PhraseQuery.h0100644006314600127310000000204010055635554016611 0ustar angusgbhtdig#ifndef _PhraseQuery_h_ #define _PhraseQuery_h_ // // PhraseQuery.h // // PhraseQuery: an operator query that filters sequenced word matches // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: PhraseQuery.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "OperatorQuery.h" class PhraseQuery : public OperatorQuery { public: PhraseQuery() {} ~PhraseQuery() {} private: // get results from operands and filter ResultList *Evaluate(); // create a result with neighboring matches ResultList *Near(const ResultList &, const ResultList &); // merge neighboring location lists, constructing phrase locations List *MergeLocations(const List &, const List &); String OperatorString() const { return ""; } String GetLogicalWords() const; }; #endif htdig-3.2.0b6/htsearch/Query.cc0100644006314600127310000000365010055635554015614 0ustar angusgbhtdig// // Query.cc // // Query: (abstract) a parsed, 'executable' digger database query // a query tree is formed by leaf objects (ExactWordQuery) and // node objects (OperatorQuery) derived from this class. // Query execution results are returned as ResultList objects. // Query evaluation is cached. Cache policy is delegated to the // QueryCache class family. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Query.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "Query.h" #include "VolatileCache.h" // // the in-memory query result cache. the default instance is // defined static so its destructor is called at program exit // VolatileCache theDefaultCache; QueryCache * Query::cache = &theDefaultCache; extern int debug; // // destructor // Query::~Query() { } // // return a ResultList with the query results // results are initially fetched from the cache // if not cached, the query is evaluated // Weight of the results is adjusted at each invocation, as // the same result list may be shared by different queries // but different weights may be assigned to the word // // ResultList * Query::GetResults() { ResultList *result = 0; // try to find in cache before trying eval String signature; if(cache) { signature = GetSignature(); result = cache->Lookup(signature); } // no cache or not in cache, evaluate if(!result) { if(debug) cerr << "EVAL: " << signature << endl; result = Evaluate(); if(cache) { cache->Add(signature, result); } } // adjust if something found/returned if(result) { if(result->Count()) { AdjustWeight(*result); } else if(!result->IsIgnore()) { result = 0; } } return result; } htdig-3.2.0b6/htsearch/Query.h0100644006314600127310000000345610055635554015462 0ustar angusgbhtdig#ifndef __Query_h__ #define __Query_h__ // // Query.h // // Query: (abstract) a parsed, 'executable' digger database query // a query tree is formed by leaf objects (ExactWordQuery) and // node objects (OperatorQuery) derived from this class. // Query execution results are returned as ResultList objects. // Query evaluation is cached. Cache policy is delegated to the // QueryCache class family. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Query.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // // // for details about the basic architectural patterns see the book: // Design Patterns, by the infamous GoF // Interpreter pattern // Factory pattern // Flyweight pattern // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "htString.h" #include "ResultList.h" class QueryCache; // abstract class Query : public Object { public: // destr virtual ~Query(); // does nothing here -- hack for comfortable parser coding virtual void Add(Query *) {} // get a boolean-style query string virtual String GetLogicalWords() const = 0; // evaluate if necessary and return results ResultList *GetResults(); // set a cache policy static void SetCache(QueryCache *c) { cache = c; } protected: // get an unique cache index virtual String GetSignature() const = 0; Query() {} // generate results virtual ResultList *Evaluate() = 0; // by default, nothing -- for use of leaf queries virtual void AdjustWeight(ResultList &) {} private: // the current cache object, if some static QueryCache *cache; }; #endif htdig-3.2.0b6/htsearch/QueryCache.h0100644006314600127310000000203510055635554016376 0ustar angusgbhtdig#ifndef _QueryCache_h_ #define _QueryCache_h_ // // QueryCache.h // // QueryCache: (abstract) interface for the current Query cache policy. // A cache stores ResultLists indexed by a signature string. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QueryCache.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "Object.h" #include "htString.h" class ResultList; // abstract class QueryCache : public Object { public: // destructor virtual ~QueryCache() {} // get cached result for a query signature virtual ResultList *Lookup(const String &signature) = 0; // add result to be cached for a query signature virtual void Add(const String &signature, ResultList *entry) = 0; protected: // construction QueryCache() {} }; #endif htdig-3.2.0b6/htsearch/QueryLexer.cc0100644006314600127310000000345710055635554016621 0ustar angusgbhtdig// // QueryLexer.cc // // QueryLexer: (abstract) a lexical analyzer used by a QueryParser. // This class defines the common public interface of this // family of lexers. It implements a tokenizer, and also // the definition of the 'quote' and 'end' terminal symbols. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QueryLexer.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryLexer.h" #include "defaults.h" #include "WordType.h" extern int debug; QueryLexer::QueryLexer() { HtConfiguration* config= HtConfiguration::config(); prefix_match = config->Find("prefix_match_character"); } void QueryLexer::Set(const String &query_string) { query = query_string; current_char = 0; Next(); } void QueryLexer::Next() { HtConfiguration* config= HtConfiguration::config(); unsigned char text = query[current_char]; WordType type(*config); current = ""; while (text && !current.length() && !type.IsStrictChar(text)) { if (text == '(' || text == ')' || text == '\"' || text == '/') { current << text; if (debug) cerr << "lexer symbol: " << current << endl; } text = query[++current_char]; } if (!current.length() && text) { while (text && (type.IsChar(text) && text != '/' || prefix_match.indexOf(text, 0) != -1)) { current << text; text = query[++current_char]; } } current.lowercase(); if (debug) cerr << "lexer current word: " << current << endl; } bool QueryLexer::IsEnd() const { return current == String(""); } bool QueryLexer::IsQuote() const { return current == String("\""); } htdig-3.2.0b6/htsearch/QueryLexer.h0100644006314600127310000000307410055635554016456 0ustar angusgbhtdig#ifndef _QueryLexer_h_ #define _QueryLexer_h_ // // QueryLexer.h // // QueryLexer: (abstract) a lexical analyzer used by a QueryParser. // This class defines the common public interface of this // family of lexers. It implements a tokenizer, and also // the definition of the 'quote' and 'end' terminal symbols. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QueryLexer.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "htString.h" class QueryLexer { public: virtual ~QueryLexer() {} // set the query string and advance to the first token void Set(const String &query_string); // advance to the next token virtual void Next(); // is the current token a word? virtual bool IsWord() const = 0; // is the current token a quote sign? bool IsQuote() const; // is the current token end-of-query? bool IsEnd() const; // get the current token value const String &Value() const { return current; } // get the full query string const String &FullString() const { return query; } protected: QueryLexer(); // the full query string String query; // the current token value String current; // the current position in the query string int current_char; // suffix string used by the 'prefix' fuzzy String prefix_match; }; #endif htdig-3.2.0b6/htsearch/QueryParser.cc0100644006314600127310000000462510055635554016774 0ustar angusgbhtdig// // QueryParser.cc // // QueryParser: (abstract) root of the family of classes that create // Query trees by analyzing query strings. // The main public interface consists on Parse(), // which does the job. // The subclasses must provide a lexer. // This class implements also the common behaviour needed to // parse single words and phrases. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QueryParser.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryParser.h" #include "Query.h" #include "htString.h" #include "ExactWordQuery.h" #include "PhraseQuery.h" #include "FuzzyExpander.h" extern int debug; FuzzyExpander * QueryParser::expander = 0; // // parse a query string // // Query * QueryParser::Parse(const String &query_string) { error = ""; Token().Set(query_string); Query *result = ParseExpression(); if(result && !Token().IsEnd()) { Expected("end of query"); // delete result; result = 0; } return result; } // parse one word // return a fuzzy word query // Query * QueryParser::ParseWord() { Query *result = 0; if(expander) { result = expander->MakeQuery(Token().Value()); } else { result = new ExactWordQuery(Token().Value()); } Token().Next(); return result; } // // parse one word // return an exact query // Query * QueryParser::ParseExactWord() { Query *result = new ExactWordQuery(Token().Value()); Token().Next(); return result; } // // phrase == word { word } // Query * QueryParser::ParsePhrase() { Query *result = 0; Query *word = 0; if(!Token().IsEnd() && !Token().IsQuote()) { word = ParseExactWord(); } if(word) { result = new PhraseQuery; result->Add(word); while(word && !Token().IsEnd() && !Token().IsQuote()) { word = ParseExactWord(); if(word) { result->Add(word); } } } if(!word && result) { delete result; result = 0; } if(!result) { Expected("at least one word after \""); } return result; } void QueryParser::Expected(const String &what) { error << "Expected " << what; if(Token().IsEnd()) { error << " at the end"; } else { error << " instead of '" << Token().Value() << "'"; } } htdig-3.2.0b6/htsearch/QueryParser.h0100644006314600127310000000335110055635554016631 0ustar angusgbhtdig#ifndef _QueryParser_h_ #define _QueryParser_h_ // // QueryParser.h // // QueryParser: (abstract) root of the family of classes that create // Query trees by analyzing query strings. // The main public interface consists on Parse(), // which does the job. // The subclasses must provide a lexer. // This class implements also the common behaviour needed to // parse single words and phrases. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: QueryParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryLexer.h" class Query; class FuzzyExpander; // abstract class QueryParser { public: virtual ~QueryParser() {} // do it Query *Parse(const String &query_string); // contains a diagnostic if Parse() failed const String &Error() const { return error; } // set a fuzzy word expansion policy static void SetFuzzyExpander(FuzzyExpander *x) { expander = x; } protected: QueryParser() {} // apply a syntax -- tbd by derived classes virtual Query *ParseExpression() = 0; // access to the lexer -- provided by children virtual QueryLexer &Token() = 0; // parse one (fuzzy) word Query *ParseWord(); // parse an exact word Query *ParseExactWord(); // parse a phrase Query *ParsePhrase(); // set the error string on syntax error void Expected(const String &what); // the current fuzzy expansion policy if some static FuzzyExpander *expander; private: // syntax error if some String error; }; #endif htdig-3.2.0b6/htsearch/ResultList.cc0100644006314600127310000000551410055635554016622 0ustar angusgbhtdig// // ResultList.cc // // ResultList: A Dictionary indexed on the document id that holds // documents found for a search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ResultList.cc,v 1.10 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "ResultList.h" #include "htString.h" //***************************************************************************** // ResultList::ResultList() // ResultList::ResultList() { isIgnore = 0; } //***************************************************************************** // ResultList::~ResultList() // ResultList::~ResultList() { //Destroy(); } //***************************************************************************** // void ResultList::add(DocMatch *dm) { String t; t << dm->GetId(); Add(t, dm); } //***************************************************************************** // DocMatch * ResultList::find(int id) const { String t; t << id; return (DocMatch *) Find(t); } //***************************************************************************** // DocMatch * ResultList::find(char *id) const { return (DocMatch *) Find(id); } //***************************************************************************** // void ResultList::remove(int id) { String t; t << id; Remove(t); } //***************************************************************************** // int ResultList::exists(int id) const { String t; t << id; return Exists(t); } //***************************************************************************** // HtVector * ResultList::elements() { HtVector *list = new HtVector(Count() + 1); char *id; Start_Get(); while ((id = Get_Next())) { list->Add(Find(id)); } return list; } void ResultList::SetWeight(double weight) { HtVector *els = elements(); for(int i = 0; i < els->Count(); i++) { DocMatch *match = (DocMatch *)(*els)[i]; match->SetWeight(weight); } els->Release(); } ResultList::ResultList(const ResultList &other) { DictionaryCursor c; isIgnore = other.isIgnore; other.Start_Get(c); DocMatch *match = (DocMatch *)other.Get_NextElement(c); while(match) { add(new DocMatch(*match)); match = (DocMatch *)other.Get_NextElement(c); } } void ResultList::Dump() const { cerr << "ResultList {" << endl; cerr << "Ignore: " << isIgnore << " Count: " << Count() << endl; DictionaryCursor c; Start_Get(c); DocMatch *match = (DocMatch *)Get_NextElement(c); while(match) { match->Dump(); match = (DocMatch *)Get_NextElement(c); } cerr << "}" << endl; } htdig-3.2.0b6/htsearch/ResultList.h0100644006314600127310000000211610055635554016457 0ustar angusgbhtdig// // ResultList.h // // ResultList: A Dictionary indexed on the document id that holds // documents found for a search. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ResultList.h,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifndef _ResultList_h_ #define _ResultList_h_ #include "Dictionary.h" #include "DocMatch.h" #include "HtVector.h" class ResultList : public Dictionary { public: ResultList(); ~ResultList(); ResultList(const ResultList &); void add(DocMatch *); void remove(int id); DocMatch *find(int id) const; DocMatch *find(char *id) const; int exists(int id) const; HtVector *elements(); void SetWeight(double weight); bool IsIgnore() const { return isIgnore != 0; } void Ignore() { isIgnore = 1; } void Dump() const; //private: int isIgnore; }; #endif htdig-3.2.0b6/htsearch/ResultMatch.cc0100644006314600127310000001560310055635554016743 0ustar angusgbhtdig// // ResultMatch.cc // // ResultMatch: Contains information related to a given // document that was matched by a search. For instance, the // score of the document for this search. Similar to the // DocMatch class but designed for result display purposes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ResultMatch.cc,v 1.10 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "ResultMatch.h" // Definition of how to search ResultMatch::SortType ResultMatch::mySortType; //***************************************************************************** // ResultMatch::ResultMatch() { } //***************************************************************************** // ResultMatch::~ResultMatch() { } //***************************************************************************** // Default-access-methods. Just dummies when that data is not used. char *ResultMatch::getTitle() { return ""; } time_t ResultMatch::getTime() { return 0; } void ResultMatch::setTitle(char *) { } void ResultMatch::setTime(time_t) { } // Then for each sort-type, we derive a class, which will keep // any necessary additional piece of data, and return the compare-function. // We could have a real cute implementation with global // constructors registering a factory method with ResultMatch, // so it would just check a list and never need to be changed // when new search methods are introduced, but that seems futile. // It is more practical to just add search methods here and // change the createMatch method, last. //***************************************************************************** class ScoreMatch : public ResultMatch { // This one needs no additional data public: virtual ResultMatch::CmpFun getSortFun(); ScoreMatch(); ~ScoreMatch(); private: static int compare(const void *a1, const void *a2); }; ScoreMatch::ScoreMatch() {} ScoreMatch::~ScoreMatch() {} int ScoreMatch::compare(const void *a1, const void *a2) { ResultMatch *m1 = *((ResultMatch **) a1); ResultMatch *m2 = *((ResultMatch **) a2); double score1 = m1->getScore(); double score2 = m2->getScore(); if(score1 == score2) return 0; else if(score1 < score2) return 1; else return -1; // return m2->getScore() - m1->getScore(); } ResultMatch::CmpFun ScoreMatch::getSortFun() { return compare; } //***************************************************************************** class TimeMatch : public ResultMatch { public: virtual ResultMatch::CmpFun getSortFun(); virtual void setTime(time_t); virtual time_t getTime(); TimeMatch(); ~TimeMatch(); private: // We need a time_t here, and to override the get/setTime methods. time_t myTime; static int compare(const void *a1, const void *a2); }; TimeMatch::TimeMatch() {} TimeMatch::~TimeMatch() {} void TimeMatch::setTime(time_t t) { myTime = t; } time_t TimeMatch::getTime() { return myTime; } int TimeMatch::compare(const void *a1, const void *a2) { ResultMatch *m1 = *((ResultMatch **) a1); ResultMatch *m2 = *((ResultMatch **) a2); time_t t1 = m1->getTime(); time_t t2 = m2->getTime(); return (int) (t2 - t1); } ResultMatch::CmpFun TimeMatch::getSortFun() { return compare; } //***************************************************************************** class IDMatch : public ResultMatch { // This one needs no additional data public: virtual ResultMatch::CmpFun getSortFun(); IDMatch(); ~IDMatch(); private: static int compare(const void *a1, const void *a2); }; IDMatch::IDMatch() {} IDMatch::~IDMatch() {} int IDMatch::compare(const void *a1, const void *a2) { ResultMatch *m1 = *((ResultMatch **) a1); ResultMatch *m2 = *((ResultMatch **) a2); int i1 = m1->getID(); int i2 = m2->getID(); return (i1 - i2); } ResultMatch::CmpFun IDMatch::getSortFun() { return compare; } //***************************************************************************** class TitleMatch : public ResultMatch { public: virtual ResultMatch::CmpFun getSortFun(); virtual void setTitle(char *t); virtual char *getTitle(); TitleMatch(); ~TitleMatch(); private: // We need a String here, and to override the get/setTitle methods. // It has to be a String, as the "char *" goes away shortly // after creating the object. String myTitle; static int compare(const void *a1, const void *a2); }; TitleMatch::TitleMatch() {} TitleMatch::~TitleMatch() {} void TitleMatch::setTitle(char *t) { myTitle = t; } char * TitleMatch::getTitle() { return myTitle; } int TitleMatch::compare(const void *a1, const void *a2) { ResultMatch *m1 = *((ResultMatch **) a1); ResultMatch *m2 = *((ResultMatch **) a2); char *t1 = m1->getTitle(); char *t2 = m2->getTitle(); if (!t1) t1 = ""; if (!t2) t2 = ""; return mystrcasecmp(t1, t2); } ResultMatch::CmpFun TitleMatch::getSortFun() { return compare; } //***************************************************************************** int ResultMatch::setSortType(const String& sorttype) { static const struct { char *typest; SortType type; } sorttypes[] = { {"score", SortByScore}, {"date", SortByTime}, {"time", SortByTime}, {"title", SortByTitle}, {"id", SortByID} }; int i = 0; const char *st = sorttype; if (st && *st) { if (mystrncasecmp("rev", st, 3) == 0) st += 3; for (i = sizeof(sorttypes)/sizeof(sorttypes[0]); --i >= 0; ) { if (mystrcasecmp(sorttypes[i].typest, st) == 0) { mySortType = sorttypes[i].type; return 1; } } return 0; } else { // If not specified, default to SortByScore mySortType = SortByScore; return 1; } } //***************************************************************************** // Now here's the switchboard: a create-function that returns a // "new":ed object of the right class for what to compare. // To have the pairing managed in a (dynamically registered) // list may seem interesting, but since everything is here // anyway, there's little need but a small cuteness-factor. // We could also change the guts to use some kind of creator // object, if there would be a win. ResultMatch * ResultMatch::create() { switch (mySortType) { case ResultMatch::SortByScore: return new ScoreMatch(); case ResultMatch::SortByTime: return new TimeMatch(); case ResultMatch::SortByTitle: return new TitleMatch(); case ResultMatch::SortByID: return new IDMatch(); default: // It is doubtful which is better: to abort() or paper // over something bad here. return new ScoreMatch(); } } htdig-3.2.0b6/htsearch/ResultMatch.h0100644006314600127310000000433410055635554016604 0ustar angusgbhtdig// // ResultMatch.h // // ResultMatch: Contains information related to a given // document that was matched by a search. For instance, the // score of the document for this search. Similar to the // DocMatch class but designed for result display purposes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: ResultMatch.h,v 1.11 2004/05/28 13:15:24 lha Exp $ // #ifndef _ResultMatch_h_ #define _ResultMatch_h_ #include "Object.h" #include "htString.h" class DocumentRef; class Collection; class ResultMatch : public Object { public: // // Construction/Destruction // ResultMatch(); ~ResultMatch(); static ResultMatch *create(); // // Data access members // void setAnchor(int a) {anchor = a;} void setID(int i) {id = i;} void setScore(double s) {score = s;} int getAnchor() {return anchor;} double getScore() {return score;} int getID() {return id;} // Multiple database support void setCollection(Collection *coll) { collection = coll; } Collection *getCollection() { return collection; } static int setSortType(const String& sorttype); // A method for each type of data Display wants to cram in. // Will only store the pieces necessary for the // search-type as defined in setSortType, the others are dummies. virtual char *getTitle(); virtual time_t getTime(); virtual void setTitle(char *title); virtual void setTime(time_t t); // This is likely to help weak compilers as well as the eye. typedef int (*CmpFun)(const void *, const void *); // The purpose of the derived classes is to define their own. virtual CmpFun getSortFun() = 0; // Sun's C++ compiler doesn't like private types used in other structs // so make this public enum SortType { SortByScore, SortByTime, SortByTitle, SortByID }; private: double score; int anchor; int id; Collection *collection; static SortType mySortType; }; #endif htdig-3.2.0b6/htsearch/SimpleLexer.h0100644006314600127310000000124010055635554016573 0ustar angusgbhtdig#ifndef _SimpleLexer_h_ #define _SimpleLexer_h_ // // SimpleLexer.h // // SimpleLexer: query lexer for simple (no-keyword) queries // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SimpleLexer.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryLexer.h" class SimpleLexer : public QueryLexer { public: SimpleLexer() : QueryLexer() {} // everything is a word bool IsWord() const { return !IsEnd(); } }; #endif htdig-3.2.0b6/htsearch/SimpleQueryParser.cc0100644006314600127310000000315410055635554020142 0ustar angusgbhtdig// // SimpleQueryParser.cc // // SimpleQueryParser: (abstract) a family of parsers that generate queries // for strings with the syntax (word|phrase){(word|phrase)} // combining them in a single operator. // The operator to apply is tbd by concrete classes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SimpleQueryParser.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "SimpleQueryParser.h" #include "OperatorQuery.h" // // expr == term { term } // Query * SimpleQueryParser::ParseExpression() { Query *result = 0; Query *term = ParseTerm(); if(term) { if(token.IsEnd()) { result = term; } else { result = MakeQuery(); result->Add(term); while(!token.IsEnd()) { term = ParseTerm(); if(term) { result->Add(term); } } } } if(!term) { delete result; result = 0; } return result; } // // term == word | '"' phrase '"' // Query * SimpleQueryParser::ParseTerm() { Query *result = 0; if(token.IsQuote()) { token.Next(); result = ParsePhrase(); if(result) { if(token.IsQuote()) { token.Next(); } else { Expected("closing \""); delete result; result = 0; } } } else if(token.IsWord()) { // don't advance token here! result = ParseWord(); } else { Expected("a word or a quoted phrase"); } return result; } htdig-3.2.0b6/htsearch/SimpleQueryParser.h0100644006314600127310000000236010055635554020002 0ustar angusgbhtdig#ifndef _SimpleQueryParser_h_ #define _SimpleQueryParser_h_ // // SimpleQueryParser.h // // SimpleQueryParser: (abstract) a family of parsers that generate queries // for strings with the syntax (word|phrase){(word|phrase)} // combining them in a single operator. // The operator to apply is tbd by concrete classes. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SimpleQueryParser.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "QueryParser.h" #include "SimpleLexer.h" // abstract class OperatorQuery; class SimpleQueryParser : public QueryParser { public: virtual ~SimpleQueryParser() {} protected: SimpleQueryParser() {} // get a combination query virtual OperatorQuery *MakeQuery() = 0; private: // apply expr == term { term } Query *ParseExpression(); // apply term == word | phrase Query *ParseTerm(); // let the parent access the lexer QueryLexer &Token() { return token; } // the used lexer SimpleLexer token; }; #endif htdig-3.2.0b6/htsearch/SplitMatches.cc0100644006314600127310000001142410055635554017105 0ustar angusgbhtdig// // SplitMatches.cc // // SplitMatches: // Holds a list of lists with the matches, as specified in // search_results_order. // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: SplitMatches.cc,v 1.6 2004/05/28 13:15:24 lha Exp $ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "StringList.h" #include "HtRegex.h" #include "SplitMatches.h" #include #include // This class is only used in private members of SplitMatches. // The OO-right thing would be to nest this inside the private // declaration of SplitMatches, but that would cause portability // problems according to // . // // It is used as a container for a key (String) and a list. // class MatchArea : public Object { public: // Construct from a string applicable to StringMatch. MatchArea(const String &); ~MatchArea(); // Does this item match? // Fail if template is empty, since explicit "*" maps to empty template inline bool Match(char *s) { return match.match(s, 0, 0) != 0; } // Return the contained list. List *MatchList() { return &myList; } private: HtRegex match; List myList; // These member functions are not supposed to be implemented, but // mentioned here as private so the compiler will not generate them if // someone puts in buggy code that would use them. MatchArea(); MatchArea(const MatchArea &); void operator= (const MatchArea &); }; MatchArea::MatchArea(const String &url_regex) { // We do not want to "install" the catch-the-rest pattern as a real // pattern; it must always return false for the "Match" operator. if (strcmp("*", url_regex.get()) != 0) { StringList l(url_regex.get(),'|'); match.setEscaped(l); } } MatchArea::~MatchArea() { } SplitMatches::SplitMatches(Configuration &config) { char *config_item = "search_results_order"; StringList sl(config[config_item], "\t \r\n"); mySubAreas = new List(); myDefaultList = 0; // Parse each as in TemplateList::createFromString. for (int i = 0; i < sl.Count(); i++) { String sub_area_pattern = sl[i]; MatchArea *match_item = new MatchArea(sub_area_pattern); mySubAreas->Add(match_item); // If this is the magic catch-rest sub-area-pattern, we want to // use its list-pointer to store all URLs that do not match // anything else. // We will iterate over a list where one of the patterns is // known to not match, but that's a small penalty for keeping // the code simple. if (strcmp("*", sub_area_pattern.get()) == 0) myDefaultList = match_item->MatchList(); } // If we did not have a catch-the-rest pattern, install one at the // end of the list. if (myDefaultList == 0) { MatchArea *match_item = new MatchArea(String("*")); mySubAreas->Add(match_item); myDefaultList = match_item->MatchList(); } } SplitMatches::~SplitMatches() { // myDefaultList is a pointer to one of the items in mySubAreas and // must not be explicitly deleted here. delete mySubAreas; } void SplitMatches::Add(ResultMatch *match, char *url) { List *area_list = mySubAreas; MatchArea *area_item; area_list->Start_Get(); // This is a linear search. If there's a problem with that, we // can improve it. For now, a list with tens of areas seems lots, // and break-even with a more clever search-scheme is probably in // the hundreds. while ((area_item = (MatchArea *) area_list->Get_Next())) { // Use the first match only. if (area_item->Match(url)) { area_item->MatchList()->Add(match); return; } } // We'll get here if no match was found, so we add to the // catch-the-rest list. myDefaultList->Add(match); } // Just a simple iterator function. List * SplitMatches::Get_Next() { MatchArea *next_area = (MatchArea *) mySubAreas->Get_Next(); List *next_area_list = 0; if (next_area != 0) next_area_list = next_area->MatchList(); return next_area_list; } // Rip out the sub-areas lists and concatenate them into one list. List * SplitMatches::JoinedLists() { // We make a new list here, so we don't have to worry about // mySubAreas being dangling or null. List *all_areas = new List(); List *sub_areas = mySubAreas; MatchArea *area; sub_areas->Start_Get(); while ((area = (MatchArea *) sub_areas->Get_Next())) { // "Destructively" move the contents of the list, // leaving the original list empty. all_areas->AppendList(*(area->MatchList())); } return all_areas; } htdig-3.2.0b6/htsearch/SplitMatches.h0100644006314600127310000000267210055635554016754 0ustar angusgbhtdig// // SplitMatches.h // // SplitMatches: Constructed from a Configuration, see doc // for format of config item "search_results_order". // Used to contain a number of ResultMatches, putting them in separate // lists depending on the URL with method Add. // Iterator methods Get_First and Get_Next returns the sub-lists. // Method Joined returns a new list with all the sub-lists // concatenated. // // $Id: SplitMatches.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // // Part of the ht://Dig package // Copyright (c) 2000-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifndef _splitmatches_h #define _splitmatches_h #include "Configuration.h" #include "ResultMatch.h" #include "List.h" class SplitMatches { public: SplitMatches(Configuration &); ~SplitMatches(); void Add(ResultMatch *, char *); List *JoinedLists(); List *Get_First() { mySubAreas->Start_Get(); return Get_Next(); } List *Get_Next(); private: // These member functions are not supposed to be implemented. SplitMatches(); SplitMatches(const SplitMatches &); void operator= (const SplitMatches &); // (Lists of) Matches for each sub-area regex. List *mySubAreas; // Matches for everything else. List *myDefaultList; }; #endif /* _splitmatches_h */ htdig-3.2.0b6/htsearch/Template.cc0100644006314600127310000000363710055635554016267 0ustar angusgbhtdig// // Template.cc // // Template: A template to set the display of the search results. // MatchTemplate is used for every match, Start and End templates // are used between the header and the first match and the // last match and the footer respectively. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Template.cc,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Template.h" #include //***************************************************************************** Template::Template() { } //***************************************************************************** Template::~Template() { } //***************************************************************************** // The start and end templates are created from the filename of the // main template by appending ".start" and ".end" to the filename // respectively. // void Template::createFromFile(const char *filename) { String realFile; realFile = filename; realFile << ".start"; readFile(startTemplate, (char*)realFile); realFile = filename; realFile << ".end"; readFile(endTemplate, (char*)realFile); readFile(matchTemplate, filename); } //***************************************************************************** // Append the contents of a file to a string. Nothing happens if the file // doesn't exist. // void Template::readFile(String &s, const char *filename) const { FILE *fl = fopen(filename, "r"); char buffer[1000]; if (!fl) return; s = 0; while (fgets(buffer, sizeof(buffer), fl)) { s << buffer; } fclose(fl); } htdig-3.2.0b6/htsearch/Template.h0100644006314600127310000000304510055635554016122 0ustar angusgbhtdig// // Template.h // // Template: A template to set the display of the search results. // MatchTemplate is used for every match, Start and End templates // are used between the header and the first match and the // last match and the footer respectively. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: Template.h,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifndef _Template_h_ #define _Template_h_ #include "Object.h" #include "htString.h" // // This class holds information about output templates. // class Template : public Object { public: Template(); ~Template(); const String& getMatchTemplate() const { return matchTemplate; } const String& getStartTemplate() const { return startTemplate; } const String& getEndTemplate() const { return endTemplate; } void setMatchTemplate(const char *s) { matchTemplate = s; } void setStartTemplate(const char *s) { startTemplate = s; } void setEndTemplate(const char *s) { endTemplate = s; } void createFromFile(const char *filename); protected: String matchTemplate; String startTemplate; String endTemplate; private: void readFile(String &, const char *) const; }; #endif htdig-3.2.0b6/htsearch/TemplateList.cc0100644006314600127310000000570510055635554017121 0ustar angusgbhtdig// // TemplateList.cc // // // TemplateList: As it sounds--a list of search result templates. Reads the // configuration and any template files from disk, then retrieves // the relevant template for display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: TemplateList.cc,v 1.11 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "TemplateList.h" #include "URL.h" #include "QuotedStringList.h" //***************************************************************************** TemplateList::TemplateList() { } //***************************************************************************** TemplateList::~TemplateList() { } //***************************************************************************** // Return the template that belongs to the given internal template // name. If no template can be found, NULL is returned. // Template * TemplateList::get(const String& internalName) { for (int i = 0; i < internalNames.Count(); i++) { const String *s = (const String *) internalNames[i]; if (mystrcasecmp(*s, internalName) == 0) return (Template *) templates[i]; } return 0; } //***************************************************************************** // Create a list of templates from a configuration string. The string // will have triplets of: display name, internal name, and filename. // There are two special cases for the internal name: builtin-long and // builtin-short. These will cause a hardcoded template to be // created. All other templates are read in from the specified // filename. // int TemplateList::createFromString(const String& str) { QuotedStringList sl(str, "\t \r\n"); String display, internal, file; Template *t; if ( sl.Count() % 3) return 0; // Make sure we have a multiple of three for (int i = 0; i < sl.Count(); i += 3) { display = sl[i]; decodeURL(display); internal = sl[i + 1]; file = sl[i + 2]; displayNames.Add(new String(display)); internalNames.Add(new String(internal)); t = new Template(); if (mystrcasecmp((char*)file, "builtin-long") == 0) { String s; s << "
    $&(TITLE)"; s << "$(STARSLEFT)\n"; s << "
    $(EXCERPT)
    \n"; s << "$&(URL)\n"; s << " $(MODIFIED), $(SIZE) bytes\n"; s << "
    \n"; t->setMatchTemplate((char*)s); } else if (mystrcasecmp((char*)file, "builtin-short") == 0) { t->setMatchTemplate("$(STARSRIGHT) $&(TITLE)
    \n"); } else { t->createFromFile((char*)file); } templates.Add(t); } return 1; } htdig-3.2.0b6/htsearch/TemplateList.h0100644006314600127310000000175210055635554016761 0ustar angusgbhtdig// // TemplateList.h // // TemplateList: As it sounds--a list of search result templates. Reads the // configuration and any template files from disk, then retrieves // the relevant template for display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: TemplateList.h,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifndef _TemplateList_h_ #define _TemplateList_h_ #include "Template.h" #include "Object.h" #include "List.h" class TemplateList : public Object { public: TemplateList(); ~TemplateList(); int createFromString(const String& str); Template *get(const String& internalName); List displayNames; List internalNames; List templates; }; #endif htdig-3.2.0b6/htsearch/VolatileCache.cc0100644006314600127310000000305710055635554017213 0ustar angusgbhtdig// // VolatileCache.cc // // VolatileCache: the simplest non-persistent Query result cache. // This is default policy. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: VolatileCache.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "VolatileCache.h" #include "ResultList.h" // // a pseudo-constant empty result list // used to avoid null pointers in the cache // ResultList theEmptyResult; ResultList * const VolatileCache::empty = &theEmptyResult; extern int debug; // // find a cache entry // ResultList * VolatileCache::Lookup(const String &signature) { ResultList *result = (ResultList *)cache[signature]; return result; } // // add a cache entry // void VolatileCache::Add(const String &signature, ResultList *entry) { ResultList *previous = (ResultList *)cache[signature]; if(previous && previous != empty) { delete previous; } if(!entry) { entry = empty; } cache.Add(signature, entry); } // // clear the in-memory cache // avoids deletion of the shared 'empty' element // VolatileCache::~VolatileCache() { if(debug) cerr << "query CLEAR: entries=" << cache.Count() << endl; cache.Start_Get(); ResultList *kill = (ResultList *)cache.Get_NextElement(); while(kill) { if(kill != empty) { delete kill; } kill = (ResultList *)cache.Get_NextElement(); } cache.Release(); } htdig-3.2.0b6/htsearch/VolatileCache.h0100644006314600127310000000175210055635554017055 0ustar angusgbhtdig#ifndef _VolatileCache_h_ #define _VolatileCache_h_ // // VolatileCache.h // // VolatileCache: the simplest non-persistent Query result cache. // This is default policy. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: VolatileCache.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "QueryCache.h" #include "Dictionary.h" class VolatileCache : public QueryCache { public: // cons & destr VolatileCache() {} ~VolatileCache(); // get cached result from in-memory cache ResultList *Lookup(const String &signature); // add result to in-memory cache void Add(const String &signature, ResultList *entry); private: Dictionary cache; static ResultList * const empty; }; #endif htdig-3.2.0b6/htsearch/WeightWord.cc0100644006314600127310000000621010055635554016565 0ustar angusgbhtdig// // WeightWord.cc // // WeightWord: Contains the information necessary for a particular search word // including the resulting weight (scaling factor) and // whether the word should be hidden (ignored). // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WeightWord.cc,v 1.10 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WeightWord.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ //*************************************************************************** // WeightWord::WeightWord() // WeightWord::WeightWord() { weight = 1; records = 0; isExact = 0; isHidden = 0; isIgnore = 0; flags = FLAGS_MATCH_ONE; } //*************************************************************************** // WeightWord::WeightWord(WeightWord *ww) // WeightWord::WeightWord(WeightWord *ww) { weight = ww->weight; records = ww->records; isExact = ww->isExact; isHidden = ww->isHidden; flags = ww->flags; word = ww->word; isIgnore = 0; } //*************************************************************************** // WeightWord::WeightWord(char *word, double weight) // WeightWord::WeightWord(char *word, double weight) { records = 0; isExact = 0; isHidden = 0; isIgnore = 0; // allow a match with any field flags = FLAGS_MATCH_ONE; set(word); this->weight = weight; } //*************************************************************************** // WeightWord::WeightWord(char *word, double weight, unsigned int f) // WeightWord::WeightWord(char *word, double weight, unsigned int f) { records = 0; flags = f; // if no fields specified, allow a match with any field if (!(flags & FLAGS_MATCH_ONE)) flags ^= FLAGS_MATCH_ONE; // ideally, these flags should all just be stored in a uint... isExact = ((flags & FLAG_EXACT) != 0); isHidden = ((flags & FLAG_HIDDEN) != 0); isIgnore = ((flags & FLAG_IGNORE) != 0); set(word); this->weight = weight; } //*************************************************************************** // WeightWord::~WeightWord() // WeightWord::~WeightWord() { } //*************************************************************************** // void WeightWord::set(char *word) // void WeightWord::set(char *word) { #if 0 isExact = 0; isHidden = 0; while (strchr(word, ':')) { // // This word contains modifiers. // if (mystrncasecmp(word, "exact:", 6) == 0) { word += 6; isExact = 1; } else if (mystrncasecmp(word, "hidden:", 7) == 0) { word += 7; isHidden = 1; } else { // // There is a ':' but not a valid attribute. It must be part // of the word we are searching for. // break; } } #endif this->word = word; this->word.lowercase(); } htdig-3.2.0b6/htsearch/WeightWord.h0100644006314600127310000000226110055635554016431 0ustar angusgbhtdig// // WeightWord.h // // WeightWord: Contains the information necessary for a particular search word // including the resulting weight (scaling factor) and // whether the word should be hidden (ignored). // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WeightWord.h,v 1.8 2004/05/28 13:15:24 lha Exp $ // #ifndef _WeightWord_h_ #define _WeightWord_h_ #include "htString.h" #include "WordRecord.h" #include "HtWordReference.h" // for FLAG_... class WeightWord : public Object { public: // // Construction/Destruction // WeightWord(); WeightWord(char *word, double weight); WeightWord(char *word, double weight, unsigned int flags); WeightWord(WeightWord *); virtual ~WeightWord(); void set(char *word); String word; double weight; WordRecord *records; unsigned int flags; short int isExact; short int isHidden; short int isIgnore; }; #endif htdig-3.2.0b6/htsearch/WordSearcher.cc0100644006314600127310000000470010055635554017074 0ustar angusgbhtdig// // WordSearcher.cc // // WordSearcher: a simple word database readonly-access wrapper // generates ResultLists for the Query framework. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordSearcher.cc,v 1.4 2004/05/28 13:15:24 lha Exp $ // #include "WordSearcher.h" #include "WordType.h" #include "ResultList.h" #include "HtWordReference.h" #include "defaults.h" extern int debug; // // constructor, opens the database // WordSearcher::WordSearcher(const String &filename) : references(*(HtConfiguration::config())) { references.Open(filename, O_RDONLY); } // // gather results for a word, either from db or ignored // ResultList * WordSearcher::Search(const String &word) { ResultList *result = 0; if(IsIgnore(word)) { if(debug) cerr << "IGNORE: " << word << endl; result = new ResultList; result->Ignore(); } else { result = Fetch(word); } return result; } // // see if word must be ignored // bool WordSearcher::IsIgnore(const String &word) { HtConfiguration* config= HtConfiguration::config(); String copy = word; WordType type(*config); return 0 != type.Normalize(copy); } // // gather all references in the db, construct a ResultList // ResultList * WordSearcher::Fetch(const String &word) { if(debug) cerr << "FETCH: " << word << endl; ResultList *result = 0; List *refs = references[word]; if(refs && refs->Count()) { if(debug) cerr << "REFERENCES: " << refs->Count() << endl; result = new ResultList; DocMatch *match = new DocMatch; refs->Start_Get(); HtWordReference *ref = (HtWordReference *)refs->Get_Next(); match->SetId(ref->DocID()); match->SetAnchor(ref->Anchor()); result->add(match); unsigned int current = ref->DocID(); if(debug) cerr << "At: " << ref->DocID() << endl; while(ref) { if(ref->DocID() != current) { if(debug) cerr << "At: "<DocID()<< endl; match = new DocMatch; match->SetId(ref->DocID()); match->SetAnchor(ref->Anchor()); result->add(match); current = ref->DocID(); } if(debug) cerr << "@ "<Location()<< endl; match->AddLocation( new Location( ref->Location(), ref->Location(), ref->Flags())); ref = (HtWordReference *)refs->Get_Next(); } } return result; } htdig-3.2.0b6/htsearch/WordSearcher.h0100644006314600127310000000205110055635554016733 0ustar angusgbhtdig#ifndef _WordSearcher_h_ #define _WordSearcher_h_ // // WordSearcher.h // // WordSearcher: a simple word database readonly-access wrapper // generates ResultLists for the Query framework. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordSearcher.h,v 1.4 2004/05/28 13:15:24 lha Exp $ // #if HAVE_CONFIG_H #include "htconfig.h" #endif #include "htString.h" #include "HtWordList.h" class ResultList; class WordSearcher { public: // constructor WordSearcher(const String &filename); // fetch results for one exact word ResultList *Search(const String &word); private: // word is to be ignored bool IsIgnore(const String &word); // fetch results in database ResultList *Fetch(const String &word); // the database wrapper HtWordList references; }; #endif /* _WordSearcher_h_ */ htdig-3.2.0b6/htsearch/htsearch.cc0100644006314600127310000006551210055635554016315 0ustar angusgbhtdig// // htsearch.cc // // htsearch: The main search CGI. Parses the CGI input, reads the config files // and calls the necessary code to put together the result lists // and the final display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htsearch.cc,v 1.72 2004/05/28 13:15:24 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htsearch.h" #include "WeightWord.h" #include "parser.h" #include "Display.h" #include "../htfuzzy/Fuzzy.h" #include "cgi.h" #include "WordRecord.h" #include "HtWordList.h" #include "StringList.h" #include "IntObject.h" #include "HtURLCodec.h" #include "HtURLRewriter.h" #include "WordContext.h" #include "HtRegex.h" #include "Collection.h" #include #include #include // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif typedef void (*SIGNAL_HANDLER) (...); // ResultList *htsearch(const String&, List &, Parser *); void htsearch(Collection *, List &, Parser *); void setupWords(char *, List &, int, Parser *, String &); void createLogicalWords(List &, String &, String &); void reportError(char *); void convertToBoolean(List &words); void doFuzzy(WeightWord *, List &, List &); void addRequiredWords(List &, StringList &); void usage(); int debug = 0; int minimum_word_length = 3; StringList boolean_keywords; StringList collectionList; // List of databases to search on // reconised word prefixes (for field-restricted search and per-word fuzzy // algorithms) in *descending* alphabetical order. // Don't use a dictionary structure, as setup time outweights saving. struct {char *name; unsigned int flag; } colonPrefix [] = { { "url", FLAG_URL }, { "title", FLAG_TITLE }, { "text", FLAG_PLAIN }, // FLAG_TEXT is 0, i.e. *no* flag... { "link", FLAG_LINK_TEXT }, { "keyword", FLAG_KEYWORDS }, { "hidden", FLAG_HIDDEN }, { "heading", FLAG_HEADING }, { "exact", FLAG_EXACT }, { "descr", FLAG_DESCRIPTION }, // { "cap", FLAG_CAPITAL }, { "author", FLAG_AUTHOR }, { "", 0 }, }; //***************************************************************************** // int main() // int main(int ac, char **av) { int c; extern char *optarg; int override_config=0; // List searchWords; List *searchWords = NULL; String configFile = DEFAULT_CONFIG_FILE; int pageNumber = 1; HtRegex limit_to; HtRegex exclude_these; String logicalWords; String origPattern; String logicalPattern; // StringMatch searchWordsPattern; StringMatch *searchWordsPattern = NULL; StringList requiredWords; int i; Dictionary selected_collections; // Multiple database support // // Parse command line arguments // while ((c = getopt(ac, av, "c:dv")) != -1) { switch (c) { case 'c': // The default is obviously to do this securely // but if people want to shoot themselves in the foot... #ifndef ALLOW_INSECURE_CGI_CONFIG if (!getenv("REQUEST_METHOD")) { #endif configFile = optarg; override_config=1; #ifndef ALLOW_INSECURE_CGI_CONFIG } #endif break; case 'v': debug++; break; case 'd': debug++; break; case '?': usage(); break; } } // // The total search can NEVER take more than 5 minutes. // #ifndef _MSC_VER /* _WIN32 */ alarm(5 * 60); #endif // // Parse the CGI parameters. // char none[] = ""; cgi input(optind < ac ? av[optind] : none); // Multiple databases may be specified for search. // Identify all databases specified with the "config=" parameter. if (input.exists("config")) { collectionList.Create(input["config"], " \t\001|"); } if (collectionList.Count() == 0) collectionList.Add(""); // use default config String errorMsg = ""; String originalWords = input["words"]; originalWords.chop(" \t\r\n"); HtConfiguration* config= HtConfiguration::config(); // Iterate over all specified collections (databases) for (int cInd=0; errorMsg.empty() && cInd < collectionList.Count(); cInd++) { // Each collection is handled in an iteration. Reset the following so // that we start with a clean slate. // logicalWords = 0; origPattern = 0; logicalPattern = 0; searchWords = new List; searchWordsPattern = new StringMatch; char *config_name = collectionList[cInd]; if (config_name && config_name[0] == '\0') config_name = NULL; // use default config // // Setup the configuration database. First we read the compiled defaults. // Then we override those with defaults read in from the configuration // file, and finally we override some attributes with information we // got from the HTML form. // config->Defaults(&defaults[0]); // To allow . in filename while still being 'secure', // e.g. htdig-f.q.d.n.conf if (!override_config && config_name && (strstr(config_name, "./") == NULL)) { char *configDir = getenv("CONFIG_DIR"); if (configDir) { configFile = configDir; } else { configFile = CONFIG_DIR; } if (strlen(config_name) == 0) configFile = DEFAULT_CONFIG_FILE; else configFile << '/' << config_name << ".conf"; } if (access((char*)configFile, R_OK) < 0) { reportError(form("Unable to read configuration file '%s'", configFile.get())); } config->Read(configFile); // Initialize htword library (key description + wordtype...) WordContext::Initialize(*config); if (input.exists("method")) config->Add("match_method", input["method"]); if (input.exists("format")) config->Add("template_name", input["format"]); if (input.exists("matchesperpage")) { // minimum check for a valid int value of "matchesperpage" cgi variable if (atoi(input["matchesperpage"]) > 0) config->Add("matches_per_page", input["matchesperpage"]); } if (input.exists("page")) pageNumber = atoi(input["page"]); if (input.exists("config")) config->Add("config", input["config"]); if (input.exists("restrict")) config->Add("restrict", input["restrict"]); if (input.exists("exclude")) config->Add("exclude", input["exclude"]); if (input.exists("keywords")) config->Add("keywords", input["keywords"]); requiredWords.Create(config->Find("keywords"), " \t\r\n\001"); if (input.exists("sort")) config->Add("sort", input["sort"]); // Changes added 3-31-99, by Mike Grommet // Check form entries for starting date, and ending date // Each date consists of a month, day, and year if (input.exists("startmonth")) config->Add("startmonth", input["startmonth"]); if (input.exists("startday")) config->Add("startday", input["startday"]); if (input.exists("startyear")) config->Add("startyear", input["startyear"]); if (input.exists("endmonth")) config->Add("endmonth", input["endmonth"]); if (input.exists("endday")) config->Add("endday", input["endday"]); if (input.exists("endyear")) config->Add("endyear", input["endyear"]); // END OF CHANGES BY MIKE GROMMET minimum_word_length = config->Value("minimum_word_length", minimum_word_length); StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); for (i= 0; i < form_vars.Count(); i++) { if (input.exists(form_vars[i])) config->Add(form_vars[i], input[form_vars[i]]); } // // Compile the URL limit patterns. // if (config->Find("restrict").length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(config->Find("restrict"), " \t\r\n\001|"); limit_to.setEscaped(l); String u = l.Join('|'); config->Add("restrict", u); // re-create the config attribute } if (config->Find("exclude").length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(config->Find("exclude"), " \t\r\n\001|"); exclude_these.setEscaped(l); String u = l.Join('|'); config->Add("exclude", u); // re-create the config attribute } // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); // for htsearch, use search_rewrite_rules attribute for HtURLRewriter. config->AddParsed("url_rewrite_rules", "${search_rewrite_rules}"); url_part_errors = HtURLRewriter::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_rewrite_rules: %s", url_part_errors.get())); // Load boolean_keywords from configuration // they should be placed in this order: // 0 1 2 // and or not boolean_keywords.Destroy(); boolean_keywords.Create(config->Find("boolean_keywords"), "| \t\r\n\001"); if (boolean_keywords.Count() != 3) reportError("boolean_keywords attribute should have three entries"); Parser *parser = new Parser(); // // Parse the words to search for from the argument list. // This will produce a list of WeightWord objects. // setupWords(originalWords, *searchWords, strcmp(config->Find("match_method"), "boolean") == 0, parser, origPattern); // // Convert the list of WeightWord objects to a pattern string // that we can compile. // createLogicalWords(*searchWords, logicalWords, logicalPattern); // // Assemble the full pattern for excerpt matching and highlighting // origPattern += logicalPattern; searchWordsPattern->IgnoreCase(); searchWordsPattern->IgnorePunct(); searchWordsPattern->Pattern(logicalPattern); // this should now be enough //searchWordsPattern.Pattern(origPattern); //if (debug > 2) // cout << "Excerpt pattern: " << origPattern << "\n"; // // If required keywords were given in the search form, we will // modify the current searchWords list to include the required // words. // if (requiredWords.Count() > 0) { addRequiredWords(*searchWords, requiredWords); } // // Perform the actual search. The function htsearch() is used for this. // The Dictionary it returns is then passed on to the Display object to // actually render the results in HTML. // const String word_db = config->Find("word_db"); if (access(word_db, R_OK) < 0) { reportError(form("Unable to read word database file '%s'\nDid you run htdig?", word_db.get())); } // ResultList *results = htsearch((char*)word_db, searchWords, parser); String doc_index = config->Find("doc_index"); if (access((char*)doc_index, R_OK) < 0) { reportError(form("Unable to read document index file '%s'\nDid you run htdig?", doc_index.get())); } const String doc_db = config->Find("doc_db"); if (access(doc_db, R_OK) < 0) { reportError(form("Unable to read document database file '%s'\nDid you run htdig?", doc_db.get())); } const String doc_excerpt = config->Find("doc_excerpt"); if (access(doc_excerpt, R_OK) < 0) { reportError(form("Unable to read document excerpts '%s'\nDid you run htdig?", doc_excerpt.get())); } // Multiple database support Collection *collection = new Collection((char*)configFile, word_db.get(), doc_index.get(), doc_db.get(), doc_excerpt.get()); // Perform search within the collection. Each collection stores its // own result list. htsearch(collection, *searchWords, parser); collection->setSearchWords(searchWords); collection->setSearchWordsPattern(searchWordsPattern); selected_collections.Add(configFile, collection); if (parser->hadError()) errorMsg = parser->getErrorMessage(); delete parser; } // Display display(doc_db, 0, doc_excerpt); Display display(&selected_collections); if (display.hasTemplateError()) { reportError(form("Unable to read template file '%s'\nDoes it exist?", (const char*)config->Find("template_name"))); return 0; } display.setOriginalWords(originalWords); // display.setResults(results); // display.setSearchWords(&searchWords); display.setLimit(&limit_to); display.setExclude(&exclude_these); // display.setAllWordsPattern(searchWordsPattern); display.setCGI(&input); display.setLogicalWords(logicalWords); if (!errorMsg.empty()) display.displaySyntaxError(errorMsg); else display.display(pageNumber); // delete results; // delete parser; return 0; } //***************************************************************************** void createLogicalWords(List &searchWords, String &logicalWords, String &wm) { String pattern; int i; int wasHidden = 0; int inPhrase = 0; for (i = 0; i < searchWords.Count(); i++) { WeightWord *ww = (WeightWord *) searchWords[i]; if (!ww->isHidden) { if (strcmp((char*)ww->word, "&") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[AND] << ' '; else if (strcmp((char*)ww->word, "|") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[OR] << ' '; else if (strcmp((char*)ww->word, "!") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[NOT] << ' '; else if (strcmp((char*)ww->word, "\"") == 0 && wasHidden == 0) { if (inPhrase) logicalWords.chop(' '); inPhrase = !inPhrase; logicalWords << "\""; } else if (wasHidden == 0) { logicalWords << ww->word; if (inPhrase) logicalWords << " "; } wasHidden = 0; } else wasHidden = 1; // generate patterns to search for and highlight in excerpt if (ww->weight > 0 // Ignore boolean syntax stuff && (!ww->isIgnore || inPhrase)) // Ignore bad/short words { // but highlight them in phrases char spacer = inPhrase ? ' ' : '|'; if (wm.length()) wm << spacer; wm << ww->word; if (!ww->isIgnore) // ignore bad/short words for searching { if (pattern.length()) pattern << spacer; pattern << ww->word; } } } if (debug) { cerr << "LogicalWords: " << logicalWords << endl; cerr << "Pattern: " << pattern << endl; cerr << "Highlight Pattern: " << wm << endl; } } void dumpWords(List &words, char *msg = "") { if (debug) { cerr << msg << ": '"; for (int i = 0; i < words.Count(); i++) { WeightWord *ww = (WeightWord *) words[i]; cerr << ww->word << ':' << ww->isHidden << ' '; } cerr << "'\n"; } } //***************************************************************************** // void setupWords(char *allWords, List &searchWords, // int boolean, Parser *parser, String &originalPattern) // void setupWords(char *allWords, List &searchWords, int boolean, Parser *parser, String &originalPattern) { HtConfiguration* config= HtConfiguration::config(); List tempWords; int i; // // Parse the words we need to search for. It should be a list of words // with optional 'and' and 'or' between them. The list of words // will be put in the searchWords list and at the same time in the // String pattern separated with '|'. // // // Convert the string to a list of WeightWord objects. The special // characters '(' and ')' will be put into their own WeightWord objects. // unsigned char *pos = (unsigned char*) allWords; unsigned char t; String word; const String prefix_suffix = config->Find("prefix_match_character"); while (*pos) { while (1) { if (debug > 3) cerr << "setupWords: " << pos << endl; t = *pos++; if (isspace(t)) { continue; } else if (t == '"') { tempWords.Add(new WeightWord("\"", -1.0)); break; } else if (boolean && (t == '(' || t == ')')) { char s[2]; s[0] = t; s[1] = '\0'; tempWords.Add(new WeightWord(s, -1.0)); break; } else if (HtIsWordChar(t) || (strchr(prefix_suffix, t) != NULL) || (t >= 161 && t <= 255)) { unsigned int fieldFlag = 0; word = 0; do // while recognised prefix, followed by ':' { while (t && (HtIsWordChar(t) || (strchr(prefix_suffix, t) != NULL) || (t >= 161 && t <= 255))) { word << (char) t; t = *pos++; } if (debug > 2) cerr << "word: " << word << endl; if (t == ':') // e.g. "author:word" to search { // only in author word.lowercase(); t = *pos++; if (t && (HtIsWordChar (t) || (strchr(prefix_suffix, t) != NULL) || (t >= 161 && t <= 255))) { int i, cmp; const char *w = word.get(); // linear search of known prefixes, with "" flag. for (i = 0; (cmp = mystrcasecmp (w, colonPrefix[i].name)) < 0; i++) ; if (debug > 2) cerr << "field: "<< colonPrefix[i].name << endl; if (cmp == 0) // if prefix found... { fieldFlag |= colonPrefix [i].flag; word = 0; } } } } while (!word.length() && t); pos--; if (!t && !word.length()) // query ended with junk chars break; if (boolean && (mystrcasecmp(word.get(), "+") == 0 || mystrcasecmp(word.get(), boolean_keywords[AND]) == 0)) { tempWords.Add(new WeightWord("&", -1.0)); } else if (boolean && mystrcasecmp(word.get(), boolean_keywords[OR]) == 0) { tempWords.Add(new WeightWord("|", -1.0)); } else if (boolean && (mystrcasecmp(word.get(), "-") == 0 || mystrcasecmp(word.get(), boolean_keywords[NOT]) == 0)) { tempWords.Add(new WeightWord("!", -1.0)); } else { // Add word to excerpt matching list originalPattern << word << "|"; WeightWord *ww = new WeightWord(word, 1.0, fieldFlag); if(HtWordNormalize(word) & WORD_NORMALIZE_NOTOK) ww->isIgnore = 1; tempWords.Add(ww); } break; } } } dumpWords(tempWords, "tempWords"); // // If the user specified boolean expression operators, the whole // expression has to be syntactically correct. If not, we need // to report a syntax error. // if (boolean) { if (!parser->checkSyntax(&tempWords)) { for (i = 0; i < tempWords.Count(); i++) { searchWords.Add(tempWords[i]); } tempWords.Release(); return; // reportError("Syntax error"); } } else { convertToBoolean(tempWords); } dumpWords(tempWords, "Boolean"); // // We need to assign weights to the words according to the search_algorithm // configuration attribute. // For algorithms other than exact, we need to also do word lookups. // StringList algs(config->Find("search_algorithm"), " \t"); List algorithms; String name, weight; double fweight; Fuzzy *fuzzy = 0; // // Generate the list of algorithms to use and associate the given // weights with them. // for (i = 0; i < algs.Count(); i++) { name = strtok(algs[i], ":"); weight = strtok(0, ":"); if (name.length() == 0) name = "exact"; if (weight.length() == 0) weight = "1"; fweight = atof((char*)weight); fuzzy = Fuzzy::getFuzzyByName(name, *config); if (fuzzy) { if (debug > 1) cerr << "Adding algorithm " << name.get() << endl; fuzzy->setWeight(fweight); fuzzy->openIndex(); algorithms.Add(fuzzy); } else if (debug) cerr << "Unknown fuzzy search algorithm " << name.get() << endl; } dumpWords(searchWords, "initial"); // // For each of the words, apply all the algorithms. // int in_phrase = 0; // If we get into a phrase, we don't want to fuzz. for (i = 0; i < tempWords.Count(); i++) { WeightWord *ww = (WeightWord *) tempWords[i]; if (ww->weight > 0 && !ww->isIgnore && !in_phrase) // I think that should be: // if (ww->weight > 0 && !ww->isIgnore && !in_phrase && !ww->isExact) { // // Apply all the algorithms to the word. // if (debug) cerr << "Fuzzy on: " << ww->word << endl; doFuzzy(ww, searchWords, algorithms); delete ww; } else if (ww->word.length() == 1 && ww->word[0] == '"') { in_phrase = !in_phrase; if (debug) cerr << "Add: " << ww->word << endl; searchWords.Add(ww); } else { // // This is '(', ')', '&', or '|'. These will be automatically // transfered to the searchWords list. // if (debug) cerr << "Add: " << ww->word << endl; searchWords.Add(ww); } dumpWords(searchWords, "searchWords"); } tempWords.Release(); } //***************************************************************************** void doFuzzy(WeightWord *ww, List &searchWords, List &algorithms) { List fuzzyWords; List weightWords; Fuzzy *fuzzy = 0; WeightWord *newWw = 0; String *word = 0; algorithms.Start_Get(); while ((fuzzy = (Fuzzy *) algorithms.Get_Next())) { if (debug > 1) cerr << " " << fuzzy->getName(); fuzzy->getWords(ww->word, fuzzyWords); fuzzyWords.Start_Get(); while ((word = (String *) fuzzyWords.Get_Next())) { if (debug > 1) cerr << " " << word->get(); // (should be a "copy with changed weight" constructor...) newWw = new WeightWord(word->get(), fuzzy->getWeight()); newWw->isExact = ww->isExact; newWw->isHidden = ww->isHidden; newWw->flags = ww->flags; weightWords.Add(newWw); } if (debug > 1) cerr << endl; fuzzyWords.Destroy(); } // // We now have a list of substitute words. They need to be added // to the searchWords. // if (weightWords.Count()) { if (weightWords.Count() > 1) searchWords.Add(new WeightWord("(", -1.0)); for (int i = 0; i < weightWords.Count(); i++) { if (i > 0) searchWords.Add(new WeightWord("|", -1.0)); searchWords.Add(weightWords[i]); } if (weightWords.Count() > 1) searchWords.Add(new WeightWord(")", -1.0)); } else // if no fuzzy matches, add exact word, but give it tiny weight { searchWords.Add(new WeightWord(ww->word.get(), 0.000001)); } weightWords.Release(); } //***************************************************************************** // void convertToBoolean(List &words) // void convertToBoolean(List &words) { HtConfiguration* config= HtConfiguration::config(); List list; int i; int do_and = strcmp(config->Find("match_method"), "and") == 0; int in_phrase = 0; String quote = "\""; if (words.Count() == 0) return; list.Add(words[0]); // We might start off with a phrase match if (((WeightWord *) words[0])->word == quote) in_phrase = 1; for (i = 1; i < words.Count(); i++) { if (do_and && !in_phrase) list.Add(new WeightWord("&", -1.0)); else if (!in_phrase) list.Add(new WeightWord("|", -1.0)); if (((WeightWord *) words[i])->word == quote) in_phrase = !in_phrase; list.Add(words[i]); } words.Release(); for (i = 0; i < list.Count(); i++) { words.Add(list[i]); } list.Release(); } //***************************************************************************** // Dictionary *htsearch(char *wordfile, List &searchWords, Parser *parser) // This returns a dictionary indexed by document ID and containing a // List of HtWordReference objects. // void htsearch(Collection *collection, List &searchWords, Parser *parser) { // // Pick the database type we are going to use // ResultList *matches = new ResultList; if (searchWords.Count() > 0) { // parser->setDatabase(wordfile); parser->setCollection(collection); parser->parse(&searchWords, *matches); } collection->setResultList(matches); // return matches; } //***************************************************************************** // Modify the search words list to include the required words as well. // This is done by putting the existing search words in parenthesis and // appending the required words separated with "and". void addRequiredWords(List &searchWords, StringList &requiredWords) { HtConfiguration* config= HtConfiguration::config(); static int any_keywords = config->Boolean("any_keywords", 0); if (requiredWords.Count() == 0) return; if (searchWords.Count() > 0) { searchWords.Insert(new WeightWord("(", -1.0), 0); searchWords.Add(new WeightWord(")", -1.0)); searchWords.Add(new WeightWord("&", -1.0)); } if (requiredWords.Count() == 1) { searchWords.Add(new WeightWord(requiredWords[0], 1.0)); } else { searchWords.Add(new WeightWord("(", -1.0)); searchWords.Add(new WeightWord(requiredWords[0], 1.0)); for (int i = 1; i < requiredWords.Count(); i++) { if (any_keywords) searchWords.Add(new WeightWord("|", -1.0)); else searchWords.Add(new WeightWord("&", -1.0)); searchWords.Add(new WeightWord(requiredWords[i], 1.0)); } searchWords.Add(new WeightWord(")", -1.0)); } } //***************************************************************************** // Report an error. Since we don' know if we are running as a CGI or not, // we will assume this is the first thing returned by a CGI program. // void reportError(char *msg) { HtConfiguration* config= HtConfiguration::config(); cout << "Content-type: text/html\r\n\r\n"; cout << "htsearch error\n"; cout << "\n"; cout << "

    ht://Dig error

    \n"; cout << "

    htsearch detected an error. Please report this to the\n"; cout << "webmaster of this site by sending an e-mail to:\n"; cout << "Find("maintainer") << "\">"; cout << config->Find("maintainer") << "\n"; cout << "The error message is:

    \n"; cout << "
    \n" << msg << "\n
    \n\n"; exit(1); } //***************************************************************************** // void usage() // Display program usage information--assumes we're running from a cmd line // void usage() { cout << "usage: htsearch [-v][-d][-c configfile] [query_string]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v -d\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; cout << "\tquery_string\tA CGI-style query string can be given as a single\n"; cout << "\t\targument, and is only used if the REQUEST_METHOD environment\n"; cout << "\t\tvariable is not set. If no query_string is given, and\n"; cout << "\t\tREQUEST_METHOD is not set, htsearch will prompt for the query.\n\n"; exit(0); } htdig-3.2.0b6/htsearch/htsearch.h0100644006314600127310000000305310055635555016150 0ustar angusgbhtdig// // htsearch.h // // htsearch: The main search CGI. Parses the CGI input, reads the config files // and calls the necessary code to put together the result lists // and the final display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htsearch.h,v 1.16 2004/05/28 13:15:25 lha Exp $ // #ifndef _htsearch_h_ #define _htsearch_h_ #include "List.h" #include "StringList.h" #include "Dictionary.h" #include "DocumentRef.h" #include "Database.h" #include "good_strtok.h" #include "DocumentDB.h" #include "htString.h" #include "HtConfiguration.h" #include "ResultMatch.h" #include "ResultList.h" #include "HtWordReference.h" #include "StringMatch.h" #include "defaults.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #ifndef _MSC_VER /* _WIN32 */ #include #endif extern int n_matches; extern int do_and; extern int do_short; extern StringList fields; #ifndef _MSC_VER /* _WIN32 */ extern StringMatch limit_to; #endif extern StringMatch URLimage; extern List URLimageList; extern StringMatch wm; extern Database *dbf; extern String logicalWords; extern String originalWords; extern int debug; extern StringList collectionList; #endif htdig-3.2.0b6/htsearch/parser.cc0100644006314600127310000005544110062361331015773 0ustar angusgbhtdig// // parser.cc // // parser: Parses a boolean expression tree, retrieving and scoring // the resulting document list // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: parser.cc,v 1.36 2004/06/11 16:50:33 grdetil Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "parser.h" #include "HtPack.h" #include "Collection.h" #include "Dictionary.h" #include "QuotedStringList.h" #define WORD 1000 #define DONE 1001 QuotedStringList boolean_syntax_errors; enum ErrorIndices { EXPECTED, SEARCH_WORD, AT_END, INSTEAD_OF, END_OF_EXPR, QUOTE }; //***************************************************************************** Parser::Parser() : words(*(HtConfiguration::config())) { tokens = 0; result = 0; current = 0; valid = 1; } //***************************************************************************** // int Parser::checkSyntax(List *tokenList) // As the name of the function implies, we will only perform a syntax check // on the list of tokens. // int Parser::checkSyntax(List *tokenList) { HtConfiguration* config= HtConfiguration::config(); void reportError(char *); // Load boolean_syntax_errors from configuration // they should be placed in this order: // 0 1 2 3 4 // Expected "a search word" "at the end" "instead of" "end of expression" // 5 // "a closing quote" boolean_syntax_errors.Destroy(); boolean_syntax_errors.Create(config->Find("boolean_syntax_errors"), "| \t\r\n\001"); if (boolean_syntax_errors.Count() == 5) { // for backward compatibility boolean_syntax_errors.Add (new String ("a closing quote")); if (debug) cerr << "Parser::checkSyntax() : boolean_syntax_errors should have six entries\n"; } else if (boolean_syntax_errors.Count() != 6) reportError("boolean_syntax_errors attribute should have six entries"); tokens = tokenList; valid = 1; fullexpr(0); return valid; } //***************************************************************************** /* Called by: Parser::parse(List*, ResultList&), checkSyntax(List*) */ /* Inputs: output -- if zero, simply check syntax */ /* otherwise, list matching documents in head of "stack" */ void Parser::fullexpr(int output) { tokens->Start_Get(); lookahead = lexan(); expr(output); if (valid && lookahead != DONE) { setError(boolean_syntax_errors[END_OF_EXPR]); } } //***************************************************************************** int Parser::lexan() { current = (WeightWord *) tokens->Get_Next(); if (!current) return DONE; else if (mystrcasecmp((char*)current->word, "&") == 0) return '&'; else if (mystrcasecmp((char*)current->word, "|") == 0) return '|'; else if (mystrcasecmp((char*)current->word, "!") == 0) return '!'; else if (mystrcasecmp((char*)current->word, "(") == 0) return '('; else if (mystrcasecmp((char*)current->word, ")") == 0) return ')'; else if (mystrcasecmp((char*)current->word, "\"") == 0) return '"'; else return WORD; } //***************************************************************************** // Attempt to deal with expressions in the form // term | term | term ... /* Called by: Parser::fullexpr(int), factor(int) */ /* Inputs: output -- if zero, simply check syntax */ void Parser::expr(int output) { term(output); while (1) { if (match('|')) { term(output); if (output) { if(debug) cerr << "or--" << endl; perform_or(); if(debug) cerr << "stack:" << stack.Size() << endl; } } else break; } if (valid && lookahead == WORD) { String expected = "'"; expected << boolean_keywords[AND] << "' "<< boolean_keywords[OR] <<" '" << boolean_keywords[OR] << "'"; setError(expected.get()); } } //***************************************************************************** // Attempt to deal with terms in the form // factor & factor & factor ... /* Called by: Parser::expr(int) */ /* Inputs: output -- if zero, simply check syntax */ void Parser::term(int output) { factor(output); if(debug) cerr << "term:factor" << endl; while (1) { if(match('&')) { factor(output); if(output) { if(debug) cerr << "and--" << endl; perform_and(); if(debug) cerr << "stack:" << stack.Size() << endl; } } else if(match('!')) { factor(output); if(output) { if(debug) cerr << "not--" << endl; perform_not(); if(debug) cerr << "stack:" << stack.Size() << endl; } } else { break; } } } //***************************************************************************** /* Gather and score a (possibly bracketed) boolean expression */ /* Called by: Parser::term(int) */ /* Inputs: output -- if zero, simply check syntax */ void Parser::factor(int output) { if(match('"')) { phrase(output); } else if (match('(')) { expr(output); if (match(')')) { return; } else { setError("')'"); } } else if (lookahead == WORD) { if (output) { perform_push(); } lookahead = lexan(); } else { setError(boolean_syntax_errors[SEARCH_WORD]); // setError("a search word, a quoted phrase, a boolean expression between ()"); } } //***************************************************************************** /* Gather and score a quoted phrase */ /* Called by: Parser::factor(int) */ /* Inputs: output -- if zero, simply check syntax */ void Parser::phrase(int output) { List *wordList = 0; double weight = 1.0; while (1) { if (match('"')) { if (output) { if(!wordList) wordList = new List; if(debug) cerr << "scoring phrase" << endl; score(wordList, weight, FLAGS_MATCH_ONE); // look in all fields } break; } else if (lookahead == WORD) { weight *= current->weight; if (output) perform_phrase(wordList); lookahead = lexan(); } else if (lookahead == DONE) { setError(boolean_syntax_errors[QUOTE]); break; } else { // skip '&' '|' and '!' in the phrase current->isIgnore = 1; if (output) perform_phrase(wordList); lookahead = lexan (); } } // end while if(wordList) delete wordList; } //***************************************************************************** int Parser::match(int t) { if (lookahead == t) { lookahead = lexan(); return 1; } else return 0; } //***************************************************************************** void Parser::setError(char *expected) { if (valid) { valid = 0; error = 0; error << boolean_syntax_errors[EXPECTED] << ' ' << expected; if (lookahead == DONE || !current) { error << ' ' << boolean_syntax_errors[AT_END]; } else { error << ' ' << boolean_syntax_errors[INSTEAD_OF] << " '" << current->word.get() << "'"; switch (lookahead) { case '&': error << ' ' << boolean_keywords[OR] << " '" << boolean_keywords[AND] << "'"; break; case '|': error << ' ' << boolean_keywords[OR] << " '" << boolean_keywords[OR] << "'"; break; case '!': error << ' ' << boolean_keywords[OR] << " '" << boolean_keywords[NOT] << "'"; break; } } if (debug) cerr << "Syntax error: " << error << endl; } } //***************************************************************************** // Perform a lookup of the current word and push the result onto the stack // void Parser::perform_push() { HtConfiguration* config= HtConfiguration::config(); static int maximum_word_length = config->Value("maximum_word_length", 12); String temp = current->word.get(); char *p; if(debug) cerr << "perform_push @"<< stack.Size() << ": " << temp << endl; String wildcard = config->Find("prefix_match_character"); if (!wildcard.get()) wildcard = "*"; if (temp == wildcard) { if (debug) cerr << "Wild card search\n"; ResultList *list = new ResultList; String doc_db = config->Find("doc_db"); DocumentDB docdb; docdb.Read(doc_db); List *docs = docdb.DocIDs(); // // Traverse all the known documents // DocumentRef *ref; IntObject *id; DocMatch *dm; docs->Start_Get(); while ((id = (IntObject *) docs->Get_Next())) { ref = docdb[id->Value()]; if (debug) cerr << (ref ? "Wildcard match" : "Wildcard empty") << endl; if (ref) { dm = new DocMatch; dm->score = current->weight; dm->id = ref->DocID(); dm->orMatches = 1; dm->anchor = 0; list->add(dm); } delete ref; } delete docs; stack.push(list); return; } // Must be after wildcard: "*" is "isIgnore" because it is too short. if (current->isIgnore) { if(debug) cerr << "ignore: " << temp << " @" << stack.Size() << endl; // // This word needs to be ignored. Make it so. // ResultList *list = new ResultList; list->isIgnore = 1; stack.push(list); return; } temp.lowercase(); p = temp.get(); if (temp.length() > maximum_word_length) p[maximum_word_length] = '\0'; List* result = words[p]; score(result, current->weight, current->flags); delete result; } //***************************************************************************** // BUG: Phrases containing "bad words" can have *any* "bad word" in that // position. Words less than minimum_word_length ignored entirely, // as they are not indexed. void Parser::perform_phrase(List * &oldWords) { HtConfiguration* config= HtConfiguration::config(); static int maximum_word_length = config->Value("maximum_word_length", 12); String temp = current->word.get(); char *p; List *newWords = 0; HtWordReference *oldWord, *newWord; // how many words ignored since last checked word? static int ignoredWords = 0; // if the query is empty, no further effort is needed if(oldWords && oldWords->Count() == 0) { if(debug) cerr << "phrase not found, skip" << endl; return; } if(debug) cerr << "phrase current: " << temp << endl; if (current->isIgnore) { // // This word needs to be ignored. Make it so. // if (temp.length() >= config->Value ("minimum_word_length") && oldWords) ignoredWords++; if(debug) cerr << "ignoring: " << temp << endl; return; } temp.lowercase(); p = temp.get(); if (temp.length() > maximum_word_length) p[maximum_word_length] = '\0'; newWords = words[p]; if(debug) cerr << "new words count: " << newWords->Count() << endl; // If we don't have a prior list of words, we want this one... if (!oldWords) { oldWords = new List; if(debug) cerr << "phrase adding first: " << temp << endl; newWords->Start_Get(); while ((newWord = (HtWordReference *) newWords->Get_Next())) { oldWords->Add(newWord); } if(debug) cerr << "old words count: " << oldWords->Count() << endl; return; } // OK, now we have a previous list in wordList and a new list List *results = new List; Dictionary newDict(5000); String nid; newWords->Start_Get(); while ((newWord = (HtWordReference *) newWords->Get_Next())) { nid = ""; int did = newWord->DocID(); nid << did; nid << "-"; int loc = newWord->Location(); nid << loc; if (! newDict.Exists(nid)) { newDict.Add(nid, (Object *)newWord); } else { // cerr << "perform_phrase: NewWords Duplicate: " << nid << "\n"; // Double addition is a problem if you don't want your original objects deleted } } String oid; oldWords->Start_Get(); while ((oldWord = (HtWordReference *) oldWords->Get_Next())) { oid = ""; int did = oldWord->DocID(); oid << did; oid << "-"; int loc = oldWord->Location(); oid << loc + ignoredWords+1; if (newDict.Exists(oid)) { newWord = (HtWordReference *)newDict.Find(oid); HtWordReference *result = new HtWordReference(*oldWord); result->Flags(oldWord->Flags() & newWord->Flags()); result->Location(newWord->Location()); results->Add(result); } } ignoredWords = 0; // most recent word is not a non-ignored word newDict.Release(); if(debug) cerr << "old words count: " << oldWords->Count() << endl; if(debug) cerr << "results count: " << results->Count() << endl; oldWords->Destroy(); results->Start_Get(); while ((newWord = (HtWordReference *) results->Get_Next())) { oldWords->Add(newWord); } if(debug) cerr << "old words count: " << oldWords->Count() << endl; results->Release(); delete results; newWords->Destroy(); delete newWords; } //***************************************************************************** // Allocate scores based on words in wordList. // Fields within which the word must appear are specified in flags // (see HtWordReference.h). void Parser::score(List *wordList, double weight, unsigned int flags) { HtConfiguration* config= HtConfiguration::config(); DocMatch *dm; HtWordReference *wr; static double text_factor = config->Double("text_factor", 1); static double caps_factor = config->Double("caps_factor", 1); static double title_factor = config->Double("title_factor", 1); static double heading_factor = config->Double("heading_factor", 1); static double keywords_factor = config->Double("keywords_factor", 1); static double meta_description_factor = config->Double("meta_description_factor", 1); static double author_factor = config->Double("author_factor", 1); static double description_factor = config->Double("description_factor", 1); double wscore; int docanchor; int word_count; if (!wordList || wordList->Count() == 0) { // We can't score an empty list, so push a null pointer... if(debug) cerr << "score: empty list, push 0 @" << stack.Size() << endl; stack.push(0); return; } ResultList *list = new ResultList; if(debug) cerr << "score: push @" << stack.Size() << endl; stack.push(list); // We're now guaranteed to have a non-empty list // We'll use the number of occurences of this word for scoring word_count = wordList->Count(); wordList->Start_Get(); while ((wr = (HtWordReference *) wordList->Get_Next())) { // // ******* Compute the score for the document // // If word not in one of the required fields, skip the entry. // Plain text sets no flag in dbase, so treat it separately. if (!(wr->Flags() & flags) && (wr->Flags() || !(flags & FLAG_PLAIN))) { if (debug > 2) cerr << "Flags " << wr->Flags() << " lack " << flags << endl; continue; } wscore = 0.0; if (wr->Flags() == FLAG_TEXT) wscore += text_factor; if (wr->Flags() & FLAG_CAPITAL) wscore += caps_factor; if (wr->Flags() & FLAG_TITLE) wscore += title_factor; if (wr->Flags() & FLAG_HEADING) wscore += heading_factor; if (wr->Flags() & FLAG_KEYWORDS) wscore += keywords_factor; if (wr->Flags() & FLAG_DESCRIPTION) wscore += meta_description_factor; if (wr->Flags() & FLAG_AUTHOR) wscore += author_factor; if (wr->Flags() & FLAG_LINK_TEXT) wscore += description_factor; wscore *= weight; wscore = wscore / (double)word_count; docanchor = wr->Anchor(); dm = list->find(wr->DocID()); if (dm) { wscore += dm->score; if (dm->anchor < docanchor) docanchor = dm->anchor; // We wish to *update* this, not add a duplicate list->remove(wr->DocID()); } dm = new DocMatch; dm->id = wr->DocID(); dm->score = wscore; dm->orMatches = 1; // how many "OR" terms this doc has dm->anchor = docanchor; list->add(dm); } } //***************************************************************************** // The top two entries in the stack need to be ANDed together. // // a b a and b // 0 0 0 // 0 1 0 // 0 x 0 // 1 0 0 // 1 1 intersect(a,b) // 1 x a // x 0 0 // x 1 b // x x x // void Parser::perform_and() { ResultList *l1 = (ResultList *) stack.pop(); ResultList *l2 = (ResultList *) stack.pop(); int i; DocMatch *dm, *dm2, *dm3; HtVector *elements; if(!(l2 && l1)) { if(debug) cerr << "and: at least one empty operator, pushing 0 @" << stack.Size() << endl; stack.push(0); if(l1) delete l1; if(l2) delete l2; return; } // // If either of the arguments is set to be ignored, we will use the // other as the result. // remember l2 and l1, l2 not l1 if (l1->isIgnore && l2->isIgnore) { if(debug) cerr << "and: ignoring all, pushing ignored list @" << stack.Size() << endl; ResultList *result = new ResultList; result->isIgnore = 1; delete l1; delete l2; stack.push(result); return; } else if (l1->isIgnore) { if(debug) cerr << "and: ignoring l1, pushing l2 @" << stack.Size() << endl; stack.push(l2); delete l1; return; } else if (l2->isIgnore) { if(debug) cerr << "and: ignoring l2, pushing l2 @" << stack.Size() << endl; stack.push(l1); delete l2; return; } ResultList *result = new ResultList; stack.push(result); elements = l2->elements(); if(debug) cerr << "perform and: " << elements->Count() << " " << l1->elements()->Count() << " "; for (i = 0; i < elements->Count(); i++) { dm = (DocMatch *) (*elements)[i]; dm2 = l1->find(dm->id); if (dm2) { // // Duplicate document. Add scores and average "OR-matches" count // dm3 = new DocMatch; // "if (dm2)" means "?:" operator not needed... // dm3->score = dm->score + (dm2 ? dm2->score : 0); // dm3->orMatches = (dm->orMatches + (dm2 ? dm2->orMatches : 0))/2; dm3->score = dm->score + dm2->score; dm3->orMatches = (dm->orMatches + dm2->orMatches)/2; dm3->id = dm->id; dm3->anchor = dm->anchor; // if (dm2 && dm2->anchor < dm3->anchor) if (dm2->anchor < dm3->anchor) dm3->anchor = dm2->anchor; result->add(dm3); } } if(debug) cerr << result->elements()->Count() << endl; elements->Release(); delete elements; delete l1; delete l2; } // a b a not b // 0 0 0 // 0 1 0 // 0 x 0 // 1 0 a // 1 1 intersect(a,not b) // 1 x a // x 0 x // x 1 x // x x x void Parser::perform_not() { ResultList *l1 = (ResultList *) stack.pop(); ResultList *l2 = (ResultList *) stack.pop(); int i; DocMatch *dm, *dm2, *dm3; HtVector *elements; if(!l2) { if(debug) cerr << "not: no positive term, pushing 0 @" << stack.Size() << endl; // Should probably be interpreted as "* not l1" stack.push(0); if(l1) delete l1; return; } if(!l1 || l1->isIgnore || l2->isIgnore) { if(debug) cerr << "not: no negative term, pushing positive @" << stack.Size() << endl; stack.push(l2); if(l1) delete l1; return; } ResultList *result = new ResultList; if(debug) cerr << "not: pushing result @" << stack.Size() << endl; stack.push(result); elements = l2->elements(); if(debug) cerr << "perform not: " << elements->Count() << " " << l1->elements()->Count() << " "; for (i = 0; i < elements->Count(); i++) { dm = (DocMatch *) (*elements)[i]; dm2 = l1->find(dm->id); if (!dm2) { // // Duplicate document. // dm3 = new DocMatch; dm3->score = dm->score; dm3->orMatches = dm->orMatches; dm3->id = dm->id; dm3->anchor = dm->anchor; result->add(dm3); } } if(debug) cerr << result->elements()->Count() << endl; elements->Release(); delete elements; delete l1; delete l2; } //***************************************************************************** // The top two entries in the stack need to be ORed together. // void Parser::perform_or() { ResultList *l1 = (ResultList *) stack.pop(); ResultList *result = (ResultList *) stack.peek(); int i; DocMatch *dm, *dm2; HtVector *elements; // // If either of the arguments is not present, we will use the other as // the results. // if (!l1 && result) { if(debug) cerr << "or: no 2nd operand" << endl; return; // result in top of stack } else if (l1 && !result) { if(debug) cerr << "or: no 1st operand" << endl; stack.pop(); stack.push(l1); return; } else if (!l1 && !result) { if(debug) cerr << "or: no operands" << endl; stack.pop(); stack.push(0); // empty result return; } // // If either of the arguments is set to be ignored, we will use the // other as the result. // if (l1->isIgnore) { delete l1; return; } else if (result->isIgnore) { result = (ResultList *) stack.pop(); stack.push(l1); delete result; return; } elements = l1->elements(); if(debug) cerr << "perform or: " << elements->Count() << " " << result->elements()->Count() << " "; for (i = 0; i < elements->Count(); i++) { dm = (DocMatch *) (*elements)[i]; dm2 = result->find(dm->id); if (dm2) { // // Update document. Add scores and add "OR-match" counts // dm2->score += dm->score; dm2->orMatches += dm->orMatches; if (dm->anchor < dm2->anchor) dm2->anchor = dm->anchor; } else { dm2 = new DocMatch; dm2->score = dm->score; dm2->orMatches = dm->orMatches; dm2->id = dm->id; dm2->anchor = dm->anchor; result->add(dm2); } } if(debug) cerr << result->elements()->Count() << endl; elements->Release(); delete elements; delete l1; } //***************************************************************************** // void Parser::parse(List *tokenList, ResultList &resultMatches) // void Parser::parse(List *tokenList, ResultList &resultMatches) { HtConfiguration* config= HtConfiguration::config(); tokens = tokenList; DocumentRef *ref = NULL; fullexpr(1); ResultList *result = (ResultList *) stack.pop(); if (!result) // Ouch! { // It seems we now end up here on a syntax error, so don't clear anything! // valid = 0; // error = 0; // error << "Expected to have something to parse!"; return; } HtVector *elements = result->elements(); DocMatch *dm; // multimatch_factor gives extra weight to matching documents which // contain more than one "OR" term. This is applied after the whole // document is parsed, so multiple matches don't give exponentially // increasing weights double multimatch_factor = config->Double("multimatch_factor"); for (int i = 0; i < elements->Count(); i++) { dm = (DocMatch *) (*elements)[i]; ref = collection->getDocumentRef(dm->GetId()); if(ref && ref->DocState() == Reference_normal) { dm->collection = collection; // back reference if (dm->orMatches > 1) dm->score *= 1+multimatch_factor; resultMatches.add(dm); } } elements->Release(); result->Release(); delete elements; delete result; } void Parser::setCollection(Collection *coll) { if (coll) words.Open(coll->getWordFile(), O_RDONLY); collection = coll; } htdig-3.2.0b6/htsearch/parser.h0100644006314600127310000000337210055635555015647 0ustar angusgbhtdig// // parser.h // // parser: Parses a boolean expression tree, retrieving and scoring // the resulting document list // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: parser.h,v 1.18 2004/05/28 13:15:25 lha Exp $ // #ifndef _parser_h_ #define _parser_h_ #include "htsearch.h" #include "WeightWord.h" #include "ResultList.h" #include "DocMatch.h" #include "Database.h" #include "htString.h" #include "Stack.h" #include "HtWordList.h" #include class Collection; class Parser { public: Parser(); int checkSyntax(List *); void parse(List *, ResultList &); // void setDatabase(const String& db) { words.Open(db, O_RDONLY); } void setCollection(Collection *collection); char *getErrorMessage() {return error.get();} int hadError() {return valid == 0;} protected: void fullexpr(int); int lexan(); void phrase(int); void expr(int); void term(int); void factor(int); int match(int); void setError(char *); void perform_push(); void perform_and(); void perform_not(); void perform_or(); void perform_phrase(List * &); void score(List *, double weight, unsigned int flags); List *tokens; List *result; WeightWord *current; int lookahead; int valid; Stack stack; String error; Collection *collection; // Multiple database support HtWordList words; }; extern StringList boolean_keywords; enum KeywordIndices { AND, OR, NOT }; #endif htdig-3.2.0b6/htsearch/parsetest.cc0100644006314600127310000001076110055635555016523 0ustar angusgbhtdig// // parsetest.cc // // parsetest: A program to test the ParseTree classes as replacement for the current // parsing code // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: parsetest.cc,v 1.4 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "cgi.h" #include "defaults.h" #include "ParseTree.h" #include "AndParseTree.h" #include "OrParseTree.h" #include "ExactParseTree.h" #include "WordContext.h" // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif void reportError(char *msg); void usage(); int debug = 0; //***************************************************************************** // int main() // int main(int ac, char **av) { int c; extern char *optarg; int override_config=0; List *searchWords = NULL; String configFile = DEFAULT_CONFIG_FILE; String logicalWords; // // Parse command line arguments // while ((c = getopt(ac, av, "c:dv")) != -1) { switch (c) { case 'c': configFile = optarg; override_config = 1; break; case 'v': debug++; break; case 'd': debug++; break; case '?': usage(); break; } } // // Parse the CGI parameters. // char none[] = ""; cgi input(optind < ac ? av[optind] : none); String originalWords = input["words"]; originalWords.chop(" \t\r\n"); // Set up the config config.Defaults(&defaults[0]); if (access((char*)configFile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configFile.get())); } config.Read(configFile); // Initialize htword library (key description + wordtype...) WordContext::Initialize(config); ParseTree *testParse; testParse = new ParseTree; if ( testParse->Parse(originalWords) != NOTOK) { cout << "Parsing as a boolean query... " << endl; cout << "Initial Query:" << testParse->GetQuery() << endl; cout << "Logical Words:" << testParse->GetLogicalWords() << endl; } else cout << "Parsing as a boolean query FAILED" << endl; delete testParse; testParse = new AndParseTree; if ( testParse->Parse(originalWords) != NOTOK) { cout << "Parsing as an AND query... " << endl; cout << "Initial Query:" << testParse->GetQuery() << endl; cout << "Logical Words:" << testParse->GetLogicalWords() << endl; } else cout << "Parsing as an AND query FAILED" << endl; delete testParse; testParse = new OrParseTree; if ( testParse->Parse(originalWords) != NOTOK) { cout << "Parsing as an OR query... " << endl; cout << "Initial Query:" << testParse->GetQuery() << endl; cout << "Logical Words:" << testParse->GetLogicalWords() << endl; } else cout << "Parsing as an OR query FAILED" << endl; delete testParse; testParse = new ExactParseTree; if ( testParse->Parse(originalWords) != NOTOK) { cout << "Parsing as an EXACT query... " << endl; cout << "Initial Query:" << testParse->GetQuery() << endl; cout << "Logical Words:" << testParse->GetLogicalWords() << endl; } else cout << "Parsing as an EXACT query FAILED" << endl; delete testParse; } //***************************************************************************** // void usage() // Display program usage information--assumes we're running from a cmd line // void usage() { cout << "usage: parsetest [-v][-d][-c configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v -d\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "parsetest: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/htsearch/qtest.cc0100644006314600127310000001262710055635555015654 0ustar angusgbhtdig// // qtest.cc // // qtest: A program to test the Query classes as replacement for the current // parsing code // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: qtest.cc,v 1.5 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "cgi.h" #include "defaults.h" #include "WordContext.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include "QueryParser.h" #include "Query.h" #include "ResultList.h" #include "Exact.h" #include "Accents.h" #include "Prefix.h" #include "WordSearcher.h" #include "OrFuzzyExpander.h" #include "ExactWordQuery.h" #include "OrQueryParser.h" #include "AndQueryParser.h" #include "BooleanQueryParser.h" #include "GParser.h" // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif void reportError(char *msg); void usage(); int debug = 0; void ParseAndGet(QueryParser &parser, const String &string); //***************************************************************************** // int main() // int main(int ac, char **av) { int c; extern char *optarg; int override_config=0; String configFile = DEFAULT_CONFIG_FILE; String logicalWords; bool doall = true, doand = false, door = false, dobool = false, dogeoffs = false; // // Parse command line arguments // while ((c = getopt(ac, av, "c:dvkaobg")) != -1) { switch (c) { case 'c': configFile = optarg; override_config = 1; break; case 'v': debug++; break; case 'd': debug++; break; case 'a': doall = false; doand = true; break; case 'o': doall = false; door = true; break; case 'b': doall = false; dobool = true; break; case 'g': doall = false; dogeoffs = true; break; case '?': usage(); break; } } // // Parse the CGI parameters. // char none[] = ""; cgi input(optind < ac ? av[optind] : none); String originalWords = input["words"]; originalWords.chop(" \t\r\n"); HtConfiguration* config= HtConfiguration::config(); // Set up the config config->Defaults(&defaults[0]); if (access((char*)configFile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configFile.get())); } config->Read(configFile); // Initialize htword library (key description + wordtype...) WordContext::Initialize(*config); OrFuzzyExpander exp; Exact exact(*config); exact.setWeight(1.0); exact.openIndex(); exp.Add(&exact); Accents accents(*config); accents.setWeight(0.7); accents.openIndex(); exp.Add(&accents); Prefix prefix(*config); prefix.setWeight(0.7); prefix.openIndex(); exp.Add(&prefix); QueryParser::SetFuzzyExpander(&exp); WordSearcher searcher(config->Find("word_db")); ExactWordQuery::SetSearcher(&searcher); // -- put here your prefered cache //QueryCache *cache = new XXX; //Query::SetCache(cache); OrQueryParser o; BooleanQueryParser b; GParser g; AndQueryParser a; if(doall || doand) { cout << "Trying and..." << endl; ParseAndGet(a, originalWords); } if(doall || door) { cout << "Trying or..." << endl; ParseAndGet(o, originalWords); } if(doall || dobool) { cout << "Trying boolean..." << endl; ParseAndGet(b, originalWords); } if(doall || dogeoffs) { cout << "Trying no-precedence-boolean..." << endl; ParseAndGet(g, originalWords); } } void ParseAndGet(QueryParser &parser, const String &query) { Query *q = parser.Parse(query); if(q) { cout << "Parsed: " << q->GetLogicalWords() << endl; ResultList *l = q->GetResults(); if(l) { cout << "Evaluated with " << l->Count() << " matches" << endl; if(debug) l->Dump(); } else { cout << "No matches" << endl;; } } else { cerr << "syntax error: " << flush << parser.Error() << endl; } delete q; } //***************************************************************************** // void usage() // Display program usage information--assumes we're running from a cmd line // void usage() { cout << "usage: qtest [-a][-o][-b][-g][-v][-d][-c configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v -d\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; cout << "\t-a\tPerform only and/all parsing\n\n"; cout << "\t-o\tPerform only or/any parsing\n\n"; cout << "\t-b\tPerform only boolean parsing\n\n"; cout << "\t-g\tPerform only no-precedence-boolean parsing\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "qtest: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/httools/0040755006314600127310000000000010063260370014057 5ustar angusgbhtdightdig-3.2.0b6/httools/.cvsignore0100644006314600127310000000012307427026545016066 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htpurge htload htdump htstat htnotify htdig-3.2.0b6/httools/Makefile.am0100644006314600127310000000167507723256616016142 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config LOCAL_DEFINES= -DSENDMAIL=\"$(SENDMAIL)\" bin_PROGRAMS = htpurge htnotify htdump htstat htload htmerge htpurge_SOURCES = htpurge.cc htpurge_DEPENDENCIES = $(HTLIBS) htpurge_LDFLAGS = $(PROFILING) ${extra_ldflags} htpurge_LDADD = $(HTLIBS) htnotify_SOURCES = htnotify.cc htnotify_DEPENDENCIES = $(HTLIBS) htnotify_LDFLAGS = $(PROFILING) ${extra_ldflags} htnotify_LDADD = $(HTLIBS) htdump_SOURCES = htdump.cc htdump_DEPENDENCIES = $(HTLIBS) htdump_LDFLAGS = $(PROFILING) ${extra_ldflags} htdump_LDADD = $(HTLIBS) htstat_SOURCES = htstat.cc htstat_DEPENDENCIES = $(HTLIBS) htstat_LDFLAGS = $(PROFILING) ${extra_ldflags} htstat_LDADD = $(HTLIBS) htload_SOURCES = htload.cc htload_DEPENDENCIES = $(HTLIBS) htload_LDFLAGS = $(PROFILING) ${extra_ldflags} htload_LDADD = $(HTLIBS) htmerge_SOURCES = htmerge.cc htmerge_DEPENDENCIES = $(HTLIBS) htmerge_LDFLAGS = $(PROFILING) ${extra_ldflags} htmerge_LDADD = $(HTLIBS) htdig-3.2.0b6/httools/Makefile.in0100644006314600127310000003626110063260372016133 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la LOCAL_DEFINES = -DSENDMAIL=\"$(SENDMAIL)\" bin_PROGRAMS = htpurge htnotify htdump htstat htload htmerge htpurge_SOURCES = htpurge.cc htpurge_DEPENDENCIES = $(HTLIBS) htpurge_LDFLAGS = $(PROFILING) ${extra_ldflags} htpurge_LDADD = $(HTLIBS) htnotify_SOURCES = htnotify.cc htnotify_DEPENDENCIES = $(HTLIBS) htnotify_LDFLAGS = $(PROFILING) ${extra_ldflags} htnotify_LDADD = $(HTLIBS) htdump_SOURCES = htdump.cc htdump_DEPENDENCIES = $(HTLIBS) htdump_LDFLAGS = $(PROFILING) ${extra_ldflags} htdump_LDADD = $(HTLIBS) htstat_SOURCES = htstat.cc htstat_DEPENDENCIES = $(HTLIBS) htstat_LDFLAGS = $(PROFILING) ${extra_ldflags} htstat_LDADD = $(HTLIBS) htload_SOURCES = htload.cc htload_DEPENDENCIES = $(HTLIBS) htload_LDFLAGS = $(PROFILING) ${extra_ldflags} htload_LDADD = $(HTLIBS) htmerge_SOURCES = htmerge.cc htmerge_DEPENDENCIES = $(HTLIBS) htmerge_LDFLAGS = $(PROFILING) ${extra_ldflags} htmerge_LDADD = $(HTLIBS) subdir = httools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = bin_PROGRAMS = htpurge$(EXEEXT) htnotify$(EXEEXT) htdump$(EXEEXT) \ htstat$(EXEEXT) htload$(EXEEXT) htmerge$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_htdump_OBJECTS = htdump.$(OBJEXT) htdump_OBJECTS = $(am_htdump_OBJECTS) am_htload_OBJECTS = htload.$(OBJEXT) htload_OBJECTS = $(am_htload_OBJECTS) am_htmerge_OBJECTS = htmerge.$(OBJEXT) htmerge_OBJECTS = $(am_htmerge_OBJECTS) am_htnotify_OBJECTS = htnotify.$(OBJEXT) htnotify_OBJECTS = $(am_htnotify_OBJECTS) am_htpurge_OBJECTS = htpurge.$(OBJEXT) htpurge_OBJECTS = $(am_htpurge_OBJECTS) am_htstat_OBJECTS = htstat.$(OBJEXT) htstat_OBJECTS = $(am_htstat_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(htdump_SOURCES) $(htload_SOURCES) $(htmerge_SOURCES) \ $(htnotify_SOURCES) $(htpurge_SOURCES) $(htstat_SOURCES) DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.config \ Makefile.am SOURCES = $(htdump_SOURCES) $(htload_SOURCES) $(htmerge_SOURCES) $(htnotify_SOURCES) $(htpurge_SOURCES) $(htstat_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign httools/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done htdump$(EXEEXT): $(htdump_OBJECTS) $(htdump_DEPENDENCIES) @rm -f htdump$(EXEEXT) $(CXXLINK) $(htdump_LDFLAGS) $(htdump_OBJECTS) $(htdump_LDADD) $(LIBS) htload$(EXEEXT): $(htload_OBJECTS) $(htload_DEPENDENCIES) @rm -f htload$(EXEEXT) $(CXXLINK) $(htload_LDFLAGS) $(htload_OBJECTS) $(htload_LDADD) $(LIBS) htmerge$(EXEEXT): $(htmerge_OBJECTS) $(htmerge_DEPENDENCIES) @rm -f htmerge$(EXEEXT) $(CXXLINK) $(htmerge_LDFLAGS) $(htmerge_OBJECTS) $(htmerge_LDADD) $(LIBS) htnotify$(EXEEXT): $(htnotify_OBJECTS) $(htnotify_DEPENDENCIES) @rm -f htnotify$(EXEEXT) $(CXXLINK) $(htnotify_LDFLAGS) $(htnotify_OBJECTS) $(htnotify_LDADD) $(LIBS) htpurge$(EXEEXT): $(htpurge_OBJECTS) $(htpurge_DEPENDENCIES) @rm -f htpurge$(EXEEXT) $(CXXLINK) $(htpurge_LDFLAGS) $(htpurge_OBJECTS) $(htpurge_LDADD) $(LIBS) htstat$(EXEEXT): $(htstat_OBJECTS) $(htstat_DEPENDENCIES) @rm -f htstat$(EXEEXT) $(CXXLINK) $(htstat_LDFLAGS) $(htstat_OBJECTS) $(htstat_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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: $(mkinstalldirs) $(DESTDIR)$(bindir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am # 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: htdig-3.2.0b6/httools/Makefile.win320100644006314600127310000000404207677124213016471 0ustar angusgbhtdig# # Makefile - makefile for htsearch # APP_NAME = Right Now Web CGI RNT_PRODUCT = rnw TARGET1 = $(BINDIR)/htdump$(EXESFX) TARGET2 = $(BINDIR)/htload$(EXESFX) TARGET3 = $(BINDIR)/htmerge$(EXESFX) TARGET4 = $(BINDIR)/htnotify$(EXESFX) TARGET5 = $(BINDIR)/htpurge$(EXESFX) TARGET6 = $(BINDIR)/htstat$(EXESFX) #htdump.cc htload.cc htmerge.cc htnotify.cc htpurge.cc htstat.cc include ../Makedefs.win32 # ----------------------------------------------------------------------------- # add new executable members to this list CXXSRC = htdump.cc htload.cc htmerge.cc htnotify.cc htpurge.cc htstat.cc OBJS1 = win32/htdump.obj OBJS2 = win32/htload.obj OBJS3 = win32/htmerge.obj OBJS4 = win32/htnotify.obj OBJS5 = win32/htpurge.obj OBJS6 = win32/htstat.obj CPPFLAGS += -DHAVE_CONFIG_H -DSENDMAIL=\"\" -I. -I../include -I../htlib -I../htcommon -I../htword -I../db -I../htnet LDLIBS = ../lib/$(ARCH)/libhtnet.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libcommon.lib ../lib/$(ARCH)/libhtword.lib ../lib/$(ARCH)/libht.lib ../lib/$(ARCH)/libfuzzy.lib ../lib/$(ARCH)/libhtdb.lib OTHERLIBS = ws2_32.lib L:/win32/lib/zlib114/zlib.lib DEPLIBS += $(LDLIBS) win32/%.obj: %.cc %.c $(CC) $(CPPFLAGS) -c $< -o $@ all: $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) $(TARGET6) $(TARGET1): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS1) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS1) $(LDLIBS) $(OTHERLIBS) $(TARGET2): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS2) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS2) $(LDLIBS) $(OTHERLIBS) $(TARGET3): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS3) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS3) $(LDLIBS) $(OTHERLIBS) $(TARGET4): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS4) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS4) $(LDLIBS) $(OTHERLIBS) $(TARGET5): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS5) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS5) $(LDLIBS) $(OTHERLIBS) $(TARGET6): $(OBJDIRDEP) $(BINDIRDEP) $(OBJS6) $(DEPLIBS) $(EXELD) $(LDFLAGS) $(OBJS6) $(LDLIBS) $(OTHERLIBS) include ../Makerules.win32 htdig-3.2.0b6/httools/htdump.cc0100644006314600127310000001145310055635555015704 0ustar angusgbhtdig// // htdump.cc // // htdump: A utility to create ASCII text versions of the document // and/or word databases. These can be used by external programs, // edited, or used as a platform and version-independent form of the DB. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htdump.cc,v 1.6 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordContext.h" #include "HtURLCodec.h" #include "HtWordList.h" #include "HtConfiguration.h" #include "DocumentDB.h" #include "defaults.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif int verbose = 0; void usage(); void reportError(char *msg); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int do_words = 1; int do_docs = 1; int alt_work_area = 0; String configfile = DEFAULT_CONFIG_FILE; int c; extern char *optarg; while ((c = getopt(ac, av, "vdwc:a")) != -1) { switch (c) { case 'c': configfile = optarg; break; case 'v': verbose++; break; case 'a': alt_work_area++; break; case 'w': do_words = 0; break; case 'd': do_docs = 0; break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configfile.get())); } config->Read(configfile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); // We may need these through the methods we call if (alt_work_area != 0) { String configValue; configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } } if (do_docs) { const String doc_list = config->Find("doc_list"); unlink(doc_list); DocumentDB docs; if (docs.Read(config->Find("doc_db"), config->Find("doc_index"), config->Find("doc_excerpt")) == OK) { docs.DumpDB(doc_list, verbose); docs.Close(); } } if (do_words) { // Initialize htword WordContext::Initialize(*config); const String word_dump = config->Find("word_dump"); unlink(word_dump); HtWordList words(*config); if(words.Open(config->Find("word_db"), O_RDONLY) == OK) { words.Dump(word_dump); words.Close(); } } return 0; } //***************************************************************************** // void usage() // Display program usage information // void usage() { cout << "usage: htdump [-v][-d][-w][-a][-c configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-d\tDo NOT dump the document database.\n\n"; cout << "\t-w\tDo NOT dump the word database.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htdump to append .work to the database files \n"; cout << "\t\tallowing it to operate on a second set of databases.\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "htdump: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/httools/htload.cc0100644006314600127310000001140110055635555015647 0ustar angusgbhtdig// // htload.cc // // htload: A utility to read ASCII text versions of the document // and/or word databases. These can be used by external programs, // edited, or used as a platform and version-independent form of the DB. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htload.cc,v 1.6 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordContext.h" #include "HtURLCodec.h" #include "HtWordList.h" #include "HtConfiguration.h" #include "DocumentDB.h" #include "defaults.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif int verbose = 0; void usage(); void reportError(char *msg); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int do_words = 1; int do_docs = 1; int alt_work_area = 0; String configfile = DEFAULT_CONFIG_FILE; int c; extern char *optarg; while ((c = getopt(ac, av, "vdwc:a")) != -1) { switch (c) { case 'c': configfile = optarg; break; case 'v': verbose++; break; case 'a': alt_work_area++; break; case 'w': do_words = 0; break; case 'd': do_docs = 0; break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configfile.get())); } config->Read(configfile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); // We may need these through the methods we call if (alt_work_area != 0) { String configValue; configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } } if (do_docs) { const String doc_list = config->Find("doc_list"); DocumentDB docs; if (docs.Open(config->Find("doc_db"), config->Find("doc_index"), config->Find("doc_excerpt")) == OK) { docs.LoadDB(doc_list, verbose); docs.Close(); } } if (do_words) { // Initialize htword WordContext::Initialize(*config); const String word_dump = config->Find("word_dump"); HtWordList words(*config); if(words.Open(config->Find("word_db"), O_RDWR) == OK) { words.Load(word_dump); words.Close(); } } return 0; } //***************************************************************************** // void usage() // Display program usage information // void usage() { cout << "usage: htload [-v][-d][-w][-a][-c configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-d\tDo NOT load the document database.\n\n"; cout << "\t-w\tDo NOT load the word database.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htload to append .work to the database files \n"; cout << "\t\tallowing it to operate on a second set of databases.\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "htload: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/httools/htmerge.cc0100644006314600127310000002457210055635555016044 0ustar angusgbhtdig// // htmerge.cc // // htmerge: Merges two databases and/or updates databases to remove // old documents and ensures the databases are consistent. // Calls db.cc, docs.cc, and/or words.cc as necessary // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htmerge.cc,v 1.7 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordContext.h" #include "good_strtok.h" #include "defaults.h" #include "DocumentDB.h" #include "HtURLCodec.h" #include "HtWordList.h" #include "HtWordReference.h" #include "htString.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include #include #include // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif // // This hash is used to keep track of all the document IDs which have to be // discarded. // This is generated from the doc database and is used to prune words // from the word db // Dictionary discard_list; // This config is used for merging multiple databses HtConfiguration merge_config; int verbose = 0; int stats = 0; // Component procedures void mergeDB(); void usage(); void reportError(char *msg); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int alt_work_area = 0; String configfile = DEFAULT_CONFIG_FILE; String merge_configfile = 0; int c; extern char *optarg; while ((c = getopt(ac, av, "svm:c:dwa")) != -1) { switch (c) { case 'd': break; case 'w': break; case 'c': configfile = optarg; break; case 'm': merge_configfile = optarg; break; case 'v': verbose++; break; case 's': break; case 'a': alt_work_area++; break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configfile.get())); } config->Read(configfile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); if (merge_configfile.length()) { merge_config.Defaults(&defaults[0]); if (access((char*)merge_configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", merge_configfile.get())); } merge_config.Read(merge_configfile); } if (alt_work_area != 0) { String configValue; configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } } WordContext::Initialize(*config); if (merge_configfile.length()) { // Merge the databases specified in merge_configfile into the current // databases. Do this first then update the other databases as usual // Note: We don't have to specify anything, it's all in the config vars mergeDB(); } return 0; } //***************************************************************************** // void mergeDB() // void mergeDB() { HtConfiguration* config= HtConfiguration::config(); DocumentDB merge_db, db; List *urls; Dictionary merge_dup_ids, db_dup_ids; // Lists of DocIds to ignore int docIDOffset; const String doc_index = config->Find("doc_index"); if (access(doc_index, R_OK) < 0) { reportError(form("Unable to open document index '%s'", (const char*)doc_index)); } const String doc_excerpt = config->Find("doc_excerpt"); if (access(doc_excerpt, R_OK) < 0) { reportError(form("Unable to open document excerpts '%s'", (const char*)doc_excerpt)); } const String doc_db = config->Find("doc_db"); if (db.Open(doc_db, doc_index, doc_excerpt) < 0) { reportError(form("Unable to open/create document database '%s'", (const char*)doc_db)); } const String merge_doc_index = merge_config["doc_index"]; if (access(merge_doc_index, R_OK) < 0) { reportError(form("Unable to open document index '%s'", (const char*)merge_doc_index)); } const String merge_doc_excerpt = merge_config["doc_excerpt"]; if (access(merge_doc_excerpt, R_OK) < 0) { reportError(form("Unable to open document excerpts '%s'", (const char*)merge_doc_excerpt)); } const String merge_doc_db = merge_config["doc_db"]; if (merge_db.Open(merge_doc_db, merge_doc_index, merge_doc_excerpt) < 0) { reportError(form("Unable to open document database '%s'", (const char*)merge_doc_db)); } // Start the merging by going through all the URLs that are in // the database to be merged urls = merge_db.URLs(); // This ensures that every document added from merge_db has a unique ID // in the new database docIDOffset = db.NextDocID(); urls->Start_Get(); String *url; String id; while ((url = (String *) urls->Get_Next())) { DocumentRef *ref = merge_db[url->get()]; DocumentRef *old_ref = db[url->get()]; if (!ref) continue; if (old_ref) { // Oh well, we knew this would happen. Let's get the duplicate // And we'll only use the most recent date. if ( old_ref->DocTime() >= ref->DocTime() ) { // Cool, the ref we're merging is too old, just ignore it char str[20]; sprintf(str, "%d", ref->DocID()); merge_dup_ids.Add(str, 0); if (verbose > 1) { cout << "htmerge: Duplicate, URL: " << url << " ignoring merging copy \n"; cout.flush(); } } else { // The ref we're merging is newer, delete the old one and add char str[20]; sprintf(str, "%d", old_ref->DocID()); db_dup_ids.Add(str, 0); db.Delete(old_ref->DocID()); ref->DocID(ref->DocID() + docIDOffset); db.Add(*ref); if (verbose > 1) { cout << "htmerge: Duplicate, URL: "; cout << url->get() << " ignoring destination copy \n"; cout.flush(); } } } else { // It's a new URL, just add it, making sure to load the excerpt merge_db.ReadExcerpt(*ref); ref->DocID(ref->DocID() + docIDOffset); db.Add(*ref); if (verbose > 1) { cout << "htmerge: Merged URL: " << url->get() << " \n"; cout.flush(); } } delete ref; delete old_ref; } delete urls; // As reported by Roman Dimov, we must update db.NextDocID() // because of all the added records... db.IncNextDocID( merge_db.NextDocID() ); merge_db.Close(); db.Close(); // OK, after merging the doc DBs, we do the same for the words HtWordList mergeWordDB(*config), wordDB(*config); List *words; String docIDKey; if (wordDB.Open(config->Find("word_db"), O_RDWR) < 0) { reportError(form("Unable to open/create document database '%s'", (const char*)config->Find("word_db"))); } if (mergeWordDB.Open(merge_config["word_db"], O_RDONLY) < 0) { reportError(form("Unable to open document database '%s'", (const char *)merge_config["word_db"])); } // Start the merging by going through all the URLs that are in // the database to be merged words = mergeWordDB.WordRefs(); words->Start_Get(); HtWordReference *word; while ((word = (HtWordReference *) words->Get_Next())) { docIDKey = word->DocID(); if (merge_dup_ids.Exists(docIDKey)) continue; word->DocID(word->DocID() + docIDOffset); wordDB.Override(*word); } delete words; words = wordDB.WordRefs(); words->Start_Get(); while ((word = (HtWordReference *) words->Get_Next())) { docIDKey = word->DocID(); if (db_dup_ids.Exists(docIDKey)) wordDB.Delete(*word); } delete words; // Cleanup--just close the two word databases mergeWordDB.Close(); wordDB.Close(); } //***************************************************************************** // void usage() // Display program usage information // void usage() { cout << "usage: htmerge [-v][-c configfile][-m merge_configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-m merge_configfile\n"; cout << "\t\tMerge the databases specified into the databases specified\n"; cout << "\t\tby -c or the default.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htmerge to append .work to database files causing\n"; cout << "\t\ta second copy of the database to be built. This allows\n"; cout << "\t\toriginal files to be used by htsearch during the indexing\n"; cout << "\t\trun.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "htmerge: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/httools/htnotify.cc0100644006314600127310000003615010055635555016250 0ustar angusgbhtdig// // htnotify.cc // // htnotify: Check through databases and look for notify META information // Send e-mail to addresses mentioned in documents if the doc // has "expired" // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htnotify.cc,v 1.8 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "HtConfiguration.h" #include "Dictionary.h" #include "DocumentDB.h" #include "DocumentRef.h" #include "defaults.h" #include "HtURLCodec.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include #include // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif // Declare a record for storing email/URL data for later retrieval class EmailNotification : public Object { public: EmailNotification (char* date, char* email, char* url, char* subject); // //accessors // String getDate() const { return date; } String getEmail() const { return email; } String getUrl() const { return url; } String getSubject() const { return subject; } private: String date; String email; String url; String subject; }; EmailNotification::EmailNotification (char* pDate, char* pEmail, char* pUrl, char* pSubject) { date = pDate; email = pEmail; url = pUrl; if (!pSubject || !*pSubject) { subject = "page expired"; } else { subject = pSubject; } } void htnotify(DocumentRef &); void usage(); void readPreAndPostamble(void); void add_notification(char *date, char *email, char *url, char *subject); void send_notification(char *email, List * notifList); void send_email(List * notifList, String& command, String& to, String& listText, int singleSubject); int parse_date(char *date, int &year, int &month, int &day); int verbose = 0; int sendEmail = 1; // // This variable is used to hold today's date. It is global for // efficiency reasons since computing it is a relatively expensive // operation // struct tm *today; // // This structure holds the set of email notifications requiring // sending. It is indexed by email address of recipients, and // each entry is a List of EmailNotification objects. // Dictionary * allNotifications; // // These strings holds the preamble/postamble text used in // email messages. // String preambleText; String postambleText; //{{{ main //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int c; extern char *optarg; String base; String configFile = DEFAULT_CONFIG_FILE; while ((c = getopt(ac, av, "nvb:c:")) != -1) { switch (c) { case 'b': base = optarg; break; case 'c': configFile = optarg; break; case 'v': verbose++; break; case 'n': verbose++; sendEmail = 0; break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); config->Read(configFile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) { cerr << form("htnotify: Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get()) << endl; exit (1); } if (base.length()) { config->Add("database_base", base); } String doc_db = config->Find("doc_db"); DocumentDB docdb; docdb.Read(doc_db); List *docs = docdb.DocIDs(); // // Compute today's date // time_t now = time(0); today = localtime(&now); readPreAndPostamble(); // // Traverse all the known documents to check for notification requirements // allNotifications = new Dictionary(); DocumentRef *ref; IntObject *id; docs->Start_Get(); while ((id = (IntObject *) docs->Get_Next())) { ref = docdb[id->Value()]; if (ref) htnotify(*ref); delete ref; } delete docs; // // Iterate through the list of notifications // allNotifications->Start_Get(); char * email; while ((email = (char *) allNotifications->Get_Next())) { List * notifList = (List *) allNotifications->Find (email); send_notification(email, notifList); } // // tidy up // docdb.Close(); delete allNotifications; return 0; } //}}} //{{{ readPreAndPostamble //***************************************************************************** // void readPreAndPostamble(void) // void readPreAndPostamble(void) { HtConfiguration* config= HtConfiguration::config(); const char* prefixfile = config->Find("htnotify_prefix_file"); const char* suffixfile = config->Find("htnotify_suffix_file"); // define default preamble text - blank string preambleText = ""; if (prefixfile != NULL && *prefixfile) { ifstream in(prefixfile); char buffer[1024]; if (! in.bad()) { while (! in.bad() && ! in.eof()) { in.getline(buffer, sizeof(buffer)); if (in.eof() && !*buffer) break; preambleText << buffer << '\n'; } in.close(); } } // define default postamble text postambleText = ""; postambleText << "Note: This message will be sent again if you do not change or\n"; postambleText << "take away the notification of the above mentioned HTML page.\n"; postambleText << "\n"; postambleText << "Find out more about the notification service at\n\n"; postambleText << " http://www.htdig.org/meta.html\n\n"; postambleText << "Cheers!\n\nht://Dig Notification Service\n"; if (suffixfile != NULL && *suffixfile) { ifstream in(suffixfile); char buffer[1024]; if (! in.bad()) { postambleText = ""; while (! in.bad() && ! in.eof()) { in.getline(buffer, sizeof(buffer)); if (in.eof() && !*buffer) break; postambleText << buffer << '\n'; } in.close(); } } if (verbose > 1) { cout << "Preamble text:" << endl; cout << preambleText << endl << endl; cout << "Postamble text:" << endl; cout << postambleText << endl; cout << endl; } } //}}} //{{{ htnotify //***************************************************************************** // void htnotify(DocumentRef &ref) // void htnotify(DocumentRef &ref) { char *date = ref.DocNotification(); char *email = ref.DocEmail(); if (date && *date && email && *email) { if (verbose > 2) { cout << "Saw a date:" << endl; cout << "Date: " << date << endl; cout << "URL: " << ref.DocURL() << endl; cout << "Subject: " << ref.DocSubject() << endl; cout << "Email: " << email << endl; cout << endl; } int month, day, year; if (!parse_date(date, year, month, day)) { // Parsing Failed if (verbose > 2) { cout << "Malformed date: " << date << endl; } add_notification(date, email, ref.DocURL(), "Malformed Date"); return; } year -= 1900; month--; // // Compare this date with today's date // if (year < today->tm_year || (year == today->tm_year && month < today->tm_mon) || (year == today->tm_year && month == today->tm_mon && day < today->tm_mday)) { // // It seems that this date is either today or before // today. Send a notification // add_notification(date, email, ref.DocURL(), ref.DocSubject()); } else { // Page not yet expired if (verbose > 2) { cout << "htnotify: URL " << ref.DocURL() << " (" << year+1900 << "-" << month+1 << "-" << day << ")" << endl; } } } } //}}} //{{{ add_notification //***************************************************************************** // void add_notification(char *date, char *email, char *url, char *subject) // void add_notification(char *date, char *email, char *url, char *subject) { List * list = (List *) allNotifications->Find (email); if (list == NULL) { // here's a new recipient so add it list = new List(); allNotifications->Add (email, list); } // now add the notification to the selected list EmailNotification* notif = new EmailNotification(date, email, url, subject); list->Add (notif); } //}}} //{{{ send_notification //***************************************************************************** // void send_notification(char * email, List * notifList) // void send_notification(char* email, List * notifList) { String command = SENDMAIL; command << " -t"; String em = email; String to = ""; char *token = strtok(em.get(), " ,\t\r\n"); while (token) { if (*token) { if (to.length()) to << ", "; to << token; } token = strtok(0, " ,\t\r\n"); } // Before we use the email address string, we may want to sanitize it. // static char ok_chars[] = "abcdefghijklmnopqrstuvwxyz // ABCDEFGHIJKLMNOPQRSTUVWXYZ // 1234567890_-.@/=+:%!, "; // char *cursor; // cursor into email address // for (cursor = to.get(); *(cursor += strspn(cursor, ok_chars));) // *cursor = '_'; // Set it to something harmless EmailNotification* notif = (EmailNotification*) notifList->Get_First(); String firstSubject = notif->getSubject(); int singleSubject = 1; // // scan to determine whether the same subject message is used throughout // notifList->Start_Get(); notifList->Get_Next(); // continue with the second item in the list while ((notif = (EmailNotification*) notifList->Get_Next())) { String current = notif->getSubject(); if ( firstSubject != current ) { singleSubject = 0; break; } } // // Aggregate the list text // String listText = ""; notifList->Start_Get(); while ((notif = (EmailNotification*) notifList->Get_Next())) { listText << notif->getUrl() << '\n'; listText << " expired " << notif->getDate() << "\n"; if (! singleSubject) { listText << " " << notif->getSubject() << '\n'; } } if (sendEmail) { send_email (notifList, command, to, listText, singleSubject); } else if (verbose) { // just list the notifiable pages cout << endl; cout << "Notification required to " << to << endl; cout << listText; } } //}}} //{{{ send_email //***************************************************************************** // void send_email(List * notifList, String& command, String& to) // void send_email (List * notifList, String& command, String& to, String& listText, int singleSubject) { HtConfiguration* config= HtConfiguration::config(); String from = "\""; from << config->Find("htnotify_webmaster") << "\" <" << config->Find("htnotify_sender") << ">"; String replyto = config->Find("htnotify_replyto"); if (verbose) { if (verbose > 1) { cout << endl; } cout << "From: " << from << endl; cout << "To: " << to << endl; if (verbose > 1) { cout << listText; } } FILE *fileptr; if ( (fileptr = popen(command.get(), "w")) != NULL ) { EmailNotification* notif = (EmailNotification*) notifList->Get_First(); String out; out << "From: " << from << '\n'; out << "To: " << to << '\n'; if (replyto.length() > 0) { out << "Reply-To: " << replyto << '\n'; } if (singleSubject) { out << "Subject: " << notif->getSubject() << '\n'; } else { out << "Subject: Web page expiry (" << notif->getSubject() << ", inter alia)\n"; } out << '\n'; // this is the important header/body separator out << preambleText; out << listText; out << postambleText; out << '\n'; fputs( out.get(), fileptr ); pclose( fileptr ); } else { perror( "popen" ); } } //***************************************************************************** // Display usage information for the htnotify program // void usage() { cout << "usage: htnotify [-c configfile][-b db_base]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "There can be any number or words.\n"; cout << "Options:\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead of the default.\n\n"; cout << "\t-b db_base\n"; cout << "\t\tSet the base path of the document database.\n"; cout << "\t-v\n"; cout << "\t\tIncrease the verbose level. Use two or three times for\n"; cout << "\t\tmore output.\n"; cout << "\t-n\n"; cout << "\t\tDon't send any email, just list what has expired.\n"; exit(0); } //}}} //{{{ parse_date //***************************************************************************** // Parse the notification date string from the user's document // int parse_date(char *date, int &year, int &month, int &day) { HtConfiguration* config= HtConfiguration::config(); int mm = -1, dd = -1, yy = -1, t; String scandate = date; for (char *s = scandate.get(); *s; s++) if (ispunct(*s)) *s = ' '; if (config->Boolean("iso_8601")) { // conf file specified ISO standard, so expect [yy]yy mm dd. sscanf(scandate.get(), "%d%d%d", &yy, &mm, &dd); } else { // Default to American standard when not specified in conf, // so expect mm dd [yy]yy. sscanf(scandate.get(), "%d%d%d", &mm, &dd, &yy); if (mm > 31 && dd <= 12 && yy <= 31) { // probably got yyyy-mm-dd instead of mm/dd/yy t = mm; mm = dd; dd = yy; yy = t; } } // OK, we took our best guess at the order the y, m & d should be. // Now let's see if we guessed wrong, and fix it. This won't work // for ambiguous dates (e.g. 01/02/03), which must be given in the // expected format. if (dd > 31 && yy <= 31) { t = yy; yy = dd; dd = t; } if (mm > 31 && yy <= 31) { t = yy; yy = mm; mm = t; } if (mm > 12 && dd <= 12) { t = dd; dd = mm; mm = t; } if (yy < 0 || mm < 1 || mm > 12 || dd < 1 || dd > 31) return 0; // Invalid date if (yy < 70) // before UNIX Epoch yy += 2000; else if (yy < 1900) // before computer age yy += 1900; if (verbose > 2) cout << "Date used (y-m-d): " << yy << '-' << mm << '-' << dd << endl; year = yy; month = mm; day = dd; return 1; } //}}} htdig-3.2.0b6/httools/htpurge.cc0100644006314600127310000002441610055635555016064 0ustar angusgbhtdig// // htpurge.cc // // htpurge: A utility to remove specified URLs and any documents // marked for removal from the word and document databases. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htpurge.cc,v 1.6 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordContext.h" #include "HtWordReference.h" #include "HtConfiguration.h" #include "DocumentDB.h" #include "DocumentRef.h" #include "defaults.h" #include "HtURLCodec.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif int verbose = 0; Dictionary *purgeDocs(Dictionary *); void purgeWords(Dictionary *); void usage(); void reportError(char *msg); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int alt_work_area = 0; String configfile = DEFAULT_CONFIG_FILE; int c; extern char *optarg; Dictionary *discard_ids = 0; Dictionary *discard_urls = new Dictionary; while ((c = getopt(ac, av, "vc:au:")) != -1) { switch (c) { case 'c': configfile = optarg; break; case 'v': verbose++; break; case 'a': alt_work_area++; break; case 'u': discard_urls->Add(optarg, NULL); break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configfile.get())); } config->Read(configfile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); if (alt_work_area != 0) { String configValue; configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } } if (optind < ac && strcmp(av[optind], "-") == 0) { String str; while (!cin.eof()) { cin >> str; str.chop("\r\n"); if (str.length() > 0) discard_urls->Add(str, NULL); } } WordContext::Initialize(*config); // We pass in our list of URLs (which may be empty) // and we get back the list of IDs purged from the doc DB // to make sure words with these IDs are purged discard_ids = purgeDocs(discard_urls); delete discard_urls; discard_urls = 0; purgeWords(discard_ids); delete discard_ids; discard_ids = 0; return 0; } //***************************************************************************** // Dictionary purgeDocs(Dictionary &purgeURLs) // Pass in a hash of the URLs to delete (it could be empty) // Return a hash of the IDs deleted from the doc DB // Dictionary *purgeDocs(Dictionary *purgeURLs) { HtConfiguration* config= HtConfiguration::config(); const String doc_db = config->Find("doc_db"); const String doc_index = config->Find("doc_index"); const String doc_excerpt = config->Find("doc_excerpt"); int remove_unused; int remove_unretrieved; DocumentDB db; List *IDs; int document_count = 0; Dictionary *discard_list = new Dictionary; // // Start the conversion by going through all the URLs that are in // the document database // if(db.Open(doc_db, doc_index, doc_excerpt) != OK) return discard_list; // It's empty right now IDs = db.DocIDs(); if (IDs->Count() == 0) reportError("Database is empty!"); IDs->Start_Get(); IntObject *id; String idStr; String url; URL u_url; while ((id = (IntObject *) IDs->Get_Next())) { DocumentRef *ref = db[id->Value()]; if (!ref) continue; db.ReadExcerpt(*ref); url = ref->DocURL(); u_url = URL((char *)url); remove_unused = config->Boolean("server", u_url.host() ,"remove_bad_urls"); remove_unretrieved = config->Boolean("server", u_url.host(), "remove_unretrieved_urls"); idStr = 0; idStr << id->Value(); if (ref->DocState() == Reference_noindex) { // This document either wasn't found or shouldn't be indexed. db.Delete(ref->DocID()); if (verbose) cout << "Deleted, noindex: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else if (ref->DocState() == Reference_obsolete) { // This document was replaced by a newer one db.Delete(ref->DocID()); if (verbose) cout << "Deleted, obsolete: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else if (remove_unused && ref->DocState() == Reference_not_found) { // This document wasn't actually found db.Delete(ref->DocID()); if (verbose) cout << "Deleted, not found: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else if (remove_unused && strlen(ref->DocHead()) == 0 && ref->DocAccessed() != 0) { // For some reason, this document was retrieved, but doesn't // have an excerpt (probably because of a noindex directive) db.Delete(ref->DocID()); if (verbose) cout << "Deleted, no excerpt: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else if (remove_unretrieved && ref->DocAccessed() == 0) { // This document has not been retrieved db.Delete(ref->DocID()); if (verbose) cout << "Deleted, never retrieved: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else if (purgeURLs->Exists(url)) { // This document has been marked to be purged by the user db.Delete(ref->DocID()); if (verbose) cout << "Deleted, marked by user input: ID: " << idStr << " URL: " << url << endl; discard_list->Add(idStr.get(), NULL); } else { // This is a valid document. Let's keep stats on it. if (verbose > 1) cout << "ID: " << idStr << " URL: " << url << endl; document_count++; if (verbose && document_count % 10 == 0) { cout << "htpurge: " << document_count << '\n'; cout.flush(); } } delete ref; } if (verbose) cout << "\n"; delete IDs; db.Close(); return discard_list; } // // Callback data dedicated to Dump and dump_word communication // class DeleteWordData : public Object { public: DeleteWordData(const Dictionary& discard_arg) : discard(discard_arg) { deleted = remains = 0; } const Dictionary& discard; int deleted; int remains; }; //***************************************************************************** // // static int delete_word(WordList *words, WordDBCursor& cursor, const WordReference *word_arg, Object &data) { const HtWordReference *word = (const HtWordReference *)word_arg; DeleteWordData& d = (DeleteWordData&)data; static String docIDStr; docIDStr = 0; docIDStr << word->DocID(); if(d.discard.Exists(docIDStr)) { if(words->Delete(cursor) != 0) { cerr << "htpurge: deletion of " << (char*)word->Get() << " failed " << strerror(errno) << "\n"; return NOTOK; } if (verbose) { cout << "htpurge: Discarding "; if(verbose > 2) cout << (char*)word->Get(); else cout << word->Word(); cout << "\n"; cout.flush(); } d.deleted++; } else { d.remains++; } return OK; } //***************************************************************************** // void purgeWords(Dictionary *discard_list) // void purgeWords(Dictionary *discard_list) { HtConfiguration* config= HtConfiguration::config(); HtWordList words(*config); DeleteWordData data(*discard_list); words.Open(config->Find("word_db"), O_RDWR); WordCursor* search = words.Cursor(delete_word, &data); search->Walk(); delete search; words.Close(); if (verbose) cout << "\n"; } //***************************************************************************** // void usage() // Display program usage information // void usage() { cout << "usage: htpurge [-][-u url][-v][-a][-c configfile]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-\tURL input. Read in a list of URLs to remove, one per line.\n\n"; cout << "\t-u\tURL input. Add this url to the list of URLs to remove.\n"; cout << "\t\t(can be specified multiple times)\n\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htpurge to append .work to the database files \n"; cout << "\t\tallowing it to operate on a second set of databases.\n\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "htpurge: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/httools/htstat.cc0100644006314600127310000001145710055635555015716 0ustar angusgbhtdig// // htstat.cc // // htstat: A utility to give statistics on the contents of the word and doc DB. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htstat.cc,v 1.6 2004/05/28 13:15:25 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordContext.h" #include "HtURLCodec.h" #include "HtWordList.h" #include "HtConfiguration.h" #include "DocumentDB.h" #include "defaults.h" #include #ifndef _MSC_VER /* _WIN32 */ #include #endif // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #elif HAVE_GETOPT_LOCAL #include #endif int verbose = 0; void usage(); void reportError(char *msg); //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int alt_work_area = 0; int url_list = 0; String configfile = DEFAULT_CONFIG_FILE; int c; extern char *optarg; while ((c = getopt(ac, av, "vc:au")) != -1) { switch (c) { case 'c': configfile = optarg; break; case 'v': verbose++; break; case 'a': alt_work_area++; break; case 'u': url_list++; break; case '?': usage(); break; } } HtConfiguration* config= HtConfiguration::config(); config->Defaults(&defaults[0]); if (access((char*)configfile, R_OK) < 0) { reportError(form("Unable to find configuration file '%s'", configfile.get())); } config->Read(configfile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); // We may need these through the methods we call if (alt_work_area != 0) { String configValue; configValue = config->Find("word_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("word_db", configValue); } configValue = config->Find("doc_db"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_db", configValue); } configValue = config->Find("doc_index"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_index", configValue); } configValue = config->Find("doc_excerpt"); if (configValue.length() != 0) { configValue << ".work"; config->Add("doc_excerpt", configValue); } } DocumentDB docs; if (docs.Read(config->Find("doc_db"), config->Find("doc_index"), config->Find("doc_excerpt")) == OK) { List *urls = docs.URLs(); cout << "htstat: Total documents: " << urls->Count() << endl; if (url_list) { // Spit out the list of URLs too String *url; cout << "htstat: URLs in database: " << endl; urls->Start_Get(); while ((url = (String *) urls->Get_Next())) { cout << "\t" << url->get() << endl; } } delete urls; docs.Close(); } // Initialize htword WordContext::Initialize(*config); HtWordList words(*config); if(words.Open(config->Find("word_db"), O_RDONLY) == OK) { cout << "htstat: Total words: " << words.WordRefs()->Count() << endl; cout << "htstat: Total unique words: " << words.Words()->Count() << endl; words.Close(); } return 0; } //***************************************************************************** // void usage() // Display program usage information // void usage() { cout << "usage: htstat [-v][-a][-c configfile][-u]\n"; cout << "This program is part of ht://Dig " << VERSION << "\n\n"; cout << "Options:\n"; cout << "\t-v\tVerbose mode. This increases the verbosity of the\n"; cout << "\t\tprogram. Using more than 2 is probably only useful\n"; cout << "\t\tfor debugging purposes. The default verbose mode\n"; cout << "\t\tgives a progress on what it is doing and where it is.\n\n"; cout << "\t-a\tUse alternate work files.\n"; cout << "\t\tTells htstat to append .work to the database files \n"; cout << "\t\tallowing it to operate on a second set of databases.\n"; cout << "\t-c configfile\n"; cout << "\t\tUse the specified configuration file instead on the\n"; cout << "\t\tdefault.\n\n"; cout << "\t-u\tGive a list of URLs in the document database.\n\n"; exit(0); } //***************************************************************************** // Report an error and die // void reportError(char *msg) { cout << "htstat: " << msg << "\n\n"; exit(1); } htdig-3.2.0b6/htword/0040755006314600127310000000000010063260370013672 5ustar angusgbhtdightdig-3.2.0b6/htword/.cvsignore0100644006314600127310000000005506775061215015703 0ustar angusgbhtdigMakefile *.lo *.la .purify .pure .deps .libs htdig-3.2.0b6/htword/Makefile.am0100644006314600127310000000211510055635555015736 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # # include $(top_srcdir)/Makefile.config LOCAL_DEFINES = pkglib_LTLIBRARIES = libhtword.la libhtword_la_SOURCES = \ WordBitCompress.cc \ WordContext.cc \ WordCursor.cc \ WordDB.cc \ WordDBCompress.cc \ WordDBInfo.cc \ WordDBPage.cc \ WordKey.cc \ WordKeyInfo.cc \ WordList.cc \ WordMonitor.cc \ WordRecord.cc \ WordRecordInfo.cc \ WordReference.cc \ WordStat.cc \ WordType.cc libhtword_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ WordBitCompress.h \ WordCaseIsAStatements.h \ WordContext.h \ WordCursor.h \ WordDB.h \ WordDBCompress.h \ WordDBInfo.h \ WordDBPage.h \ WordKey.h \ WordKeyInfo.h \ WordList.h \ WordMonitor.h \ WordRecord.h \ WordRecordInfo.h \ WordReference.h \ WordStat.h \ WordType.h htdig-3.2.0b6/htword/Makefile.in0100644006314600127310000003633310063260372015746 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la # # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # # LOCAL_DEFINES = pkglib_LTLIBRARIES = libhtword.la libhtword_la_SOURCES = \ WordBitCompress.cc \ WordContext.cc \ WordCursor.cc \ WordDB.cc \ WordDBCompress.cc \ WordDBInfo.cc \ WordDBPage.cc \ WordKey.cc \ WordKeyInfo.cc \ WordList.cc \ WordMonitor.cc \ WordRecord.cc \ WordRecordInfo.cc \ WordReference.cc \ WordStat.cc \ WordType.cc libhtword_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags} pkginclude_HEADERS = \ WordBitCompress.h \ WordCaseIsAStatements.h \ WordContext.h \ WordCursor.h \ WordDB.h \ WordDBCompress.h \ WordDBInfo.h \ WordDBPage.h \ WordKey.h \ WordKeyInfo.h \ WordList.h \ WordMonitor.h \ WordRecord.h \ WordRecordInfo.h \ WordReference.h \ WordStat.h \ WordType.h subdir = htword ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(pkglib_LTLIBRARIES) libhtword_la_LIBADD = am_libhtword_la_OBJECTS = WordBitCompress.lo WordContext.lo \ WordCursor.lo WordDB.lo WordDBCompress.lo WordDBInfo.lo \ WordDBPage.lo WordKey.lo WordKeyInfo.lo WordList.lo \ WordMonitor.lo WordRecord.lo WordRecordInfo.lo WordReference.lo \ WordStat.lo WordType.lo libhtword_la_OBJECTS = $(am_libhtword_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libhtword_la_SOURCES) HEADERS = $(pkginclude_HEADERS) DIST_COMMON = README $(pkginclude_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am SOURCES = $(libhtword_la_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign htword/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) pkglibLTLIBRARIES_INSTALL = $(INSTALL) install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f"; \ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(pkglibdir)/$$f; \ else :; fi; \ done uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ p="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p"; \ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" = "$$p" && dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhtword.la: $(libhtword_la_OBJECTS) $(libhtword_la_DEPENDENCIES) $(CXXLINK) -rpath $(pkglibdir) $(libhtword_la_LDFLAGS) $(libhtword_la_OBJECTS) $(libhtword_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f"; \ $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \ rm -f $(DESTDIR)$(pkgincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(LTLIBRARIES) $(HEADERS) installdirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(pkgincludedir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool clean-pkglibLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-pkglibLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS \ uninstall-pkglibLTLIBRARIES .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-pkgincludeHEADERS install-pkglibLTLIBRARIES \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am \ uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES # 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: htdig-3.2.0b6/htword/Makefile.win320100644006314600127310000000126607675642172016320 0ustar angusgbhtdig TARGET = $(LIBDIR)/libhtword$(LIBSFX) # ---------------------------------------------------------------------------- # add new library members to this list # ---------------------------------------------------------------------------- include ../Makedefs.win32 CXXSRC = WordBitCompress.cc WordContext.cc WordCursor.cc WordDB.cc \ WordDBCompress.cc WordDBInfo.cc WordDBPage.cc WordKey.cc \ WordKeyInfo.cc WordList.cc WordMonitor.cc WordRecord.cc \ WordRecordInfo.cc WordReference.cc WordStat.cc WordType.cc CPPFLAGS += -DHAVE_CONFIG_H -I../db -I../htcommon -I../htlib -I../htword $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(AR) $(ARFLAGS) $(OBJS) include ../Makerules.win32 htdig-3.2.0b6/htword/README0100644006314600127310000000062707001600613014550 0ustar angusgbhtdigFiles: WordDB : Interface to berkeley DB WordKey : key manipulation WordRecord : record manipulation WordReference : record and key manipulation WordStat : derived from WordReference -> per unique word statistics WordType : word normalisation and transformation (accents, lowercase, ...) WordList : inverted index interface (word insert, word delete, list browsing) htdig-3.2.0b6/htword/WordBitCompress.cc0100644006314600127310000005632210055635556017311 0ustar angusgbhtdig// // WordBitCompress.cc // // BitStream: put and get bits into a buffer // *tagging: add tags to keep track of the position of data // inside the bitstream for debuging purposes. // *freezing: saves current position. further inserts in the BitStream // aren't really done. This way you can try different // compression algorithms and chose the best. // // Compressor: BitStream with extended compression fuctionalities // // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordBitCompress.cc,v 1.5 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include"WordBitCompress.h" // ******** HtVector_byte (implementation) #define GType byte #define HtVectorGType HtVector_byte #include "HtVectorGenericCode.h" // ******** HtVector_charptr (implementation) #define GType charptr #define HtVectorGType HtVector_charptr #include "HtVectorGenericCode.h" // ************************************************** // *************** misc functions ******************* // ************************************************** // return a temporary string that merges a name and a number char * label_str(const char *s,int n) { static char buff[1000]; sprintf(buff,"%s%d",s,n); return buff; } // display n bits of value v void show_bits(int v,int n/*=16*/) { int i; if(n>0) { for(i=0;i (*((unsigned int *)b))) return 1; else if((*((unsigned int *)a)) < (*((unsigned int *)b))) return -1; else return 0; // return // (*((unsigned int *)a)) - // (*((unsigned int *)b)) ; } // quick sort an array of unsigned int's void qsort_uint(unsigned int *v,int n) { qsort((void *)v,(unsigned int)n,sizeof(unsigned int),&qsort_uint_cmp); } // log in base 2 of v // log2(0) -> -1 // log2(1) -> 0 // log2(2) -> 1 // log2(4) -> 2 // ... // log2(8) -> 3 // log2(7) -> 2 int log2(unsigned int v) { int res; for(res=-1;v;res++){v>>=1;} return(res); } // ************************************************** // *************** VlengthCoder ******************* // ************************************************** // // Compress values into a bitstream based on their probability distribution // The probability distribution is reduced to a number of intervals. // Each interval (generally) has the same probability of occuring // values are then coded by: interval_number position_inside_interval // this can be seen as modified version of shanon-fanno encoding // // Here are some aproximate calculation for estimating final coded size: // // n number of entries to code // nbits maximum size in bits of entries to code // // SUM_interval_bit_sizes -> depends on probability dist // total_size = table_size + coded_size // table_size = 2^nlev * NBITS_NBITS_VAL // coded_size = n * (nlev + SUM_interval_bit_sizes / 2^nlev ) // // example1: flat probability distribution : // SUM_interval_bit_sizes = 2^nlev * log2( 2^nbits / 2^nlev) = 2^nlev * ( nbits - nlev ) // => coded_size = n * ( nlev + nbits - nlev ) = n*nbits !! // => coded_size is the same as if we used no compression // this is normal, because it is not possible to compress random data // // example2: probability all focused in first interval except for one entry // SUM_interval_bit_sizes = 1 + nbits // the computations above are not valid because of integer roundofs // => coded_size would actually be = n * 1 + nbits // (but the code needs a few cleanups to obtain this value) // class VlengthCoder { int nbits;// min number of bits to code all entries int nlev;// split proba into 2^nlev parts int nintervals;// number of intervals int *intervals; unsigned int *intervalsizes; // speedup unsigned int *lboundaries; // speedup BitStream &bs; // inline unsigned int intervalsize(int i) // { // unsigned int res=((intervals[i] > 0 ? pow2(intervals[i]-1) : 0)); // if(intervalsizes[i]!=res){errr("intervalsizes");} // return res; // } inline unsigned int intervalsize0(int i){return((intervals[i] > 0 ? pow2(intervals[i]-1) : 0));} public: int verbose; // find interval where value v resides // fast version, this one recursively splits initial interval inline int find_interval2(const unsigned int v,unsigned int &lboundary) { int i0=0; int i1=nintervals; int i; for(;;) { if(i1==i0+1){break;} i=(i0+i1)>>1; lboundary=lboundaries[i]; // if(verbose)printf("considering i0:%3d i1:%3d : i:%3d v:%12u lboundary:%12u (%12u - %12u)\n",i0,i1,i,v,lboundary,lboundaries[i0],lboundaries[i1]); if(v=lboundary && v=nintervals){errr("code argh!");} sboundary=lboundary+intervalsizes[i]; // printf("nintervals:%3d i:%3d : %12u ... %12u : %12u\n",nintervals,i,lboundary,sboundary,v); if( (lboundary!=sboundary && v>=lboundary && v0 ? intervals[i]-1 : 0); // if(verbose>1)printf("v:%6d interval:%2d (%5d - %5d) bitsremaining:%2d ",v,i,lboundary,sboundary,bitsremaining); v-=lboundary; // if(verbose>1)printf("remain:%6d totalbits:%2d\n",v,bitsremaining+nlev); bs.put_uint(v,bitsremaining,"rem"); } // get and uncompress a value from the bitstream inline unsigned int get() { // SPEED CRITICAL SECTION int i=bs.get_uint(nlev,"int");// get interval // if(verbose>1)printf("get:interval:%2d ",i); const int bitsremaining=(intervals[i]>0 ? intervals[i]-1 : 0); // if(verbose>1)printf("bitsremain:%2d ",bitsremaining); unsigned int v=bs.get_uint(bitsremaining,"rem"); // if(verbose>1)printf("v0:%3d ",v); // unsigned int lboundary=0; v+=lboundaries[i]; // for(int j=0;j1)printf("lboundary:%5d v:%5d \n",lboundaries[i],v); return(v); } // insert the packed probability distrbution into the bitstream void code_begin(); // get the packed probability distrbution from the bitstream void get_begin(); void make_lboundaries(); VlengthCoder(BitStream &nbs,int nverbose=0); ~VlengthCoder() { delete [] lboundaries; delete [] intervals; delete [] intervalsizes; } // create VlengthCoder and its probability distrbution from an array of values VlengthCoder(unsigned int *vals,int n,BitStream &nbs,int nverbose=0); }; void VlengthCoder::code_begin() { int i; bs.add_tag("VlengthCoder:Header"); bs.put_uint(nbits,NBITS_NBITS_VAL,"nbits"); bs.put_uint(nlev,5,"nlev"); for(i=0;i1)printf("get_begin nbits:%d\n",nbits); nlev=bs.get_uint(5,"nlev"); if(verbose>1)printf("get_begin nlev:%d\n",nlev); nintervals=pow2(nlev); intervals=new int [nintervals]; CHECK_MEM(intervals); intervalsizes=new unsigned int [nintervals]; CHECK_MEM(intervalsizes); lboundaries=new unsigned int [nintervals+1]; CHECK_MEM(lboundaries); for(i=0;i1)printf("get_begin intervals:%2d:%2d\n",i,intervals[i]); } make_lboundaries(); } void VlengthCoder::make_lboundaries() { unsigned int lboundary=0; for(int j=0;j<=nintervals;j++) { lboundaries[j]=lboundary; if(j=nbits){nlev=nbits-1;} // nlev at least 1 if(nlev<1){nlev=1;} if(debug_test_nlev>=0){nlev=debug_test_nlev;} nintervals=pow2(nlev); int i; intervals=new int [nintervals]; CHECK_MEM(intervals); intervalsizes=new unsigned int [nintervals]; CHECK_MEM(intervalsizes); lboundaries=new unsigned int [nintervals+1]; CHECK_MEM(lboundaries); if(verbose>1)printf("nbits:%d nlev:%d nintervals:%d \n",nbits,nlev,nintervals); if(verbose>10) { printf("vals;\n"); for(i=0;i1)printf("intnum%02d begin:%5u end:%5u len:%5u (code:%2d) real upper boundary: real:%5u\n",i,lboundary,intervalsizes[i]+lboundary,intervalsizes[i],intervals[i],boundary); lboundary+=intervalsizes[i]; } boundary=sorted[n-1]; intervals[i]=1+log2(boundary-lboundary)+1; intervalsizes[i]=intervalsize0(i); if(0 || verbose>1)printf("intnum%02d begin:%5u end:%5u len:%5u (code:%2d) real upper boundary: real:%5u\n",i,lboundary,intervalsizes[i]+lboundary,intervalsizes[i],intervals[i],boundary); if(0 || verbose>1)printf("\n"); make_lboundaries(); int SUM_interval_bit_sizes=0; for(i=0;i>3)-1; // put first buff.back()|=((v & 0xff)<>=nbitsinfirstbyte; // printf(" (v:%x)",v); // put central for(int i=ncentral;i;i--) { buff.push_back(0); buff.back()= v & 0xff ; // ::show_bits(v & 0xff,-8); // printf(" "); v>>=8; } // put last const int nbitsremaining=n-( (ncentral<<3)+nbitsinfirstbyte ); if(nbitsremaining) { buff.push_back(0); buff.back()=v & (pow2(nbitsremaining+1)-1); // printf(" (v:%x:%x)",v & (pow2(nbitsremaining+1)-1),buff.back()); // ::show_bits(v & (pow2(nbitsremaining+1)-1),-nbitsremaining); // printf("\n"); } if(!(nbitsremaining & 0x07)){buff.push_back(0);} bitpos+=n; // printf("nbitsinfirstbyte:%d ncentral:%d nbitsremaining:%d\n",nbitsinfirstbyte,ncentral,nbitsremaining); } // printf("cuurent put order:"); // for(i=0;i>3]>>bpos0) & (pow2(n)-1); bitpos+=n; // printf("simple case:res:%x\n",res); return res; } else { int bytepos=bitpos>>3; const int ncentral=((bpos0 + n)>>3)-1; // put first res=(buff[bytepos]>>bpos0) & 0xff; // printf("normal case:res0:%x\n",res); const int nbitsinfirstbyte=8-bpos0; bytepos++; // put central if(ncentral) { unsigned int v=0; for(int i=ncentral-1;i>=0;i--) { v|=buff[bytepos+i]&0xff; if(i)v<<=8; // printf(" resC%d:v:%x\n",i,v); } bytepos+=ncentral; res|=v<>3)-1)<<3)); // printf(" :resR:%x buff[%d]:%x %d\n",res,bytepos,buff[bytepos], // (nbitsinfirstbyte +((bytepos-(bitpos>>3)-1)<<3))); } bitpos+=n; // printf("nbitsinfirstbyte:%d ncentral:%d nbitsremaining:%d\n",nbitsinfirstbyte,ncentral,nbitsremaining); return res; } } #ifdef NOTDEF unsigned int BitStream::get(int n,const char *tag/*=NULL*/) { if(check_tag(tag)==NOTOK){errr("BitStream::get(int) check_tag failed");} unsigned int res=0; for(int i=0;i=0) { printf("ERROR:BitStream:bitpos:%4d:check_tag: found tag %s at %d expected it at %d\n",bitpos,tag,found,pos); } else { printf("ERROR:BitStream:bitpos:%4d:check_tag: tag %s not found, expected it at %d\n",bitpos,tag,pos); } return(NOTOK); } return(OK); } int BitStream::find_tag(const char *tag) { int i; for(i=0;ipos && i>=0;i--); return(i); } void BitStream::show_bits(int a,int n) { for(int b=a;b=pow2(NBITS_NVALS)){errr("Compressor::put(uint *,nvals) : overflow: nvals>2^16");} put_uint_vl(n,NBITS_NVALS,"size"); if(n==0){return NBITS_NVALS;} int sdecr=2; int sfixed=1; int nbits=num_bits(HtMaxMin::max_v(vals,n)); if(verbose)printf("*********************put_vals:n:%3d nbits:%3d\n",n,nbits); int i; if(verbose) { printf("TTT:n:%3d nbits:%3d\n",n,nbits); for(i=1;i<7;i++) { debug_test_nlev=i; printf("trying nlev:%3d\n",debug_test_nlev); freeze(); put_decr(vals,n); int fndsz=unfreeze(); printf("TTT:nlev:%2d try size:%4d\n",i,fndsz); } debug_test_nlev=-1; } if(n>15 && nbits>3) { freeze(); put_decr(vals,n); sdecr=unfreeze(); freeze(); put_fixedbitl(vals,n); sfixed=unfreeze(); } if(verbose)printf("put_vals:n:%3d sdecr:%6d sfixed:%6d rap:%f\n",n,sdecr,sfixed,sdecr/(float)sfixed); if(sdecr1)printf("get_vals n:%d\n",n); if(!n){*pres=NULL;return 0;} if(verbose)printf("get_vals: n:%3d\n",n); unsigned int *res=new unsigned int[n]; CHECK_MEM(res); int comptype=get_uint(2,"put_valsCompType"); if(verbose)printf("get_vals:comptype:%d\n",comptype); switch(comptype) { case 0: get_decr(res,n); break; case 1: get_fixedbitl(res,n); break; default: errr("Compressor::get_vals invalid comptype");break; } // get_fixedbitl(res,n); // get_decr(res,n); *pres=res; return(n); } int Compressor::put_fixedbitl(byte *vals,int n,const char *tag) { int cpos=bitpos; int i,j; add_tag(tag); put_uint_vl(n,NBITS_NVALS,"size"); if(n==0){return 0;} byte maxv=vals[0]; for(i=1;imaxv){maxv=v;} } int nbits=num_bits(maxv); if(n>=pow2(NBITS_NVALS)){errr("Compressor::put_fixedbitl(byte *) : overflow: nvals>2^16");} put_uint(nbits,NBITS_NBITS_CHARVAL,"nbits"); add_tag("data"); for(i=0;i1){printf("get_decr:got:%8d\n",res[i]);} } } htdig-3.2.0b6/htword/WordBitCompress.h0100644006314600127310000001646410055635556017156 0ustar angusgbhtdig// // WordBitCompress.h // // BitStream: put and get bits into a buffer // *tagging: add tags to keep track of the position of data // inside the bitstream for debuging purposes. // *freezing: saves current position. further inserts in the BitStream // aren't really done. This way you can try different // compression algorithms and chose the best. // // Compressor: BitStream with extended fuctionalities // // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordBitCompress.h,v 1.7 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordBitCompress_h #define _WordBitCompress_h #include #include #include"HtVector_int.h" #include"HtMaxMin.h" typedef unsigned char byte; // ******** HtVector_byte (header) #define GType byte #define HtVectorGType HtVector_byte #include "HtVectorGeneric.h" typedef char * charptr; // ******** HtVector_charptr (header) #define GType charptr #define HtVectorGType HtVector_charptr #include "HtVectorGeneric.h" // ******** Utility inline functions and macros // error checking #define FATAL_ABORT fflush(stdout);fprintf(stderr,"FATAL ERROR at file:%s line:%d !!!\n",__FILE__,__LINE__);fflush(stderr);(*(int *)NULL)=1 #define errr(s) {fprintf(stderr,"FATAL ERROR:%s\n",s);FATAL_ABORT;} #define CHECK_MEM(p) if(!p) errr("mifluz: Out of memory!"); // max/min of 2 values #define TMax(a,b) (((a)>(b)) ? (a) : (b)) #define TMin(a,b) (((a)<(b)) ? (a) : (b)) // compute integer log2 // == minimum number of bits needed to code value inline int num_bits(unsigned int maxval ) { unsigned int mv=maxval; int nbits; for(nbits=0;mv;nbits++){mv>>=1;} return(nbits); } // compute 2^x #define pow2(x) (1<<(x)) // function declarations char *label_str(const char *s,int n); void show_bits(int v,int n=16); // unsigned short max_v(unsigned short *vals,int n); // unsigned int max_v(unsigned int *vals,int n); // unsigned short min_v(unsigned short *vals,int n); // unsigned int min_v(unsigned int *vals,int n); // ************************************************** // *************** BitStream *********************** // ************************************************** // compression is done in Compressor not in BitStream class BitStream { protected: // the buffer were the bitstream is stored HtVector_byte buff; // current bit position within the buffer int bitpos; // tags for debuging HtVector_int tagpos; HtVector_charptr tags; int use_tags; // freezing the bitstream HtVector_int freeze_stack; int freezeon; public: void freeze(); int unfreeze(); // puts a bit into the bitstream inline void put(unsigned int v) { // SPEED CRITICAL SECTION if(freezeon){bitpos++;return;} if(v){buff.back()|=pow2(bitpos & 0x07);} bitpos++; if(!(bitpos & 0x07))// new byte { buff.push_back(0); } } inline void put(unsigned int v,const char *tag) { if(!freezeon){add_tag(tag);} put(v); } // gets a bit from the bitstream inline byte get(const char *tag=(char*)NULL) { // SPEED CRITICAL SECTION if(check_tag(tag)==NOTOK){errr("BitStream::get() check_tag failed");} if(bitpos>=(buff.size()<<3)){errr("BitStream::get reading past end of BitStream!");} byte res=buff[bitpos>>3] & pow2(bitpos & 0x07); // printf("get:res:%d bitpos:%5d/%d buff[%3d]=%x\n",res,bitpos,bitpos%8,bitpos/8,buff[bitpos/8]); bitpos++; return(res); } // get/put an integer using n bits void put_uint(unsigned int v,int n,const char *tag=(char*)"NOTAG"); unsigned int get_uint( int n,const char *tag=(char*)NULL); // get/put n bits of data stored in vals void put_zone(byte *vals,int n,const char *tag); void get_zone(byte *vals,int n,const char *tag); // inline void add_tag(const char *tag) { if(!use_tags || !tag || freezeon){return;} add_tag1(tag); } void add_tag1(const char *tag); inline int check_tag(const char *tag,int pos=-1) { if(!use_tags || !tag){return OK;} return(check_tag1(tag,pos)); } int check_tag1(const char *tag,int pos); void set_use_tags(){use_tags=1;} int find_tag(const char *tag); int find_tag(int pos,int posaftertag=1); void show_bits(int a,int n); void show(int a=0,int n=-1); // position accesors int size(){return(bitpos);} int buffsize(){return(buff.size());} // get a copy of the buffer byte *get_data(); // set the buffer from outside data (current buffer must be empty) void set_data(const byte *nbuff,int nbits); // use this for reading a BitStream after you have written in it // (generally for debuging) void rewind(){bitpos=0;} ~BitStream() { int i; for(i=0;i // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // switch between unknown numerical types // example usage: // -------------------------- // switch(word_key_info.sort[position].type) // { //#define STATEMENT(type) case WORD_ISA_##type:pool_##type[word_key_info.sort[position].index]=val;break //#include"WordCaseIsAStatements.h" // } // -------------------------- #ifdef WORD_HAVE_TypeA STATEMENT(TypeA); #endif /* WORD_HAVE_TypeA */ #ifdef WORD_HAVE_TypeB STATEMENT(TypeB); #endif /* WORD_HAVE_TypeB */ #ifdef WORD_HAVE_TypeC STATEMENT(TypeC); #endif /* WORD_HAVE_TypeC */ #undef STATEMENT htdig-3.2.0b6/htword/WordContext.cc0100644006314600127310000000515510055635556016501 0ustar angusgbhtdig// // WordContext.cc // // WordContext: call Initialize for all classes that need to. // This will enable the Instance() static member // of each to return a properly allocated and configured // object. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordContext.cc,v 1.5 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include "WordContext.h" #include "WordType.h" #include "WordKeyInfo.h" #include "WordDBInfo.h" #include "WordRecord.h" #include "WordMonitor.h" void WordContext::Initialize(Configuration &config) { #if !defined(HAVE_LIBZ) || !defined(HAVE_ZLIB_H) config.Add("wordlist_compress", "false"); #endif WordType::Initialize(config); WordKeyInfo::Initialize(config); WordRecordInfo::Initialize(config); WordDBInfo::Initialize(config); if(config.Boolean("wordlist_monitor")) WordMonitor::Initialize(config); } Configuration *WordContext::Initialize(const ConfigDefaults* config_defaults /* = 0 */) { Configuration *config = new Configuration(); if(config_defaults) config->Defaults(config_defaults); String filename; // // Check file pointed by MIFLUZ_CONFIG environment variable // if(getenv("MIFLUZ_CONFIG")) { filename << getenv("MIFLUZ_CONFIG"); struct stat statbuf; if(stat((char*)filename, &statbuf) < 0) { if(errno != ENOENT) { fprintf(stderr, "WordContext::Initialize: MIFLUZ_CONFIG could not stat %s\n", (char*)filename); perror(""); } filename.trunc(); } } // // Check for ~/.mifluz // if(filename.empty()) { const char* home = getenv("HOME"); if(home) { filename << home << "/.mifluz"; struct stat statbuf; if(stat((char*)filename, &statbuf) < 0) { if(errno != ENOENT) { fprintf(stderr, "WordContext::Initialize: could not stat %s\n", (char*)filename); perror(""); } filename.trunc(); } } } if(!filename.empty()) config->Read(filename); Initialize(*config); if(filename.empty() && !config_defaults) { delete config; config = 0; } return config; } void WordContext::Finish() { delete WordType::Instance(); delete WordKeyInfo::Instance(); delete WordRecordInfo::Instance(); delete WordDBInfo::Instance(); if(WordMonitor::Instance()) delete WordMonitor::Instance(); } htdig-3.2.0b6/htword/WordContext.h0100644006314600127310000000561310055635556016342 0ustar angusgbhtdig// // WordContext.h // // NAME // // read configuration description and setup mifluz context. // // SYNOPSIS // // #include // // Configuration* config = WordContext::Initialize(); // ... // WordContext::Finish(); // // DESCRIPTION // // The WordContext::Initialize() method initialize the global context // for the mifluz library. All other classes depend on it. It must // therefore be called before any other mifluz classes are used. // // CONFIGURATION // // wordlist_monitor {true|false} (default false) // If true create a WordMonitor instance to gather statistics and // build reports. // // // ENVIRONMENT // // MIFLUZ_CONFIG file name of configuration file read by // WordContext(3). Defaults to ~/.mifluz. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordContext.h,v 1.5 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordContext_h_ #define _WordContext_h_ #ifndef SWIG #include "Configuration.h" #endif /* SWIG */ // // Short hand for calling Initialize for all classes // Word* that have a single instance (WordType, WordKeyInfo, WordRecordInfo). // class WordContext { public: //- // Create environment. Must be called before any other class are used. // // When calling Initialize a second time, one must ensure // that all WordList and WordCursor objects have been // destroyed. WordList and WordCursor internal state depends on the // current WordContext that will be lost by a second call. //
    // For those interested by the internals, the Initialize function // maintains a Berkeley DB environment (DB_ENV) in the following way: // // First invocation: //
      // Initialize -> new DB_ENV (thru WordDBInfo)
      // 
    // // Second invocation: //
      // Initialize -> delete DB_ENV -> new DB_ENV (thru WordDBInfo)
      // 
    // static void Initialize(Configuration &config); #ifndef SWIG //- // Build a Configuration object from the file pointed to by the // MIFLUZ_CONFIG environment variable or ~/.mifluz. // The config_defaults argument, if provided, is passed to // the Configuration object using the Defaults method. // The Initialize(const Configuration &) method is then called // with the Configuration object. // // Refer to the Configuration description for more information. // // static Configuration *Initialize(const ConfigDefaults* config_defaults = 0); #endif /* SWIG */ //- // Destroy environment. Must be called after all other mifluz // objects are destroyed. // static void Finish(); }; #endif // _WordContext_h_ htdig-3.2.0b6/htword/WordCursor.cc0100644006314600127310000003762410055635556016340 0ustar angusgbhtdig// // WordCursor.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordCursor.cc,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordCursor.h" #include "WordStat.h" #include "WordList.h" #include // // WordCursor implementation // // ***************************************************************************** // int WordCursor::Initialize(WordList *nwords, const WordKey &nsearchKey, wordlist_walk_callback_t ncallback, Object *ncallback_data, int naction) { action = naction; searchKey = nsearchKey; callback = ncallback; callback_data = ncallback_data; words = nwords; return OK; } // ***************************************************************************** // void WordCursor::Clear() { searchKey.Clear(); action = 0; callback = 0; callback_data = 0; ClearResult(); ClearInternal(); words = 0; // // Debugging section. // traceRes = 0; } // ***************************************************************************** // void WordCursor::ClearInternal() { cursor.Close(); key.trunc(); data.trunc(); prefixKey.Clear(); cursor_get_flags = DB_SET_RANGE; searchKeyIsSameAsPrefix = 0; } // ***************************************************************************** // void WordCursor::ClearResult() { collectRes = 0; found.Clear(); status = OK; } int WordCursor::ContextRestore(const String& buffer) { int ret = OK; if(!buffer.empty()) { WordKey key(buffer); if((ret = Seek(key)) != OK) return ret; // // Move to restored position so that next call to // WalkNext will go above the restored position. // if((ret = WalkNext()) != OK) return ret; } return ret; } // ***************************************************************************** // // Walk and collect data from the word database. // // If action bit HTDIG_WORDLIST_COLLECTOR is set WordReferences are // stored in a list and the list is returned. // If action bit HTDIG_WORDLIST_WALKER is set the function // is called for each WordReference found. No list is built and the // function returns a null pointer. // // The argument may be a fully qualified key, containing precise values for each // field of the key. It may also contain only some fields of the key. In both cases // all the word occurrences matching the fields set in the key are retrieved. It may // be fast if key is a prefix (see WordKey::Prefix for a definition). It may // be *slow* if key is not a prefix because it forces a complete walk of the // index. // int WordCursor::Walk() { int ret; if((ret = WalkInit()) != OK) return ret; while((ret = WalkNext()) == OK) ; int ret1; if((ret1 = WalkFinish()) != OK) return ret1; return ret == WORD_WALK_ATEND ? OK : NOTOK; } int WordCursor::WalkInit() { int ret = OK; ClearResult(); ClearInternal(); WordReference wordRef; if((ret = cursor.Open(words->db.db)) != 0) return ret; if(words->verbose) fprintf(stderr, "WordCursor::WalkInit: action = %d, SearchKey = %s\n", action, (char*)searchKey.Get()); if(action & HTDIG_WORDLIST_COLLECTOR) { collectRes = new List; } const WordReference& last = WordStat::Last(); WordKey first_key; // // Move the cursor to start walking and do some sanity checks. // if(searchKey.Empty()) { // // Move past the stat data // if(words->verbose) fprintf(stderr, "WordCursor::WalkInit: at start of keys because search key is empty\n"); first_key = last.Key(); } else { prefixKey = searchKey; // // If the key is a prefix, the start key is // the longest possible prefix contained in the key. If the // key does not contain any prefix, start from the beginning // of the file. // if(prefixKey.PrefixOnly() == NOTOK) { if(words->verbose) fprintf(stderr, "WordCursor::WalkInit: at start of keys because search key is not a prefix\n"); prefixKey.Clear(); // // Move past the stat data // first_key = last.Key(); } else { if(words->verbose) fprintf(stderr, "WordCursor::WalkInit: go to %s \n", (char*)prefixKey.Get()); first_key = prefixKey; } } first_key.Pack(key); // // Allow Seek immediately after Init // found.Key().CopyFrom(first_key); status = OK; searchKeyIsSameAsPrefix = searchKey.ExactEqual(prefixKey); cursor_get_flags = DB_SET_RANGE; return OK; } int WordCursor::WalkRewind() { const WordReference& last = WordStat::Last(); WordKey first_key; // // Move the cursor to start walking and do some sanity checks. // if(searchKey.Empty()) { first_key = last.Key(); } else { prefixKey = searchKey; // // If the key is a prefix, the start key is // the longest possible prefix contained in the key. If the // key does not contain any prefix, start from the beginning // of the file. // if(prefixKey.PrefixOnly() == NOTOK) { prefixKey.Clear(); // // Move past the stat data // first_key = last.Key(); } else { first_key = prefixKey; } } first_key.Pack(key); // // Allow Seek immediately after Rewind // found.Key().CopyFrom(first_key); status = OK; searchKeyIsSameAsPrefix = searchKey.ExactEqual(prefixKey); cursor_get_flags = DB_SET_RANGE; return OK; } int WordCursor::WalkNext() { int ret; while((ret = WalkNextStep()) == WORD_WALK_NOMATCH_FAILED) if(words->verbose > 1) fprintf(stderr, "WordCursor::WalkNext: got false match, retry\n"); return ret; } int WordCursor::WalkNextStep() { status = OK; { int error; if((error = cursor.Get(key, data, cursor_get_flags)) != 0) { if(error == DB_NOTFOUND) { if(words->verbose) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, no more matches\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); } else { return WORD_WALK_GET_FAILED; } } } // // Next step operation is always sequential walk // cursor_get_flags = DB_NEXT; found.Unpack(key, data); if(traceRes) traceRes->Add(new WordReference(found)); if(words->verbose > 1) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, candidate is %s\n", (char*)searchKey.Get(), (char*)found.Get()); // // Don't bother to compare keys if we want to walk all the entries // if(!(searchKey.Empty())) { // examples // searchKey: aabc 1 ? ? ? // prefixKey: aabc 1 ? ? ? // // Stop loop if we reach a record whose key does not // match prefix key requirement, provided we have a valid // prefix key. // (ie. stop loop if we're past last possible match...) // if(!prefixKey.Empty() && !prefixKey.Equal(found.Key())) { if(words->verbose) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, no more matches because found a key that is greater than searchKey\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); } // // Skip entries that do not exactly match the specified key. // if(!searchKeyIsSameAsPrefix && !searchKey.Equal(found.Key())) { int ret; switch((ret = SkipUselessSequentialWalking())) { case OK: if(words->verbose > 1) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, false match jump to %s\n", (char*)searchKey.Get(), (char*)found.Get()); return WORD_WALK_NOMATCH_FAILED; break; case WORD_WALK_ATEND: if(words->verbose) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, no more matches according to SkipUselessSequentialWalking\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); break; default: fprintf(stderr, "WordCursor::WalkNextStep: SkipUselessSequentialWalking failed %d\n", ret); return NOTOK; break; } } } if(words->verbose) fprintf(stderr, "WordCursor::WalkNextStep: looking for %s, found %s\n", (char*)searchKey.Get(), (char*)found.Get()); if(collectRes) { if(words->verbose > 2) fprintf(stderr, "WordCursor::WalkNextStep: collect\n"); collectRes->Add(new WordReference(found)); } else if(callback) { if(words->verbose > 2) fprintf(stderr, "WordCursor::WalkNextStep: calling callback\n"); int ret = (*callback)(words, cursor, &found, *(callback_data) ); // // The callback function tells us that something went wrong, might // as well stop walking. // if(ret != OK) { if(words->verbose) fprintf(stderr, "WordCursor::WalkNextStep: callback returned NOTOK"); return WORD_WALK_CALLBACK_FAILED|(status = WORD_WALK_ATEND); } } return OK; } int WordCursor::WalkFinish() { if(words->verbose) fprintf(stderr, "WordCursor::WalkFinish\n"); return cursor.Close() == 0 ? OK : NOTOK; } // ***************************************************************************** // // Helper for SkipUselessSequentialWalking. // Undefine in foundKey all fields defined in searchKey // so that they are not considered by SetToFollowing. // It could become a method of WordKey but lacks generalisation and // from what I see it is a rather specific operation. // static inline void complement(WordKey& key, const WordKey& mask) { int nfields = WordKey::NFields(); int i; // // Undefine in 'key' all fields defined in 'mask' // for(i = 0; i < nfields; i++) { if(mask.IsDefined(i)) key.Undefined(i); else key.SetDefined(i); } // // If searching for a prefix, we must allow the word in // key to increment. // if(mask.IsDefinedWordSuffix()) { key.UndefinedWordSuffix(); } else { key.SetDefinedWordSuffix(); key.SetDefined(0); } } // ***************************************************************************** // // Find out if we should better jump to the next possible key (DB_SET_RANGE) instead of // sequential iterating (DB_NEXT). // If it is decided that jump is a better move : // cursor_set_flags = DB_SET_RANGE // key = calculated next possible key // Else // do nothing // Return values // OK: skipping successfull. // WORD_WALK_ATEND : no more possible match, reached the maximum // WORD_WALK_FAILED: general failure, occurs if called and no skipping // necessary. // // Sequential searching can waste time by searching all keys, for example: // If searching for Key: argh 10 // Under normal circonstances we would do the following // // DATA STATUS ACTION // 1: argh 1 10 match DB_NEXT // 2: argh 2 11 nomatch DB_NEXT // 3: argh 2 15 nomatch DB_NEXT // 4: argh 2 20 nomatch DB_NEXT // 5: argh 2 30 nomatch DB_NEXT // 6: argh 5 1 nomatch DB_NEXT // 7: argh 5 8 nomatch DB_NEXT // 8: argh 8 6 nomatch DB_NEXT // // But the optimal would be // // DATA STATUS ACTION // 1: argh 1 10 match DB_NEXT // 2: argh 2 11 nomatch DB_SET_RANGE argh 3 10 // 3: argh 2 15 // 4: argh 2 20 // 5: argh 2 30 // 6: argh 5 1 nomatch DB_SET_RANGE argh 5 10 // 7: argh 5 8 // 8: argh 8 6 nomatch DB_SET_RANGE argh 8 10 // // That saves a lot of unecessary hit. The underlying logic is a bit // more complex but you have the idea. // int WordCursor::SkipUselessSequentialWalking() { WordKey& foundKey = found.Key(); int nfields = WordKey::NFields(); int i; // // Find out how the searchKey and the foundKey differ. // int diff_field = 0; int lower = 0; if(!foundKey.Diff(searchKey, diff_field, lower)) { // // foundKey matches searchKey (no difference), don't // skip, everything is fine. The caller of SkipUselessSequentialWalking // is expected to avoid this case for efficiency. // return WORD_WALK_FAILED; } if(words->verbose > 2) fprintf(stderr, "WordCursor::SkipUselessSequentialWalking: looking for %s, candidate is %s\n", (char*)searchKey.Get(), (char*)foundKey.Get()); // // Undefine in foundKey all fields defined in searchKey // so that they are not considered by SetToFollowing. // complement(foundKey, searchKey); // // If the key found is lower than the searched key when // considering only the fields defined in the search key, // we only need to enforce the key to get the match. // Otherwise we need to increment the found key to jump // properly. // if(lower) { if(words->verbose > 1) fprintf(stderr, "WordCursor::SkipUselessSequentialWalking: enforcing the search constraint is enough to jump forward\n"); for(i = diff_field + 1; i < nfields; i++) if(foundKey.IsDefined(i)) foundKey.Set(i, 0); } else { if(words->verbose > 1) fprintf(stderr, "WordCursor::SkipUselessSequentialWalking: increment the key to jump forward\n"); // // diff_field - 1 is not really necessary because diff_field is undefined // in foundKey and would therefore be ignored by SetToFollowing. We write // diff_field - 1 to clearly state that incrementing begins just before the // field for which a difference was found. // int ret; if((ret = foundKey.SetToFollowing(diff_field - 1)) != OK) return ret; } // // Copy all fields defined in searchKey into foundKey. This will copy // searchKey in foundKey because all these fields have been // previously undefined in foundKey. // foundKey.Merge(searchKey); if(words->verbose > 2) fprintf(stderr, "WordCursor::SkipUselessSequentialWalking: looking for %s, jump to %s\n", (char*)searchKey.Get(), (char*)foundKey.Get()); // // Instruct Next function to jump to the calculated key // if(foundKey.Pack(key) == NOTOK) { return WORD_WALK_FAILED; } cursor_get_flags = DB_SET_RANGE; return OK; } // ***************************************************************************** // // Copy defined fields in patch into foundKey and // initialize internal state so that WalkNext jumps to // this key next time it's called. // // Technically this means : Override latest key found (found data member) // with patch fields values, starting from the first field set in // patch up to the last. Pack the result in the key field and set // cursor_get_flags to DB_SET_RANGE. // int WordCursor::Seek(const WordKey& patch) { int nfields = WordKey::NFields(); WordKey pos = searchKey; if(patch.Empty()) { fprintf(stderr, "WordCursor::Seek: empty patch is useless\n"); return NOTOK; } int i; // // Leave the most significant fields untouched // for(i = WORD_FIRSTFIELD; i < nfields; i++) if(patch.IsDefined(i)) break; // // From the first value set in the patch to the end // override. // for(; i < nfields; i++) { if(patch.IsDefined(i)) pos.Set(i, patch.Get(i)); else pos.Set(i, 0); } if(!pos.Filled()) { fprintf(stderr, "WordCursor::Seek: only make sense if the resulting key is fully defined\n"); return NOTOK; } if(words->verbose > 2) fprintf(stderr, "WordCursor::Seek: seek to %s\n", (char*)pos.Get()); // // Next move will jump to the patched key // pos.Pack(key); cursor_get_flags = DB_SET_RANGE; return OK; } int WordCursor::Noccurrence(unsigned int& noccurrence) const { if(!words) { fprintf(stderr, "WordCursor::Noccurrence: words not set (call Prepare first)\n"); return NOTOK; } return words->Noccurrence(searchKey, noccurrence); } // // Convert the whole structure to an ascii string description // int WordCursor::Get(String& bufferout) const { String tmp; bufferout.trunc(); searchKey.Get(tmp); bufferout << "Input: searchKey = " << tmp << ", action = " << action << "; Output: collectRes " << (collectRes ? "set" : "not set"); found.Get(tmp); bufferout << ", found = " << tmp << ", status = " << status; prefixKey.Get(tmp); bufferout << "; Internal State: prefixKey = " << tmp << ", cursor_get_flags = " << cursor_get_flags; return OK; } htdig-3.2.0b6/htword/WordCursor.h0100644006314600127310000003237310055635556016176 0ustar angusgbhtdig// // WordList.h // // NAME // // search specification and results for WordList. // // SYNOPSIS // // #include // // int callback(WordList *, WordDBCursor& , const WordReference *, Object &) // { // ... // } // // Object* data = ... // // WordList *words = ...; // // WordCursor *search = words->Cursor(callback, data); // WordCursor *search = words->Cursor(WordKey("word ")); // WordCursor *search = words->Cursor(WordKey("word "), callback, data); // // ... // // if(search->Walk() == NOTOK) bark; // List* results = search->GetResults(); // // if(search->WalkNext() == OK) // dosomething(search->GetFound()); // // DESCRIPTION // // WordCursor is an iterator on an inverted index. It is created by // asking a WordList object with the Cursor. There is // no other way to create a WordCursor object. // When the Walk* methods return, // the WordCursor object contains the result of the search and // status information that indicates if it reached the end of // the list (IsAtEnd() method). // // The callback function that is called each time a match is // found takes the following arguments: //
    // WordList* words pointer to the inverted index handle.
    // WordDBCursor& cursor to call Del() and delete the current match
    // WordReference* wordRef is the match
    // Object& data is the user data provided by the caller when
    //              search began.
    // 
    // // The WordKey object that specifies the search criterion // may be used as follows (assuming word is followed by DOCID and // LOCATION): // // Ex1: WordKey("word ") find all occurrences // of word. // // Ex2: WordKey("meet ") find all occurrences // starting with meet, including meeting etc. // // Ex3: WordKey("meet 1") find all occurrences of // meet that occur at LOCATION 1 in any DOCID. This can // be inefficient since the search has to scan all occurrences // of meet to find the ones that occur at LOCATION 1. // // Ex4: WordKey("meet 2 ") find all occurrences of // meet that occur in DOCID 2, at any location. // // Interface functions are virtual so that a derivation of the // class is possible. Some functions are meant to be used by derived // classes such as the Initialize function. All data members // should be accessed using the corresponding accessor if possible. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordCursor.h,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordCursor_h_ #define _WordCursor_h_ #ifndef SWIG #include "htString.h" #include "WordKey.h" #include "WordDB.h" class WordList; class WordDBCursor; #endif /* SWIG */ // // Possible values of the action argument of WordList::Walk // check walk function in WordList.cc for info on these: // #define HTDIG_WORDLIST_COLLECTOR 0x0001 #define HTDIG_WORDLIST_WALKER 0x0002 #ifndef SWIG // // Type of the callback argument in WordCursor // typedef int (*wordlist_walk_callback_t)(WordList *, WordDBCursor& , const WordReference *, Object &); #endif /* SWIG */ // // Possible values of the status member // // // WalkNext reached the end of the matches // #define WORD_WALK_ATEND 0x0001 // // Failed to acquire Berkeley DB cursor // #define WORD_WALK_CURSOR_FAILED 0x0002 // // Berkeley DB Get operation failed // #define WORD_WALK_GET_FAILED 0x0004 // // Callback function returned NOTOK // #define WORD_WALK_CALLBACK_FAILED 0x0008 // // WalkNextStep hit an entry that does not match the // searched key. // #define WORD_WALK_NOMATCH_FAILED 0x0010 // // WordCursor contains undefined data // #define WORD_WALK_FAILED 0xffffffff // // Possible return values of the IsA() method // #define WORD_CURSOR 1 #define WORD_CURSORS 2 // // Wordlist::Walk uses WordCursor for : // state information : cursor // search term description // debug/trace/benchmarking // search result format description // class WordCursor { public: #ifndef SWIG // // Private constructor. Creator of the object must then call Initialize() // prior to using any other methods. // WordCursor() { Clear(); } //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursor(WordList *words, wordlist_walk_callback_t callback, Object * callback_data) { Clear(); Initialize(words, WordKey(), callback, callback_data, HTDIG_WORDLIST_WALKER); } //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursor(WordList *words, const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) { Clear(); Initialize(words, searchKey, 0, 0, action); } //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursor(WordList *words, const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data) { Clear(); Initialize(words, searchKey, callback, callback_data, HTDIG_WORDLIST_WALKER); } #endif /* SWIG */ virtual ~WordCursor() {} //- // Clear all data in object, set GetResult() data to NULL but // do not delete it (the application is responsible for that). // virtual void Clear(); virtual void ClearInternal(); virtual void ClearResult(); //- // Returns the type of the object. May be overloaded by // derived classes to differentiate them at runtime. // Returns WORD_CURSOR. // virtual int IsA() const { return WORD_CURSOR; } //- // Returns true if WalkNext() step entries in strictly increasing // order, false if it step entries in random order. // virtual int Ordered() const { return 1; } //- // Optimize the cursor before starting a Walk. // Returns OK on success, NOTOK otherwise. // virtual int Optimize() { return OK; } //- // Save in buffer all the information necessary to resume // the walk at the point it left. The ASCII representation of the // last key found (GetFound()) is written in buffer using the // WordKey::Get method. // virtual int ContextSave(String& buffer) const { found.Get(buffer); return OK; } //- // Restore from buffer all the information necessary to // resume the walk at the point it left. The buffer is expected // to contain an ASCII representation of a WordKey (see WordKey::Set // method). A Seek is done on the key and the object is prepared // to jump to the next occurrence when WalkNext is called (the // cursor_get_flags is set to DB_NEXT. // virtual int ContextRestore(const String& buffer); #ifndef SWIG //- // Walk and collect data from the index. // Returns OK on success, NOTOK otherwise. // virtual int Walk(); #endif /* SWIG */ //- // Must be called before other Walk methods are used. // Fill internal state according to input parameters // and move before the first matching entry. // Returns OK on success, NOTOK otherwise. // virtual int WalkInit(); //- // Move before the first index matching entry. // Returns OK on success, NOTOK otherwise. // virtual int WalkRewind(); //- // Move to the next matching entry. // At end of list, WORD_WALK_ATEND is returned. // Returns OK on success, NOTOK otherwise. // virtual int WalkNext(); #ifndef SWIG //- // Advance the cursor one step. The entry pointed to by the cursor may // or may not match the requirements. Returns OK if entry pointed // by cursor matches requirements. Returns NOTOK on // failure. Returns WORD_WALK_NOMATCH_FAILED if the current entry // does not match requirements, it's safe to call WalkNextStep again // until either OK or NOTOK is returned. // virtual int WalkNextStep(); #endif /* SWIG */ //- // Terminate Walk, free allocated resources. // Returns OK on success, NOTOK otherwise. // virtual int WalkFinish(); // // Find out if cursor should better jump to the next possible key // (DB_SET_RANGE) instead of sequential iterating (DB_NEXT). If it // is decided that jump is a better move : cursor_set_flags = // DB_SET_RANGE key = calculated next possible key Else do nothing // Return OK if skipping successfull. Returns WORD_WALK_ATEND if no // more possible match, reached the maximum. Returns // WORD_WALK_FAILED on general failure, occurs if called and no // skipping necessary. // int SkipUselessSequentialWalking(); //- // Move before the inverted index position specified in patch. // May only be called after a successfull call to the WalkNext // or WalkNextStepmethod. // Copy defined fields from patch into a copy of the // found data member and // initialize internal state so that WalkNext jumps to // this key next time it's called (cursor_get_flag set to DB_SET_RANGE). // Returns OK if successfull, NOTOK otherwise. // virtual int Seek(const WordKey& patch); //- // Returns true if cursor is positioned after the last possible // match, false otherwise. // virtual int IsAtEnd() const { return status == WORD_WALK_ATEND; } // // Accessors for input parameters // //- // Returns the search criterion. // WordKey& GetSearch() { return searchKey; } #ifndef SWIG const WordKey& GetSearch() const { return searchKey; } #endif /* SWIG */ //- // Returns the type of action when a matching entry // is found. // int GetAction() const { return action; } // // Accessors for output parameters // //- // Returns the list of WordReference found. The application // is responsible for deallocation of the list. // List *GetResults() { return collectRes; } //- // For debugging purposes. Returns the list of WordReference hit // during the search // process. Some of them match the searched key, some don't. // The application is responsible for deallocation of the list. // List *GetTraces() { return traceRes; } //- // For debugging purposes. Set the list of WordReference hit // during the search process. // void SetTraces(List* traceRes_arg) { traceRes = traceRes_arg; } //- // Returns the last entry hit by the search. Only contains // a valid value if the last WalkNext or WalkNextStep // call was successfull (i.e. returned OK). // const WordReference& GetFound() { return found; } //- // Returns the number of occurrences of the searched word // in the inverted index in the noccurrence parameter. // Returns OK on success, NOTOK on failure. // virtual int Noccurrence(unsigned int& noccurrence) const; #ifndef SWIG //- // Convert the whole structure to an ASCII string description // Returns OK if successfull, NOTOK otherwise. // virtual int Get(String& bufferout) const; String Get() const { String tmp; Get(tmp); return tmp; } protected: //- // Protected method. Derived classes should use this function to initialize // the object if they do not call a WordCursor constructor in their own // constructutor. Initialization may occur after the object is created // and must occur before a Walk* method is called. See the // DESCRIPTION section for the semantics of the arguments. // Return OK on success, NOTOK on error. // int Initialize(WordList *nwords, const WordKey &nsearchKey, wordlist_walk_callback_t ncallback, Object * ncallback_data, int naction); // // Input parameters // //- // Input data. The key to be searched, see DESCRIPTION for more information. // WordKey searchKey; // // Input data. What do do when a WordReference is found. // Can either be // HTDIG_WORDLIST_COLLECTOR WordReference found stored in collectRes // HTDIG_WORDLIST_WALKER callback is called for each WordReference found // int action; // // Input data. Callback function called for each match found. // wordlist_walk_callback_t callback; // // Input data. Argument given to callback, contains arbitrary // caller defined data. // Object *callback_data; // // Output parameters // // // Output data. List of WordReference found in the search. // List *collectRes; //- // Output data. Last match found. Use GetFound() to retrieve it. // WordReference found; //- // Output data. WORD_WALK_ATEND if cursor is past last match, // OK otherwise. Use GetStatus() to retrieve it. // int status; // // Debugging section. Do not use unless you know exactly what you do. // // // Collect everything found while searching (not necessarily matching) // List *traceRes; // // Internal state // // // The actual Berkeley DB cursor. // WordDBCursor cursor; // // The latest retrieved key and data // String key; String data; // // The shorted prefix key computed from searchKey // WordKey prefixKey; //- // WalkNext leap is either DB_NEXT or DB_SET_RANGE. // int cursor_get_flags; // // True if search key is a prefix key // int searchKeyIsSameAsPrefix; //- // The inverted index used by this cursor. // WordList *words; #endif /* SWIG */ }; #endif /* _WordCursor_h_ */ htdig-3.2.0b6/htword/WordCursorOne.cc0100644006314600127310000004142710055635556016776 0ustar angusgbhtdig// // WordCursorOne.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordCursorOne.cc,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordCursorOne.h" #include "WordListOne.h" #include "WordDead.h" #include // // WordCursorOne implementation // // ***************************************************************************** WordCursorOne::WordCursorOne(WordList *words) : WordCursor(words->GetContext()), prefixKey(words->GetContext()) { Clear(); } // ***************************************************************************** WordCursorOne::WordCursorOne(WordList *words, wordlist_walk_callback_t callback, Object * callback_data) : WordCursor(words->GetContext()), prefixKey(words->GetContext()) { Clear(); Initialize(words, WordKey(words->GetContext()), callback, callback_data, HTDIG_WORDLIST_WALKER); } // ***************************************************************************** WordCursorOne::WordCursorOne(WordList *words, const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) : WordCursor(words->GetContext()), prefixKey(words->GetContext()) { Clear(); Initialize(words, searchKey, 0, 0, action); } // ***************************************************************************** WordCursorOne::WordCursorOne(WordList *words, const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data) : WordCursor(words->GetContext()), prefixKey(words->GetContext()) { Clear(); Initialize(words, searchKey, callback, callback_data, HTDIG_WORDLIST_WALKER); } // ***************************************************************************** // int WordCursorOne::Initialize(WordList *nwords, const WordKey &nsearchKey, wordlist_walk_callback_t ncallback, Object *ncallback_data, int naction) { action = naction; searchKey = nsearchKey; callback = ncallback; callback_data = ncallback_data; words = nwords; cursor = ((WordListOne*)nwords)->db->Cursor(); return OK; } // ***************************************************************************** // void WordCursorOne::Clear() { searchKey.Clear(); action = 0; callback = 0; callback_data = 0; ClearResult(); ClearInternal(); words = 0; // // Debugging section. // traceRes = 0; } // ***************************************************************************** // void WordCursorOne::ClearInternal() { key.trunc(); data.trunc(); prefixKey.Clear(); cursor_get_flags = DB_SET_RANGE; searchKeyIsSameAsPrefix = 0; } // ***************************************************************************** // void WordCursorOne::ClearResult() { collectRes = 0; found.Clear(); status = OK; } int WordCursorOne::ContextRestore(const String& buffer) { int ret = OK; if(!buffer.empty()) { WordKey key(words->GetContext(), buffer); if((ret = Seek(key)) != OK) return ret; // // Move to restored position so that next call to // WalkNext will go above the restored position. // if((ret = WalkNext()) != OK) return ret; } return ret; } // ***************************************************************************** // // Walk and collect data from the word database. // // If action bit HTDIG_WORDLIST_COLLECTOR is set WordReferences are // stored in a list and the list is returned. // If action bit HTDIG_WORDLIST_WALKER is set the function // is called for each WordReference found. No list is built and the // function returns a null pointer. // // The argument may be a fully qualified key, containing precise values for each // field of the key. It may also contain only some fields of the key. In both cases // all the word occurrences matching the fields set in the key are retrieved. It may // be fast if key is a prefix (see WordKey::Prefix for a definition). It may // be *slow* if key is not a prefix because it forces a complete walk of the // index. // int WordCursorOne::Walk() { int ret; if((ret = WalkInit()) != OK) return ret; while((ret = WalkNext()) == OK) ; int ret1; if((ret1 = WalkFinish()) != OK) return ret1; return ret == WORD_WALK_ATEND ? OK : NOTOK; } int WordCursorOne::WalkInit() { ClearResult(); ClearInternal(); WordReference wordRef(words->GetContext()); { int ret; if((ret = cursor->Open()) != 0) return ret; } if(words->verbose) fprintf(stderr, "WordCursorOne::WalkInit: action = %d, SearchKey = %s\n", action, (char*)searchKey.Get()); if(action & HTDIG_WORDLIST_COLLECTOR) { collectRes = new List; } WordKey first_key(words->GetContext()); // // Move the cursor to start walking and do some sanity checks. // if(searchKey.Empty()) { // // Move past the stat data // if(words->verbose) fprintf(stderr, "WordCursorOne::WalkInit: at start of keys because search key is empty\n"); } else { prefixKey = searchKey; // // If the key is a prefix, the start key is // the longest possible prefix contained in the key. If the // key does not contain any prefix, start from the beginning // of the file. // if(prefixKey.PrefixOnly() == NOTOK) { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkInit: at start of keys because search key is not a prefix\n"); prefixKey.Clear(); } else { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkInit: go to %s \n", (char*)prefixKey.Get()); first_key = prefixKey; } } first_key.Pack(key); // // Allow Seek immediately after Init // found.Key() = first_key; status = OK; searchKeyIsSameAsPrefix = searchKey.ExactEqual(prefixKey); cursor_get_flags = DB_SET_RANGE; return OK; } int WordCursorOne::WalkRewind() { WordKey first_key(words->GetContext()); // // Move the cursor to start walking and do some sanity checks. // if(searchKey.Empty()) { first_key.Clear(); } else { prefixKey = searchKey; // // If the key is a prefix, the start key is // the longest possible prefix contained in the key. If the // key does not contain any prefix, start from the beginning // of the file. // if(prefixKey.PrefixOnly() == NOTOK) { prefixKey.Clear(); first_key.Clear(); } else { first_key = prefixKey; } } first_key.Pack(key); // // Allow Seek immediately after Rewind // found.Key() = first_key; status = OK; searchKeyIsSameAsPrefix = searchKey.ExactEqual(prefixKey); cursor_get_flags = DB_SET_RANGE; return OK; } int WordCursorOne::WalkNext() { int ret; while((ret = WalkNextStep()) == WORD_WALK_NOMATCH_FAILED) if(words->verbose > 1) fprintf(stderr, "WordCursorOne::WalkNext: got false match, retry\n"); return ret; } int WordCursorOne::WalkNextStep() { status = OK; { int error; if((error = cursor->Get(key, data, cursor_get_flags)) != 0) { if(error == DB_NOTFOUND) { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, no more matches\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); } else { return WORD_WALK_GET_FAILED; } } } // // Next step operation is always sequential walk // cursor_get_flags = DB_NEXT; found.Unpack(key, data); if(words->Dead()->Exists(found.Key())) return WORD_WALK_NOMATCH_FAILED; if(traceRes) traceRes->Add(new WordReference(found)); if(words->verbose > 1) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, candidate is %s\n", (char*)searchKey.Get(), (char*)found.Get()); // // Don't bother to compare keys if we want to walk all the entries // if(!(searchKey.Empty())) { // examples // searchKey: aabc 1 ? ? ? // prefixKey: aabc 1 ? ? ? // // Stop loop if we reach a record whose key does not // match prefix key requirement, provided we have a valid // prefix key. // (ie. stop loop if we're past last possible match...) // if(!prefixKey.Empty() && !prefixKey.Equal(found.Key())) { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, no more matches because found a key that is greater than searchKey\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); } // // Skip entries that do not exactly match the specified key. // if(!searchKeyIsSameAsPrefix && !searchKey.Equal(found.Key())) { int ret; switch((ret = SkipUselessSequentialWalking())) { case OK: if(words->verbose > 1) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, false match jump to %s\n", (char*)searchKey.Get(), (char*)found.Get()); return WORD_WALK_NOMATCH_FAILED; break; case WORD_WALK_ATEND: if(words->verbose) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, no more matches according to SkipUselessSequentialWalking\n", (char*)searchKey.Get()); return (status = WORD_WALK_ATEND); break; default: fprintf(stderr, "WordCursorOne::WalkNextStep: SkipUselessSequentialWalking failed %d\n", ret); return NOTOK; break; } } } if(words->verbose) fprintf(stderr, "WordCursorOne::WalkNextStep: looking for %s, found %s\n", (char*)searchKey.Get(), (char*)found.Get()); if(collectRes) { if(words->verbose > 2) fprintf(stderr, "WordCursorOne::WalkNextStep: collect\n"); collectRes->Add(new WordReference(found)); } else if(callback) { if(words->verbose > 2) fprintf(stderr, "WordCursorOne::WalkNextStep: calling callback\n"); int ret = (*callback)(words, *cursor, &found, *(callback_data) ); // // The callback function tells us that something went wrong, might // as well stop walking. // if(ret != OK) { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkNextStep: callback returned NOTOK"); return WORD_WALK_CALLBACK_FAILED|(status = WORD_WALK_ATEND); } } return OK; } int WordCursorOne::WalkFinish() { if(words->verbose) fprintf(stderr, "WordCursorOne::WalkFinish\n"); return cursor->Close() == 0 ? OK : NOTOK; } // ***************************************************************************** // // Helper for SkipUselessSequentialWalking. // Undefine in foundKey all fields defined in searchKey // so that they are not considered by SetToFollowing. // It could become a method of WordKey but lacks generalisation and // from what I see it is a rather specific operation. // static inline void complement(WordContext* context, WordKey& key, const WordKey& mask) { int nfields = context->GetKeyInfo().nfields; int i; // // Undefine in 'key' all fields defined in 'mask' // for(i = 0; i < nfields; i++) { if(mask.IsDefined(i)) key.Undefined(i); else key.SetDefined(i); } } // ***************************************************************************** // // Find out if we should better jump to the next possible key (DB_SET_RANGE) instead of // sequential iterating (DB_NEXT). // If it is decided that jump is a better move : // cursor_set_flags = DB_SET_RANGE // key = calculated next possible key // Else // do nothing // Return values // OK: skipping successfull. // WORD_WALK_ATEND : no more possible match, reached the maximum // WORD_WALK_FAILED: general failure, occurs if called and no skipping // necessary. // // Sequential searching can waste time by searching all keys, for example: // If searching for Key: argh 10 // Under normal circonstances we would do the following // // DATA STATUS ACTION // 1: argh 1 10 match DB_NEXT // 2: argh 2 11 nomatch DB_NEXT // 3: argh 2 15 nomatch DB_NEXT // 4: argh 2 20 nomatch DB_NEXT // 5: argh 2 30 nomatch DB_NEXT // 6: argh 5 1 nomatch DB_NEXT // 7: argh 5 8 nomatch DB_NEXT // 8: argh 8 6 nomatch DB_NEXT // // But the optimal would be // // DATA STATUS ACTION // 1: argh 1 10 match DB_NEXT // 2: argh 2 11 nomatch DB_SET_RANGE argh 3 10 // 3: argh 2 15 // 4: argh 2 20 // 5: argh 2 30 // 6: argh 5 1 nomatch DB_SET_RANGE argh 5 10 // 7: argh 5 8 // 8: argh 8 6 nomatch DB_SET_RANGE argh 8 10 // // That saves a lot of unecessary hit. The underlying logic is a bit // more complex but you have the idea. // int WordCursorOne::SkipUselessSequentialWalking() { WordKey& foundKey = found.Key(); int nfields = words->GetContext()->GetKeyInfo().nfields; int i; // // Find out how the searchKey and the foundKey differ. // int diff_field = 0; int lower = 0; if(!foundKey.Diff(searchKey, diff_field, lower)) { // // foundKey matches searchKey (no difference), don't // skip, everything is fine. The caller of SkipUselessSequentialWalking // is expected to avoid this case for efficiency. // return WORD_WALK_FAILED; } if(words->verbose > 2) fprintf(stderr, "WordCursorOne::SkipUselessSequentialWalking: looking for %s, candidate is %s\n", (char*)searchKey.Get(), (char*)foundKey.Get()); // // Undefine in foundKey all fields defined in searchKey // so that they are not considered by SetToFollowing. // complement(words->GetContext(), foundKey, searchKey); // // If the key found is lower than the searched key when // considering only the fields defined in the search key, // we only need to enforce the key to get the match. // Otherwise we need to increment the found key to jump // properly. // if(lower) { if(words->verbose > 1) fprintf(stderr, "WordCursorOne::SkipUselessSequentialWalking: enforcing the search constraint is enough to jump forward\n"); for(i = diff_field + 1; i < nfields; i++) if(foundKey.IsDefined(i)) foundKey.Set(i, 0); } else { if(words->verbose > 1) fprintf(stderr, "WordCursorOne::SkipUselessSequentialWalking: increment the key to jump forward\n"); // // diff_field - 1 is not really necessary because diff_field is undefined // in foundKey and would therefore be ignored by SetToFollowing. We write // diff_field - 1 to clearly state that incrementing begins just before the // field for which a difference was found. // int ret; if((ret = foundKey.SetToFollowing(diff_field - 1)) != OK) return ret; } // // Copy all fields defined in searchKey into foundKey. This will copy // searchKey in foundKey because all these fields have been // previously undefined in foundKey. // foundKey.Merge(searchKey); if(words->verbose > 2) fprintf(stderr, "WordCursorOne::SkipUselessSequentialWalking: looking for %s, jump to %s\n", (char*)searchKey.Get(), (char*)foundKey.Get()); // // Instruct Next function to jump to the calculated key // if(foundKey.Pack(key) == NOTOK) { return WORD_WALK_FAILED; } cursor_get_flags = DB_SET_RANGE; return OK; } // ***************************************************************************** // // Copy defined fields in patch into foundKey and // initialize internal state so that WalkNext jumps to // this key next time it's called. // // Technically this means : Override latest key found (found data member) // with patch fields values, starting from the first field set in // patch up to the last. Pack the result in the key field and set // cursor_get_flags to DB_SET_RANGE. // int WordCursorOne::Seek(const WordKey& patch) { int nfields = words->GetContext()->GetKeyInfo().nfields; WordKey pos = searchKey; if(patch.Empty()) { fprintf(stderr, "WordCursorOne::Seek: empty patch is useless\n"); return NOTOK; } int i; // // Leave the most significant fields untouched // for(i = WORD_KEY_WORD + 1; i < nfields; i++) if(patch.IsDefined(i)) break; // // From the first value set in the patch to the end // override. // for(; i < nfields; i++) { if(patch.IsDefined(i)) pos.Set(i, patch.Get(i)); else pos.Set(i, 0); } if(!pos.Filled()) { fprintf(stderr, "WordCursorOne::Seek: only make sense if the resulting key is fully defined\n"); return NOTOK; } if(words->verbose > 2) fprintf(stderr, "WordCursorOne::Seek: seek to %s\n", (char*)pos.Get()); // // Next move will jump to the patched key // pos.Pack(key); cursor_get_flags = DB_SET_RANGE; return OK; } // // Convert the whole structure to an ascii string description // int WordCursorOne::Get(String& bufferout) const { String tmp; bufferout.trunc(); searchKey.Get(tmp); bufferout << "Input: searchKey = " << tmp << ", action = " << action << "; Output: collectRes " << (collectRes ? "set" : "not set"); found.Get(tmp); bufferout << ", found = " << tmp << ", status = " << status; prefixKey.Get(tmp); bufferout << "; Internal State: prefixKey = " << tmp << ", cursor_get_flags = " << cursor_get_flags; return OK; } htdig-3.2.0b6/htword/WordCursorOne.h0100644006314600127310000001045710055635556016637 0ustar angusgbhtdig// // WordCursorOne.h // // NAME // // search and retrieve entries in a WordListOne object. // // SYNOPSIS // // #include // // int callback(WordList *, WordDBCursor& , const WordReference *, Object &) // { // ... // } // // Object* data = ... // // WordList *words = ...; // // WordCursor *search = words->Cursor(callback, data); // WordCursor *search = words->Cursor(WordKey("word ")); // WordCursor *search = words->Cursor(WordKey("word "), callback, data); // WordCursor *search = words->Cursor(WordKey()); // // ... // // if(search->Walk() == NOTOK) bark; // List* results = search->GetResults(); // // search->WalkInit(); // if(search->WalkNext() == OK) // dosomething(search->GetFound()); // search->WalkFinish(); // // DESCRIPTION // // WordCursorOne is a WordCursor derived class that implements search // in a WordListOne object. It currently is the only derived class of // the WordCursor object. Most of its behaviour is described in the // WordCursor manual page, only the behaviour specific to WordCursorOne // is documented here. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordCursorOne.h,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordCursorOne_h_ #define _WordCursorOne_h_ #ifndef SWIG #include "htString.h" #include "WordKey.h" #include "WordDB.h" #include "WordCursor.h" class WordList; class WordDBCursor; #endif /* SWIG */ class WordCursorOne : public WordCursor { public: #ifndef SWIG //- // Private constructor. Creator of the object must then call Initialize() // prior to using any other methods. // WordCursorOne(WordList *words); //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursorOne(WordList *words, wordlist_walk_callback_t callback, Object * callback_data); //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursorOne(WordList *words, const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER); //- // Private constructor. See WordList::Cursor method with same prototype for // description. // WordCursorOne(WordList *words, const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data); #endif /* SWIG */ virtual ~WordCursorOne() { if(cursor) delete cursor; } virtual void Clear(); virtual void ClearInternal(); virtual void ClearResult(); virtual inline int ContextSave(String& buffer) const { found.Get(buffer); return OK; } virtual int ContextRestore(const String& buffer); #ifndef SWIG virtual int Walk(); #endif /* SWIG */ virtual int WalkInit(); virtual int WalkRewind(); virtual int WalkNext(); #ifndef SWIG virtual int WalkNextStep(); #endif /* SWIG */ virtual int WalkFinish(); // // Find out if cursor should better jump to the next possible key // (DB_SET_RANGE) instead of sequential iterating (DB_NEXT). If it // is decided that jump is a better move : cursor_set_flags = // DB_SET_RANGE key = calculated next possible key Else do nothing // Return OK if skipping successfull. Returns WORD_WALK_ATEND if no // more possible match, reached the maximum. Returns // WORD_WALK_FAILED on general failure, occurs if called and no // skipping necessary. // int SkipUselessSequentialWalking(); virtual int Seek(const WordKey& patch); #ifndef SWIG virtual int Get(String& bufferout) const; inline String Get() const { String tmp; Get(tmp); return tmp; } protected: int Initialize(WordList *nwords, const WordKey &nsearchKey, wordlist_walk_callback_t ncallback, Object * ncallback_data, int naction); // // Internal state // // // The actual Berkeley DB cursor. // WordDBCursor* cursor; // // The latest retrieved key and data // String key; String data; // // The shorted prefix key computed from searchKey // WordKey prefixKey; // // WalkNext leap is either DB_NEXT or DB_SET_RANGE. // int cursor_get_flags; // // True if search key is a prefix key // int searchKeyIsSameAsPrefix; #endif /* SWIG */ }; #endif /* _WordCursorOne_h_ */ htdig-3.2.0b6/htword/WordDB.cc0100644006314600127310000000275710055635556015347 0ustar angusgbhtdig// // WordDB.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDB.cc,v 1.10 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "defaults.h" #include "WordDB.h" #include "../db/db.h" const char* dberror(int errval) { #define DB_MAX_ERROR (-DB_TXN_CKP + 1) static const char* dbstr[DB_MAX_ERROR] = { "", "DB_INCOMPLETE", "DB_KEYEMPTY", "DB_KEYEXISTS", "DB_LOCK_DEADLOCK", "DB_LOCK_NOTGRANTED", "DB_LOCK_NOTHELD", "DB_NOTFOUND", "DB_RUNRECOVERY", "DB_DELETED", "DB_NEEDSPLIT", "DB_SWAPBYTES", "DB_TXN_CKP", }; if(errval < 0 && -errval < DB_MAX_ERROR) return dbstr[-errval]; else return strerror(errval); } int WordDB::Open(const String& filename, DBTYPE type, int flags, int mode) { if(is_open) { int error = 0; if((error = Close()) != 0) return error; } if(!dbenv) { const char* progname = "WordDB"; // // Environment initialization // // Output errors to the application's log. // db->set_errfile(db, stderr); db->set_errpfx(db, progname); } int error = db->open(db, filename, NULL, type, (u_int32_t)flags, mode); if(error == 0) is_open = 1; return error; } htdig-3.2.0b6/htword/WordDB.h0100644006314600127310000001662310055635556015206 0ustar angusgbhtdig// // WordDB.h // // WordDB: Interface to Berkeley DB // uses String and WordReference instead of Dbt, add some convenience // methods and implements string translation of Berkeley DB error codes. // It does not include the 'join' feature. // Beside this, the interface it identical to the Db class. // The next evolution for this set of class is to have a single object per // application so that they all share the same environment (transactions, // shared pool, database directory). This implies a static common object // that is refered by each actual instance of WordDB. The static object // holds the DbEnv and DbInfo, the instances of WordDB only have an open // descriptor using the same DbEnv and DbInfo. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDB.h,v 1.7 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordDB_h_ #define _WordDB_h_ #include #include #include "db.h" #include "WordReference.h" #include "WordDBInfo.h" #include "htString.h" #define WORD_DBT_DCL(v) \ DBT v; \ memset((char*)&(v), '\0', sizeof(DBT)) #define WORD_DBT_SET(v,d,s) \ v.data = (d); \ v.size = (s) #define WORD_DBT_INIT(v,d,s) \ WORD_DBT_DCL(v); \ WORD_DBT_SET(v,d,s) // // Encapsulate the Berkeley DB DB type // // Implements the same methods with String instead of Dbt. // // Add convenience methods taking WordReference instead of String // // The error model is *not* to use exceptions. // // To get a cursor use the Open method of WordDBCursor. I find this // more convinient than getting a cursor from WordDB. // // The WordDB has DbInfo and DbEnv members that can be set before // calling Open to configure it. // class WordDB { public: inline WordDB() { Alloc(); } inline ~WordDB() { Dealloc(); } inline int Alloc() { db = 0; is_open = 0; dbenv = WordDBInfo::Instance()->dbenv; return CDB_db_create(&db, dbenv, 0); } inline int Dealloc() { int error = 0; is_open = 0; if(db) error = db->close(db, 0); else fprintf(stderr, "WordDB::Dealloc: null db\n"); dbenv = 0; db = 0; return error; } int Open(const String& filename, DBTYPE type, int flags, int mode); inline int Close() { int error; if((error = Dealloc()) != 0) return error; return Alloc(); } inline int Fd(int *fdp) { if(!is_open) return DB_UNKNOWN; return db->fd(db, fdp); } inline int Stat(void *sp, void *(*db_malloc)(size_t), int flags) { if(!is_open) return DB_UNKNOWN; return db->stat(db, sp, db_malloc, (u_int32_t) flags); } inline int Sync(int flags) { if(!is_open) return DB_UNKNOWN; return db->sync(db, (u_int32_t) flags); } inline int get_byteswapped() const { if(!is_open) return DB_UNKNOWN; return db->get_byteswapped(db); } inline DBTYPE get_type() const { if(!is_open) return DB_UNKNOWN; return db->get_type(db); } // // String arguments // inline int Put(DB_TXN *txn, const String& key, const String& data, int flags) { WORD_DBT_INIT(rkey, (void*)key.get(), key.length()); WORD_DBT_INIT(rdata, (void*)data.get(), data.length()); return db->put(db, txn, &rkey, &rdata, flags); } inline int Get(DB_TXN *txn, String& key, String& data, int flags) const { WORD_DBT_INIT(rkey, (void*)key.get(), (u_int32_t)key.length()); WORD_DBT_INIT(rdata, (void*)data.get(), (u_int32_t)data.length()); int error; if((error = db->get(db, txn, &rkey, &rdata, 0)) != 0) { if(error != DB_NOTFOUND) fprintf(stderr, "WordDB::Get(%s,%s) using %d failed %s\n", (char*)key, (char*)data, flags, CDB_db_strerror(error)); } else { // // Only set arguments if found something. // key.set((const char*)rkey.data, (int)rkey.size); data.set((const char*)rdata.data, (int)rdata.size); } return error; } inline int Del(DB_TXN *txn, const String& key) { WORD_DBT_INIT(rkey, (void*)key.get(), (u_int32_t)key.length()); return db->del(db, txn, &rkey, 0); } // // WordReference argument // inline int Put(const WordReference& wordRef, int flags) { if(!is_open) return DB_UNKNOWN; int ret; String key; String record; if((ret = wordRef.Pack(key, record)) != OK) return DB_RUNRECOVERY; return Put(0, key, record, flags); } inline int Del(const WordReference& wordRef) { String key; wordRef.Key().Pack(key); return Del(0, key); } // // Search entry matching wkey exactly, return key and data // in wordRef. // inline int Get(WordReference& wordRef) const { if(!is_open) return DB_UNKNOWN; String data; String key; if(wordRef.Key().Pack(key) != OK) return DB_RUNRECOVERY; int ret; if((ret = Get(0, key, data, 0)) != 0) return ret; return wordRef.Unpack(key, data) == OK ? 0 : DB_RUNRECOVERY; } // // Returns 0 of the key of wordRef matches an entry in the database. // Could be implemented with Get but is not because we don't // need to build a wordRef with the entry found in the base. // inline int Exists(const WordReference& wordRef) const { if(!is_open) return DB_UNKNOWN; String key; String data; if(wordRef.Key().Pack(key) != OK) return DB_RUNRECOVERY; return Get(0, key, data, 0); } // // Accessors // inline int set_bt_compare(int (*compare)(const DBT *, const DBT *)) { return db->set_bt_compare(db, compare); } inline int set_pagesize(u_int32_t pagesize) { return db->set_pagesize(db, pagesize); } // // Accessors for description of the compression scheme // inline DB_CMPR_INFO* CmprInfo() { return dbenv->mp_cmpr_info; } inline void CmprInfo(DB_CMPR_INFO* info) { dbenv->mp_cmpr_info = info; } int is_open; DB* db; DB_ENV* dbenv; }; // // Interface to DBC that uses String instead of DBT // class WordDBCursor { public: inline WordDBCursor() { cursor = 0; } inline ~WordDBCursor() { Close(); } inline int Open(DB* db) { Close(); return db->cursor(db, 0, &cursor, 0); } inline int Close() { if(cursor) cursor->c_close(cursor); cursor = 0; return 0; } // // String arguments // inline int Get(String& key, String& data, int flags) { WORD_DBT_DCL(rkey); WORD_DBT_DCL(rdata); switch(flags & DB_OPFLAGS_MASK) { case DB_SET_RANGE: case DB_SET: case DB_GET_BOTH: WORD_DBT_SET(rkey, (void*)key.get(), key.length()); break; } int error; if((error = cursor->c_get(cursor, &rkey, &rdata, (u_int32_t)flags)) != 0) { if(error != DB_NOTFOUND) fprintf(stderr, "WordDBCursor::Get(%d) failed %s\n", flags, CDB_db_strerror(error)); } else { key.set((const char*)rkey.data, (int)rkey.size); data.set((const char*)rdata.data, (int)rdata.size); } return error; } inline int Put(const String& key, const String& data, int flags) { WORD_DBT_INIT(rkey, (void*)key.get(), (size_t)key.length()); WORD_DBT_INIT(rdata, (void*)data.get(), (size_t)data.length()); return cursor->c_put(cursor, &rkey, &rdata, (u_int32_t)flags); } inline int Del() { return cursor->c_del(cursor, (u_int32_t)0); } private: DBC* cursor; }; #endif /* _WordDB_h */ htdig-3.2.0b6/htword/WordDBCache.cc0100644006314600127310000002613610055635556016270 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include #include #include "WordKey.h" #include "WordDB.h" #include "WordDBCache.h" #include "WordMeta.h" #include "ber.h" int WordDBCaches::Add(char* key, int key_size, char* data, int data_size) { int ret; if((ret = cache.Allocate(key_size + data_size)) == ENOMEM) { if((ret = CacheFlush()) != 0) return ret; if((ret = cache.Allocate(key_size + data_size))) return ret; } return cache.Add(key, key_size, data, data_size); } int WordDBCaches::AddFile(String& filename) { char tmp[32]; unsigned int serial; words->Meta()->Serial(WORD_META_SERIAL_FILE, serial); if(serial == WORD_META_SERIAL_INVALID) return NOTOK; filename = words->Filename(); sprintf(tmp, "C%08d", serial - 1); filename << tmp; String dummy; if(files->Put(0, filename, dummy, 0) != 0) return NOTOK; size = (cache.GetMax() / 1024) * serial; return OK; } int WordDBCaches::CacheFlush() { if(cache.Empty()) return OK; if(cache.Sort() != OK) return NOTOK; String filename; int locking = 0; if(!lock) { words->Meta()->Lock("cache", lock); locking = 1; } if(AddFile(filename) != OK) return NOTOK; if(CacheWrite(filename) != OK) return NOTOK; unsigned int serial; words->Meta()->GetSerial(WORD_META_SERIAL_FILE, serial); if(serial >= (unsigned int)file_max || Full()) if(Merge() != OK) return NOTOK; if(locking) words->Meta()->Unlock("cache", lock); return OK; } static int merge_cmp_size(WordDBCaches* , WordDBCacheFile* a, WordDBCacheFile* b) { return b->size - a->size; } int WordDBCaches::Merge() { if(CacheFlush() != OK) return NOTOK; int locking = 0; if(!lock) { words->Meta()->Lock("cache", lock); locking = 1; } unsigned int serial; words->Meta()->GetSerial(WORD_META_SERIAL_FILE, serial); if(serial <= 1) return OK; // // heap lists all the files in decreasing size order (biggest first) // WordDBCacheFile* heap = new WordDBCacheFile[serial]; { String filename; String dummy; WordDBCursor* cursor = files->Cursor(); struct stat stat_buf; int i; int ret; for(i = 0; (ret = cursor->Get(filename, dummy, DB_NEXT)) == 0; i++) { WordDBCacheFile& file = heap[i]; file.filename = filename; if(stat((char*)file.filename, &stat_buf) == 0) { file.size = stat_buf.st_size; } else { const String message = String("WordDBCaches::Merge: cannot stat ") + file.filename; perror((const char*)message); return NOTOK; } cursor->Del(); } delete cursor; myqsort((void*)heap, serial, sizeof(WordDBCacheFile), (myqsort_cmp)merge_cmp_size, (void*)this); } String tmpname = words->Filename() + String("C.tmp"); while(serial > 1) { WordDBCacheFile* a = &heap[serial - 1]; WordDBCacheFile* b = &heap[serial - 2]; if(Merge(a->filename, b->filename, tmpname) != OK) return NOTOK; // // Remove file a // if(unlink((char*)a->filename) != 0) { const String message = String("WordDBCaches::Merge: unlink ") + a->filename; perror((const char*)message); return NOTOK; } // // Remove file b // if(unlink((char*)b->filename) != 0) { const String message = String("WordDBCaches::Merge: unlink ") + b->filename; perror((const char*)message); return NOTOK; } // // Rename tmp file into file b // if(rename((char*)tmpname, (char*)b->filename) != 0) { const String message = String("WordDBCaches::Merge: rename ") + tmpname + String(" ") + b->filename; perror((const char*)message); return NOTOK; } // // Update b file size. The size need not be accurate number as long // as it reflects the relative size of each file. // b->size += a->size; serial--; // // update heap // myqsort((void*)heap, serial, sizeof(WordDBCacheFile), (myqsort_cmp)merge_cmp_size, (void*)this); } { String newname(words->Filename()); newname << "C00000000"; if(rename((char*)heap[0].filename, (char*)newname) != 0) { const String message = String("WordDBCaches::Merge: rename ") + heap[0].filename + String(" ") + newname; perror((const char*)message); return NOTOK; } String dummy; if(files->Put(0, newname, dummy, 0) != 0) return NOTOK; words->Meta()->SetSerial(WORD_META_SERIAL_FILE, serial); } if(locking) words->Meta()->Unlock("cache", lock); return OK; } int WordDBCaches::Merge(const String& filea, const String& fileb, const String& tmpname) { FILE* ftmp = fopen((const char*)tmpname, "w"); FILE* fa = fopen((const char*)filea, "r"); FILE* fb = fopen((const char*)fileb, "r"); unsigned int buffertmp_size = 128; unsigned char* buffertmp = (unsigned char*)malloc(buffertmp_size); unsigned int buffera_size = 128; unsigned char* buffera = (unsigned char*)malloc(buffera_size); unsigned int bufferb_size = 128; unsigned char* bufferb = (unsigned char*)malloc(bufferb_size); unsigned int entriesa_length; if(ber_file2value(fa, entriesa_length) < 1) return NOTOK; unsigned int entriesb_length; if(ber_file2value(fb, entriesb_length) < 1) return NOTOK; if(ber_value2file(ftmp, entriesa_length + entriesb_length) < 1) return NOTOK; WordDBCacheEntry entrya; WordDBCacheEntry entryb; if(entriesa_length > 0 && entriesb_length > 0) { if(ReadEntry(fa, entrya, buffera, buffera_size) != OK) return NOTOK; if(ReadEntry(fb, entryb, bufferb, bufferb_size) != OK) return NOTOK; while(entriesa_length > 0 && entriesb_length > 0) { if(WordKey::Compare(words->GetContext(), (const unsigned char*)entrya.key, entrya.key_size, (const unsigned char*)entryb.key, entryb.key_size) < 0) { if(WriteEntry(ftmp, entrya, buffertmp, buffertmp_size) != OK) return NOTOK; if(--entriesa_length > 0) if(ReadEntry(fa, entrya, buffera, buffera_size) != OK) return NOTOK; } else { if(WriteEntry(ftmp, entryb, buffertmp, buffertmp_size) != OK) return NOTOK; if(--entriesb_length > 0) if(ReadEntry(fb, entryb, bufferb, bufferb_size) != OK) return NOTOK; } } } if(entriesa_length > 0 || entriesb_length > 0) { FILE* fp = entriesa_length > 0 ? fa : fb; unsigned int& entries_length = entriesa_length > 0 ? entriesa_length : entriesb_length; WordDBCacheEntry& entry = entriesa_length > 0 ? entrya : entryb; while(entries_length > 0) { if(WriteEntry(ftmp, entry, buffertmp, buffertmp_size) != OK) return NOTOK; if(--entries_length > 0) if(ReadEntry(fp, entry, buffera, buffera_size) != OK) return NOTOK; } } free(buffera); free(bufferb); free(buffertmp); fclose(fa); fclose(fb); fclose(ftmp); return OK; } int WordDBCaches::Merge(WordDB& db) { int locking = 0; if(!lock) { words->Meta()->Lock("cache", lock); locking = 1; } if(Merge() != OK) return NOTOK; String filename; String dummy; WordDBCursor* cursor = files->Cursor(); if(cursor->Get(filename, dummy, DB_FIRST) != 0) { delete cursor; return NOTOK; } cursor->Del(); delete cursor; FILE* fp = fopen((char*)filename, "r"); unsigned int buffer_size = 128; unsigned char* buffer = (unsigned char*)malloc(buffer_size); unsigned int entries_length; if(ber_file2value(fp, entries_length) < 1) return NOTOK; WordDBCacheEntry entry; unsigned int i; for(i = 0; i < entries_length; i++) { if(ReadEntry(fp, entry, buffer, buffer_size) != OK) return NOTOK; void* user_data = words->GetContext(); WORD_DBT_INIT(rkey, (void*)entry.key, entry.key_size); WORD_DBT_INIT(rdata, (void*)entry.data, entry.data_size); db.db->put(db.db, 0, &rkey, &rdata, 0); } if(unlink((char*)filename) != 0) { const String message = String("WordDBCaches::Merge: unlink ") + filename; perror((const char*)message); return NOTOK; } words->Meta()->SetSerial(WORD_META_SERIAL_FILE, 0); if(locking) words->Meta()->Unlock("cache", lock); size = 0; free(buffer); fclose(fp); return OK; } int WordDBCaches::CacheWrite(const String& filename) { FILE* fp = fopen(filename, "w"); if(!fp) { String message; message << "WordDBCaches::CacheWrite()" << filename << "): "; perror((char*)message); return NOTOK; } int entries_length; WordDBCacheEntry* entries; int ret; if((ret = cache.Entries(entries, entries_length)) != 0) return ret; if(ber_value2file(fp, entries_length) < 1) return NOTOK; unsigned int buffer_size = 1024; unsigned char* buffer = (unsigned char*)malloc(buffer_size); int i; for(i = 0; i < entries_length; i++) { if(WriteEntry(fp, entries[i], buffer, buffer_size) != OK) return NOTOK; } free(buffer); fclose(fp); cache.Flush(); return OK; } int WordDBCaches::WriteEntry(FILE* fp, WordDBCacheEntry& entry, unsigned char*& buffer, unsigned int& buffer_size) { if(entry.key_size + entry.data_size + 64 > buffer_size) { buffer_size = entry.key_size + entry.data_size + 64; buffer = (unsigned char*)realloc(buffer, buffer_size); } int p_size = buffer_size; unsigned char* p = buffer; int ber_len; if((ber_len = ber_value2buf(p, p_size, entry.key_size)) < 1) { fprintf(stderr, "WordDBCaches::WriteEntry: BER failed for key %d\n", entry.key_size); return NOTOK; } p += ber_len; memcpy(p, entry.key, entry.key_size); p += entry.key_size; p_size -= ber_len + entry.key_size; if((ber_len = ber_value2buf(p, p_size, entry.data_size)) < 1) { fprintf(stderr, "WordDBCaches::WriteEntry: BER failed for data %d\n", entry.data_size); return NOTOK; } p += ber_len; memcpy(p, entry.data, entry.data_size); p += entry.data_size; if(fwrite((void*)buffer, p - buffer, 1, fp) != 1) { perror("WordDBCaches::WriteEntry: cannot write entry "); return NOTOK; } return OK; } int WordDBCaches::ReadEntry(FILE* fp, WordDBCacheEntry& entry, unsigned char*& buffer, unsigned int& buffer_size) { if(ber_file2value(fp, entry.key_size) < 1) return NOTOK; if(entry.key_size > buffer_size) { buffer_size += entry.key_size; if(!(buffer = (unsigned char*)realloc(buffer, buffer_size))) return NOTOK; } if(fread((void*)buffer, entry.key_size, 1, fp) != 1) { perror("WordDBCaches::ReadEntry(): cannot read key entry "); return NOTOK; } if(ber_file2value(fp, entry.data_size) < 1) return NOTOK; if(entry.data_size > 0) { if(entry.data_size + entry.key_size > buffer_size) { buffer_size += entry.data_size; if(!(buffer = (unsigned char*)realloc(buffer, buffer_size))) return NOTOK; } if(fread((void*)(buffer + entry.key_size), entry.data_size, 1, fp) != 1) { perror("WordDBCaches::ReadEntry(): cannot read data entry "); return NOTOK; } } entry.key = (char*)buffer; entry.data = (char*)(buffer + entry.key_size); return OK; } htdig-3.2.0b6/htword/WordDBCache.h0100644006314600127310000001454410055635556016132 0ustar angusgbhtdig// // WordDBCache.h // // NAME // intermediate cache for WordList objects. // // SYNOPSIS // // Internal helper for the WordListOne object. // // DESCRIPTION // // To speed up bulk insertions, the WordDBCache allows them to remain in // memory as long as a given limit is not reached. The inserted entries // are them sorted and dumped into a file. When a given number of files // have been produced, they are merged into one. Eventually the resulting // list of entries is inserted into the WordList index. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDBCache.h,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordDBCache_h_ #define _WordDBCache_h_ #include #include #include "htString.h" #include "List.h" #include "db.h" #include "lib.h" #include "myqsort.h" #include "WordList.h" class WordDB; class WordLock; // // Minimum size of the pulsing cache // #define WORD_DB_CACHE_MINIMUM (500 * 1024) // // We could use DBT instead but it's more than two times bigger and // time saving by the most efficient way of memory space is the whole // point of the cache. // class WordDBCacheEntry { public: char* key; unsigned int key_size; char* data; unsigned int data_size; }; class WordDBCache { public: inline WordDBCache(WordContext* ncontext) { context = ncontext; entries = (WordDBCacheEntry*)malloc(1000 * sizeof(WordDBCacheEntry)); entries_length = 0; entries_size = 1000; pool = (char*)malloc(WORD_DB_CACHE_MINIMUM); pool_length = 0; pool_size = pool_max = WORD_DB_CACHE_MINIMUM; } inline ~WordDBCache() { if(pool_length > 0) { fprintf(stderr, "WordDBCache::~WordDBCache: destructor called and cache not empty\n"); } free(entries); free(pool); } inline int ResizeEntries() { entries_size *= 2; entries = (WordDBCacheEntry*)realloc(entries, entries_size * sizeof(WordDBCacheEntry)); return entries ? 0 : DB_RUNRECOVERY; } inline int ResizePool(int wanted) { if(pool_size * 2 > pool_max) { if(pool_max > pool_size && pool_max > wanted) pool_size = pool_max; else return ENOMEM; } else { pool_size *= 2; } pool = (char*)realloc(pool, pool_size); return pool ? 0 : DB_RUNRECOVERY; } inline int Allocate(int size) { int ret; if(entries_length >= entries_size) if((ret = ResizeEntries()) != 0) return ret; if(pool_length + size >= pool_size) { if((ret = ResizePool(pool_length + size)) != 0) return ret; } return 0; } inline int GetMax() const { return pool_max; } inline int SetMax(int max) { if(max > pool_max) pool_max = max; return 0; } inline int SetCompare(int (*ncompare)(WordContext *, const WordDBCacheEntry *, const WordDBCacheEntry *)) { compare = ncompare; return 0; } inline int Sort() { if(Absolute() != OK) return NOTOK; // // Reorder entries in increasing order // myqsort((void*)entries, entries_length, sizeof(WordDBCacheEntry), (myqsort_cmp)compare, (void*)context); return 0; } inline int Relative() { int i; for(i = 0; i < entries_length; i++) { entries[i].key = (char*)(entries[i].key - pool); entries[i].data = (char*)(entries[i].data - pool); } return OK; } inline int Absolute() { int i; for(i = 0; i < entries_length; i++) { entries[i].key = pool + (int)(entries[i].key); entries[i].data = pool + (int)(entries[i].data); } return OK; } inline int Entries(WordDBCacheEntry*& nentries, int& nentries_length) { nentries = entries; nentries_length = entries_length; return 0; } inline int Pool(char*& npool, int& npool_length) { npool = pool; npool_length = pool_length; return OK; } inline int Add(char* key, int key_size, char* data, int data_size) { int ret; if((ret = Allocate(key_size + data_size)) != 0) return ret; entries[entries_length].key = (char*)pool_length; entries[entries_length].key_size = key_size; entries[entries_length].data = (char*)(pool_length + key_size); entries[entries_length].data_size = data_size; entries_length++; memcpy(pool + pool_length, key, key_size); memcpy(pool + pool_length + key_size, data, data_size); pool_length += key_size + data_size; return 0; } inline int Flush() { entries_length = 0; pool_length = 0; return 0; } inline int Empty() { return entries_length <= 0; } private: WordDBCacheEntry* entries; int entries_length; int entries_size; char* pool; int pool_length; int pool_size; int pool_max; int (*compare)(WordContext *, const WordDBCacheEntry *, const WordDBCacheEntry *); WordContext *context; }; class WordDBCacheFile : public Object { public: WordDBCacheFile() { size = 0; } String filename; unsigned int size; }; class WordDBCaches { public: inline WordDBCaches(WordList* nwords, int nfile_max, int size_hint, int nsize_max) : cache(nwords->GetContext()) { words = nwords; files = new WordDB(words->GetContext()->GetDBInfo()); files->Open(words->Filename(), "tmp", DB_BTREE, words->Flags(), 0666, WORD_DB_FILES); file_max = nfile_max; size_max = nsize_max; lock = 0; cache.SetMax(size_hint / 2); } ~WordDBCaches() { delete files; } int Full() const { return size_max > 0 ? size >= size_max : 0; } int Add(char* key, int key_size, char* data, int data_size); int AddFile(String& filename); int CacheFlush(); int Merge(); int Merge(const String& filea, const String& fileb, const String& tmpname); int Merge(WordDB& db); int CacheWrite(const String& filename); int CacheCompare(int (*compare)(WordContext *, const WordDBCacheEntry *, const WordDBCacheEntry *)) { cache.SetCompare(compare); return OK; } int WriteEntry(FILE* fp, WordDBCacheEntry& entry, unsigned char*& buffer, unsigned int& buffer_size); int ReadEntry(FILE* fp, WordDBCacheEntry& entry, unsigned char*& buffer, unsigned int& buffer_size); private: WordList* words; WordDB* files; int file_max; int size_max; int size; WordLock* lock; WordDBCache cache; }; #endif /* _WordDBCache_h */ htdig-3.2.0b6/htword/WordDBCompress.cc0100644006314600127310000001060710055635556017054 0ustar angusgbhtdig// // WordDBCompress.h // // WordDBCompress: Implements specific compression scheme for // Berkeley DB pages containing WordReferences objects. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDBCompress.cc,v 1.7 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordDBPage.h" #include "WordDBCompress.h" #include "WordBitCompress.h" /* * WordDBCompress: C-callbacks, actually called by Berkeley-DB * they just call their WordDBCompress equivalents (by using user_data) */ extern "C" { static int WordDBCompress_compress_c(const u_int8_t* inbuff, int inbuff_length, u_int8_t** outbuffp, int* outbuff_lengthp, void *user_data) { if(!user_data) { fprintf(stderr, "WordDBCompress_compress_c:: user_data is NULL"); return NOTOK; } return ((WordDBCompress *)user_data)->Compress((unsigned char*)inbuff, inbuff_length, (unsigned char**)outbuffp, outbuff_lengthp); } static int WordDBCompress_uncompress_c(const u_int8_t* inbuff, int inbuff_length, u_int8_t* outbuff, int outbuff_length, void *user_data) { if(!user_data) { fprintf(stderr, "WordDBCompress_uncompress_c:: user_data is NULL"); return NOTOK; } return ((WordDBCompress *)user_data)->Uncompress((unsigned char *)inbuff, inbuff_length, (unsigned char*)outbuff, outbuff_length); } } // *********************************************** // *********** WordDBCompress ******************* // *********************************************** WordDBCompress::WordDBCompress() { cmprInfo = 0; // // DEBUGING / BENCHMARKING // debug = 0; //zlib WordDB Compression use_zlib = 0; zlib_level = 0; } WordDBCompress::WordDBCompress(int zlib, int level) { cmprInfo = 0; // // DEBUGING / BENCHMARKING // debug = 0; //zlib WordDB Compression use_zlib = zlib; zlib_level = level; } DB_CMPR_INFO* WordDBCompress::CmprInfo() { DB_CMPR_INFO *cmpr_info = new DB_CMPR_INFO; cmpr_info->user_data = (void *)this; cmpr_info->compress = WordDBCompress_compress_c; cmpr_info->uncompress = WordDBCompress_uncompress_c; cmpr_info->coefficient = 3; // reduce page size by factor of 1<<3 = 8 cmpr_info->max_npages = 9; if(use_zlib == 1) cmpr_info->zlib_flags = zlib_level; else cmpr_info->zlib_flags = 0; cmprInfo = cmpr_info; return cmpr_info; } int WordDBCompress::Compress(const u_int8_t *inbuff, int inbuff_length, u_int8_t **outbuffp, int *outbuff_lengthp) { WordDBPage pg(inbuff, inbuff_length); if(debug > 2) { printf("########################### WordDBCompress::Compress: #################################################\n"); pg.show(); printf("~~~~~~~~~~~~~\n"); } if(debug) TestCompress(inbuff, inbuff_length); Compressor *res = pg.Compress(0, cmprInfo); (*outbuffp) = res->get_data(); (*outbuff_lengthp) = res->buffsize(); if(debug > 2) { res->show(); printf("\n%%%%%%%% Final COMPRESSED size:%4d %f\n",res->size(),res->size()/8.0); printf("*************************** #################################################\n"); } delete res; if(debug > 2) printf("WordDBCompress::Compress: final output size:%6d (inputsize:%6d)\n", (*outbuff_lengthp), inbuff_length); pg.unset_page(); return(0); } int WordDBCompress::Uncompress(const u_int8_t *inbuff, int inbuff_length, u_int8_t *outbuff,int outbuff_length) { if(debug > 2) printf("WordDBCompress::Uncompress:: %5d -> %5d\n", inbuff_length, outbuff_length); WordDBPage pg(outbuff_length); if(debug > 2) printf("------------------------ WordDBCompress::Uncompress: --------------------------------\n"); Compressor in(inbuff_length); in.set_data(inbuff,inbuff_length*8); in.rewind(); pg.Uncompress(&in,0); memcpy((void *)outbuff, (void *)pg.pg, outbuff_length); if(debug > 2) printf("------------------------ WordDBCompress::Uncompress: END\n"); // DEBUGING / BENCHMARKING pg.delete_page(); return(0); } int WordDBCompress::TestCompress(const u_int8_t* pagebuff, int pagebuffsize) { WordDBPage pg(pagebuff,pagebuffsize); pg.TestCompress(debug); pg.unset_page(); return 0; } htdig-3.2.0b6/htword/WordDBCompress.h0100644006314600127310000000741410055635556016720 0ustar angusgbhtdig// // WordDBCompress.h // // WordDBCompress: Implements specific compression scheme for // Berkeley DB pages containing WordReferences objects. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDBCompress.h,v 1.6 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordDBCompress_h_ #define _WordDBCompress_h_ // *********************************************** // *************** WordDBCompress***************** // *********************************************** // Starting point for compression. // // // Comrpession HOW IT WORKS: // // ** General outline: // // BerkeleyDB pages are stored in a memory pool. When the memory pool // is full, least recently used pages are swaped to disk. Page // compression occurs at page in/out level. The // WordDBCompress_compress_c functions are C callbacks that are called // by the the page compression code in BerkeleyDB. The C callbacks the // call the WordDBCompress comress/uncompress methods. The // WordDBCompress creates a WordDBPage which does the actual // compress/uncompress job. // // The WordDBPage compression/uncompression methods store/retreive data // from a bitstream. BitStream is a simple bitstream, and Compressor is // a bitstream with added compression capabilities. // // Compression algorithm. // // Most DB pages are full of really redundant data. Mifluz choice of using // one db entry per word makes the DB pages have an even more redundant. // But this choice also makes the pages have a very simple structure. // // Here is a real world example of what a page can look like: // (key structure: word + 4 numerical fields) // // "trois" 1 4482 1 10b // "trois" 1 4482 1 142 // "trois" 1 4484 1 40 // "trois" 1 449f 1 11e // "trois" 1 4545 1 11 // "trois" 1 45d3 1 545 // "trois" 1 45e0 1 7e5 // "trois" 1 45e2 1 830 // "trois" 1 45e8 1 545 // "trois" 1 45fe 1 ec // "trois" 1 4616 1 395 // "trois" 1 461a 1 1eb // "trois" 1 4631 1 49 // "trois" 1 4634 1 48 // .... etc .... // // To compress we chose to only code differences between succesive entries. // // Differences in words are coded by 2 numbers and some letters: // - the position within the word of the first letter that changes // - the size of the new suffix // - the letters in the new suffix // // Only differences in succesive numerical entries are stored. // // A flag is stored for each entry indicating which fields have changed. // // All this gives us a few numerical arrays which are themselves compressed // and sent to the bitstream. // // class WordDBCompress { public: WordDBCompress(); WordDBCompress(int, int); int Compress(const u_int8_t* inbuff, int inbuff_length, u_int8_t** outbuffp, int* outbuff_lengthp); int Uncompress(const u_int8_t* inbuff, int inbuff_length, u_int8_t* outbuff, int outbuff_length); // // Return a new DB_CMPR_INFO initialized with characteristics of the // current object and suitable as WordDB::CmprInfo argument. // DB_CMPR_INFO *CmprInfo(); private: DB_CMPR_INFO *cmprInfo; //ZLIB WordDBCompression Flags int use_zlib; int zlib_level; // DEBUGING / BENCHMARKING int debug; // 0 : no debug no check // 1 : TestCompress before each compression (but no debug within Compress Uncompress) // 2 : use_tags (BitStream) within TestCompress -> Compress Uncompress // 3 : verbose int TestCompress(const u_int8_t* pagebuff, int pagebuffsize); }; #endif htdig-3.2.0b6/htword/WordDBInfo.cc0100644006314600127310000000452610055635556016157 0ustar angusgbhtdig// WordDBInfo.cc // // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include "db.h" #include "WordDBInfo.h" // // WordDBInfo implementation // WordDBInfo* WordDBInfo::instance = 0; // // Like standard function but allows easy breakpoint setting. // static void message(const char *errpfx, char *msg) { fprintf(stderr, "%s: %s\n", errpfx, msg); } WordDBInfo::WordDBInfo(const Configuration& config) { dbenv = 0; if(config.Boolean("wordlist_env_skip")) return; int error; if((error = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "WordDBInfo: CDB_db_env_create %s\n", CDB_db_strerror(error)); return; } dbenv->set_errpfx(dbenv, "WordDB"); dbenv->set_errcall(dbenv, message); if(dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1) != 0) return; if(dbenv->set_verbose(dbenv, DB_VERB_DEADLOCK, 1) != 0) return; if(dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, 1) != 0) return; if(dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, 1) != 0) return; int cache_size = config.Value("wordlist_cache_size", 10*1024*1024); if(cache_size > 0) { if(dbenv->set_cachesize(dbenv, 0, cache_size, 1) != 0) return; } char* dir = 0; int flags = DB_CREATE; if(config.Boolean("wordlist_env_share")) { const String& env_dir = config["wordlist_env_dir"]; if(env_dir.empty()) { fprintf(stderr, "WordDB: wordlist_env_dir not specified\n"); return; } dir = strdup((const char*)env_dir); if(config.Boolean("wordlist_env_cdb")) flags |= DB_INIT_CDB; else flags |= DB_INIT_LOCK | DB_INIT_MPOOL; } else { flags |= DB_PRIVATE | DB_INIT_LOCK | DB_INIT_MPOOL; } if((error = dbenv->open(dbenv, (const char*)dir, NULL, flags, 0666)) != 0) dbenv->err(dbenv, error, "open %s", (dir ? dir : "")); if(dir) free(dir); } WordDBInfo::~WordDBInfo() { if(dbenv) dbenv->close(dbenv, 0); } void WordDBInfo::Initialize(const Configuration &config_arg) { if(instance != 0) delete instance; instance = new WordDBInfo(config_arg); } htdig-3.2.0b6/htword/WordDBInfo.h0100644006314600127310000000416010055635556016013 0ustar angusgbhtdig// // WordDBInfo.h // // NAME // inverted index usage environment. // // SYNOPSIS // // Only called thru WordContext::Initialize() // // DESCRIPTION // // The inverted indexes may be shared among processes/threads and provide the // appropriate locking to prevent mistakes. In addition the memory cache // used by WordList objects may be shared by processes/threads, // greatly reducing the memory needs in multi-process applications. // For more information about the shared environment, check the Berkeley // DB documentation. // // CONFIGURATION // // wordlist_env_skip {true,false} (default false) // If true no environment is created at all. This must never // be used if a WordList object is created. It may be // useful if only WordKey objects are used, for instance. // // wordlist_env_share {true,false} (default false) // If true a sharable environment is open or created if none exist. // // wordlist_env_dir (default .) // Only valid if wordlist_env_share set to true. // Specify the directory in which the sharable environment will // be created. All // inverted indexes specified with a non-absolute pathname will be // created relative to this directory. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // #ifndef _WordDBInfo_h_ #define _WordDBInfo_h_ #include "Configuration.h" struct __db_env; class WordDBInfo { public: WordDBInfo(const Configuration& config); ~WordDBInfo(); // // Unique instance handlers // static void Initialize(const Configuration& config); static WordDBInfo* Instance() { if(instance) return instance; fprintf(stderr, "WordDBInfo::Instance: no instance\n"); return 0; } // // Berkeley DB environment // struct __db_env *dbenv; // // Unique instance pointer // static WordDBInfo* instance; }; #endif htdig-3.2.0b6/htword/WordDBPage.cc0100644006314600127310000007567510055635556016155 0ustar angusgbhtdig// // WordDBPage.cc // // WordDBPage: Implements specific compression scheme for // Berkeley DB pages containing WordReferences objects. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDBPage.cc,v 1.5 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include"WordDBPage.h" #include"WordDBCompress.h" #include #define NBITS_CMPRTYPE 2 #define CMPRTYPE_NORMALCOMRPESS 0 #define CMPRTYPE_BADCOMPRESS 1 // *********************************************** // ********** Compression Versions ************** // *********************************************** // never change NBITS_COMPRESS_VERSION ! (otherwise version tracking will fail) #define NBITS_COMPRESS_VERSION 11 // IMPORTANT: change these EVERY time you change something that affects the compression #define COMPRESS_VERSION 4 static const char *version_label[]={"INVALID_VERSION_0","INVALID_VERSION_1","INVALID_VERSION_2","14 Dec 1999","3 Jan 2000",NULL}; // returns the label of compression version v static const char * get_version_label(int v) { // check if version number is ok if(COMPRESS_VERSION <0 || COMPRESS_VERSION>((sizeof(version_label)/sizeof(*version_label))-1)) { errr("get_version_label: version_label[COMPRESS_VERSION] is not valid, please update version_label"); } if( v >= (int)((sizeof(version_label)/sizeof(*version_label))-1) ) { return("INVALID_VERSION"); } // return label return(version_label[v]); } // *********************************************** // ********** WordDBPage *********************** // *********************************************** // checks if compression/decompression sequence is harmless int WordDBPage::TestCompress(int debuglevel) { if(debuglevel>2){printf("ttttttttttttt WordDBPage::TestCompress BEGIN\n");} int compress_debug=debuglevel-1; // start by compressing this page Compressor *res=Compress(compress_debug); if(res) { int size=res->size(); // now uncompress into pageu WordDBPage pageu(pgsz); res->rewind(); pageu.Uncompress(res,compress_debug); // comapre this page and pageu int cmp=Compare(pageu); // show some results if(debuglevel>2)printf("TOTAL SIZE: %6d %8f\n",size,size/8.0); // argh! compare failed somthing went wrong // display the compress/decompress sequence and fail if(cmp || size>8*1024*1000000000) { if(size>8*1024) { printf("---------------------------------------------------\n"); printf("-----------overflow:%5d------------------------------\n",size/8); printf("---------------------------------------------------\n"); printf("---------------------------------------------------\n"); } printf("################### ORIGINAL #########################################\n"); show(); printf("################### REDECOMPRESSED #########################################\n"); pageu.show(); // re-compress the page verbosely Compressor *res2=Compress(2); res2->rewind(); // re-uncompress the page verbosely WordDBPage pageu2(pgsz); pageu2.Uncompress(res2,2); pageu2.show(); if(cmp){errr("Compare failed");} delete res2; } pageu.delete_page(); delete res; }else {errr("WordDBPage::TestCompress: Compress failed");} if(debuglevel>2){printf("ttttttttttttt WordDBPage::TestCompress END\n");} return OK; } // find position of first difference between 2 strings static int first_diff(const String &s1,const String &s2) { int j; for(j=0;j1){verbose=1;} if(verbose){printf("uuuuuuuuu WordDBPage::Uncompress: BEGIN\n");} // ** first check if versions are OK int read_version = pin->get_uint(NBITS_COMPRESS_VERSION,"COMPRESS_VERSION"); if(read_version != COMPRESS_VERSION) { fprintf(stderr,"WordDBPage::Uncompress: *** Compression version mismatch ***\n"); fprintf(stderr,"found version : %3d but using version : %3d\n",read_version,COMPRESS_VERSION); fprintf(stderr,"found version label: %s\n",get_version_label(read_version)); fprintf(stderr,"using version label: %s\n",get_version_label(COMPRESS_VERSION)); fprintf(stderr,"Are you sure you're not reading an old DB with a newer version of the indexer??\n"); errr("WordDBPage::Uncompress: *** Compression version mismatch ***"); exit(1); } // ** now see if this page was a normal or uncorrectly compressed page int cmprtype=pin->get_uint(NBITS_CMPRTYPE,"CMPRTYPE"); // two possible cases switch(cmprtype) { case CMPRTYPE_NORMALCOMRPESS:// this was a normaly compressed page Uncompress_main(pin); break; case CMPRTYPE_BADCOMPRESS:// this page did not compress correctly pin->get_zone((byte *)pg,pgsz*8,"INITIALBUFFER"); break; default: errr("WordDBPage::Uncompress: CMPRTYPE incoherent"); } if(verbose){printf("uuuuuuuuu WordDBPage::Uncompress: END\n");} return OK; } // ******* Uncompress Compressor into this page // normally compressed page case int WordDBPage::Uncompress_main(Compressor *pin) { if(!pin){errr("WordDBPage::Uncompress: no Compressor to uncompress from!!");} Compressor &in=*((Compressor *)pin); if(debug>0){in.set_use_tags();} int i,j; // number arrays used to reconstruct the original page unsigned int **rnums=new unsigned int *[nnums]; CHECK_MEM(rnums); // sizes of each array int *rnum_sizes=new int[nnums]; CHECK_MEM(rnum_sizes); // char differences between words byte *rworddiffs=NULL; int nrworddiffs; // *********** read header if(Uncompress_header(in)!=OK){return NOTOK;} // get first key(s): //type=5: key(0) stored seperately ... others are decompressed frome differences // //type=3: btikey(0) is particular (len=0) it is stored seperately // btikey(1) stored seperately ... others are decompressed frome differences // int nkeysleft=nk; if(nkeysleft>0) { WordDBKey key0=uncompress_key(in,0); if(type==P_LBTREE){uncompress_data(in,0,key0.RecType());} nkeysleft--; } if(nkeysleft>0 && type==P_IBTREE){uncompress_key(in,1);nkeysleft--;} if(nkeysleft>0) { // ********* read numerical fields Uncompress_vals_chaged_flags(in,&(rnums[0]),&(rnum_sizes[0])); for(j=1;jlsn.file =in.get_uint_vl( 8*sizeof(pg->lsn.file ),"page:lsn.file"); pg->lsn.offset =in.get_uint_vl( 8*sizeof(pg->lsn.offset ),"page:lsn.offset"); pg->pgno =in.get_uint_vl( 8*sizeof(pg->pgno ),"page:pgno"); pg->prev_pgno =in.get_uint_vl( 8*sizeof(pg->prev_pgno ),"page:prev_pgno"); pg->next_pgno =in.get_uint_vl( 8*sizeof(pg->next_pgno ),"page:next_pgno"); pg->entries =in.get_uint_vl( 8*sizeof(pg->entries ),"page:entries"); pg->hf_offset =in.get_uint_vl( 8*sizeof(pg->hf_offset ),"page:hf_offset"); pg->level =in.get_uint_vl( 8*sizeof(pg->level ),"page:level"); pg->type =in.get_uint_vl( 8*sizeof(pg->type ),"page:type"); init(); if(verbose) { printf("************************************\n"); printf("******** WordDBPage::Uncompress: page header ***\n"); printf("************************************\n"); printf("page size:%d\n",(int)pgsz); printf(" 00-07: Log sequence number. file : %d\n", pg->lsn.file ); printf(" 00-07: Log sequence number. offset: %d\n", pg->lsn.offset ); printf(" 08-11: Current page number. : %d\n", pg->pgno ); printf(" 12-15: Previous page number. : %d\n", pg->prev_pgno ); printf(" 16-19: Next page number. : %d\n", pg->next_pgno ); printf(" 20-21: Number of item pairs on the page. : %d\n", pg->entries ); printf(" 22-23: High free byte page offset. : %d\n", pg->hf_offset ); printf(" 24: Btree tree level. : %d\n", pg->level ); printf(" 25: Page type. : %d\n", pg->type ); } return OK; } void WordDBPage::Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte *rworddiffs,int nrworddiffs) { int irwordiffs=0; int nfields=WordKey::NFields(); int *rnum_pos=new int[ nnums0];// current index count CHECK_MEM(rnum_pos); int ii,j; for(j=0;ji0) { unsigned int flags=rnums[CNFLAGS][rnum_pos[CNFLAGS]++]; int foundfchange=0; // **** reconstruct the word if(flags&pow2(nfields-1))// check flags to see if word has changed { foundfchange=1; if(rnum_pos[CNWORDDIFFLEN]>=rnum_sizes[CNWORDDIFFLEN]){errr("WordDBPage::Uncompress read wrong num worddiffs");} // get position of first character that changes in this word int diffpos=rnums[CNWORDDIFFPOS][rnum_pos[CNWORDDIFFPOS]++]; // get size of changed part of the word int difflen=rnums[CNWORDDIFFLEN][rnum_pos[CNWORDDIFFLEN]++]; int wordlen=diffpos+difflen; char *str=new char [wordlen+1]; CHECK_MEM(str); // copy the unchanged part into str from previos key's word if(diffpos)strncpy(str,(char *)pkey.GetWord(),diffpos); // copy the changed part from coded word differences strncpy(str+diffpos,(char *)rworddiffs+irwordiffs,difflen); str[wordlen]=0; if(verbose)printf("key %3d word:\"%s\"\n",ii,str); akey.SetWord(str); irwordiffs+=difflen; delete [] str; }else{akey.SetWord(pkey.GetWord());} // **** reconstruct the numerical key fields for(j=1;j=rnum_sizes[k]){errr("WordDBPage::Uncompress read wrong num of changes in a field");} if(!foundfchange) { // this is the first field that changes in this key // so difference is coded compared to value in pevious key akey.Set(j,rnums[k][indx]+pkey.Get(j)); } else { // this is NOT the first field that changes in this key // so difference is coded from 0 akey.Set(j,rnums[k][indx]); } // we read 1 element from coded differences in this field rnum_pos[k]++; foundfchange=1; } else { // no changes found, just copy from previous key if(!foundfchange){akey.Set(j,pkey.Get(j));} else{akey.Set(j,0);} } } } // now insert key/data into page if(type==P_LBTREE) { if(ii>i0)insert_key(akey); if(ii>i0)insert_data(arec); } else { if(type!=3){errr("WordDBPage::Uncompress_rebuild: unsupported type!=3");} if(ii>i0)insert_btikey(akey,bti); } pkey=akey; } delete [] rnum_pos; } // display void WordDBPage::Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums0,byte *rworddiffs,int nrworddiffs) { int i,j; if(verbose) { printf("WordDBPage::Uncompress_show_rebuild: rebuilt numerical fields\n"); for(j=0;j1){verbose=1;} Compressor *res=(Compressor *)new Compressor((cmprInfo ? pgsz/(1<<(cmprInfo->coefficient)) : pgsz/4)); CHECK_MEM(res); if(debug>0){res->set_use_tags();} res->put_uint(COMPRESS_VERSION,NBITS_COMPRESS_VERSION,"COMPRESS_VERSION"); res->put_uint(CMPRTYPE_NORMALCOMRPESS,NBITS_CMPRTYPE,"CMPRTYPE"); if(verbose){printf("WordDBPage::Compress: trying normal compress\n");} int cmpr_ok=Compress_main(*((Compressor *)res)); if(cmpr_ok!=OK || res->buffsize()>pgsz) { if(verbose){printf("WordDBCompress::Compress full compress failed ... not compressing at all\n");} show(); if(res){delete res;} res=new Compressor; CHECK_MEM(res); if(debug>0){res->set_use_tags();} res->put_uint(COMPRESS_VERSION,NBITS_COMPRESS_VERSION,"COMPRESS_VERSION"); res->put_uint(CMPRTYPE_BADCOMPRESS,NBITS_CMPRTYPE,"CMPRTYPE"); res->put_zone((byte *)pg,pgsz*8,"INITIALBUFFER"); } if(verbose) { printf("WordDBPage::Compress: Final bitstream result\n"); res->show(); } return res; }; int WordDBPage::Compress_main(Compressor &out) { if(debug>1){verbose=1;} if(verbose){printf("WordDBPage::Compress_main: starting compression\n");} if(pg->type!=5 && pg->type!=3){ printf("pg->type:%3d\n",pg->type);return NOTOK;} // if(pg->type==P_IBTREE){show();} // *************** initialize data structures ************** int j; // 0 -> changed/unchanged flags : 4bits // 1..n -> numerical fields delta : ?bits (depending on field) // n+1 -> word changed size : 1 int *nums =new int[nk*nnums]; CHECK_MEM(nums); int *nums_pos=new int[ nnums]; CHECK_MEM(nums_pos); // int *cnsizes =new int[ nnums]; for(j=0;jsort[j].bits;} // cnsizes[CNFLAGS]=4; // cnsizes[CNWORDDIFFPOS ]=8; // cnsizes[CNWORDDIFFLEN ]=8; HtVector_byte worddiffs; //bmt_START; // *************** extract values and wordiffs ************** if(nk>0) { Compress_extract_vals_wordiffs(nums,nums_pos,nnums,worddiffs); if(verbose)Compress_show_extracted(nums,nums_pos,nnums,worddiffs); } // *************** init compression ************** //bmt_END;bmt_START; Compress_header(out); // *************** compress values and wordiffs ************** // compress first key(s) int nkeysleft=nk; if(nkeysleft>0) { compress_key(out,0); if(type==P_LBTREE){compress_data(out,0);} nkeysleft--; } if(nkeysleft>0 && type==P_IBTREE){compress_key(out,1);nkeysleft--;} if(nkeysleft>0) { //bmt_END;bmt_START; // compress values Compress_vals(out,nums,nums_pos,nnums); //bmt_END;bmt_START; // compress worddiffs int size=out.put_fixedbitl(worddiffs.begin(),worddiffs.size(),"WordDiffs"); if(verbose)printf("compressed wordiffs : %3d values: %4d bits %4f bytes\n",worddiffs.size(),size,size/8.0); //bmt_END; } // *************** cleanup ************** delete [] nums ; delete [] nums_pos; return OK; } void WordDBPage::Compress_extract_vals_wordiffs(int *nums,int *nums_pos,int ,HtVector_byte &worddiffs) { WordDBKey pkey; int ii,j; int i0=0; if(type==P_IBTREE){i0=1;}// internal pages have particular first key for(ii=i0;iipgno ; nums[CNBTINRECS*nk+nums_pos[CNBTINRECS]++]=btikey(ii)->nrecs; } // all that follows codes differences between succesive entries // that is: Numerical key fields, Words if(ii>i0) { // clear changed falgs int iflag=CNFLAGS*nk+nums_pos[CNFLAGS]++; nums[iflag]=0; int foundfchange=0; const String &aword=akey.GetWord(); const String &pword=pkey.GetWord(); if(!(aword==pword)){foundfchange=1;} // check numerical fields for changes // ******** sets CNFIELDS and some of CNFLAGS ************ for(j=1;j0) { out.put(1,"rep"); out.put_uint_vl(k,nbits,NULL); i+=k; } else {out.put(0,"rep");} } size=out.size()-size; if(verbose)printf("compressed flags %2d : %3d values: %4d bits %8f bytes : ended bit field pos:%6d\n",0,n,size,size/8.0,out.size()); } void WordDBPage::Compress_vals(Compressor &out,int *nums,int *nums_pos,int nnums0) { // the changed flags fields are particular Compress_vals_changed_flags(out,(unsigned int *)(nums+0*nk),nums_pos[0]); // compress the difference numbers for the numerical fields for( int j=1;jlsn.file , 8*sizeof(pg->lsn.file ),"page:lsn.file"); out.put_uint_vl(pg->lsn.offset , 8*sizeof(pg->lsn.offset ),"page:lsn.offset"); out.put_uint_vl(pg->pgno , 8*sizeof(pg->pgno ),"page:pgno"); out.put_uint_vl(pg->prev_pgno , 8*sizeof(pg->prev_pgno ),"page:prev_pgno"); out.put_uint_vl(pg->next_pgno , 8*sizeof(pg->next_pgno ),"page:next_pgno"); out.put_uint_vl(pg->entries , 8*sizeof(pg->entries ),"page:entries"); out.put_uint_vl(pg->hf_offset , 8*sizeof(pg->hf_offset ),"page:hf_offset"); out.put_uint_vl(pg->level , 8*sizeof(pg->level ),"page:level"); out.put_uint_vl(pg->type , 8*sizeof(pg->type ),"page:type"); } void WordDBPage::Compress_show_extracted(int *nums,int *nums_pos,int nnums0,HtVector_byte &worddiffs) { int i,j; int *cnindexe2=new int[ nnums0]; CHECK_MEM(cnindexe2); for(j=0;jworddiffs.size() ? nk : worddiffs.size()); for(i=0;ilsn.file != pg->lsn.file ){res++;printf("compare failed for pg->lsn.file \n");} if(other.pg->lsn.offset != pg->lsn.offset ){res++;printf("compare failed for pg->lsn.offset \n");} if(other.pg->pgno != pg->pgno ){res++;printf("compare failed for pg->pgno \n");} if(other.pg->prev_pgno != pg->prev_pgno ){res++;printf("compare failed for pg->prev_pgno \n");} if(other.pg->next_pgno != pg->next_pgno ){res++;printf("compare failed for pg->next_pgno \n");} if(other.pg->entries != pg->entries ){res++;printf("compare failed for pg->entries \n");} if(other.pg->hf_offset != pg->hf_offset ){res++;printf("compare failed for pg->hf_offset \n");} if(other.pg->level != pg->level ){res++;printf("compare failed for pg->level \n");} if(other.pg->type != pg->type ){res++;printf("compare failed for pg->type \n");} int i,k; // double check header if(memcmp((void *)pg,(void *)other.pg,sizeof(PAGE)-sizeof(db_indx_t))) { res++; printf("compare failed in some unknown place in header:\n"); for(i=0;i<(int)(sizeof(PAGE)-sizeof(db_indx_t));i++) { printf("%3d: %3x %3x\n",i,((byte *)pg)[i],((byte *)other.pg)[i]); } } // pg->type != 5 && !=3 pages are not really compressed: just memcmp if(pg->type != 5 && pg->type != 3) { if(memcmp((void *)pg,(void *)other.pg,pgsz)) { printf("compare:PAGETYPE:!=5 and memcmp failed\n"); res++; printf("compare failed\n"); } return(res); } // compare each key/data pair for(i=0;i<(type==P_LBTREE ? pg->entries/2 : pg->entries);i++) { if(pg->type==P_LBTREE) { // compare keys if(key(i)->len !=other.key(i)->len ) { printf("compare:key(%2d) len : %2d != %2d\n",i,key(i)->len ,other.key(i)->len ); res++; } if(key(i)->type!=other.key(i)->type) { printf("compare:key(%2d) type: %2d != %2d\n",i,key(i)->type,other.key(i)->type); res++; } if(memcmp(key(i)->data,other.key(i)->data,key(i)->len)) { printf("compare :key(%2d)\n",i); for(k=0;klen;k++) { int c=key(i)->data[k]; if(isalnum(c)){printf(" %c ",c);} else{printf("%02x ",c);} } printf("\n"); for(k=0;klen;k++) { int c=other.key(i)->data[k]; if(isalnum(c)){printf(" %c ",c);} else{printf("%02x ",c);} } printf("\n"); res++;printf("compare:key failed\n"); } // compare data if(data(i)->len !=other.data(i)->len ) { printf("compare:data(%2d) len : %2d != %2d\n",i,data(i)->len ,other.data(i)->len ); res++; } if(data(i)->type!=other.data(i)->type) { printf("compare:data(%2d) type: %2d != %2d\n",i,data(i)->type,other.key(i)->type); res++; } if(memcmp(data(i)->data,other.data(i)->data,data(i)->len)) { printf("compare :data(%2d)\n",i); for(k=0;klen;k++) { printf("%02x ",data(i)->data[k]); } printf("\n"); for(k=0;klen;k++) { printf("%02x ",other.data(i)->data[k]); } printf("\n"); res++;printf("compare:data failed\n"); } } else { if(type!=3){errr("WordDBPage::Compare: unsupported type!=3");} if(btikey(i)->len != other.btikey(i)->len || btikey(i)->type != other.btikey(i)->type || btikey(i)->pgno != other.btikey(i)->pgno || btikey(i)->nrecs != other.btikey(i)->nrecs ) { printf("compare:btikey(%2d) failed\n",i); printf("this :len :%4d type :%4d pgno :%4d nrecs :%4d \n",btikey(i)->len,btikey(i)->type, btikey(i)->pgno,btikey(i)->nrecs); printf("other:len :%4d type :%4d pgno :%4d nrecs :%4d \n",other.btikey(i)->len,other.btikey(i)->type, other.btikey(i)->pgno,other.btikey(i)->nrecs); res++; } if(memcmp(btikey(i)->data,other.btikey(i)->data,btikey(i)->len)) { printf("compare :btikey(%2d)\n",i); for(k=0;klen;k++) { printf("%02x ",btikey(i)->data[k]); } printf("\n"); for(k=0;klen;k++) { printf("%02x ",other.btikey(i)->data[k]); } printf("\n"); res++;printf("compare:btikey failed\n"); } } } if(pg->entries>0) { int smallestoffset=HtMaxMin::min_v(pg->inp,pg->entries); int other_smallestoffset=HtMaxMin::min_v(other.pg->inp,other.pg->entries); if(smallestoffset!=other_smallestoffset) { printf("compare fail:smallestoffset:%d other_smallestoffset:%d\n",smallestoffset,other_smallestoffset); res++; } } return(res); } // Bit stream description // | field[last] changed only | yes -> delta field[last] // // redo=0 -> // redo=1 -> oops, dont show! // redo=2 -> void WordDBPage::show() { int i,j,dd,l; printf("************************************\n"); printf("************************************\n"); printf("************************************\n"); printf("page size:%d\n",(int)pgsz); printf(" 00-07: Log sequence number. file : %d\n", pg->lsn.file ); printf(" 00-07: Log sequence number. offset: %d\n", pg->lsn.offset ); printf(" 08-11: Current page number. : %d\n", pg->pgno ); printf(" 12-15: Previous page number. : %d\n", pg->prev_pgno ); printf(" 16-19: Next page number. : %d\n", pg->next_pgno ); printf(" 20-21: Number of item pairs on the page. : %d\n", pg->entries ); printf(" 22-23: High free byte page offset. : %d\n", pg->hf_offset ); printf(" 24: Btree tree level. : %d\n", pg->level ); printf(" 25: Page type. : %d\n", pg->type ); printf("entry offsets:"); for(i=0;ientries;i++){printf("%4d ",pg->inp[i]);} printf("\n"); if(pg->type ==5) { WordRecord dud; WordKey prev; int pagecl=0; for(i=0;ientries;i++) { if( (i%2) && dud.type==WORD_RECORD_NONE){continue;} printf("\n||%c:%3d:off:%03d:invoff:%4d:len:%2d:typ:%x:",i%2 ? 'D' : 'K',i,e_offset(i),pgsz-e_offset(i),entry(i)->len,entry(i)->type); if(i>0) { l=entry(i)->len+3; dd=(int)(e_offset(i-1))-l; dd-=dd%4; printf("% 5d:: ",(e_offset(i)-dd)); } if(!(i%2)) { WordDBKey tkey(entry(i)); int fieldchanged[10]; char *wordchange=NULL; printf("\""); printf("%s",(char *)tkey.GetWord()); printf("\""); for(j=0;j<20-tkey.GetWord().length();j++){printf(" ");} printf("|"); for(j=1;jsort[j].bits;} } if(fieldchanged[0]){keycl+=3;keycl+=8*strlen(wordchange);} printf(" ::%2d %f",keycl,keycl/8.0); pagecl+=keycl; prev=tkey; } else { if(entry(i)->len>100){printf("WordDBPage::show: aaargh strange failing\n");return;} for(j=0;jlen;j++) { printf("%02x ",entry(i)->data[j]); } } } printf("\n"); } else if(1) { int nn=0; // dump hex for(i=0;;i++) { printf("%5d: ",nn); for(j=0;j<20;j++) { printf("%2x ",((byte *)pg)[nn++]); if(nn>=pgsz){break;} } printf("\n"); if(nn>=pgsz){break;} } } if(pg->type == 3) { for(i=0;ientries;i++) { BINTERNAL *bie=GET_BINTERNAL(pg,i); printf("%3d: off:%4d:len:%3d :type:%3d :pgno:%4d: nrecs:%4d:: ",i,pg->inp[i],bie->len,bie->type,bie->pgno,bie->nrecs); WordDBKey tkey(bie); for(j=0;jlen-tkey.GetWord().length();j++){printf("%2x ",bie->data[j]);} printf(" : "); for(j=1;j // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDBPage.h,v 1.8 2004/05/28 13:15:26 lha Exp $ // // // Access to Berkeley DB internal // #ifndef _WordDBPage_h_ #define _WordDBPage_h_ extern "C" { #include "db_int.h" #include "shqueue.h" #include "db_shash.h" #include "mp.h" #include "db_page.h" #include "common_ext.h" } #include "WordDBCompress.h" #include "WordBitCompress.h" #include "WordRecord.h" #include "WordKey.h" #define WORD_ALIGN_TO(v,a) ( (v)%(a) ? (v+((a)-(v)%(a))) : v) #define NBITS_KEYLEN 16 #define NBITS_DATALEN 16 // *********************************************** // *************** WordDBRecord ***************** // *********************************************** // WordRecord with added functionalities to help with compression/decompression class WordDBRecord : public WordRecord { public: // retreive WordRecord data/stats from coded numbers void set_decompress(unsigned int **data,int *indexes,int i,int pdata,int pstat0,int pstat1) { if(i>=indexes[pstat0]) {// were pas the end of coded stats, so this can't be a stat type=DefaultType(); if(type==WORD_RECORD_DATA){info.data=data[pdata][i-indexes[pstat0]];} else{info.data=0;} } else {// this is a stat type=WORD_RECORD_STATS; info.stats.noccurrence=data[pstat0][i]; info.stats.ndoc =data[pstat1][i]; } } WordDBRecord():WordRecord(){;} WordDBRecord(byte *dat,int len,int rectyp):WordRecord() { type=(rectyp ? DefaultType() : WORD_RECORD_STATS); Unpack(String((char *)dat,len)); } WordDBRecord(BKEYDATA *ndata,int rectyp):WordRecord() {// typ: 0->stat 1->data type=(rectyp ? DefaultType() : WORD_RECORD_STATS); Unpack(String((char *)ndata->data,ndata->len)); } }; // *********************************************** // **************** WordDBKey ***************** // *********************************************** // WordKey with added functionalities to help with compression/decompression class WordDBKey : public WordKey { BKEYDATA *key; public: int RecType(){return (GetWord()[0]!=1 ? 1 :0);} WordDBKey():WordKey() { key=NULL; } WordDBKey(BKEYDATA *nkey):WordKey() { key=nkey; Unpack(String((char *)key->data,key->len)); } int is_null() { errr("UNUSED"); if(GetWord().length()==0) { for(int j=1;jlen==0) { ;// errr("WordDBKey::WordDBKey(BINTERNAL) : nkey->len==0"); } else{Unpack(String((char *)nkey->data,nkey->len));} } WordDBKey(byte *data,int len):WordKey() { key=NULL; if(!data || !len){errr("WordDBKey::WordDBKey(data,len) !data || !len");} Unpack(String((char *)data,len)); } }; // *********************************************** // **************** WordDBPage ***************** // *********************************************** // encapsulation of Berkeley DB BTREE page. // this one knows how to compress/decompress itself class WordDBPage { public: int n; // number of entries int nk; // number of keys int type; // for now 3(btreeinternal) && 5(leave:normal case) are allowed int pgsz; PAGE *pg; // pointer to BerkeleyDB BTREE page structure // assert this page is a leave void isleave() { if(type!=P_LBTREE){errr("WordDBPage::isleave: trying leave specific on non leave");} } // assert this page is an internal (non-leave) page void isintern() { if(type!=P_IBTREE){errr("WordDBPage::isintern: trying btreeinternal specific on non btreeinternal page type");} } // get the i'th key stored in this page WordDBKey get_WordDBKey(int i) { if(type==P_LBTREE){return(WordDBKey(key(i)));} else if(type==P_IBTREE){return(WordDBKey(btikey(i)));} else {errr("WordDBPage:get_WordDBKey: bad page type");} return WordDBKey(); } // ******************* Accessors to packed entries **************** // get the i'th key stored in this (internal==nonleave) page. (ptr to packed) BINTERNAL *btikey(int i) { if(i<0 || i>=pg->entries){printf("btikey:%d\n",i);errr("WordDBPage::btikey out iof bounds");} isintern();return(GET_BINTERNAL(pg,i )); } // get the i'th entry stored in this (nonleave) page. (ptr to packed) // an entry can either be a key or a data entry BKEYDATA *entry (int i) { if(i<0 || i>=pg->entries){printf("entry:%d\n",i);errr("WordDBPage::entry out iof bounds");} isleave(); return(GET_BKEYDATA (pg,i )); } // get the i'th key stored in this (leave) page. (ptr to packed) BKEYDATA *key (int i) { if(i<0 || 2*i>=pg->entries){printf("key:%d\n",i);errr("WordDBPage::key out iof bounds");} isleave(); return(GET_BKEYDATA (pg,i*2 )); } // get the i'th data stored in this (leave) page. (ptr to packed) BKEYDATA *data (int i) { if(i<0 || 2*i+1>=pg->entries){printf("data:%d\n",i);errr("WordDBPage::data out iof bounds");} isleave(); return(GET_BKEYDATA (pg,i*2+1)); } // ********************* Inserting entries into a page *************** int insert_pos; // offset in page of last inserted entry int insert_indx; // index of next entry to be inserted int e_offset(int i) {return((int)(pg->inp[i]));} // allocate space (in the db page) for adding an entry to this page void *alloc_entry(int size) { size=WORD_ALIGN_TO(size,4); int inp_pos=((byte *)&(pg->inp[insert_indx]))-(byte *)pg; insert_pos-=size; if(insert_pos<=inp_pos) { show(); printf("alloc_entry: allocating size:%4d entrynum:insert_indx:%4d at:insert_pos:%4d\n",size,insert_indx,insert_pos); errr("WordDBPage::alloc_entry: PAGE OVERFLOW"); } pg->inp[insert_indx++]=insert_pos; return((void *)((byte *)pg+insert_pos)); } // add a data entry to this page void insert_data(WordDBRecord &wrec) { isleave(); if(!(insert_indx%2)){errr("WordDBPage::insert_data data must be an odd number!");} String prec; wrec.Pack(prec); int len=prec.length(); int size=len+(sizeof(BKEYDATA)-1); BKEYDATA *dat=(BKEYDATA *)alloc_entry(size); dat->len=len; dat->type=1;//!!!!!!!!!!!!! memcpy((void *)dat->data,(void *)(char *)prec,len); } // add a key entry to this page void insert_key(WordDBKey &ky) { isleave(); if(insert_indx%2){errr("WordDBPage::insert_key key must be an even number!");} String pkey; ky.Pack(pkey); int keylen=pkey.length(); int size=keylen+(sizeof(BKEYDATA)-1); BKEYDATA *bky=(BKEYDATA *)alloc_entry(size); bky->len=keylen; bky->type=1;// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! memcpy((void *)bky->data,(void *)(char *)pkey,keylen); } // add a key entry to this internal page void insert_btikey(WordDBKey &ky,BINTERNAL &bti,int empty=0) { isintern(); int keylen=0; String pkey; if(!empty) { ky.Pack(pkey); keylen=pkey.length(); } int size=keylen+((byte *)&(bti.data))-((byte *)&bti);// pos of data field in BINTERNAL if(empty) { if(verbose){printf("WordDBPage::insert_btikey: empty : BINTERNAL:%d datapos:%d keylen:%d size:%d alligned to:%d\n",(int)sizeof(BINTERNAL), (int)(((byte *)&(bti.data))-((byte *)&bti)), keylen,size,WORD_ALIGN_TO(size,4));} } BINTERNAL *btik=(BINTERNAL *)alloc_entry(size); btik->len =(empty ? 0 : keylen); btik->type=1;// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! btik->pgno =bti.pgno; btik->nrecs=bti.nrecs; if(!empty){memcpy((void *)btik->data,(void *)(char *)pkey,keylen);} // else // {btik->data[0]=0;}// just to avoid uninit memory read } int entry_struct_size() { return(type==P_IBTREE ? sizeof(BINTERNAL) : sizeof(BKEYDATA ) )-1; } int entry_size(int i) { return entry_struct_size() + (type==P_IBTREE ? btikey(i)->len : key(i)->len ); } // ************** Comrpession/Uncompression *************************** // The compression functions void Compress_extract_vals_wordiffs(int *nums,int *nums_pos,int nnums,HtVector_byte &wordiffs); void Compress_show_extracted(int *nums,int *nums_pos,int nnums,HtVector_byte &wordiffs); void Compress_vals(Compressor &out,int *nums,int *nums_pos,int nnums); void Compress_vals_changed_flags(Compressor &out,unsigned int *cflags,int n); void Compress_header(Compressor &out); int Compress_main(Compressor &out); Compressor *Compress(int debug=0, DB_CMPR_INFO *cmprInfo=NULL); // The uncompression functions int Uncompress(Compressor *pin,int debug=0, DB_CMPR_INFO *cmprInfo=NULL); int Uncompress_main(Compressor *pin); void Uncompress_vals_chaged_flags(Compressor &in,unsigned int **pcflags,int *pn); int Uncompress_header(Compressor &in); void Uncompress_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte *rworddiffs,int nrworddiffs); void Uncompress_show_rebuild(unsigned int **rnums,int *rnum_sizes,int nnums,byte *rworddiffs,int nrworddiffs); int TestCompress(int debuglevel); int Compare(WordDBPage &other); // the following functions are use to compress/uncompress // keys/data directly // This is necesary for the first key/data elements of the page void compress_key(Compressor &out,int i) { if(type==P_IBTREE) { int len=btikey(i)->len; out.put_uint(len,NBITS_KEYLEN,label_str("seperatekey_len",i)); if(verbose){printf("WordDBPage::compress_key:compress(typ3):%d ::: sizeof(BINTERNAL):%d\n",len,(int)sizeof(BINTERNAL));} out.put_uint(btikey(i)->len ,sizeof(btikey(i)->len )*8,label_str("seperatekey_bti_len" ,i)); out.put_uint(btikey(i)->type ,sizeof(btikey(i)->type )*8,label_str("seperatekey_bti_type" ,i)); out.put_uint(btikey(i)->pgno ,sizeof(btikey(i)->pgno )*8,label_str("seperatekey_bti_pgno" ,i)); out.put_uint(btikey(i)->nrecs,sizeof(btikey(i)->nrecs)*8,label_str("seperatekey_bti_nrecs",i)); if(len){out.put_zone((byte *)btikey(i)->data,8*len,label_str("seperatekey_btidata",i));} } else { int len=key(i)->len; out.put_uint(len,NBITS_KEYLEN,label_str("seperatekey_len",i)); if(verbose){printf("WordDBPage::compress_key: compress(typ5):%d\n",len);} out.put_zone((byte *)key(i)->data,8*len,label_str("seperatekey_data",i)); } } void compress_data(Compressor &out,int i) { int len=data(i)->len; out.put_uint(len,NBITS_DATALEN,label_str("seperatedata_len",i)); if(verbose){printf("WordDBPage::compress_data: compressdata(typ5):%d\n",len);} out.put_zone((byte *)data(i)->data,8*len,label_str("seperatedata_data",i)); } WordDBKey uncompress_key(Compressor &in,int i) { WordDBKey res; int len=in.get_uint(NBITS_KEYLEN,label_str("seperatekey_len",i)); if(verbose){printf("WordDBPage::uncompress_key: seperatekey:len:%d\n",len);} if(type==P_IBTREE) { if(len==0 && i!=0){errr("WordDBPage::uncompress_key: keylen=0 && i!=0");} BINTERNAL bti; bti.len =in.get_uint(sizeof(bti.len )*8,label_str("seperatekey_bti_len" ,i)); bti.type =in.get_uint(sizeof(bti.type )*8,label_str("seperatekey_bti_type" ,i)); bti.pgno =in.get_uint(sizeof(bti.pgno )*8,label_str("seperatekey_bti_pgno" ,i)); bti.nrecs=in.get_uint(sizeof(bti.nrecs)*8,label_str("seperatekey_bti_nrecs",i)); if(len!=bti.len){errr("WordDBPage::uncompress_key: incoherence: len!=bti.len");} if(len) { byte *gotdata=new byte[len]; CHECK_MEM(gotdata); in.get_zone(gotdata,8*len,label_str("seperatekey_btidata",i)); res=WordDBKey(gotdata,len); delete [] gotdata; } insert_btikey(res,bti,(len==0 ? 1:0)); } else { byte *gotdata=new byte[len]; CHECK_MEM(gotdata); in.get_zone(gotdata,8*len,label_str("seperatekey_data",i)); res=WordDBKey(gotdata,len); insert_key(res); delete [] gotdata; } return res; } WordDBRecord uncompress_data(Compressor &in,int i,int rectyp) { WordDBRecord res; int len=in.get_uint(NBITS_DATALEN,label_str("seperatedata_len",i)); if(verbose)printf("uncompressdata:len:%d\n",len); byte *gotdata=new byte[len]; CHECK_MEM(gotdata); in.get_zone(gotdata,8*len,label_str("seperatedata_data",i)); res=WordDBRecord(gotdata,len,rectyp); insert_data(res); delete [] gotdata; return res; } // exctracted numerical fields const char* number_field_label(int j) { if(j>0 && jsort[j].name);} if( j==CNFLAGS )return "CNFLAGS " ; if( j==CNDATASTATS0 )return "CNDATASTATS0 " ; if( j==CNDATASTATS1 )return "CNDATASTATS1 " ; if( j==CNDATADATA )return "CNDATADATA " ; if( j==CNBTIPGNO )return "CNBTIPGNO " ; if( j==CNBTINRECS )return "CNBTINRECS " ; if( j==CNWORDDIFFPOS )return "CNWORDDIFFPOS" ; if( j==CNWORDDIFFLEN )return "CNWORDDIFFLEN" ; return "BADFIELD"; } // positions of different fileds in // number arrays that are extracted int CNFLAGS ;// FLAGS: which key-fields have changed int CNFIELDS ;// first numerical field int CNDATASTATS0 ;// word record - stats element 0 int CNDATASTATS1 ;// word record - stats element 1 int CNDATADATA ;// word record - data int CNBTIPGNO ;// internal page: page pointed at by node int CNBTINRECS ;// internal page: ?? int CNWORDDIFFPOS ;// position of first caracter that changed in word int CNWORDDIFFLEN ;// number of chars that changed in word int nnums ; // ************** DEBUGING/BENCHMARKING *************** void show(); int verbose; int debug; // ************** Initialization/Destruction ***************** // initialize when header is valid void init() { type=pg->type; n=pg->entries; nk=(type==P_LBTREE ? n/2 : n); insert_pos=pgsz; insert_indx=0; } void init0() { CNFLAGS =0; CNFIELDS =1; CNDATASTATS0 = WordKey::NFields() ; CNDATASTATS1 = WordKey::NFields() + 1; CNDATADATA = WordKey::NFields() + 2; CNBTIPGNO = WordKey::NFields() + 3; CNBTINRECS = WordKey::NFields() + 4; CNWORDDIFFPOS = WordKey::NFields() + 5; CNWORDDIFFLEN = WordKey::NFields() + 6; nnums=(CNWORDDIFFLEN+1); pg=NULL; pgsz=0; n=0; nk=0; type=-1; verbose=0; debug=0; insert_pos=pgsz; insert_indx=0; } // db page was created here, destroy it void delete_page() { if(!pg){errr("WordDBPage::delete_page: pg==NULL");} delete [] pg; pg=NULL; } // unlink db page from this encapsulation void unset_page() { if(!pg){errr("WordDBPage::unset_page: pg==NULL");} pg=NULL; } // the DB page must be unset or deleted // before destroying this encapsulation ~WordDBPage() { if(pg){errr("WordDBPage::~WordDBPage: page not empty");} } WordDBPage(int npgsz) { init0(); pgsz=npgsz; pg=(PAGE *)(new byte[pgsz]); CHECK_MEM(pg); insert_pos=pgsz; insert_indx=0; } WordDBPage(const u_int8_t* buff,int buff_length) { init0(); pg=(PAGE *)buff; pgsz=buff_length; insert_pos=pgsz; insert_indx=0; init(); } }; #endif// _WordDBPage_h_ htdig-3.2.0b6/htword/WordDead.cc0100644006314600127310000000441610055635556015711 0ustar angusgbhtdig// // WordDead.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDead.cc,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordDead.h" #include "WordListOne.h" class WordDeadCursor { public: WordDBCursor* cursor; }; WordDead::~WordDead() { delete db; delete mask; } int WordDead::Initialize(WordList* nwords) { words = nwords; db = new WordDB(nwords->GetContext()->GetDBInfo()); mask = new WordKey(words->GetContext()); return OK; } int WordDead::Open() { const String& filename = words->Filename(); int flags = words->Flags(); db->set_pagesize(words->Pagesize()); return db->Open(filename, "dead", DB_BTREE, flags, 0666, WORD_DB_DEAD) == 0 ? OK : NOTOK; } int WordDead::Remove() { return db->Remove(words->Filename(), "dead") == 0 ? OK : NOTOK; } int WordDead::Close() { return db->Close() == 0 ? OK : NOTOK; } int WordDead::Normalize(WordKey& key) const { int nfields = words->GetContext()->GetKeyInfo().nfields; int i; // // Undefine in 'key' all fields not defined in 'mask' // for(i = 0; i < nfields; i++) { if(!mask->IsDefined(i)) key.Set(i, WORD_KEY_VALUE_INVALID); } return OK; } int WordDead::Exists(const WordKey& key) const { WordKey tmp_key = key; Normalize(tmp_key); String coded; String dummy; tmp_key.Pack(coded); return db->Get(0, coded, dummy, 0) == 0; } int WordDead::Put(const WordKey& key) const { WordKey tmp_key = key; Normalize(tmp_key); String coded; String dummy; tmp_key.Pack(coded); return db->Put(0, coded, dummy, 0) == 0 ? OK : NOTOK; } WordDeadCursor* WordDead::Cursor() const { WordDeadCursor* cursor = new WordDeadCursor; cursor->cursor = db->Cursor(); return cursor; } int WordDead::Next(WordDeadCursor* cursor, WordKey& key) { String coded; String dummy; int ret = cursor->cursor->Get(coded, dummy, DB_NEXT); if(ret != 0) { delete cursor->cursor; delete cursor; } else { key.Unpack(coded); } return ret; } htdig-3.2.0b6/htword/WordDead.h0100644006314600127310000000270510055635556015552 0ustar angusgbhtdig// // WordDead.h // // NAME // // list of documents that must be ignored and then deleted from the index. // // SYNOPSIS // // Helper for the WordList class. // // DESCRIPTION // // WordDead is a list of WordKey entries describing deleted documents. // All inverted index entries that match a WordKey entry of the WordDead // list are treated as if they do not appear in the inverted index. // // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDead.h,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordDead_h_ #define _WordDead_h_ #include #include "htString.h" #include "WordDB.h" class WordList; class WordDeadCursor; class WordDead { public: WordDead() { words = 0; db = 0; mask = 0; } ~WordDead(); int Initialize(WordList* words); int Open(); int Remove(); int Close(); int Mask(const WordKey& nmask) { *mask = nmask; return OK; } List* Words() const; int Normalize(WordKey& key) const; int Exists(const WordKey& key) const; int Put(const WordKey& key) const; WordDeadCursor* Cursor() const; int Next(WordDeadCursor* cursor, WordKey& key); private: WordList* words; WordDB* db; WordKey* mask; }; #endif /* _WordDead_h_ */ htdig-3.2.0b6/htword/WordDict.cc0100644006314600127310000001377110055635556015743 0ustar angusgbhtdig// // WordDict.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDict.cc,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordDict.h" #include "WordListOne.h" #define WORD_DICT_CURSOR_FIRST 1 #define WORD_DICT_CURSOR_NEXT 2 class WordDictCursor { public: int info; String prefix; WordDBCursor* cursor; }; WordDict::~WordDict() { delete db; } int WordDict::Initialize(WordList* nwords) { words = nwords; db = new WordDB(nwords->GetContext()->GetDBInfo()); return OK; } int WordDict::Open() { const String& filename = words->Filename(); int flags = words->Flags(); db->set_pagesize(words->Pagesize()); return db->Open(filename, "dict", DB_BTREE, flags, 0666, WORD_DB_DICT) == 0 ? OK : NOTOK; } int WordDict::Remove() { return db->Remove(words->Filename(), "dict") == 0 ? OK : NOTOK; } int WordDict::Close() { return db->Close() == 0 ? OK : NOTOK; } int WordDict::Serial(const String& word, unsigned int& serial) { int ret; WordDictRecord entry; if((ret = entry.Get(db, word)) != 0 && ret != DB_NOTFOUND) return NOTOK; if(ret == DB_NOTFOUND) { words->Meta()->Serial(WORD_META_SERIAL_WORD, entry.id); if(entry.Put(db, word) != 0) return NOTOK; } serial = entry.id; return OK; } int WordDict::SerialExists(const String& word, unsigned int& serial) { int ret; WordDictRecord entry; if((ret = entry.Get(db, word)) != 0 && ret != DB_NOTFOUND) return NOTOK; serial = ret == DB_NOTFOUND ? WORD_DICT_SERIAL_INVALID : entry.id; return OK; } int WordDict::SerialRef(const String& word, unsigned int& serial) { int ret; WordDictRecord entry; if((ret = entry.Get(db, word)) != 0 && ret != DB_NOTFOUND) return NOTOK; if(ret == DB_NOTFOUND) words->Meta()->Serial(WORD_META_SERIAL_WORD, entry.id); entry.count++; if(entry.Put(db, word) != 0) return NOTOK; serial = entry.id; return OK; } int WordDict::Noccurrence(const String& word, unsigned int& noccurrence) const { if(word.empty()) { fprintf(stderr, "WordDict::Noccurrence: null word\n"); return NOTOK; } WordDictRecord entry; noccurrence = 0; int ret; if((ret = entry.Get(db, word)) != 0) { if(ret != DB_NOTFOUND) return NOTOK; } noccurrence = entry.count; return OK; } int WordDict::Normalize(String& word) const { const WordType& wtype = words->GetContext()->GetType(); return wtype.Normalize(word); } int WordDict::Incr(const String& word, unsigned int incr) { int ret; WordDictRecord entry; if((ret = entry.Get(db, word)) != 0 && ret != DB_NOTFOUND) return NOTOK; if(ret == DB_NOTFOUND) words->Meta()->Serial(WORD_META_SERIAL_WORD, entry.id); entry.count += incr; if(entry.Put(db, word) != 0) return NOTOK; return OK; } int WordDict::Decr(const String& word, unsigned int decr) { WordDictRecord entry; int ret; if((ret = entry.Get(db, word)) != 0) { if(ret == DB_NOTFOUND) fprintf(stderr, "WordDict::Unref(%s) Unref on non existing word occurrence\n", (const char*)word); return NOTOK; } entry.count -= decr; if(entry.count > 0) ret = entry.Put(db, word) == 0 ? OK : NOTOK; else ret = entry.Del(db, word) == 0 ? OK : NOTOK; return ret; } int WordDict::Put(const String& word, unsigned int noccurrence) { int ret; WordDictRecord entry; if((ret = entry.Get(db, word)) != 0 && ret != DB_NOTFOUND) return NOTOK; if(ret == DB_NOTFOUND) words->Meta()->Serial(WORD_META_SERIAL_WORD, entry.id); entry.count = noccurrence; if(entry.Put(db, word) != 0) return NOTOK; return OK; } List *WordDict::Words() const { String key; String coded; WordDBCursor* cursor = db->Cursor(); List* list = new List; while(cursor->Get(key, coded, DB_NEXT) == 0) list->Add(new String(key)); delete cursor; return list; } int WordDict::Exists(const String& word) const { String tmp_word = word; String coded; return db->Get(0, tmp_word, coded, 0) == 0; } WordDictCursor* WordDict::Cursor() const { WordDictCursor* cursor = new WordDictCursor; cursor->cursor = db->Cursor(); return cursor; } int WordDict::Next(WordDictCursor* cursor, String& word, WordDictRecord& record) { String coded; int ret = cursor->cursor->Get(word, coded, DB_NEXT); if(ret != 0) { delete cursor->cursor; delete cursor; } else { record.Unpack(coded); } return ret; } WordDictCursor* WordDict::CursorPrefix(const String& prefix) const { WordDictCursor* cursor = new WordDictCursor; cursor->cursor = db->Cursor(); cursor->prefix = prefix; cursor->info = WORD_DICT_CURSOR_FIRST; return cursor; } int WordDict::NextPrefix(WordDictCursor* cursor, String& word, WordDictRecord& record) { String coded; int ret; if(cursor->info == WORD_DICT_CURSOR_FIRST) { word = cursor->prefix; ret = cursor->cursor->Get(word, coded, DB_SET_RANGE); cursor->info = WORD_DICT_CURSOR_NEXT; } else { ret = cursor->cursor->Get(word, coded, DB_NEXT); } // // Stop walking when 1) DB_NOTFOUND, 2) the word found is shorter than // the required prefix, 3) the word found does not start with the // required prefix. // if(ret != 0 || cursor->prefix.length() > word.length() || strncmp(cursor->prefix.get(), word.get(), cursor->prefix.length())) { delete cursor->cursor; delete cursor; if(ret == 0) ret = DB_NOTFOUND; } else { record.Unpack(coded); } return ret; } int WordDict::Write(FILE* f) { WordDBCursor* cursor = db->Cursor(); String key; String coded; unsigned int occurrence; unsigned int id; while(cursor->Get(key, coded, DB_NEXT) == 0) { int offset = 0; coded.ber_shift(offset, occurrence); coded.ber_shift(offset, id); fprintf(f, "%s %d %d\n", (char*)key, id, occurrence); } delete cursor; return OK; } htdig-3.2.0b6/htword/WordDict.h0100644006314600127310000001626710055635556015610 0ustar angusgbhtdig// // WordDict.h // // NAME // // manage and use an inverted index dictionary. // // SYNOPSIS // // #include // // WordList* words = ...; // WordDict* dict = words->Dict(); // // DESCRIPTION // // WordDict maps strings to unique identifiers and frequency in the // inverted index. Whenever a new word is found, the WordDict class // can be asked to assign it a serial number. When doing so, an entry // is created in the dictionary with a frequency of zero. The application // may then increment or decrement the frequency to reflect the inverted // index content. // // The serial numbers range from 1 to 2^32 inclusive. // // A WordDict object is automatically created by the WordList object and // should not be created directly by the application. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordDict.h,v 1.4 2004/05/28 13:15:26 lha Exp $ // #ifndef _WordDict_h_ #define _WordDict_h_ #include #ifndef SWIG #include "htString.h" #include "WordDB.h" class WordList; class WordDictCursor; #define WORD_DICT_SERIAL_INVALID 0 class WordDictRecord { public: inline WordDictRecord() { count = 0; id = WORD_DICT_SERIAL_INVALID; } inline int Unpack(const String& coded) { int offset = 0; coded.ber_shift(offset, count); coded.ber_shift(offset, id); return OK; } inline int Pack(String& coded) const { int offset = 0; coded.ber_push(offset, count); coded.ber_push(offset, id); return OK; } inline int Get(WordDB* db, const String& word) { String tmp_word = word; String coded(BER_MAX_BYTES * 2); int ret; if((ret = db->Get(0, tmp_word, coded, 0)) != 0) return ret; Unpack(coded); return ret; } inline int Put(WordDB* db, const String& word) { String coded(BER_MAX_BYTES * 2); Pack(coded); return db->Put(0, word, coded, 0); } inline int Del(WordDB* db, const String& word) { return db->Del(0, word); } inline unsigned int Count() { return count; } inline unsigned int Id() { return id; } unsigned int count; unsigned int id; }; #endif /* SWIG */ class WordDict { public: #ifndef SWIG //- // Private constructor. // WordDict() { words = 0; db = 0; } ~WordDict(); //- // Bind the object a WordList inverted index. Return OK on success, // NOTOK otherwise. // int Initialize(WordList* words); //- // Open the underlying Berkeley DB sub-database. The enclosing // file is given by the words data member. Return OK on success, // NOTOK otherwise. // int Open(); //- // Destroy the underlying Berkeley DB sub-database. Return OK on success, // NOTOK otherwise. // int Remove(); //- // Close the underlying Berkeley DB sub-database. Return OK on success, // NOTOK otherwise. // int Close(); //- // If the word argument exists in the dictionnary, return its // serial number in the serial argument. If it does not already // exists, assign it a serial number, create an entry with a frequency // of zero and return the new serial in the serial argument. // Return OK on success, NOTOK otherwise. // int Serial(const String& word, unsigned int& serial); //- // If the word argument exists in the dictionnary, return its // serial number in the serial argument. If it does not exists // set the serial argument to WORD_DICT_SERIAL_INVALID. // Return OK on success, NOTOK otherwise. // int SerialExists(const String& word, unsigned int& serial); //- // Short hand for Serial() followed by Ref(). // Return OK on success, NOTOK otherwise. // int SerialRef(const String& word, unsigned int& serial); //- // Return the frequency of the word argument // in the noccurrence argument. // Return OK on success, NOTOK otherwise. // int Noccurrence(const String& word, unsigned int& noccurrence) const; #endif /* SWIG */ //- // Short hand for words->GetContext()->GetType()->Normalize(word). // Return OK on success, NOTOK otherwise. // int Normalize(String& word) const; //- // Short hand for Incr(word, 1) // int Ref(const String& word) { return Incr(word, 1); } //- // Add incr to the frequency of the word. // Return OK on success, NOTOK otherwise. // int Incr(const String& word, unsigned int incr); //- // Short hand for Decr(word, 1) // int Unref(const String& word) { return Decr(word, 1); } //- // Subtract decr to the frequency of the word. If // the frequency becomes lower or equal to zero, remove the entry // from the dictionnary and lose the association between the word and its // serial number. // Return OK on success, NOTOK otherwise. // int Decr(const String& word, unsigned int decr); //- // Set the frequency of word with the value of the noccurrence // argument. // int Put(const String& word, unsigned int noccurrence); //- // Return true if word exists in the dictionnary, false otherwise. // int Exists(const String& word) const; #ifndef SWIG //- // Return a pointer to the associated WordList object. // List* Words() const; //- // Return a cursor to sequentially walk the dictionnary using the // Next method. // WordDictCursor* Cursor() const; //- // Return the next entry in the dictionnary. The cursor argument // must have been created using the Cursor method. The word is // returned in the word argument and the record is returned in // the record argument. // On success the function returns 0, at the end of the dictionnary it // returns DB_NOTFOUND. The cursor argument is deallocated when // the function hits the end of the dictionnary or an error occurs. // int Next(WordDictCursor* cursor, String& word, WordDictRecord& record); //- // Return a cursor to sequentially walk the entries of the dictionnary // that start with the prefix argument, using the // NextPrefix method. // WordDictCursor* CursorPrefix(const String& prefix) const; //- // Return the next prefix from the dictionnary. The cursor argument // must have been created using the CursorPrefix method. The word is // returned in the word argument and the record is returned in // the record argument. The word is guaranteed to start with // the prefix specified to the CursorPrefix method. // On success the function returns 0, at the end of the dictionnary it // returns DB_NOTFOUND. The cursor argument is deallocated when // the function hits the end of the dictionnary or an error occurs. // int NextPrefix(WordDictCursor* cursor, String& word, WordDictRecord& record); //- // Dump the complete dictionary in the file descriptor f. The // format of the dictionary is word serial frequency, one by // line. // int Write(FILE* f); private: WordList* words; WordDB* db; #endif /* SWIG */ }; #endif /* _WordDict_h_ */ htdig-3.2.0b6/htword/WordKey.cc0100644006314600127310000004042210055635556015601 0ustar angusgbhtdig// // WordKey.cc // // WordKey: All the functions are implemented regardless of the actual // structure of the key using word_key_info. // WARNING: although it may seem that you can have two String // fields in the key, some code does not support that. This should // not be a problem since the goal of the WordKey class is to // implement the keys of an inverted index. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordKey.cc,v 1.9 2004/05/28 13:15:26 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include "WordKey.h" // // Returns OK if fields set in 'object' and 'other' are all equal. // // Fields not set in either 'object' or 'other' are ignored // completely. If the prefix_length is > 0 the 'object' String // fields are compared to the prefix_length bytes of the 'other' // String fields only. // // This function is useful to compare existing keys with a search // criterion that may be incomplete. For instance if we look for keys // that contain words starting with a given prefix or keys that // are located in a specific document, regardless of their location // in the document. // int WordKey::Equal(const WordKey& other) const { const WordKeyInfo& info = *WordKey::Info(); // // Walk the fields in sorting order. As soon as one of them // does not compare equal, return. // for(int j = 0; j < info.nfields; j++) { // // Only compare fields that are set in both key // if(!IsDefined(j) || !other.IsDefined(j)) continue; switch(info.sort[j].type) { case WORD_ISA_STRING: if(!IsDefinedWordSuffix()) { if(kword != other.kword.sub(0, kword.length())) return 0; } else { if(kword != other.kword) return 0; } break; default: if(Get(j) != other.Get(j)) return 0; break; } } return 1; } // // Compare and in the Berkeley DB fashion. // and are packed keys. // Compares full WordKey, unlike Compare_WordOnly. // inline int WordKey::Compare(const char *a, int a_length, const char *b, int b_length) { const WordKeyInfo& info = *WordKey::Info(); if(a_length < info.num_length || b_length < info.num_length) { fprintf(stderr, "WordKey::Compare: key length %d or %d < info.num_length = %d\n", a_length, b_length, info.num_length); return NOTOK; } // // Walk the fields, as soon as one of them does not compare equal, // return. // // // first field: string // const int p1_length = a_length - info.num_length; const int p2_length = b_length - info.num_length; { int len = p1_length > p2_length ? p2_length : p1_length; const unsigned char* p1 = (unsigned char *)a; const unsigned char* p2 = (unsigned char *)b; for (;len--; ++p1, ++p2) { if (*p1 != *p2) return (int)*p1 - (int)*p2; } if(p1_length != p2_length) return p1_length - p2_length; } // // following fields: numerical // But what *are* they?? -- lha // for(int j = 1; j < info.nfields; j++) { WordKeyNum p1; int a_index = info.sort[j].bytes_offset + p1_length; WordKey::UnpackNumber((unsigned char *)&a[a_index], info.sort[j].bytesize, p1, info.sort[j].lowbits, info.sort[j].bits); WordKeyNum p2; int b_index = info.sort[j].bytes_offset + p2_length; WordKey::UnpackNumber((unsigned char *)&b[b_index], info.sort[j].bytesize, p2, info.sort[j].lowbits, info.sort[j].bits); if(p1 != p2) return p1 - p2; } // // If we reach this point, everything compared equal // return 0; } // // Compare and in the Berkeley DB fashion. // and are packed keys. // Only compares "word" part of WordKey, unlike Compare. // inline int WordKey::Compare_WordOnly(const char *a, int a_length, const char *b, int b_length) { const WordKeyInfo& info = *WordKey::Info(); if(a_length < info.num_length || b_length < info.num_length) { fprintf(stderr, "WordKey::Compare: key length %d or %d < info.num_length = %d\n", a_length, b_length, info.num_length); return NOTOK; } // // compare first field only: actual word // const int p1_length = a_length - info.num_length; const int p2_length = b_length - info.num_length; { int len = p1_length > p2_length ? p2_length : p1_length; const unsigned char* p1 = (unsigned char *)a; const unsigned char* p2 = (unsigned char *)b; for (;len--; ++p1, ++p2) { if (*p1 != *p2) return (int)*p1 - (int)*p2; } if(p1_length != p2_length) return p1_length - p2_length; } return 0; } // // Compare and in the Berkeley DB fashion. // and are packed keys. // Compares full WordKey, unlike Compare_WordOnly. // int WordKey::Compare(const String& a, const String& b) { return WordKey::Compare(a, a.length(), b, b.length()); } // // Compare and in the Berkeley DB fashion. // and are packed keys. // Only compares "word" part of WordKey, unlike Compare. // int WordKey::Compare_WordOnly(const String& a, const String& b) { return WordKey::Compare_WordOnly(a, a.length(), b, b.length()); } // // C comparison function interface for Berkeley DB (bt_compare) // Just call the static Compare function of WordKey. It is *critical* // that this function is as fast as possible. See the Berkeley DB // documentation for more information on the return values. // Compares full WordKey, unlike word_only_db_cmp. // int word_db_cmp(const DBT *a, const DBT *b) { return WordKey::Compare((char*)a->data, a->size, (char*)b->data, b->size); } // // C comparison function interface for Berkeley DB (bt_compare) // Just call the static Compare function of WordKey. // See the Berkeley DB // documentation for more information on the return values. // Only compares text part of the WordKey, unlike word_db_cmp. // int word_only_db_cmp(const DBT *a, const DBT *b) { return WordKey::Compare_WordOnly((char*)a->data, a->size, (char*)b->data, b->size); } // // Compare current key defined fields with other key defined fields only, // ignore fields that are not defined in key or other. Return 1 if different // 0 if equal. If different, position is set to the field number that differ, // lower is set to 1 if Get(position) is lower than other.Get(position) otherwise // lower is set to 0. // int WordKey::Diff(const WordKey& other, int& position, int& lower) { position = -1; if(IsDefined(0) && other.IsDefined(0)) { int ret = 0; if(other.IsDefinedWordSuffix()) ret = GetWord().compare(other.GetWord()); else ret = strncmp((char*)GetWord(), (const char*)other.GetWord(), other.GetWord().length()); if(ret) { position = 0; lower = ret > 0; } } if(position < 0) { int nfields=WordKey::NFields(); int i; for(i = 1; i < nfields; i++) { if(IsDefined(i) && other.IsDefined(i) && Get(i) != other.Get(i)) { lower = Get(i) < other.Get(i); break; } } if(i < nfields) position = i; } return position >= 0; } // // Compare object and using comparison of their packed form // int WordKey::PackEqual(const WordKey& other) const { String this_pack; Pack(this_pack); String other_pack; other.Pack(other_pack); return this_pack == other_pack; } // // Implement ++ on a key. // // It behaves like arithmetic but follows these rules: // . Increment starts at field // . If a field value overflows, increment field - 1 // . Undefined fields are ignored and their value untouched // . Incrementing the word field is done by appending \001 // . When a field is incremented all fields to the left are set to 0 // If position is not specified it is equivalent to NFields() - 1. // It returns OK if successfull, NOTOK if position out of range or // WORD_FOLLOWING_ATEND if the maximum possible value was reached. // // Examples assuming numerical fields are 8 bits wide: // // 0 1 2 3 OPERATION RESULT // --------------------------------------------------------------------------------------- // foo 1 1 1 -> SetToFollowing(3) -> foo 1 1 2 // foo 1 1 1 -> SetToFollowing(2) -> foo 1 2 0 // foo 1 1 255 -> SetToFollowing(3) -> foo 1 2 0 // foo 255 255 255 -> SetToFollowing(3) -> foo\001 0 0 0 // foo 255 1 1 -> SetToFollowing(1) -> foo\001 0 0 0 // 255 1 1 -> SetToFollowing(1) -> WORD_FOLLOWING_ATEND // foo 1 255 -> SetToFollowing(3) -> foo 2 0 // foo 255 -> SetToFollowing(3) -> foo\001 0 // // int WordKey::SetToFollowing(int position /* = WORD_FOLLOWING_MAX */) { if(position == WORD_FOLLOWING_MAX) position = NFields() - 1; if(position < 0 || position >= NFields()) { fprintf(stderr, "WordKey::SetToFollowing invalid position = %d\n", position); return NOTOK; } int i = position; while(i > 0) { if(IsDefined(i)) { if(Overflow(i, 1)) Set(i, 0); else break; } i--; } if(i == 0) { if(IsDefined(i)) GetWord() << '\001'; else return WORD_FOLLOWING_ATEND; } else Get(i)++; for(i = position + 1; i < NFields(); i++) if(IsDefined(i)) Set(i,0); return OK; } // // Return true if the key may be used as a prefix for search. // In other words return true if the fields set in the key // are all contiguous, starting from the first field in sort order. // int WordKey::Prefix() const { const WordKeyInfo& info = *WordKey::Info(); // // If all fields are set, it can be considered as a prefix although // it really is a fully qualified key. // if(Filled()) return OK; // // If the first field is not set this cannot be a prefix // if(!IsDefined(0)) return NOTOK; int found_unset = 0; if(!IsDefinedWordSuffix()) { found_unset = 1; } // // Walk the fields in sorting order. // for(int j = WORD_FIRSTFIELD; j < info.nfields; j++) { // // Fields set, then fields unset then field set -> not a prefix // if(IsDefined(j)) if(found_unset) return NOTOK; else // // Found unset fields and this is fine as long as we do // not find a field set later on. // found_unset++; } return OK; } // // Unset all fields past the first unset field // Return the number of fields in the prefix or 0 if // first field is not set, ie no possible prefix. // int WordKey::PrefixOnly() { const WordKeyInfo& info = *WordKey::Info(); // // If all fields are set, the whole key is the prefix. // if(Filled()) return OK; // // If the first field is not set there is no possible prefix // if(!IsDefined(0)) { return NOTOK; } int found_unset = 0; // // Walk the fields in sorting order. // if(!IsDefinedWordSuffix()){found_unset=1;} for(int j = WORD_FIRSTFIELD; j < info.nfields; j++) { // // Unset all fields after the first unset field // if(IsDefined(j)) { if(found_unset) {Set(j,0);Undefined(j);} } else {found_unset=1;} } return OK; } // // Unpack from data and fill fields of object // int WordKey::Unpack(const char* string,int length) { const WordKeyInfo& info = *WordKey::Info(); if(length < info.num_length) { fprintf(stderr, "WordKey::Unpack: key record length < info.num_length\n"); return NOTOK; } int string_length = length - info.num_length; SetWord(string, string_length); for(int j = WORD_FIRSTFIELD; j < info.nfields; j++) { WordKeyNum value = 0; int index = string_length + info.sort[j].bytes_offset; WordKey::UnpackNumber((unsigned char *)&string[index], info.sort[j].bytesize, value, info.sort[j].lowbits, info.sort[j].bits); Set(j,value); } return OK; } // // Pack object into the string // int WordKey::Pack(String& packed) const { const WordKeyInfo& info = *WordKey::Info(); char* string; int length = info.num_length; length += kword.length(); if((string = (char*)malloc(length)) == 0) { fprintf(stderr, "WordKey::Pack: malloc returned 0\n"); return NOTOK; } memset(string, '\0', length); memcpy(string, kword.get(), kword.length()); for(int i = WORD_FIRSTFIELD; i < info.nfields; i++) { int index = kword.length() + info.sort[i].bytes_offset; WordKey::PackNumber(Get(i), &string[index], info.sort[i].bytesize, info.sort[i].lowbits, info.sort[i].lastbits); } packed.set(string, length); free(string); return OK; } // // Copy all fields set in to object, only if // the field is not already set in // int WordKey::Merge(const WordKey& other) { const WordKeyInfo& info = *WordKey::Info(); for(int j = 0; j < info.nfields; j++) { if(!IsDefined(j) && other.IsDefined(j)) { switch(info.sort[j].type) { case WORD_ISA_STRING: SetWord(other.GetWord()); if(!other.IsDefinedWordSuffix()) UndefinedWordSuffix(); break; default: Set(j,other.Get(j)); break; } } } return OK; } // // Convert the whole structure to an ascii string description // int WordKey::Get(String& buffer) const { buffer.trunc(); const WordKeyInfo& info = *WordKey::Info(); // // Walk the fields in sorting order. As soon as one of them // does not compare equal, return. // for(int j = 0; j < info.nfields; j++) { if(!IsDefined(j)) { buffer << ""; } else { switch(info.sort[j].type) { case WORD_ISA_STRING: buffer << GetWord(); break; case WORD_ISA_NUMBER: buffer << Get(j); break; default: fprintf(stderr, "WordKey::Get: invalid type %d for field %d\n", info.sort[j].type, j); return NOTOK; } } // // Output virtual word suffix field // if(j == 0) { if(IsDefined(j) && !IsDefinedWordSuffix()) { buffer << "\t"; } else { buffer << "\t"; } } buffer << "\t"; } return OK; } String WordKey::Get() const { String tmp; Get(tmp); return tmp; } // // Set a key from an ascii representation // int WordKey::Set(const String& buffer) { StringList fields(buffer, "\t "); return SetList(fields); } // // Set a key from list of fields // int WordKey::SetList(StringList& fields) { const WordKeyInfo& info = *WordKey::Info(); int length = fields.Count(); // // + 1 counts for the word suffix field // if(length < info.nfields + 1) { fprintf(stderr, "WordKey::Set: expected at least %d fields and found %d (ignored)\n", info.nfields + 1, length); return NOTOK; } if(length < 2) { fprintf(stderr, "WordKey::Set: expected at least two fields in line\n"); return NOTOK; } Clear(); fields.Start_Get(); // // Handle word and its suffix // int i = 0; { // // Get the word // String* word = (String*)fields.Get_Next(); if(word == 0) { fprintf(stderr, "WordKey::Set: failed to get word\n"); return NOTOK; } if(word->nocase_compare("") == 0) UndefinedWord(); else SetWord(*word); i++; // // Get the word suffix status // String* suffix = (String*)fields.Get_Next(); if(suffix == 0) { fprintf(stderr, "WordKey::Set: failed to get word suffix %d\n", i); return NOTOK; } if(suffix->nocase_compare("") == 0) UndefinedWordSuffix(); else SetDefinedWordSuffix(); } // // Handle numerical fields // int j; for(j = WORD_FIRSTFIELD; i < info.nfields; i++, j++) { String* field = (String*)fields.Get_Next(); if(field == 0) { fprintf(stderr, "WordKey::Set: failed to retrieve field %d\n", i); return NOTOK; } if(field->nocase_compare("") == 0) { Undefined(j); } else { WordKeyNum value = strtoul(field->get(), 0, 10); Set(j, value); } } return OK; } int WordKey::Write(FILE* f) const { String tmp; Get(tmp); fprintf(f, "%s", (char*)tmp); return 0; } void WordKey::Print() const { Write(stderr); } htdig-3.2.0b6/htword/WordKey.h0100644006314600127310000004323210055635556015445 0ustar angusgbhtdig// WordKey.h // // NAME // inverted index key. // // SYNOPSIS // // #include // // #define DOCID 1 // #define LOCATION 1 // // WordKey key("word 1 2"); // key.Set(DOCID, 100); // key.SetWord("other"); // // DESCRIPTION // // Describes the key used to store a entry in the inverted index. // The structure of a key is described by the WordKeyInfo // Each field in the key has a bit in the set // member that says if it is set or not. This bit allows to // say that a particular field is undefined regardless of // the actual value stored. The methods // IsDefined, SetDefined and Undefined are used to manipulate // the defined status of a field. The Pack and Unpack // methods are used to convert to and from the disk storage representation // of the key. // // Generic functions to manipulate the key should use the WordKeyInfo // information to work regardless of the actual structure of the key. // // Suffix definition: a word suffix is a kind of marker that says if // the word is a full word or only the beginning of a // word. If a word has a suffix then it's a full word. If it // has no suffix then it's only the beginning of a word. // This is mostly useful when specifying search keys. If a // search key word has no suffix, the search mechanism is // expected to return all words that begin with the word. If // the search key word has a suffix, only words that exactly // match the search key word will be returned. // // ASCII FORMAT // // The ASCII description is a string with fields separated by tabs or // white space. //
    // Example: Foo  0 1 4 2
    // Field 1: The word as a string or  if not defined
    // Field 2:  if suffix defined,  if suffix undefined
    // Field 3 to nfield + 1: numerical value of the field or  if
    //                        not defined
    //
    // 
    // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // #ifndef _WordKey_h_ #define _WordKey_h_ #ifndef SWIG #include "db.h" #include "htString.h" #include "StringList.h" #endif /* SWIG */ // // WORDSUFFIX: // // field in set flag that says if a word is just a prefix (incomplete word) // WORD_KEY_WORDSUFFIX_DEFINED -> means that word IS complete (not a prefix) // #define WORD_KEY_WORDSUFFIX_DEFINED (1 << 30) #define WORD_KEY_WORD_DEFINED 1 #define WORD_KEY_WORDFULLY_DEFINED ( WORD_KEY_WORDSUFFIX_DEFINED | WORD_KEY_WORD_DEFINED ) // // Possible return values of Outbound/Overflow/Underflow methods // #define WORD_INBOUND 0 #define WORD_OVERFLOW 1 #define WORD_UNDERFLOW 2 // // Possible return values of SetToFollowing // #define WORD_FOLLOWING_ATEND 0x0001 // // Default value for position argument of SetToFollowing // meaning NFields() - 1 // #define WORD_FOLLOWING_MAX -1 // // Position of the first numerical field (just after the word) // #define WORD_FIRSTFIELD 1 // // Unknown field position // #define WORD_KEY_UNKNOWN_POSITION -1 #ifndef SWIG // C comparison function interface for Berkeley DB (bt_compare) // int word_db_cmp(const DBT *a, const DBT *b); int word_only_db_cmp(const DBT *a, const DBT *b); #endif /* SWIG */ #ifndef SWIG #include"WordKeyInfo.h" #endif /* SWIG */ // // Describe a word occurrence // // !!!!!!!DEBUGTMP #ifndef SWIG #define WORD_FATAL_ABORT fflush(stdout);fprintf(stderr,"FATAL ERROR at file:%s line:%d !!!\n",__FILE__,__LINE__);fflush(stderr);(*(int *)NULL)=1 #define word_errr(s) {fprintf(stderr,"FATAL ERROR:%s\n",s);WORD_FATAL_ABORT;} #endif /* SWIG */ class WordKey { public: // // Constructors, destructors, copy and clear // //- // Constructor. Build an empty key. // WordKey() { Initialize(); } #ifndef SWIG //- // Constructor. Initialize from an ASCII description of a key. // See ASCII FORMAT section. // WordKey(const String& word) { Initialize(); Set(word); } // // Copy constructor (needed because of the array pointer) // WordKey(const WordKey &other) { Initialize(); CopyFrom(other); } #endif /* SWIG */ ~WordKey() { delete [] numerical_fields; } #ifndef SWIG protected: // // Constructor helper, allocate members and set to empty key // void Initialize() { if(!Info()) { fprintf(stderr, "WordKey::WordKey used before word_key_info set\n"); word_errr("WordKey::initialize"); } numerical_fields = new WordKeyNum[NFields()-1]; Clear(); } public: // // Copy operator (needed because of the array pointer) // void operator =(const WordKey &other) { Clear(); CopyFrom(other); } #endif /* SWIG */ //- // Copy other into object. // void CopyFrom(const WordKey &other) { if(other.IsDefined(0)) { SetWord(other.GetWord()); } for(int i=1;iWordKeyInfo(3)). // static inline const WordKeyInfo *Info() { return WordKeyInfo::Instance(); } #endif /* SWIG */ //- // Convenience functions to access the total number of fields // in a key (see WordKeyInfo(3)). // static inline int NFields() { return Info()->nfields; } //- // Convenience functions to access the // maximum possible value for field at position. // in a key (see WordKeyInfo(3)). // static inline WordKeyNum MaxValue(int position) { return Info()->sort[position].MaxValue(); } // // Accessors // //- // Returns the word as a const. // #ifndef SWIG inline const String& GetWord() const { return kword; } #endif /* SWIG */ //- // Returns the word. // inline String& GetWord() { return kword; } //- // Set the word. // inline void SetWord(const String& arg) { kword = arg; setbits |= WORD_KEY_WORDFULLY_DEFINED; } protected: //- // Set the word. // inline void SetWord(const char* arg, int arg_length) { kword.set(arg, arg_length); setbits |= WORD_KEY_WORDFULLY_DEFINED; } public: //- // Change status of the word to undefined. Also undefines // its suffix. // inline void UndefinedWord() { kword.trunc(); setbits &= ~WORD_KEY_WORDFULLY_DEFINED; } //- // Set the status of the word suffix to undefined. // inline void UndefinedWordSuffix() {setbits &= ~WORD_KEY_WORDSUFFIX_DEFINED;} //- // Set the status of the word suffix to defined. // inline void SetDefinedWordSuffix() {setbits |= WORD_KEY_WORDSUFFIX_DEFINED;} //- // Returns true if word suffix is defined, false otherwise. // inline int IsDefinedWordSuffix() const {return( (setbits & WORD_KEY_WORDSUFFIX_DEFINED) == WORD_KEY_WORDSUFFIX_DEFINED);} // // Get/Set numerical fields // //- // Return value of numerical field at position as const. // inline WordKeyNum Get(int position) const { // if(position<1 || position>=NFields()){errr("Get: out of bounds");} return(numerical_fields[position-1]); } #ifndef SWIG //- // Return value of numerical field at position. // inline WordKeyNum& Get(int position) { return(numerical_fields[position-1]); } //- // Return value of numerical field at position as const. // inline const WordKeyNum & operator[] (int position) const { return(numerical_fields[position-1]); } //- // Return value of numerical field at position. // inline WordKeyNum & operator[] (int position) { return(numerical_fields[position-1]); } #endif /* SWIG */ //- // Set value of numerical field at position to val. // inline void Set(int position, WordKeyNum val) { // if(position<1 || position>=NFields()){errr("Set: out of bounds");} SetDefined(position); numerical_fields[position-1] = val; } // // Key field value existenz. Defined means the value of the field contains // a valid value. Undefined means the value of the field is not valid. // //- // Returns true if field at position is defined, false // otherwise. // int IsDefined(int position) const { return setbits & (1 << position); } //- // Value in field position becomes defined. // void SetDefined(int position) { setbits |= (1 << position); } //- // Value in field position becomes undefined. // void Undefined(int position) { setbits &= ~(1 << position); } #ifndef SWIG // // Set and Get the whole structure from/to ASCII description //- // Set the whole structure from ASCII string in bufferin. // See ASCII FORMAT section. // Return OK if successfull, NOTOK otherwise. // int Set(const String& bufferin); int SetList(StringList& fields); //- // Convert the whole structure to an ASCII string description // in bufferout. // See ASCII FORMAT section. // Return OK if successfull, NOTOK otherwise. // int Get(String& bufferout) const; //- // Convert the whole structure to an ASCII string description // and return it. // See ASCII FORMAT section. // String Get() const; #endif /* SWIG */ // // Storage format conversion // #ifndef SWIG //- // Set structure from disk storage format as found in // string buffer or length length. // Return OK if successfull, NOTOK otherwise. // int Unpack(const char* string, int length); // //- // Set structure from disk storage format as found in // data string. // Return OK if successfull, NOTOK otherwise. // inline int Unpack(const String& data) { return(Unpack(data,data.length())); } // //- // Convert object into disk storage format as found in // and place the result in data string. // Return OK if successfull, NOTOK otherwise. // int Pack(String& data) const; #endif /* SWIG */ // // Transformations // //- // Copy each defined field from other into the object, if // the corresponding field of the object is not defined. // Return OK if successfull, NOTOK otherwise. // int Merge(const WordKey& other); //- // Undefine all fields found after the first undefined field. The // resulting key has a set of defined fields followed by undefined fields. // Returns NOTOK if the word is not defined because the resulting key would // be empty and this is considered an error. Returns OK on success. // int PrefixOnly(); #ifndef SWIG //- // Implement ++ on a key. // // It behaves like arithmetic but follows these rules: //
      // . Increment starts at field 
      // . If a field value overflows, increment field position - 1
      // . Undefined fields are ignored and their value untouched
      // . Incrementing the word field is done by appending \001
      // . When a field is incremented all fields to the left are set to 0
      // 
    // If position is not specified it is equivalent to NFields() - 1. // It returns OK if successfull, NOTOK if position out of range or // WORD_FOLLOWING_ATEND if the maximum possible value was reached. // int SetToFollowing(int position = WORD_FOLLOWING_MAX); #endif /* SWIG */ // // Predicates // //- // Return true if all the fields are defined, false otherwise. // int Filled() const { return setbits == (unsigned int) (((1 << NFields()) - 1) | WORD_KEY_WORDSUFFIX_DEFINED); } //- // Return true if no fields are defined, false otherwise. // int Empty() const { return setbits == 0; } //- // Return true if the object and other are equal. // Only fields defined in both keys are compared. // int Equal(const WordKey& other) const; //- // Return true if the object and other are equal. // All fields are compared. If a field is defined in object // and not defined in the object, the key are not considered // equal. // int ExactEqual(const WordKey& other) const {return(Equal(other) && other.setbits == setbits);} #ifndef SWIG //- // Return true if the object and other are equal. // The packed string are compared. An undefined numerical field // will be 0 and therefore undistinguishable from a defined field // whose value is 0. // int PackEqual(const WordKey& other) const; //- // Return true if adding increment in field at position makes // it overflow or underflow, false if it fits. // int Outbound(int position, int increment) { if(increment < 0) return Underflow(position, increment); else if(increment > 0) return Overflow(position, increment); else return WORD_INBOUND; } //- // Return true if adding positive increment to field at // position makes it overflow, false if it fits. // int Overflow(int position, int increment) { return MaxValue(position) - Get(position) < (WordKeyNum)increment ? WORD_OVERFLOW : WORD_INBOUND; } //- // Return true if subtracting positive increment to field // at position makes it underflow, false if it fits. // int Underflow(int position, int increment) { return Get(position) < (WordKeyNum)(-increment) ? WORD_UNDERFLOW : WORD_INBOUND; } #endif /* SWIG */ //- // Return OK if the key may be used as a prefix for search. // In other words return OK if the fields set in the key // are all contiguous, starting from the first field. // Otherwise returns NOTOK // int Prefix() const; #ifndef SWIG //- // Compare a and b in the Berkeley DB fashion. // a and b are packed keys. The semantics of the // returned int is as of strcmp and is driven by the key description // found in WordKeyInfo. // static int Compare(const String& a, const String& b); static int Compare_WordOnly(const String& a, const String& b); //- // Compare a and b in the Berkeley DB fashion. // a and b are packed keys. The semantics of the // returned int is as of strcmp and is driven by the key description // found in WordKeyInfo. // static int Compare(const char *a, int a_length, const char *b, int b_length); static int Compare_WordOnly(const char *a, int a_length, const char *b, int b_length); //- // Compare object defined fields with other key defined fields only, // ignore fields that are not defined in object or other. // Return 1 if different 0 if equal. // If different, position is set to the field number that differ, // lower is set to 1 if Get(position) is lower than // other.Get(position) otherwise lower is set to 0. // int Diff(const WordKey& other, int& position, int& lower); //- // Print object in ASCII form on f (uses Get method). // See ASCII FORMAT section. // int Write(FILE* f) const; #endif /* SWIG */ //- // Print object in ASCII form on stdout (uses Get method). // See ASCII FORMAT section. // void Print() const; #ifndef SWIG private: // // Convert a single number from and to disk storage representation // static int UnpackNumber(const unsigned char* from, const int from_size, WordKeyNum &res, const int lowbits, const int bits); static int PackNumber(WordKeyNum from, char* to, int to_size, int lowbits, int lastbits); // // Data members // // // Bit field for defined/undefined status of each key field // unsigned int setbits; // // Holds the numerical values of the key fields // WordKeyNum *numerical_fields; // // Holds the word key field // String kword; #endif /* SWIG */ }; #ifndef SWIG // // Set bit number to 0 and others to 1. may have a value from 0 to 8. If // 8 then all bits are 1. // #define WORD_BIT_MASK(b) ((b) == 0 ? 0xff : ((( 1 << (b)) - 1) & 0xff)) #define WORD_BIT_MASK2(b) ((1<<(b)) -1) // // Decode integer found in using bytes. The integer starts at bit // in the first byte and occupies a total of bits. The resulting integer is stored in * // inline int WordKey::UnpackNumber(const unsigned char* from, const int from_size, WordKeyNum& to, const int lowbits, const int bits) { to = 0; to = ((from[0] & 0xff) >> lowbits); if(lowbits) to &= WORD_BIT_MASK(8 - lowbits); if(from_size == 1) to &= WORD_BIT_MASK(bits); else { for(int i = 1; i < from_size; i++) { to |= (from[i] & 0xff) << ((i - 1) * 8 + (8 - lowbits)); } } if(bits < (int)(sizeof(WordKeyNum) * 8)) to &= ( 1 << bits ) - 1; return OK; } // // Encode integer , starting at bit in byte array . It will span // bytes and only the bits of the last byte (to[to_size - 1]) are // filled. See word_builder.pl for more information. // inline int WordKey::PackNumber(WordKeyNum from, char* to, int to_size, int lowbits, int lastbits) { // first byte if(lowbits) { to[0] |= ((from & WORD_BIT_MASK(8 - lowbits)) << lowbits) & 0xff; } else { to[0] = from & 0xff; } from >>= 8 - lowbits; // following bytes for(int i = 1; i < to_size; i++) { to[i] = from & 0xff; from >>= 8; } // clip the end off (clobbers anything left at the end of this byte) if(lastbits) to[to_size - 1] &= WORD_BIT_MASK(lastbits); return OK; } #undef WORD_BIT_MASK #endif /* SWIG */ #endif htdig-3.2.0b6/htword/WordKeyInfo.cc0100644006314600127310000001226010055635556016414 0ustar angusgbhtdig// WordKeyInfo.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include "WordKeyInfo.h" #include "StringList.h" #define WORDKEYFIELD_BITS_MAX 64 // // WordKeyField implementation // int WordKeyField::SetNum(WordKeyField *previous, char *nname, int nbits) { type = WORD_ISA_NUMBER; name.set(nname, strlen(nname)); bits = nbits; bits_offset = (previous ? previous->bits_offset + previous->bits : 0 ); if(bits_offset < 0 || bits_offset > WORDKEYFIELD_BITS_MAX*WORD_KEY_MAX_NFIELDS) { fprintf(stderr, "WordKeyField::WordKeyField: bits_offset: %d out of bounds\n", bits_offset); return EINVAL; } bytes_offset = bits_offset / 8; bytesize = ((bits_offset + bits - 1) / 8) - bytes_offset + 1; lastbits = (bits_offset + bits) % 8; lowbits = bits_offset % 8; return 0; } int WordKeyField::SetString() { name.set("Word"); type = WORD_ISA_STRING; return 0; } // // Tabulate for printing // static void nprint(char c, int n) { for(int i = 0; i < n; i++) { if(!(i % 4)) { printf("%c", 'a' + i / 4); } else { printf("%c", c); } } } // // Print object on standard output // void WordKeyField::Show() { if(!name.nocase_compare("Word")) { printf("Word type: %2d\n", type); } else { nprint(' ',bits_offset); printf("\"%s\" type:%2d lowbits:%2d lastbits:%2d\n", (char *)name, type, lowbits, lastbits); nprint(' ',bits_offset); printf("|---bytesize:%2d bytes_offset:%2d bits:%2d bits_offset:%2d\n", bytesize, bytes_offset, bits, bits_offset); } } // // WordKeyInfo implementation // WordKeyInfo* WordKeyInfo::instance = 0; WordKeyInfo::WordKeyInfo(const Configuration& config) { sort = NULL; nfields = -1; num_length = 0; const String &keydesc = config["wordlist_wordkey_description"]; if(!keydesc.empty()) { Set(keydesc); } else { fprintf(stderr, "WordKeyInfo::WordKeyInfo: didn't find key description in config\n"); } } void WordKeyInfo::Initialize(const Configuration &config_arg) { if(instance != 0) delete instance; instance = new WordKeyInfo(config_arg); } void WordKeyInfo::InitializeFromString(const String &desc) { Configuration config; config.Add("wordlist_wordkey_description", desc); Initialize(config); } int WordKeyInfo::Alloc(int nnfields) { nfields = nnfields; if(!(sort = new WordKeyField[nfields])) { fprintf(stderr, "WordKeyInfo::Alloc: cannot allocate\n"); return ENOMEM; } num_length = 0; return 0; } int WordKeyInfo::Set(const String &desc) { int ret = 0; StringList fields(desc, "/"); if(fields.Count() > WORD_KEY_MAX_NFIELDS) { fprintf(stderr, "WordKeyInfo::Set: too many fields in %s, max is %d\n", (const char*)desc, WORD_KEY_MAX_NFIELDS); return EINVAL; } if(fields.Count() <= 0) { fprintf(stderr, "WordKeyInfo::Set: no fields\n"); return EINVAL; } if((ret = Alloc(fields.Count()))) return ret; WordKeyField* previous = 0; int i; for(i = 0; i < fields.Count(); i++) { char* field = fields[i]; WordKeyField& key_field = sort[i]; if(!mystrcasecmp(field, "word")) { // // String field // if(i != 0) { fprintf(stderr, "WordKeyInfo::Set: Word field must show in first position %s\n", (const char*)desc); return EINVAL; } key_field.SetString(); } else { // // Numerical field // StringList pair(field, "\t "); if(pair.Count() != 2) { fprintf(stderr, "WordKeyInfo::AddField: there must be exactly two strings separated by a white space (space or tab) in a field description (%s in key description %s)\n", field, (const char*)desc); return EINVAL; } int bits = atoi(pair[1]); char* name = pair[0]; key_field.SetNum(previous, name, bits); previous = &key_field; } } // // Total length in bytes of the numerical fields // num_length = sort[i - 1].bytes_offset + sort[i - 1].bytesize; return ret; } void WordKeyInfo::Show() { fprintf(stderr, "-----------------------------------------\n"); fprintf(stderr, "nfields:%3d num_length:%3d\n", nfields, num_length); int i; for(i = 0; i < nfields; i++) sort[i].Show(); char str[WORDKEYFIELD_BITS_MAX*WORD_KEY_MAX_NFIELDS]; memset(str, '_', WORDKEYFIELD_BITS_MAX*WORD_KEY_MAX_NFIELDS); int last = 0; int j; for(j = 0; j < nfields; j++) { for(i = 0; i < sort[j].bits; i++) { char c = (j % 10) + '0'; int pos = sort[j].bits_offset + i; if(str[pos] != '_') { fprintf(stderr, "WordKeyInfo::Show: overlaping bits (field %d), bit %d\n", j, i); c='X'; } str[pos] = c; if(last < pos) last = pos; } } str[last + 1] = '\0'; fprintf(stderr, "%s (bits)\n",str); fprintf(stderr, "^0 ^1 ^2 ^3 ^4 ^5 ^6 ^7\n"); fprintf(stderr, "0123456701234567012345670123456701234567012345670123456701234567\n"); } htdig-3.2.0b6/htword/WordKeyInfo.h0100644006314600127310000001034610055635557016262 0ustar angusgbhtdig// WordKeyInfo.h // // NAME // information on the key structure of the inverted index. // // SYNOPSIS // // Use the WordKey::NField() method instead. // // DESCRIPTION // // Describe the structure of the index key (WordKey). // The description includes the layout of the packed version // stored on disk. // // CONFIGURATION // // wordlist_wordkey_description (no default) // Describe the structure of the inverted index key. // In the following explanation of the format // mandatory words are // in bold and values that must be replaced in italic. //
    // Word/name bits[/...] //
    // The name is an alphanumerical symbolic name for the key field. // The bits is the number of bits required to store this field. // Note that all values are stored in unsigned integers (unsigned int). // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // #ifndef _WordKeyInfo_h_ #define _WordKeyInfo_h_ #include "Configuration.h" // // Type number associated to each possible type for a key element // (type field of struct WordKeyInfo). // #define WORD_ISA_NUMBER 1 #define WORD_ISA_STRING 2 // // Maximum number of fields in a key description // #define WORD_KEY_MAX_NFIELDS 20 // // All numerical fields of the key are typed WordKeyNum. // Most of the code strongly assume that it is unsigned. // Mainly provided to be replaced by unsigned longlong WordKeyNum // for 64 bits machines. // typedef unsigned int WordKeyNum; // // Maximum number of bits in a field // #define WORD_KEY_MAXBITS ((int)(sizeof(WordKeyNum) * 8)) #define WORD_KEY_MAXVALUE ((WordKeyNum)~(WordKeyNum)0) // // Description of a single field // class WordKeyField { public: WordKeyField() { type = lowbits = lastbits = bytesize = bytes_offset = bits = bits_offset = 0; } // // Precompute information that will be needed to pack/unpack the key // to/from disk. // // The field is used to compute the position of the field // in packed string. is the symbolic name of the field // is the number of bits actualy used in a number. // int SetNum(WordKeyField *previous, char *nname, int nbits); // // Set the one and only string field // int SetString(); // // Maximum possible value for this field. // WordKeyNum MaxValue() const { return bits >= WORD_KEY_MAXBITS ? WORD_KEY_MAXVALUE : ((1 << bits) - 1); } // // Debugging and printing // void Show(); String name; // Symbolic name of the field int type; // WORD_ISA_{STRING|NUMBER} // // 01234567012345670123456701234567 // +-------+-------+-------+-------+-- // 100101010011100111101011110 // ^^^ ^^^^^^ // | | // lowbits = 3 lastbits = 6 // int lowbits; int lastbits; int bytesize; // Number of bytes involved int bytes_offset; // Offset of first byte from start int bits; // Size of field in bits int bits_offset; // Offset of first bit from start }; // // Description of the key structure // class WordKeyInfo { public: WordKeyInfo(const Configuration& config); ~WordKeyInfo() { if(sort) delete [] sort; } // // Unique instance handlers // static void Initialize(const Configuration& config); static void InitializeFromString(const String &desc); static WordKeyInfo* Instance() { if(instance) return instance; fprintf(stderr, "WordKeyInfo::Instance: no instance\n"); return 0; } int Alloc(int nnfields); int Set(const String &desc); void Show(); // // Array describing the fields, in sort order. // WordKeyField *sort; // // Total number of fields // int nfields; // // Total number of bytes used by numerical fields // int num_length; // // Unique instance pointer // static WordKeyInfo* instance; }; #endif htdig-3.2.0b6/htword/WordList.cc0100644006314600127310000002612710055635557015773 0ustar angusgbhtdig// // WordList.cc // // WordList: Interface to the word database. Previously, this wrote to // a temporary text file. Now it writes directly to the // word database. // NOTE: Some code previously attempted to directly read from // the word db. This will no longer work, so it's preferred to // use the access methods here. // Configuration parameter used: // wordlist_extend // wordlist_verbose 1 walk logic // wordlist_verbose 2 walk logic details // wordlist_verbose 3 walk logic lots of details // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordList.cc,v 1.13 2004/05/28 13:15:27 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordList.h" #include "WordReference.h" #include "WordRecord.h" #include "WordType.h" #include "WordStat.h" #include "Configuration.h" #include "htString.h" #include "HtPack.h" #include "HtTime.h" #include "WordDBCompress.h" #include #include #include #include // ***************************************************************************** // WordList::WordList(const Configuration& config_arg) : wtype(config_arg), config(config_arg) { // The database itself hasn't been opened yet isopen = 0; isread = 0; extended = config.Boolean("wordlist_extend"); verbose = config.Value("wordlist_verbose"); compressor = 0; } // ***************************************************************************** // WordList::~WordList() { Close(); } // ***************************************************************************** // int WordList::Open(const String& filename, int mode, int word_only) { int usecompress=0; // If word_only, entries compare equal if the "word" part matches. // This should only be used for querying the database, not writing it. // It is needed by speling to test for the existence of words. db.set_bt_compare(word_only ? word_only_db_cmp : word_db_cmp); if(config.Value("wordlist_page_size", 0)) db.set_pagesize(config.Value("wordlist_page_size")); if(config.Boolean("wordlist_compress") == 1) { usecompress = DB_COMPRESS; WordDBCompress* compressor = new WordDBCompress( config.Boolean("wordlist_compress_zlib",0), config.Value("compression_level",0)); // compressor->debug = config.Value("wordlist_compress_debug"); SetCompressor(compressor); db.CmprInfo(compressor->CmprInfo()); } int flags = (mode & O_RDWR) ? DB_CREATE : DB_RDONLY; if(mode & O_TRUNC) { if(flags == DB_CREATE) flags |= DB_TRUNCATE; else fprintf(stderr, "WordList::Open: O_TRUNC | O_RDONLY is meaningless\n"); } flags |= usecompress; int ret = db.Open(filename, DB_BTREE, flags, 0666) == 0 ? OK : NOTOK; isread = mode & O_RDONLY; isopen = 1; return ret; } // ***************************************************************************** // int WordList::Close() { if(isopen) { if(db.Close() != 0) return NOTOK; isopen = 0; isread = 0; } { WordDBCompress* compressor = GetCompressor(); if(compressor) { delete compressor; SetCompressor(0); } } return OK; } // **************************************************************************** // int WordList::Put(const WordReference& arg, int flags) { if (arg.Key().GetWord().length() == 0) { fprintf(stderr, "WordList::Put(%s) word is zero length\n", (char*)arg.Get()); return NOTOK; } if (!arg.Key().Filled()) { fprintf(stderr, "WordList::Put(%s) key is not fully defined\n", (char*)arg.Get()); return NOTOK; } WordReference wordRef(arg); String word = wordRef.Key().GetWord(); if(wtype.Normalize(word) & WORD_NORMALIZE_NOTOK) return NOTOK; wordRef.Key().SetWord(word); // // The two case could be grouped in a more compact way. // However, the resources consumption difference between // a Put(DB_NOOVERWRITE) and Put(0) is huge (the first is 75% // slower than the second). Check the db_put sources for the // explanation. // int ret = NOTOK; if(flags) { // // First attempt tells us if the key exists. If it // does not we just increment the reference count. // Otherwise, and only if flags does not contain DB_NOOVERWRITE, // we override the key/record pair. // int error; if((error = db.Put(wordRef, DB_NOOVERWRITE)) != 0) { if(error == DB_KEYEXIST && flags == 0) ret = db.Put(wordRef, 0) == 0 ? OK : NOTOK; } else { ret = Ref(wordRef); } } else { if((ret = db.Put(wordRef, 0)) == 0) ret = Ref(wordRef); } return ret; } // ***************************************************************************** // List *WordList::operator [] (const WordReference& wordRef) { return Collect(wordRef); } // ***************************************************************************** // List *WordList::Prefix (const WordReference& prefix) { WordReference prefix2(prefix); prefix2.Key().UndefinedWordSuffix(); return Collect(prefix2); } // ***************************************************************************** // List *WordList::WordRefs() { return Collect(WordReference()); } // ***************************************************************************** // List *WordList::Collect(const WordReference& wordRef) { WordCursor *search = Cursor(wordRef.Key(), HTDIG_WORDLIST_COLLECTOR); if(search->Walk() != OK) return 0; List* result = search->GetResults(); delete search; return result; } // ***************************************************************************** // // Callback data dedicated to Dump and dump_word communication // class DeleteWordData : public Object { public: DeleteWordData() { count = 0; } int count; }; // ***************************************************************************** // // static int delete_word(WordList *words, WordDBCursor &cursor, const WordReference *word, Object &data) { if(words->Delete(cursor) == 0) { words->Unref(*word); ((DeleteWordData&)data).count++; return OK; } else { fprintf(stderr, "WordList delete_word: deleting %s failed\n", (char*)word->Get()); return NOTOK; } } // ***************************************************************************** // // Delete all records matching wordRef, return the number of // deleted records. // int WordList::WalkDelete(const WordReference& wordRef) { DeleteWordData data; WordCursor *description = Cursor(wordRef.Key(), delete_word, &data); description->Walk(); delete description; return data.count; } // ***************************************************************************** // // List *WordList::Words() { List *list = 0; String key; String record; WordReference lastWord; WordDBCursor cursor; if(cursor.Open(db.db) != 0) return 0; // // Move past the first word count record // const WordReference& last = WordStat::Last(); last.Pack(key, record); if(cursor.Get(key, record, DB_SET_RANGE) != 0) return 0; list = new List; do { WordReference wordRef(key, record); if(lastWord.Key().GetWord().empty() || wordRef.Key().GetWord() != lastWord.Key().GetWord()) { list->Add(new String(wordRef.Key().GetWord())); lastWord = wordRef; } } while (cursor.Get(key, record, DB_NEXT) == 0); return list; } // ***************************************************************************** // // Returns the reference count for word in arg // int WordList::Noccurrence(const WordKey& key, unsigned int& noccurrence) const { noccurrence = 0; WordStat stat(key.GetWord()); int ret; if((ret = db.Get(stat)) != 0) { if(ret != DB_NOTFOUND) return NOTOK; } else { noccurrence = stat.Noccurrence(); } return OK; } // ***************************************************************************** // // Increment reference count for wordRef // int WordList::Ref(const WordReference& wordRef) { if(!extended) return OK; WordStat stat(wordRef.Key().GetWord()); int ret; if((ret = db.Get(stat)) != 0 && ret != DB_NOTFOUND) return NOTOK; stat.Noccurrence()++; return db.Put(stat, 0) == 0 ? OK : NOTOK; } // ***************************************************************************** // // Decrement reference count for wordRef // int WordList::Unref(const WordReference& wordRef) { if(!extended) return OK; WordStat stat(wordRef.Key().GetWord()); int ret; if((ret = db.Get(stat)) != 0) { if(ret == DB_NOTFOUND) fprintf(stderr, "WordList::Unref(%s) Unref on non existing word occurrence\n", (char*)wordRef.Get()); return NOTOK; } if(stat.Noccurrence() == 0) { fprintf(stderr, "WordList::Unref(%s) Unref on 0 occurrences word\n", (char*)wordRef.Get()); return NOTOK; } stat.Noccurrence()--; if(stat.Noccurrence() > 0) { ret = db.Put(stat, 0) == 0 ? OK : NOTOK; } else ret = db.Del(stat) == 0 ? OK : NOTOK; return ret; } // ***************************************************************************** // // streaming operators for ascii dumping and reading a list class FileOutData : public Object { public: FILE* f; FileOutData(FILE* f_arg) : f(f_arg) { } }; // ***************************************************************************** // static int wordlist_walk_callback_file_out(WordList *, WordDBCursor& , const WordReference *word, Object &data) { fprintf(((FileOutData&)data).f, "%s\n", (char*)word->Get()); return OK; } // ***************************************************************************** // int WordList::Write(FILE* f) { WordKey empty; FileOutData data(f); WordCursor *description = Cursor(empty, wordlist_walk_callback_file_out, (Object *)&data); description->Walk(); delete description; return 0; } // ***************************************************************************** // int WordList::Read(FILE* f) { WordReference word; #define WORD_BUFFER_SIZE 1024 char buffer[WORD_BUFFER_SIZE + 1]; String line; int line_number = 0; int inserted = 0; while(fgets(buffer, WORD_BUFFER_SIZE, f)) { line_number++; int buffer_length = strlen(buffer); int eol = buffer[buffer_length - 1] == '\n'; if(eol) buffer[--buffer_length] = '\0'; line.append(buffer, buffer_length); // // Join big lines // if(!eol) continue; // // If line ends with a \ continue // if(line.last() == '\\') { line.chop(1); continue; } if(!line.empty()) { if(word.Set(line) != OK) { fprintf(stderr, "WordList::Read: line %d : %s\n", line_number, (char*)line); fprintf(stderr, " cannot build WordReference (ignored)\n"); } else { if(Insert(word) != OK) { fprintf(stderr, "WordList::Read: line %d : %s\n", line_number, (char*)line); fprintf(stderr, " insert failed (ignored)\n"); } else { inserted++; } if(verbose) fprintf(stderr, "WordList::Read: inserting %s\n", (char*)word.Get()); } line.trunc(); } } return inserted; } htdig-3.2.0b6/htword/WordList.h0100644006314600127310000002774710055635560015640 0ustar angusgbhtdig// // WordList.h // // NAME // // manage and use an inverted index file. // // SYNOPSIS // // #include // // Configuration* config; // WordReference wordRef; // ... // WordList* words = new WordList(config) // // delete words; // // DESCRIPTION // // WordList is the mifluz equivalent of a database handler. Each // WordList object is bound to an inverted index file and implements the // operations to create it, fill it with word occurrences and search // for an entry matching a given criterion. // // CONFIGURATION // // wordlist_extend {true|false} (default false) // If true maintain reference count of unique // words. The Noccurrence method gives access to this count. // // wordlist_verbose (default 0) // Set the verbosity level of the WordList class. //
    // 1 walk logic //
    // 2 walk logic details //
    // 3 walk logic lots of details // // wordlist_page_size (default 8192) // Berkeley DB page size (see Berkeley DB documentation) // // wordlist_cache_size (default 500K) // Berkeley DB cache size (see Berkeley DB documentation) // Cache makes a huge difference in performance. It must be at least 2% // of the expected total data size. Note that if compression is activated // the data size is eight times larger than the actual file size. In this // case the cache must be scaled to 2% of the data size, not 2% // of the file size. See Cache tuning in the mifluz guide for // more hints. // // wordlist_compress {true|false} (default false) // Activate compression of the index. The resulting index is eight times // smaller than the uncompressed index. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordList.h,v 1.10 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordList_h_ #define _WordList_h_ #include #include #ifndef SWIG #include "Dictionary.h" #include "List.h" #include "htString.h" #include "WordRecord.h" #include "WordReference.h" #include "WordType.h" #include "WordDB.h" #include "WordDBCompress.h" #include "Configuration.h" #include "WordCursor.h" #endif /* SWIG */ class List; class WordList; class WordDBCursor; // // Inverted index interface // class WordList { public: //- // Constructor. Build inverted index handling object using // run time configuration parameters listed in the CONFIGURATION // section. // WordList(const Configuration& config_arg); virtual ~WordList(); //- // Insert wordRef in index. It is an error to insert // the same wordRef twice. This requires a lookup in the index // prior to the insertion. // Returns OK on success, NOTOK on error. // int Insert(const WordReference& wordRef) { return Put(wordRef, DB_NOOVERWRITE); } //- // Insert wordRef in index. If the Key() part of // the wordRef exists in the index, override it. // Returns OK on success, NOTOK on error. // int Override(const WordReference& wordRef) { return Put(wordRef, 0); } #ifndef SWIG int Put(const WordReference& wordRef, int flags); #endif /* SWIG */ //- // Returns OK if wordRef exists in the index, NOTOK otherwise. // int Exists(const WordReference& wordRef) { return db.Exists(wordRef) == 0 ? OK : NOTOK; } #ifndef SWIG //- // Returns OK if word exists in the index, NOTOK otherwise. // int Exists(const String& word) { return Exists(WordReference(word)); } #endif /* SWIG */ // // Delete permanently // //- // Delete all entries in the index whose key matches the // Key() part of wordRef, using the Walk // method. // Returns the number of entries successfully deleted. // int WalkDelete(const WordReference& wordRef); //- // Delete the entry in the index that exactly matches the // Key() part of wordRef. // Returns OK if deletion is successfull, NOTOK otherwise. // int Delete(const WordReference& wordRef) { if(db.Del(wordRef) == 0) return Unref(wordRef); else return NOTOK; } #ifdef SWIG %name(DeleteCursor) #endif /* SWIG */ //- // Delete the inverted index entry currently pointed to by the // cursor. // Returns 0 on success, Berkeley DB error code on error. This // is mainly useful when implementing a callback function for // a WordCursor. // int Delete(WordDBCursor& cursor) { return cursor.Del(); } //- // Open inverted index filename. mode // may be O_RDONLY or O_RDWR. If mode is // O_RDWR it can be or'ed with O_TRUNC to reset // the content of an existing inverted index. // If word_only is true, entries will compare equal if the "word" part // of the key is equal, even if the numeric fields aren't. (What are the // numeric fields, anyway??) // Return OK on success, NOTOK otherwise. // int Open(const String& filename, int mode, int word_only=false); //- // Close inverted index. // int Close(); // // These returns a list of all the WordReference * matching // the constraint. //- // Returns the list of word occurrences exactly matching the // Key() part of wordRef. The List returned // contains pointers to WordReference objects. It is // the responsibility of the caller to free the list. See List.h // header for usage. // List *Find(const WordReference& wordRef) { return (*this)[wordRef]; } //- // Returns the list of word occurrences exactly matching the // word. The List returned // contains pointers to WordReference objects. It is // the responsibility of the caller to free the list. See List.h // header for usage. // List *FindWord(const String& word) { return (*this)[word]; } #ifndef SWIG //- // Alias to the Find method. // List *operator [] (const WordReference& wordRef); //- // Alias to the FindWord method. // List *operator [] (const String& word) { return (*this)[WordReference(word)]; } #endif /* SWIG */ //- // Returns the list of word occurrences matching the Key() // part of wordRef. In the Key(), the string // (accessed with GetWord()) matches any string that begins // with it. The List returned contains pointers to // WordReference objects. It is the responsibility of the // caller to free the list. // List *Prefix (const WordReference& prefix); #ifndef SWIG //- // Returns the list of word occurrences matching the // word. In the Key(), the string (accessed with // GetWord()) matches any string that begins with it. The // List returned contains pointers to WordReference // objects. It is the responsibility of the caller to free the // list. // List *Prefix (const String& prefix) { return this->Prefix(WordReference(prefix)); } #endif /* SWIG */ // // Iterate over the complete database. // #ifndef SWIG //- // Returns a list of all unique words contained in the inverted // index. The List returned contains pointers to // String objects. It is the responsibility of the caller // to free the list. See List.h header for usage. // List *Words(); #endif /* SWIG */ //- // Returns a list of all entries contained in the // inverted index. The List returned contains pointers to // WordReference objects. It is the responsibility of // the caller to free the list. See List.h header for usage. // List *WordRefs(); #ifndef SWIG //- // Create a cursor that searches all the occurrences in the // inverted index and call ncallback with // ncallback_data for every match. // WordCursor *Cursor(wordlist_walk_callback_t callback, Object *callback_data) { return new WordCursor(this, callback, callback_data); } #endif /* SWIG */ //- // Create a cursor that searches all the occurrences in the // inverted index and that match nsearchKey. If // naction is set to HTDIG_WORDLIST_WALKER calls // searchKey.callback with searchKey.callback_data // for every match. If naction is set to // HTDIG_WORDLIST_COLLECT push each match in searchKey.collectRes // data member as a WordReference object. It is the responsibility // of the caller to free the searchKey.collectRes list. // WordCursor *Cursor(const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) { return new WordCursor(this, searchKey, action); } #ifndef SWIG //- // Create a cursor that searches all the occurrences in the // inverted index and that match nsearchKey and calls // ncallback with ncallback_data for every match. // WordCursor *Cursor(const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data) { return new WordCursor(this, searchKey, callback, callback_data); } #endif /* SWIG */ // // Update/get global word statistics statistics // //- // Add one to the reference count for the string contained // in the Key().GetWord() part of wordRef. // Returns OK on success, NOTOK otherwise. // int Ref(const WordReference& wordRef); //- // Substract one to the reference count for the string contained // in the Key().GetWord() part of wordRef. // Returns OK on success, NOTOK otherwise. // int Unref(const WordReference& wordRef); #ifndef SWIG //- // Return in noccurrence the number of occurrences of the // string contained in the GetWord() part of key. // Returns OK on success, NOTOK otherwise. // int Noccurrence(const WordKey& key, unsigned int& noccurrence) const; // // Accessors // // // Get the Berkeley DB object // const WordType& GetWordType() const { return wtype; } #endif /* SWIG */ //- // Return the Configuration object used to initialize // the WordList object. // const Configuration& GetConfiguration() const { return config; } #ifndef SWIG // // Input/Output // //- // Write on file descriptor f an ASCII description of the // index. Each line of the file contains a WordReference // ASCII description. // Returns 0 on success, not 0 otherwise. // int Write(FILE* f); // //- // Read WordReference ASCII descriptions from f, // returns the number of inserted WordReference or < 0 if an error // occurs. Invalid descriptions are ignored as well as empty // lines. // int Read(FILE* f); #endif /* SWIG */ // // Retrieve WordReferences from the database. // Backend of WordRefs, operator[], Prefix... // List *Collect(const WordReference& word); #ifndef SWIG // // Compressor object accessors // WordDBCompress *GetCompressor() { return compressor; } void SetCompressor(WordDBCompress* compressor_arg) { compressor = compressor_arg; } const WordType wtype; const Configuration& config; int isopen; int isread; // // If true enable extended functionalities of WordList such // as per-word statistics. Read from wordlist_extended configuration // parameter. // int extended; WordDB db; WordDBCompress *compressor; int verbose; #endif /* SWIG */ }; #endif /* _WordList_h_ */ htdig-3.2.0b6/htword/WordListMulti.cc0100644006314600127310000003447410055635560017004 0ustar angusgbhtdig// // WordListMulti.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordListMulti.cc,v 1.6 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordListMulti.h" #include "WordListOne.h" #include "myqsort.h" #include #include #include #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif class WordDBMulti : public Object { public: WordDBMulti() { words = 0; size = 0; mode = 0; } WordListOne *words; String filename; int mode; unsigned int size; }; // ***************************************************************************** // WordListMulti::WordListMulti(WordContext* ncontext) { dbs = new List; context = ncontext; // The database itself hasn't been opened yet isopen = 0; Configuration& config = context->GetConfiguration(); extended = config.Boolean("wordlist_extend"); verbose = config.Value("wordlist_verbose"); file_max = config.Value("wordlist_multi_max", 50); if(file_max < 4) file_max = 4; file_min = config.Value("wordlist_multi_min", 4); if(file_min < 2) file_min = 2; if(file_max < file_min) file_max = file_min * 2; put_max = config.Value("wordlist_multi_put_max", 1000); if(put_max < 50) put_max = 50; compressor = 0; serial = 0; } // ***************************************************************************** // WordListMulti::~WordListMulti() { Close(); } // ***************************************************************************** // int WordListMulti::Open(const String& nfilename, int mode) { filename = nfilename; char tmp[32]; struct stat stat_buf; int i; // // Open existing indexes // for(i = 0; i < file_max; i++) { String filename_one(filename); sprintf(tmp, "%08d", i); filename_one << tmp; if(stat((char*)filename_one, &stat_buf) == 0) { WordDBMulti* db = new WordDBMulti(); db->words = new WordListOne(context); db->filename = filename_one; db->mode = mode; dbs->Push(db); } else { break; } } serial = i; // // If no indexes exists and read-only, abort // if(i == 0 && (flags & DB_RDONLY)) { fprintf(stderr, "WordListMulti::Open(%s, O_RDONLY): no index found\n", (char*)filename); return NOTOK; } isopen = 1; // // If no indexes exists and read/write, create the first // if(i == 0) if(AddIndex() != OK) return NOTOK; WordDBMulti* db = (WordDBMulti*)dbs->Last(); if(db->words->Open(db->filename, mode) != OK) return NOTOK; return OK; } // ***************************************************************************** // int WordListMulti::Close() { if(isopen) { WordDBMulti* db; ListCursor cursor; for(dbs->Start_Get(cursor); (db = (WordDBMulti*)dbs->Get_Next(cursor));) { delete db->words; } dbs->Destroy(); isopen = 0; filename.trunc(); } return OK; } // **************************************************************************** // unsigned int WordListMulti::Size() const { unsigned int size = 0; if(isopen) { WordDBMulti* db; ListCursor cursor; for(dbs->Start_Get(cursor); (db = (WordDBMulti*)dbs->Get_Next(cursor));) { if(!db->words->isopen) { if(db->words->Open(db->filename, O_RDONLY) != OK) return 0; size += db->words->Size(); if(db->words->Close() != OK) return 0; } else { size += db->words->Size(); } } } return size; } int WordListMulti::AddIndex() { if(Flags() & O_RDONLY) return NOTOK; if(serial >= file_max) Merge(); char tmp[32]; String filename_one(filename); sprintf(tmp, "%08d", serial); filename_one << tmp; serial++; WordDBMulti* db = new WordDBMulti(); db->words = new WordListOne(context); db->words->extended = extended; db->filename = filename_one; dbs->Push(db); return OK; } static int merge_cmp_size(WordListMulti*, WordDBMulti* a, WordDBMulti* b) { return b->size - a->size; } static int merge_cmp_filename(WordListMulti*, WordDBMulti* a, WordDBMulti* b) { return a->filename.compare(b->filename); } int WordListMulti::Merge() { if(Flags() & DB_RDONLY) return NOTOK; Configuration& config = context->GetConfiguration(); int use_compress = config.Boolean("wordlist_compress"); WordDBMulti* db = (WordDBMulti*)dbs->Last(); if(db->words->Close() != OK) return NOTOK; // // heap lists all the files in decreasing size order (biggest first) // WordDBMulti* heap = new WordDBMulti[serial]; { int i; WordDBMulti* db; ListCursor cursor; for(i = 0, dbs->Start_Get(cursor); (db = (WordDBMulti*)dbs->Get_Next(cursor)); i++) { if(db->words->Open(db->filename, O_RDONLY) != OK) return NOTOK; db->size = db->words->Size(); if(db->words->Close() != OK) return NOTOK; heap[i] = *db; } dbs->Destroy(); myqsort((void*)heap, serial, sizeof(WordDBMulti), (myqsort_cmp)merge_cmp_size, (void*)this); } String tmpname = filename; tmpname << ".tmp"; while(serial > file_min) { WordDBMulti* a = &heap[serial - 1]; WordDBMulti* b = &heap[serial - 2]; WordListOne tmp(context); tmp.extended = 0; if(a->words->Open(a->filename, O_RDONLY) != OK) return NOTOK; if(b->words->Open(b->filename, O_RDONLY) != OK) return NOTOK; if(tmp.Open(tmpname, O_RDWR) != OK) return NOTOK; if(tmp.db->CacheP() && tmp.db->CacheOff() != 0) return OK; WordDBCursor* cursora = a->words->db->Cursor(); WordDBCursor* cursorb = b->words->db->Cursor(); if(cursora->Open() != 0) return NOTOK; String keya; String dataa; if(cursorb->Open() != 0) return NOTOK; String keyb; String datab; int reta; int retb; reta = cursora->Get(keya, dataa, DB_NEXT); retb = cursorb->Get(keyb, datab, DB_NEXT); // // Merge while there are entries in both indexes // while(reta == 0 && retb == 0) { // // If keya lower than keyb // if(WordKey::Compare(context, keya, keyb) < 0) { if(tmp.db->Put(0, keya, dataa, 0) != 0) return NOTOK; reta = cursora->Get(keya, dataa, DB_NEXT); } else { if(tmp.db->Put(0, keyb, datab, 0) != 0) return NOTOK; retb = cursorb->Get(keyb, datab, DB_NEXT); } } // // Sanity check // if((reta != 0 && reta != DB_NOTFOUND) || (retb != 0 && retb != DB_NOTFOUND)) return NOTOK; // // Flush the remaining entries from the index that is // not yet empty. // if(reta != DB_NOTFOUND || retb != DB_NOTFOUND) { String key = reta == 0 ? keya : keyb; String data = reta == 0 ? data : datab; WordDBCursor* cursor = reta == 0 ? cursora : cursorb; int ret = 0; while(ret == 0) { if(tmp.db->Put(0, key, data, 0) != 0) return NOTOK; ret = cursor->Get(key, data, DB_NEXT); } if(ret != DB_NOTFOUND) return NOTOK; } delete cursora; delete cursorb; a->words->Close(); b->words->Close(); tmp.Close(); // // Remove file a // if(unlink((char*)a->filename) != 0) { const String message = String("WordListMulti::Merge: unlink ") + a->filename; perror((const char*)message); return NOTOK; } if(use_compress) { if(unlink((char*)(a->filename + String("_weakcmpr"))) != 0) { const String message = String("WordListMulti::Merge: unlink ") + a->filename + String("_weakcmpr"); perror((const char*)message); return NOTOK; } } // // Remove file b // if(unlink((char*)b->filename) != 0) { const String message = String("WordListMulti::Merge: unlink ") + b->filename; perror((const char*)message); return NOTOK; } if(use_compress) { if(unlink((char*)(b->filename + String("_weakcmpr"))) != 0) { const String message = String("WordListMulti::Merge: unlink ") + b->filename + String("_weakcmpr"); perror((const char*)message); return NOTOK; } } // // Rename tmp file into file b // if(rename((char*)tmpname, (char*)b->filename) != 0) { const String message = String("WordListMulti::Merge: rename ") + tmpname + String(" ") + b->filename; perror((const char*)message); return NOTOK; } if(use_compress) { if(rename((char*)(tmpname + String("_weakcmpr")), (char*)(b->filename + String("_weakcmpr"))) != 0) { const String message = String("WordListMulti::Merge: rename ") + tmpname + String("_weakcmpr ") + b->filename + String("_weakcmpr"); perror((const char*)message); return NOTOK; } } // // Update b file size. The size need not be accurate number as long // as it reflects the relative size of each file. // b->size += a->size; // // The 'a' index is no longer in use // delete a->words; serial--; // // update heap // myqsort((void*)heap, serial, sizeof(WordDBMulti), (myqsort_cmp)merge_cmp_size, (void*)this); } // // Rename the indexes so that they are in increasing order // and push them in the list of active indexes. // myqsort((void*)heap, serial, sizeof(WordDBMulti), (myqsort_cmp)merge_cmp_filename, (void*)this); int i; for(i = 0; i < serial; i++) { WordDBMulti* db = new WordDBMulti(); *db = heap[i]; String newname(filename); char tmp[32]; sprintf(tmp, "%08d", i); newname << tmp; // // Rename if not equal // if(db->filename.compare(newname)) { // // Rename db index into newname // if(rename((char*)db->filename, (char*)newname) != 0) { const String message = String("WordListMulti::Merge: rename ") + db->filename + String(" ") + newname; perror((const char*)message); return NOTOK; } if(use_compress) { if(rename((char*)(db->filename + String("_weakcmpr")), (char*)(newname + String("_weakcmpr"))) != 0) { const String message = String("WordListMulti::Merge: rename ") + db->filename + String("_weakcmpr ") + newname + String("_weakcmpr"); perror((const char*)message); return NOTOK; } } db->filename = newname; } dbs->Push(db); } return OK; } // **************************************************************************** // int WordListMulti::Override(const WordReference& arg) { WordDBMulti* db = (WordDBMulti*)dbs->Last(); if(db->words->Size() > put_max) { if(db->words->Close() != OK) return NOTOK; if(AddIndex() != OK) return NOTOK; db = (WordDBMulti*)dbs->Last(); if(db->words->Open(db->filename, db->mode) != OK) return NOTOK; } return db->words->Override(arg); } // ***************************************************************************** int WordListMulti::Exists(const WordReference& ) { return 0; } // ***************************************************************************** // List *WordListMulti::operator [] (const WordReference& ) { return 0; #if 0 return Collect(wordRef); #endif } // ***************************************************************************** // List *WordListMulti::Prefix (const WordReference& ) { return 0; #if 0 WordReference prefix2(prefix); prefix2.Key().UndefinedWordSuffix(); return Collect(prefix2); #endif } // ***************************************************************************** // List *WordListMulti::WordRefs() { return 0; #if 0 return Collect(WordReference(context)); #endif } // ***************************************************************************** // List *WordListMulti::Collect(const WordReference&) { return 0; #if 0 WordCursor *search = Cursor(wordRef.Key(), HTDIG_WORDLIST_COLLECTOR); if(search->Walk() != OK) return 0; List* result = search->GetResults(); delete search; return result; #endif } // ***************************************************************************** // // Delete all records matching wordRef, return the number of // deleted records. // int WordListMulti::WalkDelete(const WordReference& ) { return 0; #if 0 DeleteWordData data; WordCursor *description = Cursor(wordRef.Key(), delete_word, &data); description->Walk(); delete description; return data.count; #endif } int WordListMulti::Delete(const WordReference& ) { return NOTOK; } // ***************************************************************************** // // List *WordListMulti::Words() { return 0; #if 0 List *list = 0; String key; String record; WordReference lastWord(context); WordDBCursor* cursor = db.Cursor(); if(!cursor) return 0; // // Move past the first word count record // const WordReference& last = WordStat::Last(context); last.Pack(key, record); if(cursor->Get(key, record, DB_SET_RANGE) != 0) return 0; list = new List; do { WordReference wordRef(context, key, record); if(lastWord.Key().GetWord().empty() || wordRef.Key().GetWord() != lastWord.Key().GetWord()) { list->Add(new String(wordRef.Key().GetWord())); lastWord = wordRef; } } while (cursor->Get(key, record, DB_NEXT) == 0); return list; #endif } // ***************************************************************************** // // Returns the reference count for word in arg // int WordListMulti::Noccurrence(const String& , unsigned int& ) const { return 0; #if 0 noccurrence = 0; WordStat stat(context, key.GetWord()); int ret; if((ret = db.Get(stat)) != 0) { if(ret != DB_NOTFOUND) return NOTOK; } else { noccurrence = stat.Noccurrence(); } return OK; #endif } // ***************************************************************************** // // Increment reference count for wordRef // int WordListMulti::Ref(const WordReference& ) { return NOTOK; } // ***************************************************************************** // // Decrement reference count for wordRef // int WordListMulti::Unref(const WordReference& ) { return NOTOK; } // ***************************************************************************** // int WordListMulti::AllRef() { if(!extended) return OK; Merge(); WordDBMulti* db; ListCursor cursor; for(dbs->Start_Get(cursor); (db = (WordDBMulti*)dbs->Get_Next(cursor));) { if(!db->words->isopen) { if(db->words->Open(db->filename, O_RDWR) != OK) return NOTOK; if(db->words->Close() != OK) return NOTOK; } } return OK; } htdig-3.2.0b6/htword/WordListMulti.h0100644006314600127310000002011710055635560016633 0ustar angusgbhtdig// // WordList.h // // NAME // // manage and use an inverted index file. // // SYNOPSIS // // #include // // Configuration* config; // WordReference wordRef; // ... // WordList* words = new WordList(config) // // delete words; // // DESCRIPTION // // WordList is the mifluz equivalent of a database handler. Each // WordList object is bound to an inverted index file and implements the // operations to create it, fill it with word occurrences and search // for an entry matching a given criterion. // // CONFIGURATION // // wordlist_extend {true|false} (default false) // If true maintain reference count of unique // words. The Noccurrence method gives access to this count. // // wordlist_verbose (default 0) // Set the verbosity level of the WordList class. //
    // 1 walk logic //
    // 2 walk logic details //
    // 3 walk logic lots of details // // wordlist_page_size (default 8192) // Berkeley DB page size (see Berkeley DB documentation) // // wordlist_cache_size (default 500K) // Berkeley DB cache size (see Berkeley DB documentation) // Cache makes a huge difference in performance. It must be at least 2% // of the expected total data size. Note that if compression is activated // the data size is eight times larger than the actual file size. In this // case the cache must be scaled to 2% of the data size, not 2% // of the file size. See Cache tuning in the mifluz guide for // more hints. // // wordlist_compress {true|false} (default false) // Activate compression of the index. The resulting index is eight times // smaller than the uncompressed index. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordListMulti.h,v 1.4 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordListMulti_h_ #define _WordListMulti_h_ #include #include #ifndef SWIG #include "WordList.h" #include "WordCursorOne.h" //#include "WordCursorMulti.h" #endif /* SWIG */ class WordContext; // // Inverted index interface // class WordListMulti : public WordList { public: //- // Constructor. Build inverted index handling object using // run time configuration parameters listed in the CONFIGURATION // section. // WordListMulti(WordContext* ncontext); virtual ~WordListMulti(); #ifndef SWIG virtual int Override(const WordReference& wordRef); #endif /* SWIG */ //- // Returns OK if wordRef exists in the index, NOTOK otherwise. // virtual int Exists(const WordReference& wordRef); // // Delete permanently // //- // Delete all entries in the index whose key matches the // Key() part of wordRef, using the Walk // method. // Returns the number of entries successfully deleted. // virtual int WalkDelete(const WordReference& wordRef); //- // Delete the entry in the index that exactly matches the // Key() part of wordRef. // Returns OK if deletion is successfull, NOTOK otherwise. // virtual int Delete(const WordReference& wordRef); //- // Open inverted index filename. mode // may be O_RDONLY or O_RDWR. If mode is // O_RDWR it can be or'ed with O_TRUNC to reset // the content of an existing inverted index. // Return OK on success, NOTOK otherwise. // virtual int Open(const String& filename, int mode); //- // Close inverted index. // Return OK on success, NOTOK otherwise. // virtual int Close(); //- // Return the size of the index in pages. // virtual unsigned int Size() const; int AddIndex(); int Merge(); //- // Alias to the Find method. // virtual List *operator [] (const WordReference& wordRef); //- // Returns the list of word occurrences matching the Key() // part of wordRef. In the Key(), the string // (accessed with GetWord()) matches any string that begins // with it. The List returned contains pointers to // WordReference objects. It is the responsibility of the // caller to free the list. // virtual List *Prefix (const WordReference& prefix); // // Iterate over the complete database. // #ifndef SWIG //- // Returns a list of all unique words contained in the inverted // index. The List returned contains pointers to // String objects. It is the responsibility of the caller // to free the list. See List.h header for usage. // virtual List *Words(); #endif /* SWIG */ //- // Returns a list of all entries contained in the // inverted index. The List returned contains pointers to // WordReference objects. It is the responsibility of // the caller to free the list. See List.h header for usage. // virtual List *WordRefs(); #ifndef SWIG //- // Create a cursor that searches all the occurrences in the // inverted index and call ncallback with // ncallback_data for every match. // virtual inline WordCursor *Cursor(wordlist_walk_callback_t callback, Object *callback_data) { return new WordCursorOne(this, callback, callback_data); } #endif /* SWIG */ //- // Create a cursor that searches all the occurrences in the // inverted index and that match nsearchKey. If // naction is set to HTDIG_WORDLIST_WALKER calls // searchKey.callback with searchKey.callback_data // for every match. If naction is set to // HTDIG_WORDLIST_COLLECT push each match in searchKey.collectRes // data member as a WordReference object. It is the responsibility // of the caller to free the searchKey.collectRes list. // virtual inline WordCursor *Cursor(const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) { return new WordCursorOne(this, searchKey, action); } #ifndef SWIG //- // Create a cursor that searches all the occurrences in the // inverted index and that match nsearchKey and calls // ncallback with ncallback_data for every match. // virtual inline WordCursor *Cursor(const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data) { return new WordCursorOne(this, searchKey, callback, callback_data); } #endif /* SWIG */ // // Update/get global word statistics statistics // //- // Add one to the reference count for the string contained // in the Key().GetWord() part of wordRef. // Returns OK on success, NOTOK otherwise. // virtual int Ref(const WordReference& wordRef); //- // Substract one to the reference count for the string contained // in the Key().GetWord() part of wordRef. // Returns OK on success, NOTOK otherwise. // virtual int Unref(const WordReference& wordRef); virtual int AllRef(); #ifndef SWIG //- // Return in noccurrence the number of occurrences of the // string contained in the GetWord() part of key. // Returns OK on success, NOTOK otherwise. // virtual int Noccurrence(const String& key, unsigned int& noccurrence) const; virtual int Write(FILE* f) { return NOTOK; } virtual int Read(FILE* f) { return NOTOK; } virtual WordKey Key(const String& bufferin) { abort(); return WordKey(0); } virtual WordReference Word(const String& bufferin, int exists = 0) { abort(); return WordReference(0); } #endif /* SWIG */ // // Retrieve WordReferences from the database. // Backend of WordRefs, operator[], Prefix... // virtual List *Collect(const WordReference& word); #ifndef SWIG List* dbs; int serial; int file_max; int file_min; unsigned int put_max; #endif /* SWIG */ }; #endif /* _WordListMulti_h_ */ htdig-3.2.0b6/htword/WordListOne.cc0100644006314600127310000003044410055635560016424 0ustar angusgbhtdig// // WordListOne.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordListOne.cc,v 1.6 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordListOne.h" #include "WordReference.h" #include "WordRecord.h" #include "WordType.h" #include "WordContext.h" #include "Configuration.h" #include "htString.h" #include "HtTime.h" #include "WordDBCompress.h" #include "WordDBCache.h" #include "WordDead.h" #include "WordMeta.h" #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include #include // ***************************************************************************** // WordListOne::WordListOne(WordContext* ncontext) { context = ncontext; db = new WordDB(ncontext->GetDBInfo()); dict = new WordDict(); dict->Initialize(this); meta = new WordMeta(); meta->Initialize(this); dead = new WordDead(); dead->Initialize(this); // The database itself hasn't been opened yet isopen = 0; Configuration& config = context->GetConfiguration(); extended = config.Boolean("wordlist_extend"); verbose = config.Value("wordlist_verbose"); compressor = 0; caches = 0; flags = 0; } // ***************************************************************************** // WordListOne::~WordListOne() { BatchEnd(); Close(); delete dead; delete meta; delete dict; delete db; } static int word_db_qcmp(WordContext* context, const WordDBCacheEntry *a, const WordDBCacheEntry *b) { return WordKey::Compare(context, (const unsigned char*)a->key, a->key_size, (const unsigned char*)b->key, b->key_size); } // ***************************************************************************** // int WordListOne::Open(const String& nfilename, int mode) { filename = nfilename; int usecompress = 0; Configuration& config = context->GetConfiguration(); if(config.Boolean("wordlist_compress") == 1) { usecompress = DB_COMPRESS; WordDBCompress* compressor = new WordDBCompress(context); // compressor->debug = config.Value("wordlist_compress_debug"); SetCompressor(compressor); context->GetDBInfo().dbenv->mp_cmpr_info = compressor->CmprInfo(); context->GetDBInfo().dbenv->flags |= DB_ENV_CMPR; } flags = (mode & O_RDWR) ? DB_CREATE : DB_RDONLY; flags |= usecompress; if(mode & O_TRUNC) { if(mode & O_RDWR) { unlink((char*)filename); } else fprintf(stderr, "WordListOne::Open: O_TRUNC | O_RDONLY is meaningless\n"); } WordLock* lock; Meta()->Lock("open", lock); db->set_bt_compare(word_db_cmp, (void*)context); if(config.Boolean("wordlist_cache_inserts", 0)) { int size = config.Value("wordlist_cache_size", 0); if(size / 2 < WORD_DB_CACHE_MINIMUM) size = 0; else size /= 2; db->CacheOn(context, size); db->CacheCompare(word_db_qcmp); } db->set_pagesize(Pagesize()); int ret = db->Open(filename, "index", DB_BTREE, flags, 0666, WORD_DB_INDEX) == 0 ? OK : NOTOK; if(ret == NOTOK) return ret; if(dict->Open() != OK) return NOTOK; if(meta->Open() != OK) return NOTOK; if(dead->Open() != OK) return NOTOK; isopen = 1; Meta()->Unlock("open", lock); return ret; } // ***************************************************************************** // int WordListOne::Close() { if(isopen) { if(db->Close() != 0) return NOTOK; if(dict->Close() != 0) return NOTOK; if(meta->Close() != 0) return NOTOK; if(dead->Close() != 0) return NOTOK; isopen = 0; } { WordDBCompress* compressor = GetCompressor(); if(compressor) { delete compressor; SetCompressor(0); } delete context->GetDBInfo().dbenv->mp_cmpr_info; context->GetDBInfo().dbenv->mp_cmpr_info = 0; context->GetDBInfo().dbenv->flags &= ~DB_ENV_CMPR; } return OK; } // **************************************************************************** // unsigned int WordListOne::Size() const { return db->Size(); } // **************************************************************************** // int WordListOne::Override(const WordReference& arg) { if (arg.GetWord().length() == 0) { fprintf(stderr, "WordListOne::Override(%s) word is zero length\n", (char*)arg.Get()); return NOTOK; } if (!arg.Key().Filled()) { fprintf(stderr, "WordListOne::Override(%s) key is not fully defined\n", (char*)arg.Get()); return NOTOK; } WordType& wtype = context->GetType(); WordReference wordRef(arg); String word = wordRef.GetWord(); if(wtype.Normalize(word) & WORD_NORMALIZE_NOTOK) return NOTOK; wordRef.SetWord(word); unsigned int wordid = 0; if(dict->SerialRef(word, wordid) != OK) return NOTOK; wordRef.Key().Set(WORD_KEY_WORD, wordid); int ret = NOTOK; if(caches) { String key; String record; if(wordRef.Pack(key, record) != OK) return NOTOK; ret = caches->Add(key.get(), key.length(), record.get(), record.length()) == 0 ? OK : NOTOK; if(caches->Full()) caches->Merge(*db); } else { ret = db->Put(wordRef, 0) == 0 ? OK : NOTOK; } return ret; } // ***************************************************************************** // List *WordListOne::operator [] (const WordReference& wordRef) { return Collect(wordRef); } // ***************************************************************************** // List *WordListOne::Prefix (const WordReference& prefix) { List* result = new List(); WordDictCursor* cursor = Dict()->CursorPrefix(prefix.GetWord()); String word; WordDictRecord record; WordReference prefix2(prefix); while(Dict()->NextPrefix(cursor, word, record) == 0) { prefix2.Key().Set(WORD_KEY_WORD, record.Id()); List* tmp_result = Collect(prefix2); while(tmp_result->Count() > 0) { WordReference* entry = (WordReference*)tmp_result->Shift(LIST_REMOVE_RELEASE); entry->SetWord(word); result->Push(entry); } delete tmp_result; } return result; } // ***************************************************************************** // List *WordListOne::WordRefs() { return Collect(WordReference(context)); } // ***************************************************************************** // List *WordListOne::Collect(const WordReference& wordRef) { WordCursor *search = Cursor(wordRef.Key(), HTDIG_WORDLIST_COLLECTOR); if(search->Walk() != OK) return 0; List* result = search->GetResults(); delete search; return result; } // ***************************************************************************** // int WordListOne::Read(FILE* f) { WordReference wordRef(context); #define WORD_BUFFER_SIZE 1024 char buffer[WORD_BUFFER_SIZE + 1]; String line; int line_number = 0; int inserted = 0; BatchStart(); String key; String record; while(fgets(buffer, WORD_BUFFER_SIZE, f)) { line_number++; int buffer_length = strlen(buffer); int eol = buffer[buffer_length - 1] == '\n'; if(eol) buffer[--buffer_length] = '\0'; line.append(buffer, buffer_length); // // Join big lines // if(!eol) continue; // // If line ends with a \ continue // if(line.last() == '\\') { line.chop(1); continue; } if(!line.empty()) { StringList fields(line, "\t "); // // Convert the word to a wordid // String* word = (String*)fields.Get_First(); unsigned int wordid; if(dict->SerialRef(*word, wordid) != OK) return NOTOK; word->trunc(); (*word) << wordid; if(wordRef.SetList(fields) != OK) { fprintf(stderr, "WordList::Read: line %d : %s\n", line_number, (char*)line); fprintf(stderr, " cannot build WordReference (ignored)\n"); } else { if(wordRef.Pack(key, record) != OK) { fprintf(stderr, "WordList::Read: line %d : %s\n", line_number, (char*)line); fprintf(stderr, " pack failed (ignored)\n"); } else { caches->Add(key.get(), key.length(), record.get(), record.length()); inserted++; } if(verbose && (inserted % 10000 == 0)) fprintf(stderr, "WordList::Read: inserted %d entries\n", inserted); if(verbose > 1) fprintf(stderr, "WordList::Read: inserting %s\n", (char*)wordRef.Get()); } line.trunc(); } } BatchEnd(); return inserted; } // ***************************************************************************** // // streaming operators for ascii dumping and reading a list class FileOutData : public Object { public: FILE* f; String word; FileOutData(FILE* f_arg) : f(f_arg) { } }; // ***************************************************************************** // static int wordlist_walk_callback_file_out(WordList *, WordDBCursor& , const WordReference *wordRef, Object &ndata) { FileOutData& data = (FileOutData&)ndata; ((WordReference*)wordRef)->SetWord(data.word); fprintf(data.f, "%s\n", (char*)wordRef->Get()); return OK; } int WordListOne::Write(FILE* f) { FileOutData data(f); WordDictCursor* cursor = dict->Cursor(); int ret; String word; WordDictRecord wordinfo; while((ret = dict->Next(cursor, word, wordinfo)) == 0) { WordKey key(context); key.Set(WORD_KEY_WORD, wordinfo.Id()); data.word = word; WordCursor *search = Cursor(key, wordlist_walk_callback_file_out, (Object *)&data); search->Walk(); delete search; } return ret == DB_NOTFOUND ? OK : NOTOK; } // ***************************************************************************** // // Callback data dedicated to Dump and dump_word communication // class DeleteWordData : public Object { public: DeleteWordData() { count = 0; } int count; }; // ***************************************************************************** // // static int delete_word(WordList *words, WordDBCursor &cursor, const WordReference *word, Object &data) { WordListOne *words_one = (WordListOne*)words; if(words_one->DeleteCursor(cursor) == 0) { ((DeleteWordData&)data).count++; return OK; } else { fprintf(stderr, "WordList delete_word: deleting %s failed\n", (char*)word->Get()); return NOTOK; } } // ***************************************************************************** // // Delete all records matching wordRef, return the number of // deleted records. // int WordListOne::WalkDelete(const WordReference& wordRef) { DeleteWordData data; WordKey key = wordRef.Key(); if(key.IsDefined(WORD_KEY_WORD)) { WordCursor *description = Cursor(key, delete_word, &data); description->Walk(); delete description; dict->Decr(wordRef.GetWord(), data.count); } else { WordDictCursor* cursor = dict->Cursor(); int ret; String word; WordDictRecord wordinfo; int total = 0; while((ret = dict->Next(cursor, word, wordinfo)) == 0) { key.Set(WORD_KEY_WORD, wordinfo.Id()); WordCursor *search = Cursor(key, delete_word, &data); search->Walk(); delete search; dict->Decr(word, data.count); total += data.count; data.count = 0; } data.count = total; } return data.count; } // ***************************************************************************** // // Returns the reference count for word in arg // int WordListOne::Noccurrence(const String& word, unsigned int& noccurrence) const { return dict->Noccurrence(word, noccurrence); } WordKey WordListOne::Key(const String& bufferin) { WordKey key(context); StringList fields(bufferin, "\t "); String* field = (String*)fields.Get_First(); unsigned int wordid; Dict()->Serial(*field, wordid); field->trunc(); (*field) << wordid; key.SetList(fields); return key; } WordReference WordListOne::Word(const String& bufferin, int exists /* = 1 */) { WordReference wordRef(context); StringList fields(bufferin, "\t "); String* field = (String*)fields.Get_First(); if(context->GetType().Normalize(*field) & WORD_NORMALIZE_NOTOK) { fprintf(stderr, "WordListOne::Word: cannot normalize word\n"); } String word = *field; unsigned int wordid; if(exists) Dict()->SerialExists(word, wordid); else Dict()->Serial(word, wordid); field->trunc(); (*field) << wordid; wordRef.SetList(fields); wordRef.SetWord(word); return wordRef; } void WordListOne::BatchEnd() { if(caches) { caches->Merge(*db); WordList::BatchEnd(); } } htdig-3.2.0b6/htword/WordListOne.h0100644006314600127310000001064310055635560016265 0ustar angusgbhtdig// // WordListOne.h // // NAME // // manage and use an inverted index file. // // SYNOPSIS // // #include // // WordContext context; // // WordList* words = context->List(); // WordList* words = WordListOne(&context); // // DESCRIPTION // // WordList is the mifluz equivalent of a database handler. Each // WordList object is bound to an inverted index file and implements the // operations to create it, fill it with word occurrences and search // for an entry matching a given criterion. // // The general behavious of WordListOne is described in the WordList // manual page. It is prefered to create a WordListOne instance by // setting the wordlist_multi configuration parameter to false // and calling the WordContext::List method. // // Only the methods that differ from WordList are listed here. // All the methods of WordList are implemented by WordListOne and // you should refer to the manual page for more information. // // The Cursor methods all return a WordCursorOne instance // cast to a WordCursor object. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordListOne.h,v 1.4 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordListOne_h_ #define _WordListOne_h_ #include #include #include "WordList.h" #include "WordCursorOne.h" #include "WordDict.h" #include "WordMeta.h" #include "WordDead.h" class WordContext; // // Inverted index interface // class WordListOne : public WordList { public: //- // Constructor. Build inverted index handling object using // run time configuration parameters listed in the CONFIGURATION // section of the WordList manual page. // WordListOne(WordContext* ncontext); virtual ~WordListOne(); virtual int Override(const WordReference& wordRef); virtual inline int Exists(const WordReference& wordRef) { return (!Dead()->Exists(wordRef.Key()) && db->Exists(wordRef) == 0) ? OK : NOTOK; } virtual int WalkDelete(const WordReference& wordRef); virtual inline int Delete(const WordReference& wordRef) { if(db->Del(wordRef) == 0) return dict->Unref(wordRef.GetWord()); else return NOTOK; } //- // Delete the inverted index entry currently pointed to by the // cursor. // Returns 0 on success, Berkeley DB error code on error. This // is mainly useful when implementing a callback function for // a WordCursor. // int DeleteCursor(WordDBCursor& cursor) { return cursor.Del(); } virtual int Open(const String& filename, int mode); virtual int Close(); virtual unsigned int Size() const; virtual int Pagesize() const { Configuration& config = context->GetConfiguration(); return config.Value("wordlist_page_size", 0); } virtual inline WordDict *Dict() { return dict; } virtual inline WordMeta *Meta() { return meta; } virtual inline WordDead *Dead() { return dead; } virtual List *operator [] (const WordReference& wordRef); virtual List *Prefix (const WordReference& prefix); virtual List *Words() { return dict->Words(); } virtual List *WordRefs(); virtual inline WordCursor *Cursor(wordlist_walk_callback_t callback, Object *callback_data) { return new WordCursorOne(this, callback, callback_data); } virtual inline WordCursor *Cursor(const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) { return new WordCursorOne(this, searchKey, action); } virtual inline WordCursor *Cursor(const WordKey &searchKey, wordlist_walk_callback_t callback, Object * callback_data) { return new WordCursorOne(this, searchKey, callback, callback_data); } virtual WordKey Key(const String& bufferin); virtual WordReference Word(const String& bufferin, int exists = 0); virtual void BatchEnd(); virtual int Noccurrence(const String& key, unsigned int& noccurrence) const; virtual int Write(FILE* f); virtual inline int WriteDict(FILE* f) { return dict->Write(f); } virtual int Read(FILE* f); virtual List *Collect(const WordReference& word); WordDB *db; WordDict *dict; WordMeta *meta; WordDead *dead; }; #endif /* _WordListOne_h_ */ htdig-3.2.0b6/htword/WordMeta.cc0100644006314600127310000000751610055635560015741 0ustar angusgbhtdig// // WordMeta.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordMeta.cc,v 1.4 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include extern "C" { #include "db_int.h" #include "db_page.h" #include "db_shash.h" #include "lock.h" #include "mp.h" } #include "WordMeta.h" #include "WordListOne.h" #define WORD_META_SERIAL_SIZE (WORD_META_SERIAL_FILE + 1) class WordLock { public: WordLock() { lock.off = LOCK_INVALID; } DB_LOCK lock; }; // // Total size of structure must *NOT* be over 256 bytes. // typedef struct _WordMetaInfo { DBMETA meta; unsigned int serials[WORD_META_SERIAL_SIZE]; } WordMetaInfo; class WordMetaImp { public: WordMetaImp() { mpf = 0; pgno = PGNO_INVALID; info = 0; } DB_MPOOLFILE *mpf; db_pgno_t pgno; WordMetaInfo *info; }; WordMeta::~WordMeta() { delete imp; delete db; } int WordMeta::Initialize(WordList* nwords) { words = nwords; db = new WordDB(nwords->GetContext()->GetDBInfo()); imp = new WordMetaImp(); return OK; } int WordMeta::Open() { const String& filename = words->Filename(); int flags = words->Flags(); db->set_pagesize(words->Pagesize()); if(db->Open(filename, "meta", DB_BTREE, flags, 0666, WORD_DB_DICT) != 0) return NOTOK; imp->mpf = db->db->mpf; int ret; String kpgno("pgno"); if((ret = db->Get(0, kpgno, imp->pgno, 0)) != 0 && ret != DB_NOTFOUND) return NOTOK; /* * First time thru, create the meta page and initialize it. */ if(ret == DB_NOTFOUND) { if(CDB_memp_fget(imp->mpf, &imp->pgno, DB_MPOOL_NEW, (void**)&imp->info) != 0) return NOTOK; memset((char*)imp->info, '\0', sizeof(WordMetaInfo)); imp->info->meta.type = P_INVALID; imp->info->meta.pgno = imp->pgno; if(CDB_memp_fput(imp->mpf, (void*)imp->info, DB_MPOOL_DIRTY) != 0) return NOTOK; if(db->Put(0, kpgno, imp->pgno, 0) != 0) return NOTOK; } return OK; } int WordMeta::Close() { return db->Close() == 0 ? OK : NOTOK; } int WordMeta::Serial(int what, unsigned int& serial) { serial = WORD_META_SERIAL_INVALID; if(CDB_memp_fget(imp->mpf, &imp->pgno, 0, (void**)&imp->info) != 0) return NOTOK; serial = ++imp->info->serials[what]; if(CDB_memp_fput(imp->mpf, (void*)imp->info, DB_MPOOL_DIRTY) != 0) return NOTOK; return OK; } int WordMeta::GetSerial(int what, unsigned int& serial) { serial = WORD_META_SERIAL_INVALID; if(CDB_memp_fget(imp->mpf, &imp->pgno, 0, (void**)&imp->info) != 0) return NOTOK; serial = imp->info->serials[what]; if(CDB_memp_fput(imp->mpf, (void*)imp->info, 0) != 0) return NOTOK; return OK; } int WordMeta::SetSerial(int what, unsigned int serial) { if(CDB_memp_fget(imp->mpf, &imp->pgno, 0, (void**)&imp->info) != 0) return NOTOK; imp->info->serials[what] = serial; if(CDB_memp_fput(imp->mpf, (void*)imp->info, DB_MPOOL_DIRTY) != 0) return NOTOK; return OK; } int WordMeta::Lock(const String& resource, WordLock*& lock) { lock = new WordLock; DB_ENV* dbenv = words->GetContext()->GetDBInfo().dbenv; u_int32_t id; if(CDB_lock_id(dbenv, &id) != 0) { delete lock; lock = 0; return NOTOK; } DBT obj; obj.size = resource.length(); obj.data = (void*)resource.get(); if(CDB_lock_get(dbenv, id, 0, &obj, DB_LOCK_WRITE, &lock->lock) != 0) { delete lock; lock = 0; return NOTOK; } return OK; } int WordMeta::Unlock(const String& resource, WordLock*& lock) { DB_ENV* dbenv = words->GetContext()->GetDBInfo().dbenv; int ret = CDB_lock_put(dbenv, &lock->lock); delete lock; lock = 0; return ret == 0 ? OK : NOTOK; } htdig-3.2.0b6/htword/WordMeta.h0100644006314600127310000000373210055635560015577 0ustar angusgbhtdig// // WordMeta.h // // NAME // // abstract class to manage and use an inverted index file. // // SYNOPSIS // // #include // // WordContext context; // // WordMeta* words = context->Meta(); // // delete words; // // DESCRIPTION // // WordMeta is the mifluz equivalent of a database handler. Each // WordMeta object is bound to an inverted index file and implements the // operations to create it, fill it with word occurrences and search // for an entry matching a given criterion. // // WordMeta is an abstract class and cannot be instanciated. // The Meta method of the class WordContext will create // an instance using the appropriate derived class, either WordMetaOne // or WordMetaMulti. Refer to the corresponding manual pages for // more information on their specific semantic. // // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordMeta.h,v 1.4 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordMeta_h_ #define _WordMeta_h_ #include #include "htString.h" #include "WordDB.h" class WordContext; class WordLock; class WordMetaImp; // // Serial number range [1-2^32] // #define WORD_META_SERIAL_INVALID 0 #define WORD_META_SERIAL_WORD 0 #define WORD_META_SERIAL_FILE 1 class WordMeta { public: WordMeta() { words = 0; db = 0; imp = 0; } ~WordMeta(); int Initialize(WordList* words); int Open(); int Close(); int Serial(int what, unsigned int& serial); int GetSerial(int what, unsigned int& serial); int SetSerial(int what, unsigned int serial); int Lock(const String& resource, WordLock*& lock); int Unlock(const String& resource, WordLock*& lock); private: WordList *words; WordDB *db; WordMetaImp *imp; }; #endif /* _WordMeta_h_ */ htdig-3.2.0b6/htword/WordMonitor.cc0100644006314600127310000001500210055635560016467 0ustar angusgbhtdig// // WordMonitor.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordMonitor.cc,v 1.7 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #ifndef _MSC_VER /* _WIN32 */ #include #endif #include "StringList.h" #include "WordMonitor.h" #define WORD_MONITOR_RRD 1 #define WORD_MONITOR_READABLE 2 WordMonitor* WordMonitor::instance = 0; char* WordMonitor::values_names[WORD_MONITOR_VALUES_SIZE] = { "", "C.Write", "C.Read", "C.Compress 1/1", "C.Compress 1/2", "C.Compress 1/3", "C.Compress 1/4", "C.Compress 1/5", "C.Compress 1/6", "C.Compress 1/7", "C.Compress 1/8", "C.Compress 1/9", "C.Compress 1/10", "C.Compress 1/>10", "C.P_IBTREE", "C.P_LBTREE", "C.P_UNKNOWN", "C.Put", "C.Get (0)", "C.Get (NEXT)", "C.Get (SET_RANGE)", "C.Get (Other)", "G.LEVEL", "G.PGNO", "C.CMP", 0 }; WordMonitor::WordMonitor(const Configuration &config) { memset((char*)values, '\0', sizeof(unsigned int) * WORD_MONITOR_VALUES_SIZE); memset((char*)old_values, '\0', sizeof(unsigned int) * WORD_MONITOR_VALUES_SIZE); started = elapsed = time(0); output_style = WORD_MONITOR_READABLE; if((period = config.Value("wordlist_monitor_period"))) { const String& desc = config.Find("wordlist_monitor_output"); StringList fields(desc, ','); if(fields.Count() > 0) { char* filename = fields[0]; if(filename[0] == '\0') output = stderr; else { output = fopen(filename, "a"); if(!output) { fprintf(stderr, "WordMonitor::WordMonitor: cannot open %s for writing ", filename); perror(""); output = stderr; return; } } if(fields.Count() > 1) { char* style = fields[1]; if(!mystrcasecmp(style, "rrd")) output_style = WORD_MONITOR_RRD; else output_style = WORD_MONITOR_READABLE; } } TimerStart(); } } WordMonitor::~WordMonitor() { TimerStop(); if(output != stderr) fclose(output); } void WordMonitor::Initialize(const Configuration &config_arg) { if(instance != 0) delete instance; instance = new WordMonitor(config_arg); } const String WordMonitor::Report() const { String output; int i; time_t now = time(0); if(output_style == WORD_MONITOR_RRD) output << (int)now << ":"; for(i = 0; i < WORD_MONITOR_VALUES_SIZE; i++) { if(!values_names[i]) break; if(values_names[i][0]) { if(output_style == WORD_MONITOR_READABLE) { output << values_names[i] << ": " << values[i]; if((now - elapsed) > 0) { output << ", per sec : " << (int)(values[i] / (now - started)); output << ", delta : " << (values[i] - old_values[i]); output << ", per sec : " << (int)((values[i] - old_values[i]) / (now - elapsed)); } output << "|"; } else if(output_style == WORD_MONITOR_RRD) { output << values[i] << ":"; } } } memcpy((char*)old_values, (char*)values, sizeof(unsigned int) * WORD_MONITOR_VALUES_SIZE); return output; } static void handler_alarm(int signal) { WordMonitor* monitor = WordMonitor::Instance(); if(!monitor) { fprintf(stderr, "WordMonitor::handler_alarm: no instance\n"); return; } monitor->TimerClick(signal); } void WordMonitor::TimerStart() { if(period < 5) { fprintf(stderr, "WordMonitor::TimerStart: wordlist_monitor_period must be > 5 (currently %d) otherwise monitoring is not accurate\n", period); return; } #ifndef _MSC_VER /* _WIN32 */ struct sigaction action; struct sigaction old_action; memset((char*)&action, '\0', sizeof(struct sigaction)); memset((char*)&old_action, '\0', sizeof(struct sigaction)); action.sa_handler = handler_alarm; if(sigaction(SIGALRM, &action, &old_action) != 0) { fprintf(stderr, "WordMonitor::TimerStart: installing SIGALRM "); perror(""); } if(old_action.sa_handler != SIG_DFL) { fprintf(stderr, "WordMonitor::TimerStart: found an installed action while installing SIGALRM, restoring old action\n"); if(sigaction(SIGALRM, &old_action, NULL) != 0) { fprintf(stderr, "WordMonitor::TimerStart: installing old SIGALRM "); perror(""); } return; } #endif fprintf(output, "----------------- WordMonitor starting -------------------\n"); if(output_style == WORD_MONITOR_RRD) { fprintf(output, "Started:%ld\n", started); fprintf(output, "Period:%d\n", period); fprintf(output, "Time:"); int i; for(i = 0; i < WORD_MONITOR_VALUES_SIZE; i++) { if(!values_names[i]) break; if(values_names[i][0]) fprintf(output, "%s:", values_names[i]); } fprintf(output, "\n"); } fflush(output); TimerClick(0); } void WordMonitor::TimerClick(int signal) { if(signal) { // // Do not report if less than since last report. // if(time(0) - elapsed >= period) { fprintf(output, "%s\n", (const char*)Report()); elapsed = time(0); fflush(output); } } #ifndef _MSC_VER /* _WIN32 */ alarm(period); #endif } void WordMonitor::TimerStop() { if(period > 0) { #ifndef _MSC_VER /* _WIN32 */ alarm(0); struct sigaction action; memset((char*)&action, '\0', sizeof(struct sigaction)); action.sa_handler = SIG_DFL; if(sigaction(SIGALRM, &action, NULL) != 0) { fprintf(stderr, "WordMonitor::TimerStart: resetting SIGALRM to SIG_DFL "); perror(""); } // Make sure last report is at least one second older than the previous one. // if(time(0) - elapsed < 1) sleep(2); fprintf(output, "%s\n", (const char*)Report()); fprintf(output, "----------------- WordMonitor finished -------------------\n"); #endif } } // // C interface to WordMonitor instance // extern "C" { void word_monitor_click() { WordMonitor* monitor = WordMonitor::Instance(); #ifndef _MSC_VER /* _WIN32 */ if(monitor) monitor->TimerClick(SIGALRM); #endif } void word_monitor_add(int index, unsigned int value) { WordMonitor* monitor = WordMonitor::Instance(); if(monitor) monitor->Add(index, value); } void word_monitor_set(int index, unsigned int value) { WordMonitor* monitor = WordMonitor::Instance(); if(monitor) monitor->Set(index, value); } unsigned int word_monitor_get(int index) { WordMonitor* monitor = WordMonitor::Instance(); if(monitor) return monitor->Get(index); else return 0; } } htdig-3.2.0b6/htword/WordMonitor.h0100644006314600127310000000730210055635560016335 0ustar angusgbhtdig// // WordMonitor.h // // NAME // monitoring classes activity. // // SYNOPSIS // // Only called thru WordContext::Initialize() // // DESCRIPTION // // The test directory contains a benchmark-report script used to generate // and archive graphs from the output of WordMonitor. // // CONFIGURATION // // wordlist_monitor_period (default 0) // If the value sec is a positive integer, set a timer to // print reports every sec seconds. The timer is set using // the ALRM signal and will fail if the calling application already // has a handler on that signal. // // wordlist_monitor_output [,{rrd,readable] (default stderr) // Print reports on file instead of the default stderr. // If type is set to rrd the output is fit for the // benchmark-report
    script. Otherwise it a (hardly :-) readable // string. // // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordMonitor.h,v 1.5 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordMonitor_h_ #define _WordMonitor_h_ #include #if TIME_WITH_SYS_TIME #include #include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #define WORD_MONITOR_WRITE 1 #define WORD_MONITOR_READ 2 #define WORD_MONITOR_COMPRESS_01 3 #define WORD_MONITOR_COMPRESS_02 4 #define WORD_MONITOR_COMPRESS_03 5 #define WORD_MONITOR_COMPRESS_04 6 #define WORD_MONITOR_COMPRESS_05 7 #define WORD_MONITOR_COMPRESS_06 8 #define WORD_MONITOR_COMPRESS_07 9 #define WORD_MONITOR_COMPRESS_08 10 #define WORD_MONITOR_COMPRESS_09 11 #define WORD_MONITOR_COMPRESS_10 12 #define WORD_MONITOR_COMPRESS_MORE 13 #define WORD_MONITOR_PAGE_IBTREE 14 #define WORD_MONITOR_PAGE_LBTREE 15 #define WORD_MONITOR_PAGE_UNKNOWN 16 #define WORD_MONITOR_PUT 17 #define WORD_MONITOR_GET 18 #define WORD_MONITOR_GET_NEXT 19 #define WORD_MONITOR_GET_SET_RANGE 20 #define WORD_MONITOR_GET_OTHER 21 #define WORD_MONITOR_LEVEL 22 #define WORD_MONITOR_PGNO 23 #define WORD_MONITOR_CMP 24 #define WORD_MONITOR_VALUES_SIZE 50 #ifdef __cplusplus extern "C" { #endif void word_monitor_click(); void word_monitor_add(int index, unsigned int value); void word_monitor_set(int index, unsigned int value); unsigned int word_monitor_get(int index); #ifdef __cplusplus } #endif #ifdef __cplusplus #include "Configuration.h" #include "htString.h" class WordMonitor { public: WordMonitor(const Configuration &config); ~WordMonitor(); // // Unique instance handlers // static void Initialize(const Configuration& config); static WordMonitor* Instance() { return instance; } void Add(int index, unsigned int value) { values[index] += value; } void Set(int index, unsigned int value) { values[index] = value; } unsigned int Get(int index) { return values[index]; } const String Report() const; void TimerStart(); void TimerClick(int signal); void TimerStop(); private: unsigned int values[WORD_MONITOR_VALUES_SIZE]; unsigned int old_values[WORD_MONITOR_VALUES_SIZE]; time_t started; time_t elapsed; int period; FILE* output; int output_style; static char* values_names[WORD_MONITOR_VALUES_SIZE]; // // Unique instance pointer // static WordMonitor* instance; }; #endif /* __cplusplus */ #endif /* _WordMonitor_h_ */ htdig-3.2.0b6/htword/WordRecord.cc0100644006314600127310000000467310055635560016272 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // // WordRecord.cc // // WordRecord: data portion of the inverted index database // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include "WordRecord.h" // // WordRecord implementation // // // Convert the whole structure to an ascii string description // int WordRecord::Get(String& buffer) const { buffer.trunc(); switch(type) { case WORD_RECORD_DATA: buffer << info.data; break; case WORD_RECORD_STATS: buffer << info.stats.noccurrence << "\t"; buffer << info.stats.ndoc; break; case WORD_RECORD_NONE: break; default: fprintf(stderr, "WordRecord::Get: unknown type %d\n", type); return NOTOK; break; } return OK; } String WordRecord::Get() const { String tmp; Get(tmp); return tmp; } // // Set a record from an ascii representation // int WordRecord::Set(const String& buffer) { StringList fields(buffer, "\t "); return SetList(fields); } int WordRecord::SetList(StringList& fields) { int i = 0; switch(type) { case WORD_RECORD_DATA: { String* field = (String*)fields.Get_First(); if(field == 0) { fprintf(stderr, "WordRecord::Set: failed to retrieve field %d\n", i); return NOTOK; } info.data = (unsigned int)atoi(field->get()); fields.Remove(field); i++; } break; case WORD_RECORD_STATS: { String* field = (String*)fields.Get_First(); if(field == 0) { fprintf(stderr, "WordRecord::Set: failed to retrieve field %d\n", i); return NOTOK; } info.stats.noccurrence = (unsigned int)atoi(field->get()); fields.Remove(field); i++; field = (String*)fields.Get_First(); if(field == 0) { fprintf(stderr, "WordRecord::Set: failed to retrieve field %d\n", i); return NOTOK; } info.stats.ndoc = (unsigned int)atoi(field->get()); fields.Remove(field); i++; } break; case WORD_RECORD_NONE: break; default: fprintf(stderr, "WordRecord::Set: unknown type %d\n", type); break; } return OK; } int WordRecord::Write(FILE* f) const { String tmp; Get(tmp); fprintf(f, "%s", (char*)tmp); return 0; } void WordRecord::Print() const { Write(stderr); } htdig-3.2.0b6/htword/WordRecord.h0100644006314600127310000001117410055635560016126 0ustar angusgbhtdig// // WordRecord.h // // NAME // inverted index record. // // SYNOPSIS // // #include // // WordRecord record(); // if(record.DefaultType() == WORD_RECORD_DATA) { // record.info.data = ... // } // // DESCRIPTION // // The record can only contain one integer, if the default record // type (see CONFIGURATION in WordKeyInfo) is set to DATA. // If the default type is set to NONE the record does not contain // any usable information. // // ASCII FORMAT // // If default type is DATA it is the decimal representation of // an integer. If default type is NONE it is the empty string. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordRecord.h,v 1.10 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordRecord_h_ #define _WordRecord_h_ #ifndef SWIG #include "HtPack.h" #include "StringList.h" #include "Configuration.h" #include "WordRecordInfo.h" #endif /* SWIG */ /* And this is how we will compress this structure, for disk storage. See HtPack.h (If there's a portable method by which this format string does not have to be specified at all, it should be preferred. For now, at least it is kept here, together with the actual struct declaration.) Since none of the values are non-zero, we want to use unsigned chars and unsigned short ints when possible. */ #ifndef SWIG #define WORD_RECORD_DATA_FORMAT "u" #define WORD_RECORD_STATS_FORMAT "u2" #endif /* SWIG */ // // Statistical information on a word // class WordRecordStat { public: unsigned int noccurrence; unsigned int ndoc; }; // // The data members of WordRecord. Should really be a union but // is quite difficult to handle properly for scripting language // interfaces. // class WordRecordStorage { public: // // Arbitrary data // unsigned int data; // // Statistical data used by WordStat // WordRecordStat stats; }; // // Describe the data associated with a key (WordKey) // // If type is: // WORD_RECORD_DATA info.data is valid // WORD_RECORD_STATS info.stats is valid // WORD_RECORD_NONE nothing valid // class WordRecord { public: WordRecord() { Clear(); } void Clear() { memset((char*)&info, '\0', sizeof(info)); type = DefaultType(); } #ifndef SWIG // // Convenience functions to access key structure information (see WordKeyInfo.h) // static inline const WordRecordInfo* Info() { return WordRecordInfo::Instance(); } #endif /* SWIG */ static inline int DefaultType() { return Info()->default_type; } #ifndef SWIG int Pack(String& packed) const { switch(type) { case WORD_RECORD_DATA: packed = htPack(WORD_RECORD_DATA_FORMAT, (char *)&info.data); break; case WORD_RECORD_STATS: packed = htPack(WORD_RECORD_STATS_FORMAT, (char *)&info.stats); break; case WORD_RECORD_NONE: packed.trunc(); break; default: fprintf(stderr, "WordRecord::Pack: unknown type %d\n", type); return NOTOK; break; } return OK; } int Unpack(const String& packed) { String decompressed; switch(type) { case WORD_RECORD_DATA: decompressed = htUnpack(WORD_RECORD_DATA_FORMAT, packed); if(decompressed.length() != sizeof(info.data)) { fprintf(stderr, "WordRecord::Unpack: decoding mismatch\n"); return NOTOK; } memcpy((char*)&info.data, (char*)decompressed, sizeof(info.data)); break; case WORD_RECORD_STATS: decompressed = htUnpack(WORD_RECORD_STATS_FORMAT, packed); if(decompressed.length() != sizeof(info.stats)) { fprintf(stderr, "WordRecord::Unpack: decoding mismatch\n"); return NOTOK; } memcpy((char*)&info.stats, (char*)decompressed, sizeof(info.stats)); break; case WORD_RECORD_NONE: break; default: fprintf(stderr, "WordRecord::Pack: unknown type %d\n", (int)type); return NOTOK; break; } return OK; } #endif /* SWIG */ #ifndef SWIG // // Set the whole structure from ASCII string description // int Set(const String& bufferin); int SetList(StringList& fields); // // Convert the whole structure to an ASCII string description // int Get(String& bufferout) const; String Get() const; #endif /* SWIG */ #ifndef SWIG // // Print object in ASCII form on FILE (uses Get) // int Write(FILE* f) const; #endif /* SWIG */ void Print() const; unsigned char type; WordRecordStorage info; }; #endif /* _WordRecord_h_ */ htdig-3.2.0b6/htword/WordRecordInfo.cc0100644006314600127310000000237010055635560017076 0ustar angusgbhtdig// // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // // WordRecordInfo.cc // // WordRecord: data portion of the inverted index database // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "Configuration.h" #include "WordRecordInfo.h" WordRecordInfo* WordRecordInfo::instance = 0; // // WordRecordInfo implementation // void WordRecordInfo::Initialize(const Configuration &config) { if(instance != 0) delete instance; instance = new WordRecordInfo(config); } WordRecordInfo::WordRecordInfo(const Configuration& config) { default_type = WORD_RECORD_INVALID; const String &recorddesc = config["wordlist_wordrecord_description"]; if(!recorddesc.nocase_compare("data")) { default_type = WORD_RECORD_DATA; } else if(!recorddesc.nocase_compare("none") || recorddesc.empty()) { default_type = WORD_RECORD_NONE; } else { fprintf(stderr, "WordRecordInfo::WordRecordInfo: invalid wordlist_wordrecord_description: %s\n", (const char*)recorddesc); } } htdig-3.2.0b6/htword/WordRecordInfo.h0100644006314600127310000000373510055635560016746 0ustar angusgbhtdig// // WordRecord.h // // NAME // information on the record structure of the inverted index. // // SYNOPSIS // // Only called thru WordContext::Initialize() // // DESCRIPTION // // The structure of a record is very limited. It can contain // at most two integer (int) values. // // CONFIGURATION // // wordlist_wordrecord_description {NONE|DATA} (no default) // NONE: the record is empty //
    // DATA: the record contains two integers (int) // // // END // // WordRecord: Record for storing word information in the word database // Each word occurrence is stored as a separate key/record pair. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordRecordInfo.h,v 1.4 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordRecordInfo_h_ #define _WordRecordInfo_h_ // // Possible values of the type data field // #define WORD_RECORD_INVALID 0 #define WORD_RECORD_DATA 1 #define WORD_RECORD_STATS 2 #define WORD_RECORD_NONE 3 #ifndef SWIG // // Meta information about WordRecord // // wordlist_wordrecord_description: DATA // use WordRecordStorage::data for each word occurent // wordlist_wordrecord_description: NONE // or // wordlist_wordrecord_description not specified // the data associated with each word occurrence is empty // class WordRecordInfo { public: WordRecordInfo(const Configuration& config); // // Unique instance handlers // static void Initialize(const Configuration& config); static WordRecordInfo* Instance() { if(instance) return instance; fprintf(stderr, "WordRecordInfo::Instance: no instance\n"); return 0; } int default_type; // // Unique instance pointer // static WordRecordInfo* instance; }; #endif /* SWIG */ #endif /* _WordRecordInfo_h_ */ htdig-3.2.0b6/htword/WordReference.cc0100644006314600127310000000302210055635560016735 0ustar angusgbhtdig// // WordReference.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordReference.cc,v 1.8 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordReference.h" int WordReference::Merge(const WordReference& other) { int ret = key.Merge(other.Key()); record = other.record; return ret; } // // Set the structure from an ascii representation // int WordReference::Set(const String& buffer) { StringList fields(buffer, "\t "); return SetList(fields); } // // Set the structure from list of fields // int WordReference::SetList(StringList& fields) { Clear(); if(key.SetList(fields) != OK || record.SetList(fields) != OK) return NOTOK; else return OK; } // // Convert the whole structure to an ascii string description // int WordReference::Get(String& buffer) const { String tmp; buffer.trunc(); if(key.Get(tmp) != OK) return NOTOK; buffer.append(tmp); if(record.Get(tmp) != OK) return NOTOK; buffer.append(tmp); return OK; } String WordReference::Get() const { String tmp; key.Get(tmp); return tmp; } int WordReference::Write(FILE* f) const { String tmp; key.Get(tmp); fprintf(f, "%s", (char*)tmp); return 0; } void WordReference::Print() const { Write(stderr); } htdig-3.2.0b6/htword/WordReference.h0100644006314600127310000001513510055635560016607 0ustar angusgbhtdig// // WordReference.h // // NAME // inverted index occurrence. // // SYNOPSIS // // #include // // WordReference wordRef("word"); // WordReference wordRef(); // WordReference wordRef(WordKey("key 1 2"), WordRecord()); // // WordKey& key = wordRef.Key(); // WordKey& record = wordRef.Record(); // // wordRef.Clear(); // // DESCRIPTION // // A WordReference object is an agregate of a WordKey object // and a WordRecord object. // // ASCII FORMAT // // The ASCII description is a string with fields separated by tabs or // white space. It is made of the ASCII description of a // WordKey object immediately followed by the ASCII // description of a WordRecord object. See the corresponding // manual pages for more information. // // END // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordReference.h,v 1.7 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordReference_h_ #define _WordReference_h_ #ifndef SWIG #include "htString.h" #include "WordRecord.h" #include "WordKey.h" #endif /* SWIG */ // // Describe the WordKey/WordRecord pair // class WordReference : public Object { public: // // Construction/Destruction //- // Constructor. Build an object with empty key and empty record. // WordReference() {} #ifndef SWIG //- // Constructor. Build an object from disk representation of key // and record. // WordReference(const String& key0, const String& record0) { Unpack(key0, record0); } //- // Constructor. Build an object with key word set to word // and otherwise empty and empty record. // WordReference(const String& word) { Clear(); key.SetWord(word); } #endif /* SWIG */ ~WordReference() {} //- // Reset to empty key and record // void Clear() { key.Clear(); record.Clear(); } // // Accessors //- // Return the key object. // WordKey& Key() { return key; } #ifndef SWIG //- // Return the key object as const. // const WordKey& Key() const { return key; } #endif /* SWIG */ //- // Return the record object. // WordRecord& Record() { return record; } #ifndef SWIG //- // Return the record object as const. // const WordRecord& Record() const { return record; } #endif /* SWIG */ // // Conversion // #ifdef SWIG %name(SetKey) #endif /* SWIG */ //- // Copy arg in the key part of the object. // void Key(const WordKey& arg) { key = arg; } #ifndef SWIG //- // Set key structure from disk storage format as found in // packed string. // Return OK if successfull, NOTOK otherwise. // int KeyUnpack(const String& packed) { return key.Unpack(packed); } // //- // Convert key object into disk storage format as found in // return the resulting string. // String KeyPack() const { String tmp; key.Pack(tmp); return tmp; } //- // Convert key object into disk storage format as found in // and place the result in packed string. // Return OK if successfull, NOTOK otherwise. // int KeyPack(String& packed) const { return key.Pack(packed); } #endif /* SWIG */ #ifdef SWIG %name(SetRecord) #endif /* SWIG */ //- // Copy arg in the record part of the object. // void Record(const WordRecord& arg) { record = arg; } #ifndef SWIG //- // Set record structure from disk storage format as found in // packed string. // Return OK if successfull, NOTOK otherwise. // int RecordUnpack(const String& packed) { return record.Unpack(packed); } //- // Convert record object into disk storage format as found in // return the resulting string. // String RecordPack() const { String tmp; record.Pack(tmp); return tmp; } //- // Convert record object into disk storage format as found in // and place the result in packed string. // Return OK if successfull, NOTOK otherwise. // int RecordPack(String& packed) const { return record.Pack(packed); } //- // Short hand for KeyPack(ckey) RecordPack(crecord). // inline int Pack(String& ckey, String& crecord) const { if(key.Pack(ckey) == NOTOK) return NOTOK; if(record.Pack(crecord) == NOTOK) return NOTOK; return OK; } //- // Short hand for KeyUnpack(ckey) RecordUnpack(crecord). // int Unpack(const String& ckey, const String& crecord) { if(key.Unpack(ckey) == NOTOK) return NOTOK; if(record.Unpack(crecord) == NOTOK) return NOTOK; return OK; } #endif /* SWIG */ // // Transformations // //- // Merge key with other.Key() using the WordKey::Merge method: // key.Merge(other.Key()). // See the corresponding manual page for details. Copy other.record // into the record part of the object. // int Merge(const WordReference& other); #ifndef SWIG //- // Copy master before merging with master.Merge(slave) // and return the copy. Prevents alteration of master. // static WordReference Merge(const WordReference& master, const WordReference& slave) { WordReference tmp(master); tmp.Merge(slave); return tmp; } #endif /* SWIG */ #ifndef SWIG int compare(Object *to) { String word(((WordReference *) to)->key.GetWord()); return key.GetWord().nocase_compare(word); } #endif /* SWIG */ #ifndef SWIG // // Set the whole structure from ASCII string description // //- // Set the whole structure from ASCII string in bufferin. // See ASCII FORMAT section. // Return OK if successfull, NOTOK otherwise. // int Set(const String& bufferin); int SetList(StringList& fields); //- // Convert the whole structure to an ASCII string description // in bufferout. // See ASCII FORMAT section. // Return OK if successfull, NOTOK otherwise. // int Get(String& bufferout) const; //- // Convert the whole structure to an ASCII string description // and return it. // See ASCII FORMAT section. // String Get() const; #endif /* SWIG */ // // Debuging // #ifndef SWIG //- // Print object in ASCII form on f (uses Get method). // See ASCII FORMAT section. // int Write(FILE* f) const; #endif /* SWIG */ //- // Print object in ASCII form on stdout (uses Get method). // See ASCII FORMAT section. // void Print() const; protected: #ifndef SWIG WordKey key; WordRecord record; #endif /* SWIG */ }; #endif /* _WordReference_h */ htdig-3.2.0b6/htword/WordStat.cc0100644006314600127310000000077510055635560015766 0ustar angusgbhtdig// // WordStat.cc // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordStat.cc,v 1.5 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "WordStat.h" WordReference* WordStat::word_stat_last = 0; htdig-3.2.0b6/htword/WordStat.h0100644006314600127310000000263510055635560015625 0ustar angusgbhtdig// // WordStat.h // // WordStat: Kind of record that holds statistics about each distinct word // in the database. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordStat.h,v 1.5 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordStat_h_ #define _WordStat_h_ #include "WordReference.h" class WordStat : public WordReference { public: // // Construction/Destruction // WordStat() { record.type = WORD_RECORD_STATS; } WordStat(const String& key_arg, const String& record_arg) : WordReference(key_arg, record_arg) { record.type = WORD_RECORD_STATS; } WordStat(const String& word) { Clear(); key.SetWord(String("\001") + word); record.type = WORD_RECORD_STATS; } ~WordStat() {} // // Accessors // unsigned int Noccurrence() const { return record.info.stats.noccurrence; } unsigned int &Noccurrence() { return record.info.stats.noccurrence; } // // Return upper boundary key of reference count records // static inline const WordReference& Last() { if(!word_stat_last) word_stat_last = new WordReference("\002"); return *word_stat_last; } protected: static WordReference* word_stat_last; }; #endif htdig-3.2.0b6/htword/WordType.cc0100644006314600127310000001272210055635560015767 0ustar angusgbhtdig// // WordType.cc // // WordType: Wrap some attributes to make is...() type // functions and other common functions without having to manage // the attributes or the exact attribute combination semantics. // Configuration parameter used: // valid_punctuation,extra_word_characters,minimum_word_length, // maximum_word_length,allow_numbers,bad_word_list // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordType.cc,v 1.9 2004/05/28 13:15:28 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include "WordType.h" WordType* WordType::instance = 0; void WordType::Initialize(const Configuration &config_arg) { if(instance != 0) delete instance; instance = new WordType(config_arg); } WordType::WordType(const Configuration &config) { const String valid_punct = config["valid_punctuation"]; const String extra_word_chars = config["extra_word_characters"]; minimum_length = config.Value("minimum_word_length", 3); maximum_length = config.Value("maximum_word_length", 12); allow_numbers = config.Boolean("allow_numbers", 0); extra_word_characters = extra_word_chars; valid_punctuation = valid_punct; other_chars_in_word = extra_word_chars; other_chars_in_word.append(valid_punct); chrtypes[0] = 0; for (int i = 1; i < 256; i++) { chrtypes[i] = 0; if (isalpha(i)) chrtypes[i] |= WORD_TYPE_ALPHA; if (isdigit(i)) chrtypes[i] |= WORD_TYPE_DIGIT; if (iscntrl(i)) chrtypes[i] |= WORD_TYPE_CONTROL; if (strchr(extra_word_chars, i)) chrtypes[i] |= WORD_TYPE_EXTRA; if (strchr(valid_punct, i)) chrtypes[i] |= WORD_TYPE_VALIDPUNCT; } { const String filename = config["bad_word_list"]; FILE *fl = fopen(filename, "r"); char buffer[1000]; char *word; String new_word; // Read in the badwords file (it's just a text file) while (fl && fgets(buffer, sizeof(buffer), fl)) { word = strtok(buffer, "\r\n \t"); if (word && *word) { int flags; new_word = word; if((flags = Normalize(new_word)) & WORD_NORMALIZE_NOTOK) { fprintf(stderr, "WordType::WordType: reading bad words from %s found %s, ignored because %s\n", (const char*)filename, word, (char*)NormalizeStatus(flags & WORD_NORMALIZE_NOTOK)); } else { badwords.Add(new_word, 0); } } } if (fl) fclose(fl); } } WordType::~WordType() { } // // Normalize a word according to configuration specifications and // builting transformations. // *EVERY* word inserted in the inverted index goes thru this. If // a word is rejected by Normalize there is 0% chance to find it // in the word database. // int WordType::Normalize(String& word) const { int status = WORD_NORMALIZE_GOOD; // // Reject empty strings, always // if(word.empty()) return status | WORD_NORMALIZE_NULL; // // Always convert to lowercase // if(word.lowercase()) status |= WORD_NORMALIZE_CAPITAL; // // Remove punctuation characters according to configuration // if(StripPunctuation(word)) status |= WORD_NORMALIZE_PUNCTUATION; // // Truncate words too long according to configuration // if(word.length() > maximum_length) { word.chop(word.length() - maximum_length); status |= WORD_NORMALIZE_TOOLONG; } // // Reject words too short according to configuration // if(word.length() < minimum_length) return status | WORD_NORMALIZE_TOOSHORT; // // Reject if contains control characters // int alpha = 0; for(const unsigned char *p = (const unsigned char*)(const char*)(char *)word; *p; p++) { if(IsStrictChar(*p) && (allow_numbers || !IsDigit(*p))) { alpha = 1; } else if(IsControl(*p)) { return status | WORD_NORMALIZE_CONTROL; } } // // Reject if contains no alpha characters (according to configuration) // if(!alpha) return status | WORD_NORMALIZE_NOALPHA; // // Reject if listed in config[bad_word_list] // if(badwords.Exists(word)) return status | WORD_NORMALIZE_BAD; // // Accept and report the transformations that occured // return status; } // // Convert the integer status into a readable string // String WordType::NormalizeStatus(int flags) { String tmp; if(flags & WORD_NORMALIZE_TOOLONG) tmp << "TOOLONG "; if(flags & WORD_NORMALIZE_TOOSHORT) tmp << "TOOSHORT "; if(flags & WORD_NORMALIZE_CAPITAL) tmp << "CAPITAL "; if(flags & WORD_NORMALIZE_NUMBER) tmp << "NUMBER "; if(flags & WORD_NORMALIZE_CONTROL) tmp << "CONTROL "; if(flags & WORD_NORMALIZE_BAD) tmp << "BAD "; if(flags & WORD_NORMALIZE_NULL) tmp << "NULL "; if(flags & WORD_NORMALIZE_PUNCTUATION) tmp << "PUNCTUATION "; if(flags & WORD_NORMALIZE_NOALPHA) tmp << "NOALPHA "; if(tmp.empty()) tmp << "GOOD"; return tmp; } // // Non-destructive tokenizer using external int as pointer into String // does word separation by our rules (so it can be subclassed too) // String WordType::WordToken(const String tokens, int ¤t) const { unsigned char text = tokens[current]; String ret; while (text && !IsStrictChar(text)) text = tokens[++current]; if (text) { while (text && IsChar(text)) { ret << text; text = tokens[++current]; } } return ret; } htdig-3.2.0b6/htword/WordType.h0100644006314600127310000000775510055635560015643 0ustar angusgbhtdig// // WordType.h // // WordType: Wrap some attributes to make is...() type // functions and other common functions without having to manage // the attributes or the exact attribute combination semantics. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: WordType.h,v 1.5 2004/05/28 13:15:28 lha Exp $ // #ifndef _WordType_h #define _WordType_h #include "htString.h" #include "Configuration.h" // // Return values of Normalize, to get them in string form use NormalizeStatus // #define WORD_NORMALIZE_GOOD 0x0000 #define WORD_NORMALIZE_TOOLONG 0x0001 #define WORD_NORMALIZE_TOOSHORT 0x0002 #define WORD_NORMALIZE_CAPITAL 0x0004 #define WORD_NORMALIZE_NUMBER 0x0008 #define WORD_NORMALIZE_CONTROL 0x0010 #define WORD_NORMALIZE_BAD 0x0020 #define WORD_NORMALIZE_NULL 0x0040 #define WORD_NORMALIZE_PUNCTUATION 0x0080 #define WORD_NORMALIZE_NOALPHA 0x0100 // // Under these conditions the word is said to be invalid. // Some conditions (NUMBER,TOOSHORT and BAD) depends on the configuration // parameters. // #define WORD_NORMALIZE_NOTOK (WORD_NORMALIZE_TOOSHORT| \ WORD_NORMALIZE_NUMBER| \ WORD_NORMALIZE_CONTROL| \ WORD_NORMALIZE_BAD| \ WORD_NORMALIZE_NULL| \ WORD_NORMALIZE_NOALPHA) class WordType { public: // // Constructors // WordType(const Configuration& config); // // Destructor // virtual ~WordType(); // // Unique instance handlers // static void Initialize(const Configuration& config); static WordType* Instance() { if(instance) return instance; fprintf(stderr, "WordType::Instance: no instance\n"); return 0; } // // Predicates // virtual int IsChar(int c) const; virtual int IsStrictChar(int c) const; virtual int IsDigit(int c) const; virtual int IsControl(int c) const; // // Transformations // virtual int StripPunctuation(String &s) const; virtual int Normalize(String &s) const; // // Splitting // virtual String WordToken(const String s, int &pointer) const; // // Error handling // static String NormalizeStatus(int flags); private: String valid_punctuation; // The same as the attribute. String extra_word_characters; // Likewise. String other_chars_in_word; // Attribute "valid_punctuation" plus // "extra_word_characters". char chrtypes[256]; // quick lookup table for types int minimum_length; // Minimum word length int maximum_length; // Maximum word length int allow_numbers; // True if a word may contain numbers Dictionary badwords; // List of excluded words // // Unique instance pointer // static WordType* instance; }; // Bits to set in chrtypes[]: #define WORD_TYPE_ALPHA 0x01 #define WORD_TYPE_DIGIT 0x02 #define WORD_TYPE_EXTRA 0x04 #define WORD_TYPE_VALIDPUNCT 0x08 #define WORD_TYPE_CONTROL 0x10 // One for characters that when put together are a word // (including punctuation). inline int WordType::IsChar(int c) const { return (chrtypes[(unsigned char)c] & (WORD_TYPE_ALPHA|WORD_TYPE_DIGIT|WORD_TYPE_EXTRA|WORD_TYPE_VALIDPUNCT)) != 0; } // Similar, but no punctuation characters. inline int WordType::IsStrictChar(int c) const { return (chrtypes[(unsigned char)c] & (WORD_TYPE_ALPHA|WORD_TYPE_DIGIT|WORD_TYPE_EXTRA)) != 0; } // Reimplementation of isdigit() using the lookup table chrtypes[] inline int WordType::IsDigit(int c) const { return (chrtypes[(unsigned char)c] & WORD_TYPE_DIGIT) != 0; } // Similar to IsDigit, but for iscntrl() inline int WordType::IsControl(int c) const { return (chrtypes[(unsigned char)c] & WORD_TYPE_CONTROL) != 0; } // Let caller get rid of getting and holding a configuration parameter. inline int WordType::StripPunctuation(String &s) const { return s.remove(valid_punctuation); } #endif /* __WordType_h */ htdig-3.2.0b6/htword/word.desc0100644006314600127310000000022407053425044015506 0ustar angusgbhtdig# # Structure of a key # nfields 4 #NAME SIZE SORTPOSITION Location 16 3 Flags 8 2 DocID 32 1 Word 0 0 htdig-3.2.0b6/include/0040755006314600127310000000000010063260370014006 5ustar angusgbhtdightdig-3.2.0b6/include/.cvsignore0100644006314600127310000000003406772705364016023 0ustar angusgbhtdigMakefile stamp-h htconfig.h htdig-3.2.0b6/include/Makefile.am0100644006314600127310000000015507723254655016062 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config EXTRA_DIST = config.h.in stamp-h.in pkginclude_HEADERS = htconfig.h htdig-3.2.0b6/include/Makefile.in0100644006314600127310000002774210063260372016066 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la EXTRA_DIST = config.h.in stamp-h.in pkginclude_HEADERS = htconfig.h subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = depcomp = am__depfiles_maybe = DIST_SOURCES = HEADERS = $(pkginclude_HEADERS) DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.config Makefile.am config.h.in all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f"; \ $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \ rm -f $(DESTDIR)$(pkgincludedir)/$$f; \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(HEADERS) config.h installdirs: $(mkinstalldirs) $(DESTDIR)$(pkgincludedir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool ctags distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am info \ info-am install install-am install-data install-data-am \ install-exec install-exec-am install-info install-info-am \ install-man install-pkgincludeHEADERS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am uninstall-pkgincludeHEADERS # 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: htdig-3.2.0b6/include/config.h.in0100644006314600127310000002540110024270231016022 0ustar angusgbhtdig/* include/config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define this to the type of the second argument of select() */ #undef FD_SET_T /* Define this to the type of the third argument of getpeername() */ #undef GETPEERNAME_LENGTH_T /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have the header file. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Broken regexp */ #undef HAVE_BROKEN_REGEX /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* 'big-file' environment */ #undef HAVE_FILE_OFFSET_BITS /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* large file sources */ #undef HAVE_LARGEFILE_SOURCE /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* 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_MALLOC_H /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #undef HAVE_MBRTOWC /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* 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 `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* define if the compiler implements namespaces */ #undef HAVE_NAMESPACES /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `pstat_getdynamic' function. */ #undef HAVE_PSTAT_GETDYNAMIC /* Define to 1 if you have the `raise' function. */ #undef HAVE_RAISE /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the `re_comp' function. */ #undef HAVE_RE_COMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define if SSL is enabled */ #undef HAVE_SSL_H /* define if the compiler supports ISO C++ standard library */ #undef HAVE_STD /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* 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 `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* 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 `strptime' function. */ #undef HAVE_STRPTIME /* Define if the function strptime is declared in */ #undef HAVE_STRPTIME_DECL /* 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 `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* 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_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `timegm' function. */ #undef HAVE_TIMEGM /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define if Zlib is enabled */ #undef HAVE_ZLIB_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to the syslog facility for htsearch logging */ #undef LOG_FACILITY /* Define to the syslog level for htsearch logging */ #undef LOG_LEVEL /* Define if you need a prototype for gethostname() */ #undef NEED_PROTO_GETHOSTNAME /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* The size of a `unsigned char', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_CHAR /* The size of a `unsigned int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_INT /* The size of a `unsigned long int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_INT /* The size of a `unsigned long long int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_LONG_INT /* The size of a `unsigned short int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_SHORT_INT /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Use posix regexp */ #undef USE_RX /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `long' if does not define. */ #undef off_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned' if does not define. */ #undef size_t htdig-3.2.0b6/include/htconfig.h0100644006314600127310000000110007722023176015756 0ustar angusgbhtdig/* Part of the ht://Dig package Copyright (c) 1999, 2000 The ht://Dig Group For copyright details, see the file COPYING in your distribution or the GNU General Public License version 2 or later */ #include #if HAVE_STDBOOL_H # include #else # if ! HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else typedef unsigned char _Bool; # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif htdig-3.2.0b6/include/htconfig.h.win320100644006314600127310000001360410000513631016712 0ustar angusgbhtdig/* include/htconfig.h. */ /* Win32 MSVC Native Header File*/ /* Part of the ht://Dig package Copyright (c) 1999, 2000 The ht://Dig Group For copyright details, see the file COPYING in your distribution or the GNU General Public License version 2 or later */ /* Defined in case the compiler doesn't have TRUE and FALSE constants */ #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* Define to the syslog level for htsearch logging. */ #define LOG_LEVEL LOG_INFO /* Define to the syslog facility for htsearch logging. */ #define LOG_FACILITY LOG_LOCAL5 /* Define this if you're willing to allow htsearch to take -c even as a CGI */ /* regardless of the security problems with this. */ /* #undef ALLOW_INSECURE_CGI_CONFIG */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ /* #define TIME_WITH_SYS_TIME 1 */ /* Define if your declares struct tm. */ /* #undef TM_IN_SYS_TIME */ /* Define if lex declares yytext as a char * by default, not a char[]. */ #define YYTEXT_POINTER 1 /* Define this to the type of the third argument of getpeername() */ #define GETPEERNAME_LENGTH_T int /* Define if building big-file environment (e.g., Solaris, HP/UX). */ /* #undef HAVE_FILE_OFFSET_BITS */ /* Define if building big-file environment (Linux). */ /* #undef HAVE_LARGEFILE_SOURCE */ /* Define this to the type of the second argument of select() */ #define FD_SET_T fd_set /* Define if you have the bool type */ #define HAVE_BOOL 1 #ifndef HAVE_BOOL typedef char bool; #endif /* Define if you C++ compiler doesn't know true and false */ #define HAVE_TRUE 1 #define HAVE_FALSE 1 #ifndef HAVE_TRUE #define true TRUE #endif #ifndef HAVE_FALSE #define false FALSE #endif /* Define if you need a prototype for gethostname() */ /* #undef NEED_PROTO_GETHOSTNAME */ /* Define if the function strptime is declared in */ /* #undef HAVE_STRPTIME_DECL */ /* Define if the included regex doesn't work */ /* #define HAVE_BROKEN_REGEX 1 */ /* The number of bytes in a unsigned char. */ #define SIZEOF_UNSIGNED_CHAR 1 /* The number of bytes in a unsigned int. */ #define SIZEOF_UNSIGNED_INT 4 /* The number of bytes in a unsigned long int. */ #define SIZEOF_UNSIGNED_LONG_INT 4 /* The number of bytes in a unsigned long long int. */ #define SIZEOF_UNSIGNED_LONG_LONG_INT 8 /* The number of bytes in a unsigned short int. */ #define SIZEOF_UNSIGNED_SHORT_INT 2 /* Define if you have the getcwd function. */ #define HAVE_GETCWD 1 /* Define if you have the localtime_r function. */ /* #undef HAVE_LOCALTIME_R */ /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the mkstemp function. */ /* #define HAVE_MKSTEMP 1 */ /* Define if you have the raise function. */ #define HAVE_RAISE 1 /* Define if you have the snprintf function. */ /* #define HAVE_SNPRINTF 1 */ /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strptime function. */ /* #undef HAVE_STRPTIME */ /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 /* Define if you have the timegm function. */ /* #undef HAVE_TIMEGM */ /* Define if you have the vsnprintf function. */ #define HAVE_VSNPRINTF 1 /* Define if you have the header file. */ /* #undef HAVE_ALLOCA_H */ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ /* #define HAVE_GETOPT_H 1 */ /* Define if you have the header file. */ #define HAVE_GETOPT_LOCAL 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ /* #undef HAVE_SSL_H */ /* Define if you have the header file. */ /* #define HAVE_STRINGS_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_FILE_H 1 /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define if you have the header file. */ /* #define HAVE_SYS_TIME_H 1 */ /* Define if you have the header file. */ /* #define HAVE_SYS_WAIT_H 1 */ /* Define if you have the header file. */ /* #define HAVE_UNISTD_H 1 */ /* Define if you have the header file. */ /* #undef HAVE_WAIT_H */ /* Define if you have the header file. */ /* #define HAVE_ZLIB_H 1 */ /* Define if you have the crypto library (-lcrypto). */ /* #undef HAVE_LIBCRYPTO */ /* Define if you have the nsl library (-lnsl). */ /* #undef HAVE_LIBNSL */ /* Define if you have the socket library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ /* Define if you have the ssl library (-lssl). */ /* #undef HAVE_LIBSSL */ /* Define if you have the z library (-lz). */ /* #define HAVE_LIBZ 1 */ /* Name of package */ #define PACKAGE "htdig" /* Version number of package */ #define VERSION "3.2.0b5" /* * Big-file configuration. */ #ifdef HAVE_FILE_OFFSET_BITS #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif /* _FILE_OFFSET_BITS */ #endif /* HAVE_FILE_OFFSET_BITS */ #ifdef HAVE_LARGEFILE_SOURCE #ifndef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE #endif /* _LARGEFILE_SOURCE */ #endif /* HAVE_LARGEFILE_SOURCE */ htdig-3.2.0b6/include/stamp-h.in0100644006314600127310000000001206744567654015727 0ustar angusgbhtdigtimestamp htdig-3.2.0b6/installdir/0040755006314600127310000000000010063260370014530 5ustar angusgbhtdightdig-3.2.0b6/installdir/.cvsignore0100644006314600127310000000001106772705364016540 0ustar angusgbhtdigMakefile htdig-3.2.0b6/installdir/HtFileType0100755006314600127310000000511310062352744016476 0ustar angusgbhtdig#!/bin/sh # HtContent # # Determine a file's MIME type from its contents. # # # Part of the ht://Dig package # Copyright (c) 2003 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Public License version 2 or later # # $Id: HtFileType,v 1.5 2004/06/11 15:55:16 grdetil Exp $ if file -v > /dev/null; then have_modern_file=true else have_modern_file=false fi tmpfile=`mktemp /tmp/HtFileType.XXXXXX` || exit 1 magic_file=@CONFIG_DIR@/HtFileType-magic.mime #magic_file=${0}-magic.mime # Go through each specified file. # Can't say 'for input in "$*"; do' as that breaks up names containing spaces while [ $# -gt 0 ]; do input="$1"; shift; #echo -n $input ' ' # Classify based on start of file. Strip leading whitespace and # convert broken "/dev/null | sed 's/[,;].*//'` else # old file(1) command can't strip leading whitespace, or accept -i option head -100 "$input" 2> /dev/null | tr '\012\015' ' ' | sed -e's/^ *//' -e's/ * $tmpfile output=`file -m $magic_file $tmpfile 2>/dev/null | sed -e 's/.*:[ ]*//' -e's/[,;].*//'` /bin/rm -f $tmpfile fi case $output in # 'file' calls most human-readable files "text", so check what type *text) case $output in *HTML* ) type=text/html;; *SGML* ) type=text/sgml;; *XML* ) type=text/xml;; # ignore most source code *script* | *program* | *command* ) type=application/x-unknown;; *pre-processor*|*"'diff' output"*) type=application/x-unknown;; # assume all other text is plain # (Includes outputs "English t.", "ASCII t.", "international t.") *) type=text/plain;; esac;; # Our magic file already outputs MIME types, so don't change them */* ) type=$output;; # Other recognised types *postscript* | *PostScript* ) type=application/postscript;; *PDF* | *acrobat* ) type=application/pdf;; # otherwise give up *) type=application/x-unknown;; esac # Catch HTML documents, which are special cases of SGML and XML case $type in text/xml | text/sgml ) if head -100 "$input"| egrep -i ' # 0 leshort 0x521c COFF DSP21k >18 lelong &02 executable, >18 lelong ^02 >>18 lelong &01 static object, >>18 lelong ^01 relocatable object, >18 lelong &010 stripped >18 lelong ^010 not stripped #------------------------------------------------------------------------------ # adventure: file(1) magic for Adventure game files # # from Allen Garvin # Edited by Dave Chapeskie Jun 28, 1998 # # ALAN # I assume there are other, lower versions, but these are the only ones I # saw in the archive. 0 beshort 0x0206 ALAN text adventure code data >2 byte <10 version 2.6%d # Conflicts with too much other stuff! # Infocom # (Note: to avoid false matches Z-machine version 1 and 2 are not # recognized since only the oldest Zork I and II used them. Similarly # there are 4 Infocom games that use verion 4 that are not recognized.) #0 byte 3 Infocom game data (Z-machine 3, #>2 beshort <0x7fff Release %3d, #>26 beshort >0 Size %d*2 #>18 string >\0 Serial %.6s) #0 byte 5 Infocom game data (Z-machine 5, #>2 beshort <0x7fff Release %3d, #>26 beshort >0 Size %d*4 #>18 string >\0 Serial %.6s) #0 byte 6 Infocom game data (Z-machine 6, #>2 beshort <0x7fff Release %3d, #>26 beshort >0 Size %d*8 #>18 string >\0 Serial %.6s) #0 byte 8 Infocom game data (Z-machine 8, #>2 beshort <0x7fff Release %3d, #>26 beshort >0 Size %d*8 #>18 string >\0 Serial %.6s) # TADS (Text Adventure Development System) 0 string TADS TADS game data >13 string >\0 (ver. %.6s, >22 string >\0 date %s) #------------------------------------------------------------------------------ # allegro: file(1) magic for Allegro datafiles # Toby Deshane # 0 belong 0x736C6821 Allegro datafile (packed) 0 belong 0x736C682E Allegro datafile (not packed/autodetect) 0 belong 0x736C682B Allegro datafile (appended exe data) #------------------------------------------------------------------------------ # alliant: file(1) magic for Alliant FX series a.out files # # If the FX series is the one that had a processor with a 68K-derived # instruction set, the "short" should probably become "beshort" and the # "long" should probably become "belong". # If it's the i860-based one, they should probably become either the # big-endian or little-endian versions, depending on the mode they ran # the 860 in.... # 0 short 0420 0420 Alliant virtual executable >2 short &0x0020 common library >16 long >0 not stripped 0 short 0421 0421 Alliant compact executable >2 short &0x0020 common library >16 long >0 not stripped #------------------------------------------------------------------------------ # alpha architecture description # 0 leshort 0603 COFF format alpha >22 leshort&030000 !020000 executable >24 leshort 0410 pure >24 leshort 0413 paged >22 leshort&020000 !0 dynamically linked >16 lelong !0 not stripped >16 lelong 0 stripped >22 leshort&030000 020000 shared library >24 leshort 0407 object >27 byte x - version %d >26 byte x .%d >28 byte x -%d # Basic recognition of Digital UNIX core dumps - Mike Bremford # # The actual magic number is just "Core", followed by a 2-byte version # number; however, treating any file that begins with "Core" as a Digital # UNIX core dump file may produce too many false hits, so we include one # byte of the version number as well; DU 5.0 appears only to be up to # version 2. # 0 string Core\001 Alpha COFF format core dump (Digital UNIX) >24 string >\0 \b, from '%s' 0 string Core\002 Alpha COFF format core dump (Digital UNIX) >24 string >\0 \b, from '%s' #------------------------------------------------------------------------------ # amanda: file(1) magic for amanda file format # 0 string AMANDA:\ AMANDA >8 string TAPESTART\ DATE tape header file, >>23 string X >>>25 string >\ Unused %s >>23 string >\ DATE %s >8 string FILE\ dump file, >>13 string >\ DATE %s #------------------------------------------------------------------------------ # amigaos: file(1) magic for AmigaOS binary formats: # # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis) # Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG # (the others should be separate, anyway) # 0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary 0 belong 0x000003e7 AmigaOS object/library data #------------------------------------------------------------------------------ # animation: file(1) magic for animation/movie formats # # animation formats # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8) # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com) # MPEG animation format 0 belong 0x000001b3 MPEG video stream data #>4 beshort&0xfff0 x (%d x #>5 beshort&0x0fff x %d) 0 belong 0x000001ba MPEG system stream data # MPEG Audio (*.mpx) # from dreesen@math.fu-berlin.de # XXX # This conflicts with the FF FE signature for UTF-16-encoded Unicode # text, which will be identified as an MP3 file. I don't have any MP3s # so I don't know how to (or even if it's possible to) change this to # tell the two apart. enf@pobox.com 0 beshort &0xfff0 MP # MPEG 1.0 >1 byte&0x08 =0x08 \b # Layer 3 >>1 byte &0x02 \b3 >>>2 byte&0xf0 =0x10 \b, 32 kBits >>>2 byte&0xf0 =0x20 \b, 40 kBits >>>2 byte&0xf0 =0x30 \b, 48 kBits >>>2 byte&0xf0 =0x40 \b, 56 kBits >>>2 byte&0xf0 =0x50 \b, 64 kBits >>>2 byte&0xf0 =0x60 \b, 80 kBits >>>2 byte&0xf0 =0x70 \b, 96 kBits >>>2 byte&0xf0 =0x80 \b, 112 kBits >>>2 byte&0xf0 =0x90 \b, 128 kBits >>>2 byte&0xf0 =0xA0 \b, 160 kBits >>>2 byte&0xf0 =0xB0 \b, 192 kBits >>>2 byte&0xf0 =0xC0 \b, 224 kBits >>>2 byte&0xf0 =0xD0 \b, 256 kBits >>>2 byte&0xf0 =0xE0 \b, 320 kBits # Layer 2 >>1 byte &0x04 \b2 >>>2 byte&0xf0 =0x10 \b, 32 kBits >>>2 byte&0xf0 =0x20 \b, 48 kBits >>>2 byte&0xf0 =0x30 \b, 56 kBits >>>2 byte&0xf0 =0x40 \b, 64 kBits >>>2 byte&0xf0 =0x50 \b, 80 kBits >>>2 byte&0xf0 =0x60 \b, 96 kBits >>>2 byte&0xf0 =0x70 \b, 112 kBits >>>2 byte&0xf0 =0x80 \b, 128 kBits >>>2 byte&0xf0 =0x90 \b, 160 kBits >>>2 byte&0xf0 =0xA0 \b, 192 kBits >>>2 byte&0xf0 =0xB0 \b, 224 kBits >>>2 byte&0xf0 =0xC0 \b, 256 kBits >>>2 byte&0xf0 =0xD0 \b, 320 kBits >>>2 byte&0xf0 =0xE0 \b, 384 kBits # freq >>2 byte&0x0C =0x00 \b, 44.1 kHz >>2 byte&0x0C =0x04 \b, 48 kHz >>2 byte&0x0C =0x08 \b, 32 kHz # MPEG 2.0 >1 byte&0x08 =0x00 \b # Layer 3 >>1 byte &0x02 \b3 # Layer 2 >>1 byte &0x04 \b2 >>2 byte&0xf0 =0x10 \b, 8 kBits >>2 byte&0xf0 =0x20 \b, 16 kBits >>2 byte&0xf0 =0x30 \b, 24 kBits >>2 byte&0xf0 =0x40 \b, 32 kBits >>2 byte&0xf0 =0x50 \b, 40 kBits >>2 byte&0xf0 =0x60 \b, 48 kBits >>2 byte&0xf0 =0x70 \b, 56 kBits >>2 byte&0xf0 =0x80 \b, 64 kBits >>2 byte&0xf0 =0x90 \b, 80 kBits >>2 byte&0xf0 =0xA0 \b, 96 kBits >>2 byte&0xf0 =0xB0 \b, 112 kBits >>2 byte&0xf0 =0xC0 \b, 128 kBits >>2 byte&0xf0 =0xD0 \b, 144 kBits >>2 byte&0xf0 =0xE0 \b, 160 kBits # freq >>2 byte&0x0C =0x00 \b, 22.05 kHz >>2 byte&0x0C =0x04 \b, 24 kHz >>2 byte&0x0C =0x08 \b, 16 kHz # misc >3 byte&0xC0 =0x00 \b, Stereo >3 byte&0xC0 =0x40 \b, JStereo >3 byte&0xC0 =0x80 \b, Dual-Ch >3 byte&0xC0 =0xC0 \b, Mono #>1 byte&0x01 =0x00 \b, Error Protection #>2 byte&0x02 =0x02 \b, Padding #>2 byte&0x01 =0x01 \b, Private #>3 byte&0x08 =0x08 \b, Copyright #>3 byte&0x04 =0x04 \b, Original #>3 byte&0x03 1 \b, Emphasis 5 #>3 byte&0x03 3 \b, Emphasis c # FLI animation format 4 leshort 0xAF11 FLI file >6 leshort x - %d frames, >8 leshort x width=%d pixels, >10 leshort x height=%d pixels, >12 leshort x depth=%d, >16 leshort x ticks/frame=%d # FLC animation format 4 leshort 0xAF12 FLC file >6 leshort x - %d frames >8 leshort x width=%d pixels, >10 leshort x height=%d pixels, >12 leshort x depth=%d, >16 leshort x ticks/frame=%d # DL animation format # XXX - collision with most `mips' magic # # I couldn't find a real magic number for these, however, this # -appears- to work. Note that it might catch other files, too, so be # careful! # # Note that title and author appear in the two 20-byte chunks # at decimal offsets 2 and 22, respectively, but they are XOR'ed with # 255 (hex FF)! The DL format is really bad. # #0 byte 1 DL version 1, medium format (160x100, 4 images/screen) #>42 byte x - %d screens, #>43 byte x %d commands #0 byte 2 DL version 2 #>1 byte 1 - large format (320x200,1 image/screen), #>1 byte 2 - medium format (160x100,4 images/screen), #>1 byte >2 - unknown format, #>42 byte x %d screens, #>43 byte x %d commands # Based on empirical evidence, DL version 3 have several nulls following the # \003. Most of them start with non-null values at hex offset 0x34 or so. #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3 # SGI and Apple formats 0 string MOVI Silicon Graphics movie file 4 string moov Apple QuickTime movie file (moov) 4 string mdat Apple QuickTime movie file (mdat) # iso 13818 transport stream # # from Oskar Schirmer Feb 3, 2001 (ISO 13818.1) # (the following is a little bit restrictive and works fine for a stream # that starts with PAT properly. it won't work for stream data, that is # cut from an input device data right in the middle, but this shouldn't # disturb) # syncbyte 8 bit 0x47 # error_ind 1 bit - # payload_start 1 bit 1 # priority 1 bit - # PID 13 bit 0x0000 # scrambling 2 bit - # adaptfld_ctrl 2 bit 1 or 3 # conti_count 4 bit 0 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data >188 byte !0x47 CORRUPTED # DIF digital video file format 0 belong&0xffffff00 0x1f070000 DIF >4 byte &0x01 (DVCPRO) movie file >4 byte ^0x01 (DV) movie file >3 byte &0x80 (PAL) >3 byte ^0x80 (NTSC) # Microsoft Advanced Streaming Format (ASF) 0 belong 0x3026b275 Microsoft ASF #------------------------------------------------------------------------------ # apl: file(1) magic for APL (see also "pdp" and "vax" for other APL # workspaces) # 0 long 0100554 APL workspace (Ken's original?) #------------------------------------------------------------------------------ # apple: file(1) magic for Apple file formats # 0 string FiLeStArTfIlEsTaRt binscii (apple ][) text 0 string \x0aGL Binary II (apple ][) data 0 string \x76\xff Squeezed (apple ][) data 0 string NuFile NuFile archive (apple ][) data 0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data 0 belong 0x00051600 AppleSingle encoded Macintosh file 0 belong 0x00051607 AppleDouble encoded Macintosh file # magic for Newton PDA package formats # from Ruda Moura 0 string package0 Newton package, NOS 1.x, >12 belong &0x80000000 AutoRemove, >12 belong &0x40000000 CopyProtect, >12 belong &0x10000000 NoCompression, >12 belong &0x04000000 Relocation, >12 belong &0x02000000 UseFasterCompression, >16 belong x version %d 0 string package1 Newton package, NOS 2.x, >12 belong &0x80000000 AutoRemove, >12 belong &0x40000000 CopyProtect, >12 belong &0x10000000 NoCompression, >12 belong &0x04000000 Relocation, >12 belong &0x02000000 UseFasterCompression, >16 belong x version %d # The following entries for the Apple II are for files that have # been transferred as raw binary data from an Apple, without having # been encapsulated by any of the above archivers. # # In general, Apple II formats are hard to identify because Apple DOS # and especially Apple ProDOS have strong typing in the file system and # therefore programmers never felt much need to include type information # in the files themselves. # # Eric Fischer # AppleWorks word processor: # # This matches the standard tab stops for an AppleWorks file, but if # a file has a tab stop set in the first four columns this will fail. # # The "O" is really the magic number, but that's so common that it's # necessary to check the tab stops that follow it to avoid false positives. 4 string O==== AppleWorks word processor data >85 byte&0x01 >0 \b, zoomed >90 byte&0x01 >0 \b, paginated >92 byte&0x01 >0 \b, with mail merge #>91 byte x \b, left margin %d # AppleWorks database: # # This isn't really a magic number, but it's the closest thing to one # that I could find. The 1 and 2 really mean "order in which you defined # categories" and "left to right, top to bottom," respectively; the D and R # mean that the cursor should move either down or right when you press Return. #30 string \x01D AppleWorks database data #30 string \x02D AppleWorks database data #30 string \x01R AppleWorks database data #30 string \x02R AppleWorks database data # AppleWorks spreadsheet: # # Likewise, this isn't really meant as a magic number. The R or C means # row- or column-order recalculation; the A or M means automatic or manual # recalculation. #131 string RA AppleWorks spreadsheet data #131 string RM AppleWorks spreadsheet data #131 string CA AppleWorks spreadsheet data #131 string CM AppleWorks spreadsheet data # Applesoft BASIC: # # This is incredibly sloppy, but will be true if the program was # written at its usual memory location of 2048 and its first line # number is less than 256. Yuck. 0 belong&0xff00ff 0x80000 Applesoft BASIC program data #>2 leshort x \b, first line number %d # ORCA/EZ assembler: # # This will not identify ORCA/M source files, since those have # some sort of date code instead of the two zero bytes at 6 and 7 # XXX Conflicts with ELF #4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data #>5 byte x \b, build number %d # Broderbund Fantavision # # I don't know what these values really mean, but they seem to recur. # Will they cause too many conflicts? # Probably :-) #2 belong&0xFF00FF 0x040008 Fantavision movie data # Some attempts at images. # # These are actually just bit-for-bit dumps of the frame buffer, so # there's really no reasonably way to distinguish them except for their # address (if preserved) -- 8192 or 16384 -- and their length -- 8192 # or, occasionally, 8184. # # Nevertheless this will manage to catch a lot of images that happen # to have a solid-colored line at the bottom of the screen. 8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background 8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background 8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background 8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background 8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background # Beagle Bros. Apple Mechanic fonts 0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font #------------------------------------------------------------------------------ # applix: file(1) magic for Applixware # From: Peter Soos # 0 string *BEGIN Applixware >7 string WORDS Words Document >7 string GRAPHICS Graphic >7 string RASTER Bitmap >7 string SPREADSHEETS Spreadsheet >7 string MACRO Macro >7 string BUILDER Builder Object #------------------------------------------------------------------------------ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc. # pre-POSIX "tar" archives are handled in the C code. # POSIX tar archives 257 string ustar\0 POSIX tar archive 257 string ustar\040\040\0 GNU tar archive # cpio archives # # Yes, the top two "cpio archive" formats *are* supposed to just be "short". # The idea is to indicate archives produced on machines with the same # byte order as the machine running "file" with "cpio archive", and # to indicate archives produced on machines with the opposite byte order # from the machine running "file" with "byte-swapped cpio archive". # # The SVR4 "cpio(4)" hints that there are additional formats, but they # are defined as "short"s; I think all the new formats are # character-header formats and thus are strings, not numbers. 0 short 070707 cpio archive 0 short 0143561 byte-swapped cpio archive 0 string 070707 ASCII cpio archive (pre-SVR4 or odc) 0 string 070701 ASCII cpio archive (SVR4 with no CRC) 0 string 070702 ASCII cpio archive (SVR4 with CRC) # Debian package (needs to go before regular portable archives) # 0 string !\ndebian >8 string debian-split part of multipart Debian package >8 string debian-binary Debian binary package >68 string >\n (format %s) >136 ledate x created: %s # other archives 0 long 0177555 very old archive 0 short 0177555 very old PDP-11 archive 0 long 0177545 old archive 0 short 0177545 old PDP-11 archive 0 long 0100554 apl workspace 0 string = archive # MIPS archive (needs to go before regular portable archives) # 0 string !\n__________E MIPS archive >20 string U with MIPS Ucode members >21 string L with MIPSEL members >21 string B with MIPSEB members >19 string L and an EL hash table >19 string B and an EB hash table >22 string X -- out of date 0 string -h- Software Tools format archive text # # XXX - why are there multiple thingies? Note that 0x213c6172 is # "! current ar archive # 0 long 0x213c6172 archive file # # and for SVR1 archives, we have: # # 0 string \ System V Release 1 ar archive # 0 string = archive # # XXX - did Aegis really store shared libraries, breakpointed modules, # and absolute code program modules in the same format as new-style # "ar" archives? # 0 string ! current ar archive >8 string __.SYMDEF random library >0 belong =65538 - pre SR9.5 >0 belong =65539 - post SR9.5 >0 beshort 2 - object archive >0 beshort 3 - shared library module >0 beshort 4 - debug break-pointed module >0 beshort 5 - absolute code program module 0 string \ System V Release 1 ar archive 0 string = archive # # XXX - from "vax", which appears to collect a bunch of byte-swapped # thingies, to help you recognize VAX files on big-endian machines; # with "leshort", "lelong", and "string", that's no longer necessary.... # 0 belong 0x65ff0000 VAX 3.0 archive 0 belong 0x3c61723e VAX 5.0 archive # 0 long 0x213c6172 archive file 0 lelong 0177555 very old VAX archive 0 leshort 0177555 very old PDP-11 archive # # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus # be a random library (it said 0xff65 rather than 0177545). # 0 lelong 0177545 old VAX archive >8 string __.SYMDEF random library 0 leshort 0177545 old PDP-11 archive >8 string __.SYMDEF random library # # From "pdp" (but why a 4-byte quantity?) # 0 lelong 0x39bed PDP-11 old archive 0 lelong 0x39bee PDP-11 4.0 archive # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com) # # The first byte is the magic (0x1a), byte 2 is the compression type for # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS # filename of the first file (null terminated). Since some types collide # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%), # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo. 0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW 0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed 0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed 0 lelong&0x8080ffff 0x0000031a ARC archive data, packed 0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed 0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk) # I can't create either SPARK or ArcFS archives so I have not tested this stuff # [GRR: the original entries collide with ARC, above; replaced with combined # version (not tested)] #0 byte 0x1a RISC OS archive #>1 string archive (ArcFS format) 0 string \032archive RISC OS archive (ArcFS format) # ARJ archiver (jason@jarthur.Claremont.EDU) 0 leshort 0xea60 ARJ archive data >5 byte x \b, v%d, >8 byte &0x04 multi-volume, >8 byte &0x10 slash-switched, >8 byte &0x20 backup, >34 string x original name: %s, >7 byte 0 os: MS-DOS >7 byte 1 os: PRIMOS >7 byte 2 os: Unix >7 byte 3 os: Amiga >7 byte 4 os: Macintosh >7 byte 5 os: OS/2 >7 byte 6 os: Apple ][ GS >7 byte 7 os: Atari ST >7 byte 8 os: NeXT >7 byte 9 os: VAX/VMS >3 byte >0 %d] # HA archiver (Greg Roelofs, newt@uchicago.edu) # This is a really bad format. A file containing HAWAII will match this... #0 string HA HA archive data, #>2 leshort =1 1 file, #>2 leshort >1 %u files, #>4 byte&0x0f =0 first is type CPY #>4 byte&0x0f =1 first is type ASC #>4 byte&0x0f =2 first is type HSC #>4 byte&0x0f =0x0e first is type DIR #>4 byte&0x0f =0x0f first is type SPECIAL # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz) 0 string HPAK HPACK archive data # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net 0 string \351,\001JAM\ JAM archive, >7 string >\0 version %.4s >0x26 byte =0x27 - >>0x2b string >\0 label %.11s, >>0x27 lelong x serial %08x, >>0x36 string >\0 fstype %.8s # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) 2 string -lh0- LHarc 1.x archive data [lh0] 2 string -lh1- LHarc 1.x archive data [lh1] 2 string -lz4- LHarc 1.x archive data [lz4] 2 string -lz5- LHarc 1.x archive data [lz5] # [never seen any but the last; -lh4- reported in comp.compression:] 2 string -lzs- LHa 2.x? archive data [lzs] 2 string -lh\40- LHa 2.x? archive data [lh ] 2 string -lhd- LHa 2.x? archive data [lhd] 2 string -lh2- LHa 2.x? archive data [lh2] 2 string -lh3- LHa 2.x? archive data [lh3] 2 string -lh4- LHa (2.x) archive data [lh4] 2 string -lh5- LHa (2.x) archive data [lh5] 2 string -lh6- LHa (2.x) archive data [lh6] 2 string -lh7- LHa (2.x) archive data [lh7] >20 byte x - header level %d # RAR archiver (Greg Roelofs, newt@uchicago.edu) 0 string Rar! RAR archive data # SQUISH archiver (Greg Roelofs, newt@uchicago.edu) 0 string SQSH squished archive data (Acorn RISCOS) # UC2 archiver (Greg Roelofs, newt@uchicago.edu) # I can't figure out the self-extracting form of these buggers... 0 string UC2\x1a UC2 archive data # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\003\004 Zip archive data >4 byte 0x09 \b, at least v0.9 to extract >4 byte 0x0a \b, at least v1.0 to extract >4 byte 0x0b \b, at least v1.1 to extract >4 byte 0x14 \b, at least v2.0 to extract # Zoo archiver 20 lelong 0xfdc4a7dc Zoo archive data >4 byte >48 \b, v%c. >>6 byte >47 \b%c >>>7 byte >47 \b%c >32 byte >0 \b, modify: v%d >>33 byte x \b.%d+ >42 lelong 0xfdc4a7dc \b, >>70 byte >0 extract: v%d >>>71 byte x \b.%d+ # Shell archives 10 string #\ This\ is\ a\ shell\ archive shell archive text # # LBR. NB: May conflict with the questionable # "binary Computer Graphics Metafile" format. # 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data # # PMA (CP/M derivative of LHA) # 2 string -pm0- PMarc archive data [pm0] 2 string -pm1- PMarc archive data [pm1] 2 string -pm2- PMarc archive data [pm2] 2 string -pms- PMarc SFX archive (CP/M, DOS) 5 string -pc1- PopCom compressed executable (CP/M) # From rafael@icp.inpg.fr (Rafael Laboissiere) # The Project Revision Control System (see # http://www.XCF.Berkeley.EDU/~jmacd/prcs.html) generates a packaged project # file which is recognized by the following entry: 0 leshort 0xeb81 PRCS packaged project # Microsoft cabinets # by David Necas (Yeti) 0 string MSCF\0\0\0\0 Microsoft cabinet file data, >25 byte x v%d >24 byte x \b.%d # GTKtalog catalogs # by David Necas (Yeti) 4 string gtktalog\ GTKtalog catalog data, >13 string 3 version 3 >>14 beshort 0x677a (gzipped) >>14 beshort !0x677a (not gzipped) >13 string >3 version %s #------------------------------------------------------------------------------ # asterix: file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character # strings as "long" - we assume they're just strings: # From: guy@netapp.com (Guy Harris) # 0 string *STA Aster*x >7 string WORD Words Document >7 string GRAP Graphic >7 string SPRE Spreadsheet >7 string MACR Macro 0 string 2278 Aster*x Version 2 >29 byte 0x36 Words Document >29 byte 0x35 Graphic >29 byte 0x32 Spreadsheet >29 byte 0x38 Macro #------------------------------------------------------------------------------ # att3b: file(1) magic for AT&T 3B machines # # The `versions' should be un-commented if they work for you. # (Was the problem just one of endianness?) # # 3B20 # # The 3B20 conflicts with SCCS. #0 beshort 0550 3b20 COFF executable #>12 belong >0 not stripped #>22 beshort >0 - version %ld #0 beshort 0551 3b20 COFF executable (TV) #>12 belong >0 not stripped #>22 beshort >0 - version %ld # # WE32K # 0 beshort 0560 WE32000 COFF >18 beshort ^00000020 object >18 beshort &00000020 executable >12 belong >0 not stripped >18 beshort ^00010000 N/A on 3b2/300 w/paging >18 beshort &00020000 32100 required >18 beshort &00040000 and MAU hardware required >20 beshort 0407 (impure) >20 beshort 0410 (pure) >20 beshort 0413 (demand paged) >20 beshort 0443 (target shared library) >22 beshort >0 - version %ld 0 beshort 0561 WE32000 COFF executable (TV) >12 belong >0 not stripped #>18 beshort &00020000 - 32100 required #>18 beshort &00040000 and MAU hardware required #>22 beshort >0 - version %ld # # core file for 3b2 0 string \000\004\036\212\200 3b2 core file >364 string >\0 of '%s' #------------------------------------------------------------------------------ # audio: file(1) magic for sound formats (see also "iff") # # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com), # and others # # Sun/NeXT audio data 0 string .snd Sun/NeXT audio data: >12 belong 1 8-bit ISDN u-law, >12 belong 2 8-bit linear PCM [REF-PCM], >12 belong 3 16-bit linear PCM, >12 belong 4 24-bit linear PCM, >12 belong 5 32-bit linear PCM, >12 belong 6 32-bit IEEE floating point, >12 belong 7 64-bit IEEE floating point, >12 belong 23 8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding), >12 belong 24 compressed (8-bit G.722 ADPCM) >12 belong 25 compressed (3-bit G.723 ADPCM), >12 belong 26 compressed (5-bit G.723 ADPCM), >12 belong 27 8-bit A-law, >20 belong 1 mono, >20 belong 2 stereo, >20 belong 4 quad, >16 belong >0 %d Hz # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format # that uses little-endian encoding and has a different magic number 0 lelong 0x0064732E DEC audio data: >12 lelong 1 8-bit ISDN u-law, >12 lelong 2 8-bit linear PCM [REF-PCM], >12 lelong 3 16-bit linear PCM, >12 lelong 4 24-bit linear PCM, >12 lelong 5 32-bit linear PCM, >12 lelong 6 32-bit IEEE floating point, >12 lelong 7 64-bit IEEE floating point, >12 lelong 23 8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding), >20 lelong 1 mono, >20 lelong 2 stereo, >20 lelong 4 quad, >16 lelong >0 %d Hz # Creative Labs AUDIO stuff 0 string MThd Standard MIDI data >9 byte >0 (format %d) >11 byte >1 using %d tracks 0 string CTMF Creative Music (CMF) data 0 string SBI SoundBlaster instrument data 0 string Creative\ Voice\ File Creative Labs voice data # is this next line right? it came this way... >19 byte 0x1A >23 byte >0 - version %d >22 byte >0 \b.%d # first entry is also the string "NTRK" 0 belong 0x4e54524b MultiTrack sound data >4 belong x - version %ld # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi] 0 string EMOD Extended MOD sound data, >4 byte&0xf0 x version %d >4 byte&0x0f x \b.%d, >45 byte x %d instruments >83 byte 0 (module) >83 byte 1 (song) # Real Audio (Magic .ra\0375) 0 belong 0x2e7261fd RealAudio sound file 0 string .RMF RealMedia file # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net] # Oct 31, 1995 0 string MTM MultiTracker Module sound file #0 string if Composer 669 Module sound data 0 string FAR Module sound data 0 string MAS_U ULT(imate) Module sound data 0x2c string SCRM ScreamTracker III Module sound data 0 string Extended Module Extended Module sound data # Gravis UltraSound patches # From 0 string GF1PATCH110\0ID#000002\0 GUS patch 0 string GF1PATCH100\0ID#000002\0 Old GUS patch # # Taken from loader code from mikmod version 2.14 # by Steve McIntyre (stevem@chiark.greenend.org.uk) 0 string JN extended 669 module data 0 string MAS_UTrack_V00 >14 string >/0 ultratracker V1.%.1s module sound data 0 string UN05 MikMod UNI format module sound data 0 string Extended\ Module: Fasttracker II module sound data 21 string !SCREAM! Screamtracker 2 module sound data 1080 string M.K. 4-channel Protracker module sound data 1080 string M!K! 4-channel Protracker module sound data 1080 string FLT4 4-channel Startracker module sound data 1080 string 4CHN 4-channel Fasttracker module sound data 1080 string 6CHN 6-channel Fasttracker module sound data 1080 string 8CHN 8-channel Fasttracker module sound data 1080 string CD81 8-channel Oktalyzer module sound data 1080 string OKTA 8-channel Oktalyzer module sound data # Not good enough. #1082 string CH #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data 1080 string 16CN 16-channel Taketracker module sound data 1080 string 32CN 32-channel Taketracker module sound data # TOC sound files -Trevor Johnson # 0 string TOC TOC sound file # sidfiles 0 string SIDPLAY\ INFOFILE Sidplay info file 0 string PSID PlaySID v2.2+ (AMIGA) sidtune >4 beshort >0 w/ header v%d, >14 beshort =1 single song, >14 beshort >1 %d songs, >16 beshort >0 default song: %d # IRCAM # VAX and MIPS files are little-endian; Sun and NeXT are big-endian 0 belong 0x64a30100 IRCAM file (VAX) 0 belong 0x64a30200 IRCAM file (Sun) 0 belong 0x64a30300 IRCAM file (MIPS little-endian) 0 belong 0x64a30400 IRCAM file (NeXT) # NIST SPHERE 0 string NIST_1A\n\ \ \ 1024\n NIST SPHERE file # Sample Vision 0 string SOUND\ SAMPLE\ DATA\ Sample Vision file # Audio Visual Research 0 string 2BIT Audio Visual Research file # From Felix von Leitner 0 string OggS Ogg-Vorbis compressed sound file # SGI SoundTrack 0 string _SGI_SoundTrack SGI SoundTrack project file 0 string ID3 mp3 file with ID3 2.0 tag #------------------------------------------------------------------------------ # blender: file(1) magic for Blender 3D data files # # Coded by Guillermo S. Romero using the # data from Ton Roosendaal . Ton or his company do not # support the rule, so mail GSR if problems with it. Rule version: 1.1. # You can get latest version with comments and details about the format # at http://acd.asoc.euitt.upm.es/~gsromero/3d/blender/magic.blender 0 string =BLENDER Blender3D, >7 string =_ saved as 32-bits >7 string =- saved as 64-bits >8 string =v little endian >8 string =V big endian >9 byte x with version %c. >10 byte x \b%c >11 byte x \b%c #------------------------------------------------------------------------------ # blit: file(1) magic for 68K Blit stuff as seen from 680x0 machine # # Note that this 0407 conflicts with several other a.out formats... # # XXX - should this be redone with "be" and "le", so that it works on # little-endian machines as well? If so, what's the deal with # "VAX-order" and "VAX-order2"? # #0 long 0407 68K Blit (standalone) executable #0 short 0407 VAX-order2 68K Blit (standalone) executable 0 short 03401 VAX-order 68K Blit (standalone) executable 0 long 0406 68k Blit mpx/mux executable 0 short 0406 VAX-order2 68k Blit mpx/mux executable 0 short 03001 VAX-order 68k Blit mpx/mux executable # Need more values for WE32 DMD executables. # Note that 0520 is the same as COFF #0 short 0520 tty630 layers executable #------------------------------------------------------------------------------ # bsdi: file(1) magic for BSD/OS (from BSDI) objects # 0 lelong 0314 386 compact demand paged pure executable >16 lelong >0 not stripped >32 byte 0x6a (uses shared libs) 0 lelong 0407 386 executable >16 lelong >0 not stripped >32 byte 0x6a (uses shared libs) 0 lelong 0410 386 pure executable >16 lelong >0 not stripped >32 byte 0x6a (uses shared libs) 0 lelong 0413 386 demand paged pure executable >16 lelong >0 not stripped >32 byte 0x6a (uses shared libs) # same as in SunOS 4.x, except for static shared libraries 0 belong&077777777 0600413 SPARC demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable >>20 belong >4096 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped >36 belong 0xb4100001 (uses shared libs) 0 belong&077777777 0600410 SPARC pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped >36 belong 0xb4100001 (uses shared libs) 0 belong&077777777 0600407 SPARC >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped >36 belong 0xb4100001 (uses shared libs) #------------------------------------------------------------------------------ # c-lang: file(1) magic for C programs (or REXX) # # XPM icons (Greg Roelofs, newt@uchicago.edu) # if you uncomment "/*" for C/REXX below, also uncomment this entry #0 string /*\ XPM\ */ X pixmap image data # this first will upset you if you're a PL/1 shop... # in which case rm it; ascmagic will catch real C programs #0 string /* C or REXX program text 0 string // C++ program text #------------------------------------------------------------------------------ # chi: file(1) magic for ChiWriter files # 0 string \\1cw\ ChiWriter file >5 string >\0 version %s 0 string \\1cw ChiWriter file #------------------------------------------------------------------------------ # cisco: file(1) magic for cisco Systems routers # # Most cisco file-formats are covered by the generic elf code # # Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha. 0 belong&0xffffff00 0x85011400 cisco IOS microcode >7 string >\0 for '%s' 0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode >7 string >\0 for '%s' #------------------------------------------------------------------------------ # claris: file(1) magic for claris # "H. Nanosecond" # Claris Works a word processor, etc. # Version 3.0 # .pct claris works clip art files #0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 #* #0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000 #null to byte 1000 octal 514 string \377\377\377\377\000 Claris clip art? >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes. 514 string \377\377\377\377\001 Claris clip art? >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes. # Claris works files # .cwk 0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document # .plt 0 string \020\341\000\000\010\010 Claris Works pallete files .plt # .msp a dictionary file I am not sure about this I have only one .msp file 0 string \002\271\262\000\040\002\000\164 Claris works dictionary # .usp are user dictionary bits # I am not sure about a magic header: #0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151 # soh S p f 8 U D sp ^ S cr nl p o d i #0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043 # a t r i s t sp ^ S cr nl d i v sp # # .mth Thesaurus # statrts with \0 but no magic header # .chy Hyphenation file # I am not sure: 000 210 034 000 000 # other claris files #./windows/claris/useng.ndx: data #./windows/claris/xtndtran.l32: data #./windows/claris/xtndtran.lst: data #./windows/claris/clworks.lbl: data #./windows/claris/clworks.prf: data #./windows/claris/userd.spl: data #------------------------------------------------------------------------------ # clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper. # # XXX - what byte order does the Clipper use? # # XXX - what's the "!" stuff: # # >18 short !074000,000000 C1 R1 # >18 short !074000,004000 C2 R1 # >18 short !074000,010000 C3 R1 # >18 short !074000,074000 TEST # # I shall assume it's ANDing the field with the first value and # comparing it with the second, and rewrite it as: # # >18 short&074000 000000 C1 R1 # >18 short&074000 004000 C2 R1 # >18 short&074000 010000 C3 R1 # >18 short&074000 074000 TEST # # as SVR3.1's "file" doesn't support anything of the "!074000,000000" # sort, nor does SunOS 4.x, so either it's something Intergraph added # in CLIX, or something AT&T added in SVR3.2 or later, or something # somebody else thought was a good idea; it's not documented in the # man page for this version of "magic", nor does it appear to be # implemented (at least not after I blew off the bogus code to turn # old-style "&"s into new-style "&"s, which just didn't work at all). # 0 short 0575 CLIPPER COFF executable (VAX #) >20 short 0407 (impure) >20 short 0410 (5.2 compatible) >20 short 0411 (pure) >20 short 0413 (demand paged) >20 short 0443 (target shared library) >12 long >0 not stripped >22 short >0 - version %ld 0 short 0577 CLIPPER COFF executable >18 short&074000 000000 C1 R1 >18 short&074000 004000 C2 R1 >18 short&074000 010000 C3 R1 >18 short&074000 074000 TEST >20 short 0407 (impure) >20 short 0410 (pure) >20 short 0411 (separate I&D) >20 short 0413 (paged) >20 short 0443 (target shared library) >12 long >0 not stripped >22 short >0 - version %ld >48 long&01 01 alignment trap enabled >52 byte 1 -Ctnc >52 byte 2 -Ctsw >52 byte 3 -Ctpw >52 byte 4 -Ctcb >53 byte 1 -Cdnc >53 byte 2 -Cdsw >53 byte 3 -Cdpw >53 byte 4 -Cdcb >54 byte 1 -Csnc >54 byte 2 -Cssw >54 byte 3 -Cspw >54 byte 4 -Cscb 4 string pipe CLIPPER instruction trace 4 string prof CLIPPER instruction profile #------------------------------------------------------------------------------ # commands: file(1) magic for various shells and interpreters # 0 string : shell archive or script for antique kernel text 0 string/b #!\ /bin/sh Bourne shell script text executable 0 string/b #!\ /bin/csh C shell script text executable # korn shell magic, sent by George Wu, gwu@clyde.att.com 0 string/b #!\ /bin/ksh Korn shell script text executable 0 string/b #!\ /bin/tcsh Tenex C shell script text executable 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable # # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson) 0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable 0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable 0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable 0 string/b #!\ /bin/nawk new awk script text executable 0 string/b #!\ /usr/bin/nawk new awk script text executable 0 string/b #!\ /usr/local/bin/nawk new awk script text executable 0 string/b #!\ /bin/gawk GNU awk script text executable 0 string/b #!\ /usr/bin/gawk GNU awk script text executable 0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable # 0 string/b #!\ /bin/awk awk script text executable 0 string/b #!\ /usr/bin/awk awk script text executable 0 string BEGIN awk script text # For Larry Wall's perl language. The ``eval'' line recognizes an # outrageously clever hack for USG systems. # Keith Waclena 0 string/b #!\ /bin/perl perl script text executable 0 string eval\ "exec\ /bin/perl perl script text 0 string/b #!\ /usr/bin/perl perl script text executable 0 string eval\ "exec\ /usr/bin/perl perl script text 0 string/b #!\ /usr/local/bin/perl perl script text 0 string eval\ "exec\ /usr/local/bin/perl perl script text executable # AT&T Bell Labs' Plan 9 shell 0 string/b #!\ /bin/rc Plan 9 rc shell script text executable # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 0 string/b #!\ /bin/bash Bourne-Again shell script text executable 0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable # using env 0 string #!/usr/bin/env a >15 string >\0 %s script text executable 0 string #!\ /usr/bin/env a >16 string >\0 %s script text executable # generic shell magic 0 string #!\ / a >3 string >\0 %s script text executable 0 string #!\ / a >3 string >\0 %s script text executable 0 string #!/ a >2 string >\0 %s script text executable 0 string #!\ script text executable >3 string >\0 for %s #------------------------------------------------------------------------------ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc. # # Formats for various forms of compressed data # Formats for "compress" proper have been moved into "compress.c", # because it tries to uncompress it to figure out what's inside. # standard unix compress 0 string \037\235 compress'd data >2 byte&0x80 >0 block compressed >2 byte&0x1f x %d bits # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver) 0 string \037\213 gzip compressed data >2 byte <8 \b, reserved method, >2 byte 8 \b, deflated, >3 byte &0x01 ASCII, >3 byte &0x02 continuation, >3 byte &0x04 extra field, >3 byte &0x08 original filename, >>10 string x `%s', >3 byte &0x10 comment, >3 byte &0x20 encrypted, >4 ledate x last modified: %s, >8 byte 2 max compression, >8 byte 4 max speed, >9 byte =0x00 os: MS-DOS >9 byte =0x01 os: Amiga >9 byte =0x02 os: VMS >9 byte =0x03 os: Unix >9 byte =0x05 os: Atari >9 byte =0x06 os: OS/2 >9 byte =0x07 os: MacOS >9 byte =0x0A os: Tops/20 >9 byte =0x0B os: Win/32 # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis 0 string \037\036 packed data >2 belong >1 \b, %d characters originally >2 belong =1 \b, %d character originally # # This magic number is byte-order-independent. XXX - Does that mean this # is big-endian, little-endian, either, or that you can't tell? # this short is valid for SunOS 0 short 017437 old packed data # XXX - why *two* entries for "compacted data", one of which is # byte-order independent, and one of which is byte-order dependent? # 0 short 0x1fff compacted data # This string is valid for SunOS (BE) and a matching "short" is listed # in the Ultrix (LE) magic file. 0 string \377\037 compacted data 0 short 0145405 huf output # bzip2 0 string BZh bzip2 compressed data >3 byte >47 \b, block size = %c00k # squeeze and crunch # Michael Haardt 0 beshort 0x76FF squeezed data, >4 string x original name %s 0 beshort 0x76FE crunched data, >2 string x original name %s 0 beshort 0x76FD LZH compressed data, >2 string x original name %s # Freeze 0 string \037\237 frozen file 2.1 0 string \037\236 frozen file 1.0 (or gzip 0.5) # SCO compress -H (LZH) 0 string \037\240 SCO compress -H (LZH) data # European GSM 06.10 is a provisional standard for full-rate speech # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse # excitation/long term prediction) coding at 13 kbit/s. # # There's only a magic nibble (4 bits); that nibble repeats every 33 # bytes. This isn't suited for use, but maybe we can use it someday. # # This will cause very short GSM files to be declared as data and # mismatches to be declared as data too! #0 byte&0xF0 0xd0 data #>33 byte&0xF0 0xd0 #>66 byte&0xF0 0xd0 #>99 byte&0xF0 0xd0 #>132 byte&0xF0 0xd0 GSM 06.10 compressed audio # bzip a block-sorting file compressor # by Julian Seward and others # 0 string BZ bzip compressed data >2 byte x \b, version: %c >3 string =1 \b, compression block size 100k >3 string =2 \b, compression block size 200k >3 string =3 \b, compression block size 300k >3 string =4 \b, compression block size 400k >3 string =5 \b, compression block size 500k >3 string =6 \b, compression block size 600k >3 string =7 \b, compression block size 700k >3 string =8 \b, compression block size 800k >3 string =9 \b, compression block size 900k # lzop from 0 string \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a lzop compressed data >9 beshort <0x0940 >>9 byte&0xf0 =0x00 - version 0. >>9 beshort&0x0fff x \b%03x, >>13 byte 1 LZO1X-1, >>13 byte 2 LZO1X-1(15), >>13 byte 3 LZO1X-999, ## >>22 bedate >0 last modified: %s, >>14 byte =0x00 os: MS-DOS >>14 byte =0x01 os: Amiga >>14 byte =0x02 os: VMS >>14 byte =0x03 os: Unix >>14 byte =0x05 os: Atari >>14 byte =0x06 os: OS/2 >>14 byte =0x07 os: MacOS >>14 byte =0x0A os: Tops/20 >>14 byte =0x0B os: WinNT >>14 byte =0x0E os: Win32 >9 beshort >0x0939 >>9 byte&0xf0 =0x00 - version 0. >>9 byte&0xf0 =0x10 - version 1. >>9 byte&0xf0 =0x20 - version 2. >>9 beshort&0x0fff x \b%03x, >>15 byte 1 LZO1X-1, >>15 byte 2 LZO1X-1(15), >>15 byte 3 LZO1X-999, ## >>25 bedate >0 last modified: %s, >>17 byte =0x00 os: MS-DOS >>17 byte =0x01 os: Amiga >>17 byte =0x02 os: VMS >>17 byte =0x03 os: Unix >>17 byte =0x05 os: Atari >>17 byte =0x06 os: OS/2 >>17 byte =0x07 os: MacOS >>17 byte =0x0A os: Tops/20 >>17 byte =0x0B os: WinNT >>17 byte =0x0E os: Win32 #------------------------------------------------------------------------------ # Console game magic # Toby Deshane # ines: file(1) magic for Marat's iNES Nintendo Entertainment System # ROM dump format 0 string NES\032 iNES ROM dump, >4 byte x %dx16k PRG >5 byte x \b, %dx8k CHR >6 byte&0x01 =0x1 \b, [Vert.] >6 byte&0x01 =0x0 \b, [Horiz.] >6 byte&0x02 =0x2 \b, [SRAM] >6 byte&0x04 =0x4 \b, [Trainer] >6 byte&0x04 =0x8 \b, [4-Scr] #------------------------------------------------------------------------------ # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format # 0x104 belong 0xCEED6666 Gameboy ROM: >0x134 string >\0 "%.16s" >0x146 byte 0x03 \b,[SGB] >0x147 byte 0x00 \b, [ROM ONLY] >0x147 byte 0x01 \b, [ROM+MBC1] >0x147 byte 0x02 \b, [ROM+MBC1+RAM] >0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT] >0x147 byte 0x05 \b, [ROM+MBC2] >0x147 byte 0x06 \b, [ROM+MBC2+BATTERY] >0x147 byte 0x08 \b, [ROM+RAM] >0x147 byte 0x09 \b, [ROM+RAM+BATTERY] >0x147 byte 0x0B \b, [ROM+MMM01] >0x147 byte 0x0C \b, [ROM+MMM01+SRAM] >0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT] >0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT] >0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT] >0x147 byte 0x11 \b, [ROM+MBC3] >0x147 byte 0x12 \b, [ROM+MBC3+RAM] >0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT] >0x147 byte 0x19 \b, [ROM+MBC5] >0x147 byte 0x1A \b, [ROM+MBC5+RAM] >0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT] >0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE] >0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM] >0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT] >0x147 byte 0x1F \b, [Pocket Camera] >0x147 byte 0xFD \b, [Bandai TAMA5] >0x147 byte 0xFE \b, [Hudson HuC-3] >0x147 byte 0xFF \b, [Hudson HuC-1] >0x148 byte 0 \b, ROM: 256Kbit >0x148 byte 1 \b, ROM: 512Kbit >0x148 byte 2 \b, ROM: 1Mbit >0x148 byte 3 \b, ROM: 2Mbit >0x148 byte 4 \b, ROM: 4Mbit >0x148 byte 5 \b, ROM: 8Mbit >0x148 byte 6 \b, ROM: 16Mbit >0x148 byte 0x52 \b, ROM: 9Mbit >0x148 byte 0x53 \b, ROM: 10Mbit >0x148 byte 0x54 \b, ROM: 12Mbit >0x149 byte 1 \b, RAM: 16Kbit >0x149 byte 2 \b, RAM: 64Kbit >0x149 byte 3 \b, RAM: 128Kbit >0x149 byte 4 \b, RAM: 1Mbit #>0x14e long x \b, CRC: %x #------------------------------------------------------------------------------ # genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format # 0x100 string SEGA Sega MegaDrive/Genesis raw ROM dump >0x120 string >\0 Name: "%.16s" >0x110 string >\0 %.16s >0x1B0 string RA with SRAM #------------------------------------------------------------------------------ # genesis: file(1) magic for the Super MegaDrive ROM dump format # 0x280 string EAGN Super MagicDrive ROM dump >0 byte x %dx16k blocks >2 byte 0 \b, last in series or standalone >2 byte >0 \b, split ROM >8 byte 0xAA >9 byte 0xBB #------------------------------------------------------------------------------ # genesis: file(1) alternate magic for the Super MegaDrive ROM dump format # 0x280 string EAMG Super MagicDrive ROM dump >0 byte x %dx16k blocks >2 byte x \b, last in series or standalone >8 byte 0xAA >9 byte 0xBB #------------------------------------------------------------------------------ # smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps # # Does not detect all images. Very preliminary guesswork. Need more data # on format. # # FIXME: need a little more info...;P # #0 byte 0xF3 #>1 byte 0xED Sega Master System/Game Gear ROM dump #>1 byte 0x31 Sega Master System/Game Gear ROM dump #>1 byte 0xDB Sega Master System/Game Gear ROM dump #>1 byte 0xAF Sega Master System/Game Gear ROM dump #>1 byte 0xC3 Sega Master System/Game Gear ROM dump #------------------------------------------------------------------------------ # dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format # 0 belong 0x21068028 Sega Dreamcast VMU game image 0 string LCDi Dream Animator file #------------------------------------------------------------------------------ # v64: file(1) uncertain magic for the V64 format N64 ROM dumps # 0 belong 0x37804012 V64 Nintendo 64 ROM dump #------------------------------------------------------------------------------ # msx: file(1) magic for MSX game cartridge dumps 0 beshort 0x4142 MSX game cartridge dump #------------------------------------------------------------------------------ # convex: file(1) magic for Convex boxes # # Convexes are big-endian. # # /*\ # * Below are the magic numbers and tests added for Convex. # * Added at beginning, because they are expected to be used most. # \*/ 0 belong 0507 Convex old-style object >16 belong >0 not stripped 0 belong 0513 Convex old-style demand paged executable >16 belong >0 not stripped 0 belong 0515 Convex old-style pre-paged executable >16 belong >0 not stripped 0 belong 0517 Convex old-style pre-paged, non-swapped executable >16 belong >0 not stripped 0 belong 0x011257 Core file # # The following are a series of dump format magic numbers. Each one # corresponds to a drastically different dump format. The first on is # the original dump format on a 4.1 BSD or earlier file system. The # second marks the change between the 4.1 file system and the 4.2 file # system. The Third marks the changing of the block size from 1K # to 2K to be compatible with an IDC file system. The fourth indicates # a dump that is dependent on Convex Storage Manager, because data in # secondary storage is not physically contained within the dump. # The restore program uses these number to determine how the data is # to be extracted. # 24 belong =60011 dump format, 4.1 BSD or earlier 24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC 24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible) 24 belong =60014 dump format, Convex Storage Manager by-reference dump # # what follows is a bunch of bit-mask checks on the flags field of the opthdr. # If there is no `=' sign, assume just checking for whether the bit is set? # 0 belong 0601 Convex SOFF >88 belong&0x000f0000 =0x00000000 c1 >88 belong &0x00010000 c2 >88 belong &0x00020000 c2mp >88 belong &0x00040000 parallel >88 belong &0x00080000 intrinsic >88 belong &0x00000001 demand paged >88 belong &0x00000002 pre-paged >88 belong &0x00000004 non-swapped >88 belong &0x00000008 POSIX # >84 belong &0x80000000 executable >84 belong &0x40000000 object >84 belong&0x20000000 =0 not stripped >84 belong&0x18000000 =0x00000000 native fpmode >84 belong&0x18000000 =0x10000000 ieee fpmode >84 belong&0x18000000 =0x18000000 undefined fpmode # 0 belong 0605 Convex SOFF core # 0 belong 0607 Convex SOFF checkpoint >88 belong&0x000f0000 =0x00000000 c1 >88 belong &0x00010000 c2 >88 belong &0x00020000 c2mp >88 belong &0x00040000 parallel >88 belong &0x00080000 intrinsic >88 belong &0x00000008 POSIX # >84 belong&0x18000000 =0x00000000 native fpmode >84 belong&0x18000000 =0x10000000 ieee fpmode >84 belong&0x18000000 =0x18000000 undefined fpmode #------------------------------------------------------------------------------ # database: file(1) magic for various databases # # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk) # # # GDBM magic numbers # Will be maintained as part of the GDBM distribution in the future. # 0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian 0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian 0 string GDBM GNU dbm 2.x database # # Berkeley DB # # Ian Darwin's file /etc/magic files: big/little-endian version. # # Hash 1.85/1.86 databases store metadata in network byte order. # Btree 1.85/1.86 databases store the metadata in host byte order. # Hash and Btree 2.X and later databases store the metadata in host byte order. 0 long 0x00061561 Berkeley DB >8 belong 4321 >>4 belong >2 1.86 >>4 belong <3 1.85 >>4 belong >0 (Hash, version %d, native byte-order) >8 belong 1234 >>4 belong >2 1.86 >>4 belong <3 1.85 >>4 belong >0 (Hash, version %d, little-endian) 0 belong 0x00061561 Berkeley DB >8 belong 4321 >>4 belong >2 1.86 >>4 belong <3 1.85 >>4 belong >0 (Hash, version %d, big-endian) >8 belong 1234 >>4 belong >2 1.86 >>4 belong <3 1.85 >>4 belong >0 (Hash, version %d, native byte-order) 0 long 0x00053162 Berkeley DB 1.85/1.86 >4 long >0 (Btree, version %d, native byte-order) 0 belong 0x00053162 Berkeley DB 1.85/1.86 >4 belong >0 (Btree, version %d, big-endian) 0 lelong 0x00053162 Berkeley DB 1.85/1.86 >4 lelong >0 (Btree, version %d, little-endian) 12 long 0x00061561 Berkeley DB >16 long >0 (Hash, version %d, native byte-order) 12 belong 0x00061561 Berkeley DB >16 belong >0 (Hash, version %d, big-endian) 12 lelong 0x00061561 Berkeley DB >16 lelong >0 (Hash, version %d, little-endian) 12 long 0x00053162 Berkeley DB >16 long >0 (Btree, version %d, native byte-order) 12 belong 0x00053162 Berkeley DB >16 belong >0 (Btree, version %d, big-endian) 12 lelong 0x00053162 Berkeley DB >16 lelong >0 (Btree, version %d, little-endian) 12 long 0x00042253 Berkeley DB >16 long >0 (Queue, version %d, native byte-order) 12 belong 0x00042253 Berkeley DB >16 belong >0 (Queue, version %d, big-endian) 12 lelong 0x00042253 Berkeley DB >16 lelong >0 (Queue, version %d, little-endian) # # # Round Robin Database Tool by Tobias Oetiker 0 string RRD RRDTool DB >4 string x version %s #------------------------------------------------------------------------------ # diamond: file(1) magic for Diamond system # # ... diamond is a multi-media mail and electronic conferencing system.... # # XXX - I think it was either renamed Slate, or replaced by Slate.... # # The full deal is too long... #0 string \n Diamond Multimedia Document 0 string =\n4 string >% version %.3s # Digital UNIX - Info # 0 string !\n________64E Alpha archive >22 string X -- out of date # # Alpha COFF Based Executables # The stripped stuff really needs to be an 8 byte (64 bit) compare, # but this works 0 leshort 0x183 COFF format alpha >22 leshort&020000 &010000 sharable library, >22 leshort&020000 ^010000 dynamically linked, >24 leshort 0410 pure >24 leshort 0413 demand paged >8 lelong >0 executable or object module, not stripped >8 lelong 0 >>12 lelong 0 executable or object module, stripped >>12 lelong >0 executable or object module, not stripped >27 byte >0 - version %d. >26 byte >0 %d- >28 leshort >0 %d # # The next is incomplete, we could tell more about this format, # but its not worth it. 0 leshort 0x188 Alpha compressed COFF 0 leshort 0x18f Alpha u-code object # # # Some other interesting Digital formats, 0 string \377\377\177 ddis/ddif 0 string \377\377\174 ddis/dots archive 0 string \377\377\176 ddis/dtif table data 0 string \033c\033 LN03 output 0 long 04553207 X image # 0 string !!\n profiling data file # # Locale data tables (MIPS and Alpha). # 0 short 0x0501 locale data table >6 short 0x24 for MIPS >6 short 0x40 for Alpha #------------------------------------------------------------------------------ # dump: file(1) magic for dump file format--for new and old dump filesystems # # We specify both byte orders in order to recognize byte-swapped dumps. # 24 belong 60012 new-fs dump file (big endian), >4 bedate x Previous dump %s, >8 bedate x This dump %s, >12 belong >0 Volume %ld, >692 belong 0 Level zero, type: >692 belong >0 Level %d, type: >0 belong 1 tape header, >0 belong 2 beginning of file record, >0 belong 3 map of inodes on tape, >0 belong 4 continuation of file record, >0 belong 5 end of volume, >0 belong 6 map of inodes deleted, >0 belong 7 end of medium (for floppy), >676 string >\0 Label %s, >696 string >\0 Filesystem %s, >760 string >\0 Device %s, >824 string >\0 Host %s, >888 belong >0 Flags %x 24 belong 60011 old-fs dump file (big endian), #>4 bedate x Previous dump %s, #>8 bedate x This dump %s, >12 belong >0 Volume %ld, >692 belong 0 Level zero, type: >692 belong >0 Level %d, type: >0 belong 1 tape header, >0 belong 2 beginning of file record, >0 belong 3 map of inodes on tape, >0 belong 4 continuation of file record, >0 belong 5 end of volume, >0 belong 6 map of inodes deleted, >0 belong 7 end of medium (for floppy), >676 string >\0 Label %s, >696 string >\0 Filesystem %s, >760 string >\0 Device %s, >824 string >\0 Host %s, >888 belong >0 Flags %x 24 lelong 60012 new-fs dump file (little endian), >4 ledate x This dump %s, >8 ledate x Previous dump %s, >12 lelong >0 Volume %ld, >692 lelong 0 Level zero, type: >692 lelong >0 Level %d, type: >0 lelong 1 tape header, >0 lelong 2 beginning of file record, >0 lelong 3 map of inodes on tape, >0 lelong 4 continuation of file record, >0 lelong 5 end of volume, >0 lelong 6 map of inodes deleted, >0 lelong 7 end of medium (for floppy), >676 string >\0 Label %s, >696 string >\0 Filesystem %s, >760 string >\0 Device %s, >824 string >\0 Host %s, >888 lelong >0 Flags %x 24 lelong 60011 old-fs dump file (little endian), #>4 ledate x Previous dump %s, #>8 ledate x This dump %s, >12 lelong >0 Volume %ld, >692 lelong 0 Level zero, type: >692 lelong >0 Level %d, type: >0 lelong 1 tape header, >0 lelong 2 beginning of file record, >0 lelong 3 map of inodes on tape, >0 lelong 4 continuation of file record, >0 lelong 5 end of volume, >0 lelong 6 map of inodes deleted, >0 lelong 7 end of medium (for floppy), >676 string >\0 Label %s, >696 string >\0 Filesystem %s, >760 string >\0 Device %s, >824 string >\0 Host %s, >888 lelong >0 Flags %x #------------------------------------------------------------------------------ # elf: file(1) magic for ELF executables # # We have to check the byte order flag to see what byte order all the # other stuff in the header is in. # # MIPS R3000 may also be for MIPS R2000. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500? # # updated by Daniel Quinlan (quinlan@yggdrasil.com) 0 string \177ELF ELF >4 byte 0 invalid class >4 byte 1 32-bit # only for MIPS >>18 beshort 8 >>18 beshort 10 >>>36 belong &0x20 N32 >4 byte 2 64-bit >5 byte 0 invalid byte order >5 byte 1 LSB # only for MIPS R3000_BE >>18 leshort 8 # only for 32-bit >>>4 byte 1 >>>>36 lelong&0xf0000000 0x00000000 mips-1 >>>>36 lelong&0xf0000000 0x10000000 mips-2 >>>>36 lelong&0xf0000000 0x20000000 mips-3 >>>>36 lelong&0xf0000000 0x30000000 mips-4 >>>>36 lelong&0xf0000000 0x40000000 mips-5 >>>>36 lelong&0xf0000000 0x50000000 mips-6 # only for 64-bit >>>4 byte 2 >>>>48 lelong&0xf0000000 0x00000000 mips-1 >>>>48 lelong&0xf0000000 0x10000000 mips-2 >>>>48 lelong&0xf0000000 0x20000000 mips-3 >>>>48 lelong&0xf0000000 0x30000000 mips-4 >>>>48 lelong&0xf0000000 0x40000000 mips-5 >>>>48 lelong&0xf0000000 0x50000000 mips-6 >>16 leshort 0 no file type, >>16 leshort 1 relocatable, >>16 leshort 2 executable, >>16 leshort 3 shared object, # Core handling from Peter Tobias # corrections by Christian 'Dr. Disk' Hechelmann >>16 leshort 4 core file >>>(0x38+0xcc) string >\0 of '%s' >>>(0x38+0x10) lelong >0 (signal %d), >>16 leshort &0xff00 processor-specific, >>18 leshort 0 no machine, >>18 leshort 1 AT&T WE32100 - invalid byte order, >>18 leshort 2 SPARC - invalid byte order, >>18 leshort 3 Intel 80386, >>18 leshort 4 Motorola 68000 - invalid byte order, >>18 leshort 5 Motorola 88000 - invalid byte order, >>18 leshort 6 Intel 80486, >>18 leshort 7 Intel 80860, # "officially" big endian, but binutils bfd only emits magic #8 for MIPS. >>18 leshort 8 MIPS R3000_LE [bfd bug], >>18 leshort 9 Amdahl - invalid byte order, >>18 leshort 10 MIPS R3000_LE, >>18 leshort 11 RS6000 - invalid byte order, >>18 leshort 15 PA-RISC - invalid byte order, >>>50 leshort 0x0214 2.0 >>>48 leshort &0x0008 (LP64), >>18 leshort 16 nCUBE, >>18 leshort 17 Fujitsu VPP500, >>18 leshort 18 SPARC32PLUS, >>18 leshort 20 PowerPC, >>18 leshort 36 NEC V800, >>18 leshort 37 Fujitsu FR20, >>18 leshort 38 TRW RH-32, >>18 leshort 39 Motorola RCE, >>18 leshort 40 ARM, >>18 leshort 41 Alpha, >>18 leshort 42 Hitachi SH, >>18 leshort 43 SPARC V9 - invalid byte order, >>18 leshort 44 Siemens Tricore Embedded Processor, >>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc., >>18 leshort 46 Hitachi H8/300, >>18 leshort 47 Hitachi H8/300H, >>18 leshort 48 Hitachi H8S, >>18 leshort 49 Hitachi H8/500, >>18 leshort 50 IA-64 (Intel 64 bit architecture) >>18 leshort 51 Stanford MIPS-X, >>18 leshort 52 Motorola Coldfire, >>18 leshort 53 Motorola M68HC12, >>18 leshort 62 AMD x86-64, >>18 leshort 75 Digital VAX, >>18 leshort 0x9026 Alpha (unofficial), >>20 lelong 0 invalid version >>20 lelong 1 version 1 >>36 lelong 1 MathCoPro/FPU/MAU Required >5 byte 2 MSB # only for MIPS R3000_BE >>18 beshort 8 # only for 32-bit >>>4 byte 1 >>>>36 belong&0xf0000000 0x00000000 mips-1 >>>>36 belong&0xf0000000 0x10000000 mips-2 >>>>36 belong&0xf0000000 0x20000000 mips-3 >>>>36 belong&0xf0000000 0x30000000 mips-4 >>>>36 belong&0xf0000000 0x40000000 mips-5 >>>>36 belong&0xf0000000 0x50000000 mips-6 # only for 64-bit >>>4 byte 2 >>>>48 belong&0xf0000000 0x00000000 mips-1 >>>>48 belong&0xf0000000 0x10000000 mips-2 >>>>48 belong&0xf0000000 0x20000000 mips-3 >>>>48 belong&0xf0000000 0x30000000 mips-4 >>>>48 belong&0xf0000000 0x40000000 mips-5 >>>>48 belong&0xf0000000 0x50000000 mips-6 >>16 beshort 0 no file type, >>16 beshort 1 relocatable, >>16 beshort 2 executable, >>16 beshort 3 shared object, >>16 beshort 4 core file, >>>(0x38+0xcc) string >\0 of '%s' >>>(0x38+0x10) belong >0 (signal %d), >>16 beshort &0xff00 processor-specific, >>18 beshort 0 no machine, >>18 beshort 1 AT&T WE32100, >>18 beshort 2 SPARC, >>18 beshort 3 Intel 80386 - invalid byte order, >>18 beshort 4 Motorola 68000, >>18 beshort 5 Motorola 88000, >>18 beshort 6 Intel 80486 - invalid byte order, >>18 beshort 7 Intel 80860, >>18 beshort 8 MIPS R3000_BE, >>18 beshort 9 Amdahl, >>18 beshort 10 MIPS R3000_LE - invalid byte order, >>18 beshort 11 RS6000, >>18 beshort 15 PA-RISC >>>50 beshort 0x0214 2.0 >>>48 beshort &0x0008 (LP64) >>18 beshort 16 nCUBE, >>18 beshort 17 Fujitsu VPP500, >>18 beshort 18 SPARC32PLUS, >>>36 belong&0xffff00 &0x000100 V8+ Required, >>>36 belong&0xffff00 &0x000200 Sun UltraSPARC1 Extensions Required, >>>36 belong&0xffff00 &0x000400 HaL R1 Extensions Required, >>>36 belong&0xffff00 &0x000800 Sun UltraSPARC3 Extensions Required, >>18 beshort 20 PowerPC or cisco 4500, >>18 beshort 21 cisco 7500, >>18 beshort 24 cisco SVIP, >>18 beshort 25 cisco 7200, >>18 beshort 36 NEC V800 or cisco 12000, >>18 beshort 37 Fujitsu FR20, >>18 beshort 38 TRW RH-32, >>18 beshort 39 Motorola RCE, >>18 beshort 40 ARM, >>18 beshort 41 Alpha, >>18 beshort 42 Hitachi SH, >>18 beshort 43 SPARC V9, >>18 beshort 44 Siemens Tricore Embedded Processor, >>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc., >>18 beshort 46 Hitachi H8/300, >>18 beshort 47 Hitachi H8/300H, >>18 beshort 48 Hitachi H8S, >>18 beshort 49 Hitachi H8/500, >>18 beshort 50 Intel Merced Processor, >>18 beshort 51 Stanford MIPS-X, >>18 beshort 52 Motorola Coldfire, >>18 beshort 53 Motorola M68HC12, >>18 beshort 73 Cray NV1, >>18 beshort 75 Digital VAX, >>18 beshort 0x9026 Alpha (unofficial), >>20 belong 0 invalid version >>20 belong 1 version 1 >>36 belong 1 MathCoPro/FPU/MAU Required >8 string >\0 (%s) >8 string \0 >>7 byte 0 (SYSV) >>7 byte 1 (HP-UX) >>7 byte 2 (NetBSD) >>7 byte 3 (GNU/Linux) >>7 byte 4 (GNU/Hurd) >>7 byte 5 (86Open) >>7 byte 6 (Solaris) >>7 byte 7 (Monterey) >>7 byte 8 (IRIX) >>7 byte 9 (FreeBSD) >>7 byte 10 (Tru64) >>7 byte 11 (Novell Modesto) >>7 byte 12 (OpenBSD) >>7 byte 97 (ARM) >>7 byte 255 (embedded) #------------------------------------------------------------------------------ # encore: file(1) magic for Encore machines # # XXX - needs to have the byte order specified (NS32K was little-endian, # dunno whether they run the 88K in little-endian mode or not). # 0 short 0x154 Encore >20 short 0x107 executable >20 short 0x108 pure executable >20 short 0x10b demand-paged executable >20 short 0x10f unsupported executable >12 long >0 not stripped >22 short >0 - version %ld >22 short 0 - #>4 date x stamp %s 0 short 0x155 Encore unsupported executable >12 long >0 not stripped >22 short >0 - version %ld >22 short 0 - #>4 date x stamp %s #------------------------------------------------------------------------------ # Epoc 32 : file(1) magic for Epoc Documents [psion/osaris # Stefan Praszalowicz (hpicollo@worldnet.fr) #0 lelong 0x10000037 Epoc32 >4 lelong 0x1000006D >>8 lelong 0x1000007F Word >>8 lelong 0x10000088 Sheet >>8 lelong 0x1000007D Sketch >>8 lelong 0x10000085 TextEd #------------------------------------------------------------------------------ # filesystems: file(1) magic for different filesystems # 0 string \366\366\366\366 PC formatted floppy with no filesystem # Sun disk labels # From /usr/include/sun/dklabel.h: 0774 beshort 0xdabe Sun disk label >0 string x '%s >>31 string >\0 \b%s >>>63 string >\0 \b%s >>>>95 string >\0 \b%s >0 string x \b' >0734 short >0 %d rpm, >0736 short >0 %d phys cys, >0740 short >0 %d alts/cyl, >0746 short >0 %d interleave, >0750 short >0 %d data cyls, >0752 short >0 %d alt cyls, >0754 short >0 %d heads/partition, >0756 short >0 %d sectors/track, >0764 long >0 start cyl %ld, >0770 long x %ld blocks # Is there a boot block written 1 sector in? >512 belong&077777777 0600407 \b, boot block present 0x1FE leshort 0xAA55 x86 boot sector >2 string OSBS \b, OS/BS MBR >0x8C string Invalid\ partition\ table \b, MS-DOS MBR >0 string \0\0\0\0 \b, extended partition table >0 leshort 0x3CEB \b, system >>3 string >\0 %s >>0x36 string FAT \b, %s >>>0x39 string 12 (%s bit) >>>0x39 string 16 (%s bit) >0x52 string FAT32 \b, FAT (32 bit) >>>43 string >NO\ NAME label: %.11s, >>>43 string >>43 string NO\ NAME unlabeled, >>>19 leshort >0 %d sectors >>>19 leshort 0 >>>>32 lelong x %d sectors >0x200 lelong 0x82564557 \b, BSD disklabel # Minix filesystems - Juan Cespedes 0x410 leshort 0x137f Minix filesystem 0x410 leshort 0x138f Minix filesystem, 30 char names 0x410 leshort 0x2468 Minix filesystem, version 2 0x410 leshort 0x2478 Minix filesystem, version 2, 30 char names # romfs filesystems - Juan Cespedes 0 string -rom1fs-\0 romfs filesystem, version 1 >8 belong x %d bytes, >16 string x named %s. # netboot image - Juan Cespedes 0 lelong 0x1b031336L Netboot image, >4 lelong&0xFFFFFF00 0 >>4 lelong&0x100 0x000 mode 2 >>4 lelong&0x100 0x100 mode 3 >4 lelong&0xFFFFFF00 !0 unknown mode 0x18b string OS/2 OS/2 Boot Manager 9564 lelong 0x00011954 Unix Fast File system (little-endian), >8404 string x last mounted on %s, #>9504 ledate x last checked at %s, >8224 ledate x last written at %s, >8401 byte x clean flag %d, >8228 lelong x number of blocks %d, >8232 lelong x number of data blocks %d, >8236 lelong x number of cylinder groups %d, >8240 lelong x block size %d, >8244 lelong x fragment size %d, >8252 lelong x minimum percentage of free blocks %d, >8256 lelong x rotational delay %dms, >8260 lelong x disk rotational speed %drps, >8320 lelong 0 TIME optimization >8320 lelong 1 SPACE optimization 9564 belong 0x00011954 Unix Fast File system (big-endian), >8404 string x last mounted on %s, #>9504 bedate x last checked at %s, >8224 bedate x last written at %s, >8401 byte x clean flag %d, >8228 belong x number of blocks %d, >8232 belong x number of data blocks %d, >8236 belong x number of cylinder groups %d, >8240 belong x block size %d, >8244 belong x fragment size %d, >8252 belong x minimum percentage of free blocks %d, >8256 belong x rotational delay %dms, >8260 belong x disk rotational speed %drps, >8320 belong 0 TIME optimization >8320 belong 1 SPACE optimization # ext2/ext3 filesystems - Andreas Dilger 0x438 leshort 0xEF53 Linux >0x44c lelong x rev %d >0x43e leshort x \b.%d >0x45c lelong ^0x0000004 ext2 filesystem data >>0x43a leshort ^0x0000001 (mounted or unclean) >0x45c lelong &0x0000004 ext3 filesystem data >>0x460 lelong &0x0000004 (needs journal recovery) >0x43a leshort &0x0000002 (errors) >0x460 lelong &0x0000001 (compressed) #>0x460 lelong &0x0000002 (filetype) #>0x464 lelong &0x0000001 (sparse_super) >0x464 lelong &0x0000002 (large files) # SGI disk labels - Nathan Scott 0 belong 0x0BE5A941 SGI disk label (volume header) # SGI XFS filesystem - Nathan Scott 0 belong 0x58465342 SGI XFS filesystem data >0x4 belong x (blksz=3D%d, >0x68 beshort x inosz=3D%d, >0x64 beshort ^0x2004 v1 dirs) >0x64 beshort &0x2004 v2 dirs) #------------------------------------------------------------------------------ # flash: file(1) magic for Macromedia Flash file format # # See # # http://www.macromedia.com/software/flash/open/ # 0 string FWS Macromedia Flash data, >3 byte x version %d #------------------------------------------------------------------------------ # fonts: file(1) magic for font data # 0 string FONT ASCII vfont text 0 short 0436 Berkeley vfont data 0 short 017001 byte-swapped Berkeley vfont data # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com 0 string %!PS-AdobeFont-1.0 PostScript Type 1 font text >20 string >\0 (%s) 6 string %!PS-AdobeFont-1.0 PostScript Type 1 font program data # X11 font files in SNF (Server Natural Format) format 0 belong 00000004 X11 SNF font data, MSB first 0 lelong 00000004 X11 SNF font data, LSB first # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com) 0 string STARTFONT\040 X11 BDF font text # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com) # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides) 0 string \001fcp X11 Portable Compiled Font data >12 byte 0x02 \b, LSB first >12 byte 0x0a \b, MSB first 0 string D1.0\015 X11 Speedo font data #------------------------------------------------------------------------------ # FIGlet fonts and controlfiles # From figmagic supplied with Figlet version 2.2 # "David E. O'Brien" 0 string flf FIGlet font >3 string >2a version %-2.2s 0 string flc FIGlet controlfile >3 string >2a version %-2.2s # libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu) # Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++ 0 belong 0x14025919 libGrx font data, >8 leshort x %dx >10 leshort x \b%d >40 string x %s # Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu) 0 belong 0xff464f4e DOS code page font data collection 7 belong 0x00454741 DOS code page font data 7 belong 0x00564944 DOS code page font data (from Linux?) 4098 string DOSFONT DOSFONT2 encrypted font data # downloadable fonts for browser (prints type) anthon@mnt.org 0 string PFR1 PFR1 font >102 string >0 \b: %s #------------------------------------------------------------------------------ # frame: file(1) magic for FrameMaker files # # This stuff came on a FrameMaker demo tape, most of which is # copyright, but this file is "published" as witness the following: # 0 string \11 string 5.5 (5.5 >11 string 5.0 (5.0 >11 string 4.0 (4.0 >11 string 3.0 (3.0 >11 string 2.0 (2.0 >11 string 1.0 (1.0 >14 byte x %c) 0 string \9 string 4.0 (4.0) >9 string 3.0 (3.0) >9 string 2.0 (2.0) >9 string 1.0 (1.x) 0 string \17 string 3.0 (3.0) >17 string 2.0 (2.0) >17 string 1.0 (1.x) 0 string \17 string 1.01 (%s) 0 string \10 string 3.0 (3.0 >10 string 2.0 (2.0 >10 string 1.0 (1.0 >13 byte x %c) # XXX - this book entry should be verified, if you find one, uncomment this #0 string \6 string 3.0 (3.0) #>6 string 2.0 (2.0) #>6 string 1.0 (1.0) 0 string \= 4096 (or >4095, same thing), then it's # an executable, and is dynamically-linked if the "has run-time # loader information" bit is set. # # On x86, NetBSD says: # # If it's neither pure nor demand-paged: # # if it has the "has run-time loader information" bit set, it's # a dynamically-linked executable; # # if it doesn't have that bit set, then: # # if it has the "is position-independent" bit set, it's # position-independent; # # if the entry point is non-zero, it's an executable, otherwise # it's an object file. # # If it's pure: # # if it has the "has run-time loader information" bit set, it's # a dynamically-linked executable, otherwise it's just an # executable. # # If it's demand-paged: # # if it has the "has run-time loader information" bit set, # then: # # if the entry point is < 4096, it's a shared library; # # if the entry point is = 4096 or > 4096 (i.e., >= 4096), # it's a dynamically-linked executable); # # if it doesn't have the "has run-time loader information" bit # set, then it's just an executable. # # (On non-x86, NetBSD does much the same thing, except that it uses # 8192 on 68K - except for "68k4k", which is presumably "68K with 4K # pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's # had 8K pages; dunno about MIPS.) # # I suspect the two will differ only in perverse and uninteresting cases # ("shared" libraries that aren't demand-paged and whose pages probably # won't actually be shared, executables with entry points <4096). # # I leave it to those more familiar with FreeBSD and NetBSD to figure out # what the right answer is (although using ">4095", FreeBSD-style, is # probably better than separately checking for "=4096" and ">4096", # NetBSD-style). (The old "netbsd" file analyzed FreeBSD demand paged # executables using the NetBSD technique.) # 0 lelong&0377777777 041400407 FreeBSD/i386 >20 lelong <4096 >>3 byte&0xC0 &0x80 shared library >>3 byte&0xC0 0x40 PIC object >>3 byte&0xC0 0x00 object >20 lelong >4095 >>3 byte&0x80 0x80 dynamically linked executable >>3 byte&0x80 0x00 executable >16 lelong >0 not stripped 0 lelong&0377777777 041400410 FreeBSD/i386 pure >20 lelong <4096 >>3 byte&0xC0 &0x80 shared library >>3 byte&0xC0 0x40 PIC object >>3 byte&0xC0 0x00 object >20 lelong >4095 >>3 byte&0x80 0x80 dynamically linked executable >>3 byte&0x80 0x00 executable >16 lelong >0 not stripped 0 lelong&0377777777 041400413 FreeBSD/i386 demand paged >20 lelong <4096 >>3 byte&0xC0 &0x80 shared library >>3 byte&0xC0 0x40 PIC object >>3 byte&0xC0 0x00 object >20 lelong >4095 >>3 byte&0x80 0x80 dynamically linked executable >>3 byte&0x80 0x00 executable >16 lelong >0 not stripped 0 lelong&0377777777 041400314 FreeBSD/i386 compact demand paged >20 lelong <4096 >>3 byte&0xC0 &0x80 shared library >>3 byte&0xC0 0x40 PIC object >>3 byte&0xC0 0x00 object >20 lelong >4095 >>3 byte&0x80 0x80 dynamically linked executable >>3 byte&0x80 0x00 executable >16 lelong >0 not stripped # XXX gross hack to identify core files # cores start with a struct tss; we take advantage of the following: # byte 7: highest byte of the kernel stack pointer, always 0xfe # 8/9: kernel (ring 0) ss value, always 0x0010 # 10 - 27: ring 1 and 2 ss/esp, unused, thus always 0 # 28: low order byte of the current PTD entry, always 0 since the # PTD is page-aligned # 7 string \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 FreeBSD/i386 a.out core file >1039 string >\0 from '%s' # /var/run/ld.so.hints # What are you laughing about? 0 lelong 011421044151 ld.so hints file (Little Endian >4 lelong >0 \b, version %d) >4 belong <=0 \b) 0 belong 011421044151 ld.so hints file (Big Endian >4 belong >0 \b, version %d) >4 belong <=0 \b) # # Files generated by FreeBSD scrshot(1)/vidcontrol(1) utilities # 0 string SCRSHOT_ scrshot(1) screenshot, >8 byte x version %d, >9 byte 2 %d bytes in header, >>10 byte x %d chars wide by >>11 byte x %d chars high #------------------------------------------------------------------------------ # fsav: file(1) magic for datafellows fsav virus definition files # Anthon van der Neut (anthon@mnt.org) 0 beshort 0x1575 fsav (linux) macro virus >8 leshort >0 (%d- >11 byte >0 \b%02d- >10 byte >0 \b%02d) # comment this out for now because it regognizes every file where # the eighth character is \n #8 byte 0x0a #>12 byte 0x07 #>11 leshort >0 fsav (linux) virus (%d- #>10 byte 0 \b01- #>10 byte 1 \b02- #>10 byte 2 \b03- #>10 byte 3 \b04- #>10 byte 4 \b05- #>10 byte 5 \b06- #>10 byte 6 \b07- #>10 byte 7 \b08- #>10 byte 8 \b08- #>10 byte 9 \b10- #>10 byte 10 \b11- #>10 byte 11 \b12- #>9 byte >0 \b%02d) #------------------------------------------------------------------------------ # GIMP Gradient: file(1) magic for the GIMP's gradient data files # by Federico Mena 0 string GIMP\ Gradient GIMP gradient data #------------------------------------------------------------------------------ # XCF: file(1) magic for the XCF image format used in the GIMP developed # by Spencer Kimball and Peter Mattis # ('Bucky' LaDieu, nega@vt.edu) 0 string gimp\ xcf GIMP XCF image data, >9 string file version 0, >9 string v version >>10 string >\0 %s, >14 belong x %lu x >18 belong x %lu, >22 belong 0 RGB Color >22 belong 1 Greyscale >22 belong 2 Indexed Color >22 belong >2 Unknown Image Type. #------------------------------------------------------------------------------ # XCF: file(1) magic for the patterns used in the GIMP, developed # by Spencer Kimball and Peter Mattis # ('Bucky' LaDieu, nega@vt.edu) 20 string GPAT GIMP pattern data, >24 string x %s #------------------------------------------------------------------------------ # XCF: file(1) magic for the brushes used in the GIMP, developed # by Spencer Kimball and Peter Mattis # ('Bucky' LaDieu, nega@vt.edu) 20 string GIMP GIMP brush data # # GNU nlsutils message catalog file format # 0 string \336\22\4\225 GNU message catalog (little endian), >4 lelong x revision %d, >8 lelong x %d messages 0 string \225\4\22\336 GNU message catalog (big endian), >4 belong x revision %d, >8 belong x %d messages # message catalogs, from Mitchum DSouza 0 string *nazgul* Nazgul style compiled message catalog >8 lelong >0 \b, version %ld #------------------------------------------------------------------------------ # ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE # # ACE/gr binary 0 string \000\000\0001\000\000\0000\000\000\0000\000\000\0002\000\000\0000\000\000\0000\000\000\0003 old ACE/gr binary file >39 byte >0 - version %c # ACE/gr ascii 0 string #\ xvgr\ parameter\ file ACE/gr ascii file 0 string #\ xmgr\ parameter\ file ACE/gr ascii file 0 string #\ ACE/gr\ parameter\ file ACE/gr ascii file # Grace projects 0 string #\ Grace\ project\ file Grace project file >23 string @version\ (version >>32 byte >0 %c >>33 string >\0 \b.%.2s >>35 string >\0 \b.%.2s) # ACE/gr fit description files 0 string #\ ACE/gr\ fit\ description\ ACE/gr fit description file # end of ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE #------------------------------------------------------------------------------ # hp: file(1) magic for Hewlett Packard machines (see also "printer") # # XXX - somebody should figure out whether any byte order needs to be # applied to the "TML" stuff; I'm assuming the Apollo stuff is # big-endian as it was mostly 68K-based. # # I think the 500 series was the old stack-based machines, running a # UNIX environment atop the "SUN kernel"; dunno whether it was # big-endian or little-endian. # # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based; # hp300 are 68020+68881 based; hp400 are also 68k. The following basic # HP magic is useful for reference, but using "long" magic is a better # practice in order to avoid collisions. # # Guy Harris (guy@netapp.com): some additions to this list came from # HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1, # 1.2, and 2.0). The 1.2 and 2.0 stuff isn't in the HP-UX 10.0 # "/etc/magic", though, except for the "archive file relocatable library" # stuff, and the 68030 and 68040 stuff isn't there at all - are they not # used in executables, or have they just not yet updated "/etc/magic" # completely? # # 0 beshort 200 hp200 (68010) BSD binary # 0 beshort 300 hp300 (68020+68881) BSD binary # 0 beshort 0x20c hp200/300 HP-UX binary # 0 beshort 0x20d hp400 (68030) HP-UX binary # 0 beshort 0x20e hp400 (68040?) HP-UX binary # 0 beshort 0x20b PA-RISC1.0 HP-UX binary # 0 beshort 0x210 PA-RISC1.1 HP-UX binary # 0 beshort 0x211 PA-RISC1.2 HP-UX binary # 0 beshort 0x214 PA-RISC2.0 HP-UX binary # # The "misc" stuff needs a byte order; the archives look suspiciously # like the old 177545 archives (0xff65 = 0177545). # #### Old Apollo stuff 0 beshort 0627 Apollo m68k COFF executable >18 beshort ^040000 not stripped >22 beshort >0 - version %ld 0 beshort 0624 apollo a88k COFF executable >18 beshort ^040000 not stripped >22 beshort >0 - version %ld 0 long 01203604016 TML 0123 byte-order format 0 long 01702407010 TML 1032 byte-order format 0 long 01003405017 TML 2301 byte-order format 0 long 01602007412 TML 3210 byte-order format #### PA-RISC 1.1 0 belong 0x02100106 PA-RISC1.1 relocatable object 0 belong 0x02100107 PA-RISC1.1 executable >168 belong &0x00000004 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x02100108 PA-RISC1.1 shared executable >168 belong&0x4 0x4 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x0210010b PA-RISC1.1 demand-load executable >168 belong&0x4 0x4 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x0210010e PA-RISC1.1 shared library >96 belong >0 - not stripped 0 belong 0x0210010d PA-RISC1.1 dynamic load library >96 belong >0 - not stripped #### PA-RISC 2.0 0 belong 0x02140106 PA-RISC2.0 relocatable object 0 belong 0x02140107 PA-RISC2.0 executable >168 belong &0x00000004 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x02140108 PA-RISC2.0 shared executable >168 belong &0x00000004 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x0214010b PA-RISC2.0 demand-load executable >168 belong &0x00000004 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x0214010e PA-RISC2.0 shared library >96 belong >0 - not stripped 0 belong 0x0214010d PA-RISC2.0 dynamic load library >96 belong >0 - not stripped #### 800 0 belong 0x020b0106 PA-RISC1.0 relocatable object 0 belong 0x020b0107 PA-RISC1.0 executable >168 belong&0x4 0x4 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x020b0108 PA-RISC1.0 shared executable >168 belong&0x4 0x4 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x020b010b PA-RISC1.0 demand-load executable >168 belong&0x4 0x4 dynamically linked >(144) belong 0x054ef630 dynamically linked >96 belong >0 - not stripped 0 belong 0x020b010e PA-RISC1.0 shared library >96 belong >0 - not stripped 0 belong 0x020b010d PA-RISC1.0 dynamic load library >96 belong >0 - not stripped 0 belong 0x213c6172 archive file >68 belong 0x020b0619 - PA-RISC1.0 relocatable library >68 belong 0x02100619 - PA-RISC1.1 relocatable library >68 belong 0x02110619 - PA-RISC1.2 relocatable library >68 belong 0x02140619 - PA-RISC2.0 relocatable library #### 500 0 long 0x02080106 HP s500 relocatable executable >16 long >0 - version %ld 0 long 0x02080107 HP s500 executable >16 long >0 - version %ld 0 long 0x02080108 HP s500 pure executable >16 long >0 - version %ld #### 200 0 belong 0x020c0108 HP s200 pure executable >4 beshort >0 - version %ld >8 belong &0x80000000 save fp regs >8 belong &0x40000000 dynamically linked >8 belong &0x20000000 debuggable >36 belong >0 not stripped 0 belong 0x020c0107 HP s200 executable >4 beshort >0 - version %ld >8 belong &0x80000000 save fp regs >8 belong &0x40000000 dynamically linked >8 belong &0x20000000 debuggable >36 belong >0 not stripped 0 belong 0x020c010b HP s200 demand-load executable >4 beshort >0 - version %ld >8 belong &0x80000000 save fp regs >8 belong &0x40000000 dynamically linked >8 belong &0x20000000 debuggable >36 belong >0 not stripped 0 belong 0x020c0106 HP s200 relocatable executable >4 beshort >0 - version %ld >6 beshort >0 - highwater %d >8 belong &0x80000000 save fp regs >8 belong &0x20000000 debuggable >8 belong &0x10000000 PIC 0 belong 0x020a0108 HP s200 (2.x release) pure executable >4 beshort >0 - version %ld >36 belong >0 not stripped 0 belong 0x020a0107 HP s200 (2.x release) executable >4 beshort >0 - version %ld >36 belong >0 not stripped 0 belong 0x020c010e HP s200 shared library >4 beshort >0 - version %ld >6 beshort >0 - highwater %d >36 belong >0 not stripped 0 belong 0x020c010d HP s200 dynamic load library >4 beshort >0 - version %ld >6 beshort >0 - highwater %d >36 belong >0 not stripped #### MISC 0 long 0x0000ff65 HP old archive 0 long 0x020aff65 HP s200 old archive 0 long 0x020cff65 HP s200 old archive 0 long 0x0208ff65 HP s500 old archive 0 long 0x015821a6 HP core file 0 long 0x4da7eee8 HP-WINDOWS font >8 byte >0 - version %ld 0 string Bitmapfile HP Bitmapfile 0 string IMGfile CIS compimg HP Bitmapfile # XXX - see "lif" #0 short 0x8000 lif file 0 long 0x020c010c compiled Lisp 0 string msgcat01 HP NLS message catalog, >8 long >0 %d messages # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92 0 string HPHP48- HP48 binary >7 byte >0 - Rev %c >8 beshort 0x1129 (ADR) >8 beshort 0x3329 (REAL) >8 beshort 0x5529 (LREAL) >8 beshort 0x7729 (COMPLX) >8 beshort 0x9d29 (LCOMPLX) >8 beshort 0xbf29 (CHAR) >8 beshort 0xe829 (ARRAY) >8 beshort 0x0a2a (LNKARRAY) >8 beshort 0x2c2a (STRING) >8 beshort 0x4e2a (HXS) >8 beshort 0x742a (LIST) >8 beshort 0x962a (DIR) >8 beshort 0xb82a (ALG) >8 beshort 0xda2a (UNIT) >8 beshort 0xfc2a (TAGGED) >8 beshort 0x1e2b (GROB) >8 beshort 0x402b (LIB) >8 beshort 0x622b (BACKUP) >8 beshort 0x882b (LIBDATA) >8 beshort 0x9d2d (PROG) >8 beshort 0xcc2d (CODE) >8 beshort 0x482e (GNAME) >8 beshort 0x6d2e (LNAME) >8 beshort 0x922e (XLIB) 0 string %%HP: HP48 text >6 string T(0) - T(0) >6 string T(1) - T(1) >6 string T(2) - T(2) >6 string T(3) - T(3) >10 string A(D) A(D) >10 string A(R) A(R) >10 string A(G) A(G) >14 string F(.) F(.); >14 string F(,) F(,); # hpBSD magic numbers 0 beshort 200 hp200 (68010) BSD >2 beshort 0407 impure binary >2 beshort 0410 read-only binary >2 beshort 0413 demand paged binary 0 beshort 300 hp300 (68020+68881) BSD >2 beshort 0407 impure binary >2 beshort 0410 read-only binary >2 beshort 0413 demand paged binary # # From David Gero # HP-UX 10.20 core file format from /usr/include/sys/core.h # Unfortunately, HP-UX uses corehead blocks without specifying the order # There are four we care about: # CORE_KERNEL, which starts with the string "HP-UX" # CORE_EXEC, which contains the name of the command # CORE_PROC, which contains the signal number that caused the core dump # CORE_FORMAT, which contains the version of the core file format (== 1) # The only observed order in real core files is KERNEL, EXEC, FORMAT, PROC # but we include all 6 variations of the order of the first 3, and # assume that PROC will always be last # Order 1: KERNEL, EXEC, FORMAT, PROC 0x10 string HP-UX >0 belong 2 >>0xC belong 0x3C >>>0x4C belong 0x100 >>>>0x58 belong 0x44 >>>>>0xA0 belong 1 >>>>>>0xAC belong 4 >>>>>>>0xB0 belong 1 >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0x90 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ # Order 2: KERNEL, FORMAT, EXEC, PROC >>>0x4C belong 1 >>>>0x58 belong 4 >>>>>0x5C belong 1 >>>>>>0x60 belong 0x100 >>>>>>>0x6C belong 0x44 >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0xA4 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ # Order 3: FORMAT, KERNEL, EXEC, PROC 0x24 string HP-UX >0 belong 1 >>0xC belong 4 >>>0x10 belong 1 >>>>0x14 belong 2 >>>>>0x20 belong 0x3C >>>>>>0x60 belong 0x100 >>>>>>>0x6C belong 0x44 >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0xA4 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ # Order 4: EXEC, KERNEL, FORMAT, PROC 0x64 string HP-UX >0 belong 0x100 >>0xC belong 0x44 >>>0x54 belong 2 >>>>0x60 belong 0x3C >>>>>0xA0 belong 1 >>>>>>0xAC belong 4 >>>>>>>0xB0 belong 1 >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0x44 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ # Order 5: FORMAT, EXEC, KERNEL, PROC 0x78 string HP-UX >0 belong 1 >>0xC belong 4 >>>0x10 belong 1 >>>>0x14 belong 0x100 >>>>>0x20 belong 0x44 >>>>>>0x68 belong 2 >>>>>>>0x74 belong 0x3C >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0x58 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ # Order 6: EXEC, FORMAT, KERNEL, PROC >0 belong 0x100 >>0xC belong 0x44 >>>0x54 belong 1 >>>>0x60 belong 4 >>>>>0x64 belong 1 >>>>>>0x68 belong 2 >>>>>>>0x74 belong 0x2C >>>>>>>>0xB4 belong 4 core file >>>>>>>>>0x44 string >\0 from '%s' >>>>>>>>>0xC4 belong 3 - received SIGQUIT >>>>>>>>>0xC4 belong 4 - received SIGILL >>>>>>>>>0xC4 belong 5 - received SIGTRAP >>>>>>>>>0xC4 belong 6 - received SIGABRT >>>>>>>>>0xC4 belong 7 - received SIGEMT >>>>>>>>>0xC4 belong 8 - received SIGFPE >>>>>>>>>0xC4 belong 10 - received SIGBUS >>>>>>>>>0xC4 belong 11 - received SIGSEGV >>>>>>>>>0xC4 belong 12 - received SIGSYS >>>>>>>>>0xC4 belong 33 - received SIGXCPU >>>>>>>>>0xC4 belong 34 - received SIGXFSZ #------------------------------------------------------------------------------ # ibm370: file(1) magic for IBM 370 and compatibles. # # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable". # What the heck *is* "USS/370"? # AIX 4.1's "/etc/magic" has # # 0 short 0535 370 sysV executable # >12 long >0 not stripped # >22 short >0 - version %d # >30 long >0 - 5.2 format # 0 short 0530 370 sysV pure executable # >12 long >0 not stripped # >22 short >0 - version %d # >30 long >0 - 5.2 format # # instead of the "USS/370" versions of the same magic numbers. # 0 beshort 0537 370 XA sysV executable >12 belong >0 not stripped >22 beshort >0 - version %d >30 belong >0 - 5.2 format 0 beshort 0532 370 XA sysV pure executable >12 belong >0 not stripped >22 beshort >0 - version %d >30 belong >0 - 5.2 format 0 beshort 054001 370 sysV pure executable >12 belong >0 not stripped 0 beshort 055001 370 XA sysV pure executable >12 belong >0 not stripped 0 beshort 056401 370 sysV executable >12 belong >0 not stripped 0 beshort 057401 370 XA sysV executable >12 belong >0 not stripped 0 beshort 0531 SVR2 executable (Amdahl-UTS) >12 belong >0 not stripped >24 belong >0 - version %ld 0 beshort 0534 SVR2 pure executable (Amdahl-UTS) >12 belong >0 not stripped >24 belong >0 - version %ld 0 beshort 0530 SVR2 pure executable (USS/370) >12 belong >0 not stripped >24 belong >0 - version %ld 0 beshort 0535 SVR2 executable (USS/370) >12 belong >0 not stripped >24 belong >0 - version %ld #------------------------------------------------------------------------------ # ibm6000: file(1) magic for RS/6000 and the RT PC. # 0 beshort 0x01df executable (RISC System/6000 V3.1) or obj module >12 belong >0 not stripped # Breaks sun4 statically linked execs. #0 beshort 0x0103 executable (RT Version 2) or obj module #>2 byte 0x50 pure #>28 belong >0 not stripped #>6 beshort >0 - version %ld 0 beshort 0x0104 shared library 0 beshort 0x0105 ctab data 0 beshort 0xfe04 structured file 0 string 0xabcdef AIX message catalog 0 belong 0x000001f9 AIX compiled message catalog 0 string \ archive #------------------------------------------------------------------------------ # iff: file(1) magic for Interchange File Format (see also "audio" & "images") # # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic # Arts for file interchange. It has also been used by Apple, SGI, and # especially Commodore-Amiga. # # IFF files begin with an 8 byte FORM header, followed by a 4 character # FORM type, which is followed by the first chunk in the FORM. 0 string FORM IFF data #>4 belong x \b, FORM is %d bytes long # audio formats >8 string AIFF \b, AIFF audio >8 string AIFC \b, AIFF-C compressed audio >8 string 8SVX \b, 8SVX 8-bit sampled sound voice >8 string SAMP \b, SAMP sampled audio # image formats >8 string ILBMBMHD \b, ILBM interleaved image >>20 beshort x \b, %d x >>22 beshort x %d >8 string RGBN \b, RGBN 12-bit RGB image >8 string RGB8 \b, RGB8 24-bit RGB image >8 string DR2D \b, DR2D 2-D object >8 string TDDD \b, TDDD 3-D rendering # other formats >8 string FTXT \b, FTXT formatted text #------------------------------------------------------------------------------ # images: file(1) magic for image formats (see also "iff") # # originally from jef@helios.ee.lbl.gov (Jef Poskanzer), # additions by janl@ifi.uio.no as well as others. Jan also suggested # merging several one- and two-line files into here. # # little magic: PCX (first byte is 0x0a) # Targa - matches `povray', `ppmtotga' and `xv' outputs # by Philippe De Muyter # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11 # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs # `xv' recognizes only a subset of the following (RGB with pixelsize = 24) # `tgatoppm' recognizes a superset (Index may be anything) 1 belong&0xfff7ffff 0x01010000 Targa image data - Map >2 byte&8 8 - RLE 1 belong&0xfff7ffff 0x00020000 Targa image data - RGB >2 byte&8 8 - RLE 1 belong&0xfff7ffff 0x00030000 Targa image data - Mono >2 byte&8 8 - RLE # PBMPLUS images # The next byte following the magic is always whitespace. 0 string P1 Netpbm PBM image text 0 string P2 Netpbm PGM image text 0 string P3 Netpbm PPM image text 0 string P4 Netpbm PBM "rawbits" image data 0 string P5 Netpbm PGM "rawbits" image data 0 string P6 Netpbm PPM "rawbits" image data 0 string P7 Netpbm PAM image file # From: bryanh@giraffe-data.com (Bryan Henderson) 0 string \117\072 Solitaire Image Recorder format >4 string \013 MGI Type 11 >4 string \021 MGI Type 17 0 string .MDA MicroDesign data >21 byte 48 version 2 >21 byte 51 version 3 0 string .MDP MicroDesign page data >21 byte 48 version 2 >21 byte 51 version 3 # NIFF (Navy Interchange File Format, a modification of TIFF) images 0 string IIN1 NIFF image data # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com) # The second word of TIFF files is the TIFF version number, 42, which has # never changed. The TIFF specification recommends testing for it. 0 string MM\x00\x2a TIFF image data, big-endian 0 string II\x2a\x00 TIFF image data, little-endian # PNG [Portable Network Graphics, or "PNG's Not GIF"] images # (Greg Roelofs, newt@uchicago.edu) # (Albert Cahalan, acahalan@cs.uml.edu) # # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ... # 0 string \x89PNG PNG image data, >4 belong !0x0d0a1a0a CORRUPTED, >4 belong 0x0d0a1a0a >>16 belong x %ld x >>20 belong x %ld, >>24 byte x %d-bit >>25 byte 0 grayscale, >>25 byte 2 \b/color RGB, >>25 byte 3 colormap, >>25 byte 4 gray+alpha, >>25 byte 6 \b/color RGBA, #>>26 byte 0 deflate/32K, >>28 byte 0 non-interlaced >>28 byte 1 interlaced 1 string PNG PNG image data, CORRUPTED # GIF 0 string GIF8 GIF image data >4 string 7a \b, version 8%s, >4 string 9a \b, version 8%s, >6 leshort >0 %hd x >8 leshort >0 %hd, #>10 byte &0x80 color mapped, #>10 byte&0x07 =0x00 2 colors #>10 byte&0x07 =0x01 4 colors #>10 byte&0x07 =0x02 8 colors #>10 byte&0x07 =0x03 16 colors #>10 byte&0x07 =0x04 32 colors #>10 byte&0x07 =0x05 64 colors #>10 byte&0x07 =0x06 128 colors #>10 byte&0x07 =0x07 256 colors # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster, # 1 plane, no encoding. 0 string \361\0\100\273 CMU window manager raster image data >4 lelong >0 %d x >8 lelong >0 %d, >12 lelong >0 %d-bit # Magick Image File Format 0 string id=ImageMagick MIFF image data # Artisan 0 long 1123028772 Artisan image data >4 long 1 \b, rectangular 24-bit >4 long 2 \b, rectangular 8-bit with colormap >4 long 3 \b, rectangular 32-bit (24-bit with matte) # FIG (Facility for Interactive Generation of figures), an object-based format 0 string #FIG FIG image text >5 string x \b, version %.3s # PHIGS 0 string ARF_BEGARF PHIGS clear text archive 0 string @(#)SunPHIGS SunPHIGS # version number follows, in the form m.n >40 string SunBin binary >32 string archive archive # GKS (Graphics Kernel System) 0 string GKSM GKS Metafile >24 string SunGKS \b, SunGKS # CGM image files 0 string BEGMF clear text Computer Graphics Metafile # XXX - questionable magic 0 beshort&0xffe0 0x0020 binary Computer Graphics Metafile 0 beshort 0x3020 character Computer Graphics Metafile # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de) 0 string yz MGR bitmap, modern format, 8-bit aligned 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned 0 string yx MGR bitmap, modern format, squeezed # Fuzzy Bitmap (FBM) images 0 string %bitmap\0 FBM image data >30 long 0x31 \b, mono >30 long 0x33 \b, color # facsimile data 1 string PC\ Research,\ Inc group 3 fax data >29 byte 0 \b, normal resolution (204x98 DPI) >29 byte 1 \b, fine resolution (204x196 DPI) # PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, newt@uchicago.edu) 0 string BM PC bitmap data >14 leshort 12 \b, OS/2 1.x format >>18 leshort x \b, %d x >>20 leshort x %d >14 leshort 64 \b, OS/2 2.x format >>18 leshort x \b, %d x >>20 leshort x %d >14 leshort 40 \b, Windows 3.x format >>18 lelong x \b, %d x >>22 lelong x %d x >>28 leshort x %d 0 string IC PC icon data 0 string PI PC pointer image data 0 string CI PC color icon data 0 string CP PC color pointer image data # Conflicts with other entries [BABYL] #0 string BA PC bitmap array data # XPM icons (Greg Roelofs, newt@uchicago.edu) # note possible collision with C/REXX entry in c-lang; currently commented out 0 string /*\ XPM\ */ X pixmap image text # Utah Raster Toolkit RLE images (janl@ifi.uio.no) 0 leshort 0xcc52 RLE image data, >6 leshort x %d x >8 leshort x %d >2 leshort >0 \b, lower left corner: %d >4 leshort >0 \b, lower right corner: %d >10 byte&0x1 =0x1 \b, clear first >10 byte&0x2 =0x2 \b, no background >10 byte&0x4 =0x4 \b, alpha channel >10 byte&0x8 =0x8 \b, comment >11 byte >0 \b, %d color channels >12 byte >0 \b, %d bits per pixel >13 byte >0 \b, %d color map channels # image file format (Robert Potter, potter@cs.rochester.edu) 0 string Imagefile\ version- iff image data # this adds the whole header (inc. version number), informative but longish >10 string >\0 %s # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com) 0 belong 0x59a66a95 Sun raster image data >4 belong >0 \b, %d x >8 belong >0 %d, >12 belong >0 %d-bit, #>16 belong >0 %d bytes long, >20 belong 0 old format, #>20 belong 1 standard, >20 belong 2 compressed, >20 belong 3 RGB, >20 belong 4 TIFF, >20 belong 5 IFF, >20 belong 0xffff reserved for testing, >24 belong 0 no colormap >24 belong 1 RGB colormap >24 belong 2 raw colormap #>28 belong >0 colormap is %d bytes long # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com) # # See # http://reality.sgi.com/grafica/sgiimage.html # 0 beshort 474 SGI image data #>2 byte 0 \b, verbatim >2 byte 1 \b, RLE #>3 byte 1 \b, normal precision >3 byte 2 \b, high precision >4 beshort x \b, %d-D >6 beshort x \b, %d x >8 beshort x %d >10 beshort x \b, %d channel >10 beshort !1 \bs >80 string >0 \b, "%s" 0 string IT01 FIT image data >4 belong x \b, %d x >8 belong x %d x >12 belong x %d # 0 string IT02 FIT image data >4 belong x \b, %d x >8 belong x %d x >12 belong x %d # 2048 string PCD_IPI Kodak Photo CD image pack file >0xe02 byte&0x03 0x00 , landscape mode >0xe02 byte&0x03 0x01 , portrait mode >0xe02 byte&0x03 0x02 , landscape mode >0xe02 byte&0x03 0x03 , portrait mode 0 string PCD_OPA Kodak Photo CD overview pack file # FITS format. Jeff Uphoff # FITS is the Flexible Image Transport System, the de facto standard for # data and image transfer, storage, etc., for the astronomical community. # (FITS floating point formats are big-endian.) 0 string SIMPLE\ \ = FITS image data >109 string 8 \b, 8-bit, character or unsigned binary integer >108 string 16 \b, 16-bit, two's complement binary integer >107 string \ 32 \b, 32-bit, two's complement binary integer >107 string -32 \b, 32-bit, floating point, single precision >107 string -64 \b, 64-bit, floating point, double precision # other images 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file 0 string !! Bennet Yee's "face" format # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image # stuff. # 0 beshort 0x1010 PEX Binary Archive # Visio drawings 03000 string Visio\ (TM)\ Drawing %s # Tgif files 0 string \%TGIF\ x Tgif file version %s # DICOM medical imaging data 128 string DICM DICOM medical imaging data # XWD - X-Windows Dump file. # As described in /usr/X11R6/include/X11/XWDFile.h # used by the xwd program. # Bradford Castalia, idaeim, 1/01 4 belong 7 XWD X-Windows Dump image data >100 string >\0 \b, "%s" >16 belong x \b, %dx >20 belong x \b%dx >12 belong x \b%d # PDS - Planetary Data System # These files use Parameter Value Language in the header section. # Unfortunately, there is no certain magic, but the following # strings have been found to be most likely. 0 string NJPL1I00 PDS (JPL) image data 2 string NJPL1I PDS (JPL) image data 0 string CCSD3ZF PDS (CCSD) image data 2 string CCSD3Z PDS (CCSD) image data 0 string PDS_ PDS image data 0 string LBLSIZE= PDS (VICAR) image data # pM8x: ATARI STAD compressed bitmap format # # from Oskar Schirmer Feb 2, 2001 # p M 8 5/6 xx yy zz data... # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed. # bytes either run horizontally (pM85) or vertically (pM86). yy is the # most frequent byte, xx and zz are runlength escape codes, where xx is # used for runs of yy. # 0 string pM85 Atari ST STAD bitmap image data (hor) >5 byte 0x00 (white background) >5 byte 0xFF (black background) 0 string pM86 Atari ST STAD bitmap image data (vert) >5 byte 0x00 (white background) >5 byte 0xFF (black background) # XXX: # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other # magic. # SGI RICE image file #0 beshort 0x5249 RICE image #>2 beshort x v%d #>4 beshort x (%d x #>6 beshort x %d) #>8 beshort 0 8 bit #>8 beshort 1 10 bit #>8 beshort 2 12 bit #>8 beshort 3 13 bit #>10 beshort 0 4:2:2 #>10 beshort 1 4:2:2:4 #>10 beshort 2 4:4:4 #>10 beshort 3 4:4:4:4 #>12 beshort 1 RGB #>12 beshort 2 CCIR601 #>12 beshort 3 RP175 #>12 beshort 4 YUV #------------------------------------------------------------------------------ # # Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image file format # for the EPOC operating system, which is used with PDAs like those from Psion # # see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description # of various EPOC file formats 0 string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file #------------------------------------------------------------------------------ # intel: file(1) magic for x86 Unix # # Various flavors of x86 UNIX executable/object (other than Xenix, which # is in "microsoft"). DOS is in "msdos"; the ambitious soul can do # Windows as well. # # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and # whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere # as well, if, as, and when IBM makes it portable. # # The `versions' should be un-commented if they work for you. # (Was the problem just one of endianness?) # 0 leshort 0502 basic-16 executable >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0503 basic-16 executable (TV) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort 0510 x86 executable >12 lelong >0 not stripped 0 leshort 0511 x86 executable (TV) >12 lelong >0 not stripped 0 leshort =0512 iAPX 286 executable small model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld 0 leshort =0522 iAPX 286 executable large model (COFF) >12 lelong >0 not stripped #>22 leshort >0 - version %ld # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 0 leshort =0514 80386 COFF executable >12 lelong >0 not stripped >22 leshort >0 - version %ld #------------------------------------------------------------------------------ # interleaf: file(1) magic for InterLeaf TPS: # 0 string =\210OPS Interleaf saved data 0 string =5 string ,\ Version\ = \b, version >>17 string >\0 %.3s #------------------------------------------------------------------------------ # island: file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1 # "/etc/magic": # From: guy@netapp.com (Guy Harris) # 4 string pgscriptver IslandWrite document 13 string DrawFile IslandDraw document #------------------------------------------------------------------------------ # ispell: file(1) magic for ispell # # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602. This magic # will match 0x9600 through 0x9603 in *both* little endian and big endian. # (No other current magic entries collide.) # # Updated by Daniel Quinlan (quinlan@yggdrasil.com) # 0 leshort&0xFFFC 0x9600 little endian ispell >0 byte 0 hash file (?), >0 byte 1 3.0 hash file, >0 byte 2 3.1 hash file, >0 byte 3 hash file (?), >2 leshort 0x00 8-bit, no capitalization, 26 flags >2 leshort 0x01 7-bit, no capitalization, 26 flags >2 leshort 0x02 8-bit, capitalization, 26 flags >2 leshort 0x03 7-bit, capitalization, 26 flags >2 leshort 0x04 8-bit, no capitalization, 52 flags >2 leshort 0x05 7-bit, no capitalization, 52 flags >2 leshort 0x06 8-bit, capitalization, 52 flags >2 leshort 0x07 7-bit, capitalization, 52 flags >2 leshort 0x08 8-bit, no capitalization, 128 flags >2 leshort 0x09 7-bit, no capitalization, 128 flags >2 leshort 0x0A 8-bit, capitalization, 128 flags >2 leshort 0x0B 7-bit, capitalization, 128 flags >2 leshort 0x0C 8-bit, no capitalization, 256 flags >2 leshort 0x0D 7-bit, no capitalization, 256 flags >2 leshort 0x0E 8-bit, capitalization, 256 flags >2 leshort 0x0F 7-bit, capitalization, 256 flags >4 leshort >0 and %d string characters 0 beshort&0xFFFC 0x9600 big endian ispell >1 byte 0 hash file (?), >1 byte 1 3.0 hash file, >1 byte 2 3.1 hash file, >1 byte 3 hash file (?), >2 beshort 0x00 8-bit, no capitalization, 26 flags >2 beshort 0x01 7-bit, no capitalization, 26 flags >2 beshort 0x02 8-bit, capitalization, 26 flags >2 beshort 0x03 7-bit, capitalization, 26 flags >2 beshort 0x04 8-bit, no capitalization, 52 flags >2 beshort 0x05 7-bit, no capitalization, 52 flags >2 beshort 0x06 8-bit, capitalization, 52 flags >2 beshort 0x07 7-bit, capitalization, 52 flags >2 beshort 0x08 8-bit, no capitalization, 128 flags >2 beshort 0x09 7-bit, no capitalization, 128 flags >2 beshort 0x0A 8-bit, capitalization, 128 flags >2 beshort 0x0B 7-bit, capitalization, 128 flags >2 beshort 0x0C 8-bit, no capitalization, 256 flags >2 beshort 0x0D 7-bit, no capitalization, 256 flags >2 beshort 0x0E 8-bit, capitalization, 256 flags >2 beshort 0x0F 7-bit, capitalization, 256 flags >4 beshort >0 and %d string characters # ispell 4.0 hash files kromJx # Ispell 4.0 0 string ISPL ispell >4 long x hash file version %d, >8 long x lexletters %d, >12 long x lexsize %d, >16 long x hashsize %d, >20 long x stblsize %d #------------------------------------------------------------ # Java ByteCode # From Larry Schwimmer (schwim@cs.stanford.edu) 0 belong 0xcafebabe compiled Java class data, >6 beshort x version %d. >4 beshort x \b%d #------------------------------------------------------------ # Java serialization # From Martin Pool (m.pool@pharos.com.au) 0 beshort 0xaced Java serialization data >2 beshort >0x0004 \b, version %d #------------------------------------------------------------------------------ # JPEG images # SunOS 5.5.1 had # # 0 string \377\330\377\340 JPEG file # 0 string \377\330\377\356 JPG file # # both of which turn into "JPEG image data" here. # 0 beshort 0xffd8 JPEG image data >6 string JFIF \b, JFIF standard >6 string Exif \b, EXIF standard # The following added by Erik Rossen 1999-09-06 # in a vain attempt to add image size reporting for JFIF. Note that these # tests are not fool-proof since some perfectly valid JPEGs are currently # impossible to specify in magic(4) format. # First, a little JFIF version info: >11 byte x \b %d. >12 byte x \b%02d # Next, the resolution or aspect ratio of the image: >13 byte 0 \b, aspect ratio >13 byte 1 \b, resolution (DPI) >13 byte 2 \b, resolution (DPCM) #>4 beshort x \b, segment length %d # Next, show thumbnail info, if it exists: >18 byte !0 \b, thumbnail %dx >>19 byte x \b%d # Here things get sticky. We can do ONE MORE marker segment with # indirect addressing, and that's all. It would be great if we could # do pointer arithemetic like in an assembler language. Christos? # And if there was some sort of looping construct to do searches, plus a few # named accumulators, it would be even more effective... # At least we can show a comment if no other segments got inserted before: >(4.S+5) byte 0xFE >>(4.S+8) string >\0 \b, "%s" #>(4.S+5) byte 0xFE \b, comment #>>(4.S+6) beshort x \b length=%d #>>(4.S+8) string >\0 \b, "%s" # Or, we can show the encoding type (I've included only the three most common) # and image dimensions if we are lucky and the SOFn (image segment) is here: >(4.S+5) byte 0xC0 \b, baseline >>(4.S+6) byte x \b, precision %d >>(4.S+7) beshort x \b, %dx >>(4.S+9) beshort x \b%d >(4.S+5) byte 0xC1 \b, extended sequential >>(4.S+6) byte x \b, precision %d >>(4.S+7) beshort x \b, %dx >>(4.S+9) beshort x \b%d >(4.S+5) byte 0xC2 \b, progressive >>(4.S+6) byte x \b, precision %d >>(4.S+7) beshort x \b, %dx >>(4.S+9) beshort x \b%d # I've commented-out quantisation table reporting. I doubt anyone cares yet. #>(4.S+5) byte 0xDB \b, quantisation table #>>(4.S+6) beshort x \b length=%d >14 beshort x \b, %d x >16 beshort x \b %d # HSI is Handmade Software's proprietary JPEG encoding scheme 0 string hsi1 JPEG image data, HSI proprietary #------------------------------------------------------------------------------ # karma: file(1) magic for Karma data files # # From 0 string KarmaRHD Version Karma Data Structure Version >16 belong x %lu #------------------------------------------------------------------------------ # DEC SRC Virtual Paper: Lectern files # Karl M. Hegbloom 0 string lect DEC SRC Virtual Paper Lectern file #------------------------------------------------------------------------------ # lex: file(1) magic for lex # # derived empirically, your offsets may vary! 53 string yyprevious C program text (from lex) >3 string >\0 for %s # C program text from GNU flex, from Daniel Quinlan 21 string generated\ by\ flex C program text (from flex) # lex description file, from Daniel Quinlan 0 string %{ lex description text #------------------------------------------------------------------------------ # lif: file(1) magic for lif # # (Daniel Quinlan ) # 0 beshort 0x8000 lif file #------------------------------------------------------------------------------ # linux: file(1) magic for Linux files # # Values for Linux/i386 binaries, from Daniel Quinlan # The following basic Linux magic is useful for reference, but using # "long" magic is a better practice in order to avoid collisions. # # 2 leshort 100 Linux/i386 # >0 leshort 0407 impure executable (OMAGIC) # >0 leshort 0410 pure executable (NMAGIC) # >0 leshort 0413 demand-paged executable (ZMAGIC) # >0 leshort 0314 demand-paged executable (QMAGIC) # 0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC) >16 lelong 0 \b, stripped 0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC) >16 lelong 0 \b, stripped 0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC) >16 lelong 0 \b, stripped 0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC) >16 lelong 0 \b, stripped # 0 string \007\001\000 Linux/i386 object file >20 lelong >0x1020 \b, DLL library # Linux-8086 stuff: 0 string \01\03\020\04 Linux-8086 impure executable >28 long !0 not stripped 0 string \01\03\040\04 Linux-8086 executable >28 long !0 not stripped # 0 string \243\206\001\0 Linux-8086 object file # 0 string \01\03\020\20 Minix-386 impure executable >28 long !0 not stripped 0 string \01\03\040\20 Minix-386 executable >28 long !0 not stripped # core dump file, from Bill Reynolds 216 lelong 0421 Linux/i386 core file >220 string >\0 of '%s' >200 lelong >0 (signal %d) # # LILO boot/chain loaders, from Daniel Quinlan # this can be overridden by the DOS executable (COM) entry 2 string LILO Linux/i386 LILO boot/chain loader # # Debian Packages, from Peter Tobias 0 string 0.9 >8 byte 0x0a old Debian Binary Package >>3 byte >0 \b, created by dpkg 0.9%c >>4 byte >0 pl%c # PSF fonts, from H. Peter Anvin 0 leshort 0x0436 Linux/i386 PC Screen Font data, >2 byte 0 256 characters, no directory, >2 byte 1 512 characters, no directory, >2 byte 2 256 characters, Unicode directory, >2 byte 3 512 characters, Unicode directory, >3 byte >0 8x%d # Linux swap file, from Daniel Quinlan 4086 string SWAP-SPACE Linux/i386 swap file # ECOFF magic for OSF/1 and Linux (only tested under Linux though) # # from Erik Troan (ewt@redhat.com) examining od dumps, so this # could be wrong # updated by David Mosberger (davidm@azstarnet.com) based on # GNU BFD and MIPS info found below. # 0 leshort 0x0183 ECOFF alpha >24 leshort 0407 executable >24 leshort 0410 pure >24 leshort 0413 demand paged >8 long >0 not stripped >8 long 0 stripped >23 leshort >0 - version %ld. # # Linux kernel boot images, from Albert Cahalan # and others such as Axel Kohlmeyer # and Nicolás Lichtmaier # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29 514 string HdrS Linux kernel >518 leshort >0 >>529 byte 0 zImage data, >>529 byte 1 bzImage data, >0x048c byte 0x31 >>0x048c string x version %s >0x0493 byte 0x31 >>0x0493 string x version %s >0x048c byte 0x32 >>0x048c string x version %s >0x0493 byte 0x32 >>0x0493 string x version %s >0x04df byte 0x32 >>0x04df string x version %s >0x04fb byte 0x32 >>0x04fb string x version %s # This also matches new kernels, which were caught above by "HdrS". 0 belong 0xb8c0078e Linux kernel >0x1e3 string Loading version 1.3.79 or older >0x1e9 string Loading from prehistoric times # LSM entries - Nicolás Lichtmaier 0 string Begin3 Linux Software Map entry text #------------------------------------------------------------------------------ # lisp: file(1) magic for lisp programs # # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com) 0 string ;; Lisp/Scheme program text # Emacs 18 - this is always correct, but not very magical. 0 string \012( byte-compiled Emacs-Lisp program data # Emacs 19+ - ver. recognition added by Ian Springer 0 string ;ELC byte-compiled Emacs-Lisp program data, >4 byte >0 version %d # # Files produced by CLISP Common Lisp From: Bruno Haible 0 string (SYSTEM::VERSION\040' CLISP byte-compiled Lisp program text 0 long 0x70768BD2 CLISP memory image data 0 long 0xD28B7670 CLISP memory image data, other endian # Files produced by GNU gettext 0 long 0xDE120495 GNU-format message catalog data 0 long 0x950412DE GNU-format message catalog data #.com and .bin for MIT scheme 0 string \372\372\372\372 MIT scheme (library?) #------------------------------------------------------------------------------ # mach file description # 0 belong 0xcafebabe Mach-O fat file >4 belong 1 with 1 architecture >4 belong >1 >>4 belong x with %ld architectures # 0 belong 0xfeedface Mach-O >12 belong 1 object >12 belong 2 executable >12 belong 3 shared library >12 belong 4 core >12 belong 5 preload executable >12 belong >5 >>12 belong x filetype=%ld >4 belong <0 >>4 belong x architecture=%ld >4 belong 1 vax >4 belong 2 romp >4 belong 3 architecture=3 >4 belong 4 ns32032 >4 belong 5 ns32332 >4 belong 6 for m68k architecture # from NeXTstep 3.0 # i.e. mc680x0_all, ignore # >>8 belong 1 (mc68030) >>8 belong 2 (mc68040) >>8 belong 3 (mc68030 only) >4 belong 7 i386 >4 belong 8 mips >4 belong 9 ns32532 >4 belong 10 architecture=10 >4 belong 11 hp pa-risc >4 belong 12 acorn >4 belong 13 m88k >4 belong 14 SPARC >4 belong 15 i860-big >4 belong 16 i860 >4 belong 17 rs6000 >4 belong 18 powerPC >4 belong >18 >>4 belong x architecture=%ld #------------------------------------------------------------------------------ # macintosh description # # BinHex is the Macintosh ASCII-encoded file format (see also "apple") # Daniel Quinlan, quinlan@yggdrasil.com 11 string must\ be\ converted\ with\ BinHex BinHex binary text >41 string x \b, version %.3s # Stuffit archives are the de facto standard of compression for Macintosh # files obtained from most archives. (franklsm@tuns.ca) 0 string SIT! StuffIt Archive (data) >2 string x : %s 0 string SITD StuffIt Deluxe (data) >2 string x : %s 0 string Seg StuffIt Deluxe Segment (data) >2 string x : %s # Macintosh Applications and Installation binaries (franklsm@tuns.ca) 0 string APPL Macintosh Application (data) >2 string x \b: %s # Macintosh System files (franklsm@tuns.ca) 0 string zsys Macintosh System File (data) 0 string FNDR Macintosh Finder (data) 0 string libr Macintosh Library (data) >2 string x : %s 0 string shlb Macintosh Shared Library (data) >2 string x : %s 0 string cdev Macintosh Control Panel (data) >2 string x : %s 0 string INIT Macintosh Extension (data) >2 string x : %s 0 string FFIL Macintosh Truetype Font (data) >2 string x : %s 0 string LWFN Macintosh Postscript Font (data) >2 string x : %s # Additional Macintosh Files (franklsm@tuns.ca) 0 string PACT Macintosh Compact Pro Archive (data) >2 string x : %s 0 string ttro Macintosh TeachText File (data) >2 string x : %s 0 string TEXT Macintosh TeachText File (data) >2 string x : %s 0 string PDF Macintosh PDF File (data) >2 string x : %s # MacBinary format (Eric Fischer, enf@pobox.com) # # Unfortunately MacBinary doesn't really have a magic number prior # to the MacBinary III format. The checksum is really the way to # do it, but the magic file format isn't up to the challenge. # # 0 byte 0 # 1 byte # filename length # 2 string # filename # 65 string # file type # 69 string # file creator # 73 byte # Finder flags # 74 byte 0 # 75 beshort # vertical posn in window # 77 beshort # horiz posn in window # 79 beshort # window or folder ID # 81 byte # protected? # 82 byte 0 # 83 belong # length of data segment # 87 belong # length of resource segment # 91 belong # file creation date # 95 belong # file modification date # 99 beshort # length of comment after resource # 101 byte # new Finder flags # 102 string mBIN # (only in MacBinary III) # 106 byte # char. code of file name # 107 byte # still more Finder flags # 116 belong # total file length # 120 beshort # length of add'l header # 122 byte 129 # for MacBinary II # 122 byte 130 # for MacBinary III # 123 byte 129 # minimum version that can read fmt # 124 beshort # checksum # # This attempts to use the version numbers as a magic number, requiring # that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second # be 0x81. This works for the files I have, but maybe not for everyone's. 122 beshort&0xFCFF 0x8081 Macintosh MacBinary data # MacBinary I doesn't have the version number field at all, but MacBinary II # has been in use since 1987 so I hope there aren't many really old files # floating around that this will miss. The original spec calls for using # the nulls in 0, 74, and 82 as the magic number. # # Another possibility, that would also work for MacBinary I, is to use # the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will # have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset, # and that 74 will be 0. So something like # # 71 belong&0x80804EFF 0x00000000 Macintosh MacBinary data # # >73 byte&0x01 0x01 \b, inited # >73 byte&0x02 0x02 \b, changed # >73 byte&0x04 0x04 \b, busy # >73 byte&0x08 0x08 \b, bozo # >73 byte&0x10 0x10 \b, system # >73 byte&0x10 0x20 \b, bundle # >73 byte&0x10 0x40 \b, invisible # >73 byte&0x10 0x80 \b, locked >65 string x \b, type "%4.4s" >65 string 8BIM (PhotoShop) >65 string ALB3 (PageMaker 3) >65 string ALB4 (PageMaker 4) >65 string ALT3 (PageMaker 3) >65 string APPL (application) >65 string AWWP (AppleWorks word processor) >65 string CIRC (simulated circuit) >65 string DRWG (MacDraw) >65 string EPSF (Encapsulated PostScript) >65 string FFIL (font suitcase) >65 string FKEY (function key) >65 string FNDR (Macintosh Finder) >65 string GIFf (GIF image) >65 string Gzip (GNU gzip) >65 string INIT (system extension) >65 string LIB\ (library) >65 string LWFN (PostScript font) >65 string MSBC (Microsoft BASIC) >65 string PACT (Compact Pro archive) >65 string PDF\ (Portable Document Format) >65 string PICT (picture) >65 string PNTG (MacPaint picture) >65 string PREF (preferences) >65 string PROJ (Think C project) >65 string QPRJ (Think Pascal project) >65 string SCFL (Defender scores) >65 string SCRN (startup screen) >65 string SITD (StuffIt Deluxe) >65 string SPn3 (SuperPaint) >65 string STAK (HyperCard stack) >65 string Seg\ (StuffIt segment) >65 string TARF (Unix tar archive) >65 string TEXT (ASCII) >65 string TIFF (TIFF image) >65 string TOVF (Eudora table of contents) >65 string WDBN (Microsoft Word word processor) >65 string WORD (MacWrite word processor) >65 string XLS\ (Microsoft Excel) >65 string ZIVM (compress (.Z)) >65 string ZSYS (Pre-System 7 system file) >65 string acf3 (Aldus FreeHand) >65 string cdev (control panel) >65 string dfil (Desk Acessory suitcase) >65 string libr (library) >65 string nX^d (WriteNow word processor) >65 string nX^w (WriteNow dictionary) >65 string rsrc (resource) >65 string scbk (Scrapbook) >65 string shlb (shared library) >65 string ttro (SimpleText read-only) >65 string zsys (system file) >69 string x \b, creator "%4.4s" # Somewhere, Apple has a repository of registered Creator IDs. These are # just the ones that I happened to have files from and was able to identify. >69 string 8BIM (Adobe Photoshop) >69 string ALD3 (PageMaker 3) >69 string ALD4 (PageMaker 4) >69 string ALFA (Alpha editor) >69 string APLS (Apple Scanner) >69 string APSC (Apple Scanner) >69 string BRKL (Brickles) >69 string BTFT (BitFont) >69 string CCL2 (Common Lisp 2) >69 string CCL\ (Common Lisp) >69 string CDmo (The Talking Moose) >69 string CPCT (Compact Pro) >69 string CSOm (Eudora) >69 string DMOV (Font/DA Mover) >69 string DSIM (DigSim) >69 string EDIT (Macintosh Edit) >69 string ERIK (Macintosh Finder) >69 string EXTR (self-extracting archive) >69 string Gzip (GNU gzip) >69 string KAHL (Think C) >69 string LWFU (LaserWriter Utility) >69 string LZIV (compress) >69 string MACA (MacWrite) >69 string MACS (Macintosh operating system) >69 string MAcK (MacKnowledge terminal emulator) >69 string MLND (Defender) >69 string MPNT (MacPaint) >69 string MSBB (Microsoft BASIC (binary)) >69 string MSWD (Microsoft Word) >69 string NCSA (NCSA Telnet) >69 string PJMM (Think Pascal) >69 string PSAL (Hunt the Wumpus) >69 string PSI2 (Apple File Exchange) >69 string R*ch (BBEdit) >69 string RMKR (Resource Maker) >69 string RSED (Resource Editor) >69 string Rich (BBEdit) >69 string SIT! (StuffIt) >69 string SPNT (SuperPaint) >69 string Unix (NeXT Mac filesystem) >69 string VIM! (Vim editor) >69 string WILD (HyperCard) >69 string XCEL (Microsoft Excel) >69 string aCa2 (Fontographer) >69 string aca3 (Aldus FreeHand) >69 string dosa (Macintosh MS-DOS file system) >69 string movr (Font/DA Mover) >69 string nX^n (WriteNow) >69 string pdos (Apple ProDOS file system) >69 string scbk (Scrapbook) >69 string ttxt (SimpleText) >69 string ufox (Foreign File Access) # Just in case... 102 string mBIN MacBinary III data with surprising version number # sas magic from Bruce Foster (bef@nwu.edu) # #0 string SAS SAS #>8 string x %s 0 string SAS SAS >24 string DATA data file >24 string CATALOG catalog >24 string INDEX data file index >24 string VIEW data view # spss magic for SPSS system and portable files, # from Bruce Foster (bef@nwu.edu). 0 long 0xc1e2c3c9 SPSS Portable File >40 string x %s 0 string $FL2 SPSS System File >24 string x %s # Macintosh filesystem data # From "Tom N Harris" # The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these # entries depend on the data arithmetic added after v.35 # There's also some Pascal strings in here, ditto... # The boot block signature, according to IM:Files, is # "for HFS volumes, this field always contains the value 0x4C4B." # But if this is true for MFS or HFS+ volumes, I don't know. # Alternatively, the boot block is supposed to be zeroed if it's # unused, so a simply >0 should suffice. 0x400 beshort 0xD2D7 Macintosh MFS data >0 beshort 0x4C4B (bootable) >0x40a beshort &0x8000 (locked) >0x402 beldate-0x7C25B080 x created: %s, >0x406 beldate-0x7C25B080 >0 last backup: %s, >0x414 belong x block size: %d, >0x412 beshort x number of blocks: %d, >0x424 pstring x volume name: %s 0x400 beshort 0x4244 Macintosh HFS data >0 beshort 0x4C4B (bootable) >0x40a beshort &0x8000 (locked) >0x40a beshort ^0x0100 (mounted) >0x40a beshort &0x0800 (unclean) >0x402 beldate-0x7C25B080 x created: %s, >0x406 beldate-0x7C25B080 x last modified: %s, >0x440 beldate-0x7C25B080 >0 last backup: %s, >0x414 belong x block size: %d, >0x412 beshort x number of blocks: %d, >0x424 pstring x volume name: %s #>0x480 beshort =0x482B Embedded HFS+ Volume: #>>((0x482*(0x414))+(0x41c*512)) x \b # Well, this is (theoretically) how we could do this. But it occurs to # me that we likely don't read in a large enough chunk. I don't have any # HFS+ volumes to see what a typical offset would be. 0x400 beshort 0x482B Macintosh HFS Extended >&2 beshort x version %d data >0 beshort 0x4C4B (bootable) >&4 belong ^0x00000100 (mounted) >&4 belong &0x00000800 (unclean) >&4 belong &0x00008000 (locked) >&8 string x last mounted by: '%.4s', # really, that should be treated as a belong and we print a string # based on the value. TN1150 only mentions '8.10' for "MacOS 8.1" >&16 beldate-0x7C25B080 x created: %s, >&20 beldate-0x7C25B080 x last modified: %s, >&24 beldate-0x7C25B080 >0 last backup: %s, >&28 beldate-0x7C25B080 >0 last checked: %s, >&40 belong x block size: %d, >&44 belong x number of blocks: %d, >&48 belong x free blocks: %d # I don't think this is really necessary since it doesn't do much and # anything with a valid driver descriptor will also have a valid # partition map #0 beshort 0x4552 Apple Device Driver data #>&24 beshort =1 \b, MacOS # Is that the partition type a cstring or a pstring? Well, IM says "strings # shorter than 32 bytes must be terminated with NULL" so I'll treat it as a # cstring. Of course, partitions can contain more than four entries, but # what're you gonna do? 0x200 beshort 0x504D Apple Partition data >&2 beshort x block size: %d >&48 string x first type: %s, >&12 belong x number of blocks: %d, >(&0x2.S) beshort 0x504D >>&48 string x second type: %s >>&12 belong x number of blocks: %d, >>(&0x2.S) beshort 0x504D >>>&48 string x third type: %s >>>&12 belong x number of blocks: %d, >>>(&0x2.S) beshort 0x504D >>>>&48 string x fourth type: %s >>>>&12 belong x number of blocks: %d, # AFAIK, only the signature is different 0x200 beshort 0x5453 Apple Old Partition data >&2 beshort x block size: %d >&48 string x first type: %s, >&12 belong x number of blocks: %d, >(&0x2.S) beshort 0x504D >>&48 string x second type: %s >>&12 belong x number of blocks: %d, >>(&0x2.S) beshort 0x504D >>>&48 string x third type: %s >>>&12 belong x number of blocks: %d, >>>(&0x2.S) beshort 0x504D >>>>&48 string x fourth type: %s >>>>&12 belong x number of blocks: %d, #------------------------------------------------------------------------------ # magic: file(1) magic for magic files # 0 string #\ Magic magic text file for file(1) cmd 0 lelong 0xF11E041C magic binary file for file(1) cmd >4 lelong x (version %d) (little endian) 0 belong 0xF11E041C magic binary file for file(1) cmd >4 belong x (version %d) (big endian) #------------------------------------------------------------------------------ # mail.news: file(1) magic for mail and news # # Unfortunately, saved netnews also has From line added in some news software. #0 string From mail text # There are tests to ascmagic.c to cope with mail and news. 0 string Relay-Version: old news text 0 string #!\ rnews batched news text 0 string N#!\ rnews mailed, batched news text 0 string Forward\ to mail forwarding text 0 string Pipe\ to mail piping text 0 string Return-Path: smtp mail text 0 string Path: news text 0 string Xref: news text 0 string From: news or mail text 0 string Article saved news text 0 string BABYL Emacs RMAIL text 0 string Received: RFC 822 mail text 0 string MIME-Version: MIME entity text #0 string Content- MIME entity text # TNEF files... 0 lelong 0x223E9F78 Transport Neutral Encapsulation Format # From: Kevin Sullivan 0 string *mbx* MBX mail folder #------------------------------------------------------------------------------ # maple: file(1) magic for maple files # "H. Nanosecond" # Maple V release 4, a multi-purpose math program # # maple library .lib 0 string \000MVR4\nI MapleVr4 library # .ind # no magic for these :-( # they are compiled indexes for maple files # .hdb 0 string \000\004\000\000 Maple help database # .mhp # this has the form 0 string \9 string >\0 version %.1s. >>10 string >>>11 string >\0 %.1s # .mps 0 string \0\0\001$ Maple something # from byte 4 it is either 'nul E' or 'soh R' # I think 'nul E' means a file that was saved as a different name # a sort of revision marking # 'soh R' means new >4 string \000\105 An old revision >4 string \001\122 The latest save # .mpl # some of these are the same as .mps above #0000000 000 000 001 044 000 105 same as .mps #0000000 000 000 001 044 001 122 same as .mps 0 string #\n##\ Maple something anomalous. #------------------------------------------------------------------------------ # mathematica: file(1) magic for mathematica files # "H. Nanosecond" # Mathematica a multi-purpose math program # versions 2.2 and 3.0 #mathematica .mb 0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook 0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook # .ma # multiple possibilites: 0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook #>41 string >\0 %s #0 string (*^\n\n::[\011palette Mathematica notebook version 2.x #0 string (*^\n\n::[\011Information Mathematica notebook version 2.x #>675 string >\0 %s #doesn't work well # there may be 'cr' instread of 'nl' in some does this matter? # generic: 0 string (*^\r\r::[\011 Mathematica notebook version 2.x 0 string \(\*\^\r\n\r\n\:\:\[\011 Mathematica notebook version 2.x 0 string (*^\015 Mathematica notebook version 2.x 0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x 0 string (*^\r::[\011 Mathematica notebook version 2.x 0 string (*^\r\n::[\011 Mathematica notebook version 2.x 0 string (*^\n\n::[\011 Mathematica notebook version 2.x 0 string (*^\n::[\011 Mathematica notebook version 2.x # Mathematica .mx files #0 string (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*) Mathematica binary file 0 string (*This\ is\ a\ Mathematica\ binary\ Mathematica binary file #>71 string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000 # >71... is optional >88 string >\0 from %s # Mathematica files PBF: # 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000 0 string MMAPBF\000\001\000\000\000\203\000\001\000 Mathematica PBF (fonts I think) # .ml files These are menu resources I think # these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\ # how to put that into a magic rule? 4 string \ A~ MAthematica .ml file # .nb files #too long 0 string (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook Mathematica 3.0 notebook 0 string (*********************** Mathematica 3.0 notebook # other (* matches it is a comment start in these langs 0 string (* Mathematica, or Pascal, Modula-2 or 3 code #------------------------------------------------------------------------------ # Mavroyanopoulos Nikos # mcrypt: file(1) magic for mcrypt 2.2.x; 0 string \0m\2 mcrypt 2.2 encrypted data, >3 byte 0 algorithm: blowfish-448, >3 byte 1 algorithm: DES, >3 byte 2 algorithm: 3DES, >3 byte 3 algorithm: 3-WAY, >3 byte 4 algorithm: GOST, >3 byte 6 algorithm: SAFER-SK64, >3 byte 7 algorithm: SAFER-SK128, >3 byte 8 algorithm: CAST-128, >3 byte 9 algorithm: xTEA, >3 byte 10 algorithm: TWOFISH-128, >3 byte 11 algorithm: RC2, >3 byte 12 algorithm: TWOFISH-192, >3 byte 13 algorithm: TWOFISH-256, >3 byte 14 algorithm: blowfish-128, >3 byte 15 algorithm: blowfish-192, >3 byte 16 algorithm: blowfish-256, >3 byte 100 algorithm: RC6, >3 byte 101 algorithm: IDEA, >4 byte 0 mode: CBC, >4 byte 1 mode: ECB, >4 byte 2 mode: CFB, >4 byte 3 mode: OFB, >4 byte 4 mode: nOFB, >5 byte 0 keymode: 8bit >5 byte 1 keymode: 4bit >5 byte 2 keymode: SHA-1 hash >5 byte 3 keymode: MD5 hash #------------------------------------------------------------------------------ # mime: file(1) magic for MIME encoded files # 0 string Content-Type:\ >14 string >\0 %s 0 string Content-Type: >13 string >\0 %s #------------------------------------------------------------------------------ # mips: file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.) # Dec Ultrix (MIPS) # all of SGI's *current* machines and OSes run in big-endian mode on the # MIPS machines, as far as I know. # # XXX - what is the blank "-" line? # # kbd file definitions 0 string kbd!map kbd map file >8 byte >0 Ver %d: >10 short >0 with %d table(s) 0 belong 0407 old SGI 68020 executable 0 belong 0410 old SGI 68020 pure executable 0 beshort 0x8765 disk quotas file 0 beshort 0x0506 IRIS Showcase file >2 byte 0x49 - >3 byte x - version %ld 0 beshort 0x0226 IRIS Showcase template >2 byte 0x63 - >3 byte x - version %ld 0 belong 0x5343464d IRIS Showcase file >4 byte x - version %ld 0 belong 0x5443464d IRIS Showcase template >4 byte x - version %ld 0 belong 0xdeadbabe IRIX Parallel Arena >8 belong >0 - version %ld # 0 beshort 0x0160 MIPSEB ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >22 byte x - version %ld >23 byte x .%ld # 0 beshort 0x0162 MIPSEL-BE ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %d >22 byte x .%ld # 0 beshort 0x6001 MIPSEB-LE ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %d >22 byte x .%ld # 0 beshort 0x6201 MIPSEL ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %ld >22 byte x .%ld # # MIPS 2 additions # 0 beshort 0x0163 MIPSEB MIPS-II ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >22 byte x - version %ld >23 byte x .%ld # 0 beshort 0x0166 MIPSEL-BE MIPS-II ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >22 byte x - version %ld >23 byte x .%ld # 0 beshort 0x6301 MIPSEB-LE MIPS-II ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %ld >22 byte x .%ld # 0 beshort 0x6601 MIPSEL MIPS-II ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %ld >22 byte x .%ld # # MIPS 3 additions # 0 beshort 0x0140 MIPSEB MIPS-III ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >22 byte x - version %ld >23 byte x .%ld # 0 beshort 0x0142 MIPSEL-BE MIPS-III ECOFF executable >20 beshort 0407 (impure) >20 beshort 0410 (swapped) >20 beshort 0413 (paged) >8 belong >0 not stripped >8 belong 0 stripped >22 byte x - version %ld >23 byte x .%ld # 0 beshort 0x4001 MIPSEB-LE MIPS-III ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %ld >22 byte x .%ld # 0 beshort 0x4201 MIPSEL MIPS-III ECOFF executable >20 beshort 03401 (impure) >20 beshort 04001 (swapped) >20 beshort 05401 (paged) >8 belong >0 not stripped >8 belong 0 stripped >23 byte x - version %ld >22 byte x .%ld # 0 beshort 0x180 MIPSEB Ucode 0 beshort 0x182 MIPSEL-BE Ucode # 32bit core file 0 belong 0xdeadadb0 IRIX core dump >4 belong 1 of >16 string >\0 '%s' # 64bit core file 0 belong 0xdeadad40 IRIX 64-bit core dump >4 belong 1 of >16 string >\0 '%s' # N32bit core file 0 belong 0xbabec0bb IRIX N32 core dump >4 belong 1 of >16 string >\0 '%s' # New style crash dump file 0 string \x43\x72\x73\x68\x44\x75\x6d\x70 IRIX vmcore dump of >36 string >\0 '%s' # Trusted IRIX info 0 string SGIAUDIT SGI Audit file >8 byte x - version %d >9 byte x .%ld # 0 string WNGZWZSC Wingz compiled script 0 string WNGZWZSS Wingz spreadsheet 0 string WNGZWZHP Wingz help file # 0 string \#Inventor V IRIS Inventor 1.0 file 0 string \#Inventor V2 Open Inventor 2.0 file # GLF is OpenGL stream encoding 0 string glfHeadMagic(); GLF_TEXT 4 belong 0x7d000000 GLF_BINARY_LSB_FIRST 4 belong 0x0000007d GLF_BINARY_MSB_FIRST # GLS is OpenGL stream encoding; GLS is the successor of GLF 0 string glsBeginGLS( GLS_TEXT 4 belong 0x10000000 GLS_BINARY_LSB_FIRST 4 belong 0x00000010 GLS_BINARY_MSB_FIRST #------------------------------------------------------------------------------ # mirage: file(1) magic for Mirage executables # # XXX - byte order? # 0 long 31415 Mirage Assembler m.out executable #------------------------------------------------------------------------------ # mkid: file(1) magic for mkid(1) databases # # ID is the binary tags database produced by mkid(1). # # XXX - byte order? # 0 string \311\304 ID tags data >2 short >0 version %d #------------------------------------------------------------------------------ # mmdf: file(1) magic for MMDF mail files # 0 string \001\001\001\001 MMDF mailbox #------------------------------------------------------------------------------ # modem: file(1) magic for modem programs # # From: Florian La Roche 4 string Research, Digifax-G3-File >29 byte 1 , fine resolution >29 byte 0 , normal resolution 0 short 0x0100 raw G3 data, byte-padded 0 short 0x1400 raw G3 data # # Magic data for vgetty voice formats # (Martin Seine & Marc Eberhard) # # raw modem data version 1 # 0 string RMD1 raw modem data >4 string >\0 (%s / >20 short >0 compression type 0x%04x) # # portable voice format 1 # 0 string PVF1\n portable voice format >5 string >\0 (binary %s) # # portable voice format 2 # 0 string PVF2\n portable voice format >5 string >\0 (ascii %s) #------------------------------------------------------------------------------ # motorola: file(1) magic for Motorola 68K and 88K binaries # # 68K # 0 beshort 0520 mc68k COFF >18 beshort ^00000020 object >18 beshort &00000020 executable >12 belong >0 not stripped >168 string .lowmem Apple toolbox >20 beshort 0407 (impure) >20 beshort 0410 (pure) >20 beshort 0413 (demand paged) >20 beshort 0421 (standalone) 0 beshort 0521 mc68k executable (shared) >12 belong >0 not stripped 0 beshort 0522 mc68k executable (shared demand paged) >12 belong >0 not stripped # # Motorola/UniSoft 68K Binary Compatibility Standard (BCS) # 0 beshort 0554 68K BCS executable # # 88K # # Motorola/88Open BCS # 0 beshort 0555 88K BCS executable # # Motorola S-Records, from Gerd Truschinski 0 string S0 Motorola S-Record; binary data in text format # ATARI ST relocatable PRG # # from Oskar Schirmer Feb 3, 2001 # (according to Roland Waldi, Oct 21, 1987) # besides the magic 0x601a, the text segment size is checked to be # not larger than 1 MB (which is a lot on ST). # The additional 0x601b distinction I took from Doug Lee's magic. 0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K contiguous executable >2 belong x (txt=%ld, >6 belong x dat=%ld, >10 belong x bss=%ld, >14 belong x sym=%ld) 0 belong&0xFFFFFFF0 0x601B0000 Atari ST M68K non-contig executable >2 belong x (txt=%ld, >6 belong x dat=%ld, >10 belong x bss=%ld, >14 belong x sym=%ld) #------------------------------------------------------------------------------ # msdos: file(1) magic for MS-DOS files # # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com) 0 string @echo\ off MS-DOS batch file text # XXX - according to Microsoft's spec, at an offset of 0x3c in a # PE-format executable is the offset in the file of the PE header; # unfortunately, that's a little-endian offset, and there's no way # to specify an indirect offset with a specified byte order. # So, for now, we assume the standard MS-DOS stub, which puts the # PE header at 0x80 = 128. # # Required OS version and subsystem version were 4.0 on some NT 3.51 # executables built with Visual C++ 4.0, so it's not clear that # they're interesting. The user version was 0.0, but there's # probably some linker directive to set it. The linker version was # 3.0, except for one ".exe" which had it as 4.20 (same damn linker!). # 128 string PE\0\0 MS Windows PE >150 leshort&0x0100 >0 32-bit >132 leshort 0x0 unknown processor >132 leshort 0x14c Intel 80386 >132 leshort 0x166 MIPS R4000 >132 leshort 0x184 Alpha >132 leshort 0x268 Motorola 68000 >132 leshort 0x1f0 PowerPC >132 leshort 0x290 PA-RISC >148 leshort >27 >>220 leshort 0 unknown subsystem >>220 leshort 1 native >>220 leshort 2 GUI >>220 leshort 3 console >>220 leshort 7 POSIX >150 leshort&0x2000 =0 executable #>>136 ledate x stamp %s, >>150 leshort&0x0001 >0 not relocatable #>>150 leshort&0x0004 =0 with line numbers, #>>150 leshort&0x0008 =0 with local symbols, #>>150 leshort&0x0200 =0 with debug symbols, >>150 leshort&0x1000 >0 system file #>>148 leshort >0 #>>>154 byte x linker %d #>>>155 byte x \b.%d, #>>148 leshort >27 #>>>192 leshort x requires OS %d #>>>194 leshort x \b.%d, #>>>196 leshort x user version %d #>>>198 leshort x \b.%d, #>>>200 leshort x subsystem version %d #>>>202 leshort x \b.%d, >150 leshort&0x2000 >0 DLL #>>136 ledate x stamp %s, >>150 leshort&0x0001 >0 not relocatable #>>150 leshort&0x0004 =0 with line numbers, #>>150 leshort&0x0008 =0 with local symbols, #>>150 leshort&0x0200 =0 with debug symbols, >>150 leshort&0x1000 >0 system file #>>148 leshort >0 #>>>154 byte x linker %d #>>>155 byte x \b.%d, #>>148 leshort >27 #>>>192 leshort x requires OS %d #>>>194 leshort x \b.%d, #>>>196 leshort x user version %d #>>>198 leshort x \b.%d, #>>>200 leshort x subsystem version %d #>>>202 leshort x \b.%d, 0 leshort 0x14c MS Windows COFF Intel 80386 object file #>4 ledate x stamp %s 0 leshort 0x166 MS Windows COFF MIPS R4000 object file #>4 ledate x stamp %s 0 leshort 0x184 MS Windows COFF Alpha object file #>4 ledate x stamp %s 0 leshort 0x268 MS Windows COFF Motorola 68000 object file #>4 ledate x stamp %s 0 leshort 0x1f0 MS Windows COFF PowerPC object file #>4 ledate x stamp %s 0 leshort 0x290 MS Windows COFF PA-RISC object file #>4 ledate x stamp %s # .EXE formats (Greg Roelofs, newt@uchicago.edu) # 0 string MZ MS-DOS executable (EXE) >24 string @ \b, OS/2 or MS Windows >>0xe7 string LH/2\ Self-Extract \b, %s >>0xe9 string PKSFX2 \b, %s >>122 string Windows\ self-extracting\ ZIP \b, %s >0x1c string RJSX\xff\xff \b, ARJ SFX >0x1c string diet\xf9\x9c \b, diet compressed >0x1e string Copyright\ 1989-1990\ PKWARE\ Inc. \b, PKSFX # JM: 0x1e "PKLITE Copr. 1990-92 PKWARE Inc. All Rights Reserved\7\0\0\0" >0x1e string PKLITE\ Copr. \b, %.6s compressed >0x24 string LHa's\ SFX \b, %.15s >0x24 string LHA's\ SFX \b, %.15s >1638 string -lh5- \b, LHa SFX archive v2.13S >7195 string Rar! \b, RAR self-extracting archive # # [GRR 950118: file 3.15 has a buffer-size limitation; offsets bigger than # 8161 bytes are ignored. To make the following entries work, increase # HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2, # NT/Win32 and VMS.] # [GRR: some company sells a self-extractor/displayer for image data(!)] # >11696 string PK\003\004 \b, PKZIP SFX archive v1.1 >13297 string PK\003\004 \b, PKZIP SFX archive v1.93a >15588 string PK\003\004 \b, PKZIP2 SFX archive v1.09 >15770 string PK\003\004 \b, PKZIP SFX archive v2.04g >28374 string PK\003\004 \b, PKZIP2 SFX archive v1.02 # # Info-ZIP self-extractors # these are the DOS versions: >25115 string PK\003\004 \b, Info-ZIP SFX archive v5.12 >26331 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption # these are the OS/2 versions (OS/2 is flagged above): >47031 string PK\003\004 \b, Info-ZIP SFX archive v5.12 >49845 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption # this is the NT/Win32 version: >69120 string PK\003\004 \b, Info-ZIP NT SFX archive v5.12 w/decryption # # TELVOX Teleinformatica CODEC self-extractor for OS/2: >49801 string \x79\xff\x80\xff\x76\xff \b, CODEC archive v3.21 >>49824 leshort =1 \b, 1 file >>49824 leshort >1 \b, %u files # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com) # Uncommenting only the first two lines will cover about 2/3 of COM files, # but it isn't feasible to match all COM files since there must be at least # two dozen different one-byte "magics". #0 byte 0xe9 MS-DOS executable (COM) #>6 string SFX\ of\ LHarc (%s) #0 byte 0x8c MS-DOS executable (COM) # 0xeb conflicts with "sequent" magic #0 byte 0xeb MS-DOS executable (COM) #0 byte 0xb8 MS-DOS executable (COM) # miscellaneous formats 0 string LZ MS-DOS executable (built-in) #0 byte 0xf0 MS-DOS program library data # # # Windows NT Registry files. # 0 string regf Windows NT Registry file # Popular applications 2080 string Microsoft\ Word\ 6.0\ Document %s 2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data # Pawel Wiecek (for polish Word) 2112 string MSWordDoc Microsoft Word document data # 0 belong 0x31be0000 Microsoft Word Document # 0 string PO^Q` Microsoft Word 6.0 Document # 0 string \376\067\0\043 Microsoft Office Document 0 string \320\317\021\340\241\261 Microsoft Office Document 0 string \333\245-\0\0\0 Microsoft Office Document # 2080 string Microsoft\ Excel\ 5.0\ Worksheet %s # # Pawel Wiecek (for polish Excel) 2114 string Biff5 Microsoft Excel 5.0 Worksheet # 0 belong 0x00001a00 Lotus 1-2-3 >4 belong 0x00100400 wk3 document data >4 belong 0x02100400 wk4 document data >4 belong 0x07800100 fm3 or fmb document data >4 belong 0x07800000 fm3 or fmb document data # 0 belong 0x00000200 Lotus 1-2-3 >4 belong 0x06040600 wk1 document data >4 belong 0x06800200 fmt document data # Help files 0 string ?_\3\0 MS Windows Help Data # Microsoft CAB distribution format Dale Worley 0 string MSCF\000\000\000\000 Microsoft CAB file # DeIsL1.isu what this is I don't know 0 string \161\250\000\000\001\002 DeIsL1.isu whatever that is # Winamp .avs #0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player 0 string Nullsoft\ AVS\ Preset\ Winamp plug in # Hyper terminal: 0 string HyperTerminal\ hyperterm >15 string 1.0\ --\ HyperTerminal\ data\ file MS-windows Hyperterminal # Windows Metafont .WMF 0 string \327\315\306\232\000\000\000\000\000\000 ms-windows metafont .wmf #tz3 files whatever that is (MS Works files) 0 string \003\001\001\004\070\001\000\000 tz3 ms-works file 0 string \003\002\001\004\070\001\000\000 tz3 ms-works file 0 string \003\003\001\004\070\001\000\000 tz3 ms-works file # PGP sig files .sig #0 string \211\000\077\003\005\000\063\237\127 065 to \027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig 0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig # windows zips files .dmf 0 string MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 Ms-windows special zipped file # Windows help file FTG FTS 0 string \164\146\115\122\012\000\000\000\001\000\000\000 ms-windows help cache # grp old windows 3.1 group files 0 string \120\115\103\103 Ms-windows 3.1 group files # lnk files windows symlinks 0 string \114\000\000\000\001\024\002\000\000\000\000\000\300\000\000\000\000\000\000\106 ms-Windows shortcut #ico files 0 string \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for ms-windows # Windows icons (Ian Springer ) 0 string \000\000\001\000 ms-windows icon resource >4 byte 1 - 1 icon >4 byte >1 - %d icons >>6 byte >0 \b, %dx >>>7 byte >0 \b%d >>8 byte 0 \b, 256-colors >>8 byte >0 \b, %d-colors # True Type fonts currently misidentified as raw G3 data 0 string \000\001\000\000\000 MS-Windows true type font .ttf # .chr files 0 string PK\010\010BGI Borland font >4 string >\0 %s # then there is a copyright notice # .bgi files 0 string pk\010\010BGI Borland device >4 string >\0 %s # then there is a copyright notice # recycled/info the windows trash bin index 9 string \000\000\000\030\001\000\000\000 ms-windows recycled bin info ##### put in Either Magic/font or Magic/news # Acroread or something files wrongly identified as G3 .pfm # these have the form \000 \001 any? \002 \000 \000 # or \000 \001 any? \022 \000 \000 0 string \000\001 pfm? >3 string \022\000\000Copyright\ yes >3 string \002\000\000Copyright\ yes #>3 string >\0 oops, not a font file. Cancel that. #it clashes with ttf files so put it lower down. # From Doug Lee via a FreeBSD pr 9 string GERBILDOC First Choice document 9 string GERBILDB First Choice database 9 string GERBILCLIP First Choice database 0 string GERBIL First Choice device file 9 string RABBITGRAPH RabbitGraph file 0 string DCU1 Borland Delphi .DCU file 0 string ! MKS Spell hash list (old format) 0 string ! MKS Spell hash list 0 string AH Halo(TM) bitmapped font file 0 lelong 0x08086b70 TurboC BGI file 0 lelong 0x08084b50 TurboC Font file # WARNING: below line conflicts with Infocom game data Z-machine 3 0 byte 0x03 DBase 3 data file >0x04 lelong 0 (no records) >0x04 lelong >0 (%ld records) 0 byte 0x83 DBase 3 data file with memo(s) >0x04 lelong 0 (no records) >0x04 lelong >0 (%ld records) 0 leshort 0x0006 DBase 3 index file 0 string PMCC Windows 3.x .GRP file 1 string RDC-meg MegaDots >8 byte >0x2F version %c >9 byte >0x2F \b.%c file 0 lelong 0x4C >4 lelong 0x00021401 Windows shortcut file # DOS EPS Binary File Header # From: Ed Sznyter 0 belong 0xC5D0D3C6 DOS EPS Binary File >4 long >0 Postscript starts at byte %d >>8 long >0 length %d >>>12 long >0 Metafile starts at byte %d >>>>16 long >0 length %d >>>20 long >0 TIFF starts at byte %d >>>>24 long >0 length %d # TNEF magic From "Joomy" 0 leshort 0x223e9f78 TNEF #------------------------------------------------------------------------------ # msvc: file(1) magic for msvc # "H. Nanosecond" # Microsoft visual C # # I have version 1.0 # .aps 0 string HWB\000\377\001\000\000\000 Microsoft Visual C .APS file # .ide #too long 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316 MSVC .ide 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157 MSVC .ide # .res 0 string \000\000\000\000\040\000\000\000\377 MSVC .res 0 string \377\003\000\377\001\000\020\020\350 MSVC .res 0 string \377\003\000\377\001\000\060\020\350 MSVC .res #.lib 0 string \360\015\000\000 Microsoft Visual C library 0 string \360\075\000\000 Microsoft Visual C library 0 string \360\175\000\000 Microsoft Visual C library #.pch 0 string DTJPCH0\000\022\103\006\200 Microsoft Visual C .pch # .pdb # too long 0 string Microsoft\ C/C++\ program\ database\ 0 string Microsoft\ C/C++\ MSVC program database >18 string program\ database\ >33 string >\0 ver %s #.sbr 0 string \000\002\000\007\000 MSVC .sbr >5 string >\0 %s #.bsc 0 string \002\000\002\001 MSVC .bsc #.wsp 0 string 1.00\ .0000.0000\000\003 MSVC .wsp version 1.0000.0000 # these seem to start with the version and contain menus #------------------------------------------------------------------------------ # ncr: file(1) magic for NCR Tower objects # # contributed by # Michael R. Wayne *** TMC & Associates *** INTERNET: wayne@ford-vax.arpa # uucp: {philabs | pyramid} !fmsrl7!wayne OR wayne@fmsrl7.UUCP # 0 beshort 000610 Tower/XP rel 2 object >12 belong >0 not stripped >20 beshort 0407 executable >20 beshort 0410 pure executable >22 beshort >0 - version %ld 0 beshort 000615 Tower/XP rel 2 object >12 belong >0 not stripped >20 beshort 0407 executable >20 beshort 0410 pure executable >22 beshort >0 - version %ld 0 beshort 000620 Tower/XP rel 3 object >12 belong >0 not stripped >20 beshort 0407 executable >20 beshort 0410 pure executable >22 beshort >0 - version %ld 0 beshort 000625 Tower/XP rel 3 object >12 belong >0 not stripped >20 beshort 0407 executable >20 beshort 0410 pure executable >22 beshort >0 - version %ld 0 beshort 000630 Tower32/600/400 68020 object >12 belong >0 not stripped >20 beshort 0407 executable >20 beshort 0410 pure executable >22 beshort >0 - version %ld 0 beshort 000640 Tower32/800 68020 >18 beshort &020000 w/68881 object >18 beshort &040000 compatible object >18 beshort &~060000 object >20 beshort 0407 executable >20 beshort 0413 pure executable >12 belong >0 not stripped >22 beshort >0 - version %ld 0 beshort 000645 Tower32/800 68010 >18 beshort &040000 compatible object >18 beshort &~060000 object >20 beshort 0407 executable >20 beshort 0413 pure executable >12 belong >0 not stripped >22 beshort >0 - version %ld #------------------------------------------------------------------------------ # netbsd: file(1) magic for NetBSD objects # # All new-style magic numbers are in network byte order. # 0 lelong 000000407 NetBSD little-endian object file >16 lelong >0 not stripped 0 belong 000000407 NetBSD big-endian object file >16 belong >0 not stripped 0 belong&0377777777 041400413 NetBSD/i386 demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 041400410 NetBSD/i386 pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 041400407 NetBSD/i386 >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped 0 belong&0377777777 041400507 NetBSD/i386 core >12 string >\0 from '%s' >32 lelong !0 (signal %d) 0 belong&0377777777 041600413 NetBSD/m68k demand paged >0 byte &0x80 >>20 belong <8192 shared library >>20 belong =8192 dynamically linked executable >>20 belong >8192 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 041600410 NetBSD/m68k pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 041600407 NetBSD/m68k >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 belong !0 executable >>20 belong =0 object file >16 belong >0 not stripped 0 belong&0377777777 041600507 NetBSD/m68k core >12 string >\0 from '%s' >32 belong !0 (signal %d) 0 belong&0377777777 042000413 NetBSD/m68k4k demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable >>20 belong >4096 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 042000410 NetBSD/m68k4k pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 042000407 NetBSD/m68k4k >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 belong !0 executable >>20 belong =0 object file >16 belong >0 not stripped 0 belong&0377777777 042000507 NetBSD/m68k4k core >12 string >\0 from '%s' >32 belong !0 (signal %d) 0 belong&0377777777 042200413 NetBSD/ns32532 demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 042200410 NetBSD/ns32532 pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 042200407 NetBSD/ns32532 >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped 0 belong&0377777777 042200507 NetBSD/ns32532 core >12 string >\0 from '%s' >32 lelong !0 (signal %d) 0 belong&0377777777 045200507 NetBSD/powerpc core >12 string >\0 from '%s' 0 belong&0377777777 042400413 NetBSD/SPARC demand paged >0 byte &0x80 >>20 belong <8192 shared library >>20 belong =8192 dynamically linked executable >>20 belong >8192 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 042400410 NetBSD/SPARC pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 042400407 NetBSD/SPARC >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 belong !0 executable >>20 belong =0 object file >16 belong >0 not stripped 0 belong&0377777777 042400507 NetBSD/SPARC core >12 string >\0 from '%s' >32 belong !0 (signal %d) 0 belong&0377777777 042600413 NetBSD/pmax demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 042600410 NetBSD/pmax pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 042600407 NetBSD/pmax >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped 0 belong&0377777777 042600507 NetBSD/pmax core >12 string >\0 from '%s' >32 lelong !0 (signal %d) 0 belong&0377777777 043000413 NetBSD/vax 1k demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 043000410 NetBSD/vax 1k pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 043000407 NetBSD/vax 1k >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped 0 belong&0377777777 043000507 NetBSD/vax 1k core >12 string >\0 from '%s' >32 lelong !0 (signal %d) 0 belong&0377777777 045400413 NetBSD/vax 4k demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 045400410 NetBSD/vax 4k pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 045400407 NetBSD/vax 4k >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped 0 belong&0377777777 045400507 NetBSD/vax 4k core >12 string >\0 from '%s' >32 lelong !0 (signal %d) # NetBSD/alpha does not support (and has never supported) a.out objects, # so no rules are provided for them. NetBSD/alpha ELF objects are # dealt with in "elf". 0 lelong 0x00070185 ECOFF NetBSD/alpha binary >10 leshort 0x0001 not stripped >10 leshort 0x0000 stripped 0 belong&0377777777 043200507 NetBSD/alpha core >12 string >\0 from '%s' >32 lelong !0 (signal %d) 0 belong&0377777777 043400413 NetBSD/mips demand paged >0 byte &0x80 >>20 belong <8192 shared library >>20 belong =8192 dynamically linked executable >>20 belong >8192 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 043400410 NetBSD/mips pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&0377777777 043400407 NetBSD/mips >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 belong !0 executable >>20 belong =0 object file >16 belong >0 not stripped 0 belong&0377777777 043400507 NetBSD/mips core >12 string >\0 from '%s' >32 belong !0 (signal %d) 0 belong&0377777777 043600413 NetBSD/arm32 demand paged >0 byte &0x80 >>20 lelong <4096 shared library >>20 lelong =4096 dynamically linked executable >>20 lelong >4096 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 043600410 NetBSD/arm32 pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 lelong >0 not stripped 0 belong&0377777777 043600407 NetBSD/arm32 >0 byte &0x80 dynamically linked executable >0 byte ^0x80 >>0 byte &0x40 position independent >>20 lelong !0 executable >>20 lelong =0 object file >16 lelong >0 not stripped # NetBSD/arm26 has always used ELF objects, but it shares a core file # format with NetBSD/arm32. 0 belong&0377777777 043600507 NetBSD/arm core >12 string >\0 from '%s' >32 lelong !0 (signal %d) #------------------------------------------------------------------------------ # netscape: file(1) magic for Netscape files # "H. Nanosecond" # version 3 and 4 I think # # Netscape Address book .nab 0 string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000 Netscape Address book # .snm Caches 0 string #\ Netscape\ folder\ cache Netscape folder cache 0 string \000\036\204\220\000 Netscape folder cache # .n2p # Net 2 Phone #0 string 123\130\071\066\061\071\071\071\060\070\061\060\061\063\060 0 string SX961999 Net2phone # #This is files ending in .art, FIXME add more rules 0 string JG\004\016\0\0\0\0 ART #------------------------------------------------------------------------------ # news: file(1) magic for SunOS NeWS fonts (not "news" as in "netnews") # 0 string StartFontMetrics ASCII font metrics 0 string StartFont ASCII font bits 0 belong 0x137A2944 NeWS bitmap font 0 belong 0x137A2947 NeWS font family 0 belong 0x137A2950 scalable OpenFont binary 0 belong 0x137A2951 encrypted scalable OpenFont binary 8 belong 0x137A2B45 X11/NeWS bitmap font 8 belong 0x137A2B48 X11/NeWS font family #------------------------------------------------------------------------------ # octave binary data file(1) magic, from Dirk Eddelbuettel 0 string Octave-1-L Octave binary data (little endian) 0 string Octave-1-B Octave binary data (big endian) #------------------------------------------------------------------------------ # olf: file(1) magic for OLF executables # # We have to check the byte order flag to see what byte order all the # other stuff in the header is in. # # MIPS R3000 may also be for MIPS R2000. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500? # # Created by Erik Theisen # Based on elf from Daniel Quinlan 0 string \177OLF OLF >4 byte 0 invalid class >4 byte 1 32-bit >4 byte 2 64-bit >7 byte 0 invalid os >7 byte 1 OpenBSD >7 byte 2 NetBSD >7 byte 3 FreeBSD >7 byte 4 4.4BSD >7 byte 5 Linux >7 byte 6 SVR4 >7 byte 7 esix >7 byte 8 Solaris >7 byte 9 Irix >7 byte 10 SCO >7 byte 11 Dell >7 byte 12 NCR >5 byte 0 invalid byte order >5 byte 1 LSB >>16 leshort 0 no file type, >>16 leshort 1 relocatable, >>16 leshort 2 executable, >>16 leshort 3 shared object, # Core handling from Peter Tobias # corrections by Christian 'Dr. Disk' Hechelmann >>16 leshort 4 core file >>>(0x38+0xcc) string >\0 of '%s' >>>(0x38+0x10) lelong >0 (signal %d), >>16 leshort &0xff00 processor-specific, >>18 leshort 0 no machine, >>18 leshort 1 AT&T WE32100 - invalid byte order, >>18 leshort 2 SPARC - invalid byte order, >>18 leshort 3 Intel 80386, >>18 leshort 4 Motorola 68000 - invalid byte order, >>18 leshort 5 Motorola 88000 - invalid byte order, >>18 leshort 6 Intel 80486, >>18 leshort 7 Intel 80860, >>18 leshort 8 MIPS R3000_BE - invalid byte order, >>18 leshort 9 Amdahl - invalid byte order, >>18 leshort 10 MIPS R3000_LE, >>18 leshort 11 RS6000 - invalid byte order, >>18 leshort 15 PA-RISC - invalid byte order, >>18 leshort 16 nCUBE, >>18 leshort 17 VPP500, >>18 leshort 18 SPARC32PLUS, >>18 leshort 20 PowerPC, >>18 leshort 0x9026 Alpha, >>20 lelong 0 invalid version >>20 lelong 1 version 1 >>36 lelong 1 MathCoPro/FPU/MAU Required >8 string >\0 (%s) >5 byte 2 MSB >>16 beshort 0 no file type, >>16 beshort 1 relocatable, >>16 beshort 2 executable, >>16 beshort 3 shared object, >>16 beshort 4 core file, >>>(0x38+0xcc) string >\0 of '%s' >>>(0x38+0x10) belong >0 (signal %d), >>16 beshort &0xff00 processor-specific, >>18 beshort 0 no machine, >>18 beshort 1 AT&T WE32100, >>18 beshort 2 SPARC, >>18 beshort 3 Intel 80386 - invalid byte order, >>18 beshort 4 Motorola 68000, >>18 beshort 5 Motorola 88000, >>18 beshort 6 Intel 80486 - invalid byte order, >>18 beshort 7 Intel 80860, >>18 beshort 8 MIPS R3000_BE, >>18 beshort 9 Amdahl, >>18 beshort 10 MIPS R3000_LE - invalid byte order, >>18 beshort 11 RS6000, >>18 beshort 15 PA-RISC, >>18 beshort 16 nCUBE, >>18 beshort 17 VPP500, >>18 beshort 18 SPARC32PLUS, >>18 beshort 20 PowerPC or cisco 4500, >>18 beshort 21 cisco 7500, >>18 beshort 24 cisco SVIP, >>18 beshort 25 cisco 7200, >>18 beshort 36 cisco 12000, >>18 beshort 0x9026 Alpha, >>20 belong 0 invalid version >>20 belong 1 version 1 >>36 belong 1 MathCoPro/FPU/MAU Required #------------------------------------------------------------------------------ # os2: file(1) magic for OS/2 files # # Provided 1998/08/22 by # David Mediavilla 1 string InternetShortcut MS Windows 95 Internet shortcut text >24 string >\ (URL=<%s>) # OS/2 URL objects # Provided 1998/08/22 by # David Mediavilla 0 string http: OS/2 URL object text >5 string >\ (WWW) 0 string mailto: OS/2 URL object text >7 string >\ (email) <%s> 0 string news: OS/2 URL object text >5 string >\ (Usenet) <%s> 0 string ftp: OS/2 URL object text >4 string >\ (FTP) 0 string file: OS/2 URL object text >5 string >\ (Local file) <%s> # >>>>> OS/2 INF/HLP <<<<< (source: Daniel Dissett ddissett@netcom.com) # Carl Hauser (chauser.parc@xerox.com) and # Marcus Groeber (marcusg@ph-cip.uni-koeln.de) # list the following header format in inf02a.doc: # # int16 ID; // ID magic word (5348h = "HS") # int8 unknown1; // unknown purpose, could be third letter of ID # int8 flags; // probably a flag word... # // bit 0: set if INF style file # // bit 4: set if HLP style file # // patching this byte allows reading HLP files # // using the VIEW command, while help files # // seem to work with INF settings here as well. # int16 hdrsize; // total size of header # int16 unknown2; // unknown purpose # 0 string HSP\x01\x9b\x00 OS/2 INF >107 string >0 (%s) 0 string HSP\x10\x9b\x00 OS/2 HLP >107 string >0 (%s) # OS/2 INI (this is a guess) 0 string \xff\xff\xff\xff\x14\0\0\0 OS/2 INI # # Copyright (c) 1996 Ignatios Souvatzis. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by Ignatios Souvatzis for # the NetBSD project. # 4. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # # OS9/6809 module descriptions: # 0 beshort 0x87CD OS9/6809 module: # >6 byte&0x0f 0x00 non-executable >6 byte&0x0f 0x01 machine language >6 byte&0x0f 0x02 BASIC I-code >6 byte&0x0f 0x03 P-code >6 byte&0x0f 0x04 C I-code >6 byte&0x0f 0x05 COBOL I-code >6 byte&0x0f 0x06 FORTRAN I-code # >6 byte&0xf0 0x10 program executable >6 byte&0xf0 0x20 subroutine >6 byte&0xf0 0x30 multi-module >6 byte&0xf0 0x40 data module # >6 byte&0xf0 0xC0 system module >6 byte&0xf0 0xD0 file manager >6 byte&0xf0 0xE0 device driver >6 byte&0xf0 0xF0 device descriptor # # OS9/m68k stuff (to be continued) # 0 beshort 0x4AFC OS9/68K module: # # attr >14 byte&0x80 0x80 re-entrant >14 byte&0x40 0x40 ghost >14 byte&0x20 0x20 system-state # # lang: # >13 byte 1 machine language >13 byte 2 BASIC I-code >13 byte 3 P-code >13 byte 4 C I-code >13 byte 5 COBOL I-code >13 byte 6 Fortran I-code # # # type: # >12 byte 1 program executable >12 byte 2 subroutine >12 byte 3 multi-module >12 byte 4 data module >12 byte 11 trap library >12 byte 12 system module >12 byte 13 file manager >12 byte 14 device driver >12 byte 15 device descriptor # # Mach magic number info # 0 long 0xefbe OSF/Rose object # I386 magic number info # 0 short 0565 i386 COFF object #------------------------------------------------------------------------------ # palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks # # Brian Lalor # appl 60 belong 0x6170706c PalmOS application >0 string >\0 "%s" # TEXt 60 belong 0x54455874 AportisDoc file >0 string >\0 "%s" # HACK 60 belong 0x4841434b HackMaster hack >0 string >\0 "%s" #------------------------------------------------------------------------------ # pbm: file(1) magic for Portable Bitmap files # # XXX - byte order? # 0 short 0x2a17 "compact bitmap" format (Poskanzer) #------------------------------------------------------------------------------ # pdf: file(1) magic for Portable Document Format # 0 string %PDF- PDF document >5 byte x \b, version %c >7 byte x \b.%c #------------------------------------------------------------------------------ # pdp: file(1) magic for PDP-11 executable/object and APL workspace # 0 lelong 0101555 PDP-11 single precision APL workspace 0 lelong 0101554 PDP-11 double precision APL workspace # # PDP-11 a.out # 0 leshort 0407 PDP-11 executable >8 leshort >0 not stripped >15 byte >0 - version %ld 0 leshort 0401 PDP-11 UNIX/RT ldp 0 leshort 0405 PDP-11 old overlay 0 leshort 0410 PDP-11 pure executable >8 leshort >0 not stripped >15 byte >0 - version %ld 0 leshort 0411 PDP-11 separate I&D executable >8 leshort >0 not stripped >15 byte >0 - version %ld 0 leshort 0437 PDP-11 kernel overlay # These last three are derived from 2.11BSD file(1) 0 leshort 0413 PDP-11 demand-paged pure executable >8 leshort >0 not stripped 0 leshort 0430 PDP-11 overlaid pure executable >8 leshort >0 not stripped 0 leshort 0431 PDP-11 overlaid separate executable >8 leshort >0 not stripped #------------------------------------------------------------------------------ # pgp: file(1) magic for Pretty Good Privacy # 0 beshort 0x9900 PGP key public ring 0 beshort 0x9501 PGP key security ring 0 beshort 0x9500 PGP key security ring 0 beshort 0xa600 PGP encrypted data 0 string -----BEGIN\040PGP PGP armored data >15 string PUBLIC\040KEY\040BLOCK- public key block >15 string MESSAGE- message >15 string SIGNED\040MESSAGE- signed message >15 string PGP\040SIGNATURE- signature #------------------------------------------------------------------------------ # pkgadd: file(1) magic for SysV R4 PKG Datastreams # 0 string #\ PaCkAgE\ DaTaStReAm pkg Datastream (SVR4) #------------------------------------------------------------------------------ # plus5: file(1) magic for Plus Five's UNIX MUMPS # # XXX - byte order? Paging Hokey.... # 0 short 0x259 mumps avl global >2 byte >0 (V%d) >6 byte >0 with %d byte name >7 byte >0 and %d byte data cells 0 short 0x25a mumps blt global >2 byte >0 (V%d) >8 short >0 - %d byte blocks >15 byte 0x00 - P/D format >15 byte 0x01 - P/K/D format >15 byte 0x02 - K/D format >15 byte >0x02 - Bad Flags #------------------------------------------------------------------------------ # printer: file(1) magic for printer-formatted files # # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com) 0 string %! PostScript document text >2 string PS-Adobe- conforming >>11 string >\0 at level %.3s >>>15 string EPS - type %s >>>15 string Query - type %s >>>15 string ExitServer - type %s # Some PCs have the annoying habit of adding a ^D as a document separator 0 string \004%! PostScript document text >3 string PS-Adobe- conforming >>12 string >\0 at level %.3s >>>16 string EPS - type %s >>>16 string Query - type %s >>>16 string ExitServer - type %s 0 string \033%-12345X%!PS PostScript document # DOS EPS Binary File Header # From: Ed Sznyter 0 belong 0xC5D0D3C6 DOS EPS Binary File >4 long >0 Postscript starts at byte %d >>8 long >0 length %d >>>12 long >0 Metafile starts at byte %d >>>>16 long >0 length %d >>>20 long >0 TIFF starts at byte %d >>>>24 long >0 length %d # Adobe's PostScript Printer Description (PPD) files # Yves Arrouye # 0 string *PPD-Adobe: PPD file >13 string x \b, ve # HP Printer Job Language 0 string \033%-12345X@PJL HP Printer Job Language data # HP Printer Job Language # The header found on Win95 HP plot files is the "Silliest Thing possible" # (TM) # Every driver puts the language at some random position, with random case # (LANGUAGE and Language) # For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10 # From: Uwe Bonnes # 0 string \033%-12345X@PJL HP Printer Job Language data >&0 string >\0 %s >>&0 string >\0 %s >>>&0 string >\0 %s >>>>&0 string >\0 %s #>15 string \ ENTER\ LANGUAGE\ = #>31 string PostScript PostScript # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com) 0 string \033E\033 HP PCL printer data >3 string \&l0A - default page size >3 string \&l1A - US executive page size >3 string \&l2A - US letter page size >3 string \&l3A - US legal page size >3 string \&l26A - A4 page size >3 string \&l80A - Monarch envelope size >3 string \&l81A - No. 10 envelope size >3 string \&l90A - Intl. DL envelope size >3 string \&l91A - Intl. C5 envelope size >3 string \&l100A - Intl. B5 envelope size >3 string \&l-81A - No. 10 envelope size (landscape) >3 string \&l-90A - Intl. DL envelope size (landscape) # IMAGEN printer-ready files: 0 string @document( Imagen printer # this only works if "language xxx" is first item in Imagen header. >10 string language\ impress (imPRESS data) >10 string language\ daisy (daisywheel text) >10 string language\ diablo (daisywheel text) >10 string language\ printer (line printer emulation) >10 string language\ tektronix (Tektronix 4014 emulation) # Add any other languages that your Imagen uses - remember # to keep the word `text' if the file is human-readable. # [GRR 950115: missing "postscript" or "ultrascript" (whatever it was called)] # # Now magic for IMAGEN font files... 0 string Rast RST-format raster font data >45 string >0 face % # From Jukka Ukkonen 0 string \033[K\002\0\0\017\033(a\001\0\001\033(g Canon Bubble Jet BJC formatted data #------------------------------------------------------------------------------ # project: file(1) magic for Project management # # Magic strings for ftnchek project files. Alexander Mai 0 string FTNCHEK_\ P project file for ftnchek >10 string 1 version 2.7 >10 string 2 version 2.8 to 2.10 >10 string 3 version 2.11 or later #------------------------------------------------------------------------------ # psdbms: file(1) magic for psdatabase # 0 belong&0xff00ffff 0x56000000 ps database >1 string >\0 version %s >4 string >\0 from kernel %s #------------------------------------------------------------------------------ # pyramid: file(1) magic for Pyramids # # XXX - byte order? # 0 long 0x50900107 Pyramid 90x family executable 0 long 0x50900108 Pyramid 90x family pure executable >16 long >0 not stripped 0 long 0x5090010b Pyramid 90x family demand paged pure executable >16 long >0 not stripped # often the module starts with a multiline string 0 string """ a python script text executable # MAGIC as specified in Python/import.c (1.5.2/1.6) # 20121 ( YEAR - 1995 ) + MONTH + DAY (little endian followed by "\r\n" 0 belong 0x994e0d0a python compiled #------------------------------------------------------------------------------ # riff: file(1) magic for RIFF format # See # # http://www.seanet.com/users/matts/riffmci/riffmci.htm # # and # # http://www.ora.com/centers/gff/formats/micriff/index.htm # # and # # http://www.jtauber.com/music/encoding/niff/spec/ # 0 string RIFF RIFF (little-endian) data # RIFF Palette format >8 string PAL \b, palette >>16 leshort x \b, version %d >>18 leshort x \b, %d entries # RIFF Device Independent Bitmap format >8 string RDIB \b, device-independent bitmap >>16 string BM >>>30 leshort 12 \b, OS/2 1.x format >>>>34 leshort x \b, %d x >>>>36 leshort x %d >>>30 leshort 64 \b, OS/2 2.x format >>>>34 leshort x \b, %d x >>>>36 leshort x %d >>>30 leshort 40 \b, Windows 3.x format >>>>34 lelong x \b, %d x >>>>38 lelong x %d x >>>>44 leshort x %d # RIFF MIDI format >8 string RMID \b, MIDI # RIFF Multimedia Movie File format >8 string RMMP \b, multimedia movie # Microsoft WAVE format (*.wav) >8 string WAVE \b, WAVE audio >>20 leshort 1 \b, Microsoft PCM >>>34 leshort >0 \b, %d bit >>20 leshort 2 \b, Microsoft ADPCM >>20 leshort 6 \b, ITU G.711 a-law >>20 leshort 7 \b, ITU G.711 u-law >>20 leshort 17 \b, IMA ADPCM >>20 leshort 20 \b, ITU G.723 ADPCM (Yamaha) >>20 leshort 49 \b, GSM 6.10 >>20 leshort 64 \b, ITU G.721 ADPCM >>20 leshort 80 \b, MPEG >>20 leshort 85 \b, MPEG Layer 3 >>22 leshort =1 \b, mono >>22 leshort =2 \b, stereo >>22 leshort >2 \b, %d channels >>24 lelong >0 %d Hz # AVI == Audio Video Interleave >8 string AVI\ \b, AVI # Animated Cursor format >8 string ACON \b, animated cursor # # XXX - some of the below may only appear in little-endian form. # # Also "MV93" appears to be for one form of Macromedia Director # files, and "GDMF" appears to be another multimedia format. # 0 string RIFX RIFF (big-endian) data # RIFF Palette format >8 string PAL \b, palette >>16 beshort x \b, version %d >>18 beshort x \b, %d entries # RIFF Device Independent Bitmap format >8 string RDIB \b, device-independent bitmap >>16 string BM >>>30 beshort 12 \b, OS/2 1.x format >>>>34 beshort x \b, %d x >>>>36 beshort x %d >>>30 beshort 64 \b, OS/2 2.x format >>>>34 beshort x \b, %d x >>>>36 beshort x %d >>>30 beshort 40 \b, Windows 3.x format >>>>34 belong x \b, %d x >>>>38 belong x %d x >>>>44 beshort x %d # RIFF MIDI format >8 string RMID \b, MIDI # RIFF Multimedia Movie File format >8 string RMMP \b, multimedia movie # Microsoft WAVE format (*.wav) >8 string WAVE \b, WAVE audio >>20 leshort 1 \b, Microsoft PCM >>>34 leshort >0 \b, %d bit >>22 beshort =1 \b, mono >>22 beshort =2 \b, stereo >>22 beshort >2 \b, %d channels >>24 belong >0 %d Hz # AVI == Audio Video Interleave >8 string AVI\ \b, AVI # Animated Cursor format >8 string ACON \b, animated cursor # Notation Interchange File Format (big-endian only) >8 string NIFF \b, Notation Interchange File Format # SoundFont 2 >8 string sfbk SoundFont 2 #------------------------------------------------------------------------------ # # RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com) # 0 beshort 0xedab >2 beshort 0xeedb RPM >>4 byte x v%d >>6 beshort 0 bin >>6 beshort 1 src >>8 beshort 1 i386 >>8 beshort 2 Alpha >>8 beshort 3 Sparc >>8 beshort 4 MIPS >>8 beshort 5 PowerPC >>8 beshort 6 68000 >>8 beshort 7 SGI >>10 string x %s #------------------------------------------------------------------------------ # rtf: file(1) magic for Rich Text Format (RTF) # # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk # 0 string {\\rtf Rich Text Format data, >5 byte x version %c, >6 string \\ansi ANSI >6 string \\mac Apple Macintosh >6 string \\pc IBM PC, code page 437 >6 string \\pca IBM PS/2, code page 850 #------------------------------------------------------------------------------ # sc: file(1) magic for "sc" spreadsheet # 38 string Spreadsheet sc spreadsheet file #------------------------------------------------------------------------------ # sccs: file(1) magic for SCCS archives # # SCCS archive structure: # \001h01207 # \001s 00276/00000/00000 # \001d D 1.1 87/09/23 08:09:20 ian 1 0 # \001c date and time created 87/09/23 08:09:20 by ian # \001e # \001u # \001U # ... etc. # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550). # *Sigh*. And these both came from various parts of the USG. # Maybe we should just switch everybody from SCCS to RCS! # Further, you can't just say '\001h0', because the five-digit number # is a checksum that could (presumably) have any leading digit, # and we don't have regular expression matching yet. # Hence the following official kludge: 8 string \001s\ SCCS archive data #------------------------------------------------------------------------------ # sendmail: file(1) magic for sendmail config files # # XXX - byte order? # 0 byte 046 Sendmail frozen configuration >16 string >\0 - version %s 0 short 0x271c Sendmail frozen configuration >16 string >\0 - version %s #------------------------------------------------------------------------------ # sequent: file(1) magic for Sequent machines # # Sequent information updated by Don Dwiggins . # For Sequent's multiprocessor systems (incomplete). 0 lelong 0x00ea BALANCE NS32000 .o >16 lelong >0 not stripped >124 lelong >0 version %ld 0 lelong 0x10ea BALANCE NS32000 executable (0 @ 0) >16 lelong >0 not stripped >124 lelong >0 version %ld 0 lelong 0x20ea BALANCE NS32000 executable (invalid @ 0) >16 lelong >0 not stripped >124 lelong >0 version %ld 0 lelong 0x30ea BALANCE NS32000 standalone executable >16 lelong >0 not stripped >124 lelong >0 version %ld # # Symmetry information added by Jason Merrill . # Symmetry magic nums will not be reached if DOS COM comes before them; # byte 0xeb is matched before these get a chance. 0 leshort 0x12eb SYMMETRY i386 .o >16 lelong >0 not stripped >124 lelong >0 version %ld 0 leshort 0x22eb SYMMETRY i386 executable (0 @ 0) >16 lelong >0 not stripped >124 lelong >0 version %ld 0 leshort 0x32eb SYMMETRY i386 executable (invalid @ 0) >16 lelong >0 not stripped >124 lelong >0 version %ld 0 leshort 0x42eb SYMMETRY i386 standalone executable >16 lelong >0 not stripped >124 lelong >0 version %ld #------------------------------------------------------------------------------ # sgml: file(1) magic for Standard Generalized Markup Language # HyperText Markup Language (HTML) is an SGML document type, # from Daniel Quinlan (quinlan@yggdrasil.com) # adapted to string extenstions by Anthon van der Neut 0 string ##Sketch Sketch document text #------------------------------------------------------------------------------ # sniffer: file(1) magic for packet capture files # # From: guy@alum.mit.edu (Guy Harris) # # # Microsoft Network Monitor 1.x capture files. # 0 string RTSS NetMon capture file >4 byte x - version %d >5 byte x \b.%d >6 leshort 0 (Unknown) >6 leshort 1 (Ethernet) >6 leshort 2 (Token Ring) >6 leshort 3 (FDDI) # # Microsoft Network Monitor 2.x capture files. # 0 string GMBU NetMon capture file >4 byte x - version %d >5 byte x \b.%d >6 leshort 0 (Unknown) >6 leshort 1 (Ethernet) >6 leshort 2 (Token Ring) >6 leshort 3 (FDDI) # # Network General Sniffer capture files. # Sorry, make that "Network Associates Sniffer capture files." # 0 string TRSNIFF\ data\ \ \ \ \032 Sniffer capture file >33 byte 2 (compressed) >23 leshort x - version %d >25 leshort x \b.%d >32 byte 0 (Token Ring) >32 byte 1 (Ethernet) >32 byte 2 (ARCNET) >32 byte 3 (StarLAN) >32 byte 4 (PC Network broadband) >32 byte 5 (LocalTalk) >32 byte 6 (Znet) >32 byte 7 (Internetwork Analyzer) >32 byte 9 (FDDI) >32 byte 10 (ATM) # # Cinco Networks NetXRay capture files. # Sorry, make that "Network General Sniffer Basic capture files." # Sorry, make that "Network Associates Sniffer Basic capture files." # Sorry, make that "Network Associates Sniffer Basic, and Windows # Sniffer Pro", capture files." # 0 string XCP\0 NetXRay capture file >4 string >\0 - version %s >44 leshort 0 (Ethernet) >44 leshort 1 (Token Ring) >44 leshort 2 (FDDI) # # "libpcap" capture files. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is # the main program that uses that format, but there are other programs # that use "libpcap", or that use the same capture file format.) # 0 ubelong 0xa1b2c3d4 tcpdump capture file (big-endian) >4 beshort x - version %d >6 beshort x \b.%d >20 belong 0 (No link-layer encapsulation >20 belong 1 (Ethernet >20 belong 2 (3Mb Ethernet >20 belong 3 (AX.25 >20 belong 4 (ProNET >20 belong 5 (CHAOS >20 belong 6 (Token Ring >20 belong 7 (ARCNET >20 belong 8 (SLIP >20 belong 9 (PPP >20 belong 10 (FDDI >20 belong 11 (RFC 1483 ATM >20 belong 12 (raw IP >20 belong 13 (BSD/OS SLIP >20 belong 14 (BSD/OS PPP >20 belong 50 (PPP or Cisco HDLC >20 belong 51 (PPP-over-Ethernet >20 belong 100 (RFC 1483 ATM >20 belong 101 (raw IP >20 belong 102 (BSD/OS SLIP >20 belong 103 (BSD/OS PPP >20 belong 104 (BSD/OS Cisco HDLC >20 belong 105 (802.11 >20 belong 106 (Linux Classical IP over ATM >20 belong 108 (OpenBSD loopback >20 belong 109 (OpenBSD IPSEC encrypted >20 belong 113 (Linux "cooked" >20 belong 114 (LocalTalk >16 belong x \b, capture length %d) 0 ulelong 0xa1b2c3d4 tcpdump capture file (little-endian) >4 leshort x - version %d >6 leshort x \b.%d >20 lelong 0 (No link-layer encapsulation >20 lelong 1 (Ethernet >20 lelong 2 (3Mb Ethernet >20 lelong 3 (AX.25 >20 lelong 4 (ProNET >20 lelong 5 (CHAOS >20 lelong 6 (Token Ring >20 lelong 7 (ARCNET >20 lelong 8 (SLIP >20 lelong 9 (PPP >20 lelong 10 (FDDI >20 lelong 11 (RFC 1483 ATM >20 lelong 12 (raw IP >20 lelong 13 (BSD/OS SLIP >20 lelong 14 (BSD/OS PPP >20 lelong 50 (PPP or Cisco HDLC >20 lelong 51 (PPP-over-Ethernet >20 lelong 100 (RFC 1483 ATM >20 lelong 101 (raw IP >20 lelong 102 (BSD/OS SLIP >20 lelong 103 (BSD/OS PPP >20 lelong 104 (BSD/OS Cisco HDLC >20 lelong 105 (802.11 >20 lelong 106 (Linux Classical IP over ATM >20 lelong 108 (OpenBSD loopback >20 lelong 109 (OpenBSD IPSEC encrypted >20 lelong 113 (Linux "cooked" >20 lelong 114 (LocalTalk >16 lelong x \b, capture length %d) # # "libpcap"-with-Alexey-Kuznetsov's-patches capture files. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is # the main program that uses that format, but there are other programs # that use "libpcap", or that use the same capture file format.) # 0 ubelong 0xa1b2cd34 extended tcpdump capture file (big-endian) >4 beshort x - version %d >6 beshort x \b.%d >20 belong 0 (No link-layer encapsulation >20 belong 1 (Ethernet >20 belong 2 (3Mb Ethernet >20 belong 3 (AX.25 >20 belong 4 (ProNET >20 belong 5 (CHAOS >20 belong 6 (Token Ring >20 belong 7 (ARCNET >20 belong 8 (SLIP >20 belong 9 (PPP >20 belong 10 (FDDI >20 belong 11 (RFC 1483 ATM >20 belong 12 (raw IP >20 belong 13 (BSD/OS SLIP >20 belong 14 (BSD/OS PPP >16 belong x \b, capture length %d) 0 ulelong 0xa1b2cd34 extended tcpdump capture file (little-endian) >4 leshort x - version %d >6 leshort x \b.%d >20 lelong 0 (No link-layer encapsulation >20 lelong 1 (Ethernet >20 lelong 2 (3Mb Ethernet >20 lelong 3 (AX.25 >20 lelong 4 (ProNET >20 lelong 5 (CHAOS >20 lelong 6 (Token Ring >20 lelong 7 (ARCNET >20 lelong 8 (SLIP >20 lelong 9 (PPP >20 lelong 10 (FDDI >20 lelong 11 (RFC 1483 ATM >20 lelong 12 (raw IP >20 lelong 13 (BSD/OS SLIP >20 lelong 14 (BSD/OS PPP >16 lelong x \b, capture length %d) # # AIX "iptrace" capture files. # 0 string iptrace\ 2.0 "iptrace" capture file # # Novell LANalyzer capture files. # 0 leshort 0x1001 LANalyzer capture file 0 leshort 0x1007 LANalyzer capture file # # HP-UX "nettl" capture files. # 0 string \x54\x52\x00\x64\x00 "nettl" capture file # # RADCOM WAN/LAN Analyzer capture files. # 0 string \x42\xd2\x00\x34\x12\x66\x22\x88 RADCOM WAN/LAN Analyzer capture file # # NetStumbler log files. Not really packets, per se, but about as # close as you can get. These are log files from NetStumbler, a # Windows program, that scans for 802.11b networks. # 0 string NetS NetStumbler log file >8 lelong x \b, %d stations found #------------------------------------------------------------------------------ # softquad: file(1) magic for SoftQuad Publishing Software # # Author/Editor and RulesBuilder # # XXX - byte order? # 0 string \ Compiled SGML rules file >9 string >\0 Type %s 0 string \ A/E SGML Document binary >9 string >\0 Type %s 0 string \ A/E SGML binary styles file >9 string >\0 Type %s 0 short 0xc0de Compiled PSI (v1) data 0 short 0xc0da Compiled PSI (v2) data >3 string >\0 (%s) # Binary sqtroff font/desc files... 0 short 0125252 SoftQuad DESC or font file binary >2 short >0 - version %d # Bitmaps... 0 string SQ\ BITMAP1 SoftQuad Raster Format text #0 string SQ\ BITMAP2 SoftQuad Raster Format data # sqtroff intermediate language (replacement for ditroff int. lang.) 0 string X\ SoftQuad troff Context intermediate >2 string 495 for AT&T 495 laser printer >2 string hp for Hewlett-Packard LaserJet >2 string impr for IMAGEN imPRESS >2 string ps for PostScript #------------------------------------------------------------------------------ # spectrum: file(1) magic for Spectrum emulator files. # # John Elliott # # Spectrum +3DOS header # 0 string PLUS3DOS\032 Spectrum +3 data >15 byte 0 - BASIC program >15 byte 1 - number array >15 byte 2 - character array >15 byte 3 - memory block >>16 belong 0x001B0040 (screen) >15 byte 4 - Tasword document >15 string TAPEFILE - ZXT tapefile # # Tape file. This assumes the .TAP starts with a Spectrum-format header, # which nearly all will. # 0 string \023\000\000 Spectrum .TAP data >4 string x "%-10.10s" >3 byte 0 - BASIC program >3 byte 1 - number array >3 byte 2 - character array >3 byte 3 - memory block >>14 belong 0x001B0040 (screen) #------------------------------------------------------------------------------ # sun: file(1) magic for Sun machines # # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x # releases. (5.x uses ELF.) # 0 belong&077777777 0600413 SPARC demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable >>20 belong >4096 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0600410 SPARC pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0600407 SPARC >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0400413 mc68020 demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable >>20 belong >4096 dynamically linked executable >16 belong >0 not stripped 0 belong&077777777 0400410 mc68020 pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0400407 mc68020 >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0200413 mc68010 demand paged >0 byte &0x80 >>20 belong <4096 shared library >>20 belong =4096 dynamically linked executable >>20 belong >4096 dynamically linked executable >16 belong >0 not stripped 0 belong&077777777 0200410 mc68010 pure >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped 0 belong&077777777 0200407 mc68010 >0 byte &0x80 dynamically linked executable >0 byte ^0x80 executable >16 belong >0 not stripped # reworked these to avoid anything beginning with zero becoming "old sun-2" 0 belong 0407 old sun-2 executable >16 belong >0 not stripped 0 belong 0410 old sun-2 pure executable >16 belong >0 not stripped 0 belong 0413 old sun-2 demand paged executable >16 belong >0 not stripped # # Core files. "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC # binary executed in compatibility mode under SunOS 5.x". # 0 belong 0x080456 SunOS core file >4 belong 432 (SPARC) >>132 string >\0 from '%s' >>116 belong =3 (quit) >>116 belong =4 (illegal instruction) >>116 belong =5 (trace trap) >>116 belong =6 (abort) >>116 belong =7 (emulator trap) >>116 belong =8 (arithmetic exception) >>116 belong =9 (kill) >>116 belong =10 (bus error) >>116 belong =11 (segmentation violation) >>116 belong =12 (bad argument to system call) >>116 belong =29 (resource lost) >>120 belong x (T=%dK, >>124 belong x D=%dK, >>128 belong x S=%dK) >4 belong 826 (68K) >>128 string >\0 from '%s' >4 belong 456 (SPARC 4.x BCP) >>152 string >\0 from '%s' # Sun SunPC 0 long 0xfa33c08e SunPC 4.0 Hard Disk 0 string #SUNPC_CONFIG SunPC 4.0 Properties Values # Sun snoop (see RFC 1761, which describes the capture file format). # 0 string snoop Snoop capture file >8 belong >0 - version %ld >12 belong 0 (IEEE 802.3) >12 belong 1 (IEEE 802.4) >12 belong 2 (IEEE 802.5) >12 belong 3 (IEEE 802.6) >12 belong 4 (Ethernet) >12 belong 5 (HDLC) >12 belong 6 (Character synchronous) >12 belong 7 (IBM channel-to-channel adapter) >12 belong 8 (FDDI) >12 belong 9 (Unknown) # Sun KCMS 36 string acsp Kodak Color Management System, ICC Profile #------------------------------------------------------------------------------ # teapot: file(1) magic for "teapot" spreadsheet # 0 string #!teapot\012xdr teapot work sheet (XDR format) #------------------------------------------------------------------------------ # terminfo: file(1) magic for terminfo # # XXX - byte order for screen images? # 0 string \032\001 Compiled terminfo entry 0 short 0433 Curses screen image 0 short 0434 Curses screen image #------------------------------------------------------------------------------ # tex: file(1) magic for TeX files # # From # Although we may know the offset of certain text fields in TeX DVI # and font files, we can't use them reliably because they are not # zero terminated. [but we do anyway, christos] 0 string \367\002 TeX DVI file >16 string >\0 (%s) 0 string \367\203 TeX generic font data 0 string \367\131 TeX packed font data >3 string >\0 (%s) 0 string \367\312 TeX virtual font data 0 string This\ is\ TeX, TeX transcript text 0 string This\ is\ METAFONT, METAFONT transcript text # There is no way to detect TeX Font Metric (*.tfm) files without # breaking them apart and reading the data. The following patterns # match most *.tfm files generated by METAFONT or afm2tfm. 2 string \000\021 TeX font metric data >33 string >\0 (%s) 2 string \000\022 TeX font metric data >33 string >\0 (%s) # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com) 0 string \\input\ texinfo Texinfo source text 0 string This\ is\ Info\ file GNU Info text # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com) 0 string \\input TeX document text 0 string \\section LaTeX document text 0 string \\setlength LaTeX document text 0 string \\documentstyle LaTeX document text 0 string \\chapter LaTeX document text 0 string \\documentclass LaTeX 2e document text 0 string \\relax LaTeX auxiliary file 0 string \\contentsline LaTeX table of contents # Index and glossary files 0 string \\indexentry LaTeX raw index file 0 string \\begin{theindex} LaTeX sorted index 0 string \\glossaryentry LaTeX raw glossary 0 string \\begin{theglossary} LaTeX sorted glossary 0 string This\ is\ makeindex Makeindex log file # End of TeX # ------------------------------------------------------------------------ # ti-8x: file(1) magic for the TI-8x and TI-92 Graphing Calculators. # # From: Ryan McGuire (rmcguire@freenet.columbus.oh.us). # # NOTE: This list is not complete. # # Magic Numbers for the TI-82 # 0 string **TI82** TI-82 Graphing Calculator >0x000037 byte 0x0B TI-BASIC Group/Program File. # # Magic Numbers for the TI-83 # 0 string **TI83** TI-83 Graphing Calculator >0x000037 byte 0x0B TI-BASIC Group/Program File. # # Magic Numbers for the TI-85 # 0 string **TI85** TI-85 Graphing Calculator >11 string Backup Backup File. >0x000032 string ZS4 - ZShell Version 4 File. >0x000032 string ZS3 - ZShell Version 3 File. >0x00000B string GDatabase Graphics Database. >0x00003B byte 0x12 TI-BASIC Group/Program File. # # Magic Numbers for the TI-92 # 0 string **TI92** TI-92 Graphing Calculator >0x000058 byte 0x12 TI-BASIC Group File. >0x000012 string Function Function. >0x000048 byte 0x12 TI-BASIC Program. # Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the # program/group magic numbers in here because I cannot find any. 0 string **TI80** TI-80 Graphing Calculator File. 0 string **TI81** TI-81 Graphing Calculator File. #------------------------------------------------------------------------------ # timezone: file(1) magic for timezone data # # from Daniel Quinlan (quinlan@yggdrasil.com) # this should work on Linux, SunOS, and maybe others # Added new official magic number for recent versions of the Olson code 0 string TZif timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0 old timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0 old timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0 old timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0 old timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0 old timezone data 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0 old timezone data #------------------------------------------------------------------------------ # troff: file(1) magic for *roff # # updated by Daniel Quinlan (quinlan@yggdrasil.com) # troff input 0 string .\\" troff or preprocessor input text 0 string '\\" troff or preprocessor input text 0 string '.\\" troff or preprocessor input text 0 string \\" troff or preprocessor input text 0 string ''' troff or preprocessor input text # ditroff intermediate output text 0 string x\ T ditroff output text >4 string cat for the C/A/T phototypesetter >4 string ps for PostScript >4 string dvi for DVI >4 string ascii for ASCII >4 string lj4 for LaserJet 4 >4 string latin1 for ISO 8859-1 (Latin 1) >4 string X75 for xditview at 75dpi >>7 string -12 (12pt) >4 string X100 for xditview at 100dpi >>8 string -12 (12pt) # output data formats 0 string \100\357 very old (C/A/T) troff output data #------------------------------------------------------------------------------ # typeset: file(1) magic for other typesetting # 0 string Interpress/Xerox Xerox InterPress data >16 string / (version >>17 string >\0 %s) #------------------------------------------------------------------------------ # unknown: file(1) magic for unknown machines # # XXX - this probably should be pruned, as it'll match PDP-11 and # VAX image formats. # # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure, # respectively). # # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't # have the "version %ld", which may be a bogus COFFism (I don't think # there ever was COFF for the PDP-11). # # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a # long, as it would be on a VAX. # # 0x10C is 0414, 0x10D is 0415, and 0x10E is 416; those *are* unknown. # 0 short 0x107 unknown machine executable >8 short >0 not stripped >15 byte >0 - version %ld 0 short 0x108 unknown pure executable >8 short >0 not stripped >15 byte >0 - version %ld 0 short 0x109 PDP-11 separate I&D >8 short >0 not stripped >15 byte >0 - version %ld 0 short 0x10b unknown pure executable >8 short >0 not stripped >15 byte >0 - version %ld 0 long 0x10c unknown demand paged pure executable >16 long >0 not stripped 0 long 0x10d unknown demand paged pure executable >16 long >0 not stripped 0 long 0x10e unknown readable demand paged pure executable #------------------------------------------------------------------------------ # uuencode: file(1) magic for ASCII-encoded files # # GRR: the first line of xxencoded files is identical to that in uuencoded # files, but the first character in most subsequent lines is 'h' instead of # 'M'. (xxencoding uses lowercase letters in place of most of uuencode's # punctuation and survives BITNET gateways better.) If regular expressions # were supported, this entry could possibly be split into two with # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs). 0 string begin\040 uuencoded or xxencoded text # btoa(1) is an alternative to uuencode that requires less space. 0 string xbtoa\ Begin btoa'd text # ship(1) is another, much cooler alternative to uuencode. # Greg Roelofs, newt@uchicago.edu 0 string $\012ship ship'd binary text # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?) # Greg Roelofs, newt@uchicago.edu 0 string Decode\ the\ following\ with\ bdeco bencoded News text # BinHex is the Macintosh ASCII-encoded file format (see also "apple") # Daniel Quinlan, quinlan@yggdrasil.com 11 string must\ be\ converted\ with\ BinHex BinHex binary text >41 string x \b, version %.3s # GRR: is MIME BASE64 encoding handled somewhere? #------------------------------------------------------------------------------ # varied.out: file(1) magic for various USG systems # # Herewith many of the object file formats used by USG systems. # Most have been moved to files for a particular processor, # and deleted if they duplicate other entries. # 0 short 0610 Perkin-Elmer executable # AMD 29K 0 beshort 0572 amd 29k coff noprebar executable 0 beshort 01572 amd 29k coff prebar executable 0 beshort 0160007 amd 29k coff archive # Cray 6 beshort 0407 unicos (cray) executable # Ultrix 4.3 596 string \130\337\377\377 Ultrix core file >600 string >\0 from '%s' # BeOS and MAcOS PEF executables # From: hplus@zilker.net (Jon Watte) 0 string Joy!peffpwpc header for PowerPC PEF executable # # ava assembler/linker Uros Platise 0 string avaobj AVR assembler object code >7 string >\0 version '%s' # gnu gmon magic From: Eugen Dedu 0 string gmon GNU prof performance data >4 long x - version %ld #------------------------------------------------------------------------------ # vax: file(1) magic for VAX executable/object and APL workspace # 0 lelong 0101557 VAX single precision APL workspace 0 lelong 0101556 VAX double precision APL workspace # # VAX a.out (32V, BSD) # 0 lelong 0407 VAX executable >16 lelong >0 not stripped 0 lelong 0410 VAX pure executable >16 lelong >0 not stripped 0 lelong 0413 VAX demand paged pure executable >16 lelong >0 not stripped 0 lelong 0420 VAX demand paged (first page unmapped) pure executable >16 lelong >0 not stripped # # VAX COFF # # The `versions' should be un-commented if they work for you. # (Was the problem just one of endianness?) # 0 leshort 0570 VAX COFF executable >12 lelong >0 not stripped >22 leshort >0 - version %ld 0 leshort 0575 VAX COFF pure executable >12 lelong >0 not stripped >22 leshort >0 - version %ld #------------------------------------------------------------------------------ # vicar: file(1) magic for VICAR files. # # From: Ossama Othman 32 string BYTE \b, 8 bits = VAX byte >32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2 >32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4 >32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4 >32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8 >32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8 # VICAR label file 43 string SFDU_LABEL VICAR label file #------------------------------------------------------------------------------ # visx: file(1) magic for Visx format files # 0 short 0x5555 VISX image file >2 byte 0 (zero) >2 byte 1 (unsigned char) >2 byte 2 (short integer) >2 byte 3 (float 32) >2 byte 4 (float 64) >2 byte 5 (signed char) >2 byte 6 (bit-plane) >2 byte 7 (classes) >2 byte 8 (statistics) >2 byte 10 (ascii text) >2 byte 15 (image segments) >2 byte 100 (image set) >2 byte 101 (unsigned char vector) >2 byte 102 (short integer vector) >2 byte 103 (float 32 vector) >2 byte 104 (float 64 vector) >2 byte 105 (signed char vector) >2 byte 106 (bit plane vector) >2 byte 121 (feature vector) >2 byte 122 (feature vector library) >2 byte 124 (chain code) >2 byte 126 (bit vector) >2 byte 130 (graph) >2 byte 131 (adjacency graph) >2 byte 132 (adjacency graph library) >2 string .VISIX (ascii text) #------------------------------------------------------------------------------ # vms: file(1) magic for VMS executables (experimental) # # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu) # GRR 950122: I'm just guessing on these, based on inspection of the headers # of three executables each for Alpha and VAX architectures. The VAX files # all had headers similar to this: # # 00000 b0 00 30 00 44 00 60 00 00 00 00 00 30 32 30 35 ..0.D.`.....0205 # 00010 01 01 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 ................ # 0 string \xb0\0\x30\0 VMS VAX executable >44032 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption # # The AXP files all looked like this, except that the byte at offset 0x22 # was 06 in some of them and 07 in others: # # 00000 03 00 00 00 00 00 00 00 ec 02 00 00 10 01 00 00 ................ # 00010 68 00 00 00 98 00 00 00 b8 00 00 00 00 00 00 00 h............... # 00020 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ # 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ # 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................ # 0 belong 0x03000000 VMS Alpha executable >75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption # ----------------------------------------------------------- # VMware specific files (deducted from version 1.1 and log file entries) # Anthon van der Neut (anthon@mnt.org) 0 belong 0x4d52564e VMware nvram 0 belong 0x434f5744 >8 byte 3 VMware virtual disk >>32 lelong x (%d/ >>36 lelong x \b%d/ >>40 lelong x \b%d) >8 byte 2 VMware undoable disk >>32 string >\0 (%s) #WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE 0 string \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable text >15 byte 0 Optimized for Intel >15 byte 1 Optimized for Non-Intel 1 string WPC (Corel/WP) >8 short 257 WordPerfect macro >8 short 258 WordPerfect help file >8 short 259 WordPerfect keyboard file >8 short 266 WordPerfect document >8 short 267 WordPerfect dictionary >8 short 268 WordPerfect thesaurus >8 short 269 WordPerfect block >8 short 270 WordPerfect rectangular block >8 short 271 WordPerfect column block >8 short 272 WordPerfect printer data >8 short 275 WordPerfect printer data >8 short 276 WordPerfect driver resource data >8 short 279 WordPerfect hyphenation code >8 short 280 WordPerfect hyphenation data >8 short 281 WordPerfect macro resource data >8 short 283 WordPerfect hyphenation lex >8 short 285 WordPerfect wordlist >8 short 286 WordPerfect equation resource data >8 short 289 WordPerfect spell rules >8 short 290 WordPerfect dictionary rules >8 short 295 WordPerfect spell rules (Microlytics) >8 short 299 WordPerfect settings file >8 short 301 WordPerfect 4.2 document >8 short 325 WordPerfect dialog file >8 short 332 WordPerfect button bar >8 short 513 Shell macro >8 short 522 Shell definition >8 short 769 Notebook macro >8 short 770 Notebook help file >8 short 771 Notebook keyboard file >8 short 778 Notebook definition >8 short 1026 Calculator help file >8 short 1538 Calendar help file >8 short 1546 Calendar data file >8 short 1793 Editor macro >8 short 1794 Editor help file >8 short 1795 Editor keyboard file >8 short 1817 Editor macro resource file >8 short 2049 Macro editor macro >8 short 2050 Macro editor help file >8 short 2051 Macro editor keyboard file >8 short 2305 PlanPerfect macro >8 short 2306 PlanPerfect help file >8 short 2307 PlanPerfect keyboard file >8 short 2314 PlanPerfect worksheet >8 short 2319 PlanPerfect printer definition >8 short 2322 PlanPerfect graphic definition >8 short 2323 PlanPerfect data >8 short 2324 PlanPerfect temporary printer >8 short 2329 PlanPerfect macro resource data >8 byte 11 Mail >8 short 2818 help file >8 short 2821 distribution list >8 short 2826 out box >8 short 2827 in box >8 short 2836 users archived mailbox >8 short 2837 archived message database >8 short 2838 archived attachments >8 short 3083 Printer temporary file >8 short 3330 Scheduler help file >8 short 3338 Scheduler in file >8 short 3339 Scheduler out file >8 short 3594 GroupWise settings file >8 short 3601 GroupWise directory services >8 short 3627 GroupWise settings file >8 short 4362 Terminal resource data >8 short 4363 Terminal resource data >8 short 4395 Terminal resource data >8 short 4619 GUI loadable text >8 short 4620 graphics resource data >8 short 4621 printer settings file >8 short 4622 port definition file >8 short 4623 print queue parameters >8 short 4624 compressed file >8 short 5130 Network service msg file >8 short 5131 Network service msg file >8 short 5132 Async gateway login msg >8 short 5134 GroupWise message file >8 short 7956 GroupWise admin domain database >8 short 7957 GroupWise admin host database >8 short 7959 GroupWise admin remote host database >8 short 7960 GroupWise admin ADS deferment data file >8 short 8458 IntelliTAG (SGML) compiled DTD >8 long 18219264 WordPerfect graphic image (1.0) >8 long 18219520 WordPerfect graphic image (2.0) #end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE #------------------------------------------------------------------------------ # file(1) magic(5) data for xdelta Josh MacDonald # 0 string %XDELTA% XDelta binary patch file 0.14 0 string %XDZ000% XDelta binary patch file 0.18 0 string %XDZ001% XDelta binary patch file 0.20 0 string %XDZ002% XDelta binary patch file 1.0 0 string %XDZ003% XDelta binary patch file 1.0.4 0 string %XDZ004% XDelta binary patch file 1.1 #------------------------------------------------------------------------------ # xenix: file(1) magic for Microsoft Xenix # # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small # model" lifted from "magic.xenix", with comment "derived empirically; # treat as folklore until proven" # # "small model", "large model", "huge model" stuff lifted from XXX # # XXX - "x.out" collides with PDP-11 archives # 0 string core core file (Xenix) 0 byte 0x80 8086 relocatable (Microsoft) 0 leshort 0xff65 x.out >2 string __.SYMDEF randomized >0 byte x archive 0 leshort 0x206 Microsoft a.out >8 leshort 1 Middle model >0x1e leshort &0x10 overlay >0x1e leshort &0x2 separate >0x1e leshort &0x4 pure >0x1e leshort &0x800 segmented >0x1e leshort &0x400 standalone >0x1e leshort &0x8 fixed-stack >0x1c byte &0x80 byte-swapped >0x1c byte &0x40 word-swapped >0x10 lelong >0 not-stripped >0x1e leshort ^0xc000 pre-SysV >0x1e leshort &0x4000 V2.3 >0x1e leshort &0x8000 V3.0 >0x1c byte &0x4 86 >0x1c byte &0xb 186 >0x1c byte &0x9 286 >0x1c byte &0xa 386 >0x1f byte <0x040 small model >0x1f byte =0x048 large model >0x1f byte =0x049 huge model >0x1e leshort &0x1 executable >0x1e leshort ^0x1 object file >0x1e leshort &0x40 Large Text >0x1e leshort &0x20 Large Data >0x1e leshort &0x120 Huge Objects Enabled >0x10 lelong >0 not stripped 0 leshort 0x140 old Microsoft 8086 x.out >0x3 byte &0x4 separate >0x3 byte &0x2 pure >0 byte &0x1 executable >0 byte ^0x1 relocatable >0x14 lelong >0 not stripped 0 lelong 0x206 b.out >0x1e leshort &0x10 overlay >0x1e leshort &0x2 separate >0x1e leshort &0x4 pure >0x1e leshort &0x800 segmented >0x1e leshort &0x400 standalone >0x1e leshort &0x1 executable >0x1e leshort ^0x1 object file >0x1e leshort &0x4000 V2.3 >0x1e leshort &0x8000 V3.0 >0x1c byte &0x4 86 >0x1c byte &0xb 186 >0x1c byte &0x9 286 >0x1c byte &0x29 286 >0x1c byte &0xa 386 >0x1e leshort &0x4 Large Text >0x1e leshort &0x2 Large Data >0x1e leshort &0x102 Huge Objects Enabled 0 leshort 0x580 XENIX 8086 relocatable or 80286 small model #------------------------------------------------------------------------------ # zilog: file(1) magic for Zilog Z8000. # # Was it big-endian or little-endian? My Product Specification doesn't # say. # 0 long 0xe807 object file (z8000 a.out) 0 long 0xe808 pure object file (z8000 a.out) 0 long 0xe809 separate object file (z8000 a.out) 0 long 0xe805 overlay object file (z8000 a.out) #------------------------------------------------------------------------------ # zyxel: file(1) magic for ZyXEL modems # # From # These are the /etc/magic entries to decode datafiles as used for the # ZyXEL U-1496E DATA/FAX/VOICE modems. (This header conforms to a # ZyXEL-defined standard) 0 string ZyXEL\002 ZyXEL voice data >10 byte 0 - CELP encoding >10 byte&0x0B 1 - ADPCM2 encoding >10 byte&0x0B 2 - ADPCM3 encoding >10 byte&0x0B 3 - ADPCM4 encoding >10 byte&0x0B 8 - New ADPCM3 encoding >10 byte&0x04 4 with resync htdig-3.2.0b6/installdir/HtFileType-magic.mime0100644006314600127310000004137707605307573020524 0ustar angusgbhtdig# Magic data for for file(1) command # # The format is 4-5 columns: # Column #1: byte number to begin checking from, ">" indicates continuation # Column #2: type of data to match # Column #3: contents of data to match # Column #4: MIME type of result # Column #5: MIME encoding of result (optional) # # Modified by for compatibility with # different versions of file(1): # - Columns are separated by TABs (for traditional versions) # - spaces and '<'s within a column are escaped by '\' (for new versions) # - Hex numbers in strings are given as '\0x' (traditional) and '\x' (new) # - Null characters (\000) traditionally terminate strings, but now don't #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # Add any locally observed files here. #------------------------------------------------------------------------------ # end local stuff #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Java 0 short 0xcafe >2 short 0xbabe application/java # Microsoft WAVE format (*.wav) # [GRR 950115: probably all of the shorts and longs should be leshort/lelong] # Microsoft RIFF 0 string RIFF audio/unknown # - WAVE format >8 string WAVE audio/x-wav >8 string AVI video/x-msvideo # 0 belong 0x2e7261fd application/x-realaudio # MPEG Layer 3 sound files 0 beshort &0xffe0 audio/mpeg #MP3 with ID3 tag 0 string ID3 audio/mpeg # Ogg/Vorbis 0 string OggS audio/x-ogg #------------------------------------------------------------------------------ # commands: file(1) magic for various shells and interpreters # #0 string :\ shell archive or commands for antique kernel text 0 string #!/bin/sh application/x-shellscript 0 string #!\ /bin/sh application/x-shellscript 0 string #!/bin/csh application/x-shellscript 0 string #!\ /bin/csh application/x-shellscript # korn shell magic, sent by George Wu, gwu@clyde.att.com 0 string #!/bin/ksh application/x-shellscript 0 string #!\ /bin/ksh application/x-shellscript 0 string #!/bin/tcsh application/x-shellscript 0 string #!\ /bin/tcsh application/x-shellscript 0 string #!/usr/local/tcsh application/x-shellscript 0 string #!\ /usr/local/tcsh application/x-shellscript 0 string #!/usr/local/bin/tcsh application/x-shellscript 0 string #!\ /usr/local/bin/tcsh application/x-shellscript # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 0 string #!/bin/bash application/x-shellscript 0 string #!\ /bin/bash application/x-shellscript 0 string #!/usr/local/bin/bash application/x-shellscript 0 string #!\ /usr/local/bin/bash application/x-shellscript # # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson) 0 string #!/usr/local/bin/zsh application/x-shellscript 0 string #!\ /usr/local/bin/zsh application/x-shellscript 0 string #!/usr/local/bin/ash application/x-shellscript 0 string #!\ /usr/local/bin/ash application/x-shellscript #0 string #!/usr/local/bin/ae Neil Brown's ae #0 string #!\ /usr/local/bin/ae Neil Brown's ae 0 string #!/bin/nawk application/x-nawk 0 string #!\ /bin/nawk application/x-nawk 0 string #!/usr/bin/nawk application/x-nawk 0 string #!\ /usr/bin/nawk application/x-nawk 0 string #!/usr/local/bin/nawk application/x-nawk 0 string #!\ /usr/local/bin/nawk application/x-nawk 0 string #!/bin/gawk application/x-gawk 0 string #!\ /bin/gawk application/x-gawk 0 string #!/usr/bin/gawk application/x-gawk 0 string #!\ /usr/bin/gawk application/x-gawk 0 string #!/usr/local/bin/gawk application/x-gawk 0 string #!\ /usr/local/bin/gawk application/x-gawk # 0 string #!/bin/awk application/x-awk 0 string #!\ /bin/awk application/x-awk 0 string #!/usr/bin/awk application/x-awk 0 string #!\ /usr/bin/awk application/x-awk 0 string BEGIN application/x-awk # For Larry Wall's perl language. The ``eval'' line recognizes an # outrageously clever hack for USG systems. # Keith Waclena 0 string #!/bin/perl application/x-perl 0 string #!\ /bin/perl application/x-perl 0 string eval\ "exec\ /bin/perl application/x-perl 0 string #!/usr/bin/perl application/x-perl 0 string #!\ /usr/bin/perl application/x-perl 0 string eval\ "exec\ /usr/bin/perl application/x-perl 0 string #!/usr/local/bin/perl application/x-perl 0 string #!\ /usr/local/bin/perl application/x-perl 0 string eval\ "exec\ /usr/local/bin/perl application/x-perl #------------------------------------------------------------------------------ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc. # # Formats for various forms of compressed data # Formats for "compress" proper have been moved into "compress.c", # because it tries to uncompress it to figure out what's inside. # (Technically, "gzip", "bzip2" etc. are encodings, not mime-types, # and should also decompress to find out the type of data inside.) # standard unix compress 0 string \037\235 application/x-compress # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver) 0 string \037\213 application/x-gzip # bzip2 0 string BZh application/x-bzip2 0 string PK\003\004 application/x-zip # According to gzip.h, this is the correct byte order for packed data. 0 string \037\036 application/octet-stream # # This magic number is byte-order-independent. # 0 short 017437 application/octet-stream # XXX - why *two* entries for "compacted data", one of which is # byte-order independent, and one of which is byte-order dependent? # # compacted data 0 short 0x1fff application/octet-stream 0 string \377\037 application/octet-stream # huf output 0 short 0145405 application/octet-stream # Squeeze and Crunch... # These numbers were gleaned from the Unix versions of the programs to # handle these formats. Note that I can only uncrunch, not crunch, and # I didn't have a crunched file handy, so the crunch number is untested. # Keith Waclena #0 leshort 0x76FF squeezed data (CP/M, DOS) #0 leshort 0x76FE crunched data (CP/M, DOS) # Freeze #0 string \037\237 Frozen file 2.1 #0 string \037\236 Frozen file 1.0 (or gzip 0.5) # lzh? #0 string \037\240 LZH compressed data 257 string ustar\0 application/x-tar posix 257 string ustar\040\040\0 application/x-tar gnu 0 short 070707 application/x-cpio 0 short 0143561 application/x-cpio swapped 0 string = application/x-archive 0 string ! application/x-archive >8 string debian application/x-debian-package #------------------------------------------------------------------------------ # # RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com) # 0 beshort 0xedab >2 beshort 0xeedb application/x-rpm 0 lelong&0x8080ffff 0x0000081a application/x-arc lzw 0 lelong&0x8080ffff 0x0000091a application/x-arc squashed 0 lelong&0x8080ffff 0x0000021a application/x-arc uncompressed 0 lelong&0x8080ffff 0x0000031a application/x-arc packed 0 lelong&0x8080ffff 0x0000041a application/x-arc squeezed 0 lelong&0x8080ffff 0x0000061a application/x-arc crunched 0 leshort 0xea60 application/octet-stream x-arj # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu) 2 string -lh0- application/x-lharc lh0 2 string -lh1- application/x-lharc lh1 2 string -lz4- application/x-lharc lz4 2 string -lz5- application/x-lharc lz5 # [never seen any but the last; -lh4- reported in comp.compression:] 2 string -lzs- application/x-lha lzs 2 string -lh\ - application/x-lha lh 2 string -lhd- application/x-lha lhd 2 string -lh2- application/x-lha lh2 2 string -lh3- application/x-lha lh3 2 string -lh4- application/x-lha lh4 2 string -lh5- application/x-lha lh5 2 string -lh6- application/x-lha lh6 2 string -lh7- application/x-lha lh7 # Shell archives 10 string #\ This\ is\ a\ shell\ archive application/octet-stream x-shell #------------------------------------------------------------------------------ # frame: file(1) magic for FrameMaker files # # This stuff came on a FrameMaker demo tape, most of which is # copyright, but this file is "published" as witness the following: # 0 string \ # modified by Lachlan Andrew to # match leading whitespace, but still work with old versions # of file(1) which don't recognise the /cb options # 0 string \14 byte 12 (OS/2 1.x format) #>14 byte 64 (OS/2 2.x format) #>14 byte 40 (Windows 3.x format) #0 string IC icon #0 string PI pointer #0 string CI color icon #0 string CP color pointer #0 string BA bitmap array #------------------------------------------------------------------------------ # lisp: file(1) magic for lisp programs # # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com) 0 string ;; text/plain 8bit # Emacs 18 - this is always correct, but not very magical. 0 string \012( application/x-elc # Emacs 19 0 string ;ELC\023\000\000\000 application/x-elc #------------------------------------------------------------------------------ # mail.news: file(1) magic for mail and news # # There are tests to ascmagic.c to cope with mail and news. 0 string Relay-Version: message/rfc822 7bit 0 string #!\ rnews message/rfc822 7bit 0 string N#!\ rnews message/rfc822 7bit 0 string Forward\ to message/rfc822 7bit 0 string Pipe\ to message/rfc822 7bit 0 string Return-Path: message/rfc822 7bit 0 string Path: message/news 8bit 0 string Xref: message/news 8bit 0 string From: message/rfc822 7bit 0 string Article message/news 8bit #------------------------------------------------------------------------------ # msword: file(1) magic for MS Word files # # Contributor claims: # Reversed-engineered MS Word magic numbers # Some of these also occur in PowerPoint. -- lha@users.sourceforge.net 0 string \376\067\0\043 application/msword 0 string \320\317\021\340\241\261 application/msword 0 string \333\245-\0\0\0 application/msword #------------------------------------------------------------------------------ # printer: file(1) magic for printer-formatted files # # PostScript 0 string %! application/postscript 0 string \004%! application/postscript 0 string \033%-12345X%!PS application/postscript # Acrobat # (due to clamen@cs.cmu.edu) 0 string %PDF- application/pdf #------------------------------------------------------------------------------ # sc: file(1) magic for "sc" spreadsheet # 38 string Spreadsheet application/x-sc #------------------------------------------------------------------------------ # tex: file(1) magic for TeX files # # XXX - needs byte-endian stuff (big-endian and little-endian DVI?) # # From # Although we may know the offset of certain text fields in TeX DVI # and font files, we can't use them reliably because they are not # zero terminated. [but we do anyway, christos] 0 string \367\002 application/x-dvi #0 string \367\203 TeX generic font data #0 string \367\131 TeX packed font data #0 string \367\312 TeX virtual font data #0 string This\ is\ TeX, TeX transcript text #0 string This\ is\ METAFONT, METAFONT transcript text # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com) #0 string \\input\ texinfo Texinfo source text #0 string This\ is\ Info\ file GNU Info text # correct TeX magic for Linux (and maybe more) # from Peter Tobias (tobias@server.et-inf.fho-emden.de) # 0 leshort 0x02f7 application/x-dvi # RTF - Rich Text Format 0 string {\\rtf text/rtf #------------------------------------------------------------------------------ # animation: file(1) magic for animation/movie formats # # animation formats, originally from vax@ccwf.cc.utexas.edu (VaX#n8) # MPEG file 0 belong 0x000001b3 video/mpeg 0 belong 0x000001ba video/mpeg # FLI animation format 0 leshort 0xAF11 video/fli # FLC animation format 0 leshort 0xAF12 video/flc # AVI >8 string AVI\ video/avi # # SGI and Apple formats # 0 string MOVI video/sgi 4 string moov video/quicktime moov 4 string mdat video/quicktime mdat # The contributor claims: # I couldn't find a real magic number for these, however, this # -appears- to work. Note that it might catch other files, too, # so BE CAREFUL! # # Note that title and author appear in the two 20-byte chunks # at decimal offsets 2 and 22, respectively, but they are XOR'ed with # 255 (hex FF)! DL format SUCKS BIG ROCKS. # # DL file version 1 , medium format (160x100, 4 images/screen) 0 byte 1 video/unknown 0 byte 2 video/unknown # # Databases # # GDBM magic numbers # Will be maintained as part of the GDBM distribution in the future. # 0 belong 0x13579ace application/x-gdbm 0 lelong 0x13579ace application/x-gdbm 0 string GDBM application/x-gdbm # 0 belong 0x061561 application/x-dbm # # Executables # 0 string \177ELF >4 byte 0 >4 byte 1 >4 byte 2 >5 byte 0 >5 byte 1 >>16 leshort 0 >>16 leshort 1 application/x-object >>16 leshort 2 application/x-executable >>16 leshort 3 application/x-sharedlib >>16 leshort 4 application/x-coredump # # DOS 0 string MZ application/x-dosexec # # KDE 0 string [KDE\ Desktop\ Entry] application/x-kdelnk 0 string \#\ KDE\ Config\ File application/x-kdelnk # xmcd database file for kscd 0 string \#\ xmcd text/xmcd #------------------------------------------------------------------------------ # pkgadd: file(1) magic for SysV R4 PKG Datastreams # 0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package #PNG Image Format 0 string \x89PNG image/png 0 string \0x89PNG image/png htdig-3.2.0b6/installdir/Makefile.am0100644006314600127310000000705010062350264016564 0ustar angusgbhtdig include $(top_srcdir)/Makefile.config man_MANS = htdig-pdfparser.1 htdig.1 htdump.1 htfuzzy.1 htload.1 htmerge.1 \ htnotify.1 htpurge.1 htsearch.1 htstat.1 rundig.1 htdigconfig.8 IMAGES= button1.gif button2.gif button3.gif button4.gif button5.gif \ button6.gif button7.gif button8.gif button9.gif buttonl.gif \ buttonr.gif button10.gif htdig.gif star.gif star_blank.gif \ button1.png button2.png button3.png button4.png button5.png \ button6.png button7.png button8.png button9.png buttonl.png \ buttonr.png button10.png htdig.png star.png star_blank.png COMMONHTML= header.html footer.html wrapper.html nomatch.html syntax.html \ long.html short.html COMMONDICT= bad_words english.0 english.aff synonyms EXTRA_DIST = $(IMAGES) $(COMMONHTML) $(COMMONDICT) rundig htdig.conf mime.types \ search.html HtFileType HtFileType-magic.mime cookies.txt install-data-local: all $(mkinstalldirs) $(DESTDIR)$(DATABASE_DIR) @echo "Installing default configuration files..." $(mkinstalldirs) $(DESTDIR)$(CONFIG_DIR) @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/htdig.conf ]; then sed -e s%@\DATABASE_DIR@%$(DATABASE_DIR)% -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/htdig.conf >$(DESTDIR)$(CONFIG_DIR)/htdig.conf; echo $(DESTDIR)$(CONFIG_DIR)/htdig.conf;fi @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/mime.types ]; then cp $(top_srcdir)/installdir/mime.types $(DESTDIR)$(CONFIG_DIR)/mime.types; echo $(DESTDIR)$(CONFIG_DIR)/mime.types;fi @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime ]; then cp $(top_srcdir)/installdir/HtFileType-magic.mime $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime; echo $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime;fi $(mkinstalldirs) $(DESTDIR)$(SEARCH_DIR) @if [ ! -f $(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM) ]; then sed -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/search.html >$(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM); echo $(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM);fi $(mkinstalldirs) $(DESTDIR)$(COMMON_DIR) @for i in $(COMMONHTML); do \ if [ ! -f $(DESTDIR)$(COMMON_DIR)/$$i ]; then sed -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/$$i >$(DESTDIR)$(COMMON_DIR)/$$i; echo $(DESTDIR)$(COMMON_DIR)/$$i;fi; \ done && test -z "$$fail" @for i in $(COMMONDICT); do \ if [ ! -f $(DESTDIR)$(COMMON_DIR)/$$i ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/$$i $(DESTDIR)$(COMMON_DIR)/$$i; echo $(DESTDIR)$(COMMON_DIR)/$$i; fi; \ done && test -z "$$fail" @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/cookies.txt ]; then cp $(top_srcdir)/installdir/cookies.txt $(DESTDIR)$(CONFIG_DIR)/cookies.txt; echo $(DESTDIR)$(CONFIG_DIR)/cookies.txt;fi @echo "Installing images..." $(mkinstalldirs) $(DESTDIR)$(IMAGE_DIR) @for i in $(IMAGES); do \ if [ ! -f $(DESTDIR)$(IMAGE_DIR)/$$i ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/$$i $(DESTDIR)$(IMAGE_DIR)/$$i; echo $(DESTDIR)$(IMAGE_DIR)/$$i;fi; \ done && test -z "$$fail" @echo "Creating rundig script..." $(mkinstalldirs) $(DESTDIR)$(bindir) @if [ ! -f $(DESTDIR)$(bindir)/rundig ]; then \ sed -e s%@\BIN_DIR@%$(bindir)% -e s%@\COMMON_DIR@%$(COMMON_DIR)% -e s%@\DATABASE_DIR@%$(DATABASE_DIR)% -e s%@\DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)% $(top_srcdir)/installdir/rundig >$(DESTDIR)$(bindir)/rundig; \ chmod 755 $(DESTDIR)$(bindir)/rundig; \ fi @echo "Installing file-type identification script..." $(mkinstalldirs) $(DESTDIR)$(bindir) @if [ ! -f $(DESTDIR)$(bindir)/HtFileType ]; then \ sed -es%@\CONFIG_DIR@%$(CONFIG_DIR)% $(top_srcdir)/installdir/HtFileType >$(DESTDIR)$(bindir)/HtFileType; \ chmod 755 $(DESTDIR)$(bindir)/HtFileType; \ fi htdig-3.2.0b6/installdir/Makefile.in0100644006314600127310000004241010063260372016575 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la man_MANS = htdig-pdfparser.1 htdig.1 htdump.1 htfuzzy.1 htload.1 htmerge.1 \ htnotify.1 htpurge.1 htsearch.1 htstat.1 rundig.1 htdigconfig.8 IMAGES = button1.gif button2.gif button3.gif button4.gif button5.gif \ button6.gif button7.gif button8.gif button9.gif buttonl.gif \ buttonr.gif button10.gif htdig.gif star.gif star_blank.gif \ button1.png button2.png button3.png button4.png button5.png \ button6.png button7.png button8.png button9.png buttonl.png \ buttonr.png button10.png htdig.png star.png star_blank.png COMMONHTML = header.html footer.html wrapper.html nomatch.html syntax.html \ long.html short.html COMMONDICT = bad_words english.0 english.aff synonyms EXTRA_DIST = $(IMAGES) $(COMMONHTML) $(COMMONDICT) rundig htdig.conf mime.types \ search.html HtFileType HtFileType-magic.mime cookies.txt subdir = installdir ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = htdig.1 htdig-pdfparser.1 htfuzzy.1 htmerge.1 \ htpurge.1 htstat.1 htdigconfig.8 htdump.1 htload.1 htnotify.1 \ htsearch.1 rundig.1 depcomp = am__depfiles_maybe = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.config \ Makefile.am htdig-pdfparser.1.in htdig.1.in htdigconfig.8.in \ htdump.1.in htfuzzy.1.in htload.1.in htmerge.1.in htnotify.1.in \ htpurge.1.in htsearch.1.in htstat.1.in rundig.1.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign installdir/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) htdig.1: $(top_builddir)/config.status htdig.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htdig-pdfparser.1: $(top_builddir)/config.status htdig-pdfparser.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htfuzzy.1: $(top_builddir)/config.status htfuzzy.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htmerge.1: $(top_builddir)/config.status htmerge.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htpurge.1: $(top_builddir)/config.status htpurge.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htstat.1: $(top_builddir)/config.status htstat.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htdigconfig.8: $(top_builddir)/config.status htdigconfig.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htdump.1: $(top_builddir)/config.status htdump.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htload.1: $(top_builddir)/config.status htload.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htnotify.1: $(top_builddir)/config.status htnotify.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ htsearch.1: $(top_builddir)/config.status htsearch.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ rundig.1: $(top_builddir)/config.status rundig.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done man8dir = $(mandir)/man8 install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man8dir) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 8*) ;; \ *) ext='8' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(man1dir) $(DESTDIR)$(man8dir) 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-data-local install-man install-exec-am: install-info: install-info-am install-man: install-man1 install-man8 installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 uninstall-man8 .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-data-local install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-man8 install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-info-am uninstall-man \ uninstall-man1 uninstall-man8 install-data-local: all $(mkinstalldirs) $(DESTDIR)$(DATABASE_DIR) @echo "Installing default configuration files..." $(mkinstalldirs) $(DESTDIR)$(CONFIG_DIR) @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/htdig.conf ]; then sed -e s%@\DATABASE_DIR@%$(DATABASE_DIR)% -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/htdig.conf >$(DESTDIR)$(CONFIG_DIR)/htdig.conf; echo $(DESTDIR)$(CONFIG_DIR)/htdig.conf;fi @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/mime.types ]; then cp $(top_srcdir)/installdir/mime.types $(DESTDIR)$(CONFIG_DIR)/mime.types; echo $(DESTDIR)$(CONFIG_DIR)/mime.types;fi @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime ]; then cp $(top_srcdir)/installdir/HtFileType-magic.mime $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime; echo $(DESTDIR)$(CONFIG_DIR)/HtFileType-magic.mime;fi $(mkinstalldirs) $(DESTDIR)$(SEARCH_DIR) @if [ ! -f $(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM) ]; then sed -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/search.html >$(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM); echo $(DESTDIR)$(SEARCH_DIR)/$(SEARCH_FORM);fi $(mkinstalldirs) $(DESTDIR)$(COMMON_DIR) @for i in $(COMMONHTML); do \ if [ ! -f $(DESTDIR)$(COMMON_DIR)/$$i ]; then sed -e s%@\IMAGEDIR@%$(IMAGE_URL_PREFIX)% $(top_srcdir)/installdir/$$i >$(DESTDIR)$(COMMON_DIR)/$$i; echo $(DESTDIR)$(COMMON_DIR)/$$i;fi; \ done && test -z "$$fail" @for i in $(COMMONDICT); do \ if [ ! -f $(DESTDIR)$(COMMON_DIR)/$$i ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/$$i $(DESTDIR)$(COMMON_DIR)/$$i; echo $(DESTDIR)$(COMMON_DIR)/$$i; fi; \ done && test -z "$$fail" @if [ ! -f $(DESTDIR)$(CONFIG_DIR)/cookies.txt ]; then cp $(top_srcdir)/installdir/cookies.txt $(DESTDIR)$(CONFIG_DIR)/cookies.txt; echo $(DESTDIR)$(CONFIG_DIR)/cookies.txt;fi @echo "Installing images..." $(mkinstalldirs) $(DESTDIR)$(IMAGE_DIR) @for i in $(IMAGES); do \ if [ ! -f $(DESTDIR)$(IMAGE_DIR)/$$i ]; then $(INSTALL_DATA) $(top_srcdir)/installdir/$$i $(DESTDIR)$(IMAGE_DIR)/$$i; echo $(DESTDIR)$(IMAGE_DIR)/$$i;fi; \ done && test -z "$$fail" @echo "Creating rundig script..." $(mkinstalldirs) $(DESTDIR)$(bindir) @if [ ! -f $(DESTDIR)$(bindir)/rundig ]; then \ sed -e s%@\BIN_DIR@%$(bindir)% -e s%@\COMMON_DIR@%$(COMMON_DIR)% -e s%@\DATABASE_DIR@%$(DATABASE_DIR)% -e s%@\DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)% $(top_srcdir)/installdir/rundig >$(DESTDIR)$(bindir)/rundig; \ chmod 755 $(DESTDIR)$(bindir)/rundig; \ fi @echo "Installing file-type identification script..." $(mkinstalldirs) $(DESTDIR)$(bindir) @if [ ! -f $(DESTDIR)$(bindir)/HtFileType ]; then \ sed -es%@\CONFIG_DIR@%$(CONFIG_DIR)% $(top_srcdir)/installdir/HtFileType >$(DESTDIR)$(bindir)/HtFileType; \ chmod 755 $(DESTDIR)$(bindir)/HtFileType; \ fi # 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: htdig-3.2.0b6/installdir/bad_words0100644006314600127310000000011406774067233016431 0ustar angusgbhtdigthe and for with that this you are from will not was have your can all may htdig-3.2.0b6/installdir/button1.gif0100644006314600127310000000136306275416057016632 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—Y€•X~”!ù,þ@€pH …d@ˆÐ¨ðh8 ®Øƒa9F"¡X,h³"¡%<½€Aá87|ÞÑ`¬oQr xŠ l_… ‰ž~€‚B†š²²¢ lD ™É“]B—  ààÎ ¼q¿™ "#$$#!är%¨¤JA6 4t¨W"€Ã&Hˆè§á¹tÔ@€ D4LáPEŠ$Bx(W!Ú‚u.eš°má*X8lÁ"…þ‰8dø`7€= ©0‰+Z8„ÑBʼn :d°‚@I@`ÚÁ)Š/Æp±eÖ­‚6ÖBÓ§Q§V½ú–kÑ£d.­ bĉœ;{þ :4îјÀËR$ %O¦\ùÏ%Ì‚ÚtH:Ÿˆ¬/*Èè‹.Myô쑘=â´?¢º*æxp[·o B€ëWî:uìÚ)•0¬²d–5³@!š®ŒBÀ¬j i¬ Âg¨uK Ì"—pßÔé( H™ª…!DŠ5’€«”:úƒÌQwè±G“R`ˆAÆh¤±¸G/Tņm,xa/L(‘¨|‡%z;htdig-3.2.0b6/installdir/button1.png0100644006314600127310000000262406645156451016652 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—Y€•X~”Þ7û±tRNS@æØfBIDATxœb`€&fV `aaf‚‹1³°±s€;+ 3T €`:YØ88¹¸¹yxx¸¹¹8ÙÙX &T++;'7/?ðñò°‚å*ËÁÅÃÇ/($$,,$$(ÀÏË • °É Y ¤ˆ¨ˆŠ ðñpå$ÍÂ’— qQaA~Nv€ÍÆ ”“’–‘•••‘–’äãædcf  4+7PVRZV^äd¥ò¼\@íÕ,$*!-§ ¤¬Â¨¢¬(”ÏÊ@`›šÅ¥d”TÕÕT”äe¥ÄAÚÙ˜( 4¨YF(«ÉȨ¥©®¢(Ô´ €@Vóð ‹IÊ*(«ié02êêhª)ËËHMçæ`  §9AÒR²Š*êÚºŒŒºZêÊ ²’b@Ë9X,-‘ÖÐÖgd4ÔÓVWHss°²4ºn á Q˜Ýê˜v8T€Þ–¹\C Ýå„ìoeF0PQR€û € ¡´j**Ê@Yx¨8:‘Â\QAA)ÌcB E$ÆDùx@1@àtÆÎÅ ŠQ`|KII¡Ä7@ÁR /<µˆ‰Š R @a¤5Pbã‡Ëö” J‰à¤@¨éœ€éœ–ÎÉX.fx. ä¼ÀÎcÀL†Ð @èˆ U À8"0·ä·8ÇIEND®B`‚htdig-3.2.0b6/installdir/button10.gif0100644006314600127310000000141506275416057016710 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—Y€•X~”V|’T|‘!ù,þ@€pH ŽÈ¢r9 ƒÔ% Ì¥Óp@$¾`Ä:È Ü„bÁh¸ŒÅ"0°L¡h? €q eK “ƒ ‡xg¨–™›D ¢¼®†g ·½Ð x  ¸ !é! Ö œÆ‹ÉÍ!$%Ž À» lë`Öq0lðP0Š‹(Nñ!@ ñ$0p¥@‚p,dè`DÁ,X¬HñÏ߆ Øæ¸JÙþ„fB(ØâÅ‹M €¡B¶îô„ obˆ_Ș#©K¦µE0µªX¼˜1#†×‚M%ˆ•š@™> AÓ¶€ÃÅ[°OÇNý©¡ƒÐ‚,Z(V ÁwØp*‰ œ•ü–¦P¡"Š– hÀ)OI{´äkV±¢ %¾nÈ€ðƒ ¿%[¦r":#‚‹á°ÈÛê p¨šBïg@°kg Ðit90TÄ$eäÒÔÒÒÔ`TV`”† 3@ƒâ `a55U ÑÒ’À`ááde P ‚‚\LR¦JÊÊÊJ r2’âà@ga é í@yY9yyyY ,X33@1@ã(/!%-Ò ‚Æ@’+;P^XTLBBRRRB\L(ËÍÒ @à¤Æ LiÀä","  ÄÂË 1 € ©¤˜…„„Ai‘ ˜VA2Ä“ç*à`Ræ„™ @°ìÎ\Ü À”„%c€BÎClìÀ†ÈE„l33  Ë•¹-‘¶bMIEND®B`‚htdig-3.2.0b6/installdir/button2.gif0100644006314600127310000000142106275416057016626 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š[—Y€•X~”V|’T|‘!ù,þ@€pH „$á( :ŸC¡`8X¯†Â •V Åb¼P$Ö+aFÃA¯7 taÀvà „ j] š‡ Ž|E“®¯œ¡{D ©­Â³ Q‘ ¾ÙÈ ¤¹ ­Ö !"ñ" ß ÍB¦ÑÓ4t!‚D¼ƒ#BxØ€¡B¸qˆÄK‚… >ˆ( … ñLŒÑA2Z Ê ÐÅ@]À!HœHÁ¢E‹x(JˆXˆŸþfV¢ƒ@! ‡%P¬hñF)LˆøÀ¡¡}ÍÎ¥+ºÁÃFš.dÄk¡B$U«X—èÚz¡ëF,\Äð‚¬ÙªÓj%j©Ò›.Z° õl…|Ìm¹N ˆ&RŒw‚„ È",;”â 0løsr<:d°0Â8ML)VT é%r— 1¯›Õ¢"8W1´܉"Djo¬Qòëw*Ý* À®yØÞƒ1 >ƒ7i£+šº °+¦áøâÐ8#B€e% ™,\Ø¿üøŒ \)R&$èI,ÒÈ€Nx!‰‚@`¡…Š„¢)]0Ô‡r4 ây8¢C ñÅ,&€€#{Œ‡bŠSPaÀY,!ãŒOHdDP;B;htdig-3.2.0b6/installdir/button2.png0100644006314600127310000000275606645156451016661 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š[—Y€•X~”V|’T|‘qÌÛ¢tRNS@æØfœIDATxœb`€&ff `ffBˆB’…• ØXY˜a¢—dcçàäâ.NNv6˜€‚ fVvN.^>0àåáædg…È\–›—_@PPHHPP€Ÿ‡‹ƒ$@`“Y9¸xø„„ED@DXHŸ—›ƒ ¤ €Àö²sñð ‹ŠI€¸¨ˆPd>@ŒfãÊŠˆIHIË´”„8Hž‹h<@ææÊJJËÊÉœ¬´$PžŸ‡h<@5ó ‹IHË*(*122*)ÈÉåù¸Úˆ…¤Y\JVAI…”å¤%DAÚY™d6¿˜¤Œ¼’*£¦–#£š²‚¬”¸Ðv6f€b`:L@¨YQE]SGW—‘QCU ¨h:;3@¤y€fË)ªjhëê0êhª)ÉËMY@—‰ˆKË)©jêè12êj©)Ã¥YZCGÏQE €`ÒPÃõtu!†ƒìf ¨ÓÄ€þRVÓ{L]è3 ÇáÆ @P‰JHË+B¼Í¨ª$/+)&, 6&€ $Xä•U@EIA,ÀHa hŒµKÉÈCUIQQè@Íà8 °v` åq²2Rb  i H„róåÅ%¤¤¤¥¥¤$ŲÀi PŠ`L,"¢bâ &" ”åbi H2'5A`j`Z%6°,@Á’10µÓ"ðóñ“*@!’90•óð‚0Ó)D/@ÁÓ28€+,#Rbgaee`‚KjVbfC&d9€U†0,ÂOIEND®B`‚htdig-3.2.0b6/installdir/button3.gif0100644006314600127310000000135106275416057016631 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š[—Y€•T|‘!ù,þ@€pHȤ Èl„‚Áp8L ÂÒÉH‰„b$à„ {L} ƒ˜˜ˆ ŒŽL~“ª‰ [B‰ D¢ ½É  ¸’Õ ñ"! È ÍBÐ (\Ðà.^ ñHŒ¨·Ceä ,)€`:v>„ aEŠx'J,ì !OŽH7ÁB† F˜H±‚E*P”á¡aþ}ü´äb0m ‡(VÄ‹×"…‰î=܇@hi5-‚… KUœX(UU«X†àêØbÉf˜T@®´Z7žXÑÂÅ‹xN¡–Ý×L¥¤iÆ\Ê¢\<RÐÇÌE‹ë0dܸ4 #KR8©´]Y݉ qÐD …!z:„˜ Ö¹¡ÛiÁ{^½{ù;óWQZËjײiëö-ms·uñòl˜0 ÇÄyê÷l%S¨V±rµI-[kDI¢ÁR&MœÌC'¢Ò A…uZÔèQ6nüG(‡xè¡Æ-_„AFgÆ‚k@!UL‘…Ò—„è1;htdig-3.2.0b6/installdir/button3.png0100644006314600127310000000257406645156451016660 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š[—Y€•T|‘x¬FtRNS@æØf*IDATxœb`@&f0`B $9V66vv666V¸ €‚!fV6NN.àä`gƒ) ¨V $7/ðpsq²³2ƒ%*Ë”äã~^.6°<@Ádyø…„E@@X¨*@ ‘—q1QaA~^nV ýr'7Ÿ °¨¸¤”4HIJˆ‰õ³³00X3¯€°¨„”Œ¬œ¼¼œœ¬´¤8Pž‡h<@5óð eeå•äd$ÅDù¸Ú¢YPD(ËȨªÆÈ¨¢¬ '-! ÖÎ@ ¬Ü ÍÒòŠ*jšŒŒêªÊ ²Râ"¼\lÌÄÀÄ 4[XLRVAYMS[‡QGKCU ¤l:@10­—’STÑÐÚͨ«©¦,/#)*ÄÇÍÁ@ i^´ª†ŽžP^K]Y& @èÒÈÒì,„$­¢®­«§ÏȈ0œ €ÀN“: h°Ž.#Ôi@à €P<r™†²Ç,|`QRQUSSUQV„ +@¡ª¢ *@¢„ƒ%bÐ(‘G‰€ÂŒPi)¤ ìÉA–Wbâ†$&€‚$EV¤¤(ˆœ-!óñññò"%d€" #±ƒ2\+@¡ª€dA$!·0<ÚË…IEND®B`‚htdig-3.2.0b6/installdir/button4.gif0100644006314600127310000000142206275416057016631 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™X~”T|‘!ù,þ@€pH Hä@@l:‡F‚Áp¨V§óé ˆ„B±(ˆCaÉJà FÃA§7  m¿ ˆ j[MR ššŠ M“®® ŽE”©Ä´¶ C¥ ¿ÚÚÉŠ ¹B» × "#ñ!·Î¦ L°Ã‡#J˜0  :h¸@¡–¨\(h Ž„&P¤hàÄÃðéWè"TÀ`PD +´h˜ÂÄþˆˆ”íKP@^ª1ÂÄH/®0Bâ…püŒò¢FÓ*¼€!E‰&bm¦u×¥#Nœ‹‚Zµn=êV©×¦sIR•¨,/Q£0ÓÍÜðÁ&Ø,¢ð ‚CP} ´Ì¸Â: ˜–8!²¡ »îU¨5.×?iÔ{xG¢„m#èY.Ü@Ô3—‰ÕÜàá`!B€è6‘fÍ[¢MžaXØ=ØËp!„ÞÊ y¹‘Ú* ÁŒmЀ¬û',!ùÛUþRVòǪà\\³ßDx ¨‚ zÁŒ4#)0Ƀ@`¡… †²Çƒ]1D8`r4 " 8²FPða$ࢋið!ŠþñÅXd Nàã@ÎøD;htdig-3.2.0b6/installdir/button4.png0100644006314600127310000000277606645156451016665 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™X~”T|‘ ëtRNS@æØf¬IDATxœb`€&f`fB1’;°±±²ÀU1³²qprqqsssqqr°³ÂŒ bJróðò/7Ô€‚Érñðñ  ðñrs²³‚å"ËÉÍË/(," "ÂB|<\y€Ù ”å—q1QaA>Nv @ÝÌÊÁÍ+ $*.)%-###--)!–gcf` °f~ ¬”Œ¬<ÈÉHåø¸9€Úˆ¨™OP(+¯ ¤¬¬Ì¨(/+-!*ÄÖ@ L@ÍÂb’2òŠÊªjjŒŒ*J ²Râ"‚|\@Ûˆ™‹¤YNQYMC“‘‘Q]EI^¤›ƒ• €XØf‹JÈÈ+©jh3ê22jª)+ÈJŠ Mge  ÕB¢’2 ÊjšŒzúŒŒÚê*Š@Ó…€–3Hš_H $­®Å¨o”ÖPU”ƒI²4#h¨À¤Y™" 1* 6\ " @0§I¦®¥­Ô tšŒ¤Ðã@—Øc@É*(«ªƒ|¦4.‚à` p°M—–SPRQUUUQV”jàåbgf ˆé"b’ÒròŠŠJŠŠ À@›ÍÄ@Ð(ËËÈʬ´¤¸¨H30J”€¶ó£[£ÒÒR’ Y Í ÍÄŽp.Pb1Q,$º’LAI ˜Ò„E€˜–ø‰ l4@A“1;0µÓ"ðóò€’*X €`Éœƒ‹›‡‡€é˜N¡&,“°ó'p°#R9@!ç0V6`eeAh LLĮ̀Ù Àñý/Ož¿ótIEND®B`‚htdig-3.2.0b6/installdir/button5.gif0100644006314600127310000000141406275416057016633 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰ž_…š]ƒ™[—Y€•X~”T|‘!ù,þ@€pHŽHAqÉ „‚a:-Êæò)E à0â`Àj‡‚®bÁh¸ÝŒ…"q( ΃Â!±h8 eYEy – e[Ž •©©šžwD¥¨¯ ‹ ¹ÔÚ Cµ Ð!!ìÚ ŸJi  "H´câ‡l pó@Y‚q.hè°Ä‰(2š Âà Ä`kh˳~BXTÑn #@tÈ`a¼Èj-p°þ‡#L¤`Å Žâ%lPO'Ï 8€qB‹1Ú¡(ÑQ©Â¦vî‹:µj 1b¸ÀÈÕƒW¦û4*P¡,ξ`àh× éÅu߆"J `Ç‚oŠ1“Ö¼‰l€­Î$vtàã" f öÀX#Ëò•³Ë¹„‰×EÈŒG!‚ƒn߈ڙY‡"FQðH 7e q˜oŸDi¢G·ö±¦mÓhvs¾+‡ïØ0X¨í@ð¬åèBë ‚‰¯0!Â<ÜK,ëSŠ=… ¶’ åuƒ ú9 “Hà`›tBÇM$ÈGd¨a'ˆ+Ô±Hy¤—€k,`âc\ñ¡ODaÀ0Æh€Šg4ñä8À+;htdig-3.2.0b6/installdir/button5.png0100644006314600127310000000275706645156451016665 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰ž_…š]ƒ™[—Y€•X~”T|‘QrÆtRNS@æØfIDATxœb`@&@a „3 +°²² T\’•ƒƒ 8ØÙà * ”äâæán.NvVfˆ@3+;'7/¿ðóñòpq@  ˆ,Ÿ€ °ˆˆˆ°°?/7' H €À&spñò ‹ˆ‰ƒ€˜¨ˆPd>@ ;¿ PRRJJZZJRB\$ÏÁ 4 €€F³qòðe%¥edå€@VZ$ÏËÅ4 €Àšy„²²òŠŠŒ@ '#”ççádcb Í<üB¢Òr J* YFEyIqaˆv€™ Ô,.%« ¤ªÎ¨¡¡¡¦¢('-!*² €˜Ù¹€65+ªªkõjk¨)+ÈJŠ Mge  ÕÜ|@³eä•Õ4Áfk««(ÊJLZ@PiIeu-}C ¼†ª¢L €X8Òº††z(Ò—®£k ¯Ã4, ò@ úK^IUƒ‘QG‡QSè4)¨Óär^A Ç•Õ@.ÓTWUz. 0Lù&#¯¨¬ª*J@Íâ"‚| ` V å í2À`SVVVR”—… (P™%ÀPÊËʃ0N$Ä„!@àèææÊKJIË´¤„Ðhˆf€%6 ñBÀ—””äçØ @ ÄÂLiü‚B""¢@ LM|@Ypj ˆ<(±ñS‚“T €`òœÀt̼Ü\0Y€‚'V ..n àæxF ”<ÄlH’„¢‚™˜™‘$ †ß0› @£IEND®B`‚htdig-3.2.0b6/installdir/button6.gif0100644006314600127310000000142706275416057016640 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—X~”V|’T|‘!ù,þ@€pH ŽÇ¢r9 …¨´@˜KgÁp@$¾_ÄÁP°b‡ƒ­wÁh»‹‚<8§‰EÃñ€ø! qeLi ‘‘ suEŠ § ™‡D  ¤»»® WB ·º¾Á ›ž ¤ !ëØÀ WÊÌ "H€„àM€ÀÍ€´» ¡ˆ%¢@q¢Ä4\  ˆ“P‡"J  ¸b… %D|à€¡‚þ0z'Ã5{Æá¢ ‚HY¨8ñ±C ¶Õ‡€Ù„gIœ #Í$@j€*Õž'«*‚ÐJ0†Œ¯$B„$Ë`êÙW3dÝà ‚KÃ:¥kWåÐ EG˜H …‹,R˜øÈáéÏ©³ÄEhé/„VÆS€ ‘°§¼ÅF„@"º€&NÈ6aÐH ^¨ÓiY3ÎèBˆA\Dwz ãfOȬZ®bÐÀÁC: >xà ÔÜ&ÑP9Nº9èÑcóÎj^·o(ñ0U† ø3x¯Ðž[j"̲L#PPA}®"%˜r €à¡GH`!%€’€ƒL68žz8ÀG "6€‰Æœ`„^€ dbHŠg]  ãT~ àççãåæd‡ÊD–ƒ‹‡O@PH„øx¸8ØÀò²(ËË/(,"&&...&*",ÈÏËÅÖ@@Ä”—”Iq1! <; Ð}4š“$+)%#+''++#-)”çá@ ¬Ü|‚@YiYyEEEFyYiI1A>nV&€b`k“–SPRQadTQRÊ €µ3ÐfAq)YeUFF uUeY)q v í ÄÀ4[HTBF^IUƒ‘Q[[KCUI^FBTˆŸ›ƒ… €@VÍ–”QPVc-u v éü<¬ ”æá“”UPQgd40 ®4"Í@Pi)ˆ´¡XZ&Í@¨ºõ µ@ºa†²ÝšŒºzŒ:šjÊ 2’b §±20H¡" ô¶¢Šº&Ðiš@³å¤%Dáô@ý-ò·¼’ŠšºººšŠ’<ÈßÀPgf `|B ¨]V^QIYYYIª oóp € & ,&!%#'¯   /'#% S^p (Æ@q”—”–iI ,Ðfp8¾9y€ò¢b’@ !& ”åák PjË  ‹ˆŠŠ‰‹(5±ƒm p*§D~`bA~pZË$•³°qp“*?0òñ"4%1Ì|V`&àâ. $+L €³ ;3 B €ó3  ç €0´Š¼kIEND®B`‚htdig-3.2.0b6/installdir/button7.gif0100644006314600127310000000143406275416057016637 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—Y€•X~”T|‘!ù,þ@€pHŽHAqÉ „‚a:-ƒfs = à0â`Àj‡‚á»`0ðc¡H ʦ pH´‚‚ uxL{} €” v‹E ‘¨‡E £»œYN Õ¾¯ y³ ÏêëÚ ÇBËÍ ëë#B´Óp±ŠŒ¨õàYD8¢b$rÈ`!Þ¼oáÆéÓà!‰)V°P—ÂÄî.L€Ð€Þ€¡D `.bþ ,Z¼ÐbŠ!¨»@!‚k™¼bàÍBD(‡E9!}OÙ8 >|x­à¯CšvcžAÃà9lЀÁ‰¸"¶‚( âëâUðA5fš¼ZÐà,PàyØgHÁ‘ 4âÇ#DA  ëéÁ@/ðÑÇ \BÇh¡Fl, ¢Šr€H~v8!Å\„á"" ’H„Hôè£g;htdig-3.2.0b6/installdir/button9.png0100644006314600127310000000276606645156451016671 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢g‹ d‰žb‡œ_…š]ƒ™[—Y€•X~”T|‘„J³ttRNS@æØf¤IDATxœb`@L`€,@ÄÌÂÊÊÆÆÆÊÊÂŒP@pIV6vNàà`ge) ¨©,lœ\Ü<`ÀÍÅÉÎÊ ‘ ˆ,+;'7?¿ðóñòpq°A  ˜,PRPH „øy¹9ÙY@RB, Y!Q1q *àãædÉÈUl@YAaQq )”Ês°í ÑÜ@Y1 )Y999YYiIg,æÂ@Ë>$àtƒ g{M} ƒƒ xzM~ ‘‘ —iCŸƒ–Dš ž®t±£ Š© ‚½s!À¥¶B¹¬Ì%$" ³ i Ë®))('%ÞÓ¥ÆÉÚýƒKªü @@@Àþ &@˜ð Ã^U1xØkI:eýÞ™‚ž=jÅöhZM[‰!À‰#—àdÊ&øóÀ!…X3’Ždi™Ú€]E+$*‰¬€ö‚E´Ú-\(ûY¡W…¦ Ì¢/*'?]Ie1']u;ƒJxÎ>aãFœòj` &5H x#&L™ ª!˜ÊÇ \Q´x‘’Ë[;htdig-3.2.0b6/installdir/buttonl.png0100644006314600127310000000246006645156451016743 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²}°z›®w˜«t–©q“§o‘¦l£i¢H7stRNS@æØfÞIDATxœb`@&&f `bB „3 +°²0ÃU 1³²±spr'';+ T@Aµ²°qpróð2‚7P3X € ²ì@I>~Fàãåæ„Ê\–—_*Ë((ÀÇÃÅ– Êòð 0¨° ?/Ph?@\ÅÆÉÍ'ˆe”âçábga` °f.^$½Œ2Ò’b"‚ü<œlÌ ÖÌÃ$«(/ ”ài °fd£UU”ä¤%DÆm Vn„fMM uU%Y)qv6f€b`båäaĘˆ‰§,# @á—f ÒDÀp€Iãq@]Î*šjÊPƒ €@Á‚âªÊŠÐ`áde h  #)' t>n` Èt vdyiIqP”Ì H„ò Èƒ##I\<ü‚¢0iQ,78Bœ˜Xò|p„A²`£ˆ*Ll|`ðƒ’D € ™ ˜ù€€——‡ žPžGX¡¹˜8ØÙ`Ù €20±ƒ(ÁDU é0®€1Ecä:IEND®B`‚htdig-3.2.0b6/installdir/buttonr.gif0100644006314600127310000000110006275416057016720 0ustar angusgbhtdigGIF89a¥ÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²z›®w˜«t–©q“§o‘¦l£i¢!ù,þ@€pH ŽÈ€Èl„‚á@¥ ¥Ó &Špø‹¸¶Oï‚Ñh8ÞmÆ"Q&,·BÁp< r vNy ‚“…s‰wCzŽ““† Ež££§ gBœ °´µ ‰C­  Ŕ ©K½ !"$Õ‚ÇÉg æ'(渫ñ÷“ ¹öøþ øPà@|û4—p¡9}¬SÐà™° D”0ž¹yʶuû&m܈ræÐØÅÌ4pÓBÜ»¶—_À^nèp^2!ZQüDÁ¬x·jnêôHÂQÕLÍKµ+«GŸªYj0GÕN{Ø<(Vˆ‚:šš (pÌšQ Ì"òŠhž¾ˆQ@瀪ªuíb pa,€31’D@Z'A;htdig-3.2.0b6/installdir/buttonr.png0100644006314600127310000000246106645156451016752 0ustar angusgbhtdig‰PNG  IHDR î^PLTEÿÿÿÿëúûüöùúñõ÷ìñõèîòãëðßçíÚäêÖáèÒÞåÎÛãÉØàÅÔÞÁÑܽÎÙ¹Ë×µÈÔ±ÅÒ­ÂϪÀͦ¼Ë¢ºÉž·Æš´Ä—±Á”¯¿¬½©ºŠ§¸†¥·ƒ¢´€Ÿ²z›®w˜«t–©q“§o‘¦l£i¢ ÉBtRNS@æØfßIDATxœb`€&f`B11³°²±ƒ+ B@Á%ÙØ99¹@€““ƒ•*@PY $7////7P Ä€#6.>~Fàç*`‡ÈD–“›—_Pˆ„ùù`ò6™ƒ›W@HD*Í("$ÀÇÃÉÆ”  XÁ²¢âŒp ,ÀÇÍr@4sòðe¥¤‘åy¹ØÚˆ¨™OPD\JFNI^ˆh<@5 ‹IÊÈ+*© Ƀ´333;\H]Ih; @1°0â<¬L„Gš‘“• €pË‚¤ˆ€4@0 €ð; €@ã…Ь‚’ªš’Ïø¸Á@ˆ`‘STRF `°°13.XR hrceçäâæËòòpq²Ãô,³$pr%aö"‡±°²²+’$@¡¨€ä@ä `ŽŠFXuixIEND®B`‚htdig-3.2.0b6/installdir/cookies.txt0100644006314600127310000000334710055635560016741 0ustar angusgbhtdig# # Example of input file for cookies for ht://Dig and ht://Check # # Copyright (c) 1999-2004 Comune di Prato - Prato - Italy # Copyright (c) 1995-2004 The ht://Dig Group # Author: Gabriele Bartolini - Prato - Italy # # For copyright details, see the file COPYING in your distribution # or the GNU General Public License version 2 or later # # # This file must be located through the 'cookies_input_file' directive, and # its purpose is to pre-load cookies into ht://Check and ht://Dig and to be used for a # crawl. Each line contains one name-value pair. Lines beginning with '#' # or empty ones are ignored. # # Info have been taken from: http://www.cookiecentral.com/faq/#3.5 # # Each line represents a single piece of stored information. # A tab is inserted between each of the fields. From left-to-right, # here is what each field represents: # # domain The domain that created AND that can read the variable. # flag A TRUE/FALSE value indicating if all machines within a given # domain can access the variable. This value is IGNORED. # path The path within the domain that the variable is valid for. # secure A TRUE/FALSE value indicating if a secure connection with the # domain is needed to access the variable. IGNORED. # expiration The UNIX time that the variable will expire on. UNIX time is # defined as the number of seconds since epoc (Jan 1, 1970 00:00:00 GMT). # If you want to issue a session cookie, just set this field # value to '0'. # name The name of the variable. # value The value of the variable. # # For instance, a cookies.txt file may have an entry that looks like this: # # .netscape.com TRUE / FALSE 946684799 NETSCAPE_ID 100103 htdig-3.2.0b6/installdir/english.00100644006314600127310000341250607661572667016303 0ustar angusgbhtdigAAA/S AAU AC/S ACM AI AK AKA AL ALU AMA AMI AMIS ANSI/M APS AR ARCO ARPA ASAP ASCII ASTM ATM/M AZ Aachen Aalborg Aalesund Aargau Aarhus Aaron Aaronic Abba Abbado Abbevillian Abbeydale Abbott/M Abe/M Abel Abelard Abele Abelian Abelmosk Abelson/M Aberdeen/M Abernathy/M Abernethy Aberystwyth Abidjan Abigail/M Abilene/M Abner/M Abos Abraham Abram/M Abrams Abramson Abravanel Abraxas Absalom Abu Abyssinia Abyssinian Abyssinians Acadia Acapulco Acarus Accra Accrington Aceldama Achaean Achaemenid Achates Achernar Achilles Achitophel Acis Ackerman Ackley Acta Actaeon Actinia Actium Acton/M Ada/M Adair/M Adam/S Adamite Adamson Adar Addams Addington Addis Addison Addressograph Adelaide/M Adele/M Adelia/M Aden/M Adenauer Adige Adirondack/S Adkins Adler/M Adlerian Adolph/M Adolphus Adonai Adonic Adonis Adrian/M Adriatic Adrienne/M Adullamite Advowson Aedes Aegean Aegeus Aegina Aegisthus Aeneas Aeneid Aeolic Aeolipile Aeolis Aeolus Aepyornis Aerobacter Aeschines Aeschylus Aesculapian Aesculapius Aesir Aesop Aetna Aetolia Affenpinscher Afghani/MS Afghanistan/M Africa/M African/MS Africanisation/MS Africanise/DGS Africanism Africanist Africanization/MS Africanize/DGS Afrikaans Afrikander Afrikaner Afrikanerdom Afrikanerisation Afrikanerise/DGS Afrikanerization Afrikanerize/DGS Agama Agamemnon Agapanthus Agatha Agee/M Ageratum Aggie/S Agincourt Aglaia Agnes Agnew/M Agostini Agra Agrapha Agricola Agrippa Aguascalientes Agway Ahasuerus Ahmedabad Ahmednagar Ahriman Ahvenanmaa Ahwaz Aida/M Aidan Aidin Aiken/M Aileen Ainu Airedale/M Aires Aitken/M Ajax Akan Akers Akhmatova Akkad Akkadian Akmolinsk Akron Aktyubinsk Al/MR Alabama/M Alabamans Alabamian/M Aladdin Alameda Alamein Alamo/S Alan/M Alaric Alaska/M Alastair Albania/M Albanian/MS Albany Alberich Albert Alberta Alberto Albi Albigenses Albinoni Albion Alboin Albrecht/M Albright/M Albuquerque Albury Alcestis Alcibiades Alcman Alcmena Alcoa Alcock Alcoran Alcott/M Alcyone Aldebaran Alden/M Aldermaston Alderney Aldine Aldrich/M Aldus Alec Aleck Aleksandropol Aleksandrovsk Alemanni Alemannic Aleppo Aleut Aleutian Alex Alexander/S Alexandra Alexandre Alexandria Alexandrian Alexei/M Alexis Alexius Alfa Alfonso/M Alfred/M Alfredo/M Algenib Alger/M Algeria/M Algerian/M Algerine Algiers Algol/M Algonkian Algonquian Algonquin/M Alhambra Ali Alice Alicia Alison/M Alistair Alkoran Allah/M Allahabad Allan Allegheny/S Allegra Allen Allenby Allendale Allende Allentown Allhallowtide Allis Allison Allstate Allyn/M Almaden/M Almeida Almohade Almoravide Alpert/M Alpheratz Alphonse/M Alsatia Alsatian/S Alsop/M Altaic Altair/M Altamira Alton/M Altrincham Alva/M Alvarez Alvin Alyssa/M Amadeus Amanda/M Amarillo/M Amaryllis Amati Amboina Ambrosian Amdahl/M Amelia/M Ameling Amerada America/MS American/MS Americana Americanisation/MS Americanise/GRSZ Americanism Americanist Americanization/MS Americanize/GRSZ Amerigo Amerindian Amersfoort Ames Ameslan Amfortas Amharic Amherst/M Amiens Amis Amish Amman Ammerman/M Ammonites Amoco/M Amontillado Amos Amoy Ampelopsis Ampex/M Amphitrite Amphitryon Amritsar Amsterdam/M Amtrak/M Amundsen Amy/M Amytal Anabaena Anabaptist/MS Anabas Anabel/M Anableps Anacreon Anacreontic Anaheim/M Analects Anam Ananias Anatole/M Anatolian Anchises Ancona Andalusia Andaman Andean/M Andersen/M Anderson/M Andes Andhra Andorra/M Andover/M Andre/M Andrea/M Andrei/M Andrew/M Andromache Andromeda Andy/M Angara Angarsk Angela Angeleno/MS Angeles Angelica/M Angelina Angeline Angelo Angelus Angevin Angie Angkor Anglesey Anglia Anglian Anglican/MS Anglicanise/S Anglicanism/M Anglicanize/S Anglicist Anglo Anglomania Anglophile Anglophilia/M Anglophiliac Anglophilic Anglophilism Anglophily Anglophobe Anglophobia/M Anglophobic Anglophone Angola/M Anguilla Angus Anheuser Anita Anjou Ankara Ann Anna Annale Annalen Annalist Annalistic Annam Annamese Annapolis Annapurna Anne/M Annette Annie Anopheles Anouilh Anselm/M Anselmo/M Ansermet Anson Antaeus Antarctic Antarctica/M Antares Anthony Anthurium Antietam Antigonus Antigua Antilles Antioch Antoine Antoinette Anton/M Antonio/M Antony Antwerp Anubis Anzac Apetalous Aphis Aphrodite/M Apis Apollinaire Apollo/M Apollonian Apollyon Appalachia/M Appalachian/MS Appaloosas Appian Appleby/M Appleton Appomattox Apr April/MS Apus Aquarius Aquila/M Aquinas Arab/MS Arabia/M Arabian/MS Arabianise/S Arabianize/S Arabic/M Arabicise/S Arabicize/S Arabist Araby Arachne/M Arafat Araiza Aramaic Arapaho Araucanian Araucaria Arawakan Arbela Arcadia Arcadian Arcadic Archaeopteryx Archaeornis Archean Archibald Archie/M Archilochian Archimedes Arctic Arctogaea Arcturus Arden/M Areca Areopagus Arequipa Ares Arethusa Argentina/M Argentinian Argerich Argive Argo/MS Argonne Argus Argyrol Ariadne Arian Arianism/M Arianist/MS Ariel Aries Aristides Aristippus Aristotelean Aristotelian/M Aristotle/M Arius Arizona/M Arkansan Arkansas/M Arkhangelsk Arkhipova Arlberg Arlen Arlene Arlington Armageddon/M Armata Armco Armenia Armenian/M Arminian Armonk Armour/M Armstrong/M Arnold/M Arpanet Arragon Arrau Arrhenius Arroyo Artemia Artemis Arthur Arthurian Artie/M Arturo/M Aruba Aryan/MS Aryanisation Aryanise/DGS Aryanization Aryanize/DGS Asarum Ascanius Ascensiontide Aschaffenburg Ascham Asclepiadean Asclepius Ashanti Asheville Ashford Ashkenazi Ashkenazy Ashkhabad Ashland Ashley Ashmolean Ashmore Ashton Ashur Asia/M Asian/MS Asiatic/MS Asiaticisation/MS Asiaticise/S Asiaticization/MS Asiaticize/S Asilomar/M Asimov Aspasia Assad Assam Assamese Assisi Assyria Assyrian/M Assyrianise/S Assyrianize/S Assyriology/M Astaire/S Astarte Astilbe Aston/M Astor Astoria Asuncion Atari Atchison/M Aten Athabascan Athanasian Athena/M Athenian/MS Athens Atherton Atkins Atkinson Atlanta Atlantean Atlantic/M Atlantica Atlantis Atlantov Atreus Atropos Attenborough Attica Attila Attlee Atwater/M Atwood/M Auberge/M Aubergine Aubervilliers Aubrey/M Aubrietia Aubusson Auckland/M Audrey/M Audubon/M Auerbach/M Aug Augean Auger Augsburg Augusta/M Augustan Augustine Augustinian Augusts Augustus Aurelius Auriga Aurignacian Auschwitz Aussie Auster Austerlitz Austin/M Australasia Australia/M Australian/MS Australiana Australianise/S Australianism Australianize/S Australis Australoid Australorp Austrasia Austria/M Austrian/M Austrianise/S Austrianize/S Austronesia Austronesian Autoharp Avar Ave Aventine Aventino Avernus Averroism Avery/M Avestan Avignon Avis Aviv Avogadro Avon Axminster Ayer Ayers Aylesbury Aymara Ayrshire Azerbaijan/M Azerbaijani Azilian Azores Azotobacter Azov Azrael Aztec Aztecan BBC BCD BCPL BEMA BIS BITNET BMW BNF BP BS BSD BTW Baal Baalbek Baaskap Bab Babcock Babel/M Babelise/S Babelize/S Babi Babism Babylon Babylonian/S Babylonise/S Babylonize/S Bacchae Bacchus Bach/M Bacharach Bacquier Bactrian Baden/M Baedeker Baffin Baganda Bagdad Baghdad Bagrodia/MS Bahai Bahaism Bahama/S Bahrain Bahrein/M Bailey/S Bairam Baird/M Baja Bakelite Baker Bakersfield Bakhtiari Baku Bala Balaam Balakirev Balaklava Balaton Balboa Baldwin Balearic Balfour Bali Balinese Balkan/MS Balkanisation/MS Balkanise/S Balkanization/MS Balkanize/S Balkis Ballard/S Balmacaan Balmoral Balt Balthazar Baltic/M Baltimore Baltimorean Baltsa Baluchi Baluchistan Balzac Bamako Bambara Bamberg Bamberger Bambi Banach Banbury/M Bancroft Banda Banff Bangladesh/M Bangor Bangui Bank Bannockburn Bantoid Bantu/MS Bantustan Banville Baptiste Barabbas Barathea Barbados Barbara Barbarossa Barbary Barber Barbirolli Barbour/M Barbuda Barcelona Barclay Barcoo Bardolatry Barenboim Barhop Bari Barlow/M Barmecide Barnabas Barnard Barnes Barnet Barnett/M Barney Barnhard/M Barnum Barotse Barr/M Barrett/M Barrington/M Barron Barry/M Barrymore/S Barsac Barstow Bart Barth Bartholomew Bartlett Bartok Bartoletti Barton/M Bascom Basel Bashkir Basie Basilian Basingstoke Baskerville Basque/M Bassas Bassett Bastianini Basutoland Bataan Batavia Batchelder/M Bateman/M Bathonian Bathurst/M Batista Bator Battelle/M Battenburg Battle Baudelaire Baudo Bauer Bauhaus Bauhinia Bausch Bavaria Bavarian Bax Baxter/M Bayard Bayda Bayesian Baylor Bayonne Bayport/M Bayreuth Beaconsfield Beardsley/M Beatrice Beauchamps Beaufort Beaujolais Beaumont Beaune Beauregard Beaverton Bebington Bechtel Bechuana Bechuanaland Beckenham Beckford Beckman/M Beckmann Becky Bedford Bedfordshire Bedlington Beebe/M Beecham/M Beelzebub/M Beethoven/M Beghard Beguin Behrens Beijing Beirut Bela/M Belfast Belgae Belgian/MS Belgium/M Belgrade Belgravia Belial Belisarius Belisha Belize Bella Bellamy/M Bellatrix Belleek Bellerophon Belleville Bellingham/M Bellingshausen Bellini/M Bellmouth Bellona Bellovin/M Bellwood Belmondo Belmont Beloit Belorussia Belostok Belsen Belshazzar/M Beltane Belton Beltsville Belushi/M Bemba Ben/M Benackova Benares Bendix Benedict/M Benedictine/M Benedictus Benedikt Benelux/M Bengal/M Bengali/M Beni Benin Benison Benjamin Benne Bennet Bennett Bennington Benny Benson Bentham Bentley/S Benton/M Benz Benzedrine/M Beograd Beowulf Berber Berberis Berbie Berchtesgaden Berdichev Berdyayev Berea/M Berenices Berenson Beresford/M Berezina Berezniki Berg/R Bergama Bergamo Berganza Bergen/M Bergland/M Berglund/M Bergman/M Bergonzi Bergson Bergsonism Bergsten/M Bergstrom/M Beringer Berkeleian Berkeleianism Berkeley/M Berkowitz Berkshire/S Berlin/MRZ Berlinise/S Berlinize/S Berlioz Berlitz Berman/M Bermuda/M Bern Bernadine Bernard Bernardine Bernardino/M Bernardo/M Bernese Bernet/M Bernhard Bernice Bernie Berniece Bernini Bernoulli Bernstein Berra Bert Bertha Bertie Bertram/M Bertrand Berwick/M Bess Bessarabia Bessel/M Bessemer Bessemerise/S Bessemerize/S Bessie Betelgeuse Bethany Bethesda Bethlehem Bethmann Betsey/M Betsy Betta Bette/M Betty/S Beulah Beveridge Beverly/M Bewick Bhagavadgita Bhutan Bialystok Bice Biddle Biedermeier Bielefeld Bienville Bierce Bigelow Biggs Bihari Biisk Bilbao Bilbo/M Bilharzia Billie Billiken/S Billingham Billingsgate Billiton Biltmore/M Bim Bimini Bingham Binghamton Bini Biochimica Biometrika Biophysica Birgit Birkenhead Birmingham Birminghamise/S Birminghamize/S Biscayne Bishop Bismarck Bismark/M Bissau Bizet/M Blachut Blackbeard Blackburn Blackfeet Blackfoot/MS Blackman Blackmer Blackstone Blackwell/S Blagoveshchensk Blaine/M Blair Blake Blakey Blanchard/M Blanche Blanton Blanzat Blatz Blavatsky Blech Bleeker Blegen Blenheim Bley Blindheim Blini Blinn/M Bliss Bloch/M Blomberg/M Blomquist/M Blomstedt Bloomfield Bloomington Bloomsbury Blum Blumenthal/M Blvd Blythe/M Boanerges Boarsh Boatwright Bobbie Bobbsey Bobrow Boca/M Boche Bodenheim Bodleian Bodoni Boeing Boeotia Boeotian Boer Bogart Bogartian Bogas Bogota Boheme Bohemia Bohemian Bohemianism Bohm Bohr Boildieu Bois Boise Boito Bokhara Bolivia/M Bologna/M Bolshevik/MS Bolshevism/M Bolshevist Bolshevistic Bolshie Bolshoi Bolson Bolton Boltonia Boltzmann Bombay/M Bonaparte Bonapartism Bonaventure Bonham Boniface Bonn Bonneville Bonnie Bontempo Bonynge Boone Boonton Bootes Bootle Bordeaux Bordelaise Borden Borealis Boreas Borg Borghese Boris Borneo/M Borodin Boronia Borroughs Bosch Bose Bosky Bosnia Bosporus Bostitch Boston/M Bostonian/MS Boswell Boswellise/S Boswellize/S Botswana/M Boucher Bougainville Boughton Boulez Boult Bourbaki Bourne/M Bournemouth Bouvet Bouvier Bowditch/M Bowdoin Bowen/M Bowes Boxford Boyce Boyd/M Boyer/M Boyle/M Boylston/M Bozcaada Braata Brachiosaurus Bradbury Bradford Bradley Bradshaw Brady Bragg Bragi Brahman Brahmana Brahmani Brahmanism Brahmaputra Brahmin Brahms Brahmsian Brahui Brailler/S Braillewriters Brainard/S Branchville Brandeis Brandel Brandenburg Brandon Brandt/M Braniff Brannon Brantford Brasilia Brasstown Braun Brazil/M Brazilian/M Brazzaville Breconshire Bremen/M Bremerhaven Brenda Brendan/M Brendel Brennan/M Brenner/M Brent Brentano Brentwood Brescia Bresenham/M Breslau Bresson Brest/M Bretagne Breton Brett/M Bretton Breuer Breughel Brewster/M Brian Briareus Brice Bridewell Bridgeford Bridgeman Bridgeport Bridget/M Bridgetown Bridgewater Brie Brien Brigadoon Briggs/M Brigham Bright Brighton/M Brigid Brillouin Brindisi Brinkley Brisbane/M Britain/M Britannia Britannic Britannica Briticism British/RY Britishism Briton/MS Brittany Britten/M Brixton Brno Broadbrim Broadway Brock Broglie/M Bromberg Bromfield/M Bromley/M Bronx Brookdale Brooke Brookfield Brookhaven Brookline/M Brooklyn Brookmont Brown Browne Brownell Brownian Bruce Bruch Bruckner/M Bruegel/M Brule Brumidi/M Brummagem Brunei Brunelle Brunhilde Bruno Brunswick/M Bruson Brussels Brutus Bruxelles Bryan Bryansk Bryant Bryce Bryn Brython Brythonic Bubo Bucephalus Buchanan Bucharest Buchenwald/M Buchmanism Buchwald Buckingham Buckinghamshire Buckley/M Bucknell/M Bucky Budapest Budd Buddha Buddhism Buddhist/S Buddleia Budweiser/S Buehring/M Buena Buenaventura Bueno Buenos Bugatti Buick Bujumbura Bulba Bulgar Bulgaria Bulgarian Bumbledom Bumbry Buna Bundaberg Bundestag Bundoora Bundu Bundy Bunsen/MS Bunyan/M Burbank/M Burberry Burch Burgos Burgoyne Burgundian Burgundy/S Burke/S Burkina Burlingame Burlington/M Burma Burmese Burne/S Burnett Burnham Burnside/S Burroughs Burseraceous Burt Burton Burtt/M Burundi Busch Bushire Bushnell Bute Butterfield Buttermere Butterworth Buttrick Buxtehude/M Buxton Bydgoszcz Byelorussian Byelostok Byers Byrd Byrne Byron/M Byronic Byronise/S Byronism Byronize/S Byzantine Byzantinise/S Byzantinize/S Byzantium CA CACM CATV CB CBS CCNY CDC/M CDR CDT CEO CEQ CERN CGS CIA CMOS CO CPA CPR CPU CPU/MS CRT CSNET CST CT CUNY CURVET CZ Caballe Cabinda Cabot/M Caddoan Cadillac/S Cadmean Cadmus Cady Caelian Caelum Caernarvonshire Caerphilly Caesar Caesarean Caesarian/M Caesarise/S Caesarism Caesarize/S Cahill Cahokia Caicos Cain Caine Cairo Cajun/MS Cal CalComp Calabar Caladium Calais Calciferous Calcutta/M Calder Caldwell/M Caleb/M Caledonia Caledonian Calgary Calhoun/M Caliban Calicut Calif California/M Californian/MS Caligula Calkins Callaghan/M Callahan/M Callan/M Callas Calliopsis Callisto Caltech Calumet Calvados Calvert/M Calvin/M Calvinise/S Calvinism Calvinist Calvinize/S Calydonian Cambodia Cambrian Cambridge/M Cambridgeshire Camden/M Camelopardus Camelot Camembert Camenae Cameron/M Cameroon Cameroun/M Camilla Camille Camino Campbell Campbellsport Cana Canaan/M Canaanite Canaanitic Canada/M Canadian/S Canadianisation/MS Canadianise/S Canadianism Canadianization/MS Canadianize/S Canaveral Canberra Candace Candide Candiot Candlemas Candlewick Canfield/M Canicula Canis Canoga Canopic Canopus Canossa Cantabrian Cantabrigian Canterbury Cantonese Canuck Canute Capablanca Cape Capernaum Capet Capetian Capetown Capistrano Capitan Capitoline Capone Caponisation Caponization Cappuccilli Cappy Capri Capricorn Capricornus Capsian Capt Caputo Caracas Caravaggio Carboloy Carbonari Carbondale Carbone Carbones Cardiff/M Cardiganshire Carey/M Cargill/M Carib Caribbean Caribbee Carl/M Carla Carleton Carletonian Carlin/M Carlisle/M Carlist Carlo Carlos Carlovingian Carlsbad/MS Carlson Carlton Carlyle Carman Carmarthenshire Carmel Carmela Carmelite Carmen/M Carmichael Carnegie Carolina/MS Caroline/M Carolingian Carolinian/S Carolyn Carpathia Carpathian Carpathians Carr/M Carrara Carreras Carrick Carrie Carroll/M Carruthers Carson Carteri Cartesian Carthage Carthaginian Carthusian Cartier Carty Caruso Casanova/M Casey Caslon Caspar Casparian Caspian Cassandra Cassegrainian Cassia Cassiopeia Cassite Cassius Castalia Castilian Castilla Castillo/M Castleford Castlereagh Castro Castroism Casuarina Catalan Catalina Catalonia Catawba Cathay Catherine Catherwood/M Catholicisation Catholicised Catholicising Catholicization Catholicized Catholicizing Cathy Catskill/S Cattleya Caucasian/S Caucasoid Caucasus Cauchy Cavell Cavendish Cavesson Cavetto Caviness Cavour Cawdrey Cawley Cawnpore Caxton Cayes Cayley/M Cayman Cayuga/M Cayuse Ceanothus Cecil Cecilia Cecropia Cecrops Cedric Ceiba Celadon Celaeno Celanese Celebes Celeste Celia/M Celsius Celt Celtiberian Celtic Celticise/S Celticize/S Cenozoic Centaurus Central Centralia Centrex Cepheid Cepheus Ceratodus Cerberus Cercis Cerenkov Ceres Cervantes Cesare/M Cessna Cete Cetus Ceylon Cezanne/S Chablis Chablises Chaco Chad Chadderton Chadwick/M Chaffey Chailly Chalcis Chaldean Chaldee Chalmers Cham Chamaeleon Chambertin Champlain Chancellorsville Chandigarh Chandy/M Chang Channing Chantilly Chao/M Chaplin Chapman Charlemagne/MS Charles Charleston Charley Charlie Charlotte Charlottenburg Charlottesville Charlottetown Charlton Charmeuse Charon/M Charpentier Charta Chartism Chartres Charybdis Chasidim Chatham/M Chatsworth/M Chattahoochee Chattanooga Chatterton Chaucer Chaucerian Chauncey/M Chautauqua Chechen Cheek Chekhov Chellean Chelmsford Chelsea/M Cheltenham Chelyabinsk Chelyuskin Chen Cheney/M Cheng Chengchow Chengteh Chengtu Cheongsam Cheops Cherbourg Cheremiss Cheremkhovo Cherenkov Cheriton/M Chernovtsy Chernozem Cherokee/S Chertsey Cherubini Cheryl/M Chesapeake Cheshire Chessel Chesterfield Chesterfieldian Chesterton Chetnik Cheval Chevrolet Chevy Cheyenne/S Chian Chiang/M Chibchan Chicago/M Chicagoan/S Chicana/MS Chicano/MS Chickasaw Chickasaws Chihuahua Childermas Chile/S Chilean Chiltern Chilton Chimique Chimiques China Chinaman Chinamen Chinatown/M Chinee Chinese/M Ching Chinook Chinookan Chionodoxa Chippendale Chippewa Chiron Chisholm Chita Chkalov Chloe Chlorella Chloromycetin Chocho Choco Choctaw/S Chomsky/M Chopin Chou/M Chris Chrissie Christ Christadelphian Christchurch Christendom Christensen/M Christenson Christhood Christian/MS Christiana/M Christianisation/MS Christianise/RSZ Christianising Christianity Christianization/MS Christianize/RSZ Christianizing Christians/N Christianson/M Christie Christina/M Christine Christlike Christmas Christmastide Christmastime Christoff Christoffel Christology Christoph/M Christophe Christopher/M Christy Chrysler Chukchi Chung Chungking Churchill Churchillian Churrigueresque Chuvash Ciccolini Cicely Cicero Ciceronian Ciceronianise/S Ciceronianize/S Cid Cilician Cimbri Cimmerian Cinchona Cincinnati Cincinnatus Cinderella Cindy/M Cinemascope Cinerama Cineraria Cipango Circassian Circe Circinus Cisalpine Cistercian Cistus Citroen City Clacton Claire Clapeyron Clapham Clapton Clara Clarabella Clare Claremont Clarence Clarenceux Clarendon/M Clark Clarke Clarkia Clarridge Claude Claudel Claudia Claudio Claudius Claus/N Clausewitz Clausius Clayton/M Claytonia Clearwater Clematis Clemens Clemente Clementine Clemmons Clemson Cleome Cleopatra Cleve Cleveland Clevenger Cliburn Clifford Clifton/M Clint Clinton/M Clintonia Clio Clipperton Clive Clostridium Clotho Cluj Cluytens Clyde Clydesdale Clytemnestra Co Coast Coatbridge Coates Cobb/M Cobbett Cobham Cobol/M Cochin Cochise Cochran/M Cochrane/M Cockaigne Cocos Coddington/M Cody/M Coffey/M Coffman Cohen Cohn Cointreau Colby Colchicum Colchis Cole/M Coleman/M Coleridge Colette/M Colgate Colima Colleen Collier Collins Collinsia Colloq Colobus Cologne Colombia Colombian/S Colombo/M Colorado/M Colosseum Colossian Coltrane Columba Columbia Columbian Columbus Colwyn Comanche Comanchean Comdex/M Cominform Comintern Command Commie Comoros Compagnie Compositae Comptometer Compton/M Compuserve/M Comus Conakry Conant/M Concorde Concordia Conestoga Conferva Confucian Confucianism Confucius Congo Congolese Congreve Coniston Conium Conklin/M Conley/M Connally/M Connecticut Connelly Connie Connors Conrad/M Conrail/M Constantine/M Constantinople Continentalise/S Continentalize/S Convair/M Convolvulus Conway/M Cook Cooke/M Cooley/M Coolidge Coors Copeland Copenhagen Copernican Copernicus Copland Copperfield Coprosma Copt Coptic Coquille Coral Corantijn Corbett/M Corcoran/M Cordelier Cordovan Coreopsis Corey/M Corinth Corinthian/S Corinthianise/S Corinthianize/S Coriolanus Cornelia/M Cornelian Cornelius Cornell/M Cornish Cornwall Cornwallis Coronado Corp Corriedale Corsica/M Corsican Cortes Cortez Cortland Corvallis Corvus Corybant Corydalis Corydon Corydoras Cosgrove/M Costa Costello Costermansville Cotinga Cotrubas Cottrell/M Coulter/M Couperin Courland Courtney/M Cousteau Covent Coventry Cowan/M Cowell Cowichan Craal Craig Cramer Crandall Cranfield Cranford Cranston Crawford Cray/MS Cree Creighton Creole Creolisation Creolise/DGS Creolization Creolize/DGS Creon Cressida Creston Crestview Cretaceous/Y Cretan Crete Cretic Crichton Crimea Crimean Crinum Crispin/M Croat Croatia Croatian Crockett Crockford Croix Crompton Cromwell Cromwellian Cronin Crookes Crookesmoor Crosby Crossley Crowley Crownland Croydon/M Cruickshank/M Crusoe Cruz Cryptomeria Cuba Cuban/S Cubanise/S Cubanize/S Cuberli Culbertson/M Culex Culver/S Cumberland Cumbrian Cummings Cummins Cunard Cundick Cunningham Cupertino/M Cupid Curculio Curcuma Curran/M Curtana Curtis Curvet Cuscus Cushing/M Cushitic Cushman Custer/M Cuthbert Cuvier Cuzco Cyanamid Cyclades Cygnus Cymric Cynthia Cyprian Cypriot Cypripedium Cyprus Cyrano Cyrenaic Cyril Cyrillic Cyrus Cytherea Czech Czechisation/MS Czechization/MS Czechoslovak Czechoslovakia Czechoslovakian Czerniak/M Czernowitz Czerny DA/MS DAG DARPA/M DB DC DECNET DECsystem DECtape DFL DMA DMF DNA DOD DOS DPP DWT Dacca/M Dacron Dada Dadaism Dadaist Dadaistic Dade Daedalus Dagenham Dagestan Dago Dahl/M Dahomey/M Dailey/M Daimler Dairylea Dakar Dakota Daley/M Dalhousie Dali Dallas Dalton Daltonism Daly Dalzell/M Damara Damaraland Damascene Damascus Damien Damocles Damon/M Damson Dan/M Dana/M Danaides Danbury Dane/S Danegeld Danelaw Daniel/S Danielson Danio Danisation/MS Danise/S Danish Danization/MS Danize/S Danny/M Dante Danton Danube Danubian Danville Danzig Daphne Daphnis Dapsang Darby Darcy/M Dard Dardan Dardic Darien Darius Darjeeling Darlene Darlington Darrell Darrow Darry Dartford Dartmoor Dartmouth Darwin Darwinian Darwinise/S Darwinism Darwinistic Darwinize/S Daryl/M Datamation Datamedia Datsun Daugherty/M Dave/M David/M Davidovich Davidson Davie/S Davinich Davis Davison/M Davy/S Dawson Dayton Daytona/M DeKalb DeKastere DeMorgan/M Deane/M Deanna/M Dearborn Deauville Deb Debbie/M Debby Deborah Debra Debussy Dec Decatur/M Decca December/MS Decembrist Dee/M Deepfreeze Deere Defoe Deimos Deirdre/MS Del Delaney/M Delano/M Delaware/M Delhi/M Delia/M Delian Delibes Delilah Delius Della/M Deller Dellwood Delmarva Delorme Delos Delphi Delphic Delphically Delphinus Delsarte Demeter Demogorgon Demosthenes Dempsey Denbighshire Dene Deneb/M Denebola Deneen Denis Denmark/M Dennis Denny Dentalium Denton/M Denver Dependance Dependant/S Depraz Dept Derbyshire Derek/M Dernesch Derris Descartes Desmond Detroit Deuteronomist Deuteronomistic Deuteronomy Deutsch Deutschland Deutzia Devereux Devon Devonian Devonshire Dewey Dewitt Dexedrine Dhabi DiMaggio Diablo Diamond Diana Diane Dianne Dick/M Dickerson/M Dickinson Dickson Dictaphone Dictograph Didache Dido/M Diebold/M Diego Dieskau Dietrich Dietz Dijkstra/M Dijon Dillon Dimitrovo Dinah Dinaric Dinesen Dingaan Dinka Dinnington Dinoceras Diocletian Diogenes Dion Dione Dionysia Dionysiac Dionysian Dionysus Diophantine Dioscuri Diplodocus Dirac Dirham Dirichlet Disney Disneyland Disraeli Ditzel Dixie Dixiecrats Dixieland Dixon/M Djakarta Djibouti Dmitri Dneprodzerzhinsk Dnepropetrovsk Dnieper/M Dniester Dobbs Doberman Doc Docetism Dodd/M Dodgson Dodington Dodona Dodson/M Doese Dogtown Doherty/M Dohnanyi Dol Dolan/M Dolichosaurus Dolores Domenico/M Domesday Domingo Dominic Dominica Dominican/S Dominick/M Dominique/M Domitian Donahue Donald/M Donaldson Donar Donath Donatist Doncaster Doneck/M Donegal Donetsk Dongola Donizetti Donna Donnelly Donovan Dooley/M Doolittle Dopper Doppler Dor Dora/M Dorado Dorati Dorcas Dorchester Doreen/M Doria/M Dorian Doric/M Doricise/S Doricize/S Doris Dorking Dormoy Doronicum Dorothea/M Dorothy Dorset/M Dortmund/M Dostoevsky Doubleday Doug Dougherty Douglas Douglass Dow Dowland Dowling/M Downey Dowson Doyle Dr Dracaena Draco/M Draconian Draconic Drakensberg Dramamine Dravidian Drayton Dressen Drexel Dreyfuss Driscoll/M Dronfield Drummond/M Drury Druse Dryden DuPont/S Duala Duane Dubhe/M Dublin Dubonnet Dubuque Dudley/M Duffy Dugan/M Duisburg Dukas Dulcinea Dulles Duluth Duma/M Dumas Dumbarton Dumont Dumpty Dunbar/M Dunbarton Duncan Dundee/M Dunedin/M Dunham Dunker Dunkirk Dunlap Dunlop/M Dunn/M Dunne Dupont/S Dupre Duquesne Duralumin Durango/M Durban Durer Durham Durkee Durkheim Durkin/M Duroc Durrell/M Durufle Durward/M Dusenberg Dusenbury/M Dusseldorf Dustin Dutch Dutchman Dutchmen Dutoit Dutton/M Duyker Dvandva Dvina Dvinsk Dvorak Dvorsky Dwight Dwyer/M Dyak Dyke Dylan/M Dyonisian Dzaudzhikau Dzerzhinsk Dzhambul Dziggetai Dzongka Dzungaria EBCDIC ECAD ECG EDP EDT EEG EEOC EGA/M EPA ERDA ESC EST Eagan/M Eaglestone Eaglewood Earp Earthman/M Earthmen/M Eastbourne Eastertide Easthampton Eastland Eastleigh Eastman Eastwick Eastwood Eaton/M Eben/M Ebert Eccles Ecclesiastes Ecclesiasticus Echeveria Ecole Econometrica Ecuador Edda Eddie Eddington Eden/M Edenisation/MS Edenise/S Edenization/MS Edenize/S Edgar Edgerton Edgewater Edgewood Edinburgh Edison Edith Edmonds Edmondson/M Edmonton/M Edmund Edna Edo Edomite Edsger/M Eduard Eduardo/M Edward/S Edwardian Edwardine Edwin Edwina Effie/M Efik Egan/M Egbert Egeria Egerton Egham Egmont Egypt Egyptian/S Egyptianisation/MS Egyptianise/S Egyptianization/MS Egyptianize/S Egyptise/S Egyptize/S Egyptology Ehrenburg Ehrlich/M Eichendorff Eichmann Eiffel Eijkman Eikon Eilat Eileen Eindhoven Einkorn Einstein Einsteinian Eire/M Eisenach Eisenhower Eisenstadt Eisenstein Eisner/M Eisteddfod Ekaterinburg Ekaterinodar Ekaterinoslav Ekberg Ekstrom/M Ektachrome Elaine Elamite Elba Elbert Eldon/M Eleanor Eleatic Eleazar/M Electra Elena/M Eleusinian Elfland Elgar Elgin/M Eli Elia/S Elijah Elinor/M Eliot Elisabeth Elisabethville Elisavetgrad Elisavetpol Elise/M Elisha/M Elizabeth Elizabethan/S Elizabethanise/S Elizabethanize/S Elkhart Ella Ellen/M Ellesmere Ellice Ellie Ellington Elliot Elliott Ellis Ellison Ellsworth Ellwood/M Elmhurst Elmira Elmsford Elohim Elohist Eloise Elroy Elsass Elsevier/M Elsie Elsinore Elton/M Elvira Elvis/M Elwood/M Ely/M Elysee/M Elysees Elysium Emanuel Emerson Emil/M Emile/M Emilio/M Emily Emirates Emma Emmanuel Emmenthal Emmet Emmett/M Emmy Emory Empson Endamoeba Endicott Endrich Endymion Enesco Engel Engels Engle/M Englewood English/M Englishise/S Englishism Englishize/S Englishman Englishmen Englishry Enid/M Enoch Enos Enrico Ensolite Entamoeba Eocene Eozoic Ephedra Ephemera Ephesian/S Ephesus Ephraim Ephraimite Epicurise/S Epicurize/S Epicurus Epigoni Episcopalian Episcopalianise/S Episcopalianize/S Episcopalism Epsom Epstein Equatorial Equisetum Erasmus Erastianism Erastus Erato/M Eratosthenes Erechtheum Erechtheus Erenburg Eric Erica Erich Erickson Ericson Ericsson Erie Erik/M Erika/M Erikson Erin Eritrea Erlang/M Erlenmeyer/M Ermanaric Ermler Ernest Ernestine Ernie Ernst Eros Errol Erse Erskine/M Ervin Erwin Erymanthian Escallonia Escherichia Escorial Esdras Eskilstuna Eskimo/S Eskimoised/MS Eskimoized/MS Esmark/M Esp Espagnol Esperanto Esposito/M Esquiline Essen/M Essene Essenise/S Essenize/S Essex Estella/M Estes Esther Estonia/M Estonian Eth Ethan Ethel Ethelbert Ethelred Ethernet/MS Ethiopia Ethiopian Ethiopians Etna Eton Etruria Etruscan Eucharis Eucharist Euclid Euclidean Eugene Eugenia Euler Eulerian Eumenides Eunice Euonymus Eupatorium Euphrates Euphrosyne Eurasia Eurasian Euridyce/M Euripides Euroclydon Eurocommunism Eurocrat Eurodollar Euromarket Europa Europe/M European/MS Europeanisation/MS Europeanise/GS Europeanised Europeanization/MS Europeanize/GS Europeanized Eurovision Eurus Euryale Eurydice Eurystheus Eustachian Euterpe/M Euxine Eva Evangeline Evans Evanston Evansville Evelyn Evensen Eveready Everett Everglade Everglades Everhart/M Everton Evertor Evesham Evonymus Ewen Ewing Excalibur Exeter Exmoor Exon Exxon Ezekiel Ezra FAA FAQ/MS FBI FCC FDA FIFO FL FM FMC FPC FPS FSF/M FTC FTP Faber/M Fabian/M Fabianism Fabrikoid Factice Fafnir/M Fagin Fahey/M Fahrenheit/S Fairbanks Fairchild Fairfax Fairfield Fairmont Fairport Fairview Faisal Faizabad Falange Faliscan Falk Falkirk Falkland/S Falkner Falla Fallopian Falmouth/M Falstaff Falstaffian Fanny/S Fanti Faraday Farber Fareham Fargo Farkas Farley Farmington Farnborough Farnese Farnesol Farnham Farnsworth/M Faroe/S Farouk Farquhar Farrago Farrell Farthingale Fartlek Faruk Fassbaender Fassbinder Fathometer Fatima Fatimid Fatshan Faubourg Faulkner Faulknerian Fauntleroy Faure Faust Faustian Faustus Fawkes Fayal Fayette/M Fayetteville Featherman Feb February/MS Fedoseyev Feeney/M Feigin Feisal Felder Feldman Felice Felicia Felix Fellini Feme Fenian Fenice Fenrir Fenton/M Fenwick Ferber/M Ferdinand Ferdinando Fergus Ferguson/M Fermat/M Fermi Fernandi Fernando Ferrara Ferreira Ferrer/M Fescennine Fess Feuchtwanger Feuerbach Feuilleton Fezzan Fianna Fiberglas Fibonacci Fidel Figaro Fiji/M Fijian/MS Filipino/S Filippo Fillmore Finland Finley/M Finn/S Finnegan Finnic Finnish Finsen Finsteraarhorn Fiorello Fiori Firbank Firestone Fischbein/M Fischer Fishkill Fisk Fiske/M Fitch Fitchburg Fitzgerald Fitzpatrick Fitzroy Fizeau/M Flagler/M Flamig Flaminian Flanagan Flanders Fledermaus Fleetwood Fleischman Fleisher Fleming/S Flemish/DGS Flensburg Fletcher Fletcherise/S Fletcherism Fletcherize/S Flintshire Flo/M Florence Florentine Florida/M Floridian/S Floyd Flugelhorn Flynn Flysch Fogarty Foism Foison Fokine Fokker Foley/M Folsom Fomalhaut/M Fontaine/M Fontainebleau Fontana Foochow Foote Forbes Fordham Formica Formosa Formosan Fornax Forrester Forsythe/M Forsythia Fortescue/M Fortran/M Foss Fouquet Fourier/M Fourierism Fournet Fournier Foxhall Fran/M Francaise France/MS Francesca Francescatti Francesco Francie Francine/M Francis Franciscan/S Francisco Francise/S Francize/S Franck Franco Francois Francoise/M Franconia Franconian Francophile Francophobe Francophone Franglais Frankel/M Frankenstein Frankford Frankfort Frankfurt Frankie Frankish Franklinisation/MS Franklinization/MS Franny Franz Fraser/M Frau Frauenfeld Fraunhofer Frayne Frazer Frazier Frazil Freccia Fred Freda Freddie Freddy/M Frederic Fredericia Frederick/S Fredericksburg/M Frederico Fredericton/M Frederiksberg Fredholm/M Fredrick Fredrickson Fredrikstad Freemason Freeport Freesia Freetown/M Freiburg Freida French/M Frenchise/S Frenchize/S Frenchman Frenchmen Frenchy Freni Frescobaldi Fresnel Fresno Freud Freudian Frey Freya/M Freytag Fri Fribourg Fricandeau Frick Friday/MS Friedman Friedrich/M Friesian Friesland/M Frigg Frigga Frigidaire Frijol Frisbee Frisch Frisco Frisian Frito Fritz Friuli Friulian Frizette Frobisher Froment Frostbelt/M Fruehauf/M Frye/M Ft Fuchs Fuegian Fuji Fujitsu/M Fulbright/MS Fulham Fullerton Fulton/M Furman/M Futuna Fyzabad GA GAO GCD GE GM GMT GNP GOP GPO GPSS GSA GU Gaberones Gabon/M Gabriel Gabrielle Gadarene Gael Gaelic Gaelicisation/MS Gaelicise/S Gaelicization/MS Gaelicize/S Gaeltacht Gagarin Gaia Gail Gaines Gainesville Gainsborough Gaithersburg Galago Galahad Galapagos Galatea Galatia/M Galbreath Galen/M Galenic Galenical Galenism Galibi Galician Galilean Galilee Galileo/M Galla Gallagher/M Gallic Gallican Gallicanism Gallicisation Gallicise/DGS Gallicism Gallicization Gallicize/DGS Galloway Gallup Galois Galt/M Galton Galveston Galvin/M Galway/M Galwegian Gambeson Gambetta Gambia/M Gambier Gamboge Ganda Gandhi/M Gandhian Gandhiism Ganga Ganges Gannett/M Ganymede Garamond Garcia Gardner Garfield Garfunkel Gargantua Garibaldi Garnett Garrett Garrisonian Garry Garrya Garth/M Garvey Gary/M Gascon Gascony Gaspar Gaspee/M Gasset Gaston Gates Gatha Gatlinburg Gatsby Gaucho Gauguin Gaul Gaulish Gaulle/M Gaullism Gaullist Gaultheria Gauntley Gaussian Gautama Gavin Gaylor Gaylord Gaynor Gaza Geary Gedda Gegenschein Gehenna Gehrig Geiger Geigy/M Geisel Geissler Gelderland Gelsemium Gelsenkirchen Gemara Gemini Geminid Gemma Gencer Gendron Genesco Geneva/M Genevan Genevieve/M Genf Genfersee Genghis Genoa/M Genoese Genova Gentoo Geoff/M Geoffrey/M Geordie George/MS Georgetown Georgette Georgia Georgian/S Gerald Geraldine Gerard Gerber Gerhard Gerhardt German/MS Germania Germanic Germanism Germanophile Germanophobe Germantown Germany/M Gerome Gerry/M Gershwin/S Gertrude Gethsemane Getty Gettysburg Geum Ghana Ghanian Gharial Gharry Ghaut Ghazi Ghazzah Gheber Ghent Gherao Ghiaurov Ghiberti Ghibli Ghillie Ghirlandaio Ghitalla Giacometti Giacomo Gibbs Gibby Gibeonite Gibraltar Gibson/M Giddings Gideon Gielgud Gierek Giessen Gifford Gigout Gil/M Gilbertian Gilbertson Gilchrist/M Gilda/M Gilead/M Gileadite Gilels Giles Gilkson Gillespie Gillette Gilligan Gillingham Gilmore/M Gimbel Gina/M Gino/M Ginsberg/M Ginsburg/M Gioconda Giorgio Giovanni Gippsland Gippy Gipsy/MS Giraud Giraudoux Gisborne Giscard Giuliano/M Giulini Giulio Giuseppe/M Gladstone Gladys Glagolitic Glasgow Glaswegian Glazunov Gleason Glenda Glendale Glengarry Glenn Glickman Glidden/M Glinka Globigerina Gloria Gloriana/M Glorioso Gloucester Gloucestershire Gloxinia Gluck Glynn Gobbi Gobelin Gobi/M Goddard/M Godesberg Godetia Godfrey/M Godiva Godolphin Godot Godspeed Godthaab Godunov Godwin/M Godzilla/M Goebbels Goering Goethe Goff/M Gogh Goidel Golconda Golda Goldberg Goldfield Goldman Goldmark Goldstein/M Goldstine/M Goldwater Goleta/M Golgi Golgotha Goliath Gomberg Gomez Gond Gondi Gondwanaland Gongorism Gonzales Gonzalez Goode/M Goodman Goodrich Goodwin Goodyear Goop Gorcock Gordian Gordon Goren/M Gorgonzola Gorham Gorki Gorky Gorlovka Gorton/M Goshen Gosplan Goth Gotha Gotham Gothenburg Gothic Gothically Gothicise/DGRSZ Gothicism Gothicize/DGRSZ Gotland Gottfried/M Goucher Gouda/M Gould/M Gounod Goya Graafian Graben Gracchus Gracie Grady Graeae Graff/M Graffman Grafton Graian Granth Granville Grayson Grecian Grecianise/S Grecianize/S Grecism Greece Greek/MS Greekise/S Greekize/S Green Greenberg Greenblatt Greenbriar Greene/M Greenfeld Greenfield Greenham Greenland Greenpeace/M Greensboro Greensville Greentree Greenville Greenwich Greer/M Greg/M Gregg Gregorian Gregory Greisen Grenada Grenadines Grendel Grenier Grenoble Grenville Gresham/M Greta Gretchen Gretel/M Gretna Grieg Grierson Griffe Griffith Griffiths Griffon Grig Grigioni Grignard Grikwa Grimaldi/M Grimm Grinch/M Grindelia Griqua Griqualand Gris Grison Griswold/M Grolier Groot Grosset Grossman Grosvenor Groton Grumman Grundheber Grus Grusky Gruyere Guadalupe Guadeloupe Guam Guarani Guardia Guatemala Guatemalan Guelph Guenther/M Guerin Guernica Guernsey Guerrero Guevara Guggenheim Guhleman Guiana Guido Guildford Guilford/M Guillaume Guillou Guinea Guinevere/M Guinness Gujarat Gujarati Gullah Gunderson Gunnar Gunther/M Gurkha/M Gurmukhi Gurzenich Gus Gustafson/M Gustav/M Gustave/M Gustavus Gutenberg Guthrie Guyana Gwen Gwyn/M Gypsophila HDL HP Haag/M Haas Haberman/M Habib/M Habsburg Hackett Hadamard Haddad/M Haddington Hades Hadith Hadley/M Hadrian Haematoxylon Hafiz Hagegard Hagen/M Hager/M Hagiographa Hagstrom/M Hague Hahn/M Haida Haifa Hainan Haines Haiti Haitian Haitink Hakea Hal Haley/M Halifax Hallamshire Halle Halley/M Hallinan Halloween Hallowmas Hallstatt Halpern Halsey/M Halstead/M Halverson/M Hamal/M Hamburg Hamey Hamilton Hamiltonian/S Hamite Hamitic Hamlin/M Hammett Hammond Hampshire Hampton Hancock Handel/M Handley Haney/M Hanford/M Hankel/M Hanley/M Hanlon/M Hanna/M Hannah Hannibal Hanoi Hanover Hanoverian Hanoverianise/S Hanoverianize/S Hanoverise/S Hanoverize/S Hans/N Hansard Hanseatic Hansel Hanson Hanukkah Hanuman Hanyang Hapgood Hapsburg/M Harbin/M Harcourt Hardenberg Hardin Hardy Hargreaves Haringey Harl Harlan/M Harlem Harley/M Harlow Harmon/M Harmonist Harmonistic Harmonistically Harmsworth Harold Harper Harriet Harrild Harriman/M Harrington/M Harris Harrisburg Harrison Harrisonburg Harrovian Harry/M Hartford Hartley Hartman Harvard Harvardise/S Harvardize/S Harvey/S Harveyise/S Harveyize/S Haskell Haskins Hatchure Hatfield Hathaway/M Hathor Hatteras Hattie Hattiesburg/M Hattise/S Hattize/S Haugen/M Hauptmann Hausa/M Hausdorff/M Hauser Havana Haversian Havilland/M Hawaii Hawaiian Hawick Hawkins Hawley Hawthorne Hayden/M Haydn Hayes Haynes Hayward Haywood Healey/M Healy/M Heard Hearst Heartwood Heathkit Heathman Heaviside Hebe Hebraic Hebraicise/S Hebraicize/S Hebraism Hebraist Hebrew/S Hebrides/M Hebron Hecate/M Heckman/M Hecuba Hedda Hegel Hegelian Hegelianise/S Hegelianize/S Heidegger/M Heidelberg Heidi/M Heifetz Heine/M Heinlein/M Heinrich/M Heinz Heinze Heisenberg Heiser Helen Helena Helene Helga/M Helgoland Helianthus Heligoland Heliogabalus Heliopolis Helios Helladic Hellas Helldiver Helleborine Hellenic Hellenisation/S Hellenise/DGS Hellenism Hellenist Hellenistic Hellenization/S Hellenize/DGS Hellespont Helmholtz Helmut Helsinki Helvetia Helvetian Helvetic Helvetica Helvetii Hemingway Hemmings Hempstead/M Henderson Hendrick/S Hendrickson Hendrix Henie Henley/M Hennessey/M Hennessy Henri/M Henrietta Henryson Henslowe Henze Hepburn Hephaestus Heptateuch Hera Heraclid Heraclitus Herat Herbert Herculean Hercules Hercynian Hereford Herefordshire Herero Herman Hermann/M Hermaphroditus Hermes Hermite Hermosa Hernandez/M Herodotus Herr Herrington Herschel Hersey Hershel Hershey Hertford Hertfordshire Hertzian Hertzog/M Herzegovina Herzl Herzog Hesione Hesperia Hesperian Hesperides Hesperus Hess Hesse/M Hessian/S Hester/M Hesychast Het Heteroousian Hetman/M Hettie/M Hetty/M Heublein Heusen/M Heuser/M Hewett/M Hewitt/M Hewlett/M Hexateuch Heynis Heysham Heywood Hezekiah Hialeah Hiatt/M Hiawatha Hibbard/M Hibernia Hibernicism Hickey/S Hickman/M Hickok Hickox Hideyoshi Hieland Hieronymus Higgins Highfield Hilary Hilbert Hildebrand/M Hildesheim Hillary Hillcrest Hillel Hillsboro Hillsdale Hilton Himalaya/M Himalayas Himmler Himyarite Himyaritic Hinayana Hindemith Hindenburg Hindi Hindu/MS Hinduism Hindustan/M Hines Hinkle Hinman/M Hinsdale Hippeastrum Hippocrates Hippocratic Hippocrene Hippolytus Hippomenes Hiram Hirey Hiroshi/M Hiroshima Hirsch Hirudin Hispania Hispanic/MS Hispanicisation Hispanicise/DGS Hispanicism Hispanicization Hispanicize/DGS Hispaniola Hitachi Hitchcock Hitler Hitlerian Hitlerism Hitlerite/S Hittite Hoagland/M Hobart/M Hobbes Hobbism Hobbs Hobday Hoboken Hochheimer Hocktide Hodge/M Hodgkin/M Hodgson Hoene Hoff/M Hoffman Hofmann Hogan/M Hohenzollern Holbrook Holcomb/M Holland/MRSZ Hollandia Hollerith Holliday Holliger Hollingsworth/M Hollister Holloway/M Hollywood/M Hollywoodise/S Hollywoodize/S Holm/M Holman/M Holmdel/M Holmes Holocene Holst Holstein Holyoke Holzman Hom Homeric Homoiousian Honda/M Hondo Honduras Honeywell Hong Honiton Honolulu Honshu/M Hoosier Hoosierise/S Hoosierize/S Hoover/M Hooverise/S Hooverize/S Hopi/M Hopkins Hopkinsian Horace Horatian Horatio Horatius Horenstein Hornblower Horne Horowitz Hortense Horton Horus Hosta Hottentot/M Houdaille/M Houdan Houdini Houghton/M Houston Houstonia Howard Howe Howell Howland Hoya Hoyt/M Hrothgar/M Hubbard/M Hubbell/M Hubble/M Huber/M Hubert Huck Huddersfield Huddleston Hudibrastic Hudson Huey Huffman/M Huggins Hugh/S Hugo Huguenot Humboldt Hume Hummel/M Humperdinck Humphrey/S Humpty Hun Hungarian Hungary Hunnish Huntingdonshire Huntington/M Huntley/M Huntsville Hurd/M Hurdies Huron Hurst Hurwitz Hussite Huston/M Hutchins Hutchinson Hutchison Huxley Huxtable/M Huybrechts Hyacinthus Hyades Hyannis Hyde/M Hydrastis Hydroski Hydrus Hygeia Hyman Hynninen Hyoscyamus Hypnos Hyson Hz I'd I'll I'm I've IA IBM/M ICC ICL IEE IEEE IGN IL INTERAMA IOT IQ IR/S IRAF ISO ISSN ITCorp/M ITT ITcorp/M IUD IUDs Ian/M Iapetus Iberia Iberian Ibero Ibn Ibo Ibrahim Ibsen Icaria Icarian Icarus Iceland/MR Icelandic Iceni Ichthyornis Ida/M Idaho Ido Idomeneus Ifni Ignatius Igor/M Igorot Iguanodon Ijssel Ijsselmeer Ike/M Ilford Iliad Iliadise/S Iliadize/S Ilkeston Illinois Illuminise/S Illuminize/S Illyrian Ilona Ilyushin Imagen/M Imai Imbrium Immanuel Immelmann Immingham Impatiens Inbal Inc Inca/S Ind India/M Indiaman Indian/MS Indiana/M Indianapolis Indic Indira Indo Indochina Indochinese Indoeuropean Indologist Indonesia Indonesian Indris Indus Indy/S Informatica Ingersoll Ingram Ingush Inkerman Inman/M Innuit Inselberg Intel/M Intelsat Interisland Internet/M Invar Inverness Io Ionesco Ionia Ionian Ionicisation/MS Ionicise/S Ionicization/MS Ionicize/S Iowa Ipomoea Ira Iran/M Iranian/MS Iranise/S Iranize/S Iraq Iraqi/MS Ireland/M Irene Ireton Irish Irishise/S Irishism Irishize/S Irishman Irishmen Irkutsk Irma Irons Iroquoian Iroquois Irrawaddy Irvin/M Irvine Irving Irwin/M Isaac/S Isaacson/M Isabel Isabella/M Isadore/M Isaiah/M Isbn Iscariot Ishmael Ishmaelite Ishtar Isidore Isis Iskander Iskenderun Islam Islamabad/M Islamic Islamisation/MS Islamise/DGS Islamization/MS Islamize/DGS Islandia Islington Ismaili Isocheim Isolde/M Israel/M Israeli/MS Israelite/S Israelitise/S Israelitize/S Istanbul Istvan/M Italia Italian/MS Italianisation/MS Italianise/DGRSZ Italianism Italianization/MS Italianize/DGRSZ Italy Ithaca Ithacan Ito/M Ivan Ivanhoe Ivanovo Ivanovsky Iverson/M Ives Ivory Ixia Ixion Ixtaccihuatl Izaak Izhevsk Iztaccihuatl Izvestia JACM JCL Jabalpur Jabir Jabiru Jablonsky/M Jaborandi Jacaranda Jackie Jackman Jackson/S Jacksonian Jacksonville Jacky Jacob/S Jacobean Jacobi/M Jacobian Jacobin Jacobinise Jacobinize Jacobite Jacobs/N Jacobson/M Jacobus Jacoby Jacquard Jacqueline Jacques Jadotville Jaeger/M Jaga Jahvist Jaime/M Jain Jainism Jakarta Jake/S Jamaica Jamaican James Jamesian Jameson Jamestown Jamie/M Jan Janacek Jane/M Janeiro Janesville Janet/M Janice Janiculum Janigro Janis Janos Janowitz Jansen Jansenism Jansenist/M January/MS Janus Jap Japan/M Japanese/M Japanisation/MS Japanise/DGS Japanization/MS Japanize/DGS Japheth Japhetic Jarvi/S Jarvin/M Jason Jastrow Jat Java Javanese Jaycee/S Jeanette Jeanie Jeanne Jeannie Jed/M Jeff Jefferson/M Jeffersonian/S Jeffrey/S Jehovah Jehovist Jello Jemmy Jena Jenghis Jenkins Jenner Jennie Jennifer Jennings Jensen/M Jephthah Jeremiad Jeremiah Jeremy Jeres Jericho Jerome Jerry/M Jersey Jerusalem Jervis Jespersen Jesse/M Jesselton Jessica Jessie Jessy Jesu Jesuit/S Jesuitise/DGS Jesuitism Jesuitize/DGS Jesus Jethro Jetton Jew/S Jewell/M Jewelled Jewess Jewett/M Jewish/P Jewry Jezebel Jezreel Jill/M Jim/M Jimenez Jimmie Jimmy/M Jinny Jo/M Joab Joan Joanna Joanne/MS Joaquin Jobrel Jocasta Jochum Jodi/M Jodo Jody Joe/S Joel Johann Johanna/M Johannes Johannesburg Johansen Johanson Johnnie/M Johnny/M Johnsen Johnson Johnsonian Johnston/M Johnstown Joinville Joliet Jolla/M Jolson Jon/M Jonah Jonas Jonathan Jonathanisation/MS Jonathanization/MS Jones/S Jonson Joplin Jordan Jorge Jorgensen Jorgenson Jose Josef Joseph Josephine Josephson Josephus Joshua Josiah Jotunheim Jovanovich Jove Jovian Joyce Jr Juan Juanita Juantorena Jubal Jubbulpore Judaea Judah Judaic Judaica Judaism Judas Judd/MRZ Judder/DGS Jude Judea Judith Judson/M Judy Jugoslavia Juilliard Jul Jules Julia Julian Juliana Julie/MS Juliet Julio Julius July/MS Julys Jumada Jun June/MS Juneau Juneberry Jung/M Jungian Junius Juno Junoesque Jupiter Jura/MS Justine Justinian Jutish Jutland/M Jylland KGB KS KWIC KWOC KY Kaaba Kabaka Kabuki Kabul Kabyle Kaddish Kaffir Kaffraria Kafir Kafka Kafkaesque Kahn/M Kaiserslautern Kajar/M Kalahari Kalamazoo Kalevala Kalmuck Kalmuk/M Kamchatka Kamikaze/M Kamikazes Kampala/M Kampuchea/M Kamu Kanaka Kanarese Kanawa Kandinsky Kane/M Kanji Kankakee Kannada Kansas Kant Kapfenberg Kaplan/M Karachi/M Karaite Karajan Karakul Karamazov/M Karczykowski Karelian Karen Karl Karloff Karlovy Karlsbad Karlsruhe Karnak Karol Karp/M Karpov Karri Karst Kasha Kashmir Kashmiri Kaskaskia Kaspszyk Kate Katharine/M Katherine Kathleen Kathy Katie/M Katmandu Katowice/M Katrina/M Katrine Katz Kauffman/M Kaufman/M Kay Keaton Keats Keck/M Keegan Keeling Keenan Keewatin Keighley Keijo Keith Keller Kelley Kellogg Kelly/M Kelsey/M Kelson Kelvin Kemp Kempff Ken/M Kendall/M Kenilworth Kennan/M Kennecott Kennedy Kennelly Kenneth Kenney/M Kennington Kenny Kenosha Kensington Kent Kentish Kenton/M Kentucky Kenya Kenyon/M Kepler/M Kerenski Kermanshah Kermit Kernighan/M Kerouac/M Kerr/M Kertesz Kessler/M Keswick Kettering Kevin Kewaskum Kewaunee Keyes Keynes Keynesian Keynesianism Khabarovsk Khachaturian Khaddar Khakass Khakis Khalid Khalif Khalkha Khalkidiki Khama Khamsin Khanate Khanga Khania Kharif Kharkov Khartoum/M Khat Khayal Khedive Khelat Kherson Khieu Khingan Khirbet Khiva Khmer Khoikhoi Khoisan Khojent Khotan Khrushchev/S Khufu Khulna Khuskhus Khyber Kiaat Kiang Kiangsi Kiangsu Kiaochow Kibitka Kiblah Kickapoo Kidde/M Kidderminster Kieffer/M Kiel Kielce Kier Kierkegaard Kieselguhr Kiev Kiewit/M Kif Kigali/M Kikoi Kikumon Kikuyu/M Kilauea Kildare Kilderkin Kilgore/M Kilimanjaro/M Kilkenny Killarney Killebrew Killick Killiecrankie Killifish Killikinick Kilmarnock Kim Kimball/M Kimberly/M King Kingdom Kingman Kingsbury Kingsley Kingston Kingstown Kingwood Kinney/M Kinnickinnic Kinnock Kinross Kinsey Kinshasa Kinshasha/M Kiowa Kipling Kirby Kirchhoff Kirchner/M Kirchoff Kirghiz Kiribati Kirigami Kirin Kirk/M Kirkby Kirkcaldy Kirkcudbright Kirkland Kirkman Kirkpatrick Kirkuk Kirkwall Kirkwood Kirman Kirmess Kirov/M Kirovabad Kirovograd Kirshbaum Kiruna Kirundi Kisangani Kish Kishinev Kishke Kismayu Kissel Kissin Kissinger Kist Kistna Kisumu Kitakyushu/M Kitts Kiwanis Kizil Klagenfurt Klan Klangfarbe Klansman Klaus Klausenburg Klee Kleiber Klein/M Kleinrock/M Kleist Klemperer Klimt Kline/M Klipspringer Klondike Klux Knapp/M Knauer/M Kneller Knesset Knighthead Knightsbridge/M Kniplova Knobeloch Knobkerrie Knossos Knott/M Knowles Knowlton/M Knox Knoxville Knudsen Knudson Knussen Knuth/M Knutsen Knutson Kobayashi Koblenz Koch Kochab/M Kodachrome Kodak/S Kodaly Kodiak Koenig Koenigsberg Koestler Koheleth Kohima Kohl Kohler Kohn Kohoutek Kokand Kokanee Kokobeh Kokoschka Kolhapur Kolinsky Kollo Kollwitz Kolmar Kolmogorov Kolo Kolomna Kolyma Komati Komatik Komi Kommunarsk Kommunizma Komodo Komsomol Komsomolsk Konakry Kondo Kondrashin Kong Konrad/M Konstanz Kootenay Kopeisk Kopje Koppa Koppers Koran/M Korbut Korchnoi Kordofan Kordofanian Korea Korean/S Korma Korngold Korsakov Kortrijk Koruna Korzybski Kos Kosciusko Kossuth Kostroma Kosygin Kota Kotabaru Koulibiaca Koumis Kovacs Kovic/M Kovno Kovrov Kowalewski/M Kowalski/M Koweit Kowhai Kowloon Kozhikode Kra Kraal Kraemer Kragujevac Krait Krakatoa Krakau Krakow Kramatorsk Kramer Krameria Kranj Krans Krasnodar Krasnoyarsk Krause Krebs Krefeld Kreisky Kreisler Kremenchug Kremer Kremlin Krems Kreplach Kresge Kreutzer Krieger/M Kriegspiel Kriemhild Krimmer Krio Krips Kris Krishna Kriss Kristiansand Kristianstad Kristin/M Kristina Krivoy Kromesky Krone Kronecker/M Kronig Kronos Kroon Kropotkin Krueger Kruger Krugersdorp Kruller Krummhorn Krupp Kruse/M Kruysen Krym Kshatriya Kuala Kuban Kubelik Kublai Kubrick Kuch/GN Kueh Kuenlun Kuenning/M Kufic Kuhn/M Kuibyshev Kukri Kuku Kula Kulturkampf Kulun Kum Kumamoto Kumar Kumasi Kumbaloi Kung Kungur Kunming Kunzite Kuomintang Kuopio Kura Kurd Kurdish Kurgan Kuril Kurland Kurosawa Kuroshio Kurrajong Kursaal Kursk Kurt Kurzeme Kuskokwim Kutaisi Kutch Kutuzov Kuwait Kuznetsk Kwa Kwacha Kwajalein Kwakiutl Kwangchow Kwangchowan Kwangju Kwangtung Kwantung Kwanza Kwara Kwazulu Kweichow Kweilin Kweisui Kweiyang Kwela Kyle Kynewulf Kyongsong Kyoto Kyprianou Kyrie Kyushu L'vov LDL LED/MS LIFO LPG LSI LTV La LaTeX/M Laager Laaland Laban/M Labrador Laburnum Lacedaemonian Lacerta/M Lacey Lachesis Lackawanna Lactobacillus Ladin Ladino Lafayette Lagos Lagrange Lagrangian/M Lagting Laguerre Laguna Lahnda Lahore/M Lahti Laibach Laidlaw/M Laing/M Lakehurst Lakeland Lakes Lakewood Laksa Lakshadweep Lalo Lamaism Lamar/M Lamarck Lamarckian Lamarckism Lamborghini/MS Lamington Lammas Lammastide Lamport/M Lana/M Lancashire Lancaster Lancastrian Lancelot/M Landau Landis Landwehr Lang/M Lange Langeland Langford Langland Langley Langmuir/M Langobard Langobardic Langridge Langton Langtry Lanka/M Lansing Lantana Lao Laocoon Laos Laotian/S Lapith Laplace Laplacian Lapland Lapp Lar Laramie Laredo Larkin/M Larry/M Lars/N Larson Laski Lassen Laszlo/M Latakia Lateran/M Lathrop Latimeria Latin/M Latina Latinate Latinisation/MS Latinise/DGRSZ Latinism Latinist Latinity Latinization/MS Latinize/DGRSZ Latino Latona Latour Latrobe/M Lattimer Latvia/M Latvian Lauderdale Laudian Laue/M Laughlin/M Laughton Launce Launceston Laundromat/S Laura/M Lauren Laurence Laurent/M Laurentian Laurie/M Lausanne/M Lavoisier/M Lawford Lawless Lawrence Lawrenceville Lawrentian Lawson Layton/M Lazar Lazarus Leacock Leaf Leah Leamington Leander/M Lear Leary Leatherette Leavenworth Lebanese Lebanon Lebesgue Leda Lee/M Leeuwenhoek/M Lefkowitz Legendre/M Lehigh Lehman/M Leibnitz Leibniz Leicester Leicestershire Leichhardt Leiden Leif Leigh Leighton Leila Leinsdorf Leinster Leipzig/M Leishmania Leitner Leland/M Lemberg Lemke Lemmens Lemuel Len/M Lena/M Lenin Leninabad Leninakan Leningrad Leninism Leninist Lennon/M Lennox/M Lenny Leno Lenore/M Lenten Lenya Leo Leon Leona Leonard Leonardo Leoncavallo Leone Leonid/M Leonidas Leopardi Leopold Leopoldville Lepanto Lepidosiren Leptocephalus Lepton Lepus Lermontov Leroy Lerwick Leslie Lesotho/M Lethbridge Lethe/M Letitia/M Leto Lett Lettish Leucippus Levant Levantine Leverhulme Leverkusen Levi/S Leviable Levin/M Levine Levite Levitical Leviticus Levitt/M Levko Lew/M Lewellyn Lewisham Lexington Leyden Leyte Lhasa Liadov Liao Liaoning Liaotung Liaoyang Lias Libby/M Liberace Liberia Libreville/M Libya Libyan Lichfield Lichtenstein Lichter Lieberman/M Liebfraumilch Liechtenstein Ligget/M Liggett/M Lila/M Lilian/M Lilith Lillian/M Lilliputian Lilliputianise/S Lilliputianize/S Lilly Lima Liman Limbourg Limburg/R Limpopo Lin/M Lincoln Lincolnshire Lind/M Linda Lindberg Lindbergh/M Lindholm/M Lindquist/M Lindsay/M Lindsey/M Lindstrom/M Lindy Linnaean Linnaeus Linotype Linsang Linton Linus Lionel Lipetsk Lippincott/M Lippizaner Lipschitz Lipscomb/M Lipton Liriodendron Lisa Lisbon Lise/M Liss Lissajous Listerise/S Listerism Listerize/S Liston Liszt Lithuania Lithuanian Littleton Litton Liv Livermore Liverpool Liverpudlian Livingston Liz/M Lizzie Lizzy Ljubljana Llandaff Llandudno Llanelli Llangollen Llewellyn Lleyn Lloyd Lobachevsky Locarno Locke Lockhart Lockheed Lockian Lockwood Lodowick/M Loeb/M Loewe Logan Loire Lois Loki/M Lola Lolland Lollard Lomb/M Lombard Lombardy/M Lombrosian Lome London/R Londonderry Londonisation/MS Londonise/S Londonization/MS Londonize/S Longbenton Longfellow Longford Longobard Longstreet Lonicera Loomis Lopez Lorelei Loren/M Lorengar Lorentzian Lorenz/M Loretta Lori/M Lorinda/M Lorraine Lota Lothario Lotte/M Lottie Lou/M Loughborough Louis Louisa Louisburg Louise Louisiana Louisianan Louisville Lounsbury/M Lourdes Louvre Lovejoy Lovelace Loveland Lowe/M Lowell Lowry/M Loy Loyola Ltd Luba Lubbock Lubell/M Lucan Lucania Lucas Lucerne Lucia Lucian Lucien Lucifer Lucille Lucina Lucius Lucknow Lucretia Lucretius Lucy Luddite Ludendorff Ludlow/M Ludmilla Ludwig Ludwigsburg Ludwigshafen Luffa Lufthansa Luftwaffe Luganda Lugansk Luis Luke/M Luluabourg Lumpur Luna/M Lund/M Lundberg/M Lundquist/M Luo Lupercalia Lur Lura Lusaka/M Lusatian Lusitania Lutetia Luther Lutheran Lutheranise/RSZ Lutheranize/RSZ Luton Lutoslawski Lutyens Lutz Luxembourg Luxemburg Luxon Luzon/M Lvov Lycian Lydia Lydian Lykes Lyle/M Lyman/M Lyme Lymington Lynchburg Lyndon Lynn Lyon Lyonnais Lyonnesse Lyra/M Lysander Lysenko/M Lysenkoism Lysimachus Lytham Lythraceous Lyublin MAG MBA MD MDT MDs MFD MHz MIG MIGs MIMD MIPS MIRV MIT/M MKS MKSA MN MO MPH MRI MSC MST MTS MTV MVS MVT Ma Maag Maar Maarianhamina Maas Maastricht Maazel Mab Mabel/M Mac MacArthur MacDonald MacDougall/M MacDraw/M MacGregor MacIntosh/M MacKenzie MacKerras MacMahon/M MacMillan MacPaint/M Macadamia Macao Macarthur Macaskill Macassar Macau Macaulay Macaulayan Macaulayism/S Macbeth Maccabean Maccabees Macclesfield Macdonald Macdonnell Macdougall/M Macedon Macedonia Macedonian Macgregor Mach Machiavelli Machiavellian Mackay Mackenzie Mackerras Mackey/M Mackinac Maclean Macleod Macmahon Macmillan Macneice Macon Macpherson Macready Madagascar Madame/S Maddalena Maddox Madeira Madeleine/M Madeline/M Madhya Madison Madonna/S Madrid Madsen/M Mae/M Maecenas Maelstrom Mafia/M Mafiosi Magdalen Magdalene Magdalenian Magdeburg Magellan Magellanic Maggie Maghreb Magill Maglemosian Magnificat Magnuson/M Magog/M Magruder Maguire/S Magyar Maharashtra Mahayana Mahayanist Mahdi Mahican Mahler/M Mahomet Mahoney/M Mahonia Mahound Maia Maine Maintenon Maitland Majlis Majorca/M Malabar/M Malacca Malagasy/M Malamud Malawi/M Malay Malaya Malayise/S Malayize/S Malaysia Malaysian Malcolm Malden/M Maldive/MS Mali/M Malibu/M Malinowski Malison Mallory Malone Maloney/M Malpighian Malraux Malta Maltese Malthus Malthusian Malton/M Mam Mameluke Managua Manchester Manchu Manchuria Mancunian Mandaean Mandalay Mande Mandelbrot/M Mandeville Mandingo Manfred Manhattan/M Manhattanise/S Manhattanize/S Manichaeism Manila/M Manitoba Manitowoc Mankowski Manley/M Mann/M Mannerheim Mannheim Mansfield Mantler Manuel/M Manuguerra Manville Manx Manxman Mao Maori Maplecrest Mar Marabout Maracaibo Maratha Marathi Marburg Marc/M Marceau/M Marcel Marcello/M Marchland Marcia/M Marciano Marcie/M Marcionism Marco/M Marconi Marcotte Marcus Marcy Mardi/S Marengo Marenzio Margaret/M Margaux Margay Marge Margery/M Margo/M Marguerite Maria/M Marian/M Mariana Marianne/M Marie/M Mariehamn Marienbad Marietta Marilyn Marin Marinduque Marinetti Marino Mario Mariolatry Mariology Marion Marissa/M Marist Mariupol Marius Marivaux Marjorie Marjory/M Mark/M Markevitch Markham/M Markhor Markism/M Markka Markov Markova Markovian Markovitz Marlborough Marlene Marley Marlow Marlowe Maronite Marquesan Marquette Marrakech Marrakesh Marriner Marriott Marsala Marseillaise Marseille Marseilles Marsha Marshall/DG Marshalsea Marston Martha Martian/S Martin Martinez Martinique Martinmas Martinon Martinson Marton Marty Marvin Marx Marxian Marxism/S Marxist Mary/M Maryland/MZ Masai Mascagni Masefield Maserati/MS Masonic Masonite Massachusetts Massawa Massenet Massey/M Matabele Matabeleland Mateo/M Mathews Mathewson Mathias Mathieu Mathis Matilda Matisse/S Matorin Matson/M Matsumoto/M Matt/M Matthew/S Mattie Mattila Mattson/M Mauceri Maud Maude Maugham Maureen Maurice Mauricio Maurine/M Maurist Mauritania Mauritius Mauser Mavis Mavourneen Mawr Mawson Maxim Maximilian Maxine Maxtor/M Maxwellian May/R Maya Mayakovski Mayan Mayans Mayen Mayer/M Mayfair Mayflower Maynard Mayo/M Mayotte Mazda Mazdaism Mbujimayi McAdams McAllister/M McBride/M McCabe/M McCall/M McCallum/M McCann/M McCarthy/M McCarty/M McCauley/M McClain/M McClellan/M McClure/M McCluskey/M McConnel/M McConnell/M McCormick/M McCoy/M McCracken/M McCullough/M McDaniel/M McDermott/M McDonald/M McDonnell/M McDougall/M McDowell/M McElhaney/M McElroy/M McFadden/M McFarland/M McGee/M McGill/M McGillicuddy/M McGinnis McGinty/M McGovern/M McGowan/M McGrath/M McGraw/M McGregor/M McGuire/M McHugh/M McIntosh/M McIntyre/M McKay/M McKee/M McKenna/M McKenzie/M McKeon/M McKesson/M McKinley/M McKinney/M McKnight/M McLanahan McLaughlin/M McLean/M McLeod/M McMahon/M McMartin/M McMillan/M McMullen/M McNair McNally/M McNaughton/M McNeil/M McNulty/M McPherson/M Mcadams Mcallister/M Mcbride/M Mccabe/M Mccall/M Mccallum/M Mccann/M Mccarthy/M Mccarthyism Mccartney Mccarty/M Mccauley/M Mcclain/M Mcclellan/M Mcclure/M Mccluskey/M Mcconnel/M Mcconnell/M Mccormack Mccormick/M Mccoy/M Mccracken/M Mccullers Mccullough/M Mcdaniel/M Mcdermott/M Mcdiarmid Mcdonald/M Mcdonnell/M Mcdougall/M Mcdowell/M Mcelroy/M Mcfadden/M Mcfarland/M Mcgee/M Mcgill/M Mcginnis Mcgonagall Mcgovern/M Mcgowan/M Mcgrath/M Mcgraw/M Mcgregor/M Mcguire/M Mchugh/M Mcintosh/M Mcintyre/M Mckay/M Mckee/M Mckenna/M Mckenzie/M Mckeon/M Mckesson/M Mckinley/M Mckinney/M Mcknight/M Mclaughlin/M Mclean/M Mcleod/M Mcluhan Mclure Mcmahon/M Mcmillan/M Mcmullen/M Mcmunn Mcmurdo Mcnally/M Mcnaughten Mcnaughton/M Mcneil/M Mcnulty/M Mcpherson/M Mcqueen Meade Meccano Mechem Mechlin Mecklenburg Mede Medea Medfield Medford/M Medicaid Medicare Medici/S Medina Mediterranean Mediterraneanisation/MS Mediterraneanise/S Mediterraneanization/MS Mediterraneanize/S Medusa/M Medusan Meg/M Megaera Mehta Meier/M Meiji Meissen Meister Meistersinger Mekong Mel Melaleuca Melampus Melanesia Melanesian Melanie Melanochroi Melbourne Melcher/M Melchite Melchizedek Meleager Melinda Melisande Melissa Melitopol Mellon Melpomene/M Melton Melungeon Melville Melvin Memnon Memphian Memphis Mencken Mendel/M Mendeleyev Mendelian Mendelise/S Mendelism Mendelize/S Mendelssohn Mendoza Menelaus Menelik Mengelberg Menlo Mennonite/S Menominee Menorca Mensch Menshevik Menton Menzies Mephistopheles Mercator Mercedes Mercian Merck/M Mercouri Mercurian Mercurochrome Meredith Merionethshire Meriwether Merle Merovingian Merriam Merrick Merrill Merrimac Merrimack Merritt/M Merseburg Mersey Merseyside Merton Mervin/M Mesembryanthemum Mesopotamia Mesozoic Mesple Messapian Messrs Metcalf/M Methuen/M Methuselah Methuselahs Metol Metrecal Metternich Metzler/M Mexicali Mexican/S Mexicanise/S Mexicanize/S Mexico Meyer/S Meyerbeer Meyerhof Miami Micah Michael/MS Michaelangelo Michaelmas Michaelson Michel/M Michelangelo Michele/M Michelin Michelle/M Michelson Michigan/M Mick Mickelson Mickey/M Mickie Micky Micmac Micronesia Micronesian Microport/M Microscopium Microsoft/M Middelburg Middlebury Middlesbrough Middlesex Middleton Middletown Middlewood Midlandise/S Midlandize/S Midway Midwest Midwestern/RZ Miguel Mikhail Mikoyan Milan Milashkina Mildred Milford Milhaud Millard Millie Millikan Millington Milne Milnes Milquetoast/S Milstein Milton Miltonian Miltonic Miltonise/DGS Miltonism Miltonist Miltonize/DGS Milwaukee Mimi Mina Mindanao/M Mindel Minerva Ming Mingrelian Minkowski Minneapolis Minnesota/M Minnie Minoan Minorca Minorite Minos Minot/M Minotaur/M Minsk/M Minsky/M Minton Minya Miocene Miquelon Mira Miranda Mirfak/M Miriam Miserere Mishima Mishnah Mississippi Mississippian/S Missoula Missouri Missy Mitch/M Mitchell/M Mithraism Mithras Mitropolous Mitropoulos Mittelland Mitterrand Mixtec Mizar/M Mizoguchi Mlle Mme Mnemosyne Mobil Modesto Modiolus Modred Moe/M Moen/M Mogadiscio Moghul Mogilev Mohammed Mohammedan Mohammedanisation/MS Mohammedanise/DGS Mohammedanism Mohammedanization/MS Mohammedanize/DGS Mohave Mohawk Mohican Mohock Mohr Moines Moiseyev/M Mojave Moldau Moldavia Moldavian Moldavite Molech Moliere Moline Moll Mollet Molly Moloch Molochise/S Molochize/S Molokai Molotov Moluccas Mommsen Momus Mon Mona/M Monaco Monash Moncton Mondale Monday/MS Mondial Monegasque Monet Monfort Mongo Mongol Mongolia Mongolian Mongolianism Mongolic Monica Monmouth/M Monmouthshire Monoceros Monongahela/M Monophysite Monroe Monrovia Monsanto Montague Montaigne Montana/M Montanan/M Montclair Montenegrin/M Monterey Monteux Monteverdi/M Montevideo Montezuma Montgomery Montgomeryshire Monticello Montmartre/M Montpelier Montrachet/M Montreal Montserrat Monty Mooney Moorcock Moore Moorish Moorland Moradabad Moran/M Moravia Moravian Moravianised/S Moravianized/MS Mordvin Mordvinian Morehouse Moreland Moresby/M Moreton Morgan Moriarty Morisco Morley/M Mormon Moro Moroccan Morocco Morpheus Morrill/M Morris Morrison Morrissey/M Morristown Morse Mortimer Morton/M Moscone Moscow Moselle Moser/M Moses Moslem/MS Moslemise/S Moslemize/S Mossberg Mossi Mosul Motorola/M Moulton/M Mountbatten Mountie Moussorgsky Mousterian Mouton Moyer/M Mozambique Mozarab Mozart/M Mpc Mr/S Mridang Ms Mt Mudd/M Mueller/M Muenster Muhammad Muharram Muir Mukden/M Mulciber Mulligan/M Multibus/M Multics Mumford Munch Muncie Munda Mundt Munich Munroe Munsey/M Munson Muong/M Murdabad Murdoch Muriel Murillo Murmansk Murphy Murray Murrow Musca Muscat Muscovy Muskegon Muskhogean Muslim/MS Mussolini/MS Mussorgsky/M Mussulman Muti Muzak Muzo/M Mwalimu Mweru Mycenae Mycenaean Mycobacterium Mynheer Myra/M Myrica Myrmidon Myron Mysore NAACP NASA NATO NBC NBS NC NCAA NCAR NCC NCO NCR NE NFS NGK NH NIH NIMH NJ NM NMR NNE NNW NOAA NRC NSF NTIS NTP NV NW NY NYC NYSE NYT NYU NaCl Naafi Nabataean Nabisco Nabokov Nabonidus Nadia Nadine/M Naga Nagaland Nagana Nagano Nagari Nagasaki Nagoya/M Nagpur Nagy/M Nagyszeben Nahuatl Nahum Nair/M Nairobi Nakamura Nakayama Nakoma Nama Namaqualand Namibia Nan Nana Nancy/M Nanette Nanking Nanook Nansen Nantucket Naomi Napier Napierian Naples Napoleon Napoleonic Napoleonise/S Napoleonize/S Napoli Napravnik Narayanganj Narbonne/M Narraganset Narragansett/M Nash Nashua Nashville Nassau Nat Natalie/M Natchez Nate/M Nathan Nathanael Nathaniel Nauru Navaho Navajo Navassa Navona Nayarit Nazarene Nazareth Nazarite Nazi/MS Nazism NeWS Neal/M Neanderthal Neapolitan Nearctic Neblett Nebraska/M Nebraskan/M Nebuchadnezzar/M Ned/M Nederland Needham Neff/M Negress Negritic Negrito Negro/M Negroes Negroisation/MS Negroise/S Negroization/MS Negroize/S Negrophil Negrophobe Negus Nehemiah Nehru/M Neil/M Nejd Nekrasov Nell/M Nellie/M Nelly Nelsen/M Nelson Nembutal Nemean Nemesia Neocene Neogaea Neogene Neotropical Neozoic Nepal/M Nepali Neptune Neptunian Nereis Neri Nero Ness Nestor Nestorianism Netherlands Neubrandenburg Neumann Neva/M Nevada Neville Nevins Nevis Nevski New Newark Newbold/M Newburg Newbury Newburyport Newcastle Newcombe Newcomen Newell Newfie Newgate Newham Newhaven Newman Newmanise/S Newmanize/S Newmarket Newport Newsweek/Y Newton/M Newtonabbey Newtonian Newtown Ngaio Ngaliema Ngoma Nguni Nguyen/M Ngwee Nha Niagara Niamey/M Nibelung Nicaea Nicaean Nicaragua Niccolo Nice Nicene Nicholas Nicholls Nichols Nicholson Nicias Nicklaus Nicobar Nicodemus Nicol Nicola Nicolai Nicolesco Nicolson Nicosia/M Nicotiana Niedersachsen Nielsen Nielson Niersteiner Nietszche Nietzsche Niflheim Niger/M Nigeria Nigerian Nijinsky Nijmegen Nikaria Nike Nikko/M Nikolai/M Nikolainkaupunki Nikolayev Nile Nilotic Nilsen Nilsson Nimitz Nimrod Nimwegen Nina Nineveh Ningpo Ninon Niobe Nipissing Nippon Nipponise/S Nipponize/S Nisei Nishapur Nissen Niue Nixon Nizam Noachian Noah Nobel Noble Noctiluca Noel Noetherian Noguchi Nolan/M Noll/M Noordholland Nora/M Nordhoff/M Nordic Nordkyn Nordstrom/M Noreen/M Norfolk Norland Norma Norman Normandy Normanisation/MS Normanise/DGRSZ Normanization/MS Normanize/DGRSZ Normanton Norn Norris Norristown Norse Norseman Northallerton Northampton Northamptonshire Northcliffe Northcountryman Northfield Northman Northmen Northrop/M Northrup/M Northumberland Northumbria Northumbrian/S Northwich Norton Norwalk Norway Norwegian Norwich Nostoc Nostradamus Nostrand/M Notogaea Notornis Nototherium Notour Notre Nottingham Nottinghamshire Notus Nov Novak/M November/MS Novgorod Novokuznetsk Novosibirsk/M Noyes Nuba Nubia/M Nubian Nucci Nuffield Nugent Nullstellensatz Nuneaton Nupe Nuremberg Nyanja Nyasaland Nynorsk Nyoro Nyquist/M O'Brien/M O'Clock O'Connell/M O'Connor/M O'Dell/M O'Donnell/M O'Dwyer/M O'Er O'Hare/M O'Leary/M O'Neill/M O'Shea/M O'Sullivan/M OEM/MS OK/M OPEC OS/M OSF/M OSHA Oahu Oakham Oakland Oakley Oakmont Oakville Oaxaca Obadiah Oberammergau Oberhausen Oberland Oberlin Oberon Obraztsova Occam/M Occidentalisation/MS Occidentalise/DGS Occidentalization/MS Occidentalize/DGS Oceania Ochman Ockham Oconomowoc Ocrea Oct Octans Octavia Octavian October/MS Octobrist Odelsting Oderberg/MS Odessa Odin Odontoglossum Odysseus Oedipal/Y Oedipus Offenbach Ogden Ogham Oglethorpe Ogpu Ogygian Ohio/M Oidium Oireachtas Oistrakh Ojibwa Okamoto Okayama Okeechobee Okefenokee Okhotsk Okie Okinawa Oklahoma/M Oklahoman/M Olaf Olav/M Olcott Oldcastle Oldenburg Oldham Oldsmobile Olduvai Oleg Olga Oligocene Olin/M Oliveira Oliver/M Olivers Olivetti Olivia Olivier/M Olsen Olson Olympia Olympian Olympianise/S Olympianize/S Olympic/S Olympus Olynthus Omaha Oman Ommiad Omsk Oneida Onondaga/M Ontario Opel Ophiuchus Ophiucus Oporto Oppenheimer Oppens Orangeism Orangeman Oratorian Orcadian Ordovician Oregon Oregonians Orenburg Oresteia/M Orestes Orff Orin Orinoco Orion/M Oriya Orkney/M Orlando Orleanist Orleans Orlick Orly Ormandy Ormazd Ornithorhynchus Orono/M Orphean Orpheus Orphic Orphically Orphism Orpington Orr/M Orsk Ortega Orvieto Orville/M Orwell Orwellian Osage Osaka Osbert Osborn Osborne Oscan Oscar Osgood/M Oshawa Oshkosh Oshogbo Osijek Osiris Oslo Osmanli Osnaburg Osset Ossetic Ossian Ostrander Ostrogoth Ostyak Oswald Othello Othin Otis Ott/M Ottawa Ottley Otto/M Ottoman Ottomanisation/MS Ottomanise/S Ottomanization/MS Ottomanize/S Ouagadougou Ouija Ovambo Overijssel Ovid Owen/S Oxbridge Oxford Oxfordshire Oxnard Oz Ozark/S Ozawa Ozzie PABA PBS PC/MS PCB/MS PCs PDP PDT PM POBox PR PST PTA PUC PVC PWT Paal Pablo Pabst Pachisi Pachouli Pacific Packard/MS Packwood Paddywhack Paderewski Padus Paganini Pahari Pahlavi Paignton Paine Paiute Pakistan Pakistani/S Palacio Palaearctic Palaeocene Palaeozoic Palatine Palau Palenque Paleolithic Paleozoic Palermo Palestine Palestinian Pali Palladian Pallas Palmerston Palmolive Palmyra Palo Palomar Pam/M Pamela Panama Panamanian Panathenaea Pancho Pandanus Pandarus Pandean Pandora Pangaea Panhellenic Panhellenism Panjabi Pantagruel Paoli/M Papen Paphian Papiamento Pappas Papua/M Papuan Paracel Paracelsus Paraguay Paraguayan/MS Paramus Pareto/M Paris Parisian Parisianisation/MS Parisianise/S Parisianization/MS Parisianize/S Parke/M Parkersburg Parkhouse Parkinson Parkinsonian Parma Parmesan Parnassian Parnassus Parr/MS Parrish Parsee Parsi Parsifal/M Parthenon Parthenopaeus Parthenope Parthenos Parthia Parthian Pasadena Pascal/M Pasch Pashto Paso Passaic Passamaquoddy Passiontide Passover Pasternak Pasteur Pasteurisers Pasteurism Pasteurizers Patagonia Patagonians Paterson/M Pathan Patmos Patrice Patricia Patrick Patsy/S Patterson Patti/M Patton Pauk Paul/GM Paula Paulette/M Pauli Pauline Paulinise/S Paulinize/S Paulinus Paulo/M Paulsen Paulson Paulus Pavarotti Pavlov Pavlovian Pavo Pawnee Pawtucket Payne/S Paynise/S Paynize/S Payson Paz Peabody Peachtree Peale/M Pearce Pears Pearson Pease Pecksniffian Pecos Pedro Pegasus Peggy Pehlevi Peiping Pekin Peking Pekingese Pelagian Pelagianism Pelasgian Peleus Pelew Pelham Pelias Pelmanism Peloponnese Peloponnesian Pelops Pembroke/M Pembrokeshire Pendleton Penelope/M Penh Penn Pennsylvania/M Penrose Pensacola Pentateuch Pentecost Pentland Pentstemon Penutian Peoria Pepsi Pepsico Pepys Pequot Perceval Percheron Percival/M Percy Perez Pergamon Periclean Pericles Perilla Peritricha Perkins Perle/M Perlman Permian Pernod Perry/M Perseid Persephone/M Perseus Pershing Persia Persian/S Persianisation/MS Persianise/S Persianization/MS Persianize/S Persicaria Persis Persson Perth Peru Peruvian/S Peruvianise/S Peruvianize/S Pesach Pete/M Peter/MS Peterborough Peterlee Peterloo Peterman Petermann Petersburg Petersen Petersham Peterson Petkiewicz/M Petra Petrie Petrine Petronius Petropavlovsk Petrosian Petrov Petrovsk Petrozavodsk Pettibone Peugeot Pewaukee Peyer Peyton/M Pfalz Pfizer Pforzheim Ph PhD Phaeacian Phaedra Phaedrus Phelps Phil/Y Philadelphia Philadelphus Philco Philip Philippe Philippeville Philippians Philippic Philippine/S Philistia Philistine/S Philistinise/S Philistinism Philistinize/S Phillip/M Phillips Philly/S Philoctetes Philomela Phipps Phlegethon Phobos Phoenicia/M Phoenician Phragmites Phrygian Phyllis Phylloxera Pianola Piavko Picard Picasso Piccadilly Pickett/M Pickford Pickman Pickwickian Pict Pictish Piedfort Piedmont Pierian Pierides Pierre Pierrot Pierson Pietermaritzburg Pieterson Pilate Pillsbury Pilsen Pilsudski Piltdown Pindaric Pinehurst Pinkerton Pinkster Pinsk Pinsky/M Piotr/M Pipestone Piraeus Pisa Pisanello Pisano Piscataway/M Pisces Piscis Pitcairn Pithecanthropus Pitney Pitt Pitta Pittsburgh/Z Pittsfield Pittston Pius Pizarro Pl Plainfield Plainview Planck/M Plasson Plasticine Plato Platonical Platonism Platonist Plattdeutsch Platte Platteland Platteville Plautus Pleiades Pleistocene Plexiglas Pliny Pliocene Plutarch Pluto Plymouth Pocahontas Pocono/S Podolsk Poe Pogonia Pogorelich Poincare Poindexter Poisson Polack Poland/M Polanski Polaris Polaroid Polje Polk Pollack Pollard/M Pollini Pollux Pollyanna Polska Poly Polycarp Polyhymnia Polynesia/M Polynesian Polyphemus Polys Pomerania Pomeranian Pomona Pompeii Pompey Ponce Ponchartrain/M Pondo Pondoland Pons Pontiac Pontic Poole/M Popek/MS Popov Popp Popsicle/S Porson Porte/M Portia Portland Porto Portsmouth Portugal Portuguese Poseidon Posen Positif Posner/M Potemkin Potomac Potsdam Pottawatomie Potts Poughkeepsie Poulenc Poussin/S Powell Powhatan Poynting/M Pradesh Prado Praesepe Praetorian Prague Prakrit Pratt Prattville Pravda Precambrian Prentice/DG Presbyterian Presbyterianise/S Presbyterianism Presbyterianize/S Prescott Presley Pressburg Preston/M Pretoria Pretorian Pretre Preussen Previn Prey Priam Priapus Price Priestley Prime's Princeton Principe Principia Priscian Priscilla Pritchard/M Procne Procrusteanise/S Procrusteanize/S Procrustes Procter/M Procyon Prokofieff Prokofiev/M Prokopyevsk Promethean Prometheus Proserpine/M Proterozoic Protestantise/S Protestantism Protestantize/S Protista Protophyta Proust Provence Provincetown Proxmire Prunella Prussia Prussian Prussianisation/MS Prussianise/DGRSZ Prussianism Prussianization/MS Prussianize/DGRSZ Pskov Psoralea Ptolemaic Ptolemaist Ptolemaists Ptolemy Puccini Puerto Pugh Pulaski Pulitzer Pullman/S Pullmanise/S Pullmanize/S Punic Punjab/M Punjabi Puppis Purbeck Purcell Purdue Purina Puritanise/RSZ Puritanize/RSZ Pusan/M Pusey/M Puseyism Putnam/M Pygmalion Pyhrric Pyle/M Pyongyang/M Pyotr/M Pyrex Pyrrhus Pythagoras Pythagorean/S Pythagoreanise/S Pythagoreanism Pythagoreanize/S Pythia Pythian QA QED QM Qatar/M Quadragesima Quakeress Quakerisation/MS Quakerise/S Quakerization/MS Quakerize/S Quantico Quasimodo Quassia Quebec Queenborough Queensland/M Queenstown Quezon/M Quichua Quimper Quinn/M Quinquagesima Quirinal Quirites Quito/M Quivar Quixote Quixotism RCA RCS RFI RI RISC RMS RNA ROM ROTC RPM RSVP RSX RTT Rabat/M Rabelais Rabelaisian Rabi Rabia Rabin/M Rachel Rachmaninoff Racine Rackham Radcliffe Radetzky Radnorshire Rae/M Rafael Rafferty/M Rafflesia Ragusan Raia Raimondi Rajive/M Rajput Raleigh Ralph/M Ralston Rama Ramada Raman/M Rambouillet Rameses Ramirez Ramo/M Ramona Rampal Ramsey Rand Randall Randolph Randova Randy/M Rangoon Ranier/M Ranki Rankin/M Rankine Raoul Rapallo Raphael Raphia Rapunzel Raritan/M Rasmussen Rastafarian Rastus Ratfor Rattle Raul/M Rauwolfia Ravel Rawlings Rawlins Rawlinson Rawson Rayburn Rayleigh Raymond Raymondville Raytheon Rea Reagan Rebecca Rebozo Recife/M Recklinghausen Redbridge Redemptorist Redford/M Redgrave Redhook Redmond/M Redondo/M Redstone Reedville Reese Regensburg Regina Reginald Regis Regulus Rehoboam Reich Reichenberg Reichsrat Reichstag Reid/M Reilly Reiner Reinhard Reinhardt Reinhold Remblai Rembrandt Reme Remex Remington Remus Remy Rena/M Renardy Renault/M Renaults Rene/M Renee/M Renfrew Renoir Rensselaer/M Rensselaerite Renville Resnik Respighi Reub/M Reuben Reunion Reuters Reuther Rev Rex Reykjavik/M Reynolds Rhadamanthus Rhaetian Rhaetic Rhea Rheims Rheinholdt Rheinland Rhemish Rhenish Rhine Rhineland Rhinelander Rhoda/M Rhode Rhodes Rhodesia Rhodesian Rhodesoid Rhodian Rhodope Rhonda Rica Rican/S Ricanism Ricci Ricciarelli Richard/MS Richardson Richey Richfield Richland Richmond Richter Rick/M Rickenbaugh Rico Ridgefield Ridgway Riemann Riemannian Riesling Riga Rigel/M Riggs Rigsdaler Rijeka Rijksdaaler Rijn Rijswijk Riksdag Riley Rilke Rimini Rimsky Rinehart Rio Riordan/M Ripley Ripuarian Riss Ritchie/M Ritter Ritz Rivera Riverview Riviera Riyadh Roanoke Robbie Robbins Robert/MS Roberta Roberto Robertson/S Robeson Robespierre Robinson/M Robinsonville Robson Rocco Rochberg Rochdale Rochelle Rochester/M Rochford Rockaway/S Rockefeller Rockford Rockhampton Rockingham Rockland Rockville Rockwell Rodgers Rodin Rodney/M Rodrigo Rodriguez Rodzinski Roethke Roger/MS Rojak Roland Rolf Rollie Rollins Rollo Roma Romagna Romaic Romains Romaji Roman/MS Romanes Romanesque Romania Romanic Romanisation/MS Romanise/DGRSZ Romanism Romanist Romanization/MS Romanize/DGRSZ Romano Romanov Romansch Romany/S Romberg Rome Romeldale Romeo/S Romero/S Romish Rommel Romney Romulus Ron Ronald Roncesvalles Ronin Ronnie Ronsard Rooney Roosevelt/M Rooseveltian Roquemore Rorschach Rosa Rosabelle Rosalie Rosalind Roseland Rosella Rosen Rosenberg Rosenblum/M Rosenthal/M Rosenzweig/M Rosetta Rosicrucian Rosie Ross Rossi Rossini Rostov Rostropovich Roswell Rotarian/S Roth Rotherham Rothermere Rothesay Rothschild/M Rotterdam Rouault Roubaix Roumania Rourke Rousseau/M Roussillon Routemarch Rowan Rowbotham Rowe/M Rowena/M Rowicki Rowland/M Rowlandson Rowley/M Roxburgh Roxbury/M Roxy/M Roy/M Royce Royden Rozelle/M Rozhdestvensky Rubaiyat Ruben/M Rubens Rubenstein Rubicon Rubin/M Rudesheimer Rudolf/M Rudolph/M Rudy Rudyard/M Rufus Ruhr Rumania Rumanian/S Rumford Rummel Rumpelstiltskin Rundstedt Runge Runnymede Runyon Rupert Ruppert Rurik Ruritania Rushmore Ruskin Russ Russell Russia Russian/MS Russianisation/MS Russianised Russianises Russianising Russianization/MS Russianized Russianizes Russianizing Russky Russo/M Russophile Russophobe Rutgers Ruth Ruthenian Rutherford Rutherfordium Ruthful/PY Rutland Rutledge Rutter Rwanda/M Ryan Rybinsk Rydberg/M Ryder Ryswick Ryukyu Ryurik Rzewski SC SCCS SCM SCSI SD SE SIAM SIDS SIGABRT SIGALRM SIGBUS SIGCHLD SIGCLD SIGCONT SIGEMT SIGFPE SIGHUP SIGILL SIGINT SIGIO SIGIOT SIGKILL SIGPIPE SIGPROF SIGQUIT SIGSEGV SIGSTOP SIGSYS SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR SIGVTALRM SIGWINCH SIGXCPU SIGXFSZ SIMD SMSA/MS SMTP SNCC SNOBOL SOS SPSS SSE SST SSW STOL SUNY SW Saadi Saar Saarinen Saarland Sabaean Sabaoth Sabbatarian Sabbathise/S Sabbathize/S Sabellian Sabina/M Sabine Sachs/N Sackville Sacramentarian Sacramento Sadducee Sadie Sadler/M Saens Safar Safi Saginaw Sagittarius Sahaptin Sahara Saharan Saigon Saint Saintpaulia Saiva Sakai Sakharov Sakyamuni Sal Salem Salerno Salesian Salford Salian Salicornia Salina/M Salisbury Salish Salk Salle Sallinen Sally/M Salminen Salol Salonen Salpa Salpiglossis Salton Salvador Salvadoran Salvatore Salvia Salz/M Salzburg Sam/M Samaritan Samarkand Sambo Samian Sammy/M Samnite Samoa Samoan Samoyed Sampson Samson Samuel/S Samuelson San Sana Sanborn/M Sanchez Sancho Sanctus Sandburg Sanderling Sanderson Sandhurst Sandia Sandra Sandringham Sandusky Sandwich Sanford Sanforized Sanger Sangh Sangraal Sanhedrin Sanjak Sankhya Sanskrit Sanskritic Sanskritise Sanskritize Santa Santayana Santee Santiago Santo/S Sao Sappho/M Sara Saracen/MS Sarah Sarajevo Saran Sarangi Saransk Sarasota Saratoga Saratov Sard Sardinia/M Sardinian Sardis Sardius Sardou Sarge/M Sargent Sargodha Sargon Sark Sarkis Sarracenia Sarsen Sartre Saschowa Saskatchewan Sassanid Sassenach Satan Satanism Satanist Satie Satsuma Saturday/MS Saturn Saturnian Saturnism Satyanarayanan/M Saud Saudi Sauerbaum Saukville Saul/M Sault Saunders Savannah Saviour Savonarola Savoy Savoyard/S Sawney Saxe Saxon/S Saxonisation/MS Saxonise/S Saxonization/MS Saxonize/S Saxony Saxton Scala/M Scandian Scandinavia Scandinavian/S Scarborough Scarlatti/M Scarsdale/M Schaefer Schaeffer Schaerbeek Schafer Schaffhausen Schaffner Schantz Schapiro Scheherazade/M Scheherezade Schein Schelling Schenck Schenectady Schiedam Schiff Schiller/M Schippers Schleiermacher Schlesien Schlesinger/M Schleswig Schliemann Schlitz Schloss Schmidt Schmitt Schnabel/M Schnecken Schneider Schnitzler Schoenberg/M Schofield/M Schopenhauer Schottky/M Schroeder Schroedinger Schubert Schultz Schulz Schumacher Schuman Schumann Schuster Schuyler/M Schuylkill Schwab Schwartz Schwarz Schwarzkopf Schweitzer/M Sci Scimone Scleroderma Scofield Scopus Scorpio Scorpius Scot/S Scotchgard Scotchman Scotia Scotian Scotism Scotland/M Scotsman Scotsmen Scotswoman Scott Scotticism Scottish Scotto Scottsdale Scotty Scranton Scriabin Scribners Scripps Scylla Scythia Scythian Seabee Seaborg Seabrook Seagate/M Seagram/M Sealyham Sean/M Seaquarium Searle Seaton Seattle/M Sebastian Sebastopol Sebring/M Secunderabad Sedgemoor Sedgwick Seebeck Seeger Seeland Seeley Segovia Segundo Seidel Seidlitz Seifert Selectric Selena/M Selene Seleucid Selfridge Selig Seljuk Selkirk/M Selma Selwyn/M Seminole Semipalatinsk Semite Semiticise/S Semiticize/S Semitics Semitisation/MS Semitise/S Semitization/MS Semitize/S Seneca Senechal Senegal Senlac Senora Seoul Sep Sephardi Sepoy September/MS Septembrist Septuagint Serafin Serapis Serb Serbia/M Serbian Serbo Sergei/M Serkin Serpens Serra Seth/M Seton Sevastopol Severn/M Severnaya Severus Seville Seward Sexagesima Sextans Seychelles Seymour Shaban Shabuoth Shackleton Shafer/M Shaffer/M Shaka Shakespeare Shakespearean Shakespearian Shakespearise/S Shakespearize/S Shakta Shakti Shang Shanghai/G Shankar Shankaracharya Shannon Shantung Shapiro Shari/M Sharia Sharon Sharpe Shasta Shattuck/M Shavian Shaw Shawano Shawnee Shawwal Shchedrin Shcheglovsk Shcherbakov Shea Sheboygan Shechem Shedir Sheehan/M Sheffield/RZ Sheila Shekinah Shelby Sheldon Shelley Shelton Shemite Shemitic Shenandoah Sheol Shepard Sheppard/M Sheraton Sheri/M Sheridan Sherman Sherpa Sherrill/M Sherrington Sherwin Sherwood Shetland Shiah Shiism Shiite/MS Shillong Shiloh Shimonoseki Shinto Shintoise/S Shintoism Shintoize/S Shipley Shiraz Shirley Shiva/M Shluh Shmuel Shoa Shockley/M Sholokhov Shona Shorewood Shoshone/M Shoshonean Shostakovich Shreveport Shrewsbury Shropshire Shrovetide Shu/M Shulamite Shulman/M Shylock Shylockian Siamese Sian/M Sibelius Siberia Siberian Sibley Sicanian Sicilian/S Siciliana Sicily Siddhartha Sidney Siegel/M Siegfried Sieglinda/M Siegmund/M Siemens Siena Sierra Sifford Siggraph Sigil Sigmund Signor Signora Sihanouk Sika Sikh/MS Sikhs Sikkim/M Sikkimese Sikorsky Silas Silures Silurian Silvanus Silverman Silverstein/M Simarouba Simbirsk Simeon Simferopol Simla Simmons Simmonsville Simms Simon Simonson/M Simpson Sims Sinai Sinaloa Sinatra Sinbad/M Sinclair Sindhi Singapore/M Singborg Singhalese Sinhalese Sinicism Sinitic Sino Sinopoli Sintow Siouan Sioux Siracusa Sirius Sisley Sistine Sisyphean Sisyphus Sitar Sitarist Sitka Siva Sivaism Sivan Siwash Sixtus Skelton Skijoring Skikda Skimmia Skippy Skipton Skokiaan Skolly Skopje Skrowaczewski Skua Skye Slatkin Slav/S Slavic Slavicise/S Slavicize/S Slavisation/MS Slavise/S Slavism Slavization/MS Slavize/S Slavkov Slavonia Slavonic Slavonicise/S Slavonicize/S Slavophile/S Slesinger Slesvig Sloan Sloane Slocum/M Slovak Slovakia/M Slovene Slovenia/M Smalley/M Smallwood Smeaton Smetana Smilax Smirnov Smithfield Smithson/M Smithsonian Smithtown Smolensk Smollett Smucker Smyrna/M Smythe Snead Sneed Snodgrass Snowbelt/M Snyder Sobranje Soc Societe Socinian Socrates Socratic Soddy Soderblom Soderstrom Sodom Soffel Sofia Sogdian Sol/Y Solenodon Solomon Solon Soloviev Solti Solutrean Solzhenitsyn Somali/S Somalia Somaliland Somerset Somerville Sommerfeld/M Sondheim Sonenberg Songhai Sonoma Sonora Sony/M Sophia/S Sophie Sophoclean Sophocles Sorbian Sorbonne Sordello Sorensen Sorenson Sorrentine Sothic Sothis Sotho Souphanourong Sousa Souslik Sousse Souterrain Southampton Southdown Southern Southernwood Southey Southfield Southport Southron Southwark Sovetsk Soviet Sovietised Sovietising Sovietized Sovietizing Soweto Soyinka Soyuz Spaak Spacewar Spafford/M Spahn Spain/M Spalding Spaniard/S Spaniardisation/MS Spaniardise/S Spaniardization/MS Spaniardize/S Spanish/M Spanishise/S Spanishize/S Sparkman Sparta Spartacus Spartan Spartanise/S Spartanize/S Spassky Spaulding/M Speakerphone Spector/M Speenhamland Spenborough Spence Spencer/M Spencerian Spengler Spenglerian Spenser Spenserian Sperry Spica/S Spiegel Spinoza Spinozism Spiro/M Spitsbergen Spitz Spivakov Spokane Sposato Sprague/M Spratly Springfield Springhaas Sproul/M Spuds Squaresville Squibb/G Sr Srbija Sri/M Stacy/M Stade Stafford Staffordshire Stagirite Stahl/M Stakhanovism Staley/M Stalin/MS Stalinabad Stalingrad Stalinism Stalinist Stalinogrod Stalinsk Stamford Stan/MS Standish/M Stanford/M Stanhope/M Stanislavsky Stanley Stanleyville Stanton Stapleton Stargate/M Starker Starkey Starr Staten Statler Stauffer Staunton Stavanger Stavropol Stearns Steber Steele/M Steen/M Stefan/M Stefansson Stegodon Stegomyia Stegosaurus Steier Steiermark Stein Steinbeck Steinbecks Steinberg Steinitz Stella Stellite Stendhal Stendler Stephan Stephanie/M Stephen/S Stephenson Stern Sternberg/M Sterno Stetson/S Steuben Steve/M Steven/MS Stevenson Stevie Stewart/M Stijl Stillson/S Stillwell Stilton Stilwell Stimson Stirling Stockhausen Stockholm Stockport Stockton Stockwood Stokowski Stokys Stone/M Stonehenge Storey/DS Storting Stouffer Stourbridge Stowe Stradivari Stradivarius Strafford Stralsund Stranraer Strasbourg Stratas Stratford Strathclyde Stratton/M Straus Strauss Stravaig Stravinsky Streisand Strelitzia Stretford Streusel Strickland/M Strindberg Stroheim Strom/M Stromberg Strongheart Strophanthus Strymon Stu Stuart Stubblefield/S Studebaker Sturbridge/M Sturm/M Stuttgart Stuyvesant Stygian Stylar Stylops Styrofoam Styx Subapically Sudan Sudanese Sudanic Sudetenland Sudra Suez Suffolk Sufi Sufism Sukarno Sullivan Sultanabad Sulu Sulzberger Sumatra Sumba Sumbawa Sumer Sumeria Sumerian Summerdale Summers Sumner/M Sumo Sumter Sunbelt/M Sunday/MS Sunderland Sunni Sunnite Sunnyvale Suomi Superman/M Surinam Suriname Sus Susan/M Susanna Susanne/M Susian Susie/M Susquehanna/M Sussex/M Susu Sutcliffe Sutherland/M Sutton/M Suvorov Suwanee/M Suwannee Suzanne/M Suzuki/M Svalbard Sverdlovsk Svetlana/M Svetlanov Swabia Swabian/MS Swadeshi Swahili/M Swanee Swansea/M Swanson Swarthmore Swarthout/M Swartz Swatow Swazi Swaziland Swede/S Sweden Swedenborg Swedenborgianism Swedish Sweeney/S Sweeny Swenson Swinburne Swink Swithin Switzer Switzerland Sybil Sydney Sykes Sylow Sylvan Sylvania Sylvester Sylvia Sylvie/M Symington Symons Synge Syracuse Syria Syriac Syrian/MS Syrianise/S Syrianize/S Syrtis Szabadka Szczecin Szechwan Szeged Szell Szerying Szeryng Szewinska Szilard Szombathely Szymanowski TA TCP TKO TN TNT TOEFL TP TRW TTL TTY TV/MS TVA TWA TWP TWX TX Tabasco Tabriz Tacamahac Tacchino Tachina Tacitus Tacoma Tadzhiki Taft Tagalog Tahiti Tahoe Tai Taichung Tainan Taino Taipei Taiping Taisho Taiwan Taiwanese Tajik Talaing Talladega Tallahassee Tallahatchie Tallahoosa Tallchief Talleyrand Talmud Talmudisation/MS Talmudise/S Talmudism Talmudist Talmudization/MS Talmudize/S Talvela Tambov Tamerlane Tamil Tammany Tammanyise/S Tammanyize/S Tampa Tamworth Tanagra Tanaka/M Tananarive Tanganyika/M Tanjungpriok Tannenbaum Tannenberg Tantalus Tanya Tanzania Tapdance Tara Tarbell/M Tardenoisian Targum Tarkington Tarnopol Tarpeia Tarpeian Tarquin Tarrytown Tartarean Tartaric Tartarus Tartary Tartuffe Tarzan Tasmania Tasmanian Tass Tatar Tatary Tate Tatum Taunton Taurus Tawney Tay Taylor/S Taylorise/S Taylorize/S Taymyr Tayra Tayside Tbilisi Tchad Tchaikovsky Te TeX/M Teal Tear Tebaldi Technicolor Technion Teddy Teflon/M Tegucigalpa/M Teheran Tehran Tektronix/M Tel Teledyne Telefunken Telegu Telemann Telescopium Telex Telford Telstar Telugu Tema Temne Tempe Templar Templeman Templeton Tenebrae Tenerife Tenex Tenneco Tennessee/M Tenney Tennstedt Tennyson Tenzi Terence Teresa Teresina Tereus Ternopol Terpsichore/M Terra Terran Terrani Terre/M Tess Tesseract Tessie Tethys Teton Teucer Teucrian Teuton Teutonic Teutonism Tewkesbury Tex Texaco Texan/S Texas/MS Textron Thai Thailand Thalia/M Thames Thanatos Thayer/M Thea/M Thebaid Thebes Thelma Themis Theodora Theodore Theodoric Theodosian Theodosius Theophilus Theresa Thermit Thermofax Thersites Theseus Thessalonian/S Thessaly Thetford Thetis Thiensville Thomas Thomism Thomistic/M Thompson/M Thomson Thor Thoreau Thornburg Thorndike Thornton Thorpe Thorstein Thorvaldsen Thrace/M Thracian Throneberry Thruway/S Thu Thuban/M Thucydides Thuja Thule Thurber Thurgau Thuringia Thuringian Thurman Thurn Thursday/MS Thyestes Tiber Tiberius Tibet Tibetan Tiburon Ticonderoga Tieck Tientsin/M Tigris Tijuana Tilburg Tilbury Tillich Tillie Tilsit Tim/MS Timex Timmy Timon Timonise/S Timonize/S Timor Timoshenko Timour Tina/M Tinseltown/M Tintagel Tioga Tippecanoe Tipperary Tippett Tirana/M Tirol Tiruchirapalli Tirunelveli Tisa Tishab Tisiphone Titanesque Titanomachy Tito/M Titograd Titoism Titus Tivoli Tjirebon Tlaxcala Tlemcen Tlingit Tmesis Tobago Tobey Tobolsk Tobruk Toby/M Tocharian Tocqueville Todd/M Togliatti Togo Togoland Tojo Tokay Tokelau Tokharian Tokoloshe Tokugawa Tokyo Tolan Toland Tolbert Toledo Tolima Tolkien Toller Tolley Tolly Tolstoy Toltec Toluca Tom/M Tombigbee Tome Tomlinson/M Tommie Tomowa Tompkins Tomsk Tonbridge Tonga Toni Tonio Tonka Tonkin Toomey Topeka Tophet Topsy Torah Toronto Torquemada Torrance/M Torricellian Torsk Tory/S Toryise/S Toryize/S Tosca/M Toscanini/M Toshiba/M Toto Toulouse Tourel Townley Townsend Townsville Towsley Toynbee Toyota Tractarianism Tractarians Tracy Transcaucasia Transite/M Transputer Transvaal/M Transylvania/M Transylvanian Trappist Travis Treadwell Treblinka Trent Trenton Trevelyan Trevino Treviso Trevor Triangulum Trianon Triassic Trichinella/M Tridentine Trimble Trinidad Trinil Tripitaka Triplett/M Tristan Triticum Trobriand Trojan Tromelin Trondheim Tropez Trotsky Troutman Trowbridge Troy Troyanos Truckee Trudeau/M Trudy Truffaut Trujillo Truk Truman Trumbull Truro Tsunematsu Tuamotu Tuareg Tucana Tucker Tuckwell Tucson Tudor Tue Tuesday/MS Tulane Tulsa Tunbridge Tungus Tungusic Tunis Tunisia Tunisian Tupi Turanian Turco Turin Turing/M Turkey Turki Turkic Turkise/S Turkish Turkism Turkize/S Turkmen Turkoman Turks Tuscaloosa Tuscan Tuscanise/S Tuscanize/S Tuscany Tuskegee Tutankhamen Tutenkhamon Tuttle Tuvalu Twelfthtide Twi Twickenham Twombly/M Tyburn/M Tyche Tyler Tylerise/S Tylerize/S Tynwald Typhon Tyrannosaurus/M Tyrian Tyrol Tyrolienne Tyrone Tyrr Tyrrhenian Tyson Tzeltal UART UCLA UHF UK UN UNESCO UNIX/M USA USAF USART USC/M USDA USG/M USGS USIA USN USPS USSR UT UV Ubangi Ubiquitarian Udall Ude Uganda Ugrian Ugric Uhland Uhuru Uigur Uinta Uitlander Ujamaa Ujiji Ujjain Ujung Ukase Ukiyoe Ukraine/M Ukrainian/S Ulan Ulbricht Ullman Ullswater Ulm Ulsterman Ultrix/M Ulyanovsk Ulysses Umbrian Umbriel Unalaska UniPlus/M UniSoft/M Uniat Unibus Union Uniroyal Unisys Unitarianise/S Unitarianize/S United Univac Unix/M Upton Ural Uralic Urania Uranian Uranus Urbana Urdu Uredo Uri/S Uriah Uriel Urmston Urnfield Urquhart Ursa Ursula Ursuline Uruguay Usenet/M Usenix/M Ustinov Utah/M Utica Utopianise/S Utopianize/S Utrecht/M Uxbridge Uzbek Uzi/M VA VAC VAG VAR VAX VCR VDU VGA VHF VLF VLSI VMS/M VT VTOL Vaal Vaasa Vaduz Vail Vaishnava Valencia Valenciennes Valentinian Valerie Valery/M Valhalla Valjakka Valkyrie Valletta/M Valois Valparaiso Vance Vancement Vancouver Vanda Vandenberg Vanderbilt Vanderburgh Vanderpoel/M Vandyke Vanessa/M Vanir Vanuatu Varady Varangian Varga Varian Varitype/M Varityping Varuna Vaseline Vasquez/M Vassar/M Vatican Vaticanisation/MS Vaticanise/S Vaticanism Vaticanization/MS Vaticanize/S Vaudois Vaughan/M Vaughn Vax/M Veasy Veblen Veda/M Vedalia Vedanta Vedda Veddoid Vedernikov Vedic Vega/S Veganism Velasquez Vella/M Velsen Venda Veneti Venetia Venetian/MS Venetic Veneto/M Venezia Venezuela Venezuelan Venice Venizelos Venn Venora Ventura/M Venus Venusberg Venusian/S Vera Veracruz Verde/M Verderer Verdi/M Vergil Verlag Vermont Vern Verna/M Verne Vernoleninsk Vernon Verona Veronal Veronese Veronica Verrett Versailles Versatec/M Vertumnus Vesuvius Vic/M Vichy/M Vickers Vickie/M Vicksburg/M Vicky/M Victoria/M Victorian/S Victorianise/S Victorianize/S Victrola/MS Vida/M Vidal/M Vienna/M Viennese/M Vientiane/M Vierne Viet Vietcong Vietminh Vietnam/M Vietnamese/M Vietnamisation Vietnamise/DGS Vietnamization Vietnamize/DGS Vihuela Viipuri Vijayawada Viking/S Vikram Vilayet Villach Villahermosa Villainage Villanovan Villars Villeneuve Villeurbanne Villiers Villon Vilnius Viminal Vince Vincennes Vincent/M Vinci/M Vindhya Vineland Vinland Vinson Virchow Virgil/M Virginia/M Virginian/S Virgo/MS Visakhapatnam Visayan Visby Visconti Viseu Vishakhapatnam Vishinsky Vishnu Visigoth Visigoths Vitebsk Vito/M Vitus Vivaldi Vivian Vizagapatam Vizcacha Vizsla Vlaardingen Vlach Vladikavkaz Vladimir Vladivostok Vlaminck Vlei Vlissingen Vltava Voetsek Voetstoots Vogel Vogelweide Vogul Vol Volans Volapuk Volga Volgograd Volkswagen/S Volsci Volscian Volstead Volta Voltaire Volterra/M Volvo Von Vorarlberg Voronezh Voroshilov Voroshilovgrad Voroshilovsk Vortumnus Voss Votyak Vought/M Vouvray Vreeland/M Vries Vuelta Vulcan Vulcanism Vulcanite Vulpecula Vyatka Vyshinsky Vyvyan WA WAAC WAAF WAC WFF WI WV WWW WY Waals Waart Wabash Waco Waddenzee Waddington Wade/M Wadsworth/M Wagner Wagnerian Wagnerise/S Wagnerize/S Wahhabi Wahl/M Waikato Waikiki Wainwright Waite/M Wajda Wakashan Wakayama Wakefield Wakerife Waksman Walach Walachia Walbridge Walbrzych Walcheren Walcott Waldemar Walden Waldenburg Waldensian Waldgrave Waldheim Waldo Waldorf Waldron/M Waley Walford Walgreen Wallace Wallachia Wallenstein Wallis Walloon Wallsend Wally/M Walpole Walpurgis Walsall Walsh Walsingham Walt/RZ Waltham/M Walther Walton Walvis Walworth Wand Wandsworth Wang Wansee Wansley Wapentake Wappenshaw Wappinger/M Waragi Warangal Warbeck Warburton Ward Warfarin Warfield/M Warhol Warison Warley Warnock/M Warren Warrington Warsaw/M Wartburg Warwick/M Warwickshire Wasatch Washburn Washington/M Washoe Wasserman Watanabe/M Waterbury Waterford Watergate Waterhouse Watertown Watford Watkins Watling Watson/M Watteau Wattenberg Wattenscheid Watterson Watts Watusi Waugh Waukesha Waunona Waupaca Waupun Wausau Wauwatosa Waveland Wayland Wayne Waynesboro Weatherford Webb/M Webber Webern Webster/M Websterville Wedgwood Wednesday/MS Wehr/M Wei/M Weibull/M Weider Weidman Weierstrass Weigela Weikert Weikl Weill Weimar Weinberg Weiner Weinstein Weisenheimer Weismannism Weiss Weisshorn Weissman Weissmuller Weizmann Welch/RS Weldon Weldwood Weller Welles Wellesley Wellingborough Wellington Wellingtonia Wellman Wellsville Welmers Welsbach Welshman Welton Welwitschia Wembley Wenceslaus Wendell Wendish Wendy Wenkel Wensleydale Wentworth Werner Werther/M Wesley Wesleyan Wesson Westbrook Westchester Westernism Westfalen Westfield Westhampton Westinghouse Westmeath Westminster Westmore Westmorland Weston Westphalia Westport Westwood Wetterhorn Wexford Weyerhauser Weymouth Whalen/M Wharton Whatley/M Wheatland Wheaton Wheatstone Wheelock Whelan Wheller Whikehart Whippany Whipple Whitaker/M Whitcomb White Whiteboy Whitechapel Whitefield Whitehall Whitehorse/M Whiteleaf Whiteley Whitewater Whitfield Whitlam Whitley Whitlock Whitlow Whitman Whitmanise/S Whitmanize/S Whitney Whitsun Whitsuntide Whittaker Whittier Whittington Wichita Wickersley Wickliffe Wicklow Widor Wieland Wiesbaden Wiggins Wightman/M Wigner Wigtown Wijngaarden Wilberforce Wilbur/M Wilcox Wiley Wilfred Wilhelm Wilhelmina Wilkes Wilkie/M Wilkins Wilkinson Willa/M Willamette Willard Willcocks Willcox Willem William/S Williamsburg Williamson Willie/DS Willis Willisson/M Willoughby Willy/DS Wilma Wilmette Wilmington Wilshire Wilson/M Wilsonian Wilton Wiltshire/M Wimbledon Wimshurst Winceyette Winchell Winchester Winchesters Winckelmann Windsor Winehead Winfield Winifred Winnebago Winnetka Winnie Winnipeg Winograd Winooski Winsborough Winsett Winslow Winston Winthrop Wisconsin/M Wiseman Wisenheimer Witherspoon Witt/M Wittenberg Wittgenstein/M Witwatersrand Wixell Wobbegong Wodehouse Woden Woking Wokingham Wolcott Wolds Wolfe/M Wolff/M Wolffian Wolfgang Wolfram Wolfsburg Wollongong Wolof Wolverhampton Wolverton Wong/M Woodard Woodberry Woodbury Woodlawn Woodrow Woodsia Woodstock/M Woodward/S Woody/M Woolworth Woomera Woonsocket Wooster Worcester Worcestershire/M Wordsworth Worthington Wotan/M Wotton Woulfe Wraac Wrexham Wrigley Wronskian Wu/M Wunderlich Wyatt/M Wycliffite Wyeth/M Wykeham Wylie/M Wyman Wynn/M Wyoming XOR Xanthus Xavier Xenakis Xenia Xenix/M Xeres Xerox/M Xeroxed Xeroxes Xeroxing Xerxes Xhosa Xmas YMCA YWCA Yablonovy Yahoo Yahweh Yakima Yakut Yakutsk Yale Yalies Yalta Yalu Yamaha/M Yangtze Yankee/S Yankeeism Yankton/M Yaounde/M Yaqui Yarborough Yarkand Yarmouth/M Yaroslavl Yashmak Yates Yeager Yeats Yekaterinburg Yekaterinodar Yekaterinoslav Yelisavetgrad Yelisavetpol Yelizaveta Yellowknife/M Yellowstone/M Yemen Yenisei Yentl/M Yerba Yerkes Yevtushenko Yid Yiddish Yoknapatawpha Yokohama Yonkers Yorick York/MRSZ Yorke Yorkist/S Yorkshire/M Yorktown Yoruba Yosemite Yoshihito Yost/M Youngberry Youngstown Younker Ypres Ypsilanti Yquem Yresko Ysaye Yser Yseult Yssel Yuba Yucatan Yuga Yugoslav Yugoslavia Yukawa Yukon Yuman Yurev Yuri Yurlov Yuzovka Yves Yvette Zaandam Zabrze Zacatecas Zaccaria Zacharias Zachary Zagreb/M Zaibatsu Zaire Zakai Zakuski Zambezi Zambia/M Zamboanga Zamenhof Zamia Zan/M Zanasi Zanthoxylum Zanzibar Zapotec Zealand/M Zeebrugge Zeeland Zeeman Zeffirelli Zeiss Zellerbach Zemstvo Zen Zend Zennist Zenobia Zepperitz Zermatt Zetland Zeus/M Zhdanov Zhitomir Zhivkov Zho Zhukov Ziegfeld/MS Ziegler/M Ziggy Zimbabwe Zimmerman/M Zindabad Zinman Zinovievsk Zinzendorf Zion/MS Zionism Zionist/MS Zoa Zoe/M Zorn Zoroaster Zoroastrian/S Zoroastrianism Zouave Zoysia Zuider Zuidholland Zukerman Zulu/MS Zurich/M Zwilich aardvark/MS aardwolf ab abac abaca aback abacterial abactinal abacus/S abadan abaddon abaft abakan abalone/MS abamp abampere abandon/DGRS abandonee abandonment/S abase/DGRS abasement/S abash/DGS abashed/U abashment abate/DGRS abated/U abatement/S abatis/S abator abattoir abaxial abbacy abbas abbasid abbatial abbe abberation/S abbess abbey/MS abbot/MS abbreviate/DGNSX abbreviated/AU abbreviator abcoulomb abdias abdicable abdicate/DGNS abdicator abdomen/MS abdominal/Y abdominous abduce/DG abducens abducent abducentes abduct/DGS abduction/MS abductor/MS abeam abecedarian abed abednego abeokuta aberdare aberrance aberrancy aberrant/Y aberrated aberration/S aberrational abet/S abetment abetted abetter abetting abettor abeyance abeyant abfarad abhenry abhor/S abhorred abhorrence abhorrent/Y abhorrer abhorring abib abidance abide/DGRS abiding/Y abietic abilene abilities/I ability/MS abingdon abiogenesis abiogenetic abiogenetical/Y abiogenist abiological/Y abiotic abiotically abirritant abirritate abject/PY abjection/S abjuration abjure/DGRS abkhaz ablactation ablate/DGNSV ablative/Y ablator ablaut ablaze able/RT abloom abluted ablution/S ablutionary ably abnegate/NS abnegator abnormal/Y abnormalise/S abnormality/S abnormalize/S aboard abode/MS abohm aboideau aboil abolish/DGRSZ abolishable abolishment/MS abolition abolitionary abolitionise/S abolitionism abolitionist/S abolitionize/S abomasal abominable abominably abominate/DGNSX abominator/S aboral/Y aboriginal/Y aborigine/MS aborning abort/DGRSV aborticide abortifacient abortion/MS abortionist/S abortive/PY aboukir aboulia abound/DGS about above aboveboard aboveground abovementioned abracadabra abradable abradant abrade/DGRS abranchiate abrasion/MS abrasive/PSY abreact abreaction/MS abreast abri abridge/DGRS abridged/U abridgement abridgment abrin abroach abroad abrogate/DGNS abrupt/PY abruption abruzzi abscess/DS abscise/DG abscisin abscissa/MS abscissae abscission abscond/DGRS abseil absence/MS absent/DGSY absentee/MS absenteeism absentia absentminded/PY absinth absinthe absinthism absolute/NPSY absolutisation/MS absolutise/S absolutism absolutist absolutistic absolutization/MS absolutize/S absolve/DGRS absonant absorb/DGRS absorbability absorbable absorbance absorbancy absorbant absorbefacient absorbency absorbent/MS absorbing/Y absorbtions absorptance absorption/MS absorptional absorptive absorptivity absquatulate abstain/DGRS abstemious abstemiously abstention/S abstentious abstergent abstinence abstinent/Y abstract/DGPRSVY abstractable abstracted/PY abstraction/MS abstractional abstractionism abstractionist/S abstractor/MS abstrict abstriction/S abstruse/PY abstruseness/S abstrusity absurd/PY absurdism absurdist absurdity/MS absurdum abubble abuilding abukir abulia abundance/S abundant/Y abusable abuse/DGRSVZ abusive/PY abut/S abutilon abutment/S abuttal/S abutted abutter/MS abutting abuzz abvolt abwatt aby abydos abysm abysmal/Y abyss/MS abyssal acacia academe academia academic/S academical academically academician academicianship academicism academism academy/MS acajou acanthaceous acanthine acanthocephalan acanthoid acanthopterygian acanthous acanthus/S acariasis acarid acaroid acarology acarpellous acarpelous acarpous acas acatalectic acaudal acaulescence acaulescent accad accede/DGS accelerando accelerate/DGNSVX accelerated/U accelerating/Y accelerator/S accelerometer/MS accent/DGS accentless accentor accentual/Y accentuate/DGNS accept/DGRSVZ acceptability/U acceptable/P acceptably/U acceptance/MS acceptant acceptation accepted/Y accepting/PY acceptor/MS access/DGS accessary accessibility/I accessible/IU accessibleness accessibly/I accession/MS accessional accessorial accessorise accessorize accessor/S accessory/MS acciaccatura accidence accident/MSY accidental/PY accidentalism accidentalist accidie accipiter accipitrine acclaim/DGRS acclamation acclimate/DGNS acclimatisable/S acclimatisation/AS acclimatise/GRSZ acclimatised/U acclimatises/A acclimatizable/MS acclimatization/AMS acclimatize/GRSZ acclimatized/U acclimatizes/A acclivity accolade/S accommodate/DGNSVX accommodated/U accommodating/Y accommodational accommodative/P accommodator/S accommodatory accompanied/U accompaniment/MS accompanist/MS accompany/DGRS accompanyist/S accomplice/S accomplish/DGRSZ accomplishable accomplished/U accomplishment/MS accord/DGRSZ accordance/S accordant/Y according/Y accordion/MS accordionist/S accost/DGS accostable account/DGJS accountability/S accountable/P accountably/U accountancy accountant/MS accountantship accounted/U accouplement accouter/DGS accouterment/MS accoutre/DGS accoutrement/MS accredit/D accreditable accreditation/S accrescent accrete/DGV accretion/MS accretionary accruable accrual/S accrue/DGS accruement acculturate/DGNSV acculturational acculturationist acculturise acculturize accumbency accumbent accumulable accumulate/DGNSVX accumulative/PY accumulator/MS accuracy/IS accurate/PY accurately/I accurse/DGS accursed/PY accursing/Y accurst accusal accusation/MS accusative accusatory accuse/DGRSZ accusing/Y accusor/S accustom/DGS accustomation accustomed/P accutron ace/DGMRS acedia acellular acentric acephalous acerate acerb acerbate acerbic acerbically acerbity acerose acervate/NY acescent acetabulum acetal acetaldehyde acetamide acetaminophen acetanilide acetate acetic acetify/NR acetometer acetone acetonic acetonisation/MS acetonise/S acetonization/MS acetonize/S acetophenetidin acetous acetum acetyl acetylate/NV acetylcholine acetylene acetylenic acetylide acetylsalicylic achaea ache/DGS achelous achene acheron acheulian achievable/U achieve/DGRSZ achieved/U achievement/MS aching/Y achlamydeous achlorhydria achondrite achondroplasia achromat achromatic achromatically achromaticity achromatin achromatisation achromatise/DGS achromatism achromatization achromatize/DGS achromatous achromic achy/PRT acicula aciculate aciculum acid/PSY acidhead acidic acidiferous acidifiable acidify/NR acidimeter/MS acidimetric acidimetry acidise/S acidity/S acidize/S acidometer acidophil acidophilus acidosis acidulant acidulate/N acidulent acidulous acierate acinaciform aciniform acinus ackee acknowledge/DGRSZ acknowledgeable acknowledged/Y acknowledgement/AMS acknowledgement/MS acknowledgment/AMS acl aclinic acme acne/D acnode acock acol acold acolyte/S aconcagua aconite acorn/MS acotyledon acouchi acoustic/S acoustical/Y acoustician acquaint/DGS acquaintance/MS acquaintanceship acquainted/AU acquiesce/DGS acquiescence acquiescent/Y acquirable acquire/DGS acquirement acquisition/MS acquisitional acquisitionist acquisititious acquisitive/Y acquisitiveness acquit/S acquitment acquittal/S acquittance acquitted acquitter acquitting acre/MS acreage acrid/PY acridine acridity acriflavine acrilan acrimonious/Y acrimony acrobacy acrobat/MS acrobatic/S acrobatically acrocarpous acrocentric acrodont acrodrome acrogen acrolein acrolith acromegaly acromion acronym/MS acronymic acronymically acronymise/S acronymize/S acropetal/Y acrophobia acrophobic acropolis acrospire across acrostic acrostical/Y acroter acrylamide acrylate acrylic acrylonitrile acrylyl act/ADGSV acta actability actable actin actinal actinic actinide actinidin actiniform actinium actinochemistry actinoid actinolite actinomere actinometer/MS actinomorphic actinomycete actinomycin actinomycosis actinon actinopod actinotherapy actinouranium actinozoan action/AMS actionable actionably actionise/S actionize/S actionless actions/AI activate/DGNSX activation/AI activator/MS active/APY actively/AI activise/S activism activist/MS activistic activity/MS activize/S actomyosin actor/AMS actorish actress/MS actual/SY actualisation/AMS actualise/DGS actualises/A actuality/S actualization/AMS actualize/DGS actualizes/A actuarial/Y actuaries actuary/S actuate/DGNS actuator/MS acuity aculeate aculeus acumen acuminate/N acupuncture acutance acute/PRTY acyclic acyclical acyclically acyl acylate/DS ad/AS adactylous adage/S adagio/S adamance adamancy adamant/Y adamantine adamawa adamsite adana adapt/DGRSVZ adaptability adaptable/U adaptably adaptaplex adaptation/MS adaptational/Y adapted/P adapting/A adaption adaptitude adaptive/PY adaptivity adaptor/S adaxial add/DGRSZ addable addax addend addenda addendum addible addict/DGSV addiction/MS addition/MS additional/Y additive/MSY additivity addle/DGS addlepated address/DGRSZ addressability addressable addressee/MS addressor adduce/DGRS adducible adduct/DGSV adduction adductor ademption adenectomy adenine adenitis adenocarcinoma adenohypophysis adenoid/S adenoidal adenoidectomy adenoma adenomatous adenosine adenovirus adept/PSY adequacy/IS adequate/IPY adhere/DGRSZ adherence/S adherend adherent/MSY adhesion/S adhesional adhesive/MPSY adhibit adiabatic adiabatically adiabaticlly adiaphorism adiaphorous adiathermancy adieu adieux adios adipic adipocere adipose adiposity adit adivasi adjacency adjacent/Y adject adjectival/Y adjective/MSY adjoin/DGS adjoint adjourn/DGS adjournment adjudge/DGS adjudicate/DGNSVX adjudication/MS adjudicator adjudicatory adjunct/MSVY adjunction adjuration adjuratory adjure/DGS adjust/DGRSVZ adjustability adjustable/AU adjustably adjusted/AU adjustment/MS adjustmental adjustments/A adjustor/MS adjusts/A adjutancy adjutant/S adjuvant adle adman admass admeasure admeasurement admetus adminicle administer/DGJS administrable administrant administrate/DGS administration/MS administrational administrationist administrative/Y administrator/MS administratrix admirability admirable/P admirably admiral/MS admiralty admiration/S admire/DGRSZ admiring/Y admissibility/I admissible/I admission/MS admissive admit/S admittance admitted/Y admitter/S admitting admix/DS admixture admonish/DGRS admonishing/Y admonishment/MS admonition/MS admonitorily admonitory adnate adnominal adnoun ado adobe adolescence adolescent/MSY adopt/DGRSVZ adoptability adoptable adopted/U adoptee/S adoptianism adoptianist adoption/MS adoptionism adoptionist adoptive/Y adorability adorable/P adorably adoration adore/DGRS adorn/DGS adorned/U adornment/MS adowa adoze adposition adrastus adrenal/Y adrenalin adrenaline adrenalise/S adrenalize/S adrenergic adrenocortical adrift adroit/PY adscititious adscription adsorb/DGS adsorbability adsorbable adsorbate adsorbent adsorbtion adsorption adsorptive/Y adsuki adularia adulate/GNX adulator adulatory adult/MPSY adulterant adulterate/DGNS adulterated/U adulterator adulterer/MS adulteress/S adulterine adulterise/S adulterize/S adulterous/Y adultery adulthood adultlike adumbral adumbrate/DGNSV adumbrative/Y adust aduwa advance/DGRSZ advancement/MS advantage/DGS advantageous/PY advection/S advective advent/V adventist/S adventitia adventitious/PY adventive/Y adventure/DGRSZ adventuresome/P adventuress/S adventurism adventurist/S adventuristic adventurous/PY adverb/MS adverbial/Y adverbialise/S adverbialize/S adversarial adversary/MS adversative/Y adverse/DGSY adversity/S advert/DGS advertence advertency/I advertent/Y advertise/DGRSZ advertisement/MS advice advisability/I advisable/P advisably advise/DGRSZ advised/UY advisee/MS advisement/S adviser/MS advisor/MS advisory advocacy advocate/DGNSV advocator adygei adynamia adynamic adytum adz adze adzhar adzuki aeciospore aecium aedile aegis aegospotami aegrotat aegyptus aeneous aeolian aeolotropic aeolotropy aeon/MS aeonian aeonic aeonism/MS aerate/DGNS aerator/S aerial/MSY aerialist aerie/R aerily aero aeroacoustic aeroballistic/S aerobatic/S aerobe aerobic/S aerobically aerobiological/Y aerobiology aerobiosis aerobiotic aerobiotically aerodonetics aerodrome aerodynamic/S aerodynamical/Y aerodynamicist aerodyne aeroembolism aerofoil/S aerogel aerogene/S aerogram/MS aerographer aerography aerolite aerolith aerolitic aerological aerologist aerology aeromagnetic/S aeromechanic/S aeromedical aeromedicine aerometeorograph aerometer/MS aerometry aeronaut aeronautic/S aeronautical/Y aeroneurosis aeronomer aeronomic/S aeronomical aeronomist aeropause aerophagia aerophobia aerophyte aeroplane/MS aeropropulsion aerosol/S aerosolisation aerosolise/D aerosolization aerosolize/D aerospace aerosphere aerostat aerostatic/S aerostation aerothermodynamic/S aery/R aesthesia aesthesiometer/MS aesthesis aesthete/S aesthetic/MS aesthetical aesthetically/U aesthetician aestheticise/S aestheticism aestheticize/S aestival aestivate/N aetiology/MS afar/S afeard afeared afebrile affability affable affably affair/MS affaire/S affect/DGRSV affectability affectable affectate affectation/MS affected/PUY affecting/Y affection/DMS affectional/Y affectionate/UY affectionless affective/Y affectivity affectless/P afferent/Y affettuoso affiance affianced affiant afficionado affidavit/MS affiliate/DGNSX affine/DY affinity/MS affirm/ADGS affirmable affirmance affirmation/MS affirmative/Y affix/DGS affixable affixal affixation affixial affixment afflatus afflict/DGSV affliction/MS afflictive/Y affluence affluency affluent/Y afflux afford/DGS affordable afforest/A afforestation affray affreightment affricate/NSV affright affront/DGS affusion afghan/S afghani aficionada aficionado/S afield afire aflame aflatoxin afloat aflutter afoot afore aforemention aforementioned aforesaid aforethought aforetime afoul afraid/U afreet afresh afrika afrikaans afrit afro afrormosia aft after/S afterbirth afterbody afterbrain afterburner/S afterburning aftercare afterclap afterdamp afterdeck aftereffect/S afterglow afterheat afterimage afterlife aftermath aftermost afternoon/MS afterpain/S afterpiece aftersensation aftershaft aftershave aftershock/MS aftertaste aftertax afterthought/S aftertime afterward/S afterword afterworld aga agadir again against agalloch agamete agamic agamically agamogenesis agape agapeic agapeically agar agaric agartala agate/S agateware agatise/S agatize/S agave agaze age/DGRSZ aged/PY agegroup ageing/U ageless/PY agelong agency/MS agenda/MS agendaless agendum agene agenesis agenise agenize agent/MSV agentry agents/A aggie/S agglomerate/DNSV agglutinability agglutinate/DGNSV agglutinin/S agglutinogen agglutinogenic aggradation aggrade aggrandisable/MS aggrandisation aggrandise/DGRSZ aggrandisement/MS aggrandizable/MS aggrandization aggrandize/DGRSZ aggrandizement/MS aggravate/DGNSX aggregate/DGNPSVXY aggregated/U aggregational aggregative/Y aggress aggression/MS aggressive/PY aggressivity aggressor/S aggrieve/DGS aggrieved/Y aggro agha aghast agile/Y agility agio/S agiotage agist agitate/DGNSVX agitated/Y agitational agitato agitator/MS agitprop aglare agleam aglet agley aglimmer aglitter aglow agma agminate agnail agnate/N agnatic agnatically agni agnise/DGS agnize/DGS agnomen agnostic/MS agnosticism agnus ago agog agon agone agonic agonise/DGRSZ agonised/Y agonising/Y agonisingly/S agonist/S agonistic agonistical/Y agonize/DGRSZ agonized/Y agonizedly/S agonizing/Y agony/S agora agoraphobia agoraphobic agouti agraffe agram agranulocytosis agraphia agrarian agrarianise/S agrarianism agrarianize/S agree/DRSZ agreeability agreeable/P agreeably agreeing agreement/MS agrestal agrestic agribusiness/S agricultural/Y agriculturalist agriculturalist/S agriculture agriculturist agrigento agrimony agriology agrippina agrobiological/Y agrobiology agrologic agrological/Y agrologist agrology agronomic/S agronomical/Y agronomist agronomy agrose agrostology aground agrypnotic ague agueweed aguish/Y agulhas ah aha ahab ahead ahem ahimsa ahistoric ahistorical ahithophel ahold ahoy ahura aid/DGRS aide/DGRS aided/U aidman aiglet aigrette aiguille aiguillette aikido aikona ail/DGS ailanthus aile aileron/S ailment/MS ailurophile ailurophobe aim/DGRSZ aimless/PY ain ain't aintab air/DGJRSZ airbag/MS airboat airborne airbrick airbrush airburst airbus aircraft/S aircraftman aircrew airdrie airdrome airdrop/S aire airfare airfield/MS airflow airfoil/S airforce airframe/MS airfreight airglow airgun airhead airily airless/P airlift/MS airline/MRSZ airliner/MS airlock/MS airmail/S airman airmanship airmass airmen airmobile airpark airplane/MS airplay airport/MS airpost airscrew airship/MS airsick/P airspace airspeed/S airstream airstrip/MS airt airtight/P airwave/S airway/MS airworthy/P airy/PRT aisha aisle/S aisne ait aitch aitchbone ajaccio ajar ajmer akbar akela akene akhara akhenaten akihito akimbo akin akkerman aksum akure akvavit ala alabaster alabastrine alack alacritous alacrity alagez alagoas alai alamode alamogordo alanbrooke alanine alannah alap alar alarm/DGS alarming/Y alarmism alarmist alarum alary alas alate/DN alb alba albacete albacore albata albatross albedo albeit albemarle alberti albertite albertus albescent albinic albinism albino albinotic albinus albite album/NS albumenisation albumenise/DGS albumenization albumenize/DGS albumin albuminate albuminisation/MS albuminise/S albuminization/MS albuminize/S albuminoid albuminous albuminuria albumose alburnum alcaeus alcahest alcaic alcaide alcalde alcan alcatraz alcazar alchemic alchemical/Y alchemise alchemist alchemistic alchemistical alchemize alchemy alcheringa alcidine alcmene alcohol/MS alcoholic/MS alcoholically alcoholicity alcoholisable/S alcoholisation/MS alcoholise/S alcoholism/S alcoholizable/MS alcoholization/MS alcoholize/S alcoholometer/MS alcoholometry alcove/DMS alcuin aldabra aldan aldehyde alder alderman/M aldermanic aldermen aldershot aldis aldol aldosterone aldoxime aldrin ale/S aleatoric aleatory alecost alecto alee alegar alehouse alekhine alembic alembicated aleph alert/DGPRSYZ alerted/Y alessandria alethic aleurone alevin alewife alexandretta alexandrine alexandrite alexia alexipharmic alfa alfalfa alfieri alfilaria alforja alfresco alga algae algaecide algal algarroba algebra/MS algebraic algebraical algebraically algebraisation/MS algebraise/S algebraist algebraization/MS algebraize/S algeciras algicidal algicide algid algidity algin alginate/S alginic algoid algolagnia algology algometer algophobia algor algorism algorithm/MS algorithmic algorithmically alia alias/DGS alibi/MS alible alicante alicyclic alidade alien/MS alienability/I alienable alienage alienate/DGNS alienator alienee alienise/S alienism alienist alienize/S alienor aliform aligarh alight/DG alightment align/DGRS aligned/AU alignment/AS alike/P aliment/S alimentary alimentation alimentative alimony aline alinement aliped aliphatic aliquot/MS alit aliunde alive/P alizarin alk alkahest alkahestic alkalescence alkalescent alkali/MS alkalic alkalify alkalimeter/MS alkalimetry alkaline alkalinisation/MS alkalinise/S alkalinity alkalinization/MS alkalinize/S alkalisation alkalise/DGS alkalization alkalize/DGS alkaloid/MS alkaloidal alkalosis alkane alkene alkmaar alky alkyd alkyl alkylation alkyne all alla allan allanite allantoid allantois allargando allay/DGS allegate allegation/MS allege/DGS alleged/Y allegiance/MS allegiant allegoric allegorical/PY allegorisation allegorise/DGRS allegorist allegorization allegorize/DGRS allegory/MS allegretto/MS allegro/MS allele/S allelic allelism allelomorph alleluia allemand allemande alleppey allergen allergenic allergic allergist allergy/MS allery allethrin alleviate/DGNSV alleviator/MS alleviatory alley/MS alleyway/MS allhallows allheal alliaceous alliance/MS alligator/DMS alliterate/DGS alliteration/MS alliterative/Y allium alloa allocable/U allocatable allocate/ADGNSVX allocated/AU allocation/AMS allocator/AMS allocution allodial allodium allogamous allogamy allogeneic allograft allograph allographic allomerism allomerous allometric allometry allomorph allomorphic allomorphism allonge allons allonym allopath allopathic allopathically allopathy allopatric allopatrically allopatry allophane allophone/S allophonic alloplasm allopurinol allosteric allosterically allot/DS allotee allotment/MS allotments/A allotransplant allotransplantation allotrope allotropic allotropically allotropy allots/A allotted/A allottee/S allotter allotting/A allotts allotype allotypic allotypically allotypy allover allow/DGS allowable/P allowably allowance/DGMS allowed/Y alloy/DGMS alloyed/U allseed allspice allude/DGS allure/DGS allurement allusion/MS allusive/PY alluvial alluvion alluvium ally/DGRS allyl allylic allyou alma almada almagest almanac/MS almandine almandite almelo almemar almighty/P almond/MS almoner almonry almost alms/A almsgiver almsgiving almshouse almshouse/S almsman almucantar almuce alnico alodium aloe/S aloft alogical/Y aloha aloin alone/P along alongshore alongside aloof/PY alopecia alost aloud alow alp alpaca alpenglow alpenhorn alpenstock alpes alpestrine alpha alphabet/MS alphabetic/S alphabetical/Y alphabetisation/MS alphabetise/DGRSZ alphabetization/MS alphabetize/DGRSZ alphameric/S alphamerical alphanumeric/S alphanumerical/Y alphatically alpheus alphonsus alphorn alphosis alpine alpinism alpinist alps already alright alsace alsike also alt altar/MS altarpiece altazimuth altdorf/R alter/DGRSZ alterability/IU alterable/IU alterably/I alterate/V alteration/MS altercate altercation/MS altered/U alterman altern alternant alternate/DGNSVXY alternative/PSY alternator/MS alternise/S alternize/S althea althing altho althorn although altimeter/MS altimetry altiplano altissimo altitude/S altitudinal altitudinous alto/MS altocumulus altogether altogther altona altostratus altricial altruism altruist/S altruistic altruistically aludel alula alum alumina aluminate aluminiferous aluminisation aluminise/DGS aluminium/MS aluminization aluminize/DGS aluminosilicate aluminothermy aluminous aluminum/MS alumna/M alumnae alumni alumnus alumroot alundum alunite alveolar/Y alveolate/N alveoli alveolus alvey alvine alway always alyssum alytical am/MS amadavat amadou amagasaki amah amain amalekite amalgam/MS amalgamate/DGNSVX amalgamatise/S amalgamatize/S amalgamator amalgamisation/MS amalgamise/S amalgamization/MS amalgamize/S amalthea amanita amanuenses amanuensis amaranth amaranthaceous amaranthine amarelle amaryllidaceous amass/DGRS amassment amateur/MS amateurish/PY amateurism amative/PY amatol amatory amaurosis amaurotic amaut amaze/DGRSZ amazed/Y amazement amazing/Y amazon/MS amazonas amazonite ambage/S ambagious ambala ambary ambassador/MS ambassadorial ambassadorship ambassadress amber ambergris amberjack amberoid ambiance/S ambidexterity ambidextrous/Y ambience/S ambient ambiguity/MS ambiguous/PY ambiguously/U ambit ambition/MS ambitionless ambitious/PY ambivalence ambivalent/Y ambiversion ambiversive ambivert amble/DGRS amblygonite amblyopia ambo amboceptor amboise amboyna ambroid ambrose ambrosia ambrosial/Y ambrotype ambry ambsace ambulacral ambulacrum ambulance/MS ambulant ambulate/N ambulatorily ambulatory ambuscade/R ambush/DRS ambushment amdahl ameba ameer ameliorate/DGNV ameliorator amelioratory amen/S amenability/S amenable amenably amend/DGRS amendable amendatory amende amendment/MS amenhotep amenity/S amenorrhea amenorrhoea ament amentia amerce/G amercement amerciable americanised americanized americium amesace amethyst amethystine ametropia ametropic amhara amharic ami/S amiability amiable/PRT amiably amianthus amicability amicable/P amicably amice amicus amid amide amidol amidship amidships amidst amigo amin amine amino aminobenzoic aminophenol aminopyridine aminopyrine amir amiss amitosis amitotic amitotically amitrole amity ammendment/S ammeter/MS ammine ammino ammo ammocoete ammon ammonal ammonate ammonia/S ammoniac ammoniacal ammoniate/N ammonic ammonify/NR ammonite/S ammonitic ammonium ammonoid ammunition/S amnesia amnesiac amnesic amnestic amnesty amnia amniocentesis amnion amniote amniotic amoeba/MS amoebae amoebaean amoeban amoebiasis amoebic amoebocyte amoeboid amok amon among amongst amontillado amor/MS amoral/Y amoralise/S amoralism amorality amoralize/S amoretto amorism/MS amorist/MS amoristic/S amoroso amorous/PY amorphisation amorphise amorphism amorphization amorphize amorphous/PY amort amortisable/S amortisation/MSU amortise/DGS amortised/U amortisement/MS amortizable/MS amortization/MSU amortize/DGS amortized/U amortizement/MS amount/DGRSZ amour/MS amourism/MS amouristic/S amowt amp/S amperage/S ampere/S ampersand/MS amphetamine/S amphiarthrosis amphiaster amphibia amphibian/MS amphibiotic amphibious/PY amphiblastula amphibole amphibolite amphibolitic amphibology amphibrach amphichroic amphicoelous amphictyon amphictyony amphidiploid amphigory amphimacer amphimixis amphioxis amphioxus amphipathic amphiploid amphipod amphiprostyle amphiprotic amphisbaena amphistylar amphitheater/MS amphitheatre/MS amphitheatric amphitheatrical/Y amphithecium amphitricha amphitropous amphora amphoteric ample/PRT amplexicaul amplexus amplidyne amplify/DGNRSXZ amplitude/MS amply ampoule/MS ampul ampule ampulla amputate/DGNS amputator amputee amra amravati amrita amstrad amuck amulet/S amur amuse/DGRSVZ amused/Y amusement/MS amusing/PY amygdala amygdalate amygdale amygdalin amygdaline amygdaloid amygdaloidal amyl amylaceous amylase amylene amyloid amylolysis amylolytic amylopectin amylopsin amylose amyotonia an ana anabantid anabaptism anabasis anabatic anabiosis anabiotic anabolic anabolism anabolite anabranch anacardiaceous anachorism anachronic anachronism/MS anachronistic anachronistically anachronous/Y anaclinal anaclitic anacoluthia anacoluthic anacoluthically anacoluthon anaconda/S anacoustic anacrusis anaculture anadem anadex anadiplosis anadromous anadyr anaemia/MS anaemic/S anaemically anaerobe anaerobic anaerobically anaerobiosis anaesthesia/MS anaesthesiologist anaesthesiology anaesthetic/MS anaesthetically anaesthetisation/MS anaesthetise/DGRSZ anaesthetist anaesthetization/MS anaglyph anaglyphic anaglypta anagnorisis anagoge anagram/MS anagrammatic anagrammatical/Y anagrammatisation anagrammatise anagrammatization anagrammatize anak anal analcite analects analemma/MS analeptic analgesia analgesic analgetic analog/MS analogic analogical/Y analogise/S analogism/MS analogist analogize/S analogous/PY analogue/MS analogy/MS analphabet analphabetic analphabetism analysable/U analysand analysation analyse/ADGRSZ analysed/AU analysis/A analyst/MS analytic/S analytical/Y analyticity/S analyzable/U analyzation analyze/ADGRSZ analyzed/AU anambra anamnesis anamorphic anamorphism anamorphoscope anamorphosis anandrous ananthous anapaest anaphase anaphasic anaphora anaphoric anaphorically anaphrodisiac anaphylaxis anaplasia anaplasmosis anaplastic anaplasty anaptyxis anapurna anarch anarchic anarchical anarchise/S anarchism anarchist/MS anarchistic anarchize/S anarcho anarchy anarthria anarthrous anasarca anastasia anastigmat anastigmatic anastomose anastomoses anastomosis anastomotic anastrophe anatase anathema anathematisation anathematise/DGS anathematization anathematize/DGS anatolia anatomic anatomical/SY anatomise anatomist anatomize anatomy anatoxin anatropous anatto anaxagoras anaximander anaximenes anbury ancestor/MS ancestral/Y ancestress ancestry anchor/DGS anchorage/MS anchored/U anchoress anchoret anchorite anchoritic anchoritically anchoritism anchorless anchorman anchoveta anchovy/S anchylose ancient/PSY ancientry ancillary/S ancipital ancohuma ancon ancy ancylostomiasis and/DGSZ andalusia andalusite andante andantino anderlecht andesine andesite andesitic andiron andizhan andradite andreanof andreotti androcles androclinium androecium androgen androgenic androgenous androgyne androgynous androgyny android andros androsphinx androsterone andvari ane anear anecdotage anecdotal/Y anecdotalist/S anecdote/MS anecdotic anecdotical/Y anecdotist anechoic anelace anele anemia/MS anemic/S anemically anemochore anemograph anemographic anemography anemology anemometer/MS anemometric anemometrical anemometry anemone anemophilous anemoscope anent anergy aneroid anesthesia/MS anesthesiologist anesthesiology anesthetic/MS anesthetically anesthetist anesthetization/MS anesthetize/DGRSZ anesthetizer/MS anestrus anethole aneto aneuploid aneurin aneurism aneurysm aneurysmal anew anfractuosity anfractuous angary angel/MS angelfish angelic angelical/Y angelicise/S angelicize/S angelico angelise/S angelize/S angell angelology anger/DGS angerless angina anginal anginose angiocardiographic angiocardiography angiography angiology angioma angiosperm angle/DGRSZ anglesite angleworm anglia anglice anglicisation/MS anglicise/DS anglicism anglicization/MS anglicize/DS angora angostura angra angrily angry/PRT angst angstrom/S anguilliform anguine anguish/D angular/Y angularisation/MS angularise/S angularity angularization/MS angularize/S angulation angwantibo anhalt anhinga anhwei anhydride anhydridisation/MS anhydridise/S anhydridization/MS anhydridize/S anhydrite anhydrous/Y ani aniakchak aniconic anil anile aniline anilingus anima animadversion animadvert animal/MPSY animalcular animalcule animalculum animalisation/MS animalise/DGS animalises/A animalism animalist animalistic animality animalization/MS animalize/DGS animalizes/A animallike animate/DGNPSXY animated/Y animatism animato animator/MS animised animism animist animistic animized animosity animus anion/MS anionic/S anise aniseed aniseikonia aniseikonic anisette anisodactyl anisogamy anisole anisometric anisometropia anisotropic anisotropically anisotropism anisotropy/MS ankerite ankh anking ankle/MS anklebone/S anklet ankus ankylosaur ankylose ankylosis ankylostomiasis anlace anlage annaba annabergite annal/NS annalise/S annalize/S annates annatto anneal/DGRSZ annecy annelid annex/DGS annexation/S annexational annexationist annexe annhilate annihilate/DGNSV annihilator annihilatory anniversary/MS anno annotate/DGNSVX annotator/S announce/DGRSZ announced/U announcement/MS annoy/DGRSZ annoyance/MS annoying/Y annual/SY annualisation annualise/GS annualised annualization annualize/GS annualized annuary annuitant annuity/S annul/S annular/Y annularity annulate/DNY annulet annuli annulled annulling annulment/MS annulose annulus annum annunciate/DGNS annunciator/S annunciatory annunicates anoa anodal/Y anode/MS anodic anodically anodisation anodise/DGS anodization anodize/DGS anodyne anodynic anoestrus anoint/DGRS anointment anole anomalistic anomalistical anomalous/PY anomaly/MS anomer anomeric anomic anomie anon anonym anonymity anonymous/PY anorak anorectic anoretic anorexia anorexigenic anorthic anorthite anorthitic anorthosite anorthositic anosmia anosmic another/M anovulant anovulatory anoxaemia anoxemia anoxemic anoxia anoxic ansate anschluss anserine anshan answer/DGRSZ answerable/U answered/U ant/DGMS antacid antagonisation/MS antagonise/DGRSZ antagonised/U antagonising/U antagonism/S antagonist/MS antagonistic antagonistically antagonization/MS antagonize/DGRSZ antagonized/U antagonizing/U antarctic ante/DG anteater/MS antebellum antecede antecedence antecedent/MSY antecessor antechamber/S antechoir antedate/DGS antediluvian antefix antefixal anteing antelope/MS antemeridian antemortem antenatal antenna/MS antennae antennal antennule antependium antepenultimate anterior/SY anteroom/S antetype anteversion antevert anthelion anthelmintic anthem/MS anthemion anther antheridium antherozoid anthesis anthill anthocyanin anthologisation anthologise/DGRS anthologist anthologization anthologize/DGRS anthology/S anthophore anthotaxy anthozoan anthracene anthracite anthracitic anthracitisation/MS anthracitization/MS anthracnose anthracoid anthraquinone anthrax anthrop anthropic anthropical anthropocentric anthropocentrically anthropocentricity anthropogenesis anthropogenetic anthropogenic anthropography anthropoid anthropological/Y anthropologist/MS anthropology anthropometric/S anthropometrical/Y anthropometry anthropomorphic anthropomorphically anthropomorphisation anthropomorphise/DGS anthropomorphism anthropomorphist anthropomorphization anthropomorphize/DGS anthropomorphosis anthropomorphous anthropopathism anthropopathy anthropophagi anthropophagite anthropophagous anthropophagus anthropophagy anthroposophy anti antiaircraft antianxiety antibacterial antibaryon antibes antibiosis antibiotic/S antibiotically antiblack antiblackism antibody/S antic/MS antically anticancer anticancerous anticatalyser/MS anticatalyst anticatalyzer/MS anticathode anticentralisation/MS anticentralization/MS antichlor anticholinergic anticholinesterase antichrist anticipant/S anticipatable anticipate/DGNSVX anticipated/U anticipative/Y anticipator anticipatory anticise/S anticize/S anticlastic anticlerical anticlericalism anticlimactic anticlimactical/Y anticlimax/S anticlinal anticline anticlinorium anticlockwise anticoagulant anticoagulate anticoagulation anticodon anticompetitive anticonvulsant anticonvulsive anticosti anticyclone/S antidepressant antiderivative antidisestablishmentarianism antidiuretic antidotal/Y antidote/MS antidromic antiegalitarian antienzyme antiepicenter/MS antiepicentre/MS antiestablishment antifebrile antifederalist antiferromagnetism antifertiliser/MS antifertility antifertilizer/MS antifluoridation antiform antiformant antifouling antifreeze antifriction antifundamentalist antifungal antigen/MS antigenic antigenically antigenicity antiglobulin antigone antigorite antigravity antihalation antihelices antihelix antihemophilic antihero/S antihistamine antihistaminic antihistorical antihypertensive antiknock antilabor/MS antilabour/MS antilepton/S antileukemic antilitter antilog antilogarithm/S antilogism antilogs antilogy antimacassar/S antimagnetic antimalarial/S antimasque antimatter/M antimediaeval/MS antimedieval/MS antimere antimetabolite antimicrobial antimilitarist/S antimissile/S antimitotic antimonial antimonic antimonious antimonous antimony antimonyl antineoplastic antineutrino antineutron antinodal antinode antinomian antinomy antinovel antinovelist antinucleon antiochus antioxidant antioxidiser/MS antioxidising/MS antioxidizer/MS antioxidizing/MS antiparallel antiparasitic antiparticle antipasto antipater antipathetic antipathetically antipathise/S antipathize/S antipathy antiperiodic antiperiplanar antiperistalsis antipersonnel antiperspirant antiphlogistic antiphon antiphonal/Y antiphonary antiphony antiphrasis antipodal antipode/MS antipodean antipoetic antipollution antipope antiproton antipsychiatry antipyretic antipyrine antiquarian/MS antiquarianise/S antiquarianism antiquarianize/S antiquary antiquate/DN antique/MS antiquity/S antirachitic antiredeposition antiremonstrant antiresonance antiresonator antirheumatic antirrhinum antirumor/MS antirumour/MS antisana antiscorbutic antisemite/MS antisemitic antisemitism/M antisensitise/RSZ antisensitiser/MS antisensitize/RSZ antisensitizer/MS antisepsis antiseptic antiseptically antisepticise/S antisepticize/S antiseptise/S antiseptize/S antisera antiserum antisiphon/MS antislavery antisocial antispasmodic antistatic antisthenes antistrophe antistrophic antistrophically antisubmarine antisymmetric antisymmetry antisyphon/MS antitank antithesis antithesise antithesize/S antithetic antithetical/Y antithyroid antitoxic antitoxin/MS antitrades antitragus antitrust/R antitubercular antituberculous antitumor antitumoral antitussive antitype antivenin antiviral antivitamin antiworld antler/D antlia antlion antofagasta antoninus antonioni antonius antonomasia antonym/S antonymic antonymous antonymy antre antrim antrorse/Y antrum antung anu anuradhapura anuran anuresis anuria anurous anus anvers anvil/MS anviled anviling anvilled anvilling anxiety/S anxious/PY any anyang anybody/S anyhow anymore anyone/MS anyplace anything/S anytime anyway/S anywhere/S anywise anzio anzus aorangi aorta aortal aortic aortographic aortography aosta aoudad apace apache/S apagoge apalachicola apanage aparri apart/P apartheid apartment/MS apartmental apatetic apathetic apathetically apathy apatite ape/DGRSZ apeak apeldoorn apelike apelles apeman apennines aperient aperiodic aperiodically aperiodicity aperitif aperture/D apery apetalous apex/S aphaeresis aphaeretic aphagia aphanite aphanitic aphasia aphasiac aphasic aphelion apheliotropic aphesis aphetic aphetically aphid/MS aphides aphonia aphonic aphorise/DGRSZ aphorism/MS aphorist aphoristic aphoristically aphorize/DGRSZ aphotic aphrodisiac aphrodisiacal aphtha aphyllous aphylly apia apian apiarian apiarist apiary/S apical/Y apices apiculate apicultural apiculture apiculturist apiece apiezon apish/PY apivorous aplacental aplanatic aplanospore aplasia aplastic aplenty aplite aplomb apnoea apo apocalypse apocalyptic apocalyptical/Y apocalypticism apocalyptism apocalyptist apocarp apocarpous apocarpy apochromat apochromatic apocopate apocope apocrine apocrypha apocryphal/PY apocynaceous apocynthion apodal apodeictic apodictic apodictically apodosis apodous apoenzyme apogamic apogamous apogamy apogean apogee/S apogeotropism apolar apolitical/Y apollinaire apollinaris apologetic/S apologetically/U apologia apologie apologise/DGRSZ apologises/A apologising/U apologist/MS apologize/DGRSZ apologizes/A apologizing/U apologue apology/MS apolune apomict apomixis apomorphine aponeurosis aponeurotic apopemptic apophasis apophthegm apophyge apophyllite apophysis apoplectic apoplectically apoplexy apopolectic aport aposematic aposematically aposiopesis apospory apostasy apostate/S apostatisation apostatise/DGS apostatization apostatize/DGS apostil apostle/MS apostleship apostolate apostolic apostolicity apostrophe/S apostrophic apostrophise/DGS apostrophize/DGS apothecary apothecial apothecium apothegm apothegmatic apothegmatical/Y apothem apotheoses apotheosis apotheosise apotheosize apotropaic apotropaically appal/S appall/S appalled appalling/Y appaloosa appaloosas appanage apparatus/S apparel/S appareled appareling apparelled apparelling apparency apparent/PY apparently/I apparition/MS apparitional apparitor appassionato appeal/DGRSZ appealability appealable/U appealing/UY appear/DGRSZ appearance/S appeasable appease/DGRS appeasement appel appellant/MS appellate/NV appellative/Y appellee append/DGRSZ appendage/MS appendant appendectomy appendicectomy appendices appendicitis appendicle appendicular appendix/MS appenzell apperceive apperception apperceptive appertain/DGS appestat appetence/I appetency appetent appetise/DSZ appetisement/MS appetiser appetising/UY appetite/MSV appetize/DSZ appetizement/MS appetizer appetizing/UY applaud/DGRS applaudable applaudably applause apple/MS applecart/S applejack applesauce applesnits appliance/MS applicability/I applicable/I applicant/MS applicate application/MS applicative/Y applicator/MS applicatory applique/S apply/DGNRSXZ applying/A appoint/DGRSVZ appointe appointee/MS appointment/MS appointor/S appomattox apport apportion/DGS apportioned/A apportionment/S appose/DG apposite/NPVY appositional/Y appositive/Y appraisal/MS appraisals/A appraise/DGRSZ appraised/A appraisement appraises/A appraising/Y appreciable/I appreciably/I appreciate/DGNSVX appreciated/U appreciative/IPY appreciator appreciatory apprehend/DGRS apprehensible apprehensibly apprehension/MS apprehensive/PY apprentice/DS apprenticeship/S appressed apprise/DGJRSZ apprize/DGJRSZ apprizing/SY approach/DGRSZ approachability/U approachable/IU approbate/N approbatory appropriable appropriate/DGNPSTVXY appropriated/U appropriator/MS approvable approvably approval/MS approve/DGRSZ approving/Y approx approximable approximal approximant approximate/DGNSVXY approximative/Y approximator/S appulse appurtenance/S appurtenant apractic apraxia apraxic apricot/MS apriorism apriority apron/MS apropos apse/S apsidal apsides apsis apt/IPUY apteral apterous apterygial apteryx aptitude/S aptitudinal/Y apuleius apulia apure apurimac apyrase apyretic aqaba aqua/S aquacade aquaculture aquafortis aqualung aqualunger aquamarine aquanaut aquaplane/R aquarelle aquarellist aquaria aquarist aquarium aquashow aquatic/S aquatically aquatint/R aquatintist aquavit aqueduct/MS aqueous/Y aquicultural aquiculture aquidneck aquifer/S aquiferous aquilegia aquileia aquiline aquilinity aquire aquit aquitaine aquittal aquiver ara/S arabesque arabica arability arabinose arabisation arabise/DGS arabization arabize/DGS arable arachnid/MS arachnoid arad arafura aragats aragon aragonite araguaia arak/S arakan araldite araliaceous aram aran araneid arany arapaima ararat araroba araucania araxes arbalest arbil arbiter/MS arbitrable arbitrage/R arbitrageur arbitral arbitrament arbitrarily arbitrary/P arbitrate/DGNSV arbitrational arbitrator/MS arbitress arbor/DMS arboraceous arboreal/Y arboreous arbores arborescence arborescent/Y arboretum arboriculture arboriculturist arborisation arborise/DGS arborist/MS arborization arborize/DGS arborvitae arbour/DMS arboures arbovirus arbritrary arbroath arbuthnot arbutus arc/DGS arcade/DGMS arcana arcane arcanum arcature arccos arccosine arch/DGPRSVYZ archae archaean archaeological/Y archaeologist/MS archaeology archaeomagnetism archaeozoic archaic/P archaically archaise/DGRSZ archaism archaist archaistic archaize/DGRSZ archangel/MS archangelic archbishop archbishopric archdeacon archdeaconate archdeaconry archdiocesan archdiocese/S archducal archduchess archduchy archduke archdukedom archegonial archegonium archenemy archenteron archeological/Y archeologist/MS archeology archerfish archery archespore archetypal/Y archetype/S archetypical/Y archfiend archfool archicarp archidiaconal archidiaconate archiepiscopal archiepiscopate archil archilochus archimage archimandrite archine archipelagic archipelago archipelagoes archipenko archiphoneme archiplasm architect/MS architectonic/S architectonically architectural/Y architecture/MS architrave archival archive/DGRSZ archivist/S archivolt archon archoplasm archpriest archway arclength arclike arco arcograph arcsin arcsine arctan arctangent arctic arctically arcticise/S arcticize/S arcuate/NY arcus ardeb ardency ardennes ardent/Y ardor/MS ardour/MS arduous/PY are/S area/MS areal/Y areaway areawide areg aren't arena/MS arenaceous arenicolous arenite areography areola areolar areolate/N areole aretino arezzo argal argali argand argent argenteuil argentic argentiferous argentine argentite argentous argentum arger argil argillaceous argilliferous argillite arginine argol argolis argon argonaut/S argonon argos argosy argot argovie arguable/IU arguably/IU argue/DGRSZ argufy/R argument/MS argumentation argumentative/Y argumentum argyle argyll arhat aria arianist/S arica arid/P aridity arietta aright aril arillode arimathea ariminum ariose arioso ariosto arise/GJRS arisen arista aristaeus aristarchus aristocracy aristocrat/MS aristocratic aristocratically aristophanes arithmetic/S arithmetical/Y arithmetician arithmetisation/MS arithmetise/DS arithmetization/MS arithmetize/DS arjuna ark arkose arkwright arles arlon arm/DGMRSZ armada armadillo/S armagh armagnac armament/MS armamentarium armature/S armband armchair/MS armed/AU armentieres armes armet armful/S armhole armiger armillaria armillary arminius armipotent armistice armless armlet armlike armload armoire armor/DGMRSZ armored/U armorer/MS armorial/Y armorica armorist/MS armorless armory/DMS armour/DGMRSZ armoured/U armourer/MS armourless armoury/DMS armpit/MS armrest arms/A armsful armure army/MS arne arnhem arnica arnim arno aroid aroint aroma/S aromatic/P aromatically aromaticity aromatisation aromatise/DGS aromatization aromatize/DGS arose around arousal arouse/DGS arp arpanet arpeggio/MS arpent arquebus arrack arraign/DGS arraignment/MS arran arrange/DGRSZ arrangeable arrangement/AMS arrant/Y arras array/DGRS arrear arrearage arrears arrest/DGRSZ arrestable arrestant arrested/A arrestee/MS arresting/Y arrestment arrestor/MS arretium arrhythmia arrhythmic arrhythmical/Y arris/S arrival/MS arrive/DGRS arrivisme arriviste arroba arrogance arrogant/Y arrogate/DGNS arrondissement arrow/DGS arrowhead/MS arrowroot arrowwood arrowworm arrowy arroyo/S arru arse arsehole/MS arsenal/MS arsenate arsenic arsenical arsenicise/S arsenicize/S arsenide arsenious arsenite arsenopyrite arsine/S arsis arson arsonist arsonous arsphenamine art/MS artaud artaxerxes arte artefact/S artemisia arterial/Y arterialisation/MS arterialise/DGS arterialization/MS arterialize/DGS arteriogram/MS arteriographic arteriography arteriolar arteriole/MS arteriolosclerosis arteriosclerosis arteriovenous arteritis artery/MS artesian artful/PY arthralgia arthritic arthritically arthritis arthrogram/MS arthromere arthropathy arthropod/MS arthrosis arthrospore arthrosporic artic artichoke/MS article/DGMS articulable articular articulate/DGNPSVXY articulated/U articulator/S articulatory artifact/MS artifical/Y artifice/RS artificial/PY artificialise/S artificiality/S artificialize/S artillerist artillery/S artilleryman artily artiodactyl artisan/MS artist/MS artiste artistic/I artistical artistically/I artistry artless/Y artmobile artois artwork arty/PR arum arunachal arundel arundinaceous aruspex aruwimi arvo aryl arytenoid as asafetida asafoetida asantehene asap asarabacca asben asbestos asbestosis asbestus ascariasis ascarid ascend/DGRSZ ascendable ascendance ascendancy ascendant/Y ascendence ascendency ascendent ascendible ascension/S ascensional ascensive ascent ascertain/DGS ascertainable ascertainment ascesis ascetic/MS ascetical/Y asceticism asch asci ascidian ascidium ascites ascitic asclepiadaceous ascocarp ascogonium ascoli ascomycete ascomycetes ascorbate ascorbic ascospore ascosporic ascosporous ascot ascribable ascribe/DGS ascription ascriptive ascus asdic aseity asepalous asepsis aseptic aseptically asepticise/S asepticize/S asexual/Y asgard ash/NRS ashame ashamed/UY ashcan/S ashcroft ashe ashet ashkey ashlar/DGS ashless ashman ashmen ashore ashplant ashram ashtoreth ashtray/MS ashurbanipal ashy/R aside/S asinine/Y asininity asir ask/DGRSZ askance askant askari asked/U askesis askew/P askja aslant asleep aslef aslope asmara asmodeus aso asocial asoka asp/NRXZ asparagine asparagus aspartate aspartic aspartokinase aspect/MS aspectual aspencade/S asperges aspergillosis aspergillus asperity asperse/DG aspersion/MS asphalt/D asphaltic asphaltite asphaltum aspheric aspherical asphodel asphyxia asphyxiant/S asphyxiate/N asphyxiator aspiate aspic aspidistra aspinwall aspirant/MS aspirate/DGNSX aspiration/MS aspirator/S aspire/DGRS aspirin/S asplenium asquint asquith ass/MS assad assagai assai assail/DGS assailable assailant/MS assassin/MS assassinate/DGNSX assassinator assault/DGRSV assaultive/PY assay/DGRZ assegai assemblage/MS assemblagist assemble/DGRSZ assembled/AU assembly/MS assemblyman assemblywoman assent/DGRS assentation assentient assentor assert/DGRSVZ assertion/MS assertional assertive/PY asserts/A assess/ADGS assessable assessment/AMS assessor/MS asset/MS asseverate/NV asshole/MS asshur assibilate assiduity assiduous/PY assign/DGRSZ assignability assignable/A assignat assignation/S assignational assigned/AU assignee/MS assignment/AMS assignor assigns/AU assimilability assimilable assimilate/DGNSVX assimilationism assimilationist assimilator assimilatory assiniboine assist/DGRS assistance/S assistant/MS assistantship/S assisted/U assistents assiut assize/RSZ assn associable associate/DGNSVX associateship association/MS associational associationism associative/Y associativity/S associator/MS assoil assoilment assonance assonant assort/DGRS assortative assortment/MS assuage/DGS assuagement assuan assuasive assumability assumable assumably assume/DGRS assumpsit assumption/MS assumptive assurance/MS assurances/A assurbanipal assure/DGRSZ assured/PY assurgent assuring/AY assuror astable astaire astaires astarboard astatic astatically astaticism astatine aster/MS asteria asteriated asterisk/MS asteriskless asterism/S astern asternal asteroid/MS asteroidal asthenia asthenic asthenosphere asthma asthmatic asthmatically asti astigmat astigmatic astigmatically astigmatiser/MS astigmatism astigmatizer/MS astir astolat astomatous astonied astonish/DGS astonishing/Y astonishment astound/DGS astounding/Y astrachan astraddle astragal astragalus astrakhan astral/Y astraphobia astray astrict astride astringency astringent/Y astrobiological astrobiologist astrobiology astrobotany astrocompass astrocyte astrocytic astrocytoma astrodome astrodynamics astrogeology astroid astrol astrolabe astrologer/MS astrological/Y astrology astrometry astron astronaut/MS astronautic astronautical/Y astronautics astronavigation astronomer/MS astronomic astronomical/Y astronomy astrophotography astrophysical astrophysicist/MS astrophysics astrosphere asturias astute/PY astyanax asunder asur aswan aswarm aswirl aswoon asyllabic asylum/S asymmetric asymmetrical/Y asymmetry/S asymptomatic asymptomatically asymptote/MS asymptotic/Y asymptotical asymptotically asynapsis async asynchronise/DGS asynchronism asynchronize/DGS asynchronous/Y asynchrony asyndetic asyndetically asyndeton asyut at atacama atactic ataghan atahualpa ataman ataractic ataraxic atari atavism atavist atavistic atavistically ataxia ataxic atbara ate atelectasis atelier atemporal athabaska athamas athanasius atheism atheist/MS atheistic atheistical/Y athelstan athematic athenaeum atheneum athermanous atheroma atherosclerosis athirst athlete/MS athletic/S athletically athleticism athodyd athos athwart athwartship/S atilt atinate atingle atlantes atlas atli atman atment atmolysis atmometer/MS atmosphere/DMS atmospheric/S atmospherically atmospherium atoll/MS atom/MS atomic/S atomically atomicity atomisability atomisable atomisation/MS atomise/DGRSZ atomism atomist atomistic/S atomistically atomizability atomizable atomization/MS atomize/DGRSZ atomy atonal/Y atonalism atonalist atonalistic atonality atone/DGS atonement atonic atonicity atony atop atopic atopy atrabilious atremble atresia atrial atrioventricular atrip atrium/S atrocious/PY atrocity/MS atrophic atrophy/DGS atropine attaboy attach/DGRSZ attachable attache/DGRSZ attached/U attachment/MS attack/DGRSZ attackable attacker/MS attackman attain/DGRSZ attainability attainable/P attainably attainder attainment/MS attaint attar attedance attemper attempt/DGRSZ attemptable attend/DGRSZ attendance/MS attendant/MS attended/U attendee/MS attention/MS attentional attentionality attentive/IPY attenuant attenuate/DGNS attenuated/U attenuator/MS attercliffe attest/DGRS attestation attic/MS atticise/S atticism atticize/S attire/DGS attis attitude/MS attitudinal/Y attitudinisation attitudinise/DGS attitudinization attitudinize/DGS attlee attorn attorney/MS attorneyship attornment attract/DGSV attractable attractant attraction/MS attractive/PUY attractivity attractor/MS attributable attribute/DGNRSVX attributed/U attributional attributive/Y attrited attrition attritional attu attune/DGS attunement atune atween atwitter atypic atypical/Y atypicality aubade aube auburn auction/DG auctioneer/MS auctorial aud/GN audacious/PY audacity aude audibility/I audible/I audibly/I audience/MS audient audile audio audiofrequency/S audiogenic audiogram/MS audiological audiologist/MS audiology audiometer/MS audiometric audiometry audiophile audiotape audiotypist audiovisual/S audiphone audit/DGSV auditable audition/DGMS auditor/MS auditorium/S auditory audivi auer augend auger/MS aught augite augitic augment/DGRS augmentable augmentation/S augmentative augmentor augur/S augury august/PY auk auklet auld aulic aulis aunt/MSY aunthood auntie auntlike aura/MS aural/Y aurangzeb aurar aureate aurelian aureola aureole aureomycin aureus auric auricle auricula auricular auriculate auriferous auriol aurist aurochs aurora aurorae auroral aurorean aurous aurum auscultate/DGNSX auscultatory ausforming auslander ausonius auspicate auspice/S auspicious/IPY austen austenite austenitic austere/PY austerity austral australite australites australopithecine autacoid autarchy autarky autecious autecology auteur authentic/IU authentically authenticate/DGNSX authenticated/U authenticator/S authenticity/I author/DGMS authoress authorial authorisation/AMS authorise/DGRSZ authorises/AU authoritarian authoritarianism authoritative/PY authority/MS authorization/AMS authorize/DGRSZ authorizes/AU authorship autism autistic auto/MS autoantibody autobahn autobiographer autobiographic autobiographical/Y autobiography/MS autobus autocade autocatalysis autocatalytic autocephalous autochanger autochthon autochthonous autoclave/D autocode autocoder autocollimator autocorrelate/DGNSX autocracy/S autocrat/MS autocratic autocratical autocratically autocross autocue autocueing autocycle autodial autodialer autodialler autodidact autodidactic autodyne autoecious/Y autoecism autoerotic autoerotically autoeroticism autoerotism autofluorescence autogamous autogamy autogenesis autogenetic autogenetically autogenic autogenous/Y autogiro autograft autograph/DG autographic autographically autographs autography autogyro autohypnosis autohypnotic autoicous autoimmune autoimmunisation autoimmunity autoimmunization autoinfection autoinoculation autointoxication autoionisation autoionization autokinetic autoload/DS autoloader autoloading autologous autolycus autolysate autolyse autolysin autolysis autolytic automaker automanipulation automanipulative automat automata automatable automate/DGNS automatic/S automatically automaticity automatisation/MS automatise/S automatism automatist automatization/MS automatize/S automaton/S automobil automobile/MS automobilist automorphic automorphism automotive autonavigator/MS autonomic autonomically autonomist autonomous/Y autonomy autoparagraph autophyte autophytic autophytically autopilot/MS autopista autoplastic autoplastically autoplasty autopsy/DS autoput autoradiogram/MS autoradiograph/DGMS autoradiographic autoradiography autoregressive autorepeat/GS autorotate/N autorotational autoroute autosexing autosomal/Y autosome autostability autostart autostrada autosuggest autosuggestibility autosuggestible autosuggestion autotable autotelic autotetraploid autotetraploidy autotimer autotomic autotomise autotomize autotomous autotomy autotoxaemia autotoxin autotransformer autotransplant autotransplantation autotroph autotrophic autotrophically autotrophy autotype autoxidation autumn/MS autumnal/Y autunite auvergne aux auxanometer auxesis auxetic auxetically auxil auxiliary/S auxin auxinic auxinically auxochrome auxotroph auxotrophic auxotrophy avadavat avagadro avail/DGRSZ availability/S available/P availably avalanche/DGS avaliable avalon avant avarice avaricious/PY avast avatar avaunt avebury avec aveiro avellan avellane avellaneda avenge/DGRS avens aventail aventine aventino aventurine avenue/MS aver/S average/DGPSY averment averno averred averrer averring avers/V averse/NPVXY aversion/MS avert/DGS avesta aveyron avian avianise avianize aviarist aviary/S aviate/X aviation aviator/MS aviatress aviatrix avicenna aviculture aviculturist avid/PY avidin avidity aviemore avifauna avifaunal/Y avifaunistic avigation avignon avionic/S avirulent avitaminosis avitaminotic avizandum avlona avocado/S avocate avocation/MS avocational/Y avocet avoid/DGRSZ avoidable/U avoidably/U avoidance avoirdupois avouch avouchment avow/DRS avowal avowed/Y avulse/GN avuncular avunculate await/DGS awake/DGS awaken/DGRS award/DGRSZ awardable awardee aware/PU awash away/P awe/DG aweary aweather aweigh aweless awesome/PY awestricken awestruck awful/PY awheel awhile/S awhirl awkward/PY awl/MS awless awlwort awn awning/DMS awnless awoke awoken awry ax/DGRSZ axal axe/DGRSZ axel axenic axenically axial/Y axiality axil axile axilla axillar axillary axiological/Y axiology axiom/MS axiomatic/S axiomatically axiomatisation/MS axiomatise/DGS axiomatization/MS axiomatize/DGS axion/MS axis axisymmetric axisymmetrical/Y axisymmetry axle/MS axletree axman axolotl/MS axon/MS axseed axum ayacucho ayah ayahuasca aycliffe aydin aye/S ayesha ayin ayr ayub ayurveda ayutthaya azalea/MS azan azathioprine azazel azbine azeotropic azide azido azikiwe azimuth/MS azimuthal/Y azine aznavour azo/H azobenzene azoic azole azonal azote azotemia azotic azotisation azotise/DGS azotization azotize/DGS azure azurite azusa baa/S baba babar babassu babbage babbitt/DGS babble/DGRS babblement babe/MS babeuf babiche babirusa baboon baboonish babu babul babur babushka baby/DGMS babyhood babyish babylonia babysat babysit/S babysitter/S babysitting baccalaureate baccarat baccate bacchanal bacchanalia bacchanalian bacchant bacchante/S bacchantic bacchic bacchius bacciferous bacciform baccivorous baccy bachelor/MS bachelorhood bachelorise/S bachelorize/S baci bacillar bacillary bacilli bacillus bacitracin back/DGRSZ backache/MS backarrow backbench/RZ backbite/R backblocks backboard backbone/MS backbreaker backbreaking backchaining backchat backcloth backcomb backcountry backcourt backcourtman backcross backdate/DGS backdrop/MS backed/U backend/S backfield backfill/DGS backfire/DGS backgammon/M background/MS backhand/DR backhanded/Y backhaus backhoe backhouse backlash/R backless backlog/MS backmost backorder backpack/MRSZ backpedal backplane/MS backplate/S backrest backsaw backscatter/DGS backscratcher backseat backset backsheesh backside backslap backslapper backslash/DGS backslide/R backspace/DGS backspin backstabber backstabbing backstage backstairs backstay backstitch/DGS backstop backstreet backstretch backstroke backswept backswing backsword backtrack/DGRSZ backup/S backus backward/PSY backwardation backwash backwater/MS backwood backwoods backwoodsman backyard/MS baclava bacolod bacon/R baconise/S baconize/S bacteraemia bacteria bacterial/Y bactericidal/Y bactericide bacterin bacteriological bacteriology bacteriolysis bacteriophage bacteriostasis bacterise bacterium bacterize bacteroid bactria baculiform baculum bad/PSY badajoz badalona badderlocks baddie bade badge/DGRSZ badger/DGMS badinage badland badlands badman badmen badminton badoglio baeda bael baeyer baez baffle/DGRSZ bafflement baffling/Y bag/MS bagasse bagatelle/MS bagehot bagel/MS bagful baggage baggageman baggagemen bagged bagger/MS baggily bagging baggy/PRS bagh baghlan bagie bagley bagman bagnio bagpipe/MRS baguette baguio bagwash bagwig bagworm bah bahadur bahasa bahia baht bahuvrihi baikal bail/GRY bailable baile bailee baileefe bailie bailiff/MS bailiffship bailiwick bailment bailor bailsman baines bainite bairn bairnsfather bait/DGRS baize baja bajan bake/DGJRSZ bakeapple bakehouse bakery/MS bakeshop bakewell baklava bakra baksheesh bakst bakunin balaclava balalaika/MS balance/DGRSZ balanced/PU balanchine balas balata balbo balbriggan balcony/DMS bald/GPRY balderdash baldhead/D baldish baldmoney baldpate baldric baldy bale/DGRSZ baleen balefire baleful/PY balenciaga balibuntal balikpapan baliol balk/DGRS balkanisation balkanise/DG balkanization balkanize/DG balkh balkhash balkline balky/PR ball/DGRSZ ballad/MS ballade balladeer balladic balladise/S balladist balladize/S balladmonger balladry ballance ballarat ballast/MS ballcarrier ballerina/MS ballet/MS balletic balletomane balletomania ballfield/M ballfields ballflower ballgown/M balliol ballista ballistic/S ballistically ballocks ballonet balloon/DGRSZ balloonist ballot/DGMRS ballottement ballplayer/MS ballroom/MS ballyhoo ballyhooey balm/MS balmain balmily balmung balmy/PR balneal balneology baloney balpa balsa balsam/S balsamic balsamiferous balsaminaceous balsamise/S balsamize/S baluster balustrade/MS bam bambino bamboo/S bamboozle/DGS bamboozlement ban/MS banal/Y banality banana/MS banaras banat banausic banc bancroft band/DGRS bandage/DGRS bandaid bandana bandanna bandaranaike bandbox bandeau bandeaux banderilla banderillero bandgap bandh bandicoot bandit/MS banditry banditti bandjarmasin bandleader bandmaster bandobust bandoleer bandoleers bandolier bandoline bandore bandpass bandsaw bandsman bandspreading bandstand/MS bandstop bandung bandwagon/MS bandwidth bandwidths bandy/DGS bane/G baneberry baneful/Y bang/DGRS bangalore bangish bangka bangkok bangle/MS bangtail bangweulu banian banish/DGRS banishment banister/MS banja banjermasin banjo/MS banjoes banjoist banjul bank/DGRSZ banka bankable bankbook/S banket banknote/S bankroll/R bankrupt/DGS bankruptcy/MS bankside banned/U banner/MS banneret bannerette bannerol banning/U bannister/S bannock banns banquet/DGJRS banquette bans/U bansela banshee/MS banstead bant/G bantam bantamise/S bantamize/S bantamweight banter/DGRS bantering/Y bantling banyan banzai baobab bap baptisable/S baptise/DGRSZ baptised/U baptisement/MS baptises/U baptism/MS baptismal/Y baptist/MS baptistery baptistry/MS baptizable/MS baptize/DGRSZ baptized/U baptizement/MS baptizes/U bar/MS baranof baraza barb/DRSZ barbarian/MS barbarianise/S barbarianism barbarianize/S barbaric barbarically barbarisation barbarise/DGS barbarism barbarity/S barbarization barbarize/DGS barbarous/PY barbate barbe barbecue/DGRS barbed/P barbel barbell/MS barbellate barber/DGS barbered/U barberry barbershop barbet barbette barbican barbicel barbital barbitone barbiturate/S barbituric barbizon barbudo/S barbule barbusse barbwire barca barcarole barce barchart/S bard/MS bardot bare/DGPRSTY bareback/D barefaced/PY barefoot/D barehanded bareheaded/P bareilly bareknuckle/D barents baresark barfly/MS bargain/DGRS barge/DGS bargeboard bargee bargeman bargepole bariatrician bariatrics baric barilla barite baritonal baritone/MS barium bark/DGRSZ barkeep/R barkentine barkhan barkless barky/R barletta barley barleycorn barm barmaid barman barmy/R barn/MS barnacle/D barnardo barnaul barnful barnsful barnsley barnstorm/DGRS barnum barny barnyard/MS barocchio baroda barogram/MS barograph barographic baroja barometer/MS barometric barometrical/Y barometry baron/MS baronage baroness baronet baronetage baronetcy barong baronial baronise/S baronize/S barony/MS baroque/PY baroscope barostat barouche barozzi barque barquentine barquisimeto barrack/RS barracoon barracouta barracuda/MS barrage/DGMS barramunda barramundi barranca barranco barranquilla barrater barrator barratry barrault barre barred/U barrel/MS barreled barrelful barrelhouse barreling barrelled barrelling barrelsful barren/PS barrenwort barret barrette/MS barricade/MS barrie barrier/MS barring/R barrio barrister/S barron barroom/S barros barrow/S barstool/MS bartend bartender/MS barter/DGRS bartizan bartolommeo barware barycentre barycentric barye baryon/MS baryonic barysphere baryta barytes barytone bas basal/Y basalt basaltic basaltware bascinet bascom bascule base/DGPRSTY baseball/MS baseband baseboard/MS baseborn baseburner baseless baselevel baseline/MS baseman basemen basement/MS basementless basenji baseplate basepoint baserunning bash/DGRS bashan bashaw bashful/PY bashibazouk basic/S basically basicity basidial basidiomycete/S basidiomycetous basidiospore basidiosporous basidium basie basifixed basify/N basil basilan basilar basilary basildon basileis basilica basilican basilicata basilisk basin/DMS basinal basinet basipetal/Y basis bask/DG basket/MS basketball/MS basketful basketlike basketry basketwork basle basler baslot basophil basophile basophilia basophilic basotho bass/MS bassein bassenthwaite basset basseterre bassi/S bassinet/MS bassist basso bassoon/MS bassoonist/MS basswood bast bastard/MSY bastardisation/MS bastardise/DGS bastardised/U bastardization/MS bastardize/DGS bastardized/U bastardry bastardy baste/DGNRSX bastia bastile bastille bastinado bastion/DMS bastnaesite bastogne bat/MS batangas batata batboy batch/DGRS bate/DGMRSZ bateau bated/AU bateleur bates batesian batfish batfowl bath/DGRSZ bathe/DGRSZ bathetic bathhouse/S batholith bathometer/MS bathos bathrobe/MS bathroom/DMS baths bathsheba bathtub/MS bathtubful bathwater bathyal bathymetry bathyscaph bathysphere batik batista batiste batley batman baton/MS batrachian batrachotoxin batsman batt battailous battalia battalion/MS batteau batted battels battement batten/DGS batter/DGS battersea battery/MS battik batting battle/DGRSZ battledore battlefield/MS battlefront/MS battleground/MS battlement/DMS battlepiece battleship/MS battlewagon battu battue batty/PR batum batwing batwings batwoman baubee bauble/MS bauchi baucis baud/S baudouin baudrons baulk/DGS baum bautzen bauxite bauxitic bawbee bawcock bawd/N bawdily bawdry bawdy/PR bawdyhouse/S bawl/DGRS bay/DGSY bayadere bayaderka bayanihan bayberry/S bayern bayeux bayle bayonet/DGMS bayou/MS baysian baywood bazaar/MS bazon bazoo bazooka/S bdellium be bea beach/DGS beachboy/S beachcomb/RZ beachfront beachhead/MS beachie beachside beachwear beachy beacon/DGMS bead/DGS beadle/MS beadledom beadroll beadsman beadwork beadworker beady beagle/MS beak/DRSZ beale beall beam/DGRSZ beame beamish/Y beamy bean/DGRSZ beanbag/MS beanball beanery beanfeast beanie beano beanpole bear/GJRSZ bearability bearable/U bearably/U bearbaiting bearberry beard/DS bearded/P beardless beardown bearish/PY bearskin beast/JSY beastie beasties beastly/PR beasty beat/GJNRSZ beatable/U beatably/U beaten/U beatie beatific beatifically beatify/N beatitude/MS beatles beatless beatnik/MS beatty beau/MS beauchamps beauclerk beauharnais beaumarchais beaut beauteous/PY beautician/S beautiful/PY beautifully/U beautify/DGNRSXZ beauty/MS beauvais beauvoir beaux beaver/MS beaverboard beaverbrook beaverise/S beaverize/S beaverton bebeerine bebel bebop bebopper becalm/DGS became because beccafico bechance bechet beck becket beckett beckon/DGS beclamor/DGS beclamour/DGS becloud become/GS becoming/UY becquerel becudgeled becudgeling becudgelled becudgelling bed/MS bedabble bedaub/G bedazzle/DGS bedazzlement bedbug/MS bedchamber bedclothes beddable bedded bedder/MS bedding bede bedeck bedesman bedevil/S bedeviled bedeviling bedevilled bedevilling bedevilment bedew bedfast bedfellow bedight bedim bedimmed bedimming bedivere bedizen bedlam bedlamise/S bedlamite bedlamize/S bedmate/MS bedouin bedpan/MS bedplate bedpost/MS bedraggle/D bedrail bedrid bedridden bedriveled bedriveling bedrivelled bedrivelling bedrock/M bedroll bedroom/DMS bedside bedsit/S bedsitter bedsore bedspaces bedspread/MS bedspring/MS bedstead/MS bedstraw bedtime beduin/S bedwarmer bedwetting bedworth bee/S beeb beebread beech/NR beechnut beechwood beef/DGRSZ beefburger beefcake beefeater beefsteak beefwood beefy/R beehive/MS beekeeper beekeeping beelike beeline been/S beento beep/DGRS beer/S beerbohm beersheba beery/R beestings beeswax beeswing beet/MS beetfly beetle/DGMS beetroot/S beeves beezer befall/GNS befell befit/MS befitted befitting/Y befog/S befogged befogging befoh befool before beforehand beforehandedness beforeimage/S beforetime befoul/DGS befriend/DGS befuddle/DGS befuddlement beg/S begad began begat beget/S begetter begetting beggar/DGSY beggarly/P beggarweed beggary begged begging begin/S beginner/MS beginning/MS begird begone begonia begorra begot begotten begrime/DG begrudge/DGRS begrudging/Y beguile/DGRS beguilement beguiling/Y beguine begum begun behalf behan behave/DGRS behavior/DMS behavioral/Y behaviorism/MS behaviorist/MS behavioristic/S behavioristically behaviour/DMS behavioural/Y behaviourism/MS behaviouristic/S behead/G beheld behemoth behemothic behemoths behest behind behindhand behistun behold/GNRSZ behoof behoove/DGJMS behooving/MSY behove/DGJS behoving/MSY beiderbecke beige beigel beigy being/S beira bejabers bejewel bejeweled bejeweling bejewelled bejewelling bel belabor/DGMS belabour/DGMS belah belate belated/PY belaud belay/DGS belch/DGS beldam beldame beleaguer belemnite belfort belfry/MS belga belge belie/DRS belief/MS believability believable/U believably/U believe/DGRSZ believing/U belike belittle/DGRS belittlement belitung belive bell/MS belladonna bellarmine bellay bellbird bellboy/MS belle/MS belleau belletrist bellflower bellhop/MS bellicose/PY bellicosity belligerence belligerency belligerent/MSY bellinzona bellman bellmen belloc bellow/DGS bellpull bells/A bellum bellwether/MS bellwood bellwort belly/DGMS bellyache/GR bellyband bellybutton bellyful bellyfull belmopan belong/DGJS belonging/PS belove beloved belovo below belowground belt/DGS belted/U beltless belton beltway beluga/M belvedere bely/DGRS bemadden/G beman bemean bemedaled bemedalled bemire bemoan/DGS bemock bemuse/D bemused/Y bemusement benadryl benares bench/DGRS benchmar benchmark/GMS bend/DGRSZ bendable/U benday bendel bendigo bendy beneath benedicite benediction/MS benedictory benefaction benefactor/MS benefactress benefic benefice beneficence/S beneficent/Y beneficial/PY beneficiary/S beneficiate/N benefit/DGRSZ benefitted benefitting benempt benevento benevolence benevolent/PY benfleet bengaline benghazi benguela benight benighted/PY benign/Y benignancy benignant/Y benignity benoni bent/S benthal benthic benthonic benthos bentinck bentonite bentonitic bentwood benue benumb benzaldehyde benzene benzidine benzine benzoate benzocaine benzofuran benzoic benzoin benzol benzophenone benzoquinone benzoyl benzyl bepaint beplaster bequeath/DGS bequeathal bequest/MS berar berate/DGS berbera berberidaceous berberine berbice berceuse/S bereave/DGS bereavement/S bereft beret/MS berg/NRS bergamot bergdama bergerac bergius beria beribbon beribboned beriberi bering beringer berio beriosova berk/S berkelium berley berlichingen berlinguer berm bermejo bermondsey bernadette bernadotte bernardine berne bernhardt bernicle bernina berretta berry/DGMS berrylike bersagliere berseem berserk/R berteros berth/DGJ berths bertillon berto bertolucci beryl beryllium berzelius beseech/GS beseeching/Y beseem beset/S besetment besetting beshrew beside/S besiege/DGRZ besmear besmirch/DGS besom besot besotted besotter besotting besought bespangle bespatter bespeak/S bespectacled bespoke bespoken bespread besprent besprinkle best/DGRS bestead/DG bestial/Y bestialise/DGS bestiality bestialize/DGS bestiary bestir bestirring bestow/D bestowal bestrew bestride/GS bestrode bestseller/MS bestsellerdom bestselling bestubble/D bet/MS beta/S betaine betake betatron betel bethe bethel bethink bethought bethral/S bethralled bethralling bethsaida betide betimes betjeman betoken/DG betony betook betray/DGRS betrayal betroth/D betrothal/S betrothed/U betted better/DGS betterment/S betti betting bettor betulaceous between/P betweenbrain betweentimes betweenwhiles betwixt beuthen bevan bevanite/S bevatron bevel/S beveled beveler/S beveling/S bevelled beveller/S bevelling bevelling/S beverage/MS bevin bevvy bevy/S bewail/DGS beware bewhisker bewhiskered bewigged bewilder/DGS bewildered/PY bewildering/Y bewilderment bewitch/DGS bewitchery bewitching/Y bewitchment bewray bexley bey beyond beyrouth bezel bezique bezoar bezonian bezwada bhagalpur bhai bhakti bhang bharal bharat bharatiya bhatpara bhavan bhavnagar bhindi bhishti bhopal bhubaneswar bhutto biafra biak biannual biannulate biarritz bias/DGPS biassed biassin biassing biathlon biauriculate biaxial/Y bib/MS bibb/R bibbed bibbery bibbing bibcock bibelot/S bible/MS bibless biblical/Y biblicism biblicist bibliographer bibliographic/S bibliographical/Y bibliography/MS bibliolater bibliolatrous bibliolatry bibliology bibliomancy bibliomania bibliomaniac bibliomaniacal bibliopegic bibliopegically bibliopegist bibliopegistic bibliopegy bibliophile/S bibliophilic bibliophilism bibliophilist bibliophily bibliopole bibliopolic bibliopolist bibliotheca bibliothecal bibliotic/S bibliotist bibulous/PY bicameral bicameralism bicapsular bicarb bicarbonate bicentenary bicentennial bicentric bicentricity bicep bicephalous biceps bicester bichloride bichromate/D bichromatise/S bichromatize/S bichrome bicipital bicker/DGRS bicollateral bicolor/D bicolour/D biconcave biconcavity biconditional biconnected biconvex biconvexity bicorn bicorne bicornuate bicultural biculturalism bicuspid bicuspidate bicycle/DGRSZ bicyclic bicyclist bid/MS bida bidarka biddability biddable biddably bidden/U bidder/MS bidding/A biddle biddy/S bide/DGRS bidentate bidet bidiagonal bidialectal bidialectalism bidirectional bidistill/DGS bids/A biel bield bienne biennial/Y biennium bier/S bierce bierkeller biestings bietnar bifacial bifarious biff biffin bifid/Y bifidity bifilar/Y biflagellate bifocal/S bifoliate bifoliolate biforate biform bifrost bifurcate/DGNSXY big/PY bigamist bigamous/Y bigamy bigarreau bigeminal bigeminy bigener bigeneric bigeye bigger biggest biggety biggin bigging biggish biggity bighead/D bighearted/PY bighorn/MS bight/MS bigmouth bigmouthed bignonia bignoniaceous bigot/DGMS bigoted/Y bigotry biguanide bigwig bihar biharmonic bijapur bijection/MS bijective/Y bijou bijouterie bijugate bikaner bike/DGMRSZ biker/MS bikeway bikie bikila bikini/DMS bilabial bilabiate bilander bilateral/PY bilateralism bilayer/S bilbao bilberry bilbo bilboa bilboes bile bilection bilestone bilge/DGMS bilgy/R bilharziasis biliary bilinear bilingual/SY bilingualism bilious/PY bilirubin biliverdin bilk/DGRS bill/DGJRSZ billable billabong billboard/MS billet/DGS billfish billfold/MS billhead billhook billiard/S billion/HS billionaire billon billow/DGS billowy billposter billposting billy/S billycock billyo bilobal bilobate bilobed bilocular biloculate biltong bimah bimanous bimanual/Y bimbo bimester bimestrial bimetal bimetalist bimetalistic bimetallic bimetallism bimetallist bimetallistic bimillenary bimillenial bimodal bimodality bimolecular/Y bimonthly/S bimorph bimorphemic bin/MS binal binary/S binate binational binaural/Y bind/GJRSZ bindery binding/PSY bindle bindweed bine bing/N binge/S bingey binghi bingle bingo/S binh binnacle binned binning binocular/SY binocularity binodal binomial/Y binominal bint binturong binuclear binucleate/D bio bioactive bioassay bioastronautical bioastronautics biocatalyst biocatalytic biocellate biocenology biocenosis biocenotic biochemic biochemical/Y biochemist/S biochemistry biochip/S biocidal biocide bioclean bioclimatic bioclimatology biocoenosis biocoenotic biocycle biodegradability biodegradable biodegradation biodegrade biodynamics bioecological bioecologist bioecology bioelectric bioelectrical bioelectricity bioenergetics bioengineering bioenvironmental biofeedback bioflavonoid biog/N biogenesis biogenetic biogenetically biogenic biogeochemical biogeochemistry biogeographic biogeographical biogeography biograph biographee biographer/MS biographic biographical/Y biographise/S biographize/S biography/MS bioherm bioinstrumentation biologic biological/SY biologise/S biologism biologist/MS biologistic biologize/S biology bioluminescence bioluminescent biolysis biomacromolecule/S biomass biomaterial biome biomedical biomedicine biometric/S biometrical/Y biometry biomolecular biomolecule/S bionic/S bionomic/S bionomical/Y biophysic/S biophysical/Y biophysicist/S bioplasm biopoiesis biopolymer/S biopsy/S biosatellite bioscience/S bioscientific bioscientist bioscope bioscopy biosis biosphere biostatics biostatistic/S biostrome biosynthesis biosynthesised biosynthesized biosynthetic biosynthetically biosystematic biosystematist biosystematy biota biotechnological biotechnology biotelemetric biotelemetry biotic biotin biotite biotitic biotope biotransformation biotron biotype biotypic biovular bipack biparental/Y biparietal biparous bipartisan bipartisanism bipartisanship bipartite/NY biped/S bipedal bipetalous biphenyl bipinnate/Y biplane/MS bipod bipolar bipolarisation bipolarise/S bipolarity bipolarization bipolarize/S bipropellant bipyramidal biquadrate biquadratic biquarterly biracial biracialism biradial biramous birch/NRS birchbark bird/MRS birdbath/M birdbaths birdbrain/D birdcage/MS birdcall birdhouse birdie/DS birdieback birdieing birdlike birdlime birdman birdseed birdwatch birdyback birefringence birefringent bireme birendra biretta birgitta biriani birk birkhead birkie birl/R biro/S birobidzhan birr birse birth/DGM birthday/MS birthmark/S birthplace/S birthrate/MS birthright/MS birthroot births birthstone/S birthweight/S birthwort birtwhistle bis bisayas biscay biscayne biscuit/MS bise bisect/DGS bisection/MS bisectional/Y bisector/MS bisectrix biserial biserrate bisexual/MSY bisexuality bish bishop/MS bishopbird bishopric bisitun bisk biskra bismuth bismuthic bismuthinite bismuthous bison/MS bisque/S bissextile bist bistability bistable bistate bister/D bistort bistre/D bistro/S bistroic bisulcate bisulfate bisulfide bisulfite bisulphate bisulphide bisulphite bisutun bisyllabic bisymmetric bit/MS bitartrate bitblt/S bitch/MS bitchery bitchily bitchy/PR bite/GRSZ bithynia biting/Y bitmap/MS bitolj bits/R bitstock bitsy bitt/DG bitted/U bitten bitter/PRSTY bitterish bitterling bittern bitternut bitterroot bittersweet/PY bitterweed bitterwood bittock bitty bitumen bituminisation bituminise/DGS bituminization bituminize/DGS bituminoid bituminous bitwise bivalent bivalve/DMS bivariate bivouac/S bivvy biweekly biyearly biz bizarre/PY bizerte blab/S blabbed blabber/DG blabbermouth blabbermouths blabbing blabby black/DGNPRSTXY blackamoor/S blackball/DGS blackberry/MS blackbird/MRS blackboard/MS blackbody/S blackbuck blackbutt blackcap blackcock blackcurrant blackdamp blacken/DGRS blackett blackface blackfin blackfish blackfly blackguard/MSY blackguardism blackhander blackhead blackheart blackish blackjack/MS blackland blackleg blacklist/DGRS blackmail/DGRSZ blackmer blackmore blackout/MS blackpoll blackpool blackshirt blacksmith/GM blacksmiths blacksnake blackstrap blacktail blackthorn blacktop/MS blackwall blackwash blackwater blackwood bladder/MS bladderlike bladdernose bladdernut bladderwort bladderwrack blade/DMS blague blah blain blakey blamable blamably blame/DGRSZ blameful/Y blameless/PY blameworthy/P blamey blanc blanch/DGRS blancmange bland/PY blandish/R blandishment/S blank/DGPRSTY blanket/DGRSZ blanketflower blanketlike blanquette blanton blare/DGS blarney blasco blase blasingame blaspheme/DGRS blasphemous/PY blasphemy/S blast/DGRSZ blastema blastematic blastemic blastie blastment blastocoel blastocyst blastoderm blastoff blastogenesis blastomere blastopore blastula/MS blastular blastulation blat blatancy blatant/PY blate blather/DGR blatted blatter blatting blaubok blaydon blaze/DGRSZ blazing/Y blazon/DGR blazonry bldg bleach/DGRSZ bleachable bleak/PY bleakish blear blearily bleary/P bleat/GRS bleb bled bleed/GJRSZ bleep/DGR bleeps blemish/DGMS blemished/U blench blend/DGRSZ blende blennioid blenny blent blepharitis bless/DGJS blessed/PY blest/U blet blether blevins blew blewits blida bligh blight/DR blighty blimey blimp/MS blimpishly blimpishness blind/DGPRSYZ blindage blinded/U blindfish blindfold/DGS blinding/Y blindside/DGS blindstorey blindworm blink/DGRSZ blinker/DGS blinking/U blintz blintze blip/MS blipping blique bliss blissful/PY blister/DGS blistering/Y blistery blithe/RTY blithesome/Y blitz/MS blitzkrieg blizzard/MS blizzardy bloat/DGRSZ blob/MS blobbing bloc/MS block/DGMRSZ blockade/DGRS blockage/MS blockboard blockbuster/S blockbusting blockhead/S blockhouse/S blockish/Y blocky/R bloemfontein blois bloke/MS blond/MS blonde/MS blondish blood/DS bloodbath bloodbaths bloodcurdling/Y bloodfin bloodguilt bloodguilty/P bloodhound/MS bloodily bloodless/PY bloodletting bloodline/MS bloodmobile bloodred bloodroot bloodshed bloodshot bloodsport/S bloodstain/DMS bloodstock bloodstone bloodstream bloodsucker bloodsucking bloodthirstily bloodthirsty/P bloodworm bloodwort bloody/DGPT bloom/DGRSZ bloomery bloomy bloop/RS blossom/DGS blossomy blot/MS blotch blotchily blotchy blotted blotter blotting blotto blotty blouse/GMS blouson blow/DGRSZ blowback blowfish blowfly blowgun blowhard blowhole blowie blowlamp blown/U blowout blowpipe blowsy blowtorch blowtube blowup blowy blowzy blub blubber/DG blubbery blucher bludge bludgeon/DGS blue/DGPRSTY blueback bluebeard bluebell blueberry/MS bluebill bluebird/MS bluebonnet/MS bluebook bluebottle bluebush bluecoat bluefin bluefish bluegill bluegrass blueing bluejack bluejacket bluenose bluepoint blueprint/DGMS bluesman bluestem bluestocking bluestone bluesy bluet bluethroat bluetit bluetongue blueweed bluey bluff/DGPRSY bluish/P blume blundell blunder/DGJRS blunderbuss blundering/SY blunge/R blunt/DGPRSTY blur/MS blurb blurred/Y blurrily blurring/Y blurry/PR blurt/DGRS blush/DGRS blushful blushing/UY bluster/DGRS blustering/Y blusterous blustery blutwurst blyth boa/S boabdil boadicea boar board/DGRSZ boardinghouse/MS boardlike boardman boardmanship boardroom boards/I boardsmanship boardwalk boarfish boarhound boarish boart boast/DGJRSZ boastful/PY boat/DGRSZ boatbill boatel/S boathook boathouse/MS boatload/MS boatman boatmanship boatmen boatsmanship boatswain/MS boatyard/MS boaz bob/MS bobbed bobber bobbery bobbin/MS bobbinet bobbing bobble/DGS bobbsey bobby/S bobbysoxer bobcat bobeche bobfloat boblet bobol bobolink/MS bobotie bobowler bobrow bobsled bobsledder bobsledding bobsleigh bobstay bobtail/D bobwhite/MS bocaccio bocage boccaccio boccherini bocci boccie boccioni bochum bock bocklogged bockwurst bod bodacious/Y bode/DGS bodega bodement bodenheim bodensee bodge/R bodgie bodh bodhisattva bodice bodied/U bodiless bodily bodkin bodmin body/DGS bodybuild bodybuilder/MS bodybuilding bodycheck bodyguard/MS bodysurf/R bodyweight bodywork boehmer boehmite boer boethius boeuf boff boffin boffo/S boffola bofors bog/MS bogan bogarde bogart bogartian bogbean bogey/DGS bogeyman/M bogeymen bogged bogging boggle/DGS boggs boggy bogie bogle bognor bogong bogor bogtrotter bogus bogwood bogy/S boh bohea boheme bohlen bohol bohunk boiardo boies boil/DGRSZ boileau boilermaker/MS boilerplate boilover boisterous/PY boite/S bokassa bokmakierie bola/S boland bolas/S bold/PRTY boldface/DGS bole bolection bolero bolet boletus boleyn bolide bolingbroke boliou bolivar boliviano boll bollard bollix bollocks bollworm bolo/S bolometer/MS bolometric bolometrically boloney bolshevise bolshevize bolster/DGRS bolt/DGRS bolted/U boltrope bolus bolzano boma bomb/DGJRSZ bombacaceous bombard/DGS bombardier/S bombardment/S bombardon bombast/R bombastic bombastically bombazine bombe bombinate/N bombora bombproof bombshell bombsight bombus bombycid bomu bon bona bonaire bonanza/MS bonaventura bonbon bonce bond/DGRSZ bondable bondage bonderise bonderize bondholder bondmaid bondman bonds/A bondservant bondsman bondsmen bondstone bondwoman bone/DGRSZ boneblack boned/U bonefish bonehead/D boneless boneset bonesetter boneshaker boney boneyard bonfiglio bonfire/MS bong bongo bongoes bongoist bonham bonheur bonhoeffer bonhomie bonin bonism bonito bonjour bonkers bonnard bonne/R bonnet/DS bonneted/U bonnily bonnor bonny/R bonsai bonsela bonspiel bontebok bontempo bonus/MS bony/R bonze/R bonzes boo/S boob boobialla boobify booboo boobook booby/S boodle booger boogerman boogeyman boogie boohoo book/DGJRSZ bookbind/GRZ bookbindery bookcase/MS bookeeper bookend/S bookful bookie/MS bookish/PY bookkeep bookkeeper/MS bookkeeping booklet/MS booklist booklouse bookmaker/S bookmaking bookman bookmark/MRSZ bookmobile/S bookplate/S bookseller/MS bookselling bookshelf/M bookshelves bookstall bookstore/MS bookworm/MS booky boole boolean/S boom/DGRS boomerang/MS boomkin boomlet boomslang boomtown/S boomy/R boon boondocks boondoggle/GR boong boonies boor/MS boorish/PY boost/DGRS boosterism boot/ADGS bootblack/S bootee booth/S boothia boothroyd bootie bootjack bootlace bootle bootleg/S bootlegged bootlegger/MS bootlegging bootless/PY bootlick/R bootloader bootprint bootstrap/MS bootstrapped bootstrapping booty/S booze/GR boozily boozy bop bophuthatswana bopper bopping bora boracic boracite borage boraginaceous borak borane borate/DS borax borazon borborygmus bordel bordello/MS border/DGJRS bordereau borderland/MS borderline bordure bore/DGRSZ boreal borecole boredom boree borehole/S boresight/S borgerhout borges borgholm borgia borglum boric boride boring/PY borise/S borize/S borland born/AIU borne borneol bornholm bornu borodino boron boronic borosilicate borough boroughs borrow/DGJRSZ borrowable bors borstal bort borzoi boschbok boschvark bosh bosk boskop bosom/MS bosomy boson bosonic bosphorus bosque bosquet boss/DS bossa bossboy bossdom bossism bossuet bossy/PRS bostitch bosun bosworth bot/S botan botanic botanical/Y botanise/DGS botanist/MS botanize/DGS botany botargo botch/DGRSZ botchwork botchy botel botfly both botha bother/DGS botheration bothersome bothnia bothwell bothy botryoidal bott botticelli bottle/DGRSZ bottlebrush bottlecap/MS bottleful bottleneck/MS bottlenose bottom/DGRS bottomland bottomless/PY bottommost bottomost bottomry bottrop botulin botulinal botulinum botulinus botulism botvinnik boucicault boucle boudicca boudoir bouffant bouffe bougainvillaea bougainvillea bough/DM boughs bought/N bougie bouillabaisse bouillon boulanger boulder/DMS bouldery boule boulevard/MS boulevardier boulevardise/S boulevardize/S bouleversement boulez boulle bounce/DGRSZ bouncily bouncing/Y bouncy/R bound/DGNRS boundary/MS bounded/AU bounderish/Y boundless/PY bounds/AI bounteous/PY bountiful/PY bounty/DMS bouquet/MS bourbon/S bourbonise/AS bourbonism bourbonize/AS bourdon bourg bourgeois bourgeoise bourgeoisie bourgeoisify bourgeon bourges bourgogne bourguiba bourn bourse bouse/G boustrophedon bout/MS boutique/S bouton boutonniere bouvardier bouvier bouzouki bovid bovine/SY bovinity bovril bovver bow/DGRSZ bowan bowden bowdlerisation bowdlerise/DGRS bowdlerization bowdlerize/DGRS bowed/U bowel/MS boweled boweling bowelled bowelless bowelling bowerbird/MS bowery bowes bowfin bowfront bowhead bowie bowknot bowl/DGRSZ bowlder bowleg bowlegged bowlful bowline/MS bowman bowmen bows/R bowsaw bowse bowshot bowsprit bowstring/MS bowwow bowyangs bowyer box/DGRSZ boxboard boxcar/MS boxfish boxful boxhaul boxlike boxroom boxthorn boxwood boxy/PR boy/MRS boyar/S boyard boycott/DGRS boyfriend/MS boyhood boyish/PY boyla boyne boyoma boysenberry boz/N bozo/S bpi bra/MS brabant brabble/DG brace/DGRS bracelet/MS brach brachia brachial brachiate brachiopod brachium brachycephalic brachydactylic brachylogy brachypterous brachyuran bracken bracket/DGS brackish/P bracknell bract bracteate bracteole brad bradawl bradded bradding bradman bradycardia bradykinin brae/MS brag/S braga braggadocio braggart bragged bragger braggest bragging braggy brahe brahma braid/DGRS brail braille braillewriter braillex braillink braillo brailtel brain/DGS braincase brainchild/M brainchildren brainish brainless/PY brainpan brainpower brainsick/Y brainstem/MS brainstorm/GMRS brainteaser brainwash/DGRS brainy/PR braise/DGRS brake/DGS brakeless brakeman brakemen/M brakesman brakpan braky bramante bramble/GMS brambly bramley bran branch/DGJS branched/U branchia branchial branchiate branchiopod branchless branchlet branchy brancusi brand/DGRS brandel brandin brandish/GS brandling brando brandy/DGS brandywine brank/S branle brannon brant/S branum braque/S brasenose brash/PY brashy brasier brasil brasilein brasilin brass/DS brassard brassbound brasserie brassica brassie brassiere brassily brassy/PR brat/MS bratislava brattice brattish/G brattle/DG bratty/P bratwurst braunite braunschweig brava bravado bravais brave/DGPRSTY bravery bravissimo bravo/DGS bravoes bravura braw/Y braweling brawl/DGRS brawle brawly/R brawn brawnily brawny/PR braxy bray/DGRS braze/DGRS brazen/DGPY brazier/MS brazils brazos breach/DGRSZ bread/DGHS breadbasket/S breadboard/MS breadfruit/S breadline breadmaking breadnut/S breadroot breadstuff breadthways breadthwise breadwinner/MS breadwinning break/GRSZ breakable/S breakage breakaway breakbone breakdown/MS breakeven breakfast/DGRSZ breakfront breakneck breakoff breakout breakpoint/DGMS breakthrough/MS breakthroughs breakup/S breakwater/MS bream/S breast/DGS breastbone breastfed breastfeed/G breastpin breastplate breaststroke/R breastwork/MS breath/DGRSZ breathability breathable/U breathalyse breathalyzer breathe/DGRSZ breathless/PY breaths breathtaking/Y breathy/R breccia/S brecciate/N brecht brecon bred/IU breda brede bree breech/GMS breechblock breechcloth breechclout breechloader breed/GRS breeks breenger breeze/DGMS breezeless breezeway breezily breezy/PR bregenz bregma bregmatic brekky bremsstrahlung brethren breve/S brevet/DGS breviary/S brevier brevity brew/DGRSZ brewage brewery/MS brewis brey brezhnev briand briar/MS briard briarroot bribable bribe/DGRSZ bribery bricating brick/DGRS brickbat bricklay bricklayer/MS bricklaying brickle brickmason/S bricktop brickwork brickyard bricole bridal bride/MS bridegroom bridesmaid/MS bridewell bridge/DGS bridgeable bridgeboard bridgehead/MS bridgeless bridgework/M bridie bridle/DGS bridled/U bridlewise bridoon brie brief/DGJPRSTY briefcase/MS briefing/MS briefless brien brier brierroot briery brig/MS brigade/DGMS brigadier/MS brigadoon brigalow brigand/MS brigandage brigandine brigandism brigantine brighouse bright/GNPRSTXY brighten/DGRSZ brightness/S brightside brightwork brill brilliance brilliancy brilliant/PY brilliantine brim brimful brimless brimmed brimmer brimming brimstone brinded brindle/D brine/GR brinell bring/GRSZ bringdown brinjal brink brinkley brinkmanship brinksmanship brinny briny/PR brio brioche briolette briony briquet briquette brisance brisant brisk/PRY brisket brisling brist bristle/DGS bristlecone/MS bristlelike bristletail bristly/R bristol/S brit britches brittle/DGPRTY brittonic britzka brix broach/DGRS broad/NPRSTXY broadax broadband broadbill broadcast/DGJRSZ broadcasts/A broadcloth broaden/DGJRSZ broadleaf broadloom broadminded broadmoor broadsheet broadside broadsword broadtail broadwife broca brocade/D brocatelle broccoli broch brochette brochure/MS brockage brocken brocket brockle brocoli broddle broderie broederbond brogan brogue broider broidery broil/DGRSZ broke/RZ broken/PY brokenhearted brokerage brolga brolly/S bromal bromate/DG brome bromegrass bromeliad bromelin bromeosin bromic bromide/MS bromidic brominate/N bromine/S brominise/S brominize/S bromism bromo/S bromoform bromsgrove bronc/S bronchi bronchia bronchial bronchialy bronchiectasis bronchiolar bronchiole/MS bronchiolitis bronchitis bronchopneumonia bronchoscope bronchus bronco/S broncobuster brontosaur brontosaurus bronze/DGRS bronzy brooch/MS brood/GRS brooding/Y broody/P brook/DS brookite brooklet brooklime brookside brookweed broom/DGMS broomball/R broomcorn broome broomgrove broomhill broomrape broomstick/MS broonzy brose broth/RZ brothel/MS brother/MSY brotherhood brotherly/P broths brougham/S brought brouhaha broun brow/MS browband browbeat/GNS brown/DGJPRSTY brownie/MS brownish brownnose/R brownout brownshirt brownstone/S browny brows/DGRSZ browsability browse/DGRSZ broxodent broz brubeck brucellosis brucine bruges bruin bruise/DGRSZ bruit brumal brumby brume brummell brummie brunch/S brundisium brunel brunelleschi brunet brunette/S brunhild brunt brusa brush/DGRS brushability brushback brushcut brushfire/MS brushland brushless brushlike brushstroke/MS brushup brushwood brushwork brushy/R brusk brusque/PY brusquerie brut brutal/Y brutalisation/MS brutalise/DGS brutalised/U brutalises/AU brutality/S brutalization/MS brutalize/DGS brutalized/U brutalizes/AU brute/MS brutify brutish/PY bruxelles bruxism brynhild bryology bryony bryophyta bryophyte bryozoa bryozoan bs/A btu bub/MS bubal bubaline bubble/DGRS bubbly/R bubby bubonic bubonocele bucaramanga buccal buccaneer/MS buccaneerish buccinator bucentaur bucer buchan buchner buchu buck/DGRS buckaroo/S buckbean buckboard/MS buckeen buckeroo bucket/DGMS bucketful/M bucketfuls bucketsful buckeye buckhead buckhorn buckhound buckish buckjumper buckle/DGRS buckman bucko buckoes buckra buckram bucksaw buckshee buckshot buckskin/S bucktail buckthorn bucktooth buckwheat bucky bucolic bucolically bucovina bud/MS budded budder budding buddle buddy/MS budge/DGS budgerigar budget/DGRSZ budgetary budgeteer budgetted budgetting budgie budging/U budlong budweis buff/GMRSZ buffalo buffaloes buffer/DGMRSZ buffered/U bufferer/MS bufferred buffet/DGJS buffi bufflehead buffo/S buffon buffoon/MS buffoonery buffoonish bug/MS bugaboo buganda bugatti bugbane bugbear bugbears bugeye bugeyed bugged bugger/DGMS buggery bugging buggy/MS bughouse bugle/DGRS bugleweed bugloss bugong bugseed buhl buibui build/DGJRSZ building/MS buildup/MS built/AIU builtin buitenzorg bukavu bukhara bukharin bukovina bul bulawayo bulb/DMS bulba bulbaceous bulbar bulbiferous bulbil bulblet bulbous/Y bulbul bulganin bulge/DGS bulgur bulgy/P bulimia bulk/DS bulkhead/DMS bulkily bulky/PR bull/DGS bulla bullace bullae bullbaiting bullbat bulldog/MS bulldogger bulldoze/DGRSZ bulle bullet/MS bulletin/MS bulletproof/DGS bullfight/GR bullfinch bullfrog bullhead/D bullheaded/PY bullhide bullhorn bullion bullish/PY bullnecked bulloch bullock bullocky bullous bullpen bullpout bullring bullroarer bullrush/MS bullseye bullshit bullterrier bullwhack bullwhackers bullwhip bully/DGS bullyboy/S bullyrag bulnbuln bulrush bulwark bum/MS bumbailiff bumbershoot bumble/DGRSZ bumblebee/MS bumbling/Y bumboat bumbry bumf bumkin bummaree bummed bummer/S bumming bump/DGRSZ bumph bumpily bumpkin/MSY bumpkinish bumptious/PY bumpy/PR bumsucking bun/MS bunch/DGS bunche bunchily bunchy bunco buncombe bund bundelkhand bundesrat bundh bundist bundle/DGRS bundled/U bundobust bundoora bundy bung/R bungalow/MS bunghole bungle/DGRSZ bunglesome bungling/Y bunin bunion/MS bunk/DGRSZ bunker/DGMS bunkhouse/MS bunkmate/MS bunko/S bunkum bunny/MS bunraku bunt/DGRSZ buntal buntline bunyip buonaparte buonarroti buoy/DGS buoyage buoyance buoyancy buoyant/Y buprestid bur buran buraydah burbage burbank burble/DGRS burbly burbot burden/DGMS burdened/U burdensome/PY burdock bureau/MS bureaucracy/MS bureaucrat/MS bureaucratic/U bureaucratically bureaucratisation/MS bureaucratise/DS bureaucratization/MS bureaucratize/DS bureaux buret burette/S burg/Z burgage burgas burgee burgeon/DGS burger burgess/MS burgher/MS burghley burglar/MS burglarious/Y burglarize/DGS burglarproof/DGS burglary/MS burgle/DGS burgomaster/S burgonet burgoo/S burgrave burhel burial buried/U burin burk burka burking burl/DR burladero burlap burle burleigh burlesque/DGRSY burley burlily burlingame burly/PR burn/DGJRSZ burnable burne/S burned/U burnet burney burning/SY burnish/DGRS burnley burnoose burnous burnout burnt/PY buroo burp/DGS burr/DMRS burrawang burro/MS burrow/DGRS burrstone burry/R bursa/S bursae bursal bursar bursarial bursary burse burseed bursiform bursitis burst/DGRS burstone bursty burthen burweed bury/DGRS buryat bus/DGS busbar busboy/MS busby/S busera bush/DGJS bushbaby bushbuck/S bushcraft bushel/MS bushelage busheled busheler/S busheling/S bushelled busheller/S bushelling/S bushelman bushfire bushhammer bushido bushie bushily bushland/M bushman bushmaster bushpig bushranger bushtit bushveld bushwhack/DGRS bushwheel bushy/PR busily business/MS businesslike businessman businessmen businesswoman/M businesswomen busk/R buskin busload/MS busoni busra buss/DGS bust/DGRS bustard/MS bustee bustle/DG bustling/Y busty busuuti busy/DGPRST busybody busyness busywork but/A butadiene butane butanol butanone butat butch butcher/DGMRSY butcherbird butchery butene butenedioic buteo butler/MS butskellism butskellite butt/DGMRSZ butte/DGRSZ butted/A butter/DGRSZ butterball butterbur buttercup buttered/U butterfat butterfingered butterfingers butterfish butterfly/MS butterflyer butterine butterless buttermilk butternut butterscotch butterweed butterwort buttery butting/A buttinski buttinsky buttock/MS button/DGRS buttonball buttonbush buttoned/U buttonhole/MRS buttonhook buttonless buttonmould buttons/U buttonweed buttonwood buttony buttress/DGS buttstock butty/S butung butut butyl butylate/N butylene butyraceous butyral butyraldehyde butyrate butyric butyrin buxom/PY buy/GRSZ buyer/MS buzz/DGRS buzzard/MS buzzsaw buzzword/MS buzzy bwana by bye/S byelaw/S byelovo bygone/S byinge bylaw/MS byline/MRS bylot byname byng bypass/DGS bypast bypath byplay byproduct/MS byre byrnie byroad byssinosis byssus bystander/MS bystreet byte/MS bytom byway/S byword/MS cab/MS cabal/S cabala cabalism cabalist cabalistic caballed caballero caballing cabana/S cabanatuan cabaret/S cabbage/DGMS cabbageworm cabbala cabbie/S cabby/S cabdriver/S caber/MS cabezon cabimas cabin/MS cabinet/MS cabinetmaker/MS cabinetmaking cabinetry cabinetwork cable/DGS cablegram/MS cablet cableway cabman cabob cabochon caboodle caboose cabora cabotage cabral cabretta cabrilla cabriole cabriolet cabstand cacao cacciatore cachalot cache/DGMRS cachectic cachepot cachet cachexia cachinnate cachou cachucha cacique caciquism cackle/DGRS cackly cacodemon cacodemonic cacodyl cacoepy cacoethes cacogenesis cacogenic/S cacographical cacography cacology cacomistle cacophonist cacophonous/Y cacophony cacti cactus/S cacuminal cad cadaster cadastral/Y cadastre cadaver cadaveric cadaverine cadaverise/S cadaverize/S cadaverous/Y caddie caddis caddish/PY caddy/S cade cadelle cadence/DGS cadency cadent cadential cadenza cadet cadetship cadge/DGRS cadi cadmium cadmiumise/S cadmiumize/S cadre caducean caduceus caducity caducous caecilian caecum caen caenozoic caeoma caerleon caernarfon caesalpiniaceous caesaraugusta caesarea caesium caespitose caesura caetano cafard cafe/MS cafeteria/MS caff caffeine/M caffeinic caftan cage/DGRSZ caged/U cageling cagey/P cagily cagliari cagliostro cagmag cagney cagoule/S cagy/PR cahier cahoot/S caiaphas caiman cainogenesis cainozoic caird cairn/DS cairngorm caisson caithness caitiff caius cajeput cajole/DGRS cajolement cajolery cajuput cake/DGS cakewalk/R calabash calaboose calabria calalu calamanco calamine calamint calamite calamitous/PY calamity/MS calamondin calamus calandria calash calathus calaverite calcaneal calcaneum calcaneus calcar calcareous/PY calcariferous calceiform calces calchas calcic calcicole calciferol calcific calcifuge calcifugous calcify/DN calcimine calcination calcine/DG calcinosis calcite calcitic calcitonin calcium calcomp calcsinter calculability/I calculable/IP calculably/I calculate/ADGNSVX calculated/PY calculating/AU calculatingly/U calculational calculator/MS calculi calculous calculus caldarium caldera caldron caleche calefacient calefactory calendar/DGMS calender/R calendric calendrical calends calendula calenture calf/S calflike calfskin cali caliber/S calibrate/DGNRSX calibrator/S calibre/S calices caliche calicle calico calif califate californium caliginous caligula calimere calipash calipee caliper/S caliph caliphal caliphate caliphs calisaya calisthenic/S calix calk/R call/DGRSZ calla callable/A callais callant callao callback callboy called/AU callee/M caller/MS callicrates calligraph/RZ calligraphic calligraphically calligraphist calligraphy callimachus calliope callipash calliper calliper/S callipygian callisthenics callose callosity callous/DPY callow/P callus/S calm/DGPRSTY calmative calming/Y calomel calor caloric calorically calorie/MS calorific calorimeter/MS calorimetric calorimetrically calorimetry calory calotte caloyer calpe calque caltanissetta caltech calthrop caltrop/S calumniate/DN calumniator calumnious/Y calumny calutron calvaria calvary calve/G calves calvities calx calyces calycine calycle calypso calypsonian calyptra calyptrogen calyx cam/S camail camaraderie camarilla camass cambay camber/DG camberwell cambial cambist cambium camboose cambrai cambrel cambria cambric cambyses came/N camel/MS camelback cameleer camelia camellia camellias camelopard cameo/S camera/MS cameral cameralism cameralist cameraman cameramen camerlengo camiknickers camisado camise camisole caml camlet camomile camoodi camorra camorrista camouflage/DGS camouflageable camouflagic camp/DGRSZ campagna campaign/DGRSZ campania campanile campanologist campanology campanula campanulaceous campanulate campcraft campeche campership campesinos campestral campfire campground/S camphene camphine camphor camphoraceous camphorate/D camphoric campily campina/S campion campo campobello camporee campos campsite/S campstool campus/MS campy/P camshaft/S camus camwood can't can/MS canaigre canakin canal/MS canalboat canaled canaler/S canaletto canaliculate canaliculus canaling canalisation/MS canalise/DGS canalization/MS canalize/DGS canalled canaller/S canalling canara canard canarese canary/MS canasta canaster cancan cancel/S cancelable cancelate/D canceled/U canceler canceling cancellable cancellate cancellate/D cancellation/MS cancelled/U canceller cancelling cancellous cancelous cancer/MS cancerous/Y cancroid candela candelabra candelabrum candent candescence/I candescent candia candid/PY candida candidacy candidate/MS candidature candidly/U candle/DGRS candleberry candlefish candleholder candlelight/R candlelit candlenut candlepin/S candlepower/S candlesnuffer candlestick/MS candlewick candlewood candor/MS candour/MS candy/DGS candyfloss candytuft cane/DGJRSZ canea canebrake canella canescent caneware canful cangue canicular canikin canine/S canister/S canker/DG cankerous cankerworm canna cannabin cannabis cannae canned cannel cannelloni cannelure canner/MS cannery/S cannes cannibal/MS cannibalic cannibalisation/MS cannibalise/DGS cannibalism/M cannibalistic cannibalization/MS cannibalize/DGS cannily/U canning cannister/MS cannock cannon/DGMS cannonade cannonball cannoneer cannonry cannot cannula cannulate canny/PR canoe/DMS canoeing canoeist/MS canoewood canon/MS canoness canonic canonical/SY canonicalisation canonicalise/DGS canonicalization canonicalize/DGS canonicate canonicity canonisation/MS canonise/GRSZ canonised/U canonises/U canonist canonization/MS canonize/GRSZ canonized/U canonizes/U canonry canoodle canopy canorous/PY canova canso canst cant/DGR cantabile cantal cantala cantaloupe/MS cantankerous/PY cantata/S cantatrice canted/AI canteen/S canter/D canterelle cantharides canthi canthus canticle cantilena cantilever/S cantillate/N cantina cantle/S canto/S canton/MS cantonal cantonment cantor/MS cantorial cantoris cantrip cantus canty canula canute canvas/MRS canvasback canvaslike canvass/DGRSZ canyon/MS canzona canzone canzonet cap/MS capabilites capability/MS capable/IP capably/I capacious/PY capacitance/S capacitate/IV capacitive/Y capacitor/MS capacity/S caparison cape/MS capelet capelin capella caper/DGS capercaillie capeskin capet capework capful capias capillaceous capillarity capillary capita capital/SY capitalisable/S capitalisation/AMS capitalise/DGRSZ capitalised/AU capitalises/A capitalism capitalist/MS capitalistic capitalistically capitalizable/MS capitalization/AMS capitalize/DGRSZ capitalized/AU capitalizes/A capitan capitate/NS capitol/MS capitular capitulary capitulate/DNS capitulum caplin capo capon caponise/DGS caponize/DGS caporal caporetto capote cappadocia capparidaceous capped/A capper/S cappie capping/A cappuccino cappy capreolate capric capriccio capriccioso caprice capricious/PY caprification caprifig caprifoliaceous caprine capriole caproic capsaicin capsid capsize/DGS capstan/S capstone capsular capsulate/D capsule/DGS capsulisation capsulise/DGS capsulization capsulize/DGS capt captain/DGS captaincy captainship captan caption/DGMRS captionless captious/PY captivate/DGNS captivator captive/MS captivity captor/MS capture/DGRSZ capua capuche capuchin caput capybara car/MS carabao carabid carabineer carabiner carabinero carabinier carabiniere caracal caracalla caracara caracole caracoled caracoling caracolled caracolling caracul carafe carageen caramba caramel caramelisation/MS caramelise/DGS caramelization/MS caramelize/DGS carangid carapace/MS carat caratacus caravan/MRS caravanner caravansary caravanserai caravel caraway carbamate carbamic carbamidine carbanion carbarn carbaryl carbazole carbene carbide carbine/S carbineer carbohydrate/MS carbolated carbolic carboline carbolisation carbolise/DGS carbolization carbolize/DGS carbon/MS carbonaceous carbonade carbonado carbonate/DNS carbonatisation/MS carbonatization/MS carbonic carboniferous carbonisable/S carbonisation/AMS carbonise/DGRSZ carboniser/AS carbonises/A carbonium carbonizable/MS carbonization/AMS carbonize/DGRSZ carbonizer/AS carbonizes/A carbonless carbonous carbonyl carbonylic carborundum carboxy carboxyl carboxylase carboxylate/N carboxylic carboy carbuncle/D carbuncular carburation carburet carburetion carburetor/S carburetted carburetter carburisation carburise/DGS carburization carburize/DGS carby carbylamine carcajou carcanet carcase carcass/MS carcassonne carchemish carcinogen/S carcinogenesis carcinogenic carcinogenicity carcinoid carcinoma carcinomatosis card/DGMRS cardamom cardboard/S cardiac cardialgia cardigan/MS cardin cardinal/SY cardinalate cardinality/MS cardinalship cardiod cardiogram/MS cardiograph/R cardiographic cardiographs cardiography cardioid/MS cardiological cardiologist cardiology cardiomegaly cardiopathy cardiopulmonary cardiorespiratory cardiotonic cardiovascular cardiovasculatory carditis cardoon cardplayer cardsharp/R carduaceous carducci care/DGRSZ cared/U careen/DG career/DGMS careerism careerist/S carefree careful/PY carefuller carefullest careless/PY caress/DGRSV caressing/Y caressive/Y caret/S caretaker/S caretaking carew careworn carfare carfax carfuffle carful cargo/S cargoes carhop caria caribbees caribe cariboo caribou/S caricatural caricature/DS caricaturist carifta carillon carillonneur carina carinate caring/U carinthia carioca cariocan cariogenic cariole carious carle/G carline carload/GS carlota carlow carlsbad carmagnole carmaker carmarthen carminative carmine carnage carnal/Y carnalise/S carnality carnalize/S carnallite carnarvon carnassial carnatic carnation/IS carnauba carne carnelian carnet carney carnify carniola carnival/MS carnivore carnivorous/PY carnot carnotite carny carob caroche carol/MS caroled caroler/S caroling carolled caroller/S carolling carolus carom carotene carotenoid carotid carousal carouse/DGR carousel/MS carp/DGRS carpal carpel carpellary carpentaria carpenter/DGMS carpentier carpentry carpet/DGS carpetbag/MS carpetbagged carpetbagger/MS carpetbaggery carpetbagging carpi carping/Y carpogonium carpology carpometacarpus carpophagous carpophore carport carpospore carposporic carpus carrack carrageen carrefour carrel/S carriage/MS carriageway/S carriole carrion carronade carrot/MS carroty carrousel carry/DGRSZ carryall carrycot carryng carryon carryout carryover/S carse carsick carstensz cart/DGRSZ cartage cartagena carte cartel cartelisation/MS cartelise/S cartelization/MS cartelize/S cartels carteret cartful carthorse cartilage cartilaginous cartload/S cartogram/MS cartographer/S cartographic cartographical cartography cartomancy carton/MS cartoon/MS cartoonist/S cartop cartouche cartridge/MS cartulary cartwheel/RS cartwright carty caruncle caruncular carunculate/D carve/DGJRSZ carvel carven cary/S caryatid caryophyllaceous caryopsis carzey casa casaba/MS casablanca casals casaubon casbah cascabel cascade/DGS cascara cascarilla case/DGJS casease caseate/N casebearer casebook/S casebound casefy casein caseload/S casemate casement/MS caseose caseous casern caserne caserta casework/RZ caseworm cash/DGRSZ cashable cashbook cashew/S cashier/MS cashless cashmere casimere casino/S cask/MS casket/MS casque cassaba cassareep cassata cassation cassatt cassava cassel casserole/MS cassette/S cassimere cassini cassino cassiodorus cassirer cassite cassiterite cassock/D cassoulet cassowary cast/DGJMRSZ castanet/S castaway caste/DGHJMRSZ casteism castellammare castellan castellany castellated castigate/DNS castigator/S castiglione castile castle/DGS castoff/S castor castorised/MS castorized/MS castrate/DGNRSZ castrato castrator/S castratory castries casual/PSY casualty/MS casuist casuistic casuistical casuistry cat/MS catabasis catabolic catabolically catabolise catabolism catabolite catabolize catacaustic catachresis catachresti catachrestic catachrestical cataclasis cataclinal cataclysm cataclysmal cataclysmic catacomb catacombic catadromous catafalque catalase catalatic catalectic catalepsy cataleptic cataleptically catalo catalog/DGMRS catalogue/DGMRS cataloguers cataloguise/S cataloguize/S catalonia catalpa catalyse/RSZ catalyser/MS catalysis catalyst/MS catalytic catalytically catalyze/RSZ catalyzed catalyzer/MS catamaran catamenia catamite catamount catania catanzaro cataphoresis cataphyll cataplasia cataplasm cataplastic cataplexy catapult/DGS cataract/S cataractal catarrh catarrhal/Y catarrhine catastasis catastrophe/MS catastrophic catastrophically catastrophism catatonia catatonic catawba catbird catboat catcall catch/GRSZ catchable/U catchall catchee catcher/MS catchfly catchment catchpenny catchpole catchpoll catchup catchweight catchword/S catchy/R cate/NSX catechesis catechetical catechin catechisable/S catechisation/MS catechise/DGRSZ catechism catechismal catechist catechistic catechizable/MS catechization/MS catechize/DGRSZ catechol catecholamine/S catechu catechumen categoric categorical/Y categorisation/MS categorise/DGRSZ categorised/AU categorization/MS categorize/DGRSZ categorized/AU category/MS catena catenane catenary catenate/N catenoid catenulate cater/DGRS cateran catercorner cateress caterpillar/MS caterwaul catface/G catfall catfish catgut cathar catharses catharsis cathartic cathead cathect cathectic cathedra cathedral/MS cathepsin catheter/S catheterisation/MS catheterise/S catheterization/MS catheterize/S catheti/MS cathexes cathexis cathode/MS cathodic cathodically catholic/MS catholically catholicate catholicise/RSZ catholicises/U catholicism catholicity catholicize/RSZ catholicizes/U catholicon cathouse catiline cationic cationically catkin catlike catling catmint catnap/S catnip cato catoptric/S catoptrically catsup cattail cattalo catted cattegat cattermole cattery cattily catting cattle cattleman cattlemen catty/PRS catullus catwalk/MS cauca caucasia caucus/GS caudad caudal/Y caudate/DN caudex caudillo caudine caudle caught/U caul cauldron/S caulescent caulicle/S cauliflower/S cauline caulis caulk/RS causal/Y causalgia causality causate/V causation/MS causative/Y cause/DGRS caused/U causeless causerie causeway/MS causey/S caustic/SY caustically causticisation/MS causticise/RSZ causticises/A causticity causticization/MS causticize/RSZ causticizes/A cauterant cauterisation/MS cauterise/DGS cauterization/MS cauterize/DGS cautery caution/DGJRSZ cautionary cautious/IPY cauvery cavafy cavalcade/S cavalier/PY cavalierism cavalla cavalry cavalryman cavalrymen cavan cavatina cave/DGRS caveat/MS caveator cavefish caveman cavemen cavern/MS cavernicolous cavernous/Y caviar caviare cavicorn cavie cavies cavil cavilation caviled caviler/S caviling/S cavillation cavilled caviller caviller/S cavilling/S cavitary cavitate/N cavite cavity/MS cavort/DG cavy caw/DGS cay cayenne cayman cc cease/DGS ceasefire/M ceaseless/PY ceasing/U cecity cecum cedar cedarn cedarwood cede/DGR cedi cedilla ceefax ceil ceilidh ceiling/DMS ceilometer/MS ceinture celandine celaya celebrant/S celebrate/DGNSX celebrated/P celebrator/S celebratory celebrity/MS celeriac celerity celery celesta celestial/Y celestialise/S celestialize/S celestite celiac celibacy celibate/S cell/DS cella cellar/DGMRS cellarage/S cellaret/S cellarette/S celle cellini cellist/MS cello/S cellobiose celloidin cellophane cellular/Y cellularity cellulase cellule cellulitis celluloid/M cellulose/S cellulosic cellulous celom cembalo cement/DGRS cementation cementite cementitious cementum cemetery/MS cenacle cenesthesia cenis cenobite cenobitic cenobitical cenogenesis cenogenetic cenogenetically cenospecies cenotaph cenote cense/GR censor/DGS censored/U censorial censorious/PY censorship censurable censure/DGRS census/MS cent/S cental centare centaur/S centaurea centaury centavo centenarian centenary centennial/Y center/DGJMRSZ centerable/MS centerboard centerless centerline/S centerpiece/MS centesimal centesimo centiare centigrade/S centigram/MS centigramme/MS centiliter centilitre centillion centime centimeter/MS centimetre/MS centimetric centimo centipede/MS centipoise centisecond/S centner cento centones centra central/SY centrale centralisation/AMS centralise/DGRSZ centralises/A centralism centralist/S centralistic centrality centralization/AMS centralize/DGRSZ centralizes/A centre/DGMS centreboard centrefold centreing centreline/S centrepiece/MS centric centrically centricity centrifugal/SY centrifugalisation/MS centrifugalise/S centrifugalization/MS centrifugalize/S centrifugate/N centrifuge/DGMS centriole centripetal/Y centrism centrist centrobaric centroclinal centroid/S centroidal centromere centromeric centrosome centrosomic centrosphere centrosymmetric centrum centum centurial centurion century/MS ceorl cep cephalad cephalalgia cephalic cephalically cephalin cephalisation cephalization cephalochordate cephalometer cephalometric cephalometry cephalonia cephalopod cephalothorax cepstrum ceraceous ceram ceramal ceramic/S ceramicist ceramist ceramium cerargyrite cerastes cerate/D ceratoid cercaria cercopithecoid cercus cere/GS cereal/MS cerebellar cerebellum cerebral/Y cerebralisation/MS cerebralise/S cerebralization/MS cerebralize/S cerebrate/DGNSX cerebroside/S cerebrospinal cerebrovascular cerebrum cerecloth cerement ceremonial/PY ceremonialise/S ceremonialism ceremonialist/S ceremonialize/S ceremonious/PUY ceremony/MS ceresin cereus ceria ceric cerise cerium cermet cernuous cero cerography ceroplastic/S cerotic cerotype cerous cerro cert certain/UY certainty/SU certes certifiable certifiably certificate/DGNSX certificatory certified/U certify/DGNRSXZ certiorari certitude/S cerulean cerumen ceruminous ceruse cerussite cervelat cervical cervices cervicitis cervid cervin cervine cervix/S cesarean cesarian cesena cesium cespitose cess/R cessation/MS cession cessionary cesspit cesspool cesta cesti cestode cestoid cestus cesura cetacean/MS cetane cetatea cetera/S ceteris cetinje cetology ceuta cf chabazite chabrol chacma chaconne chadic chaeronea chaeta chaetognath chaetopod chafe/GR chaff/GR chaffer/DGR chaffey chaffinch chaffy chagall chagres chagrin/DGS chain/DGS chainlike chainman chainomatic chainplate chair/DGS chairborne chairlady chairman chairmanship/S chairmen chairperson/MS chairwoman chairwomen chaise chalaza chalcanthite chalcedonic chalcedony chalcid chalcidice chalcocite chalcography chalcolithic chalcopyrite chaldea chaldron chalet chaliapin chalice/DMS chalicothere chalk/DGS chalkboard chalkline chalkpit chalkstone chalky challah challenge/DGRSZ challenged/U challenging/Y challis chalone chalybeate chamade chamaephyte chamber/DGRSZ chamberlain/MS chambermaid/S chambord chambray/S chameleon/S chameleonic chameleonise/S chameleonize/S chamfer/DGS chamfron/S chammy chamois chamoix chamomile chamonix champ/SZ champac champagne champaign champak champertous champerty champignon champion/DGS championise/S championize/S championship/MS champlainian champollion chance/DGS chanceful chancel/S chancellery chancellor/S chancellorship/S chancellory chancery/S chancre/S chancroid chancroidal chancrous chancy/PR chandelier/MS chandelle chandernagore chandigarh chandler chandlery chandragupta chanel changan changchiakow changchow changchun change/DGRSZ changeability/U changeable/P changeably/U changed/U changeful/PY changeless/PY changeling changeover/MS changsha changteh channel/S channeled channeler/MS channeling channelisation/MS channelise/S channelization/MS channelize/S channelled channeller/MS channelling channing chanson chant/DGRS chanterelle chanteuse/S chantey chanticleer/MS chantry/S chanty/RS chanukah chaoan chaochow chaos chaotic chaotically chap/MS chaparejos chaparral chapati chapatti chapbook chape chapeau/S chapeaux chapel/MS chapelles chaperon/D chaperonage chaperone/S chapfallen chapiter chaplain/MS chaplaincy/S chaplet/DS chaplinesque chappal chappie chapping chapstick chapter/DGMS chapterhouse char/GS charabanc characin character/DGMS characterful characterisable/S characterisation/MS characterise/DGRSZ characterised/U characteristic/MS characteristically/U characterizable/MS characterization/MS characterize/DGRSZ characterized/U characterless characterological/Y charactery charade/S charas charcoal/DS charcot charcuterie chard chardin chare charente charge/DGRSZ chargeable/P charged/AU charges/A charily chariot/MS charioteer/S charism/S charisma charismata charismatic charitable/PU charitably/U charity/MS charivari charkha charlady/S charlatan charlatanism charlatanry charlatans charleroi charlock charm/DGRSZ charminar charming/Y charmless charnel charnock charollais charpoy charqui charr charred charring chart/DGJRSZ chartable charted/U charter/DGRSZ charterage chartered/U charterhouse chartering/A chartist/S chartless chartography chartreuse chartroom/S chartulary/S charwoman charwomen chary/PR chase/DGRSZ chasm/MS chassepot chasseur chassis chaste/PRTY chasten/DGR chastise/DGRSZ chastisement/S chastity/U chasuble chat/S chateau/MS chateaubriand chateaux chatelain/S chatelaine/S chatoyance chatoyancy chatoyant chattahoochee chatted chattel/S chattelisation/MS chattelise/S chattelization/MS chattelize/S chatter/DGRSYZ chatterbox/S chattily chatting chatty/PR chauffer chauffers chauffeur/DGS chaulmoogra chaunt chausses chaussure/S chauvinism/M chauvinist/MS chauvinistic chauvinistically chavannes chaw chayote cheap/NPRTXY cheapen/DGS cheapie cheapish/Y cheapskate/S cheat/DGRSZ cheb cheboksary check/DGRSZ checkable/U checkbits checkbook/MS checked/AU checker/DGS checkerberry checkerbloom checkerboard/S checkless checklist/S checkmark/S checkmate/DGS checkoff checkout/S checkpoint/MS checkrein checkroom/S checkrow checks/A checksum/MS checksummed checksumming checkup/S checky cheddar cheddite cheek/MS cheekbone/S cheekful cheekily cheekpiece cheeky/PR cheep/S cheer/DGRSYZ cheerful/PY cheerfulise/S cheerfulize/S cheerily cheerio cheerlead cheerleader/S cheerless/PY cheery/PR cheese/DGMS cheeseboard cheeseburger/S cheesecake/MS cheesecloth cheesecloths cheesemaker/S cheesemaking cheesemonger cheeseparer cheeseparing/S cheesewood cheesy/PR cheetah cheetahs chef/MS chefdom chefoo cheiron cheju chekhov chekiang chela chelatable chelate/DGNX chelicera chelicerate cheliform cheloid chelonian chelp chemic chemical/SY chemicalisation/MS chemicalise/S chemicalization/MS chemicalize/S chemiluminescence chemiluminescent chemin chemische chemise/S chemisette chemism chemisorb chemisorption chemist/MS chemistry/S chemmy chemnitz chemoautotrophic chemoautotrophically chemoautotrophy chemometrics chemoprophylaxis chemoreception chemoreceptive chemoreceptivity chemoreceptor/S chemosmosis chemosphere chemostat chemosynthesis chemotaxis chemotherapy/M chemotropism chempaduk chemulpo chemurgy chenab cheng chenille chenopod cheque/MRSZ chequebook/MS chequer/DS chequerboard cheribon cherish/DGRS cherishable cheroot cherry/MS cherrylike cherrystone chersonese chert cherub/MS cherubic cherubically cherubim cherublike chervil/S chervonets cheshunt chess chessboard/S chessman chessmen chest/RS chestful chestnut/MS chesty/R chetah chevalier cheveron chevet cheviot chevrette chevron/D chevrotain chew/DGRSZ chewa chewable chewie chewy chi chiack chianti chiapas chiaroscurist chiaroscuro chiasma chiasmatic chiasmus chiastic chiastolite chiat chiaus chiba chibouk chic/PY chicalote chicane chicanery chicaning chiccory chichagof chichen chichester chichewa chichi chichihaerh chick/NSX chickabiddy chickadee/MS chickasaws chicken/DGS chickenhearted chickenpox chickpea/MS chickweed/S chiclayo chicle chicory chicos chidden chide/DGS chief/MSY chiefdom/S chieftain/MS chieftaincy/S chieftainship chiffchaff chiffon chiffonier chifley chigetai chigger/S chignon chigwell chihli chilblain/S child/MY childbear childbearing childbed childbirth childbirths childcare childhood/S childish/PY childless/P childlike/P childminder/S childminding childrearing children/M chili chiliad chiliasm chilies chilkoot chill/DGPRSZ chilli chillily chilling/Y chillon chillum chilly/PRS chilopod chilpancingo chilung chimaera chimb chimborazo chimbote chime/DGMRS chimera chimere chimeric chimerical/Y chimerism chimkent chimney/DMS chimneypiece chimneypot chimp/S chimpanzee/S chin/MS china chinaberry chinagraph chinan chinaware chinbone chincapin chinch chincherinchee chinchilla chindit chindwin chine/S ching chinghai chingtao chink/DS chinkapin chinkiang chinless chinned chinner/S chinning chino chinoiserie chinos chinquapin chintz chintzy/R chinwag chios chip/MS chipboard chipmunk/MS chipolata chipped chipper chippewa chipping chippy chirac chirau chirico chirm chirographer chirographic chirographical chirography chiromancer chiromancy chiropodist/S chiropody chiropractic chiropractor/S chiropter chiropteran chirp/DGS chirpily chirpy chirrup/DGS chirurgeon chisel/S chiseled chiseler/S chiseling/S chiselled chiseller/S chiselling chiselling/S chishima chisimaio chit/S chital chitarrone chitchat chitin chitinous chitlings chiton chittagong chitter/DGS chitterlings chiv chivalric chivalrous/PY chivalrously/U chivalry chivaree chive/S chivvy/DG chivy/D chivying chlamydate chlamydeous chlamydospore chlodwig chloracne chloral chlorambucil chloramine chloramphenicol chlorate chlordane chlorenchyma chloric chloride/S chloridise/S chloridize/S chlorinate/DNS chlorine chlorinise/S chlorinity chlorinize/S chlorite chloritic chloroacetic chlorobenzene chloroform chloroformisation/MS chloroformise/S chloroformization/MS chloroformize/S chlorohydrin chlorophyll chlorophyllose chlorophyllous chloropicrin chloroplast/MS chloroplatinate chloroprene chloroquine chlorosis chlorothiazide chlorotic chlorous chlorpromazine chlorpropamide chlortetracycline choanocyte chock/DGMRS chockablock chocolate/MS chocolaty chogyal choice/PRSTY choir/MS choirboy choirmaster choiseul choke/DGRSZ chokeberry chokebore chokecherry chokedamp choking/Y choko choky cholecalciferol cholecyst cholecystectomy choler cholera choleraic choleric cholesterol choli cholic choline cholinergic cholinesterase cholla chollers cholon cholula chomp chon/I chondrify chondriosome chondrite chondroma chondrule choof chook choom choose/GRSZ choosey choosy/R chop/S chopfallen chophouse chopine choplogic chopped chopper/MS choppily chopping choppy/PR chopstick/S choragus choral/Y chorale/S chord/DGMS chordal chordata chordate chordophone chore/GNS chorea choreman choreodrama choreograph/DRZ choreographic choreographically choreography choriamb choric chorically chorine chorines chorisation/MS chorister chorization/MS chorizo chorley chorographic chorography choroid chorology chortle/DGS chorus/DS chorusmaster choryza chose chosen/U chota chott chough choux chow chowder/S chowderhead/D chowhound chowtime chrematistic chresard chrestomathy chrism chrismatory chrisom chrissake christen/DGS christsake chromate chromatic/PS chromatically chromaticism chromaticity chromatid chromatin chromatise/S chromatize/S chromatogram/MS chromatograph chromatographic chromatographically chromatography chromatology chromatolysis chromatolytic chromatophore chrome/DGS chromic chromicise/S chromicize/S chromide chrominance chromise/DGS chromite chromium chromize/DGS chromo chromogen chromogenic chromolithograph chromolithography chromomere chromonema chromophore chromoplast chromoprotein chromosomal chromosome/MS chromosomic chromosphere chromospheric chromous chromyl chronaxie chronic chronical chronically chronicity chronicle/DRSZ chronobiology chronogram/MS chronogrammatic chronogrammatical chronograph chronographic chronographs chronography chronologer/S chronologic chronological/Y chronologise/S chronologist/S chronologize/S chronology/MS chronometer/MS chronometric chronometrical/Y chronometry chronon chronoscope/S chrysalid chrysalis chrysanthemum/MS chrysarobin chryselephantine chrysoberyl chrysolite chrysoprase chrysostom chrysotile chthonian chub/S chubb chubbily chubby/PRT chubbyness chuck/DGMS chuckhole chuckle/DGS chucklehead/DS chucklesome chuckling/Y chuckwalla chudskoye chufa chuff/DG chuffy/R chug/S chugalug chugger chugging chukar chukka chukker chum/S chummily chumming chummy/PR chump/GMS chumship chunder chunderous chunk/MS chunkily chunky/R chunnel chunter chupatti/S chuppah chur church/DGSY churchgo churchgoer churchgoers churchgoing churchianity churchless churchly/P churchman churchmanship churchmen churchwarden/S churchwoman churchwomen churchy churchyard/MS churidars churinga churl/S churlish/PY churn/DGRSZ churr chute/DGMS chutist/S chutney/S chuttie chutzpa chutzpah chyack chyle chyme chymosin chymotrypsin chymotrypsinogen ciao cibber ciborium cic cicada/S cicala cicatricle cicatrix cicerone cichlid/S cider/S cienfuegos cig cigar/MS cigaret cigarette/MS cigarillo/S cii cil cilia ciliary ciliate/DSY cilice cilicia ciliolate cilium cimabue cimex cimon cinch/S cinchonidine cinchonine cinchonise cinchonism cinchonize cincture cinder/MS cindery cine cineaste cinema/S cinemagoer/S cinematheque cinematic cinematically cinematise cinematize cinematograph/R cinematographic cinematographical/Y cinematographs cinematography cineol cinerarium cinereous cinerin cingulum cinna cinnabar cinnamic cinnamon cinquain cinque cinquecento cinquefoil cinzano cipher/DGMS ciphertext ciphony cipolin circa circadian circassia circinate/Y circle/DGRS circlet circlorama circuit/DGMS circuital circuitous/PY circuitry circuity circulant circular/MPSY circularisation/MS circularise/DGRSZ circularity/S circularization/MS circularize/DGRSZ circulatable circulate/DGNSVX circulator/S circulatory circumambient/Y circumambulate/S circumbendibus circumcircle circumcise/DGNRSX circumcised/U circumference/S circumferential/Y circumflex/S circumfluent circumfluous circumfuse/DGNSX circumjacent circumlocution/MS circumlocutory circumlunar circummartian circumnavigate/DGNSX circumnavigator/S circumnutate circumpolar circumscissile circumscribe/DGS circumscription circumscriptions circumsolar circumspect/Y circumspection/S circumsphere circumstance/DGMS circumstantial/Y circumstantiality circumstantiate/DGS circumvallate/DGNSX circumvent/DGS circumventable circumvention/S circumvolution/S circus/MS circusy cirenaica cirencester cirque/S cirrate cirrhoses cirrhosis cirrhotic cirri cirripede cirrocumulus cirrose cirrostratus cirrous cirrus cirsoid ciscaucasia cisco ciskei cislunar cispadane cissoid cist cistaceous cistern/MS cisterna cistron cit citable citadel/MS citation/AMS citational citations/AI cite/ADGIS cithara cither citify/D citizen/MSY citizeness citizenise/S citizenize/S citizenry citizenship citole citral citrate/D citreous citric citriculture citrin citrine citron citronella citrulline citrus/S cittern/S city/DMS cityscape/S citywide ciudad civ civet civic/S civically civie/S civil/UY civilian/MS civilianisation/S civilianise/DGS civilianization/S civilianize/DGS civilisable/SU civilisation/AMS civilisational/MS civilise/DGRSZ civilised/PU civilises/AU civilists civility/S civilizable/MSU civilization/AMS civilizational/MS civilize/DGRSZ civilized/PU civilizes/AU civism civvy clabber clachan clack/RSZ clackmannan clactonian clad/S cladded cladding cladoceran cladode cladophora cladophyll claim/ADGRS claimable/A claimant/MS claimed/AU clairaudience clairvoyance clairvoyant/SY clam/MS clamant/Y clambake/S clamber/DGRS clammily clamming clammy/PR clamor/DGRSZ clamorer/MS clamorist/MS clamorous/PUY clamour/DGRSZ clamourer/MS clamp/DGRS clampdown clamshell/S clamworm/S clan/S clandestine/PY clang/DGRSZ clangor/DGMS clangorous/Y clangour/DGMS clank/DG clanking/Y clannish/PY clansman clansmen clap/S clapboard/S clapped clapper/S clapperboard/S clapperclaw clapping claptrap claque/S claret/S clarify/DGNRSX clarinet/S clarinetist clarinettist clarino clarion clarity/U claro clarridge clarts clary clash/DGRS clasp/DGRS class/DGRS classic/S classical/Y classicalise/S classicalism classicalist classicality classicalize/S classicisation classicise/DGS classicism classicist classicistic classicization classicize/DGS classifiable classificatorily classificatory classified/AU classifieds classify/DGNRSXZ classis classless/P classmate/MS classroom/MS classwork classy/PRT clastic clathrate clatter/DGRS clattering/Y clattery claudication clausal clause/MS claustral claustrophobia claustrophobic clavate clave/R clavicembalo clavichord clavichordist clavicle/MS clavicorn clavicular clavier clavierist clavieristic claviform clavius claw/DGRS clay/DGMS claybank clayey clayish claymore claypan claystone clayware clean/DGPRSTYZ cleanable cleaner/MS cleanhanded cleanly/PR cleans/DGRSZ cleanse/DGRSZ cleanskin cleanthes cleanup/MS clear/DGJPRSTY clearable clearance/MS clearcole clearcut cleared/U clearheaded/PY clearing/MS clearinghouse clearstory clearway/S clearwing cleat/DGS cleavage/S cleave/DGRSZ cleck cleek cleethorpes clef/MS cleft/MS cleg cleidoic cleisthenes cleistogamy clem clemence clemenceau clemency/I clemens clement/SY clemente clemently/I clench/DGS clenched/U cleon clepe/DGS clepsydra cleptomania clerestory clergy clergyman clergymen cleric/S clerical/SY clericalise/SU clericalism clericalist clericalize/SU clerihew clerk/DGMSY clerkess clerkship cleruchy cleveite clever/PRTY cleverish clevis clianthus cliche/MS clichy click/DGRSZ client/MS clientage cliental clientele cliff/MS cliffhang cliffhanger cliffhanging cliffy clii climacteric climactic climactically climate/MS climatic climatically climatise/S climatize/S climatological/Y climatologist/S climatology climax/DGS climb/DGRSZ climbable/U clime/MS clinandrium clinch/DGRS clinching/Y cline/S cling/GS clingfish clingy clinic/MS clinical/Y clinician/S clink/DRZ clinker/DGS clinkstone clinometer/IMS clinometric clinometry clinostat clinquant clip/MS clipboard/S clipped/U clipper/MS clippie clipping/MS clipsheet clique/MS cliquey cliquish/PY clishmaclaver clisthenes clitellum clitic clitoral clitoric clitoris cliv clix cloaca cloacal cloak/DGMS cloakroom/S clobber/DGS cloche clock/DGJRSZ clocklike clockmaker clockwatcher clockwise clockwork clod/MS cloddish/P cloddy clodhopper/MS clodhopping clog/MS clogged clogging cloister/DGMS cloistral cloistress clomb clomp/DGS clonal/Y clone/DGRSZ clonic clonicity clonk/DGS clonus clop/S clopped clopping closable/A close/DGJPRSTYZ closeable closed/IU closedown closefisted closemouthed closeness/S closeout closet/DS closetful closeup/S closure/DGMS clot cloth/DGS clothbound clothe/DGS clothed/U clothesbrush clotheshorse clothesline/S clothesman clothesmen clothespin clothespress clothier cloths clotted clotting cloture/DGS cloud/DGS cloudberry cloudburst/S clouded/U cloudily cloudland cloudless/PY cloudlet/S cloudscape cloudy/PRT clouet clough clout clove/RS cloven cloverleaf cloverleaves clovis clown/GS clownery clownish/PY cloy/G cloying/Y club/MS clubable clubbable clubbed clubber clubbing clubby/PR clubfoot/D clubhaul clubhouse clubland clubman clubroom/S cluck/DGS clucky clue/GMS clueing clueless clumber clump/DGS clumpy clumsily clumsy/PRT clung clunk/DGRS clunky/PY cluny clupeid clupeoid clustan cluster/DGJS clusterability clusterable clustered/AU clusters/A clustery clutch/DGS clutchy clutter/DGS cluttered/U clvi clvii clwyd clxi clxii clxiv clxix clxvi clxvii clydebank clype clypeus clyster cm cnidarian cnidoblast cnidus cnossus cnut coacervate coach/DGMRS coachman coachmen coachwood coachwork coact/V coaction coadapted coadjutant coadjutor coadjutrices coadjutrix coadunate/DGNS coagulability coagulable coagulant/S coagulase coagulate/DGNS coagulum coahuila coal/DGRS coalesce/DGS coalescence coalescent coalface coalfield/S coalfish coalify/N coalise/RSZ coalition coalitionist coalize/RSZ coalmine/S coalport coaming coapt/DGS coaptation/M coarctate/N coarse/PRTY coarsen/DG coarticulation coarticulatory coast/DGRSZ coastal coastguard coastguardman coastguardsman coastland coastline coastward/S coastwise coat/DGJRSZ coated/U coatee coati coatrack coatroom coattail/S coauthor coax/DGRS coaxial/Y cob/MS cobalt cobaltic cobaltite cobaltous cobber cobble/DGS cobbler/MS cobblestone/DS cobby cobden cobelligerent cobia coble cobnut cobra coburg cobweb/MS cobwebbed cobwebby coca cocaine cocainisation/MS cocainise/S cocainism cocainization/MS cocainize/S cocci coccid coccidioidomycosis coccidiosis cocciferous coccolith coccyx cochabamba cochairman cochairmen cochineal cochise cochlea cochleate cock/DGRS cockade/D cockalorum cockamamie cockatiel cockatoo cockatrice cockayne cockboat cockchafer cockcroft cockcrow cockerel cockeye/D cockeyed/PY cockfight/GMS cockhorse cockily cockle cockleboat cocklebur cockleshell cockloft cockney/S cockneyfy cockneyish cockneyism cockpit/S cockroach/S cockscomb cocksfoot cockshy cockspur cocksure cockswain cocktail/MS cockup cocky/PR coco/S cocoa coconscious/P coconspirator/S coconut/MS cocoon/MS cocopan cocotte cocoyam cocteau cocurricular cod/MS coda codable codasyl codder coddle/DGRS code/DGJMRSZ codebook/S codebreak codeclination coded/AU codefendant codeine codeless codeposit coder/MS codetermination codetermine/S codeword/MS codex codfish codger codices codicil codicillary codicology codifiability codification/MS codifier/MS codify/DGNRSXZ codling codomain codominant codominate/DGS codon codpiece/S codswallop coed/S coedit coedited coediting coeditor/MS coedits coeducation coeducational/Y coeducationalise/S coeducationalize/S coefficient/MSY coelacanth coelenterate coelenteron coeliac coelom coelostat coenacle coenamor/DGS coenamour/DGS coenobite coenocyte coenurus coenzyme coequal/Y coequalise/S coequality coequalize/S coerce/DGNSVX coercibility coercible/I coercive/PY coercivity coessential coetaneous coeternal/Y coeternity coeur coeval coevality coevolution coexecutor coexist/DGS coexistence coexistent coextend coextensive/Y cofactor/S cofeature coff coffee/MS coffeecup coffeehouse coffeepot coffer/MS cofferdam coffin/MS coffle/S cofunction cog/S cogency cogent/Y coggan cogged cogging cogitable/I cogitate/DGNSV cogito coglike cognac cognate/NSXY cognisable cognisably cognisance/AI cognisant/I cognise/DGRSZ cognition/AS cognitional cognitive/SY cognitivity cognizable cognizably cognizance/AI cognizant/I cognize/DGRSZ cognomen cognoscenti cogon cogwheel/S cohabit/DGS cohabitant/S cohabitation/S cohabitational cohabitee/S coheir coheiress cohere/DGRS coherence/I coherency coherent/IY cohesion cohesional cohesionless cohesive/PY coho cohobate cohomology cohort/MS cohosh cohune coidentity coif coiffeur coiffeuse coiffing coiffure/D coign coil/ADGS coilability coiled/AU coimbatore coimbra coin/DGRS coinage/A coincide/DGS coincidence/MS coincident/Y coincidental/Y coined/U coinsurance coinsure/R coir coire coit coital/Y coition coitional coitus coke/GS cokuloris col/Y cola colander/S colasanto colatitude/S colbert colcannon colchester colchicine colcothar cold/PRSTY coldblood coldhearted/PY coldish colectomy colemanite coleopteran coleoptile coleorhiza coles coleslaw colet coleus colewort coley coli colic colicky colicroot colicweed coliform coligny coliseum colitis coll collaborate/DGNSVX collaborationism collaborationist/S collaborative/Y collaborator/MS collage/S collagen collagist/S collapsar collapse/DGS collapsibility collapsible collar/DGS collarbone collard collarette collarless collate/DGNSVX collateral/Y collateralise collaterality collateralize collator/S colleague/MS colleagueship colleaguesmanship collect/ADGSV collectable collectanea collected/PY collectible collection/AMS collective/SY collectivisation/MS collectivise/DS collectivism collectivist/S collectivistic collectivistically collectivities collectivity collectivization/MS collectivize/DS collector/MS collectorate/S collectorship college/MS collegial/Y collegiality collegian/S collegiate/Y collegium collembolan collenchyma collet collide/DGS collie/DRS colliery/S colligate/NV collimate/DGNS collimator collinear collinearity collision/MS collisional/Y collisionless collocate/S collocation collocational collocutor collodion collogue/DG colloid colloidal/Y collop colloq colloquia colloquial/Y colloquialise/S colloquialism/MS colloquiality colloquialize/S colloquist colloquium colloquoy colloquy collotype collude/DGS collusion/S collusive/Y colluvial colluvium collywobbles colmar colocynth colog cologarithm cologne/D colombes colon/MS colonel/MS colonelcy colonial/PSY colonialise/S colonialism colonialist colonialistic colonialize/S colonic colonisability/MS colonisable/S colonisation/AMS colonisationist/MS colonise/DGRSZ colonised/U colonises/AU colonist/MS colonitis colonizability/MS colonizable/MS colonization/AMS colonizationist/MS colonize/DGRSZ colonized/U colonizes/AU colonnade/DS colonsay colony/MS colophon colophony coloquintida color/DGJMRSZ colorability/MS colorable/MPS colorably/SU colorama colorant/S colorate coloration coloratura colorcast/RZ colored/AU coloreds/U colorer/MS colorfast/P colorful/PY colorific colorimeter/MS colorimetric colorimetrically colorimetry colorism/S colorist/MS coloristic/S coloristically colorization/MS colorize/S colorless/PY colorman colormap/MS colormen colors/A colossae colossal/Y colossi colossians colossus/S colostomy colostral colostrum colotomy colour/DGJMRSZ colourability/MS colourable/PS colourables/U colourably/SU colourama colourant/S colouration colourcast/RZ coloured/AU coloureds/U colourer/MS colourfast/P colourful/PY colourific colourimeter/MS colourimetric colourimetrically colourimetry colourisation/MS colourise/S colourism/S colourist/MS colouristic/S colouristically colourless/PY colourman colourmap/MS colourmen colours/A coloury colpitis colporteur colquhoun colt/MRS coltish/PY coltsfoot colubrid colubrine colugo colum columbarium columbic columbine columbines columbite columbium columbous columella column/DMS columnar columniation columnisation/MS columnise/DGS columnist/S columnistic columnization/MS columnize/DGS columnwise colure coly colza com coma/S comae comaker comaneci comate comatose comatulid comb/DGJRSZ combat/DGSV combatant/MS combative/PY combatted combe combinability combinable combinate/V combination/AMS combinational/A combinator/MS combinatorial/Y combinatoric/S combinatory combine/DGRSZ comblike combo/S combust/GRV combustibility/I combustible/S combustibly combustion/S combustor/S come/GHJRSTYZ comeback comecon comedian/MS comedic comedie comedienne/S comedo comedown comedy/MS comely/PR comenius comestible/S comet/MS cometary cometic comeuppance comfit/S comfort/DGRSZ comfortability/S comfortable/P comfortably/U comforted/U comforting/Y comfortless comfrey comfy/R comic/MS comical/Y comicality comines comique comitia comity comma/MS command/DGMRSZ commandable commandant/MS commandeer/DGS commandership commandery commanding/Y commandment/MS commando/S commeasure commedia commemorate/DGNSVX commemorative/SY commemorator/S commence/DGRS commenced/A commencement/MS commences/A commend/ADGRS commendable/A commendably commendam commendation/AMS commendatory/A commensal/Y commensalism commensurability/I commensurable/I commensurably/I commensurate/NSXY comment/DGMRS commentary/MS commentate/S commentator/MS commented/U commerce/DG commercial/PSY commercialisation/MS commercialise/DGS commercialism commercialist commercialistic commercialization/MS commercialize/DGS commie commies commination comminatory commines commingle/D comminute/DN commis commiserate/DGNSV commissar commissariat commissary commission/DGRSZ commissionaire commissionership commissural commissure commit/S commitment/MS committable committal/A committed/U committee/MS committeeman committeemen committeewoman committeewomen committing commix commixture commo commode/S commodious/IPY commodity/MS commodore/MS commodus common/PRSTYZ commonable commonage commonality/S commonalty commoner/MS commonise/S commonize/S commonplace/PS commonsense commonsensible commonsensibly commonsensical commonweal commonwealth commonwealths commotion/S commove/DGS communal/Y communalisation/MS communalise/DGRSZ communalism communalist/S communality/S communalization/MS communalize/DGRSZ communard/S commune/DGNS communese communicability/I communicable/IU communicableness communicably/I communicant/MS communicate/DGNSVX communicatee communicatie communicational communicative/PY communicator/MS communicatory communique/S communisation/MS communise/DGS communism communist/MS communistic communistically communitarian communitarianism community/MS communization/MS communize/DGS commutable/I commutate/DGNSX commutative/Y commutativity commutator/S commute/DGRSZ comnenus como comorin comoro comoving comp compact/DGPRSTYZ compactible compactify compaction compactor/MS compadre compander/S companion/MS companionable/P companionably companionate companionise/S companionize/S companionship companionway/S company/MS comparability/I comparable/P comparably/I comparatist comparative/PSY comparativist comparator/MS compare/DGRS comparison/MS compart compartment/DGS compartmental compartmentalisation/MS compartmentalise/DGS compartmentalization/MS compartmentalize/DGS compartmentation/S compartmentise/S compartmentize/S compass/DGS compassable compassion compassionate/PY compassionless compatability compatibility/IMS compatible/PS compatibly/I compatriot/S compatriotic compeer compel/S compellable compellation compelled compeller compelling/Y compend compendia compendious/PY compendium compensability compensable compensate/DGNSVX compensational compensator/S compensatory compere/DG compete/DGS competence/S competency/S competent/IY competition/MS competitive/PY competitor/MS competitory compilability compilable compilation/MS compilations/A compile/DGRSZ compiler/MS complacence complacency complacent complain/DGRSZ complainant/S complaining/UY complaint/MS complaisance complaisant/Y compleat complect complected complement/DGRSZ complemental complementarily complementarity complementary/P complementation complementiser complementizer comples complete/DGNPRSVXY completed/U complex/PSY complexation complexion/D complexional complexity/S complexometric complexometry compliance/S compliancy compliant/Y complicacy complicate/DGNSX complicated/PY complicator/MS complice complicity compliment/DGRSZ complimentarily complimentary/U compline complot comply/DGNRSXZ compo/S component/MS componential componentry compony comport/D comportment compose/DGRSZ composed/PY composer/MS composite/NSXY compositional/Y compositor/S compossible compost compostela composure compotation compote compound/DGRS compoundable comprador comprehend/DGS comprehendible comprehending/U comprehensibility/I comprehensible/IP comprehensibly comprehension/I comprehensive/PY compress/DGSUV compressed/Y compressibility/I compressible/I compression/S compressional compressive/Y compressor/S comprisable comprisal/S comprise/DGS compromise/DGRSZ compromising/UY comptroller/MS comptrollership compulsion/MS compulsive/PSY compulsivity compulsorily compulsory compunction/S compunctious compurgation/S compurgator computability computable/IU computation/MS computational/Y compute/DGRSZ computer/MS computerese computerisable computerisation computerise/DGS computerite computerizable computerization computerize/DGS computerlike computernik comrade/SY comradely/P comradery comradeship comsat comstockery comsummatively comte con conan conation conative conatus concatenate/DGNSX concave concavity conceal/DGRSZ concealable concealing/Y concealment concede/DGRS conceded/Y conceit/DS conceited/PY conceivability/I conceivable/IU conceivableness conceivably/I conceive/DGRS concelebrate concensus concent concenter concentrate/DGNSVX concentrator/S concentre concentric concentrically concentricity concept/MSV conceptacle conception/MS conceptional conceptual/Y conceptualisation/MS conceptualise/DGRS conceptualising/A conceptualism conceptualist conceptualistic conceptualistically conceptuality conceptualization/MS conceptualize/DGRS conceptualizing/A conceptus concern/DGS concerned/UY concernment concert/DS concertante concerted/PY concertgoer concerti concertina concertino concertise/RSZ concertize/RSZ concertmaster concertmeister concerto/S concession/MRS concessionaire/S concessional concessionary concessive/Y conch/S concha conchie conchiferous conchiolin conchobar conchoid conchoidal conchology concierge/S conciliar/Y conciliate/DNSVX conciliator conciliatory/A concinnity/I concise/NPXY conclave/S conclude/DGRS conclusion/MS conclusive/IPY concoct/DRSV concoction concomitance concomitant/SY concord concordance concordant/Y concordat concorde concourse/S concrescence/S concrescent concrete/DGNPSY concretionary concretisation/S concretise/DGS concretism concretist concretistic concretization/S concretize/DGS concubinage concubine/S concupiscence concupiscent concupiscible concur/S concurred concurrence concurrency/S concurrent/Y concurring concuss/DGSV concussion/S concussive/Y condemn/DGRSZ condemnable condemnate condemnation/S condemnatory condemnor condensable condensate/SX condensation condensational condense/DGRSZ condensible condescend/GS condescendence condescending/Y condescension condign/Y condillac condiment/S condimental condition/DGRSZ conditionable conditional/SY conditionalise/S conditionality conditionalize/S conditionally/U conditioned/AU condo/MS condolatory condole/DG condolence/S condom condominial condominium/MS condoms condonable condonation condone/DGRS condor condottiere conduce/DGS conducive/P conduct/DGSV conductance/S conductibility conductible conductimetric conduction conductive/Y conductivity/S conductometric conductor/MS conductorial conductress conduit/S conduplicate/N condyle condyloid condyloma cone/DGMS coneflower coney confab confabbed confabbing confabulate/DNSX confabulator confabulatory confect/S confection/RSZ confectionary confectionery confederacy confederal confederalist/S confederate/NSVX confederatise/S confederatize/S confer/S conferee/S conference/GMS conferential conferment/S conferrable conferral/S conferred conferrer/MS conferring confess/DGS confessable confessant confessed/Y confession/MS confessional/SY confessionalism confessionalist confessor/MS confetti confidant/MS confidante/S confide/DGRS confidence/S confident/Y confidential/PY confidentiality confiding/PY configurable/A configural configurate/DGSV configuration/AMS configurational/Y configurationism configure/ADGS confine/DGRS confined/U confinement/MS confirm/DGS confirmability confirmable confirmand confirmation/MS confirmational confirmatory confirmed/PY confiscable confiscatable confiscate/DGNSX confiscator/S confiscatory confiteor confiture conflagrant conflagrate/DS conflagration/S conflagrator/S conflagratory conflate/DGNSX conflatrate/G conflict/DGSV conflictful conflicting/Y confliction/S conflictless conflictual confluence/S confluent/S conflux/S confocal conform/DGRSZ conformability conformable/U conformably/U conformal conformance conformation/MS conformational/Y conformism conformist/S conformity/IU confound/DGRS confounded/Y confraternity/S confrere/S confront/DGRSZ confrontal confrontation/MS confrontational confrontationism confrontationist confuse/DGNRSXZ confused/PY confusing/Y confusional confutation/S confutative confutator/S confute/DGRS cong/R conga congeal/DGS congealment congelation/S congener congeneric congenial/Y congenialise/S congeniality/U congenialize/S congenital/Y congeries congest/GSV congested congestion congius conglobate conglomerate/DNSVX conglomeratic conglomerator conglutinant conglutinate/DGNS congou congrats congratulate/DNSX congratulator congratulatory congregant congregate/DGNSX congregational congregationalise/S congregationalism congregationalist/S congregationalize/S congregator congress/DGMS congressional/Y congressman congressmen congresswoman congresswomen congretants congruence/I congruency congruent/IY congruential/Y congruity/I congruous/IPY conic/S conical/PY conicity conidiophore conidium conifer/S coniferous coniine coniology conjectural/Y conjecture/DGRS conjoin/GS conjoined conjoint/Y conjuction conjugacy conjugal/Y conjugality conjugant/S conjugate/DGNPSVXY conjugational/Y conjunct/DSV conjunction/MS conjunctional/Y conjunctiva conjunctival conjunctive/Y conjunctivitis conjuncture/S conjuration/S conjure/DGRSZ conjuror conk/DGRSZ conn/DGRV connacht connate/Y connatural/Y connaturality connaught connect/DGRSVZ connectable connected/PY connectible connection/MS connectional connective/MSY connectivity/S connector/MS connelly connemara connexion connexions conniption connivance connive/DGRS connivent connivery connoisseur/MS connoisseurship connotation/S connotational connotative/Y connote/DGS connubial/Y connubialism connubiality conodont conoid conoscenti conquer/DGRSZ conquerable/U conqueror/MS conquest/MS conquian conquistador/S conquistadores cons consanguine consanguineous/Y consanguinity conscience/MS conscienceless conscientious/PY conscionable/U conscionably conscious/PSY conscribe/DGS conscript/DGS conscription/S consecrate/DGNSVX consecrator consecratory consecution consecutive/PY consensual/Y consensus consent/DGRSZ consentaneous/Y consentient consenting/Y consequence/MS consequent/PSY consequential/PY consequentiality/S consequentially/I consequently/I conservancy conservation/MS conservational conservationist/MS conservatise/DGS conservatism conservative/PSY conservatize/DGS conservatoire conservator conservatorial conservatorium conservatory conserve/DGRS consett consider/DGRS considerable/I considerably/I considerate/NPXY consideration/AI considered/AU consign/DGS consignable consignation consignee consignment consignor consist/DGS consistence/I consistency/IS consistent/IY consistorial consistory consociate/N consociational consocies consol/S consolable/I consolation/MS consolatory console/DGRSZ consolette consolidate/DGNSX consolidated/AU consolidates/A consolidator/S consoling/Y consolute consonance/I consonancy consonant/MSY consonantal consonantise/S consonantize/S consort/DGS consortium conspecific conspectus/S conspicuity conspicuous/IPY conspiracy/MS conspiration/S conspirational conspirator/MS conspiratorial/Y conspire/DGS constable/MS constabulary constance constancy/I constant/SY constantan constantly/I constatation constellate constellation/MS constellatory consternate/DGS consternation constipate/DGNS constituency/MS constituent/MSY constitute/DGNSVX constituted/A constitutes/A constitutional/UY constitutionalisation/MS constitutionalise/S constitutionalism constitutionalist constitutionality/U constitutionalization/MS constitutionalize/S constitutionless constitutive/Y constrain/DGS constrained/Y constraint/MS constrict/DGSV constriction/S constrictor/S constringe/DGS constringent construable construal construct/ADGSV constructibility constructible/A construction/MS constructional/Y constructionist/A constructions/A constructive/PY constructivism constructivist constructor/MS construe/DGS consubstantial consubstantiate/N consuetude consuetudinary consul/MS consular consulate/MS consulship consult/DGRSV consultancy/S consultant/MS consultantship consultation/MS consultative consultor consumable/S consume/DGRSZ consumed/Y consumer/MS consumerism consumerist consumership consuming/Y consummate/DGNSVXY consummator consummatory consumption/MS consumptive/Y cont'd contact/DGS contacted/A contactor contagion contagious/PY contagium contain/DGRSZ containable containerboard containerisation containerise/DGS containerization containerize/DGS containment/MS contaminant/S contaminate/DGNSVX contaminated/U contaminator contango contemn contemplate/DGNSVX contemplative/PY contemplator contemporaneity contemporaneous/PY contemporarily contemporary/PS contemporisation contemporise/DGS contemporization contemporize/DGS contempt contemptible/P contemptibly contemptuous/PY contend/DGRSZ contendere content/DGSY contented/PY contention/MS contentious/PY contentment conterminous/Y contest/DGRSZ contestable/I contestant/S contestation contested/U context/MS contextual/Y contexture contiguity contiguous/PY continence/I continent/MSY continental/Y continently/I contingence contingency/MS contingent/MSY continously continua continual/Y continuance/MS continuant continuate/DGSV continuation/MS continuative/Y continuator continue/DGRS continuity/S continuo continuous/PY continuum conto contort/DGSV contortion/S contortionist/S contortionistic contour/DGMS contraband contrabandist contrabass contrabassist contrabassoon contraception contraceptive/S contract/DGSV contractibility contractible contractile contractility contraction/MS contractional contractor/MS contractual/Y contracture contradance contradict/DGS contradictable contradiction/MS contradictious contradictor contradictorily contradictory/P contradistinct/V contradistinction/S contradistinctive/Y contradistinguish contrail contraindicate/DGNSVX contraindication/MS contralateral contralto contraoctave contraposition contrapositive/S contraption/MS contrapuntal/Y contrapuntist contrariety/S contrarily contrarious contrariwise contrary/P contrast/DGRSVZ contrastable contrasting/Y contrastive/Y contrasty contrasuggestible contrate contravallation contravariant contravene/DGRS contravention contrayerva contredanse contretemps contribute/DGNRSVXZ contributive/Y contributor/MS contributorily contributory contrite/NPY contrivance/MS contrive/DGRS control/MS controllability/U controllable/IU controllably/U controlled/U controllee/S controller/MS controllership/S controlling controlment/S controversial/Y controversialise/S controversialism controversialist controversialists controversialize/S controversy/MS controvert/DGRS controvertible/I contumacious/Y contumacy contumelious/Y contumely contuse/DGS contusion/S conundrum/MS conundrumise/S conundrumize/S conurbation/S conure convalesce/G convalescence convalescent convect/DGSV convection/S convectional convector/S convene/DGRSZ convened/A convenes/A convenience/MS conveniency/I convenient/IY convent/MS conventicle/R convention/MS conventional/UY conventionalisation/MS conventionalise/GS conventionalised conventionalises/U conventionalism conventionalist conventionality/U conventionalization/MS conventionalize/GS conventionalized conventionalizes/U conventioneer conventionise/S conventionize/S conventual/Y converge/DGS convergence/S convergency convergent conversable conversance conversancy conversant/Y conversation/MS conversational/Y conversationalist conversationise/S conversationize/S converse/DGNSXY conversion/GS conversional convert/DGRSZ convertibility/I convertible/IU convertibleness convertibly/I convertiplane convertite convertor converts/A convex convexity convey/DGRSZ conveyance/DGMRSZ conveyor/S conveyorise/DGS conveyorize/DGS convict/DGSV conviction/MS convince/DGRSZ convinced/U convincing/PUY convivial/Y convivialise/S conviviality convivialize/S convocate convocation/S convocational convoke/DGS convolute/NXY convoluted convolutional convolve/DGS convolvulaceous convoy/DGS convulsant convulse/DGSV convulsion/MS convulsionary convulsive/PY cony coo/G cooch cooee cook/DGMRSZ cookbook/S cookery cookhouse cookie/MS cookout/S cookshack cookshop cookware cooky/S cool/DGJPRSTYZ coolabah coolant/S cooled/U cooler/MS coolgardie coolheaded coolie/MS coolish coolness/S coom coomb/S coon/MS cooncan coonskin coontie coop/DRSZ cooper/DGS cooperage cooperate/DGNSVX cooperationist cooperative/PSY cooperativity cooperator/MS coopt coordinal coordinate/DGNPSVXY coordinated/U coordinator/MS coot cootch cootie cop/MS copacetic copaiba copal copalm coparcenary coparcener copartner copartnership cope/DGJRS copeck copemate copepod copesetic copesmate copestone copilot copious/PY copita coplanar coplanarity copley copliots copolymer/S copolymerisation/MS copolymerise/DGS copolymerization/MS copolymerize/DGS copper/DGMS copperas copperhead copperisation/MS copperise/S copperization/MS copperize/S copperplate coppersmith coppersmiths coppery coppice copping copra coprinus coprocessor/MS coproduct/MS coprolalia coprolite coprolitic coprology coprophagous coprophilia coprophilous cops/S copse/S copter/S copula/S copulate/DGNSV copulative/Y copulatory copy/DGRSZ copybook/S copyboy copycat/S copycatted copycatting copydesk copygraph copyhold/R copyist copyread copyreader copyright/DGMRSZ copywriter coquelicot coquet coquetry coquette/DG coquettish/PY coquilla coquina coquito coraciiform coracle coracoid coral coralberry coraled coralled coralline corallite coralloid coralroot coranto corban corbeil corbel corbeled corbeling/S corbelled corbelling corbelling/S corbicula corbie corbusier corby corcyra cord/ADGRS cordage cordate/Y corday cordeliers cordial/PY cordialise/S cordiality cordialize/S cordierite cordiform cordillera/S cordite cordless cordoba cordon cordova corduroy/S cordwain/R cordwainery cordwood core/DGRSZ corecipient cored/A corelate/N coreligionist corella corelli corequisite corespondent corf corfam corfu corgi coriaceous coriander corinthians coriolis corium cork/DGRSZ corkage corkboard/S corked/U corkscrew/S corkwood corky/R cormel cormophyte cormorant/S corn/DGRSZ cornball cornbread corncob corncockle corncrake corncrib cornea corneal corneille cornel cornelian corneous corner/DGS cornerman cornerstone/MS cornerways cornerwise cornet cornetcy cornetist cornett cornettist cornfield/MS cornflakes cornflour cornflower cornhusk cornhusking cornice/DGS corniche corniculate cornification cornily cornmeal cornmonger corno cornstalk cornstarch cornstone cornu cornucopia cornucopian cornute cornwallis corny/PRT corody corolla corollaceous corollary/MS corollate coromandel corona coronach coronagraph coronal coronary/S coronate coronation coroner/S coronet/DMS coronograph corot coroutine/MS corozo corpocracy/S corpora corporal/MSY corporality corporate/NVXY corporation/MS corporatism corporatist corporativism corporator/I corporeal/PY corporealisation/MS corporealise/S corporeality corporealization/MS corporealize/S corporeally/I corporeity/I corporis corposant corps/S corpse/MS corpsman corpsmen corpulence/S corpulency/S corpulent/PY corpulentness/S corpus corpuscle/MS corpuscular corpusculated corpuscule/S corrade/DG corral/S corralled corralling corrasion/S corrasive correct/DGPSVY correctable/U corrected/U correction/S correctional correctitude corrective/PSY corrector correggio corregidor correlatable correlate/DGNSVX correlated/U correlational correlative/Y correlator correspond/DGS correspondence/MS correspondency correspondent/MS corresponding/Y corresponsive corrida corridor/MS corrientes corrigenda corrigendum corrigibility/I corrigible/I corrigibly/I corrival corroborant corroborate/DGNSVX corroborative/Y corroborator/S corroboratory corroboree corrode/DGS corrodent corrodible corrody corrosion/S corrosive/PSY corrugate/DGNSX corrugator corrupt/DGRSVY corruptibility corruptible/I corruptibly/I corruption/I corruptionist corruptive/Y corsac corsage/S corsair corse corselet corset/S corsetry corsica corsican cortege/S cortex/S cortical/Y corticate/D cortices corticoid corticosteroid/S corticosterone corticotrophin cortisol cortisone cortot corundum corunna coruscate/DGNSX corvallis corves corvette corvine corymb coryphaeus coryza cos cosa cosec cosecant cosech coseismal cosenza coset cosgrave cosh/R cosignatory cosigner cosily cosine/S cosmetic/S cosmetician/S cosmetologist/S cosmetology cosmic cosmical/Y cosmine cosmo cosmochemical cosmochemistry cosmodrome cosmogenic cosmogonic cosmogonical cosmogonist cosmogony cosmographer cosmographic cosmographical/Y cosmography cosmoid cosmologic cosmological/Y cosmologist/MS cosmology cosmonaut cosmopolis cosmopolitan cosmopolitanisation/MS cosmopolitanise/S cosmopolitanism cosmopolitanization/MS cosmopolitanize/S cosmopolite cosmopolitism cosmos/S cosmotron cospar cosponsor/DS cosponsorship coss cossack/S cosset/DGS cossie cost/DGSVY costa costal costard costate costermonger costive/PY costless/Y costly/PR costmary costotomy costrel costume/DGRSZ costumery costumey costumier cosy cot/MS cotan cotangent cote cotemporary cotenant coterie/S coterminosity coterminous/Y coth cothurnus cotidal cotillion cotillon cotman cotoneaster cotonou cotopaxi cotquean cotswold/S cotta cottage/RSZ cottagey cottbus cotter/S cottian cotton/DGS cottonade cottonisation/MS cottonise/S cottonization/MS cottonize/S cottonmouth cottonseed cottontail/MS cottonweed cottonwood cottony cotty cotyledon/MS cotyloid coucal couch/DGS couchant couchette cougar/S cough/DGR coughs could've could/T couldn't couldst coulee coulibiaca couloir coulomb coulometer/S coumarin coumarone council/MS councillor/MS councillorship councilman councilmanic councilmen councilor/M councilorship councilwoman councilwomen counsel/MS counseled counselee counseling counselled counsellee counselling counsellor/MS counsellorship counselor/MS counselorship count/DGRSZ countability countable/U countably/U countdown/MS counted/AU countenance/R counter/DGS counteract/DGSV counteraction counterargument/S counterattack/R counterattraction counterbalance/DGS counterblast counterblow counterchallenge counterchange countercharge countercheck counterclaim counterclockwise counterculture countercurrent/Y countercyclical counterespionage counterexample/S counterfactual counterfeit/DGRS counterflow counterfoil counterforce counterglow counterinsurgency counterintelligence counterintuitive counterirritant counterman countermand/DGS countermarch countermeasure/MS countermen countermove countermovement counteroffensive counteroffer counterpane counterpart/MS counterplan counterplea counterplot counterpoint/G counterpoise counterpose/DGS counterposition counterproductive counterproof counterproposal counterpunch/R counterreformation counterrevolution counterrevolutionary/MS counterrevolutionist countershade/DGS countershaft/S countersign countersignature countersink/GS counterspy counterstatement countersubject countersunk countertenor/S counterterrorism counterterrorist counterthreat/MS countertrend countertype countervail/DGS counterview counterweigh counterweight/DGMS counterword counterwork countess countless/Y countrify/D country/MS countryfied countryish countryman countrymen countryseat countryside countrywide countrywoman county/MS countywide coup/AS coupal coupe couple/DGJMRSZ couplement couplet/MS coupon/MS courage courageous/PY courante courantyne courbet courbevoie coureur courgette courier/MS courlan course/DGRS courses/A coursework court/DGRSYZ courtelle courteous/PY courtesan courtesy/MS courthouse/MS courtier/MS courtly/P courtmartial courtrai courtroom/MS courtship courtyard/MS couscous cousin/MS cousinage cousinhood cousinship couth couthie couture couturier couturiere couvade covalence covalency covalent/Y covariance/S covariant/S covariate/NS covary cove/GRSZ coven covenant/DGMRS covenantal covenanted/U covenantee covenantor covent coventry cover/DGJRS coverable/A coverage coverall/DS coverdale coverless coverlet/MS coverley coversed covert/PY coverture/S covet/DGRS covetable coveting/Y covetous/PY covey/S covin covington cow/DGMS cowage coward/SY cowardice cowardly/P cowbane cowbell cowberry cowbind cowbird/S cowboy/MS cowcatcher cowed/Y cower/DGRSZ cowering/Y cowes cowfish cowgirl/MS cowhand/S cowherb cowherd cowhide/DG cowitch cowk cowl/DGS cowley cowlick cowman cowmen coworker/MS cowpat cowpea cowper cowpoke cowpony cowpox cowpunch/R cowry cowskin cowslip/MS cox coxa coxalgia coxcomb/S coxcombry coxsackie coxswain coy/PY coyote/MS coyotillo coypu coz cozen cozily cozy/PRS cpr crab/MS crabapple crabbe crabbed/PY crabber crabbing crabby/R crabmeat crabstick crabwise crack/DGRSYZ crackajack crackbrain/D crackdown crackerjack cracket crackjaw crackle/DGS cracknel crackpot/S cracksman cracow craddock cradle/DGRS cradlesong craft/DGRS craftily craftsman craftsmanlike craftsmanship craftsmen craftspeople craftsperson craftswoman craftswomen crafty/PR crag/MS cragged craggily craggy/PR cragsman craigie craiova crake cram/S crambo crammed crammer cramming cramoisy cramp/DMRS crampon/MS cran cranach cranage cranberry/MS crane/DGMS cranelike craneman cranemen cranesbill crania cranial/Y craniate craniology craniometer craniometry craniotomy cranium crank/DGS crankcase crankily cranko crankpin crankshaft cranky/PRT cranmer crannog cranny/DS cranwell crap/GS crapaud crape crapper crappie/R crapping crappy crapshooter crapulent crapulous craquelure crash/DGRSZ crashable crashaw crashworthy/P crasis crass/PTY crassitude crassulaceous crassus cratch crate/GRSZ crater/DS craterlet craunch cravat/MS crave/DGRS craven/PY craw/Y crawl/DGRSZ crawlerise/S crawlerize/S crawley crawlspace crawlway cray crayfish crayon/S crayonist craze/DGS crazily crazy/PRT creak/DGS creakily creaky/R cream/DGRSZ creamcups creamery creamily creamlaid creamy/P crease/DGIRS creaseless create/ADGNSVX created/AU creatine creatinine creationism/M creative/PY creativity creator/MS creatural creature/MSY creaturehood creaturely/P creaturise/S creaturize/S creche/S credence credendum credent credential/S credenza credibility/I credible/I credibly/I credit/DGS creditability creditable/P creditably creditor/MS credo/S credulity/I credulous/PY credulously/I cree creed/MS creedal creek/MS creekside creel/S creep/GRSZ creepage creepie creepy/PR creese creighton cremate/DGNSX cremator crematorium crematory cremona crenate/DNY crenel crenelate/DNS creneled creneling crenellate/DN crenellate/DNS crenelle crenelled crenelling crenulate/DN creodont creophagous creosol creosote crepe crepey crepitant crepitate/N crepitus crept crepuscle crepuscular crepuscule crepy crescendo crescent/MS crescentic crescive/Y cresol cress cresset cressy crest/DGS crestal crestfallen/PY crestless cresylic cretin/S cretinisation/MS cretinise/S cretinism cretinization/MS cretinize/S cretinous cretonne creuse crevasse crevice/MS crew/DGS crewcut crewe crewel crewelwork crewless crewman crewmember/S crewmen crib/MS cribbage/M cribber cribbing cribellum cribriform crick cricket/GMRS cricoid crikey crim crime/MS criminal/SY criminalisation/M criminalise criminality criminalization/M criminalize criminate/GN criminological/Y criminologist criminology criminous crimmer crimp/DGRS crimple crimplene crimpy/R crimson/G cringe/DGRS cringle crinite crinkle/DGS crinkleroot crinkly crinoid crinoline criollo cripes crippen cripple/DGRS cripps crises criseyde crisis crisp/PRSY crispate/N crispbread crispi crispy/PR criss crisscross/DS crissum crista cristate cristobalite criteria criterion critic/MS critical/PY criticality critically/U criticaster criticisable/SU criticise/DGRSZ criticised/U criticises/A criticising/UY criticisingly/S criticism/MS criticizable/MSU criticize/DGRSZ criticized/U criticizes/A criticizing/UY criticizingly/S critique/DGS critter/MS croak/DGRSZ croaky croatian croce crocein crochet/DGRS crocidolite crock/DRS crockery crocket/D crocodile/S crocodilian crocoite crocus/S croesus croft/RZ crofterisation/MS crofterise/S crofterization/MS crofterize/S croissant/S crombec cromlech crone/S cronk cronus crony/S cronyism crook/DS crookback/D crooked/PY croon/DGRSZ crop/MS cropland/MS cropped cropper/MS cropping croquet croquette crore crosier cross/DGJRSYZ crossability crossable crossarm crossbar/MS crossbeam crossbearer crossbill crossbones crossbow crossbowman crossbred/I crossbreed crosscheck crosscurrent/S crosscut crosse crossfire crosshatch/DGS crosshead crossjack crosslet crosslink/MS crossopterygian crossover/MS crosspatch crosspiece crosspoint crosspool crossproduct/S crossroad/GS crossruff crosstabulate/N crosstalk crosstie/S crosstown crosstree crosswalk crossway/S crosswind crosswise crossword/MS crotch/DS crotchet/DGS crotchety/P croton crotone crotonic crouch/DGS croup croupier croupous croupy crouse croute crouton croutons crow/DGS crowbait crowbar/MS crowberry crowboot crowd/DGRS crowded/P crowfeet crowfoot/S crowkeeper crown/DGRS crowned/U crownet crownpiece crownwork croze crozier cru/S cruces crucial/Y crucian cruciate/Y crucible crucifer cruciferous crucifix crucifixion cruciform/Y crucify/DGNS cruck crud crudded crudding cruddy crude/PRTY crudity/S cruel/PRTY cruelise/S cruelize/S crueller cruellest cruelty cruet cruft crufty cruise/DGRSZ cruiserweight cruiseway cruller crumb/SY crumble/DGJS crumbly/PR crumby/R crumhorn crummock crummy/RS crump crumpet crumple/DGS crunch/DGRSZ crunchy/PRT crunode crupper crura crural crusade/DGRSZ crusado cruse crush/DGRSZ crushable/U crushing/Y crushproof crust/DGMS crustacea crustacean/MS crustaceous crustal crustification crustily crustose crusty/PR crutch/DMS crux/MS cruyff cruzado cruzeiro crwth cry/DGRSZ crybaby cryer crymotherapy cryobiological/Y cryobiologist/S cryobiology cryocable cryogen cryogenic/S cryogenically cryogeny cryohydrate cryolite cryometer cryonic/S cryophilic cryophyte cryoplankton cryoscope cryoscopic cryoscopy cryostat cryosurgery cryotherapy cryotron crypt/S cryptaesthesia cryptal cryptanalysis cryptanalyst cryptanalytic cryptanalyze cryptic cryptical/Y crypto/S cryptoclastic cryptocrystalline cryptogam cryptogenic cryptogram/MS cryptogrammic cryptograph cryptographer cryptographic cryptographically cryptography cryptologic cryptological cryptologist cryptology cryptozoic cryptozoite cryst crystal/MS crystalize/DGRS crystalized/AU crystalizes/A crystalline crystallisability/MSU crystallisable/SU crystallisation/AMS crystallise/DGRSZ crystallised/AU crystallises/A crystallite/S crystallizability/MSU crystallizable/MSU crystallization/AMS crystallize/DGRSZ crystallized/AU crystallizes/A crystallographer/S crystallographic crystallographica crystallographical/Y crystallography crystalographical/Y ctenidium ctenoid ctenophore ctesiphon cub/MS cubage cubane cubature cubby/S cubbyhole cube/DGRS cubeb cubic/SY cubical/Y cubicle cubicles cubiculum cubiform cubism cubist/S cubistic cubit cubital cuboid cuboidal cucking cuckold cuckoldry cuckoo/MS cuckooflower cuckoopint cuculiform cucullate/DS cucumber/MS cucurbit cud cudbear cuddle/DGS cuddleback cuddlesome cuddly/R cuddy cudgel/MS cudgeled cudgeler/S cudgeling/S cudgelled cudgeller/S cudgelling/S cudgerie cudweed cue/DGS cueing cuenca cuernavaca cuesta cuff/DGMS cuffless cufflink/S cufic cuirass cuirassier cuisine cuisse cuke culation culch culebra culet culicid culinary cull/DGRS cullender cullet cullis culloden cully culm culmiferous culminant culminate/DGNS culotte/S culpa/S culpability culpable/P culpably culprit/MS cult/MS cultch cultic cultigen cultism cultist/S cultivability cultivable cultivar/S cultivatable cultivate/DGNSX cultivator/MS cultrate cultural/Y culture/DGS culturisation/MS culturise/S culturization/MS culturize/S culverin culvert cum cumae cumber cumbernauld cumbersome/PY cumbria cumbrous/PY cumin cummerbund cumquat cumshaw cumulate/DGNSX cumulative/Y cumulet cumuliform cumulonimbus cumulostratus cumulous cumulus cunaxa cunctation cunctative cuneal cuneate/Y cuneiform cuneo cunjevoi cunner cunnilinctus cunnilingus cunning/PY cunt cup/MS cupbearer cupboard/MS cupcake cupcakes cupel cupelation cupeled cupeler/S cupeling cupellation cupelled cupeller cupeller/S cupelling cupful/S cupidity cuplike cupola cuppa cupped cupping cuppy/R cupreous cupric cupriferous cuprite cuprous cuprum cupsful cupular cupulate cupule cur/S curability/I curable/IP curably/I curacy curare curarine curarise/DGS curarize/DGS curassow curate/V curatise/S curative/Y curatize/S curator/S curatorial curatorship curb/DGS curbside curbstone curch curd curdle/DGS curds cure/DGJRSZ cured/U cureless curet curettage curette/DG curettement curfew/MS curia curiae curie curio/S curiosa curiosity/MS curious/PRTY curite curitiba curium curl/DGRSZ curled/U curlew curlicue curlpaper curly/PR curmudgeon/Y currajong currant/MS currawong currency/MS current/PSY currently/A curricle curricula curricular curricularisation/MS curricularise/S curricularization/MS curricularize/S curriculum/MS currie curriery currish/Y curry/DGRS currycomb curs/ADGSV curse/ADGSV cursed/PY cursive/APY cursor/MS cursorial cursorily cursory/P curst curt/PY curtail/DGRS curtailment curtain/DGS curtal curtesy curtilage curtin curtsey/DGS curtsy/DGMS curule curvaceous/Y curvacious curvature/S curve/DGS curveball curved/A curvilineal curvilinear/Y curvilinearity curvy curzon cusco cusec cush cushat cushily cushion/DGS cushionless cushiony cushy/T cusk cuso cusp/MS cuspate/D cuspid cuspidate/DN cuspidor cuss/DRS cussed/PY cussword/S custard custodial custodian/MS custodianship/S custody/S custom/RSZ customable customarily customary/P customer/MS customhouse/S customisable customisation/MS customise/DGRSZ customizable customization/MS customize/DGRSZ customshouse custos custumal cut/MS cutability cutaneous/Y cutaround cutaway cutback/S cutch cutcherry cute/PRTY cutes cutesy cutey/S cuticle/S cuticula cuticular cutie cutin cutinise/DGS cutinize/DGS cutis cutisation/MS cutization/MS cutlass cutler cutlery cutlet/S cutline cutoff/S cutout/S cutover cutpurse cutset cuttable cuttack cutter/MS cutthroat cutting/SY cuttle cuttlebone/S cuttlefish/S cutty cutup/S cutwater cutwork cutworm cuvette cuxhaven cuyp cuzco cwmbran cyan cyanamide cyanate cyanic cyanide cyanine cyanite cyanocobalamin cyanogen cyanohydrin cyanosis cyanotype cybele cyber cybernate cybernated cybernation cybernetic/S cybernetical/Y cybernetician cyberneticist cyborg cycad cyclamate cyclamen cycle/DGRS cyclic/Y cyclical cyclically cyclicity cyclisation/MS cyclise/DGS cyclist/S cyclitol cyclization/MS cyclize/DGS cyclo/S cycloaddition cycloalkane cyclograph cycloheptatrienyl cyclohexane cyclohexanol cyclohexyl cycloid/MS cycloidal cyclometer/MS cyclone/MS cyclonic cyclonically cyclonite cycloparaffin cyclopean cyclopedia cyclopentadienyl cyclopentane cycloplegia cyclopropane cyclops cyclorama cyclosis cyclostome cyclostyle cyclothymia cyclotomic cyclotomy cyclotron cyder cydnus cygnet/MS cylinder/DGMS cylindric cylindrical/Y cylindroid cylix cyma cymar cymatium cymbal/MS cymbalist/S cymbalo cyme cymene cymogene cymograph cymoid cymophane cymose cymru cynghanedd cynic/S cynical/UY cynicism cynosure cyperaceous cypher/S cypress cyprinid cyprinodont cyprinoid cypsela cyrenaica cyrene cyst/S cystamine cystectomy cysteine cystic cysticercoid cystine cystitis cystocarp cystocele cystoid cystolith cystoscope cystotomy cytaster cythera cytidine cytochemical/Y cytochemistry cytochrome cytogenesis cytogenetics cytokinesis cytokinin cytologic cytological/Y cytologist cytology cytolysin cytolysis cytolytic cyton cytopathogenicity cytophilic cytoplasm cytoplasmic cytoplasmically cytoplast cytosine cytostatic cytostatically cytotaxonomy cytotoxicity cytotoxin cytotropic cyzicus czar czardas czarevitch czarevna czarina czarism czarist czarship d'art d'etat d'etre d'oeuvre d's dab/S dabbed dabber/S dabbing dabble/DGRSZ dabchick dabster dace dacha dachau dachshund dachshunde dachsund dacia dacoit dacoity dacron dactyl/S dactylic dactylogram dactylography dactylology dactylus dad/MS daddy/S dado dadra daedal daemon/MS daff daffodil/MS daffy/R daft/PRTY dagan dagga dagger/S daggerboard daggerman dagoba dagon daguerre daguerreotype/MS daguerreotypic daguerreotypy dahlia/S dahna daily/S daimon/S daimones daimonic daimyo daintily dainty/PRS daiquiri/S dairen dairy/GS dairyland dairymaid dairyman dairymen dais/S daishiki daisy/MS daisycutter dak dal daladier dalai dalasi dale/HMS dalesman dalhousie dali dallapiccola dalliance dalloway dally/DGR dallyes dalmatia dalmatian/S dalmatic dam/MS damage/DGRSZ damaged/U damaging/Y damask dame/DMS damietta dammed damming dammit damn/DGS damnable/P damnably damnation damnatory damndest damned/RT damnify damning/Y damodar damp/DGNPRSXYZ dampcourse damped/U dampen/DGRS dampier dampish damsel/MS damselfish damselfly/S dance/DGRSZ danceability danceable dancelike dandelion/MS dander dandiacal/Y dandie dandify/N dandily dandiprat dandle/DG dandruff dandruffy dandy/RS dandyise/S dandyish/Y dandyism dandyize/S dandys dang/D danger/MS dangerous/PY dangle/DGRSZ dangler/MS dangling/Y dank/PY danseur daphnia dapper/PY dapple/DGS daraf darbies dardanelles dardanus dare/DGRSZ daredevil/S daredevilry daredeviltry dareful daresay daresbury darfur darg dargah daric daring/PY dario dariole dark/NPRSTY darken/DGRZ darkend darkish darkle darkroom/S darksome darlan darling/MPSY darlington darmstadt darn/DGRS darnel darnley darogha darrow darry dart/DGRS dartboard dash/DGRSZ dashboard/S dasheen dashiki dashing/Y dashpot dassie dastard/Y dastardise/S dastardize/S dastardly/P dasyure data databank databanks database/MS datable datafile datagram/MS datamedia datary dataset/S dataswitch/S datatype datcap datcha date/DGRSV dateable dated/PY dateless dateline/DS datetime dato datolite datuk datum/S datura daub/DRS daube daubery daubigny daudet daugava daugavpils daughter/MSY daughterless daumier daunt/DGS daunted/U dauntless/PY dauphin dauphine davao davenport davit davits daw dawdle/DGRSZ dawes dawn/DGS day/MS dayak dayan daybed daybook dayboy daybreak/S daydream/DGRSZ daydreamlike dayfile dayflower dayfly daylight/MS daylong daymare dayroom/S dayspring daystar daytime/S daze/DGS dazed/P dazzle/DGRSZ dazzling/Y db de deacidify/N deacon/MS deaconess deaconise/S deaconize/S deaconry deactivate/DGNS deactivator dead/NPXY deadbeat deaden/DGRS deadening/Y deadeye deadfall deadhead/S deadlight deadline/MS deadlock/DGS deadly/PRT deadpan deadpanner deadstarting deadweight deadwood deaerate/NS deaf/NPRTXY deafen/DGS deafening/Y deakin deal/GJRSZ dealate/DNS dealership dealerships dealfish deallocate/DGNSX deallocation/MS deallocator dealt deaminate/N deaminise deaminize dean/MS deanery deanship dear/HPRSTY dearchive/DGS dearie dearths deary deassign/S deassignment death/Y deathbed deathblow deathless/PY deaths deathsman deathtrap deathward deathwatch debacle/S debag debar/S debark/S debarkation debarment debarred debarring debase/DGRS debasement debatable/U debate/DGRSZ debatement debator/S debauch/DRS debauched/PY debauchee debauchery debe debenture/S debilitate/DGNS debility debit/DGS debonair/PY debone/GRS debouch debouchment debouchure debrecen debrief/DGS debris debs debt/MS debtless debtor/S debug/S debugged debugger/MS debugging debunk/GRS debus debut/GS debutant debutante/MS debye decade/MS decadence decadency decadent/Y decaffeinate/DGS decagon/U decagram decahedron decal decalcify/N decalcomania decalescence decaliter/S decalitre/S decalogue/S decameter/MS decametre/MS decametric decamp/S decampment decanal decane decanedioic decani decanoic decanol decant/DGRSZ decantation decapitate/GNS decapitated decapitator decapod/MS decapolis decarbonate/DGNS decarbonator decarbonisation decarbonise/DGRS decarbonization decarbonize/DGRS decarboxylation decarburisation decarburise/DGS decarburization decarburize/DGS decastyle decasualisation decasualization decasyllabic decasyllable decathlon/S decay/DGRS deccan decease/DGS decedent deceit deceitful/PY deceivable/P deceive/DGRSZ deceiving/Y decelerate/DGNSX decelerator decelerometer decemvirate decenary decency/MS decennial/Y decennium decent/IY decentralisation/MS decentralisationist decentralise/S decentralised decentralising decentralist decentralization/MS decentralizationist decentralize/S decentralized decentralizing deception/MS deceptional deceptive/PY decerebrate/DGNS decern decertify/N dechlorinate/DNS deciare decibel/S decidability decidable/U decide/DGRS decided/PY decidua decidual deciduate deciduous/PY decigram/MS decigramme/MS decile deciliter/S decilitre/S decillion/U decimal/SY decimalisation/MS decimalise/DGS decimalization/MS decimalize/DGS decimate/DGNS decimeter/MS decimetre/MS decimetric decipher/DGRSZ decipherable decipherment decision/MS decisional decisionmaker decisive/IPY decistere deck/DGJRS deckhand deckhouse deckle declaim/DGRS declamation/S declamatory declarable declarant declaration/MS declarative/SY declarator/S declaratory declare/DGRSZ declared/AU declass declasse declassify/NX declension/S declensional/Y declinable/I declinate declination/MS declinational decline/DGRSZ declinometer declivitous declivity declog/S declogged declogging decluster/DGS declutch/DGS decoct/DGS decoction/S decode/DGJRSZ decoke decollate/DGNSX decolletage/S decollimate decolonisation decolonise decolonised decolonises decolonising decolonization decolonize/DGS decolor/DGS decolorant/S decolorate/DS decolorise/DS decolorization decolorize/DRS decolour/DGS decolourant/S decolourate/DS decolourisation decolourise/DRS decommission decompensate/N decompensatory decompile/DGRSZ decomposability decomposable/IU decompose/DGRS decomposition/MS decompound decompress/DGRS decompression deconcentrate deconcentrator decondition decongest/V decongestant decongestion deconsecrate/N deconstruct decontaminate/GNSX decontaminated decontrol decontrolled decontrolling deconvolution deconvolve decor decorate/DGNSVX decorated/AU decorates/A decorative/PY decorator/S decorous/IPY decorticate/DGNS decorticator/S decorum/S decoupage/S decouple/DGRS decoy/MS decrease/DGS decreasing/Y decree/DRS decreeing decreet decrement/DGS decremental decrepid decrepit/Y decrepitate/N decrepitude decrescendo decrescent decretal/S decretive decretory decrial/S decriminalisation/M decriminalise decriminalization/M decriminalize decry/DGRS decrypt/DGS decryption decryptograph decsystem dectape decubitus decumbent decuple decurion decurrent decurved decury decussate/NY decwriter dedal dedicate/DGNSVX dedicated/Y dedicator dedicatory dedifferentiate/DN deduce/DGRS deducible deduct/DGSV deductibility deductible/S deduction/MS deductive/Y deed/DGS deedless deejay deek deem/ADGS deemphasis deemphasisation/M deemphasise/DGRSZ deemphasization/M deemphasize/DGRSZ deemster deenergise/DGRS deenergize/DGRS deep/NPRSTXY deepen/DGS deer/S deergrass deerhound deerskin/S deerstalker deface/GRS defacement defalcate/N defalcator defamation defamatory defame/DGRS defat default/DGRS defeasance defeasibility/I defeasible/I defeat/DGS defeatism defeatist/S defeature/DGS defecate/DGNSX defect/DGSV defection/MS defective/PSY defector/MS defeminise/DGS defeminize/DGS defence/DGMSV defenceless/PY defenceman defences/U defend/DGRSZ defendable defendant/MS defended/U defenestrate/DGNSX defense/DGMS defenseless/PY defenseman defenses/U defensibility/I defensible/I defensibly/I defensive/PY defer/S deferable deference deferent/S deferential/Y deferment/MS deferrable deferral deferred deferrer/MS deferring defervescence/S defervescent defial defiance/S defiant/Y defibrillation defibrillator deficiency/S deficient/Y deficit/MS defilade defile/DGRS defilement definable/IU definably/I define/DGRSZ defined/AU definement definiendum definiens definite/NPVXY definition/AMS definitional definitisation/MS definitise/DGS definitive/PY definitization/MS definitize/DGS definitude deflagrate/DGNS deflate/DGNRS deflationary deflator deflect/DGSV deflected/U deflection/S deflectionisation/MS deflectionise/S deflectionization/MS deflectionize/S deflector deflexed deflocculate defloration/S deflower defoamer/S defocus/G defocussing defoe defoliant defoliate/DGNS defoliator deforce deforcement deforciant deforest/R deforestation deform/GS deformalise deformalize deformation/MS deformational deformative deformed/U deformity/MS defraud/DGRS defraudation defray/DGS defrayable defrayal/S defrock defrost/DGRS deft/PRT deftly defunct defunctionalisation/MS defunctionalise/S defunctionalization/MS defunctionalize/S defuse/DG defy/DGRS defyed defying/Y defys degas degassed degasses degassing degauss/DGS degeneracy degenerate/DGNPSVY deglutinate deglutition deglycerolised deglycerolized degradable degradation/MS degrade/DGRS degraded/PY degrading/Y degranulation degrease degree/DMS degression degressive/Y degum degumming degust dehisce dehiscent dehorn dehra dehumanisation/MS dehumanise/DGS dehumanization/MS dehumanize/DGS dehumidify/DNRX dehydrase dehydrate/DGNS dehydrator dehydrogenase dehydrogenate dehydroretinol dehypnotisation dehypnotise/DGS dehypnotization dehypnotize/DGS deianira deicide deictic deific deiform deify/N deign/DGS deil deindustrialisation deindustrialise deindustrialization deindustrialize deionisation deionise/S deionization deionize/S deipnosophist deism deist deistic deistical/Y deity/MS deixis deja deject dejecta dejected/PY dejection dejeuner/S dekagram/MS dekagramme/MS dekaliter dekalitre dekameter/MS dekametre/MS dekker dekko delacroix delagoa delaine delaminate/N delate/DGNS delator delaunay delay/DGRSZ dele delectability delectable/P delectably delectate delectation deledda delegable delegacy delegate/DGNSX delegatory delete/DGNRSX deleted/U deleterious/PY delft delgado deli/MS deliberate/DGNPSVXY deliberative/PY deliberator/MS delicacy/MS delicate/PSY delicatessen delicious/PSY delict delicti delight/DGRS delighted/PY delightful/PY delightsome/Y delimeter/S delimit/DGRSZ delimitate/V delimitation delimitise/S delimitize/S delineament/S delineate/DGNSVX delineator delinquency delinquent/MSY deliquesce deliquescence deliquescent delirious/PY delirium/S delist delitescence deliver/DGRSZ deliverability deliverable/S deliverance delivery/MS deliveryman/M deliverymen/M dell/MS dellwood delocalisation delocalise delocalization delocalize delouse/DGS delphine delphinium delta/MS deltaic deltiology deltoid/S delude/DGRS deluding/Y deluge/DGS delusion/MS delusional delusionary delusive/PY delusory deluster delustre deluxe delve/DGRS demagnetisable/SU demagnetisation/MS demagnetise/DGRSZ demagnetizable/MSU demagnetization/MS demagnetize/DGRSZ demagnify/N demagog demagogic demagogical/Y demagogism demagogue/S demagoguery demagogy demand/DGRS demandable demandant demanding/Y demantoid demarcate/DGNS demark demarkation dematerialisation dematerialise/DGS dematerialization dematerialize/DGS demavend deme demean/DGS demeanor/MS demeanour/MS dement demented/PY dementia demential demerara demerit/S demesne demeter demi demibastion demicanton demigod demigoddess demijohn demilitarisation demilitarise/DGS demilitarization demilitarize/DGS demilune demimondaine demimonde demineralisation/MS demineralise/DGRS demineralization/MS demineralize/DGRS demirel demirelief demirep demiscible demise/DGS demisemiquaver demission demist demit demitasse demitted demitting demiurge demivierge demivolt demo/PS demob demobilisation demobilise/DGS demobilization demobilize/DGS democracy/MS democrat/MS democratic/U democratically/U democratique democratisation/MS democratise/DGRS democratises/U democratization/MS democratize/DGRS democratizes/U democritus demodulate/DGNSX demodulation/MS demodulator/MS demographer/MS demographic/S demographical/Y demographiques demography demoiselle demolish/DGRS demolishment demolition/S demolitionist demon/MS demonetisation demonetise/DGS demonetization demonetize/DGS demoniac demoniacal/Y demonian demonic demonical/Y demonisation demonise/DGS demonism demonization demonize/DGS demonolater demonolatry demonology demonstrability demonstrable/P demonstrably/I demonstrate/DGNSVX demonstrational demonstrationist demonstrative/PUY demonstrator/MS demoralisation/MS demoralise/DGRSZ demoralising/Y demoralization/MS demoralize/DGRSZ demoralizing/Y demote/DGNS demotic demould/DGS demount/DGS demountable dempster demulcent demulsify demultiplex demur/S demure/PY demurrage demurral demurred demurrer demurring demy demystify/DGS demythologisation demythologise/DGRS demythologization demythologize/DGRS den/MS denarius denary denationalisation denationalise/DGS denationalization denationalize/DGS denaturalisation denaturalise/DGS denaturalization denaturalize/DGS denaturant denaturation denaturational denature/DGS denaturisation/MS denaturise/RSZ denaturization/MS denaturize/RSZ denazify/N dendral dendriform dendrite/MS dendritic dendrochronologist/S dendrochronology dendrogram/S dendroid dendrologic dendrological dendrologist dendrology deneen denegation denervate/DGNS dengue deniable/U denial/MS denicotinise denicotinize denigrate/DGNSV denigrator denigratory denim/S denitrate denitrify/N deniz denizen/S denizenise/S denizenize/S denning denominate/DV denomination/MS denominational denominationalise/SU denominationalism denominationalist denominationalize/SU denominationally denominator/MS denormalise denormalize denotable denotation/MS denotational/Y denotative denote/DGS denotement denouement denounce/DGRSZ denouncement dens/RT dense/PRTY densify/N densimeter/MS densimetric densitometer/MS densitometric densitometry density/MS dent/DGIS dental/SY dentalisation/MS dentalise/S dentalization/MS dentalize/S dentate/DNY dentex denticle denticulate/DNY dentiform dentifrice dentigerous dentil dentilabial dentilingual dentin dentinal dentine dentist/MS dentistry dentition dentoid dentulous denture/IS denuclearisation denuclearise/DGS denuclearization denuclearize/DGS denudate denudation denudational denude/DGRS denudement denumerable denumerably denunciate/DGNSVX denunciatory deny/DGRS denying/Y denys deodand deodar deodorant/MS deodorise/DGS deodorize/DGS deontic deontological deontologist deontology deoxidation deoxidiser deoxidizer deoxycholate deoxygenate deoxygenation deoxyribonucleic deoxyribose depart/DGS department/MS departmental/Y departmentalisation/MS departmentalise/S departmentalism departmentalization/MS departmentalize/S departmentisation/MS departmentise/S departmentization/MS departmentize/S departure/MS depasture depend/DGS dependability dependable/P dependably dependant/S dependence/S dependency/S dependent/ISY depersonalisation/MS depersonalise/GS depersonalised depersonalization/MS depersonalize/GS depersonalized depict/DGRS depicted/U depiction/S depicture depigmentation depilate/DGNS depilatory deplane/DGS depletable deplete/DGNSVX deplorable/P deplorably deplore/DGRS deploring/Y deploy/DGS deployable deployment/MS deploys/A deplume depolarisation/MS depolarise/DGRSZ depolarization/MS depolarize/DGRSZ depoliticisation depoliticise/DGS depoliticization depoliticize/DGS depolymerisation depolymerise/DGS depolymerization depolymerize/DGS depone/DGS deponent depopulate/N depopulator deport/DGS deportable deportation deportee/MS deportment depose/DGS deposit/ADGS depositary deposition/MS depositional depositor/AMS depository depot/MS depravation/S deprave/DGRS depraved/PY depravement depravity/S deprecate/DGNSX deprecating/Y deprecatorily deprecatory depreciable depreciate/DGNSVX depreciating/Y depreciative/Y depreciator/S depreciatory depredate/DGNS depredations depredator/S depredatory depress/DGSV depressant/S depressible depressily depressing/Y depression/MS depressive/Y depressomotor depressor depressors depressurisation depressurise/DGS depressurization depressurize/DGS deprivation/MS deprive/DGS depside depth depthless depths depurative deputation/S deputationise/S deputationize/S depute/DGS deputisation deputise/GS deputised deputization deputize/GS deputized deputy/MS dequeue/DGS deraign derail/DGS derailleur derailment derain derange/DGS derangement derate/GN derationalisation/MS derationalise/S derationalization/MS derationalize/S deratisation/MS deratization/MS derbent derby/S derealisation derealization dereference/DGRSZ deregister deregulate deregulationise/S deregulationize/S deregulatory derelict/S dereliction derestrict deride/DGRS deriding/Y derisible derision derisive/PY derisory derivable/U derivate derivation/MS derivational derivative/MPSY derive/DGRS derived/U derma dermal dermatitis dermatogen dermatoglyphics dermatoid dermatologic dermatological dermatologist dermatology dermatome dermatophyte dermatophytosis dermatoplasty dermatosis dermis dermoid dero derogate/DGNSV derogatorily derogatory derrick/DGS derrickman derrickmen derriere derringer derry derv dervish/S derwent derwentwater desai desalinate desalination desalinisation desalinise desalinization desalinize desalting descant descend/DGRSZ descendant/MS descended/U descendent/MS descendible descension descent/MS deschamps deschool descrating describable/I describe/DGRSZ description/MS descriptional descriptive/PSY descriptivism descriptor/MS descry/DG desecrate/DNRS desecrator desegregate/DGNS deselect/DGS deselection/S desensitisation/MS desensitise/DGRSZ desensitization/MS desensitize/DGRSZ desert/DGRSZ desertic desertion/S deserve/DGJRS deserved/PY deserving/SY desex desexualisation desexualise/DGS desexualization desexualize/DGS deshabille desicate desiccant desiccate/DNSV desiccator desiderata desiderate/NV desideratum design/DGRSZ designate/DGNSVX designational designator/MS designatory designed/AU designedly designee designer/MS designing/AU designment desinence desirability/U desirable/PU desirably/U desire/DGRS desired/U desirous/PY desist desistance desk/MS deskill/DG deskman desktop desman desmid desmoid desmoulins desolate/DGNPRSXY desolating/Y desolator desorb/D desorbable desorption despair/DGRS despairing/Y despatch/D despenser desperado desperadoes desperate/NPY despicable/P despicably despiritualisation despiritualise despiritualization despiritualize despise/DGRS despisement despite/D despiteful/PY despiteous/Y despoil/DGRSZ despoilation despoilment despoliation despond despondence/S despondency despondent/Y despot/MS despotic despotically despotise/S despotism despotize/S despumate desquamate dessalines dessau dessert/MS dessertspoon dessiatine dessicate dessicator/S destabilisation destabilise/DGS destabilization destabilize/DGS destalinise/DGS destalinize/DGS desterilise desterilize destigmatisation destigmatization destinate destination/MS destine/DG destiny/MS destitute/NP destroy/DGRSZ destroyer/MS destruct/S destructibility/I destructible destruction/MS destructionist destructive/PY destructivity destructor desuetude desulfurization desulfurize desulphurisation desulphurise/DGS desulphurization desulphurize/DGS desultorily desultory/P desynchronisation desynchronise/DGS desynchronization desynchronize/DGS detab detach/DGRS detachability detachable detachably detached/PY detachment/MS detail/DGRS detailed/PY detain/DGRS detainee detainment detect/DGSV detectability/U detectable/U detectably detectaphone detected/U detection/MS detective/S detector/MS detent detente/X detention deter/S deterge detergency detergent/S deteriorate/DGNSV determent/S determinability determinable/IP determinably/I determinacy/I determinant/MS determinantal determinate/NPVXY determination/AI determinative/PY determinator determine/DGRSZ determined/PY determines/A determinism/I determinist/I deterministic/I deterministically deterred deterrence deterrent/SY deterrer deterring deters/V detersive/S detest/DGS detestable/P detestably detestation/S dethrone dethronement detinue detmold detonability/S detonable detonatable detonate/DGNSV detonational detonator/MS detour/DGS detoxicant/S detoxicate/DGNS detoxicator detoxify/DGNS detract/DGSV detraction/S detractive/Y detractor/MS detrain/DGS detrainment detrend/DGS detribalisation/MS detribalise/DGS detribalization/MS detribalize/DGS detriment/S detrimental/Y detrition detritus detrude detruncate detumescence/S detumescent detune/DGS deuce/DGS deuced/Y deurne deus deuteragonist deuteranope deuterate/DGNSX deuteride deuterium/S deuterogamy deuteron/M deutoplasm deutsch deva devaluate/X devaluation devalue/DGS devanagari devastate/DGNSVX devastating/Y devastator/S develed develing develled develling develop/ADGRSZ developable developed/AU developer/MS development/MS developmental/Y deventer deverbative devest devi deviance/S deviancy/S deviant/MSY deviate/DGNSX deviated/U deviating/U deviationism deviationist deviator/S device/MS devil/MS deviled devilfish deviling devilise/S devilish/PY devilize/S devilkin devilled devilling devilment/S devilry deviltry devious/PY devisability devisable devisal devise/DGJNRSX devisee devisor devitalisation devitalise/DGS devitalization devitalize/DGS devitrify/N devocalise devocalize devoice/DGS devoid devoir/S devolatilisation devolatilise/DGS devolatilization devolatilize/DGS devolution devolutionary devolutionist devolve/DGS devote/DGNSX devoted/Y devotee/MS devotement devotional/Y devour/DGRS devout/PY dew/DGS dewan dewar/S dewater/DGRS dewberry dewclaw dewdrop/MS dewily deworm dewsbury dewy/PR dexedrine dexter dexterity dexterous/PY dextral/Y dextrality dextran dextrin dextrine dextro dextroamphetamine dextroglucose dextrogyrate dextrorotation dextrorse dextrose/M dextrous dey dezhnev dhahran dhak dharma dharna dhaulagiri dhobi dhole dhoti dhow diabase diabetes diabetic/S diablerie diabolic diabolical/PY diabolisation diabolise/DGS diabolism diabolist diabolization diabolize/DGS diabolo diacaustic diacetylmorphine diachronic/P diachronically diachrony diacid diacidic diaconal diaconate diacritic/MS diacritical/SY diactinic diadelphous diadem diadic diadromous diaeresis diagenesis diageotropism diaghilev diagnometer/MS diagnosable diagnose/DGS diagnoseable diagnosis diagnostic/MS diagnostical/Y diagnostician/S diagonal/SY diagonalisable diagonalisation diagonalise/S diagonalizable diagonalization diagonalize/S diagram/DGMS diagrammable diagrammatic diagrammatical diagrammaticality diagrammatically diagrammed diagrammer/MS diagramming diagraph diakinesis diakinetic dial/MS dialect/MS dialectal/Y dialectic/S dialectical/Y dialectician/S dialecticise/S dialecticize/S dialectological/Y dialectologist dialectology dialed/A dialer/S dialing/S dialist/S diallage dialled/A dialler dialler/S dialling/A dialling/S diallist/S dialog/MS dialogic dialogical/Y dialogism dialogist dialogistic dialogue/MS dials/A dialup/MS dialysability/MS dialysable/S dialyse/RSZ dialysed/U dialyser/MS dialysis dialytic dialyzability/MS dialyzable/MS dialyze/RSZ dialyzed/U dialyzer/MS diamagnet/S diamagnetic diamagnetism diamantine diamegnetism diameter/MS diametral diametric diametrical diametrically diamine diamond/MS diamondback diamondise/S diamondize/S diandrous dianetics dianne dianoetic dianoia diapason diapause/G diapedesis diapente diaper/DGMS diaphaneity diaphanous/PY diaphone diaphoresis diaphoretic diaphototropism diaphragm/MS diaphragmatic diaphragmatically diaphragmic diaphysis diapir diapositive diarch diarchy diarist diarrhea/MS diarrheal diarrheic diarrhetic diarrhoea/MS diarrhoeal diarrhoeic diarrhoetic diary/MS dias diascope diaspora diaspore diastalsis diastase diastasis diastema diastole diastolic diastrophic diastrophically diastrophism diastyle diatessaron diathermancy diathermic diathermy diathesis diathetic diation diatom/S diatomaceous diatomic diatomite diatonic diatonically diatribe/MS diatropic diatropism/S diazine diazo diazole diazomethane diazonium dibasic dibble dibbuk dibranchiate dibromide dibs dicarbonyl dicarboxylic dicast dice/GRS dicephalous dices/I dicey dichasium dichlamydeous dichloride dichloroethanol dichondra dichotic dichotically dichotomisation dichotomise/DGS dichotomist dichotomization dichotomize/DGS dichotomous/PY dichotomy/S dichroic dichroism dichroitic dichromat/S dichromate dichromatic dichromaticism dichromatism dichromic dichroscope dicier dick/RSZ dickcissel dickens dicker/DGS dickey dicky diclinous dicotyledon dicta dictate/DGNSX dictator/MS dictatorial/PY dictatorship/S diction/S dictionally dictionary/MS dictum/MS dicuss dicyclic dicynodont did/U didact didactic/S didactical/Y didacticism diddle/DGR diderot didgeridoo didn't didymium didymous didynamous die/DS dieback diecious diefenbaker diehard/S dieing diel dieldrin dielectric/MS diem dien diencephalon dieppe dieresis dies/U diesel/S dieselisation/MS dieselise/S dieselization/MS dieselize/S diesis diestock diestrus diet/RSZ dietarily dietary/S dietetic/S dietetically diethylaminoethyl diethylstilbestrol dietician/S dietitian/MS diety dieu dieux diffeomorphic diffeomorphism differ/DGRSZ difference/DGMS different/PY differentia differentiability differentiable differential/MSY differentialise/S differentialize/S differentiate/DGNSX differentiated/U differentiator differentiators differently/I difficile difficult/Y difficulty/MS diffidence diffident/Y diffract/DGS diffraction/S diffractometer/MS diffuse/DGNPRSVXYZ diffusible diffusional diffusive/PY diffusivity difluoride dig/S digamma digamy digenesis digenetic digest/DGRSV digestant digested/IU digestibility/I digestible/I digestion/S digestive/PY digged digger/MS digging/S dight digit/MS digital/Y digitalin digitalis digitalisation/MS digitalise/DGS digitalism digitalization/MS digitalize/DGS digitate/DNY digitiform digitigrade digitisation digitise/DGRSZ digitiser/MS digitization digitize/DGRSZ digitizer/MS digitonin digitoxin digitron dignified/U dignify/D dignitary/S dignity/IS digram digress/DGSV digression/MS digressional digressionary digressive/PY dihedral dihybrid dihydric dihydrofolate dihydroxy dijon dike/GMRS dikkop diktat dilapidate/DGNS dilapidator dilatability dilatable dilatancy dilatant dilatation dilatational dilate/DGNSV dilated/PY dilatometer/MS dilatometric dilatometry dilator dilatorily dilatory/P dildo/S dilemma/MS dilemmatic dilemmatical dilettante/S dilettanti dilettantish dilettantism dilettantist diligence/S diligent/PY dilithium dill dillinger dilly dillydally dilogarithm diluent dilute/DGNPRSVXY diluted/U dilutor diluvial dim/PSY dimaggio dimashq dime/MRSZ dimenhydrinate dimension/DGS dimensional/Y dimensionalisation dimensionalise/DGS dimensionality dimensionalization dimensionalize/DGS dimensionless dimercaprol dimeric dimerisation/MS dimerise/DGS dimerism dimerization/MS dimerize/DGS dimerous dimeter/MS dimethoxymethane dimethyl dimethylformamide dimethylglyoxime dimethylpropane dimethylsulphoxide dimetric diminish/DGS diminishable diminished/U diminishment diminuendo/MS diminution diminutional diminutive/PY diminutivise/S diminutivize/S dimissory dimity dimmable dimmed/U dimmer/MS dimmest dimming dimorph dimorphic dimorphism dimorphous dimout dimple/DGS dimply dimwit/S dimyristoyl din dinar dine/DGRSZ dineric dinette ding dingbat/S dingdong dinge dinghy/S dingily dingle dingo dingy/PR dinitrobenzene dinitrogen dink dinkey dinkum dinky dinner/MS dinnerless dinnertime dinnerware dinning dinoflagellate dinosaur/S dinosaurian dinosauric dinothere dint dio diocesan diocese diode/MS diodorus dioestrus diogenes diol diomede/S dionysius diophantus diopside dioptase diopter dioptometer/MS dioptometry dioptre dioptric/S dior diorama/S dioramic diorite dioxalate dioxan dioxide/S dip/S dipeptide dipetalous diphase diphasic diphenyl diphenylamine diphenylhydantoin diphosgene diphtheria diphtherial diphtherian diphtheritic diphtheroid diphthong/S diphthongal diphthongisation/MS diphthongise/SU diphthongization/MS diphthongize/SU diphyletic diphyllous diphyodont diplegia diplex diploblastic diplocardiac diplococcus diploid/MS diploidy diploma/MS diplomacy diplomat/MS diplomate diplomatic/S diplomatically/U diplomatise/S diplomatist diplomatize/S diplont diplopia diplopod diplosis diplostemonous dipnoan dipod dipodic dipody dipolar dipole/MS dipped dipper/MS dipperful dipping/S dippy dipropellant diprotodont dipsomania dipsomaniac dipsomaniacal dipstick dipteral dipteran dipterocarpaceous dipterous diptych dire/PRTY direct/DGPSVY directed/AIU direction/MS directional/Y directionality directionless directions/AI directive/MS directivity director/AMS directorate directorial directorship directory/MS directrices directrix direful/Y dirge/DGMS dirigible/S diriment dirk dirndl dirt/MS dirtily dirty/DGPRST disability/MS disable/DGRSZ disablement disabuse disaccharide/S disaccord disaccredit disaccustom disadvantage/DGMS disadvantaged/P disadvantageous/PY disaffect disaffected/PY disaffection disaffiliate/DGNS disaffirm disaffirmance disaffirmation disafforest disaggregate/DGNV disagree/DS disagreeability disagreeable/P disagreeably disagreeing disagreement/MS disallow/DGS disallowance disambiguate/DGNSX disangularise/S disangularize/S disannul disappear/DGS disappearance/MS disappoint/DGS disappointed/Y disappointing/Y disappointment/MS disapprobation disapproval disapprovative disapprove/DGRS disapproving/Y disarm/DGRSZ disarmament disarming/Y disarrange/S disarranged disarrangement disarray/S disarticulate/N disarticulated disassemble/DGRSZ disassembler/MS disassembly disassociate/DGNS disaster/MS disastrous/Y disauthorise/S disauthorize/S disavow/DGS disavowable disavowal/S disband/DGS disbandment disbar/S disbarment disbelief disbelieve/DGRSZ disboweled disboweling disbowelled disbowelling disbranch disbud disburden disburdenment disburse/DGRS disbursement/MS disc/MS discalced discanonisation/MS discanonise/S discanonization/MS discanonize/S discard/DGRS discardable discern/DGRS discernable discernibility discernible/I discernibly discerning/Y discernment discharge/DGRS dischargeable dischargee disciform disciple/MS discipleship disciplinable/I disciplinal disciplinant disciplinarian disciplinarianism disciplinarily disciplinarity disciplinary discipline/DGRS disciplined/IU disclaim/DGRSZ disclamation disclimax disclose/DGRS disclosed/U disclosure/MS disco/MS discobolus discographer discographic discographical/Y discography discoid discoidal discoidin discolor/GM discoloration discolored/MPS discoloreds/U discolorization/MS discolorment/MS discolors discolour/GM discolouration discoloured/MPS discoloureds/U discolourisation/MS discolourment/MS discolours discombobulate discomfit/DGS discomfiture/S discomfort/G discomfortable discomfortably discomforting/Y discommend discommendable discommendation discommode/GS discommodity discommon discompose/D discomposed/Y discomposure disconcert/DGS disconcerting/Y disconfirm disconfirmation disconform disconformable disconformity disconnect/DGRS disconnected/PY disconnection/S disconsider disconsolate/NPY discontent/D discontented/Y discontentment discontinuance discontinuation discontinue/DGS discontinuity/MS discontinuous/Y discophile discord/S discordance/S discordancy discordant/Y discorporate/D discotheque discount/DGRS discountenance discourage/DGRS discourageable discouragement discouraging/Y discourse/DGMRS discourteous/PY discourtesy discover/DGRSZ discoverable discovered/AU discovers/A discovert discovery/MS discredit/DGS discreditable discreditably discreet/IPY discrepancy/MS discrepant/Y discrete/NPXY discretionary discretisation discretise discretization discretize discriminability discriminable discriminably discriminant discriminate/DGNSVX discriminating/IY discriminational discriminator/S discriminatorily discriminatory discursive/PY discus/S discuss/DGRS discussable discussant/S discussed/U discussible/I discussion/MS disdain/GS disdainful/PY disdenominationalise/S disdenominationalize/S disdiplomatise/S disdiplomatize/S disease/DGS disembark disembarkation disembarrass disembodied disembodiment disembody disembogue disembowel/S disemboweled disemboweling disembowelled disembowelling disembowelment disembroil disenable disenamor/MS disenamour/MS disenchant/GR disenchanting/Y disenchantment disencumber disencumbrance disendow/R disendowment disenfranchise/DGRS disenfranchisement/MS disengage/DGS disengagement disentail disentangle/DGRS disentanglement disenthral/S disenthrall/S disenthralled disenthralling disentitle disentomb disentwine disepalous disequalise/RSZ disequilibrate/N disequilibrium disestablish/D disestablishment disestablishmentarian disesteem disestimation disfavor/DGRSZ disfavorer/MS disfavour/DGRSZ disfavourer/MS disfeature disfeaturement disfigure/DGS disfigurement/S disforest disfranchise/DGS disfranchisement disfrock disfunction disfurnish disfurnishment disgorge/R disgorgement disgrace/DGRS disgraceful/PY disgruntle/GS disgruntled disgruntlement disguise/DGRS disguised/UY disguisement disgust/DGS disgusted/Y disgustful/Y disgusting/Y dish/DGS dishabille disharmonic disharmonious disharmonise/S disharmonize/S disharmony dishcloth dishearten/G disheartening/Y disheartenment/S dishevel/S disheveled disheveler disheveling dishevelled disheveller dishevelling dishonest/Y dishonesty dishonor/DGRSZ dishonorable/MPS dishonorably/S dishonored/U dishonorer/MS dishonour/DGRSZ dishonourable/PS dishonourably/S dishonoured/U dishonourer/MS dishpan dishrack/S dishtowel dishumanise/S dishumanize/S dishumor/DS dishumour/DS dishwasher/S dishwater dishy disillusion/DG disillusionise/RSZ disillusionize/RSZ disillusionment/MS disincentive disincentives disinclination disincline/DGS disincorporated disindividualise/S disindividualize/S disinfect/DGS disinfectant/S disinfection disinfest/DGS disinfestant disinfestation disinflation disinflationary disingenuous/PY disinherit/DGS disinheritance disinhibition disinhibitory disinsectization disintegrate/DGNSVX disintegrator/S disinter/DGS disinterest disinterested/PY disinterment disinterred disintoxication disinvest disinvestment disject disjoin disjoint/DPY disjointed/PY disjunct/SV disjunction/S disjunctive/Y disjunctor/S disjuncture disk/DGMS diskette/S disklike dislicense/DGRS dislikable dislikably dislike/DGRS dislikeable dislimn dislocate/DGNSX dislodge/DGS dislodgement disloyal/Y disloyalty dismal/PY dismalise/S dismalize/S dismantle/DGS dismantlement dismast dismay/DGS dismayed/U dismaying/Y dismember/G dismembered dismemberment dismiss/DGRSVZ dismissal/MS dismission dismount/DGS disnaturalisation/MS disnaturalise/S disnaturalization/MS disnaturalize/S disobedience disobedient/Y disobey/DGRS disoblige/R disoblingingly disoperation disorder/DSY disordered/PY disorderly/P disorganisation/MS disorganise/GRSZ disorganised/U disorganization/MS disorganize/GRSZ disorganized/U disorient disorientate/DGS disorientation disoriented disown/DGS disownment disozonise/S disozonize/S dispapalise/S dispapalize/S disparage/DGRS disparagement disparaging/Y disparate/PY disparity/MS dispart dispassion dispassionate/PY dispatch/DGRSZ dispauperise/S dispauperize/S dispel/S dispelled dispelling dispend dispensability dispensable dispensary dispensate dispensation dispensational dispensatory dispense/DGRSZ dispeople dispermous dispersability dispersable dispersal dispersant disperse/DGNRSVX dispersed/Y dispersement dispersible dispersity dispersive/PY dispersoid dispersonalise/S dispersonalize/S dispirit/DGS dispirited/PY dispiteous displace/DGRS displaceable displacement/MS displant display/DGRS displayable displease/DGS displeased/Y displeasure displode/DGS displosion dispopularise/S dispopularize/S disport disportment disporves disposability disposable disposal/MS dispose/DGRS disposed/I disposes/I disposition/MS dispositional dispositive dispossess/GS dispossessed dispossession dispossessor disposure/S dispraise/R dispraisingly dispread disprize disproof disproportion disproportional disproportionate/NY disprovable disprove/DGS disproven disputable/I disputant disputation disputatious/PY dispute/DGRSZ disputed/U disqualify/DGNS disquantity disquiet/GY disquieting/Y disquietude disquisition disraeli disrate disrealise/S disrealize/S disregard/DGS disregardful disrelate/DN disrelish disremember disremembrance disrepair disreputability disreputable/P disreputably disrepute disrespect disrespectability disrespectable disrespectful/PY disrobe disrupt/DGRSV disrupted/U disruption/MS disruptive/PY dissappear dissatisfaction/MS dissatisfactory dissatisfied dissatisfy/GS disscepter/MS dissceptre/MS dissect/DGS dissection dissector disseise/DGS disseisin/S disseisor/S disseize/DGS disseizin/S disseizor/S dissemble/DGR disseminate/DGNS disseminator/S disseminule dissension/MS dissensualise/S dissensualize/S dissent/DGRSZ dissentient dissention dissentious dissepiment dissert dissertate dissertation/MS dissertator disserve disservice dissever disseverance disseverment dissidence dissident/MS dissimilar/Y dissimilarity/MS dissimilate/DGNSV dissimilatory dissimilitude dissimulate dissimulation dissimulator dissipate/DGNRSVX dissipated/PY dissociability dissociable/I dissocial dissocialise dissocialize dissociant dissociate/DGNSV dissociated/U dissolubility/I dissoluble dissolute/PY dissolution/MS dissolvable dissolve/DGRS dissolvent dissonance/MS dissonant/Y dissuade/DGRS dissuasion dissuasive/PY dissyllable dissymmetric dissymmetry dissympathise/S dissympathize/S distaff/S distal/Y distance/DGS distant/PY distaste/S distasteful/PY distemper distemperate distemperature distend/D distensibility distensible distension distent distention distich distichous distill/DGRSZ distillate/SX distillation distillery/S distinct/IPVY distinction/MS distinctive/PY distinguish/DGRS distinguishability/I distinguishable/I distinguishably/I distinguished/U distort/DGRS distortable distorted/U distortion/MS distortional distract/DGSV distracted/Y distractibility distractible distracting/Y distraction/MS distrain/R distrainable distrainee distrainor distraint distrait distraught/Y distress/DGS distressful/PY distressing/Y distributary distribute/DGNRSVX distributed/AU distributee distribution/AMS distributional distributive/PY distributivity distributor/MS distributorship district/DGMS distringas distrito distrubuted distrust/DS distrustful/PY disturb/DGRS disturbance/MS disturbed/U disturbing/Y disubstituted disulfide disulfiram disulphate disulphide disulphuric disunion disunionist disunite disunited disunity disuse/D disutilise/S disutility disutilize/S disvalue disvalues disyllabic disyllable dita ditch/DGMRS ditheism dither/DGR dithery dithionite dithionous dithyramb dithyrambic dittander dittany ditto/S dittography ditty/S diu diuresis diuretic diurnal div diva divagate/N divalent divan/MS divaricate/N divaricator dive/DGRSTZ diverge/DGS divergence/MS divergency/S divergent/Y diverse/NPXY diversiform diversify/DGNRS diversionary diversionist diversity/S divert/DGS diverticulitis diverticulosis diverticulum divertimento divertissement/S divest/DGS divestiture divestment divi dividable divide/DGRSZ divided/U dividend/MS divination divinatory divine/DGRSY divinisation/MS divinise/DGS divinity/MS divinization/MS divinize/DGS divinylbenzene divisibility divisible divisibly division/MS divisional divisionism divisionist divisive/PY divisor/MS divorce/DGS divorcee/S divorcement divot divulgate divulge/DGS divulgence divulsion divvied divvies divvy divvying dixiecrats diyarbakir dizen dizequalise/MRSZ dizorganisation dizorganise dizzily dizzy/DGPR dizzying/Y djailolo djaja djajapura djambi djebel djerba djinni djokjakarta do/GHJRZ doab doable dobbin dobby doberman dobla dobro dobruja dobson dobsonfly doc docent docetic docile/Y docility/I dock/DGRS dockage docket/DGS dockhand dockisation/MS dockise/S dockization/MS dockize/S dockland/S dockside dockworker dockyard doctor/DGMS doctoral doctorate/MS doctorisation/MS doctorise/S doctorization/MS doctorize/S doctorless doctorship doctrinaire doctrinairism doctrinal/Y doctrine/MS doctrinisation/MS doctrinise/S doctrinization/MS doctrinize/S document/DGMRSZ documental documentale documentalist documentarian documentarily documentarist documentary/MS documentation/MS documentational documented/U documentise/S documentize/S dodder/DGRS doddery doddle dodecagon dodecahedra dodecahedral dodecahedron dodecanese dodecanoic dodecaphonic dodecasyllable dodecyl dodge/DGRSZ dodgem dodgery dodgy dodington dodo/MS dodoma doe doek doenitz does/U doeskin doesn't doff/GS dog/MS dogbane dogberry dogcart dogcatcher doge dogface dogfight/S dogfish dogfishs dogged/PY dogger doggerel doggery doggie/RS dogging doggish/PY doggo doggone/DG doggy/RS doghouse dogleg doglike dogma/MS dogman dogmatic/S dogmatical/P dogmatically/U dogmatisation dogmatise/R dogmatism dogmatist/MS dogmatization dogmatize/R dognaped dognaping dognapped dognapping dogsbody dogtooth dogtrot dogvane dogwatch dogwood dogy doh doha doily/S doing/AU doit/D dojo dolabriform dolby dolce doldrum/S dole/DGS doleful/PY dolerite dolesome dolichocephalic doline doll/MS dollar/S dollarbird dollarfish dollfuss dollhouse dollish/PY dollop/DGMS dolly/DGMS dolman dolmas dolmen dolmetsch dolomite/S dolomitic dolomitisation/MS dolomitise/S dolomitization/MS dolomitize/S dolor dolorimetry doloroso dolorous/PY dolour dolphin/MS dolt doltish/PY dom domain/MS dome/DGS domestic/S domestically domesticate/DGNS domesticated/U domesticise/S domesticity domesticize/S domett domical domicil domicile/D domiciliary domiciliate/N dominance dominant/Y dominate/DGNSVX dominator dominee domineer/G domineering/PY dominical dominie dominion/S dominium domino dominoes don't don/S dona donate/DGNSVX donatello donator donatus donau donbass done/AU donee doneness dong donga donjon donkey/MS donne donned donner donnert donning donnish/PY donny donnybrook donor/S donut donuts doodad doodah doodle/DGRS doodlebug doohickey doom/DGS doomful/Y doomsayer doomsday doomster door/MS doorbell doorframe doorjamb doorkeep/RZ doorknob/S doorless doorman doormat doormen doorn doornail doornik doorplate doorpost doors/I doorsill doorstep/MS doorstop doorway/MS dooryard dopa dopant dope/DGRSZ dopester dopey doppelganger dopy/PR dordogne dordrecht dorm/R dormancy dormant dormice dormie dormitory/MS dormobile dormouse/M dormy dornbirn dornick dorp dorpat dorsad dorsal/Y dorsiferous dorsigrade dorsiventral dorsoventral dorsum dort dorty dory dosage/S dose/DGS dosimeter/MS dosimetric dosimetry doss/R dossal dosshouse dossier/S dost dot/MS dotage dotal dotard dotation dote/DGRS doting/Y dotted dotter dotterel dottily dotting dottle dotty/PR douai douala douay double/DGPRSZ doubled/AU doubleheader doublespeak doublet/MS doublethink doubleton doubletree doubloon doublure doubly doubs doubt/DGRSZ doubtable/A doubted/U doubtful/PY doubting/Y doubtless/PY douc douce douceur douche dough doughboy doughface doughlike doughnut/MS doughnuttery doughtily doughty/PR doughy/R doukhobors doum dour/PY doura dourine douro douroucouli douse/DGRS dovap dove/RS dovecot dovecote dovekie dovetail dovish/P dowable dowager/S dowdily dowding dowdy/PRS dowdyish dowel doweled doweler doweling dowelled doweller dowelling dower dowery dowitcher down/DGRSZ downbeat downcast downcome/R downcourt downdraft downdraught downfall/N downgrade/DGS downhaul downhearted/PY downhill downhole download/DGS downpatrick downpipe downplay/DGS downpour downrange downright/PY downriver downshift downside downslope downspout downstage downstairs downstate/R downstream downstroke downswing downswings downthrow downtime downtown/RS downtrend downtrodden downturn/S downward/PSY downwash downweight/DG downwell downwind downy/R dowry/S dowsabel dowse/GRS doxastic doxographer doxology doxy doyen doyley doze/DGRS dozen/HS dozy/PR drab/PSY drabber drabbest drabbet drabbing drabble/DG draff draft/DGMRSZ draftable draftboard draftee/S draftily draftsman draftsmanship draftsmen draftsperson drafty/PR drag/S dragged dragger dragging/Y draggle/DG draggletailed draggy/R draghound dragline dragnet dragoman dragon/MS dragonet dragonfly dragonhead dragonise/S dragonish dragonize/S dragonnade dragonroot dragoon/DS dragrope dragster drail drain/DGRSZ drainage/S drained/U drainpipe/S drake dram drama/MS dramalogue dramamine dramatic/S dramatical dramatically/U dramatis dramatisable/SU dramatisation/MS dramatise/DGRSZ dramatist/MS dramatizable/MSU dramatization/MS dramatize/DGRSZ dramaturge dramaturgic dramaturgical/Y dramaturgy drammen dramshop drancy drank drapability drapable drape/DGRSZ drapeability drapeable drapery/MS drastic drastically drat dratted dratting draught/MS draughtboard draughtily draughtsman draughtsmanship draughtsperson draughty/PR drava draw/GJRSYZ drawable drawback/MS drawbar drawbridge/MS drawdown drawee drawerful drawknife drawl/DGRS drawling/Y drawn/PY drawnwork drawplate drawstring/MS drawtube dray drayage drayhorse drayman/M draymen/M dread/DGS dreadful/PY dreadnought dream/DGRSZ dreamboat dreamed/U dreamful/PY dreamily dreaming/Y dreamland dreamless/PY dreamlike dreamt/U dreamworld dreamy/PR drear drearily dreary/PR dreck dredge/DGMRSZ dree dreg dreggy dregs dreich dreiser drench/DGRS drenthe dresden dress/DGJRSZ dressage dressmake dressmaker/MS dressmaking dressy/PR drew drib/S dribble/DGRS driblet dried/U drier/MS drift/DGRSZ driftage drifting/Y driftweed driftwood/M drifty/R drill/DGRS drillability drillable drillmaster drillstock drily drin drink/GRSZ drinkability drinkable/U drinkwater drip/MS dripless dripped dripper dripping drippy/R dripstone drivable drive/GRSZ driveable drivel driveled driveler/S driveline driveling drivelled driveller driveller/S drivelling driven/P driver/MS driverless driveway/MS drizzle/DGS drizzling/Y drizzly drogheda drogue droit droll/P drollery/S drolly dromedary dromond drone/GMRS drongo/S droning/Y droob drool/DGRS droop/DGS drooping/Y droopy/R drop/MS drophead dropkick/R droplet/S droplight dropout/S droppage dropped dropper/MS dropperful dropping/MS dropshot dropsonde dropsy droshky drosophila dross drossy drought/MS droughty/P drouth drove/RSZ drown/DGJRS drownd/DG drowse/DGS drowsily drowsy/PRT drub drubber drubbing drudge/GRS drudgery drudging/Y druffen drug/MS drugged drugget drugging druggist/MS drugless drugmaker drugstore/S druid druidess druidic druidical druidism drum/MS drumbeat/GR drumfire drumhead drumlike drumlin drummed drummer/MS drumming drumroll drumstick/S drunk/MNRSY drunkard/MS drunken/PY drunkeness drunkometer/MS drupe drupelet dry/DGRSTYZ dryable dryad dryasdust dryer/S drylot dryness dryopithecine drypoint drys drysalter drysaltery drysdale drystone drywall du dual/SY dualisation/MS dualise/SU dualism dualist dualistic dualistically duality/MS dualization/MS dualize/SU dub/S dubai dubbed dubber dubbin dubbing dubiety dubiosity dubious/PY dubitable dubitation dubrovnik dubuffet dubuque ducal/Y ducat duccio duce/S duchamp duchess/MS duchy/S duck/DGRS duckbill/D duckboard duckfooted duckling duckpin duckweed/MS ducky/R duclos duct/DGS ductile/I ductilise/S ductility ductilize/S ductless ductule ductwork dud/S dude dudeen dudgeon dudish/Y due/PS duel/S dueled dueler/S dueling/S duelist/S duelled dueller dueller/S duelling duelling/S duellist duellist/S duello duende duenna duennaship duero duet/S duetted duetting duff/RZ duffel duffle dufy dug dugong dugout duhamel duiker duka duke/MS dukedom dukhobors dulcet/Y dulciana dulcify dulcimer dulcimore dulgence dulia dull/DGPRST dullard dulles dullish/Y dullsville dully dulness dulosis dulse duly/U dumas dumb/PRTY dumbbell/MS dumbell/S dumbfound/DRS dumbstruck dumbwaiter/S dumdum dumfries dumka dummy/DGMS dumortierite dump/DGRSZ dumpily dumpish dumpling/MS dumpo dumpster/MS dumpy/PR dumyat dun duna/I dunaj dunant dunce/MS dundalk dundee dunderhead/D dune/MS duneland dunelike dunfermline dung dungaree dungas dungeness dungeon/MS dunghill dungy dunite duniwassal dunk/R dunkel dunkerque dunlin dunnage dunnakin dunne dunnite dunno dunnock dunny dunois dunoon dunsany dunsinane dunstable dunstan dunt duntroon dunwoody duo/S duodecimal duodecimo duodenal duodenary duodenitis duodenum duologue duomo/S duopolist duopolistic duopoly duotone dup duparc dupatta dupe/DGNRS dupery duple dupleix duplet duplex/R duplicable duplicate/DGNSVX duplicated/A duplicator/MS duplicitous/Y duplicity dupondius dupont/S duppy duque durability/S durable/PS durably duramen durance duration/MS durational durative durazzo durbar duress durex durgah durian during durmast duro durometer/MS duros durra durst durum durzi dushanbe dusk duskily dusky/PR dust/DGRSZ dustability dustable dustbin/S dustcart/S dustcover dustheap dustily dustin dustless dustlike dustman dustmen dustpan/S dustsheet/S dustup dusty/PRT dutchess duteous dutiable dutiful/PUY duty/MS duumvir duumvirate duvalier duverger duvet dux dwale dwarf/DPS dwarfishly dwarfishness dwarfism dwarflike dwarves dwell/DGJRSZ dwelt dwindle/DGS dyad/S dyadic dyadically dyarchy dybbuk dye/DGRSZ dyeability dyeable dyeing dyerear dyestuff dyewood dyfed dying/U dykes dynameter dynamic/S dynamical dynamically dynamicism dynamised dynamism dynamist dynamistic dynamite/DGRS dynamitic dynamized dynamo/S dynamoelectric dynamometer/MS dynamometric dynamometry dynamotor dynapolis dynast/S dynastic dynastically dynasty/MS dynatron dyne dynode/S dyscrasia dysenteric dysentery dysfunction dysfunctional dysgenesis dysgenic/S dysgraphia dyslexia dyslexic dyslogistic dyslogistically dysmenorrhoea dyspepsia dyspeptic dyspeptically dysphagia dysphagic dysphasia dysphasic dysphemism dysphonia dysphonic dysphoria dysphoric dysplasia dysplastic dyspnoea dysprosium dysteleology dysthymia dystopia dystrophic dystrophy dysuria dytiscid dyula e'er e's eV each eager/PY eagle/MS eaglet eagre ealdorman ealing eanes ear/DGS earache earbash eardrop/S eardrum/S earflap earful earhart earl/MS earlap earldom earless earlobe earlock early/PRT earmark/DGJS earmuff/S earn/DGJRSTZ earned/U earner/MS earnest/PY earom earp earphone/S earpiece earplug earring/MS earshot earsplitting earth/DMNY earthborn earthbound earthenware earthily earthlight earthlike earthling earthly/PU earthman earthmen earthmove earthmover earthmoving earthnut earthquake/MS earthrise earths earthshaker earthshaking/Y earthshine earthstar earthward/S earthwork/S earthworm/MS earthy/PR earwax earwig earwigged earwigging earwitness ease/DGRS easeful/Y easel easement/MS easily/U east/GRS eastbound easter/Y eastern/RZ easternise easternize easternmost easthampton eastmost eastward/S eastwick easure easy/PRT easygoing/P eat/GJNRSZ eatable/S eatage eatery eave eaves eavesdrop/S eavesdropped eavesdropper/MS eavesdropping ebb/DGS eblis ebon ebonisation ebonise/DGS ebonite ebonization ebonize/DGS ebony ebracteate ebullience ebulliency ebullient/Y ebullioscopy ebullition eburnation ecbatana ecbolic ecce eccentric/MS eccentrically eccentricity/S ecchymosis ecclesall ecclesia ecclesial ecclesiastic ecclesiastical/Y ecclesiasticise/S ecclesiasticism ecclesiasticize/S ecclesiolatry ecclesiological ecclesiology eccrinology ecdysiast ecdysis ecdysone ecesis ecevit ech echard echelon/S echidna echinate echinococcus echinoderm echinoid echinulate/N echinus echo/DGS echoes echoey echoic echoise/S echoism echoize/S echolalia echolocation echopraxia echovirus eck eckhart eclampsia eclat eclectic eclectically eclecticise/S eclecticism eclecticize/S eclipse/DGS eclipsis ecliptic eclogite eclogue eclosion ecocide ecol ecologic ecological/Y ecologist ecologists ecology econometric/S econometrically econometrician econometricians econometrist economic/S economical/Y economisation/MS economise/DGRSZ economising/U economist/MS economization/MS economize/DGRSZ economizing/U economy/MS ecophysiological ecophysiology ecospecies ecospecific ecosphere ecosystem/S ecotone ecotype ecotypic ecotypically ecowas ecru ecstacy ecstasy ecstatic/S ecstatically ecstaticise/S ecstaticize/S ecthyma ectoblast ectoblastic ectocrine ectoderm ectodermal ectodermic ectoenzyme ectogenic ectogenous ectomere ectomeric ectomorph ectomorphic ectoparasite ectoparasitic ectophyte ectopia ectopic ectoplasm ectoplasmic ectoproct ectosarc ectotherm ectothermic ectotrophic ectotropic ectype ecumenic/MS ecumenical/Y ecumenicalism ecumenicism ecumenicist/MS ecumenicity ecumenism ecumenist/MS eczema eczematous ed edacious edacity edale edam edaphic edaphically eddo eddy/DGMS eddystone ede edelweiss edema/MS edematous edentate edentulous edessa edge/DGRS edgehill edgeless edgewater edgeways edgewise edgewood edgeworth edgily edgy/PR edibility edible/PS edict/MS edictal edificatory edifice/MS edify/DGNS edile edirne edit/DGS editable edited/IU edition/MS editor/MS editorial/SY editorialisation editorialise/DGRS editorialist editorialization editorialize/DGRS editorship editress edom eduard educability/I educable/I educate/DGNSVX educated/PY education/MS educational/Y educationalist/S educationist educator/MS educatory educe/G educible educt eduction eductor/S edulcorate edwardine eeg eel/MS eelgrass eellike eelpout eelworm eely eerie/R eerily eery/P eff effable efface/DGRS effaceable/I effacement effect/DGSV effective/PSY effectivity effector/MS effectual/IP effectualise/S effectuality/I effectualize/S effectually effectuate/DGNS effeminacy effeminate effeminatise/S effeminatize/S effendi efferent/Y effervesce effervescence effervescent/Y effete/PY efficacious/IPY efficacity efficacy/I efficency efficiency/IS efficient/IY effigy effloresce efflorescence efflorescent efflrescent effluence effluent/S effluvia effluvium efflux effluxion effort/MS effortful/Y effortless/PY effrontery effulgence effulgent effuse/DGNSV effusiometer effusive/PY eft efta eftsoons egad/S egalitarian/I egalitarianism egerton egest egesta egestion egestive egg/DGRS eggbeater eggcup egghead/D eggheaded/P eggnog eggplant eggshell egis eglantine ego/S egocentric egocentrically egocentricity egocentrism egoise/RSZ egoism egoist/S egoistic egoistical/Y egoize/RSZ egomania egomaniac/S egomaniacal/Y egotism egotist/S egotistic egotistical/Y egregious/PY egress egression egret/S egyptus eh eichmann eider eiderdown eidetic eidetically eidolon eigenfrequency/S eigenfunction/S eigenspace eigenstate/S eigenstructure eigensystem/S eigenvalue/MS eigenvector/S eiger eight/S eighteen/HS eightfold eighth/MS eighths eightsome eighty/HS eightyfold ein eine einsteinium eirenic eirenicon eisegesis eisk either ejaculate/DGNSX ejaculatory eject/DGSV ejecta ejectable ejection ejectment ejector/S eke/DGS ekistic/S el/AS elaborate/DGNPSVXY elaborators elaeoptene elagabalus elam elan eland elapid elapse/DGS elasmobranch elasmosaur elastance elastase elastic/S elastically/I elasticate/DGS elasticisation elasticise/DGRSZ elasticity/S elasticization elasticize/DGRSZ elastin elastomer elastomeric elastoplast elat elate/DGNRS elated/PY elaterid elaterin elaterite elaterium elbe elbow/DGS elbowroom elbrus elburz eld elder/SY elderberry elderly/P eldership eldest eldo eldritch elea elecampane elecroencephalographic elect/ADGSV electability electable elected/AU election/MS electioneer/R elective/PSY elector/MS electoral/Y electorate electress electret electric/S electrical/PY electricalise/S electricalize/S electrician/S electricise/S electricity/S electricize/S electrify/DGN electriques electro electroacoustic/S electroacoustically electroanaesthesia/MS electroanalysis electroanalytic electroanalytical electroanesthesia/MS electrocardiogram/MS electrocardiograph electrocardiographic electrocardiographically electrocardiography electrocauterisation/MS electrocauterization/MS electrochemical/Y electrochemist/S electrochemistry electroconvulsive electrocorticogram/MS electrocute/DGNSX electrode/MS electrodeposit electrodeposition electrodialyse/RSZ electrodialyser/MS electrodialysis electrodialytic electrodialyze/RSZ electrodialyzer/MS electrodynamic/SY electrodynamometer/MS electroencephalogram/MS electroencephalograph electroencephalography electroform electrogalvanise/S electrogalvanize/S electrogenesis electrogenic electrogram/MS electrograph electrohomeopathy/MS electrohomoeopathy/MS electrohydraulic electrohydraulically electrojet electrokinetic/S electroless electrologist electroluminescence electroluminescent electrolyse/DGS electrolysis electrolyte/MS electrolytic electrolytically electrolyze/DGS electromagnet/S electromagnetic electromagnetically electromagnetisable electromagnetism/S electromagnetizable electromechanical/Y electromerism electrometallurgy electrometer/MS electromotive electromyogram/MS electromyograph electromyographic electromyographical electromyographically electromyography electron/MS electronegative electronegativity electronic/S electronically electronography electronvolt electrooculogram/MS electrophilic electrophone electrophoresis electrophoretic electrophoretically electrophoretogram/MS electrophorus electrophotographic electrophotography electrophysiologic electrophysiological/Y electrophysiologist electrophysiology electroplate/R electropositive electroretinogram/MS electroretinograph electroretinographic electroretinography electroscope electroshock/S electrostatic/S electrostatically electrostriction electrosurgery electrosurgical electrotechnology electrotherapist electrothermal/Y electrothermic electrotonic electrotonically electrotonise/S electrotonize/S electrotonus electrotype/R electrotypers electrovalence electrovalency electrovalent electroviscous electroweak electrowinning electrum electuary eleemosynary elegance/S elegancy elegant/IY elegiac elegiacal/Y elegise/DGS elegit elegize/DGS elegy/S eleia element/MS elemental/SY elementalise/S elementalize/S elementarily elementary/P elemi elenchus eleoptene elephant/MS elephantiasis elephantine eleusis elevate/DGNSX elevator/MS eleven/HS elevenfold elevens/S elevon elf elfin elfish/Y elflock elgon elicit/DGS elicitation elicitor elide/DGS elidible eligibility/S eligible/S eligibly eliminable/I eliminate/DGNSVXY eliminator/S elis elision/S elisp elite/PS elitism elitist/S elixir elk/MS elkhound ell elle ellie elliot ellipse/MS ellipsis ellipsoid/MS ellipsoidal ellipsometer/MS ellipsometry elliptic elliptical/Y ellipticity elm/RS elocution elocutionary elocutionist/S eloign elongate/DGNS elope/DGRS elopement eloquence eloquent/IY elroy elsan else/M elsewhere eluant eluate/S elucidate/DGNSV elucidator elucubrate/DGNS elude/DGS eluent elusion elusive/PY elute/DGN elutriate elutriator eluvial eluviate/N eluvium elver elves elvis elvish elyot elysian elysium elytron elytrum em/S emaciate/GNS emaciated emacs/M email/M emanate/DNSVX emanating emanational emancipate/DGS emancipation emancipationist emancipator emarginate/DN emasculate/DGNS emasculator embalm/GRSZ embalmment embank/DGS embankment/S embarcadero embargo/DG embargoes embark/DGS embarkation embarkment embarrass/DGS embarrassable embarrassed/Y embarrassing/Y embarrassment embassage embassy/MS embattle/DGS embattlement embay embayment embed/S embeddable embedded embedder embedding embedment embellish/DGRS embellished/U embellishment/MS ember/S embezzle/DGRSZ embezzlement embezzler/MS embitter/S embittered embitterment emblaze/DGS emblazon/DGRS emblazonment emblazonry emblem/S emblematic emblematical/Y emblematicise/S emblematicize/S emblematisation emblematise/DGS emblematization emblematize/DGS emblements emblemise/S emblemize/S embodiment/MS embody/DGRS embolden/DS embolectomy embolic embolisation embolism embolismic embolization embolus embosom emboss/DGRSZ embossable embossment embouchure embow embowed embowel emboweled emboweling embowelled embowelling embower embrace/DGRSV embraceable embracement embraceor embracery embracing/Y embranchment embrangle embranglement embrasure embrectomy embrittle embrittlement embrocate/DGNS embroglio embroider/DRS embroidery/S embroil/DGS embroilment embrown embrue embryectomy embryo/MS embryogenesis embryogenetic embryogenic embryogeny embryol embryologic embryological/Y embryologist embryology embryonal/Y embryonated embryonic embryonically embryotic embus emcee/D emceeing emden emend/R emendable emendate/N emendator emendatory emerald/MS emerge/DGS emerged/A emergence emergency/MS emergent emeriti emeritus emersed emerses emersion emery/S emesis emetic emetically emetine emf emigrant/MS emigrate/DGNS emigre/M emigree eminence eminency eminent/Y emir emirate emiscan emissary/S emission/AMS emissive emissivity/S emit/S emittance emitted emitter/S emitting emmen emmenagogue emmer emmetropia emollient/S emolument/S emote/DGSV emotion/MS emotional/UY emotionalisation/MS emotionalise/DGS emotionalism emotionalist emotionalistic emotionality emotionalization/MS emotionalize/DGS emotionise/S emotionize/S emotionless/P emotive/Y emotivism emotivity empale empanel/S empaneled empaneling empanelled empanelling empassion empath empathetic empathetically empathic empathise/DGS empathize/DGS empathy empedocles empennage emperor/MS emperorship empery/S emphases emphasing emphasis emphasise/ADGRSZ emphasization/AM emphasize/ADGRSZ emphatic/U emphatically/U emphysema emphysematous empire/MS empiric empirical/Y empiricism empiricist/MS emplace emplacement emplane employ/DGRSZ employability/U employable/U employed/U employee/MS employer/MS employment/MS empoison empoisonment empolder emporium/S empower/DGS empowerment empress empressement emprise emptily empty/DGPRST emptyhanded empurple/DG empyema empyrean empyreuma emu emulate/DGNSVX emulative/Y emulator/MS emulous/PY emulsible emulsifiable emulsify/DNRS emulsion/S emulsionise/S emulsionize/S emulsive emulsoid emunctory en/S enable/DGRSZ enact/DGS enactment/S enactor enamel/S enameled enameler/S enameling/S enamelist/S enamelled enameller/S enamelling enamelling/S enamellist enamellist/S enamelware enamine enamor/DGMS enamored/MPS enamorment/MS enamour/DGMS enamoured/MPS enamourment/MS enantiomorph enarbor/MS enarbour/MS enarthrosis enate encaenia encage encamp/DGS encampment encapsulate/DGNS encapsule/S encarnalisation encarnalise/DGS encarnalization encarnalize/DGS encase/D encasement encash encashment encaustic enceinte enceladus encephalic encephalin encephalitic encephalitis encephalitogenic encephalogram/MS encephalograph encephalographic encephalography encephaloma encephalomyelitis encephalon enchain/D enchainment enchant/DGRS enchanting/Y enchantment enchantress enchase/DG enchilada enchiladas enchiridion enchondroma enchorial encipher/DGRS encipherment encircle/DGS encirclement enclasp enclave/S enclitic enclose/DGS enclosure/MS encode/DGJRSZ encolor/DGMS encolour/DGMS encomia encomiast encomium/S encompass/DGS encompassment encore/DGS encounter/DGS encourage/DGRS encouragement/S encouraging/Y encrimson encrinite encroach/DGRS encroachment encrust/DGS encrustation encrypt/DGS encryption/MS enculturation encumber/DGS encumbered/U encumbrance/RS encyclical encyclopaedia/MS encyclopaedic encyclopaedically encyclopaedism encyclopaedist encyclopedia/MS encyclopedic encyst encystation encystment end/DGJRSZ endamage endanger/DGS endangerment endarch endarchy endbrain endear/DGS endearing/Y endearment/S endeavor/DGMRSZ endeavored/U endeavorer/MS endeavour/DGRSZ endeavoured/U endeavourer/MS endemic endemically endemicity enderby endergonic endermic endermically endexine endgame endite endive/S endleaf endless/PY endlong endmost endnote/MS endo endobiotic endoblast endoblastic endocardial endocarditis endocardium endocarp endocentric endochondral endocranium endocrine endocrinologic endocrinological endocrinologist endocrinology endocytic endocytosis endocytotic endoderm endodermal endodermis endodontia endodontic/S endodontically endodontist endoenzyme endoergic endoerythrocytic endogamic endogamous endogamy endogen endogenic endogenous/Y endogeny endolymph endolymphatic endometrial endometriosis endometrium endomitosis endomorph endomorphic endomorphism endomorphy endoneurium endonuclease endoparasite endoparasitism endopeptidase endophyte endophytic endoplasm endoplasmic endorsable endorse/DGRS endorsee endorsement/MS endoscope endoscopic endoscopically endoscopy endoskeletal endoskeleton endosmosis endosmotic endosmotically endosome endosperm endospermic endospermous endospore endosporic endosporous endosteal/Y endosternite endosteum endostosis endostyle endosymbiosis endothecium endothelial endothelioma endothelium endotherm endothermal endothermic endotoxic endotoxin endotracheal endotrophic endotropic endover endow/DGS endowment/MS endozoic endpaper endplate endplay endpoint/S endue/DG endurable/U endurably/U endurance endure/DGS enduring/PY endways endwise enema/MS enemata enemy/MS energetic/S energetically energid energisation energise/GRZ energised/U energises energization energize/GRZ energized/U energizes energumen energy/S enervate/DGNSV enface enfant/S enfeeble/DGS enfeeblement enfeoff enfetter enfever enfilade enflame/DGS enfold enforcable/U enforce/DGRSZ enforceability enforceable/U enforced/Y enforcement/A enforcible/U enfranchise/DGRS enfranchisement engadine engage/DGS engagement/MS engaging/Y engender/DGS engild engine/DGMS engineer/DGJMS engineering/SY engineroom/S enginery engird engirdle englacial england/RZ englut englutted engluttin engorge/DGS engorgement engr engraft engrail engrailed engrain engram/MS engramme/MS engrammic engrandise/S engrandisement/MS engrandize/S engrandizement/MS engrave/DGJRSZ engross/DGR engrossed/Y engrossing/Y engrossment engulf engulfed engulfing engulfment engulfs enhalo enhance/DGS enhancement/MS enharmonic enharmonically enhypostatise/S enhypostatize/S enigma enigmatic enigmatical/Y enisle eniwetok enjambement enjambment enjoin/DGS enjoinder enjoy/DGS enjoyable/P enjoyably enjoyment enkindle enlace enlacement enlarge/DGRSZ enlargeable enlargement/MS enlighten/DGS enlightening/U enlightenment enlist/DGRS enlistee enlistment/S enlists/A enliven/DGS enmesh/D enmeshment enmity/S ennage ennead enneagon enneahedron ennerdale ennervation ennis enniskillen ennius ennoble/DGRS ennoblement ennui enol enolase enolic enolisation/MS enolise/S enolization/MS enolize/S enologist enology enormity/S enormous/PY enosis enough enounce enow enphytotic enplane enqueue/DS enquire/DGRSZ enquiry/S enrage/DGS enrapt enrapture/DGS enregister enrich/DGRS enrichment enrobe enrol/S enroll/S enrolled enrollee/S enrolling enrollment/MS enrolment/MS enroot ensample ensanguine enschede ensconce/GS ensconced enscroll ensemble/MS ensepulcher/MS ensepulchre/MS enserf enserfment ensheathe enshrine/DS enshrinement enshroud ensiform ensign/MS ensilage ensile/DG ensional enslave/DGRSZ enslavement ensnare/DGS ensnarl ensolite ensor ensorceled ensorcelled ensorcells ensorcels ensoul ensphere ensue/DGS ensure/DGRSZ enswathe entablature entablement/S entail/DGRS entailment entangle/DGRS entanglement entasis ente entebbe entelechy entellus entendre entente enter/DGRS enterable enteral/Y enteric enteritis enterogastrone enterokinase enteron enterostomy enterotomy enterovirus enterprise/GRS enterprising/Y entertain/DGRSZ entertaining/Y entertainment/MS enthalpy enthetic enthral/S enthrall/S enthralled enthralling enthrallment/MS enthralment/MS enthrone/DGS enthronement enthronisation/MS enthronise/S enthronization/MS enthronize/S enthuse/DGS enthusiasm/S enthusiast/MS enthusiastic/U enthusiastically/U enthymeme entice/DGRSZ enticement enticements entire/Y entirety/S entitle/DGS entitlement/S entity/MS entoblast entoderm entodermal entodermic entoil/D entomb/D entombment entomic entomological entomologise/DGS entomologist entomologize/DGS entomology entomophagous entomophilous entomophily entomostracan entophyte entopic entourage/S entozoic entozoon entrail/S entrain/DGRS entrainment entrammel entrance/DGS entrancement entranceway entrant/S entrap/S entrapment/S entrapped entrappingly entreat/DGS entreating/Y entreatment entreaty/S entrechat entree/S entremets entrench/DGS entrenchment/S entrepreneur/MS entrepreneurial entrepreneurship entresol entropy/S entrust/DGS entrustment entry/MS entryism entryist/S entryname/S entrypoint/S entryway entwine/DGS entwinement entwist enucleate/DGN enugu enumerable enumerate/DGNSVX enumerated/U enumerator/MS enunciable enunciate/DGS enunciated/U enunciation enunciator/S enure enuresis envapor/MS envapour/MS envelop/DGRS envelope/DGRS envelopment/S envenom/DGS envenomisation envenomization enver enviable/P enviably envied/U envious/PY environ/DGS environment/MS environmental/Y environmentalism environmentalist/S envisage/DGS envision/DGS envisionin envoi/S envoy/MS envy/DGRS envying/Y enwheel enwind/G enwomb enwrap enwreath enwreathe enzed enzootic enzymatic enzymatically enzyme/S enzymic enzymically enzymologist enzymology enzymolysis eobiont eogene eohippus eolian eolic eolipile eolith eolithic eon/MS eonian eonism/MS eos eosin eosine eosinophil epact epaminondas eparch eparchy epaulet/MS epaulette epencephalon epenthesis epergne epexegesis ephah ephebe ephemeral/SY ephemerality ephemerides ephemeris ephemeron ephesians ephod ephor epiblast epiboly epic/MS epical/Y epicalyx epicanthus epicardial epicardium epicarp epicedium epicene epicenism epicenter/MS epicentral epicentre/MS epiclesis epicontinental epicotyl epicrisis epicritic epictetus epicure epicurean epicureanism epicurism epicurus epicycle/S epicyclic epicyclical/Y epicycloidal epidaurus epideictic epidemic/MS epidemical/Y epidemicity epidemiologic epidemiological/Y epidemiologist epidemiology epidermal epidermic epidermis epidiascope epididymis epidote epidural epifocal epigastrium epigeal epigene epigenetic epigenous epigeous epiglottis epigone epigram/S epigrammatic epigrammatical/Y epigrammatisation epigrammatise/DGRS epigrammatism epigrammatist epigrammatization epigrammatize/DGRS epigraph/R epigraphic epigraphical/Y epigraphist epigraphy epigynous epilate epilepsy epileptic/S epileptically epileptoid epilimnion epilogue/S epimere epimerism epimorphism epimorphosis epimysium epinasty epinephrine epineurium epiphanous epiphany epiphenomena epiphenomenal/Y epiphenomenalism epiphenomenon epiphragm epiphyseal epiphysis epiphyte epiphytic epiphytotic epirogeny epirus episcopacy episcopal/Y episcopate episcope episematic episiotomy episode/MS episodic episodical/Y episomal/Y episome epispastic epistasis epistasy epistatic epistaxis epistemic epistemically epistemological/Y epistemologist epistemology episternum epistle/MRS epistolary epistolatory epistoler epistrophe epitaph/DG epitaphial epitaphic epitaphise/S epitaphize/S epitaphs epitaxial/Y epitaxy epithalamium epithelial epithelioma epithelium epithet/MS epithetic epithetical epithetise/S epithetize/S epitome/S epitomisation/MS epitomise/DGRSZ epitomised/U epitomization/MS epitomize/DGRSZ epitomized/U epizoic epizoon epizootic epoch epochal/Y epoches epochs epode/S eponym eponymous eponymy epos epoxide epoxy epping eprom/S epsilon/S epyllion equability equable/P equably equal/SY equaled/U equaling equalisation/MS equalise/DGJRSZ equalised/U equaliser/MS equalises/U equalitarian equalitarianism equalities/I equality/MS equalization/MS equalize/DGJRSZ equalized/U equalizer/MS equalizes/U equalled/U equalling equally/U equanimity/S equate/DGNSX equational/Y equator/MS equatorial equatorward equerry/S equestrian/S equestrianise/S equestrianize/S equestrienne equiangular equiangularity equicaloric equidistant/Y equifrequent/Y equilateral/S equilibrant equilibrate/DGNS equilibrator/S equilibratory equilibria equilibrist equilibristic equilibrium/S equimolal equimolar equimolecular equine/S equinoctial equinox equip/S equipage equipartition equipment/S equipoise equipollence equipollent/Y equiponderant equiponderate equipotent equipotential equipped equipping equiprobable equiproportional equiproportionality equiproportionate equitability equitable/P equitably/I equitant equitation equites equity/IS equivalence/DGS equivalency equivalent/SY equivocal/PY equivocality equivocate/DGS equivocation equivocator equivoke equivoque equuleus era/MS eradiate eradicable/I eradicably/I eradicate/DGNSV eradicator/S eradictions erasability/S erasable erase/DGNRSZ erasure erbium erciyas ere erebus erect/DGPSY erectable erectile erectility erection/MS erector/MS erelong eremite erenow erepsin erethism erevan erewhile/S erfurt erg ergastoplasm ergative ergatocracy ergo ergodic ergodicity ergograph ergometer/MS ergometric ergonomic/S ergonomist ergonovine ergosterol ergot ergotamine ergotic ergotised ergotises ergotism ergotized ergotizes ergotropic erhard ericaceous eridanus erinaceous eringo erinyes eris eristic erith erivan erk erlang/NR erlking ermine/DMS erne erode/DGS erodibility erodible erogenic erogenous erose/Y erosible erosion erosional/Y erosive/P erosivity erotema erotic erotica erotical erotically eroticisation eroticise/DGS eroticism eroticist eroticization eroticize/DGS erotism erotogenic erotology erotomania err/DGS errancy/S errand/S errant/SY errantry errata/S erratic erratical erratically erraticism erratum errhine erring/UY erroneous/PY error/MS errorless errupt/V ersatz erst erstwhile erubescence eruct erudite/NY erumpent erupt/DGSV eruptible eruption/S eruptive/Y erymanthus eryngo erysipelas erysipeloid erythema erythrism erythrite erythritol erythroblast erythroblastosis erythrocyte erythrocytometer erythromycin erythropoiesis erzgebirge erzurum esaki esau esbjerg escadrille escalade/RS escalate/DGNS escalator/S escalatory escallop/S escalope escapable/I escapade/MS escape/DGRS escapee/MS escapement/S escapism escapist escapologist escapology escargot escarp escarpment/MS escaut eschalot escharotic eschatology escheat escherichia eschew/DGS eschewal escoffier escolar escort/DGS escot escribe escritoire escrow escuage escudo esculent escurial escutcheon/S esdraelon esemplastic eserine esher esker esky esophageal esophagi esophagus esoteric esoterica esoterically esotericism esp espadrille espagnol espalier espanol esparto especial/Y esperance espial espionage esplanade espoo espousal/S espouse/DGRS espresso/S esprit/S espy/DGS esquimau esquire/S esro essaouira essay/DRS essayist essayistic essayists essence/MS essential/PSY essentialise/S essentialism essentialist essentiality essentialize/S essequibo essonite essonne establish/DGRS establishable establishment/MS establishmentarian establishmentarianism estancia estate/MS este esteem/DGS esteemable ester esterase esterify esterisation/MS esterise/S esterization/MS esterize/S esters esthesia esthesiometer/MS esthesis esthete/S esthetic/MS esthetically esthonia estienne estimable/P estimate/DGNSVX estimating/A estimator/S estipulate estival estivate/N estop estoppal estopped estoppel estopping estovers estrade estradiol estragon estral estrange/DGRS estrangement estray estreat estremadura estrin estriol estrogen estrogenic estrogenically estrone estrous estrum estrus estuarial estuarine estuary/S esurience esuriency esurient/Y et eta/S etaerio etagere etalon etamine etaoin etatism etatist etc etcetera/S etch/GRS etchant etched eteocles eternal/PY eternalisation/MS eternalise/DGS eternalization/MS eternalize/DGS eterne eternise/DGS eternity/S eternize/DGS etesian ethane ethanol ethene ether/MS ethereal/PY etherealisation/MS etherealise/DGS ethereality etherealization/MS etherealize/DGS etherege etheric etherify etherisation/MS etherise/DGRSZ etherish etherization/MS etherize/DGRSZ etherlike ethic/S ethical/PY ethicality ethically/U ethician/S ethicisation ethicise/DGS ethicist/S ethicization ethicize/DGS ethmoid ethnarch ethnic ethnical ethnically ethnicise/S ethnicity/S ethnicize/S ethnobiological ethnobiology ethnobotany ethnocentric ethnocentrically ethnocentricity ethnocentrism ethnogeny ethnographer ethnographers ethnographic ethnographical/Y ethnography ethnol ethnologic ethnological/Y ethnologist ethnology ethnomethodology ethnomusicology ethological ethologist ethology ethonone ethos ethoxide ethoxy ethoxyethane ethyl ethylate/N ethylbenzene ethylene ethylenic ethylenically ethylic ethyne ethynyl etiolate etiology/MS etiquette etna etude/S etui etymological/Y etymologisation etymologise/DGS etymologist/S etymologization etymologize/DGS etymology/S etymon etzel eubacteria euboea eucaine eucalyptol eucalyptus eucaryotic eucharistic euchlorine euchre euchromatin eucken euclidian eucre eudemon eudemonia eudemonics eudiometer eudoxus eugenic/S eugenically eugenicist eugenol euglena euhemerise euhemerism euhemerist euhemeristic euhemeristically euhemerize eukaryote eukaryotic eulachon eulogia eulogisation/MS eulogise/DGRSZ eulogist eulogistic eulogistically eulogium eulogization/MS eulogize/DGRSZ eulogy/S eumorphic eunuch eunuchism eunuchs eupatrid eupen eupepsia euphausiid euphemise/DGRS euphemism/MS euphemist euphemistic euphemistically euphemize/DGRS euphonic euphonically euphonious/PY euphonisation euphonise/DGS euphonium euphonization euphonize/DGS euphony euphorbia euphorbiaceous euphoria euphoriant euphoric euphorically euphotic euphrasy euphroe euphuism euphuist euphuistic euphuistically euplastic euploid eupnoea euratom eure eureka eurhythmic/S eurhythmy euripus europeanish europium eurypterid eurythermal eurythmic/S eurythmy eurytopic eurytopicity eurytropic eusebius eusporangiate eustatic eutectic eutectoid euthanasia euthanasic euthenics euthenist eutherian euthyroid eutrophic eutrophy/N eux euxenite evacuant evacuate/DGNSVX evacuator evacuee/S evadable evade/DGRS evaginate evagination evaluable evaluate/DGNSVX evaluated/AU evaluator/MS evanesce/DGS evanescence evanescent evangel evangelic evangelical/Y evangelicalism evangeline evangelisation/MS evangelise/DGRSZ evangelism evangelist/S evangelistic evangelistically evangelization/MS evangelize/DGRSZ evanish evanishment evaporable evaporate/DGNSVX evaporative/Y evaporativity evaporator/S evaporimeter/S evaporite evaporitic evapotranspiration evasion/S evasive/PY eve/S evection even/DGJPRSY evenfall evenhanded/PY evening/MS evensong event/MS eventful/PY eventfully/U eventide/S eventless eventual/Y eventualise/S eventuality/S eventualize/S eventuate/DGS ever/T everblooming evergreen everlasting/PY evermore eversible eversion/S evert every everybody/M everyday/P everyman everyone/MS everyplace everything everywhere eves/A evict/DGS evictee/S eviction/MS evictor/S evidence/DGS evident/Y evidential/Y evidentiary evil/PSY evildoer/S evildoing eviler evilest eviller evillest evince/DGS evincible eviscerate/DGNS evitable evite evocable evocate/NVX evocative/PY evocator/S evoke/DGS evolute/MNSX evolution/MS evolutionarily evolutionary evolutionise/S evolutionism evolutionist evolutionists evolutionize/S evolvable evolve/DGS evolvement evulsion/S evzone ewe/MS ewen ewer ex exacerbate/DGNSX exact/DGPRSY exacta exactable exacting/PY exaction/MS exactitude/I exactor/S exaggerate/DGNSVX exaggerated/PY exaggerative/Y exaggerator/S exagitates exalt/DGRSZ exaltation/S exalted/Y exam/MNS examinable examinant/S examination/MS examinational examinatorial examine/DGRSZ examined/AU examinee/S example/DGMS exampled/U exanimate/DGS exanthema exarate exarch exarchate exasperate/DGNSX exasperated/Y exasperating/Y excaudate excavate/DGNSX excavational excavator/S exceed/DGRS exceeding/Y excel/S excelled excellence/S excellency excellent/Y excelling excelsior except/DGSV exception/MS exceptionability exceptionable/U exceptionably/U exceptional/PY exceptionality exceptionally/U excerpt/DRS excerption/S excerptor/S excess/SV excessive/PY exchange/DGRSZ exchangeability exchangeable exchangee/S exchequer/MS excide/DGS excipient excisable excise/DGNSX exciseman excitability excitable/P excitant/S excitation/MS excitative excitatory excite/DGRS excited/Y excitement exciting/Y exciton excitor exclaim/DGRSZ exclamation/MS exclamatory exclaustration exclave/S exclosure/S excludability excludable exclude/DGRS excludible exclusion/RSZ exclusionary exclusionist/S exclusive/PY exclusivity excogitate/NV excommunicate/DGNSV excommunicator excoriate/DGNSX excrement/MS excremental excrementitious excrescence/S excrescency excrescent/Y excreta excretal excrete/DGNRSX excretory excruciate/DGNS excruciatingly exculpate/DGNSX exculpatory excurrent excursion/MS excursionise/S excursionist/S excursionize/S excursive/PY excursus/S excusable/IP excusably/I excusatory excuse/DGRS excused/U exeat exec execrable/P execrably execrate/DGNSV execrator/S executability executable/MS executant execute/DGNRSVXZ execution/RS executional executive/MS executor/MS executorial executory executrices executrix/S exedra exegesis exegete exegetic/S exegetical/Y exegetist exemplar/S exemplarily exemplarity exemplary/P exemplify/DGNRSZ exemplum exempt/DGS exemption/S exenterate/DGNSX exequatur exequies exercisable exercise/DGRSZ exercitation exergonic exergue exert/DGS exertion/MS exeunt exfoliate/DGNSV exhalant/S exhalation/S exhale/DGS exhalent/S exhaust/DGRSV exhausted/Y exhaustibility/I exhaustible/I exhausting/Y exhaustion exhaustive/PY exhaustivity exhaustless/PY exhibit/DGSV exhibition/MRS exhibitionise/S exhibitionism exhibitionist exhibitionistic exhibitionize/S exhibitor/MS exhibitory exhilarant exhilarate/DGNSV exhilarating/Y exhort/DGRS exhortation/MS exhortative exhortatory exhumation/S exhume/DGRS exigence exigency/S exigent/Y exigible exiguity exiguous/PY exile/DGS exilic eximious exine exist/DGS existence/S existent/I existential/Y existentialise/S existentialism existentialist/MS existentialistic existentialistically existentialize/S exit/DGS exitance exo exobiological exobiologist exobiology exocarp exocentric exocrine exocyclic exoderm exodermis exodontia exodontics exodontist exodus exoergic exogamic exogamous exogamy exogenous/Y exonerate/DGNSV exonuclease exonym exopeptidase exophthalmic exophthalmos exoplasm exorable exorbitance/S exorbitant/Y exorcise/DGS exorciser exorcism exorcist exorcistic exorcistical exorcize/DGS exordial exordium exoskeleta exoskeletal exoskeleton exoskeletons exosmosis exosmotic exosphere exospheric exospore exostosis exosystem/S exoteric exotericaly exothermal exothermic exothermically exotic/P exotica exotically exoticism exotism exotoxin expand/DGRSZ expandable expanded/U expander/MS expanse/DGNSVX expansibility expansible expansile expansional expansionary expansionism expansionist expansionistic expansive/PY expansivity expatiate/DGNS expatriate/DGNS expecially expect/DGS expectable expectably expectance expectancy/S expectant/Y expectation/MS expectative expected/PUY expecting/Y expectorant expectorate/N expedience/I expediency/I expedient/IY expediential expedite/DGNRSX expedition/MS expeditionary expeditious/PY expeditor expel/S expellable expellant expelled expellee expeller/S expelling expend/DGRS expendability expendable expended/U expenditure/MS expense/DGSV expensive/IPY experience/DGS experienced/IU experiential/Y experientialism experiment/DGRSZ experimental/Y experimentalise/S experimentalism experimentalist/MS experimentalize/S experimentation/MS experimentise/S experimentize/S expert/PSY expertise expertism expiable/I expiate/DGNS expiator expiatory expiration/MS expiratory expire/DGS expiry explain/DGRSZ explainable/IU explained/U explanation/MS explanative/Y explanatorily explanatory explant/S explantation expletive/S expletory explicable explicably explicate/DGNSV explicative/Y explicator explicatory explicit/PY explicite/Y explicity explictly explode/DGRS explodent exploit/DGRSVZ exploitable exploitation/MS exploitative/Y exploited/U exploration/MS explorational explorative/Y exploratory explore/DGRSZ explored/U explosibility explosible explosion/MS explosive/PSY expo/S exponent/MS exponential/SY exponentiate/DGNSX exponentiation/MS exponible export/DGRSZ exportability exportable exportation expose/DGRSZ exposit/D exposition/MS expositional expositor expository expostulate/N expostulatory exposure/MS expound/DGRS express/DGRSVY expressage expressed/U expressibility/I expressible/I expressibly/I expression/MS expressional expressionism expressionist/S expressionistic expressionistically expressionless/PY expressive/IPY expressivity expresso expressway/S expropriate/DGNSX expropriator/S expulsion expulsive expunction expunge/DGRS expurgate/DGNS expurgator expurgatorial expurgatory exquisite/PY exsanguinate/N exsanguine exscind exsect exsert/D exsertile exsertion/S exsiccate/N exstipulate exstrophy ext extant extemporal/Y extemporaneity extemporaneous/PY extemporarily extemporary extempore extemporisation/MS extemporise/DGRSZ extemporization/MS extemporize/DGRSZ extend/DGRS extendable extended/PY extendibility extendible/S extensibility extensible/I extensile extension/MS extensional/Y extensionality extensity extensive/PY extensometer/MS extensor extent/MS extention/S extenuate/DGN extenuator extenuatory exterior/MSY exteriorisation/MS exteriorise/DGS exteriority exteriorization/MS exteriorize/DGS exterminate/DGNSX exterminator/MS exterminatory extermine extern external/SY externalisation/MS externalise/DGS externalism externalities externality externalization/MS externalize/DGS externship exteroceptive exteroceptor exterritorial exterritoriality extinct/V extinction extine extinguish/DGRSZ extinguishable extinguishant extinguishment extirpate/DGNV extol/S extoll extolled extoller extolling extolment extort/DGRSV extortion/R extortionary extortionate/Y extortionist/MS extra/S extracanonical extracellular/Y extrachromosomal extracorporeal/Y extracranial extract/DGSV extractability extractable extractible extraction/MS extractive/Y extractor/MS extracurricular extraditable extradite/NS extrados extradoses extragalactic extrajudicial/Y extralegal/Y extralimital extralinguistic extralinguistically extrality extramarital extramundane extramural/Y extraneous/PY extranuclear extraordinarily extraordinary/P extrapolate/DGNSVX extrapolator extraposition extrasensory extrasystole extrasystolic extraterrestrial extraterritorial extraterritoriality extrauterine extravagance extravagancy extravagant/Y extravaganza/S extravagate extravasate/N extravascular extravehicular extraversion extraversive extravert/D extrema extremadura extremal extreme/DPRSTY extremis extremism extremist/MS extremity/MS extremum extricable/I extricate/DGNS extrinsic extrinsically extrorse/Y extroversion extrovert/DS extrudability extrudable extrude/DGRS extrusion extrusive exuberance exuberant/Y exuberate exudate/V exudation exude/DGS exult/DGS exultance exultancy exultant/Y exultation exulting/Y exurban exurbanite exurbia exuviae exuviate exuviation eyas eye/DGRSZ eyeball/S eyebath eyeblack eyebolt eyebright eyebrow/MS eyecup eyed/P eyedropper eyedropperful eyeful eyeglass/S eyehole eyehook eyeing eyelash/S eyeless eyelet/S eyeleteer eyelid/MS eyelike eyeliner eyepatch eyepiece/MS eyepoint eyepopper eyeshade eyeshot eyesight eyesore/MS eyespot eyestalk eyestrain eyestrings eyeteeth eyetie eyetooth eyewash eyewink eyewitness/MS eyot/S eyra eyre eyrie eyrir eysenck f's fab fabaceous fabians fabius fable/DGRS fabliau fabre fabric/MS fabricant fabricate/DGNSX fabricator/S fabular fabulist fabulous/PY facade/DGS face/DGJRS facebar faced/A facedown faceless/P facement facepiece/S faceplate faces/A facet/DGS facetiae facetious/PY facetted faceup facia facial/Y facies facile/PY facilitate/DGNSV facilitator facilitators facilitatory facility/MS facilties facsimile/DGMS facsimilise/S facsimilize/S fact/MS facticity faction/MS factional/Y factionalism factious/PY factitious/PY factitive/Y facto factor/DGJS factorable factorage factorial factorisation/MS factorise/DGS factorization/MS factorize/DGS factorship factory/MS factotum factual/PY factualism factualist/S factuality facture/S facula faculae facultative/Y faculty/MS fad/S fadden faddish/P faddism faddist/S fade/DGRSZ fadeaway faded/Y fadeless/Y fadeout fadge fading/U faecal faeces faenza faerie faeroes faeroese faery faff fag/S fagaceous fagging faggot/GS fahlband faial faience fail/DGJS failing/SY faille failsafe failsoft failure/MS fain faint/DGPRSTY fainthearted/PY faintish/P fair/DGPRSTY fairbanks fairgoer/S fairground fairgrounds fairish/Y fairlead/R fairless fairview fairway/S fairweather fairy/MS fairyfloss fairyland fairylike faith/U faithful/PSY faithless/PY faiths faitour faiyum fake/DGRS fakery fakir falafel falbala falcate/D falchion falciform falcon/RS falconet falconiform falconine falconry falderal faldstool falerii falk fall/GNRS fallacious/PY fallacy/MS fallal fallback fallfish fallibility/I fallible/I fallibly falloff fallout/S fallow/P false/PRTY falsehood/MS falsetto/S falsety/S falsework falsies falsify/DGNRS falsity falster faltboat falter/DGRS faltering/UY falun famagusta fame/DGS familial familiar/PSY familiarisation/MS familiarise/DGRSZ familiarised/U familiarising/Y familiarity/S familiarization/MS familiarize/DGRSZ familiarized/U familiarizing/Y familiarly/U familism familist family/MS famine/MS famish/DGS famishment famous/PY famously/I famulus fan/MS fanagalo fanatic/MS fanatical/P fanatically fanaticise/DGS fanaticism fanaticize/DGS fancier/MS fanciful/PY fancily fancy/DGPRSTZ fancywork fandangle fandango fane/N fanfani fanfare fanfaronade fanfold fang/DMS fangio fangled fango fankle fanlight fanlike fanned fanner fanning fanon fanout fantail fantasia fantasise/DGRS fantasist fantasize/DGRS fantasm fantast fantastic fantastical/P fantasticality fantastically fantasticate/DGNS fantasy/DMS fantoccini fantod fantom fanwise faqir far farad faradic faradisation/MS faradise/DGRSZ faradism faradization/MS faradize/DGRSZ farandole faraway farce/GMS farceur farci farcical/Y farcicality farcy fard fardel fare/DGRS farewell/S farfetched/P farina farinaceous farinose farl farm/DGRSZ farmer/MS farmhand/S farmhouse/MS farmland/S farmstead/G farmworker/S farmyard/MS faro farrier farriery farrow farseeing farside farsighted/PY fart farther farthermost farthest farthing fasces fascia fascial fasciate fasciated fasciation fascicle/DS fascicular/Y fasciculate/DNX fascicule fasciculus fascinate/DGNSX fascinating/Y fascinator/S fascine fascism fascist/S fascistic fascistically fascisticisation/MS fascisticise/S fascisticization/MS fascisticize/S fascistisation/MS fascistise/DGS fascistization/MS fascistize/DGS fash fashion/DGRSZ fashionability/S fashionable/P fashionably/U fashionise/S fashionize/S fashionmonger fashoda fast/DGNPRSTX fastback fastball/MS fasten/DGJRSZ fastened/U fastidious/PY fastigiate fastuous/Y fat/PSY fatah fatal/SY fatalise/S fatalism fatalist fatalistic fatalistically fatalists fatality/MS fatalize/S fatback fate/DGS fateful/PY fathead/D fatheaded/P father/DGMSY fathered/U fatherhood fatherland fatherless fatherlike fatherly/P fathom/DGS fathomable fathomless/PY fatidic fatigability fatigable fatigue/DGS fatiguing/Y fatling fatso fatted fatten/DGRSZ fatter fattest fatting fattish fatty/PRS fatuity fatuous/PY faucal fauces faucet/S faugh faulknerian fault/DGS faultfinder faultfinding faultily faultless/PY faulty/PR faun fauna/I faunal/Y faunistic faunistically fauntleroy faunus fauteuil fauve fauvism fauvist faux faveolate favonian favor/DGJMRSZ favorable/MPSU favorably/U favored's/U favored/MPSY favorer/MS favoring/MSY favorings/U favorite/MSU favoritism/MS favorless/S favors/A favour/DGJRSZ favourable/PSU favourably/U favoured's/U favoured/MPSY favourer/MS favouring/MSY favourings/U favourite/MSU favouritism/MS favourless/S favours/A favrile favus fawkes fawn/DGRS fawning/Y fawny fax/MS fay fayalite fayum faze/DGS feal fealty fear/DGRS fearful/PY fearless/PY fearnought fearsome/PY feasibility feasible/P feasibly feast/DGRS feat/GMSY feather/DGRSZ featherbed featherbedding featherbrain/D feathered/U featheredge featherhead/D featherless featherman featherstitch feathertop featherweight feathery feature/DGS featureless feaze febricity febrifacient febrific febrifuge febrile fecal feces fechner feck feckless/PY feckly fecula feculence feculent fecund/I fecundability fecundate/DGNSX fecundise/S fecundity fecundize/S fed/S fedayee federal/SY federalisation/MS federalise/DGS federalism federalist/S federalization/MS federalize/DGS federate/DGSVX federated/U federation federative/Y fedora fee/S feeble/PRT feebleminded/PY feebly feed/GJRSZ feedback/S feedbag feedlot feedstock feedstuff feeing feel/GJRSZ feeling/PSY feet feetfirst feeze feign/DGRS feigned/U feininger feint/DGS feist feisty/R felafel feldspar feldspathic felicific felicitate/DGNS felicitator felicitous/PY felicitously/I felicity/S feline/SY felinity fell/DGPRSZ fella/S fellable fellah fellatio fellation/S felled/A felling/A fellini fellmonger felloe fellow/MSY fellowman fellowship/MS felo felon/S felones felonious/PY felonry felony felsite felsitic felspar felt/DGS felucca female/MPS femalise/S femalize/S feminine/PY femininity feminisation/S feminise/DGS feminism feminist/MS feministic feminity feminization/S feminize/DGS femme/S femoral femur/MS fen fence/DGRSZ fenced/U fenceless/P fencepost fencible fend/RZ fenestella fenestra fenestral fenestrate/DNS fennec fennel fennelflower fenny fenugreek feoff feoffee feoffment feral ferbam ferdinando fere feretory fergana feria ferial ferine fering ferity fermanagh ferment/DGRS fermentable fermentation/MS fermentative fermion/MS fermium fern/MS fernandel fernery fernlike ferny ferocious/PY ferocity ferrari ferrate ferreled ferreling ferrelled ferrelling ferreous ferret/DGRS ferrety ferriage ferric ferricyanic ferricyanide ferriferous ferrimagnet ferrimagnetic ferrimagnetically ferrimagnetism ferris ferrite ferritic ferritin ferritisation/MS ferritization/MS ferro ferrocene ferrochromium ferroconcrete ferrocyanic ferrocyanide ferroelectric/S ferrofluid/S ferrol ferromagnesian ferromagnet/S ferromagnetic ferromagnetism ferromanganese ferrosilicon ferrotype ferrous ferruginous ferrule ferry/DGS ferryboat ferryman fertile/PY fertilisable/SU fertilisation/AMS fertilisational/MS fertilise/DGRSZ fertilised/U fertilises/A fertility/S fertilizable/MSU fertilization/AMS fertilizational/MS fertilize/DGRSZ fertilized/U fertilizes/A ferula ferule fervency fervent/Y fervid/PY fervor/MS fervorless/S fervour/MS fervourless/S fescue fess fesse fest/RZ festal fester/DGS festinate/NY festival/MS festive/PY festivity/S festoon/S festoonery festschrift feta fetal fetalization/MS fetation fetch/DGRS fetching/Y fete/DS feterita fetial feticide fetid/PY fetiparous fetish/S fetishisation/MS fetishise/DGS fetishism fetishist fetishistic fetishization/MS fetishize/DGS fetlock/S fetologist fetology fetor fetter/DGS fettered/U fetterlock fettle/DGS fettuccine fetus/MS feud/MS feudal/Y feudalisable/S feudalisation/MS feudalise/DGS feudalism feudalist feudalistic feudality feudalizable/MS feudalization/MS feudalize/DGS feudatory feudist fever/DGS feverfew feverish/PY feverous/Y feverwort few/PRST fey/P feydeau fez/S fezzes fiacre fiance fiancee fiasco fiat/S fib fibber fibbing fiber/DMS fiberboard fiberglass fiberization fiberize/DGRSZ fiberizer/MS fiberless/S fibration fibre/DMS fibreboard fibrefill fibreglass fibreless/S fibriallating fibriform fibril/S fibrillar fibrillate/DNS fibrilliform fibrillose fibrin fibrinogen fibrinolysin fibrinolysis fibrinous fibrisation fibrise/DGRSZ fibrize/RSZ fibro fibroblast fibrocement fibroid fibroin fibroma fibronectin fibrosis fibrositis fibrous/PY fibrovascular fibula fibular fiche fichte fichu ficino fickle/P ficticious fictile fiction/MS fictional/Y fictionalisation fictionalise/DGS fictionalization fictionalize/DGS fictioneer/G fictionisation/MS fictionise/S fictionist fictionization/MS fictionize/S fictitious/PY fictive/Y ficus fid fiddle/DGRS fiddleback fiddlehead fiddlestick/S fiddlewood fide fideicommissary fideicommissum fideism fideist fideistic fidel fidelism fidelity/I fidge fidget/DGS fidgety/P fidging fiducial/Y fiduciary fidus fie fief fiefdom field/DGRSZ fieldfare fieldmouse fieldpiece fields/I fieldsman fieldstone fieldstrip fieldwork/RZ fiend/S fiendish/PY fierce/PRTY fieri fierily fiery/P fiesole fiesta fifa fife fifteen/HS fifth/Y fifths fifty/HS fiftyfold fig/MS figaro fight/GRSZ fighter/IS fighting/I figment figuline figurable figural figurant figurate/NX figurative/PY figure/DGJRSZ figurehead figurine/S figurise/S figurize/S figwort filable filament/MS filamentary filamentous filar filaria filarial filariasis filature filbert/S filch/DS file/DGJMRSZ filecard filefish filename/MS filespace filestore filet/S filial/UY filiate filiation filibuster/DGRS filicide filiform filigree/D filigreeing filippo fill/DGJRSZ fillable/A fillagree fille/S filled/AU fillet/DGS fillip/S fillment fillmore filly/S film/DGS filmcard filmdom filmic filmically filmily filmise/S filmize/S filmmake/GRZ filmography filmset filmsetting filmstrip/S filmy/PR filoplume filose filoselle fils filter/DGMRS filterability filterable filth filthily filthy/PRT filtrable filtrate/DGS filtration/M filum fimble fimbria fimbrial fimbriate/DNS fin/MS finable finagle/DGRS final/SY finale/MS finalisation/S finalise/DGS finalism finalist/S finality finalization/S finalize/DGS finance/DGS financial/Y financier/MS finback finch finchley find/GJRSZ findable/U fine/DGPRSTY fineable finery finespun finesse/DG finfoot finger/DGJRS fingerboard fingerbreadth fingerlike fingerling fingermark/DGS fingernail/S fingerpost fingerprint/DGS fingerstall/S fingertip/S fingo finial finical/PY finicking finicky/P finis finish/DGJRSZ finished/AU finisterre finitary finite/PSY finitude fink finlike finnan finned finner finney finning finnmark finny fino finochio fiord fiori fiorin fipple fir/S firdausi fire/DGJRSZ firearm/MS fireback fireball/S firebird fireboat firebomb firebox firebrand firebrat firebreak/S firebrick firebug fireclay firecracker/S firecrest fired/U firedamp firedog firedrake firefight/GSZ firefly/MS fireguard firehouse/S fireless firelight/G firelock fireman firemen firenze firepan fireplace/MS fireplug/S firepower fireproof fireroom fireside firestorm firethorn firetrap firewall firewarden firewater firewood firework fireworks firkin firm/DGMPRSTY firma firmament firmamental firmware/S firry first/SY firstborn firstfruits firsthand firstling/S firth/MS fisc fiscal/SY fiscalisation/MS fiscalise/S fiscalization/MS fiscalize/S fish/DGRSZ fishability fishable fishbolt fishbowl fisherman/M fishermen/M fishery/S fishfinger fishgig fishhook fishkill fishmeal fishmonger/S fishnet fishplate/S fishpond fishskin fishtail fishway fishwife fishy/R fishyback fissile fissility fission/DGS fissionability fissionable fissional fissipalmate fissiparous/PY fissiped fissirostral fissure/DGS fist/DS fistfight fistful fistic fisticuff/S fistmele fistnote fistula fistulous fit/PSY fitchew fitful/PY fitment fitted/U fitter/MS fittest fitting/PSY fittipaldi fitzsimmons fiume five/RS fivefold fivepenny fivepins fix/DGJRSZ fixable/U fixate/DGNSVX fixed/PY fixity fixture/MS fixups fizgig fizz/R fizzle/DGS fizzy fjord/S flab flabbergast/DGS flabbergasting/Y flabbily flabby/PR flabellate flabellum flaccid/Y flaccidity flack flacon flag/MS flagellant/S flagellantism flagellar flagellate/DGNS flagelliform flagellum flageolet flagged flagger flagging/UY flaggy flagitious/PY flagman flagon flagpole/S flagrance flagrancy/S flagrant/Y flagrante flagship/MS flagstad flagstaff flagstone flail/DGS flair flak flake/DGRS flaky/PR flam/N flamb flambeau flamborough flamboyance flamboyancy flamboyant/Y flamboyantise/S flamboyantize/S flame/DGRSZ flamelet/S flamenco flameout flameproof flamethrower flaming/Y flamingo flamingoes flamininus flaminius flammability/I flammable/S flamsteed flan/M flanch flange/DS flank/DGRSZ flannel/MS flanneled flannelette flanneling flannelled flannelling flap/MS flapdoodle flapjack flapped flapper/S flapping flappy flare/DGS flareback flaring/Y flash/DGRSZ flashback/S flashboard flashbulb/S flashcube/S flashgun/S flashily flashlight/MS flashover/S flashtube flashy/PR flask flasket flat/PSY flatbed flatboat flatcap flatcar flatette flatfeet flatfish/S flatfoot/DS flathead flatiron/S flatland/RS flatlet/S flatling flatmate/S flatness/S flatted flatten/DGRS flatter/DGRS flattering/UY flattery flattest flatting flattish flattop flatulence flatulency flatulent/Y flatus flatware flatways flatwise flatwork flatworm flaubert flaunch flaunt/DGS flaunting/Y flaunty flautist flavescent flavin flavine flavone flavoprotein flavopurpurin flavor/DGJMRSZ flavored/U flavorer/MS flavorful/Y flavorless/S flavorous flavorsome flavory flavour/DGJMRSZ flavoured/U flavourer/MS flavourful/Y flavourless/S flavoursome flavoury flaw/DGS flawless/PY flax/N flaxman flaxseed flaxy/R flay flea/MS fleabag fleabane fleabite/S fleam fleapit/S fleawort fleck/DGRS flection flective fled fledermaus fledge/GS fledged/U fledgling/MS fledgy flee/RS fleece/DMS fleecy/R fleeing fleeringly fleet/GPSTY fleeting/PY fleischman fleisher flense flesh/DGJRSY fleshment fleshpot/S fleshy/PR fletch/DGJRS fletching/MS fleurette fleury flew/S flex/DG flexed/I flexibility/S flexible/I flexibly/I flexile flexion/AI flexitime flexo flexographic flexographically flexography flexor flexuous/Y flexural flexure fley fleysome flibbertigibbet flibbertigibbety flick/DGRS flicker/DG flickering/Y flickery flight/MS flightily flightless flighty/PR flimflam flimflammed flimflammer flimflamming flimsily flimsy/PRS flinch/DGRS flinching/U flinders fling/GMRS flint/S flintily flintless flintlike flintlock flinty/PR flip/S flipflop flippancy flippant/Y flipped flipper flippers flipping flirt/DGRS flirtation/S flirtatious/PY flirty flit/S flitch flite flitted flitter flitting flivver float/DGRSZ floatage floatation floatplane floaty floc floccose flocculant/S flocculate/DGNS flocculent flocculus floccus flock/DGS flodden floe/S flog/S flogged flogger flogging flong flood/DGRS floodgate floodlight floodlit floodplain floodwall floodwater/MS floodway flooey floor/DGJRS floorage floorboard/S floorwalker floozie/S floozy/S flop/MS flophouse flophouses flopover/S flopped flopper/S floppily flopping floppy/MPRS flora floral/Y floralise/S floralize/S floreated flores florescence/AI florescent/AI floret florey floriate/DNX floribunda florican floricultural/Y floriculture floriculturist florid/PY floridity floriferous/PY florigen florigenic florilegium florin florio florist/S floristic/S floristically floristry floruit flory flos floss/DGS flossy/R flotage flotation/S flotilla/S flotow flotsam flounce/DGS flouncy flounder/DGS flour/DS flourish/DGRS flourishing/Y floury flout/DGRS flow/DGRSZ flowability flowage flowchart/GS flower/DGRS flowerage flowerbed floweret flowerless flowerlike flowerpot flowery/P flowing/Y flown flows/I flowstone flu flub/S flubbed flubbing fluctuant fluctuate/DGNSX flue fluegelhorn fluency fluent/AI fluently fluff/S fluffy/PRT fluid/PSY fluidal/Y fluidextract fluidic/S fluidisation/MS fluidise/DGRS fluidity fluidization/MS fluidize/DGRS fluidounce fluidram fluke flukey fluky/R flume/DGS flummery flummox flump/DGS flung flunk/DGRS flunkeys flunky fluor fluorene fluoresce/RS fluorescein fluorescence fluorescent fluoric fluoridate/DGNSX fluoride/S fluoridisation/MS fluoridise/S fluoridization/MS fluoridize/S fluorimeter/MS fluorimetric fluorimetry fluorinate/GNSX fluorinated fluorine fluorite fluorocarbon fluorometer fluorophore fluoroscope fluoroscopic fluoroscopy fluorosis fluorosulphuric fluorspar flurry/DGS flush/DGPS flushable fluster/DGS flute/DGMRS flutelike flutist flutter/DGRS flutterboard fluttery fluvial fluviatile fluviomarine flux/ADS fluxion fluxional fluxmeter/S fly/GRSZ flyable flyaway flyback flyblow flyblown flyboat/S flybook flyby flybys flycatcher/S flyer/MS flyleaf flyleaves flyman flyover/S flypaper flypast/S flyspeck flyswatter flyte flytier flyting flytrap/S flyway flyweight flywheel/S foal/S foam/DGRS foamflower foamless foamy/PR fob fobbing focal/Y focalisation/MS focalise/DGS focalization/MS focalize/DGS foch foci fock focus/DGRS focusable focused/AU focusless focussable focussed/AU focusser focusses/A focussing/A fodder fodgel foe/MS foehn foeman foetal foetalisation/MS foetation foeticide foetid/PY foetor foetus/MS fog/MS fogbound fogbow/S fogdog fogey/S fogged fogger foggest foggia foggily fogging foggy/PRT foghorn/S fogless fogy/S fogyish fogyism foible/S foie foil/DGS foilsman foin foist/DGS folacin fold/DGJRSZ foldable foldaway foldboat/GR folded/AU folderol foldout/S folia foliaceous foliage/DS foliar foliate/DGNSX folic folie folio/S foliolate foliose foliot/S folium folk/MS folkestone folketing folkish/P folklike folklore folkloric folklorish folklorist folkloristic folkmoot folksily folksinger/MS folksinging folksong/S folksy/PR folktale/MS folkway/S follicle/S follicular folliculate/D folliculin follow/DGJRSZ followership followeth followup/MS folly/S folsom foment/DGRS fomentation/S fond/PRSTY fonda fondant/S fondle/DGRS fondue/S fonseca font/MS fontal fontana fontanelle fonteyn food/MS foodless/P foodstuff/MS fool/DGS foolery foolhardily foolhardy/P foolish/PY foolproof foolscap/M foot/DGJRSZ footage/S football/DMRSZ footboard/S footboy/S footbridge/S footcandle footcloth footfall/S footgear foothill/S foothold/S footle/DGRS footless/PY footlight/S footlike footlocker footloose footman footmark footmen footnote/MS footpace footpad/S footpath footpaths footplate/S footprint/MS footrace footrest/S footrope/S footsie footslog/S footslogged footslogger footslogging footsore/P footstalk footstall footstep/S footstock footstool/S footwall footway/S footwear footwork footworn footy foozle/D fop/S foppery fopping foppish/PY for fora forage/DGRS foramen foraminifer foraminifera forasmuch foray/MRS forbade forbear/GMRS forbearance forbid/S forbiddance forbidden forbidder forbidding/PY forbode forbore forborne forby forbye force/DGMRS forced/Y forcefield/MS forceful/PY forceless forcemeat forceps forcepslike forcible/P forcibly ford/S fordable fordo fordone fore/T forearm/DMS forebear forebears forebode/DRS foreboding/PSY forebrain forecast/DGRSZ forecastle/S foreclose/S foreclosed foreclosing foreclosure forecourse forecourt/S foredeck foredo foredoom/D forefather/MS forefeel forefeet forefend forefinger/MS forefoot forefront foregather forego/GR foregoes foregone foreground/S foregut forehand/D forehanded/PY forehead/MS forehock foreign/PRSYZ foreignisation/MS foreignise/S foreignism foreignization/MS foreignize/S forejudge forejudgement/MS forejudgment/MS foreknow foreknowledge foreknown forelady foreland foreleg forelimb forelock foreman foremanship foremast/S foremen foremost foremother forename/DS forenoon forensic/S forensical/Y foreordain/DGS foreordination forepart forepassed forepast forepaw forepaws forepeak foreplay forequarter/S forereach forerun forerunner/S foresaid foresail foresaw foresee/RS foreseeable foreseeing foreseen/U foreshadow/DGRS foreshank foresheet foreshock foreshore foreshorten/S foreshortened foreshortening foreshow foreside foresight/D foresighted/PY foresightful foreskin forespeak forespent forest/DRSZ forestage forestal forestall/DGRS forestallment forestation forestay forestaysail forestial forestry foreswear foresworn foretaste foretell/GRS foretellable forethought/M forethoughtfully forethoughtfulness forethougtful foretime foretoken foretold foretooth foretop foretriangle forever/P forevermore forewarn/DGJRS forewent forewind forewing forewoman foreword foreworn foreyard forfar forfeit/DGRSZ forfeitable forfeiture/S forfend/DGS forficate forgat forgather forgave forge/DGRSVZ forgeability forgeable forgery/MS forget/SV forgetful/PY forgettable/U forgettably/U forgetter forgetting forgivable/U forgivably forgive/GPRS forgiveable/U forgiveably/U forgiven forgiving/PY forgo/GR forgoes forgone forgot forgotten forint forjudge fork/DGRS forkful forklift forklike forky/R forlorn/PY form/ADGIRSZ forma formability/A formable formal/PSY formaldehyde formalin formalisable formalisation/MS formalise/DGRSZ formalised/U formalises/I formalism/MS formalist formalistic formalistically formality/S formalizable formalization/MS formalize/DGRSZ formalized/U formalizes/I formally/I formant/IS format/DGSV formate/S formation/MS formational/A formations/I formative/PY formatted/AU formatter/MS formatting/A forme formed/AIU former/SY formfeed/S formfitting formful formic formicary formicate/N formidability formidable/P formidably formless/PY formula/MS formulae formulaic formulaically formularisation/S formularise/DGRS formularization/S formularize/DGRS formulary formulate/DGNSX formulator/MS formulisation/S formulise/DGS formulism formulization/S formulize/DGS formwork formyl fornenst fornicate/DGSX fornication fornicator/S fornix forrader forrarder forsake/GS forsaken forsee forseen/U forsook forsooth forspeak forspent forster forsterite forswear/S forswore forsworn fort/MS fortaleza fortalice forte/S fortepiano forth forthcome forthcoming/U forthright/PY forthwith fortify/DGNRSX fortin fortiori fortis fortissimo fortitude fortman fortnight/Y fortress/MS fortuitism fortuitous/PY fortuity fortuna fortunate/PSY fortune/DGMS forty/HRS fortyfold forum/MS forumise/S forumize/S forward/DGPRSYZ forwent forwhy forworn forzando fosbury fossa fossate fosse fossette fossick fossil/S fossiled fossiliferous fossilisable/S fossilisation/MS fossilise/GS fossilised/U fossilizable/MS fossilization/MS fossilize/GS fossilized/U fossilled fossorial foster/DGRS fosterage fosterite fosterling/S fotheringhay fou foucault foucquet foudroyant fought foul/DGPRSTY foulard foulmouth/D found/DGRSZ foundation/MS foundational/Y foundationless founded/U founder/DGS founderous foundling/S foundress foundrous foundry/MS fount/MS fountain/MS fountainhead four/HS fourdrinier fourfold fourpence fourpenny fourscore foursome/S foursquare fourteen/HRS fourth/Y fourths fovea foveola fowey fowl/GRS fowliang fox/DGMS foxfire foxglove foxhole/S foxhound foxily foxtail foxtrot/MS foxy/PR foyboat foyer fracas fracases fractal/MS fracted fraction/DGMS fractional/Y fractionalisation fractionalise/DGS fractionalization fractionalize/DGS fractionate/GSX fractionated fractionation fractionator/S fractionisation/MS fractionise/S fractionization/MS fractionize/S fractions/I fractious/PY fractocumulus fractostratus fracture/DGS frae fraenum frag/S fragged fragging fragile/Y fragility fragment/DGS fragmental/Y fragmentarily fragmentary/P fragmentate/DGSX fragmentation fragmentise/DGRS fragmentize/DGRS fragonard fragrance/MS fragrancy fragrant/Y frail/PRTY frailty/S fraise fraktur framable frambesia framboesia frame/DGJMRSZ frameable framework/MS franc/S franca francaise francesca francesco franchise/DGMRS franchisee franchisor francie francium francois francolin franger frangibility/AI frangible/AI frangipane frangipani frank/DGPRSTY frankalmoign frankfurter/S frankincense franklin frankpledge franny frantic/PY frantically frap frappe/G frass frat/R fratchy fraternal/Y fraternalism fraternisation/MS fraternise/DGRSZ fraternity/MS fraternization/MS fraternize/DGRSZ fratricidal fratricide fraud/MS fraudulence fraudulent/P fraudulently fraught/DGS fraxinella fray/DGS frayne frazzle/DGS freak/MS freakish/PY freaky/R freckle/DGS freckly fredrick free/DPRSTY freebie freeboard freeboot/RZ freeborn freedman freedmen freedom/MS freedomites freedwoman freehand/D freehanded/Y freehearted/Y freehold/RZ freeing/S freelance freeload/R freeman freemartin freemason freemasonry freemen freesheet/S freestanding freestone freestyle freethink/GR freethinkers freeway/MS freewheel/DGRSZ freewheeling/P freewill freeze/GRSZ freida freight/DGRSZ freightage freightliner fremantle fremitus frenchify/N frenetic frenetically frenulum frenum frenzied/Y frenzy/DGS freon frequence/I frequency/S frequent/DGPRSYZ frequentation/S frequentative/S frequented/U frequently/I fresco/DGS frescoes fresh/NPRTXYZ freshen/DGRSZ freshet freshman freshmen freshwater fret/S fretful/PY fretted fretting fretwork friability friable/P friar/MSY friarbird friary fribble/DGS fricasee fricassee frication/MS fricative/S friction/MS frictional/Y frictionise/S frictionize/S frictionless/Y fridge/MS friend/MSY friendless/P friendlily friendly/PRST friendship/MS frieze/MS frig frigate/MS frigging fright/NX frighten/DGS frightening/Y frightful/PY frigid/PY frigidity frigorific frill/DMS frillery frilly fringe/DGIS fringilline fringy/R frippery frippet frisk/DGRS frisket friskily frisky/PR frisson/S frit fritillary frito fritted fritter/RS fritting frivol frivoled frivoler frivoling frivolity frivolled frivoller frivolling frivolous/PY frizz/Y frizzily frizzle/DGS frizzly/R frizzy/PR fro frock/DGMS froe froebel frog/MS frogfish frogged frogging froghopper frogman frogmarch frogmen frogmouth frogspawn froissart frolic/S frolick/DS frolicking frolicsome/PY from frome fromenty fromm frond/DMS fronde frondescence frondeur frondose/Y frons front/DGS frontage frontal/Y frontality frontenac frontier/MS frontiersman frontiersmen frontispiece/S frontless frontlet frontogenesis frontolysis fronton frontrunner frontwards frore frost/DGS frostbite/G frostbitten frosted/U frostily frostwork frosty/PR froth/G frothily froths frothy/PR frottage froude froufrou frow froward/PY frown/DGRS frowning/Y frowst frowsty/R frowsy/R frowzy/R froze frozen/PY fructiferous fructify/NX fructose/MS fructuous/Y frugal/Y frugality frugivorous fruit/DMRS fruitage fruitarian fruitcake fruiter/R fruitful/PUY fruition fruitless/PY fruitlet fruity/R frumentaceous frumenty frump/S frumpish frumpy/R frunze frustrate/DGNRSX frustrating/Y frustule frustum frutescent fry/DGRS fryer ft/A ftp/GJRSZ fuad fubsy fuchsia fuchsin fuck/DGMRSZ fucker/MS fuckwit fucoid fucose fucus fuddle/DGS fudge/DGS fuel/AS fueled/A fueler/S fueling/A fueliser/MS fuelizer/MS fuelled/A fueller fueller/S fuelling/A fugacious fugacity fugal/Y fugard fugato fugger fugio fugitive/MPSY fugue fuguist fukien fukuda fukuoka fukushima fula fulani fulbright fulcra fulcrum fulfil/S fulfill/S fulfilled/U fulfiller fulfilling fulfillment/MS fulfilment/MS fulgent/Y fulgurant fulgurate/DGNSX fulgurite fulgurous fuliginous/Y full/PRT fullback/G fullmouthed fullword/MS fully fulmar fulminant fulminate/DGNSX fulminator/S fulminic fulminous fulness fulsome/PY fulvous fum fumarate fumaric fumarole fumatorium fumatory fumble/DGRS fumbling/Y fume/DGS fumigant fumigate/DNSX fumigator/S fumitory fumy fun funambulist funchal function/DGMS functional/SY functionalise/S functionalism functionalist/S functionalistic functionality/S functionalize/S functionary functionise/S functionize/S functionless functor/MS functorial fund/ADGRSZ fundament fundamental/SY fundamentalism fundamentalist/MS fundamentalistic funded/AU fundi fundraiser/MS fundraising fundus fundy funeral/MS funeralise/S funeralize/S funerary funereal/Y funfair fungal fungi fungibility fungible fungicidal/Y fungicide fungicides fungiform fungistat fungo fungoes fungoid fungous fungus/S funicle funicular funiculus funigating funk funky/PR funnel/S funneled funneler funnelform funneling funnelled funneller funnelling funnily/U funning funny/PRST funnyman fur/MPS furan furbearer furbelow furbish/GRS furcate/DGNSXY furcula furcular furfur furfuraceous furfural furfuraldehyde furfuran furioso furious/PRY furl/DU furless furlong/S furlough/D furloughs furmenty furmity furnace/DGMS furnish/DGJRSZ furnished/U furniture furnivall furor/MS furore/MS furphy furred furriery furring furrow/DGS furry/RZ further/DGRST furtherance furthermore furthermost furthest furtive/PY furuncle furuncular furunculosis furunculous fury/MS furze fusain fuscous fuse/DGNSX fusee/MS fuselage/S fushih fushun fusibility/I fusible/I fusiform fusil fusile fusileer fusilier fusillade/S fusionism/I fusionist fuss/GR fussbudget fussbudgety fussily fusspot fussy/PR fustanella fustian/S fustic fustigate/DGNSX fustily fusty/P futile/PY futilise/S futilitarian futilitarianism futility futilize/S futtock future/MS futureless futurise/S futurism futurist/S futuristic futuristically futurity futurize/S futurology fuzz/D fuzzily fuzzy/PRT fyke fylde fylfot fyn fyrd g's gab gabar gabardine/S gabber gabbing gabble/DGRS gabbro gabby/R gabelle gaberdine gaberlunzie gabfest/S gabion gabionade gable/DRS gablet gabo gabor gaborone gaby gad gadabout/S gaddafi gadded gadder gadding gadfly gadget/MS gadgeteer/S gadgetry gadgety gadhelic gadid gadoid gadolinite gadolinium gadroon gadsden gadwall gadzooks gaea gaekwar gaff/S gaffe/RS gaffsail gag/S gaga gagauzi gage/DGJRSZ gagged gagger gagging gaggle gagman gagmen gagster/S gagwriter/S gahnite gaiety/S gaikwar gaillard gaillardia gaily gain/DGJRSYZ gainful/PY gaingiving gainless/P gainsay/R gaiseric gait/DRSZ gaitskell gaius gal/MS gala galactagogue galactic galactometer galactopoietic galactopyranose galactopyranoside/S galactopyranosyl galactose galah galahad galangal galantine galanty galashiels galata galatians galavant galaxy/MS galba galbanum galbraith gale/S galea galena galenite galileo galimatias galingale galiot galipot gall/DGS gallant/SY gallantise/S gallantize/S gallantly/U gallantry gallberry gallbladder galle galleass galleon/S gallery/DS gallet galley/MS gallfly gallia galliambic galliard gallice gallied galligaskins gallimaufry gallinacean gallinaceous gallinas galling/Y gallinule galliot gallipoli gallipot gallium gallivant/DGS galliwasp gallnut galloglass gallon/MS gallonage galloon galloot gallop/DGRSZ gallopade gallous gallow gallows/S gallstone/S gallus/S galoot galop galore galosh/DGS galsworthy galumph galvani galvanic galvanically galvanisation/AMS galvanise/DRSZ galvanises/A galvanising galvanism galvanization/AMS galvanize/DRSZ galvanizes/A galvanizing galvanometer/MS galvanometric galvanoscope galvanostat galvanotropism galvo galyak gam gama gamba gambado gambit/S gamble/DGRSZ gambol/S gamboled gamboling gambolled gambolling gambrel gambrinus game/DGPSY gamecock gamekeeper/S gamelan gamesman gamesmanship gamesome/PY gamester gametangium gamete/MS gametic gametically gametocyte gametogenesis gametophore gametophyte gamey gamic gamily gamin gamine gamma/S gammadion gammer gamming gammon gamogenesis gamopetalous gamophyllous gamosepalous gamp gamut gamy/PR gan gance gand gandalf gander gandhi gandy gandzha ganesa gang/MRSY gangbang gangland gangling ganglion ganglioside/S gangly/R gangplank gangplow gangrel gangrene/DGS gangrenous gangster/MS gangsterism gangtok gangue gangway/S ganister ganja gannet ganof ganoid gansey gantlet gantry/S gaol gap/MS gape/DGRS gapeworm gaping/Y gapped gapping gappy gar/MS garage/DGS garageman garagemen garam garand garb/D garbage/DGMS garbanzo garble/DGRS garbo garboard garboil gard garda gardant garde garden/DGRSZ gardenful gardenia/S gardenise/S gardenize/S garderobe gardiner garfish garganey gargantuan garget gargle/DGS gargoyle/DS garish/PY garland/DS garlic/S garlicky garment/DGMS garner/DGS garnet garnett garnierite garnish/DS garnishable garnishee/S garnishment/S garniture/S garonne garotte garpike garret/S garrick garrison/DGS garrote/DGRS garrots garrulity garrulous/PY garter/DGMS garth/MS gas/MS gasbag gasconade gaselier gaseous/PY gash/DGMS gasholder gashouse gasiform gasify/DGNRSXZ gaskell gasket/S gaskin gaslight/DS gaslit gasman gasogene gasohol gasolene gasolier gasoline/S gasolinic gasometer/MS gasometry gasp/DGRSZ gasping/Y gassed gasser/S gasses gasset gassing/S gassy/P gast/P gasteropod gastight/P gastral gastralgia gastrectomy gastric gastrin gastritis gastroenteric gastroenteritis gastroenterology gastroenterostomy gastrogenic gastrogenous gastrointestinal gastrolith gastrology gastronome/S gastronomic gastronomical/Y gastronomist gastronomy gastropod gastroscope gastrostomy gastrotomy gastrotrich gastrovascular gastrula gastrulate/N gasworker gasworks gat gate/DGS gatefold gatehouse gatekeep gatekeeper/MS gatepost gateshead gateway/MS gath gather/DGJRSZ gatling gator gatsby gatt gauche/PY gaucherie/S gaud/DGS gaudery gaudily gaudy/PRS gauffer gauge/DGRS gaugeable gaugeably gaugeing gauhati gaum/S gaumless gaunt/PY gauntlet/D gauntley gauntry gaup gaur gauss/S gaussmeter gautama gautier gauze/DGS gauzelike gauzily gauzy/P gavage gave gavel gaveled gaveler gaveling gavelled gaveller gavelling gavial gavotte/S gawk/RS gawkily gawkish/PY gawky/R gawp gay/PRTY gaya gayety gayomart gazankulu gaze/DGRSZ gazebo/MS gazehound gazelle/S gazette/DGS gazetteer/S gaziantep gazpacho/M gazump gdynia gean geanticline gear/DGS gearbox gearless gearshift gearwheel geary geber gec gecko gedact gedanken gee/DGS geegaw geek/MS geelong geese geest/MS geezer gefilte gehlenite gehrig geisha/S gel/MS gelable gelada gelant gelate/DGNS gelatin gelatine gelatinisability/MS gelatinisable/SU gelatinisation/MS gelatinise/DGRSZ gelatinizability/MS gelatinizable/MSU gelatinization/MS gelatinize/DGRSZ gelatinoid gelatinous/PY gelation/A geld/GJ gelibolu gelid/Y gelidity gelin gell gelled gelligaer gelling gelt gem/MS gemeinschaft geminal/Y geminate/NY gemlike gemmate/DGNS gemming gemmiparous gemmulation gemmule gemology gemot gemsbok gemstone/MS gen/S genappe gendarme gendarmerie gender/DGMS gene/MS genealogical/Y genealogist genealogists genealogy/S genera generable/A general/MPSY generale generalisability generalisable/S generalisation/MS generalisational generalise/DGRSZ generalised/U generalism generalissimo generalist/MS generality/S generalizability generalizable/MS generalization/MS generalizational generalize/DGRSZ generalized/U generalship/S generate/DGNSVX generational generative/AY generator/MS generators/A generatrix generic/P generically generosity/MS generous/PY generously/U genesis genet genetic/S genetical genetically geneticist/MS genial/PY genialise/S geniality genialize/S genic genically geniculate/DY genie/MS genii genip genipap genital/MSY genitalia genitalic genitive/MS genitor genitourinary genius/MS genizah genk genocidal genocide/S genome/MS genotype/MS genotypic genotypical/Y genotypicity genre/MS genro genseric genstat gent/S genteel/PRTY genteelise/S genteelism genteelize/S gentian/S gentianaceous gentianella gentile/S gentilesse gentilisation/MS gentilise/SU gentility gentilization/MS gentilize/SU gentle/DGPRT gentlefolk/S gentleman/Y gentlemanise/SU gentlemanize/SU gentlemanlike/P gentlemanly/P gentlemen gentlewoman gentlewomen/M gently gentrice gentrification gentry/S genu genuflect/DGS genuflection genuflectory genuine/PY genus geocentric geocentrically geocentricism geochemical/Y geochemist geochemistry geochronologic geochronological/Y geochronologist geochronology geochronometric geochronometry geode/MS geodesic/S geodesist geodesy geodetic geodetical/Y geoduck geodynamics geognosy geographer/MS geographic geographical/Y geography/MS geohydrologic geohydrology geoid geologic geological geologise/DGS geologist/MS geologize/DGS geology geomagnetic geomagnetically geomagnetism geomancy geomantic geomechanics geometer/MS geometric geometrical/Y geometrician geometricise/S geometricize/S geometrid geometrise/DGS geometrize/DGS geometry/S geomorphic geomorphological geomorphology geophagy geophysical/Y geophysicist/S geophysics geophyte geopolitic/S geopolitical/Y geopolitician geoponic/S georgic geoscience geosphere geostatic/S geostrategic geostrategist geostrategy geostrophic geostrophically geosynchronous geosyncline geotaxis geotectonic geothermal/Y geothermic geotropic geotropically geotropism gera gerah geraniaceous geranial geraniol geranium geratology gerbil gerent gerenuk gerfalcon geriatric/S geriatrician/S geriatrist gerlachovka germ/MNS germander germane germania germanicus germanisation/MS germanise/GRSZ germanised germanium germanization/MS germanize/GRSZ germanized germanous germfree germicidal germicide/S germinability germinal/Y germinant germinate/DGNSVX germinative/Y germiston germproof germy/R gerome gerona geronimo gerontic gerontocracy gerontological gerontologist/S gerontology gerrymander/D gerrymandering gers gerund/V gerundial geryon gesellschaft gesso gest gestalt gestapo gestate/DGNSX gestation/MS gestational gestatorial gesticulate/DGNSVX gesticulative/Y gesticulator/S gesticulatory gestural gesture/DGS gesualdo get/S getatable getaway/S getter/DMS getting getup/S gewgaw gey geyser/DGS geyserite gezira ghastful/Y ghastly/PR ghat/S ghazal/S ghee gherkin/S ghetto/S ghettoisation/MS ghettoise/DGS ghettoization/MS ghettoize/DGS ghost/DGSY ghostlike ghostliness/S ghostly/PR ghostwrite/R ghosty ghoul/S ghoulish/PY giant/MS giantess gianthood/S giantise/S giantism/S giantize/S giantlike gib gibber/DGS gibberellic gibberellin gibberish gibbet/DGS gibbing gibbon/S gibbosity gibbous/PY gibbsite gibby gibe/GRS gibeon giblet/S gibli gibran gid giddap giddily giddings giddy/DGPR gide gidgee gie gift/DS gifted/PY giftwrap gifu gig/MS gigabit gigabyte/S gigacycle/S gigahertz gigaherz gigantesque gigantic/P gigantically gigantism/S gigantomachy gigavolt gigawatt gigging giggle/DGRS giggling/Y giggly gigli gigolo gigot/S gigue gila gilbert gild/DGRS gildas gilet gilgai gilgamesh gill/DMRS gillies gillion gillray gillyflower gilolo gilsonite gilt gilthead gimbal/S gimbaled gimbaling gimballed gimballing gimcrack gimcrackery gimel gimlet/MS gimmal gimme gimmick/MS gimmickry gimmicky gimp gimpy gin/MS ginger/DGY gingerbread gingerly/P gingersnap gingery gingham/S gingiva gingivitis gingko gink ginkgo ginmill ginnel ginning ginseng gioconda giorgione giotto gip gipon giraffe/MS giraffish giraldus girandole gird/DGRSZ girder/MS girdle/DGRS girdlecake girgenti girl/MS girlfriend/MS girlhood/S girlie girlish/PY girly girn giro gironde gironny girosol girt/U girth gisarme gish gismo/S gissing gist git gittern giusto givable give/GHRSZ giveaway/S given/PS giving/Y gizmo/MS gizzard/MS glabella glabrous glacial/Y glacialise/S glacialist glacialize/S glaciate/DGNS glacier/MS glaciologic glaciological glaciologist glaciology glacis glad/PY gladbeck gladded gladden/DGS gladder gladdest gladding gladdon gladdy glade/S gladiate gladiator/S gladiatorial gladiola gladiolus gladrags gladsome/PY glady glaikit glair glaive glamor/DGS glamorgan glamorisation/S glamorise/DGRSZ glamorization/S glamorize/DGRSZ glamorless glamorous/PY glamour/DGS glamourize/DGRSZ glamourless glamourous/PY glance/DGS glancing/Y gland/MSZ glandered glandless glandular/Y glandule glans glare/DGS glaring/PY glarus glary/R glaser glass/DS glassblower glassblowing glassful glasshouse glassily glassine glassless glassmaker glassmaking glassman glassware glasswork/RS glasswort glassy/PRS glastonbury glauce glaucoma glauconite glaucous glaze/DGRSZ glazed/U glazier glaziers glaziery gleam/DGS gleamy glean/DGJRS gleanable glebe glee/DS gleeful/PY gleeman gleesome gleet gleiwitz glen/MS glencoe glendower glenoid glenrothes gley glia gliadin glib/PY glibber glibbest glide/DGRSZ glim glimmer/DGS glimpse/DGRSZ glint/DGS glioma glissade glissando glisten/DGS glister glitch/MS glitter/DGS glittering/Y glittery gliwice gloam/DGS gloat/DRS glob global/SY globalisation/S globalise/DGS globalism globalist/S globalization/S globalize/DGS globate globe/GMS globeflower globetrotter globin globoid globose globular/PY globularity globule globuliferous globulin/S glochidium glockenspiel glogg glom/S glomerate/N glomerular glomerulate glomerule glomerulus glomma glommed glomming gloom/S gloomily gloomy/PR glorify/DNRSXZ glorious/IPY glory/DGS gloss/DGS glossa glossarial glossarist glossary/MS glossator glossectomy glosseme glossily glossitis glossographer glossography glossolalia glossology glossopharyngeal glossy/PRS glottal glottalisation glottalise/S glottalization glottalize/S glottic glottis glottochronology glove/DGRSZ gloveless glow/DGRSZ glower/DGS glowing/Y gloze glucagon glucinum glucocorticord gluconeogenesis gluconyl glucoprotein glucopyranosyl glucosamine glucose glucoside glucosuria glue/DGRSZ glued/U glueing gluey gluily glum/PY glumaceous glume glummer glummest gluon glut/NS glutamate glutamic glutamine glutathione gluteal glutelin gluteus glutinous/PY glutted glutting glutton/MS gluttonise/S gluttonize/S gluttonous/PY gluttony glyceric glyceride glycerin glycerinate/D glycerine glycerinise/S glycerinize/S glycerol glycerolise/S glycerolised glycerolize/S glycerolized glycerophosphate glyceryl glycine glycocholate/S glycoconjugate/S glycodeoxycholate/S glycogen glycogenesis glycogenise/S glycogenize/S glycol/S glycolic glycolipid/S glycolysis glyconeogenesis glycopeptide/S glycoprotein/S glycosidase/S glycoside glycosidic glycosphingolipid/S glycosuria glycosyl glycosylate/DNS glynn glyoxaline glyph glyphography glyptal glyptic/S glyptodont glyptography gnarl/DS gnarly gnash/GS gnat/MS gnatcatcher gnathic gnathion gnathite gnathonic gnatty gnaw/DGRS gneiss gneissic gnocchi gnome/S gnomelike gnomic gnomish gnomon gnomonic gnosis gnostic gnosticise/RSZ gnosticism gnosticize/RSZ gnotobiotics gnu/S go/GJRZ goad/DGS goal/MS goalie goalkeeper goalmouth goalpost goaltender goaltending goanna goat/MS goatee/MS goatfish goatherd goatish goatlike goatsbeard goatskin goatsucker gob gobbet gobble/DGRSZ gobbledegook gobbledygook gobi gobioid goblet/MS goblin/MS gobo gobstopper goby god/MSY godard godavari godchild goddamn/D goddaughter godded goddess/MS godding goddise/S goddize/S godefroy goderich godfather godforsaken godhead godhood godkin godless/P godlike/P godling godly/PR godmother/MS godot godown godparent godroon godsend/S godson godwit goes goethite gog gogga goggle/DGRSZ gogglebox goggly goglet gogo gogol gogra goiter/S goitre/S goitrogen goitrogenic gold/GNS golda goldarn goldbeater goldbeating goldbrick goldbug goldcrest golden/PY goldeneye goldenrod goldenseal goldeye goldfinch goldfish goldilocks goldoni goldschmidt goldsmith goldsmiths goldthread golem golf/GRSZ goliard goliardery golliwog gollop golly goloshes gombroon gomel gomez gomorrah gompers gomphosis gomulka gomuti gonad/MS gonadal gonadotropic gonadotropin goncourt gondar gondola/S gondolier/S gone/NR gonfalon gonfalonier gong/MS gongola gonidium goniometer gonk gonna gonococcus gonocyte gonof gonophore gonopore gonorrhea gonorrheal gonorrhoea gonorrhoeal goo goober good/PSY goodbye/MS goodie/MS goodish goodnight goodwife goodwill goody/MS gooey goof/DGS goofball goofily goofy/PR googly googol googolplex gook goole goon gooney goosander goose/GS gooseberry gooseflesh goosefoot goosegog goosegrass gooseneck/D goosey goosy gopak gopher/S gorakhpur goral gorbals gorblimey gore/DGS goreng gorge/GRS gorgeous/PY gorgerin gorget gorgias gorgon gorgoneion gorgonian gorgonise/DGS gorgonize/DGS gorgously gorica gorilla/MS gorizia gormandise/DGRS gormandize/DGRS gormless gorse gorsedd gory/R gosh goshawk gosling gospel/S gospeler/S gospelise/S gospelize/S gospeller/S gosport gossamer gossamery gosse gossip/RSZ gossiped gossiping gossipmonger/S gossipped gossipping gossipry gossipy gossoon goster got/U gotama gotcha/MS goth/MS goto gotta gotten/U gouache goucher gouda gouge/DGRS goulash gourami gourd gourde gourmand/MS gourmandise/DGS gourmandism gourmandize/DGS gourmet/S gourmont gout goutweed gouty govern/DGS governable/U governance governed/U governess/S governessy government/MS governmental/Y governmentalise/DGS governmentalism governmentalist governmentalize/DGS governor/MS governorate/S governorship gowan gower gowk gown/DS gowon goy goyish goys grab/S grabbed grabber/MS grabbing/S grabble/DGRS grabby/R grace/DGS graceful/PUY graceless/PY gracie gracile gracileness gracility gracioso gracious/PY graciously/U grackle grad/S gradable gradate/DGS gradation/MS gradational/Y grade/DGJRSYZ graded/U gradeless gradient/MS gradiometer/MS gradual/PY gradualism gradualist/S graduand graduate/DGNSX graduator gradus graecism graffiti graffito graft/DGRS graftage grafton graham/MS grahame graiae grail/S grain/DGRS grained/I grainger grains/I grainy/PR grallatorial gram/MS grama gramarye gramercy gramicidin gramineous graminivorous grammar/MS grammarian/S grammatic grammatical/PY grammaticality/U grammaticise/S grammaticize/S grammatology gramme/MS gramophone/MS grampian gramps grampus granada granadilla granados granary/MS grand/PRSTY grandad grandaddy grandam grandame grandaunt grandchild grandchildren granddad granddaughter/S grande grandee grandeur grandfather/MSY grandiloquence grandiloquent/Y grandiose/PY grandiosity grandioso grandkid/MS grandma/M grandmaster/S grandmother/MSY grandnephew/S grandniece/S grandpa/MS grandparent/S grandparental grandparenthood grandsire/S grandson/MS grandstand/DGRS granduncle/S grange/RS grangemouth grangerise/DGRS grangerism grangerize/DGRS granicus granite graniteware granitic granitisation/MS granitise/S granitite granitization/MS granitize/S granivorous granny/S granodiorite granola granolith granophyre grant/DGMRS granta grantable grantee grantor grantsman grantsmanship granular/Y granularity granulate/DGNSVX granulator granule/S granulise/S granulite granulitic granulize/S granulocyte/S granulocytic granuloma granulose grape/MS grapefruit grapeshot grapevine/MS graph/DGM grapheme graphemic/S graphemically graphic/PS graphical/Y graphite graphitic graphitisable graphitisation/MS graphitise/S graphitizable graphitization/MS graphitize/S graphological graphologist graphology graphomotor graphophone graphs grapnel grappa grappelli grapple/DGRS graptolite grapy/R gras grasmere grasp/DGRS graspable grasping/PY grass/DGSZ grassfinch grasshook grasshopper/M grasshoppers grassland/S grasslike grassquit grassroot grassroots grassy/RT grata grate/DGJRS grateful/PUY gratian graticule gratified/U gratify/DGNX gratifying/Y gratin grating/SY gratis gratitude/I grattan gratuitous/PY gratuity/MS gratulate gratulating graupel grav gravamen grave/GPRSTYZ gravel/SY graveled graveless graveling gravelled gravelling graven gravenhage gravesend gravestone/S gravettian graveyard/S gravid/PY gravidity gravimeter/MS gravimetric gravimetrical gravimetrically gravimetry gravitate/DGSVX gravitation gravitational/Y gravitometer/MS graviton/MS gravity/S gravure gravy/S gray/DGPRSTY graybeard/S grayish grayling/S graywacke graz grazable graze/DGRS grazeable grazier/S grease/DGRSZ greaseless greasepaint/S greaseproof greasewood greasily greasy/PR great/NPRSTY greatcoat/DS greaten/DG greathearted/PY greave/S grebe grecise/DG grecize/DG gree greed greedily greedy/PR greegree greeley green/DGPRSTY greenaway greenback/R greenbackism greenbelt greenbottle greenbrier greenery greenfinch greenfly greengage greengrocer greengrocery greenhead greenheart greenhorn greenhouse/MS greenish/P greenlet greenling greenock greenockite greenroom greensand greenshank greensickness greenstick greenstone greenstuff greensward greentree greenware greenwood greeny greet/DGJRS greets/A gregarine gregarinian gregarious/PY greige gremial gremlin/MS gremmie/S gremmy/S grenade/MS grenadier grenadine grenier grep gressorial greuze grew grewsome grey/GT greyback greybeard greyhen greyhound greylag greystones greywacke gribble grid/MS griddle griddlecake gridfile/S gridiron gridlock/M grids/A grief/MS griefless grievance/MS grievant grieve/DGRSZ grieving/Y grievous/PY griffin grill/DGRS grillage grille grillparzer grillroom grillwork grilse grim/DGPY grimace/DGRS grimalkin grime/S grimines grimmer grimmest grimsby grimy/R grin/S grind/GJRSZ grindelwald grindery grinding/SY grindstone/MS gringo/S grinned grinner grinning/Y grip/DGRS gripe/DGRS grippe gripped gripper/MS gripping/Y grippy gris grisaille griseofulvin griseous grisette grishun griskin grisly/P grisons grist/Y gristle gristly/PR gristmill grit/MS grith gritted grittily gritting gritty/PR grivation grivet grizzle/DGS grizzly/R groan/DGRSZ groat/S grocer/MS grocery/S grockle grodno grog groggily groggy/PR grogram grogshop groin grok/S grokked grokking grommet gromyko groningen groom/DGMRS groomsman groomsmen groot groove/DGRS groovy/R grope/DGRS gropius gros grosbeak groschen grosgrain gross/DGPRSTY grosse grosseteste grossular grossularite grosswardein grosz grot grote grotesque/PY grotesquerie grotesquery grotius grotto/MS grottoes grouch/DGMS grouchily grouchy/PR ground/DGRSZ groundage grounded/U groundhog/MS groundless/PY groundling groundmass groundnut groundout groundsel groundsheet groundsill groundskeep groundskeepers groundsman groundspeed groundswell groundwater groundwork group/DGJMRS groupable groupie/MS groupoid groupwork grouse/DGRS grout/DGRS grouty grove/RSZ grovel/S groveled groveler/S grovelike groveling/Y grovelled groveller groveller/S grovelling/Y grovet grow/GHRSYZ growing/Y growl/DGRS growling/Y growly/PR grown/I grownup/MS growth/I growths/I groyne grozing grozny grub/MS grubber grubbily grubbing grubby/PR grubstake/R grudge/DGMRS grudging/Y gruel grueled grueler/S grueling/Y gruelled grueller/S gruelling/SY gruelling/Y gruesome/PY gruff/PY grugru grumble/DGRS grumbling/Y grumbly grummet grumous grump/DGS grumpily grumpy/PR grundy grunion grunt/DGRS gruntle/DGS grusky gryphon grysbok gtad guacamole guacharo guaco guadalajara guadalcanal guadalquivir guadalupe guadiana guaiacum guan guanabara guanaco guanajuato guanase guanidine guanine guano guanosine guarantee/DRSZ guaranteeing guarantor guaranty guard/DGRS guardafui guardant guarded/PUY guardhouse guardian/MS guardianship guardrail guardroom guardsman guarneri guava guayaquil guayule gubbins gubernatorial guck gudeance gudgeon gudrun guelders guenon guerdon guerilla guernsey/S guerrilla/MS guess/DGRS guessed/U guesstimate guesswork guest/DGMS guesthouse guff guffaw/S guggle/DGS guhleman guidable guidance/S guide/DGRS guidebook/MS guided/U guideline/MS guidepost/S guideway guidon guienne guignol guild/R guildhall guildship guildsman guile guileful/PY guileless/PY guillemot guilloche guillotine/DGMS guilt/S guiltily guiltless/PY guilty/PRT guimet guimpe guinea/S guipure guisard guiscard guise/DGMS guitar/MS guitarfish guitarist/S guizot gujranwala gul gulag/S gular gulbenkian gulch/MS gulden gules gulf/MS gulfweed gull/DGS gullable gullet/S gullibility gullible gullibly gully/DGMS gulosity gulp/DRS gum/MS gumbo gumboil gumdrop/MS gumma gummatous gummed gummer gumming gummite gummosis gummous gummy/PR gumption gumshield gumshoe gumtree gun/MS gunboat guncotton gundog gunfight/RS gunfire/S gunflint gunge gunk gunky gunlock gunman gunmen gunmetal gunnar gunned gunnel gunner/MS gunnery gunning gunny gunnysack gunpaper gunplay gunpoint gunpowder/S gunpowdery gunrunner gunrunning gunsel gunship gunshot gunsling/GR gunsmith gunstock gunter guntur gunwale gunyah guppy/S gur gurdwara gurgitation gurgle/DGS gurglet gurjun gurkhali gurnard gurney/S guru/MS gush/DGRS gushily gushy/PR gusset/S gust/MS gustation gustative/P gustatorial/Y gustatorily gustatory gustavo gustily gusto gustoes gusty/P gut/S gutbucket guthrun gutless/P guts/R gutsy/PR gutta guttate/N gutted gutter/DGS guttersnipe guttersnipish gutting guttural/P gutturalisation/MS gutturalise/DGS gutturalism gutturalization/MS gutturalize/DGS gutty/R guv guy/DGMRSZ guyenne guyot guzzle/DGRS gwalior gwelo gwent gwynedd gwyniad gyani gybe gym/S gymkhana gymnasiarch gymnasiast gymnasium/MS gymnast/MS gymnastic/S gymnastically gymnosophist gymnosperm gymslip gynaeceum gynaecocracy gynaecocrat gynaecocratic gynaecoid gynaecologic/S gynaecological/MS gynaecologist/MS gynaecology/MS gynaecomastia gynandrous gynarchy gynecium gynecocrat gynecocratic gynecologic/S gynecological/MS gynecologist/MS gynecology/MS gyniatrics gynophore gyp gypping gypseous gypsite gypsum gypsy/DGMS gyral gyrate/DGS gyration/S gyrational gyrator/S gyratory gyre gyrene gyrfalcon gyro/S gyrocompass gyrofrequency gyromagnetic gyron gyronny gyroplane gyroscope/MS gyroscopic gyroscopically gyrose gyrostabiliser gyrostabilizer gyrostat gyrostatic/S gyve h's ha habeas haberdasher haberdashery/S habiles habiliment habilitate/DGNSX habit/MS habitability habitable/P habitably habitant/S habitat/MS habitation/MS habitual/PY habitualise/S habitualize/S habituate/DGNS habitude/S habitus habu hac hachure hacienda/S hack/DGRSZ hackamore hackberry hackbut hacker/MS hackle/DGRS hackmatack hackney/DGS hacksaw/S hackstaff hackwork had hadal hadaway haddix haddock/S hade/S hadhramaut hadj hadji hadn't hadron hadrosaur hadst hae haecceity haeckel haem haemachrome haemacytometer haemagglutinate haemagglutinin haemagogue haemal haematein haematemesis haematic haematin haematinic haematite haematoblast haematocele haematocrit haematocryal haematogenesis haematogenous haematoid haematological haematology haematolysis haematoma haematopoiesis haematosis haematothermal haematoxylin haematozoon haematuria haemic haemin haemochrome haemocoel haemocyanin haemocyte haemocytometer haemodialysis haemoflagellate haemoglobin haemoglobinuria haemoid haemolysin haemolysis haemophile haemophilia haemophiliac haemophilic haemopoiesis haemoptysis haemorrhage haemorrhagic haemorrhoidectomy haemorrhoids haemostasis haemostat haemostatic haeres hafiz hafnium haft haftarah hag/MS hagar hagbut hagfish haggadah haggadic haggadist haggadistic haggai haggard/PY haggis haggish haggle/DGRS hagiarchy hagiocracy hagiographer hagiography/MS hagiolatry hagiology hagioscope hah hahnemann haidar haig haik haiku hail/DGRS haile hailstone hailstorm hainaut haiphong hair/DMS hairball hairbreadth hairbrush haircloth haircut/MS haircutter haircutting hairdo/S hairdresser/MS hairdressing hairgrip hairif hairless/P hairlike hairline hairnet hairpiece hairpin hairsbreadth hairsplitter hairsplitting hairspring/MS hairstreak hairstyle/GMS hairstylist hairtail hairweaving hairworm hairy/PR hajj hake hakim hakluyt hakodate halafian halakah halal halation halberd halberdier halcyon halcyone haldane hale/GIR haleakala halesowen half/P halfback/S halfbeak halfhearted/PY halfpenny/S halftime halftone halfway halfwit halfword/MS halibut/S halicarnassus halide/S halidom halite halitosis hall/MRS hallah hallam hallel hallelujah hallelujahs halliard/S hallinan hallmark/DGMS hallo halloo/S hallow/DGS hallowed/U halluces hallucinate/DGNSVX hallucinational hallucinatory hallucinogen/S hallucinogenic hallucinosis hallux hallway/MS halm halma halmahera halmstad halo/S halobiont halocarbon halocline haloes halogen/S halogenate/N halogenous haloid halomorphic halomorphism halophyte halothane halpern hals halt/DGRSZ haltemprice halter/DGS haltere halting/Y halvah halve/DGSZ halyard ham/MS hama hamadryad hamadryas hamamatsu hamamelidaceous hamate hambletonian hamburger/MS hame hamelin hameln hamersley hamey hamhung hamilcar hamlet/MS hamletisation/MS hamletise/S hamletization/MS hamletize/S hamm hammer/DGRS hammerfest hammerhead hammerless hammerlock hammersmith hammerstein hammertoe hammett hammily hamming hammock/MS hammurabi hammy/PR hampden hamper/DGS hampered/U hampstead hamshackle hamster/S hamstring hamstrung hamsun hamulus hamza hanaper hanau hand/DGRSZ handbag/MS handball handbarrow handbell handbill handbook/MS handbrake handbreadth handcar handcart handclasp handcraft handcraftman handcraftsman handcrank/S handcuff/DGS handed/PY handfast/G handfeed handful/S handgrip handgun/S handhold handicap/MS handicapped handicapper handicapping handicraft/RS handicraftsman handicraftsmen handily/U handiwork handkerchief/MS handle/DGRSZ handleability handleable handlebar/S handleless handless handline handlist handmade handmaid handmaiden handout/S handpick/D handpress handprint/MS handrail handsaw handsbreadth handseled handseling handselled handselling handset/S handsful handshake/GMRS handshook handsome/PRTY handsomely/U handspike/S handspring/S handstand/S handstroke handwaving handwheel/S handwork/R handwoven handwrite/JS handwriting handwritten handwrought handy/PRT handyman handymen hang/DGRSZ hangable hangar/MS hangbird hangchow hangdog hangman/M hangmen hangnail/MS hangout/S hangover/MS hangtag hangup hank/RZ hanker/DGRS hankerchief hankie/S hankow hanky/S hannover hanratty hanseled hanseling hanselled hanselling hansom hant/R haole hap/Y hapax hapchance hapgood haphazard/PY haphazardry haphtarah hapless/PY haplite haplography haploid haploidy haplology haplosis happen/DGJS happenchance happenstance happily/U happing happy/PRTU hapten hapteron haptic hapto haptotropism harakiri harald harambee harangue/DGRS harappa harar harass/DGRS harassment/S harbinger/S harbor/DGMRSZ harborage/S harborer/MS harborful harborless/S harbour/DGMRSZ harbourage/S harbourer/MS harbourful harbourless/S hard/GJNPRSTXY hardback hardbake hardball hardboard hardboiled hardboot hardbound hardcase hardcopy/S hardcover/S hardecanute harden/DGRS hardfisted/P hardhack hardhanded/P hardhat hardhead/D hardheaded/PY hardhearted/PY hardicanute hardie hardihood hardily hardiment hardmouthed hardness/S hardpan hardscrabble hardshell hardship/MS hardstand/G hardtack hardtop/S hardware/S hardwire/DGS hardwood/S hardworking hardy/PR hare/MS harebell harebrain/D harelip/S harelipped harem hargeisa haricot harijan harikari hark/DGNS harlequin harlequinade harlot/MS harlotry harm/DGRS harmattan harmed/U harmful/PY harmless/PY harmonic/S harmonica/MS harmonical/PY harmonious/IPY harmonisable/S harmonisation/MS harmonise/DGRSZ harmonised/U harmonises/AU harmonist harmonium harmonizable/MS harmonization/MS harmonize/DGRSZ harmonized/U harmonizes/AU harmonograph harmonographs harmony/S harmotome harness/DGRS harney harp/DGJRSZ harpenden harpist harpoon/DGMRS harpsichord/S harpsichordist harpy/MS harquebus harquebusier harrar harridan harrogate harrow/DGRS harrumph/DGS harrumphs harry/DGR harsh/NPRTY harshen/DG harslet hart hartal harte hartebeest harthacanute hartlepool hartnell hartree hartshead harun haruspex harvest/DGRSZ harvestable harvestman harvestmen harvesttime harwell harwich haryana harz has hasa hasdrubal hash/DGRS hashemite hashish hask haskell haskins haslet hasn't hasp/S hassan hasselt hassle/DGRS hassock/S hast hastate/Y haste/DGJS hasten/DGRS hastily hasty/PRT hat/MS hatband hatbox hatch/DGRS hatchability hatchable hatchback hatcheck hatcheled hatcheling hatchelled hatchelling hatchery/MS hatchet/MS hatchling hatchment/S hatchure hatchway hate/DGRSZ hateful/PY hath hatless hatpin hatred hatshepsut hatted hatter/S hatting haubergeon hauberk haugh haughtily haughty/PR haul/DGRSZ haulage haulageway haulaway haulier haulm haunch/MS haunt/DGRS haunting/Y hauraki hauser hausfrau haustellum haustorium hautboy/S haute hauteur havant have/GRSZ havel havelock haven't haven/MS haver/GS haversack/MS havildar havoc/S havocked havocking havre haw/G hawes hawfinch hawhaw hawk/DGRSZ hawkbill hawkish/PY hawksbill hawkweed haworth hawse hawsehole hawsepipe hawser hawthorn hay/GRS haybox haycock hayfield/S hayfork hayloft/MS haymaker haymaking haymow hayrack hayrick hayride hayseed/S haystack/S haywire haywood hazard/DGMS hazardise/S hazardize/S hazardous/PY haze/DGMRS hazel hazelhen hazelnut/S hazily hazlitt hazy/PRT he'd he'll he/MRZ head/DGJMRSZ headache/MS headachy headband headboard/S headcount headdress headfirst headforemost headgear headgroup/MS headhunter headily heading/MS headlamp headland/MS headless/P headlight/S headline/DGRS headlock headlong headman/M headmaster headmastership headmen/M headmistress headmost headnote headphone/MS headpiece headpin headquarter/D headquarters headrace headrail headreach headrest headroom headsail headscarf headset/S headship headshrinker headsman headsmen headspring headsquare headstall headstand/S headstock headstone/S headstream headstrong headwaiter headwall/S headward/S headwater/S headway headwind/MS headword headwork heady/PR heal/DGHRSZ heald/S healthful/PY healthily/U healths healthy/PRT heap/DGS hear/GHJRSTZ heard/U hearken/DG hears/GS hearsay hearse heart/DMNSX heartache/MS heartbeat/S heartbreak/G heartbreaking/Y heartbroken heartburn/G hearted/Y hearten/DGS heartening/Y heartfelt hearths hearthstone heartily heartland/M heartless/PY heartrending/Y heartsease heartsick/P heartsome/Y heartsore heartstring/S heartthrob/MS heartwarming heartwood heartworm hearty/PRST heat/DGRSZ heatable heated/Y heath/NR heathberry heathendom heathenisation heathenise/DGS heathenish/Y heathenism heathenization heathenize/DGS heathenry heathery heathfowl heathless heathlike heathman heatless heatstroke heaume heave/DGRSZ heaven/MSY heavenise/S heavenize/S heavenly/P heavenward/S heavily heavy/PRST heavyhearted/PY heavyset heavyweight hebbel hebdomad hebdomadal/Y hebephrenia hebephrenic hebetate hebetation hebetic hebetude hebetudinous hebraisation/S hebraise/DGS hebraization/S hebraize/DGS hecatomb heck heckelphone heckle/DGRSZ hectare hectares hectic hectically hectocotylus hectogram/MS hectogramme/MS hectograph hectographic hectoliter hectolitre hectometer/MS hectometre/MS hector hedda heddle/R hedge/DGRS hedgehog/MS hedgehop hedgehopper hedgepig hedgerow hedging/Y hedjaz hedonic/S hedonically hedonism hedonist/S hedonistic hedonistically hee heed/DGS heeded/U heedful/PY heeding/U heedless/PY heehaw heel/DGRSZ heelball heelless heelpiece heelpost heeltap heenan heerlen heffer heft/DS heftily hefty/PR hegel hegemonic hegemony/S hegira hegumen heh heidegger heiduc heifer heigh height/NSX heighten/DGS heilbronn heilungkiang heinous/PY heinze heir/MS heirdom heiress/MS heirless heirloom heirship heiser heist/DGMRS heitiki heitler hejira hekate hekla hel held heldentenor heliacal/Y helical/Y helices helichrysum helicline helicograph helicoid helicoidal helicon helicopt/DGZ helicopter heliocentric heliochrome heliogram/MS heliograph/R heliographic heliography heliogravure heliolatrous heliolatry heliolithic heliometer/MS heliometric heliometrically heliophyte heliopolis heliostat heliotaxis heliotherapy heliotrope heliotropic heliotropically heliotropin heliotropism heliotype heliozoan heliozoic helipad heliport helistop helium helix/S hell/MRS hellbender hellbent hellbox hellbroth hellcat helle/S hellebore hellery hellfire hellgrammite hellhole hellhound hellion hellish/PY hello/S helluva helm/U helmand helmet/DMS helmetlike helminth helminthiasis helminthic helminthology helmont helmsman helmsmanship helmsmen helot helotism helotry help/DGRSZ helpful/PY helpfully/U helpless/PY helpmann helpmate helpmeet helsingborg helve/DGS helvellyn hem/MS hemacytometer/MS hemal hematic hematin hematinic hematite hematoblast hematoblastic hematocrit hematogenous hematologic hematological hematologist hematology hematoma hematophagous hemel hemelytron hemeralopia hemialgia hemianopsia hemicellulose hemichordate hemicycle hemidemisemiquaver hemielytron hemihedral/Y hemihydrate/D hemimetabolic hemimetabolism hemimetabolous hemimorphic hemimorphism hemimorphite hemiola hemiparasite hemiparasitic hemiplegia hemiplegic hemipode hemipteran hemipterous hemispheral hemisphere/DMS hemispheric hemispherical hemispheroid hemistich hemiterpene hemline hemlock/MS hemmed hemmer hemming hemoblast hemodynamically hemodynamics hemoflagellate hemoglobin hemoglobinic hemoglobinopathy hemoglobinous hemolymph hemolysin hemolytic hemophilia hemophiliac hemophilic hemoprotein hemoptysis hemorrhage/DGS hemorrhagic hemorrhoid hemorrhoidal hemorrhoids hemosiderin hemostasis hemostat/S hemostatic hemp/N hempel hemstitch hemus hen/MS henae henbane henbit hence henceforth henceforward henchman henchmen hencoop hendecagon hendecahedron hendecasyllabic hendecasyllable hendiadys hendrix henequen henge hengelo hengist henhouse henna hennery henning henotheism henotheist henotheistic henpeck/D henry hent hep heparin heparinise heparinize hepatic hepatica hepatise/DGS hepatitis hepatize/DGS hepatocellular hepatocyte/MS hepatoma hepcat hepplewhite hepta heptad heptadecanoic heptagon heptagonal heptahedron heptamerous heptameter/MS heptane heptangular heptarchy heptastich heptatriene heptavalent heptose hepworth heraclea heracles herakleion herald/DGS heralded/U heraldic heraldically heraldise/S heraldize/S heraldry herb/MS herbaceous herbage herbal herbalist herbarium herbicidal/Y herbicide/MS herbivore herbivorous/Y herblike herby hercegovina herculaneum herd/DGRS herdic herdlike herdsman herdsmen here/MS hereabout/S hereafter hereat hereaway/S hereby heredes hereditable hereditament hereditarian hereditarianism hereditarily hereditary hereditist heredity herein hereinabove hereinafter hereinbefore hereinbelow hereinto hereof hereon heresiarch heresy heretic/MS heretical/PY hereticise/S hereticize/S hereto heretofore hereunder hereunto hereupon hereward herewith heriot herisau heritability/I heritable heritage/S heritor herl herm hermannstadt hermaphrodite/MS hermaphroditic hermaphroditically hermaphroditism hermatypic hermeneutic hermeneutical/Y hermeneutics hermetic hermetical/Y hermeticism hermetism hermetist hermit/MS hermitage/MS hermitian hermitism hermon hermosillo hermoupolis hern hernandez herne hernia/MS hernial herniate/DGNSX herniorrhaphy hero/MS herod herodias heroes heroic/S heroical heroically heroicomic heroicomical heroin heroine/MS heroinise/S heroinism heroinize/S heroisation/MS heroise/DGS heroises/U heroism heroization/MS heroize/DGS heroizes/U heron/MS heronry herophilus herpes herpesvirus herpetic herpetologic herpetological/Y herpetologist/S herpetology herrick herring/MS herringbone herrington herriot herself hersey herstmonceux herty hertz/S hesiod hesiometer/MS hesitance hesitancy hesitant/Y hesitate/DGNRSX hesitating/UY hesperidin hesperidium hest hestia hetaera hetaerism heterarchy heterecious hetero heteroatom heteroautotrophic heterocercal heterochromatic heterochromatin/S heterochromosome heterochromous heteroclite heterocycle heterocyclic heterocyst heterodactyl heterodont heterodox heterodoxy heterodyne heteroecious heteroecism heterogamete heterogametic heterogamous heterogamy heterogeneity heterogeneous/PY heterogenesis heterogenetic heterogenous heterogeny heterogonic heterogony heterograft heterography heterogynous heterolecithal heterologous heterologously heterology heterolysis heterolytic heteromerous heteromorphic heteromorphism heteromorphous heteronomous/Y heteronomy heteronym heterophil heterophile heterophony heterophyllous heterophylly heterophyte heterophytic heteroplasty heteroploid heteroploidy heteropolar heteropolarity heteropterous heteroscedasticity heterosexual/SY heterosexuality heterosis heterosporous heterostructure heterostyly heterotaxis heterothallic heterotic heterotopia heterotopic heterotroph heterotrophic heterotrophically heterotypic heterotypical heterozygosis heterozygosity heterozygote heterozygous heth heuristic/MS heuristically hevelius hevesy hew/DGRS hewn hex/R hexachloride hexachloroethane hexachlorophene hexachord hexacosanoic hexad hexade hexadecane hexadecimal/SY hexadic hexaemeron hexafluoride hexagon/S hexagonal/Y hexagram hexahedron hexahydrate/D hexahydrite hexamerous hexameter hexamethonium hexane hexangular hexanoic hexapla hexaploid hexaploidy hexapod hexapody hexastich hexastyle hexavalent hexene hexone hexosan hexose hexyl hexylresorcinol hey heyday heyduck heyerdahl heywood hi hiatus/S hibachi hibernaculum hibernal hibernate/DGNS hibernator hibiscus hic hiccough/DGS hiccup/DGS hiccupped hiccupping hick/S hickok hickory/S hid hidalgo hidden hiddenite hide/DGRS hideaway hidebound hideous/PY hideout/MS hidrosis hidrotic hie hieing hiemal hieracosphinx hierarch hierarchal hierarchic hierarchical/Y hierarchy/MS hieratic hieratically hierocracy hierodule hieroglyph hieroglyphic/S hieroglyphical/Y hierogram hierology hierophant hifalutin higgle/DGRS high/RTY highball highbinder highborn highboy highbred highbrow/D highbrowism highchair highfalutin highhanded highjack highland/RS highlife highlight/DGS highline/S highness/MS highroad highs hight hightail highveld highway/MS highwayman highwaymen hijack/DGRSZ hijaz hijinks hike/DGRSZ hilarious/PY hilarity hilding hill/DGMRS hilla hillary hillbilly hillery hillfort hilliard hillingdon hillman hillmen hillock/S hillocky hillside hilltop/MS hilly/R hillyer hilt/MS hilum hilus hilversum him/S himachal himalayas himation himeji himmler himself hin hinckley hind/RSZ hindbrain hinder/DGRS hindgut hindmost hindoo hindquarter hindquarters hindrance/S hindsight hindustan hinge/DGRS hinged/U hingism hinkle hinny hinshelwood hint/DGRS hinterland/S hip/MPS hipbone hipparch hipparchus hipped hipper hippest hippie hipping hippo/S hippocampal hippocampus hippocras hippodrome hippogriff hippolyta hippopotamus hippy/S hipster/S hipsterism hiragana hircine hire/DGJRSZ hireling/S hirey hiri hirohito hiroshige hirseled hirseling hirselled hirselling hirsute/P hirsutism hirsutulous hirundine his hispid hiss/DGRS hist histaminase histamine histaminergic histaminic histidine histiocyte histochemic histochemical histochemistry histogen histogenesis histogram/MS histoid histologic histological/Y histologist histology histolysis histolytic histone histopathologic histopathological/Y histopathologist histopathology histophysiologic histophysiological histophysiology histoplasmosis historian/MS historiated historic historical/PY historicise/DGS historicism historicist historicity historicize/DGS historiographer historiographic historiographical/Y historiography history/MS histrionic/S histrionically hit/MS hitch/DGRS hitched/U hitchhike/DGRSZ hither hithermost hitherto hitherward hitless hitparade hitter/MS hitting hive/GS hiveless hmm hmso ho hoactzin hoad hoagie/S hoagy/S hoar hoard/DGRS hoarfrost hoarhound hoarse/PRTY hoarsen/DG hoary/PR hoatching hoatzin hoax/DGMRS hob hobbema hobbing hobble/DGRS hobbledehoy hobby/MS hobbyhorse hobbyist/MS hobday hobgoblin hobnail/D hobnob/S hobnobbed hobnobber hobnobbing hobo/S hoc hochhuth hock/GRS hockaday hockey hockney hocus/DG hocussed hocussing hod hodad hodaddy hodden hodeida hodge/S hodgepodge hodman hodometer hodoscope hoe/MRS hoecake hoedown hoeing hoek hofei hofmannsthal hofuf hog/MS hogan hogarth hogback hogg/D hogging hoggish/PY hogmanay hognosed hogshead hogtie hogue hogwash hogweed hohenlinden hohenlohe hohenstaufen hoi hoick/S hoiden hoising hoist/DGRS hoistman hoistmen hokan hoke/G hokey/PRT hokeypokey hokkaido hokku hokum hokusai holabird holandric holandry holarctic holbein hold/GJNRSZ holdall/S holdback holdfast holding/IS holdout/S holdover/S holdup/S hole/DGMS holeable holey holiday/MRS holidaymaker holily holinshed holism holistic holistically holkar hollandaise hollas holler/DGS hollo holloa hollow/DGPRSTY holloware hollowware holly/S hollyhock/S holmic holmium holoblastic holoblastically holocaine holocaust holoenzyme holofernes hologamous hologamy hologram/MS holograph holographic holographically holography hologynic hologyny holohedral holometabolism holometabolous holomyarian holophrastic holophytic holoplankton holothurian holotype holotypic holozoic holp/N hols holster/DGS holt holy/PRS holyhead holyoake holystone/S holytide holzman homage/DGRS hombre homburg home/DGRSYZ homebody homebound homebred homebuild homebuilder/S homebuilding homebuilt homecome homecoming/S homecraft homegrown homeland homeless/P homelike homely/PR homemade homemake/G homemaker/MS homeobox homeomorph homeomorphic homeomorphism/MS homeopath homeopathic homeopathically homeopaths homeopathy/MS homeostasis homeostatic homeotypic homeown homeowner/S homeownership homerists homeroom homesick/P homesite homespun homestead/RSZ homestretch hometown homeward/S homework/RZ homey/P homicidal/Y homicide/S homiletic/S homiletical/Y homily hominid hominisation hominised hominization hominized hominoid hominy homo/S homocentric homocercal homochromatic homochromous homocyclic homodont homoeomorph homoeopath homoeopathic homoeopathically homoeopathy/MS homoeostasis homoeostatic homoeotypic homoerotic homoeroticism homogametic homogamic homogamous homogamy homogenate/S homogeneities/I homogeneity/MS homogeneous/PY homogenisation/MS homogenise/DGRSZ homogenization/MS homogenize/DGRSZ homogenous homogeny homograft homograph homographic homoiotherm homoiothermal homoiothermic homolog homologate/N homological/Y homologisation homologise/DGRS homologization homologize/DGRS homologous homolographic homologue homology homolysis homolytic homomorphic homomorphism/MS homomorphy homonuclear homonym/MS homonymic homonymous/Y homonymy homoousian homophile homophobe/S homophobia homophone homophonic homophonous homophony homophyly homoplastic homoplastically homoplasy homopolar homopolymer homopolymers homopteran homopterous homorganic homoscedastic homoscedasticity homosexual/SY homosexuality homosporous homospory homotaxis homothallic homothallism homothermal homotopy homotransplant homotransplantation homozygosis homozygosity homozygote homozygotic homozygous/Y homunculi homunculus homy/PR hon honan honcho/S hondo hone/DGRST honecker honegger honest/Y honesty honewort honey/DGS honeybee/S honeybunch honeycomb/D honeydew honeymoon/DGRSZ honeysucker honeysuckle hong honiara honied honk/DGRSZ honkeys honkie honky/MS honor/DGRSZ honorability/MS honorable/MPS honorables/U honorableship/MS honorably/SU honoraria honorarily honorarium honorary honored/U honoree honorer/MS honorific/MS honorifically honorless/S honors/A honour/DGRSZ honourability/MS honourable/PS honourables/U honourableship/MS honourably/SU honoured/U honouree honourer/MS honourless/S honours/A hoo hooch hood/DGMS hooded/P hoodlike hoodlum/S hoodlumise/S hoodlumish hoodlumism hoodlumize/S hoodoo/S hoodooism hoodwink/DGRS hooey hoof/DMRS hoofbeat hoofbound hoofmark/S hoofprint/MS hoogh/Y hook/DGRSZ hookah hooke hooked/P hookey/S hooklet hooknose hooks/U hookup/S hookworm hooky hooligan/S hooliganise/S hooliganism hooliganize/S hoop/DGRS hoopla hoopoe/S hooray/MS hoosegow/S hoot/DGRSZ hootch hootenanny hoovered hoovering hoovers hooves hop/S hope/DGRS hoped/U hopeful/PSY hopeh hopeless/PY hophead hopi hoplite hoplology hopped hopper/MS hopping hopple hoppled hopples hoppus hopsack hopscotch hora horae horal horary hord horde/MS hordein horeb horehound horizon/MS horizonal horizontal/SY horizontalisation/MS horizontalise/S horizontalization/MS horizontalize/S horme hormonal/Y hormone/MS hormonelike hormonise/S hormonize/S hormuz horn/DS hornbeam/S hornbill/S hornblende hornbook hornby horned/P hornet/MS hornfels hornless/P hornlike hornmouth hornpipe/MS hornstone hornswoggle/DGS horntail hornwort horny/PR horologe horologer horologic horological horologist/S horologium horology horoscope/S horoscopy horrendous/Y horrent horrible/P horribly horrid/PY horrific horrifically horrify/DGS horrifying/Y horripilation horror/MS horrorise/S horrorize/S hors/X horsa horse/GMSY horseback horsebox horseboxs horsecar horsedom horseflesh horsefly/S horsehair horsehide horselaugh horseleech/S horselike horseman horsemanship horsemen horsemint horseplay/R horsepower/S horseradish/S horseriding horseshit horseshoe/RS horsetail horsewhip horsewoman horsewomen horsey horsily horst horsy/PR horta hortative/Y hortatory horthy horticultural/Y horticulturalist horticulture horticulturist hortus hosanna hose/DGMS hosea hosier hosiery hospice/S hospitable/I hospitably/I hospital/MS hospitalet hospitalisation/MS hospitalise/DGS hospitality/I hospitalization/MS hospitalize/DGS hospitaller hospodar host/DGMSY hostage/MS hostel/RS hosteller hostelling hostelry/S hostess/MS hostie hostile/Y hostilise/S hostility/S hostilize/S hostler hot/PY hotbed hotblood hotbox hotchpot hotchpotch hotdogs hotel/MS hotelier hotelisation/MS hotelise/S hotelization/MS hotelize/S hotelman hotfeet hotfoot/MS hothead/D hotheaded/PY hothouse hotien hotplate hotpot hotrod hotshot hotspur hotter hottest hottie hottish houdon hough houmous hound/DGRS hounslow hour/MSY hourglass houri house/DGJMRS houseboat/S housebound houseboy/S housebreak/GRZ housebroken housebuilding housecarl houseclean/GR housecoat housed/A housedress housefather/S housefly/MS housefront houseful houseguest household/MRSZ housekeep housekeeper/MS housekeeping housel houseled/U houseleek/S houseless/P houselights houseline houseling/S houselled/U houselling/S housemaid/S houseman housemaster/S housemate/MS housemother/S houseplant houseroom houses/A housetop/MS houseward housewares housewarming housewife/MY housewifely/P housewifery housewives housework/RZ housman houting hove hovel/MS hoveled hoveler/S hoveling hovelled hoveller/S hovelling hover/DGRS hovercraft hoverport hovertrain/S how/MS howbeit howdah howdy however howitzer howl/DGRS howlet howrah howsoever howsomever howtowdie hoxha hoy hoyden hoydenish hoylake hoyle hradec hrs hrvatska hsi hsian hsiang hsining hsinking hua huambo huang hub/MS hubba hubble hubbub hubby/S hubcap/MS hubli hubris hubristic hubristically huck huckaback huckel huckle huckleberry hucklebone huckster/DGS hucksterise/S hucksterism hucksterize/S hud huddle/DGRS hue/DMS huelva huesca huey huff huffish huffy/PR hufuf hug/S huge/PRTY hugeous/Y huggable hugged hugger/S huggermugger hugging/S hughie huh huhehot hula hulk/DGS hull/DGMRS hullabaloo/DGS hullo hulme hum/S human/PSY humane/PY humanely/I humanisation/MS humanise/DGRSZ humanises/AI humanism humanist/S humanistic humanistically humanitarian/S humanitarianise/S humanitarianism humanitarianize/S humanities/I humanity/MS humanization/MS humanize/DGRSZ humanizes/AI humankind humanlike humanoid humber humberside humble/DGPRST humblebee humbly humbug humbugged humbuggery humbugging humdinger humdrum humectant humeral humeri humerus humic humid/Y humidify/DGNRSXZ humidistat humidity/S humidor humification/S humified humiliate/DGNSX humiliating/Y humility hummable hummed hummer humming hummingbird/S hummock/S hummocky humor/DGMRSZ humoral humored/U humoresque humorise/S humorism/MS humorist/MS humoristic/S humoristical/MS humorize/S humorless/PS humorous/PY humorsome humour/DGMRSZ humoural humoured/U humourless/PS humoursome hump/DGS humpback/DS humph humpty humpy/R humus hunan hunch/DS hunchback/DMS hundred/HS hundredfold hundredweight/S hung/RZ hunger/DGS hungnam hungrily hungry/PRT hunk/MRSZ hunker/DGS huns hunt/DGRSZ huntingdon huntress huntsman hunyadi huon hup hupeh huppah hurdle/DGRS hurds hurl/DGRZ hurley hurly hurrah hurray/S hurricane/MS hurricanise/S hurricanize/S hurried/PY hurriedly/U hurry/DGRS hurstmonceux hurt/GRS hurtful/PY hurting/Y hurtle/DGS hurtless hurty hus husain husband/MRSY husbandman husbandmen husbandry husein hush/DGS hushaby husk/DGRS huskily husky/PRS huss hussar hussein husserl hussy/S hustings hustle/DGRSZ hut/MS hutch hutchie hutment hutu hutzpah huygens huysmans huzzah huzzahs hwang hwyl hyacinth hyacinthine hyacinths hyaena/S hyalin hyaline hyalinisation/MS hyalinise/S hyalinization/MS hyalinize/S hyalite hyaloid hyaloplasm hyaluronic hybrid/S hybridisable/S hybridisation/MS hybridise/DGRSZ hybridises/A hybridism hybridity hybridizable/MS hybridization/MS hybridize/DGRSZ hybridizes/A hybris hydantoin hydathode hydatid hyderabad hydnocarpate hydnocarpic hydra hydracid hydrangea hydrant/S hydranth hydrastinine hydrate/DGNSX hydrator hydraulic/S hydraulical hydraulically hydrazide hydrazine hydrazoic hydria hydric hydrically hydride/S hydriodic hydro/S hydrobiological hydrobiologist hydrobiology hydrobromic hydrocarbon/S hydrocarbonaceous hydrocarbonic hydrocarbonous hydrocaryaceous/S hydrocele hydrocellulose hydrocephalic hydrocephalus hydrocephaly hydrochemistry hydrochloric hydrochloride hydrocoral hydrocortisone hydrocyanic hydrodynamic/S hydrodynamical/Y hydrodynamicist hydroelectric hydroelectrically hydroelectricity hydrofluoric hydrofoil hydroformer hydroforming hydrogen/MS hydrogenate/N hydrogenisation/MS hydrogenise/DGS hydrogenization/MS hydrogenize/DGS hydrogenolysis hydrogenous hydrograph hydrographer hydrographic hydrographically hydrography hydroid hydrokinetic/S hydrolase hydrologic hydrological/Y hydrologist hydrology hydrolysate hydrolyse/MS hydrolysed/U hydrolysis hydrolyte hydrolytic hydrolytically hydrolyzable/MS hydrolyze/MS hydrolyzed/U hydromagnetic/S hydromancy hydromechanical hydromechanics hydromedusa hydromel hydrometallurgy hydrometeor hydrometer/MS hydrometric hydrometrical hydrometry hydromorphic hydronaut hydronic hydronically hydronium hydropathic hydropathically hydropathy hydroperoxide hydrophane hydrophile hydrophilic hydrophilous hydrophobia hydrophobic hydrophobicity hydrophone hydrophyte hydrophytic hydroplane/R hydroponic/S hydroponically hydropower hydroquinone hydroscope hydrosere hydrosol hydrosolic hydrospace hydrosphere hydrospheric hydrostat hydrostatic/S hydrostatical/Y hydrosulfide hydrosulfite hydrosulphate hydrosulphide hydrosulphurous hydrotactic hydrotaxis hydrotherapeutics hydrotherapy hydrothermal/Y hydrothorax hydrotropic hydrotropically hydrotropism hydrous hydroxide/S hydroxonium hydroxy hydroxyl/MS hydroxylamine hydroxylate/N hydroxylic hydroxylisation/MS hydroxylise/S hydroxylization/MS hydroxylize/S hydroxyproline hydroxyzine hydrozoan hyena hyenic hyenoid hyetograph hyetography hygiene hygienic/S hygienically hygienisation/MS hygienise/S hygienist/S hygienization/MS hygienize/S hygristor hygrograph hygrometer/MS hygrometric hygrometry hygrophilous hygrophyte hygrophytic hygroscope hygroscopic hygroscopically hygroscopicity hygrostat hying hyksos hyla hylomorphism hylophagous hylotheism hylozoism hymen/S hymenal hymeneal/Y hymenial hymenium hymenopteran hymenopterous hymettus hymn/GMS hymnal hymnary hymnbook hymnist hymnody hymnology hyoid hyoscyamine hypabyssal hypaesthesia hypaethral hypallage hypanthium hype/DMRS hyperacid hyperacidity hyperactive hyperactivity hyperaemia hyperaesthesia hyperaesthetic hyperbaric hyperbarically hyperbaton hyperbola hyperbole hyperbolic hyperbolical hyperbolically hyperbolise/DGS hyperbolist hyperbolize/DGS hyperboloid hyperboloidal hyperborean hypercatalectic hypercatharses hypercatharsises hypercellularity hypercharge hypercivilisation/MS hypercivilised/MS hypercivilization/MS hypercivilized/MS hypercorrect hypercorrection hypercritic hypercritical/Y hypercriticise/S hypercriticism hypercriticize/S hypercube/MS hyperdulia hyperemia hyperemic hyperemphasise/S hyperemphasize/S hyperesthesia hyperesthetic hypereutectic hyperextension hyperfine hyperfocal hypergamous/Y hypergamy hyperglycaemia hyperglycemia hyperglycemic hyperimmunisation/MS hyperimmunise/S hyperimmunization/MS hyperimmunize/S hyperinsulinisation/MS hyperinsulinise/S hyperinsulinism hyperinsulinization/MS hyperinsulinize/S hyperion hyperirritability hyperirritable hyperkeratosis hyperkeratotic hyperkinesia hyperkinesis hyperkinetic hypermarket hypermeter/MS hypermetric hypermetrical hypermetropia hypermetropic hypermetropical hypermetropy hypermnesia hypermnesic hypermorph hypermorphic hypermorphism hyperon hyperope hyperopia hyperopic hyperostosis hyperostotic hyperoxygenise/S hyperoxygenize/S hyperparasite hyperparasitic hyperparasitise/S hyperparasitism hyperparasitize/S hyperphagia hyperphysical/Y hyperpituitarism hyperpituitary hyperplane/S hyperplasia hyperplastic hyperploid hyperploidy hyperpnoea hyperpyrexia hyperrealise/S hyperrealize/S hypersensitisation/MS hypersensitise/DGS hypersensitive/P hypersensitivity hypersensitization/MS hypersensitize/DGS hypersonic hypersonically hyperspace hyperspiritualising/MS hyperspiritualizing/MS hyperstability hyperstable hypersthene hypersurface hypertension hypertensive hyperterm/S hypertext/M hyperthermia hyperthermic hyperthyroid hyperthyroidisation/MS hyperthyroidise/S hyperthyroidism hyperthyroidization/MS hyperthyroidize/S hypertonic hypertonicity hypertrophic hypertrophy/D hypervelocity hyperventilation hypervitalisation/MS hypervitalise/S hypervitalization/MS hypervitalize/S hypervitaminosis hypesthesia hypethral hypha hyphae hyphal hyphen/DGMS hyphenate/DGNSX hyphenisation/MS hyphenise/S hyphenization/MS hyphenize/S hyphenless hypnagogic hypnoanalysis hypnogenesis hypnogenetic hypnogenetically hypnogogic hypnoid hypnoidal hypnology hypnopaedia hypnopompic hypnoses hypnosis hypnotherapy hypnotic/S hypnotically hypnotisability/MS hypnotisable/SU hypnotisation/MS hypnotise/GRSZ hypnotised hypnotises/U hypnotism hypnotist/S hypnotizability/MS hypnotizable/MSU hypnotization/MS hypnotize/GRSZ hypnotized hypnotizes/U hypo/S hypoacidity hypoactive hypoblast hypocaust hypocellularity hypocenter hypocentral hypocentre hypochlorite hypochlorous hypochondria hypochondriac hypochondriacal/Y hypochondrium hypocoristic hypocoristical/Y hypocotyl hypocrisy/S hypocrite/MS hypocritic hypocritical/Y hypocycloid hypoderm hypodermic/S hypodermically hypodermis hypoeutectic hypogastrium hypogeal hypogene hypogenous hypogeous hypogeum hypoglossal hypoglycaemia hypoglycemia hypoglycemic hypognathous hypogynous hypoid hypoiodite hypolimnion hypomania hypomorphic hyponasty hyponitrite hyponitrous hypophosphate hypophosphite hypophosphoric hypophosphorous hypophyge hypophyseal hypophysectomised hypophysectomized hypophysis hypopituitarism hypoplasia hypoploid hypopnoea hyposensitisation hyposensitise hyposensitization hyposensitize hypostatisation/MS hypostatise/S hypostatization/MS hypostatize/S hyposthenia hypostyle hyposulphite hyposulphurous hypotaxis hypotension hypotensive hypotenuse/S hypothalamic hypothalamically hypothalamus hypothalmus hypothec hypothecate/N hypothecator hypothenuse hypothermal hypothermia hypothermic hypotheses hypothesis hypothesise/DGRSZ hypothesize/DGRSZ hypothetic hypothetical/Y hypothyroid hypothyroidism hypotonic hypotonically hypotonicity hypotrophy hypoxanthine hypoxemia hypoxemic hypoxia hypoxic hypsography hypsometer/MS hypsometric hypsometry hyracoid hyrax hyrcania hyssop hysterectomise/DGS hysterectomize/DGS hysterectomy hysteresis hysteretic hysteria hysteric/S hysterical/UY hysterogenic hysteroid hysteron hysterotomy hystricomorph i's iamb iambic iambus/S iata iatric iatrogenic ibadan ibarruri ibero ibert ibex ibibio ibid ibidem ibis/S ibiza ice/DGJS iceberg/MS iceblink icebound icebox icebreaker icecap/MS icefall icehouse iceless iceman/MS ichang ichinomiya ichneumon ichneumonised/MS ichneumonized/MS ichnography ichnology ichor ichorous ichthyic ichthyoid ichthyolite ichthyology ichthyophagous ichthyosaur ichthyosis icicle/S icily icky/R icon/MS iconic iconically iconicity iconium iconoclasm iconoclast iconoclastic iconoclastically iconographer iconographic iconographical/Y iconography iconolatry iconological iconology iconomatic iconoscope iconostasis icosahedra icosahedral icosahedron icterus ictinus ictus icy/PRT id/MS ide idea/MS ideal/SY idealess idealisation/MS idealise/DGRSZ idealised/U idealism idealist idealistic idealistically ideality idealization/MS idealize/DGRSZ idealized/U idealless idealogical idealogy ideate/NS ideational/Y ideatum idem idempotent/S identic identical/PY identifers identifiability identifiable/U identifiably identified/U identify/DGNRSXZ identikit identity/MS ideogram/MS ideogramic ideogrammatic ideogrammic ideograph ideographic ideographically ideography ideolect ideologic ideological/Y ideologist/S ideologue/S ideology/S ideomotor ideosyncrasy/S ides idetic idioblast idiocy/S idiographic idiolect idiolectal idiom/S idiomatic/P idiomatically idiomorphic idiomorphically idiopathic idiopathically idiopathy idiophone idioplasm idioplasmatic idioplasmic idiosyncracy/S idiosyncrasy/MS idiosyncratic idiosyncratically idiot/MS idiotic idiotical/P idiotically idiotise/S idiotism idiotize/S idle/DGPRSTZ idly idocrase idol/MS idolater idolatrise/DGS idolatrize/DGS idolatrous/PY idolatry idolisation/MS idolise/DGRSZ idolization/MS idolize/DGRSZ idolum idun idyll idyllic idyllically idyllist ie ieper ieyasu if ife iffy/P igbo igdrasil igfet igloo/S igneous ignescent ignis ignitability ignitable ignite/DGRSX ignitible ignition ignitor ignitron ignobility ignoble/P ignobly ignominiosness ignominious/Y ignominy ignorable ignoramus ignorance ignorant/PY ignoratio ignore/DGRS ignotum igor igraine iguana ihram ii iii ikan ikebana ikeja ikhnaton ikon ilea ileac ileitis ileostomy ilesha ileum ileus ilex ilia iliac ilial iliamna iligan ilion ilium ilk/M ilkley ill/PS illampu illation illative/Y illaudable illaudably illawarra illegal/Y illegalisation illegalise/DGS illegality/S illegalization illegalize/DGS illegibility illegible illegibly illegitimacy illegitimate/Y illegitimatise/S illegitimatize/S illiberal/PY illiberalism illiberality illich illicit/Y illimani illimitability illimitable/P illimitably illinium illiquid illiquidity illite illiteracy illiterate/PSY illitic illness/MS illocution illogic illogical/PY illogicality illon illude illume/DG illuminable illuminance illuminant illuminate/DGNSVX illuminati illuminating/Y illuminator/S illumine/DS illuminism illuminist illus illusion/MS illusional illusionary illusionism illusionist illusionistic illusive/PY illusorily illusory/P illust illustrate/DGNSVX illustrational illustrative/Y illustrator/MS illustrious/PY illutation/MS illuvial illuviate/N illuvium illy illyria illyricum ilmen ilmenite iloilo ilorin im image/DGS imagen imagery imaginable/P imaginably/U imaginal imaginarily imaginary/P imaginate imagination/MS imaginative/PY imaginatively/U imagine/DGJRS imagism imagist imagistic imagistically imago imam imamate imaret imbalance/S imbecile/Y imbecilic imbecility imbed imbibe/DGR imbibition imbibitional imbitter imbosom imbricate/NY imbroglio imbros imbrown imbrue/D imbruing imbrute/DG imbue/DG imdtly ime imidazole imide imidic imido imine imino iminourea imipramine imit imitable/I imitate/DGNSVX imitational imitative/PY imitator imitators immaculacy immaculate/PY immane immanence immanency immanent/Y immanentism immanentist immanentistic immaterial/PY immaterialisation immaterialise/DGS immaterialism immaterialist immateriality immaterialization immaterialize/DGS immature/PY immaturel immaturity immeasurable/P immeasurably immediacy/S immediate/PY immedicable immedicably immemorial/Y immense/PY immensity/S immensurable immerge/DG immergence immerse/DGNRSX immersible immersionism immesh immethodical/Y immigrant/MS immigrate/DGNS immigrational imminence imminency imminent/PY immingle immiscibility immiscible immiscibly immitigable/P immitigably immittance immix immixture immobile immobilisation/MS immobilise/DGRS immobilism immobility immobilization/MS immobilize/DGRS immoderacy immoderate/NPY immodest/Y immodesty immolate/N immolator immoral/Y immoralise/S immoralist immorality/S immoralize/S immortal/SY immortalisable/S immortalisation/MS immortalise/GRSZ immortalised/U immortalises/U immortality immortalizable/MS immortalization/MS immortalize/GRSZ immortalized/U immortalizes/U immortelle immotile immotility immovability immovable/P immovably immoveables immune immunisation/MS immunise/DGS immunity/MS immunization/MS immunize/DGS immunoassay immunochemical/Y immunochemistry immunoelectrophoresis immunofluorescence immunofluorescent immunogenesis immunogenetic/S immunogenetically immunogenic immunogenically immunogenicity immunoglobulin immunohematological immunohematology immunologic immunological/Y immunologist immunology immunomicrosphere immunopathologic immunopathological immunopathologist immunopathology immunoreaction immunosuppression immunosuppressive immunotherapy immunotoxin/S immure/DGS immurement immutability immutable/P immutably imp/MS impact/DGRSV impaction/S impactionise/S impactionize/S impactor/MS impair/DGRS impaired/U impairment impala impale/DGS impalement impalpability impalpable impalpably impanation impanel impaneled impaneling impanelled impanelling imparadised imparipinnate imparisyllabic imparity impart/DGS impartable impartation impartial/Y impartiality impartible impartibly impartment impassability impassable/P impassably impasse/NSVX impassibility impassible impassibly impassion/DGS impassioned/U impassive/PY impassivity impaste impasto impatience impatient/Y impeach/DGS impeachable impeachment impearl impeccability impeccable impeccably impeccant impecuniosity impecunious/PY impedance/MS impede/DGRS impeded/U impediment/MS impedimenta impel/S impelled impeller/S impelling impellor impend impendent impending impenetrability impenetrable/P impenetrably impenitence impenitent/Y impennate imperate imperative/PSY imperator imperatorial imperceivable imperceptibility imperceptible imperceptibly imperceptive/P imperceptivity imperfect/PVY imperfectability imperfection/MS imperfectivity imperforate/DS imperial/Y imperialisation/MS imperialise/S imperialism imperialist/MS imperialistic imperialistically imperialization/MS imperialize/S imperil imperiled imperiling imperilled imperilling imperilment imperious/PY imperishability imperishable/P imperishably imperium impermanence impermanency impermanent/Y impermeability impermeable/P impermeably impermissibility impermissible impermissibly imperscriptible impersonal/Y impersonalisation/MS impersonalise/GS impersonalised impersonality impersonalization/MS impersonalize/GS impersonalized impersonate/DGNSX impersonator impertinence impertinency impertinent/Y imperturbability imperturbable imperturbably impervious/PY impetigo impetrate/DGNSX impetuosity impetuous/PY impetus imphal impi impiety impinge/DGS impingement impious/Y impish/PY implacability implacable/P implacably implacental implant/DGRS implantable implantation implausibility implausible implausibly implead implement/DGRSZ implementability implementable implemental implementation/MS implemented/U implementor/MS implicant/MS implicate/DGNSVX implicative/PY implicit/PY implode/DGS implore/DGS implosion/S implosive/Y imply/DGNSX impolder impolicy impolite/PY impolitic/PY impolitical/Y imponderabilia imponderability imponderable/PS imponderably imponent import/DGRSZ importable importance/U importancy important/Y importation/S importunate/PY importune/RYZ importunities importunity imposable impose/DGRS imposing/Y imposition/MS impossibility/S impossible/PS impossibly impost/RS imposthume impostor/MS impostume imposture impotence impotency impotent/Y impound/DGS impoundment impoundments impoverish/DGRS impoverishment impower impracticability impracticable/P impracticably impractical/PY impracticality imprecate/DGNSX imprecatory imprecise/NPY impregnability impregnable/P impregnably impregnate/DGNSX impregnator/S impresa impresario imprescriptible impress/DGRSV impressed/U impressibility impressible impressibly impression/MS impressionability impressionable/P impressionably impressional impressionism impressionist/S impressionistic impressionistically impressive/PY impressment impressure imprest imprimatur imprimis imprint/DGS imprison/DGS imprisonable imprisonment/MS improbability improbable/P improbably improbity impromptu improper/PY impropitious impropriety improvability improvable improvably improve/DGRS improved/U improvement/S improvidence improvident/Y improvisation/MS improvisational improvisator improvisatorial improvisatorise/S improvisatory improvise/DGRSZ improvisor improvizatorize/S imprudence imprudent/Y impudence impudent/Y impudicity impugn/DGRS impugnable impuissance impuissant impulse/DGNSVX impulsive/PY impunity impure/PY impurity/MS imputability imputable imputation/S imputative/Y impute/DGS imroz in/SY inability/S inaccurate/Y inaction inactivate inactive/Y inactivity inadmissibly inadvertence inadvertent/Y inadvisable inalienable inalienably inalterable/P inamorata inane/PRTY inanimate/PY inanition inanity inapparent inappeasable inappellable inapplicably inapposite/PY inapprehensive inappropriate/PY inaptitude inarch inarticulable inarticulate/PY inartificial inasmuch inattention inaugural inaugurate/DGNX inaugurator/S inbeing inboard inbound inbreathe inbreed/GR incalescence/S incalescent incandesce/DGS incandescent/Y incant/D incantation/S incantational incantatory incapability incapacitate/DNS incapacitating incapacitator incapacity incaparina incapsulate incarcerate/DGNS incardinate incardination incarnadine incarnate incarnation/MS incase incaution incendiarism incendiary/S incense/DGS incensory incentive/MSY incept/DGSV inception/S inceptive/Y inceptor incertitude incessancy incessant/Y incest incestuous/PY inch/DGS inchmeal inchoate/PVY inchoative/Y inchworm/MS incidence/S incident/MS incidental/SY incinerate/DGNSX incinerator/S incipience incipiency incipient/Y incipit incise/DGSV incision/MS incisive/PY incisor/MS incisure incitant/S incitation incite/DGRS incitement/S incivility inclement/Y inclinable inclination/MS inclinational incline/DGRS inclip inclose/DGS includable include/DGS includible incluse inclusion/MS inclusive/PY incog incogitant incognita incognito incoherence/S incombustible income/GRSZ incommensurate incommode incommodity incommunicado incommunicative incommutably incomparable incompatible incompetence incompetency incompetent/MSY incomplete/NPY incompliant incomprehensibly incomprehensive incompressibly incomputably inconceivable/P incondensable incondite incongruity/S inconscient inconsecutive inconsequence inconsequent inconsequential/Y inconsequentiality inconsiderable/P inconsiderate/NPY inconsistency/MS inconsolable/P inconsolably inconsonant inconstant inconsumable inconsumably incontestability incontestably incontinency incontinent incontrovertibly inconvenience/DGS inconvincible incoordinate/N incorporable incorporate/DGNSV incorporated/U incorporating/A incorporation/A incorporeal incorrect/PY incorrigible/P incorrupt/DPY incorruptibility increasable increasing/Y increate incredible/P incredulous/Y increment/DGS incremental/Y incrementalism incrementalist/S incrementation increscent incriminate/DNS incriminating incriminatory incross incrust incrustation incubate/DGNSV incubational incubator/MS incubatory incubi incubus incudes inculcate/DNS inculcator inculpable inculpate/NV inculpatory incult incumbency incumbent/S incumber incunabula incunabulum incur/S incurable/PS incuriosity incurious/PY incurred incurrence incurrent incurrer incurring incursion/S incurvate/DGNS incurvature incurve incus incuse indaba indagate/N indagator indamine indebted/P indecency indeces indecipherable indecision indecorum indeed indefatigability indefatigable/P indefatigably indefeasibly indefectibility indefectible indefectibly indefinability indefinable/P indefinite/PY indefinity indehiscence indehiscent indelibility indelible indelibly indelicacy indelicate/PY indemnification indemnify/R indemnity indemonstrable indene indent/DGRS indentation/MS indented/U indention indenture/DGS independence independency indescribable/P indescribably indestructible/P indestructibly indeterminacy/MS indeterminate/NPY indetermine index/DGRSZ indexable indexation indexical indican indicant/S indicate/DGNSVX indicational indicative/SY indicator/MS indicatory indicia indict/DR indictable indiction indictment/MS indictor indifference indifferency indifferent/Y indifferentism indifferentist indigen indigence indigene/S indigenous/PY indigent indigestion indigestive indign indignant/Y indignation indigo indigoid indigotin indirect/DGPSY indirection/S indiscernability indiscipline/D indiscoverable indiscrete indiscretion indiscriminate/GNPY indispensability indispensable/P indispensably indispose/G indisposition indisputable/P indisputably indissociably indissoluble/P indissolubly indistinct/PVY indistinguishable/P indite/DGR indium indivertible indivertibly individual/MSY individualisation/MS individualise/DGRSZ individualised/U individualises/U individualising/Y individualism individualist/S individualistic individualistically individuality individualization/MS individualize/DGRSZ individualized/U individualizes/U individualizing/Y individuate/DGNS indivisibility indivisible/P indivisibly indo indocile indoctrinate/DGNS indoctrinator indole indoleacetic indolebutyric indolence indolent/Y indomethacin indomitability indomitable/P indomitably indoor/S indophenol indore indorsee indoxyl indra indraft indraught indrawn indre indubitability indubitable/P indubitably induce/DGRS inducement/MS inducibility inducible induct/DGSV inductance/S inductee/S induction/MS inductive/PY inductor/MS indue indulge/DGRS indulgence/MS indulgent/Y indult induplicate indurate/NV indusium industrial/SY industrialisation/MS industrialise/S industrialised/U industrialising industrialism industrialist/MS industrialization/MS industrialize/S industrialized/U industrializing industrious/PY industry/MS indwell/GR indy inearth inebriant inebriate/DGNS inebriety inedible ineffability ineffable/P ineffably ineffaceability ineffaceably ineffective/PY ineffectual/PY inelastic inelasticity inelegance ineligibility ineligible ineluctability ineluctable ineluctably ineludible inenarrable inept/PY ineptitude inequable inequality/S inequitable inequivalent inequivalve/D ineradicability inerrable inerrancy inerrant inert/PY inertance inertia/S inertial/Y inescapably inescutcheon inessential inessive inestimable inestimably inevitability/S inevitable/P inevitably inexact/PY inexhaustible/P inexhaustibly inexistence inexorability inexorable/P inexorably inexperience/D inexpert/PY inexpiably inexplicability inexplicable/P inexplicably inexplicit inexpressible/P inexpugnable/P inexpugnably inexpungible inextinguishable inextinguishably inextirpable inextricability inextricably infall infallibilism infallibly infamous/Y infamy infancy infant/MS infanta infante infanticide/M infantile infantilism infantility infantry infantryman infantrymen infarct/D infarction infare infatuate/DX infatuation infaunal infeasible infect/DGSV infected/U infection/MS infectious/PY infectivity infector infecundibility infelicitous/Y infelicity infer/S inferable inference/GMRS inferential/Y inferior/MSY inferiorise/S inferiority inferiorize/S infernal/Y infernalise/S infernalize/S inferno/MS inferred inferrer inferrible inferring infertile infertility infest/DGRS infestant infestation/S infeudation infibulate infidel/MS infidelise/S infidelize/S infield/MRZ infielder/MS infight infighter/MS infill infiltrate/DGNSV infiltrator/S infinite/PVY infinitesimal/Y infinitise/S infinitival infinitive/MSY infinitize/S infinitude infinitum infinity/S infirm/DY infirmary infirmity infix/MS inflame/DGR inflammable/P inflammably inflammation inflammatorily inflammatory inflatable inflate/DGNRS inflationary inflationism inflationist inflator inflect/DGSV inflection/S inflectional/Y inflexibility inflexible/P inflict/DGRSV infliction inflictor inflorescence/S inflow influence/DGRS influenced/U influential/Y influenza influx info infold informal/Y informalise informality informalize informant/MS informatics information/S informational informative/PY informatively/U informatory informed/U infra infracostal infract infraction infractor infrahuman infralapsarian infrangible/P infrangibly infrared infrasonic infraspecific infrastructural infrastructure/S infrequency infrequent/Y infringe/DGRS infringement/MS infulae infundibular infundibulate infundibuliform infundibulum infuriate/DGNSY infuriating/Y infuscate infuse/DGNRSX infusible/P infusoria infusorial infusorian ingather/G inge ingeminate ingenerate ingenious/PY ingenue ingenuity ingenuous/PY ingest/DV ingesta ingestible ingestion ingle ingleborough inglenook ingoing ingolstadt ingot/S ingraft ingrain ingrained/Y ingrate ingratiate/GN ingratiating/Y ingratiatory ingravescent ingredient/MS ingres ingress/V ingression ingressive/P ingrowing ingrown/P inguinal ingulf ingurgitate/N inhabit/DGRS inhabitable inhabitance inhabitancy inhabitant/MS inhabitation inhabited/U inhalant inhalation inhalational inhalator inhale/DGRS inhambane inharmonic inharmony inhaul inhere/DGS inherence inherent/Y inherit/DGS inheritable/P inheritance/MS inheritor/MS inheritress/MS inheritrices inheritrix inhesion inhibit/DGRSV inhibition/MS inhibitor inhibitors inhibitory inhomogeneity/S inhomogeneous inhospitable/P inhuman/PY inhumane/Y inhumanise inhumanity inhumanize inhumation inhume/DGS inimical/Y inimitable/P inimitably inion/MS iniquitous/PY iniquity/MS initial/PS initialed initialer initialing initialisable/U initialisation/MS initialise/DGRSZ initialised/AU initialism initializable/U initialization/MS initialize/DGRSZ initialized/AU initialled initialler initialling initially initiate/DGNSVX initiated/U initiative/MS initiator/MS initiatory initio inject/DGSV injectable/U injectant injection/MS injector/S injunct injunctive injure/DGRS injured/U injurious/PY ink/DGJRSZ inkberry inkblot inkhorn inkle inkling/MS inkstand inkwell inky/P inlace inland/R inlay/GR inly/GR inmate/MS inmesh inmigrant inmost inn/S innard innards innate/PY inner/PY innermost innersole innerspring innervate/DGNS innervational innerve inning/S inniskilling innkeeper/MS innocence innocency innocent/SY innocuous/PY innominate innovate/DGNSVX innovation/MS innovational innovative/P innovator innovators innovatory innoxious innsbruck innuendo/S innuendoes innumerability innumerable/P innumerably innumerate innumerous innutrition inobservance inobservant inoculable inoculant inoculate/DGNSVX inoculativity inoculator inoculum inodorous inoffensive/PY inofficious inoperative/P inoperculate inopportune/PY inordinate/PY inorganic inosculate/DGNS inositol inotropic inpatient inphase inpour input/DGMRS inqilab inquest inquire/DGRSZ inquiring/Y inquiry/MS inquisition/MS inquisitional inquisitive/PY inquisitor inquisitorial/Y inroad/S inrush insalivate insalubrious insane/PY insanitation insatiability insatiable/P insatiably insatiate/PY inscape inscribe/DGRS inscription/MS inscriptional inscriptive/Y inscroll inscrutability inscrutable/P inscrutably insculp inseam insectan insectarium insecticidal/Y insecticide/S insectifuge insectivore/MS insectivorous insectivory insecure/PY insecurity inseminate/N inseminator insensate/PY insensibility insensitive/PY insensitivity insentient inseparably insert/DGRS insertion/MS insertional insertions/A insessorial inset insetted inshore inshrine inside/RSZ insidious/PY insight/MS insightful/Y insignia/S insignificant/Y insincere/Y insinuate/DGNSVX insinuating/Y insinuator insipid/Y insipidity insipience insist/DGS insistence insistency insistent/Y insnare insofar insolate/N insole insolence insolent/Y insolubilise insolubilize insoluble/P insolvably insolvent insomnia insomniac/S insomuch insouciance insouciant/Y insoul inspan inspect/DGSV inspection/MS inspector/MS inspectorate inspectorship insphere inspiration/MS inspirational/Y inspirator inspiratory inspire/DGRS inspired/U inspiring/U inspirit inspissate/DN inspissator instability/S instable instalation install/DGRSZ installant installation/MS installment/MS instalment/S instance/DGS instancy instant/PRSY instantaneity instantaneous/PY instantiate/DGNSX instantiated/U instantiation/MS instar instate/G instauration instead instep instigate/DGNSV instigator/MS instil/S instill/DGR instillation instillment instinct/MSV instinctive/Y instinctual institute/DGNRSVXZ institution/MS institutional/Y institutionalisation/MS institutionalise/DGS institutionalism institutionalist institutionalization/MS institutionalize/DGS institutionise/S institutionize/S institutor instruct/DGSV instruction/MS instructional instructive/PY instructor/MS instructorship instructress instrument/DGS instrumental/SY instrumentalise/S instrumentalism instrumentalist/MS instrumentalities instrumentality instrumentalize/S instrumentation insubordinate/NY insubstantial insufferable insufficience insufficiency/S insufflate/DGNS insufflator insugently insulant insular/Y insularise/S insularism insularity insularize/S insulate/DGNSX insulated/U insulator/MS insulin insult/DGRS insulting/Y insuperable insuperably insupportable/P insuppressibly insurability insurable insurance/S insure/DGRSZ insurgence insurgency insurgent/MS insurmountable insurmountably insuror insurrection/MS insurrectional insurrectionary insurrectionise/S insurrectionist insurrectionize/S insusceptibly inswing intact/P intaglio intake/G intangible/MPS integer/MS integrability integrable integral/MSY integralisation/MS integralise/S integrality integralization/MS integralize/S integrand integrant integratable integrate/DGNSVX integrated/A integrationist integrator integrity integument intellect/MSV intellection intellective/Y intellectual/PSY intellectualisation/MS intellectualise/DGRSZ intellectualism intellectualist intellectualistic intellectuality intellectualization/MS intellectualize/DGRSZ intellectus intelligence/RS intelligent/UY intelligential intelligentsia intelligibility/U intelligible/PU intelligibly/U intend/DGRS intendancy intendant/S intended/PY intendment intenerate/N intense/NPVY intensify/DGNRSZ intensional/Y intensity/S intensive/PY intent/PSY intention/DS intentional/UY intentionality intepupillary inter interact/DGSV interactant interaction/MS interactional interactive/Y interactivity interagency interatomic interaxial interbedded interbrain interbreed intercalary intercalate/DGNSV intercase intercaste intercede/RS intercellular/Y intercensal intercept/DGRS interception interceptor intercession intercessional intercessor intercessory interchange/DGJRS interchangeability interchangeable/P interchangeably interchannel intercity intercivilisation/MS intercivilization/MS interclass interclavicle interclavicular intercohort intercollegiate intercolonisation/MS intercolonization/MS intercolumniation intercom intercommunicate/DGNS intercommunion intercomputer interconnect/DGS interconnectable interconnected/P interconnection/MS interconnectivity interconsole intercontinental interconversion interconvert interconvertibility interconvertible intercooler intercorrelated intercostal/Y intercourse intercrisis intercrop intercross intercrystallisation/MS intercrystallise/S intercrystallization/MS intercrystallize/S intercultural/Y intercurrent/Y intercut interdenominational interdenominationalism interdental/Y interdepartmental/Y interdepend interdependence interdependency/S interdependent/Y interdict/V interdiction interdictor interdictory interdiffuse/N interdigitate/N interdisciplinary interest/DGS interested/Y interesting/PY interestingly/U interface/DGRS interfacial interfaith interfascicular interfere/DGRS interference/S interferential interfering/Y interferogram/MS interferometer/MS interferometric interferometrically interferometry interferon interfertile interfertility interfile interflow interfluent interfluve interframe interfuse/N intergalactic intergeneration intergenerational intergeneric interglacial intergovernmental intergradation intergradational intergrade intergranal intergroup intergrowth interhemispheric interhybridise/S interhybridize/S interim interindex interindustry interionic interior/MSY interiorisation interiorise/DGS interiority interiorization interiorize/DGS interjacent interject/DGS interjection interjectional/Y interjectionalise/S interjectionalize/S interjectionise/S interjectionize/S interjector interjectory interjudgement/MS interjudgment/MS interlace/DGS interlacement interlaken interlaminate/N interlap interlard interlay interlayer/G interleaf interleave/DGS interlibrary interline interlinear/Y interlineation interlingua interlining interlink/DGS interlisp/M interlobular interlocal interlocation interlock/DGRS interlocution interlocutor interlocutory interlope/DGRS interlude/S interlunar interlunary interlunation intermarriage intermarry intermeddle/R intermediacy intermediary/S intermediate/DGMNPSY intermembrane interment intermesh intermeshed intermetallic intermetrics intermezzo intermigration interminable interminably intermingle/DGS intermission/S intermit intermittence intermittency intermittent/Y intermitter intermix/DGRS intermixture intermodule intermolecular/Y intern/DGS internal/SY internalisation/MS internalise/DGS internality internalization/MS internalize/DGS international/SY internationalisation/MS internationalise/GS internationalised internationalism internationalist/S internationality internationalization/MS internationalize/GS internationalized interne internecine internee internescine internetwork interneuron interneuronal internist internment internodal internode internship internuclear internuncial/Y internuncio interoceptive interoceptor interoffice interorganisational interorganizational interosculate interpage interparticle interpellant interpellate/N interpellator interpenetrate/N interpenetrates interpersonal/Y interphase interphone interplanetary interplant interplay interplead/R interpol interpolant interpolate/DGNSVX interpolator interpolatory interpose/DGRS interposition interpret/DGRSVZ interpretability interpretable/U interpretation/MS interpretational interpretations/A interpretative/Y interprete/S interpreted/AU interpretive/Y interpretor/S interprocess interprocessor interquartile interracial interradial interred interregional interregnum interrelate/DGNSX interrelated/PY interrelationship/MS interreligious interrex interring interrobang interrogable interrogate/DGNSVX interrogational interrogative/SY interrogator/S interrogatory/S interrogee/S interrupt/DGRSVZ interruptible interruption/MS interscholastic intersect/DGS intersection/MS intersectoral interservice intersession intersex intersexual/Y intersexuality interspace interspecies interspecific intersperse/DGNSX interstadial interstage interstate interstellar intersterile intersterility interstice/S interstitial/Y interstratify intersubjective/Y intersubjectivity intersurvey intersystem intertask intertestamental intertexture intertidal/Y intertie intertill intertillage intertrigo intertropical intertwine/DGS intertwinement intertwist interurban interval/MS intervale intervalometer/MS intervene/DGRS intervenor intervention/MS interventionism interventionist intervertebral/Y interview/DGRSZ interviewed/AU interviewee/MS interviewer/MS intervocalic interwar interweave/S interweaving interwoven interzonal interzone intestinal/Y intestine/MS intima intimacy intimal intimate/DGNPRSXY intimidate/DGNS intimidator intimidatory intinction intine intitule intl intnl intolerable/P intolerance intolerant/PY intonate intonation/MS intonational intone/G intoxicant intoxicate/DGN intoxicated/Y intra intraarterial/Y intracardiac intracardial/Y intracellular/Y intracity intraclass intracoastal intracohort intracranial/Y intractable/P intractably intracutaneous/Y intradepartmental intradermal/Y intrados intraepithelial intrafamily intragalactic intragenerational intraindustry intraline intrametropolitan intramolecular/Y intramural/Y intramuscular/Y intranasal intranational intrans intransigeance intransigeant/Y intransigence intransigent/SY intrant intranuclear intraoffice intraorganisation/MS intraorganization/MS intraperitoneal/Y intrapersonal intrapopulation intraprocess intrapsychic intrapsychically intrapulmonary intraregional intrasectoral intrasocietal intraspecies intraspecific intraspecifically intrastate intratelluric intratissue intrauterine intravasation intravascular intravenous/Y intravital/Y intravitam intrazonal intreat intrench intrepid/PY intrepidity intricacy/S intricate/PY intrigant intriguant intrigue/DGRS intriguing/Y intrinsic/S intrinsical/P intrinsically intro introduce/DGRS introduction/MS introductorily introductory introgressant introgression introgressive introit introject/DS introjection intromission intromit intromittent intromitter introrse/Y introspect/V introspection/S introspectional introspectionism introspectionist introspectionistic introspective/PY introversion introversive/Y introvert/D intrude/DGRSZ intruder/MS intrusion/MS intrusive/PY intrust intrvascularly intsv intubate/DGNS intuc intuit/G intuitable intuition/MS intuitionism intuitionist intuitive/PY intuitivism intumesce intussuscept/V intussusception intwine inuit inulin inundate/DGNSX inundator inundatory inurbane inure/DG inurement inurn inutility inv invade/DGRSZ invaginate/DGNS invaginated/U invalid/PSY invalidator invalidism invalidity/S invaluable/P invariable/P invariance invasion/MS invasive/P invective/PY inveigh/R inveigle/DGR inveiglement invenit invent/ADGSV invention/MS inventive/PY inventor/MS inventorial/Y inventory/MS inventress invercalt invercargill inverse/NSVXY invert/DGRSZ invertase invertebrate/MS invertible investable invested/A investigate/DGNSVX investigational investigator/MS investigatory investiture investment/MS investor/MS inveteracy inveterate/Y invictus invidious/PY invigorate/DGNS invigorating/Y invigoration/A invigorator/A inviible invincibility invincible/P invincibly inviolability inviolable inviolacy inviolate/PY inviscid invisibility invitation/MS invitational invitatory invite/DGRS invited/U invitee/S inviting/Y invocate invocation/MS invocational invocatory invoice/DGS invokable invoke/DGRSZ invoked/A invokes/A involucel involucral involucrate involucre/D involucrum involute/NXY involutional involutionary involutorial involutory involve/DGRS involved/Y involvement/MS invulnerability invultuation inward/PSY inweave inwrap inyala ioctl iodate/DGN iodic iodide iodin iodinate/DGN iodine iodisation iodise/DGRSZ iodism iodization iodize/DGRSZ iodoamino iodocompounds iodoform iodometry iodophor iodoprotein iodopsin iodothyronines iodotyrosines iodous iolite ion/MS iona ione ionic ionicity ionisable/S ionisation's/U ionisation/MS ionisations/U ionise/DGJNRSXZ ionium ionizable/MS ionization's/U ionization/MS ionizations/U ionize/DGJNRSXZ ionone ionopause ionosphere ionospheric ionospherically iontophoresis iosola iota iotacism ipecac ipecacuanha iphigenia ipoh iproniazid ipsambul ipsilateral/Y ipso ipsus ipswich iqbal iquique iquitos iracund irade iraqi irascibility irascible/P irascibly irate/PY irbid irbil ire/MS ireful irenaeus irenic/S irenically irenicon irian irid iridaceous iridectomy irides iridescence iridescent/Y iridic iridium irido iridosmine iridotomy irina iris/S iritis irk/DGS irksome/PY iron/DGJPRS ironbark ironbound ironclad ironfisted ironfounding ironhanded/PY ironhearted ironic ironical/PY ironise/S ironist ironize/S ironmaster ironmonger ironmongery ironside/S ironstone ironware ironweed ironwood ironwork/MRS irony/S irradiance irradiant irradiate/DNV irradiator irradicable irradicably irrational/PSY irrationalise/S irrationalism irrationalist irrationalistic irrationality irrationalize/S irreal irreality irreclaimable irreclaimably irreconcilability irreconcilable/P irreconcilably irreconciliable irrecoverable/P irrecoverably irrecusable irrecusably irred irredeemable irredeemably irredenta irredentism irredentist irreducibility irreducible irreducibly irreflexive irreformability irreformable irrefragability irrefragable irrefragably irrefrangible irrefutability irrefutable irrefutably irreg irregardless irregular/SY irregularise/S irregularity/S irregularize/S irrelative/Y irrelevance/S irrelevancy/S irrelevant/Y irrelievable irreligion irreligionist irreligious/Y irremeable irremediable/P irremediably irremissible irremovability irremovable irremovably irreparable/P irreparably irrepealability irrepealable irreplaceability irreplaceable/P irreplaceably irrepressibility irrepressible irrepressibly irreproachability irreproachable/P irreproachably irreproducibility irreproducible irresistibility irresistible/P irresistibly irresoluble irresolute/NPY irresolvable irrespective/Y irrespirable irresponsibility irresponsible/P irresponsibly irresponsive/P irretentive irretrievability irretrievable irretrievably irreverence irreverent/Y irreversibility irreversible irreversibly irrevocability irrevocable/P irrevocably irrigate/DGNSX irrigational irrigationists irrigator/S irriguous irritability irritable/P irritably irritant/S irritate/DGNSVX irritating/Y irrotational/Y irrupt/DGSV irruption/S irruptive/Y irtysh is isagoge isagogics isallobar isar isarithmic isatin isauria ischaemia ischia ischium isentropic isentropically isherwood isinglass island/RSZ islandia islay isle/GMS islet/MS ism ismailia isn't iso isoagglutination isoagglutinative isoagglutinin isoagglutinogen isoalloxazine isoamyl isoantibody isoantigen isoantigenic isoantigenicity isobar isobaric isobath isobutylene isocept isochor isochromatic isochron isochronal/Y isochrone isochronisation isochronise/DGS isochronism isochronization isochronize/DGS isochronous/Y isochroous isoclinal/Y isocline isoclinic isoclinically isocracy isocrates isocyanate isocyanic isocyanide isodiametric isodiaphere isodimorphism isodine isodynamic isoelectric isoelectronic isoenergetic isogamete isogenous isogeotherm isogloss isogon isogonic isogram/MS isohel isohyet isoimmunisation/MS isoimmunise/S isoimmunization/MS isoimmunize/S isolate/DGNSX isolationism isolationist isolationistic isolator isolecithal isoleucine isolex isoline isologous isologue isomagnetic isomer/S isomerase isomeric isomerisation/MS isomerise/DGS isomerism isomerization/MS isomerize/DGS isomerizeparabolization isomerous isometric/S isometrical/Y isometry isomorph isomorphic isomorphically isomorphism/MS isomorphous isoniazid isonomy isooctane isophone isophotal isophote isopiestic isopleth isopleths isopod isoprene isopropyl isorhythmic isosceles isoseismal isosmotic isospondylous isostasy isosteric isotactic isothere isotherm/S isothermal/Y isotone isotonic isotonically isotonicity isotope/MS isotopic isotopically isotopy isotron isotropic isotropical isotropically isotropy isozyme isozymic ispell/M israfil issachar issuable issuably issuance issuant issue/ADGRSZ issueless issus istana isthmian isthmic isthmus istle istria it'd it'll it/MSU itacolumite itaconic italianate italic/S italicisation/MS italicise/DGS italicised/U italicity italicization/MS italicize/DGS italicized/U italicy itch/GS itchy/P item/MS itemisation/MS itemise/DGRSZ itemised/U itemises/A itemization/MS itemize/DGRSZ itemized/U itemizes/A iterance iterant iterate/ADGNSVX iterative/AY iterator/MS ithunn ithyphallic itineracy itinerancy itinerant/Y itinerary/S itinerate/DGNS itself itsy iud/S iulus iv iviza ivory/S ivy/DMS ix ixtle iyar iyeyasu izaak izmir izmit iznik izzard j's jab/MS jabbed jabber/DGRS jabberings jabberwocky jabbing jabot jacamar jacdaw jack/DGRS jackal/MS jackanapes jackass jackassery jackboot/DS jackdaw/S jackeroo jacket/DS jacketed/U jacketted jacketting jackfish jackfruit jackhammer jackknife jackpot/S jackscrew jackshaft jacksmelt jacksnipe jackstay jackstraws jacobite jacoby jaconet jacquerie jactitation jade/DGS jaded/PY jadeite jael jaffa jaffna jag jagged/PY jagger jaggers jaggery jagging jaggy jaguar jaguarondi jahveh jahweh jai jail/DGRSZ jailbait jailbird jailbreak jailhouse jailor jaipur jalap jalapa jalisco jalopy/S jalousie jam/S jamb jambalaya jambeau jambi jambo jamboree jammed/U jammer jamming/U jammu jammy jamnagar jampan jamshedpur jamshid jana janata jangle/DGRS janina janis janissary/S janitor/MS janitorial janitress japanned japanner japanning jape/GRS japery japonica jar/MS jardiniere jarful jargon jargonisation/MS jargonise/DGS jargonistic jargonization/MS jargonize/DGS jarl jarp jarrah jarred jarring/Y jarrow jarry jarvey jasmine jasper/S jasperise/S jasperize/S jassy jato jaundice/DGS jaunt/DGMS jauntily jaunty/PR java javanese javari javelin/MS jaw/DMS jawan jawara jawbone jawbreak jawbreaker jawline jaxartes jay jayawardena jaybird jaywalk jazz jazzily jazzman jazzmen jazzy/PR jealous/PY jealousy/S jean/MS jeanne jebel jedda jeep/DGMSZ jeepable jeer/MRS jeeringly jefe jehad jehol jehoshaphat jehu jejune/PY jejunum jekyll jell/DGS jellaba jellicoe jellify jello jelly/DGMS jellybean jellyfish jellylike jemadar jemappes jembe jenny jeopard jeopardisation jeopardise/DGS jeopardization jeopardize/DGS jeopardy/S jequirity jerba jerbil jerboa jerez jerid jerk/DGJRS jerkily jerkin jerkwater jerky/PR jeroboam jerreed jerry jersey/MS jess jessy jest/DGRS jesuitic jesuitical/Y jesuitry jet/MS jetbead jetliner/S jetport jetsam jetted jetting jettison jettisonable jetty/DGS jeunes jevons jewel/S jeweled jeweler/S jewelery/S jewelfish jeweling jewelled jeweller/S jewellery/S jewelling jewelry/S jewfish jhansi jhelum jib jibber/S jibbing jibbons jibboom jibe/DGS jibouti jidda jiff jiffy/S jig/MS jigged jigger/D jiggermast jigging jiggle/DGS jiggly/R jigsaw jihad jillaroo jillion jilolo jilt/DRS jimjams jimmy/DGS jinghis jingle/DGRS jingly jingo jingoes jingoish jingoism jingoist jingoistic jingoistically jinja jink/S jinn jinnah jinni jinny jinx jipijapa jissom jitney/S jitter/S jitterbug jitterbugger jitterbugging jittery jiujitsu jiujutsu jive/DGS job/MS jobbed jobber/S jobbery jobbing jobcentre/S jobholder/S jobless/P jobname jobrel jock jockey/DGS jocko jocks jockstrap/S jocose/PY jocosity jocular/Y jocularity jocund/Y jocundity jodhpur/S jodhpuri jodrell joey joffre jog/S jogged jogger/S jogging joggle/DGRS jogjakarta john/MS johore join/DGRSZ joinable joinder joined/AU joinery joint/DGMPRSY jointed/PY jointress jointure/DGS jointworm joist/S joke/DGRSZ joking/Y jokjakarta jollification/S jollify jollity/S jolly/DGRS jolo jolt/DGRS jolty jongleur jonnock jonquil/S jook joppa jordaens jorum jos josh/DGRS josquin joss jostle/DGS jot/S jota jotted jotter jotting jotun joual joule jounce/DGS jouncy/R jour journal/MS journalese/S journalisation/MS journalise/DGRSZ journalised/U journalism journalist/MS journalistic journalistically journalization/MS journalize/DGRSZ journalized/U journalled journey/DGJS journeyman journeymen journeywork joust/DGRS jovial/Y jovialise/S joviality jovialize/S jow/Y jowett jowl/DS jowly/R joy/MS joyance joyful/PY joyless/PY joyous/PY joypop joyride/GR joystick/S juba jubbah jube jubilant/Y jubilarian jubilate/DGNSX jubilee judezmo judge/DGRS judgement/MS judgemental judgeship judgmatic judgmatical/Y judgment/MS judgmental judicable judicative judicator judicatory judicature/S judicial/Y judicialise/S judicialize/S judiciary/S judicious/IPY judo judogi judoist judoka jug/MS jugal jugate jugfet jugful jugged juggernaut/DGMS jugging juggins juggle/DGRSZ jugglery juglandaceous jugular jugulate jugulum jugum jugurtha juice/DGMRSZ juiceless juicily juicy/PRT juiz jujitsu juju jujube jujutsu juke/GS jukebox julep/S julienne jullundur jumble/DGS jumbo/S jumbuck jumna jump/DGRSZ jumpy/PR juncaceous junco junction/IMS junctional junctor juncture/MS jungfrau jungian jungle/DMS jungly junior/MS juniper junk/RSZ junkerdom junket/DGRS junketeer/G junkie/S junkman junky/S junkyard junta junto/S jupon jural/Y jurassic jurat juratory jure jurel juridic juridical/Y jurisconsult/S jurisdiction/MS jurisdictional/Y jurisprudence jurisprudent jurisprudential/Y jurist/S juristic juristically juror/MS jury/IMS juryman jus jussive/S just/GPRY juste justice/IMS justiceship justiciability justiciable justiciar justiciary justifiability justifiable/U justifiably justificative justificatory justified/U justifier/MS justify/DGNRSXZ justle justment jut jute/S jutted jutting jutty/DGS juvenal juvenescence/A juvenescent/A juvenile/MS juvenilia juvenilise/S juvenility juvenilize/S juvenocracy juxtapose/DGS juxtaposition juxtapositional k's kHz kabalega kabaragoya kabbala kabob kaboom kachang kachina kadi kadiyevka kaduna kaffirs kafiristan kaftan kagera kagoshima kagu kaiak kaieteur kaif kaifeng kail kailyard kain kainogenesis kairouan kaiser kaka kakapo kakemono kaki kalat kale kaleidescope kaleidoscope/DGS kaleidoscopic kaleidoscopical/Y kalends kaleyard kalgan kalgoorlie kali kalian kalidasa kalif kalimantan kalinin kaliningrad kalisz kaliyuga kalmar kalmia kalong kalpa kalpak kalsomine kaluga kama kamakura kamala kamasutra kame kamerun kamet kami kamikaze kampong kampuchea kamseen kana kanamycin kananga kanara kanazawa kanchenjunga kanchipuram kandahar kandy kanga kangaroo/S kangwane kannada kano kanpur kansu kantar kanu kanzu kaohsiung kaolack kaoliang kaolin kaolinisation/MS kaolinise/S kaolinite kaolinization/MS kaolinize/S kaon kapellmeister kaph kapok kappa kaput karabiner karafuto karaganda karakoram karakorum karamanlis karat karate karateist karbala karelia kariba karma karmic karnataka karoo kaross kart karyatid karyogamy karyokinesis karyolymph karyolysis karyoplasm karyosome karyotin karyotype kasai kasbah kasher kashgar kashmir kassa kassala kassel kat katabasis katabolism katakana katanga katar kathak katharevusa katharsis kathiawar katmai katsina kattegat katydid katzenjammer kauai kaunas kaunda kauri kava kaveri kawasaki kayak/RS kayo/DG kayseri kazachok kazakh kazan kazantzakis kazbek kazoo/S kcal kea kean kearney kebab/S keble kebob keck ked kedah keddah kedge kedgeree kediri kedron keef keegan keel/DGRS keelboat keelhaul keelless keelson keelung keen/GPRTY keep/GRSZ keepnet keepsake/S keeshond kef keffiyeh keg/S kegful kegler kegsful keister keitel keitloa kekkonen kelantan keloid kelp kelpie kelt/R kelts kemal kemble kemerovo kempe kempis kempt ken kenaf kendal kendo kennel/MS kenneled/U kenneling/U kennelled kennelled/U kennelling/U keno kenogenesis kenosis kenspeckle kente kentledge kenyatta keos kep kept kerala keramic/S keratin keratinisation keratinise/DGS keratinization keratinize/DGS keratitis keratogenous keratoid keratoplasty keratose keratosis kerb/G kerbaya kerbela kerbstone kerch kerchief/DMS kerchieves kerf kerguelen kerkrade kerman kermes kermis kermits kern kerne kernel/MS kerneled kerneling kernelled kernelling kernite kero kerosene kerosine kerouac kerry kersey kerseymere kerygma kesselring kesteven kestrel ketch/S ketchup ketene keto ketogenesis ketogenic ketone ketonic ketonisation/MS ketonise/S ketonization/MS ketonize/S ketonuria ketose ketosis ketosteroid ketotic ketoxime kettle/MS kettledrum kevel kew kewaskum kewaunee kewpie kex key/DGS keyboard/GMRS keybutton keyclick/MS keyhole/S keyless keynote/RS keypad/MS keypunch/DGRS keystone/S keystroke/MS keytop/S keyway/S keyword/MS khaki khan khrush kibble/DGS kibbutz kibbutzim kibbutznik kibe kibitz/R kibosh kick/DGRSZ kickapoo kickback/S kickdown kickoff/S kickshaw/S kicksorter kickstand kicktail kickup/S kid/MS kidd kidded kidder kiddie/S kidding/Y kiddish kiddle kiddush kiddy kidless kidnap/MS kidnaped kidnaper/MS kidnaping/MS kidnapped kidnapper/MS kidnapping/MS kidney/MS kidron kidskin kief kiel kielbasa kike kill/DGJRSZ killable killdeer killebrew killing/SY killjoy kiln kilo/S kilobar kilobaud kilobit/S kilobuck kilobyte/S kilocalorie/S kilocurie kilocycle/S kilogauss kilogram/MS kilogramme/MS kilohertz kilohm kilojoule kiloliter/MS kilolitre/MS kilometer/MS kilometre/MS kilooersted kiloparsec kilorad kiloton/S kilovolt/S kilowatt/S kiloword kilt/R kilts kilung kimberley kimberlite kimono kin kina kinabalu kinaesthesia kinaesthesis kinaesthetic/S kinaesthetically kinase kincardine kinchinjunga kincob kind/PRSTY kindergarten kindergartner kindhearted/PY kindle/ADGRS kindless/Y kindly/PR kindness/S kindred kine kinematic/S kinematical/Y kinematograph kinescope/DS kineses kinesic kinesics kinesiology kinesis kinesthesia kinesthesis kinesthetic/S kinesthetically kinetic/S kineticist kinetin kinetochore kinetonucleus kinetoplast kinetoplastic kinetoscope kinetosome kinfolk/S king/SY kingbird kingbolt kingcraft kingcup kingdom/MS kingfish kingfisher kinglet kingly/PR kingmaker kingpin kingship kingside kingwana kingwood kinin kink/U kinkajou/M kinky/PR kinnickinnic kino kinsey kinsfolk kinship kinsman kinsmen/M kinswoman kiosk/S kioto kip/S kipper/DGS kirk kirkwood kirsch kirtle kismet kiss/DGJRSZ kissable kit/MS kitbag/S kitchen/MRS kitchenette/S kitchenless kitchenware/S kite/DGRSZ kitenge kith/G kithara kithe/G kitsch kitschy kitten/DGMS kittenish/PY kittiwake kittle/DGRS kitty/S kitwe kiushu kiva kivu kiwi/MS kiz kizzie klaipeda klatch klatsch klauber klaxon kleenex klepht kleptomania kleptomaniac klieg kline klong klootchman klopstock kludge/DGMRSZ kludger/MS kludgey klutz/MS klutzy/P klystron/S km knack/RS knackery knackwurst knag knap knapsack/MS knar knave/MS knavery knavish/Y knawel knead/DGRS kneadable knee/DS kneecap/S kneehole/S kneeing kneel/DGRS kneepad/S knell/MS knelt knew knick/RZ knickerbocker knickknack knickpoint knife/DGS knifelike kniferest knight/DGSY knighthood knightly/P knish knit/AU knits knitted knitter knitting knitwear knives knob/MS knobbed knobby knobeloch knock/DGRSZ knockabout/S knockdown/S knockout/S knockwurst knoll/MS knop knossos knot/MS knotgrass knothole knotted knotter knotting knotty/PR knotweed knotwork knout know/GRS knowable/U knoweth knowhow knowily knowing/UY knowledge/S knowledgeability knowledgeable/P knowledgeably known/U knuckle/DGS knuckleball/R knucklebone/S knucklehead/D knurl knurly koa koala koan kob kobarid kobe kobold kochi kodok koel kofta koftgar kofu kohlrabi koine koinonia kokura kola kolar kolding kolkhoz kombu konga koniology konrad konya koodoo kook kookaburra kookie/R kooks kooky/PR kooning kopeck kopek koph korfball kosher/DG koto kowtow kpc kraemer kraft kraken kraut/S kremlinologist kremlinology kretchmer krill krummholz krypton kudo kudos kudu kudzu kulak kultur kumquat kurchatovium kurdish kurtosis kwashiorkor kyanise/DGS kyanite kyanize/DGS kylin kylix kyloe kymograph kymric kymry kyphosis kythera l's la/MS lab/MS labarum labdanum labe labefaction label/MS labelable labeled/AU labeler/MS labelers/A labeling/A labellable labellate labelled/AU labeller/MS labellers/A labelling/A labellum labels/A labia labial/Y labialisation/MS labialise/DGS labialises/U labialization/MS labialize/DGS labializes/U labiate labiche labile labilisation/MS labilise/S lability labilization/MS labilize/S labiodental labionasal labiovelar labium lablab labor/DGJRSZ laborability/MS laborable/MSU laboratory/MS labored's/U labored/MPY laborer/MS laborhood/MS laboring/MSY laborings/U laborious/PY laborism/MS laborist/MS laborite/MS laborless/S laborsaving labour/DGJMRSZ labourability/MS labourable/SU laboured's/U laboured/MPY labourer/MS labourhood/MS labouring/MSY labourings/U labourism/MS labourist/MS labourite/MS labourless/S labradorite labret labroid labrum labuan labyrinth labyrinthian labyrinthine labyrinthodont labyrinths laccolith lace/DGRS laced/U lacedaemon laceless lacelike lacemaker lacerant lacerate/DGNSVX lacertilian lacewing lacework lacey laches lachlan lachryma lachrymal lachrymator lachrymatory lachrymose/Y laciniate/DN lack/DGRS lackadaisic lackadaisical/Y lackaday lackey/DGS lackluster lacklustre laclos laconia laconic/S laconically laconise/DGS laconism/S laconize/DGS lacquer/DGRSZ lacrimal lacrimation lacrimator lacrosse/S lactalbumin lactam lactary lactase lactate/DGNS lactational/Y lacteal lactescent lactic lactiferous lactiferousness lactobionamide/S lactobionic lactobionyl lactoflavin lactogenic lactoglobulin lactometer lactone lactonic lactonised lactonized lactophenol lactoprotein lactoscope lactose lacuna/S lacunae lacunal lacunar lacunaria lacunary lacunate lacustrine lacy/R lad/S ladanum ladder/S laddie lade/DGU laden/DG lading/S ladislaus ladle/DGS ladoga ladrone lady/MS ladybird/MS ladybug/MS ladyfern ladyfinger ladyfy ladykin ladylike ladylove ladyship ladysmith ladysnow laertes laevogyrate laevorotatory laevulin laevulose laforgue lag/S lagan lage lagena lager/S lagerkvist laggard/PSY lagged lagger lagging lagniappe lagomorph lagomorphic lagomorphous lagoon/MS lagoonal laguna lah laic laical/Y laicisation/S laicise/DGS laicism laicization/S laicize/DGS laid/I laik lain lair/MS laird/Y lairy laissez laitance/S laity laius lake/GMRS lakefront lakeshore lakeside lakewood lakh laky lala lalang lalapalooza lallans lallation lallygag lallygagged lam lama lamartine lamas lamasery lamb/MRS lambast lambaste lambda/MS lambdacism lambdoid lambency lambent/Y lambert lambertian lambeth lambkill lambkin lambrequin lambskin lame/DGPRSTY lamebrain/D lamella/S lamellae lamellar/Y lamellate/NY lamellicorn lamelliform lamellirostral lament/DGS lamentable/P lamentably lamentation/MS lamented/U lametedly lamia lamina laminal laminar laminaria laminarian laminarin laminate/DGNSX laminator laminin laminitis lammed lammergeier lamming lamp/MRS lampas lampblack lampedusa lampern lampeter lampholder lampion lamplight/R lampoon/DGRS lampoonery lamppost/S lamprey/S lamprophyre lampshade/S lamster lanai lanark lanate lance/DGRSZ lancejack lancelet lancelot lanceolate/Y lancet/D lancewood lanchow lancinate/DGNSX land/DGJRSZ landammann landau landaulet landes landeshauptmann landfall landfill landform landgrave landgraviate landgravine landhold/GJRZ landlady/MS landless landlocked landloper landlord/MS landlordism landlubber/Y landmark/MS landmass/S landor landowner/MS landownership landowning landowska landrace landscape/DGRS landscapist/S landseer landshark landshut landside landsknecht landslide/S landslip/S landsman landtag landwaiter landward/S lane/MS lanesmanship lanfranc langeland langlauf langouste langrage langres langsyne language/MS langue languedoc languet languid/PY languish/DGRS languishing/Y languishment languor languorous/Y langur laniard laniary laniferous lank/PY lankester lankily lanky/PR lanner lanneret lanolin lanose lansquenet lantern/MS lanthanide lanthanum lanthorn lanuginous/P lanugo lanyard laoag laodicea laodicean laomedon laotze lap/MS laparotomy lapboard lapdog lapel/MS lapeled lapelled lapful lapidarian lapidary lapidate lapidify lapillus lapis lapped lapper lappet lapping laps/DGRS lapse/ADGRS lapstrake lapstreak lapsus laptev laptop/MS lapwing larcener larcenist larcenous/Y larceny larch lard/DGRS lardon lardy lares large/PRTY largehearted largemouth largen largess largesse larghetto largish largo/S lariat larine larisa lark/MRS larkspur larky/R larmor larn larnax larousse larrigan larrikin larrup larum larva/S larvae larval larvicidal larvicide larwood laryngeal/Y larynges laryngitis laryngology laryngoscope laryngoscopic laryngotomy larynx/S las lasagna lasagne lascar lascaux lascivious/PY lase/G laser/MS lash/DGJRS lashed/U lashio lashkar lasker lasket lass/MS lassa lassalle lassie/S lassitude/S lasso/DR lassoes lassus last/DGRSY lasting/PY lat latch/DGS latchet latchkey latchstring late/DPRTY latecomer/S lateen/R lateiner latency/MS latened latening latensify/DNSX latent/SY latentise/S latentize/S latera lateral/Y lateralisation/MS lateralise/S lateralization/MS lateralize/S laterisation/MS laterite laterization/MS lateroversion latex/MS lath/GRS lathe lather/DGR lathery lathi lathy latices laticiferous latifundium latimer latish latitude/MS latitudinal/Y latitudinarian latitudinarianism latitudinary latium latria latrine/MS latten latter/MY lattermost lattice/DGMS latticework lattimer latus laud/RS lauda laudability laudable/P laudably laudanum laudation/S laudative laudatorily laudatory laugh/DGRZ laughable/P laughably laughing/Y laughingstock/S laughs laughter/S laughterful launch/DGJRSZ launder/DGJRS launderability laundered/U launderette/S laundress laundresses laundry/S laundryman laundrymen laundrywoman laura lauraceous laurasia laurate laureate/DGNS laureateship laurel/MS laureled laureling laurelled laurelling lauric laurier laurustinus lauryl lautrec lav lava lavabo lavage/D laval lavalava lavaliere lavalike lavallade lavalliere lavation lavational lavato lavatory/MS lave/GR laveer lavender/DG laverock lavish/DGPY lavolta law/MS lawbreak lawbreaker/S lawbreaking lawes lawful/PUY lawgive lawgiver/S lawgiving lawks lawless/PY lawmake lawmaker lawmakers lawmaking lawman lawmen lawn/MS lawny lawrencium lawsuit/MS lawyer/MSY lax/PY laxation laxative/PSY laxey laxity lay/GRSZ layabout/S layamon layard layaway laycock layer/DGS layerage layette layman laymen layoff layoffs layout/MS layover/S laypeople layperson layshaft layup/MS laywoman laywomen lazaretto laze/S lazed lazily lazing lazio lazuli lazulite lazurite lazy/DGPRT lazybones lazyish lb/S lea leach/GS leachable leachate lead/DGJNRSZ leadbelly leaded/U leaden/PY leader/MS leaderless leadership/MS leadeth leadless leadoff leadsman leadsmen leadwork leadwort leady/R leaf/DGS leafage leafcutter leafhopper leafless leaflet/MS leafletting leaflike leafstalk/S leafy/RT league/DGRSZ leak/DGRS leakage/MS leakey leakily leaky/PR leal lean/DGJPRSTY leant leap/DGRS leapfrog leapfrogged leapfrogging leapt learn/DGJRSZ learnable learned/PY learns/A learnt/U leary lease/ADGS leaseback leasehold/R leash/MS least leastways leastwise leasure leat leather/DGS leatherback leatherhead leatherise/S leatherize/S leatherjacket leatherlike leathern leatherneck leatherwood leatherwork leathery leave/DGJRSZ leaven/DG leavened/U leavis leben lebensraum lebkuchen leblanc lebowa lebrun lecce lech lecher lecherous/PY lechery lecithin lecithinase lecky leconte lectern/MS lectin/MS lection/A lectionary lector lecture/DGRSZ lectureship lecythus led lederhosen ledge/RSZ ledgy lee/SZ leeboard leech/MS leeds leek leer/DGS leery leet leeuwarden leeward/S leeway left/S lefthand/D leftism leftist/MS leftmost leftover/MS leftward/S leftwing/RZ lefty/S leg/S legacy/MS legal/SY legalese legalisation/MS legalise/DGS legalised/U legalism legalist legalistic legalistically legality/S legalization/MS legalize/DGS legalized/U legaspi legate/DGNSX legatee legateship legatine legato legator legend/MS legendarily legendary legendry legerdemain legerity leges legged legging leggings leggy/R leghorn legibility legible legibly legion/MS legionary legionnaire/S legis legislate/DGNSVX legislative/Y legislator/MS legislatorial legislatorship legislatress legislatrix legislature/MS legist legit legitimacy legitimate/DGNSY legitimatise/DGS legitimatize/DGS legitimisation/MS legitimise/DGRS legitimism legitimist legitimization/MS legitimize/DGRS legless legman legnica legroom legume/S legumin leguminous legwork lehmann lehmbruck lehr lei leiria leishmaniasis leister leisure/DY leisurely/P leitmotif leitmotiv leitrim leix lek lekker lely leman lemke lemma/MS lemming/S lemniscate lemnos lemon/MS lemonade lemony lempira lemur lemures lemuroid lend/GRSZ lenglen length/NXY lengthen/DGRS lengthily lengthman lengths lengthways lengthwise lengthy/PR lenience leniency lenient/Y lenis lenitive/Y lenity lens/DGJMRSZ lense lensless lent/A lentamente lentic lenticel lenticular lenticulate/N lentigo lentil/MS lentissimo lento leoben leonine leopard/MS leopardess leotard/S lepaya leper/S lepidolite lepidopteran lepidopterist lepidote lepidus lepontine leporid leporine leprechaun/S leprosarium leprose leprosy leprotic leprous/PY lepton/MS leptophyllous leptosome leptospiral leptospirosis leptotene les lesbian/S lesbianism lesbos lesion/S less/GNRSX lessee lessen/DGS lesseps lesson/DGMS lessor lest/R let/IMS letch letchworth letdown/S lethal/Y lethalise/S lethality lethalize/S lethargic lethargically lethargy/S letted letter/DGRS lettered/U letterhead/S letterman lettermen letterpress letterset letting lettuce letup leu leucas leucine leucite leucitic leuco leucocratic leucocyte leucocytosis leucoderma leucoma leucomaine leucopenia leucoplast leucopoiesis leucorrhoea leucotomy leuctra leukaemia leukas leukemia leukemic leukemoid leukocyte leukocytic leuven lev/S levalloisian levanter levator/S levatores levee/DMS leveeing level/PSY leveled/U leveler/S levelest levelheaded/P leveling/U levelled/U leveller leveller/S levellest levelling levelling/U leven/DS lever/DGMS leverage/DGS leveret leverrier leviable leviathan/M levigate/DGNS levirate leviratic levitate/DGNS levitational levity/S levkas levorotation levorotatory levulose levy/DGRS lewd/PY lewellyn lewes lewis lewisite lex lexeme lexica lexical/Y lexicality lexicographer/MS lexicographic lexicographical/Y lexicography lexicology lexicon/MS lexiconise/S lexiconize/S lexicostatistic/S lexigraphy lexis ley liability/MS liable/AP liaise/DGS liaison/MS liana liar/MS liard liase liason lib libation/S libationary libau libava libeccio libel/S libelant/S libeled libelee/S libeler/S libeling libelist libellant libellant/S libelled libellee libellee/S libeller libeller/S libelling libellous libellous/Y libelous/Y liber/S liberace liberal/PSY liberalisation/MS liberalise/DGRSZ liberalised/U liberalism liberalist liberalistic liberality liberalization/MS liberalize/DGRSZ liberalized/U liberate/DGNS liberationist/S liberator/MS liberec libertarian/S libertarianism liberticide libertie libertinage libertine/S libertinism liberty/MS libia libidinal/Y libidinous/PY libido libra librae librarian/MS librarianship library/MS librate/N librational libratory libretti librettist/S libretto/MS libriform licating lice licence/MS licenceless/S licensable license/ADGMRS licenseable licensed/AU licensee/MS licenseless/S licensor licensure licentiate licentiateship licentious/PY lichee lichen/DMS lichenin lichenisation/MS lichenise/S lichenization/MS lichenize/S lichenology lichenous lichi licht/R lichtenstein licit/Y lick/DGRS licked/U lickerish/PY lickspittle licorice lictor lid/MS lidded liddell lidding lidice lidless lido/S lidocaine lie/DRS lieberman liebig liebknecht lied/R lief liege liegeman liegnitz lien/MS lienal lientery lierne liestal lietuva lieu lieut lieutenancy lieutenant/MS lieve life/MRZ lifeblood lifeboat/S lifeful lifeguard/S lifeless/PY lifelike/P lifeline/S lifelong lifemanship lifesaver lifesaving lifespan/S lifestyle/S lifetime/MS lifeway lifework liffey lift/DGRSZ liftable liftboy liftman liftoff ligament/S ligamentary ligamentous ligan ligand/S ligate/DGNSX ligature/DGS liger ligeti light/DGNPRSTXYZ lighten/DGRS lighter/MS lighterage lightface/D lightfooted/PY lightful lighthanded/P lightheaded lighthearted/PY lighthouse/MS lightish lightless lightning/DMS lightproof lightship lightships lightsome/PY lightweight/S lightyear/S ligneous ligniform lignify/DGNS lignin lignite lignitic lignitise/S lignitize/S lignocaine lignocellulose lignum ligroin ligula ligulate ligule ligure liguria lii likability likable/P likasi like/DGJRSTY likeable likelihood/SU likely/PRT liken/DGS likeness/MS likewise liklihood likuta lilac/MS lilburne liliaceous lilienthal liliuokalani lille lilliput lilliputian lilo lilongwe lilt/G lilting/PY lily/DMS limacine limassol limb/DRSZ limba limbate limber/DGPSY limbers/U limbic limbless limbo/S limbus lime/DGMS limeade limekiln limelight limen limerick/MS limestone limewater limey limicoline limicolous liminal limit/DGRSZ limitability limitable limitably limitarian limitary limitation/MS limitational limitative limited/PSY limitedly/U limitless/PY limitrophe limmer limn/GR limnetic limnic limnological/Y limnologist limnology limo/MS limoges limonene limonite limonitic limousin limousine/S limp/DGPRSY limpet limpid/PY limpidity limpkin limpsy limulus limy/R linac linacre linage linalool linares linate/DN linchpin/MS lincrusta linctus lindane linden lindesnes lindisfarne lindwall lindy line/DGJMRSZ lineage/S lineal/Y lineality lineament lineamental linear/Y linearisable linearisation/MS linearise/DGNS linearity/S linearizable linearization/MS linearize/DGNS lineate/X lineation linebacker/S linebacking linebreed linecaster linecasting lined/U linefeed/S lineman linemen linen/MS linenise/RSZ linenize/RSZ linenumber lineolate/D lineprinter/MS linerless linesman linestyle lineup/S linewidth linga lingam lingayen lingcod linger/DGRS lingerie lingering/Y lingo lingoes lingonberry lingua linguae lingual/Y lingualise/S lingualize/S linguiform linguine linguini linguist/MS linguistic/S linguistical linguistically linguistician lingulate linhay liniment/S linin link/DGJRSZ linkage/MS linkboy linking/AU linkman linksman linkup linkwork linlithgow linn linnaeus linnet linnhe lino linocut linoleate linoleic linolenate linolenic linoleum linos linseed linstock lint/RS lintel lintwhite linty linum linz lion/MS lioness/MS lionfish lionhearted lionisable/S lionisation/MS lionise/DGRSZ lionizable/MS lionization/MS lionize/DGRSZ lionlike lip/MS lipari lipase lipchitz lipid/MS lipide lipidic lipless liplike lipography lipoid lipolysis lipolytic lipoma lipophilic lipoprotein lippe lipped lippen lippi lippie lipping lippy/R lipread/G lipstick liquate/DGNSX liquefacient liquefaction liquefactive/MS liquefiability liquefiable liquefy/DGRSZ liquesce liquescent liqueur liquid/MPSY liquidate/DGS liquidation/MS liquidator liquidisation liquidise/DGRSZ liquidity liquidization liquidize/DGRSZ liquidus liquor/DGMS liquorice liquorish lira/S lire liripipe lisieux lisle lisp/DGMRS liss lissom lissome/PY list/DGJNRSXZ liste listed/U listel listen/DGRSZ listenable listeriosis listing/MS listless/PY liston lit litany/S liter/S literacy literae literal/PSY literalisation/MS literalise/DRSZ literalism literalist literalistic literality literalization/MS literalize/DRSZ literarily literary/P literate/NPY literati literatim literator literature/MS literatus litharge lithe/PY lithesome lithia lithiasis lithic lithically lithium litho/S lithograph/RZ lithographic lithographically lithographise/S lithographize/S lithographs lithography lithoid lithologic lithological/Y lithology lithomarge lithometeor lithophane lithophyte lithophytic lithopone lithosol lithosphere lithospheric lithotomy lithotrity lithuanian litigable litigant/S litigate/DGNS litigator litigious/PY litmus litotes litre/S litter/DGRS litterateur litterbag litterbug littermate/MS littery little/PRT littleneck littoral littoria liturgic/S liturgical/Y liturgiologist liturgiology liturgist liturgy litz liu livability livable/P livably live/DGHJPRSTYZ liveability liveable livelihood livelily livelong lively/PRT liven/DG liverish/P liverwort livery/D liveryman livestock livid/P lividity living/PSY livingstone livlihood livonia livorno livraison livy lix lixiviate/DGNS lixivium lizard/MS lizzy llama/MS llano/S lo los loach/S load/DGJRSZ loadable loadstar loadstone loaf/DGRSZ loam loamy loan/DGRS loanable loanda loanword/MS loath/DGPRSY loathe/DGRS loathsome/PY loaves lob lobar lobate/DNY lobbing lobby/DGS lobbyer lobbyism lobbyist lobe/DMS lobectomy lobelia lobeline lobengula lobito loblolly lobo/S lobola lobotomy lobscouse lobster/MS lobsterman lobstermen lobular/Y lobularity lobulate/DN lobule/S lobulose lobworm local/SY locale/S localisable/SU localisation/MS localise/DGRSZ localised/U localises/U localism localisms localite locality/MS localizable/MSU localization/MS localize/DGRSZ localized/U localizes/U locatable locate/DGNRSVX locational/Y locative/S locator/MS loch lochia loci lock/DGJRSZ lockable lockage lockbox locket lockies lockjaw locknut lockout/MS locksmith/G lockstep lockstitch lockup/MS lockyer locl loco locoes locofoco locoism locoman locomote/DGS locomotion locomotive/MSY locomotor locomotory locoweed locris locular loculate/DN locule/D loculus locum locus/M locust/MS locution locutor lod lode loden lodestar lodestone lodge/DGJRSZ lodgement lodgepole lodger/MS lodgment lodi lodicule loess loewi lofoten loft/MRS loftily lofty/PR log/MS loganberry loganiaceous logaoedic logarithm/MS logarithmic logarithmically logbook loge/NX logged/U logger/MS loggerhead loggets loggia loggie logging loggy logia logic/MS logical/PSY logicalisation/MS logicalise/S logicality logicalization/MS logicalize/S logician/MS logicise/DGS logicism logicize/DGS login/S logistic/S logistical/Y logistician logjam loglog lognormal/Y lognormality logo/S logoff logogram/MS logogrammatic logograph logographic logographically logography logogriph logomachy logopaedics logorrhea/MS logorrheic logorrhoea/MS logotype logout logroll/GR logwood logy lohengrin loin/MS loincloth loiret loiter/DGRS loll/GR lollapalooza lollipop lollop lolly/S lollygag lollypop lomax lombok lombroso loment lomond londonderry londrina lone/PRYZ lonelily lonely/PRT lonesome/PY long/DGJPRSTY longan longanimity longanimous longboat/S longbow longbowman longcase longcloth longe longeron longevity longevous longhair/D longhand longhead/D longheaded/P longhorn/S longhouse longicorn longing/SY longinus longish longitude/MS longitudinal/Y longlasting longleaf longlegs longline longship longshore longshoreman longshoremen longshoring longsome/PY longspur longstanding longstreet longterm longtime longue longueuil longueur longus longways longwinded longword/MS longyearbyen loo looby/S loofah look/DGRSZ lookahead lookin lookout/S lookup/MS loom/DGS loon looney loony/PR loop/DGRS loophole/DGMS loopy loose/DGPRSTY loosebox looseleaf loosen/DGRS loosestrife loot/DGRS lop/S lope/DGR lophobranch lophophore lopped lopper lopping loppy/R lopseed lopsided/PY loquacious/PY loquacity loquat lor loran/S lorca lord/GMSY lordling lordly/PR lordosis lordotic lordship lordy lore loreal lorentz lorgnette/S lorgnon/S lorica loricate/D lorient lorikeet lorimer loris lorn/P lorrain lorris lorry/S lory losable/P lose/GJRSZ losel losey loss/MS lossage lossless lossy/RT lost/P lot/MS loth lothair lothario lotharios lothian/S lothringen lotic lotion/S lotos lotted lottery/S lotting lotto lotus louche loud/NPRTY louden/DG loudish loudmouth/D loudspeak loudspeaker/MS loudspeaking lough lounge/DGRSZ loup/G loupe/G louse/DGS lousewort lousily lousy/PR lout/S louth loutish/PY louvain louvar louver/DS louvre/DS lovable/P lovably lovage lovat love/DGMRSYZ loveable lovebird/S loved/U lovejoy loveless/PY lovelily lovell lovelock/S lovelorn/P lovely/PRST lovemaking lover/GMSY lovesick/P lovesome lovey loving/PY low/GPRSTYZ lowan lowborn lowboy lowbred lowbrow lowdown lower/DGS lowercase/DGS lowerclassman lowermost lowery lowestoft lowland/RS lowlight/MS lowlihead lowlily lowly/PRT lown lowveld lox/S loxodrome loxodromic/S loxodromically loy loyal/Y loyalise/S loyalist/S loyalize/S loyalty/MS loyang loyola lozenge/DS lozengy lozi lualaba luanda luang luau lubber/SY lubberland/Z lubberly/P lube lublin lubra lubric lubrical lubricant/MS lubricate/DGSVX lubrication lubricator lubricious/Y lubricity lubricous lubritorium lubumbashi lucarne lucca luce lucency lucent/Y lucid/PY lucidity lucien luciferin luciferous lucilius luck/DS luckily/U luckless lucky/PRT lucrative/PY lucre lucubrate/DGNSX lucubrator luculent/Y lucullus lud ludhiana ludicrous/PY ludmilla ludo lues luetic luetically luff/DGS lug/S luge/MRS luggage luggageless lugged lugger lugging lugo lugsail lugubrious/PY lugworm luichow luik lukemia lukewarm/PY lull/DS lullaby lulu lum lumbago lumbar lumbarisation/MS lumbarization/MS lumber/DGRS lumberjack/MS lumberjacket lumberman lumbermen lumberyard lumbian lumbricalis lumbricoid lumen/S lumenal lumiere lumina luminaire luminal luminance luminary/S luminesce/DG luminescence luminescent luminiferous luminist luminosity luminous/PY lumisterol lumme lummox lummus lump/DGNRS lumpenproletariat lumpily lumpish/PY lumpy/PR lumumba luna lunacy lunar lunarian lunary lunate/DNY lunatic/S lunatise/S lunatize/S lunch/DGRS luncheon/MS luncheonette lunchroom/S lunchtime lune/S lunette lung/DGRS lungan lunge lungfish lungi lungki lungworm lungwort lunik lunisolar lunitidal lunker lunkhead/D luns lunt lunula lunulate lunule luny lupanar lupin lupine lupulin lupus lurch/DGRS lurdan lurdane lure/DGRS lurex lurid/PY lurk/DGRSZ lusatia luscious/PY lush/PSY lusion lust/GS luster/DGS lusterless lusterware lustful/PY lustihood lustily lustra lustral lustrate/DGNSX lustre/DGS lustreless lustreware lustrous/PY lustrum lusty/PR lusus lutanist lute/DGMS luteal luteinisation luteinise luteinization luteinize lutenist luteolin luteous lutestring lutetium luthern luthuli lutihaw lutine lutist lux luxate/DGNSX luxe/S luxor luxulianite luxuriance luxuriant/Y luxuriate/DG luxurious/PY luxury/MS lvi lvii lxi lxii lxiv lxix lxvi lxvii lyallpur lyautey lycanthrope lycanthropic lycanthropy lycaon lycaonia lycee lyceum lychee lychnis lycia lycidas lycopod lycopodium lycurgus lydda lyddite lydgate lye lyell lying/SY lyly lymph lymphadenitis lymphangial lymphangitis lymphatic lymphatically lymphoadenoma lymphoblast lymphoblastic lymphocyte/S lymphocytic lymphocytosis lymphoid lymphoma lymphomatoid lymphomatosis lymphomatous lymphopoiesis lyncean lynch/DRS lynchet lyndon lynx/MS lyonnaise lyophile lyophilic lyophilisation lyophilise/DR lyophilization lyophilize/DR lyophobic lyotropic lyrate/DY lyre/MS lyrebird/MS lyric/S lyrical/PY lyricise/DGS lyricism lyricist/S lyricize/DGS lyrism lyrist lysate lyse/GS lysergic lysias lysimeter/MS lysimetric lysin lysine lysippus lysis lysogen lysogenic lysogenicity lysogenisation lysogenise lysogenization lysogenize lysogeny lysol lysolecithin lysosomal/Y lysosome lysozyme lyssa lytic lytically lytta lytton m's ma ma'am mabela mabuse macabre/Y macaco macadam macadamisation macadamise/DGS macadamization macadamize/DGS macaque macarise/DGS macarize/DGS macaroni/M macaronic macaronically macaronies macaroon macaw/MS maccaroni mace/DGRS macebearer macedoine macerate/DGNSX macerator/S machado machan machel machete machicolate/N machin machinability machinable machinate/DGS machination/MS machinator machine/DGMS machineable machinelike machinery/S machinisation/MS machinise/S machinist/S machinization/MS machinize/S machismo machmeter macho machree machu macintosh mack mackerel/S mackinaw mackintosh mackle/DGS macklin macle/D macrame macro/MS macroaggregate/D macrobiotic/S macrocephalic macrocephalous macrocephaly macroclimate macrocosm macrocosmic macrocosmically macrocyte macrocytic macrocytosis macrodynamic macroeconomic macroeconomics macroencephaly macroevolution macroevolutionary macrofossil macrogamete macrograph macroinstruction macromolecular macromolecule/MS macron macronucleus macronutrient macropathological macropathology macrophage/S macrophagic macrophysics macrophyte macrophytic macroprocessor macropterous macroscale macroscopic macroscopical macroscopically macrosimulation macrosocioeconomic macrosporangium macrospore macrostructural macrostructure/M macrosystem macruran macula maculate/DGNSX macule macumba mad/PY madafu madam/S madcap madded madden/DG maddening/Y madder maddest madding maddish made/AU mademoiselle/S madhouse madhya madina madman madmen madras madre madrepore madrigal/GS madrigalian madrigalist madrilene madrona madrone madstone/S madura madurai maduro madwoman madwomen madwort maebashi maelstrom/MS maenad maenadic maestoso maestricht maestro maeterlinck maewo mafeking maffick mafia mafioso mag/N magallanes magazine/DGMS magazinism magazinist/S magdalena mage magenta maggiore maggot/MS maggotry/S maggoty magi magic magical/Y magicalise/S magicalize/S magician/MS magicked magicking magill magilp maginot magisterial/Y magisterium magistery magistracy magistral/Y magistrate/MS magistrateship magistratical/Y magistrature magma magmatic magna magnanimity magnanimous/PY magnate/S magnesia magnesian magnesite magnesium/S magnet/MS magnetic/S magnetically magnetisability/MS magnetisable/S magnetisation/AMS magnetise/GRSZ magnetised/U magnetises/A magnetism/MS magnetite magnetitic magnetizability/MS magnetizable/MS magnetization/AMS magnetize/GRSZ magnetized/U magnetizes/A magneto/S magnetochemistry magnetodynamo magnetoelectric magnetoelectrical magnetoelectricity magnetofluidmechanic/S magnetogasdynamic/S magnetogram/MS magnetograph magnetohydrodynamic/S magnetometer/MS magnetometric magnetometry magnetomotive magneton magnetooptic/S magnetooptical magnetopause magnetoscope magnetosheath magnetosphere magnetospheric magnetostatic magnetostriction magnetostrictive/Y magnetron/S magnific magnifical/Y magnificats magnificence magnificent/Y magnifico magnified/U magnify/DGNRSXZ magniloquence magniloquent/Y magnitude/MS magnolia/S magnoliaceous magnum/S magnus magot magpie/S magritte magtape/S maguey maguire/S magus mahabharata mahalla mahanadi maharaja/M maharajah maharanee maharani maharashtra maharishi mahatma mahatmaism mahewu mahjong mahler mahlstick mahoganise/DGS mahoganize/DGS mahogany mahometan mahout mahratta mahseer maid/MNSX maidan maiden/SY maidenhair maidenhead maidenhood maidenly/P maidhood maidish maidservant maidstone maiduguri maier maieutic/S maieutical maigre maihem maikop mail/DGJRSZ mailability mailable mailbag/S mailboat/S mailbox/MS mailcoach mailer/MS maillol maillot mailman mailmen mailplane/S mailsack/S maim/DGRSZ maimed/P maimonides main/SY mainbrace mainframe/MS mainland/RZ mainline/DGRSZ mainmast mainsail mainsheet mainspring mainstay mainstream maintain/DGRSZ maintainability maintainable/U maintained/U maintainer/MS maintenance/MS maintenence maintop maintopsail mainz maiolica maisonette/S maitre/S maize/RSZ majestic majestical majestically majesty/MS majolica major/DGS majordomo/S majorette/S majorise/S majority/MS majorize/S majunga majuscular majuscule makable makalu makarios make/GJRSZ makeable makebate makefast makefile/S makepeace makeshift/S makeshifty makeup/S makeweight makeyevka makhachkala makkah mako/S makurdi makuta mal malabo malachi malachite malacologic malacological malacologist malacology malacophyllous malacopterygian malacostracan maladapt/DV maladaptation maladdress maladjust/DV maladjustment/S maladminister maladministration maladroit/Y malady/MS malaise malam malamud malamute malang malapert/PY malapportioned malapportionment malappropriate/DGS malaprop malapropian malapropism malapropos malar malaria malarial malarian malariated malariologist malariology malarious malarkey malassimilation malate malatesta malathion malatya malaxate/DGS malconduct malconformation malcontent/DMS malcontented/PY maldevelopment maldistribute/N maldon male/MPS maleable malebranche maledict malediction maledictory malefaction malefactor/MS malefic maleficence maleficent maleic malemute malentendu malevich malevolence malevolencies malevolent/Y malfeasance malfeasant malformation/S malformed malfunction/DGS malgovernment malherbe malic malice malicious/PY maliciously/U maliferous malign/DY malignance malignancy/S malignant/Y malignity malihini malimprinted malines malinger/DR malingering malinke malism malkin mall/MS mallam mallard/S malleability malleable/P malleablise/S malleablize/S mallee mallemuck mallenders malleolus mallet/MS malleus mallorca mallow malm malmsey malnourished malnutrition malocclusion malodor malodorous/PY malodour malolactic malonic malonylurea malory malpighi malpighiaceous malposed malposition malpractice malpractitioner malt/DGS maltase maltha malthus maltman maltobionic maltose maltreat maltreatment maltster malty maluku malvaceous malvasia malvasian malvern malversation malvoisie malwa mama mamaguy mamba mambo/S mamelon mamilla mamillate mamma/MS mammal/MS mammalian mammalogist mammalogy mammary mammee mammer mammet mammiferous mammilla mammillar mammillary mammillate/D mammock mammography mammon mammonism mammonist mammonite mammoth mammy/S mampara man/MSY mana manacle/DGS manado manage/DGRSZ manageability manageable/P manageably managed/U management/MS managemental manager/MS manageress managerial/Y managerialism managership manakin manassas manasseh manatee manaus manche manchet manchineel manchukuo manchuria mancipation mancipatory manciple/S mandala mandamus/DGS mandarin/S mandarinate/S mandarinic mandarinise/S mandarinism mandarinize/S mandatary/S mandate/DGS mandator mandatorial mandatorily mandatory/S mandi mandible mandibular mandibulate mandir mandola mandolin/MS mandolinist/S mandorla mandragora mandrake/S mandrel mandril mandrill manducate/DGS mane/DMS manege manet maneuver/DGRS maneuverability maneuverable manful/PY mangabey mangalore manganate manganese manganesian manganic manganin manganite manganous mange mangel mangelwurzel manger/MS mangily mangle/DGRS mango/MS mangonel mangosteen mangrove mangy/PR manhandle/DGS manhole/S manhood manhunt/S mani mania maniac/MS maniacal/Y manic manically manichaeus manicotti manicure/DGS manicurist manicurists manifest/DGPSY manifestant manifestation/MS manifesto/DGMS manifestoes manifold/MPRSY manikin/S manilla manille maninke manioc maniple manipulability manipulable manipular manipulatable manipulate/DGNSVX manipulative/P manipulator/MS manipulatory manipur manisa manitoulin manitowoc manizales mankind mankowski manky manless manlike manly/PRT manna mannar manned/U mannequin/S manner/DSY mannered/U mannerise/S mannerism/S mannerist manneristic mannerize/S mannerless mannerly/PU mannikin manning mannish/PY mannitic mannitol mannopyranosyl mannosyl manoeuvrability manoeuvrable manoeuvre/DGRS manolete manometer/MS manometric manometrical/Y manometry manor/MS manorial manorialism manpower manque manresa manrope/S mansard/D mansart manse manservant manship mansholt mansion/MS manslaughter manslayer mansuete mansuetude manteau mantegna mantel/MS mantelet mantelletta mantelpiece mantelshelf manteltree mantic mantilla mantinea mantis/S mantissa/MS mantle/DGMS mantlepiece mantoux mantova mantra mantrap mantua manual/MSY manubrium manuduction manuductory manufactory manufacturable manufacture/DGRSZ manufacturer/MS manuka manukau manumission manumit manumitted manumitting manure/DGRSZ manurial manus manuscript/MS manuscriptal manutius manward/S manwise many manyfold manyplies manzanilla manzanita manzoni maoism map/MS maple/MS maplecrest mapmaker/S mapmaking mappable mapped/U mapper mappery mapping/MS mappist/S maps/U maputo maquette maquillage maquis mar/S mara marabou marabunta maraca maracanda maracay maraging marasca maraschino marasmic marasmus marat marathon/S maraud/GRS marauders maravedi marble/DGRS marbleise/S marbleised marbleising marbleize/S marbleized marbleizing marbly marcasite marcelled marcelling marcellus marcescent march/DGRS marche marchesa marchese marchioness marchpane marconigram/MS marcos marcotte marcuse marduk mardy mare/MS maremma marg margaric margarine margarita margarite margate margin/DGMS marginal/SY marginalia marginalisation marginalise/DGS marginality marginalization marginalize/DGS marginate/DGNSX margravate margrave margravine margrethe maria mariachi marianao maribor mariculture marigold/MS marijuana/M marimba marina/S marinade/S marinate/DGS marine/RS marionette/S mariposa marish maritage maritain marital/Y maritime/R maritsa marjoram mark/DGJRSZ markable/A markdown marked/AU markedly market/DGJRS marketability marketable marketeer/GMS marketplace/MS marketwise markovitz marksman marksmanship marksmen markswoman markswomen markup/S marl marlin marline marlite marmalade/S marmara marmite marmolada marmoreal/Y marmorean marmoset/MS marmot maroc marocain maroon/D maroquin maros marplot marprelate marquand marque/A marquee/S marquesas marquess/S marquessate marquet marquis/S marquisate marquise marquisette marram marrano marred/U marriage/MS marriageability marriageable marriages/A married/AU marring marron marrow/S marrowbone/S marrowfat marrowless marrowy marry/DGS marryat marse marsh/MS marshal/DGRSZ marshalcy marshall/GS marshalled marshalship marshland/S marshmallow/S marshmallowy marshy/PR marsilius marsipobranch marsupial/MS marsupialisation/MS marsupialise/S marsupialization/MS marsupialize/S marsupium mart/NSX martaban martagon martel martellato martello martensite martensitic martensitically martial/Y martialisation/MS martialise/S martialization/MS martialize/S martin martineau martinet martingale martini/S martlet martyr/MS martyrdom martyrisation/MS martyrise/DGRSZ martyrization/MS martyrize/DGRSZ martyrologist/S martyrology/S martyry marvel/S marveled marveler marveling marvell marvelled marveller marvelling marvellous/PY marvelous/PY marxists marzipam marzipan masaccio masan masaryk masbate mascara/S mascarene mascle mascon mascot/MS masculine/PY masculinisation/MS masculinise/DGS masculinity masculinization/MS masculinize/DGS maser mash/DGJRSZ masharbrum mashhad mashie masinissa masjid mask/DGJRS maskable maskanonge masked/U masochism masochist/MS masochistic masochistically mason/DGMS masonry masqat masque/RSZ masquerade/GRS mass/DGSV massa massachuset massacre/DGRS massage/DGRS massasauga massasoit massbus masseter masseteric masseur/S masseuse massicot massif/S massine massing/R massinissa massive/PY massless massorete massotherapy massy mast/DRSZ mastaba mastectomy/S master/DGJMSY masterful/PY masterly/P mastermind/DGS masterpiece/MS mastership mastersinger/S masterstroke/S masterwork mastery masthead mastic masticate/DGNSX masticator/S masticatory mastiff mastigophoran mastitic mastitis mastodon/S mastodonic mastodont mastoid mastoidectomy mastoideus mastoiditis masturbate/DGNS masturbational masturbatory masuria masurium mat/MS matadi matador matamoros matanzas matapan match/DGJRSZ matchable/U matchboard/G matchbook matchbox matched/U matchless/Y matchlock matchmake matchmaker/MS matchmaking/M matchmark matchstick matchwood mate/DGJMRS mated/U matelote materfamilias material/PSY materialisation/MS materialise/DGRSZ materialises/A materialism/M materialist materialistic materialistically materiality materialization/MS materialize/DGRSZ materializes/A materiel maternal/Y maternalise/S maternalize/S maternity mates/IU matey math mathematic mathematical/Y mathematician/MS mathematicise/S mathematicize/S mathematics mathematisation mathematization maths mathura matinal matinee matins matlo matlock mato matoke matopo matozinhos matrass matriarch matriarchal matriarchate matriarchy matric matrices matricidal matricide matriclinous matriculant matriculate/DGS matriculation matrilineal/Y matrilocal matrimonial/Y matrimony matrix/S matroclinous matroid matron/Y matronage matronise/DGS matronize/DGS matronymic matsu matsuyama matt mattamore matte matted mattei matter/DGS matterhorn mattery matthias mattie matting mattins mattock mattoid mattrass mattress/MS maturate/DGSVX maturation maturational mature/DGPRSY maturity/S matutinal/Y matzo/S matzoon maubeuge mauby maude maudlin/Y maudlinise/S maudlinism/S maudlinize/S maugre maui maul/GRSZ maulana maulmain maulstick maumet mauna maund/R maundy maungy maupassant maupertuis mauretania mauriac mauricio maurois maury maurya mausoleum/S mauve maverick/S maw mawger mawkin mawkish/PY mawsie max maxi maxilla/S maxillae maxillary maxilliped maxillipede maxim/MS maxima maximal/Y maximalist maximin maximisation/MS maximise/DGRSZ maximization/MS maximize/DGRSZ maximum/SY maximus maxint maxisingle maxixe maxwell may/GRST mayapple maybe mayday mayence mayflower mayfly mayhap mayhem mayon mayonnaise mayor/MS mayoral mayoralty mayoress mayorship maypole mayst mazard mazarin maze/DGMRS mazed/PY mazedness/S mazourka/MS mazuma mazurka/MS mazy mazzard mazzini me mea/H mead/S meadow/MS meadowland meadowlark/MS meadowsweet meager/PY meagre meal/MS mealie mealtime mealworm mealy/RS mealymouth/D mealymouthed/PY mealymouthedness/S mean/GJPRSTY meander/DGJS meandrous meaning/MS meaningful/PY meaningless/PY meant/U meantime meanwhile meany measle/D measles measly/R measurability measurable/U measurably measure/DGRS measured/Y measureless measurement/MS meat/MS meatball/S meatman meatmen meatus meaty/PRT mecamylamine mecca mech mechanic/MS mechanical/SY mechanicalisation/MS mechanicalise/S mechanicalization/MS mechanicalize/S mechanician mechanisable mechanisation/MS mechanise/DGRSZ mechanised/U mechanises/U mechanism/MS mechanist mechanistic mechanistically mechanizable mechanization/MS mechanize/DGRSZ mechanized/U mechanizes/U mechanochemically mechanoreceptor mechanotherapy mechelen mecholyl meck meconium mecum med medal/MS medaled medaling medalise/S medalist/S medalize/S medalled medallic medalling medallion/MS medallist/S medan medawar meddle/DGRS meddlesome/P media/S mediacy mediad mediae mediaeval/MSY mediaevalise/S mediaevalism/MS mediaevalist/MS mediaevalistic/S medial/Y medialisation/MS medialise/S medialization/MS medialize/S medially/A median/MSY mediant mediastinum mediate/DGNPSVXY mediational mediatisation/MS mediatise/DGS mediatization/MS mediatize/DGS mediator/S mediatorial mediatorship mediatory mediatress/S mediatrice mediatrix medic/MS medicable medicably medicaid medical/Y medicament/DGS medicamentous medicare medicate/DGNSVX medicinable medicinal/Y medicine/MS medico/S medicolegal medieval/MSY medievalise/S medievalism/MS medievalist/MS medievalistic/S medievalize/S mediocre mediocrity/S meditate/DGNSVX meditative/PY meditator medium/MS mediumisation/MS mediumise/S mediumistic mediumization/MS mediumize/S mediumship medlar/S medley/S medulla medullary medullated medusae medusoid medway mee/D meek/PRTY meerkat meerschaum meerut meet/GJRSY meetinghouse mega megabit/S megabuck megabyte/S megacephaly megacycle megadeath megaflop/S megagamete megagametophyte megahertz megakaryocyte megakaryocytic megalith megalithic megaloblast megaloblastic megalocardia megalocephaly megalomania megalomaniac megalomaniacal/Y megalomanic megalopolis megalopolises megalopolistic megalopolitan megalopolitanism megalopteran megalopterous megalosaur megaparsec megaphone megaphonic megapode megapolis megapolitan megara megarians megaron megascopic megascopically megasporangium megaspore megasporic megasporogenesis megasporophyll megathere megaton/S megavolt megawatt megaword/S megger meghalaya megiddo megillah megilp megohm/S megrim/S mehemet meilhac meiny meiosis meiotic meiotically meir meister meitner mekka melamine melancholia melancholiac melancholic melancholically melancholy melanchthon melange melanic melanin melanisation melanise/DGS melanism melanist melanistic melanite melanitic melanization melanize/DGS melanoblast melanoblastic melanoblastoma melanochroic melanocyte melanogenesis melanoid melanoma melanophore melanosis melanotic melanous melaphyre melatonin melba melchior meld/GS melee meliaceous melic melies melilla melilot melinite meliorate/DGNSVX meliorator meliorism meliorist melioristic melisma mell melliferous mellifluent/Y mellifluous/PY mellitin mellophone mellow/DGPSY melodeon melodic melodically melodious/PY melodisation melodise/DGRS melodist melodization melodize/DGRS melodrama/MS melodramatic/S melodramatically melodramatisation melodramatise/DGS melodramatist melodramatization melodramatize/DGS melody/MS meloid melon/MS melos melt/DGRS meltability meltable meltage meltdown/M melting/Y meltwater/S mem member/DMS membership/MS membranal membrane/DMS membraneless membranous/Y meme memel memento/S mementoes memling memo/MS memoir/S memoire memorabilia memorability memorable/P memorably/U memoranda memorandum/S memorex memorial/SY memorialisation/MS memorialise/GRSZ memorialised/U memorialist memorialization/MS memorialize/GRSZ memorialized/U memoriam memorisable/S memorisation/MS memorise/DGRSZ memorised/U memorises/A memoriter memorizable/MS memorization/MS memorize/DGRSZ memorized/U memorizes/A memory/MS memoryless memphremagog memsahib men/MS menace/DGS menacing/Y menadione menado menagerie/S menai menam menander menaquinone menarche/S menarcheal mencius mencken menckenese mend/DGRS mendable mendacious/PY mendacity mendelevium menderes mendicancy/S mendicant/S mendicity/S mendips mendoza menes menfolk/S mengistu menhaden menhir menial/SY meningeal meninges meningitic meningitis meningocele meningococcal meningococcic meninx menisci meniscus/S menispermaceous meno menology menominee menomini menon menopausal menopause menorah menorrhagia menorrhagic menotti mens/DGS mensa mensal mensch mense menseful menseless menservants menstrual menstruate/DGNSX menstruous menstruum mensurability mensurable/P mensural mensuration/S mensurational menswear mental/Y mentalisation/MS mentalise/S mentalism mentalist mentality/S mentalization/MS mentalize/S mentation/S menthol mentholated mention/DGRSZ mentionable/U mentioned/U mentor/MS mentorship mentum menu/MS menuhin meow/DGMS mepacrine meperidine mephitic mephitis meprobamate mer merano merbromin merca mercantile mercantilism mercantilist mercantilistic mercaptan mercaptide mercaptopurine mercenarily mercenary/MPS mercer/S mercerisation/MS mercerise/DGRSZ mercerization/MS mercerize/DGRSZ mercery merchandise/DGRS merchant/MS merchantability merchantable merchantman merchantmen merchet mercia mercians merciful/PY mercifully/U merciless/PY mercurate/DGNSX mercurial/PY mercurialisation/MS mercurialise/S mercurialization/MS mercurialize/S mercuric mercurous mercury/S mercy/S mere/TY merengue meretricious/PY merganser merge/DGRSZ mergence/S mergui meridian/S meridional/Y meringue/S merino meristem meristic meristically merit/DGS meritocracy meritocratic meritorious/PY meriwether merkin merlin merlon mermaid/MS merman/M mermen meroblastic meroblastically merocrine meromorphic meromyosin meroplankton merozoite merrick merrily merrimac merriment/S merry/PRT merrymake merrymaker merrymaking merryman merrythought merse mersin merthyr mesa mesarch mescal mescaline mesdames mesdemoiselles meseems mesencephalon mesenchyme mesenteric mesenteritis mesenteron mesentery mesh/DGS meshach meshed/U meshuga meshwork meshy mesial/Y mesic mesically mesitylene mesmeric mesmerically mesmerisability/MS mesmerisable/S mesmerisation/MS mesmerise/GRSZ mesmerised/U mesmerises/U mesmerism/S mesmerist/S mesmerizability/MS mesmerizable/MS mesmerization/MS mesmerize/GRSZ mesmerized/U mesmerizes/U mesnalty mesne mesobenthos mesoblast mesoblastic mesocarp mesocephalic mesocratic mesoderm mesodermal mesodermic mesogastrium mesoglea mesognathous mesolithic mesolonghi mesomeric mesomerism mesomorph mesomorphic mesomorphism mesomorphy meson mesonephric mesonephros mesonic mesopause mesopelagic mesophase/S mesophyll mesophyte mesosome mesosphere mesospheric mesothelioma mesothelium mesothoracic mesothorax mesothorium mesotron mesotronic mesotrophic mesquite mess/DGS message/DGMS messalina messaline messene messenger/MS messenia messiaen messiah messiahs messiahship messianic messianism messieurs messily messina messmate/S messuage/S messy/PRT mestee mester mestizo mestranol met/SZ meta metabole metabolic metabolically metabolisable/S metabolise/GS metabolised metabolism/S metabolite/S metabolizable/MS metabolize/GS metabolized metacarpal metacarpus metacenter metacentre metacentres metacentric metacharacter/S metachromatic metachromatism metacinnabarite metacircular metacircularity metaethical metaethics metafemale metagalactic metagalaxy/S metagenesis metagenetic metagenetically metagnathous metagram/MS metal/MS metalanguage/S metaled metalicity/MS metaling metalization/MS metalize/DGS metalled metallic metallically metallicise/S metallicize/S metalliferous metallike metalline metalling metallisation/MS metallise/DGS metallist/S metallization/MS metallize/DGS metallocene metallographer metallographic metallographically metallographist metallography metalloid metalloidal metallophone metallurgic metallurgical/Y metallurgist metallurgists metallurgy metalsmith/S metalware metalwork/GJR metamale metamathematical metamathematician metamathematics metamer metamere metameric metamerically metamerisation/MS metamerised/MS metamerism metamerization/MS metamerized/MS metamorphic metamorphically metamorphism metamorphose/D metamorphosis metanephric metanephros metanotion/S metaperiodate metaph metaphase metaphonise/S metaphonize/S metaphor/MS metaphoric metaphorical/Y metaphorise/S metaphorize/S metaphosphate metaphosphoric metaphrase metaphrast metaphysic metaphysical/Y metaphysician metaphysicise/S metaphysicize/S metaphysics metaplasia metaplasm metaplasmic metaplastic metapolitics metaproduction/S metaprotein metapsychological metapsychology metasomatic metasomatically metasomatism metastability metastable metastably metastasis metastasise/DGS metastasize/DGS metastatic metastatically metasymbol/S metasyntax/S metatarsal/Y metatarsus metate metatheory metatherian metathesis metathetic metathetical/Y metathoracic metathorax metavariable metaxylem metazoa metazoal metazoan metchnikoff mete/DGRSZ metempirical metempirics metempsychosis metencephalic metencephalon meteor/MS meteoric meteorically meteorisation/MS meteorise/S meteorite/S meteoritic/S meteoritical meteorization/MS meteorize/S meteorograph meteorographic meteoroid/MS meteoroidal meteorol meteorologic meteorological meteorologicaly meteorologist meteorology meter/DGMS metestrus methacrylate methacrylic methadon methadone methaemoglobin methamphetamine methane methanol methanolic metheglin methenamine methinks methionine metho method/MS methodic methodical/PY methodisation/MS methodise/DGRSZ methodism methodist/MS methodistic methodius methodization/MS methodize/DGRSZ methodological/Y methodologist methodologists methodology/MS methotrexate methought methoxide meths methyl methylal methylamine methylase methylate/DN methylator methylcholanthrene methylcyclohexane methyldopa methylene methylic methylnaphthalene methylphenidate methylphthalate methylthionine metic meticulosity meticulous/PY metier metis metoestrus metonic metonym metonymic metonymical/Y metonymy metope metopic metopon metrazol metre/DGMS metric/MS metrical/Y metricate metrication metricise/DGS metricize/DGS metrify metrist metritis metro/S metrological/Y metrologist metrology metronidazole metronome/S metronomic metronomical/Y metronymic metropolis metropolitan metropolitanisation metropolitanise/S metropolitanization metropolitanize/S metrorrhagia mettle/DS mettlesome metz meu meung meuse mew/DS mewl mezcal mezcaline mezereon mezereum mezuza mezuzah mezzanine/S mezzo/S mezzotint mho miaou miaow/DGS miasma miasmal miasmatic miasmic miaul mica micaceous micawber mice micellar micelle/MS michelozzo mick mickery mickiewicz mickle micra micro/S microamp microampere/S microanalysis microanalyst microanalytic microanalytical microanatomical microanatomy microbalance/S microbarograph microbarographs microbe/MS microbeless microbial microbic microbicidal microbicide microbiologic microbiological/Y microbiologist microbiology microbody/S microbrailler microbus microcalorimetric microcephalic microcephaly microchemistry microchip/S microcircuit/S microcircuitry microcirculation microcirculatory microclimate/S microclimatic microclimatological microclimatologist microclimatology microcline/S micrococcal micrococcus microcode/DGS microcomputer/MS microconcrete microconsumer microcontroller microcopy/R microcosm microcosmic microcosmically microcrack/DGS microcrystal microcrystaline microcrystalinity microcrystalline microcrystallinity microcyte microcytic microdensitometer/MS microdensitometric microdensitometry microdetector microdissection microdomain/S microdont microdot microeconomic microeconomics microelectrode microelectronic/S microelectronically microelectrophoresis microelectrophoretic microelectrophoretical/Y microelement microencapsulate/N microenvironment microenvironmental microevolution microevolutionary microfabric microfarad/S microfauna microfaunal microfibril microfibrillar microfiche/S microfilaria microfilarial microfilm/DMRS microfine microflash microflora microfloral microform microfossil microfossils microfungal microfungus microgamete microgametocyte microgel microgram/MS microgramme/MS micrograph/RZ micrographs micrography microgroove microhabitat microhardness microinch microinjection microinstruction/MS microjoule microkink/G microlevel microliter/MS microlith microlithic microlitre/MS micromania micromanipulation micromanipulator micromere micrometeorite micrometeorites micrometeoritic micrometeoroid micrometeorological micrometeorologist micrometeorology micrometer/MS micromethod micrometre/MS micrometric micrometry micromicrofarad/S micromicron micromillimeter/MS micromillimetre/MS microminiature microminiaturisation microminiaturise/DGRSZ microminiaturization microminiaturize/DGRSZ micromixing micron/S micronisation/MS micronise/S micronization/MS micronize/S micronuclear micronucleate micronucleus micronutrient/S microorganic microorganism/S micropalaeontology micropaleontologic micropaleontological micropaleontologist micropaleontology microparasite/S microparasitic microphage microphone/GS microphonic/S microphotograph/R microphotographic microphotography microphotometer/MS microphotometric microphotometrically microphotometry microphyll microphyllous microphysical/Y microphysics microphyte micropipet micropipette microplankton micropolarisation/MS micropolarization/MS micropore microporosity microporous microprint microprobe microprocessing microprocessor/MS microprogram/MS microprogrammable microprogrammed microprogramming microprojection microprojector micropulsation micropump micropylar micropyle micropyrometer microradiograph microradiographic microradiography microreader microrelief microreproduction microscale microscope/MS microscopic microscopical/Y microscopise/S microscopist microscopize/S microscopy microsecond/MS microsection microseism microseismic microseismicity microsimulation/S microsomal microsome/S microspectrophotometer/MS microspectrophotometric microspectrophotometrical/Y microspectrophotometry microsphere microspheric microsporangium microspore microsporic microsporophyll microstate microstomatous microstore microstructural/Y microstructure/S microsurgery microsurgical microswitch/S microsystem/S microtechnic microtechnique microtherm microtome/S microtomy microtonal/Y microtonality microtone/S microtubular microtubule/S microvolt/S microwatt/S microwave/MS microword/S microwriter/S micrurgy micturate/DGS micturition/S mid midafternoon midair midas midband midbrain midcapacity midcourse midday midden/S middle/DGJRS middlebreaker middlebrow/S middlebrowism middleman middlemen middlemost middleweight/S middling/SY middorsal middy/S mideast midfield/R midge/S midget midgut midheaven midi midian midinette midiron midland/RS midlife midline midlothian midmorn/G midmost midnight/SY midplane midpoint/MS midportion midrange midrash midrashic midrashim midrib midribbed midriff/S midscale midsection midsemester midship/S midshipman midshipmen midsole midspan midst/S midstream midsummer midsummery midterm/MS midtown midwatch/S midway/S midweek/Y midwife/DG midwifery midwing midwinter/Y midwintry midwived midwives midwiving midyear mien/S mieres miff/DGS miffy mig/S might/S mightily mightless mighty/PRT mignon mignonette migraine/S migrainous migrancy migrant/MS migrate/DGNSVX migratetic/S migrational migrationist/S migrator migratorial migratory/S mihrab mikado mike mikhail mikoyan mil mila milacre milady milage milanese milazzo milch mild/NPRTY mildew/S mildewcide mildewproof mildewy mildhearted mildish mile/MRS mileage/S mileometer milepost milesian milestone/MS miletus milfoil/S milia miliaria/S miliarial miliary milieu/S milieux milinch militance/S militancy/S militant/PSY militarily militarisation/S militarise/DGS militarism/S militarist militaristic militaristically militarization/S militarize/DGS military/S militaryism/S militate/DGS militia/S militiaman militiamen milium milk/DGRSZ milkfish milkhouse milkily milkless milklike milkmaid/MS milkman milkmen milksop milksopping milksoppy milkstone milkweed milkwort milky/PR mill/DGRSZ millable millage millais millboard millcourse milldam millefleurs millenarian millenarianism millenary/S millenia millennia millennial millennialism millennium millepede millepore millerite millesimal/Y millet millhouse milli milliammeter/MS milliamp milliampere/S milliard milliary millibar millibarn millicron millicurie millicycle millidarcy millidegree/S millieme/S milliequivalent millifarad milligal milligan milligram/MS milligramme/MS millihenry millihertz millihg millijoule/S millilambert milliliter/MS millilitre/MS millilux millime millimeter/MS millimetre/MS millimetric millimicrofarad/S millimicron millimicrosecond millimolar millimolarity millimole milline/R milliners millinery million/DHS millionaire/MS millionairedom millionairess millionary millionfold millionise/S millionize/S millipede/MS milliphot millipoise millirad milliroentgen millisecond/S millivolt/S millivoltmeter/MS milliwatt/S millman millmen millowner millpond/S millrace/S millrun millsite millstone/MS millstream/S millwheel/S millwork millwright/S milne milo milometer/S milord milquetoast/S milreis milt/R miltiades mim mimas mime/GR mimeograph/DGS mimesis mimetic mimetically mimetism mimetite mimic/S mimical mimicked mimicking mimicry mimir mimosa mimosaceous min minable minacious minaret/DS minas minatory mince/DGRSZ mincemeat minch mincing/Y mincy mind/ADGRSZ minded/P mindful/PY mindless/PY mindoro mindszenty mine/DGNRSXZ mineable minefield minelayer mineral/MS mineralisable/S mineralisation/AMS mineralise/GRSZ mineralised/U mineralises/A mineralizable/MS mineralization/AMS mineralize/GRSZ mineralized/U mineralizes/A mineralocorticoid mineralogical mineralogist/S mineralogy/MS minestrone minesweeper/S minesweeping mineworker/S minge mingle/DGS mingus mingy minho mini/S miniature/DGMS miniaturisation/S miniaturise/DGS miniaturist/S miniaturistic miniaturization/S miniaturize/DGS minibike minibus/S minicab/S minicam minicamera minicar minicartridge minicomputer/MS minidress/S minify/DGS minikin minim minima minimal/Y minimalism minimalist/MS minimax minimisation/MS minimise/DGRSZ minimised/U minimization/MS minimize/DGRSZ minimized/U minimum/S minimus minipill miniscule miniskirt minister/DGMS ministerial/Y ministerialist ministerium ministrable ministrant ministration ministrations ministry/MS minitab minitrack minium miniver minivet mink/MS minna minnesinger minnow/MS minor/DGMS minority/MS minot minous minster minstrel/MS minstrelsy mint/DGRS mintage mintoff minuend/S minuet minus/S minuscular minuscule minute/DGPRSTY minuteman minutemen minutia minutiae minutial minx/S miocrystaline miocrystalline miombo mioses miosis miotic mirabeau mirabilite miracidium miracle/MS miracular miraculise/DGS miraculism/S miraculist/S miraculize/DGS miraculous/PY mirador miraflores mirage/DGS mirate/DGNSX mire/DGS mirepoix mirk mirky mirror/DGS mirrorise/S mirrorize/S mirrorlike mirrory mirth mirthful/PY mirthless/PY mirths miry mirza misaddress/D misadjustment misadventure/DS misadventurous misadvise misaim misalign/DGS misalignment/MS misalliance misallocate/DGNS misally misalphabetise/S misalphabetize/S misandry misanthrope misanthropic misanthropically misanthropise/DGS misanthropism misanthropist/S misanthropize/DGS misanthropy misapply/DGNRS misapplys misappreciate/N misapprehend/DGS misapprehending/Y misapprehension/S misapprehensive/PY misappropriate/NS misarranged misarrangement misarray misascription misassignment misattribution misauthorisation/MS misauthorise/S misauthorization/MS misauthorize/S misbaptise/S misbaptize/S misbecome/G misbeget misbegotten misbehadden misbehave/DRS misbehaving misbehavior/MS misbehaviour/MS misbeholden misbelief misbelieve/GR misbelieving/Y misbeseem misbestow misbirth misbrand/DGS misc miscalculate/GS miscalculated miscalculation/MS miscalculator miscall/R miscanonise/S miscanonize/S miscarriage/S miscarry/DGS miscarrys miscast/GS miscegenation/S miscegenational miscellanea miscellaneity miscellaneous/PY miscellanist/S miscellany/S mischance mischaracterisation/MS mischaracterise/S mischaracterization/MS mischaracterize/S mischief mischiefful mischievous/PY miscibility miscible misclassification misclassified misclassify/X misclassifying miscode/DGS miscolor/DGMS miscolour/DGMS miscommunicate/DNS miscomprehend miscomprehension misconceit misconceive/DGRS misconception/MS misconduct/DGS misconstruction/S misconstrue/DGS miscontent miscontentment miscook miscopy miscorrect/D miscounsel/D miscount/DGS miscreance/S miscreant/S miscreate/NV miscreator miscue/MS misdate misdeal/G misdeclared misdeed/S misdeem/S misdefined misdeliver/D misdelivery misdemean misdemeanant/S misdemeanor/MS misdemeanour/MS misdescribe misdescription misdescriptive misdirect/DS misdirection misdirector/S misdo/GR misdoubt mise miseducated miseducation misemphases misemphasis misemphasise/S misemphasization misemphasize/DGS misemploy misemployment misendeavor/MS misendeavour/MS miseno miser/SY miserable/P miserably misericord misericorde miserly/P misery/MS mises misesteem misestimate/N misfeasance misfeasor misfeature misfeed misfile/DGS misfire/DGS misfit/MS misfortune/MS misgauge/DGS misgive/S misgiving/SY misgovern misgovernment misguidance misguide/DGRS misguided/PY mishandle/DGS mishap/MS mishear mishmash misidentify/DGNS misimpression misimprove misinform/DGS misinformation misinformative misintelligence misinterpret/DGRSZ misinterpretable misinterpretation/S misjoinder misjudge/DGS misjudgement misjudging/Y misjudgment/MS misknow/S misknowledge miskolc mislabel mislabeled mislabeling mislabelled mislabelling mislabor/DGMS mislabour/DGMS mislaid mislay/GS mislead/GJRS misleading/SY misleared misled mislike mismachine mismanage/DGS mismanagement mismarriage mismatch/DGS mismate misname/DGS misnomer/D misogamic misogamist/S misogamy misogynic misogynist/MS misogynistic misogyny misologist misology misoneism misorder misorganisation/MS misorganise/S misorganization/MS misorganize/S misperceive/DS misperception/S misplace/DGS misplacement/S misplay misplead mispleading mispoint misposition/DGS mispraise misprint misprise/DGS misprision/S misprize/DGS mispronounce/DGS mispronunciation mispunctuate/N misquotation misquote/S misquoted misread/GRS misrealise/S misrealize/S misreckon misrecognise/S misrecognize/S misrecollect misrecollection misregister misregistration misrelated misremember misreport misreporting misrepresent/DGRS misrepresentation/MS misrepresentative misroute/DS misrouteing misrouting misrule/DGRS miss/DGSV missal/S missel missend misshape/S misshapen/PY misshapenness/S missile/MS missileer/S missileman missilemen missilery missilry mission/DGRS missionarise/S missionarize/S missionary/MS missionate missionisation missionise/DGRSZ missionization missionize/DGRSZ missions/A missis mississauga mississipi missive/S missolonghi missort missout misspeak misspecification misspecified misspell/DGJS misspelt misspend/DGRS misstate/DGRS misstatement/S misstep misstrike missus mist/DGRSZ mistakable/U mistake/GRS mistaken/Y mistaking/Y mistal mistassini mister/DGS misterm mistful misthink misti mistigris mistily mistime/D mistle mistletoe mistook mistrain mistral/S mistranslate/N mistreat/DGS mistreatment mistress/Y mistrial mistrust/DGRS mistrustful/PY misty/PRT mistype/DGS misunderstand/GJRSZ misunderstanding/MS misunderstood misusage misuse/DGRS misvalue misventure miswrite/GS miswritten mitch mite/S miter/DGR miterwort mither mithgarthr mithridate/S mithridatism miticide mitigate/DGNSVX mitigator/S mitigatory mitis mitochondria mitochondrion mitogenesis mitogenetic mitogenic mitoinhibitory mitosis mitotic mitotically mitrailleuse mitral mitre/DGR mitrewort mitt/DS mitten/MS mittimus mitzvah/MS mitzvahs mix/DGRSZ mixable mixed/AU mixologist/S mixology mixolydian mixture/MS mixup mizanthropise/S mizoram mizzen mizzenmast mizzle/DGS mizzly ml mlea mm mnemonic/MS mnemonically moa moab moan/DGS moanful/Y moat/MS mob/MS mobbed mobbing mobbish/PY mobbism mobcap/S mobile/S mobilisable/S mobilisation/AMS mobilise/DGRS mobilises/A mobility mobilizable/MS mobilization/AMS mobilize/DGRS mobilizes/A mobocracy mobocrat mobocratic mobster/S mobutu moccasin/MS mocha mock/DGRSZ mockernut mockery mocking/Y mockingbird mockup/S mod/S modal/Y modalise/S modality/MS modalize/S mode/ST model/MS modeled/A modeler/S modeling/S modelled/A modeller modeller/S modelling/S models/A modem/S modena moderate/DGNPSXY moderated/U moderationist moderatism moderato moderator/MS moderatorship modern/PSY moderne modernisable/S modernisation/MS modernise/DGRSZ modernised/U modernises/U modernism modernist modernistic modernists modernity modernizable/MS modernization/MS modernize/DGRSZ modernized/U modernizes/U modest/Y modesty modge modicity modicum modifiability modifiable/P modificative modified/U modify/DGNRSXZ modigliani modillion modish/PY modiste modulability modular/Y modularisation modularise/DGS modularity/S modularization modularize/DGS modulate/DGNSX modulator/AMS modulatory module/MS moduli modulo modulus modus mofette mog/N mogador mogul mohair mohm moho mohole mohs mohur moidore moiety/S moil/GR moiling/Y moirai moire moist/NPY moisten/DGR moisture/S moistureless moisturisation moisturise/DGRSZ moisturization moisturize/DGRSZ moke mokha mokpo molal molality molar/S molarisation/S molarity molarization/S molasses mold/DGRSZ moldable moldboard molder/DGS molding/A moldy/PR mole/ST molecular/Y molecularity molecule/MS molehill moleskin/S molest/DGRSZ molestation/S molested/U molina molise moll mollah mollescent mollie mollify/DGNSX mollusc/S molluscan molluscoid mollusk/S molluskan mollweide mollycoddle/DGRS molopo molotov molt/RS molten moltke molto molucca moly molybdate molybdenite molybdenous molybdenum molybdic molybdous mom/MS mombasa moment/MSY momenta momental momentaneous momentarily momentary/P momentous/PY momentum/S momism momma mommy monachal monachism monacid monad/S monadelphous monadic monadism monadnock monaghan monal monandrous monandry monanthous monarch monarchal monarchial monarchic monarchical/Y monarchise/RSZ monarchism monarchist/S monarchistic monarchize/RSZ monarchs monarchy/MS monas monasterial monastery/MS monastic monastical/Y monasticise/S monasticism monasticize/S monatomic monaural/Y monaxial monazite monck monde mondrian monecious monel moneme moner monestrous monet monetarily monetarism monetarist monetary monetisation/A monetise/ADGS monetization/A monetize/ADGS money/DMRS moneybags moneychanger moneylender moneylenders moneylending moneyless moneymake/R moneymaking moneywort mong monger/DGS mongolism mongoloid mongoose/S mongrel/PY mongrelisation/S mongrelise/DGRS mongrelism mongrelization/S mongrelize/DGRS monic monicker monied monies moniker monilia moniliform monish monism monist monistic monistical monition/S monitor/DGS monitorial/Y monitorship monitory monitress monk/MS monkery/S monkey/DGS monkeyflower monkeypot monkeyshine monkfish monkhood monkish monkshood monnet mono/M monoacid monoacidic monoamine monoatomic monobasic monocarp monocarpellary monocarpic monocausal monochasial monochasium monochloride monochloroethanol monochord monochordise/S monochordize/S monochromat monochromatic monochromatically monochromaticity monochromatism monochromator monochrome/S monochromic monochromist monocle/DS monocline monoclinic monoclinous monocoque monocracy monocrat monocratic monocular/Y monocultural monoculture monocycle monocyclic monocycly monocyte monocytic monodisperse monodispersity monodist monodrama monodramatic monody monoecious/Y monoecism monoenergetic monoester monofilament monofuel monogamic monogamist/S monogamous/PY monogamy monogastric monogenean monogenesis monogenetic monogenic monogenically monogerm monogram/MS monogrammatic monograph/MS monographic monographical monographs monography monogynous monogyny monohull monohybrid monohydrate monohydric monohydroxy monoicous monoid monolatry monolayer monolingual/S monolingualism monolith monolithic monolithically monoliths monologise/DGS monologist/S monologize/DGS monologue/S monologuist monomania monomaniac monomark monomer/MS monomeric monomerous monometalism monometalist monometallic monometallism monometallist monometer/MS monomial monomolecular/Y monomorphemic monomorphic monomorphism monomorphous mononuclear mononucleosis monopetalous monophagous monophobia monophonic monophonically monophony monophthong monophthongal monophyletic monophyletism monophyllous monoplane monoplegia monoploid monopode monopodial/Y monopodium monopolisable/S monopolisation/MS monopolise/DGRSZ monopolised/U monopolises/U monopolist monopolistic monopolistically monopolists monopolizable/MS monopolization/MS monopolize/DGRSZ monopolized/U monopolizes/U monopoly/MS monopropellant monopsony monopteros monopulse monorail/MS monosaccharide/S monosemy monosepalous monosized monosodium monosome monosomic monospermous monostat monostatic monostich monostichous monostome monostrophe monostylous monosyllabic monosyllabically monosyllabicity monosyllable/S monosymmetric monosymmetry monosynaptic monosynaptically monotheism monotheist monotheistic monotheistical/Y monothetic monotint monotone monotonic monotonically monotonicity monotonise/S monotonize/S monotonous/PY monotony monotower monotrematous monotreme monotrichous monotropism monotype monotypic monovalent monovular monoxide monozygotic mons monsieur monsignor monsoon/S monsoonal monster/MS monstrance/S monstrosity/S monstrous/PY montage/DGS montagnard montagu montagues montaigne montale montane montauban montbretia montcalm monte montefiore montego monteith montenegro montero monterrey montesquieu montessori montfort montgolfier month/MY montherlant monthly/S months monticule montmorillonite montparnasse montpellier montreuil montreux montrose monument/MS monumental/Y monumentalisation/MS monumentalise/DGS monumentality monumentalization/MS monumentalize/DGS monumentless monza monzonite moo/DS mooch/GRS mood/MS moodily moody/PR moog moola moolah moolvie moon/DGS moonbeam/MS moonbow mooncalf mooneye moonfish moonflower moonish/Y moonless moonlet moonlight/DGRS moonlit moonquake moonraker moonrise moonscape moonseed moonset moonshine/R moonshot moonstone moonstruck moonward moonwort moony moor/DGJMS moorage moorfowl moorhen moorwort moose moot/D mop/S mopboard mope/DGRS mopoke mopped mopper moppet mopping moquette mor/S mora/A moraceous morainal moraine morainic moral/MSY morale/S moralisation/MS moralise/DGRSZ moralising/Y moralisingly/S moralism moralist moralistic moralistically morality/S moralization/MS moralize/DGRSZ moralizing/Y moralizingly/S morar morass/S morassy moratorium/S morava moray morbid/PY morbidise/S morbidity morbidize/S morbific morbihan morbilli morcha mordacious/Y mordacity mordancy mordant/Y mordecai mordent mordred more/DNS morea moreau morecambe moreen morehouse moreish morel morelia morello morelos moreover morepork moresco moresque morganatic morganatically morganite morgen morgue/S moribund moribundity morish morn/GJ mornay morocco moron moroni moronic moronically moronism moronity morose/PY morosity morph morphallaxis morpheme morphemic morphine/S morphinic morphinisation/MS morphinise/S morphinism morphinization/MS morphinize/S morphism/MS morpho morphogenesis morphologic morphological/Y morphology morphophoneme morphophonemic/S morphosis morphotype/S morphy morris morro morrow morsel/MS morseled morseling morselisation/MS morselise/S morselization/MS morselize/S morselled morselling mort mortal/SY mortalise/S mortality mortalize/S mortar/DGS mortarboard mortarise/S mortarize/S mortem mortgage/DGMRS mortgagee/S mortgagor/S mortician/S mortified/Y mortify/DGNRSX mortimer mortise/G mortmain mortuary/MS morula morwong mos mosaic/MS mosaically mosaicism mosaicist mosasaur moschatel moscone moseley mosey/DG moshav moshesh moskva mosley mosotho mosque/S mosquito/S mosquitoes mosquitoey moss/MS mossback/D mossbunker mossie mosslike mosso mosstrooper mossy/R most/Y mot/S mote motel/MS motet moth/RZ mothball mother/DGMRSYZ motherboard/MS motherfucker motherhood motherhouse motherland motherless/P motherly/P motherwell motherwort mothproof/R moths mothy motif/MS motile motility motion/DGRS motional motionless/PY motivate/DGNSVX motivated/U motivational/Y motivator motive/DGS motivic motivity motley motmot motocross motoneuron motor/DGS motorable motorbicycle motorbike motorboat/GR motorbus motorcade/MS motorcar/MS motorcoach motorcycle/MS motorcyclist motordrome motoric motorically motorisation/MS motorise/DGS motorised/U motorist/MS motorization/MS motorize/DGS motorized/U motorless motorman motormen motortruck motorway motown motte mottle/DGRS motto/S mottoes motu mouflon moujik moulage mould/DGRS mouldboard moulder/G moulds/A mouldy moulin/S moulmein moult mound/DS mount/DGJRS mountable mountain/MS mountaineer/GS mountainous/PY mountainside/S mountaintop/MS mountainy mountebank mountebankery mounted/U mourn/DGRSZ mournful/PY mourning/Y mouse/GRS mousebird mousetail mousetrap mousey mousily moussaka mousse mousseline moustache/DS mousy/PR mouth/DGRS mouthbrooder mouthful mouthlike mouthpart mouthpiece/S mouths mouthwash mouthwatering mouthy/R movability/A movable/AP movably/A move/DGJRSZ moved/AU moveless/PY movement/MS movie/MS moviedom moviegoer moviemaker movietone moving/SY moviola mow/DGRSZ mowburnt mown moxa moxie mozzarella mu much/P muciferous mucilage mucilaginous/Y mucin muck/DGRS muckamuck muckle muckrake/GR mucksweat muckworm mucky mucoid mucopolysaccharide mucoprotein mucopurulent mucosa mucous mucro mucronate mucus mud/S mudcat mudded muddily mudding muddle/DGRSZ muddlehead/DS muddleheaded/P muddy/DGPR mudfish mudguard mudhole/MS mudir mudlark mudpack mudra mudsill mudskipper/S mudsling/GRZ mudstone/S muenster muesli muezzin muff/MS muffin/MS muffle/DGRSZ mufti/S mufulira mug/MS mugabe mugged mugger muggers muggily mugging/S muggins muggy/PR mugho mugwort mugwump muhammad muhammadan mujik mukluk mulatto/S mulattoes mulberry/MS mulch/DGS mulct muldoon mule/GMS muleta muleteer muley mulga mulhouse muliebrity mulish/PY mulki mull/GNR mullah mullein mullet/S mulley mulligan mulligatawny mulliken mullion mullite mullock mulloway multan multangular multeity multi multiaperture multicavity multicellular multicellularity multichannel multichip multicide multicollector multicollinearity multicolor/DMS multicolour/DMS multicolumn multicompletion multicomponent multicomputer/MS multicoupler multicycle multideck multidimensional multidimensionality multidisciplinary multidrop multielectrode multiengine multifaceted multifactorial multifactrially multifarious/PY multifibered/MS multifibred/MS multifid multifigure multifile multiflora multifoil multifold multifoliate multiform multiformity multifunctioned multigravida multihop multihued multihull/S multikey/S multilane/D multilateral/Y multilateralist/S multilayer/DS multilevel multileveled multilevelled multilingual/Y multilingualism multilingualist multimedia multimegaton multimembered multimeter/MS multimillionaire multinational multinomial multinuclear multinucleate/D multipacket multipactor multipara multiparous multipartite multiped multiphase multiphasic multiphastic multiplane multiple/MS multiplepoinding multiplet/S multiplex/DGRSZ multiplexor/MS multipliable multiplicable multiplicand/MS multiplicate/S multiplicative/SY multiplicity multiply/DGNRSXZ multipolar multipolarity multiprocess/G multiprocessor/MS multiprogram multiprogrammed multiprogramming/S multipronged multipunch/D multipurpose multiracial multiracialism multireel multirole multiscreen multisectoral multisegment multispectral multistage multistatic multistorey multistory multisubject multisyllabic multitasking multitude/MS multitudinous/PY multiuser multivalence multivalent multivalued multivariable multivariate multiversity multivibrator multivocal multivolume/D multiway multiword multure mum mumble/DGJRSZ mumbo mumchance mummer mummery mummify/DNX mumming mummy/MS mump/RS munch/DGRS mundane/PY mundt mung munga munge/DGJRSZ mungo municipal/Y municipalisation/MS municipalise/DGRSZ municipality/MS municipalization/MS municipalize/DGRSZ munificence munificent/Y muniment/S munist munition/S munnion munro munroe munsell munster munt muntin muntjac muntz muon muonic murage mural/S muralist murasaki murat murcia murder/DGRSZ murderee murderess murderous/PY mure murex muriate muriatic muricate murine murk murkily murky/PR murman murmur/DGRS murmuring/U murmurous/Y murra murrain murre murrelet murrey murrhine murrow murrumbidgee murther musaceous muscadel muscadine muscae muscarine muscatel muscid muscle/DGS muscleman musclemen muscly muscovado muscovite/S muscular/Y muscularise/S muscularity muscularize/S musculature musculoskeletal muse/DGJRS musee museology musette/S museum/MS museumise/S museumize/S mush/R mushily mushroom/DGS mushy/PR music/S musical/SY musicale musicalisation/MS musicalise/S musicality musicalization/MS musicalize/S musician/SY musicianship musicological musicologist musicologists musicology musil musing/SY musjid musk/S muskeg muskellunge musket/MS musketeer musketry muskie/RS muskmelon muskox/N muskrat/MS musky/PRS muslin muso musquash muss/DGS mussel/MS musset mussily mussy/PR must've must/S mustache/DS mustachio/DS mustafa mustang/S mustard/S mustee musteline muster/DGS musth mustily mustn't musty/PR mutability mutable/P mutably mutafacient mutagen mutagenesis mutagenic mutagenically mutagenicity mutandis mutant/S mutase mutate/DGNSVX mutational/Y mutatis mutator/S mutch mutchkin mute/DGPRSTY muted/Y muticous mutilate/DGNSX mutilator mutine/DG mutineer mutinous/PY mutiny/MS mutism mutsuhito mutt mutter/DGRSZ mutton muttonchops muttonhead muttony muttra mutual/Y mutualisation/MS mutualise/DGS mutualism mutualist mutualistic mutuality mutualization/MS mutualize/DGS mutuel mutule muumuu muzorewa muzz muzzily muzzle/DGMRS muzzy/PR my/S myalgia myalism myall myasthenia mycelium mycetoma mycetozoan mycin mycobacteria mycology mycoplasma mycorrhiza mycosis mycostatin mycotic mydriasis mydriatic myel myelencephalon myelin myeline myelinisation/MS myelinization/MS myelitis myeloid myeloma myers myiasis mylar mylonite myna mynah myocardial myocardiograph myocarditis myocardium myofibril myogenic myoglobin myograph myology myoma myope myopia myopic myopically myosin myosotis myotic myotome myotonia myriad myriameter/MS myriapod myriopod myristate myrmecological myrmecology myrmecophagous myrmecophile myrobalan myrrh myrtaceous myrtle myself mysia mystagogue mystagogy mysterious/PY mystery/MS mystic/MS mystical/Y mysticise/SU mysticism/S mysticize/SU mystify/DGNRS mystifying/Y mystique myth/MS mythic mythical/Y mythicisation mythicise/DGRSZ mythicization mythicize/DGRSZ mythise/S mythize/S mythmaker mythmaking mythographer/S mythography mythologer mythologic mythological/Y mythologisation mythologise/DGRS mythologist mythologization mythologize/DGRS mythology/MS mythomania mythomaniac mythopoeia mythopoeic mythopoetic mythopoetical mythos myths mytilene myxoedema myxoma myxomatosis myxomycete myxovirus mzee mzungu n's nab nabbed nabbing nabis nabla/S nablus nabob naboth nacelle nacre nacreous nadir nae naevus nag/MS nagged nagger nagging/Y nagor naha naiad nail/DGRS nailbrush nailfile nailhead nainsook naira nairn naissant naive/PRY naivete naivety nakamura naked/PY nakedise/S nakedize/S naker nakhichevan nakoma nakuru nalchik nalgo namable namangan namas name/DGMRSYZ nameable/U named/AU nameless/PY namelist/S namen nameplate/S namesake/MS nametape namhoi namur nanak nanchang nanda nanga nankeen nanning nanny/S nanogram/S nanogramme/S nanometer/S nanometre/S nanometric nanook nanoplankton nanosecond/S nanterre nantes nantung nap/MS napalm nape/S napery naphtali naphtha naphthalene naphthalenic naphthene naphthenic naphthol naphthyl napiform napkin/MS napless nappa napped napper napping nappy/RS nara narbada narc narceine narcism narcissi narcissism narcissist narcissistic narcissus/S narcist narcoanalysis narcolepsy narcoleptic narcos narcosis narcosynthesis narcotic/S narcotically narcotisation narcotise/DG narcotises narcotism narcotization narcotize/DG narcotizes nardoo nares narial nark narmada narrate/DGNSX narrational narrative/MSY narrator/S narrow/DGPRSTY narrowing/P narrowminded narthex narva narvik narwal narwhal/MS nary nasal/Y nasalisation/MS nasalise/GS nasalised nasality nasalization/MS nasalize/GS nasalized nascence/A nascency nascent/A naseberry naseby nashe nasho nasion nasofrontal nasopharynx nasser nastase nastic nastily nasturtium nasty/PRST natal natalist natality natant natation/S natatorial natatorium natatory natch nate/S natheless nation/MS national/SY nationalisation/MS nationalise/DGRSZ nationalised/AU nationalises/A nationalism/S nationalist/MS nationalistic nationalistically nationality/MS nationalization/MS nationalize/DGRSZ nationalized/U nationhood nationwide native/PSY nativism nativist nativistic nativity natrium natrolite natron natsopa natter natterjack nattily natty/PR natural/PSY naturalisation/MS naturalise/GRSZ naturalised/U naturalises/U naturalism naturalist naturalistic naturalistically naturalization/MS naturalize/GRSZ naturalized/U naturalizes/U naturam nature/DMS natured/A natures/A naturise/S naturism naturize/S naturopath naturopathy nauch naucratis naught/MS naughtily naughty/PR naumachia nauplius naur nausea/S nauseant nauseate/DGS nauseating/Y nauseous/PY nauseum naut nautch nautical/Y nautiloid nautilus navaho naval/Y navar navarin navarino navarre nave/S navel/S navew navicert navicular navigability navigable/P navigably navigate/DGNSX navigational/Y navigator/MS navona navratilova navtas navvy navy/MS naw nawab naxalite naxos nay naze nazify/DGNSX nd ndola neagh neap near/DGPRSTY nearby nearside nearsighted/PY neat/NPRSTY neath neb nebbish nebo nebuchadnezzar nebula nebulae nebular nebularisation/MS nebularise/S nebularization/MS nebularize/S nebulisation/S nebulise/DGRS nebulization/S nebulize/DGRS nebulosity nebulous/PY necessarily/U necessary/S necessitarian necessitarianism necessitate/DGNSX necessitous/PY necessity/S neck/DGRS neckar neckband neckcloth neckerchief necklace/MS neckline neckpiece necktie/MS neckwear necrobiosis necrolatry necrological necrologist/S necrology necromancer/S necromancy necromania necromantic necromantically necrophagia necrophagous necrophagy necrophilia necrophilic necrophilism necrophobia necropolis necropsy necrose necroses necrosis necrotic necrotise/DGS necrotize/DGS necrotomy nectar nectareous nectarine nectarise/S nectarize/S nectarous nectary/S neddy nee need/DGRSY needed/U needful/PY needle/DGRSZ needlecord needlecraft needlefish needleful needlelike needlepoint needless/PY needlewoman needlewomen needlework/R needn't needy/PR neep nefarious/PY nefertiti negate/DGNRSVX negated/U negational negative/DGPSY negativism/S negativist/S negativistic negativity negaton negator/S negatron negev neglect/DGRS neglectful/PY negligee/S negligence negligent/Y negligibility negligible negligibly negotiability negotiable/A negotiant negotiate/DGNSX negotiated/A negotiates/A negotiator/S negotiatory negresses negrillo negritude negroid negrophile negrophilism negropont negros neigh neighbor/DGJMRSYZ neighbored/U neighborer/MS neighborhood/MS neighborless/S neighborlike/MSU neighborly/PU neighborship/MS neighbour/DGJMRSYZ neighboured/U neighbourer/MS neighbourhood/MS neighbourless/S neighbourlike/MSU neighbourly/PU neighbourship/MS neisse neither nek nekton nelson neman nemathelminth nematic nematicidal nematicide nematocyst nematode/S nemea nemertean nemery nemeses nemesis nemophila nene neo neoanthropic neoarsphenamine neoclassic neoclassical neoclassicism neoclassicist neocolonialism neoconservative neocortex neocosmic neodymium neofascism neogenesis neogenetic neoglycolipid/S neoimpressionism neoliberalism neolith neolithic neological neologisation neologise/DGS neologism/MS neologistic neologization neologize/DGS neology neomycin neon/D neonatal/Y neonate neoorthodox neoorthodoxy neophyte/S neoplasia neoplasm neoplasms neoplastic neoplasticism neoplasticist/S neoplasty neoprene neoscholasticism neostigmine neotenic neoteny neoteric neotype nepenthe nepenthean neper nephanalysis nepheline nephelinic nephelinite nephelinitic nephelite nephelometer/MS nephelometric nephelometry nephew/MS nephogram nephograph nephology nephometer/MS nephoscope nephralgia nephrectomy nephridium nephrite nephritic nephritis nephron nephrosis nephrotomy nepos nepotism nepotist/S nepotistic neptunium neral nereid nereus neritic nernst neroli neruda nerva nerval nervate nervation/S nerve/DGMS nerveless/PY nervine nervosity nervous/PY nervure nervy/PR nescience/S nescient nesh nesselrode nessus nest/DGRS nestle/DGRS nestorius net/MS netaji netball nether nethermost netherworld netkeeper netless netlike neto netsuke nett netted netter netting nettle/DGS nettlesome netty network/DGMS neumatic neume neural/Y neuralgia neuralgic neurasthenia neurasthenic neurectomy neurilemma neuritic neuritis neuro neuroanatomic neuroanatomy neuroanotomy neurobiology/M neuroblast neuroblastoma neurochemistry neurocirculatory neurocoele neuroendocrine neuroepithelial neurofibril neurofibrillary neurogenic neurogenically neuroglia neuroglial neurogram neurohypophysis neurolemma neurological/Y neurologist neurologists neurology neuroma neuromuscular neuron/MS neuronal neuronic neuropath neuropathic neuropathically neuropathology neuropathy neurophysiology neuropsychiatric neuropsychiatry neuropteran neuropterous neuroses neurosis neurospora neurosurgeon neurosurgery neurosurgical neurotic neurotically neuroticise/S neuroticism neuroticize/S neurotomy neurotoxic neurotoxicity neurotoxin neurotransmitter/S neurotropic neurovascular neusatz neuss neustria neuter/DGJRSZ neutercane neutral/PSY neutralisation/MS neutralise/DGRSZ neutralised/U neutralism neutralist/S neutralistic neutrality/S neutralization/MS neutralize/DGRSZ neutralized/U neutretto neutrino/MS neutron/S neutronium neutrophil/S neutrophile neutrophilic neutrophilis neve/Z never nevermore nevertheless nevus new/PRSTY newborn/S newbury newcomer/MS newel newfangled/P newfound newfoundland newish newline/MS newlywed/S newsagent/S newsboy/S newsbreak newscast/GRSZ newsgroup/MS newshawk newsless newsletter/MS newsmagazine newsman newsmen newsmonger newspaper/MS newspaperised/MS newspaperized/MS newspaperman newspapermen newspeak newsprint newsreel newsroom newsstand newswire newsworthy/P newsy/PR newt/S newton next nexus/S ney nez niacin nib/S nibble/DGRSZ nibelungenlied niblick niccolo nice/PRTY nicety/S niche/GS nichrome nick/DGRS nickel/MS nickeled nickelic nickeliferous nickeling nickelisation/MS nickelise/S nickelization/MS nickelize/S nickelled nickelling nickelodeon nickelous nicker/DG nicklaus nicknack nickname/DRS nicknameless nickpoint nicotinamide nicotine nicotinic nicotinise/S nicotinism nicotinize/S nictheroy nictitate/G nidaros niddering nide nidicolous nidification nidifugous nidify nidus niebuhr niece/MS niello niemen nietzschean nieve niff nifty/RS niggard/Y niggardly/P nigger niggle/DGRS niggling/Y nigh night/DMSYZ nightcap nightclothes nightclub/S nightclubber nightdress nightfall nightglow nightgown nighthawk nightie/S nightingale/MS nightingalise/S nightingalize/S nightlife nightlong nightmare/MS nightmarish/Y nightrider nightshade nightshirt nightside nightspot nightstand nightstick nighttide nighttime nightwalker nightwear nighty/S nigrescent nigrify nigritude nihilianism nihilism/S nihilist nihilistic nihilistically nihility nihon niigata nijinsky nil/Y nilgai nilgiri nill nilmanifold nilpotent nim nimble/PRT nimblewit nimbly nimbostratus nimbus/DS nimiety nimming nimonic nincompoop nincompoopery nine/S ninebark ninefold ninepin/S nineteen/HS ninety/HS ninetyfold ningsia ninny/S ninnyhammer ninth ninus niobic niobium niobous niort nip/S nipa nipigon nipped nipper/S nippily nipping/Y nipple/S nipplewort nippur nippy/PR nirvana nisei/S nishinomiya nisus nit nite niter nitid niton nitpick nitramine nitrate/DGNSX nitrator nitre nitric nitride/G nitridisation/MS nitridise/S nitridization/MS nitridize/S nitrify/NX nitrile nitrite nitro/S nitrobacteria nitrobenzene nitrocellulose nitrocellulosic nitrochloroform nitrofuran nitrogen nitrogenisation/MS nitrogenise/DGS nitrogenization/MS nitrogenize/DGS nitrogenous nitroglycerin nitroglycerine nitrohydrochloric nitrometer nitromethane nitroparaffin nitrosamine nitroso nitrosoamine nitrosyl nitrous nitty nitwit nitwitted nival nivation niven niveous nivernais nix/DGRS nixie nizhni njord nkomo nkrumah nm no/A nob nobble/DG nobbut nobby/R nobelium nobiliary nobility/S noble/PRST nobleman noblemen noblesse noblewoman nobly nobody/MS nocent noces nociceptive nock/G noctambulation noctambulism noctambulist noctilucent noctuid noctule nocturn nocturnal/Y nocturne nocuous/Y nod/MS nodal/Y nodality nodded nodder nodding noddle noddy/S node/MS nodi nodical nodose nodosity nodular nodulation nodule/S nodulise/S nodulize/S nodus noes noesis noetic nofretete nog noggin nogging noh nohow noil noise/DGS noiseless/Y noisemake/GRZ noisette noisily noisome/PY noisy/PR nolde nolle nolo noma nomad/S nomadic nomadisation/MS nomadise/DGS nomadism nomadization/MS nomadize/DGS nomarch nomarchy nombles nombril nome nomen nomenclator nomenclatorial nomenclatural nomenclature/S nomic nomina nominal/Y nominalise/GS nominalised nominalism nominalist nominalistic nominalize/GS nominalized nominate/DGNSVX nominated/A nominates/A nomination/MS nominative/Y nominator/S nominee/S nomism nomocracy nomogram/MS nomograph/R nomographic nomographically nomography/S nomological nomology nomothetic non nonacid nonacknowledgement/MS nonacknowledgment/MS nonactive nonadjacent nonage nonagenarian nonaggression nonagon nonagricultural nonaligned nonallelic nonanaesthetised nonanalytic nonanesthetized nonanoic nonapostatising/MS nonapostatizing/MS nonappearance nonbank nonblank/S nonblocking nonbook nonbusiness noncalcareous noncanonisation/MS noncanonization/MS noncarbohydrate noncartelised/MS noncartelized/MS noncatechisable/S noncatechizable/MS noncausal nonce nonchalance nonchalant/PY noncharitable noncivilised/MS noncivilized/MS noncoloring/MS noncolouring/MS noncom noncombatant noncommissioned noncommittal/Y noncompliance noncomputable nonconcurrence nonconcurrency noncondensing nonconducting nonconductor/S nonconfidence nonconform/GR nonconformable nonconformably nonconformance nonconformism nonconformist/S nonconformity nonconservative noncontiguous noncontributory noncooperation noncooperationist noncooperative noncooperator noncritical noncrossing noncrystallisable/S noncrystallised/MS noncrystallising/MS noncrystallizable/MS noncrystallized/MS noncrystallizing/MS noncurrent noncyclic nondecreasing nondeductibility nondeductible nondefense/MS nondeforming nondegenerate nondemobilisation/MS nondemobilization/MS nondemocratic nondescript/Y nondestructive nondestructively nondeterminacy nondeterminate/Y nondeterminism nondeterministic nondeterministically nondialysing/MS nondialyzing/MS nondimensionalise/D nondimensionalize/D nondirected nondirectional nondirective nondisclosure/S nondiscriminatory nondisjunction nondisjunctional nondispersive nondistinctive nondivided nondormant nondramatic nondrying nondurable none/S noneconomic noneconomist noneffective nonego nonelectrolyte nonemergency nonempty nonentity/S nonequivalence nonequivalent nonessential nonesuch nonet nonetheless noneuclidean nonevent nonexecutable nonexistence nonexistent nonextensible nonfat nonfavorite/MS nonfavourite/MS nonfeasance nonferrous nonfiction nonfictional nonfigurative nonflammable nonflowering nonfragmenting nonfulfillment/MS nonfulfilment/MS nonfunctional nong nongalvanised/MS nongalvanized/MS nongelatinising/MS nongelatinizing/MS nongovernment nongovernmental nonharmonic nonhierarchic nonhierarchical nonhuman nonhydrolysable/S nonhydrolyzable/MS nonidentical nonillion nonimmunised/MS nonimmunized/MS nonimpact nonimpinging noninductive noninteger noninteracting noninterference nonintersecting nonintervention noninterventionist nonintuitive noninvertible noninverting noninvolvement nonionic nonionised/MS nonionising/MS nonionized/MS nonionizing/MS nonjoinder nonjuring nonjuror nonlinear/Y nonlinearity/MS nonlinguist nonlinguistic nonliterary nonliterate nonloaded nonlocal nonlocalised/MS nonlocalized/MS nonmagical nonmagnetisable/S nonmagnetizable/MS nonmatching nonmetal nonmetallic nonmoral nonmultiple nonnegative nonnitrogenised/MS nonnitrogenized/MS nonnucleated nonnumeric nono nonobjective nonobjectivism nonobjectivist nonobjectivity nonobservance nonoccurrence nonogenarian nonorganisation/MS nonorganization/MS nonorthogonal nonorthogonality nonowner/S nonoxidisable/S nonoxidising/MS nonoxidizable/MS nonoxidizing/MS nonparallel nonparametric/S nonparametrical nonpareil nonparlor/MS nonparlour/MS nonparous nonparticipant nonparticipating nonparticipation nonpartisan nonpartisanship nonparty nonpast nonpaternity nonpathogenic nonpayment nonpenalised/MS nonpenalized/MS nonperishable nonpermanent nonpersonal nonperturbing nonphosphorised/MS nonphosphorized/MS nonplus/S nonpoisonous nonpolar nonpolarisable/S nonpolarised nonpolarising/MS nonpolarizable/MS nonpolarized nonpolarizing/MS nonpolitical nonporous nonpositive nonpossession nonpossessor nonprescription nonprint/G nonprocedural/Y nonproducer nonproductive/PY nonprofessional/Y nonprofit nonprofitable nonprogrammable nonprogrammer nonprogressive nonproliferation nonpros nonprossed nonprossing nonprotein nonracial nonrandom nonrationalised/MS nonrationalized/MS nonreactive nonreader nonrealisation/MS nonrealistic nonrealization/MS nonreclosing nonrecognised/MS nonrecognized/MS nonrecording nonrecursive/Y nonreducing nonredundant nonregulation nonreimbursable nonrelativistic nonrelevance nonrelevant nonreligious nonremovable nonrenewable nonrepresentational nonrepresentationalism nonrepresentative nonresidence nonresidency nonresident nonresidential nonresistance nonresistant nonrespondent/S nonresponse nonrestraint nonrestricted nonrestrictive nonretractable nonreturnable nonrigid nonscheduled nonschematised/MS nonschematized/MS nonscientific nonseasonal nonsecretor nonsectarian nonsegregated nonsegregation nonsense nonsensical/PY nonsensitised/MS nonsensitized/MS nonsequenced nonsignificant/Y nonsingular nonskid nonslip nonsmoker/S nonsocial nonspecialised/MS nonspecialist/MS nonspecialized/MS nonspecific nonsporting nonstandard nonstandardised/MS nonstandardized/MS nonstarter nonstative nonstick nonstop nonstriated nonstylised/MS nonstylized/MS nonsuch nonsuit nonsupervisory nonsupport nonsyllabic nonsympathiser/MS nonsympathizer/MS nonsynchronous nonsynthesised/MS nonsynthesized/MS nontechnical/Y nontemporal nontemporising/MS nontemporizing/MS nontenure nonterminal/MS nonterminating nontermination nontrivial nonuniform nonunion nonunionism nonuse/R nonutilised/MS nonutilized/MS nonverbal/Y nonveteran/S nonviable nonviolence nonviolent/Y nonvisualised/MS nonvisualized/MS nonvocal nonvolatile nonvolatilised/MS nonvolatilized/MS nonvolunteer/S nonvoter nonvoting nonvulcanisable/S nonvulcanizable/MS nonwhite nonworker nonzero noodle/DGS nook/MS noon/GS noonday noontide noontime noordbrabant noose/GS nopal nope nor noradrenalin noradrenaline nord nordau norepinephrine norge noria noricum norite nork norm/DMS normal/SY normalcy normalisable normalisation/MS normalise/DGRSZ normalised/AU normalises/AU normality normalizable normalization/MS normalize/DGRSZ normalized/AU normalizes/AU normative/PY normotensive norodom north/GMRZ northbound northeast/R northeaster/Y northeastern northeasternmost northeastward/S norther/SY northern/RYZ northernise/S northernize/S northernmost northland northmost norths northward/S northwest/R northwester/Y northwestern northwestward/S nose/DGS nosebag/MS noseband nosebleed/MS nosegay nosepiece nosey/G nosh/R nosily nosise nosize nosography nosologic nosological/Y nosology nostalgia nostalgic nostalgically nostology nostril/MS nostrum nosy/PR not/S note/DGNRSX nota notability notable/PS notably notarial/Y notarisation/S notarise/DGS notarius notarization/S notarize/DGS notary notate/DGSV notation/MS notational/Y notch/DGS note/DGNRSX notebook/MS notecase noted/PY noteless notelet notepaper noteworthily noteworthy/P nothing/PS nothingise/S nothingize/S notice/DGS noticeable noticeably noticeboard/S noticed/U notifiable notify/DGNRSXZ notional/Y notionality notitia notochord notocord notoriety notorious/PY notum notwithstanding nougat nought/S noumenon noun/MS nouncing nounise/S nounize/S nourish/DGRS nourished/U nourishment nous nouveau nouvelle nova/MS novaculite novae novalis novara novation novaya novel/MS novelese novelette novelettish novelisation/MS novelise/GRSZ novelised novelist/MS novelistic novelization/MS novelize/GRSZ novelized novella novelle novello novelty/MS novemdecillion novena novercal novice/MS novitiate/S novocaine now/S nowaday nowadays noway/S nowel nowhence nowhere/S nowhither nowise nowt nox noxious/PY noyade noyau noyes noyon nozzle/S nroff/M nth nu nuance/D nuances nub nubbin nubble/S nubbly nubecula nubians nubile nubility nucellar nucelli nucellus nucha nuchal nucleant nuclear nuclease nucleate/DN nucleator nuclei nucleic nuclein nucleocapsid nucleolar nucleoli nucleolus nucleon/MS nucleonic/S nucleophile nucleophilic nucleophilically nucleophilicity nucleoplasm nucleoplasmatic nucleoplasmic nucleoprotein nucleoside nucleosynthesis nucleotidase nucleotide/MS nucleus/S nuclide nuclidic nuddy nude/PRSTY nudge/DGRS nudibranch nudicaul nudism nudist/S nudity nudum nuevo nugatory nugent nuggar nugget/S nuggety nuisance/MS nuissance nuke nukus null/DS nullah nullarbor nullificationist nullifidian nullify/DGNRSZ nullipara nulliparous nullity numantia numb/DGPRSYZ numbat number/DGRS numberable numbered/AU numberless numberplate numbfish numbing/Y numbles numbskull numdah numen numerable numeral/MSY numerary numerate/DGNSX numerator/MS numeric/S numerical/Y numerological numerology numerous/PY numia numidia numinous numis numismatic/S numismatically numismatist nummary nummular nummulite numnah numskull nun/MS nunatak nunc nunciation nunciature nuncio nuncle nuncupate/NV nunes nunhood nunnery nunny nuovo nuptial/S nuptialise/S nuptiality nuptialize/S nureyev nuri nuristan nurmi nurse/DGMRS nursemaid nursery/MS nurserymaid nurseryman nursling nurtural nurturant nurture/DGRS nusa nut/MS nutant nutate/DGNS nutational nutbrown nutcase nutcrack/R nutgall nuthatch nuthouse nutlet nutlike nutmeg nutria nutrient/S nutriment nutrition/M nutritional/Y nutritionist/S nutritious/PY nutritive/Y nutshell nutted nutter nutting nutty/PR nutwood nux nuzzle/DGS nyala nyanza nyasa nyctaginaceous nyctalopia nyctinasty nyctitropism nyctophobia nye nyeman nyerere nylghau nylon/S nymph nympha nymphaeaceous nymphal nymphalid nymphet nymphette nympho nympholepsy nympholept nymphomania nymphomaniac/S nymphomaniacal nymphs nystagmic nystagmus nystatin nyx o'clock o'er o's oaf/S oafish/PY oak/NS oakum oakwood oar/DGMS oarfish oarlock oarsman oarsmanship oases oasis oast oat/NRS oatcake/MS oates oath oaths oatmeal oba oban obasanjo obbligato obconic obcordate obduracy obdurate/PY obeah obedience/S obedient/Y obedientiary obeisance obeisant/Y obelise/DGS obelisk obelize/DGS obese obesity obey/DGRS obfuscate/DGNRSX obfuscatory obi obit/R obituary/S object/DGMSV objectify/DGNSX objection/MS objectionable/P objectionably objectisation/MS objectise/S objective/PSY objectivise/AS objectivism objectivist objectivistic objectivity objectivize/AS objectization/MS objectize/S objectless/P objector/MS objurgate/DGNSX objurgatory oblanceolate oblast oblate/NPXY obligate/DGNSXY obligation/MS obligational obligato obligator obligatorily obligatory oblige/DGRS obligee obliging/PY obligor/S oblique/PY obliquity obliterate/DGNSVX obliterative/Y obliterator obliviated obliviates obliviating oblivion/S oblivionise/S oblivionize/S oblivious/PY oblong/PY oblongatal oblongated oblongish obloquious obloquy obmutescence obnoxious/PY obnubilate/DGNSX oboe/S oboist obolus obote obovate obovoid obreption obscene/Y obscenity/S obscurant obscurantic obscurantism obscurantist obscuration/S obscure/DGPRSY obscurity/S obscurum obsecrate obsequent obsequies obsequious/PY obsequy observable/U observably observance/MS observant/Y observation/MS observational/Y observatory/S observe/DGRSZ observed/U observing/Y obsess/DSV obsession/MS obsessional/Y obsessive/PY obsidian obsolesce obsolescence obsolescent/Y obsolete/DGPSY obstacle/MS obstetric/S obstetrical/Y obstetrician/MS obstinacy obstinate/PY obstipation obstreperous/PY obstruct/DGRSV obstruction/MS obstructionism obstructionist obstructionistic obstructive/PY obstructor obstruent obtain/DGRS obtainability obtainable/U obtainably obtainment obtect/D obtest obtestation obtrude/DGRS obtrusion obtrusive/PUY obtund obturate/DGNS obturator obtuse/PRTY obverse/Y obvert obviate/DGNSX obvious/PY obvolute oca ocarina occas occasion/DGJS occasional/Y occasionalism occident occidental/Y occipital/Y occiput occlude/DGS occludent occlusal occlusion/MS occlusive occular occult/RY occultate occultation/S occultism occultist occupancy/S occupant/MS occupation/MS occupational/Y occupied/U occupy/DGRSZ occur/S occurred occurrence/MS occurrent occurring ocean/MS oceana oceanarium oceanfront oceangoing oceanic oceanid oceanographer/MS oceanographic oceanographical/Y oceanography oceanologic oceanological/Y oceanologist oceanology oceanside oceanus ocellar ocellate/DN ocelli ocellus ocelot och ocher/MS ocherous ochlocracy ochlocrat ochlocratic ochlocratical ochlophobia ochone ochre/MS ochrea ochreous ockeghem ocker ocode oconomowoc ocotillo octachord octad octadecyl octagon/S octagonal/Y octahedra octahedral/Y octahedrite octahedron octal/S octamerous octameter/MS octandrious octane octanedioic octangle octangular octant/MS octarchy octaroon octavalent octave/S octavo octennial octet octile octillion octocentenary octodecillion octodecimo octogenarian octonary octoploid octoploidy octopod octopodan octopodous octopus octoroon octosyllabic octosyllable octroi octu octuple octylphenylether ocular ocularist oculist oculomotor odalisque odd/PRSTY oddball/MS oddfellow oddity/MS oddment ode/DMRS odea odense odeum odic odilo odious/PY odium odoacer odograph odometer/MS odontalgia odontoblast odontograph odontoid odontologst odontology odontophore odor/DMS odorant odorful odoriferous/PY odorise/DGRS odorize/DGRS odorless/S odorous/PY odour/DMS odourful odourless/S odovacar odra odyl odyssey oecology oedema/MS oedematous oedipal oeillade oenology oenomel oenone oersted oesophagus oestrin oestrogen oestrone oestrous oestrus oeuvre/S of ofay off/GJS offa/Y offal offbeat offcast offcut/S offence/MSV offenceless/SY offend/DGRSZ offense/MS offenseless/SY offensive/PSY offer/DGJRSZ offertory/S offhand/D offhanded/PY office/MRSZ officeholder/S officemate/S officer/DMS official/MSY officialdom officialese officialisation/MS officialise/S officialism officialization/MS officialize/S officially/U officiant officiary officiate/DGNSX officinal officio officious/PY offish/PY offline offload/DGS offprint/S offramp offsaddle offscour/G offscreen offset/MS offsetting offshoot offshore offside offspring/S offstage oft/N often/R oftentimes ofttimes ogaden ogasawara ogbomosho ogdoad ogee ogeographically ogive ogle/GRS ogled ogre ogreish ogress ogun oh ohm/S ohmage ohmic ohmically ohmmeter/MS oho ohs oil/DGRSZ oilbird oilcan oilcloth oilcup oilfield oilfired oilily oilman oilmen oilseed/S oilskin oilstone oily/PRT oink ointment/S oise oita oka okamoto okapi okavango okay/MS oke okra okta olasticism old/NPRT oldfangled oldie oldish oldster/S oldwife oldy/S oleaceous oleaginous/PY oleander/S oleaster oleate olecranon olefin olefine olefinic oleg oleic olein oleograph oleomargarine oleophilic oleophobic oleoresin oleum olfaction/S olfactive olfactology olfactometer/MS olfactorily olfactory olibanum olid oligarch oligarchic oligarchical oligarchy oligochaete oligoclase oligomer/MS oligopolistic oligopoly oligopsony oligosaccharide/MS oligotrophic oliguria olio oliphant olivaceous olivary olive/MRS olivenite olivier olivine olla olm ology olomouc oloroso olszyn olympiad om omadhaun omagh omar omasum omayyad ombre ombudsman/M ombudsperson omdurman omega/S omelet/S omelette omen/MS omental omentum omer omicron ominous/PY omissible omission/MS omit/S omitted omitting ommatidial ommatidium ommatophore ommission omni omnibus omnicompetent omnidirectional omnifarious/PY omnific omnificence/S omnificent omnify omnipotence omnipotency omnipotent/Y omnipresence omnipresent/Y omnirange omniscience omnisciency omniscient/Y omnist omnivore omnivorous/PY omophagia omphale omphalos omuta on/S onager onagraceous onanism onanistic onassis once/R oncogene/MS oncogenic oncology oncoming ondes ondo ondograph ondometer one/MPRS onefold onega oneiric oneirocritic oneirocritical/Y oneiromancy onerous/PY oneself onetime oneupmanship ongoing onion/MS onionised/MS onionized/MS onionskin onitsha onium online onload onlook onlooker/S onlooking only/P onomasiology onomastic/S onomatology onomatopoeia/M onomatopoeic onrush/G onset/MS onsetting onshore onside onslaught/S onstage ontically onto ontogenesis ontogenetic ontogenetically ontogeny ontological/Y ontologist ontology onus onward/S onychophoran onymous onyx oocyte oodles oof oogamy oogenesis oogonium ooh oolite oology oolong oomiak oompah oomph oont oophorectomy oophoritis oophyte oops oose oosperm oosphere oospore oostende ootheca ootid ooze/DGS oozy/R op/S opacity/S opah opal/MS opaled opalesce opalescence/S opalescent/Y opaline opalise/S opalize/S opalled opaque/PY opcode/MS ope open/DGJPRSTYZ openability openable/U opencast opened/AU openendedness openhanded/PY openhearted/PY opening/MS openmouthed/PY openwork opera/MS operability operable/I operably operand/MS operandi operant/SY operate/DGNSVX operatic operatically operational/Y operationalisation/S operationalise/D operationalism operationalist operationalistic operationalization/S operationalize/D operationism operationist operatise/S operative/PSY operatize/S operator/MS opercular operculate/D operculum operetta operettist operon operose ophicleide ophidian ophiology ophiophagous ophir ophite ophitic ophthalmia ophthalmic ophthalmitis ophthalmologic ophthalmologically ophthalmologist ophthalmology ophthalmoscope ophthalmoscopic ophthalmoscopical ophthalmoscopy opiate/S opine/DGS opinion/MS opinionate/V opinionated/PY opinionative/PY opisometer opisthobranch opisthognathous opium opiumism opossum oppidan oppilate opponent/MS opportune/IY opportunism opportunist opportunistic opportunistically opportunity/MS opposability opposable oppose/DGRS opposeless opposite/NPSXY oppositional oppress/DGSV oppression oppressive/PY oppressor/MS opprobrious/PY opprobrium oppugn/R oppugnant opsimath opsonic opsonin opt/DGS optacon/S optative/Y opthalmic opthalmologic opthalmology optic/S optical/Y optician opticians optima optimal/Y optimality optimisation/MS optimise/DGRSZ optimised/U optimiser/MS optimises/U optimism optimist/S optimistic optimistical optimistically optimization/MS optimize/DGRSZ optimized/U optimizer/MS optimizes/U optimo optimum option/MS optional/Y optionalise/S optionality optionalize/S optoacoustic optoelectronic optoisolate optokinetic optometer optometric optometrical optometrist/S optometry opulence opulent/Y opuntia opus/S opuscule opusculum or/MS ora orach orache oracle/MS oracular/Y oracularity oracy oradea oral/SY oralisation/MS oralise/S orality oralization/MS oralize/S oran orange/MS orangeade orangeroot orangery orangewood orangey orangise/S orangish orangize/S orangoutan orangutan orangy orate/DGS oratio oration/MS orator/MS oratoric oratorical/Y oratorio/S oratorise/S oratorize/S oratory/MS orb orbicular/Y orbicularity orbiculate/Y orbit/DGRSZ orbital/SY orc orca/MS orcein orch orchard/MS orchardist orchardman orchesis orchestra/MS orchestral/Y orchestrate/DGNRSX orchestrational orchestrator orchestre orchestrina orchid/MS orchidaceous orchil orchis orchitis orcinol orczy ordain/DGRS ordainment ordeal/S order/DGJRSY ordered/AU orderless orderly/PS ordinal ordinance/MS ordinand ordinarily ordinary/PS ordinate/DGNSX ordinator/S ordines ordnance/S ordonnance ordure ordzhonikidze ore/MS oread orectic oregano orel orense orfe orfray organ/MS organdie organdy organelle organic/S organically/I organicism organicist organisability/MS organisable/SU organisation/AMS organisational/MSY organisationist/AMS organise/ADGRSZ organised/AU organism/MS organismal organismic organismically organist/MS organizability/MS organizable/MSU organization/AMS organizational/MSY organizationist/AMS organize/ADGRSZ organogenesis organography organoleptic organology organometallic organon organotherapy organum organza organzine orgasm/S orgasmic orgastic orgeat orgiastic orgiastically orgulous orgy/MS oribi oriel orient/DGS orientable oriental/Y orientalisation/MS orientalise/DGS orientalism orientalist orientalization/MS orientalize/DGS orientate/DGS orientation/MS orientational/Y oriente oriented/A orienteering orientisation/MS orientise/S orientization/MS orientize/S orifice/MS orificial oriflamme origami origanum origen origin/MS original/SY originality originals/U originate/DGNSVX originative/Y originator/MS orinasal oriole/S orismological orismology orison orissa orizaba orjonikidze orkneys orle orlon orlop ormer ormolu ormuz ornament/DGS ornamental/Y ornamentalise/S ornamentalize/S ornamentation/S ornate/PY orne ornery/P orney ornis ornith ornithic ornithine ornithischian ornithology/M ornithomancy ornithopod ornithopter ornithoscopy ornithosis orobanchaceous orogenic orogeny orographic orographical/Y orography oroide orometer orontes orotund orotundity orozco orphan/DGS orphanage/S orphanhood orphanise/S orphanize/S orpharion orphrey orpiment orpine orrery orris orsini ort/S ortegal orthant orthicon ortho orthocenter orthocentre orthocephalic orthocephalous orthocephaly orthochromatic orthoclase orthoclastic orthodontia orthodontic/S orthodontist/S orthodox/SY orthodoxly/U orthodoxy/U orthoepic orthoepical/Y orthoepist orthoepy orthogenesis orthogenetic orthogenetically orthogenic orthognathism orthognathous orthognathy orthogonal/Y orthogonalisation orthogonalise/GS orthogonalised orthogonality orthogonalization orthogonalize/GS orthogonalized orthograde orthographic orthographical/Y orthography/MS orthohydrogen orthonormal orthopaedic/S orthopaedically orthopaedist orthopedic/S orthopedically orthopedist orthophosphate/S orthophosphoric orthophosphorous orthopsychiatric orthopsychiatrist orthopsychiatry orthopter orthopteran orthopterist orthopteroid orthopteron orthopterous orthoptic/S orthorhombic orthoscope/S orthoscopic orthostichy orthotic/S orthotist orthotone orthotropic orthotropically orthotropism orthotropous ortles ortolan oruro oryol oryx/S orzae oscillate/DGNSX oscillation/MS oscillational oscillator/MS oscillatory oscillogram/MS oscillograph oscillographic oscillographically oscillography oscilloscope/MS oscilloscopic oscilloscopically oscine oscitancy osculant oscular osculate/DGNSX osculatory osculum osier osman osmatic osmeterium osmic osmious osmiridium osmium osmolal osmolality osmolar osmolarity osmometer/MS osmometric osmometry osmoregulation osmoregulatory osmose/DG osmosis osmotic osmotically osmous osmunda oso osprey/S osram osric ossa ossein osseous/Y ossetia ossicle ossicular ossiculate/D ossie ossietzky ossiferous ossificatory ossifrage ossify/DNX osso ossuary osteal osteitis ostend ostensible ostensibly ostensive/Y ostensorium ostensory ostentation/S ostentatious/PY osteoarthritic osteoarthritis osteoblast osteoblastic osteoclasis osteoclast osteoclastic osteocyte osteogenesis osteoid osteological/Y osteologist osteology osteoma osteomalacia osteomyelitis osteopath osteopathic osteopathically osteopaths osteopathy osteophyte osteophytic osteoplastic osteoplasty osteoporosis osteotome osteotomy ostia ostinato ostiole ostium ostler ostmark ostosis ostracisable/S ostracisation/MS ostracise/GRSZ ostracised ostracism ostracizable/MS ostracization/MS ostracize/GRSZ ostracized ostracod ostracoderm ostracon ostrava ostrich/MS ostwald otalgia other/MPS othergates otherguess otherwhere otherwhile/S otherwise otherworld/Y otherworldly/P othman otho otic otiose otitis otocyst otolaryngology otology otoscope otranto ottar ottava otter/MS otterburn otway ouabain ouachita ouan ouananiche oubangui oubliette ouch oudh ouessant ough ought/S oughtn't oui oujda oulu ounce/S our/S ourself ourselves ouse ousel oust/DGR out/DGJPRS outage/MS outasight outback outbalance outbid outboard/S outbound outbrave outbreak/MS outbreed/G outbuilding outburst/MS outby outbye outcast/MS outcaste outcaviled outcaviling outcavilled outcavilling outclamor/MS outclamour/MS outclass/D outcome/MS outcrop outcrops outcross outcry/S outdate outdated/P outdazzle outdistance outdistanced outdistancing outdo outdoor/S outdoorsman outdoorsmanship outdoorsy outdraw outdrew outercoat outermost outface outfall outfield/RZ outfight/G outfit/MS outfitted outfitter outfitting outflank/R outflow/S outfoot outfought outfox outgas outgeneral outgeneraled outgiving outgo outgoes outgoing/PS outgrew outgrip outgrow/GHS outgrown outguess outgun outhaul outhouse outhumor/DGMS outhumour/DGMS outhyperbolise/S outhyperbolize/S outing/MS outjockey outlabor/MS outlabour/MS outland/RZ outlandish/PY outlast/S outlaw/DGS outlawry outlay/MS outlet/MS outlier outliers outline/DGS outlist outlive/DGS outlook outlying outman outmaneuver/DGS outmanoeuvre/DGS outmatch outmatched outmigration outmode/G outmoded outmost outnumber/DGS outpace/D outpatient/S outperform/DGS outplay outplayed outpoint/DGS outport/R outpost/MS outpour/GJ outpull output/MS outputted outputting outrace outrage/DGS outrageous/PY outrance outrange outrank outreach outride/R outrigger/S outright/Y outrival outrivaled outrivaling outrivalled outrivalling outrun/S outrunner outrush outsavor/GMS outsavour/GMS outscore outscoring outsell outsert outset outshine outshone outshoot outshout outside/RZ outsider/MPS outsight outsit outsize outsized outskirt outskirts outsleep outsmart/DGS outsmell outsoar outsole outspeak outspeed outspend outspent outspin outsplendor/MS outsplendour/MS outspoken/PY outspread outstand outstanding/Y outstare outstart outstate/N outstay outstretch outstretched outstrip/S outstripped outstripping outswing outtake outtalk outthink outturn outtyrannise/S outtyrannize/S outvote/DGS outward/PSY outwash outwear outweigh/DG outweighs outwit/S outwith outwitted outwitting outwork outworn ouvre ouzel ouzo ova oval/MPSY ovalisation/MS ovalise/S ovalization/MS ovalize/S ovarial ovarian ovariectomised ovariectomized ovariectomy ovariole ovariotomy ovaritis ovary/MS ovate/NSX ovation/DGS oven/MS ovenbird/S ovenproof/DGS ovenware over/GSY overabundance overabundant overachieve/DGRS overact overaction overactive overactivity overage overaggressive overagonise/S overagonize/S overall/MS overarch overarching overarm overawe overbalance overbear overbearance overbearing/PY overbid overbite overblew overblouse overblow/GS overblown overboard overboot overbought overbrutalise/S overbrutalize/S overbuild overburden/DGS overburdening/Y overbuy overcall/DGS overcame overcapacity overcapitalisation/MS overcapitalise/DGS overcapitalization/MS overcapitalize/DGS overcareful/Y overcast/G overcautious overcentralisation/MS overcentralise/S overcentralization/MS overcentralize/S overcerebral overcharge overcheck overcivilisation/MS overcivilise/S overcivilization/MS overcivilize/S overclamor/MS overclamour/MS overcloud overcoat/GMS overcolor/MS overcolour/MS overcome/GRS overcompensate/N overcompensatory overcompetence overconfidence overconfident/Y overconsolidate/DGNS overconsumption overcooked overcooled overcorrection overcriticise/S overcriticize/S overcrop overcrowd/DGS overcurious overcurrent/S overdetermination overdetermine/GS overdetermined overdevelop overdeveloped overdevelopment overdo overdoctrinise/S overdoctrinize/S overdoing overdominance overdominant overdone overdose/DGMS overdraft/MS overdraw/GS overdrawn overdress overdrew overdrive overdriving overdue overdye overeager/PY overeat/GNR overeducated overemotionalise/S overemotionalize/S overemphasis overemphasise/DGRSZ overemphasization/MS overemphasize/DGRSZ overestimate/DGNSX overet overexcite overexcited overexcitement overexploitation overexploited overexpose overexposure overextend/DGS overextension overfall overfastidious overfavor/MS overfavorable/MS overfavorably/S overfavour/MS overfavourable/S overfavourably/S overfed overfeed overfertilisation overfertilization overfill/DGS overfish overfleshed overflight overflow/DGS overflown overfly overfold overgarment overgeneralise/S overgeneralize/S overgenerous overglaze overgraze overgrazing overground overgrow/H overgrown overhand/D overhang/GS overhaul/DGJRS overhead/S overhear/GRS overheard overheat/DGS overhonor/MS overhonour/MS overhumanise/S overhumanize/S overhype/DGS overily overindulge overindulged overindulgence overindulgent overindustrialisation/MS overindustrialise/S overindustrialization/MS overindustrialize/S overissue/DGS overjoy/D overjudgement/MS overjudgment/MS overkill/M overlabor/MS overlabour/MS overlaid overland overlap/MS overlapped overlapping overlay/GS overleaf overleap overlearn overlie overlive overload/DGS overlong overlook/DGS overlord overlords overlordship overloud overly/G overman overmantel overmaster overmatch overmatter overmuch overnationalisation/MS overnationalization/MS overnice overnight/RSZ overoptimism overoptimist overoptimistic overoptimistically overpaid overpass overpay overpayment overpersuade overpersuasion overpitch overplay overplayed overplaying overplus overpopulate overpopulated overpopulation overpower/DGS overpowering/Y overpraise overpressure overprice/D overprint/DGS overprize overproduce/DGS overproduction overpronounce overproof overproportion overprotect overprotection overprotective overran overrapturise/S overrapturize/S overrate overrated overrationalise/S overrationalize/S overreach/DRS overreact overreaction overrefine overrefinement overrepresent overrepresented overridden override/GRS overripe overrode overrule/DGS overrun/S overrunning oversample/DG oversanguine oversaturate overscale overscore oversea overseas oversee/RSZ overseeing overseen oversell/GS oversensitive/P oversentimentalise/S oversentimentalize/S overset oversew oversexed overshadow/DGS overshoe overshoes overshoot/GS overshot overside oversight/MS oversimplify/DGNSX oversize/DS overskirt overslaugh oversleep oversleeve overslip oversoft/P oversold oversoul overspecialisation/MS overspecialise/DS overspecialization/MS overspecialize/DS overspeculate/N overspeed overspend/GRS overspent overspill overspread overstaff/DGS overstate/DGS overstatement/MS overstay oversteepen oversteer overstep/S overstepped overstepping overstock overstocks overstory overstrain overstraining overstress/D overstrew overstride overstrike/GS overstruck overstrung overstuff/DGS oversubscribe/GS oversubscribed oversubscription oversubtle oversubtlety oversupply oversystematise/S oversystematize/S overt/PY overtake/GRSZ overtaken overtask overtax overtaxation overtaxed overthrew overthrow/GS overthrown overthrust overtime overtone/MS overtook overtop overtrade overtrain overtrick overtrump overture/MS overturn/DGS overtype/G overunionised/MS overunionized/MS overurbanisation/MS overurbanization/MS overuse overvalue overview/MS overvoltage/S overwatch overwear overweary overween/G overweigh overweight overwhelm/DGS overwhelming/Y overwind overwinter overwomanise/S overwomanize/S overword overwork/DGS overwrap overwrite/GS overwritten overwrote overwrought overzealous/P ovicidal ovicide oviduct oviductal oviedo oviferous oviform ovine oviparous/PY oviposit oviposition ovipositional ovipositor ovisac ovoid ovoidal ovonic ovotestis ovoviviparous/PY ovular ovulate/DGNSX ovulatory ovule ovum ow owe/DGS owelty owerless owerri owl/MRS owlet owlish/PY owly own/DGRSZ owner/MS ownership/S owt ox/N oxacillin oxalacetate oxalacetic oxalate oxalic oxalis oxaloacetate oxaloacetic oxazine oxblood oxbow oxcart oxenstierna oxeye oxheart oxhide oxidant oxidase oxidasic oxidate/VX oxidation oxidative/Y oxide/MS oxidic oxidimetry oxidisability/MS oxidisable/SU oxidisation/MS oxidise/DGJRSZ oxidised/U oxidisement/MS oxidises/A oxidizability/MS oxidizable/MSU oxidization/MS oxidize/DGJRSZ oxidized/U oxidizement/MS oxidizes/A oxime oxon oxonian oxonium oxpecker oxtail oxter oxtongue oxus oxyacetylene oxyacid oxycephaly oxychloride oxygen/S oxygenate/DGNSX oxygenator oxygenic oxygenicity oxygenisable/S oxygenise/RSZ oxygenisement/MS oxygenises/A oxygenizable/MS oxygenize/RSZ oxygenizement/MS oxygenizes/A oxygenless oxyhaemoglobin oxyhemoglobin oxyhydrogen oxyhydroxides oxymoron oxyphil oxyphile oxyphilic oxysalt oxysome oxysulfide oxysulphide oxytetracycline oxytocic oxytocin oxytone oyer oyez oyo oystchers oyster/GMS oystercatcher oysterman oystermen oz ozagen ozagenians ozalid ozocerite ozokerite ozone ozonic ozonide ozoniferous ozonisation/MS ozonise/DGRSZ ozonization/MS ozonize/DGRSZ ozonolysis ozonosphere ozonous ozs ozzie p's pH pa/MS pabulum paca pace/DGMRSZ pacem pacemaker pacemaking pacesetter pacesetting paceway pacha pachalic pachuca pachuco pachyderm pachydermal pachydermatous/Y pachysandra pachytene pacifiable pacific pacifically pacificator/S pacificatory pacificist pacifism pacifist pacifistic pacifistically pacify/DGNRSX pack/DGRSZ packability packable package/DGJRSZ packaged/AU packages/AU packboard packet/DGMS packetisation packetise/DGRSZ packetiser/MS packetization packetize/DGRSZ packetizer/MS packhorse packinghouse packman packs/AU packsack packsaddle packthread packwood pact/MS pad/MS padang padauk padded/U padding/S paddle/DGRS paddleboard paddlefish paddock paddy/S pademelon paderborn padishah padlock/DS padma padouk padova padre padrone padsaw padua paduasoy paean/S paeanise/S paeanize/S paederast paediatrician paediatrics paedogenesis paedology paedomorphosis paedophilia paella paeon paeony paestum pagan/MS paganini paganisation/AMS paganise/DGRSZ paganiser/AS paganises/AU paganish paganism paganization/AMS paganize/DGRSZ paganizer/AS paganizes/AU page/DGMRSZ pageant/MS pageantry pageboy paged/U pageful/S pager/MS paginal paginate/DGNSX pagoda/S pagurian pah pahang pahsien paid/AU paigle pail/MS pailful paillasse paillette pain/DGS painful/PY painfuller painfullest painkiller painless/PY painstaking/Y paint/DGJRSZ paintbox paintbrush painted/AU painter/SY painterly/P pair/DGJS paired/AU pairwise paisa paisano paisley paix pajama/DMS pakeha paki pal/MSY palace/MS paladin palaeanthropic palaeethnology palaeoanthropic palaeoanthropology palaeobotany palaeoclimatology palaeoecological palaeoecology palaeoethnobotany palaeogene palaeography palaeolith palaeolithic palaeomagnetism palaeontography palaeontology/M palaeozoology palaestra palais palanquin palasts palatability/U palatable/P palatably palatal/Y palatalisation palatalise/DGS palatalization palatalize/DGS palate/MS palatial/PY palatinate palatisation/MS palatise/S palatization/MS palatize/S palaver/DG palawan palazzo/S pale/DGPRSTY palea paleface palefaces palembang palencia paleoanthropology/M paleoecologic paleoecological paleoecologist paleoecology paleogeographic paleogeographical/Y paleogeography paleographer paleographic paleographical/Y paleography paleolith paleoliths paleologist/S paleomagnetics paleontologic paleontological paleontologist paleontology paleozoological paleozoology palestra palestrina paletot palette paley palfrey palikar palimpsest palindrome/S palindromic palindromicity palingenesis palingenetic palinode palisade/S palish palk pall/G palladia palladic palladio palladium palladiumise/S palladiumize/S palladous pallbearer pallet pallete palletisation/S palletise/GRS palletised palletization/S palletize/GRS palletized pallette pallial palliasse palliate/NV palliative/SY palliator pallid/PY pallium pallor/MS palm/DGRS palma palmaceous palmar palmary palmate/DNY palmetto palmira palmist palmistry palmitate palmlike palmy/R palolo palomino palooka palos palour palp palpability palpable palpably palpal palpate/DGNSX palpebral palpebrate palpi palpitant palpitate/DGS palsgrave palstave palsy/DGS palter/DGR paltry/PR paludal paludism palynologic palynological/Y palynologist palynology pamirs pampa/S pamper/DGRS pamperise/S pamperize/S pampero pamphlet/MS pamphleteer/S pamphletise/S pamphletize/S pamphrey pamphylia pamplona pan/MS panacea/MS panacean panache panada panama panatela panatella/S panay pancake/DGMS panchax panchayat panchen panchromatic pancosmism pancratium pancreas pancreatic pancreatin panda/MS pandanaceous pandect/S pandemic pandemonium pander/DGRS panderise/S panderize/S pandied pandit pandore pandour pandowdy pandurate pandy pandybat pane/MS panegyric panegyrical/Y panegyrist panel/S paneled paneling/S panelisation panelised panelist/MS panelization panelized panelled panelling panelling/S panellist/S panetela panetella panettone panful pang/MS panga pangenesis pangenetic pangolin panhandle/DGRS panhuman panic/MS panicked panicking panicky panicle panicmonger paniculate panjandrum panjim pankhurst panmixia panmunjom pannage panne panned pannier pannikin panning pannonia panocha panoply/D panoptic panorama/S panoramic panoramically panpipe/S pansophy pansy/MS pant/DGS pantalets pantalettes pantaloon/S pantas pantechnicon pantelleria pantheism pantheist pantheistic pantheistical/Y pantheon pantheonisation/MS pantheonise/S pantheonization/MS pantheonize/S panther/MS pantie pantihose pantile/D pantisocracy/S pantisocratic pantisocratical pantisocratist panto pantograph pantographic pantomime/D pantomimic pantomimist pantothenate pantothenic pantoum pantropic pantry/MS pantryman pantrymen pantsuit panty/S pantywaist panza panzer paoting paotow pap/S papa papacy papadopoulos papain papal/Y papalisation/MS papalise/RSZ papalization/MS papalize/RSZ papandreou papaveraceous papaverine papaw papaya papeete paper/DGJMRSZ paperback/MS paperbark paperboard paperbound paperboy/S paperclip/S paperhanger paperhangers paperhanging paperknife paperknives paperless papermaker/S papermaking paperthrow paperweight/S paperwork papery/P papeterie paphlagonia paphos papier papiers papilionaceous papilla papillae papillary papillate/D papilloma papillomatous papillon papillose papillote papist papistry papoose pappose pappus pappy/S paprika papule papyraceous papyri papyrology papyrus/S par/S para parabasis parabiosis parabiotic parabiotically parablast parable/S parabola parabolic parabolically parabolisation parabolise/DGS parabolize/DGS paraboloid paraboloidal parabrake paracasein paracetamol parachronism parachute/DGMRS parachutic parachutist paraclete parade/DGRS paradigm/MS paradigmatic paradigmatical paradisaic paradisaical/Y paradisal paradise paradisiac paradisiacal/Y paradox/MS paradoxic paradoxical/PY paradrop paraesthesia paraffin/S paraffinic paraffinise/S paraffinize/S paraformaldehyde paragenesis paragenetic paragenetically paraginase paragoge paragon/MS paragonite paragraph/DGR paragraphic paragraphise/S paragraphize/S paragraphs parahydrogen parakeet/S paralanguage paraldehyde paralinguistic paralipomena parallactic parallax/M parallel/S paralleled/U parallelepiped/S paralleling parallelisation/MS parallelise/DGRSZ parallelism parallelization/MS parallelize/DGRSZ parallelled/U parallelling parallelogram/MS paralogism paralysation paralyse/DGRSZ paralysed/Y paralysedly/S paralyser/MS paralysing/Y paralysingly/S paralysis paralytic paralyzation paralyze/DGRSZ paralyzed/Y paralyzedly/S paralyzer/MS paralyzing/Y paralyzingly/S paramagnet paramagnetic paramagnetically paramagnetism paramaribo paramatta paramecium paramedic paramedical parament parameter/MS parameterisable parameterisation/MS parameterise/DGS parameterised/U parameterizable parameterization/MS parameterize/DGS parameterized/U parameterless parametric parametrical parametrically parametrisable parametrisation/MS parametrise/DGS parametrised/U parametrizable parametrization/MS parametrize/DGS parametrized/U paramilitary paramnesia paramo paramorph paramorphine paramorphism paramount paramountcy paramour parang paranoia paranoiac/S paranoid paranormal/Y paranormality paranymph paraoxon parapet/DMS paraph paraphernalia paraphrasable paraphrase/DGRS paraphrastic paraphrastically paraphysis paraplegia paraplegic parapodial parapodium parapraxis paraprofessional/S parapsychology paraquat pararosaniline parasang paraselene paraselenic parasexual parasexuality parashah parasite/MS parasitic/S parasitical/Y parasiticidal parasiticide parasitisation parasitise/DGS parasitism parasitization parasitize/DGS parasitology parasol/S parastichy parasympathetic parasympathomimetic parasynthesis parasynthetic parasyntheton paratactic paratactical/Y parataxis parathion parathyroid parathyroidectomise/DGS parathyroidectomize/DGS parathyroidectomy paratroop/RSZ paratyphoid paravane paraxial parboil/D parbuckle/DG parcae parcel/S parceled/U parceler parceling parcelled parcelled/U parceller parcelling parcenary parcener parch/D parcheesi parchment parchmentise/S parchmentize/S parclose pard pardalote pardner/S pardon/DGRSZ pardonable/P pardonably pardubice pare/GJRS paregoric pareira parella parenchyma parenchymal parent/GMS parentage parental/Y parenteral/Y parentheses parenthesis parenthesisation parenthesise/GS parenthesised parenthesization parenthesize/GS parenthesized parenthetic parenthetical/Y parenthood parergon paresis paresthesia pareu pareve parfait parfleche parfocalisation parfocalise parfocalization parfocalize parget parhelic parhelion pariah parian paries parietal parietes parimutuel/S parioli paripinnate parish/MS parishad parishioner/S parisina parisology parison parisyllabic parity/S park/DGRSZ parka/MS parkin parkinsonism parkish parkland parklike parkway parky parlance parlando parlante parlay/D parle/G parley/S parleyvoo parliament/MS parliamentarian/S parliamentarianism parliamentary/U parlor/MS parlour/MS parlous/Y parm parmenides parmentier parmigiana parmigianino parmigiano parnell parochial/Y parochialisation/MS parochialise/S parochialism/MS parochialization/MS parochialize/S parodic parodist parodistic parody/DS paroicous parol parole/DGS parolee/S paronomasia paronomastic paronym paronymous parotic parotid parotitis parotoid parous parousia paroxysm paroxysmal paroxytone parquet/DG parquetry parrakeet parramatta parrel parricidal parricide parrillo parring parris parrot/GS parrotfish parrotise/S parrotize/S parrotlike parry/DG pars/DGJRSZ parse/DGJRSZ parsec/S parsed/U parser/MS parsimonious/Y parsimony parsley parsnip parson/MS parsonage parsonise/S parsonize/S part/DGJRSYZ partake/GRS partan parterre parthenocarpic parthenocarpically parthenocarpy parthenogenesis parthenogenetic parthenogenetically parthia parti partial/SY partialise/S partiality partialize/S partible participant/MS participate/DGNSVX participator participatory participial/Y participle/S particlar particle/MS particular/SY particularisation/MS particularise/DGS particularism particularist particularistic particularity particularization/MS particularize/DGS particulate/S partisan/MS partisanise/S partisanize/S partisanship partita partite/V partition/ADGRS partitioned/AU partitionist partitive/Y partizan partlet partner/DGMS partnership/S partook partridge/MS parturient parturifacient parturition partway party/DGMS parulis parure parve parvenu parvenue parvis parvise parzival pasargadae pasay paschal pase pash pasha pashalik pashka pashm pasionaria pasolini pasqueflower pasquinade pass/DGRSVZ passable passably passacaglia passade passage/DGMS passageway passant passarine passavant passband passbook/MS passe/DGNRSVXZ passel passementerie passenger/MSY passepied passerby passerine passersby passible passifloraceous passim passional passionate/PY passionflower passionless passivate/DGNSX passive/PSY passivism passivist/S passivity passkey passport/MS password/DMS past/DGMPS pasta paste/DGS pasteboard pastel/S pastelist pastellist pastern/S pasternak pasteup pasteurisation/S pasteurise/DGRS pasteurization/S pasteurize/DGRS pastiche pastil pastilles pastime/MS pastis pastlle pasto pastor/MS pastoral/PY pastorale pastoralise/S pastoralism pastoralist pastoralize/S pastorate pastorise/S pastorium pastorize/S pastorship pastrami pastry/S pasturage pasture/DGMRS pastureland pasty/PRS pat/MS patagium patagonians patch/DGRS patchboard patchily patchouli patchouly patchwork/RZ patchy/PR pate/DS patella/S patellae patellar patellate patelliform paten/S patency patent/DGRSYZ patentability patentable patentee/S patentor pater/S paterfamilias paternal/Y paternalise/S paternalism paternalist paternalistic paternalize/S paternity paternoster path/MS pathbreaking pathetic pathetical/Y pathfind pathfinder pathfinding pathic pathlength pathless/P pathname/MS pathogen/S pathogenesis pathogenetic pathogenic pathogenically pathogenicity pathognomonic pathognomy pathol pathologic pathological/Y pathologist/MS pathology/S pathometer/MS pathomorphologic pathomorphological pathomorphology pathophysiologic pathophysiological pathophysiology pathos paths pathway/MS patiala patible paticularly patience patient/MSY patil patin patina/S patinae patine/DG patio/S patisserie patisseries patmore patna patois paton patras patresfamilias patrial patriarch patriarchal patriarchate patriarchs patriarchy/S patrician/MS patriciate/S patricidal patricide patriclinous patrilineage patrilineal patrilocal patrimonial patrimony patriot/MS patriotic/U patriotically patriotism patristic/S patristical patroclus patrol/MS patrolled patroller patrolling patrolman patrolmen patrology patron/MSY patronage patronal patroness patronisable/SU patronisation/MS patronise/DGJRSZ patronised/U patronises/A patronising's/U patronising/MSY patronizable/MSU patronization/MS patronize/DGJRSZ patronized/U patronizes/A patronizing's/U patronizing/MSY patronne patronymic patroon patted patten patter/DGJRS pattern/DGS patternise/S patternize/S pattie patting patty/MS patulous/PY pau paua paucal paucity pauldron pauling paulownia paumotu paunch paunchy/PR pauper pauperisation/MS pauperise/DGRSZ pauperism pauperization/MS pauperize/DGRSZ pausanias pause/DGS pav pavage pavane pavanne pave/DGRS paved/U pavement/MS pavese pavid pavilion/MS paving/A pavior paviour pavis pavlodar pavlova pavonine paw/DGS pawky pawl pawn/DGMRS pawnbroker/MS pawnbroking pawnees pawnor pawnshop/MS pawpaw pax paxam paxton paxwax pay/DGRSZ payable/A paycheck/MS payday payee payer/MS paygrade/S payload/MS paymaster/S payment/MS payments/A paynim payoff/MS payola payor payroll/S pea/MS peace/S peaceable/P peaceably peaceful/PY peacekeeper peacekeeping peacemake/R peacemaking peacetime/S peach/MS peachy/R peacock/MS peacockish peafowl peag peahen peak/DGS peake peaked/P peaky peal/ADGS pealike pean peanut/MS pear/SY pearl/MRS pearlescence pearlescent pearlisation pearlise/DGS pearlite pearlitic pearlization pearlize/DGS pearlstone pearlwort pearly/R pearmain peart peary peasant/MS peasanthood peasantise/S peasantize/S peasantry peascod peasecod peashooter peasouper peat/A peaty peau peavey pebble/DGMS pebbly pecan/S peccable peccadillo peccadilloes peccancy peccant/Y peccary peccavi pechora peck/DGRS peckinpah peckish pecky pectase pectate pecten pectic pectin pectinaceous pectinate/DN pectines pectisation pectise/DGS pectization pectize/DGS pectoral/S pectoralis peculate/DGNS peculator peculiar/SY peculiarise/S peculiarity/MS peculiarize/S peculium pecuniarily pecuniary pedagog pedagogic/S pedagogical/Y pedagogue pedagogy pedal/S pedaled pedaler/S pedalfer pedalferic pedaling pedalled pedaller/S pedalling pedalo pedant pedantic pedantically pedantise/S pedantize/S pedantry pedate pedatifid peddle/DGS peddler/MS peddlery peden pederast/S pederastic pederasty pedestal/S pedestaled pedestaling pedestalled pedestalling pedestrian/MS pedestrianisation pedestrianise/DGS pedestrianism pedestrianization pedestrianize/DGS pedi pediatric/S pediatrician pediatrist pedicab pedicel pedicellate pedicle/D pedicular pediculate pediculosis pediculous pedicure pedicurist pediform pedigree/D pediment/D pedimental pedipalp pedlar pedlary pedocal pedocalic pedogenesis pedogenetic pedogenic pedologic pedological pedologist pedology pedometer/MS pedophile pedophilia pedophiliac pedophilic pedunculate pee peebles peek/DGS peekaboo peel/DGRS peelable peeler/M peen/DGS peep/DGRSZ peephole peepshow peepul peepy peer/DGS peerage peeress peerless/PY peeter peetweet peeve/DGMSZ peevish/PY peewee peewit peg/MS pegboard/S pegged pegging pegmatite pegu peignoir peipus peiraeus peirce pejoration pejorative/SY pekan peke pekoe pelage pelagic pelagius pelargonic pelargonium pelerine pelf pelican/S pelion pelisse pelite pella pellagra pellagrin pellagrous pelles pellet/DGMS pelletal pelletier pelletisation/S pelletise/DGRS pelletization/S pelletize/DGRS pellicle pellitory pellucid/PY pellucidity pelmet peloponnese peloria peloric pelorus pelota/S pelt/GRS peltast peltate/Y peltier peltry/S pelvic pelvis/S pemba pemberton pemican pemmican pemmicanisation/MS pemmicanise/S pemmicanization/MS pemmicanize/S pemphigus pen/S penal/Y penalisable/S penalisation/MS penalise/DGS penalised/U penalizable/MS penalization/MS penalize/DGS penalized/U penalty/MS penance/DGS penang penates pence penchant penchi pencil/S penciled penciler/S penciling/S pencilled penciller penciller/S pencilling pencilling/S pend/DGS pendant pendency pendent/VY pendente penderecki pendleton pendragon pendular pendulous/PY pendulum/MS peneplain penetrability penetrable/P penetrably penetralia penetrance/S penetrant/S penetrate/DGNSVX penetrating/Y penetrative/PY penetrator/MS penetrometer/MS peneus pengally pengpu penguin/MS penholder penicillate/NY penicillin penicillium penile penillion peninsula/MS peninsular peninsulate penis/S penitence/S penitency penitent/Y penitential/Y penitentiary penki penknife/M penknives penlight penman penmanship penmen penna pennaceous pennae pennant/S pennate penned penniless pennine/S penning penninite pennis pennon pennoncel penny/MS pennycress pennyroyal pennyweight pennywort pennyworth penological penologist penology penrith pens/V pensile pension/DGRSZ pensionable pensionary pensionless pensive/PY penstemon penstock pent/A penta pentachlorophenol pentacle/S pentad pentadactyl pentadactylism pentagon/MS pentagonal/Y pentagram/MS pentagraph pentahedral pentahedron pentamerous pentameter pentane pentangle/S pentangular pentanoic pentapeptide pentaploid pentaploidy pentaprism pentaquin pentaquine pentarchy pentastich pentathlete pentathlon pentatomic pentatonic pentavalent pentazocine pentecostal pentelikon pentene penthesileia pentheus penthouse/MS pentimento pentlandite pentobarbital pentobarbitone pentode/S pentomic pentosan pentose pentothal pentoxide pentyl pentylenetetrazol penuche penuchle penult penultima penultimate/Y penumbra penumbral penurious/PY penury penza penzance peon peonage peones peony/S people/DGMS peoplehood peopleless pep pepin peplos peplum pepo pepper/DGRS peppercorn/MS peppergrass peppermint/S pepperminty pepperoni peppertree pepperwort peppery pepping peppy/PR pepsico pepsin pepsinate pepsinogen peptic peptidase/S peptide/S peptisable/S peptisation/MS peptise/DRSZ peptising peptizable/MS peptization/MS peptize/DRSZ peptizing peptone peptonisation peptonise/DGS peptonization peptonize/DGS per pera peracid peradventure peraea perak perambulate/DGNSX perambulator perambulatory perborate percale percaline perceivable perceivably perceive/DGRSZ perceived/U percent/S percentage/S percentile/S percept perceptibility perceptible perceptibly perception/S perceptional perceptive/PY perceptivity perceptual/Y perch/DGS perchance perchlorate perchloric perchloride percipience percipient percoid percoidean percolate/DGNS percolator/S percptibly percuss percussion/S percussionise/S percussionist percussionize/S percussive/PY percutaneous/Y perdido perdition/S perdu perdurability perdurable perdurably pere peregrinate/DGNSX peregrine pereira peremptorily peremptory/P perennate/DGNSX perennial/SY perennialise/S perennialize/S perfect/DGPRSVY perfecta perfectibility perfectible perfection/S perfectionism perfectionist/MS perfective/PY perfectivise/S perfectivity perfectivize/S perfecto perfervid perfidious/PY perfidy perfin perfoliate/N perforate/DGNSX perforated/U perforator perforce perform/DGRSZ performable performance/MS performative performatory performed/U perfume/DGRS perfumery perfunctorily perfunctory/P perfuse/DGV perfusion pergamum pergola pergolesi perhaps peri perianth periapt periblem pericardial pericarditis pericardium pericarp perichondral perichondrial perichondrium periclase periclinal pericline pericope pericranial pericranium pericycle pericyclic pericynthion periderm peridermal peridermic peridia peridium peridot peridotic peridotite peridotitic perigean perigee/M periglacial perigon perigordian perigynous perigyny perihelial perihelion perikaryal perikaryon peril/MS periled periling perilled perilling perilous/PY perilune perilymph perimeter perimorph perimysium perinatal perinephrium perineum perineuritis perineurium period/MS periodate periodic periodical/SY periodicalise/S periodicalize/S periodicity/S periodisation/S periodise/DGS periodization/S periodize/DGS periodontal/Y periodontics periodontist perioneum perionychium periosteum periostitis periotic peripatecically peripatetic peripatetically peripateticism peripatus peripety peripherad peripheral/SY periphery/MS periphrasis periphrastic periphrastically periphytic periphyton periplast peripteral perique perisarc periscope/S periscopic perish/DGRSZ perishability perishable/MS perishing/Y perisperm perispomenon perissodactyl peristalsis peristome peristyle peritectic perithecium peritoneum peritonitis peritrack peritrichous/Y periwig periwinkle/S perjure/DGRS perjurious/Y perjury perk/DGS perkily perky/PR perlis perlite perlitic perlocution perlocutionary perm permafrost permalloy permanence permanency permanent/PSY permanganate permanganic permeability permeable/P permeably permeance permease permeate/DGNSVX permissable permissibility permissible/P permissibly permission/S permissive/PY permit/MS permitted permitter permitting permittivity permutation/MS permutational permute/DGS pernambuco pernicious/PY pernickety pernik pernod perogative peroneal peroral/Y perorate/N perorational peroxidase peroxide peroxidic peroxidise/S peroxidisement/MS peroxidize/S peroxidizement/MS peroxisomal peroxisome peroxysulphuric perpend perpendicular/SY perpendicularity perpetrate/DGNSX perpetrator/MS perpetual/Y perpetuate/DGNS perpetuator perpetuity perpignan perplex/DGS perplexed/Y perplexity/S perquisite/S perrault perrin perron persalt perse persecute/DGNSV persecutor/MS persecutory persephone persepolis perseverance perseverant perseveration/S persevere/DGS persiennes persiflage persimmon/S persist/DGRS persistence persistency persistent/Y persnickety person/MS persona personable/P personae personage/MS personal/SY personalisation/MS personalise/DGS personalism personalist personalistic personality/MS personalization/MS personalize/DGS personalty personate/DGNSV personator personhood personify/DGNRSX personisation/MS personise/S personization/MS personize/S personnel perspective/MSY perspectivism perspex perspicacious/PY perspicacity perspicuity perspicuous/PY perspiration/S perspiratory perspire/DGS persuadable persuade/DGRSZ persuasible persuasion/MS persuasive/PY persulphate persulphuric pert/PY pertain/DGS pertinacious/PY pertinacity pertinence pertinency pertinent/Y perturb/DG perturbable perturbation/MS perturbational perturbative perturbed/U pertussis perugia perugino peruke perusal peruse/DGRSZ perutz peruzzi perv pervade/DGS pervasion pervasive/PY perverse/NPVXY perversity pervert/DGRS perverted/PY pervious/P pes pesade pesaro pescadores pescara peseta pesewa peshawar peshitta pesky/R peso/S pessary pessimal pessimism pessimist/S pessimistic pessimistically pessimum pest/RSZ pestalozzi peste pester/DGS pesthole pesthouse pesticide/S pestiferous/PY pestilence/S pestilent/Y pestilential/Y pestle/DGS pet/MS petal/MS petaled petaliferous petalled petallike petalody petaloid petalous petard petasos petasus petechia peter/DS pethidine petiolate/D petiole/D petiolule petit petite/P petition/DGRS petitionary petits petrarch petrarchan petrel petri petrifaction petrify/DN petrochemical petrochemistry petrodollar petrogenesis petrogenetic petroglyph petrograd petrographer petrographic petrographical/Y petrography petrol petrolatum petroleum petrolic petrolisation/MS petrolise/S petrolization/MS petrolize/S petrologic petrological/Y petrologist petrology petronel petrosal petrous petsamo petted petter/MS pettibone petticoat/DMS pettifog pettifogger pettifoggery pettifogging pettily pettiness/S petting pettish/PY pettitoes petty/PRT petulance/S petulancy petulant/Y petunia petuntse pevsner pew/MS pewaukee pewee pewit pewter/R peyote pfennig ph phaeton phage phagedaena phagocyte/S phagocytise/S phagocytize/S phagocytosis phagomania phagophobia phalangeal phalanger phalanges phalanstery phalanx/S phalarope phalli phallic phallically phallicism phallus/S phanerocrystalline phanerogam phanerogamic phanerogamous phanerophyte phanerozoic phantasm phantasma phantasmagoria phantasmagoric phantasmal phantasmic phantasy phantom/MS phantomise/RSZ phantomize/RSZ phantomlike pharaoh pharaonic pharisaic pharisaical/PY pharisaism pharisee pharmaceutic/S pharmaceutical/SY pharmacist/S pharmacodynamic/S pharmacodynamically pharmacogenetic/S pharmacognostic pharmacognostical pharmacognosy pharmacokinetic/S pharmacologic pharmacological/Y pharmacologist pharmacology pharmacophore/S pharmacophoric pharmacopoeia pharmacy/S pharnges pharos pharsalus pharyngeal pharyngitis pharyngology pharyngoscope pharyngotomy pharynx/S phase/DGRSZ phasic phasmid phatic phd pheasant/MS pheidippides phelloderm phellogen phenacaine phenacetin phenacite phenanthrene phenazine phenetic phenetics phenetidine phenetole phenformin phenix phenobarbital phenobarbitone phenocain phenocopy phenocryst phenol phenolate phenolic phenolisation/MS phenolise/S phenolization/MS phenolize/S phenological/Y phenology phenolphthalein phenomena phenomenal/Y phenomenalisation/MS phenomenalise/S phenomenalism phenomenalist phenomenalistic phenomenalistically phenomenalization/MS phenomenalize/S phenomenological/Y phenomenologist phenomenology/S phenomenom phenomenon phenothiazine phenotype phenotypic phenotypical/Y phenoxide phentolamine phenyl phenylalanine phenylamine phenylene phenylephrine phenylic phenylketonuria pheromone/MS phew phi phial phidias phidippides philae philander/DGRSZ philanderer/MS philanthropic philanthropical/Y philanthropise/S philanthropist/S philanthropize/S philanthropy/S philatelic philatelically philatelist philately philby philco philemon philharmonic philhellene philibeg philippe philippi philippians philippics philippopolis philips philistines phillips phillumenist philodendron philogyny philol philological/Y philologist philologists philology philomel philoprogenitive/P philosopher/MS philosophic philosophical/Y philosophisation/MS philosophise/DGRSZ philosophised/U philosophises/U philosophization/MS philosophize/DGRSZ philosophized/U philosophizes/U philosophy/MS philter philtre phimosis phiz phlebitis phlebosclerosis phlebotomisation phlebotomise/DGS phlebotomization phlebotomize/DGS phlebotomy phlegm phlegmatic phlegmatically phlegmy phloem phlogistic phlogiston phlogopite phlox phlyctena phnom phobia phobic phocaea phocine phocis phocomelia phoebe phoebus phoenicians phoenix phomvihane phon phonate/DGNS phone/DGMS phonematic phoneme/MS phonemic/S phonemically phonendoscope phonetic/S phonetical phonetically phonetician phoneticisation/MS phoneticise/S phoneticization/MS phoneticize/S phonetist phoney/S phonic/S phonically phonily phonocardiogram/MS phonocardiograph phonocardiographic phonocardiography phonogram/MS phonogramic phonogramically phonogrammic phonogrammically phonograph/R phonographic phonographically phonographs phonography phonolite phonolitic phonologial phonologic phonological/Y phonologist phonology phonometer phonon/S phonoreception phonoreceptor phonorecord phonos phonoscope phonotactics phonotype/S phonotypy phony/PRS phooey phosgene phosgenite phosophoric phosphatase phosphate/MS phosphatic phosphatide phosphatidic phosphatidyl phosphatisation/MS phosphatise/DGS phosphatization/MS phosphatize/DGS phosphaturia phosphene phosphide phosphine/S phosphino phosphite phosphocreatine phospholipid/S phosphonium phosphoprotein phosphor/S phosphorate phosphore phosphoresce phosphorescence phosphorescent/Y phosphoreted phosphoretted phosphoric phosphorise/AS phosphorism phosphorite phosphoritic phosphorize/AS phosphorolysis phosphorolytic phosphoroscope phosphorous phosphorus phosphoryl phosphorylase phosphorylate/NV phossy phot photic photically photo/MS photoactinic photoactive photoautotrophic photoautotrophically photobiologic photobiological photobiologist photobiology photobiotic photocatalyser/MS photocatalyzer/MS photocathode/S photocell photochemical/Y photochemist photochemistry photochromic photochromism photochronograph photocoagulation photocompose/R photocomposition photoconduction photoconductive photoconductivity photocopy/DGRS photocurrent photodecomposition photodetector photodiode/S photodisintegrate/N photodissociation photodissociative photodrama photoduplicate/N photodynamic/S photodynamically photoelastic photoelasticity photoelectric photoelectrically photoelectron photoelectronic photoelectrons photoelectrotype photoemission photoemissive photoengrave/GR photoengravers photofit photoflash photoflood photofluorogram/MS photofluorographic photofluorography photogene photogenic photogenically photogeologic photogeological photogeology photogram/MS photogrammetric photogrammetrist photogrammetry photograph/DGRZ photographic photographically photographise/S photographize/S photographs photography photogravure photoheliograph photoinduced photoinduction photoinductive photoionisation/MS photoionization/MS photoisomerisation/MS photoisomerization/MS photojournalism photojournalist/MS photojournalistic photokinesis photokinetic photolabeled photolabeler photolabeling photolabelled photolabeller photolabelling photolithograph/R photolithographic photolithographically photolithography photoluminescence photolysable photolyse/DGS photolysis photolytic photolytically photolyzable photolyze/DGS photomap photomechanical/Y photometer/MS photometric photometrically photometry photomicrgraphical photomicrogram/MS photomicrograph photomicrographic photomicrography photomicroscope photomicroscopic photomontage photomorphogenesis photomorphogenic photomultiplier photomural photon/MS photonasty photonegative photoneutron photonic photonuclear photooxidation photooxidative photoperiod photoperiodic photoperiodically photoperiodism photophilic photophilous photophily photophobia photophobic photophore photophysical photophysics photopia photoplay photopolymer photopolymerisation/MS photopolymerization/MS photopositive photoprint photoproduct photoproduction photoreaction photorealism photoreception photoreceptive photoreceptor photoreconnaissance photorecord/R photoreduction photoresistance photorespiration photoselected photoselection photosensitisation/MS photosensitise/DGRSZ photosensitive photosensitivity photosensitization/MS photosensitize/DGRSZ photoset photosetter photosphere photospheric photostat photostatic photosynthesis photosynthesise/DGS photosynthesize/DGS photosynthetic photosynthetically phototactic phototactically phototaxis phototelegraphy phototherapy photothermic phototonus phototopography phototransistor phototropic phototropically phototropism phototube phototype phototypeset phototypesetter phototypesetting phototypographic phototypography photovoltaic photozincography phrasal phrasally phrase/DGJS phrasemaker phrasemaking phrasemonger/G phraseogram/MS phraseograph phraseological/Y phraseologist phraseology/MS phratry/S phreatic phreatophyte phreatophytic phrenetic phrenic phrenitis phrenological/Y phrenologist phrenology phrensy phrixus phrygia phthalate phthalein phthalic phthalocyanine phthiriasis phthisic phthisis phut phycologist phycology phycomycete/S phyfe phyla phylactery phylae phylar phyle phylesis phyletic phyllary phyllite phylloclade phyllode phyllodium phylloid phyllome phyllomic phyllophagous phyllopod phylloquinone phyllotaxis phylogenetic phylogeny phylum physiatrics physiatrist physic/S physical/PSY physicalism physicalist physicalistic physicality physician/MS physicist/MS physicked physicking physicochemical physicochemically physiochemical physiocrat physiocratic physiognomic physiognomical/Y physiognomy physiographer physiographic physiographical physiography physiol physiologic physiological/Y physiologist physiology physiopathologic physiopathological physiopathology physiotherapist physiotherapy physique/D physoclistous physostigmine physostomous phytane phytoalexin phytochemical/Y phytochemist phytochemistry phytochrome phytoflagellate phytogenesis phytogenic phytogeographic phytogeographical/Y phytogeography phytography phytohormone phytolith phytoliths phytological/Y phytology phyton phytonic phytopathogen phytopathogenic phytopathologic phytopathological phytopathology phytophagous phytophagy phytoplankton phytoplanktonic phytosociological/Y phytosociologist phytosociology phytosterol phytotoxic phytotoxicity phytotoxin phytotron pi/M piacenza piacular piaf piaffe piaget pial pianism pianissimo pianist/S pianistic pianistically piano/MS pianoforte/MS pias piassava piaster piastre piave piaza piazza/MS piazze pibroch pic pica picador picadores picaninny picara picardy picaresque picaro picaroon picayune picayunish piccalilli piccanin piccaninny piccard piccolo piccoloist pice piceous pichiciego pick/DGJRSZ pickaback pickaninny pickaroon pickax pickaxe pickeer picker/GS pickerel/S pickerelweed picket/DGRSZ picketboat pickin pickle/DGS picklock pickoff/S pickpocket pickproof pickthank pickup/MS picky/R picnic/MS picnicked picnicker/S picnicking picnicky picnometer/MS pico picofarad/S picogram/MS picogramme/MS picojoule picoline picometer/MS picometre/MS picon picong picosecond/S picot picotee picrate picric picrite picrotoxin pictogram pictograph pictographic pictography pictor pictorial/PY pictorialisation/MS pictorialise/DGS pictorialism pictorialization/MS pictorialize/DGS picts picture/DGS picturegoer picturesque/PY picturisation/MS picturise/DGS picturization/MS picturize/DGS picul piddle/G piddock pidgin pidginisation pidginise/DGS pidginization pidginize/DGS pie/DRSZ piebald piece/DGRS piecemeal piecewise piecework/R piecrust piedmont piedmontite piefort pieing pieman piemonte pierce/DGS piercing/Y pieria pieridine piero pieta pietism pietist pietistic pietistical/Y pietro piety/S piezo piezochemistry piezoelectric piezoelectrically piezoelectricity piezometer/MS piezometric piezometry piffle/DGS pig/MS pigboat pigeon/MS pigeonberry pigeonfoot pigeonhearted pigeonhole/DGS pigeonwing pigface/D pigfish pigged piggery/S piggin pigging piggish/PY piggledy piggott piggy piggyback/DG pigheaded/P piglet/S pigmeat pigment/DS pigmentary pigmentation/S pigmentise/S pigmentize/S pigmy pignut pigpen/S pigroot pigskin pigstick/GR pigsty pigswill pigtail/D pigweed pika pike/DGMRS pikelet pikeman pikeperch pikestaff pilaf pilaff pilaster pilatus pilau pilch pilchard pilcomayo pile/DGJSZ pilea pileate/D pilei pileous pileum pileup pileus pilewort pilfer/DGRS pilferage pilgarlic pilgrim/MS pilgrimage/MS pilgrimise/S pilgrimize/S pili piliferous piliform pill/MS pillage/DGRS pillar/DS pillarise/S pillarize/S pillbox/S pillion/S pilliwinks pillory/DGS pillow/MS pillowcase/S pillwort pilocarpine piloerection pilose pilot/DGMS pilotage/S pilothouse pilotless pilsener pilsner pilular pilule pilus pimento pimiento pimp/GSY pimpernel pimple/DS pimplike pin/MS pinaceous pinafore/S pinar pinaster pinata pinball pinbone pincer/MS pincerlike pinch/DGRS pinchbeck pinchcock pinchpenny pinckney pincushion pindar pindling pindus pine/DGS pineal pineapple/MS pinecone pinedrops pinene pinero pinery pinesap pineta pinetum pinewood piney pinfeather pinfish pinfold ping/GR pingo pinguid pinhead/DS pinheaded/P pinhole/S pinion/DS pinite pink/DGPRSTY pinkeye pinkie/S pinkish/P pinko/S pinkoes pinkroot pinky pinna/S pinnace pinnacle/DGMS pinnae pinnal pinnate/Y pinnatifid pinnatipartite pinnatiped pinnatisect pinned pinner pinning/S pinniped/MS pinnula pinnular pinnulate/D pinnule pinny pinochet pinochle pinole pinpoint/DGS pinprick/S pinscher pinsetter pinspotter pinstripe pint/MRS pinta pintadera pintail/S pintle pinto pintoes pinturicchio pinup pinwheel pinwork pinworm pinxter piny piolet pion pioneer/DGS pionic pious/PY pip pipa pipage pipal pipe/DGJRSZ pipeage pipeclay pipefish pipefitting pipeful pipeless pipelike pipeline/DGS piperaceous piperazine piperidine piperine piperonal pipestone pipet pipette pipewort pipgras piping/SY pipistrelle pipit pipkin pippin pipping pipsissewa pipsqueak piquancy piquant/PY pique/DG piquet piracy piragua pirandello piranesi piranha piraro pirate/DGMS piratical/Y piratise/S piratize/S pirhouette pirn pirog pirogue piroplasm piroplasma piroplasmata pirouette/G pirozhki piscary piscatorial piscicultural pisciculture pisciculturist piscina piscine piscivorous pisgah pish pishogue pishpek pisiform pisistratus pismire pisolite pisolitic piss/DGRS pissarro pissoir pistachio pistareen piste pistil/MS pistillate pistoia pistol/MS pistole pistoled pistoleer pistoleers pistoling pistolled pistolling piston/MS pit/MS pita pitapat pitch/DGRSZ pitchblende pitchfork/MS pitchman pitchometer/S pitchout pitchstone pitchy piteous/PY pitfall/MS pith/DGS pithead pithily pithos pithy/PRT pitiable/P pitiably pitiful/PY pitiless/PY pitman piton/MS pitot pitsaw pittance/MS pitted pitting pituitary pituri pity/DGRSZ pitying/Y pityriasis piura pivot/DGS pivotable pivotal/Y pivotman pix pixel/MS pixie pixieish pixilated pixilates pixilation pixmap/MS pixy/PS pizazz pize pizz pizza pizzazz pizzeria pizzicato pizzle placability placable placably placard/MS placate/DGNRSV placatory place/ADGRS placeable placebo placed/AU placeholder placeless/Y placeman placemat/MS placement/AMS placency placent placenta placental placentation/S placentia placet placid/PY placidity placket placoderm placoid plafond plagal plage plagiarisation/MS plagiarise/DGRSZ plagiarism plagiarist plagiaristic plagiarization/MS plagiarize/DGRSZ plagiary plagioclase plagioclimax plagiotropism plague/DGRS plagued/U plaguesome plaguey plaguily plaguy plaice plaid/DMS plain/PRSTY plainchant plainclothes plainclothesman plainsman plainsong plainspoken/P plaint plaintext plaintful plaintiff/MS plaintive/PY plainview plaister plait/GMRS plan/DGMRSZ planar planarian planarity planation planchet planchette plane/DGMRSZ planeload planet/MS planetaria planetarium planetary planetesimal planetoid/S planetoidal planetological planetologist planetology planform plangency plangent/Y planimeter/MS planimetric planimetry planish/R planisphere planispheric plank/GS plankton planktonic planless/PY planned/U planner/MS planning plano planoconcave planoconvex planogamete planograph planographic planography planometer planosol plant/DGJRSZ plantable plantagenet plantain plantar plantation/MS planted/A plantigrade plantlike plantocracy planula planular planuloid plaque/S plash plashy plasm plasma plasmagel plasmagene plasmagenic plasmalemma plasmapheresis plasmasol plasmatic plasmid/MS plasmin plasminogen plasmodesm plasmodesma plasmodium plasmogamy plasmolyse plasmolysis plasmolytic plasmolytically plasmolyze plasmon plasmosome plasodesma plassey plaster/DGRSZ plasterboard plasterwork plastery plastic/SY plastically plasticisation/MS plasticise/DGRSZ plasticity plasticization/MS plasticize/DGRSZ plastid plastidial plastisol/S plastogene plastometer plastral plastron plat plata plataea platan plate/DGJRSZ plateau/MS plateaux plateful platelayer/S platelet/MS platelike platemaker platemaking platemark/S platen/MS plateresque platform/MS plath platies platina platinic platiniferous platiniridium platinisation/MS platinise/DGS platinization/MS platinize/DGS platinocyanic platinocyanide platinoid platinotype platinous platinum platipi/M platitude/S platitudinal platitudinarian platitudinisation platitudinise/DGS platitudinization platitudinize/DGS platitudinous/Y platonic platonically platonisation platonise/DGS platonization platonize/DGS platoon/S platted platter/MS platterful platting platy platyhelminth platypus/MS platyrrhine plauded plauding plaudit plauen plause/V plausibility plausible/P plausibly play/DGRSZ playa playability playable playact playback/S playbill/S playbook playboy/S player/MS playful/PY playgirl playgoer/S playground/MS playgroup/S playhouse/S playland playlet playmaker playmate/MS playoff playpen/MS playroom playschool playsuit plaything/MS playtime playwright/MS playwriting plaza/S plea/MS pleach plead/DGJRS pleadable pleader/A pleading/SY pleas/DGRS pleasance pleasant/PUY pleasantry please/DGRSY pleased/U pleasing/PY pleasurability pleasurable/P pleasurably pleasure/DGS pleasureless pleat/DRS pleatless pleb plebby plebe/S plebeian/Y plebeianise/S plebeianism plebeianize/S plebian plebiscitary plebiscite/MS plebs plectognath plectrum/MS pled pledge/DGRS pledgee pledget pledgor pleiad pleiocene pleiotropism plenary plenipotent plenipotentiary plenish plenitude plenitudinous plenteous/PY plentiful/PY plentitude plenty/S plenum pleochroism pleomorphism pleonasm pleopod plesiosaur plessor plethora plethoric plethysmograph pleura/S pleurae pleural pleurisy pleuritic pleurodont pleurodynia pleuron pleuropneumonia pleurotomy pleuston pleven plex plexiform plexiglass plexor plexus pliability pliable/P pliably pliancy pliant/PY plica plicate plight/R plimsoll plink/DGRS plinth ploat plod/S plodded plodder plodding/Y plodge plonk plonko plop plopped plopping plosion plosive plot/MS plotinus plotless/P plottable plottage plotted plotter/MS plotting plotty/R plough/DGRS ploughable ploughboy ploughboys ploughhead ploughman ploughmen ploughs ploughshare/MS ploughstaff plover/S plow/DGRS plowable plowboy plowhead plowman plowmen/M plowshare/MS ploy/MS pluck/DGR pluckily plucky/PR plug/MS plugboard/MS pluggable plugged/U plugger plugging/U plugs/U plum/DGMS plumage/DS plumate plumb/DGMRSZ plumbaginaceous plumbaginous plumbago plumbate plumbed/U plumbeous plumbic plumbicon plumbiferous plumbism plumbous plumbum plume/DGS plumelet plumlike plummer plummet/DS plummeting plummy/R plumose/Y plump/DNPRY plumpish plumulate plumule plumulose plumy/R plunder/DGRSZ plunderable plunderage plunderous plunge/DGRSZ plunk/GRZ pluperfect plural/SY pluralisation/MS pluralise/DGRSZ pluralism pluralist/S pluralistic pluralistically plurality pluralization/MS pluralize/DGRSZ pluriaxial pluriliteral pluripotent pluripresence plus/S plush/PY plushy/PR plussage plusses plutocracy plutocrat plutocratic plutocratically pluton plutonian plutonic plutonium plutus pluvial pluviometer pluvious ply/DGNRSZ plyscore plywood pma pneuma pneumatic/S pneumatically pneumaticity pneumatology pneumatolysis pneumatolytic pneumatometer/MS pneumatophore pneumatophoric pneumectomy pneumobacillus pneumococcus pneumoconiosis pneumodynamics pneumogastric pneumograph pneumonectomy pneumonia pneumonic pneumonitis pneumothorax pnom poaceous poach/DGRSZ pocahontas pochard pock pocket/DGS pocketbook/MS pocketful pocketknife/M pocketknives pockmark pocky poco pococurante pocus pod/MS podagra podagral podded podding poddy podesta podge/RZ podgorica podgy/R podia podiatric podiatrist podiatry podite poditic podium podophyllin podsol poem/MS poenology poesy/S poet/MS poetaster poetess poetic/S poetical/PY poeticisation poeticise/DGS poeticism poeticization poeticize/DGS poetisation/MS poetise/DGRSZ poetization/MS poetize/DGRSZ poetry/MS pogey pogge pogo pogrom/S pogromise/S pogromist pogromize/S pogy pohai pohutukawa poi poignancy poignant/Y poikilotherm poikilothermic poikilothermism poilu poinciana poind poinsettia point/DGRSZ pointe pointed/PY pointillism pointillist pointilliste pointillistic pointless/PY pointsman pointwise pointy/RT poirot poise/DGS poison/DGRS poisonous/PY poitiers poitou poitrine poke/DGRS pokeberry pokelogan pokerface/D pokeweed pokey/S pokie pokily poky/PR pol pola polacre polar polarimeter/MS polarimetric polarimetry polarisability/MS polarisable/SU polarisation/MS polariscope polariscopic polarise/DGRSZ polariton polarity/MS polarizability/MS polarizable/MSU polarization/MS polarize/DGRSZ polarogram/MS polarograph polarographic polarographically polarography polaron polder pole/DGRS poleax poleaxe polecat poleless polemarch polemic/S polemical/Y polemicise/DGS polemicist polemicize/DGS polemise/DGS polemist polemize/DGS polemoniaceous polemonium polenta polestar poleward poleyn police/DGMS policeman/M policemen/M policewoman/M policewomen policise/RSZ policize/RSZ policy/MS policyholder/S policymaker/S policymaking polio poliomyelitic poliomyelitis poliovirus polis polish/DGRSZ politburo polite/PRTY politesse politic/S political/Y politicalise/S politicalize/S politician/MS politicisation politicise/GRSZ politicised politicization politicize/GRSZ politicized politick/R politicking politico/S polities politise/S politize/S polity polka/MS polkadot/S poll/DGNRS pollaiuolo pollan polled/U pollee pollenate/DGNS polleniser pollenizer pollenosis pollex pollical pollices pollinate/DGNS pollinator pollinic polliniferous pollinise/DGRS pollinium pollinize/DGRS pollinosis polliwog pollock polloi pollster pollutant/S pollute/DGNRSV polluted/U pollywog/MS polo poloist polonaise polonium polony poltava poltergeist poltroon poltroonery poltroonish/Y poly polyadelphous polyamide polyandrous polyandry polyanka polyantha polyanthus polyatomic polybasic polybasite polybius polybutene/S polycarbonate polycarpellary polycarpic polycarpous polycarpy polycentrism polychaete polychaetous polychasium polychemicals polychotomous polychotomy polychromatic polychromatise/S polychromatize/S polychrome polychromise/S polychromize/S polychromy polycistronic polyclinic polycondensation polyconic polycot polycotyl polycotyledon polycotyledonous polycrates polycrystal polycrystalline polycyclic polycythemia polycythemic polydactyl polydactylous polydactyly polydemic polydeuces polydipsi polydipsia polydisperse polydispersity polyelectrolytes polyembryony polyester/S polyether/S polyethylene polygala polygalaceous polygamic polygamical/Y polygamise/S polygamist polygamize/S polygamous/Y polygamy polygene polygenesis polygenesist polygenetic polygenetically polygenic polyglandular polyglot polyglotism polyglottism polygnotus polygon/MS polygonaceous polygonal/Y polygonum polygram/MS polygraph polygraphic polygynoecial polygynous polygyny polyhedra polyhedral polyhedron polyhedrosis polyhistor polyhistoric polyhydric polyhydroxy polyisobutylene polyisocyanates polyisoprene polymath polymathic polymathy polymer/MS polymerase polymeric polymerically polymerisation/AM polymerisations polymerise/AS polymerism polymerization/AM polymerizations polymerize/AS polymerous polymorph polymorphic polymorphically polymorphism polymorphonuclear polymorphous/Y polymyositis polymyxin polyneuritis polynices polynomial/MS polynuclear polynucleotide polynya polyonymous polyoxyethene polyp polypary polypeptide polypeptidic polypetalous polyphagia polyphagous polyphagy polyphase polyphasic polyphenol polyphenolic polyphone polyphonic polyphonically polyphonous/Y polyphony polyphosphate/S polyphosphoric polyphyletic polyphyletically polyphyleticism polyphyodont polypide polyploid polyploidy polypnea polypneic polypod polypody polypoid polypous polypropylene polyprotodont polyptych polypus polyrhythm polyrhythmic polyrhythmically polyribonucleotide polyribosomal polyribosome polysaccharide/S polysaprobic polysemous polysemy polysepalous polysilicon polysiloxanes polysome polysomic polysorbate polystichous polystyrene polysulfide polysulphide polysulphurisation/MS polysulphurization/MS polysyllabic polysyllabically polysyllable polysyllogism polysynaptic polysynaptically polysyndeton polytechnic polytene polyteny polytheism polytheist polytheistic polytheistical polythene polythetic polythionic polytocous polytonal/Y polytonality polytope polytrophic polytype polytypic polytypism polytypy polyunsaturated polyurethane polyuria polyvalence polyvalent polyvinyl polyvinylidene polywater polyxena polyzoan polyzoarium polyzoic pom pomace pomaceous pomade/DS pomander pomatum pombal pombe pome pomegranate pomelo pomerania pomeranian pomfret pomiculture pomiferous pommel pommeled pommeling pommelled pommelling pommern pommy pomological/Y pomologist pomology pomorze pomp pompadour pompano pompey pompidou pompon pompons pomposity pompous/PY pon poncho pond/RSZ ponder/DGRS ponderable ponderosa/MS ponderous/PY pondicherry pondokkie pondweed pone/A pong pongee pongid poniard pons pont ponta pontchartrain pontefract pontevedra pontianak pontifex pontiff pontific pontifical/S pontificaly pontificate/DGNS pontificator pontifices pontil pontine pontius ponton pontonier pontoon pontormo pontus pontypool pontypridd pony/MS ponytail pooch/D pood poodle poof pooftah pooh pool/DGS poolroom poon poona poonce poop poor/PRTY poorhouse poorish poove pop/MS popcorn pope/MS popedom popery popeyed popgun popinjay popish/Y poplar poplin popliteal popover poppa poppadom popped popper poppet popping popple poppy/DMS poppycock poppyhead poppyseed popsicle popsy populace populaire/S popular/Y popularisation/MS popularise/DGRSZ popularises/U popularism popularity/U popularization/MS popularize/DGRSZ popularizes/U populate/DGNSX populism populist populistic populous/PY porbeagle porcelain porcelainisation/MS porcelainise/S porcelainization/MS porcelainize/S porcelainlike porcelaneous porcellaneous porch/MS porcine porcupine/MS pore/DGS porgy pori poriferal poriferan porirua porism pork/R porkpie porky/S porn pornocracy pornographer pornographic pornographically pornography poromeric porosimeter porosity porous/PY porphyria porphyrin porphyritic porphyrogenite porphyroid porphyropsin porphyry porpoise/S porrect porridge porringer porsena port/DGRSYZ portability portable/S portably portadown portage/DG portal/MS portamento/M portance portative portcullis portend/DGS portent/S portentous/PY porter/GS porterage porterhouse portfire portfolio/S porthole portico portiere portion/DGMS portionise/S portionize/S portionless portlaoise portly/PR portmanteau/S portobello portrait/MS portraitist portraiture portray/DGRS portrayal/S portress portulaca portulacaceous posable posada pose/DGRSZ poseur/S posey posh/T posho posit/DGSV position/ADGS positional positive/PSY positivise/S positivism positivist/S positivistic positivity positivize/S positron positronium posology poss posse/S posseman possemen possess/DGSV possessed/PY possession/MS possessional possessive/MPSY possessor/MS possessory posset/S possibility/MS possible/S possibly possie possum/MS post/DGJRSZ postage postal postaxial/Y postbag/S postbellum postbox/S postboy/S postbreeding postcard/MS postcava postclassic postclassical postcode/S postcolonial postcondition/S postdate/DGS postdental postdiluvian postdoctoral postdoctorate postembryonal postembryonic postemergence poster/MS posteriad posterior/Y posteriori posteriority posterise/S posterity posterize/S postern postexilian postexilic postface postfix/DGS postform postglacial postgraduate posthaste posthole posthumous/PY posthypnotic postiche posticous postie postil postilion postillion postimpressionism postliminy postlude/S postman postmarital postmark/DS postmaster/MS postmastership postmen postmenopausal postmeridian postmillenarian postmillenarianism postmillennial postmillennialism postmillennialist postmistress postmodern postmortem postmultiply postnasal postnatal/Y postnuptial/Y postoperative/Y postorbital postorder postpaid postpartum postpituitary postponable postpone/DGRS postponement postposition postpositional/Y postpositions postpositive/Y postprandial/Y postprocess postprocessor/S postrider postschool postscript/MS postsecondary postsynaptic postsynaptically postsynchronisation postsynchronization posttension posttraumatic postulancy postulant postulate/DGNSX postulational postulator postural posture/DGMRS posturise/S posturize/S postvocalic postwar posy/S pot/MS potability potable/P potage potamic potamology potash potassic potassium potation potato potatoes potatory potbelly/D potboil/RZ potboy potch poteen potemkin potence potency potent/Y potentate/MS potential/SY potentialisation/MS potentialise/S potentiality/S potentialization/MS potentialize/S potentiate/N potentiating potentiator potentiometer/MS potentiometric potentiostat potentise/S potentize/S potful pothead pothecary potheen pother/DG potherb pothole/DG pothook pothouse pothunter pothunting potiche potion/S potiphar potlatch/S potluck potman potoroo potpie potpourri potsdam potsherd potshot potshotting potstone pottage pottawatomie potted potter/MRS potteringly pottery/S potting pottle potto/S potty/RS potyomkin pouch/DMS pouchy/R pouf pouff/D poulard poularde poult poulterer poultice/S poultry poultryman pounce/DGS pouncet pound/DGRSZ poundage poundal pour/DGRSZ pourable pourboire pouring/Y pourparler pourpoint poussette/DG poussin/S pout/DGRS pouty poverty pow powan powder/DGRS powderisation/MS powderise/RSZ powderization/MS powderize/RSZ powderman powdermen powderpuff powdery power/DGS powerboat powerful/PY powerhouse/MS powerless/PY powwow powys pox/S poxvirus poyang poza pozsony pozzuolana pozzuoli pozzy ppm pracharak practicability practicable/P practicably practical/PY practicality/S practicalization/MS practicalize/RSZ practice/MS practiced/U practicer practician practicing practicum practise/DGRS practised/U practitioner/MS pradesh praecox praedial praemunire praenomen praetor praetorius pragmat/S pragmatic/S pragmatical pragmatically pragmaticism pragmaticist pragmatism pragmatist/S pragmatistic praha prairie/S praise/DGRSZ praiseworthily praiseworthy/P praising/Y prajna praline pralltriller pram/S prance/DGRS prancing/Y prandial prang prank/MS prankish/PY prankster/S prase praseodymium prat prate/DGRS pratfall pratincole prating/Y pratique prato prattle/DGRS prattling/Y prau prawn/RS praxeological praxeology praxes praxis praxiteles pray/DGRSZ prayer/MS prayerful/PY pre/T preach/DGRSZ preacherise/S preacherize/S preachify/S preachily preaching/Y preachment preachy/PR preacknowledgement/MS preacknowledgment/MS preadamite preadapt/DV preadaptation preadolescence preadolescent preallocate/DGNSX preallocation/MS preallocator/S preamble/S preamplifier/S preanaesthetic/S preanesthetic/S prearrange prearranged prearrangement preassign/DGS preatomic preaxial/Y prebaptise/S prebaptize/S prebend prebendal prebendary prebind prebiologic prebiological prebiotic precall precancel precancelation precancellation precancerous precarious/PY precast precatory precaution/DGMS precautionary precautious precede/DGS precedence/MS precedency precedent/DS precedented/U precedential preceed preceeded preceeding precensor precentor precentorial precentorship precept/MSV preceptive/Y preceptor preceptorial preceptorship preceptory preceptress precess/DGS precession precessional prechlorination precinct/MS preciosity precious/PY precipice precipitable precipitance precipitancy precipitant/PY precipitate/DGNPSVY precipitator precipitin precipitinogen precipitinogenic precipitous/PY precis precise/NPXY precisian precisianism precisionise/S precisionist precisionize/S precivilisation/MS precivilization/MS preclinical preclude/DGS preclusion preclusive/Y precoat/G precocial precocious/PY precocity precode/D precognition precognitive precollege precolonial precolor/GJMS precolorable/MS precolour/GJMS precolourable/S precombustion precompact precompile/DGS precompose precomputation precomputed preconceive/D preconception/MS preconceptual preconcert/D preconcerted/PY precondition/DS preconisation/MS preconise/RSZ preconization/MS preconize/RSZ preconnected preconnection preconscious preconsolidate/DGNS preconsonantal precook precooked precritical precriticise/S precriticize/S precursor/MS precursory precut predaceous/P predacious predacity predate/DGNS predator/MS predatorily predatory predawn predecease predecessor/MS predecline predefense/MS predefine/DGS predefinition/MS predella predesignate/N predestinarian predestinarianism predestinate/N predestinator predestine predestined predeterminate predetermination predetermine/DGRS predial predicable predicament predicant predicatable predicate/DGNSVX predicator predicatory predict/DGSV predictability/U predictable/U predictably/U predicted/U prediction/MS predictive/Y predictor/S predigest predigested predigestion predikant predilect predilection/S predispose/DS predisposition/S prednisone predoctoral predominance predominancy predominant/Y predominate/DGNSY predrilled preemergence preemergent preemie preeminence preeminent/Y preemphasization/M preemphasize/DGRSZ preemployment preempt/DGSV preemption preemptive/Y preemptor preen/GR preexchange/D preexist preexistence preexistent preexisting prefab prefabricate/DN preface/DGRS prefatorial/Y prefatorily prefatory prefavor/MS prefavorable/MS prefavorably/S prefavorite/MS prefavour/MS prefavourable/S prefavourably/S prefavourite/MS prefect/S prefectural prefecture/S prefer/S preferability preferable/P preferably preference/MS preferential/Y preferment preferred preferrer preferring prefertilisation/MS prefertilise/S prefertilization/MS prefertilize/S prefiguration prefigurative/PY prefigure/DGS prefigurement prefill/DGS prefix/DGS prefixal/Y preflavor/GJMS preflavour/GJMS preflight/DGS prefocus/DGS preform/DS preformation prefrontal pregalvanise/S pregalvanize/S preglacial pregnability pregnable pregnancy/S pregnant/Y pregnenolone preheat/DR prehensile prehensility prehension/A prehistorian prehistoric prehistorical/Y prehistory prehominid prehumor/MS prehumour/MS preignition preincubate/DGS preinduction preindustrial preinitialise/DGS preinitialize/DGS preinterview preisolated prejudge/DR prejudgement prejudgment/MS prejudice/DGS prejudiced/U prejudicial/PY prejudicious/Y prelabor/MS prelabour/MS prelacy prelate prelatise/S prelatism prelatize/S prelature prelect prelection prelexical prelibation prelicense/DGRS preliminarily preliminary/S prelims preliterate prelocalisation/MS prelocalization/MS prelude/DGMRS preludise/S preludize/S prelusion prelusive/Y prelusory premalignant preman premarital/Y premarket premature/PY prematurity premaxilla premed premediaeval/MS premediaevalism/MS premedial premedian premedical premedication premedieval/MS premedievalism/MS premeditate/NV premeditated/Y premeditator premeiotic premenstrual/Y premership premie premier/DGMS premiere/DGS premiership premillenarian premillenarianism premillennial/Y premillennialism premillennialist premise/DGMS premiss premium/MS premix/D premolar premonish premonition/S premonitorily premonitory premonopolise/S premonopolize/S premorse premultiply/DG premultiplys premune premunition prename prenatal/Y prenomen prenominal prenominate/N prenotion preoccupancy preoccupation/S preoccupy/DS preoffence/MS preoffense/MS preopened preoperative/Y preorbital preordain/DGS preordainment preordination preorganisation/MS preorganise/S preorganization/MS preorganize/S preoviposition preovulatory preoxidation preoxidise/DGS preoxidize/DGS prep prepackage prepackaged preparation/MS preparative/MSY preparator preparatorily preparatory prepare/DGRS prepared/PY prepausal prepay prepayment prepend/DGRSZ prepense/Y preplan preponderance/S preponderancy preponderant/Y preponderate/GNY preposition/MS prepositional/Y prepositive/Y prepositor prepossess/G prepossessing/PY prepossession preposterous/PY prepotency prepotent/Y preppie prepping preprandial preprepared preprint/DGS preprocess/DS preprocessing preprocessor/S preproduction preprofessional preprogram preprogramme preprogrammed prepuberal/Y prepubertal/Y prepuberty prepubescence prepubescent prepublication prepuce prepunch prepupal preputial preradiation prerealisation/MS prerealise/S prerealization/MS prerealize/S prerecognise/S prerecognize/S prerecord prerelease prerequisite/MS prerogative/DMS presa presage/DGRS presageful presanctified presbyope presbyopia presbyopic presbyter presbyterate presbyterial/Y presbytery prescan preschool/R prescience/M prescient/Y prescientific prescind prescore prescribe/DGRS prescribed/U prescript prescriptible prescription/MS prescriptive/Y prescriptivism prese preselect/DGS preselection presell presence/MS present/DGPRSYZ presentability presentable/P presentably presentation/AMS presentational presentationism presentative presentee presentient presentiment presentimental presentment presentments preservable preservation/S preservationist preservative/MS preserve/DGRSZ preserved/U preset/S presettable presetting preshrunk preside/DGRS presidency president/MS presidential/Y presidentship presidial presidiary presidio presidium presignify presley presoak presoaks prespecialise/S prespecialize/S presplendor/MS presplendour/MS press/DGJRS pressboard pressing/SY pression pressman pressmark pressmen pressor/A pressroom pressrun pressure/DGS pressurisation pressurise/DGRSZ pressurization pressurize/DGRSZ presswork prest/R prestandardisation/MS prestandardise/S prestandardization/MS prestandardize/S prestel presternum prestidigitate/N prestidigitator prestige prestigeful prestigious/PY prestissimo presto/S prestonpans prestress/D prestwich presumable presumably presume/DGRS presuming/Y presumption/MS presumptive/Y presumptuous/PY presuppose/DGS presupposition/S presympathise/S presympathize/S presynaptic presynaptically pretax preteen pretence/NSVX pretend/DGRSZ pretended/Y pretending/U pretense/NSVX pretensionless pretentious/PUY preterhuman preterit/V preterite/NV preterminal pretermission pretermit preternatural/PY pretest/DGS pretext/MS pretonic pretor pretorius pretreat pretreatment pretrial prettify/N prettily pretty/DGPRST prettyish pretubercular pretuberculous pretzel pretzels preutilisable/S preutilisation/MS preutilise/S preutilizable/MS preutilization/MS preutilize/S prevail/DGS prevailing/Y prevalence prevalent/Y prevaricate/DGNS prevaricator prevenient/Y prevent/DGRSV preventability preventable preventably preventative preventible prevention/S preventive/PSY preverbal preview/DGRSZ previous/PY previse prevision/DGS previsional previsionary prevocalic prevocational prevue prewar prexy prey/DGRS priapic priapism pribilof price/DGRSZ priced/U priceless pricey prick/DGRSY pricket prickle/DG prickly/PR pricky/R pricy/R pride/DGS prideful/PY priest/SY priestcraft priestess/S priesthood priestly/P prieur prig priggery priggish/PY priggism prill prim/PY prima primacy primaeval primal primality primaquine primarily primary/MS primate/S primateship primatial primatives primatological primatologist primatology prime/DGPRSYZ primed/U primero primeval/Y primigravida primine primipara primiparity primiparous primitive/PSY primitivism primitivist primitivistic primitivity primmer primmest primming primo/S primogenitor primogeniture primordial/Y primordium primp/G primrdium primrose primula primulaceous primus prince/SY princedom princekin princelet princeling princely/PR princeship princess/MS princesse principal/SY principality/MS principalship principial principium principle/DS princox prink/R print/DGRSZ printability printable/U printably printed/AU printemps printery printless printmake/GRZ printout/S prior/SY priorate prioress/S priori priorisation/S priorise/DGS prioritisation prioritise/DGJRSZ prioritization prioritize/DGJRSZ priority/MS priorization/S priorize/DGS priorship priory pripet prisage prise prisere prism/MS prismatic prismatically prismatoid prismatoidal prismoid prismoidal prison/RSZ prisoner/MS prissily prissy/PR pristane pristine/Y prithee privacy/S privatdocent privatdozent private/NPSVXY privateer/MS privatisation/A privatise/DG privatism privative/Y privatization/A privatize/DG privet privilege/DS privileged/U privily privity privy/MS prix prize/DGRSZ prizefight/GR prizewinner pro/MS proa proach/G proactive probabilism probabilist probabilistic probabilistically probability/S probable probably proband probang probate/DGNSV probates/A probation/RZ probational/Y probationary probatory/A probe/DGJRS probenecid probit probity problem/MS problematic/U problematical/UY problemise/S problemize/S probosces proboscidean proboscidian proboscis proc procaine procambial procambium procarp procaryote procaryotic procathedral procedural/Y procedure/MS proceed/DGJRS proceleusmatic procephalic procercoid process/DGMS processability processable/A processed/AU processibility processible procession processional/Y processionise/S processionize/S processor/MS prochronism proclaim/DGRSZ proclamation/MS proclimax proclitic proclivity/MS proclus proconsul proconsular proconsulate proconsulship procopius procrastinate/DGNS procrastinator/MS procreant procreate/NV procreativity procreator procrustean procryptic proctodaeum proctologic proctological proctologist proctology proctor/DGMS proctorial proctorisation/MS proctorise/S proctorization/MS proctorize/S proctorship proctoscope procumbent procurable procurance procuration procurator procuratorial procuratory procure/DGRSZ procurement/MS procuress prod prodded prodder prodding prodigal/Y prodigalise/S prodigality prodigalize/S prodigious/PY prodigy/S prodromal prodromata prodrome/S prodromic producable produce/ADGRSZ producible/A product/MSV production/AMS productional productise/DGRSZ productive/PY productively/A productivity/S productize/DGRSZ proem proemial proenzyme proestrus prof profanation profanatory profane/DGPRY profanise/S profanity profanize/S profess/DGS professed/Y professeur profession/MS professional/SY professionalisation/MS professionalise/DGS professionalism/S professionalization/MS professionalize/DGS professionise/S professionize/S professor/MS professorate professorial/Y professoriat professoriate professorship proffer/DGS proficiency/S proficient/Y profile/DGRSZ profiler/MS profili profit/DGMRSZ profitability profitable/PU profitably/U profiteer/MS profiterole profitless profitted profitting profligacy profligate/SY profluent profound/PTY profoundity profundity profuse/NPY prog progamete progenitive progenitor progeny progestational progesterone progestin progestogen progging proglottid proglottidean proglottis prognathic prognathism prognathous prognoses prognosis prognostic prognosticate/NV prognosticator prograde program/MS programability programable programed/A programer/AMS programing/A programist/MS programistic/S programmability programmable programmatic programmatically programme/MS programmed/A programmer/AMS programmes/A programming/A programmist/MS programmistic/S progress/DGSV progression/MS progressional progressionist progressist progressive/PY progressivism progressivist progressivistic prohibit/DGRSV prohibition/MS prohibitionist prohibitive/PY prohibitory project/DGMSV projectable projected/U projectile/S projection/MS projectional projectionist/S projective/Y projector/MS projet/S prokaryote prokaryotic prolactin prolamin prolamine prolan prolapse/DG prolate prole proleg prolegomena prolegomenon prolepsis proleptic proletarian proletarianisation proletarianise/GS proletarianised proletarianization proletarianize/GS proletarianized proletariat proliferate/DGNSV proliferous/Y prolific/P prolificacy prolifically prolificity proline prolix/Y prolixity prolocutor prolog/MS prologize prologue/MS prologuise/RSZ prologuize/RSZ prolong/DGRS prolongate/DGNS prolotherapy prolusion/S prolusionise/S prolusionize/S prolusory prom promazine promenade/GMRS promethazine promethium prominence prominent/Y promiscuity/M promiscuous/PY promise/DGRS promisee promising/UY promisor promissory promontory/S promotability promotable promote/DGNRSVXZ promotional promotive/P prompt/DGJPRSTYZ promptbook/S prompted/U promptitude promulgate/DGNSX promulgator promulgators promycelium pronatalism pronatalist pronate/DGN pronator prone/PY pronephric pronephros prong/DS pronghorn/S pronominal/Y pronominalisation pronominalise pronominalization pronominalize pronoun/MS pronounce/DGRS pronounceable/U pronounced/Y pronouncement/MS pronto pronuclear pronucleus pronunciamento pronunciation/MS pronunciational proof/DGMRS prooflike proofread proofreader proofreading proofreads proofroom prop/RS propaedeutic propagable propaganda propagandise/DGS propagandism propagandist/S propagandistic propagandistically propagandize/DGS propagate/DGNSVX propagated/U propagational propagator propagule propane propanoic proparoxytone propel/S propellant/S propelled propellent propeller/MS propelling propellor propenamide propend propene propense propensity/S proper/PY properdin propertied/U propertius property/DS propertyless prophage prophase prophasic prophecy/MS prophesy/DGRS prophet/MS prophetess prophetic prophetical prophetically prophetise/S prophetize/S prophylactic prophylactically prophylaxis propine/DG propinquity propionate propionibacteria propionic propitiable propitiate/N propitiator propitiatory propitious/PY propjet proplastid propman propolis propone/DG proponent/MS propontis proportion/DGRS proportionable proportionably proportional/Y proportionality proportionate proportionately proportionment propos proposal/MS propose/DGRSZ proposition/DGS propositional/Y propositionise/S propositionize/S propositus propound/DGRS propped propping propraetor propranolol propretor proprietary proprietor/MS proprietorship/S proprietress propriety proprioception proprioceptive proprioceptor proptosis propulsion/MS propulsive propyl propylaeum propylene propylite prorate/DGN prorogate/N prorogue/DG pros/GR prosaic prosaically prosaism prosaist prosateur proscenium/S prosciutto proscribe/DGRS proscription proscriptive/Y prose/GR prosector prosectorial prosecutable prosecute/DGNSX prosecutor/S proselyte proselytisation/MS proselytise/DGRSZ proselytism proselytization/MS proselytize/DGRSZ proseminar prosencephalic prosencephalon prosenchyma/S prosenchymata prosenchymatous proserpina prosily prosit proso prosobranch prosodic/S prosodical/Y prosodist prosody/S prosoma prosomal prosopographical prosopography prosopopoeia prospect/DGSV prospection/MS prospective/PSY prospector/MS prospectus prosper/DGS prosperity prosperous/PY prossed prosser prost prostaglandin prostate prostatectomy prostatic prostatism prostatitis prostheses prosthesis prosthetic/S prosthetically prosthodontics prosthodontist prostitute/S prostitution prostitutor prostomial prostomium prostrate/DN prostyle prosy/PR protactinium protagonist/S protagoras protamine protandrous protanopia protasis protatic protea protean protease/S protect/DGSV protectant protected/UY protection/MS protectionise/S protectionism protectionist protectionize/S protective/PY protector/MS protectoral protectorate protectorship protectory protectress protege/MS proteid proteide protein/MS proteinaceous proteinase proteinate proteinuria proteinuric protend protensive/Y proteoclastic proteolysis proteolytic proteose proteranthous proteranthy proters protest/DGMRSZ protestant protestantism protestants protestation/S protester/MS protesting/Y protestor proteus prothalamion prothalamium prothallial prothallium prothallus prothesis prothetelic prothetely prothetic prothonotarial prothonotary prothoracic prothorax prothrombin protist protistan protitch protium proto protoactinium protochordate protocol/MS protocoled protocoling protocolisation/MS protocolise/S protocolization/MS protocolize/S protocolled protocolling protoderm protodermal protogalaxy protogeometric protogynous protohistorian protohistoric protohistory protohuman protolanguage protolithic protomartyr protomorphic proton/MS protonate/DN protonema protonemal protonematal protonic protonotary protonymph protonymphal protopathic protophloem protophyta protoplanet protoplasm protoplasmic protoplast protoplastic protoporphyrin protosemitic protostar protostele protostelic prototherian prototroph prototrophic prototrophy prototypal prototype/DGMS prototypic prototypical/Y protoxide protoxylem protozoa protozoal protozoan protozoic protozoological protozoologist protozoology protozoon protract/DV protractile protraction protractor protreptic protrude/DGS protrusible protrusile protrusion/MS protrusive/PY protuberance protuberant protuberate protuberatly protude/GS protyle proud/RTY proudful proudhearted proudhon proustite prout provability/U provable/P provably provascular prove/DGRSZ proved/AU provement proven/Y provenance provender provenience proventriculus proverb/MS proverbial/Y proverbialise/S proverbialize/S proverbise/S proverbize/S provide/DGRSZ provided/U providence provident/Y providential/Y province/MS provincial/Y provincialisation/MS provincialise/S provincialism provincialist provinciality provincialization/MS provincialize/S proviral provirus provision/DGRS provisional/Y provisionary proviso provisons provisory provitamin provo provocate/X provocateur/S provocation provocative/PY provoke/DGS provoking/Y provolone provost prow/MS prowess prowl/DGRSZ proxemic/S proxima proximal/Y proximate/PY proximity proximo proxmire proxy/S prude/MS prudence prudent/Y prudential/Y prudentius prudery prudish/PY pruinose prune/DGRSZ prunelle prurience pruriency prurient/Y pruriginous prurigo pruritic pruritus prussiate prussic prut prutot pry/DGRS pryer prying/Y prynne prytaneum psalm/MS psalmbook psalmist psalmody psalter psalterium psaltery psaltry psammite psephite psephological psephologist psephology pseud pseudaxis pseudepigraph pseudepigrapha pseudepigraphon pseudepigraphy pseudo pseudoallele pseudoallelic pseudoallelism pseudoanaemia/MS pseudoanaemic/S pseudoanemia/MS pseudoanemic/S pseudocarp pseudoclassic pseudoclassicism pseudocode pseudoedema/MS pseudoenergy pseudographise/S pseudographize/S pseudomediaeval/MS pseudomedieval/MS pseudomorph pseudomutuality pseudonym/MS pseudonymity pseudonymous/PY pseudooedema/MS pseudopodium pseudopotential pseudorandom pseudoscience pseudoscientific pseudoscientist pseudoscorpion pseudosophisticated pseudosophistication pseudotuberculosis pshaw psi psilocybin psilomelane psittacine psittacosis psoas psoriasis psst psych psychasthenia psyche/MS psychedelia psychedelic psychedelically psychiatric psychiatrically psychiatrist/MS psychiatry psychic/MS psychical/Y psycho/S psychoacoustic/S psychoactive psychoanalyse/RSZ psychoanalyser/MS psychoanalysis psychoanalyst psychoanalytic psychoanalytical/Y psychoanalyze/RSZ psychoanalyzer/MS psychobiographical psychobiography psychobiologic psychobiological psychobiologist psychobiology psychochemical psychocultural psychodrama psychodramatic psychodynamic/S psychodynamically psychogenesis psychogenetic psychogenic psychogenically psychognosis psychognosy psychograph psychohistory psychokinesis psychokinetic psycholinguist psycholinguistic/S psychologic psychological/Y psychologisation psychologise/DGS psychologism psychologist/MS psychologization psychologize/DGS psychology psychometric/S psychometrically psychometry psychomimetic psychomotor psychoneurosis psychoneurotic psychopath psychopathic psychopathically psychopathologic psychopathological/Y psychopathologist psychopathology psychopathy psychopharmaceutical psychopharmacologic psychopharmacological psychopharmacologist psychopharmacology psychophysic/S psychophysical/Y psychophysicist psychophysiologic psychophysiological/Y psychophysiologist psychophysiology psychopomp psychos/S psychosexual/Y psychosexuality psychosis psychosocial/Y psychosomatic/S psychosomatically psychosurgery psychosurgical psychotechnics psychotherapeutic/S psychotherapeutically psychotherapist psychotherapists psychotherapy psychotic psychotically psychotogen psychotogenic psychotomimetic psychotomimetically psychotropic psychrometer/MS psychrometric psychrometry psychrophilic psycoanalyze psyllium ptah ptarmigan pteridology pteridophyte pteridosperm pterodactyl/MS pteropod pterosaur pterygoid pteryla ptisan ptochocracy ptolemaeus ptolemaists ptomaine ptosis ptyalin ptyalism pub/MS puberal pubertal puberty puberulent pubes pubescence pubescent pubic pubis public/PSY publican/S publication/MS publicise/DGS publicist publicists publicity publicize/DGS publick publique publish/ADGRSZ publishable published/AU puccoon puce puck pucka pucker/DGS puckery puckish/PY pud pudding/MS puddingstone puddle/DGRS puddly pudency pudendal pudendum pudgy/PR pudsey puebla pueblo/S puebloisation/MS puebloise/S puebloization/MS puebloize/S puerile/Y puerilism puerperal puerperium puff/DGRSZ puffball/S puffbird/S puffery puffin/S puffy/P pug pugaree puget puggaree pugging pugilism pugilist pugilistic puglia pugmark pugnacious/PY pugnacity pugwash puisne puissance puissant/Y puke/DGS pukka pul/GR pula pulchritude pulchritudinous pule/GR puli/S pulicide pulik pull/DGJRS pullback pullet pulley/MS pullorum pullout pullover pullulate/N pulmonary pulmonate pulmonic pulmotor pulp/GR pulpal/Y pulpit/MS pulpitise/S pulpitize/S pulpwood pulpy/P pulque pulsant pulsar/MS pulsate/DGNSX pulsatile pulsator pulsatory pulse/DGRS pulsejet pulsimeter/MS pulsometer/MS pulverable pulverisable/S pulverisation/MS pulverise/DGRSZ pulverised/U pulverises/AU pulverizable/MS pulverization/MS pulverize/DGRSZ pulverized/U pulverizes/AU pulverulent pulvillus pulvinate pulvinus puma/M pumice/DG pumiceous pumicite pummel/S pummeled pummeler pummeling pummelled pummeller pummelling pump/DGRS pumpernickel pumpkin/MS pumpkinseed/S pun/MS puna punakha punce punch/DGJRSZ punchable punchball/S punchboard punchbowl/S punched/U puncheon puncher/MS punchinello punchless punchy/R punctate/N punctilio punctilious/PY punctual/PY punctuality punctuate/DGS punctuation punctuator puncture/DGMS pundit/S punditry pune pung pungency pungent/Y punily punish/DGRS punishability punishable punished/U punishment/MS punition punitive/PY punjab punk/S punka punkah punkie punkin punky/PRS punnet/S punning punny/R punster/S punt/DGRSZ punta punty/S puny/PR pup/MS pupa/S pupae pupal puparia puparial puparium pupate/DGNS pupfish pupil/MS pupilage pupilar pupilise/S pupilize/S pupillage pupillary pupiparous puppet/MS puppeteer/S puppetise/S puppetize/S puppetry pupping puppy/MS puppyish purana purblind/PY purchasable purchase/DGRSZ purdah purdew pure/PRTY pureblood purebred puree/DMS pureeing purfle/DG purgation purgative purgatorial purgatory purge/DGRS puri purificator purificatory purifing purify/DGNRSXZ purim purine purism purist/S puristic puritan/S puritanic puritanical/Y puritanism purity purl/DGRZ purlieu purlin purloin/DGRS puromycin purple/DGRST purplish purply purport/DGRSZ purported/Y purpose/DGSVY purposeful/PY purposeless/PY purposive/PY purpura purpure purpuric purpurin purr/DGS purring/Y purse/DGRSZ purselike pursewarden purslane pursuance pursuant pursue/DGRSZ pursuit/MS pursuivant pursy/PR purtenance purulence purulent purvey/DGS purveyance purveyor/S purview purvis pus push/DGRSZ pushball pushbutton/S pushcart pushchair/S pushdown pushful/P pushily pushkin pushout pushover/MS pushpin/MS pushrod/S pushto pushup pushy/PR pusillanimity pusillanimous/Y puss pussy/RS pussycat pussyfoot/GR pussytoes pustulant pustular pustulate/DN pustule/S put/S putains putamen putas putative/Y putdown/MS putout putrefaction putrefactive putrefy putrescence putrescent putrescible putrescine putrid/PY putridity putsch putschist putt/D puttana putted/I puttee/S putter/GRS putting/I putto putty/DGS puttyroot putumayo puvis puy puzzle/DGJRSZ puzzleheaded/P puzzlement pya pyaemia pycnidium pycnogonid pycnometer/MS pydna pye pyelitis pyelography pyelonephritic pyelonephritis pyemia pyemic pygidial pygidium pygmaean pygmean pygmoid pygmy/MS pygmyish pygmyism pyjama/DMS pyknic pyknotic pylon/S pylorectomy pylori pyloric pylorus pylos pym pyocanea pyoderma pyodermic pyogenesis pyogenic pyoid pyorrhea/MS pyorrheal pyorrhoea/MS pyorrhoeal pyosis pyracanth pyracantha pyralid pyralidid pyramid/MS pyramidal/Y pyramidical pyramidise/S pyramidize/S pyramus pyran pyranoid pyranometer pyranose pyranoside pyrargyrite pyrazole pyre pyrene pyrenees pyrenoid pyrethrin pyrethroid pyrethrum pyretic pyrexia pyrexial pyrexic pyrheliometer/MS pyrheliometric pyric pyridine pyridinise/S pyridinize/S pyridoxal pyridoxamine pyridoxin pyridoxine pyriform pyrimethamine pyrimidine/S pyrite/S pyritic pyritisation/MS pyritise/S pyritization/MS pyritize/S pyrocatechol pyrocellulose pyrochemical/Y pyroclastic pyroconductivity pyroelectric pyroelectricity pyrogallate pyrogallol pyrogen pyrogenic pyrogenicity pyrogenous pyrognostics pyrographic pyrography pyrola pyroligneous pyrolusite pyrolysable pyrolysate pyrolyse/MRS pyrolysed pyrolysing pyrolysis pyrolytic pyrolytically pyrolyzable pyrolyzate pyrolyze/MRS pyromagnetic pyromancy pyromania pyromaniac/MS pyromaniacal pyrometallurgical pyrometallurgy pyrometer/MS pyrometric pyrometrically pyrometry pyromorphite pyrone pyronine pyroninophilic pyrope pyrophoric pyrophosphate pyrophosphatic pyrophosphoric pyrophotometer pyrophyllite pyrophyllte pyrosis pyrostat pyrosulphate pyrosulphuric pyrotechnic/S pyrotechnical/Y pyrotechnist pyroxene pyroxenic pyroxenite pyroxenitic pyroxenoid pyroxylin pyrrha pyrrhic pyrrho pyrrhotite pyrrhuloxia pyrrol pyrrole pyrrolic pyrrolidine pyrruvic pyruvate pyschiatrist pythias python/S pythoness pythonic pythonine pythonise/S pythonize/S pyuria pyx pyxides pyxidium pyxie pyxis q's qaboos qaddafi qaddish qadi qairwan qattara qeshm qibla qintar qishm qoph qua quack/DGS quackery quackish quad quadded quadding quadragenarian quadragesimal quadrangle/S quadrangular quadrant/MS quadrantal quadraphonic/S quadraphony quadraplegic quadrapole quadrat/DG quadrate/DGS quadratic/S quadratical/Y quadrature/MS quadrella quadrennial/Y quadrennium quadric quadricentennial quadriceps quadricipital quadrifid quadriga quadrilateral/S quadrille/NS quadrillion/H quadrinomial quadripartite/NY quadriplegia quadriplegic quadripuntal quadrisect/DGS quadrisyllabic quadrivalent quadrivial quadrivium quadroon/S quadrophonics quadrumanous quadrumvir quadrumvirate quadruped/S quadrupedal quadruple/DGS quadruplet/S quadruplex quadruplicate/DGNSX quadruplicity quadruply quadrupolar quadrupole quadword/MS quaere quaestor quaff/R quag quagga quaggy quagmire/MS quahog quai quaich quail/MS quaint/PY quake/DGRSZ quaky quale qualified/UY qualify/DGNRSXZ qualitative/Y quality/MS qualm/S qualmish/PY qualmy quandary/MS quango/S quant quanta quantal quantasome quantic quantifiable/U quantifiably quantificational/Y quantify/DGNRSXZ quantifys quantile/S quantisation/MS quantise/DGRSZ quantiser/MS quantitate/DGNSX quantitative/PY quantity/MS quantization/MS quantize/DGRSZ quantizer/MS quantum quaquaversal quarantinable quarantine/DGMS quare quark/S quarrel/S quarreled quarreler/S quarreling quarrelled quarreller quarreller/S quarrelling quarrellous quarrelous quarrelsome/PY quarrian quarry/DGMRS quarryman quarrymen quart/RSZ quartan quarter/DGRSY quarterage quarterback/S quarterdeck/S quarterfinal quarterfinalist quarterisation/MS quarterization/MS quarterlight/S quarterly/S quartermaster/S quartern quarternary quartersaw quarterstaff quartet/MS quartette quartic/S quartile/S quarto/S quartz quartziferous quartzite quartzitic quartzose quasar/MS quash/DGS quashi quasi quasicontinuous quasimodo quasiorder quasiparticle quasiperiodic quasistationary quass quatercentenary quaternary/S quaternion quaternity quathlamba quatrain quatre quatrefoil quattrocento quattuordecillion quaver/DGS quavering/Y quavery quay/S quayage quayside quean queasily queasy/PR queazy quebracho queen/MSY queencake queensberry queenship queer/PRSTY queerish quell/DGRS quelpart quelquechose quemoy quench/DGRS quenchable quenched/U quenchless queneau quenelle quercetin quercine querilla querist quern/S querulous/PY query/DGRS quesnay quest/ADGRSZ question/DGJRSZ questionable/P questionably/U questionary questioned/AU questioning/SY questioningly/U questionless questionnaire/MS questor/A quetta quetzal quetzalcoatl quetzales queue/DMRSZ queueing queuer/MS queuing quib/S quibble/DGRS quiberon quiche/S quick/NPRTXY quicken/DGRS quickie/S quicklime quicksand/S quickset quicksilver quickstep/S quid/MS quiddity quidnunc quiescence quiescent/PY quiet/DGNPRSTXY quieten/DGS quietism quietist quietude/I quietus quiff/DS quill/S quillet quillon quillwort quilmes quilt/DGRS quim quinacrine quinary quinate quince/S quincentenary quincuncial/Y quincunx/S quincunxial quincy quindecagon quindecaplet quindecennial quindecillion quinic quinidine quiniela quinine quininise/S quininize/S quinnat quinoa quinoid quinoidine quinol quinoline quinone quinonoid quinquagenarian quinquecentenary quinquefoliate quinquennial/Y quinquennium quinquepartite quinquereme quinquevalent quinquivalent quinsy quint quintain quintal quintan quintana quintero quintessence quintessential quintet/S quintette quintic quintile/S quintilian quintillion/H quintuple/DGS quintuplet/MS quintuplicate/DGS quintus quinze quip/S quipped quipping quipster quipu quire quirinus quirk/GS quirkily quirky/P quirt quisling quislingism quist quit/S quitch quitclaim quite/A quitrent quittance quitted quitter/MS quitting quittor quiver/DGS quiverful quixotic quixotical/Y quixotry quiz quizmaster quizzed quizzer quizzes quizzical/Y quizzicality quizzing qum qumran quo quod quodlibet quoin quoit/S quokka quondam quonset quorum quot quota/MS quotable quotation/MS quote/DGS quoted/U quoth quotha quotidian quotient/S r's rRNA rabato rabaul rabbath rabbet/DGS rabbi rabbinate rabbinic rabbinical/Y rabbinism rabbit/DGMRS rabbitfish rabbitoh rabbitry rabbity rabble/DGR rabblement rabic rabid/PY rabidity rabies raccoon/MS race/DGRSZ racecard/S racecourse/S racegoer/S racehorse/MS racemate raceme racemic racemisation racemise/DGS racemization racemize/DGS racemose racetrack/R raceway rachet rachides rachiodont rachis/S rachitic rachitis rachmanism racial/Y racialisation/MS racialise/S racialism racialist racialistic racialization/MS racialize/S racily racine racism racist/S rack/DGRS racket/MS racketeer/GS rackety rackle racon raconteur racoon racquet/S racy/PR rad/S rada radar/MS radarscope/S raddle/DGS radial/Y radiale radialisation/MS radialise/S radialization/MS radialize/S radian/S radiance radiancy radiant/Y radiate/DGNSVXY radiational radiationless radiative/Y radiator/MS radic radical/PSY radicalisation/MS radicalise/DGS radicalises/U radicalism radicalization/MS radicalize/DGS radicalizes/U radicand radicate radicel radices radicle radicular radiguet radii radio/DGS radioactivate radioactive/Y radioactivity/S radioastronomy radioautograph radioautographic radioautography radiobiologic radiobiological/Y radiobiologist radiobiology radiobroadcast/GR radiocarbon radiocast/R radiochemical/Y radiochemist radiochemistry radiochlorine radiocommunication radioecological radioecologist radioecology radioelement radiogenic radiogram/MS radiograph radiographic radiographically radiography radioimmunoassay radioisotope radioisotopic radioisotopically radiolarian radioligand radiolocation radiologic radiological/Y radiologist radiology radiolucency radiolucent radioluminescence radiolysis radiolytic radioman radiomen radiometeorograph radiometer/MS radiometric radiometrically radiometry radiomicrometer radiomimetic radionics radionuclide radiopaque radiopasteurisation radiopasteurization radiophone radiophonic radiophoto radiophotograph radiophysics radioscope radioscopic radioscopy radiosensitive radiosensitivity radiosonde radiosterilisation radiosterilise/GS radiosterilised radiosterilization radiosterilize/GS radiosterilized radiostrontium radiosymmetrical radiotelegram radiotelegraph radiotelegraphic radiotelegraphy radiotelemetry radiotelephone radiotelephony radioteletype radiotherapist radiotherapy radiothermy radiothorium radiotoxic radiotracer radish/MS radium radiumisation/MS radiumise/S radiumization/MS radiumize/S radius/S radix/S radom radome radon radula radular raeburn raf raff raffia raffinate raffinose raffish/PY raffle/DGS raft/RSZ rafter/DS raftsman rag/MS raga ragamuffin ragbag ragbolt rage/DGS ragged/PY raggedy ragging raggle ragi raglan ragman ragout ragpicker ragtag ragtime ragusa ragweed/S ragworm/S ragwort rah rahman raid/DGRSZ rail/DGRSZ railbird/S railcar/S railhead/S raillery railroad/DGRSZ railway/MS railwayman raiment rain/DGMS rainband rainbird rainbow/S raincheck raincoat/MS raindrop/MS rainfall rainforest rainless rainmaker rainmaking rainout rainproof rainspout rainsquall rainstorm rainwash rainwater rainwear rainy/RT raise/DGRSZ raisin/S raison raj raja rajab rajah rajahs rajasthan rajkot rajputana rajya rakata rake/DGRS rakehell raki rakish/PY rale rallentando ralline rally/DGS rallycross rallye rallyist rallymaster ram/MS ramachandra ramakrishna ramat ramate ramayana rambert ramble/DGJRSZ rambling/SY rambunctious/PY rambutan rameau ramekin ramentum ramequin rami ramie ramification/MS ramiform ramify/DGS ramillies ramirez ramjet/S rammed rammer ramming rammish ramose/Y ramous ramp/DGMS rampage/DGS rampageous/PY rampancy rampant/Y rampart/S rampion rampur ramrod/S rams/S ramsay ramsgate ramshackle ramsons ramtil ramulose ramus ran/A rancagua rance ranch/DGRSZ rancherie ranchero ranchi ranchman rancho/S rancid/P rancidity rancor/MS rancorous/Y rancour/MS randan randers random/PY randomisation/MS randomise/DGRS randomization/MS randomize/DGRS randy/S ranee rang/DGRZ range/DGRSZ rangefinder rangeland/S rangy/PR rani ranian ranjit rank/DGJPRSTYZ ranked/U ranker/MS ranking/MS rankle/DGS ranmoor ransack/DGRS ransom/GRS ransome rant/DGRSZ ranting/Y rantry ranunculaceous ranunculus rap/MS rapacious/PY rapacity rapacki rape/DGRS rapeseed raphe raphide rapid/PSY rapidity rapier rapine rapist rapists rapparee rapped rappee rappel rappen rapper/MS rapping rapport rapporteur rapprochement rapscallion rapt/PY raptor raptorial rapture/DGMS rapturise/S rapturize/S rapturous/PY rapunzel rara rare/GPRTY rarebit raree rarefaction rarefactional rarefactive rarefy/D rareripe rarify rarity/MS rarotonga rasa rasbora rascal/SY rascalise/S rascality rascalize/S rase rash/PRSY rasht rasing rask rasorial rasp/DGJRS raspatory raspberry rasping/SY rasputin raspy rasse raster/S rasure rat/MS rata ratable ratably ratafia ratan rataplan ratatouille ratbag ratbaggery ratbite ratch ratchet/DGMS rate/DGJRSZ rateable rated/U rateen ratel ratemeter/MS ratepayer/S ratfink ratfish ratha rathe rathenau rather rathskeller raticide ratificationist ratify/DGNSX ratio/MS ratiocinate/DGNSV ratiocinator ratiometer ration/DGS rational/PY rationale/MS rationalisable/S rationalisation/MS rationalise/DGRSZ rationalism rationalist/S rationalistic rationalistically rationality/S rationalizable/MS rationalization/MS rationalize/DGRSZ ratisbon ratite ratlam ratlike ratline rato raton ratoon ratsbane rattail rattan ratted ratteen ratter rattigan ratting rattish rattle/DGRSZ rattlebox rattlebrain/D rattlesnake/MS rattletrap rattling/Y rattly rattoon rattrap ratty/R raucous/PY raunchily raunchy/PR ravage/DGRSZ ravagement rave/DGJRS ravel/S raveled raveler/SU ravelin raveling/S ravelled raveller raveller/SU ravelling ravelling/S ravelment raven/DGRS ravenna ravenous/PY ravin ravine/DMS ravioli ravish/GRS ravishing/Y ravishment raw/PRSTY rawalpindi rawboned rawhide/DG rawinsonde rawlings rawlins rawsthorne ray/DMS rayless/P raylet rayon raze/DGRS razee razeed razeeing razoo razor/MS razorback razorbill razz razzia razzle razzmatazz rd re/S reabbreviate/DGS reabsorb reabsorption reacclimatisation/MS reacclimatise reacclimatize reach/DGRS reachability reachable/U reachably reacquaint reacquire reacquisition react/DGSV reactance/S reactant/S reacted/U reactional/Y reactionary/MS reactionaryism reactivate/DGNS reactivity reactualise reactualize read/GJRSZ readability/U readable/P readably reade reader/MS readership/M readily readjust/GR readjustment readonly readout/MS readwrite ready/DGPRST reaffirmation reagent reaggregate/N real/PSTY realgar realign/DGS realisability/MS realisable/PS realisables/U realisably/S realisation/MS realise/DGJRSZ realised/U realises/U realising/MSY realism/U realist/MS realistic/U realistically/U realisticise/S realisticize/S reality/S realizability/MS realizable/MPS realizably/S realization/MS realize/DGJRSZ realized/U realizes/U realizing/MSY reallot reallotment realm/MS realpolitik realtor/S realty ream/DGMRS reanimalise/S reanimalize/S reap/DGRS reapologise reapologize reappear/DGS reappearance reapplication reapply/DS reapportion reapportionment reappraisal/S reappraise/G rear/DGRS rearguard/S rearhorse rearm/G rearmament rearmost rearrange/DGS rearrangeable rearrest/D rearward/SY reason/DGJRS reasonability reasonable/PU reasonably/U reasonless/Y reassemble/DGRS reassembly reassert/DG reassertion reassign/DGS reassociation reassurance reassure/DGS reassuringly/U reast reauthorise reauthorize reave/GR reawaken/DGS reb/S rebaptisation/MS rebaptization/MS rebarbative/Y rebate/DGMRS rebato rebec rebel/MS rebell rebelled rebelling rebellion/MS rebellious/PY rebellow rebid rebirth/M reboant rebond/DG reboot/DGRSZ rebound/DGRS rebroadcast/S rebrutalise rebrutalize rebuff/DGS rebuild/GS rebuke/DGRS rebus rebuttable rebuttal/S rebutter rec recalcitrance recalcitrancy recalcitrant recalesce recalescence recall/DGRS recallability recanalisation recanalization recant/D recantation recap recapitalise recapitalize recapitulate/DGNS recappable recaption recapture/DGS recarbonise recarbonize recast/GS recatory recausticise/S recausticize/S recede/DGS receipt/DGMS receiptor receivable/S receive/DGRSZ receiver/MS receivership recency recension recent/PY recentralise recentralize recept receptacle/MS receptaculum reception/MS receptionist/S receptive/PY receptivity receptor/MS recertification recess/DGSV recession/MS recessional recessionary recessive/PY recharge/GR rechargeable recheat recheck/G recherche/S recidivism recidivist recidivistic recipe/MS recipience recipiency recipient/MS reciprocal/SY reciprocalise/S reciprocalize/S reciprocate/DGNSV reciprocator reciprocity recirculate/DGNS recision recital/MS recitalist recitative recitativo recite/DGRS recivilise recivilize reck reckless/PY reckon/DGJRS reclaim/DGRSZ reclamation/S reclassify/DGNS reclinate recline/DGS recluse/MNSV recluster/G recode/DGS recodify/DGS recognisability recognisable/U recognisably recognise/DGRSZ recognised/Y recognisedly/S recognising/UY recognisingly/S recognition/MS recognizability recognizable/U recognizably recognize/DGRSZ recognized/Y recognizedly/S recognizee recognizing/UY recognizingly/S recoilless recoin recolonise recolonize recolor/GM recolour/GM recombinant recombine/DGS recommence/G recommit recommitment recompence recompense recompilation recompile/DGS recompose recomposition recompute/DGS reconceptualisation reconceptualization reconcilability reconcilable/P reconcile/DGRS reconcilement reconciliation/MS recondite/NPXY recondition/GJS reconfigurability reconfigure/DGRS reconfirm reconfirmation reconnaissance reconnect/DGRS reconnection reconnoiter/DGRSZ reconnoiterer/MS reconnoitre/DGMS reconquer/DGS reconsider/DGS reconsolidate/G reconstitute/N reconstruct/DGSV reconstructed/U reconstruction/S reconstructionism reconstructor recontaminate recontamination reconvene/G reconvention reconversion reconvert/D reconverting reconvey reconveyance recopy/DS record/DGJRSZ recordable recordation recorded/U recordist recount/DGRS recoup/DGS recoupable recoupment recourse/S recover/DGRS recoverability recoverable/U recovery/MS recreant recreatable recreate/DGNSVX recreational recreationist recrement recriminate/DGNSVX recriminatory recriticise recriticize recrudesce recrudescence recrudescent recruit/DGMRSZ recruiter/MS recruitment recrystalize/G recrystallise/G recrystallize/G recta rectal/Y rectangle/MS rectangular/Y rectangularity recti rectifiability rectifiable rectify/DNRXZ rectilinear/Y rectillinear recting rection rectitude rectitudinous rective recto/S rectocele rector/MS rectorate rectorial rectorship rectory rectrices rectrix rectum/MS rectus recumbency recumbent/Y recuperate/DGNSV recuperator recur/S recurred recurrence/MS recurrency recurrent/Y recurring recurse/DGNSVX recursion/MS recursivity recurvate recurve recusancy recusant recuse recyclable recycle/DGS red/PSY redact redaction redactional redactions redactor redan redargue redback redbird/S redbone redbreast redbrick redbud redbug redcap redcoat/S redcurrant redd redded redden/DG redder reddest redding reddish/P redditch reddle reddy rede redear redeclare/DGS redecorate redecorating redecoration redecorator rededicate redeem/DGRSZ redeemable redeemed/U redefine/DGS redemption/R redemptional redemptive redemptory redeploy/D redeployment redeposit/DGMS redeposition redescribe redescription redesign/DGS redetermine/DG redevelopment redeye redfin redhead/DRS redhook redhorse redia/S rediae redial redialer redialing redialler redialling rediffusion redingote redintegrate/NV redirect/DGS redirection/S rediscount rediscountable rediscover/G rediscovery redisplay/DGS redistribute/DGNSVX redistributory redistrict redistricting redivivus redleg redneck/DS redo redolence redolent/Y redon redondo redose redouble/DGS redoubt redoubtably redound redout redowa redox redpoll redraw/GS redrawn redress/DGRS redroot redshank redshift/DGS redshirt redskin redstart redtop reduce/DGRSZ reducibility reducible reducibly reduct/V reductant reductase reductio reduction/MS reductional reductionalist reductionism reductionist reductionistic redundancy/S redundant/Y reduplicate/NV reduplicative/Y reduviid redware redwing redwood/S ree/TV reebok reed/GMRS reedbuck reedify reedling reeducate/V reeducation reedy/R reef/GRS reek/DGRS reeky reel/DGRS reelable reelection reembroider reemploy reemployment reen reenact reenactment reenforce reenlist/D reenlistment reenter/DGS reentrance reentrant reentry reenumerate/N reestablish/DGS reestablishment reestimate reevaluate/DGNS reeve reexamination reexamine/DGS ref reface/G refactoring refashion refavor/M refavour/M refect refection refectory/S refer/S referable referee/DMS refereeing reference/DGRS referenced/U referenda referendum referent/MS referential/Y referentiality referral/MS referred referrer referring refertilise refertilize refill/DGS refinance refine/DGRS refined/U refinement/MS refinery/S refinish/GRS refit reflate/DGS reflation reflationary reflect/DGSV reflectance reflected/U reflection/MS reflectional reflective/PY reflectivity reflectometer/MS reflectometry reflector/MS reflectorise/DGS reflectorize/DGS reflet reflex/DMSVY reflexive/PY reflexivity reflexology reflow refluence reflux/DGS refocus/DGS reforest reforestation reforestisation/M reforestise/S reforestization/M reforestize/S reforge reformable reformat/SV reformate reformation reformatory/S reformatter reformism reformist/S reformulate/DGNS refract/DGV refractile refraction refractive/PY refractivity/S refractometer/MS refractometric refractometry refractor refractorily refractory/P refrain/DGS refrainment refrangible/P refresh/DGNRSZ refreshing/Y refreshment/MS refrigerant refrigerate/DN refrigerator/MS refringent refry/DGS refuge/DGS refugee/MS refugeeism refugium refulgence refulgent refund/DGMRSZ refundability refundable refurbish/DGR refurbishment refusal/S refuse/DGRS refutable refutably refutation refute/DGRS regain/DGS regal/DGY regale regalia regalise/S regality regalize/S regalvanise/S regalvanize/S regard/DGS regardant regardful/PY regardless/PY regatta/S regelate regency regeneracy regenerate/DGNPSVY regenerator regent/MS regental reger reggae reggio regicidal regicide regime/MS regimen regiment/DS regimental/SY regimentation regin regiomontanus region/MS regional/Y regionalisation/MS regionalise/DGS regionalism regionalist regionalistic regionalization/MS regionalize/DGS regisseur register/DGSU registrable registrant/S registrar/S registration/MS registry/S regius reglet regna regnal regnant regnum rego regolith regorge/DG regosol regrant regrate regreet regress/DGSV regression/MS regressive/PY regressor regressors regret/S regretful/PY regretless regrettable regrettably regretted regretter regretting regrid regridded regridding reground regroup/DG regrow regulable regular/SY regularisation/MS regularise/DRSZ regularising regularity/S regularization/MS regularize/DRSZ regularizing regulate/DGNSVX regulated/U regulator/MS regulatory regurgitate/DGNSV rehabilitant rehabilitate/DGNSVX rehabilitationist rehabilitator reharmonisation reharmonise reharmonization reharmonize rehash/DGS rehear rehearing rehearsal/MS rehearse/DGRS rehearsed/U rehonor/M rehonour/M rehouse/G rehumanisation rehumanise rehumanization rehumanize rehybridise/S rehybridize/S rehydratable rehydrate/N reichsmark reify/DGN reigate reign/DGS reimbursable reimburse/GS reimbursed reimbursement/MS reimpression reims rein/DGS reincarnate/DN reincarnationist reindeer reinfection reinforce/DGRS reinforceable reinforced/U reinforcement/MS reinhard reinhardt reinitialisation reinitialise/DGS reinitialization reinitialize/DGS reinless reinsert/DGS reinsertion reinsman reinstall/DGRS reinstate/DGS reinstatement reinstitution reinsurance reinsure/R reintegrate/NV reinterpret/DGS reinterpretation reinterview reintroduce/DGS reintroduction reinvention reinvest reinvestigation reinvestment reinvigorate reinvoke/G reissuer/MS reitemise reitemize reiterate/DGNSVX reiterative/PY reiterator reith reive/GR reject/DGRSV rejectee rejecting/Y rejection/MS rejector/MS rejig rejigger rejoice/DGRS rejoicing/Y rejoin/DGS rejoinder rejuvenate/DGNS rejuvenator rejuvenesce relabel/S relabeler/S relabeller/S relatable relate/DGNRSVX related/PY relational/Y relationship/MS relative/PSY relativisation/MS relativise/DGS relativism relativist relativistic relativistically relativity/M relativization/MS relativize/DGS relator relatum relax/DGRS relaxant relaxation/MS relaxed/PY relaxin relay/DGS relearn releasability releasable releasably release/DGRS released/U relegate/DGNS relent/DGS relenting/U relentless/PY relevance/S relevancy relevant/Y reliability/SU reliably/U reliance reliant/Y relic/MS relict reliction relief/S relievable relieve/DGRSZ relieved/Y relievo religion/MS religionise/S religionism religionist religionists religionize/S religiose religiosity religious/PY reline relinquish/DGS relinquishment reliquary relique reliquiae relish/DGS relishable relive/GS reload/DGRS relocatable relocate/DGNSX relocatee relucent reluct reluctance/S reluctancy reluctant/Y reluctate/DN reluctivity relume/DG relumine rely/DGRS remagnetise/S remagnetize/S remain/DGS remainder/DGMS remainderman remaines remake/G reman remand/DG remanence remanent remanufacture/R remap remark/DGS remarkable/P remarkably remarked/U remarriage remarry/G rematch rematerialise rematerialize remediable/P remediably remedial remediate/N remediless/Y remedy/DGS remember/DGRS rememberability rememberable remembrance/MRS rememorise rememorize remigial remilitarisation remilitarise remilitarization remilitarize remindful remineralise/S remineralize/S reminisce/DGS reminiscence/MS reminiscent/Y reminiscential remint remise/DG remiss/PY remissible remissibly remission remit/S remitment remittable remittal remittance/S remitted remittee remittent/Y remitter remitting/U remix/GS remnant/MS remobilise remobilize remodel/S remodeling remodelling remodulate/DGNS remonstrance remonstrant/Y remonstrate/DGNSV remonstrative/Y remonstrator remontant remontoir remorse remorseful/PY remorseless/PY remote/NPTY remould/DG remount remounting removal/MS removalist remove/DGRS remscheid remunerate/DGNSVX remunerated/U remunerative/PY remunerator remuneratory remus renaissance renal rename/DGS renationalise/G renaturation renature/G rencontre rencounter rend/GRSZ render/DGJRS renderable rendezvous/DGS rendition/MS rendzina renegade/S renegado renege/DGRS renegotiate/N renew/DGRS renewability renewable renewably renewal/S reni reniform renig renigged renigging renin renitency renitent rennes rennet rennin renographic renography renominate/GN renormalisation renormalise/G renormalization renormalize/G renounce/DGRS renouncement renovate/DNS renovator renown/D rent/DGRSZ rentability rentable rental/MS rente renter/MS rentier renumber/DGS renumeration renunciate/NVX renunciatory renvoi reobjectivisation/MS reobjectivization/MS reoccupy reoccur reoccurrence reopen/DGS reorder/DGS reorganisational reorganised/U reorganizational reorganized/U reorient reorientate/DGS reorientation reoxidise reoxidize reoxygenise/S reoxygenize/S rep repack/GR repackage/DGRS repacked repaganise/RSZ repaganize/RSZ repaint/DGRSZ repair/DGRSZ repairability repairable repairman repairmen repand reparable reparation/MS reparative repartee repartition/DGRSZ repass repassage repassivation repast/MS repatriate/DGNS repatriations repatronise repatronize repay/GS repayment repeal/DGRS repealable repeat/DGRSZ repeatability repeatable repeated/Y repechage repel/S repellant repelled repellency repellent/Y repeller repelling repent/DGRS repentance repentant/Y repercussion/MS repercussive repersonalise repersonalize repertoire repertory repetend repetition/MS repetitional repetitious/PY repetitive/PY rephosphorisation/MS rephosphorization/MS rephrase/DGS repine/DGR replaceable replant replay/DGS replenish/DGRS replenishment/S replete/NP repleviable replevied replevies replevin replevy replica/MS replicable replicate/DGNSVX replicator/S reply/DGNRSX repoint repolymerisation/MS repolymerization/MS repopularise repopularize report/DGRSZ reportable reportage reported/Y reportorial/Y reposal repose/DGS reposeful/PY reposit/DG repository/MS repossess repossession repost/DGJRS repot repower reprehend reprehensibility reprehensible/P reprehensibly reprehensive represent/DGRS representable/U representably representational/Y representationalism representationalist representative/PSY representativity represented/U repress/DGSV repressibility repressible repression/MS repressionist repressive/PY reprieval reprieve/DGS reprimand/D reprint/DGRS reprisal/MS reprise/DG repristinate/N reprivatisation/MS reprivatise/S reprivatization/MS reprivatize/S repro/S reproach/DGRS reproachable reproachful/PY reproaching/Y reprobance reprobate/GNV reprocess/S reprocessor reproducibility/S reproducibly reproductive/Y reproductivity reprogram/S reprogramme/S reprography reproof reprove/DGR reproving/Y reps reptant reptile/MS reptilian republic/MS republican/MS republicanisation/MS republicanise/DGRSZ republicanism republicanization/MS republicanize/DGRSZ republication republisher/MS repudiate/DGNSX repudiationist repudiator repugn repugnance repugnancy repugnant/Y repulse/DGNSVX repulsive/PY repulverise repulverize reputability reputable reputably reputation/MS repute/DGS reputed/Y req requested/U requestioner requiem/MS requiescat requin require/DGRS requirement/MS requisite/NPSX requisition/DGRS requital requite/DGR requited/U reradiate/N reread/GS reredos reremouse rereward reroute/DJRSZ resail resale resample/G resaturate/GN rescale rescaling reschedule/DGRS rescind/DR rescindment rescissible rescissory rescript rescue/DGRSZ research/DGRSZ researchable researchist reseat reseau resect resectability resectable resection reseed reselect/DGS reselection resemblance/MS resemblant resemble/DGS resend/G resensitise/S resensitize/S resent/DGS resentful/PY resentment resepulcher resepulchre resequence reserpine reservation/MS reserve/DGRS reserved/PUY reservist/S reservoir/MS reset/S resettable resetter/S resetting resettle resettlement reshape/DGRS reship reshipment reshipper reshuffle reside/DGRS residence/MS residency resident/MS residential/Y residentiary residua residual/SY residuary residue/MS residuum resign/DGRS resignation/MS resigned/PY resile/DG resilience resiliency resilient/Y resin/DGMS resinate resiniferous resinify resinise/S resinize/S resinlike resinoid resinous resiny resipiscence resist/DGRSV resistable resistance/S resistant/Y resisted/U resistencia resistibility resistible resistibly resisting/U resistive/PY resistivity resistless/PY resistor/MS resit resitting resize/DGS resnais resnatron resojet resold resole resolemnise/S resolemnize/S resolute/NPVXY resolved/U resolvent resonance/S resonant/Y resonate/DGS resonator/S resorb resorcinol resort/DGRS resound/GS resounding/Y resource/DGMS resourceful/PY respecify/S respect/DGRSV respectability respectable/P respectably respectful/PY respective/PY respell respirable respiration/S respirational respirator/S respiratory respire/G respite/DG resplendence resplendency resplendent/Y respond/DGRSZ respondent/MS response/RSVX responsibility/S responsible/P responsibly responsive/PUY responsory responsum resrict ressentiment resses rest/DGRSV restage restandardise restandardize restart/DGRS restartable restate/DGS restatement restaurant/MS restauranteur restaurateur resterilise resterilize restful/PY restiform restigmatise/S restigmatize/S restitute restitution restive/PY restless/PY restock restorability restoral restoration/MS restorationism restorative/PY restore/DGRSZ restrainable restrained/UY restraint/MS restransmit restrict/DGSV restricted/UY restriction/MS restrictionism restrictionist restrictive/PY restrike restroom/MS restructurability restructure/DGS restudy resubmission result/DGS resultant/SY resultful/P resultless resumable resume/DGS resumption/MS resupine resupply/DGMS resurface/DGRSZ resurfacer/MS resurgam resurge/G resurgence resurgent resurrect/DGS resurrection/MS resurrectional resurrectionise/S resurrectionism resurrectionist resurrectionize/S resuscitate/DGNSV resuscitator/S resuspension resvering resymbolise resymbolize resynchronisation resynchronise/G resynchronization resynchronize/G resynthesise resynthesize ret/S retable retail/DGRSZ retain/DGRSZ retainment retake retaliate/DGSV retaliation retaliatory retard/DGR retardant retardate retardation retch/G rete retell/G retene retension/D retention/S retentionist retentive/PY retentivity retenue retest rethink/GR rethought retia retiarius retiary reticence reticency reticent/Y reticle/MS reticular reticulate/DGNSY reticule reticulocyte reticulocytic reticulose reticulum retiform retina/MS retinacular retinaculum retinae retinal retinene retinise/S retinite retinitis retinize/S retinol retinopathy retinoscopy retinospora retinue/S retinula retinular retirant retiree retirement/MS retiring/PY retool retort/DGS retortion retot retouch/R retouching retrace/DGS retract/DGS retractile retractility retraction/S retrain/DGS retrainee retral/Y retranquilise retranquilize retread/DG retreat/DGRS retreatant retrench retrenching retrenchment retrial retributed retribution retributive/Y retributory retrievability retrievable retrieval/MS retrieve/DGRSZ retro retroact retroaction retroactive retroactively retroactivity retrocede retrocession retrochoir retrodiction retrofire retrofit retrofitted retrofitting retroflection retroflex/D retroflexion retrogradation retrogradations retrograde/GY retrogress retrogression retrogressive/Y retroject retrolental retrolingual retropack retroperitoneal/Y retroreflection retroreflective retroreflector retrorocket retrorse/Y retroserrate retrospect/V retrospection retrospective/Y retroversion retrovision retsina retted retting return/DGRSZ returned/U returnee/MS retuse retype/DGS reuchlin reunify/N reunion/S reunionist/S reunionistic reunite/DG reus reuse/DGS reuter reutilise reutilize reutlingen rev/RSTZ reval revalidate/G revaluate revaluation revalue revamp/DGS revanche revanchism revanchist revaporise/S revaporize/S reveal/DGRS revealable revealing/U revealment revegetate/N revehent reveille/S revel/S revelation/MS revelationise/SU revelationist revelationize/SU revelator revelatory reveled reveler/S reveling/S revelled reveller/S revelling/S revelry revenant revenge/DGMRS revenue/RSZ reverb reverberant/Y reverberate/DNVX reverberator reverberatory revere/DGS reverence/R reverend/MS reverent reverential/Y reverently reverie/S reverify/DGS reversal/MS reverse/DGNRSXY reversi reversibility reversible reversibly reversion/RS reversionary reverso revert/DGRSV revertible revery revetment revetments revictual review/DGRSZ revile/DGR revilement revisable revisal revise/DGNRSX revision/MS revisionary revisionism revisionist/S revisor revisory revisualise revisualize revitalisation/MS revitalise/DGRSZ revitalization revitalize/DGRSZ revivable revival/MS revivalise/S revivalism revivalist/S revivalistic revivalize/S revive/DGRS revivify/N reviviscence reviviscent revocation/S revoice revokable revoke/DGRS revolatilise/S revolatilize/S revolt/DGRS revolting/Y revoluable revolute revolution/MS revolutionarily revolutionary/MPS revolutionibus revolutionise/DGRSZ revolutionisement/MS revolutionist revolutionists revolutionize/DGRSZ revolutionizement/MS revolvable revolve/DGRSZ revue/S revulsed revulsion revulsive revved revving rew rewake rewaken reward/DGRS rewardable rewarding/Y rewind/DGRS rewire/G reword/DGJS rewording/MS rework/DGS rewound rewrite/GJRS rexine rexroth rey reynard reynaud reynosa rezone rhabdom rhabdomancy rhabdome rhabdomere rhabdomyoma rhachis rhadamanthine rhaetia rhamnaceous rhamnose rhamnus rhaphe rhapsodic rhapsodical/Y rhapsodise/DGS rhapsodist rhapsodize/DGS rhapsody rhatany rhebok rhee rheims rhein rheinholdt rhenium rheobase rheological/Y rheologist rheology rheometer/MS rheophile rheophilic rheostat/S rheostatic rheotaxis rheotropism rhesus rhet rhetic rhetor rhetoric rhetorical/PY rhetorician/S rheum rheumatic/S rheumatically rheumatism rheumatiz rheumatoid rheumatologist rheumatology rheumy rheydt rhigolene rhinal rhinelander rhinencephalic rhinencephalon rhinestone/S rhinitis rhino/S rhinoceros rhinocerotic rhinolaryngology rhinology rhinopharyngitis rhinoplasty rhinoscopy rhinosporidium rhinotracheitis rhinovirus rhizanthous rhizobium rhizocarpic rhizocarpous rhizocephalan rhizocephalid rhizoctonia rhizogenesis rhizogenetic rhizogenic rhizoid rhizoidal rhizomatous rhizome rhizomic rhizomorph rhizomorphous rhizoplane rhizopod rhizopodal rhizopodous rhizopus rhizosphere rhizotomy rho rhodamine rhodic rhodinal rhodium rhodochrosite rhododendron/S rhodolite rhodomontade rhodonite rhodoplast rhodopsin rhodora rhodos rhomb/S rhombencephalon rhombi rhombic rhombohedral rhombohedron rhomboid rhomboidal rhomboideus rhombus/S rhonchi rhonchus rhotacism rhotic rhubarb rhumb/S rhumba rhumbatron rhus/S rhyme/DGRS rhymester rhynchocephalian rhyolite rhyolitic rhythm/MS rhythmic/S rhythmical/Y rhythmicise/S rhythmicity rhythmicize/S rhythmisable/S rhythmisation/MS rhythmise/S rhythmist rhythmizable/MS rhythmization/MS rhythmize/S rhytidome rhyton ri ria rial rialto riant/Y riata rib/MS ribald ribaldry riband ribas ribband ribbed ribbentrop ribber ribbing ribble ribbon/MS ribbonfish ribbonlike ribbonwood ribby ribera ribgrass riblet riboflavin ribonuclease ribonucleic ribonucleoprotein ribonucleoside ribonucleotide ribose ribosomal ribosome/S ribwort/S ricardo ricci riccio rice/RS ricebird ricercar ricercare rich/NPRSTY richelieu richen/DG richert richey richland richment richthofen rici ricin ricinoleic ricinus rickards rickenbaugh rickets rickettsia rickettsial rickety rickey/S rickrack ricksha rickshaw/MS ricochet/DGS ricotta rictal rictus rid/SZ ridable riddance ridded ridden ridder ridding riddle/DGRS ride/GJRSZ rideable rident rider/MS riderless ridge/DGMS ridgeling ridgepole ridgetree ridgeway ridgling ridgy ridicule/DGRS ridiculise/S ridiculize/S ridiculous/PY ridley ridotto ridpath riefenstahl riegger riel riempie rienzi rife/Y riff riffle/DGRS riffraff rification rifice/R rifle/DGRS riflebird rifled/U rifleman riflemen riflery riflescope rift rifying rig/MS rigadoon rigamarole rigatoni rigaudon rigged rigger/S rigging right/DGNPRSY rightable righteous/PUY rightful/PY righthand/D rightish rightism rightist rightmost righto rightward/S rightwinger/S rigi rigid/PY rigidify/N rigidity/S rigil rigmarole/S rigor/MS rigorism/MS rigorist/MS rigoristic/S rigorous/PY rigour/MS rile/G rilke rill rille rillet rilly rim/MS rimbaud rime/GR rimester rimland rimless rimmed rimming rimose rimous rimrock rimu rimy/R rin rinascimento rind/DMS rinderpest rinforzando ring/DGJRSZ ringbark ringbolt/S ringbone/D ringdove ringel ringent ringgit ringhals ringing/SY ringinglow ringleader/S ringlet/S ringlike ringmaster/S ringneck ringolade ringside/Z ringster ringstraked ringtail ringtaw ringtoss ringworm/S rink/R rinse/DGRS riot/DGRSZ riotous/PY rip/S riparian ripcord ripe/PRTY ripen/DGRS ripieno ripoff/MS ripon riposte ripped ripper ripping ripple/DGRS ripplet riprap ripsaw ripsnorter ripsnorting riptide rise/GJRSZ risen risibility risible/S risk/DGRS risky/PR risorgimento risotto rissole risus rit ritard ritardando rite/DMS ritenuto ritornello ritual/SY ritualisation ritualise/GS ritualised ritualism ritualist ritualistic ritualistically ritualization ritualize/GS ritualized ritzy/PR rivage rival/S rivaled/U rivaless/S rivaling rivalise/S rivalize/S rivalled/U rivalless/S rivalling rivalrous rivalry/MS rive/DGRZ riven river/MS riverbank/S riverbed riverboat riverfront riverine riverside riverview riverward/S riverweed rivet/DGRS rivulet/MS riyal rizal rizzio roach/S road/MS roadability roadbed/S roadblock/S roadholding roadhouse/S roadless roadroller/S roadrunner/S roads/I roadside/S roadstead roadster/MS roadway/MS roadwork/S roadworthy/P roam/DGRS roan roar/DGRS roaring/T roast/DGRS rob/S robalo roband robbed robben robber/MS robbery/MS robbia robbie robbing robe/DGS robin/MS roble roborant robot/MS robotic/S robotisation/MS robotise/S robotism robotization/MS robotize/S robust/PY robustious/PY roc roca rocaille rocambole rochet rock/DGRSZ rockabilly rockabye rockaway/S rockbound rockery rocket/DGMS rocketeer rocketry rockettes rockfish rocklike rockling rockoon rockrose rockshaft rockskipper rockweed rocky/PRS rococo rod/MS rodder rodding rode rodent/S rodenticide rodeo/S rodeph rodless rodlike rodomontade roe/S roebuck/S roemer roentgen roentgenise roentgenize roentgenogram/MS roentgenograph roentgenographic roentgenographically roentgenography roentgenologic roentgenological/Y roentgenologist roentgenology roentgenopaque roentgenoscope roentgenoscopic roentgenoscopy roentgenotherapy roeselare roff rogation rogatory roget rogue/GMS rogueing roguery roguish/PY roi roic roil/DGS roily roister/DGR roisterous rolamite role/MS roll/DGRSZ rollaway rollback rollbar rollick rollicking/Y rollie rollmop/S rollneck rollout rollover rollway rolnick romaine romance/DGRSZ romantic/MS romantically/U romanticisation romanticise/GS romanticism romanticist romanticization romanticize/GS romanza romaunt romp/DGRSZ romulo rondeau rondeaux rondel rondelet rondelle rondo/S rondure rone roneo ronggeng ronnel ronyon roo rood roof/DGRSZ roofhouse roofless rooflike roofline rooftop/S rooftree rooinek rook/S rookery rookie/S rooky room/DGRSZ roomette roomful roommate/MS roomy/PR rooney roorback roos roose roost/RZ root/DGMRS rootage rooted/P roothold rootle rootless/P rootlet rootlike rootstalk rootstock rooty ropable rope/DGRSZ ropean ropedancer ropedancing ropery ropewalk/R ropeway ropework ropy/PR roque roquefort roquelaure roquet roraima rorqual rorschach rort rosabelle rosace rosaceous rosaniline rosarian rosario rosarium rosary/S roscius roscoe roscommon rose/MS roseate/Y rosebay roseberry rosebud/MS rosebush rosefish rosehip roselike rosella rosemaling rosemary roseola roseolar rosery roset rosette/S rosewall rosewater rosewood rosh rosie rosily rosin/DG rosinante rosinous rosinweed roskilde roslev rospa rossetti rossi rossiya rossoff rostagno/S rostand rostellar rostellate rostellum roster rostock rostra rostral rostrate rostrum rosulate roswell rosy/PR rot/S rota/D rotameter/MS rotary rotatable rotate/DGNSVX rotated/U rotational/Y rotative/Y rotator/MS rotatory rote rotenone rotgut rothko roti rotifer rotisserie rotogravure/S rotonda rotor/S rotorcraft rotorua rotos rototill rotted rotten/PY rottenstone rotter rotting rottosei rottweiler rotund/PY rotunda rotundity roturier rou/HNS rouble/MS roucou rouge/G rouget rough/DNPRTXY roughage roughcast roughen/DGS roughhouse/DG roughish roughleg roughneck roughrider/S roughshod roulade rouleau rouleaux roulers roulette/DGS roumelia round/DGPRSTYZ roundabout/P rounded/P roundel roundelay roundhead/D roundheaded/P roundhouse roundish roundlet roundoff roundsman roundtable roundup/MS roundwood roundworm roup rouse/DGRS rouseabout rousement roust/R roustabout rout/DGJRZ route/DGJRSZ routeing routeman routeway routine/SY routinisation/MS routinise/S routinization/MS routinize/S roux rove/DGRS roven row/DGNRSZ rowboat/S rowdily rowdy/PRS rowdyish rowdyism rowel roweled roweling rowelled rowelling rowlock rowntree roxas roxy royal/Y royalisation/MS royalise/AS royalism royalist/MS royalization/MS royalize/AS royalty/MS royaux royster rozella rozelle rozzer rpt rub/S rubasse rubato rubbed rubber/MS rubberisation rubberise/GS rubberised rubberization rubberize/GS rubberized rubberlike rubberneck/R rubbery rubbing rubbish/S rubbishy rubble/DG rubblework rubbra rubby rubdown rube/S rubefacient rubefy rubella rubellite rubeola rubeolar rubescent rubiaceous rubicund rubicundity rubidium rubiginous rubinstein rubious ruble/MS rubout rubric rubrical/Y rubricate/N rubricator rubrician rubricise/S rubricize/S rubstone rubus ruby/MS rubythroat rucellai ruche/G ruck rucksack ruckus ruction rudbeckia rudd rudder/MS rudderhead rudderless rudderpost rudderstock ruddily ruddle/DG ruddleman ruddock ruddy/PR rude/PRTY ruderal rudesby/S rudiment/MS rudimental rudimentarily rudimentary/P rudish rue/DGS rueful/P ruefully rufescent ruff/DY ruffe/D ruffian/SY ruffianise/S ruffianism ruffianize/S ruffle/DGRS ruffled/U rufous rug/MS ruga rugae rugal rugate rugby rugged/PY ruggedisation ruggedise/DGS ruggedization ruggedize/DGS rugger ruggiero rugose/Y rugosity rugulose ruh ruidoso ruin/DGRS ruinate ruination/MS ruinous/PY ruisdael rule/DGJRSZ ruled/U ruleless rulership rum/MS rumba rumble/DGRS rumbly rumbustious rumdum rumelia rumen/S rumina ruminal ruminant/SY ruminate/NV ruminative/Y ruminator rummage/DGR rummel rummer rummest rummy/RS rumor/DGMRSZ rumored/U rumorer/MS rumormonger/MS rumour/DGMRSZ rumoured/U rumourer/MS rumourmonger/MS rump/SY rumple/DGS rumply/R rumpus rumrunner run/AS runabout/S runagate runaround runaway/S runback runcible runcinate runcorn rundle rundlet rundown rune/S rung/MS runic runless runlet runnable runnel/S runner/MS runneth running/A runny runoff/S runout/S runover runt/S runtime runtm runty/P runway/S rupee/S rupiah rupiahs rupicoline rupicolous ruppert rupture/DGS rural/Y ruralisation/MS ruralise/DGS ruralist rurality ruralization/MS ruralize/DGS rurban ruse rush/DGRS rushall rushee rushlight rushy rusk russet/DGS russetting russianisation russianise russianization russianize russify/N russula rust/DGS rustic rustical/Y rusticate/DGNS rusticator rusticise/S rusticity rusticize/S rustily rustle/DGRSZ rustproof rusty/NPR rut/MS rutabaga/S ruthenia ruthenic ruthenious ruthenium ruthful ruthless/PY rutilant rutilated rutile rutted rutting ruttish/PY rutty/R ruwenzori ruysdael ruyter ryazan rydal rye/M ryegrass ryobu ryokan ryot s's saba sabadell sabadilla sabah sabatier sabayon sabbat sabbath sabbatic sabbatical saber/DGMS sabered/U saberlike/MS sabertooth sabin sable/MS sabol sabot sabotage/DGS saboteur/S sabra sabras sabre/DGMS sabred/U sabrelike/MS sabretache sabretooth sabulous sac sacahuiste sacaton saccade saccadic saccate saccharase saccharate saccharic saccharide/S saccharify/N saccharimeter/MS saccharimetry saccharin saccharine saccharinity saccharoid saccharoidal saccharometer/MS saccharomyces saccharose sacco saccular sacculate/DNS saccule sacculus sacerdotal/Y sacerdotalism sacerdotalist sachem/S sachemic sachet/D sacheverell sack/DGRS sackbut sackcloth sackful saclike sacque sacra sacral sacralisation/MS sacralization/MS sacrament/S sacramental/Y sacramentalism sacramentalist sacramentise/S sacramentize/S sacrarium sacre/G sacred/PY sacrestia sacrifice/DGRSZ sacrificial/Y sacrilege sacrilegious/Y sacrilegiousnes sacristan sacristy sacroiliac sacrosanct sacrosanctity sacrum sad/PY sadat sadden/DGS sadder saddest saddhu saddle/DGRS saddlebag/S saddlebill saddlebow saddlecloth saddleless saddlery saddletree sade sadhu sadi sadiron sadism sadist/MS sadistic sadistically sadomasochism sadomasochist sadomasochistic sadowa safari safe/PRSTY safecracker safecracking safeguard/DGS safekeeping safelight safely/U safety/DGS safetyman saffian safflower saffron safid safranin safranine safrole sag/S saga sagacious/PY sagacity sagami sagamore sage/PSY sagebrush saggar sagged sagger sagging saghalien sagitta sagittal/Y sagittate sago/S saguache saguaro saguenay saguia sagunto saharanpur sahib sahitya said/U saida saiga sail/DGRS sailable sailboard sailboat/GRSZ sailcloth sailfish sailon sailor/SY sailorising/MS sailorizing/MS sailplane/R sain sainfoin sainsbury saint/DSY saintdom sainthood saintlike saintly/P saintsbury saintship saipan saith saithe sake/RS sakhalin saki sako saktas sakti salaam salability salable/A salacious/PY salad/MS salade saladin salado salamanca salamander salamandrine salambria salami/S salariat salary/DS salchow salduba sale/MS saleable saledo salep saleratus saleroom salesclerk salesgirl saleslady salesman salesmanship salesmen salespeople/M salesperson/M salesroom saleswoman saleswomen salet salic salicaceous salicin salicional salicylate salicylic salida salience saliency salient/Y salientian saliferous salify salimeter/MS saline salinger salinisation salinise/S salinity salinization salinize/S salinometer/MS salique saliva salivary salivate/DGNS sallee sallet sallow/P sallowish sallust sally/DGS salmagundi salmanazar salmi salmon/S salmonberry/S salmonella salmonellosis salmonid salmonoid salometer/MS salon/MS salonika saloon/MS saloonkeep saloonkeeper saloop salop salopette salpicon salpingectomy salpingitis salpinx salsa/MS salsify salt/DGPRSZ salta saltant saltarello saltation saltatorial saltatory saltbox saltbush saltcellar saltchuck/R salted/U saltern saltfish saltigrade saltillo saltily saltine saltire saltless saltlike salto saltonstall saltpan saltpeter/MS saltpetre/MS saltshaker saltus saltwater saltworks saltwort salty/PRT salubrious/PY salubrity/I saluki salutarily salutaris salutary/P salutation/MS salutational salutatorian salutatory salute/DGRS salutiferous salutory salvable salvage/DGRS salvageability salvageable salvation salvational salvationism salvationist salvatorian salve/GRS salverform salvific salvo/S salvoes salvor salween salyut salzgitter samar samara samarang samaria samarium samarskite samba sambar sambre sambur same/P samekh samfoo samiel samisen samite samiti samizdat samlet samnium samos samothrace samovar samp sampan samphire sample/DGJMRSZ samsara samshu samsun samurai/MS sanatarium sanative sanatoria sanatorium sanbenito sancta sanctify/DNR sanctimonious/PY sanctimony sanction/DGS sanctitude sanctity/S sanctuary/MS sanctum sand/DGRSZ sandakan sandal/MS sandaled sandaling sandalled sandalling sandalwood sandarac sandbag sandbagger sandbank sandbar sandbars sandblast/R sandbox sandbur sandfly sandglass sandgrouse sandhi sandhill sandhog sandling sandlot sandlotter sandman sandpaper sandpapery sandpile sandpiper sandpit sandsoap sandstone/S sandstorm/S sandwich/DGS sandworm/S sandwort/S sandy/PR sane/PRTY sang sangaree sangfroid sango sangre sangria sanguinaria sanguinarily sanguinary sanguine/PY sanguineous sanguineum sanguinity sanguinolent sanicle sanies sanious sanipractor sanitaire sanitarian sanitarily sanitarium/S sanitary/IU sanitate/X sanitation sanitisation sanitise/DGRS sanitization sanitize/DGRS sanitorium sanity/I sank sankey sankt sanmicheli sannyasi sans sansei/S sanserif sansevieria sanskritic sansom sansome sant santalaceous santana santander santolina santonica santonin santour saorstat sap/MS sapajou sapanwood sapele saphead/D saphena saphenous sapid sapidity sapience sapiens sapient/Y sapiential sapientise/S sapientize/S sapindaceous sapio sapir sapless/P sapling/MS sapodilla sapogenin saponaceous/P saponifiable saponify/NR saponin/S saponite sapor saporous sapota sapotaceous sappanwood sapped sapper sapphic sapphira sapphire sapphirine sapphism sapping sapporo sappy/PR sapraemia sapremia sapremic saprobe saprobic saprobically saprogenic saprogenicity saprolite sapropel sapropelic saprophagous saprophyte saprophytic saprophytically saprozoic sapsago sapsucker sapwood saraband sarabande saragossa sarape sarasate sarawak sarcasm/MS sarcastic sarcastically sarcenet sarcocarp sarcoid sarcoidosis sarcolemma sarcolemmal sarcoma sarcomatosis sarcomatous sarcomere sarcomeric sarcophagic sarcophagous sarcophagus sarcophagy sarcoplasm sarcoplasma sarcoplasmatic sarcoplasmic sarcosomal sarcosome sarcous sardar sardegna sardine/S sardonic sardonically sardonicism sardonyx sargasso sargassum sarge sari sarmatia sarmentose sarmi sarnen sarnia sarod sarode sarodist sarong/MS saronic saros sarpanch sarpedon sarpsis sarraceniaceous sarraute sarre sarrusophone sarsaparilla sarsenet sarsparilla sarthe sarti sarto sartor sartorial/Y sartorius sarum sarvodaya sasebo sash/DS sashay/D sashimi sasin saskatoon sass sassaby sassafras sassari sassing sassoon sasswood sassy/R sastruga sat satai satang/S satanic satanically satanise/S satanize/S satchel/MS satchelful sate/DGS sateen satellite/MS satellitium satem sati satiable/I satiate/DGNS satiety satin satinet satinflower satinise/S satinize/S satinpod satinwood satiny satire/MS satiric satirical/Y satirisable/S satirise/DGRZ satirised/U satirises/U satirist/MS satirizable/MS satirize/DGRZ satirized/U satirizes/U satisfaction/MS satisfactorily/U satisfactory/P satisfiability/U satisfiable/U satisfied/U satisfy/DGRSZ satisfying/Y satori satrap satrapy saturable saturant saturate/DGNRSX saturated/AU saturates/A saturator saturnali saturnalia saturnalian/Y saturniid saturnine/Y saturnism satyagraha satyagrahi satyr satyriasis satyric satyrid sauce/GRSZ saucebox saucepan/MS saucerlike sauch saucily saucy/PR sauerbraten sauerkraut sauger sauna/MS saunter/DGRS saurel saurian sauries saurischian sauropod saury sausage/MS saussure saute sauterne/S sav sava/S savable savage/DGPRSYZ savagery savagise/S savagism savagize/S savaii savanna/MS savannahs savant/S savate save/DGJRSZ saveable saved/U saveloy savior/MS saviorhood/MS saviorship/MS saviour/MS saviourhood/MS saviourship/MS savoie savoir savona savor/DGRSZ savorer/MS savorily/SU savoring/Y savoringly/S savorless/S savorous savory/MPRST savour/DGRSZ savourer/MS savourily/SU savouring/Y savouringly/S savourless/S savourous savoury/MPRST savoy savvy/DG saw/DGRS sawbelly sawbill sawbones/S sawbuck sawder sawdust sawfish sawfly sawhorse sawlike sawmill/MS sawn sawtimber sawtooth sawyer sax saxhorn saxicolous saxifragaceous saxifrage saxo saxons saxophone/MS saxophonic saxophonist saxton say/GJRSZ sayable/U sayan sazerac scab/S scabbard/MS scabbed scabbing scabble/DGS scabby/R scabies scabietic scabiosa scabious scabrous/PY scad/MS scafell scaffold/GJS scag scagliola scalability scalable scalade scalado scalage scalar/MS scalare scalariform/Y scalation scalawag scald/DGS scaldfish scale/DGJRSZ scaleboard scaled/A scaleless scalelike scalene scalenus scalepan scaliger scall scallion scallop/DGRS scallopini scallywag/S scalogram/MS scaloppine scalp/GMRS scalpel scaly/PR scam/MS scammed scammel scamming scammony scamp scamper/DGS scampi scampini scampish scan/AS scandal/MS scandaled scandaling scandalisation/MS scandalise/RSZ scandalised/U scandalises/U scandalising scandalization/MS scandalize/RSZ scandalized/U scandalizes/U scandalizing scandalled scandalling scandalmonger scandalous/PY scandaroon scandent scanderbeg scandic scandium scannable scanned/A scanner/MS scanning/A scansion scansorial scant/PY scantily scantling scanty/PRST scapa scape/G scapegoat/GS scapegoatism scapegrace scapewheel scaphoid scaphopod scapin scapolite scapose scapula scapular/S scar/DGMRS scarab scarabaeid scarabaeus scaramouch scaramouche scarce/PRTY scarcement scarcity scare/DGRS scarecrow scarecrowish scarehead scaremonger scarey scarf/S scarface scarfpin scarfskin scarificator scarify/NR scarious scarlatina scarlatinal scarless scarlet scarp/DGRSZ scarper/DGS scarph scarred scarring scarron scarry scarves scary/R scat scatback scathe/DS scatheless scathing/Y scatological scatology scatted scatter/DGRS scatteration scatterbrain/D scattergram scattergun scattering/Y scatterplot/S scattershot scatting scatty/R scaup/RS scavenge/DGS scavenger/MS scc scena scenario/MS scenarioisation/MS scenarioise/S scenarioization/MS scenarioize/S scenarisation/MS scenarise/S scenarist scenarization/MS scenarize/S scend scene/MS scenery/S scenic/S scenical/Y scenographic scenographically scenography scent/DS scentless scepter/DGMS scepterless/S scepters/U sceptibly sceptic sceptical scepticism sceptre/DGMS sceptred/U sceptreless/S sceptres/U schappe schedule/DGMRSZ scheduled/AU scheduler/MS schedulise/S schedulize/S scheel scheele scheelite scheldt schelling schema/MS schemata schematic/S schematically schematisation/MS schematise/DGRSZ schematism schematization/MS schematize/DGRSZ scheme/DGMRSZ scherzando scherzi scherzo schiaparelli schickard schilling schism schismatic schismatical/Y schismatise/DGS schismatist schismatize/DGS schist schistose schistosity schistosomal schistosome schistosomiasis schistous schizo/S schizocarp schizogenesis schizogonic schizogonous schizogony schizoid schizomycete schizomycetes schizomycetous schizont schizophrene schizophrenia schizophrenic schizophrenically schizophyceous schizophyte schizophytic schizopod schizothymia schizothymic schlegel schlemiel schlepp schlieren schlieric schlock schmaltz schmaltzy schmalz schmo schmooze schmuck schnapps schnauzer schnitzel schnook schnorkle schnorrer schnozzle schola scholar/SY scholarship/MS scholastic/S scholastica scholastically scholasticate scholasticism scholiast scholiastic scholium schongauer school/DGRSZ schoolbag schoolbook/S schoolboy/MS schoolchild schooled/U schoolfellow schoolgirl/S schoolgirlish schoolhouse/MS schoolie schoolman schoolmarm schoolmaster/MS schoolmate/S schoolmistress schoolroom/MS schoolteacher schooltime schoolwork schoolyard/MS schooner schopenhauer schorl schorlaceous schottische schouten schrodinger schul schuman schwa schwaben schwada schwann schwarzwald schweinfurt schweiz schwerin schwitters schwyz sciaenid sciaenoid sciamachy sciatic sciatica science/MS scienter sciential scientific/U scientifically/U scientifique scientism scientist/MS scientologist scientology scilicet scilla scilly scimitar/S scincoid scintigraphic scintigraphy scintilla scintillant/Y scintillate/DGNS scintillator scintillometer/MS sciolism sciolist sciolistic sciomachy sciomancy sciomantic scion/S scipio scire scirocco scirrhi scirrhous scirrhus scissel scissile scission/A scissor/DGS scissortail scissure sciurine sciuroid sclera sclerenchyma scleritis sclerodermatous scleroid scleroma sclerometer sclerophyll scleroprotein sclerose/D sclerosis sclerotial sclerotic sclerotin sclerotisation sclerotised sclerotium sclerotization sclerotized sclerotomy sclerous scoff/DGRS scofflaw/MS scold/DGRS scolecite scolex scolices scoliosis scoliotic scollop scolopendra scolopendrid scombroid sconce scone scoop/DGRS scoopful scoot/DGRS scop scopas scope/DGS scopic scopolamine scops scopula scopulate scorbutic scorbutically scorch/DGRS scorching/Y score/DGJMRSZ scoreboard/S scorecard scorekeeper scoreless scoria scoriaceous scorify scorn/DGRS scornful/PY scorpaenid scorpaenoid scorper scorpioid scorpion/MS scotch scotchgard scotchman scoter scotoma scotomatous scotopia scotopic scotswomen scottie scotus scoundrel/MSY scour/DGJRS scourge/GR scouse/R scout/DGRS scoutcraft scoutmaster scow scowl/DGRS scrabble/DGRS scrabbly scrag scragging scraggly scraggy/R scram scramb scramble/DGRSU scramming scran scrannel scrap/DGJMRSZ scrapbook/S scrape/DGJRSZ scraperboard/S scrapheap/S scrapie scrapped scrapper scrapping scrapple scrappy/PR scratch/DGRSZ scratched/U scratchy/PR scrawl/DGRS scrawly scrawny/PR screak screaky scream/DGRSZ screaming/Y scree screech/DGRS screechy screed screen/DGJRS screenable screened/U screenful screenplay screenwriter/MS screvane screw/DGRS screwball screwbean screwdriver/S screwlike screws/U screwup screwworm screwy/PR scribble/DGRS scribe/GIRS scrieve scrim scrimmage/DGRS scrimp/DGS scrimpy scrimshank scrimshaw scrip script/DGMS scriptal scripted/U scription scriptorium scriptural/Y scripturalise/S scripturalize/S scripture/S scriptwriter/MS scriven/R scrobiculate scrod scrofula scrofulous scroll/DGS scrollbar/MS scrollwork scrooge/MS scroop scrophulariaceous scrota scrotal scrotum/MS scrouge/G scrounge/DGRSZ scrub/S scrubbed scrubber scrubbing scrubby/R scrubland scrubwoman scruff scruffy/PR scrum scrummage scrump scrumptious/Y scrumpy scrunch scruple/DGS scrupulosity scrupulous/PUY scrutable/I scrutator scrutin scrutineer scrutinisation/MS scrutinise/DGRSZ scrutinised/U scrutinising/UY scrutinisingly/S scrutinization/MS scrutinize/DGRSZ scrutinized/U scrutinizing/UY scrutinizingly/S scrutiny scry scuba scud/S scudded scudding scudo scuff/DGS scuffle/DGS scull/DGRS scullery/S scullin scullion/S sculpin sculpsit sculpt/DGS sculptor/MS sculptress sculptural/Y sculpture/DGS sculpturesque/Y scum/MS scumble/DGS scumming scummy scuncheon scunge scungy scunner scunthorpe scup/S scupper/DGS scuppernong scurf scurfy scurril scurrile scurrility scurrilous/PY scurry/DG scurvily scurvy/P scut scuta scutage scutate scutch scutcheon scute scutellation scutellum scutiform scuttle/DGS scuttlebutt scutum scyphiform scyphistoma scyphozoan scyphus scyros scythe/GMS sea/SY seabag seabeach seabed/M seabird seaboard seaboot seaborg seaborne seacoast/MS seacock seacraft seadog seadrome seafare/GRZ seafloor seafood seafowl seafront seagirt seagoing seagull/S seahorse seakale seal/DGRS sealant/S sealed/AU sealery seals/U sealskin seam/DGNRS seaman/Y seamanlike seamanship/S seamark seami seamless/PY seamlike seamount seamster seamstress/S seamy/PR seanad seance seaplane seaport/MS seaquake seaquarium sear/DGS search/DGJRSZ searchable/U searcher/AMS searching/SY searchless searchlight/S searing/Y seascape sease seashell/MS seashore/MS seasick/P seaside season/DGJMRSYZ seasonable/PU seasonably/U seasonal/Y seasonality seasoned/U seastrand seat/DGRS seatmate/MS seato seawall seawan seaward/S seaware seawater/M seaway seaweed/S seaworthy/P seaworthyness sebaceous sebacic sebiferous seborrhea seborrheic seborrhoea seborrhoeic sebum sec secam secant/S secateur/S secco secede/DGRS secern secession secessionism secessionist sech seclude/GS secluded/PY seclusion seclusive/PY secobarbital second/DGRSYZ secondarily secondary/PS secondhand secondo secrecy secret/DGSVY secretarial secretariat secretary/MS secretaryship secrete/DGNSVX secretin secretionary secretive/PY secretor secretory sect/IMS sectarian sectarianisation sectarianise/DGS sectarianises/U sectarianism sectarianization sectarianize/DGS sectarianizes/U sectary/I sectile/I sectility section/DGS sectional/Y sectionalisation/MS sectionalise/GS sectionalised sectionalism sectionalization/MS sectionalize/GS sectionalized sectionise/S sectionize/S sector/DGMS sectoral sectorial secular/Y secularisation/MS secularise/GRSZ secularised/U secularises/U secularism secularist/S secularistic secularity secularization/MS secularize/GRSZ secularized/U secularizes/U secund secundine/S secure/DGJPRSY secured/U securement security/S sedan/S sedate/DGNPSVY seddon sedentary seder sedge sedgwick sedgy sedilia sediment/MS sedimentary sedimentation sedimentologic sedimentological/Y sedimentologist sedimentology sedition seditious/PY seduce/DGRSZ seducement seduction/S seductive/PY seductress sedulity sedulous/P sedulously sedum see/RSZ seeable seed/DGJRSZ seedbed/S seedcake/S seeded/U seedily seedless seedlike seedling/MS seedpod seedsman seedtime seedy/PR seeing/U seek/GRSZ seeking/Y seel seeley seem/DGSY seeming/Y seemly/PR seen/U seep/DGS seepage seepy seeress seerey seersucker seesaw/DGS seethe/DGS seferis seg segetal segment/DGS segmental/Y segmentary segmentation/MS segmented/U segno/S segregant segregate/DGNSV segregated/U segregationist segue/DMS segueing seguidilla segur segura sei seicento seiche seif seigneur seigneurial seigneury seignior seigniorage seigniory seignorage seignorial seignory seine/GR seise seisin/S seism seismic seismicity seismism seismogram/MS seismograph/R seismographic seismographs seismography seismological seismologist seismology seismometer seismometric seismometry seismoscope seizable seize/DGJRSZ seizin/S seizor/S seizure/MS selachian selaginella selah selangor selden seldom select/DGPSV selectable selected/AU selectedly selectee selection/MS selectional selective/PY selectivity selectman selectmen selector/MS selenate selenic selenide seleniferous selenious selenite selenium selenocentric selenodont selenographer selenographic selenographist selenography selenological selenologist/MS selenology selenomorphology selenosis seleucia seleucus self/P selfadjoint selfdom selfheal selfhood selfish/PUY selfless/PY selfsame/P sell/AGRSZ sellable selle sellotape sellout selsyn seltzer selva selvage/D selvedge/D selves semanteme semantic/S semantical/Y semanticist/MS semaphore/MS semarang semasiological semasiologist semasiology sematic sematology semblable semblably semblance/A semeiology semele sememe semen sement semeru semester/MS semestral semestrial semi semiabstract semiabstraction semiannual/Y semiaquatic semiarboreal semiarid semiaridity semiautomated semiautomatic semiautomatically semiautonomous semibasement semibituminous semibold semibreve semicarbonise/S semicarbonize/S semicentenary semicentennial semicircle/S semicircular semicivilisation/MS semicivilised/MS semicivilization/MS semicivilized/MS semiclassic semiclassical semicolon/MS semicolonial semicolonialism semicolony semicommercial semicompile semiconducting semiconductor/MS semiconscious/PY semiconservative/Y semicrystaline semicrystalline semicylindrical semidarkness semidefinite semidesert semidetached semidiameter semidiurnal semidivine semidocumentary semidome/D semidomestic semidomesticated semidomestication semidominant semidouble semidry semidrying semiellipse semielliptic semielliptical semiempirical semierect semievergreen semifinal semifinalist semifinished semifitted semiflexible semifluid semiformal semifossil semifossilised/MS semifossilized/MS semigloss semigovernmental semigroup semihonor/MS semihonour/MS semihumanised/MS semihumanized/MS semilegendary semilethal semiliquid semiliterate semilog semilogarithmic semilunar semilustrous semimanufactures semimercerised/MS semimercerized/MS semimetal semimetallic semimicro semimineralised/MS semimineralized/MS semimoist semimonastic semimonthly semimystical seminal/Y seminar/MS seminarian/S seminarise/S seminarist seminarize/S seminary/MS semination seminationalisation/MS seminationalization/MS seminiferous seminumerical semiofficial/Y semiological semiology semiopaque semiorganised/MS semiorganized/MS semiosis semiotic/S semiotical semiotician semioxidised/MS semioxidized/MS semioxygenised/MS semioxygenized/MS semipalmate semipalmated semiparasitic semipermanent/Y semipermeability semipermeable semiphore semipolitical semiporcelain semipostal semiprecious semiprivate semipro semiprofessional/SY semiprofessionalised/MS semiprofessionalized/MS semipublic semiquantitative/Y semiquaver semiramis semireligious semiretired semiretirement semirigid semisacred semisecret semisedentary semishrub semishrubby semiskilled semisoft semisolid semistructured semisweet semisynthetic semiterrestrial semitic/S semitonal/Y semitone semitonic semitonically semitrailer semitrance semitranslucent semitransparent semitropic/S semitropical semivitreous semivocal semivowel semivulcanised/MS semivulcanized/MS semiweekly semiworks semiyearly semmes semolina sempach semper sempervivum sempiternal/Y sempiternity semple semplice sempre sempstress semra sen/S sena senarii senarius senarmontite senary senate/MS senator/MS senatorial senatorian senatorship send/GRSZ sendable sendai sendal sendoff sends/A senecio senectitude senega senegambia senesac senescence senescent seneschal senghor sengi senhor senhora senhores senhorita senile/Y senilis senilise/S senility senilize/S senior/MS senioritatis seniority seniti senna sennacherib sennar sennet sennight sennit senor senorita sensa sensate/IY sensation/MS sensational/Y sensationalise/DGS sensationalism sensationalist sensationalistic sensationalize/DGS sense/DGS senseful senseless/PY sensibilia sensibility/S sensible/IP sensibly/I sensillum sensise/S sensitisation/AMS sensitise/GRSZ sensitised/U sensitises/AU sensitive/PSY sensitivity/S sensitization/AMS sensitize/GRSZ sensitized/U sensitizes/AU sensitometer/MS sensitometric sensitometry sensize/S sensor/MS sensorial/Y sensorimotor sensorineural sensorium sensory sensual/Y sensualisation/MS sensualise/DGS sensualism sensualist sensualistic sensuality sensualization/MS sensualize/DGS sensum sensuosity sensuous/PY sent/AU sentence/DGS sententia sentential/Y sententious/PY senti sentience/I sentient/Y sentiment/MS sentimental/Y sentimentalisation/MS sentimentalise/DGRSZ sentimentalises/U sentimentalism sentimentalist sentimentalists sentimentality sentimentalization/MS sentimentalize/DGRSZ sentimentalizes/U sentinel/MS sentineled sentineling sentinelled sentinelling sentry/MS senussi sepal sepaled sepalled sepaloid separability/I separable/IP separably separate/DGNPSVXY separationist separatism separatist separatistic separator/MS sepia sepiolite seppuku sepses sepsis sept septa septal septarium septate/N septavalent septenarius septenary septendecillion septennial/Y septennium septentrion septentrional septet septic septicaemia septicemia septicemic septicidal septicisation/MS septicization/MS septifragal septilateral septillion septime septivalent septuagenarian septuagesima septum septuple septuplet septuplicate sepuchral sepulcher/DMS sepulchers/AU sepulchral/Y sepulchralise/S sepulchralize/S sepulchre/DMS sepulchred/U sepulchres/AU sepulture seq sequacious/Y sequacity sequel/MS sequela sequelae sequence/DGJRSZ sequenced/A sequency sequent sequential/Y sequentialise/DGS sequentiality sequentialize/DGS sequester/DG sequestrant sequestrate sequestration sequestrum sequin/DS sequinned sequitur sequoia ser sera serac serafin seraglio serai serajevo seral seram serang serape seraph seraphic seraphically seraphim seraphs serbantian serbian sercq serdab sere serein seremban serenade/DRS serenata serendipitous/Y serendipity serene/PY serenise/S serenity serenize/S serf/MS serfage serfdom serge/G sergeancy sergeant/MS sergeanty sergipe serial/SY serialisability serialisable serialisation/MS serialise/DGS serialism serialist serializability serializable serialization/MS serialize/DGS seriate/Y seriatim sericeous sericin sericultural sericulture sericulturist seriema series serieuses serif serigraph/R serigraphy serin serine seringa seringapatam seriocomic seriocomically serious/PY serjeant serjeants serjeanty sermon/MS sermonic sermonise/DGRSZ sermonize/DGRSZ serodiagnosis serodiagnostic serologic serological/Y serologist serology seropurulent serosa serosal serotinal serotine serotinous serotonin serotype serous serow serpent/MS serpentine/Y serpentinisation/MS serpentinise/S serpentinization/MS serpentinize/S serpentise/S serpentize/S serpiginous/Y serpigo serpulid serra serranid serranoid serrate/DGNS serratus serried/PY serriform serrulate/N serry/DG serting sertive sertorius sertularian serum/MS serval servanda servant/MS servation servatius serve/DGJRSZ served/AU server/MS servetus servia service/DGRS serviceability serviceable/P serviceably serviceberry serviced/U serviceman servicemen servicewoman servicewomen servient serviette/S servile/PY servilise/S servility servilize/S servitor/S servitude servo/S servomechanism/S servomotor servosystem/S sesame sesamoid sesotho sesquialtera sesquicarbonate sesquicentenary sesquicentennial sesquioxide sesquipedalian sessed sesshu sessile sessility session/MS sessional sesterce sestertium sestet sestina sestos set/MS seta setaceous/Y setae setal setback/S setiferous setiform setline setnm seto setoff setom setose setout setpoint/S sets/AI setscrew/S sett settable settee/S setter/MS setting/AI settings/A settle/DGJRSZ settled/AU settlement/MS settles/A settling/AU settlor setup/S setz setzb setzm seurat sevan sevec seven/HS sevenfold seventeen/HS sevenths seventy/HS seventyfold sever/DGRST severability severable several/SY severalfold severalise/S severalize/S severalty severance severe/DGPRTY severisation/MS severise/S severity/MS severization/MS severize/S severna sevigli sew/DGRSZ sewage sewan sewell sewerage sewickley sewn sex/DS sexagenarian sexagesimal sexangular sexcentenary sexdecillion sexennial sexily sexism/M sexist/MS sexivalent sexless/PY sexology sexpartite sexpot sext sextain sextan sextant sextet sextic sextile sextillion sexto/S sextodecimo sexton sextuor sextuple/DG sextuplet sextuplicate sexual/Y sexualisation/MS sexualise/S sexualised sexuality sexualization/MS sexualize/S sexualized sexy/PR sey seyfert seyhan sfax sforza sforzando sfumato sgraffito shaba shabbat shabbily shabby/PR shack/DS shackle/DGRS shacklebone shad shadberry shadblow shadbush shaddock shade/DGJRS shaded/U shadeless shadflower shadily shadoof shadow/DGRS shadowbox shadowgraph shadowily shadowless shadowlike shadowy/P shadrach shaduf shadwell shady/PRT shaef shaft/DGMS shaftesbury shaftsbury shag/S shagbark shaggily shagging shaggy/PR shaggymane shagreen shah shahaptin shahdom shahjahanpur shahn shaitan shakable/U shakably shake/GRSZ shakeable/U shakedown shaken/U shakeout shakhty shakily shako shakoes shaky/PR shakya shale/S shall shalloon shallop shallot shallow/PRSY shalom shalt sham/DGMS shaman shamanism shamanist shamanistic shamash shamba shamble/DG shambles shame/DGS shameface shamefaced/P shamefacedly shamefast shameful/PY shameless/PY shammer shammes shamming shammosim shammy shamo shampoo/RS shamrock shamus shan shan't shandrydan shandy/S shandygaff shangaan shanghaied shanghaier shango shank/D shankpiece shanny shansi shantey shantow shanty/MS shantyman shantytown shapable shape/DGRSYZ shapeable shapeless/PY shapely/PR shapen/U sharable shard shards share/DGRSZ shareability shareable sharecrop sharecropper/MS sharecropping shared/U sharefarmer/S shareholder/MS shareown shark/MS sharkskin sharksucker sharp/DGNPRSTXY sharpen/DGRS sharpened/U sharpie/S sharpshoot/GRZ sharpy/S sharrow shashlick shashlik shatilov shatter/DGS shattering/Y shatterproof shave/DGJRS shaved/U shaveling shaven/U shavetail shavie shavuot shaw shawano shawl/MS shawm shawomet shay/S shayne shayol she'd she'll she/M sheading sheaf sheaflike sheahe shear/DGRSZ shearlegs shearling shearn shearwater sheatfish sheath/GR sheathbill sheathe/U sheathing/U sheaths sheave/G sheaves sheba shebang shebeen sheboygan shechina shed/S shedded shedder shedding sheen sheene sheeny sheep sheepcote sheepdog sheepfold sheepherder sheepherding sheepish/PY sheepshank sheepshead sheepshearer sheepshearing sheepskin sheepwalk sheer/DPY sheeran sheerlegs sheet/DGRS sheetfed sheetlike sheik sheikdom sheikh sheikhdom shekel shelagh shelf/S shelfful shelflike shell/DGMRS shellac shellacked shellacking shellback/MS shellbark shellcracker shelled/U shellfire shellfish shellproof shellwork shelly shelta shelter/DGRS shelterbelt sheltered/U shelterless sheltie/S shelty/S shelve/DGRS shem shema shembe shenanigan/S shend/G shensi shenyang shep shepherd/DGMS shepherdess shepherdise/S shepherdize/S sher sherbert sherbet sherbrooke sherd sheria sherif sheriff/MS sheriffdom sherlock sherris sherry/S sherwani shes shetlands shevelling shew/S shewbread shewe shewn shh shiai shibboleth shibboleths shicker/D shiel/G shield/DGRS shielded/U shietz shiflett shift/DGRSZ shiftable shiftily shiftless/PY shifty/PRT shigella shih shihchiachuang shikar shikari shikarred shikarring shikoku shiksa shikse shilingi shill/S shillalah shillelagh shilling/S shillong shillyshally shily shim/S shimmer/DG shimmery shimming shimmy/DGS shin/DGRZ shinar shinbone shindig/MS shindy/S shine/DGRSZ shingle/DGMRS shingly shining/Y shinkin shinleaf/S shinnery shinney shinning shinny/DG shinplaster shinsplints shinty shiny/PR ship/MS shipboard/S shipborne shipbuild/R shipbuilding shipfitter shipka shiplap shipload shipman shipmaster shipmate/S shipmen shipment/MS shipowner shippable shipped shipper/MS shipping shipshape shipside shipway shipworm shipwreck/DS shipwright shipyard/S shiralee shire/S shirk/GRS shirr/G shirt/GS shirtmake/R shirtsleeve shirttail shirtwaist/R shirty shish shit shitepoke shithead shittah shittim shiv shiva shivaree shive shiver/DGRS shivery shizuoka shlemiehl shlock sho shoal/MS shoat shock/DGRSZ shockheaded shocking/Y shockproof shockstall shod/U shoddily shoddy/PR shoe/DRS shoebill shoeblack shoehorn shoeing shoelace/S shoemake/Z shoemaker shoepac shoepack shoeshine shoestring/S shoetree shofar shogun shogunate sholapur sholom shone shoo/G shoofly shoogle shook shool shoon shoot/GJRSZ shootout/MS shop/MS shopfloor/S shophar shopkeep shopkeeper/MS shoplift/GRZ shoppe shopped shopper/MS shopping shopsoiled shoptalk shopwalker shopwork/R shopworn shoran shore/DGMS shorebird/MS shorefront shoreless shoreline/S shoreside shoreward/S shorn short/DGNPRSTXY shortage/MS shortbread shortcake shortchange/R shortcoming/MS shortcut/MS shorten/DGRS shortfall/S shorthand/DS shorthorn shortie/S shortish shortliffe shortlist/DGS shortlived shortsighted/PY shortstop shorty/S shoshone shot/MS shotbush shote shotgun/MS shotline/S shott shotten should/RTZ shoulder/DGS shouldn't shouldst shoup shouse shout/DGRSZ shove/DGRS shovel/S shoveled shoveler/S shovelful shovelhead shoveling shovelled shoveller shoveller/S shovelling shovelman shovelnose shovelsful show/DGJRSZ showboat showbread showcase/DGMS showd showdown shower/DGS showerproof showery showgirl showily showjumping showman showmanship showmen shown showpiece showplace showroom showstopper showy/PR shrank shrapnel shred/MS shredded shredder/MS shredding shrew/MS shrewd/PTY shrewdie shrewish/PY shrewmouse shriek/DGS shrieval shrievalty shrieve shrift shrike shrill/DGP shrilly shrimp shrimpy shrine/MS shrink/GRS shrinkable shrinkage shrive/D shrivel/S shriveled shriveling shrivelled shrivelling shriven shriver shroff shroud/DGS shrove shrub/MS shrubbery shrubby/R shrug/S shrugged shrugging shrunk/N shtetel shtetl shtetlach shtg shtick shuck/RS shudder/DGS shuddery shuffle/DGRS shuffleboard shufty shufu shuggy shuiski shul shulde shun/S shunned shunner shunning shunpike/GR shunt/DGRS shush shushan shut/S shutdown/MS shute shuteye shutoff shutout shutter/DGS shutterbug shutterless shutting shuttle/DGS shuttlecock/S shuz shy/DGPRSY shyer shyes shyest shylockian shyness shypoo shyster si sialagogue sialkot sialoid siamang siang siangtan sib/Y sibe sibilant/Y sibilate/N sibiu sibling/MS sibyl/S sibylic sibylla sibyllic sibylline sic siccative siccing sicilia siciliana sick/GNPRSTY sickbay sickbed/MS sicken/DGR sickening/Y sicker/Y sickert sickie sickish/PY sickle/DG sicklebill sicklemia sicklewort sicklily sickly/DGP sickness/MS sickroom sicyon sid siddo siddons siddur siddurim side/DGJS sidearm/S sideband/S sideboard/MS sideburned sideburns sidecar/S sidechain/S sided/P sidedress sideffect/S sidehill sidekick/S sidelight/MS sideline/RS sideling sidelong sideman sidemen sidency sident sidepiece sideplate/S sidereal siderealise/S siderealize/S siderite sideritic siderolite siderophilin siderosis siderostat sidesaddle sideshow/S sideslip/S sidesman sidespin sidesplitting sidestep/S sidestepped sidestepper sidestepping sidestroke sideswipe sidetrack/DGS sidewalk/MS sidewall sideward/S sideway sideways sidewheel/R sidewinder sidewise sidi sidle/DGS sidon sidra sie sieben siebern siecle/S siegbahn siege/GMS siegler sieglinde sienkiewicz sienna siepi sierra/S sierran siesta sieux sieve/GMSZ sifaka sift/DGJRS sifted/A sig sigh/DGR sighs sight/DGJRSY sightless/P sightly/P sightscreen sightsee/RZ sightseeing sigil sigismund sigla siglos sigma/S sigmate sigmoid sigmoidal/Y sigmoidoscope sign/DGRSZ signac signal/SY signaled signaler/S signaling signalisation signalise/DG signalises signalization signalize/DG signalizes signalled signaller signaller/S signalling signalman signalmen signalment signatories signatory signature/MS signboard signed/AU signet signifiable significance/IS significancy/I significant/SY significative/PY significs signify/DGNRS signior signiory/S signore signorelli signori signorina signorino signory/S signpost/DGS sigurd sikang sike/G silage silane silastic sild/S sile silence/DGRSZ silent/PSY silenus silesia silex silhouette/DS silica silicate/S silicatisation/MS silicatization/MS siliceous silicic silicicolous silicide silicidise/S silicidize/S siliciferous silicify/N silicious silicium silicle silicon/S silicone siliconise/S siliconize/S silicosis silicothermic silicotic siliculose siliqua silique silk/NS silkaline silke silkily silkoline silkweed silkworm/S silky/PRT sill/MS sillabub sillily sillimanite silly/PRT silo/S siloam silone siloxane silt/DGS siltation siltstone/S silty silurid siluroid silva/S silvan silver/DGRSY silverfish silverise/RSZ silverize/RSZ silvern silverpoint silverside/S silversmith silversmiths silvertail silverware silverweed silvery/P silvical silvicolous silvics silvicultural/Y silviculture silviculturist simar simaroubaceous simazine simba simca simchath simian similar/Y similarise/S similarity/S similarize/S simile similise/S similitude similize/S simitar simla simmel simmer/DGS simms simnel simoleon simoniac simonides simonise simonize simony simoom simoon simp/RZ simpatico simper/DGRS simple/PRST simpleminded/PY simpleton simplex/S simplices simplicial/Y simplicidentate simplicity/MS simplifiction simplified/U simplify/DGNRSXZ simplism simplistic simplistically simplon simply simsim simula simulacre simulacrum simulant simular simulate/DGNSVX simulator/MS simulcast simultaneity simultaneous/PY sin/MS sinan sinanthropus sinapism sinarquist sinatra since sincere/PTY sincerity/I sincipita sincipital sinciput sind sine/GS sinecure sinew/MS sinewy sinfonia sinfonietta sinful/PY sing/DGRSYZ singable singe singeing singer/MS singing/Y single/DGPS singlehanded/Y singleminded singlestick singlet singleton/MS singletree singsong singsonged singsongy singspiel singular/Y singularisation/MS singularise/S singularity/MS singularization/MS singularize/S singultus sinh sinhailien siniboia sinicise/DGS sinicize/DGS sinister/PY sinistral/Y sinistrodextral sinistrorse sinistrous sink/DGRSZ sinkable sinkage sinkhole/S sinless/PY sinn sinned sinner/MS sinning sinoatrial sinological sinologist sinologue sinology sinopia sinsyne sint sinter/D sinterability sinton sinuate/Y sinuatrial sinuosity sinuous/PY sinuousities sinus/S sinusitis sinusoid sinusoidal/Y sinusoids sion sip/S siphon/DGMS siphonless/S siphonlike/MS siphonophore siphonostele siphonostelic siphonostely siphons/U siple sipped sipper sippers sippet sipping siqueiros sir/S sirdar sire/DGS siree siren/S sirenian sirenise/S sirenize/S siret sirloin sirocco sirra sirrah sirree sirup sirupy sirvente/S sis sisal sisera siskin sismondi sissified sissy/S sister/DGMSY sisterhood sisterise/S sisterize/S sistrum sit/S sitar sitcom site/DGMS sitella sitfast sith sithole sitology sitosterol sitsang sitter/MS sitting/S situ/S situate/DGNSX situational/Y situla sitwell sitz sitzkrieg sitzmark siva/S six/HS sixain sixfold sixgun sixmo/S sixpence/S sixpenny sixte sixteen/HS sixteenmo sixth/Y sixths sixty/HS sixtyfold sizable/P sizably sizar size/DGJRSZ sizeable sized/AU sizova sizzle/DGR sjambok skag/N skagerrak skald skaldic skara skat skate/DGRSZ skateboard/GMRS skatepark skater/MS skatole skaw skean skedaddle/DGRS skeet/R skeg skeigh skein/MS skeleta skeletal/Y skeleton/MS skeletonisation/MS skeletonise/DGRSZ skeletonization/MS skeletonize/DGRSZ skelf skellum skelly skelmersdale skelp/G skelpit skelter/DG sken skene skep skepsis skeptic/MS skeptical/Y skepticise/S skepticism skepticize/S skerrick skerries skers skery sket sketch/DGRS sketchbook sketchily sketchpad sketchy/PR skew/DGPRSZ skewback skewbald skewer/DGS skewwhiff ski/DGRS skiable skiagram/MS skiagraph skiagraphy skiamachy skiascope skiascopy skibob skid/S skidded skidder skidding skiddoo skiddy/R skidlid skidoo skidpan skidproof skidway skiff/S skiffle skilful/Y skill/DGS skilled/U skilless skillet skillful/PUY skillion skilly skim/MS skimmed skimmer/MS skimming/S skimobile skimp/DGS skimpily skimpy/PR skin/MS skindive/G skinflint/MS skinful skinhead skink/R skinless skinned skinner/MS skinning skinny/PR skint skintight skip/S skipjack skiplane skipped skipper/DGMS skippet skipping skirl skirmish/DGRSZ skirr skirret skirt/DGRS skit/S skite skitter skittery skittish/PY skittle skive/GR skivvy/S skiway skiwear skoal skulduggery skulk/DGRS skull/DMS skullcap skullduggery skunk/MS sky/DGMRS skyborne skycap skydive skydiving skyey skyhook skyjack/DGRZ skylab skylark/GRS skylight/MS skyline skylounge skyphoi skyphos skyrocket skyros skysail skyscape skyscrape skyscraper/MS skyward skywave skyway skywrite/GR slab/S slabber/DG slabbing slack/DGNPRSTXY slacken/DGS slade slag slain slaister slake/DG slaked/U slalom/S slam/S slammed slamming slander/DGRS slanderous/PY slang/G slangily slangy/P slant/DGS slanting/Y slantways slantwise slap/S slapdash slaphappy slapjack slapped slapping slapshot slapstick slash/DGRS slashing/Y slat/DGMRSZ slate/DGRSZ slatelike slather/DGS slatted slattern/Y slatternly/P slatting slaty slaughter/DGRS slaughterhouse/S slaughterman slaughtermen slaughterous/Y slave/DGRS slaveholder/S slaveholding slaver/DG slavery slavey/S slavish/PY slavocracy slavs slaw slay/GRSZ sleave sleazily sleazy/PR sled/MS sledded sledder sledding sledge/GMS sledgehammer sleek/PY sleekit sleep/GRSZ sleepily sleepless/PY sleeplessess sleeplike sleepwalk/R sleepy/PR sleepyhead sleet sleety sleeve/DGMS sleeveless sleevelet sleezy sleigh sleighs sleight sleken/DG slender/PRY slenderise/DGS slenderize/DGS slept slesinger sleuth sleuthhound sleuthing slew/DG slezsko slice/DGRSZ slick/PRSYZ slickenside slid/GRZ slidden slide/GRSZ slideway slight/DGPRSTY slighting/Y sligo slily slim/DGPY slime/DGS slimily slimmed slimmer/S slimmest slimming slimpsy slimsy slimy/PR sling/GRS slingback slings/U slingshot slink/DGS slinkily slinky/PR slip/MS slipcase slipcover slipform slipknot slipnoose slipover slippage slipped slipper/MS slipperwort slippery/PR slipping slippy/R slipsheet slipshod slipslop slipsole slipstick slipstream slipup slipway slit/MS slither/DGS slithery slitless slitter/S slitting sliver/DGS slivery slivovitz slob slobber/DGRS slobbery slobbish sloe slog slogan/MS sloganeer/G sloganise/S sloganize/S slogger slogging sloop/S sloot slop/DGRSZ slope/DGRSZ sloped/U slopped sloppily slopping sloppy/PR slopwork/R slosh/D slot/MS slotback sloth slothful/PY sloths slotted slotting slouch/DGRS slouchily slouchy/PR slough/DG sloughs sloughy sloven/Y slovenly/P slow/DGPRSTY slowcoach slowdown slowish slowpoke slowworm slub slubber/DG slubberdegullion slubbing sludge/S sludgy/R slue/G sluff slug/S slugabed slugfest sluggard/PY slugged slugger/S slugging sluggish/PY sluice/DGS sluiceway sluicy slum/MS slumber/DGMRS slumberous slumbery slumbrous slumgullion slumlord slummer slumming slummy/R slump/DS slung/U slungshot slunk slur/MS slurp/DGS slurring slurry/DGS slush slushy/PR slut sluttish/PY sly/Y slyboots slyer slyest slyness slype smack/DGRS small/PRT smallage smallboy smallclothes smallholding smallish smallmouth smallpox smallsword smalltime smaltite smalto smaragd smaragdite smarm smarmy smart/DGNPRSTY smarten/DG smartie/S smartweed smarty/S smash/DGRSZ smashing/Y smashup smatch smatter/R smattering/S smear/DGRS smearcase smeary smectic smegma smell/DGRS smelly/R smelt/RS smeltery smew smidgen smidgeon smilacaceous smile/DGRS smileless/Y smiley/M smilies smiling/UY smirch smirk/D smirky smit smite/GR smith/M smithereens smithery smiths smithsonite smithy/S smitten smock/GS smog smoggy/R smogless smokable smoke/DGRSZ smokeable smokechaser smokeho smokehouse smokejack smokeless smokelike smokeproof smoker/MS smokescreen smokestack smokey smokily smoko smoky/PRS smolder/DGS smoldering/Y smolt smooch/G smoochy smoodge smooth/DGNPRSTYZ smoothbore smoothen/DG smoothie/S smooths smoothy/S smorgasbord smote smother/DGS smothery smoulder smriti smsa/MS smudge/DG smudgily smudgy/P smug/PY smugger smuggest smuggle/DGRSZ smut/S smutch smutchy smutted smuttily smutting smutty/PR snack/S snackette snaffle/DG snafu snag/S snagged snagging snaggletooth/D snaggy snail/MS snaillike snake/DGS snakebird snakebite/MS snakelike snakemouth snakeroot snakeskin snakestrike snakeweed snakily snaky snap/SU snapback snapdragon/S snappe snapped/U snapper/MS snappily snapping/U snappish/PY snappy/PRT snapshoot/R snapshot/MS snare/DGRS snarf/DGJS snark/S snarl/DGRS snarly snash snatch/DGRS snatchy snath snathe snazzy/R sndmsg snead sneak/DGRSZ sneaker/DS sneakily sneaking/Y sneaky/PRT sneap sneck sned sneed sneer/DGRS sneesh sneeze/DGRS sneezeweed sneezewort sneezy snell/G snib snick snicker/DGR snickersnee snickery snicket snide/PRTY sniff/DGRS sniffily sniffish/PY sniffle/DGRS sniffy/P snifter snigger/DGR sniggle/DG snip/DGRSZ snipe/DGRSZ snipefish sniper/MS sniperscope snipped snipper/MS snippet snippety snipping snippy/R snit snitch/R snivel sniveled sniveler/S sniveling/S snivelled sniveller sniveller/S snivelling/S snob/S snobbery snobbish/PY snobbism snobby snobsniveling snobsnivelling snodgrass snog snollygoster snood snook/RSZ snoop/DGRS snooperscope snoopily snoopy snoot snootily snooty/PR snooze/GRS snoozle/DGS snopes snore/DGRS snorkel/DGR snorri snort/DGRS snot snotty snout/DMS snoutish snouty snow/DGS snowball/DGS snowbank/MS snowberry snowbird snowblink snowblower/S snowbound snowbrush snowcap snowcapped snowdon snowdonia snowdrift snowdrop snowfall snowfield snowflake/S snowily snowless snowmaker snowmaking snowman snowmelt snowmen snowmobile/GR snowpack snowplough snowplow snowscape snowshed snowshoe/DMRS snowshoeing snowslide snowstorm snowsuit snowy/PRT snub/PS snubbed snubber snubbing snubby/P snuck snuff/DGRS snuffbox snuffboxes snuffle/DGR snuffy snug/PSY snugged snugger snuggery snuggest snugging snuggle/DGS snuggly snye so/S soak/DGRS soakage soakaway soap/DGS soapbark soapberry soapbox/S soapily soapless soapmaking soapolallie soapstone/S soapsud/S soapwort soapy/PR soar/DGRS soares sob/S soba sobbed sobbing/Y sobe sobeit sober/DGPRSTY soberise/DGS soberize/DGS sobersided sobersides sobf sobibor sobriety/I sobriquet socage/R socal soccage soccer soche sochi sociability/IU sociable/IU sociableness sociably/IU social/UY socialisation/MS socialise/DGRS socialised/U socialism socialist/MS socialistic socialistically socialite sociality socialization/MS socialize/DGRS socialized/U societal/Y society/MS socinianism socinus socio sociobiology sociocultural/Y sociodemographic socioeconomic/S socioeconomically sociolinguistic/S sociologic sociological/Y sociologist/S sociology sociometric sociometry sociopath sociopathic sociopolitical sociosexual sociosexuality sock/DGS sockdolager sockdologer sockdologising sockdologizing socket/MS sockeye socle socman socola soconoco socred sod/MS soda sodalist sodalite sodality sodamide sodbuster sodded sodden/DGPY sodding soddy sodic sodium sodomite sodomy soekarno soemba soembawa soenda soerabaja soeren soever sofa/MS sofar soffit soft/NPRTXY softa softback softball softbound softcover soften/DGRS softhead/D softheaded/PY softhearted/PY softie/S softish software/MS softwood softy/S sogat sogdiana soggily soggy/PR soh sohn soho soign soignee soil/DGS soilage soilborne soilge soilless soilure soir soiree/S soissons sojourn/RZ soke sokeman sokol sokolev sokolov sokolsky sokoto sokotra sola solace/DGR solacement solan solanaceous solander solanin solanine solanum solar solarimeter solarisation/MS solarise/DGS solarism solarium solarization/MS solarize/DGS solate/DG solatium sold/RZ soldan solder/DGRS solderability soldi soldier/DGSY soldierise/S soldierize/S soldiership soldiery soldo sole/DGPSY solecise/DGS solecism solecistic solecize/DGS solemn/PY solemnify solemnisation/MS solemnise/DGRSZ solemnises/AU solemnity solemnization/MS solemnize/DGRSZ solemnizes/AU solenoid/S solenoidal solent soleplate soleprint solesmes soleure solfatara solfeggio solferino soli solicit/DGS solicitant solicitation solicited/U solicitor/S solicitorship solicitous/PY solicitude solid/PSY solidago solidarism solidarist solidaristic solidarity solidary solidify/DGNS solidity solidus solifidian solifluction solihull soliloquisation soliloquise/DGJRSZ soliloquising/MSY soliloquist soliloquization soliloquize/DGJRSZ soliloquizing/MSY soliloquy soliman soling/N solipsism solipsist solipsistic solitaire solitarily solitary/P soliton solitude/MS solitudinarian solitudinem solleret sollicker solmisation solmization soln solo/DGMS soloist/S solonchak solonets solonetz solonetzic solothurn solstice solstitial solubilisation/I solubilise/DGS solubility/I solubilization/I solubilize/DGS soluble/AI solubleness solubly/I solum solus solute solution/MS solutise/RSZ solutize/RSZ solvability solvable/AIU solvate/DN solvating solvay solve/ADGRSZ solved/AU solvency/I solvent/MSY solventless solvolysis solvolytic solway solyman soma somatic somatically somatogenic somatological somatology somatoplasm somatoplastic somatopleure somatopleuric somatosensory somatotrophin somatotropin somatotype somatotypic somatotypically somber/PY sombre sombrero sombrous some/Z somebodies somebody'll somebody/M someday somedeal somehow someone'll someone/M someplace/M somersault/GS something sometime/S someway/S somewhat somewhen somewhere/S somewhither somewise somite somitic somme sommelier/S somnambulant somnambular somnambulate/N somnambulator somnambulism somnambulist somnambulistic somnambulistically somnifacient somniferous/Y somniloquy somnolence somnolency somnolent/Y somnus son/MSY sonambula sonance sonant sonantised/MS sonantized/MS sonar/S sonarman sonata/S sonatina sondage sonde sone song/MS songau songbag songbird songbook songfest songful/PY songkok songless/Y songsmith songster songtress songwriter songwriting sonic sonically sonicate/DN sonicator/S soniferous sonless sonnet/MS sonneteer sonnetise/S sonnetize/S sonnobuoy sonny sonobuoy sonofabitch sonogram/MS sonorant sonority/S sonorous/PY sonovox sonship sonsie sonsy sonuvabitch soo soochow sook soomed soon/RT soong soot sooth/DGRSY soothe/DGRS soothfast soothing/PY soothsay/GRZ sootily sooty/PR sop/S sophism sophist/R sophistic sophistical/Y sophisticate/S sophisticated/Y sophistication/U sophistocated sophistry sophomore/MS sophomoric sophy sopite/DG sopor soporiferous/P soporific/MS sopping soppy/R sopranino soprano/S sopsaisana sora sorata sorb/D sorbability sorbable sorbate sorbefacient sorbent sorbic sorbitol sorcerer/MS sorceress sorcerous sorcery sordid/PY sordino sore/PRSTY soredium sorehead/D sorghum sorgo sori soricine sorites sorn sorocaba sororal sororate sororicide sorority/S sorosis sorption/A sorptive/A sorrel sorrentine sorrentino sorrento sorrily sorrow/MRS sorrowful/PY sorry/PRT sort/DGRSZ sortable sorted/AU sortie sortilege sortition sorus sosnowiec sostenuto sot soteriological soteriology sotol sottish/PY sotto sotun sou soubise soubrette soubriquet souchong soudan souffle sough sought/U soukhouma soul/DMS soule soulful/PY soulless/PY soult sound/DGJPRSTY soundable soundboard soundbox sounding/MSY soundless/Y soundpost soundproof/DGS soup/MS soupfin soupspoon soupy/R sour/DGPRSTY sourberry source/AMS sourceless sourdine sourdough sourish sourpuss soursop sourwood sousaphone souse/G sout/R soutache soutane south/GR southbound southeast/R southeaster/Y southeastern southeasternmost southeastward/S souther/Y southern/PRYZ southernise/S southernisms southernize/S southernmost southland southmost southpaw/S souths southward/S southwest/R southwester/Y southwestern southwesternmost southwestward/S soutine souvenir/S sovereign/MSY sovereignty soviet/MS sovietisation/MS sovietise/S sovietism sovietization/MS sovietize/S sovkhoz/S sovran sovranty sow/GRZ sowbelly sowbug/MS sowens sower/D sown sox soxhlet soy soya soybean/S sozzled spa/S space/DGJRSZ spaceband spacecraft spaceflight spaceless spaceman spaceport spaceship/MS spacesuit/S spacetime spacewalk spacewalker spacewalking spacial spacious/PY spackle/DG spacs spacward spada spade/DGRS spadefish spadeful spadework spadiceous spadices spadille spadix spaeing spaghetti spagyric spahi spahn spake spalato spalding spall/DG spallable spallation spalpeen spam span/MS spancel spandrel spandrels spandril spang spangle/DGS spaniel spank/DGRS spanned spanner/MS spanning spanworm spar/S sparable sparce spare/DGPRSTY spareable sparerib spareribs sparge/GR sparid sparing/UY spark/DGRS sparkily sparkish sparkle/DGRS sparkplug sparky/R sparling/S sparoid sparred sparring sparrow/MS sparrowgrass sparrowhawk sparry sparse/PRTY sparsity spartan sparteine spasm/S spasmodic spasmodical/Y spasmolytic spasmolytically spastic spastically spasticity spat/S spatchcock spate/MS spathe spathic spathulate spatial/Y spatialisation/MS spatialise/S spatiality spatialization/MS spatialize/S spatiotemporal/Y spatlum spatted spatter/D spatterdash spatterdock spatting spatula spatulate spavin spavined spawn/DGRS spay/DG speak/GRSZ speakable/U speakeasy speaker/MS speakership spean spear/DGRS spearfish spearhead spearman spearmint spearwort spec/S special/PSY specialisation/MS specialise/DGRSZ specialised/U specialising/U specialism/S specialist/MS specialistic speciality/MS specialization/MS specialize/DGRSZ specialized/U specializing/U specialty/MS speciate/N speciational specie species specifiability specifiable specific/S specifically specificise/S specificity/S specificize/S specified/AU specify/DGNRSXZ specimen/MS specimenise/S specimenize/S speciosity specious/PY speck/MS speckle/DGS specsartine spect spectacle/DS spectacular/Y spectate/DG spectator/MS spectatress specter/DMS specterlike/MSU spector spectra spectral/PY spectrality spectre/DMS spectrelike/MSU spectrobolometer spectrofluorimeter/MS spectrofluorometer/MS spectrofluorometric spectrofluorometry spectrogram/MS spectrograph spectrographic spectrographically spectrography spectroheliogram/MS spectroheliograph spectroheliography spectrohelioscope spectrometer/MS spectrometric spectrometry spectrophotometer/MS spectrophotometric spectrophotometrical/Y spectrophotometry spectroscope spectroscopic spectroscopical spectroscopically spectroscopist spectroscopy spectrum/S specular/Y specularity speculate/DGNSVX speculative/Y speculator/MS speculum sped speech/MS speechify speechless/PY speed/DGRSZ speedball speedboat/GR speedily speedlight speedo speedometer/MS speedster speedup/MS speedway speedwell speedwriting speedy/PR speel speer speight speir speiss spelaean speleogenesis speleogenetic speleological speleologist speleology spelk spell/DGJRSZ spellbind/R spellbound spelldown spellican spelt/R spelunker spelunking spend/GRSZ spendable spendthrift spenglerian spent/U speos sperm/S spermaceti spermagonium spermary spermatheca spermathecal spermatial spermatic spermatid spermatium spermatocidal spermatocide spermatocyte spermatogenesis spermatogenetic spermatogenic spermatogonial spermatogonium spermatophore spermatophyte spermatophytic spermatorrhoea spermatozoa spermatozoal spermatozoan spermatozoid spermatozoon spermic spermicidal spermicide spermidine spermine spermiogenesis spermogonium spermophile spermophyte spermous sperrylite spessartite spew/GJR spey/R sphagnous sphagnum sphalerite sphene sphenic sphenodon sphenodont sphenogram sphenoid sphenoidal sphenopsid spheral sphere/GMS spheric/S spherical/Y sphericity spheroid spheroidal/Y spheroidicity spheroidise/S spheroidize/S spherometer/MS spheroplast spherule/S spherulite spherulitic sphery sphincter sphincteral sphinges sphingid sphingomyelin sphingosine sphinx/S sphragistics sphygmic sphygmograph sphygmographic sphygmography sphygmoid sphygmomanometer/MS sphygmomanometric sphygmomanometrically sphygmomanometry spic spicae spicate spiccato spice/DGS spiceberry spicebush spicery spicily spicula spicular spiculate/N spicule spiculiferous spiculum spicy/PR spider/MS spiderman spiderweb spiderwort spidery spiegeleisen spiel/R spif spiffing spiffy/R spiflicate spignel spigot/S spike/DGRS spikelet spikelike spikenard spiky/R spile/DGS spill/DGRS spillable spillage/MS spillikin/S spillover/MS spillway spilosite spilt spilth spin/S spina spinach spinal/Y spinco spindle/DGRS spindlelegs spindly spindrift spine/S spinel spineless/PY spinelle spinescent spinet spiniferous spinifex spinless spinnability spinnaker spinner/MS spinneret spinnerette spinney/S spinning spinodal spinoff spinor spinose spinosely spinosity spinous spinout spinrad spinse spinster spinsterhood spinsterish spinthariscope spinule spinulose spiny/PR spiracle spiracular spiraea spiral/SY spiraled spiraling spiralisation/MS spiralise/S spiralization/MS spiralize/S spiralled spiralling spirant spire/DGMS spirea spired/AI spireme spires/AI spirillum spirit/DGS spirited/PY spiritise/S spiritism spiritist spiritistic spiritize/S spiritless/PY spiritoso spiritous spiritual/PSY spiritualisation/MS spiritualise/DGRSZ spiritualism spiritualist spiritualistic spirituality spiritualization/MS spiritualize/DGRSZ spiritualty spirituel spirituelle spirituous spiritus spirketting spirochaetal spirochaete/MS spirochaetosis spirochetal spirochete/MS spirochetosis spirograph spirographic spirography spirogyra spiroid spirometer/AMS spirometric/A spirometry/A spironolactone spirt spirula spiry spit/DGS spital spitball spitchcock spite/DGS spiteful/PY spitfire spithead spitsticker spitted spitter spitting spittle spittoon/S spiv splake splanchnic splash/DGRSZ splashback/S splashboard splashdown/S splashily splashy/PR splat splatter splattered splay/D splayfoot/D spleen spleenful spleenwort spleeny splendent splendid/PY splendiferous/PY splendor/MS splendorous splendour/MS splendrous splenectomised splenectomized splenectomy splenetic splenetically splenic splenitis splenius splenomegaly splent spleuchan splice/DGJRSZ spline/DMS splint/DGS splinter/DGS splintery split/MS splitter/MS splitting/S splodge splore splotch/DS splotchy splurge/GS splutter/R spluttery spock spode spodumene spoil/DGRSZ spoilable spoilables spoilage spoiled/U spoilfive spoilsman spoilsport spoilt spoke/DGS spoken/U spokeshave spokesman spokesmen spokespeople spokesperson/M spokespersons spokeswoman spoliate/N spoliator spondaic spondee spondulix spondylitis sponge/DGRSZ spongin spongioblast spongy/PR sponsion sponson sponsor/DGS sponsorial sponsorship spontaneity spontaneous/PY spontoon spoof spook spookily spookish spooky/PR spool/DGRSZ spoon/DGS spoonbill spoondrift spoonerism spooney spoonful/S spoonsful spoony/R spoor sporades sporadic/Y sporadically sporangial sporangiophore sporangium spore/DGMS sporicidal sporicide sporiferous sporocarp sporocyst sporocystic sporocyte sporogenesis sporogenic sporogenous sporogonic sporogonium sporogonos sporogony sporophore sporophyll sporophyte sporophytic sporopollenin sporotrichosis sporozoan sporozoite sporran sport/DGSV sportful/PY sportily sporting/Y sportive/PY sportscast sportsman/Y sportsmanlike/U sportsmanship sportsmen sportswear sportswoman sportswrite sportswriter sportswriting sporty/PRT sporulate/NV sporule spot/MS spotless/PY spotlight/DGMS spottable spotted/U spotter/MS spottily spotting spotty/PR spousal spouse/GMS spout/DGRS sprag sprain/DS sprang sprat sprawl/DGS spray/DGRS sprayed/U spread/GJRSZ spreadability spreadable spreadsheet/S sprechgesang sprechstimme spree/MS sprent sprig sprigging sprightful/PY sprightly/PR sprigtail spring/GRSZ springal springald springboard springbok/S springe springhalt springhead springhouse springily springlet springtail/S springtide springtime springvale springwood springy/PRT sprinkle/DGRS sprinkler/D sprint/DGRSZ sprit sprite spritsail sprocket/DGS sprocketed/U sprout/DGS spruce/DGPRTY sprucy/R sprue spruik sprung/U spry/RTY spryer spryest spryness spss spud spudded spudding spue spuggy spume/G spumescent spumone spumoni spumous spumy spun spunk spunkie/R spunkily spunky/PR spur/MS spurge spurious/PY spurn/DGRS spurred spurrey/S spurring spurry/R spurt/DGS spurtle sputa sputnik/S sputter/DR sputum spuyten spy/DGRS spyglass sqrt squab/S squabble/DGRS squacco squad/MS squadded squadding squadron/MS squalane squalene squalid/PY squall/MRS squally/R squalor squama squamae squamate/N squamosal squamose squamous/Y squamulose squander/DGRS square/DGPRSTY squaresville squarish/PY squark squarrose squash/DGRS squashberry squashily squashy/PR squat/PSY squatted squatter/S squattest squatting squattocracy squatty/R squaw squawbush squawk/DGRS squawroot squeak/DGRS squeaky squeal/DGRS squeamish/PY squeegee/DS squeegeeing squeezability squeezable squeeze/DGRS squelch/DGRS squelchy squeteague squib/S squid/S squidded squidding squiffed squiffy squiggle/DGS squiggly squilgee squill/S squilla squillae squinch squinny/DG squint/DGRS squinting/Y squinty squirarchy squire/GMS squirearchy squireen squirehood squirish squirm/DGS squirmy squirrel/SY squirreled squirrelfish squirreling squirrelled squirrelling squirt/DGRS squish/DGS squishy/PRT squit squiz squoosh srinagar st stab/SY stabat stabbed stabber stabbing stabile stabilisable stabilisation/MS stabilise/DGRSZ stability/MS stabilizable stabilization/MS stabilize/DGRSZ stable/DGPRST stableboy stableman stablemate stablemen stablish stablishment stably/U stabroek staccato/S stack/DGMRS stackable stacked/U stackframe stacks/U stacte staddle staddlestone stade stadholder stadia stadiometer stadium/MS stadtholder stadtholderate stadtholdership staff/DGMRSZ staffa staffman stag/DGMRSZ stage/DGRSZ stagecoach stagecraft stagehand stagestruck stagey stagflation staggard stagger/DGRS staggerbush staggering/Y staggery stagging staggy staghound stagily stagira stagnancy stagnant/Y stagnate/DGNS stagy/PR staid/PY stain/DGRS stainability stainable stained/U staines stainless/Y stair/MS staircase/MS stairhead stairway/MS stairwell/S stake/DGS stakeholder stakeout stalactite/MS stalactitic stalag stalagmite/MS stalagmitic stale/DGPRSTY stalemate stalk/DGRS stalkless stalky stall/DGJS stallard stallion stallionise/S stallionize/S stalwart/PY stalwartise/S stalwartize/S stalworth stambul stamen/MS stamina staminal staminate staminode staminodium staminody stammel stammer/DGRS stamp/DGRSZ stampede/DGRS stance/MS stanch/RT stanchion/DGS stand/GJRS standalone standard/SY standardbred standardisable/S standardisation/AMS standardise/DGRSZ standardised/U standardises/A standardizable/MS standardization/AMS standardize/DGRSZ standardized/U standardizes/A standaway standby standbys standee standeth standfast standoff standoffish/PY standout standpat standpatter standpattism standpipe standpoint/MS standstill stane stang stanite stank stannard stannary/S stannic stanniferous stannite stannous stannum stanovoi stans stanza/MS stanzaic stapedectomised stapedectomized stapedectomy stapedes stapedial stapelia stapes staph staphylinid staphylococcal staphylococcic staphylococcus staphyloplasty staphylorrhaphy staple/DGRSZ stapled/U star/DGMRS stara starbird starboard/DGS starch/DGS starchily starchy/PR stardom stardust stare/DGRS starets starfish starflower stargaze/GRS staring/U stark/PTY starless starlet/MS starlight starlike starling/S starlit starre starred starring starry/R starship start/DGRSZ startc startle/DGS startling/PY startup/MS starvation starve/DGRS starveling starwort stases stash/DGS stasis statable statant state/DGMRSVY stateable statecraft stated/AIU statedly statehood statehouse stateless/P stately/PR statement/MS stateroom states/AI stateside statesman/MY statesmanlike statesmanship statesmen statewide static/S statical statically statice station/DGRS stational stationarily stationarity stationary/S stationery/S stationmaster statism statist statistic/MS statistical/Y statistician/MS statisticise/S statisticize/S statius stato statoblast statocyst statolatry statolith stator/S statoscope statuary statue/DMS statuesque/PY statuette stature status/S statutable statute/MS statutorily statutory/P statz staunch/PTY staurolite staurolitic stauroscope stave/DGS stavesacre stavropoulos stay/DGRSZ staysail stdio stead/G steadfast/PY steadily/U steady/DGPRST steak/MS steakhouse steal/GHRS stealthily stealthy/PR steam/DGRSZ steamboat/MS steamie steamily steamroll/R steamship/MS steamtight steamy/PR steapsin stearate stearic stearin stearine stearoptene steatite steatitic steatolysis steatopygia steatopygic steatorrhoea stecher stedfast steed/S steel/DGSZ steelhead steelie steelmaker steelwork/RS steely/PRS steelyard steenbok steep/DGNPRSTY steepen/DG steeple/MS steeplebush steeplechase/R steeplejack steer/DGRS steerable steerage steerageway steersman steeve/G steeves steffens stegosaur stegosaurus steichen stein/RZ steinbecks stela stelae stelar stele stellar stellarator stellate stelliferous stelliform stellify stellular stem/MS stemhead stemless stemma stemmata stemmed/U stemmer stemming stemmy/R stemson stemware stench/MS stenchful stenchy stencil/MS stenciled stenciler/S stenciling stencilise stencilize stencilled stenciller stenciller/S stencilling stendhal steno/S stenobathic stenograph stenographer/MS stenographic stenographically stenography stenohaline stenopetalous stenophagous stenophyllous stenos/D stenosis stenotherm stenothermal stenothermy stenotic stenotopic stenotropic stenotype stenotypist stenotypy stentor stentorian stentorophonic step/MS stepbrother stepchild stepchildren stepdame stepdaughter stepfather stephan stephanotis stepladder stepladders steplike stepmother/MS stepparent steppe/S stepped stepper stepping steprelation steps/I stepsister stepson stepwise steradian stercoraceous stercoricolous sterculiaceous stere stereo/MS stereobate stereochemical/Y stereochemistry stereochrome stereochromy stereogram/MS stereograph stereographic stereographically stereography stereoisomer/S stereoisomeric stereoisomerism stereological/Y stereology stereometric stereometry stereomicroscope stereomicroscopic stereomicroscopically stereophonic stereophonically stereophony stereophotographic stereophotography stereopsis stereopticon stereoregular stereoregularity stereoscope stereoscopic stereoscopically stereoscopy stereospecific stereospecifically stereospecificity stereotape stereotaxic stereotaxically stereotaxis stereotomy stereotropism stereotype/DGRSZ stereotypic stereotypical/Y stereotypy stereovision steric/S sterically sterigma sterilant sterile sterilisability/MS sterilisable/S sterilisation/MS sterilise/DGRSZ sterilised/U sterilises/A sterility sterilizability/MS sterilizable/MS sterilization/MS sterilize/DGRSZ sterilized/U sterilizes/A sterios sterlet sterling/PY sterlitamak stern/PSY sterna sternal sterne sternforemost sternite sternmost sternocostal sternpost sternson sternum sternutation sternutator sternutatory sternward/S sternway steroid/S steroidal steroidogenesis steroidogenic sterol stertor stertorous/Y stet stethoscope stethoscopic stethoscopically stetted stettin stetting stevedore/S stevenage stevengraph stevie stew/DGS steward/MS stewardess/S stewardship stewpan steyr sthenic stheno stibine stibium stibnite stich stichometry stichomythia stichomythic stichomythy stick/DGRSZ stickball stickful stickhandler stickily stickit stickle/DGR stickleback stickpin stickseed sticktight stickum stickup stickweed stickwork sticky/PRT stickybeak sticle sticy stidger stiff/NPRSTXY stiffen/DGRSZ stiffish stiffness/S stifle/DGRS stifling/Y stigma/S stigmal stigmasterol stigmata stigmatic stigmatically stigmatisation/MS stigmatise/GRSZ stigmatised/U stigmatises/A stigmatism stigmatist stigmatization/MS stigmatize/GRSZ stigmatized/U stigmatizes/A stilbene stilbestrol stilbite stile/MS stiletto stilicho still/DGPRST stillage stillbirth stillbirths stillborn stillicide stilliform stillman stillroom stills/I stillwater stillwell stilly stilt/DS stilted/PY stime stimulant/MS stimulate/DGNSVX stimulator/S stimulatory stimuli stimulus sting/GRS stingaree stingily stinging/Y stingless stingo stingray/MS stingy/PR stink/GRSZ stinkard stinkbug/MS stinkhorn stinking/Y stinko stinkpot stinkpotters stinkstone stinkweed stinkwood stinky stint/DGMRS stinting/U stion/G stipe/DS stipel stipellate stipend/MS stipendiary stipitate stipites stipple/DGRS stipular stipulate/DGNSX stipulator stipulatory stipule/D stir/S stirabout stirk stirp/S stirpes stirred stirrer/MS stirring/SY stirrup/S stitch/DGRS stitchery stitchwort stithy/S stiver stoa stoat/MS stob stochastic stochastically stochasticity stock/DGJRSZ stockade/DGMS stockbreeder stockbroker stockbrokerage stockbroking stockcar stockfish stockholder/MS stockily stockinet stockinette stocking/DS stockish stockist stockjobber stockkeeper stockman stockpile/GR stockpot stockproof stockroom stocktaking stocky/PR stockyard stockynges stodge/G stodgily stodgy/PR stogie/S stogy/S stoic/S stoical/Y stoichiometric stoichiometrically stoichiometry stoicism stoke/DGRS stokehold stokehole stokesia stole/DMS stolen stolid/Y stolidity stoll/NX stolon stolonate stoloniferous/Y stolzenbach stoma/S stomach/DGRS stomachache stomachic stomachically stomachs stomachy stomack stomal stomata stomatal stomate stomatic stomatitis stomatologic stomatological stomatologist stomatology stomatoplasty stomatopod stomodaeal stomodaeum stomodeal stomodeum stomp/DGS stone/DGMRS stoneboat stonecast stonechat stonecrop stonecutter/S stonecutting stonefish stonefly stoneground stonemason/S stonemasonry stonewall stoneware stonework/R stonewort stoney stonily stonk stonkered stony/PR stonyhearted/P stood stooge/GS stook stool/S stoolie stoop/DGS stoopball stop/MS stopband stopcock/S stope/S stopgap/MS stoplight/S stopover/S stoppable/U stoppage/S stoppard stopped/U stopper/DGMS stopping stopple/DG stopwatch/S storable/A storage/MS storax store/ADGS storefront/MS storehouse/MS storekeep/RZ storeria storeroom storeship storewide storeyed storiated stork/MS storksbill storm/DGS stormbound stormily stormproof stormy/PRT stornoway storr/S story/DGMS storyboard/S storybook/S storyteller/S storytelling storywriter stoss stot stotinka stotious stotter stound stoup stour stoush stout/NPRTY stouten/DG stouthearted/PY stoutish stove/MRS stovepipe/S stow/DGS stowage/S stowaway/MS stowe stowey strabismic strabismus strabo strabotomy strachey straddle/DGRSZ strafaci strafe/GRS straggle/DGRSZ straggly/R straight/NPRTXY straightaway straightbred straightedge straighten/DGRSZ straightforward/PSY straightish straightjacket straightlaced straightway strain/ADGRSZ strained/AU strainometer/MS strait/NPSY straiten/DG straitjacket straitlaced/PY strake stram stramash stramonium stranahan strand/DGRS stranded/P strandline strandloper strange/PRTYZ stranger/MS strangle/DGJRSZ stranglehold strangulate/D strangulation/MS strangury strap/MS straphang/R strapless strappado strapped strapper strapping strata stratagem/MS strategem/S strategic/S strategical strategically strategist/S strategy/MS strath strathspey/S strati straticulate stratificational stratified/U stratiform stratify/DGNSX stratigraphic stratigraphical/Y stratigraphy stratocracy stratocumulus stratopause stratosphere stratospheric stratum stratus stravage stravinsky straw/MS strawberry/MS strawboard strawflower/S strawman strawworm stray/DGMRS streak/DGS streaky/PR stream/DGRSZ streambed streamed/U streamlet streamline/DGRS streamside streamy streek street/SZ streetcar/MS streetlight streetwalker streetwalking strength/NX strengthen/DGRS strengthless/P strengths strenuosity strenuous/PY strep strepitous streptobacillus streptococcal streptococcic streptococcus streptokinase streptolysin streptomyces streptomycete streptomycin streptothricin stress/DGS stressed/U stressful/Y stressless/P stressor stretch/DGRSZ stretchability stretchable stretchy stretta stretti stretto/S strew/GHS strewment strewn stria striae striate/DGNS striated/U strick stricken strickle/DG strict/PRTY striction stricture/S stridden stride/GRS stridence stridency strident/Y stridor stridulate/N stridulatory stridulous/Y strife strifeless strigiform strigil strigose strike/GRSZ strikebound strikebreak/GRZ strikeless strikeout strikeover striking/Y strimon strine string/DGMRSZ stringboard stringcourse stringency stringendo stringent/Y stringhalt/D stringless stringpiece stringy/PRT strip/DGMRS stripe/DGRS striped/U stripeless stripfilm stripling strippable stripped stripper/MS stripping stript striptease/R stripy/R strive/GJRS striven strobe/DGMS strobic strobila strobilaceous strobilar strobilation strobile strobilisation strobilization strobilus stroboscope stroboscopic stroboscopically strobotron strode stroganoff stroke/DGRSZ strokefinder stroll/DGRS stroma stromal stromata stromatal stromatic stromatolite stromatolitic stromboli stromeyerite strong/RTY strongbox strongheart stronghold strongish strongman strongroom/S strongyle strontia strontian strontianite strontic strontium strop/S strophanthin strophe/S strophic strophoid stropped stropping stroppy stroud/G strove strow/G stroy struck structural/Y structuralisation/MS structuralise/S structuralism structuralist/S structuralization/MS structuralize/S structure/DGRS structured/AU structureless/P strudel struggle/DGRS strum struma/S strumae strummer strumming strumose strumpet strung/U strunt strut/S struthious strutted strutter strutting strychnic strychnine strychninisation/MS strychninise/S strychninism strychninization/MS strychninize/S stub/MS stubbed stubbing stubble stubblefield/S stubbly stubborn/PY stubbs stubby stucco stuccoes stuccowork stuck/U stud/MS studbook/S studded studding studdingsail student/MS studentship/S studhorse studied/PY studio/MS studious/PY studwork study/DGRS stuff/DGJRS stuffily stuffless stuffy/PRT stull stultify/GN stum/R stumble/DGRS stumblebum stumbling/Y stumming stump/DGRS stumpage stumpy stun/S stung stunk stunned stunner stunning/Y stunsail stunt/DGMS stunted/P stupa stupe stupefacient stupefaction stupefy/G stupendous/PY stupid/PRTY stupidity/S stupor stuporous sturch sturdily sturdy/PR sturgeon sturley sturmer sturt stutter/DGRS sty stye/GS styka style/DGRSZ stylebook styleless/P stylet styli styliform stylisation/MS stylise/GRSZ stylised stylish/PY stylist stylistic/S stylistically stylite stylites stylitic stylization/MS stylize/GRSZ stylized stylobate stylograph stylographic stylographical/Y stylography styloid stylolite stylopodium stylostixis stylus/S stymie/DS stymieing stypsis styptic styracaceous styrax styrene/S styria suability suable suably suakin suasion suasive/PY suave/PY suavity sub/S subacetate subacid/PY subacute/Y subadar subadult subaerial/Y subagency subagent subah subahdar subalpine subaltern subalternate/NY subangular subantarctic subapical subapostolic subaqua subaquatic subaqueous subarctic subarea subareas subarid subarmor/MS subarmour/MS subassemblage/S subassembly subastral subatmospheric subatomic subaudible subaudition subauricular subaverage subaxillary subbase subbasement subbass subbing subcabinet subcalibre subcapsular subcartilaginous subcaste subcategorising subcategorizing subcelestial subcellular subcenter subcentral/Y subcentre subception subchain subchannels subchaser subchloride subclass/MS subclassifications subclavian subclimax subclinical/Y subcluster/S subcollegiate subcommand/S subcommittee/MS subcommunity subcompact subcomponent/MS subcomputation/MS subconcept subconscious/PY subconstituent subcontinent subcontinental subcontract/G subcontractor subcontraoctave subcontrariety subcontrary subcool subcordate subcortex subcortical subcritical subcrustal subcultural subculture/MS subcutaneous/Y subdeacon subdeb subdebutante subdelirium subdepot subdiaconate subdirectory/S subdistrict subdividable subdivide/DGRS subdivision/MS subdominance subdominant subduct subdue/DGRS subdued/Y subedit subeditor subeditorial subelement/S subemployed subemployment subentry/S subepidermal/Y subepidermis subequatorial suberect suberic suberin suberisation/MS suberise/DGS suberization/MS suberize/DGS suberose subexpression/MS subfamily/S subfield/MS subfile/MS subfix subflavor/MS subflavour/MS subfloor subfossil subfreezing subfusc subgenus subglacial/Y subglottal subgoal/MS subgrade subgrammar subgraph subgraphs subgross subgroup/GMS subhead/G subhuman subhumanity subi subic subindex subinfeud subinfeudate/N subinfeudatory subinstance/S subinterval/MS subirrigate/N subito subj subjacency subjacent/Y subject/DGMSV subjectify subjection subjective/PY subjectivisation subjectivise/S subjectivism subjectivist/S subjectivistic subjectivity subjectivization subjectivize/S subjectless subjoin subjugate/DGNS subjugator subjunction subjunctive subkingdom sublanguage/S sublapsarianism sublate/DGN sublease sublet sublethal/Y sublevel sublicense/DGRS sublieutenant sublimable sublimate/DGS sublimation/S sublime/DGPRY subliminal/Y sublimise/S sublimity sublimize/S sublingual sublist/MS subliterary subliterature sublittoral sublunar sublunary subluxation submachine submandibular submarginal/Y submarine/DGRSZ submaxilla submaxillary submediant submental submerge/DGS submergence submergible submerse/DGN submersible submicrogram/MS submicron submicroscopic submicroscopically subminiature subminiaturisation subminiaturise/DGS subminiaturization subminiaturize/DGS submiss submission/MS submissive/PY submit/AS submitochondrial submittal submitted/A submitter/S submitting/A submode/S submodule/MS submontane submucosa submucosal/Y submucous submultiple subnational subnet/S subnetwork/MS subnormal/Y subnormality suboceanic subopposite suboptimal suboptimum suborbicular suborbital suborder subordinary subordinate/DGNPSVY subordinationism subordinator suborn/DGRS subornation subotica subovate suboxide/S subpage subpanel/S subpar subparagraph subparallel subparameter/S subpart/S subphylum subplot/S subpoena/DS subpolar subpopulation/S subpotency subpotent subprincipal subproblem/MS subprocess/MS subprocessor subprofessional subprogram/MS subproject subproof/MS subpulveriser/MS subpulverizer/MS subquestion/MS subrange/MS subregion/S subregional/Y subreption subreptitious/Y subring subrogate subrogation subroutine/MS subsaline subsample/S subsatellite subsaturated subsaturation subscan/S subscapular subschema/MS subscribe/DGRSZ subscript/DGS subscripted/U subscription/MS subsectio subsection/MS subsegment/MS subsentence subsequence/MS subsequent/PY subserve subservience subserviency subservient/Y subset/MS subshrub subshrubby subside/DGS subsidence subsidiarily subsidiary/MS subsidisable/S subsidisation/MS subsidise/DGRSZ subsidised/U subsidizable/MS subsidization/MS subsidize/DGRSZ subsidized/U subsidy/MS subsist/DGS subsistence subsistent subsocial subsocietal subsoil/R subsolar subsonic subsonically subspace/MS subspecialise/S subspeciality/MS subspecialize/S subspecialty/MS subspecies subspecific substage substance/MS substanceless substandard substandardise/S substandardize/S substantial/PY substantialise/SU substantialism substantiality/IU substantialize/SU substantially/U substantiate/DGNSVX substantiated/U substantival/Y substantive/PY substantivise/S substantivity substantivize/S substation/S substerilisation substerilization substituent/S substitutability substitutable substitute/DGNRSVX substituted/U substitutional/Y substitutionary substitutive/Y substomatal substrate/MS substratosphere substratospheric substratum substring/S substructural substructure/MS subsume/DGS subsumption subsurface subsystem/MS subtable/S subtangent subtask/MS subteen subtemperate subtenancy subtenant subtend subtended subtends subterfuge/S subterminal subternatural subterranean/Y subterraneanise/S subterraneanize/S subterraneous subtest subtetanic subthreshold subtile/PRTY subtilis subtilisation/MS subtilise/RSZ subtilisin subtilization/MS subtilize/RSZ subtilty subtitle/DGMS subtle/PRT subtlety/S subtly subtonic subtopic/MS subtorrid subtotal subtotaled subtotaling subtotalled subtotalling subtotals subtract/DGRSVZ subtracter/MS subtraction/S subtrahend/MS subtreasury subtree/MS subtropic/S subtropical subtype/S subufd/S subulate subunit/MS suburb/MS suburban suburbanisation/MS suburbanise/S suburbanised suburbanising suburbanite/S suburbanization/MS suburbanize/S suburbanized suburbanizing suburbia suburbicarian subvene subvention subventionary subversion subversionary subversive/PSY subvert/DGRS subviral subvitalised/MS subvitalized/MS subvocal/Y subway/MS subzero succedaneous succedaneum succedent succeed/DGRS succentor succeptibility success/SV successful/PY successfully/U succession/MS successional/Y successive/PY successor/MS successorship successsive succinate succinct/PY succinic succinyl succinylcholine succor/DGRSZ succorable/MSU succored/U succorer/MS succorless/S succory succotash succoth succour/DGRSZ succourable/SU succoured/U succourer/MS succourless/S succuba succubi succubus succulence succulent/Y succumb/DGS succursal succuss such suchlike suck/DGRSZ sucker/DGS suckerfish suckle/DGS sucrase sucre sucrose suction suctional suctorial suctorian sudanic sudarium sudatorium sudatory sudbury sudd sudden/PY sudetes sudor sudoriferous sudorific suds/GR sudsless sudsy/R sue/DGRS suede/DG suet suetonius suey suff suffer/DGJRSZ sufferable/P sufferableness/I sufferably/I sufferage sufferance suffice/DGRS sufficiency/I sufficient/IY suffiency suffix/DGRS suffixation suffixed/U sufflate suffocate/DGNSV suffocating/Y suffragan suffrage suffragette/S suffragist/S suffruticose suffumigate suffuse/DGNSV sufu sugar/DGJS sugarcane sugarcoat sugarhouse sugarloaf sugarplum sugary suggest/DGRSV suggestibility suggestible suggestibly suggestion/MS suggestionise/S suggestionize/S suggestive/PY suharto suicidal/Y suicide/DGMS suint suisse suit/DGMSZ suitability/U suitable/P suitably/U suitcase/MS suite/DGSZ suited/U suitor/MS sukarnapura sukarno sukhumi sukiyaki sukkoth sulamite sulamith sulcate sulci sulcus suleiman sulfa sulfadiazine sulfanilamide sulfaquinoxaline sulfatase sulfate/DG sulfatide/S sulfatise/S sulfatize/S sulfhydryl sulfide sulfinyl sulfite sulfitic sulfonamide/S sulfonate/N sulfone sulfonic sulfonium sulfonmethane sulfonyl sulfonylurea sulfoxide sulfur/DG sulfureous/PY sulfuret sulfuric sulfurization/MS sulfurize/S sulfurous/PY sulfuryl sulk/DGS sulkily sulky/PS sulla sullage sullen/PY sully/DGS sulphadiazine sulphanilamide sulphate/S sulphathiazole sulphide sulphinyl sulphisoxazole sulphite sulphonamide sulphonate/D sulphone sulphonic sulphonium sulphonmethane sulphonyl sulphur/D sulphurate sulphuret sulphuretted sulphuric sulphurisation/MS sulphurise/S sulphurization/MS sulphurize/S sulphurou/S sulphuryl sultan/MS sultana sultanate sultaness sultanise/S sultanize/S sultrily sultry/PR sulzberger sum/MS sumac sumach summa summability summable summae summand/MS summarily summarisation/MS summarise/DGRSZ summarised/U summarization/MS summarize/DGRSZ summarized/U summary/MS summated summates summating summation/MS summational summed summer/DGMS summerhouse summerise/S summerize/S summersault summertime summerweight summerwood summery summing summit summitry summon/DGRSZ summons/S sump sumpter sumptuary sumptuous/PY sumy sun/MS sunay sunbake sunbaked sunbath/R sunbathe/R sunbeam/MS sunbird sunbonnet sunbow sunburn sunburnt sunburst/S sundae/S sunder/DGS sundew sundial/S sundog sundown/RZ sundress/S sundrops sundry/S sundsvall sunfast sunfish sunflower sung/U sungari sungkiang sunglass/S sunglow sungrebe sunhat sunk/N sunlamp sunless sunlight/S sunlit sunn sunna sunned sunnily sunning sunny/PR sunray sunrise/S sunroof sunscald sunscreen/GMS sunset/S sunshade/S sunshine/S sunshiny sunspot sunstar sunstroke sunstruck sunsuit suntan suntanned suntanning suntrap sunup sunward/S sunwise suo sup/S super/DG superable/P superably superabound superabundance superabundant/Y superacknowledgement/MS superacknowledgment/MS superadd superaddition superagency superaltar superaltern superannuate/DN superb/PY superbazaar superblock supercalender supercanonisation/MS supercanonization/MS supercarbonisation/MS supercarbonise/S supercarbonization/MS supercarbonize/S supercargo supercede/DS supercharge/R superciliary supercilious/PY supercity supercivilisation/MS supercivilised/MS supercivilization/MS supercivilized/MS superclass/M supercolumnar supercomputer/MS supercomputing superconcept superconduct/GV superconduction superconductivity superconductor/S supercool supercritical supercurrent superdense superdominant superego/MS superelevate/N supereminence supereminent/Y superemphasise/S superemphasize/S superempirical superencipher superencipherment supererogate supererogation supererogatory superfamily superfecundation superfemale superfetation superficial/PY superficialise/S superficiality superficialize/S superficies superfine superfix superfluid superfluidity superfluity/MS superfluous/PY superfuse supergalaxy supergene supergiant superglacial superheat/RS superhero superhet superheterodyne superhigh superhighway superhighways superhuman/PY superhumanise/S superhumanity superhumanize/S superhumeral superieure superimposable superimpose/DGS superimposition superincumbent/Y superindividual superinduce superinduction superinfection superintend superintendence superintendency superintendent/MS superior/MSY superiority superjacent superjet superlanguage superlative/PSY superliner superload superluminal superlunar superlunary supermachine supermale superman supermarket/MS supermodel/S supermundane supernal/Y supernatant supernational supernatural/PY supernaturalise/SU supernaturalism supernaturalist supernaturalistic supernaturalize/SU supernormal/Y supernormality supernova/MS supernovae supernumerary superorder superordinate superorganic superorganisation/MS superorganise/S superorganism superorganization/MS superorganize/S superovulation superoxide superparasitism superpatriot superpatriotic superpatriotism superphosphate superphysical superposable superpose/DGS superposition/S superpower/DS superpredicate supersaturate/DN superscribe superscript/DGS superscription supersede/DGRS supersedeas supersedure supersensible supersensitisation/MS supersensitive/P supersensitization/MS supersensory superserviceable supersession supersessive superset/MS supersex supersonic/S supersonically superspecialise/S superspecialize/S superstar superstition/MS superstitious/PY superstratum superstruct superstructural superstructure/S supersubstantial supersubtilised/MS supersubtilized/MS supersubtle supersubtlety supersulphurise/S supersulphurize/S supersystem supertanker supertax supertitle/DGMS supertonic superuser/MS supervene/D supervenience supervenient supervention supervise/DGNSX supervisee supervisor/MS supervisory supinate/AN supinator supine/PY suplex supper/MS supping suppl supplant/DGRS supplantation supple/DGPRY supplejack supplement/DGRS supplemental supplementary/S supplementation suppletion suppletive suppletory suppliance suppliant/Y supplicant/MSY supplicate/G supplicatory supplier/AMS supply/DGMNRSZ support/DGRSVZ supportability supportable/IU supportableness supportably/I supported/U supporting/Y supportive/Y supposable supposably supposal suppose/DGRS supposed/Y supposition/MS suppositional/Y suppositious supposititious/PY suppositive/Y suppository/S suppress/DGSV suppressant suppressibility suppressible/I suppression/S suppressive/P suppressor/S suppurate/NV supr supra supraglottal supralapsarian supralaryngeal supraliminal/Y supramolecular supranational supranationalism supranationalist supranationality supraorbital supraprotest suprarational suprarenal suprasegmental supravital/Y supremacist supremacy suprematism supreme/PY supremo supremum suqutra sur sura surah surakarta sural surat surbase/D surcease/DG surcharge/DGS surcingle surcliffe surcoat/S surculose surd sure/DPRTY surefire surefooted/PY surety/S suretyship surf/GRZ surfable surface/DGPRSZ surfactant/S surfbird/S surfboard/RS surfboat/S surfcasting surfeit/DRS surfer/MS surficial surfie surfperch surg surge/DGSY surged/A surgeon/MS surgeoncy surgeonfish surgerise/S surgerize/S surgery/S surges/A surgical/Y suribachi suricate surjection surjective surlily surly/PR surmise/DGRS surmount/DGS surmountable surmullet surname/DMS surpass/DGS surpassable surpassed/U surpassing/Y surplice surplus/MS surplusage surprint surprisal surprise/DGMRS surprised/U surprising/UY surra surreal surrealism surrealist/S surrealistic surrealistically surrebuttal surrebutter surrejoinder surrender/DGRS surreptitious/PY surrey/S surrogate/MNS surround/DGJS surroyal sursum surtax surtout surveil surveillance/S surveillant survey/DGS surveyor/MS survivability survivable survival/S survivalist/S survivance survive/DGRS survivor/MS survivorship susa susah susceptance susceptibility/I susceptible/I susceptive/P susceptivity suseptible sushi suslik suspect/DGRS suspected/U suspecting/U suspend/DGRSZ suspended/AU suspender/MS suspense/NSVX suspenseful suspensive/Y suspensoid suspensor suspensory suspicion/DGMS suspicious/PY suspiration suspire/DG susquehanna suss susso sustain/DGRS sustainable sustainment sustenance sustentacular sustentation sustentative sustention susurrant susurrate susurration susurrous susurrus sutlej sutler sutra suttee sutural/Y suture/DGS suva suzerain suzerainty svelte/PY sverige svizzera swab/S swabbed swabber swabbie swabbing swabby/S swacked swaddle/DG swadesh swag/G swage swagger/DG swagging swagman swain/MS swainish/P swale swallow/DGRS swallowable swallowtail swallowwort swam swami swamp/DGRS swampland/MS swampy/PR swan/MS swanage swang swanherd swank/R swankily swanky/PR swanlike swannery swanning swansdown swanskin swap/S swappable swapped swapper/MS swapping swaraj sward swarf swarm/DGRS swart/P swarthy/PR swartz swash/R swashbuckle/GR swastika swat/S swatch/S swath/DGJMRS swathe/DGJRS swatted swatter swatting sway/DGRS swayback/D swear/GRS swearword sweat/DGRSZ sweatband sweatbox sweatily sweatpants sweatshirt sweatshop/M sweatshops sweatsocks sweaty/PR sweazey sweelinck sweep/GJRSZ sweepback sweeping/PSY sweepstake/S sweepy/R sweet/GNPRSTXY sweetbread/MS sweetbrier sweeten/DGJRSZ sweetheart/MS sweetie/MS sweetiewife sweetish/Y sweetman sweetmeal sweetmeat sweetshop sweetsop swell/DGJS swellhead/D swellheaded/P swelter/D sweltering/Y swept sweptback sweptwing swerve/DGS swerving/U sweven sweyn swidden swift/PRTY swiftie swiftlet swig swigger swigging swill/R swim/S swimmable swimmer/MS swimmeret swimmily swimming/Y swimmy/PR swimsuit/MS swinburne swindle/DGRS swindon swine swineherd swinepox swing/GRSZ swingable swingably swingboat swinge swingeing swinging/Y swingle swingletree swingometer/S swingy/R swinish/PY swipe/DGS swirl/DGRS swirling/Y swirly/R swish/DR swishingly swishy/R swiss switch/DGJMRSZ switchable switchback/MS switchblade switchboard/MS switcheroo switchgear switchgirl switchgrass switchman switchmen/M switchyard swith/R swivel/S swiveled swiveling swivelled swivelling swivet swizzle/DGR swob swollen swoon/DGRS swooning/Y swoop/DGRS swoosh swop sword/MS swordbill swordcraft swordfight/MS swordfish swordlike swordplay/R swordsman swordsmanship swordsmen swordstick/S swordtail swore sworn swot/S swotted swotting swound/S swum swung swy sybaris sybarite sybaritically sybert sycamine sycamore syce sycee syconium sycophancy sycophant/SY sycophantic sycophantically sycophantise/S sycophantish/Y sycophantism sycophantize/S sycosis sydneysider syene syenite syenitic syktyvkar syllabarium syllabary syllabi syllabic syllabically syllabicate/N syllabicity syllabify/N syllabism syllable/DGMS syllabogram syllabography syllabub syllabus syllepsis sylleptic syllogise syllogism/MS syllogist syllogistic syllogistically syllogize sylph sylphid sylphlike sylva sylvan sylvanise/S sylvanite sylvanize/S sylvanus sylvatic sylviculture sylvie sylvine sylvite sym symbiont symbiontic symbiosis symbiote symbiotic symbiotically symbol/MS symboled symbolic/MS symbolical symbolically symboling symbolisation/AMS symbolise/DGRSZ symbolised/U symbolises/A symbolism/S symbolist symbolistic symbolists symbolization/AMS symbolize/DGRSZ symbolized/U symbolizes/A symbolled symbolling symbology symington symmetallism symmetric symmetrical/PY symmetrically/U symmetrisation/MS symmetrise/DGS symmetrization/MS symmetrize/DGS symmetry/MS symonds sympathectomy sympathetic/U sympathetically sympathin sympathise/DGJRSZ sympathised/U sympathising/MSUY sympathize/DGJRSZ sympathized/U sympathizing/MSUY sympatholytic sympathomimetic sympathy/MS sympatric sympatrically sympatry sympetalous sympetaly symphile symphonic symphonically symphonious/Y symphonist symphony/MS symphyseal symphysial symphysis symplectic sympodial/Y sympodium symposia symposiac symposiarch symposiast symposium/S symptom/MS symptomatic symptomatically symptomatologic symptomatological/Y symptomatology symptomise/S symptomize/S symptomless synaeresis synaesthesia synaesthesis synaesthetic synagog synagogal synagogue/S synalepha synaloepha synapse/DGMS synapsis synaptic synaptically synaptosomal synaptosome synarchy synarthrodial/Y synarthrosis sync/G syncarp syncarpous syncarpy synch/G synchro/S synchrocyclotron synchroflash synchromesh synchrometer synchronal synchroneity synchronic synchronical/Y synchronisable/S synchronisation/MS synchronisations/A synchronise/DGRSZ synchronised/AU synchronises/A synchronism synchronistic synchronizable/MS synchronization/MS synchronizations/A synchronize/DGRSZ synchronized/AU synchronizes/A synchronous/PY synchrony synchroscope synchrotron synclastic synclinal syncline synclinorium syncom syncopal syncopate/DNV syncopator syncope syncretic syncretise/DGS syncretism syncretist syncretistic syncretize/DGS syncrisis syncytial syncytium syndactyl syndactylism syndactyly syndesis syndesmosis syndesmotic syndetic syndetically syndic/S syndical syndicalise/S syndicalism syndicalist syndicalize/S syndicate/DGNS syndicator syndrome/MS syne synecdoche synecdochic synecdochical/Y synecious synecologic synecological/Y synecology synectic/S synectically synephrine syneresis synergetic synergic synergically synergid synergism synergist synergistic synergistically synergy synesis synesthesia synesthetic syngamy syngeneic synizesis synkaryon synod/S synodal synodic synodical synonym/MS synonymic synonymical synonymise/S synonymist synonymity synonymize/S synonymous/Y synonymy synopses synopsis synopsise synopsize synoptic synoptical/Y synostosis synovia synovial synovitis synsepalous syntactic/SY syntactical/Y syntagma syntax/S syntheses synthesis synthesisation/MS synthesise/DGRSZ synthesised/U synthesises/A synthesist synthesization/MS synthesize/DGRSZ synthesized/U synthesizes/A synthetase synthetic/S synthetical/Y synthetism syntonic syntonically sypher syphilis syphilitic syphilologist syphilology syphiloma syphon/DGMS syphonless/S syphonlike/MS syphonophore syphonostele syphonostelic syphonostely syphons/U syr syren syringa syringe/DGS syringomyelia syringomyelic syrinx/S syrphid syrup syrupy sys sysgt syssarcosis syst systaltic systat system/MS systematic/PS systematical systematically systematisation/MS systematise/DGRSZ systematised/U systematising/U systematism systematist systematization/MS systematize/DGRSZ systematized/U systematizing/U systematology systemic systemically systemisable/SU systemisation/MS systemise/RSZ systemizable/MSU systemization/MS systemize/RSZ systemless systemwide systole systolic sytactic syzran syzygial syzygy taata tab/S tabac tabanid tabard tabaret tabbed tabbing tabby/S tabellen tabernacle/DGMS tabernacular tabes tabescent tabetic tabla tablature table/DGS tableau/MS tableaux tablecloth tablecloths tableful tableland tablespoon/MS tablespoonful/MS tablespoonsful tablet/MS tabletop/MS tableware tabloid tabloids taboo/MS tabor/DGRSZ taboret/S taborin/S tabouret/S tabu tabula tabular/Y tabularisation/MS tabularise/S tabularization/MS tabularize/S tabulate/DGNSX tabulator/MS tace tacet tach tachinid tachism tachist tachiste tachistoscope tachistoscopic tachistosopically tachograph tachometer/MS tachometry tachs tachycardia tachygraphic tachygraphical tachygraphy tachylite tachylyte tachymeter/MS tachymetry tachyon/MS tachyphylaxis tacit/PY taciturn taciturnity tack/DGRS tackboard tacket tackify/R tackily tackiness tackle/DGMRS tacky/RS tacloban tacmahack taco/S taconite tact/I tactful/PY tactic tactical/Y tactician tactics tactile/Y tactility taction tactless/Y tactlessness tactual/Y tad tadmor tadpole tadpoles taegu taejon tael taenia taeniacide taeniafuge taeniasis taffeta taffetised taffetized taffrail taffy/S tafia tafilelt tag/MS tagalong taganrog tagboard tagged taggers tagging tagine/S tagliatelle tagmeme tagmemics tagore tagus tahina tahr tahsil tahsildar taig taiga tail/DGJRS tailback tailboard tailbone tailcoat/D tailgate/DGR taille tailless taillight/MS taillike tailor/DGS tailorbird tailoress tailorisation/MS tailorise/S tailorization/MS tailorize/S tailpiece tailpipe tailplane tailrace tailskid tailspin/MS tailstock tailwater tailwind/MS taimyr tain taine taint/DS taintless taipan taiwanese taiyuan taj tajo taka takahe takamatsu takao take/GHJRSZ takeaway takedown taken takeoff/S takeout takeover/S takes/I takin takoradi talapoin talaria talavera talbot talc talca talcahuano talcose talcum tale/MNRS talebearer talebearing talent/DS talentless talesman taleysim tali taliesin taligrade taliped talipes talipot talisman talismanic talismanically talk/DGRSZ talkathon talkative/PY talkie talky tall/PRT talladega tallage tallahatchie tallahoosa tallboy tallchief talleyrand tallinn tallis tallish tallith tallithim tallow tallowy tally/DGS tallyho tallyman talmudic talmudical talon/DS talos taluk talus talweg tam tamable tamale tamandua tamarack tamarau tamarin tamarind tamarisk tamasha tamatave tamaulipas tambac tambala tambora tambour/R tamboura tambourine tambura tamburitza tamburlaine tame/DGPRSTY tameable tamed/U tameless tamis tammerfors tammuz tammy tamp/G tampala tamper/DGRS tampere tampered/U tamperproof tampico tampion tampon tan/S tana tanager tanana tanbark tance tancred tandem tandemise/S tandemize/S tandjungpriok tandoori tang/DY tanga tangelo tangency tangent/MS tangential/Y tangere tangerine tangibility/I tangible/IP tangibly/I tangle/DGS tangleberry tanglement tango/S tangram tangshan tanguy tangy/R tanh tanis tanist tanjore tank/DGRSZ tanka tankage tankard tankful tannage tannate tanned tannenbaum tanner/MS tannery tannest tannic tannin tanning tannish tansy/S tanta tantalate tantalic tantalisation/MS tantalise/DGRSZ tantalised/U tantalising/PY tantalisingly/S tantalisingness/S tantalite tantalization/MS tantalize/DGRSZ tantalized/U tantalizing/PY tantalizingly/S tantalizingness/S tantalous tantalum tantamount tantara tantivy tanto tantra tantric tantrism tantrum/MS tao/S taoism taoist/S tap/MS tapa tapadera tape/DGJRSZ taped/U tapeline tapemark/S taper/DGRS tapestry/DMS tapeta tapetum tapeworm taphole taphouse tapioca tapir/S tapis tapley tappa tapped/U tapper/MS tappet/S tapping taproom/S taproot/MS tapster/S tar/S tara/S tarabulus taraday taradiddle taramasalata tarantara tarantass tarantella tarantism taranto tarantula/S tarawa taraxacum tarbes tarboosh tarbush tardigrade tardily tardo tardy/PRS tare/DGS tarentum targe target/DGS targo tarheelia tariff/MS tariffise/S tariffize/S tarim tarlatan tarmac tarmacadam tarn tarnal tarnation tarnish/DGS tarnishable tarnishs taro/S tarok tarot tarp tarpan tarpaper tarpapered tarpaulin/S tarpon/S tarradiddle tarragon tarragona tarrant tarrasa tarre tarred tarriance tarring tarry/DGS tarsal tarshish tarsi/R tarsia/I tarsometatarsus tarsus tart/PSY tartan tartar tartarisation/MS tartarise/DS tartarization/MS tartarize/DS tartarous tartarughe tartish/Y tartlet/S tartrate/DS tartu tartuffe taruffi tashi tashkent tasimeter task/DGS taskmaster taskmistress taskwork tasman tasse tassel/M tasseled tasseling tasselled tasselling tassells tassels tasset tassie tassle tasso taste/DGRSZ tasteful/PY tasteless/PY tastemaker tastily tasty/PR tat tatami tatchell tate tater tati tatian tatler tatouay tatra tatras tatted tatter/D tatterdemalion tattersall tatting tattle/DGRS tattletale tattoo/DRS tattooist tatty/R tau taught/U taui taunt/DGRS taunting/Y taupe taupo tauranga taurine taurocholate taurocholic taurog tauromachy taussig taut/NPY tauten/DG tautog tautological/Y tautologous/Y tautology/MS tautomer tautomeric tautomerism tautonym tautonymic tautonymous tautonymy tav tavel tavern/MRS taverna tavernise/S tavernize/S taw/S tawdrily tawdry/PR tawes tawie tawney tawny/PRS tawpie tawse tax/DGRS taxa taxability taxable taxably taxaceous taxation taxeme taxemic taxi/DGMS taxicab/MS taxidermic taxidermist/MS taxidermy taxies taximan taximeter/MS taxing/Y taxiplane/S taxiway/MS taxon/S taxonomic taxonomically taxonomist/MS taxonomy taxpayer/MS taxpaying taxus taxying tazza tchaikovsky tea/S teacake teacart teach/GJRSZ teachability teachable/P teachably teacher/MS teachership teacup teacupful teahouse/S teak/MS teakettle teakwood teal/S team/DGMS teammate/S teamster/S teamwork teapot/S teapoy tear/DGMRS teardown teardrop/S tearful/PY teargas tearily tearjerker tearle tearless/Y tearlessnss tearoom/S tearstain/D teary/R teas/DGRS tease/DGRS teasel teaseled teaseler/S teaseling teaselled teaseller/S teaselling teashop teasing/Y teaspoon/MS teaspoonful/MS teaspoonsful teat/DS teatime teatro teazel teazeled teazeling teazelled teazelling teazle/D tech/D technetium technetronic technic/S technical/PY technicalisation technicalise/SU technicality/MS technicalization technicalize/SU technician/MS technion technique/MS technocommercial technocracy technocrat technocratic technography technol technologic technological/Y technologise technologist/MS technologize technology/MS technostructure techy tecta tectal tectonic/S tectonism tectorial tectum tecum tecumseh ted/S tedded tedder tedding tedious/PY tedium tee/S teeing teem/DGS teeming/PY teen/RS teenage/DRZ teenie/R teensy/R teentsy/R teeny/R teenybopper teepee teesside teet teeter teeterboard teetering teeth/DGRS teethe/DGRS teetotal teetotaled teetotaler teetotaling teetotalism teetotalist teetotalled teetotaller teetotalling teetotum tef teg tegmen tegmental tegmentum tegular tegument tegumental/I tegumentary/I tehuantepec teide teiid teilhard tejo tektite/S tektitic tel tela telaesthesia telaesthetic telamon telamones telanaipura telangiectasia telangiectasis telangiectatic telautograph tele telecamera telecast/R telecom telecommunicate telecommunication/S telecomunications teleconference/DGMS telecourse teledu telefacsimile telefilm teleg telega telegenic telegnosis telegonus telegony telegram/MS telegraph/DGRZ telegraphese telegraphic telegraphically telegraphist telegraphs telegraphy telekinesis telekinetic telekinetically telemachus teleman telemann telemark telemeter/MS telemetric telemetrically telemetry telencephalic telencephalon teleologic teleological/Y teleologist teleology teleost teleostean teleostome telepathic telepathically telepathy telephone/DGRSZ telephonic telephonically telephonist/S telephony telephoto telephotographic telephotography teleplay teleprinter teleprocessing teleprompter teleran telescope/DGS telescopic telescopically telescopy telescript telesis telespectroscope telestereoscope telesthesia telesthetic telestich teletext telethermoscope telethon teletranscription teletube teletype/MS teletypesetter teletypesetting teletypewrite/R teletypist teleutospore teleutosporic televideo teleview/R televise/DGNSX televisionally televisionary televisor/MS televisual telewriter telexed telexes telexing telfer telferage telia telial telic telically teliospore teliosporic telium tell/GJRSZ telli telling/SY telltale/MS tellurate tellurian telluric telluride tellurion tellurise/DGS tellurite tellurium tellurize/DGS tellurometer/MS tellurous tellus telnet/S telocentric teloic telome telomeric telophase telos telotaxis telpher telpherage telson temblor temerarious/PY temerity temp tempeh temper/DGRS tempera temperable temperament/S temperamental/Y temperance/I temperate/IPY temperature/MS tempest/S tempestuous/PY tempi template/MS temple/DMS templeman templet templise/S templize/S tempo/S temporal/Y temporalise/DGS temporality temporalize/DGS temporarily temporary/PS temporisation/MS temporise/DGJRSZ temporiser/MS temporising/MSY temporisings/U temporization/MS temporize/DGJRSZ temporizer/MS temporizing/MSY temporizings/U tempt/DGRSZ temptable temptation/MS tempting/Y temptress tempura temuco ten/HMS tenability/U tenable/P tenably tenace tenacious/PY tenacity tenaculum tenaille tenancy/S tenant/MS tenantable tenantless tenantry tench/S tend/DGRSZ tenda tendance/I tendencious tendency/S tendentious/PY tender/DGPSY tenderfoot tenderhearted/PY tenderisation tenderise/DGRS tenderization tenderize/DGRS tenderloin tenderometer/MS tendinous tendon/S tendresse tendril/S tendriled tendrilled tendrilous tenebrific tenebrionid tenebrious tenebrism tenebrist tenebrous tenedos tenement/MS tenementary tenementisation/MS tenementise/S tenementization/MS tenementize/S tenenbaum tenesmus tenet/S tenex tenfold teng tengri tenia teniacide teniafuge teniasis teniers tenner tenniel tennis tennist tenno tenon tenor/MS tenorite tenorrhaphy tenosynovitis tenotomy tenour tenpenny tenpin/S tenpounder tenrec tens/DGRSTV tense/DGNPRSTVXY tensible tensile tensility tensimeter/MS tensiometer/MS tensiometric tensiometry tension/DGRS tensional/I tensionless tensity tensometer/MS tensor/MS tensorial tenspot tent/DGRS tentacle/DS tentacular tentage tentation tentative/PY tented/U tenterhook/S tenth/S tenths tentie tentless tentmaker tenty tenuis tenuity tenuous/PY tenure/DS tenurial/Y tenuto tenzing teocalli teonanacatl teosinte tepa tepal tepee tepees tepefy tephra tephrite tepic tepid/PY tepidity tequila/M ter/DT terai teraph teraphim teratism teratogen teratogenesis teratogenic teratogenicity teratoid teratologic teratological teratologist teratology/S teratoma teratomatous terbia terbium terce terceira tercel tercentenary tercentennial tercept tercet terebene terebic terebinth terebinthine teredines teredo terephthalate terephthalic tereshkova terete terga tergal tergite tergiversate/N tergiversator tergum teriyaki term/DGRSY termagant/Y termcap terminable/P terminableness/I terminably terminal/MSY terminalisation/MS terminalised/MS terminalization/MS terminalized/MS terminate/DGNSVX terminated/U terminational terminative/Y terminator/MS termined termini termining terminism terminological/Y terminology/S terminosity terminus termitarium termite/S termless termor termtime tern ternary ternate/Y terne/N terneplate terni ternise/S ternize/S terotechnology terpene terpeneless terpenic terpenoid terpineol terpolymer terpsichorean terr terrace/DGS terrae terrain/MS terram terramycin terrane terrapin/S terraqueous terrarium terrazzo terrene terreplein terrestial terrestrial/MSY terrestrialise/S terrestrialize/S terret terrible/P terribly terricolous terrier/MS terrific/Y terrifically terrify/DGS terrifying/Y terrigenous terrine territorial/Y territorialisation/MS territorialise/S territorialism territorialist territoriality territorialization/MS territorialize/S territorian territory/MS terror/MS terrorisation/MS terrorise/DGRSZ terrorised/U terrorism terrorist/MS terroristic terrorization/MS terrorize/DGRSZ terrorized/U terrorless terry/S terse/PRTY tertial tertian tertiary/S tertium tertre tertullian teruel tervalent tery terylene terza terzetto tesla tessellate/DNS tessera tesseract tessie tessin tessitura test/DGJMRSZ testa testability testable/U testacean testaceous testacy/I testae testament/MS testamentary testate/I testator/MS testatrix testbed testcross tested/U tester/MS testes testicle/MS testicular testiculate testify/DGRSZ testily testimonial/S testimonialisation/MS testimonialise/RSZ testimonialization/MS testimonialize/RSZ testimony/MS testis teston testoon testosterone testudinal testudo testy/PR tetanal tetanic tetanically tetanisation tetanise/DGS tetanization tetanize/DGS tetanus tetany tetartohedral tetched tetchy/R tete/R teth tether/DGS tetherball tetra tetrabasic tetrabasicity tetrabrach tetrabutylammonium tetracaine tetrachlorethylene tetrachloride tetrachord tetracid tetracyclic tetracycline tetrad tetradecyl tetradic tetradrachm tetradymite tetradynamous tetraethyl tetraethyllead tetrafluoride tetragonal/Y tetragonolobus tetragram tetragrammaton tetrahalides tetrahedra tetrahedral/Y tetrahedrite tetrahedron tetrahydrate/D tetrahydrocannabinol tetrahydrofuran tetrahydroxy tetrahymena tetralogy tetramer/MS tetrameric tetrameron tetramerous tetrameter tetramethyl tetramethyllead tetraphenyl tetraplegia tetraploid tetraploidy tetrapod tetrapody tetrapterous tetrapyrrole tetrarch tetrarchic tetrarchy tetrasodium tetraspore tetrasporic tetrastich tetrastichous tetrasyllable tetratomic tetravalent tetrazolium tetrazzini tetrode/S tetrodotoxin tetroxide tetrxide tetryl tetter tetzel teutoburger teutonise teutonize tevere tevet tewfik text/MS textbook/MS textbookish textile/MS textual/Y textualism textuary textural/Y texture/DGS texturised texturized teyde tezel th thackeray thaddeus thadentsonyane thalamencephalon thalamic thalamically thalamus thalassemia thalassemic thalassic thalassocracy thalassocrat thaler thales thalidomide thalli thallic thallium thalloid thallophyte thallophytic thallous thallus/S thalweg thames thammuz than thanatopsis thane thaneship thanet thanjavur thank/DGRS thankful/PY thankless/PY thanksgiving/MS thankworthy thapsus thar that'd that'll that/MS thatch/DGRS thatcherism thaumatology thaumatrope thaumaturge thaumaturgic thaumaturgist thaumaturgy thaw/DGS the theaceous theanthropism thearchy theast theat theater/MS theatergoer/MS theatergoing/MS theaterless/S theaterlike/MS theatre/MS theatregoer/MS theatregoing theatreless/S theatrelike/MS theatric/S theatrical/SY theatricalisation/MS theatricalise/DGS theatricalism theatricality theatricalization/MS theatricalize/DGS theatricise/S theatricize/S thebaine theca thecae thecal thecate thecodont thee theelin theelol theft/MS thegn theine their/MS theism theist/MS theistic theistical/Y them thematic/U thematically theme/MS themistocles themselves then thenar thenardite thence thenceforth thenceforward/S theobromine theocentric theocentricity theocentrism theocracy theocrasy theocrat theocratic theocratical/Y theocritus theodicy theodolite theodolitic theodorakis theodosius theogonic theogony theol theolog theologian/MS theologic theological/Y theologisation theologise/DGRS theologization theologize/DGRS theologue theology/S theomachy theomancy theomania theomorphic theonomous/Y theonomy theopathy theophagy theophanic theophany theophobia theophrastus theophylline theorbo theorem/MS theorematic theoretic/S theoretical/Y theoretician theoreticians theorisation/MS theorise/DGRSZ theorist/MS theorization/MS theorize/DGRSZ theory/MS theosophical/Y theosophist theosophy therapeusis therapeutic/S therapeutically therapeutist therapist/MS therapsid therapy/MS theravada there'd there'll there/M thereabout thereabouts thereafter thereat thereby therefor therefore therefrom therein thereinafter thereinto thereof thereon thereto theretofore thereunder thereunto thereupon therewith therewithal therezina therfore theriac theriaca theriacal therianthropic theriomorphic therm thermae thermaesthesia thermal/SY thermalization thermalize/DGS thermic thermically thermion thermionic/S thermistor/S thermite/M thermo/S thermoanaesthesia/MS thermoanesthesia/MS thermobarograph thermobarometer thermochemical thermochemist thermochemistry thermocline thermocoagulation thermocouple/S thermoduric thermodynamic/S thermodynamical thermodynamically thermodynamicist thermoelastic thermoelectric thermoelectricity thermoelectron thermoelement thermoform thermoformable thermoformed thermoforming thermogenesis thermogram/MS thermograph thermographic thermographically thermography thermogravimetric thermohaline thermojunction thermolabile thermolability thermoluminescence thermoluminescent thermolysis thermolytic thermomagnetic thermomagnetically thermometer/MS thermometerise/S thermometerize/S thermometric thermometrically thermometry thermomotor thermonuclear thermoperiodicity thermoperiodism thermophile thermophilic thermophilous thermophysical thermopile thermoplastic thermoplasticity thermopolymerisation/MS thermopolymerization/MS thermopower thermopylae thermoreceptor thermoregularity thermoregulation thermoregulator thermoregulatory thermoremanence thermoremanent thermoscope thermoset thermosetting thermosiphon/MS thermosphere thermospheric thermostability thermostable thermostat/DMS thermostatic/S thermostatical thermostatically thermosyphon/MS thermotactic thermotaxis thermotensile thermotherapy thermotropic thermotropism theroelectricity theroid theropod thersitical thesaural thesauri thesaurus these/S thesis thespian/S thespis theta/S thetic thetically theurgic theurgical theurgist theurgy thew they they'd they'll they're they've thiabendazole thiamin thiaminase thiamine thiazide thiazine thiazole thick/NPRSTXY thicken/DGRSZ thicket/DMS thickety thickhead/D thickish thickleaf thickness/S thickset thief thieve/GS thievery thievish/PY thigh/D thighbone thighs thigmotaxis thigmotropism thill/S thimble/MS thimbleberry thimbleful/M thimblerig thimblerigger thimblesful thimbleweed thimblewit thimerosal thin/PRSTY thinclad thine thing/PS thingamabob thingamajig/MS thingumabob thingumajig thingummy think/GRSZ thinkable/P thinkably/U thinking/PY thinkingly/U thinks/A thinned thinner/S thinnest thinning thinnish thioalcohol thiocarbamide thiocyanate thiocyanic thiofuran thioguanine thiol thiolic thionate thionic thionine thionyl thiopental thiopentone thiophen thiophene thiophosphate thiosinamine thiosulfate thiosulfuric thiosulphate thiosulphuric thiotepa thiouracid thiouracil thiourea thir thiram third/SY thirdhand thirdstream thirl thirlage thirlmere thirst/DRS thirstily thirsty/PR thirteen/HS thirty/HS thirtyfold this this'll thisbe thistle thistledown thistly thither thitherto thitherward thixotropic thixotropy tho/H thod tholdy thole/DGRS tholeiite tholeiitic tholepin tholos thonburi thong/D thoraces thoracic thoracically thoracoplasty thoracotomy thorax/S thoria thorianite thoriate/D thoric thorite thorium thorn/MS thornback thornbill thornbush thornless thornlike thorny/PR thoron thorough/PY thoroughbred thoroughfare/MS thoroughgoing thoroughpaced thoroughpin thoroughwort thorp thorshavn those thou/S though thought/MS thoughtful/PY thoughtless/PY thoughtway thousand/HS thousandfold thousandths thraldom thrall thralldom thrash/DGRS thrasonical/Y thrave thraw thrawart thrawn/Y thread/DGRSZ threadbare/P threadfin threading/A threadless threadlike threadneedle threadworm thready/P threap threat/NSX threaten/DGRS threatening/Y three/MS threefold threepence/S threepenny threescore threesome thremmatology threnode threnodic threnodist threnody threonine thresh/DGR threshold/DGMS threw thrice thrift thriftily thriftless/PY thrifty/PR thrill/DGRSZ thrilling/Y thrips thrive/DGRS thriven thriving/Y thro throat/DGS throatily throatlash throatlatch throaty/PR throb/S throbbed throbber throbbing throe throes thrombi thrombin thrombocyte thrombocytic thrombocytopenia thrombocytopenic thromboembolic thromboembolism thrombogen thrombokinase thrombophlebitis thromboplastic thromboplastically thromboplastin thrombose thrombosed thromboses thrombosis thrombospondin thrombotic thrombus throne/GMS throneberry throng/GMS thronise/S thronize/S throstle throttle/DGRS throttleable throttlehold through/Y throughither throughother throughout throughput throughway throve throw/GRS throwaway throwback thrown throwster thru thrum thrumming thrush/S thrust/GRSZ thrustful/P thrustor thud/S thudded thudding thug/MS thuggee thulium thumb/DGS thumbhole thumbnail thumbnut thumbprint/MS thumbscrew thumbstall thumbtack/DGMS thummim thump/DGRS thun/R thunder/DGRSZ thunderbird thunderbolt/MS thunderbox thunderclap/S thundercloud/MS thunderflower thunderhead thundering/Y thunderous/Y thunderpeal thundershower/MS thunderstone thunderstorm/MS thunderstrike thunderstroke thunderstruck thundery thunk thurber thurible thurifer thurl thus/Y thuya thwack thwart/DGRSY thwartwise thwump thy thylacine thylakoid thyme/MS thymectomise thymectomize thymectomy thymelaeaceous thymey thymic thymidine thymine thymocyte thymol thymus thymy thyratron thyrglobulin thyristor thyrocalcitonin thyroglobulin thyroid/S thyroidal thyroidectomised thyroidectomized thyroidectomy thyroidisation/MS thyroiditis thyroidization/MS thyronine thyrotoxic thyrotoxicosis thyrotrophic thyrotrophin thyrotropic thyrotropin thyroxin thyroxine thyrse thyrsi thyrsus thysanopteran thysanuran thyself ti tia tial tiality tian tiara tiated tiberias tibesti tibia tibial tibiotarsus tibullus tibur tiburon tic tical ticino ticism tick/DGRSZ ticket/DGMS tickicide tickle/DGRS ticklebrush ticklish/PY tickseed ticktack ticktacktoe ticktock ticonderoga tictac tidal/Y tidbit/S tiddledywinks tiddler tiddly tiddlywinks tide/DGJS tideland/S tideless tidemark tidewaiter tidewater tideway tidily/U tidy/DGPRS tie/DRSZ tieback tiebreaker tieck tied/AU tieing tieless tiemannite tiepin tiepolo tier/DS tierce tiercel tierra tiff tiffany tiffin tiflis tiger/MS tigerish/PY tigerlike tight/NPRSTXY tighten/DGJRSZ tightfisted tightknit tightrope tightwad/MS tightwire tiglic tiglon tigon tigress tigrinya tihwa tijuana tike tiki tikoloshe til/Y tilapia tilde/S tile/DGRS tilefish tiliaceous till/DGRSZ tillable tillage tillandsia tiller/DGS tillerman tillich tillicum tillie tilt/DGRSZ tiltable tilth tiltmeter/MS tiltyard timaru timbal timbale timber/DGS timberhead timberland/S timberline timberman timberwork timberyard timbral timbre timbrel timbrelled timbuktu time/DGJRSYZ timecard timekeeper timekeeping timeless/PY timely/PR timeous/Y timeout/S timepiece timepleaser timesaving timescale/S timeserver/S timeserving timeshare/DGS timeslice/S timestamp/DGS timetable/DGMS timework/R timeworn timid/PY timidity timmy timocracy timocratic timocratical timorous/PY timothy timpani timpanist tin/MS tinamou tinc tincal tinct tinctorial/Y tincture/DG tindal tinder tinderbox tine/MS tinea tineal tineau tined tineid tinfoil tinful ting/NY tinge/DG tingeing tingle/DGS tingling/Y tinhorn tinily tining tinker/DGRS tinkle/DGS tinkly tinman tinned tinner tinnily tinning tinnitus tinny/PRT tinplate tinpot tinsel/Y tinseled tinselier tinseliest tinseling tinselled tinsellier tinselliest tinselling tinsmith tinsmiths tinstone tint/DGRS tintable tintinnabulary tintinnabulation tintinnabulum tintless tintoretto tintype tinware tinwork/S tiny/PRT tip/MS tipcart tipcat tipi tipoff tippecanoe tipped tipper/MS tippet tipping tipple/DGRS tippy/R tipsily tipstaff tipstaves tipster tipstock tipsy/PR tiptoe/D tiptoeing tiptop tipu tirade/S tiran tire/ADGMS tired/APY tireless/PY tiresias tiresome/PY tirewoman tirich tiro/S tirpitz tirso tisane tissue/DGMS tissuey tisza tit/MS titan/S titanate titaness titania titanic titanically titaniferous titanism titanite titanium titanosaur titanothere titanous titbit titer/S titfer tithable tithe/GMRS tithonia tithonus titi titian titicaca titillate/GNV titillating/Y titivate/N titlark title/DGS titled/AU titleholder/S titlist titman titmice titmouse/M tito titrant titratable titrate/DGNS titrator titre/S titrimetric titrimetrically titter/DGS tittie tittivate tittle tittup tittuped tittuping tittupped tittupping tittuppy tittupy titubation titular/Y tiu tiv tizzy/S to/IU toad/MS toadeater/MS toadfish/MS toadflax toadstone/MS toadstool toady/DGS toadyism toast/DGRSZ toastmaster/MS toastmistress toasty/R tobacco tobacconist/MS tobaggon/MS tobies tobit toboggan/GMRS tobogganist tobol tocantins toccata tocher tocology tocopherol tocsin tod today'll today/MS toddle/DGRSZ toddy/MS tody/S toe/DMS toea toecap toehold/MS toeing toeless toenail/S toepiece toeplate toey toff toffee toffy/S toft tofu tog/S toga/D together/P toggery togging toggle/DGS togue toheroa toil/DGRS toile toilet/MS toiletry toilette toilful/Y toilsome/PY toilworn tokamak toke token/MS tokenism tokonoma tola toland tolbooth tolbutamide told/AU tole/G tolerability/I tolerable/I tolerably/I tolerance/S tolerant/IY tolerate/DGNSV tolerator tolidine toll/DGS tollbooth/M tollbooths tolley tollgate tollhouse tollman tollway tolpuddle tolu toluate toluene toluic toluidine toluol toluyl tolyl tolylene tolylphosphine tom/MS tomahawk/MS tomalley toman tomato tomatoes tomb/MS tombac tombigbee tombless tomblike tombola tombolo tombouctou tomboy tomboyish/P tombstone/S tomcat/S tomcod tome/S tomentose tomentum tomfool tomfoolery tommy tommyrot tomogram/MS tomograph tomography tomorrow/MS tompion tomtit ton/MS tonal/Y tonalities tonality tondi tondo tone/DGRS toned/I toneless/PY toneme tonemic toner/I tonetic/S tonetically tonette tong/R tonga tongs tongue/DGS tongueless tonguelike tonic/MS tonically tonicise/S tonicity tonicize/S tonight tonio tonk/S tonle tonn/R tonnage tonne/RS tonneau/S tonometer/MS tonometric tonometry tonoplast tonsil tonsillar tonsillectomy tonsillitis tonsillotomy tonsorial tonsure/DG tontine tonus tony/R too toodle took tool/DGRSZ toolbox/S toolhead toolholder toolhouse toolkit/MS toolmake/GRZ toolroom toolshed toolsmith toom toomey toon toot/DGRS tooth/DG toothache/MS toothbrush/GMS toothily toothless toothlike toothpaste toothpick/MS tooths toothsome/PY toothwort toothy/R tootle/DGR tootsie/S tootsy/S toowoomba top/MS toparch topaz topazolite topcoat/S topcross topdressing tope/DGJRSZ topee topflight topful topfull topgallant topheavy tophi tophus topi topiary topic/MS topical/Y topicality topkick topknot topless toploftical toploftily toplofty/P topmast topminnow topmost topnotch/R topocentric topograph/R topographic topographical/Y topography/S topoi topological/Y topologise topologist topology/S toponym toponymic toponymical toponymy topos topotype topped topper/S topping/S topple/DGS topsail topside/S topsoil topspin topstitch topwork toque tor torbay torc torch/MS torchbearer torchier torchlight torchon torchwood tore toreador torero toreutic/S tori toric torii torino torment/DGRSZ tormentil tormentor torn tornadic tornado/S tornadoes tornillo toroid/S toroidal/Y torose torpedo/DGS torpedoes torpid/Y torpidity torpor torporise/S torporize/S torquate torquay torque/GRSZ torquemada torr/X torre/S torrefy torrence torrent/MS torrential/Y torricelli torrid/PY torridity torsade torsi torsibility torsion/AI torsional/Y torso/S tort/N torte/S tortelier tortellini torticollis tortile tortilla tortious/Y tortoise/MS tortoiseshell tortola tortoni tortricid tortrix tortuga tortuosity tortuous/Y torture/DGRSZ torturous/Y torula torus/MS tory/S toscana toscanini tosh toss/DGRS tosspot tot/S total/MSY totaled totaler/MS totaling totalisation/MS totalisator totalise/DGRSZ totalism totalistic totalitarian totalitarianise totalitarianism totalitarianize totality/MS totalization/MS totalizator totalize/DGRSZ totalled totaller/MS totalling totaquina totaquine tote/DGRS totem totemic totemically totemisation/MS totemism totemist totemistic totemite totemization/MS tother totipotency totipotent toto totted totter/DGS tottering/Y tottery totting toucan touch/DGRS touchable/U touchback touchdown/S touched/U touchhole touchily touching/Y touchline touchmark touchstone/S touchwood touchy/PRT tough/NPRTXY toughen/DGS toughie/S toughs toughy/S toul toulon toulouse toupee tour/DGRS touraco touraine tourane tourbillion tourbillon tourcoing tourise/S tourism tourist/MS touristic touristically touristy tourize/S tourmaline tournai tournament/MS tournedos tourneur tourney/DGS tourniquet/S touse/G tousle/DGS toussaint tout/DGRS touzle tovarich tovarish tow/DGRSZ towage toward/SY towardly/P towbar towboat/S towel/MS toweled toweling/S towelled towelling towelling/S tower/DGS towering/Y towerlike towhead/D towhee towie towkay towline towmond town/MRS townee townhall townhouse townlet townley townscape townsfolk townshend township/MS townsman townsmen townspeople townswoman townwear towny/S towpath towrope towsley toxaemia toxalbumin toxaphene toxemia toxemic toxic toxicant toxicity toxicogenic toxicologic toxicological/Y toxicologist toxicology toxicosis toxigenic toxigenicity toxin/MS toxoid toxophilite/S toxophily toxoplasma toxoplasmic toxoplasmosis toy/DGRS toyama toylike toynbee toyon trabeate/DN trabecula trabecular trabeculate trabzon tracasserie trace/DGJRSZ traceability/U traceable/P traceably traceback/MS traced/AU traceless/Y tracepoint/MS tracery/D trachea tracheae tracheal tracheary tracheate/D tracheid tracheidal tracheitis tracheobronchial tracheolar tracheole tracheophyte tracheostomy tracheotomy trachoma trachomatous trachyte trachytic track/DGRSZ trackage tracked/U tracklayer tracklaying trackless trackman trackside tracksuit trackwalker tract/MSV tractability/I tractable/AI tractableness tractably tractarians tractate tractile traction tractional tractor/AMS tractorisation/MS tractorise/S tractorization/MS tractorize/S trad tradable trade/DGRSZ tradeability tradeable trademark/MS tradeoff/S tradescantia tradesman tradesmen tradespeople tradevman tradition/MS traditional/Y traditionalise/S traditionalised traditionalism traditionalistic traditionalists traditionalize/S traditionalized traditionary traditionise/S traditionize/S traditionless traditor tradtionalist traduce/DGR traducement traducianism trafalgar traffic/MS trafficable trafficked trafficker/MS trafficking tragacanth tragedian/S tragedienne tragedy/MS tragi tragic tragical tragically tragicise/S tragicize/S tragicomedy tragicomic tragicomical tragopan tragus traherne trail/DGJRSZ trailblaze trailblazer/MS trailblazing trailbreaker trailerable trailerist trailerite trailership trailhead/MS trailless trailside train/DGRSZ trainability trainable/A trainband trainbearer trained/AU trainee/MS traineeship traineeships trainferry trainful trainload/MS trainman/M trainmen trainsick traipse/G trait/MS traitor/MS traitoress traitorise/S traitorize/S traitorous/Y traitress trajan traject trajection trajectory/MS tral/A tralee tram tramcar tramline trammel/S trammeled trammeler/S trammeling trammelled trammeller/S trammelling trammie tramming tramontane tramp/DGRS trample/DGRS trampoline/GR trampolinist tramroad tramway trance/GMS trancelike tranformed trangam tranmission tranmitted trannie tranquil/PY tranquilisation/MS tranquilise/DGJRSZ tranquilised/U tranquiliser/MS tranquilises/A tranquilising/MSY tranquility tranquilization/MS tranquilize/DGJRSZ tranquilized/U tranquilizer/MS tranquilizes/A tranquilizing/MSY tranquillisation tranquillise/DGRSZ tranquillity tranquillization tranquillize/DGRSZ transact/DGS transactinide transaction/MS transactional transactor transalpine transaminase transamination transatlantic transaxle transcalent transceiver/MS transcend/DGS transcendence transcendency transcendent/Y transcendental/Y transcendentalise/S transcendentalism transcendentalist transcendentalists transcendentalize/S transconductance transcontinental transcribe/DGRSZ transcript/MS transcription/MS transcriptional/Y transcultural transculturation transcurrent transcutaneous transduced transducer/S transducing transduction transductional transect/DGS transection transept/S transeptal transfer/DMS transferability transferable transferal/MS transferase transferee transference transferential transferor/S transferral/MS transferred transferrer/MS transferring transfiguration transfigure transfinite transfix/DGS transfixion transform/DGRSZ transformable transformant/S transformation/MS transformational transformationalist transformative transformed/U transformism transfusable transfuse/DGNX transfusible transfusional transglottal transgranular transgress/DGSV transgression/MS transgressor/S tranship transhumance transhumant transience transiency transient/SY transilient transilluminate/N transilluminator transistor/MS transistorisation transistorise/DGS transistorization transistorize/DGS transit/V transitio transition/DS transitional/Y transitive/IPY transitivity transitorily transitory/P transkei translatability translatable translate/DGNSVX translated/AU translational translator/MS translatory transliterate/N transliterator translocate/N translucence translucency translucent/Y translunar transmarine transmembrane transmigrant transmigrate/N transmigrator transmigratory transmissibility transmissible transmission/AMS transmissive transmissivity transmissometer/MS transmit/AS transmittable transmittal transmittance transmittancy transmitted/A transmitter/MS transmitting/A transmogrify/N transmontane transmountain transmundane transmutable transmutation transmutative transmute/DGS transnational transnatural transoceanic transom/S transonic transpacific transpadane transparence transparency/MS transparent/PY transparentise/S transparentize/S transpassive transpersonal transpicuous transpierce transpiration/S transpire/DGS transplacental/Y transplant/DGRS transplantability transplantable transplantation transpolar transpond/Z transponder transpontine transport/DGRSZ transportability transportable transportaion transportation/S transportational transposable transpose/DGS transposed/U transposition transpositional transput/RZ transsexual transsexualism transshape transship/S transshipment transshipped transshipping transthoracic transthoracically transubstantial transubstantiate/N transudate/N transude/DG transuranic transuranium transvaluate/N transvalue transversal/Y transverse/SY transvestism transvestite transvestitism transylvania tranverse trap/MS trapan trapani trapdoor/S trapes trapeze trapeziform trapezist trapezium trapezius trapezohedron trapezoid/MS trapezoidal trapnest trappean trapped trapper/MS trapping/S traprock trapshooter trapshooting trapunto trash/DGRS trashman trashy/PR trasimene trass trattoria trauma/S traumata traumatic traumatically traumatisation traumatise/DGS traumatism traumatization traumatize/DGS travail/S travancore trave travel/S traveled traveler/MS traveling/S travelled traveller/MS travelling/S travelog/MS travelogue/MS traversable traversal/MS traverse/DGRS travertine travesty/MS travois/S trawl/R trawlerman tray/MS trayal trayful traymobile treacherous/PY treachery/MS treacle treacly tread/DGRS treadle/DG treadless treadmill treadwell treason treasonable treasonably treasonous treasurable treasure/DGRS treasurership treasury/MS treat/DGRSZ treatability treatable treated/AU treatise/MS treatment/MS treaty/MS trebizond treble/DGS trebly trebuchet trebucket trecento tred tredecillion tree/DMS treece treehopper treeing treeless treelike treen treenail treename/S treenware treetop/MS tref trefoil trehala trehalase trehalose treillage treitschke trek/MS trekked trekker trekking trellis/DS trelliswork trematode tremble/DGRS trembly tremendous/PY tremolant tremolite tremolitic tremolo tremor/MS tremulant tremulous/PY trenail trench/DRSZ trenchancy trenchant/Y trencherman trenchermen trend/GS trendily trendy/PR trengganu trente trento trepan/S trepanation trepang trepanned trepanning trephination trephine/DG trepid trepidant trepidation treponema treponemal treponematosis treponematous treponeme trespass/DRSZ tress/DMS tressel tressure trestle/S trestletree trestlework tret trevally trevithick trews trey/S tri/S triable/P triac triacetate triacid triad triadic triadically triage trial/MS trialisation trialization trialogue triamcinolone triangle/MS triangular/Y triangularisation/S triangularise/DGS triangularity triangularization/S triangularize/DGS triangulate/DNY triarchy triatomic triaxial triaxiality triazine/S triazole trib tribade tribal/Y tribalism tribasic tribe/MS tribesman tribesmen triblet triboelectric triboelectricity tribological tribologist tribology triboluminescence triboluminescent tribophysics tribrach tribrachic tribromide tribromoethanol tribulate/NX tribulation/MS tribunal/MS tribunate tribune/MS tribuneship tributary tribute/GMS tricarbonyl tricarboxylic tricarpellary tricarpellate trice/G tricentenary triceps/S triceratops trichiasis trichina trichinal trichinise trichinize trichinopoly trichinosis trichinous trichite trichlorfon trichloride trichloro trichloroacetic trichloroethane trichloroethanol trichloroethylene trichocyst trichocystic trichogyne trichoid trichology trichome trichomic trichomonacidal trichomonacide trichomonad trichomonadal trichomonal trichomoniasis trichopteran trichosis trichotomous/Y trichotomy trichroism trichromat trichromatic trichromatism trichrome trichuriasis trick/DGRS trickery/S trickily trickish/PY trickle/DGS trickster tricksy/PR tricktrack tricky/PRT triclad triclinic triclinium tricolette tricolor/DMS tricolour/DMS tricorn tricorne tricornered tricostate tricot tricotine tricotyledonous tricritical tricriticality tricrotic trictrac tricuspid tricycle/S tricyclic tricyclohexyl tridactyl trident/S tridentate tridentum tridiagonal tridimensional tridimensionality triduum triecious tried/AU triene triennial/Y triennium trierarch trierarchy trieste triethyl trifacial trifid trifle/DGRS trifluoride trifluralin trifocal trifold trifoliate trifoliolate trifolium triforium triform trifurcate/N trig trigeminal trigger/DGS triggerfish triggerman trigging triglyceride/S triglyph triglyphic triglyphical trigon trigonal/Y trigonometric trigonometrical/Y trigonometry trigonous trigram/S trigraph trigraphic trihedral trihedron trihybrid trihydrate trihydric trihydroxy triiodomethane triiodothyronine trijet trike trilateral/Y trilaterality trilateration trilby/S trilemma trilinear trilingual/Y triliteral triliteralism trilithon trill/DR trillion/HS trillionise/S trillionize/S trillium trilobate/N trilobed trilobite trilocular triloculate trilogy trim/PRSY trimaran trimble trimeric trimerisation/MS trimerization/MS trimerous trimester trimestral trimestrial trimeter trimethadione trimetric trimetrogon trimmed trimmer trimmest trimming/S trimolecular trimonthly trimorph trimorphic trimorphism trimorphous trimotor trimurti trinacria trinal trinary trincomalee trindle/DG trine trinitarian/S trinitrobenzene trinitrocresol trinitroglycerin trinitrophenol trinitrotoluene trinity trinket/DMRS trinketry trinkums trinocular trinomial trinucleotide trio/S triode/S trioecious triol triolein triolet triose trioxide trip/MSY tripack tripalmitin tripartite/N tripe tripersonal triphammer/MS triphenyl triphenylarsine triphenylmethane triphenylphosphine triphenylstibine triphibian triphibious triphosphate triphosphopyridine triphthong triphthongal tripinnate/Y triplane triple/DGS triplet/MS tripletail triplex triplicate triplicity triplite triploblastic triploid triploidy triply/N tripod/S tripodal tripody tripoli tripolitania tripolyphosphate tripos tripped tripper trippet tripping/Y triptane tripterous triptolemus triptych triptyque tripura tripwire triquetrous triradiate trireme trisaccharide trisect trisection trisector triserial triskaidekaphobia triskele/N trismegistus trismus trisoctahedron trisodium trisome trisomic trisomy tristate triste tristearin tristeza tristful/PY tristich tristichous tristimulus trisubstituted trisulfide trisulphide trisyllabic trisyllabicall trisyllable trit tritanopia trite/PRTY tritheism tritheist tritheistic tritheistical trithing tritiate tritiated triticale tritium/M tritoma triton tritone triturable triturate/N triturator triumph/DG triumphal triumphant triumphantly triumphs triumvir triumviral triumvirate triune triunitarian trivalent trivalve trivandrum trivet trivia trivial/Y trivialisation trivialise/DGS triviality/S trivialization trivialize/DGS trivium triweekly troas troat trobriand trocar trochaic trochal trochanter trochanteral trochanteric trochar troche trochee trochelminth trochilus trochlea trochlear trochoid trochoidal trochophore trod/U trodden/U trode troff/MR trog troglodyte troglodytic trogon trograd troika troilism troilite troilus trois troll/MS trolley/DMS trolleybus trollop trollope trolly/DS tromba trombidiasis trombone/MS trombonist trommel tromp trona trone troop/DGRSZ troopship/S troostite trop tropaeolin tropaeolum trope tropez trophallaxis trophic trophically trophoblast trophoblastic trophoplasm trophozoite trophy/DGMS tropic/MS tropical/Y tropicalisation/MS tropicalise/DGS tropicalization/MS tropicalize/DGS tropicbird tropidoclonion tropine tropism/S tropistic tropocollagen tropologic tropological/Y tropology tropomyosin tropopause tropophilous tropophyte troposphere tropospheric tropotaxis troppo tropylium trossachs trot/S troth trothplight trotline trotsky trotskyism trotskyist trotted trotter trotting trotyl troubador troubadour/MS trouble/DGRS troubled/U troublemaker/MS troubleshoot/DGRSZ troubleshot troublesome/PY troublous/PY trough troughs trounce/DGS troupe/GRS troupial trouse trouser/DS trousseau/S trousseaux trout/S trouty/R trove/R trow trowel/MS troweled troweler/S troweling trowelled troweller troweller/S trowelling troy troyes truancy truant/MS truantry truce/G trucial truck/DGRSZ truckage truckee truckie truckle/DGR truckline truckload/MS truckman truckmaster truculence truculency truculent/Y trudge/DGRS trudgen true/DGPRST trueborn truehearted/P trueing truelove truepenny truffle/DMS trug/S truism/MS truistic trujillo truk trull truly/U trumeau trump/DS trumpery trumpet/DGRS trumpetlike trumpetweed truncate/DGNSX truncation/MS truncheon/S trundle/DGRS trunk/DMS trunkfish trunkful trunnel trunnion/S truss/GRS trust/DGRS trustability trustable trustbuster trusted/U trustee/DMS trusteeing trusteeship trustful/PY trusting/Y trustless trustworthily trustworthiness/U trustworthy/P trusty/PRS truth/U truthful/PUY truths try/ADGRSZ trying/Y tryma tryout trypanosome trypanosomiasis tryparsamide trypsin trypsinise/S trypsinize/S trypsinogen tryptamine tryptic tryptophan tryptophane tryptophanyl trysail tryst trytophan tryworks tsade tsana tsar tsarevich tsarevitch tsarevna tsarina tsarism tsarist tsaritsyn tselinograd tset tsetse/S tshiluba tshombe tsinan tsinghai tsingtao tsingyuan tso tsonga tsotsi tsugaru tsukahara tsunami tsunamic tsunematsu tsushima tsutsugamushi tswana tty/M ttys tuart tuatara tub/MS tuba tubal tubate tubbable tubbed tubber tubbing tubby/R tube/DGRSZ tubeless tubelike tubercle/D tubercular/Y tuberculate/DN tuberculin tuberculinisation/MS tuberculinise/S tuberculinization/MS tuberculinize/S tuberculoid tuberculosis tuberculous/Y tuberisation/MS tuberise/S tuberization/MS tuberize/S tuberose tuberosity tuberous tubful tubifex/S tubificid tubman tubocurarine tubuai tubular/Y tubularity tubule/S tubuliflorous tubulisation/MS tubulization/MS tubulous tuchun tuck/DGRS tuckahoe tucker/DG tucket tucotuco tuebor tuel tufa tufaceous tuff tuffaceous tuffet tuft/DMRS tufty tug/S tugboat tugela tugged tugger tugging tugrik tui tuileries tuille tuition/IS tuitional/I tula tularaemia tularemia tularemic tulation tulatory tule tulip/MS tulipwood tull tulle tullibee tully tum tumble/DGRSZ tumblebug tumbledown tumblehome tumblerful tumbleweed tumbrel tumbrels tumbril tumefaciens tumefacient tumefaction tumefactive tumefy tumescence/I tumescent/I tumid/Y tumidity tummy/MS tumor/DMS tumoral tumorigenic tumorigenicity tumorlike/MS tumorous tumour/DMS tump tumpline tumular tumulose tumult/MS tumultuary tumultuous/PY tumulus tun tuna/S tunability tunable/P tunably tundish tundra tune/DGJRSZ tuneable tuneful/PY tuneless tunelessly tunesmith tung tungstate tungsten tungstic tungstite tungstous tungting tunguska tunic/MS tunica tunicae tunicate/D tunicle tuning/MS tunnage tunnel/S tunneled tunneler/S tunneling/S tunnelled tunneller tunneller/S tunnellike tunnelling tunnelling/S tunny tup tupamaro tupelo tuple/MS tuppence tuppenny tupping tupungato tuque turaco tural turban/DMS turbanned turbary turbellarian turbid/PY turbidimeter/MS turbidimetric turbidimetrically turbidimetry turbidite turbidity turbinal turbinate/DS turbine/S turbit turbjet turbo/S turbocar turbocharge/R turboelectric turbofan turbogenerator turbojet turboprop turboshaft turbosupercharged turbosupercharger turbot/S turbulence/M turbulency turbulent/Y turd turdine ture/DN tureen turenne turf turfman turfski/G turfy turgenev turgent turgescence turgescent turgid/PY turgidity turgite turgor turgot turishcheva turk/S turkestan turkey/MS turku turmeric turmoil/MS turn/DGJRSZ turnable/A turnabout turnaround/S turnbuckle turncoat turncock turndown turnery turnip/MS turnkey/S turnoff turnout/S turnover/S turnpike/S turnround turnsole turnspit turnstile turnstone turntable turnup turnverein turpentine turpentinic turpentinous turpeth turpin turpitude turps turquois turquoise turret/DMS turtle/GMS turtleback/S turtledove turtlehead turtleneck turves turvy tusche tusculum tush tusk/RSZ tusklike tussah tussaud tussis tussive tussle/DGS tussock/S tussocky tussore tut tutankhamen tutee/S tutelage tutelar tutelary tutiorism tutor/DGS tutorage tutored/U tutoress tutorial/MS tutorisation/MS tutorise/S tutorization/MS tutorize/S tutorship tutoyer tutsan tutsi tutti tutty tutu tutuila tuva tux tuxedo/DMS tuxtla tuyere tver twaddle/DGRS twae twain twang/G twangy twas twat twattle twayblade tweak/DGRS twee tweed tweeddale tweedledum tweedsmuir tweedy/PR tween tweeny tweet/R tweeze/DG tweezer/S twelfth twelfths twelve/S twelvefold twelvemo twelvemonth twenty/HS twentyfold twerp twice twiddle/DGS twig/MS twigged twigging twiggy twilight/MS twilit twill/DG twin/DGMRS twinberry twinborn twine/DGRS twinflower twinge/GS twingeing twinkle/DGRS twinkly twinning twinship twiny twirl/DGRS twirling/Y twirly twirp twist/DGRSZ twisted/U twisty twit twitch/DGR twitchily twitchy twite twitted twitter/DGR twittery twitting twixt two/MS twofer twofold twohandedness twopence/S twopenny twosome tychism tycho tycoon tye tying/U tyke/MS tylopod tylosis tymbal tympan tympani/MS tympanic tympanist tympanites tympanitic tympanitis tympanum/M tympany tyndall tyndareus tyne/MS tyne/S tynemouth tyneside typal type/DGMRS typeable typeahead typebar typecase typecast typed/AU typedef/S typeface typefounder typefounding typefoundry typeout typescript typeset/S typesetter/S typesetting typewrite/G typewriter/MS typewritten typey typhlitis typhlology typhlosole typhoeus typhogenic typhoid typhoidin typhoon typhus typic typical/PY typicality typify/DGNS typist/MS typo typograph typographer typographic typographical/Y typography typological/Y typologist typology/S typos typothetae typy/R tyr tyramine tyrannic tyrannical/PY tyrannicide tyrannise/DGJRSZ tyrannising/MSY tyrannize/DGJRSZ tyrannizing/MSY tyrannosaur tyrannosaurus tyrannous/Y tyranny tyrant/MS tyre/MS tyro/S tyrocidin tyrocidine tyrosinase tyrosine tyrothricin tyumen tzaddik tzaddikim tzar tzekung tzetze tzigane tzimmes tzitzis ubbelohde ubiety ubiquitous/PY ubiquity ucayali ucca uccello udaipur udal udall udder udine udmurt udo udometer uele ufa ufd ufo ufology ugali ugaritic ugh ugli uglify/N uglily ugly/PRT uhlan uintathere ukulele ulama ulcer/DGMS ulcerate/DNSVX ulcerogenic ulcerous uldered ulema ulexite ulfilas ullage ulmaceous ulna/M ulnar ulotrichous ulotrichy ulpian ulster ulterior/Y ultima ultimacy ultimate/PY ultimatum ultimo ultimogeniture ultra ultrabasic ultracentraliser/MS ultracentralizer/MS ultracentrifugal ultracentrifugally ultracentrifugation ultracentrifuge ultraconservative ultrafashionable ultrafast ultrafiche ultrafilter ultrafiltration ultrahigh ultrahonorable/MS ultrahonourable/S ultraism ultraist ultraistic ultramafic ultramarine ultramicro ultramicrometer/S ultramicroscope/S ultramicroscopic ultramicrotome/S ultramicrotomy ultramodern ultramodernist ultramontane ultramontanism ultramundane ultranationalism ultranationalist ultrapure/Y ultrared ultrasecret ultrashort ultrasonic/S ultrasonically ultrasonicate/DGS ultrasound ultraspecialisation/MS ultraspecialization/MS ultrastandardisation/MS ultrastandardization/MS ultrastructural/Y ultrastructure ultrathin ultraviolet ultravirus ultrawet ululant ululate/N ulva umayyad umbel umbellate umbellifer umbelliferous umbellule umber/DG umberto umbilical umbilicate/DN umbilici umbilicus/S umbles umbo umbonate umbones umbos umbra umbrae umbrage umbrageous/PY umbral umbrella/MS umbria umiak umlaut ump umpirage umpire/DGMS umpteen/H umpy umrcc umtali un unabashed/Y unabated/Y unable unacceptable unaccountability unaccountable unaccustomed/Y unacknowledged unadapted unadulterated/Y unadventurous unaesthetic unaggressive unagonise unagonize unalcoholised/MS unalcoholized/MS unalienability unalienable unallocateed unalterable/P unalterably unamazed unambiguity unambiguous/Y unambitious unamuno unamused unamusing unanchor unaneled unanimalised/MS unanimalized/MS unanimity unanimous/Y unanswerably unantagonisable/S unantagonizable/MS unanticipated/Y unapologetic unapostatised/MS unapostatized/MS unappeasable unappeasably unappreciation unapproachably unarm unary unaskable unassailability unassailable/P unassailably unassertive unassign unassuageable unassuming/P unasterisked unattach unattainability unattainable unauthorise unauthorised/PY unauthorize unauthorized/PY unavailability unavailable unavailing/PY unaverage unaware/PSY unbalance unballasted unban unbandage unbaptise unbaptize unbar unbeautiful unbecome unbecoming/PY unbeknown unbeknownst unbelief unbeliever unbelieving/Y unbelt unbend/G unbent unbeseeming unbiased/P unbiblical unbid unbind unbirthday unblenched unblessed unblinking/Y unblock/DGS unbolt unbonnet unbosom unbound/D unbounded/P unbox unbrace unbraid unbreakable unbridle unbroke unbroken unbrutalise unbrutalize unbrutise/S unbrutize/S unbuckle unbudgeable unbudgeably unbudging/Y unbuild unbundle unburden unbutton/G uncage uncalculated uncandid uncanny/P uncanonise/S uncanonize/S uncantonised/MS uncantonized/MS uncap uncatechised/MPS uncatechized/MPS uncatholicise/S uncatholicize/S uncauterised/MS uncauterized/MS unceasing/Y uncelebrated uncelestialised/MS uncelestialized/MS uncertain/PY unchain unchallengeable unchancy unchangeable unchangealeness unchanging/PY uncharacteristic uncharge unchaste/PY unchivalrous unchloridised/MS unchloridized/MS unchoke unchristian unchristianise/DS unchristianize/DS unchurch uncial/Y unciform uncil uncinaria uncinariasis uncinate uncinus uncircularised/MS uncircularized/MS uncircumcision uncivilise uncivilised/PY uncivilize uncivilized/PY unclad unclamp unclasp unclasping unclassical uncle/MS unclean/PY uncleanly/P unclear/D unclench unclimbable/P unclinch uncloak unclog unclose unclothe unclouded/Y unclutter unco uncock uncodable uncodeable uncoffin/D uncoil uncoiling uncolonise uncolonize uncolorable/MS uncolored/PSY uncolourable/S uncoloured/PSY uncombable uncomfortable uncomment/GS uncommercial uncommon/PY uncommunicative uncompassionate uncompetitive/P uncomplicated uncomprehending/Y uncompromisable unconcern unconcerned/PY unconditional/Y unconfirmed uncongenial unconnected unconquerably unconscionability unconscionable/P unconscionably unconscious/PY unconservative unconstrained unconstraint uncontroversial unconventionalise/S unconventionalize/S uncool/D uncooperative uncork uncorseted uncouple/R uncourageous uncousinly uncouth/PY uncover/DGS uncritical uncross uncrown uncrumple unction/I unctuous/PY uncurl uncurricularised/MS uncurricularized/MS uncus uncut undated undauntable undaunted/Y undebatably undeceive undecided undedicated undefence/M undefense/M undefinability undefine undefined/P undelete/D undeliverability undeliverable undemocratise undemocratize undeniable/P undeniably undependable under/Y underachieve underachievers underact underactivity underadjusting underage underarm underbedding underbelly underbid underbidder underbody underbracing underbred underbrim underbrush underbuy undercapitalisation/MS undercapitalise/DGS undercapitalization/MS undercapitalize/DGS undercarriage undercart undercharge underclass underclassman underclassmen underclay underclothes underclothing undercoat/G undercolor/DGJMS undercolour/DGJMS underconsumption undercook undercooked undercool undercount/S undercover undercroft undercurrent undercut undercutting underdevelop underdeveloped underdevelopment underdo underdog underdone underdrawers underdress/D undereducated undereducation underemphasis underemphasise/DGS underemphasize/DGS underemployed underemployment underenumerated underenumeration underestimate/DGNSX underexpose underexposure underfeed underfelt underfilled underfloor underflow/DGS underfoot underfur undergarment undergarments undergird undergirding underglaze undergo/G undergoes undergone undergrad/MS undergraduate/MS underground/R undergrown undergrowth underhand underhanded/PY underheat underhung underinsurance underlaborer/MS underlabourer/MS underlaid underlay underlayment underlet underletting underlie/S underline/DGJS underlinen underling/MS underlip underly/GS undermanned undermentioned undermine/DGS undermost underneath undernourish undernourished undernourishment undernutrition underorganisation/MS underorganization/MS underoxidise/S underoxidize/S underpaid underpainting underpants underpart underpass/S underpay underpayment/MS underpin underpinned underpinning/S underpins underpitch/DGS underplay/DGS underplot/S underpopulated underpowered underprice/DGS underprivileged underproduction underproductive underproof underprop underquote underrate/D underrealise/S underrealize/S underregistration underreport underreported underreporting underrepresentation underrepresented underripe underrun undersaturated undersavior/MS undersaviour/MS underscore/DS undersea/S underseal undersecretariat undersecretary/MS undersell underset undersexed undersheriff undershirt/MS undershoot/GS undershorts undershot undershrub underside/MS undersigned undersize/DGS underskirt underslung undersmooth/DG undersmooths undersong underspent underspin understaff understaffed understand/GJS understandability understandable understandably understanding/SY understate/GS understated understatement/S understeer understood understory understrapper understrength understructure/MS understudy/MS undersupply undersurface undertake/GJRSZ undertaken undertaker/MS undertenant underthrust undertint undertone undertook undertow/MS undertrick undertrump undertype underused underutilisation underutilise underutilised underutilization underutilize underutilized undervaluation undervalue/G undervalued undervitalised/MS undervitalized/MS underwaist underwater underway underwear underweight underwent underwhelm/DGS underwing underwood underwool underworld underwrite/GRSZ undeserved undetermined undeviating/Y undialectical undialysed/MS undialyzed/MS undine undiplomatic undirectional undiscolored/M undiscoloured/M undo/GJR undock undogmatic undouble undoubted/Y undramatic undramatised/MS undramatized/MS undrape undraw undress/DGS undro undrunk undset undue undulant undulate/DGNSX undulatory undumper/M une unearth/DG unease uneasy/P uneconomic uneconomical uneducated unemployment unenamored/MS unenamoured/MS unencroachable unending/Y unendurable/P unenergised/MS unenergized/MS unenviable unequal/Y unequalise unequalize unequivocably unequivocal/Y unessential uneulogised/MS uneulogized/MS unevangelised/MS unevangelized/MS uneven/PY uneventful/Y unexceptionable/P unexceptional unexcited unexpressive unextended unfaded unfading/Y unfailing/PY unfair/PY unfaithful/PY unfamiliar/Y unfamiliarity unfancy unfashionable unfasten unfathomable unfavored/M unfavoring/M unfavoured/M unfavouring/M unfeeling/PY unfeigned/Y unfelt unfertile unfetter unfeudalise/DS unfeudalize/DS unfit/PY unfitting unfix unfixed unflappability unflappable unflinching/Y unfold/DGS unfoldment unforced unforgeable unforgettability unforgiving/P unfortunate/SY unfossilised/MS unfossilized/MS unfraternising/MS unfraternizing/MS unfreeze unfriended unfriendly/P unfrock unfrocking unfrozen unfussy ungainly/P ungallant ungalvanised/MS ungalvanized/MS ungaretti ungava ungelatinised/MS ungelatinized/MS ungenerosity ungenerous ungird unglamorous unglue ungodly/P ungospelised/MS ungospelized/MS ungracious ungrammatical ungraphitised/MS ungraphitized/MS ungrudging ungual unguard unguent unguessable unguiculate unguinous unguis ungula ungulate unguligrade unhair unhallow/D unhand unhandsome unhandy/P unhappy/PRT unharbor/DM unharbour/DM unharmonious unharmonise unharmonize unharness unhealthy/P unheated unhelpful unheroise/S unheroize/S unhesitant unhinge unhitch/GS unholy/P unhonorable/M unhonourable unhood unhook/DG unhorse/D unhouselled unhurried unhurt unhydrolysed/MS unhydrolyzed/MS unhypnotise/S unhypnotize/S uni unialgal uniaxial/Y unibus unibuss unicameral/Y unicef unicellular unicellularity unicolour unicorn/MS unicostate unicycle unicyclist unideal unidimensional unidirection unidirectional/Y unidirectionality unidolised/MS unidolized/MS unifactorial unifiable unifilar unifoliate unifoliolate uniform/DGPSY uniformally uniformisation/MS uniformise/S uniformitarian uniformitarianism uniformity/S uniformization/MS uniformize/S unify/DGNRSXZ unijugate unilateral/Y unilateralisation/MS unilateralise/S unilateralist/S unilateralization/MS unilateralize/S unilinear unilingual uniliteral unilluminating unillusioned unilocular unimaginable unimaginative unimak unimmortalise/S unimmortalize/S unimodal unimodular unimpeachable unimpeachably unimportant unimposing unimpressive unindividualise unindividualize unindustrialised/MS unindustrialized/MS uninfluential uninformative uninhibited/PY uninitiate uninominal unintelligence unintended uninterested uninteresting/Y uninterruptable uninterrupted/PY uninucleate uninvolved union/AMS unionisation unionise/DGRSZ unionism unionist/S unionization unionize/DGRSZ uniparental/Y uniparous unipersonal uniplanar uniplex unipod unipolar unipolarity uniprocessor/MS unique/PY uniramous uniseptate uniserial unisex unisexual/Y unisexuality unison unit/MS unitage unital unitarian/S unitarianism unitarily unitarity unitary unite/DGRSV united/Y uniterm unitisation unitise/GS unitised unitization unitize/GS unitized unity/MS univalent univalve/MS univariate universal/PSY universalisation/MS universalise/DGRSZ universalism universalist universalistic universality universalization/MS universalize/DGRSZ universe/MS university/MS univocal/Y unjam unjust/PY unkempt unkenned unkennel unkind/PY unkindly/P unknown/S unlabialise/S unlabialize/S unlabored/M unlaboring/M unlaboured/M unlabouring/M unlace unlacing unlash unlatch unlay unlead unlearn/D unleash/DGS unless unlettable unlike/PY unlikely/P unlimber/DG unlimited/Y unlink/DGS unliterary unlive unload/DGRSZ unlocalise unlocalize unlock/DGS unloose unloosen unlovely/P unlucky/P unmagnetised/MS unmagnetized/MS unmake unmalicious unman unmanageable unmanageably unmanly/P unmannered/Y unmarried/S unmask unmate/G unmeaning unmeasured unmechanise unmechanize unmediatised/MS unmediatized/MS unmeet unmemorable unmemorialised/MS unmemorialized/MS unmentionable/S unmercerised/MS unmercerized/MS unmerciful/Y unmeritorious unmesmerise/S unmesmerize/S unmet unmetalized/MS unmetallised/MS unmethodical unmethodised/MS unmethodising/MS unmethodized/MS unmethodizing/MS unmindful unmineralised/MS unmineralized/MS unmissionised/MS unmissionized/MS unmistakably unmitigatd unmitigated/PY unmobilised/MS unmobilized/MS unmodeled unmodernise unmodernize unmodifiable unmonopolise/GJ unmonopolize/GJ unmoor unmoral unmoralise/DGJS unmorality unmoralize/DGJS unmount/D unmountable unmoving unmuffle unmunicipalised/MS unmunicipalized/MS unmusical unmutualised/MS unmutualized/MS unmuzzle unmyelinated unnail unnatural/PY unnaturalisable/S unnaturalise/S unnaturalizable/MS unnaturalize/S unnecessary unnerve/DGS unnerving/Y unnitrogenised/MS unnitrogenized/MS unnormalise/G unnormalize/G uno unobservable/S unofficial/Y unoptimise/G unoptimize/G unorganized/PY unorthodox unoxygenised/MS unoxygenized/MS unpack/DGRS unpackage/G unpaddable unpaganise/S unpaganize/S unpaintable unpalatable unparagonised/MS unparagonized/MS unparalysed/MS unparalyzed/MS unparticularised/MS unparticularising/MS unparticularized/MS unparticularizing/MS unpartisan unpatronising unpatronizing unpauperised/MS unpauperized/MS unpeg unpeople unperfect unperson unperturbed/Y unphilosophise unphilosophize unphosphatised/MS unphosphatized/MS unphysical unpick unpicturesque unpile unpin unplagiarised/MS unplagiarized/MS unplowed unplug unpoeticised/MS unpoeticized/MS unpoetise/DS unpoetize/DS unpolarised/MS unpolarized/MS unpolitic unpolitical unpolymerised/MS unpolymerized/MS unpopular unpopularise unpopularize unprecedented/Y unpreemphasized unpregnant unpremeditated unprepared unprepossessing unprincipled/P unprocurable unproductive unprofessed unprofessional unpronounced unprotestantise/S unprotestantize/S unprovable unproven unprovocative unpulverise unpulverize unquestionable unquestioning unquiet/PY unquote unradicalise/S unradicalize/S unrancored/MS unrancoured/MS unravel/S unraveled unraveling unravelled unravelling unreactive unread unreadable unready/P unreal unrealisable unrealise/GJ unreality unrealizable/MS unrealize/GJ unreason/G unreasoning/Y unreceptive unreckonable unrecognised unrecognized unreconnoitered/MS unreconnoitred/MS unrecordable unredeemable unreel unreeling unreeve unreflective unregenerate unrelated unrelenting/Y unreliable unrelieved unreligious unremarkable unremitting/Y unrepair unrepentant unreported unrepresentative unreserve unrest unrestrained/PY unrestraint unrestrictive unrewarding unriddle unrig unrip unripe/P unrobe unroll/DGS unromantic unromanticised/MS unromanticized/MS unroof unroot unrotate unround/D unroyalised/MS unroyalized/MS unruly/P unrwa unsaddle unsafe/Y unsafety unsatirise/D unsatirize/D unsatisfactory unsatisfying unsaturate unsavored/PY unsavory/MPS unsavoured/PY unsavoury/MPS unsay unscandalise/S unscandalize/S unscathed unscepter/DM unsceptre/M unschematised/MS unschematized/MS unscrew/DG unseal/G unseam unsearchably unseat unsectarianise/S unsectarianize/S unsecularise/S unsecularize/S unsee unseemly unsel unselective unselfconscious/P unsensitise/S unsensitize/S unsensualise/DS unsensualize/DS unsentimentalise unsentimentalize unsepulcher/D unsepulchre unserviceable unservile unset unsettle unsettled/P unsettlement unsettling/Y unsew unsex unshackle unshed unshell unshift unship unshockability unshockable unshped unsight/D unsightly unsignalised/MS unsignalized/MS unsinkable unsiphon/M unskilful unsling/DG unsnarl unsociable/P unsold/R unsolemnise/DS unsolemnize/DS unsophisticated unsound/DPY unspeak unspeakably unspeaking unspecifed unspecific unspecify unspectacular unsphere unspiritualise/DS unspiritualize/DS unstable/P unstate unsteady/P unsteel unstep unstick unstigmatised/MS unstigmatized/MS unstilted unstinting/Y unstoicise/S unstoicize/S unstop unstoppably unstrap unstring unstudied unstuffy unsubstantial unsubtle unsuccess unsuccessful/Y unsuggestive unsuitable unsulphurised/MS unsulphurized/MS unsupernaturalise/DS unsupernaturalize/DS unsupportive unsure unsurmountable unswathe unswear unsymmetrical unsymmetrised/MS unsymmetrized/MS unsympathisability/MS unsympathisable/S unsympathizability/MS unsympathizable/MS unsyphon/M unsystematic unsystematised/Y unsystematized/Y untangle untantalising/MS untantalizing/MS untartarised/MS untartarized/MS unteach untellable untemporising/M untemporizing/M untenable untenanted unter unterwalden untether unthaw untheorisable/S untheorizable/MS unthink unthinkability unthinkable unthinking unthought unthread unthrone untidy/P untie/DS until untimely/P untimeous untouchability untouchable/MS untoward/PY untraceable untraditional untrammeled untrammelled untravelled untread untrue untruss untuck untune untwine untwist untypical unusual/PY unutterably unvaporised/MS unvaporized/MS unvarying unvitalised/MS unvitalized/MS unvitriolised/MS unvitriolized/MS unvocal unvocalised/MS unvocalized/MS unvoice unvolatilise/DS unvolatilize/DS unvulcanised/MS unvulcanized/MS unvulgarise/DS unvulgarize/DS unwaivering unwarrant unwarrantable unwary/P unwashed/P unwearied/Y unweave unwed unweeting/Y unweight unweighted unwelcome unwell unwesternised/MS unwesternized/MS unwholesome/Y unwieldily unwieldy/P unwilling/PY unwind/GRSZ unwire unwisdom unwise/RTY unwish/D unwitting/Y unwomanise unwomanize unwomanly unworkable unworthy/P unwound/D unwrap/S unwrapping unwreathe unyielding/Y unyoke unzio unzip up/S upanishad uparrow upas upbeat upbraid/R upbring upbringing upbuild/R upcast upchuck upcome/G upcountry update/DGRS updo/S updraft updraught upend upfield upgrade/DGS upgrowth upheaval/S upheave/R upheld uphill uphold/GRSZ upholster/DGRSZ upholstering/A upholstery uphoster uphroe upkeep upland/RS uplift/DGRS upload/DGS upmanship upmost upolu upon upped upper/S upperbound/S uppercase/DGS upperclassman upperclassmen uppercut uppermost upperpart upping uppish/PY uppity uppityness uppsala upraise/D uprear upright/PY uprise/R uprising/MS upriver uproar uproarious/PY uproot/DGRS uprouse uprush upsadaisy upsala upset/S upsetter upsetting upshift upshot/MS upside/S upsilon upslope upspring upstage/DGS upstairs upstand upstanding/P upstart upstate/R upstream upstretched upstroke upsurge upsweep upswell upswept upswing/S uptake upthrow upthrust uptight/P uptilt uptime upto uptown uptrend upturn/DGS upward/PSY upwell upwind uracil uraei uraemia uraeus uralite uralitic uranalysis uranic uranide uraninite uranism uranite uranium uranographic uranographical uranography uranological uranology uranometry uranous uranyl urate uratic urban urbane/Y urbanisation/MS urbanise/GS urbanised urbanism urbanist urbanistic urbanistically urbanite/S urbanity urbanization/MS urbanize/GS urbanized urbanologist urbanology urbiculture urceolate urchin/MS ure urea urease uredinial uredinium urediospore uredium uredosorus uredospore uredostage ureide uremia uremic ureotelic ureotelism ureter ureteral ureteric urethan urethane/S urethra urethral urethritis urethroscope uretic urey urfa urga urge/DGJRS urgency/S urgent/Y uric uricosuric uricotelic uricotelism uridine urim urinal/S urinalysis urinant urinary urinate/DGNS urine uriniferous urinogenital urinometer/MS urinous urmia urn/GMS urochord urochordal urochordate urochrome urodele urogenital urogenous urokinase urol urolith urolithiasis urologic urological urologist urology uropod uropygial uropygium uroscopy urostyle urquhart ursine urticaceous urticaria urticarial urticate/N uruapan urumchi urundi urus urushiol us usability usable/AU usableness usably usage/S usance use/DGRSZ useably used/AU useful/PY useless/PY user/MS username usernames useway ushant ushas usher/DGS usherette usnach usnea uspallata usquebaugh usrio ussher ussuri ustashi ustulation ustyurt usual/PUY usufruct usufructuary usumbura usurer usurious/PY usurp/DR usurpation usury utamaro ute uteca utensil/MS utep uterine uterus/S utgard uther utile/I utilisability/S utilisable/SU utilisation/A utilise/DGRSZ utilises/A utilitarian utilitarianise/S utilitarianism utilitarianize/S utility/MS utilizability/S utilizable/MSU utilization/A utilize/DGRSZ utilizes/A utiny utmost utopia/S utopian/MS utopianiser/MS utopianism utopianizer/MS utopism utopist utopistic utricle utricular utricularia utriculitis utriculus utrillo uttar utter/DGRSY utterable/U utterance/MS uttered/U uttermost uttium uucp/M uvarovite uvea uveal uvedale uveitis uvula uvular/Y uvulitis uxmal uxorial uxoricide uxorious/PY vacancy/MS vacant/PY vacate/DGNSX vacation/DGRSZ vacationist vacationland vacationless vaccinal vaccinate/DS vaccinating vaccination/S vaccinator/S vaccine/S vaccinia vaccinial vaccinisation/MS vaccinization/MS vacherin vacillate/DGNSX vacillating/Y vacillator/MS vacua vacuity vacuo vacuolar vacuolate/DGNS vacuolated/U vacuole/S vacuolisation/MS vacuolization/MS vacuous/PY vacuum/DGS vacuumise/DGS vacuumize/DGS vadodara vadose vagabond/MS vagabondage vagabondise/RSZ vagabondish vagabondism vagabondize/RSZ vagal vagally vagarious/Y vagary/MS vagile vagility vagina/MS vaginal/Y vaginate vaginectomy vaginismus vaginitis vagotomy vagotonia vagotonic vagotropic vagrancy vagrant/SY vagrantise/S vagrantize/S vague/PRTY vagus vahana vain/P vainglorious/PY vainglory vainly vaisya valais valance/DS valdai valdemar valdivia vale/MS valediction valedictorian/M valedictory valence/MS valency/S valens valentine/MS valera valerian valerianaceous valeric valet/MS valeta valetta valetudinarian valetudinarianism valetudinary valgus valiance valiancy valiant/PY valid/IPY validate/DGINSX validated/AI validates/AI validation/AI validity/I valine valise/S valladolid vallation valle vallecula vallecular valley/MS vallombrosa valona valonia valor/MS valorisation/AMS valorise/ADGS valorization/AMS valorize/ADGS valorous/Y valour/MS valuable/PS valuably/I valuate/DGS valuation/MS valuational/Y valuator/S value/DGRSZ valued/AU valueless/P values/A valuta valvate valve/DGMS valvular valvule valvulitis vambrace vamoose/DGS vamp/R vampire/S vampirise/S vampirism vampirize/S vampish van/MS vanadate vanadic vanadinite vanadium vanadous vanaspati vanbrugh vandal/S vandalisation/MS vandalise/DGS vandalism vandalistic vandalization/MS vandalize/DGS vanderburgh vandyked vane/DMS vang vanguard vanguardism vanguardist vanilla vanillic vanillin vanish/DGRS vanishing/Y vanity/S vanquish/DGRS vanquishable vanquishment vansittart vantage/S vanua vanward vanzetti vapid/PY vapidity vapor/DGJMRSZ vaporability/MS vaporable/MS vaporer/MS vaporescence vaporetto vaporific vaporimeter vaporing/MSY vaporisable/S vaporisation/AMS vaporise/DGRSZ vaporises/A vaporish/P vaporizable/MS vaporization/AMS vaporize/DGRSZ vaporizes/A vaporless/S vaporlike/MS vaporous/PY vapory/RT vapour/DGJMRSZ vapouring/SY vapourisable vapourisation/S vapourise/DGRS vapourish/P vapourless vapourlike vapoury/RT vaquero vara varactor varanasi vardar vardon varec varese vargas varia variability/I variable/MPS variablity variably/I variac variance/MS variant/ISY variate/DGS variation/MS variational/Y varicella varicellate varicelloid varices varicocele varicolored/MS varicoloured/MS varicose/D varicosis varicosity varicotomy varied/Y variegate/DN variegator varietal/Y variety/MS variform variocoupler variola variolate variole variolite varioloid variolous variometer/MS variorum various/PY variscite varisized varistor varityper varix varlet varletry varmint varna varnish/DGMRSZ varnished/U varnishy varro varsity varus varve/D vary/DGJRS varying/SY vas vasal vasari vasco vascular vascularisation/MS vascularise/DGS vascularity vascularization/MS vascularize/DGS vasculature vasculum vase/MS vasectomy/S vaselike vashti vasiform vasoactive vasoactivity vasoconstriction vasoconstrictive vasoconstrictor vasodilatation vasodilation vasodilator vasoinhibitor vasomotor vasopressin vasopressor vasoregulatory vasospasm vasospastic vasotocin vassal/S vassalage vassalisation vassalise/DGS vassalization vassalize/DGS vast/PRTY vastitude vastity vasty vat/MS vatic vaticide vaticinal vaticinate/N vaticinator vatted vatting vauban vaucluse vaud vaudeville vaudevillian vault/DGRS vaulty vaunt/DR vauntful vauntingly vaunty vav vavasor vaward veal/AGR vealy vectograph vectographic vector/DGMS vectorcardiogram/MS vectorcardiographic vectorcardiography vectorial vectorisable/U vectorisation vectorise/DRSZ vectoriser/DGS vectorising vectorizable/U vectorization vectorize/DRSZ vectorizing vedette vee veep veer/DGS veering/Y veery/S veg vegan vegetable/MS vegetablise/S vegetablize/S vegetably vegetal vegetarian/MS vegetarianism vegetate/DGNSV vegetational/Y vegetative/PY vegete/V vehemence vehement/Y vehicle/MS vehicular veii veil/DGSU vein/DGRS veinal veinlet veinstone veinule veiny vela velamen velamentous velamina velar velarisation velarise/DGS velarium velarization velarize/DGS velate velcro veld veldskoen veldt/MS veleta veliger velitation velites velleity vellicate vellore vellum veloce velocimeter/MS velocipede velocity/MS velodrome velopment velour/S velum velure velutinous velvet velveteen velvety vena venae venal/Y venalisation/MS venalise/S venality venalization/MS venalize/S venatic venation venational vend/GR vendable vendace/S vendee vendetta vendibility vendible vendibly vendition vendor/MS vendue veneeal veneer/GR venenate/N venenose venepuncture venerability venerable/P venerably venerate/DGNSX venerator venereal venereological venereologist venereology venerology venery venesection venetian venge/G vengeance vengeful/APY venial/PY venin venipuncture venire venireman venisection venison venlo venography venom venomisation/MS venomise/S venomization/MS venomize/S venomous/PY venose venosity venous/Y vent/DGRS ventage ventail ventilate/DGNSVX ventilated/U ventilator ventilatory ventless ventral/Y ventricle/MS ventricose ventricular ventriculus ventriloquial/Y ventriloquise/DGS ventriloquism ventriloquist/MS ventriloquistic ventriloquize/DGS ventriloquy ventris ventrolateral/Y ventromedial ventura venture/DGJRSZ venturesome/PY venturi/S venturous/PY venue/MS venule veracious/PY veracity/I veranda/DMS verandah/D veratrine veratrum verb/MS verbal/Y verbalisation/MS verbalise/DGRSZ verbalised/U verbalism verbalist verbalistic verbalization/MS verbalize/DGRSZ verbalized/U verbatim verbena/S verbenaceous verbiage verbicide verbid verbify verbigeration verbile verbose/PY verbosity vercelli vercingetorix verdancy verdant/Y verderer verderor verdict/S verdigris verdin verdun verdure/D verdurous/P verecund vereeniging verge/RS vergeboard vergil verglas veridic veridical/Y veridicality verifiability verifiable/P verifiably verified/AU verifier/MS verify/DGNRSXZ verily verisimilar/Y verisimilitude verisimilitudinous verism verismo verist veristic veritable/P veritably verity verjuice verkrampte verlaine verligte vermeer vermeil vermeiled vermeiles vermeiling vermeilled vermeilles vermeilling vermian vermicelli vermicide vermicular vermiculate/DN vermiculite vermiform vermifuge vermilion vermilionise/S vermilionize/S vermillion vermin vermination verminosis verminous/Y vermis vermivorous vermouth vern vernacle vernacular/Y vernacularisation/MS vernacularise/S vernacularism vernacularization/MS vernacularize/S vernal/Y vernalisation/MS vernalise/DGS vernalization/MS vernalize/DGS vernation vernicle vernier vernissage verny verrazano verrocchio verruca verrucae verrucose versa versabraille versal versant versatec versatile/PY versatility verse/ADGNRSX verseman verset versicle versicolor/D versicolour/D versicular versify/NR versine version/AIS versional/A versionise/S versionize/S verso/S verst versus vert vertebra vertebrae vertebral/Y vertebrate/MNS vertex/S vertical/PSY verticality vertices verticil verticillaster verticillate verticillte vertiginous/Y vertigo vertu verulamium vervain verve vervet verwoerd very/RT vesalius vesical vesicant vesicate/N vesicle/S vesicular/Y vesicularity vesiculate/N vespasian vesper/S vesperal vespertilionine vespertinal vespertine vespiary vespid vespine vespucci vessel/MS vest/DGIS vesta vestal/Y vestee vestiary vestibular vestibule/D vestige/MS vestigial/Y vestlike vestment vestmental vestments vestry/S vestryise/S vestryize/S vestryman vesture/DGS vesuvian vesuvianite vesuvius vet/A vetch vetchling veteran/MS veteranise/S veteranize/S veterinarian/MS veterinary vetiver veto/DGR vetoes vetted/A vetting/A vex/DGS vexation vexatious/PY vexed/Y vexillary vexillologic vexillological vexillologist vexillology vexillum vi/MS via viability/I viable/I viably viaduct/S vial/MS vialed vialing vialled vialling viand/S viareggio viaticum viator vibes vibist vibraculum vibraharp vibraharpist vibrance vibrancy vibrant/Y vibraphone vibraphonist vibrate/DGNSX vibratile vibratility vibrational vibrationless vibrato vibrator vibratory vibrio vibrion vibrionic vibriosis vibrissa vibrissae vibronic viburnum vic vicar vicarage vicarate vicarial vicariate vicarious/PY vicarship vice/GMS vicegerency vicegerent vicenary vicennial vicenza viceregal/Y vicereine viceroy viceroyalty viceroyship vichyssoise vicinage vicinal vicinity/S vicious/PY vicissitude/MS vicissitudinous vickers vico vicomte victim/MS victimisable/S victimisation/MS victimise/DGRSZ victimised/U victimizable/MS victimization/MS victimize/DGRSZ victimized/U victor/MS victoriana victorious/PY victory/MS victress victual/S victualage victualed victualer/S victualess victualing victuallage victualled victualler victualler/S victualless victualling vicuna vidal vide videlicet video/S videophone videotape/DGMS videotex vidette vidhan vidicon viduity vie/DRS vienne view/DGJRSZ viewable viewfinder/MS viewgraph/MS viewless/Y viewpoint/MS viewport/MS viewscan viewy vigesimal vigil vigilance vigilant/Y vigilante/MS vigilantism vigintillion vignette/DGMRS vignettist vignola vigny vigo vigor/MS vigorish vigorist/MS vigorless vigoroso vigorous/PY vigour/MS vigourless vii viii vile/PRTY vilify/DGNRSX vilipend villa/MS villadom village/MRSZ villagery villain/MS villainess villainous/PY villainy villanella villanelle villatic villein villenage villi villiform villosity villous villus vim vimen/S vimineous vina vinaceous vinaigrette vinal vinasse vinblastine vinca vincible vincristine vinculum vindicable vindicate/DGNSV vindicator/S vindicatory vindictive/PY vine/GMS vineal vinedresser/S vinegar/S vinegarette vinegarish vinegarroon vinegary vinery vineyard/MS vineyardist vinic viniculture viniferous vinification vinificator vinnitsa vino vinosity vinous/Y vintage/RS vintner viny/R vinyl vinylic vinylidene viol viola violability violable/P violableness/I violably/I violaceous/Y violate/DGNSVX violator/MS violence violent/Y violet/MS violin/MS violinist/MS violist violoncello violone viomycin viosterol viper/MS viperine viperish viperous/Y viraginous virago viral/Y virelay viremia viremic viren vireo vires virescence virescent virga virgate virgin/MS virginal/Y virginity virginium virgulate virgule virial viricidal viricide virid viridescent viridian viridity virile virilism virility virion virologic virological/Y virologist virology viroses virosis virtu virtual/Y virtualise/S virtuality virtualize/S virtue/MS virtueless virtuosa virtuosi virtuosic virtuosity virtuoso/MS virtuous/PY virucidal virucide virulence virulency virulent/Y viruliferous virus/MS virustatic visa/DGS visage/D viscacha viscera visceral/Y viscerogenic visceromotor viscid/Y viscidity viscoelastic viscoelasticity viscoid viscometer/MS viscometric viscometry viscose viscosimeter/MS viscosimetric viscosity/S viscount/MS viscountcy viscountess viscounty viscous/PY viscus vise/DGV viselike visibility/S visible/IP visibly/I vision/DGMS visional/Y visionary/P visionise/S visionize/S visionless visit/ADGS visitable visitant visitation/MS visitational visitatorial visited/AU visitor/MS visor/DMS visorless vista/DMS vistula visual/SY visualisation/AMS visualise/DGRSZ visualised/U visualises/A visualization/AMS visualize/DGRSZ visualized/U visualizes/A vita vitaceous vitae vital/SY vitalisation/MS vitalise/DGJRSZ vitalising/MSY vitalism vitalist vitalistic vitality vitalization's/A vitalization/MS vitalizations/A vitalize/DGJRSZ vitalizing/MSY vitamer vitameric vitamin/MS vitaminisation vitaminise/S vitaminization vitaminize/S vitaphone vitascope vitellin vitelline vitellogenesis vitellus vitiate/DGNS vitiator viticultural viticulture viticulturist vitiligo vitiosity vitite vitoria vitrain vitreous/PY vitrescence vitrescent vitric vitrifiable vitriform vitrify/N vitrine vitriol vitriolic vitriolisable/S vitriolisation/MS vitriolise/RSZ vitriolizable/MS vitriolization/MS vitriolize/RSZ vitro vitruvius vitta vittae vittate vittle vittles vituline vituperate/N vituperative/Y vituperator vituperatory vitus viva vivace vivacious/PY vivacity vivarium vive/Z viverrid viverrine vivid/PY vivific vivified/A vivify/DNR viviparity viviparous/PY vivisect vivisection vivisectional/Y vivisectionist vivisector vivo vixen vixenish/PY viyella viz vizard vizier vizierate vizierial viziership vizor vms vocable/AI vocabular vocabularian vocabularianism vocabulary/S vocal/SY vocalic vocalically vocalisation/MS vocalise/DGRSZ vocalism vocalist/S vocality vocalization/MS vocalize/DGRSZ vocate vocation/MS vocational/Y vocationalisation/MS vocationalise/S vocationalism vocationalist vocationalization/MS vocationalize/S vocations/AI vocative/Y vociferant vociferate/N vociferator vociferous/PY vocoded vocoder vodka/M vogue voguish/P voice/DGRSZ voiceband voiced/IU voicedness voiceful/P voiceless/PY voiceprint void/DGPRS voidable/P voidage voidance voila voile voiotia voir voix vojvodina volant volante volar volatile/PS volatilisable/S volatilisation/MS volatilise/GRSZ volatilises/AU volatility/S volatilizable/MS volatilization/MS volatilize/DGRSZ volatilizes/AU volcanic volcanically volcanicity volcanism volcano/MS volcanoes volcanologic volcanological volcanologist volcanology vole/S volitant volition volitional/Y volitionality volitive volkslied/R volley/DGRS volleyball/MS vologda volost volplane/DG volsung volsunga volt/AS voltage/S voltaic voltaism voltameter/MS voltametric voltammeter voltise/S voltize/S voltmeter/MS volturno volubility voluble/P volubly volume/DGMS volumeter/MS volumetric volumetrically voluminosity voluminous/PY voluntarily/I voluntarism voluntarist voluntaristic voluntary/IP voluntaryism voluntaryist volunteer/DGS volunteerism voluptuary voluptuous/Y volute/DN volutin volva volvement volvox volvulus vomer vomerine vomit/DGRS vomitory vomiturition vomitus von voodoo/S voodooism voodooist voodooistic voortrekker voracious/PY voracity vored vorster vortex/S vortical/Y vorticella vortices vorticism vorticist vorticity vorticose vortiginous vosges vostok votaress votarist votary vote/DGRSVZ voteless votive/PY votress vouch/GRSZ vouchee vouchsafe/DGS vouchsafement vouge voussoir vow/DGRS vowel/MS vowelisation/MS vowelise/DGS vowelization/MS vowelize/DGS vox voyage/DGJRSZ voyageur/S voyeur/S voyeurism voyeuristic voyeuristically vroom vs/A vuillard vulcanian vulcanicity vulcanisable/S vulcanisate/NX vulcanisation/MS vulcanise/GRSZ vulcanised/U vulcanizable/MS vulcanizate/NX vulcanization/MS vulcanize/GRSZ vulcanized/U vulcanologist vulcanology vulgar/Y vulgarian vulgaris vulgarisation/MS vulgarise/DGRSZ vulgarism vulgarity vulgarization/MS vulgarize/DGRSZ vulgate vulgus vulnerability/S vulnerable/IP vulnerably/I vulnerary vulpine vulterine vulture/MS vulturelike vulturine vulturous vulva vulvae vulval vulvar vulviform vulvitis vulvovaginitis vyborg vying wabble/DGS wace wackily wacko/MS wacky/PR wad/S wadable wadai wadded wadder waddie/DS wadding waddle/DGRS waddy/DGS wade/DGRSZ wadeable wadi wadmal wadset wafer/DGMS waffle/DGMS waft/R waftage wafture wag/S wage/DGRSZ waged/U wageless wager/DGRS wageworker wagged wagger waggery wagging waggish/PY waggle/DGS waggly waggon/MRSZ waggoneer waggoner/MS waggonette wagon/MS wagoneer/MS wagoner/MS wagonette/MS wagonload/MS wagonner/MS wagram wagtail wah wahine wahoo/S waif wail/DGRS wailful/Y wain/D wainscot/DGS wainscotting waist/DMRS waistband waistcloth waistcoat/DMS waistline wait/DGRSZ waiter/MS waitress/MS waive/DGRSZ waiverable wake/DGRS wakeful/PY wakeless waken/DGR wakerobin wakeup wale/GRS walfish walhalla walk/DGRSZ walkable walkabout walkaway walkie walkingstick walkley walkout walkover walkway/MS wall/DGMRS wallaby wallah wallaroo wallasey wallboard wallenstein wallet/MS walleye/D wallflower wallop/DGRS wallow/DGRS wallpaper/S wally/S walnut/MS walrus/MS waltz/DGRS wamble/DG wame wampum wan/PY wand/S wander/DGJRSZ wanderlust wanderoo wandoo wane/DGS waney wanganui wangle/DGRS wanhsien wank wankel wankie wanna wanner wannest wanning wansee wansley want/DGRS wanted/U wanton/PRY wany/R wapiti/S war/MS waratah warble/DGRS warbonnet ward/DGNRSX wardenship wardership wardian wardle wardmote wardress wardrobe/MS wardroom/S wardship ware/GS warehouse/DGRS warehouseman warehousemen wareroom warfare warhead/S warhorse/S warily/U warless warlike warlock warlord/S warlordism warm/DGHPRSTYZ warmhearted/PY warmish warmonger/GS warmup warn/DGJRS warning/SY warp/DGMRS warpage warpath warplane/MS warrant/DGRS warrantable/P warrantably/U warranted/U warrantee/S warrantless warrantor/S warranty/MS warred warren/RSZ warrigal warring warrior/MS warship/MS warsle wart/DMS warta wartime/S warty wary/PRT was wash/DGJRSZ washability washable washaway washbasin washboard washbowl washcloth washcloths washday/S washerman washerwoman washerwomen washery washhouse washin washoe washout washrag washroom/S washstand/S washtub/S washwoman washwomen washy/R wasn't wasp/MS waspish/PY wasplike wassail/R wassermann wast wastage/S waste/DGRS wastebasket/S wasteful/PY wasteland/S wastepaper wastewater wasteweir wasting/Y wastrel/S watap watch/DGJRSZ watchband watchcase watchdog watched/U watcheye watchful/PY watchmake/GRZ watchman watchmen watchpoints watchstrap watchtower watchword/MS watchworks water/DGJRS waterage waterborne waterbrain waterbuck watercolor/DGMS watercolorist/S watercolour/DGMS watercolourist/S watercourse watercraft watercress waterfall/MS waterflood waterfowl/MR waterfront waterhole/MS waterily waterish/P waterless/PY waterline/S waterlog waterlogged waterloo waterman watermanship watermark watermelon waterpower waterproof/DGPRS waterscape watershed/S waterside/R waterspout watertight/P watertower waterway/MS waterweed waterwheel waterworks waterworn watery/P watt/S wattage/S wattle/DGS wattlebird wattmeter/MS waught waukesha waul waunona waupaca waupun wausau wauwatosa wave/DGRSZ waveband/S waveform/MS wavefront/MS wavefunction/S waveguide/S waveland wavelength wavelengths waveless/Y wavelet/S wavelike wavellite wavemeter wavenumber waveoff waver/DGRS wavering/UY wavery wavily wavy/PR waw wawa wawl wax/DGNRSZ waxberry waxbill waxlike waxplant waxwing/MS waxwork/S waxy/PR way/MS waybill wayfarer wayfaring waygoing waylaid waylay wayless wayside/S wayward/PY wayworn wayzgoose waziristan we'd we'll we're we've we weak/NPRTXY weaken/DGRS weakfish weakhearted weakish weakling weakly/P weakness/MS weal weald wealth wealthily wealths wealthy/PRT wean/DGR weanling weapon/DMS weaponeer weaponless weaponry wear/GRS wearability wearable wearied/U weariful/PY weariless/Y wearily wearing/Y wearisome/PY wearproof weary/DGPRST weasand weasel/MS weaseled weaseling weaselled weaselling weather/DGRSY weatherability weatherbeaten weatherboard/G weathercock/MS weatherglass weatherman weatherproof/P weatherstrip weatherstripping weatherworn weathery weave/GRSZ weaverbird web/MS webbed webber webbing webbs webby weber/MS webfoot weblike webwheel wed/S wedded weddell wedder wedding/MS wedekind wedeling wedge/DGS wedgy wedlock wee weed/DGRS weedkiller weedless weedy/P week/MSY weekday/MS weekend/MRS weekly/S weeknight/S weelkes ween weeny weep/GRSZ weepy weet weever weevil/Y weeviled weevilled weevily weft/S weider weidman weigh/DGJR weighable weighbridge/S weighed/U weighs weight/DGJRS weightily weightless/Y weightlessness weightlifter weightlifting weighty/PR weihai weimaraner weiner weir weird/PY weirdie/S weirdo/S weirs weka welcome/DGPRSY weld/DGJRSZ weldable weldment weldor weldwood welfare welfarism welfarist welkin welkom well/DGPS welland wellaway wellbeing wellborn wellesz wellhead wellies wellington wellman wellwisher/MS welmers welsh/R welt/RS welter/DG welterweight weltschmerz welwyn wen wench/MRS wend went wentletrap wept/U were weren't werewolf/M werewolves wernerite wersh wert weser wesker weskit wessex west/GR westbound wester/DGY westerly/S western/RSZ westernisation/MS westernise/DGS westernization/MS westernize/DGS westernmost westmost westward/S wet/PSY wetback wetland/S wettable wetted wetter wettest wetting wettish wff whack/DGRS whacko whacky whale/GRS whaleback whaleboat whalebone/MS wham whamming whammy/S whang whangarei whangee whap whare wharf/S wharfage wharfie wharfinger wharfmaster wharve wharves what'd what're what/M whatchamacallit/MS whatever whatnot whats whatsit whatsoever whaup wheal wheat/N wheatear wheatland wheaton wheatworm whee wheedle/DGS wheel/DGJRSZ wheelbarrow/M wheelbarrows wheelbase wheelchair/M wheelhorse wheelhouse wheelie wheelless wheelman wheelock wheelsman wheelwork wheelwright wheen wheeze/DGS wheezily wheezy/PR whelk whelm whelp when/S whenas whence whencesoever whenever whensoever where'd where're where/M whereabout whereabouts whereafter whereas whereat whereby wherefore/S wherefrom wherein whereinto whereness whereof whereon wheres wheresoever wheresomever wherethrough whereto whereunto whereupon wherever wherewith wherewithal wherrit wherry/S whet/S whether whetstone whetted whetter whetting whew whey wheyface which whichever whichsoever whicker/DG whidah whidding whiff whiffle/DGRS whiffletree whig/S whigmaleerie while/DGS whilom whilst whim/MS whimbrel whimper/DGS whimsey/S whimsical/PY whimsicality whimsy/DMS whin whinchat whine/DGRS whiney whinge whining/Y whinny/DGS whinstone whip/MS whipcord whiplash/S whiplike whipped whipper/MS whippersnapper whippet whipping/MS whippletree whippoorwill whippy/R whipsaw/D whipstall whipstitch whipstock whipworm whir/Y whirl/DGRS whirlabout whirligig whirlpool/MS whirlwind whirly/S whirlybird whirr/G whirry/DG whish whisht whisk/DGRSZ whisker/DS whiskery whiskey/MS whiskies whisky/M whiskys whisper/DGJRS whispering/SY whispery whist whistle/DGRSZ whistleable whit/DGNRX whitby white/DGPRSTY whitebait whitebeam whitebeard whitecap whitedamp whiteface whitefish whitefly whitehead whiteleaf whiteley whiten/DGRSZ whiteout whitesmith whitespace whitetail whitethorn whitethroat whitewall whitewash/DGR whitewater whitewing whitewood whitey whither whithersoever whitherward whitish whittle/DGJRS whity whiz whizbang whizz/R whizzbang whizzed whizzes whizzing who'd who'll who've who/M whoa whodunit/MS whoever whole/PS wholefood wholehearted/Y wholemeal wholesale/DGRSZ wholesome/PY wholism wholly whom whomever whomp whomsoever whoop/DGRS whoopee whoopla whoosh whop whopper whoppers whopping whore/GMS whoredom whorehouse whoremaster whoremonger whoreson whorish whorl/DMS whort whortle whortleberry whose whosesoever whoso whosoever whump whup why whyalla whydah whys wick/DGRS wicked/PY wickerwork wicket/S wicketkeeper/S wicketkeeping wickiup wickthing wicopy widdershins wide/PRTY widemouthed widen/DGRS widespread widgeon/S widgery widget/MS widgie widish widnes widow/DRSZ widowerhood widowhood width widths widthways widthwise widukind wieland wield/DGRS wieldy wien wiener/S wienerwurst wienie wife/MY wifehood wifeless wifelike wifely/P wig/MS wigan wigeon/S wigged wigging wiggle/DGRS wiggly wight wiglet wigmaker wigwag wigwam wikiup wilco wild/GPRTY wildcard/DGS wildcat/MS wildcatted wildcatter wildcatting wilde wildebeest/M wilder/P wilderment wildfire wildflower/MS wildfowl/GR wildish wildlife wildling wildwood wile/DGS wilful/Y wilhelmshaven wilhelmstrasse wilily will/DGJRS willable willed/U willemite willemstad willet willful/PY willing/PSY williwaw willow/MRS willowherb willowlike willowware willowy willpower willy/GS wilmette wilmslow wilno wilt/DGS wily/PR wimble/DGS wimp/MS wimple/DG wimpy/RT win/S wince/DGS wincey winch/DGRS winchell winchester wind/DGRSZ windage windbag/S windblown windbound windbreak/S windburn/D windcheater/S windchill windermere windfall windflaw windflower windgall windhoek windhover windily windjammer windlass/DGSY windless/PY windlestraw windmill/GMS window/DGMS windowless windowpane/S windowsill windpipe windproof windrow windsail windscreen windshield windsock windstorm windsurf/DGS windswept windup windward/Y windway windy/PR wine/DGRSZ winebibber wineglass winegrower winehead winemake winemaster winepress winery wineshop wineskin winey wing/DGRSZ wingback wingbeat/MS wingding wingless/P winglet winglike wingman wingmen wingover wingspan wingspread/MS wingtip wingy winism wink/DGRS winkelried winking/U winkle/DGS winless winnable/U winnebago winned winner/MS winning/SY winnipegosis winnow/R wino/S winooski winsett winsome/PY winter/DGRSY winterfeed wintergreen winterisation/MS winterise/DGS winterization/MS winterize/DGS winterkill winterthur wintertide wintertime winterweight wintery wintle wintrily wintry/PR winy winze wipe/DGRSZ wipo wirable wire/DGJRS wired/AU wiredraw/R wiredrawn wirehair/D wireless wirelike wireman wiremen wirepuller wires/A wiretap/MS wiretapper wiretapping wirewalker wireway wirework/S wireworm wirily wirra wirral wiry/PR wis wisdom/S wise/DGPRSTY wiseacre wisecrack/DR wisenheimer wisent wisewoman wish/DGRSZ wisha wishbone wishful/PY wishlist/S wishy wislany wismar wisp/MS wispish wispy wist wistaria wisteria wistful/PY wit/MS witan witch/GS witchcraft witchery witchetty witchlike witchy wite witenagemot with withal withdraw/GRS withdrawable withdrawal/MS withdrawn/P withdrew withe wither/DGS withering/Y witherite withershins witherspoon withheld withhold/GJRSZ within withindoors without withoutdoors withstand/GS withstood withy/S witless witling witness/DGS witnessed/U witted witter witticism wittily witting/Y wittol witty/PRT wive/G wivern wives wiz wizard/MSY wizardry wizen/D woad/D woadwaxen woald wobble/DGRS wobbly/P wodge/S woe/P woebegone/P woeful/Y wog woggle wok woke woken wold wolf/R wolfbane wolfenden wolffish wolfhound wolfish/PY wolfit wolflike wolframite wolfsbane wollastonite wolly wolsey wolve/R wolverine/MS wolverton wolves woman/MY womanhood womanisation/MS womanise/DGRSZ womanised/U womanises/U womanish/PY womanization/MS womanize/DGRSZ womanized/U womanizes/U womankind womanless womanlike womanly/P womanpower womb/DMS wombat/MS women/M womenfolk/S womenkind womera won won't wonder/DGRS wonderful/PY wondering/Y wonderland/M wonderment wonderwork wondrous/PY wonky wonning wonsan wont/DG wonted/PUY wonton woo/DGRS wood/DGMNS woodberry woodborer woodcarver woodcarving woodchat woodchopper/S woodchuck/MS woodcock/MS woodcockise/S woodcockize/S woodcraft woodcut woodcutter woodcutters woodcutting wooden/PY woodenhead/D woodenware woodgrain/G woodgrouse woodhen woodhook woodland/R woodlark woodlore woodlot woodlouse woodman woodnote woodpecker/MS woodpile woodruff woodrush woods/R woodscrew woodseats woodshed woodside woodsman woodsy woodwaxen woodwind woodwork/GR woodworm woody/PR woodyard woof/DGRSZ wool/DNSXY woolenization/MS woolenize/S woolf woolfell woolgather/GR woolgrower woolie woollen/S woollenisation/MS woollenise/S woollenization/MS woollenize/S woolley woolly/PRS woollybutt woolpack woolsack woolshed woolskin woop woops woorali woozily woozy/PR wop/S word/DGJMS wordage/S wordbook wordily wordless/P wordlessly wordmonger wordplay wordy/PR wore work/DGJRSZ workability workable/P workably workaday workaround/MS workbag workbasket workbench/MS workboat workbook/MS workbox workday worker/MS workfile/S workfolk/S workforce/MS workgroup/S workhorse/MS workhouse workhouses workingman workingmen workless/P workload/S workman/Y workmanlike workmanship workmate/S workmen/M workout/S workpeople workperson workpiece/S workplace/MS workroom/S worksheet/S workshop/MS workshy worksop workspace/S workstation/MS worktable workweek workwoman world/MSYZ worldling worldly/PU worldwide worm/DGRS wormcast wormhole wormlike wormseed wormwood wormy/R worn/U worried/Y worriment worrisome/PY worry/DGRSZ worrying/Y worrywart worse/R worsen/DGS worship/S worshiped worshiper/MS worshipful/PY worshiping worshipless worshipped worshipper/MS worshipping worsley worst/D wort worth/G worthful worthily/U worthless/PY worths worthwhile/P worthy/PRST wot wotted would've would/T wouldn't wouldst wound/DGS woundless woundwort wove woven/U wow wowser wrack/DS wracking wraith wraiths wran wrangle/DGRSZ wrap/MS wraparound wrapover wrapped/U wrapper/MS wrapping/S wrapround wraps/U wrapup wrasse wrath wrathful/PY wrathy wreak/S wreath/DGS wreathe wreaths wreathy wreck/DGRSZ wreckage wreckfish wreckful wrekin wren/MS wrench/DGS wrenching/Y wrest/DGRS wrestle/DGJRS wretch/DS wretched/PY wriggle/DGRS wriggly wright wring/GRS wrinkle/DGS wrinkled/U wrinkly wrist/MS wristband wristlet wristlock wristwatch/MS wristy writ/GJMRSZ writable/U write/GJRSZ writer/MS writeup/MS writhe/DGS writhen written/AU wroclaw wrong/DGPRSTY wrongdo/Z wrongdoer wrongdoing wrongful/PY wrongheaded/PY wrote/A wroth wrought/I wrung wry/RTY wrybill wryneck wuchang wuhsien wuhu wulfenite wulfila wunderkind wundt wuppertal wurley wurst wus wusih wuthering wutsin wycherley wycliffe wye wynd wysiwyg wyvern xanthate xanthein xanthene xanthic xanthin xanthine xanthippe xanthochroid xanthochroism xanthoma xanthophyll xanthous xanthus xci xcii xciv xcix xcvi xcvii xenakis xenia xenocrates xenocryst xenogamy xenogenesis xenoglossia xenolith xenomania xenomorphic xenon xenophanes xenophile xenophilous xenophobe xenophobia xenophobic xenophon xerarch xeric xerically xeroderma xerographic xerographically xerography xeromorphic xerophile xerophilous xerophily xerophthalmia xerophyte xerosere xerosis xhosa xi xii xiii xiphisternum xiphoid xiphosuran xiv xix xterm/M xuthus xv xvi xvii xviii xx xxi xxii xxiii xxiv xxix xxv xxvi xxvii xxviii xxx xxxi xxxii xxxiii xxxiv xxxix xxxv xxxvi xxxvii xxxviii xylan xylem xylene xylidine xylocarp xylograph xylography xyloid xylol xylophagous xylophone/S xylophonist xylose xylotomic xylotomical xylotomous xylotomy xylyl xyst/R yabber yabby yacc/M yacht/GSZ yachtsman yachtsmen yack/G yaffle yafo yagi yah yahata yak/S yakking yalies yam/S yamagata yamani yamashita yamen yammer yang yanina yank/DGS yap/S yapok yapon yapping yard/DGMS yardage yardarm yardbird yardman yardmaster yardstick/MS yare/Y yarmelke yarmulke yarn/DGMS yarrow yarwood yataghan yate yauld yaunde yaup yaupon yautia yaw/DGS yawata yawl yawn/GRS yawning/Y yawp yazd ycleped yclept ye yea/S yeah yean yeanling year/MSY yearbook yearling yearlong yearn/DGJRS yearning/SY yeast/MS yeastily yeasty/PR yecch yegg yeld yelk yell/DGRS yellerish yellow/DGPRST yellowbark yellowbird yellowhammer yellowish yellowlegs yellowtail yellowweed yellowwood yelp/DGRS yen yenan yentai yeoman/Y yeomanry yeomen yep yerevan yes/S yeshiva yester yesterday/MS yesteryear yestreen yet yeti yeuk yew yezd ygerne yield/DGRS yielded/U yielding/U yike yin yingkow yip yippee yipping yirr ylem ymir yob yod yodel/S yodeled yodeler yodeling yodelled yodeller yodelling yodle yoga yogh yoghurt/M yogi yogic yogin yogurt/M yohimbine yoicks yoke/GMS yokefellow yokel/S yoknapatawpha yola yolk/S yolky yom yon yond yonder yoni yonne yonnie yore you'd you'll you're you've you young/PRTY youngish youngling youngster/MS your/MS yourself yourselves youth/M youthful/PY youths yow yowl yr ytterbia ytterbite ytterbium yttria yttriferous yttrium yuba yucca yuck yuk yulan yule yuletide yummy/R yup yuppie/MS yuri yurt yvelines ywis zabaglione zacynthus zaffer zag/S zagazig zagged zagging zagreus zagros zama zamindar zamindari zamora zanily zante zanu zany/PRS zap/S zapata zaporozhye zappa zapped zapping zapu zaqaziq zaragoza zarathustra zaratite zareba zarf zarga zaria zarzuela zastruga zayin zazen zeal zealot zealotry zealous/PY zeami zebec zebedee zebra/MS zebrawood zebu zebulun zecchino zechariah zed zedekiah zedoary zee zeffirelli zein zeist zeitgeist zemindar zenana zener zenith zenithal zeolite zeolitic zephaniah zephyr zephyrus zeppelin zero/DGHS zeroes zeroise/DGS zeroize/DGS zest zestful/PY zesty/R zeta/S zeugma zeuxis zia ziaur zibeline zibet ziff zig zigged zigging ziggurat ziggy zigzag zigzagged zigzagger zigzagging zila zilch zillion zilpah zinc/M zincate zincic zinciferous zincite zinckenite zincograph zincography zinfandel zing/RS zingiberaceous zingy/R zinjanthropus zinkenite zinnia zip/S zipangu zipped zipper/DS zipping zippy/R zircalloy zircon zirconia zirconic zirconium ziska zither/S zitherist zizith zlatoust zloty zlotys zoaea zoan zoantharian zoarial zoarium zobrist zodiac/S zodiacal zoea zoffany zohar zola zombi zombie/S zombiism zonal/Y zonate/DN zond zone/DGRSY zonk/GS zonked zonule zoo/MS zoochemistry zoochore zoogenic zoogenous zoogeographer zoogeographic zoogeography zoogloea zoography zooid zooks zoolatry zoologic zoological/Y zoologist/S zoology zoom/DGS zoometry zoomorphic zoomorphism zoonosis zoonotic zooparasite zooparasitic zoophagous zoophile zoophilia zoophilic zoophilism zoophilous zoophobia zoophyte zoophytic zooplankton zooplasty zoosperm zoosporal zoosporangium zoospore zoosterol zootechnics zootomy zootoxin/S zori zorilla zorrilla zoster zoug zounds zsigmondy zucchetto zucchini zugzwang zwitterion/S zwitterionic zygote/MS htdig-3.2.0b6/installdir/english.0.original0100644006314600127310000055333206345054421020063 0ustar angusgbhtdigaback abaft abandon/DGRS abandonment/S abase/DGRS abasement/S abash/DGS abashed/U abate/DGRS abated/U abatement/S abbe abbey/MS abbot/MS abbreviate/DGNSX abbreviated/AU abdomen/MS abdominal/Y abduct/DGS abduction/MS abductor/MS abed aberrant/Y aberration/S abet/S abetted abetter abetting abettor abeyance abhor/S abhorred abhorrent/Y abhorrer abhorring abide/DGRS abiding/Y abilities/I ability/MS abject/PY abjection/S abjure/DGRS ablate/DGNSV ablative/Y ablaze able/RT ablution/S ably abnormal/Y abnormality/S aboard abode/MS abolish/DGRSZ abolishment/MS abolition abolitionist/S abominable aboriginal/Y aborigine/MS abort/DGRSV abortion/MS abortive/PY abound/DGS about above aboveground abrade/DGRS abrasion/MS abreaction/MS abreast abridge/DGRS abridged/U abridgment abroad abrogate/DGNS abrupt/PY abscess/DS abscissa/MS abscond/DGRS absence/MS absent/DGSY absentee/MS absenteeism absentia absentminded/PY absinthe absolute/NPSY absolve/DGRS absorb/DGRS absorbency absorbent/MS absorbing/Y absorption/MS absorptive abstain/DGRS abstention/S abstinence abstract/DGPRSVY abstracted/PY abstraction/MS abstractionism abstractionist/S abstractor/MS abstruse/PY abstruseness/S absurd/PY absurdity/MS abundance/S abundant/Y abuse/DGRSVZ abusive/PY abut/S abutment/S abutted abutter/MS abutting abysmal/Y abyss/MS acacia academia academic/S academically academy/MS accede/DGS accelerate/DGNSVX accelerated/U accelerating/Y accelerator/S accelerometer/MS accent/DGS accentual/Y accentuate/DGNS accept/DGRSVZ acceptability/U acceptable/P acceptably/U acceptance/MS accepted/Y accepting/PY acceptor/MS access/DGS accessibility/I accessible/IU accessibly/I accession/MS accessory/MS accident/MSY accidental/PY acclaim/DGRS acclamation acclimate/DGNS accolade/S accommodate/DGNSVX accommodated/U accommodating/Y accommodative/P accompanied/U accompaniment/MS accompanist/MS accompany/DGRS accomplice/S accomplish/DGRSZ accomplished/U accomplishment/MS accord/DGRSZ accordance/S according/Y accordion/MS accost/DGS account/DGJS accountability/S accountable/P accountably/U accountancy accountant/MS accounted/U accredit/D accreditation/S accretion/MS accrue/DGS acculturate/DGNSV accumulate/DGNSVX accumulative/PY accumulator/MS accuracy/IS accurate/PY accurately/I accursed/PY accusal accusation/MS accusative accuse/DGRSZ accusing/Y accustom/DGS accustomed/P ace/DGMRS acetate acetone acetylene ache/DGS achievable/U achieve/DGRSZ achieved/U achievement/MS Achilles aching/Y acid/PSY acidic acidity/S acidulous acknowledge/DGRSZ acknowledged/Y ACM acme acne/D acolyte/S acorn/MS acoustic/S acoustical/Y acoustician acquaint/DGS acquaintance/MS acquainted/AU acquiesce/DGS acquiescence acquirable acquire/DGS acquisition/MS acquisitiveness acquit/S acquittal/S acquitted acquitter acquitting acre/MS acreage acrid/PY acrimonious/Y acrimony acrobat/MS acrobatic/S acronym/MS acropolis across acrylic act/ADGSV actinium actinometer/MS action/AMS actions/AI activate/DGNSX activation/AI activator/MS active/APY actively/AI activism activist/MS activity/MS actor/AMS actress/MS actual/SY actuality/S actuarial/Y actuate/DGNS actuator/MS acuity acumen acute/PRTY acyclic acyclically ad/AS Ada/M adage/S adagio/S adamant/Y adapt/DGRSVZ adaptability adaptable/U adaptation/MS adapted/P adapting/A adaption adaptive/PY adaptor/S add/DGRSZ addenda addendum addict/DGSV addiction/MS addition/MS additional/Y additive/MSY additivity address/DGRSZ addressability addressable addressee/MS adduce/DGRS adduct/DGSV adduction adductor adept/PSY adequacy/IS adequate/IPY adhere/DGRSZ adherence/S adherent/MSY adhesion/S adhesive/MPSY adiabatic adiabatically adieu adjacency adjacent/Y adjective/MSY adjoin/DGS adjourn/DGS adjournment adjudge/DGS adjudicate/DGNSVX adjudication/MS adjunct/MSVY adjure/DGS adjust/DGRSVZ adjustable/AU adjustably adjusted/AU adjustment/MS adjustments/A adjustor/MS adjusts/A adjutant/S administer/DGJS administration/MS administrative/Y administrator/MS admirable/P admirably admiral/MS admiralty admiration/S admire/DGRSZ admiring/Y admissibility/I admissible/I admission/MS admit/S admittance admitted/Y admitting admix/DS admixture admonish/DGRS admonishing/Y admonishment/MS admonition/MS ado adobe adolescence adolescent/MSY adopt/DGRSVZ adopted/U adoption/MS adoptive/Y adorable/P adoration adore/DGRS adorn/DGS adorned/U adornment/MS adrenal/Y adrenaline adrift adroit/PY adsorb/DGS adsorption adulate/GNX adult/MPSY adulterate/DGNS adulterated/U adulterer/MS adulterous/Y adultery adulthood adumbrate/DGNSV adumbrative/Y advance/DGRSZ advancement/MS advantage/DGS advantageous/PY advent/V adventist/S adventitious/PY adventive/Y adventure/DGRSZ adventurous/PY adverb/MS adverbial/Y adversary/MS adverse/DGSY adversity/S advertise/DGRSZ advertisement/MS advice advisability/I advisable/P advisably advise/DGRSZ advised/UY advisee/MS advisement/S adviser/MS advisor/MS advisory advocacy advocate/DGNSV aegis aerate/DGNS aerator/S aerial/MSY aeroacoustic aerobic/S aerodynamic/S aeronautic/S aeronautical/Y aerosol/S aerospace afar/S affable affair/MS affect/DGRSV affectation/MS affected/PUY affecting/Y affection/DMS affectionate/UY affective/Y afferent/Y affianced affidavit/MS affiliate/DGNSX affinity/MS affirm/ADGS affirmation/MS affirmative/Y affix/DGS afflict/DGSV affliction/MS afflictive/Y affluence affluent/Y afford/DGS affordable affricate/NSV affright affront/DGS afghan/S Afghanistan/M aficionado/S afield afire aflame afloat afoot afore aforementioned aforesaid aforethought afoul afraid/U afresh Africa/M African/MS aft/RZ aftereffect/S aftermath aftermost afternoon/MS aftershock/MS afterthought/S afterward/S again against agape agar agate/S age/DGRSZ aged/PY ageless/PY agency/MS agenda/MS agent/MSV agents/A agglomerate/DNSV agglutinate/DGNSV agglutinin/S aggravate/DGNSX aggregate/DGNPSVXY aggregated/U aggregative/Y aggression/MS aggressive/PY aggressor/S aggrieve/DGS aggrieved/Y aghast agile/Y agility agitate/DGNSVX agitated/Y agitator/MS agleam aglow agnostic/MS ago agog agony/S agrarian agree/DRSZ agreeable/P agreeably agreeing agreement/MS agricultural/Y agriculture ague ah ahead aid/DGRS aide/DGRS aided/U ail/DGS aileron/S ailment/MS aim/DGRSZ aimless/PY air/DGJRSZ airbag/MS airborne aircraft/S airdrop/S Airedale/M airfield/MS airflow airframe/MS airhead airily airless/P airlift/MS airline/MRSZ airliner/MS airlock/MS airmail/S airman airmen airport/MS airship/MS airspace airspeed/S airstrip/MS airway/MS airy/PRT aisle/S ajar akimbo akin Alabama/M Alabamian/M alabaster alacrity alarm/DGS alarming/Y alarmist alas Alaska/M alba albacore Albania/M Albanian/MS albeit album/NS albumin alchemy Alcibiades alcohol/MS alcoholic/MS alcoholism/S alcove/DMS Alden/M alder alderman/M aldermen ale/V alee alert/DGPRSYZ alerted/Y alfalfa alfresco alga algae algaecide algebra/MS algebraic algebraically Algeria/M Algerian/M alginate/S Algol/M algorithm/MS algorithmic algorithmically alias/DGS alibi/MS alien/MS alienate/DGNS alight/DG align/DGRS aligned/AU alignment/AS alike/P aliment/S alimony alive/P alkali/MS alkaline alkaloid/MS alkyl all Allah/M allay/DGS allegation/MS allege/DGS alleged/Y allegiance/MS allegoric allegorical/PY allegory/MS allegretto/MS allegro/MS allele/S allemande allergic allergy/MS alleviate/DGNSV alleviator/MS alley/MS alleyway/MS alliance/MS alligator/DMS alliteration/MS alliterative/Y allocate/ADGNSVX allocated/AU allocation/AMS allocator/AMS allophone/S allophonic allot/DS allotment/MS allotments/A allots/A allotted/A allotter allotting/A allow/DGS allowable/P allowably allowance/DGMS allowed/Y alloy/DGMS alloyed/U allude/DGS allure/DGS allurement allusion/MS allusive/PY ally/DGRS alma almanac/MS almighty/P almond/MS almoner almost alms/A almsman alnico aloe/S aloft aloha alone/P along alongside aloof/PY aloud alpha alphabet/MS alphabetic/S alphabetical/Y alphanumeric/S alpine alps already also altar/MS alter/DGRSZ alterable/IU alteration/MS altercation/MS altered/U alternate/DGNSVXY alternative/PSY alternator/MS although altitude/S alto/MS altogether altruism altruist/S altruistic altruistically alum alumna/M alumnae alumni alumnus alundum alveolar/Y alveoli alveolus always Alyssa/M am/NS amain amalgam/MS amalgamate/DGNSVX Amanda/M amanuensis amass/DGRS amateur/MS amateurish/PY amateurism amatory amaze/DGRSZ amazed/Y amazement amazing/Y amazon/MS ambassador/MS amber ambiance/S ambidextrous/Y ambient ambiguity/MS ambiguous/PY ambiguously/U ambition/MS ambitious/PY ambivalence ambivalent/Y amble/DGRS ambrosial/Y ambulance/MS ambulatory ambuscade/R ambush/DRS Amdahl/M Amelia/M ameliorate/DGNV amenable amend/DGRS amendment/MS amenity/S America/MS American/MS Americana americium Ames amiable/PRT amicable/P amicably amid amide amidst amigo amino amiss amity ammo ammonia/S ammoniac ammonium ammunition/S amnesty amoeba/MS amok among amongst amoral/Y amorality amorous/PY amorphous/PY amount/DGRSZ amour/MS amp/SY ampere/S ampersand/MS amphetamine/S amphibian/MS amphibious/PY amphibology ample/PRT amplify/DGNRSXZ amplitude/MS ampoule/MS amputate/DGNS Amsterdam/M Amtrak/M amulet/S amuse/DGRSVZ amused/Y amusement/MS amusing/PY amyl an Anabaptist/MS anachronism/MS anachronistically anaconda/S anaerobic anagram/MS anal analogical/Y analogous/PY analogy/MS analysis/A analyst/MS analytic/S analytical/Y analyticity/S anaphora anaphoric anaphorically anaplasmosis anarchic anarchical anarchist/MS anarchy anastomoses anastomosis anastomotic anathema anatomic anatomical/SY anatomy ancestor/MS ancestral/Y ancestry anchor/DGS anchorage/MS anchored/U anchorite anchoritism anchovy/S ancient/PSY ancillary/S and/DGSZ Andorra/M anecdotal/Y anecdote/MS anechoic anemometer/MS anemometry anemone anew angel/MS Angeleno/MS angelic anger/DGS angiography angle/DGRSZ Anglican/MS Anglicanism/M Anglophilia/M Anglophobia/M Angola/M angrily angry/PRT angst angstrom/S anguish/D angular/Y anhydrous/Y aniline animal/MPSY animate/DGNPSXY animated/Y animator/MS animism animosity anion/MS anionic/S anise aniseikonic anisotropic anisotropy/MS ankle/MS annal/NS annex/DGS annexation/S annihilate/DGNSV anniversary/MS annotate/DGNSVX announce/DGRSZ announced/U announcement/MS annoy/DGRSZ annoyance/MS annoying/Y annual/SY annul/S annulled annulling annulment/MS annum annunciate/DGNS annunciator/S anode/MS anoint/DGRS anomalous/PY anomaly/MS anomic anomie anon anonymity anonymous/PY anorexia another/M ANSI answer/DGRSZ answerable/U answered/U ant/DGMS antagonism/S antagonist/MS antagonistic antagonistically antarctic Antarctica/M ante/DG anteater/MS antecedent/MSY antedate/DGS antelope/MS antenna/MS antennae anterior/SY anthem/MS anther anthology/S anthracite anthropological/Y anthropologist/MS anthropology anthropomorphic anthropomorphically anti antibacterial antibiotic/S antibody/S antic/MS anticipate/DGNSVX anticipated/U anticipative/Y anticipatory anticoagulation anticompetitive antidisestablishmentarianism antidote/MS antiformant antifundamentalist antigen/MS antihistorical antimicrobial antimony antinomian antinomy antipathy antiphonal/Y antipode/MS antiquarian/MS antiquate/DN antique/MS antiquity/S antiredeposition antiresonance antiresonator antiseptic antisera antiserum antislavery antisocial antisubmarine antisymmetric antisymmetry antithesis antithetical/Y antithyroid antitoxin/MS antitrust/R antler/D anus anvil/MS anxiety/S anxious/PY any anybody/S anyhow anymore anyone/MS anyplace anything/S anyway/S anywhere/S aorta apace apart/P apartheid apartment/MS apathetic apathy ape/DGRS aperiodic aperiodicity aperture/D apex/S aphasia aphasic aphid/MS aphonic aphorism/MS Aphrodite/M apiary/S apical/Y apiece apish/PY aplenty aplomb apocalypse apocalyptic apocrypha apocryphal/PY apogee/S Apollo/M Apollonian apologetic/S apologetically/U apologia apologist/MS apology/MS apostate/S apostle/MS apostolic apostrophe/S apothecary apotheoses apotheosis Appalachia/M Appalachian/MS appalled appalling/Y appanage apparatus/S apparel/S apparent/PY apparently/I apparition/MS appeal/DGRSZ appealing/UY appear/DGRSZ appearance/S appease/DGRS appeasement appellant/MS appellate/NV appellative/Y append/DGRSZ appendage/MS appendices appendicitis appendix/MS appertain/DGS appetite/MSV applaud/DGRS applause apple/MS applejack appliance/MS applicability/I applicable/I applicant/MS application/MS applicative/Y applicator/MS applique/S apply/DGNRSXZ applying/A appoint/DGRSVZ appointee/MS appointment/MS apportion/DGS apportioned/A apportionment/S appraisal/MS appraisals/A appraise/DGRSZ appraised/A appraises/A appraising/Y appreciable/I appreciably/I appreciate/DGNSVX appreciated/U appreciative/IPY apprehend/DGRS apprehensible apprehension/MS apprehensive/PY apprentice/DS apprenticeship/S apprise/DGJRSZ apprize/DGJRSZ apprizing/SY approach/DGRSZ approachability/U approachable/IU approbate/N appropriate/DGNPSTVXY appropriated/U appropriator/MS approval/MS approve/DGRSZ approving/Y approximate/DGNSVXY approximative/Y appurtenance/S apricot/MS April/MS apron/MS apropos apse/S apsis apt/IPUY aptitude/S aqua/S aquaria aquarium Aquarius aquatic/S aqueduct/MS aqueous/Y aquifer/S Arab/MS arabesque Arabia/M Arabian/MS Arabic/M arable arachnid/MS arbiter/MS arbitrarily arbitrary/P arbitrate/DGNSV arbitrator/MS arboreal/Y arc/DGS arcade/DGMS arcane arch/DGPRSVYZ archaeological/Y archaeologist/MS archaeology archaic/P archaically archaism archangel/MS archbishop archdiocese/S archenemy archery archetype/S archfool Archie/M archipelago archipelagoes architect/MS architectonic/S architectural/Y architecture/MS archival archive/DGRSZ archivist/S arclike arctic ardent/Y arduous/PY are/S area/MS aren't arena/MS Argentina/M Argo/MS argon argonaut/S argot arguable/IU arguably/IU argue/DGRSZ argument/MS argumentation argumentative/Y Arianism/M Arianist/MS arid/P aridity Aries aright arise/GJRS arisen aristocracy aristocrat/MS aristocratic aristocratically Aristotelian/M Aristotle/M arithmetic/S arithmetical/Y Arizona/M ark Arkansas/M arm/DGMRSZ armadillo/S Armageddon/M armament/MS armchair/MS armed/AU Armenian/M armful/S armhole armistice armload Armour/M armpit/MS arms/A Armstrong/M army/MS aroma/S aromatic/P arose around arousal arouse/DGS arpeggio/MS arrack arraign/DGS arraignment/MS arrange/DGRSZ arrangement/AMS arrant/Y array/DGRS arrears arrest/DGRSZ arrested/A arresting/Y arrestor/MS arrival/MS arrive/DGRS arrogance arrogant/Y arrogate/DGNS arrow/DGS arrowhead/MS arroyo/S arsenal/MS arsenic arsine/S arson art/MS Artemis arterial/Y arteriolar arteriole/MS arteriosclerosis artery/MS artful/PY arthritis arthrogram/MS arthropod/MS artichoke/MS article/DGMS articulate/DGNPSVXY articulated/U articulator/S articulatory artifact/MS artifice/RS artificial/PY artificiality/S artillerist artillery/S artisan/MS artist/MS artistic/I artistically/I artistry artless/Y artwork Aryan/MS as ASAP asbestos ascend/DGRSZ ascendancy ascendant/Y ascendency ascendent ascension/S ascent ascertain/DGS ascertainable ascetic/MS asceticism ASCII ascot ascribable ascribe/DGS ascription aseptic ash/NRS ashamed/UY ashman ashore ashtray/MS Asia/M Asian/MS Asiatic/MS aside/S asinine/Y ask/DGRSZ askance asked/U askew/P asleep asocial asp/NR asparagus aspect/MS aspersion/MS asphalt/D asphyxia aspic aspirant/MS aspirate/DGNSX aspiration/MS aspirator/S aspire/DGRS aspirin/S ass/MNS assail/DGS assailant/MS assassin/MS assassinate/DGNSX assault/DGRSV assaultive/PY assay/DGRZ assemblage/MS assemble/DGRSZ assembled/AU assembly/MS assent/DGRS assert/DGRSVZ assertion/MS assertive/PY asserts/A assess/ADGS assessment/AMS assessor/MS asset/MS assiduity assiduous/PY assign/DGRSZ assignable/A assigned/AU assignee/MS assignment/AMS assigns/AU assimilate/DGNSVX assist/DGRS assistance/S assistant/MS assistantship/S assisted/U associate/DGNSVX association/MS associational associative/Y associativity/S associator/MS assonance assonant assort/DGRS assortment/MS assuage/DGS assume/DGRS assumption/MS assurance/MS assurances/A assure/DGRSZ assured/PY assuring/AY Assyrian/M Assyriology/M astatine aster/MS asterisk/MS asteroid/MS asteroidal asthma astonish/DGS astonishing/Y astonishment astound/DGS astounding/Y astral/Y astray astride astringency astringent/Y astronaut/MS astronautics astronomer/MS astronomical/Y astronomy astrophysical astrophysics astute/PY asunder asylum/S asymmetric asymmetrical/Y asymmetry/S asymptomatically asymptote/MS asymptotic/Y asymptotically asynchronism asynchronous/Y asynchrony at atavistic ate atemporal atheism atheist/MS atheistic Athena/M Athenian/MS Athens atherosclerosis athlete/MS athletic/S athleticism Atlantic/M atlas ATM's atmosphere/DMS atmospheric/S atoll/MS atom/MS atomic/S atomically atonal/Y atone/DGS atonement atop atrocious/PY atrocity/MS atrophic atrophy/DGS attach/DGRSZ attache/DGRSZ attached/U attachment/MS attack/DGRSZ attackable attacker/MS attain/DGRSZ attainable/P attainably attainment/MS attempt/DGRSZ attend/DGRSZ attendance/MS attendant/MS attended/U attendee/MS attention/MS attentional attentionality attentive/IPY attenuate/DGNS attenuated/U attenuator/MS attest/DGRS attic/MS attire/DGS attitude/MS attitudinal/Y attorney/MS attract/DGSV attraction/MS attractive/PUY attractor/MS attributable attribute/DGNRSVX attributed/U attributive/Y attrition attune/DGS atypical/Y auburn Auckland/M auction/DG auctioneer/MS audacious/PY audacity audible/I audibly/I audience/MS audio audiogram/MS audiological audiologist/MS audiology audiometer/MS audiometric audiometry audit/DGSV audition/DGMS auditor/MS auditorium/S auditory Audubon/M auger/MS aught augment/DGRS augmentation/S augur/S august/PY Augusta/M Augusts aunt/MSY aura/MS aural/Y aureole aureomycin aurora auscultate/DGNSX auspice/S auspicious/IPY austere/PY austerity Austin/M Australia/M Australian/MS Austria/M Austrian/M authentic/IU authentically authenticate/DGNSX authenticated/U authenticator/S authenticity/I author/DGMS authoritarian authoritarianism authoritative/PY authority/MS authorship autism autistic auto/MS autobiographic autobiographical/Y autobiography/MS autocollimator autocorrelate/DGNSX autocracy/S autocrat/MS autocratic autocratically autodial autofluorescence autograph/DG autographs automata automate/DGNS automatic/S automatically automaton/S automobile/MS automotive autonavigator/MS autonomic autonomous/Y autonomy autopilot/MS autopsy/DS autoregressive autorepeat/GS autosuggestibility autotransformer autumn/MS autumnal/Y auxiliary/S avail/DGRSZ availability/S available/P availably avalanche/DGS avant avarice avaricious/PY Ave avenge/DGRS avenue/MS aver/S average/DGPSY averred averrer averring avers/V averse/NPVXY aversion/MS avert/DGS avian aviary/S aviation aviator/MS avid/PY avidity avionic/S avocado/S avocation/MS avoid/DGRSZ avoidable/U avoidably/U avoidance avouch avow/DRS avowed/Y await/DGS awake/DGS awaken/DGRS award/DGRSZ aware/PU awash away/P awe/DG awesome/PY awful/PY awhile/S awkward/PY awl/MS awning/DMS awoke awry ax/DGRSZ axe/DGNRSXZ axial/Y axiological/Y axiom/MS axiomatic/S axiomatically axion/MS axis axle/MS axolotl/MS axon/MS aye/RSZ azalea/MS azimuth/M azimuths azure babble/DGRS babe/MS Babel/M baby/DGMS babyhood babyish babysit/S babysitter/S baccalaureate Bach/M bachelor/MS bacilli bacillus back/DGRSZ backache/MS backbone/MS backdrop/MS backed/U background/MS backlash/R backlog/MS backpack/MRSZ backplane/MS backscatter/DGS backslash/DGS backspace/DGS backstabber backstabbing backstage backstairs backstitch/DGS backtrack/DGRSZ backup/S backward/PSY backwater/MS backwoods backyard/MS bacon/R bacteria bacterial/Y bacterium bad/NPSY bade badge/DGRSZ badger/DGMS badlands badminton baffle/DGRSZ baffling/Y bag/MS bagatelle/MS bagel/MS baggage bagged bagger/MS bagging baggy/PRS bagpipe/MRS Bagrodia/MS bah bail/GRY bailiff/MS bait/DGRS bake/DGJRSZ bakery/MS baklava balalaika/MS balance/DGRSZ balanced/PU balcony/DMS bald/GPRY bale/DGRSZ baleful/PY balk/DGRS Balkan/MS balky/PR ball/DGRSZ ballad/MS ballast/MS ballerina/MS ballet/MS ballistic/S balloon/DGRSZ ballot/DGMRS ballplayer/MS ballroom/MS ballyhoo balm/MS balmy/PR balsa balsam/S Baltic/M balustrade/MS bamboo/S ban/GMS banal/Y banana/MS band/DGRS bandage/DGRS bandit/MS bandpass bandstand/MS bandwagon/MS bandwidth bandwidths bandy/DGS bane/G baneful/Y bang/DGRS Bangladesh/M bangle/MS banish/DGRS banishment banister/MS banjo/MS bank/DGRSZ bankrupt/DGS bankruptcy/MS banned/U banner/MS banning/U banquet/DGJRS bans/U banshee/MS bantam banter/DGRS bantering/Y Bantu/MS baptism/MS baptismal/Y baptist/MS baptistery baptistry/MS bar/DGMRST barb/DRSZ Barbados barbarian/MS barbaric barbarity/S barbarous/PY barbecue/DGRS barbed/P barbell/MS barber/DGS barbered/U barbital barbiturate/S bard/MS bare/DGPRSTY barefoot/D barfly/MS bargain/DGRS barge/DGS baritone/MS barium bark/DGRSZ barley barn/MS barnstorm/DGRS barnyard/MS barometer/MS barometric baron/MS baroness baronial barony/MS baroque/PY barrack/RS barracuda/MS barrage/DGMS barred/U barrel/MS barren/PS barricade/MS barrier/MS barring/R barrow/S bartender/MS barter/DGRS bas/DGRST basal/Y basalt base/DGPRSTY baseball/MS baseboard/MS baseless baseline/MS baseman basement/MS bash/DGRS bashful/PY basic/S basically basil basin/DMS basis bask/DG basket/MS basketball/MS bass/MS basset bassinet/MS basso bastard/MSY baste/DGNRSX bastion/DMS bat/DGMRS batch/DGRS bated/AU bath/DGRSZ bathe/DGRSZ bathos bathrobe/MS bathroom/DMS baths bathtub/MS baton/MS battalion/MS batted batten/DGS batter/DGS battery/MS batting battle/DGRSZ battlefield/MS battlefront/MS battleground/MS battlement/DMS battleship/MS bauble/MS baud/S bauxite bawdy/PR bawl/DGRS Baxter/M bay/DGSY bayonet/DGMS bayou/MS bazaar/MS be/DGHSTY beach/DGS beachhead/MS beacon/DGMS bead/DGS beadle/MS beady beagle/MS beak/DRSZ beam/DGRSZ bean/DGRSZ beanbag/MS bear/GJRSZ bearable/U bearably/U beard/DS bearded/P beardless bearish/PY beast/JSY beastly/PR beat/GJNRSZ beatable/U beatably/U beaten/U beatific beatify/N beatitude/MS beatnik/MS beau/MS beauteous/PY beautiful/PY beautifully/U beautify/DGNRSXZ beauty/MS beaver/MS becalm/DGS became because beck beckon/DGS become/GS becoming/UY bed/MS bedazzle/DGS bedazzlement bedbug/MS bedded bedder/MS bedding bedevil/S bedfast bedlam bedpost/MS bedraggle/D bedridden bedrock/M bedroom/DMS bedside bedspread/MS bedspring/MS bedstead/MS bedtime bee/GJRSZ beech/NR beef/DGRSZ beefsteak beefy/R beehive/MS been/S beep/DGRS beet/MS Beethoven/M beetle/DGMS befall/GNS befell befit/MS befitted befitting/Y befog/S befogged befogging before beforehand befoul/DGS befriend/DGS befuddle/DGS beg/S began beget/S begetting beggar/DGSY beggarly/P beggary begged begging begin/S beginner/MS beginning/MS begot begotten begrudge/DGRS begrudging/Y beguile/DGRS beguiling/Y begun behalf behave/DGRS behead/G beheld behest behind behold/GNRSZ beige belated/PY belay/DGS belch/DGS belfry/MS Belgian/MS Belgium/M belie/DRS belief/MS believability believable/U believably/U believe/DGRSZ believing/U belittle/DGRS bell/MS bellboy/MS belle/MS bellhop/MS bellicose/PY bellicosity belligerence belligerent/MSY bellman bellmen Bellovin/M bellow/DGS bells/A bellwether/MS belly/DGMS bellyful belong/DGJS belonging/PS beloved below belt/DGS belted/U Belushi/M bely/DGRS bemoan/DGS bench/DGRS benchmark/GMS bend/DGRSZ bendable/U beneath Benedict/M Benedictine/M benediction/MS benefactor/MS beneficence/S beneficial/PY beneficiary/S benefit/DGRSZ benevolence benevolent/PY Bengal/M Bengali/M benighted/PY benign/Y bent/S Benzedrine/M benzene bequeath/DGS bequest/MS berate/DGS bereave/DGS bereavement/S bereft beret/MS Bergsten/M beribboned beriberi Berkeley/M berkelium Berlin/MRZ Bermuda/M berry/DGMS berth/DGJ berths beryl beryllium beseech/GS beseeching/Y beset/S besetting beside/S besiege/DGRZ besmirch/DGS besotted besotting besought bespeak/S bespectacled Bessel/M best/DGRS bestial/Y bestow/D bestowal bestseller/MS bestselling bet/MS beta/S betide betray/DGRS betrayal betroth/D betrothal/S betrothed/U better/DGS betterment/S betting between/P betwixt bevel/S beverage/MS Beverly/M bevy/S bewail/DGS beware bewhiskered bewilder/DGS bewildered/PY bewildering/Y bewilderment bewitch/DGS bewitching/Y beyond biannual bias/DGPS bib/MS bibbed bibbing bible/MS biblical/Y bibliographic/S bibliographical/Y bibliography/MS bibliophile/S bicameral bicarbonate bicentennial biceps bicker/DGRS biconcave biconvex bicycle/DGRSZ bid/DGMRS biddable bidden/U bidder/MS bidding/A biddy/S bide/DGRS bidirectional bids/A biennial/Y biennium bifocal/S bifurcate/DGNSXY big/PY bigger biggest bight/MS bigot/DGMS bigoted/Y bigotry bijection/MS bijective/Y bike/DGMRSZ biker/MS bikini/DMS bilabial bilateral/PY Bilbo/M bile bilge/DGMS bilinear bilingual/SY bilk/DGRS bill/DGJRSZ billboard/MS billet/DGS billiard/S billion/HS billow/DGS bimodal bimolecular/Y bimonthly/S bin/MS binary/S binaural/Y bind/DGJRSZ binding/PSY bing/N binge/S bingo/S binocular/SY binomial/Y binuclear biochemical/Y biochemistry biofeedback biographer/MS biographic biographical/Y biography/MS biological/SY biologist/MS biology biomedical biomedicine biopsy/S bipartisan bipartite/NY biped/S biplane/MS bipolar biracial birch/NRS bird/MRS birdbath/M birdbaths birdie/DS birdlike birefringence birefringent birth/D birthday/MS birthplace/S birthright/MS births biscuit/MS bisect/DGS bisection/MS bisector/MS bishop/MS bismuth bison/MS bisque/S bit/GMRSZ bitblt/S bitch/MS bite/GRSZ biting/Y bitmap/MS bits/R bitten bitter/PRSTY bittersweet/PY bituminous bitwise bivalve/DMS bivariate bivouac/S biweekly bizarre/PY blab/S blabbed blabbermouth blabbermouths blabbing black/DGNPRSTXY blackberry/MS blackbird/MRS blackboard/MS blacken/DGRS blackjack/MS blacklist/DGRS blackmail/DGRSZ blackout/MS blacksmith/GM blacksmiths bladder/MS blade/DMS blamable blame/DGRSZ blameless/PY blanch/DGRS bland/PY blank/DGPRSTY blanket/DGRSZ blare/DGS blase blaspheme/DGRS blasphemous/PY blasphemy/S blast/DGRSZ blatant/PY blaze/DGRSZ blazing/Y bleach/DGRSZ bleak/PY blear bleary/P bleat/GRS bled bleed/GJRSZ blemish/DGMS blemished/U blend/DGRSZ bless/DGJS blessed/PY blew blight/DR blimp/MS blind/DGPRSYZ blinded/U blindfold/DGS blinding/Y blink/DGRSZ blinker/DGS blinking/U blip/MS bliss blissful/PY blister/DGS blistering/Y blithe/RTY blitz/MS blitzkrieg blizzard/MS bloat/DGRSZ blob/MS bloc/MS block/DGMRSZ blockade/DGRS blockage/MS blockhouse/S bloke/MS blond/MS blonde/MS blood/DS bloodhound/MS bloodless/PY bloodshed bloodshot bloodstain/DMS bloodstream bloody/DGPT bloom/DGRSZ blossom/DS blot/MS blotted blotting blouse/GMS blow/DGRSZ blowfish blown/U blowup blubber/DG bludgeon/DGS blue/DGPRSTY blueberry/MS bluebird/MS bluebonnet/MS bluefish blueprint/DGMS bluestocking bluff/DGPRSY bluish/P blunder/DGJRS blundering/SY blunt/DGPRSTY blur/MS blurb blurred/Y blurring/Y blurry/PR blurt/DGRS blush/DGRS blushing/UY bluster/DGRS blustering/Y blustery boar board/DGRSZ boardinghouse/MS boards/I boast/DGJRSZ boastful/PY boat/DGRSZ boathouse/MS boatload/MS boatman boatmen boatswain/MS boatyard/MS bob/MS bobbed bobbin/MS bobbing bobby/S bobolink/MS bobwhite/MS bode/DGS bodice bodied/U bodily body/DGS bodybuilder/MS bodybuilding bodyguard/MS bog/MS bogged boggle/DGS bogus boil/DGRSZ boilerplate boisterous/PY bold/PRTY boldface/DGS Bolivia/M boll Bologna/M Bolshevik/MS Bolshevism/M bolster/DGRS bolt/DGRS bolted/U bomb/DGJRSZ bombard/DGS bombardment/S bombast/R bombastic bombproof bonanza/MS bond/DGRSZ bondage bonds/A bondsman bondsmen bone/DGRSZ boned/U bonfire/MS bong bonnet/DS bonneted/U bonny/R bonus/MS bony/R boo/HS boob booboo booby/S book/DGJRSZ bookcase/MS bookie/MS bookish/PY bookkeeper/MS bookkeeping booklet/MS bookseller/MS bookshelf/M bookshelves bookstore/MS boolean/S boom/DGRS boomerang/MS boon boor/MS boorish/PY boost/DGRS boot/ADGS booths bootleg/S bootlegged bootlegger/MS bootlegging bootstrap/MS bootstrapped bootstrapping booty/S booze/GR borate/DS borax bordello/MS border/DGJRS borderland/MS borderline bore/DGRSZ boredom boric boring/PY born/AIU borne Borneo/M boron borough boroughs borrow/DGJRSZ bosom/MS boss/DS Boston/M Bostonian/MS bosun botanical/Y botanist/MS botany botch/DGRSZ both/RZ bother/DGS bothersome Botswana/M bottle/DGRSZ bottleneck/MS bottom/DGRS bottomless/PY botulinus botulism bouffant bough/DM boughs bought/N boulder/DMS boulevard/MS bounce/DGRSZ bouncing/Y bouncy/R bound/DGNRS boundary/MS bounded/AU boundless/PY bounds/AI bounteous/PY bounty/DMS bouquet/MS bourbon/S bourgeois bourgeoisie Bourne/M bout/MS bovine/SY bow/DGNRSZ bowed/U bowel/MS bowl/DGRSZ bowline/MS bowman bows/R bowstring/MS box/DGRSZ boxcar/MS boxwood boy/MRS boycott/DGRS boyfriend/MS boyhood boyish/PY bra/MS brace/DGRS bracelet/MS bracket/DGS brackish/P brae/MS brag/S bragged bragger bragging braid/DGRS braille brain/DGS brainchild/M brainstorm/GMRS brainwash/DGRS brainy/PR brake/DGS bramble/GMS brambly bran branch/DGJS branched/U brand/DGRS brandish/GS brandy/DGS brash/PY brass/DS brassiere brassy/PR brat/MS bravado brave/DGPRSTY bravery bravo/DGS bravura brawl/DGRS brawn bray/DGRS braze/DGRS brazen/DGPY brazier/MS Brazil/M Brazilian/M breach/DGRSZ bread/DGHS breadboard/MS breadwinner/MS break/GRSZ breakable/S breakage breakaway breakdown/MS breakfast/DGRSZ breakpoint/DGMS breakthrough/MS breakthroughs breakup/S breakwater/MS breast/DGS breastwork/MS breath/DGRSZ breathable/U breathe/DGRSZ breathless/PY breaths breathtaking/Y breathy/R bred/IU breech/GMS breed/GRS breeze/DGMS breezily breezy/PR bremsstrahlung Bresenham/M brethren breve/S brevet/DGS brevity brew/DGRSZ brewery/MS briar/MS bribe/DGRSZ brick/DGRS bricklayer/MS bricklaying bridal bride/MS bridegroom bridesmaid/MS bridge/DGS bridgeable bridgehead/MS bridgework/M bridle/DGS bridled/U brief/DGJPRSTY briefcase/MS briefing/MS brier brig/MS brigade/DGMS brigadier/MS brigantine bright/GNPRSTXY brighten/DGRSZ brightness/S brilliance brilliancy brilliant/PY brim brimful brimmed brindle/D brine/GR bring/GRSZ brink brinkmanship brisk/PRY bristle/DGS Britain/M britches British/RY Briton/MS brittle/DGPRTY broach/DGRS broad/NPRSTXY broadband broadcast/DGJRSZ broadcasts/A broaden/DGJRSZ broadside brocade/D broccoli brochure/MS broil/DGRSZ broke/RZ broken/PY brokerage bromide/MS bromine/S bronchi bronchial bronchiole/MS bronchitis bronchus bronze/DGRS brooch/MS brood/GRS brooding/Y brook/DS broom/DGMS broomstick/MS broth/RZ brothel/MS brother/MSY brotherhood brotherly/P brought brow/MS browbeat/GNS brown/DGJPRSTY brownie/MS brownish brows/DGRSZ browse/DGRSZ bruise/DGRSZ brunch/S brunette/S brunt brush/DGRS brushfire/MS brushlike brushy/R brusque/PY brutal/Y brutality/S brute/MS brutish/PY BSD bubble/DGRS bubbly/R buck/DGRS buckboard/MS bucket/DGMS buckle/DGRS buckshot buckskin/S buckwheat bucolic bud/MS budded budding buddy/MS budge/DGS budget/DGRSZ budgetary budging/U Buehring/M buff/GMRSZ buffalo buffaloes buffer/DGMRSZ buffered/U bufferer/MS buffet/DGJS buffoon/MS bug/MS bugged bugger/DGMS bugging buggy/MS bugle/DGRS build/DGJRSZ building/MS buildup/MS built/AIU bulb/DMS bulge/DGS bulk/DS bulkhead/DMS bulky/PR bull/DGS bulldog/MS bulldoze/DGRSZ bullet/MS bulletin/MS bulletproof/DGS bullion bullish/PY bully/DGS bulwark bum/MS bumble/DGRSZ bumblebee/MS bumbling/Y bummed bummer/S bumming bump/DGRSZ bumptious/PY bun/MS bunch/DGS bundle/DGRS bundled/U bungalow/MS bungle/DGRSZ bungling/Y bunion/MS bunk/DGRSZ bunker/DGMS bunkhouse/MS bunkmate/MS bunny/MS bunt/DGRSZ buoy/DGS buoyancy buoyant/Y burden/DGMS burdened/U burdensome/PY bureau/MS bureaucracy/MS bureaucrat/MS bureaucratic/U burgeon/DGS burger burgess/MS burgher/MS burglar/MS burglarproof/DGS burglary/MS burgle/DGS burial buried/U burl/DR burlesque/DGRSY burly/PR burn/DGJRSZ burned/U burning/SY burnish/DGRS burnt/PY burp/DGS burr/DMRS burro/MS burrow/DGRS bursa/S bursitis burst/DGRS bury/DGRS bus/DGS busboy/MS bush/DGJS bushel/MS bushwhack/DGRS bushy/PR busily business/MS businesslike businessman businessmen buss/DGS bust/DGRS bustard/MS bustle/DG bustling/Y busy/DGPRST but/A butane butcher/DGMRSY butchery butler/MS butt/DGMRSZ butte/DGRSZ butted/A butter/DGRSZ buttered/U butterfat butterfly/MS butternut butting/A buttock/MS button/DGRS buttoned/U buttonhole/MRS buttons/U buttress/DGS butyl butyrate buxom/PY buy/GRSZ buyer/MS buzz/DGRS buzzard/MS buzzword/MS buzzy by/R bye/SZ bygone/S bylaw/MS byline/MRS bypass/DGS byproduct/MS bystander/MS byte/MS byway/S byword/MS cab/MRS cabbage/DGMS cabin/MS cabinet/MS cable/DGS cache/DGMRS cackle/DGRS cacti cactus/S cad cadence/DGS cafe/MS cafeteria/MS cage/DGRSZ caged/U cajole/DGRS cake/DGS calamity/MS calcium calculate/ADGNSVX calculated/PY calculating/AU calculator/MS calculus calendar/DGMS calf/S calibrate/DGNRSX calibrator/S calico California/M Californian/MS caliph caliphs call/DGRSZ called/AU caller/MS callous/DPY calm/DGPRSTY calming/Y calorie/MS calves Cambridge/M came/N camel/MS camera/MS camouflage/DGS camp/DGRSZ campaign/DGRSZ campus/MS can/DGMRS can't Canada/M canal/MS canary/MS cancel/S cancellation/MS cancer/MS candid/PY candidate/MS candidly/U candle/DGRS candlestick/MS candy/DGS cane/DGRS canker/DG canned canner/MS cannibal/MS canning cannister/MS cannon/DGMS cannot canoe/DMS canon/MS canonical/SY canopy cantankerous/PY canto/S canton/MS cantor/MS canvas/MRS canvass/DGRSZ canyon/MS cap/MRSZ capability/MS capable/IP capably/I capacious/PY capacitance/S capacitive/Y capacitor/MS capacity/S cape/RSZ caper/DGS capillary capita capital/SY capitalism capitalist/MS capitol/MS capped/A capping/A capricious/PY captain/DGS caption/DGMRS captivate/DGNS captive/MS captivity captor/MS capture/DGRSZ car/DGMRSZ caravan/MRS carbohydrate/MS carbolic carbon/MS carbonate/DNS carbonic carcass/MS card/DGMRS cardboard/S cardiac cardinal/SY cardinality/MS care/DGRSZ cared/U career/DGMS carefree careful/PY careless/PY caress/DGRSV caressing/Y caressive/Y caret/S cargo/S cargoes caribou/S caring/U carnation/IS carnival/MS carnivorous/PY carol/MS Carolina/MS carpenter/DGMS carpet/DGS carriage/MS carrot/MS carry/DGRSZ carryover/S cart/DGRSZ Cartesian cartography carton/MS cartoon/MS cartridge/MS carve/DGJRSZ cascade/DGS case/DGJS casement/MS cash/DGRSZ cashier/MS cask/MS casket/MS casserole/MS cast/DGJMRSZ caste/DGHJMRSZ castle/DGS casual/PSY casualty/MS cat/MRSZ catalyst/MS cataract/S catastrophe/MS catastrophic catch/GRSZ catchable/U catcher/MS categorical/Y category/MS cater/DGRS caterpillar/MS cathedral/MS catheter/S cathode/MS catholic/MS catsup cattle caught/U causal/Y causality causation/MS cause/DGRS caused/U causeway/MS caustic/SY caution/DGJRSZ cautious/IPY cavalier/PY cavalry cave/DGRS caveat/MS cavern/MS cavity/MS caw/DGS CDC CDC's cease/DGS ceaseless/PY ceasing/U cedar ceiling/DMS celebrate/DGNSX celebrated/P celebratory celebrity/MS celery celestial/Y celibate/S cell/DS cellar/DGMRS cellist/MS cellular/Y cement/DGRS cemetery/MS censor/DGS censored/U censorship censure/DGRS census/MS cent/S centipede/MS central/SY centrifuge/DGMS centripetal/Y century/MS CEO cereal/MS cerebral/Y ceremonial/PY ceremony/MS certain/UY certainty/SU certifiable certificate/DGNSX certified/U certify/DGNRSXZ cessation/MS chafe/GR chaff/GR chaffer/DGR chagrin/DGS chain/DGS chair/DGS chairman chairmanship/S chairmen chairperson/MS chalice/DMS chalk/DGS challenge/DGRSZ challenged/U challenging/Y chamber/DGRSZ chamberlain/MS champagne champaign champion/DGS championship/MS chance/DGS chancellor/S chandelier/MS change/DGRSZ changeability/U changeable/P changeably/U changed/U changeover/MS channel/S chant/DGRS chanticleer/MS chaos chaotic chap/MS chapel/MS chaperon/D chaplain/MS chapter/DGMS char/GS character/DGMS characteristic/MS characteristically/U charcoal/DS charge/DGRSZ chargeable/P charged/AU charges/A chariot/MS charitable/PU charity/MS charm/DGRSZ charming/Y chart/DGJRSZ chartable charted/U charter/DGRSZ chartered/U chartering/A chase/DGRSZ chasm/MS chaste/PRTY chastise/DGRSZ chat/S chateau/MS chatter/DGRSYZ chauffeur/DGS chauvinism/M chauvinist/MS chauvinistic cheap/NPRTXY cheapen/DGS cheat/DGRSZ check/DGRSZ checkable/U checked/AU checker/DGS checkout/S checkpoint/MS checks/A checksum/MS cheek/MS cheer/DGRSYZ cheerful/PY cheerily cheerless/PY cheery/PR cheese/DGMS chef/MS chemical/SY chemise/S chemist/MS chemistry/S cherish/DGRS cherry/MS cherub/MS cherubim chess chest/RS chestnut/MS chew/DGRSZ chick/NSX chickadee/MS chicken/DGS chide/DGS chief/MSY chieftain/MS chiffon child/MY childhood/S childish/PY children/M chill/DGPRSZ chilling/Y chilly/PRS chime/DGMRS chimney/DMS chin/MS Chinese/M chink/DS chinned chinner/S chinning chintz chip/MS chipmunk/MS chirp/DGS chisel/S chivalrous/PY chivalrously/U chivalry chlorine chloroplast/MS chock/DGMRS chocolate/MS choice/PRSTY choir/MS choke/DGRSZ choking/Y cholera choose/GRSZ chop/S chopped chopper/MS chopping choral/Y chord/DGMS chore/GNS chorus/DS chose chosen/U christen/DGS Christian/MS Christians/N Christmas chronic chronicle/DRSZ chronological/Y chronology/MS chubby/PRT chuck/DGMS chuckle/DGS chuckling/Y chum/S chump/GMS chunk/MS church/DGSY churchly/P churchman churchyard/MS churn/DGRSZ chute/DGMS cider/S cigar/MS cigarette/MS cinder/MS cinnamon cipher/DGMS circle/DGRS circuit/DGMS circuitous/PY circuitry circular/MPSY circularity/S circulate/DGNSVX circumference/S circumflex/S circumlocution/MS circumspect/Y circumstance/DGMS circumstantial/Y circumvent/DGS circumventable circus/MS cistern/MS citadel/MS citation/AMS citations/AI cite/ADGIS citizen/MSY citizenship city/DMS civic/S civil/UY civilian/MS civility/S clad/S claim/ADGRS claimable/A claimant/MS claimed/AU clairvoyant/SY clam/MS clamber/DGRS clamorous/PUY clamp/DGRS clan/S clang/DGRSZ clap/S clarify/DGNRSX clarity/U clash/DGRS clasp/DGRS class/DGRS classic/S classical/Y classifiable classified/AU classifieds classify/DGNRSXZ classmate/MS classroom/MS classwork clatter/DGRS clattering/Y clause/MS claw/DGRS clay/DGMS clean/DGPRSTYZ cleaner/MS cleanly/PR cleans/DGRSZ cleanse/DGRSZ cleanup/MS clear/DGJPRSTY clearance/MS cleared/U clearing/MS cleavage/S cleave/DGRSZ cleft/MS clench/DGS clenched/U clergy clergyman clerical/SY clerk/DGMSY clever/PRTY cliche/MS click/DGRSZ client/MS cliff/MS climate/MS climatic climatically climax/DGS climb/DGRSZ clime/MS clinch/DGRS clinching/Y cling/GS clinic/MS clinical/Y clink/DRZ clinker/DGS clip/MS clipped/U clipper/MS clipping/MS clique/MS cloak/DGMS clobber/DGS clock/DGJRSZ clockwise clockwork clod/MS clog/MS clogged clogging cloister/DGMS clone/DGRSZ close/DGJPRSTYZ closed/IU closeness/S closet/DS closure/DGMS cloth/DGS clothe/DGS clothed/U cloud/DGS clouded/U cloudless/PY cloudy/PRT clout clove/RS clown/GS club/MS clubbed clubbing cluck/DGS clue/GMS clump/DGS clumsily clumsy/PRT clung cluster/DGJS clustered/AU clusters/A clutch/DGS clutter/DGS cluttered/U CMOS coach/DGMRS coachman coagulate/DGNS coal/DGRS coalesce/DGS coalition coarse/PRTY coarsen/DG coast/DGRSZ coastal coat/DGJRSZ coated/U coax/DGRS coaxial/Y cobbler/MS Cobol/M cobweb/MS cock/DGRS cockroach/S cocktail/MS cocoa coconut/MS cocoon/MS cod/DGJRSZ code/DGJRSZ coded/AU coder/MS codeword/MS codification/MS codifier/MS codify/DGNRSXZ coefficient/MSY coerce/DGNSVX coercive/PY coexist/DGS coexistence coffee/MS coffer/MS coffin/MS cogent/Y cogitate/DGNSV cognition/AS cognitive/SY cohabit/DGS cohabitation/S cohere/DGRS coherence/I coherent/IY cohesion cohesive/PY coil/ADGS coiled/AU coin/DGRS coinage/A coincide/DGS coincidence/MS coincidental/Y coined/U coke/GS cold/PRSTY Coleman/M collaborate/DGNSVX collaborative/Y collaborator/MS collapse/DGS collar/DGS collate/DGNSVX collateral/Y collator/S colleague/MS collect/ADGSV collected/PY collectible collection/AMS collective/SY collector/MS college/MS collegiate/Y collide/DGS collie/DRS collision/MS cologne/D colon/MS colonel/MS colonial/PSY colonist/MS colony/MS Colorado/M colossal/Y colt/MRS column/DMS columnar comb/DGJRSZ combat/DGSV combatant/MS combative/PY combination/AMS combinational/A combinator/MS combinatorial/Y combinatoric/S combine/DGRSZ combustion/S Comdex/M come/GHJRSTYZ comedian/MS comedic comedy/MS comely/PR comestible/S comet/MS comfort/DGRSZ comfortability/S comfortable/P comfortably/U comforted/U comforting/Y comic/MS comical/Y comma/MS command/DGMRSZ commandant/MS commandeer/DGS commanding/Y commandment/MS commemorate/DGNSVX commemorative/SY commence/DGRS commenced/A commencement/MS commences/A commend/ADGRS commendation/AMS commensurate/NSXY comment/DGMRS commentary/MS commentator/MS commented/U commerce/DG commercial/PSY commission/DGRSZ commit/S commitment/MS committed/U committee/MS committing commodity/MS commodore/MS common/PRSTYZ commonality/S commoner/MS commonplace/PS commonwealth commonwealths commotion/S communal/Y commune/DGNS communicant/MS communicate/DGNSVX communicative/PY communicator/MS communist/MS community/MS commutative/Y commutativity commute/DGRSZ compact/DGPRSTYZ compactor/MS companion/MS companionable/P companionship company/MS comparability/I comparable/P comparably/I comparative/PSY comparator/MS compare/DGRS comparison/MS compartment/DGS compass/DGS compassion compassionate/PY compatibility/IMS compatible/PS compatibly/I compel/S compelled compelling/Y compendium compensate/DGNSVX compensatory compete/DGS competence/S competent/IY competition/MS competitive/PY competitor/MS compilable compilation/MS compilations/A compile/DGRSZ compiler/MS complain/DGRSZ complaining/UY complaint/MS complement/DGRSZ complementary/P complete/DGNPRSVXY completed/U complex/PSY complexion/D complexity/S compliance/S complicate/DGNSX complicated/PY complicator/MS complicity compliment/DGRSZ complimentary/U comply/DGNRSXZ component/MS compose/DGRSZ composed/PY composer/MS composite/NSXY compositional/Y composure compound/DGRS comprehend/DGS comprehending/U comprehensibility/I comprehensible/IP comprehension/I comprehensive/PY compress/DGSUV compressed/Y compressible/I compression/S compressive/Y comprise/DGS compromise/DGRSZ compromising/UY comptroller/MS compulsion/MS compulsory compunction/S computability computable/IU computation/MS computational/Y compute/DGRSZ computer/MS computerese comrade/SY comradely/P comradeship concatenate/DGNSX conceal/DGRSZ concealing/Y concealment concede/DGRS conceded/Y conceit/DS conceited/PY conceivable/IU conceivably/I conceive/DGRS concentrate/DGNSVX concentrator/S concentric concept/MSV conception/MS conceptual/Y concern/DGS concerned/UY concert/DS concerted/PY concession/MRS concise/NPXY conclude/DGRS conclusion/MS conclusive/IPY concomitant/SY concord concrete/DGNPSY concur/S concurred concurrence concurrency/S concurrent/Y concurring condemn/DGRSZ condemnation/S condensation condense/DGRSZ condescend/GS condescending/Y condition/DGRSZ conditional/SY conditionally/U conditioned/AU condone/DGRS conducive/P conduct/DGSV conduction conductive/Y conductivity/S conductor/MS conduit/S cone/DGMS confederacy confederate/NSVX confer/S conference/GMS conferred conferrer/MS conferring confess/DGS confessed/Y confession/MS confessor/MS confidant/MS confide/DGRS confidence/S confident/Y confidential/PY confidentiality confiding/PY configurable/A configuration/AMS configure/ADGS confine/DGRS confined/U confinement/MS confirm/DGS confirmation/MS confirmed/PY confiscate/DGNSX conflict/DGSV conflicting/Y conform/DGRSZ conformity/IU confound/DGRS confounded/Y confront/DGRSZ confrontation/MS confuse/DGNRSXZ confused/PY confusing/Y congenial/Y congested congestion congratulate/DNSX congregate/DGNSX congress/DGMS congressional/Y congressman congruence/I congruent/IY conjecture/DGRS conjoined conjunct/DSV conjunction/MS conjunctive/Y conjure/DGRSZ connect/DGRSVZ connected/PY connection/MS connective/MSY connectivity/S connector/MS connoisseur/MS connote/DGS conquer/DGRSZ conquerable/U conqueror/MS conquest/MS cons conscience/MS conscientious/PY conscious/PSY consecrate/DGNSVX consecutive/PY consensus consent/DGRSZ consenting/Y consequence/MS consequent/PSY consequential/PY consequentiality/S consequentially/I consequently/I conservation/MS conservationist/MS conservatism conservative/PSY conserve/DGRS consider/DGRS considerable/I considerably/I considerate/NPXY consideration/AI considered/AU consign/DGS consist/DGS consistency/IS consistent/IY consolable/I consolation/MS console/DGRSZ consolidate/DGNSX consolidated/AU consolidates/A consoling/Y consonant/MSY consort/DGS consortium conspicuous/IPY conspiracy/MS conspirator/MS conspire/DGS constable/MS constancy/I constant/SY constantly/I constellation/MS consternation constituency/MS constituent/MSY constitute/DGNSVX constituted/A constitutes/A constitutional/UY constitutionality/U constitutive/Y constrain/DGS constrained/Y constraint/MS construct/ADGSV constructibility constructible/A construction/MS constructions/A constructive/PY constructor/MS construe/DGS consul/MS consulate/MS consult/DGRSV consultant/MS consultation/MS consultative consumable/S consume/DGRSZ consumed/Y consumer/MS consuming/Y consummate/DGNSVXY consumption/MS consumptive/Y contact/DGS contacted/A contagion contagious/PY contain/DGRSZ containable containment/MS contaminate/DGNSVX contaminated/U contemplate/DGNSVX contemplative/PY contemporaneous/PY contemporary/PS contempt contemptible/P contemptuous/PY contend/DGRSZ content/DGSY contented/PY contention/MS contentment contest/DGRSZ contestable/I contested/U context/MS contextual/Y contiguity contiguous/PY continent/MSY continental/Y continently/I contingency/MS contingent/MSY continual/Y continuance/MS continuation/MS continue/DGRS continuity/S continuous/PY continuum contour/DGMS contract/DGSV contraction/MS contractor/MS contractual/Y contradict/DGS contradiction/MS contradictory/P contradistinction/S contrapositive/S contraption/MS contrary/P contrast/DGRSVZ contrasting/Y contrastive/Y contribute/DGNRSVXZ contributive/Y contributor/MS contributorily contributory contrivance/MS contrive/DGRS control/MS controllability/U controllable/IU controllably/U controlled/U controller/MS controlling controversial/Y controversy/MS conundrum/MS convalescence convene/DGRSZ convened/A convenes/A convenience/MS convenient/IY convent/MS convention/MS conventional/UY converge/DGS convergence/S convergent conversant/Y conversation/MS conversational/Y converse/DGNSXY conversion/GS convert/DGRSZ convertibility/I convertible/IU convertibleness converts/A convex convey/DGRSZ conveyance/DGMRSZ convict/DGSV conviction/MS convince/DGRSZ convinced/U convincing/PUY convoluted convoy/DGS convulsion/MS coo/G cook/DGMRSZ cookery cookie/MS cooky/S cool/DGJPRSTYZ cooled/U cooler/MS coolie/MS coolness/S coon/MS coop/DRSZ cooper/DGS cooperate/DGNSVX cooperative/PSY cooperator/MS coordinate/DGNPSVXY coordinated/U coordinator/MS cop/DGJMRS cope/DGJRS copious/PY copper/DGMS cops/S copse/S copy/DGRSZ copyright/DGMRSZ coral cord/ADGRS cordial/PY core/DGRSZ cored/A cork/DGRSZ corked/U cormorant/S corn/DGRSZ corner/DGS cornerstone/MS cornfield/MS corollary/MS coronary/S coronation coronet/DMS coroutine/MS corporal/MSY corporate/NVXY corporation/MS corps/S corpse/MS corpus correct/DGPSVY correctable/U corrected/U correction/S corrective/PSY corrector correlate/DGNSVX correlated/U correlative/Y correspond/DGS correspondence/MS correspondent/MS corresponding/Y corridor/MS corroborate/DGNSVX corroborative/Y corrosion/S corrupt/DGRSVY corruption/I corruptive/Y corset/S cosine/S cosmetic/S cosmology cosmopolitan cost/DGSVY costive/PY costly/PR costume/DGRSZ cot/MS cottage/RSZ cotton/DGS cotyledon/MS couch/DGS cough/DGR coughs could/T couldn't council/MS councillor/MS counsel/MS count/DGRSZ countable/U countably/U counted/AU countenance/R counter/DGS counteract/DGSV counterclockwise counterexample/S counterfeit/DGRS countermeasure/MS counterpart/MS counterpoint/G counterproductive counterrevolution countess countless/Y country/MS countryman countryside county/MS couple/DGJMRSZ coupon/MS courage courageous/PY courier/MS course/DGRS courses/A court/DGRSYZ courteous/PY courtesy/MS courthouse/MS courtier/MS courtly/P courtroom/MS courtship courtyard/MS cousin/MS cove/GRSZ covenant/DGMRS covenanted/U cover/DGJRS coverable/A coverage coverlet/MS covert/PY covet/DGRS coveting/Y covetous/PY cow/DGRSZ coward/SY cowardice cowardly/P cowboy/MS cowed/Y cower/DGRSZ cowering/Y cowgirl/MS cowl/DGS cowslip/MS coyote/MS cozy/PRS CPU CPU's CPUs crab/MS crack/DGRSYZ crackle/DGS cradle/DGRS craft/DGRS craftsman crafty/PR crag/MS cram/S cramp/DMRS cranberry/MS crane/DGMS crank/DGS crankily cranky/PRT crap/GS crash/DGRSZ crate/GRSZ crater/DS cravat/MS crave/DGRS craven/PY crawl/DGRSZ Cray/MS craze/DGS crazily crazy/PRT creak/DGS cream/DGRSZ creamy/P crease/DGIRS create/ADGNSVX created/AU creative/PY creativity creator/MS creature/MSY creaturely/P credence credibility/I credible/I credibly/I credit/DGS creditable/P creditably creditor/MS credulity/I credulous/PY credulously/I creed/MS creek/MS creep/GRSZ cremate/DGNSX crepe crept crescent/MS crest/DGS cretin/S crevice/MS crew/DGS crib/MS cricket/GMRS crime/MS criminal/SY crimson/G cringe/DGRS cripple/DGRS crises crisis crisp/PRSY criteria criterion critic/MS critical/PY critically/U criticism/MS critique/DGS critter/MS croak/DGRSZ crochet/DGRS crook/DS crooked/PY crop/MS cropped cropper/MS cropping cross/DGJRSYZ crossable crossbar/MS crossover/MS crossword/MS crouch/DGS crow/DGS crowd/DGRS crowded/P crown/DGRS crowned/U crucial/Y crucify/DGNS crude/PRTY cruel/PRTY cruelty cruise/DGRSZ crumb/SY crumble/DGJS crumbly/PR crumple/DGS crunch/DGRSZ crunchy/PRT crusade/DGRSZ crush/DGRSZ crushable/U crushing/Y crust/DGMS crustacean/MS crutch/DMS crux/MS cry/DGRSZ cryptanalysis cryptic cryptographic cryptography cryptology crystal/MS crystalline cub/DGMRS cube/DGRS cubic/SY cuckoo/MS cucumber/MS cuddle/DGS cudgel/MS cue/DGS cuff/DGMS cull/DGRS culminate/DGNS culpability culprit/MS cult/MS cultivate/DGNSX cultivator/MS cultural/Y culture/DGS cumbersome/PY cumulative/Y cunning/PY cup/MS cupboard/MS Cupertino/M cupful/S cupped cupping cur/DGRSY curable/IP curably/I curb/DGS curds cure/DGRS cured/U curfew/MS curiosity/MS curious/PRTY curl/DGRSZ curled/U curly/PR currant/MS currency/MS current/PSY currently/A curricular curriculum/MS curry/DGRS curs/ADGSV curse/ADGSV cursed/PY cursive/APY cursor/MS cursorily cursory/P curt/PY curtail/DGRS curtain/DGS curtsy/DGMS curvature/S curve/DGS curved/A cushion/DGS cusp/MS cuss/DRS cussed/PY custard custodian/MS custody/S custom/RSZ customarily customary/P customer/MS cut/MRST cute/PRSTY cutoff/S cutter/MS cutting/SY cybernetic/S cycle/DGRS cyclic/Y cyclically cycloid/MS cycloidal cyclone/MS cylinder/DGMS cylindrical/Y cymbal/MS cynical/UY cypress cyst/S cytology czar Czechoslovakian dabble/DGRSZ dad/MS daddy/S daemon/MS daffodil/MS dagger/S daily/S daintily dainty/PRS dairy/GS daisy/MS dale/HMS dam/DMS damage/DGRSZ damaged/U damaging/Y damask dame/D damn/DGS damnation damned/RT damning/Y damp/DGNPRSXYZ damped/U dampen/DGRS damsel/MS Dan/M dance/DGRSZ dandelion/MS dandy/RS danger/MS dangerous/PY dangle/DGRSZ dangler/MS dangling/Y dare/DGRSZ daring/PY dark/NPRSTY darken/DGRZ darling/MPSY darn/DGRS DARPA DARPA's dart/DGRS dash/DGRSZ dashing/Y data database/MS date/DGRSV dated/PY datum/S daughter/MSY daunt/DGS daunted/U dauntless/PY dawn/DGS day/MS daybreak/S daydream/DGRSZ daylight/MS daytime/S daze/DGS dazed/P dazzle/DGRSZ dazzling/Y deacon/MS dead/NPXY deaden/DGRS deadening/Y deadline/MS deadlock/DGS deadly/PRT deaf/NPRTXY deafen/DGS deafening/Y deal/GJRSZ deallocate/DGNSX deallocation/MS deallocator dealt dean/MS dear/HPRSTY dearths death/Y deaths debatable/U debate/DGRSZ Debbie/M debilitate/DGNS debris debt/MS debtor/S debug/S debugged debugger/MS debugging decade/MS decadence decadent/Y decay/DGRS decease/DGS deceit deceitful/PY deceive/DGRSZ deceiving/Y decelerate/DGNSX December/MS decency/MS decent/IY deception/MS deceptive/PY decidability decidable/U decide/DGRS decided/PY decimal/SY decimate/DGNS decipher/DGRSZ decision/MS decisive/IPY deck/DGJRS declaration/MS declarative/SY declare/DGRSZ declared/AU declination/MS decline/DGRSZ DECNET decode/DGJRSZ decompile/DGRSZ decomposability decomposable/IU decompose/DGRS decomposition/MS decompression decorate/DGNSVX decorated/AU decorates/A decorative/PY decorum/S decouple/DGRS decoy/MS decrease/DGS decreasing/Y decree/DRS decreeing decrement/DGS dedicate/DGNSVX dedicated/Y deduce/DGRS deducible deduct/DGSV deduction/MS deductive/Y deed/DGS deem/ADGS deep/NPRSTXY deepen/DGS deer/S default/DGRS defeat/DGS defeatism defeatist/S defect/DGSV defection/MS defective/PSY defend/DGRSZ defendant/MS defended/U defenestrate/DGNSX defensive/PY defer/S deference deferment/MS deferrable deferred deferrer/MS deferring defiance/S defiant/Y deficiency/S deficient/Y deficit/MS defile/DGRS definable/IU define/DGRSZ defined/AU definite/NPVXY definition/AMS definitional definitive/PY deformation/MS deformed/U deformity/MS deftly defy/DGRS defying/Y degenerate/DGNPSVY degradable degradation/MS degrade/DGRS degraded/PY degrading/Y degree/DMS deign/DGS deity/MS dejected/PY Delaware/M delay/DGRSZ delegate/DGNSX delete/DGNRSX deleted/U deliberate/DGNPSVXY deliberative/PY deliberator/MS delicacy/MS delicate/PSY delicious/PSY delight/DGRS delighted/PY delightful/PY delimit/DGRSZ delineate/DGNSVX delinquency delinquent/MSY delirious/PY deliver/DGRSZ deliverable/S deliverance delivery/MS dell/MS delta/MS delude/DGRS deluding/Y deluge/DGS delusion/MS delve/DGRS demand/DGRS demanding/Y demise/DGS demo/PS democracy/MS democrat/MS democratic/U democratically/U demodulate/DGNSX demodulation/MS demodulator/MS demographic/S demolish/DGRS demolition/S demon/MS demonstrable/P demonstrate/DGNSVX demonstrative/PUY demonstrator/MS DeMorgan/M demur/S den/MS deniable/U denial/MS denigrate/DGNSV denizen/S Denmark/M denomination/MS denominator/MS denotable denotation/MS denotational/Y denotative denote/DGS denounce/DGRSZ dens/RT dense/PRTY density/MS dent/DGIS dental/SY dentist/MS deny/DGRS denying/Y depart/DGS department/MS departmental/Y departure/MS depend/DGS dependability dependable/P dependably dependence/S dependency/S dependent/ISY depict/DGRS depicted/U deplete/DGNSVX deplorable/P deplore/DGRS deploring/Y deploy/DGS deployment/MS deploys/A deport/DGS deportation deportee/MS deportment depose/DGS deposit/ADGS deposition/MS depositor/AMS depot/MS deprave/DGRS depraved/PY depreciate/DGNSVX depreciating/Y depreciative/Y depress/DGSV depressing/Y depression/MS depressive/Y deprivation/MS deprive/DGS depth depths deputy/MS dequeue/DGS derail/DGS derby/S dereference/DGRSZ deride/DGRS deriding/Y derision derivable/U derivation/MS derivative/MPSY derive/DGRS derived/U descend/DGRSZ descendant/MS descended/U descent/MS describable/I describe/DGRSZ description/MS descriptive/PSY descriptor/MS descry/DG desert/DGRSZ desertion/S deserve/DGJRS deserved/PY deserving/SY desiderata desideratum design/DGRSZ designate/DGNSVX designator/MS designed/AU designedly designer/MS designing/AU desirability/U desirable/PU desirably/U desire/DGRS desired/U desirous/PY desk/MS desktop desolate/DGNPRSXY desolating/Y despair/DGRS despairing/Y despatch/D desperate/NPY despise/DGRS despite/D despot/MS despotic dessert/MS destination/MS destine/DG destiny/MS destitute/NP destroy/DGRSZ destroyer/MS destruction/MS destructive/PY detach/DGRS detached/PY detachment/MS detail/DGRS detailed/PY detain/DGRS detect/DGSV detectable/U detectably detected/U detection/MS detective/S detector/MS detention deteriorate/DGNSV determinable/IP determinacy/I determinant/MS determinate/NPVXY determination/AI determinative/PY determine/DGRSZ determined/PY determines/A determinism/I deterministic/I deterministically detest/DGS detestable/P detonate/DGNSV detract/DGSV detractive/Y detractor/MS detriment/S devastate/DGNSVX devastating/Y develop/ADGRSZ developed/AU developer/MS development/MS developmental/Y deviant/MSY deviate/DGNSX deviated/U deviating/U device/MS devil/MS devilish/PY devise/DGJNRSX devoid devote/DGNSX devoted/Y devotee/MS devour/DGRS devout/PY dew/DGS dewdrop/MS dewy/PR dexterity diabetes diadem diagnosable diagnose/DGS diagnosis diagnostic/MS diagonal/SY diagram/DGMS diagrammable diagrammatic diagrammatically diagrammed diagrammer/MS diagramming dial/MS dialect/MS dialog/MS dialogue/MS dials/A diameter/MS diametrically diamond/MS diaper/DGMS diaphragm/MS diary/MS diatribe/MS dice/GRS dices/I dichotomy/S dickens dicky dictate/DGNSX dictator/MS dictatorship/S diction/S dictionary/MS dictum/MS did/U didn't die/DS dielectric/MS dies/U diet/RSZ dietitian/MS differ/DGRSZ difference/DGMS different/PY differential/MSY differentiate/DGNSX differentiated/U differentiators differently/I difficult/Y difficulty/MS diffuse/DGNPRSVXYZ diffusive/PY dig/ST digest/DGRSV digested/IU digestible/I digestion/S digestive/PY digger/MS digging/S digit/MS digital/Y dignified/U dignify/D dignity/IS digress/DGSV digression/MS digressive/PY Dijkstra/M dike/GMRS dilate/DGNSV dilated/PY dilemma/MS diligence/S diligent/PY dilute/DGNPRSVXY diluted/U dim/PRSYZ dime/MRSZ dimension/DGS dimensional/Y dimensionality diminish/DGS diminished/U diminution diminutive/PY dimmed/U dimmer/MS dimmest dimming dimple/DGS din/DGRZ dine/DGRSZ dingy/PR dinner/MS dint diode/MS Diophantine dioxide/S dip/S diphtheria diploma/MS diplomacy diplomat/MS diplomatic/S dipped dipper/MS dipping/S dire/PRTY direct/DGPSVY directed/AIU direction/MS directional/Y directionality directions/AI directive/MS director/AMS directory/MS dirge/DGMS dirt/MS dirtily dirty/DGPRST disability/MS disable/DGRSZ disabuse disadvantage/DGMS disadvantaged/P disagree/DS disagreeable/P disagreeing disagreement/MS disallow/DGS disambiguate/DGNSX disappear/DGS disappearance/MS disappoint/DGS disappointed/Y disappointing/Y disappointment/MS disapproval disapprove/DGRS disapproving/Y disarm/DGRSZ disarmament disarming/Y disassemble/DGRSZ disassembler/MS disaster/MS disastrous/Y disband/DGS disbelieve/DGRSZ disburse/DGRS disbursement/MS disc/MS discard/DGRS discern/DGRS discernibility discernible/I discernibly discerning/Y discernment discharge/DGRS disciple/MS disciplinary discipline/DGRS disciplined/IU disclaim/DGRSZ disclose/DGRS disclosed/U disclosure/MS discomfort/G discomforting/Y disconcert/DGS disconcerting/Y disconnect/DGRS disconnected/PY disconnection/S discontent/D discontented/Y discontinuance discontinue/DGS discontinuity/MS discontinuous/Y discord/S discount/DGRS discourage/DGRS discouragement discouraging/Y discourse/DGMRS discover/DGRSZ discovered/AU discovers/A discovery/MS discredit/DGS discreet/IPY discrepancy/MS discrete/NPXY discriminate/DGNSVX discriminating/IY discriminatory discuss/DGRS discussed/U discussion/MS disdain/GS disease/DGS disenfranchise/DGRS disenfranchisement/MS disengage/DGS disentangle/DGRS disfigure/DGS disgorge/R disgrace/DGRS disgraceful/PY disgruntled disguise/DGRS disguised/UY disgust/DGS disgusted/Y disgusting/Y dish/DGS dishearten/G disheartening/Y dishonest/Y dishwasher/S disillusion/DG disillusionment/MS disinterested/PY disjoint/DPY disjointed/PY disjunct/SV disjunction/S disjunctive/Y disk/DGMS dislike/DGRS dislocate/DGNSX dislodge/DGS dismal/PY dismay/DGS dismayed/U dismaying/Y dismiss/DGRSVZ dismissal/MS dismount/DGS disobedience disobey/DGRS disorder/DSY disordered/PY disorderly/P disown/DGS disparate/PY disparity/MS dispatch/DGRSZ dispel/S dispelled dispelling dispensation dispense/DGRSZ disperse/DGNRSVX dispersed/Y dispersive/PY displace/DGRS displacement/MS display/DGRS displease/DGS displeased/Y displeasure disposable disposal/MS dispose/DGRS disposed/I disposes/I disposition/MS disprove/DGS dispute/DGRSZ disputed/U disqualify/DGNS disquiet/GY disquieting/Y disregard/DGS disrupt/DGRSV disrupted/U disruption/MS disruptive/PY dissatisfaction/MS dissatisfied disseminate/DGNS dissension/MS dissent/DGRSZ dissertation/MS disservice dissident/MS dissimilar/Y dissimilarity/MS dissipate/DGNRSVX dissipated/PY dissociate/DGNSV dissociated/U dissolution/MS dissolve/DGRS dissonance/MS distal/Y distance/DGS distant/PY distaste/S distasteful/PY distemper distill/DGRSZ distillation distinct/IPVY distinction/MS distinctive/PY distinguish/DGRS distinguishable/I distinguished/U distort/DGRS distorted/U distortion/MS distract/DGSV distracted/Y distracting/Y distraction/MS distraught/Y distress/DGS distressing/Y distribute/DGNRSVX distributed/AU distribution/AMS distributional distributive/PY distributivity distributor/MS district/DGMS distrust/DS disturb/DGRS disturbance/MS disturbed/U disturbing/Y ditch/DGMRS divan/MS dive/DGRSTZ diverge/DGS divergence/MS divergent/Y diverse/NPXY diversify/DGNRS diversity/S divert/DGS divest/DGS divide/DGRSZ divided/U dividend/MS divine/DGRSY divinity/MS division/MS divisor/MS divorce/DGS divulge/DGS dizzy/DGPR dizzying/Y do/GHJRZ dock/DGRS doctor/DGMS doctoral doctorate/MS doctrine/MS document/DGMRSZ documentary/MS documentation/MS documented/U dodge/DGRSZ does/U doesn't dog/MS dogged/PY dogging dogma/MS dogmatism doing/AU dole/DGS doleful/PY doll/MS dollar/S dolly/DGMS dolphin/MS domain/MS dome/DGS domestic domestically domesticate/DGNS domesticated/U dominance dominant/Y dominate/DGNSVX dominion/S don/S don't donate/DGNSVX done/AU donkey/MS doom/DGS door/MS doors/I doorstep/MS doorway/MS dope/DGRSZ dormant dormitory/MS dorsal/Y DOS dose/DGS dot/DGMRS dote/DGRS doting/Y dotted dotting double/DGPRSZ doubled/AU doublet/MS doubly doubt/DGRSZ doubtable/A doubted/U doubtful/PY doubting/Y doubtless/PY dough doughnut/MS douse/DGRS dove/RS down/DGRSZ downcast downfall/N downplay/DGS downright/PY downstairs downstream downtown/RS downward/PSY downy/R doze/DGRS dozen/HS drab/PSY draft/DGMRSZ draftsmen drag/S dragged dragging/Y dragon/MS dragoon/DS drain/DGRSZ drainage/S drained/U drake drama/MS dramatic/S dramatically/U dramatist/MS drank drape/DGRSZ drapery/MS drastic drastically draw/GJRSYZ drawback/MS drawbridge/MS drawl/DGRS drawling/Y drawn/PY dread/DGS dreadful/PY dream/DGRSZ dreamed/U dreamily dreaming/Y dreamy/PR dreary/PR dredge/DGMRSZ dregs drench/DGRS dress/DGJRSZ dressmaker/MS drew dried/U drier/MS drift/DGRSZ drifting/Y drill/DGRS drily drink/GRSZ drinkable/U drip/MS drive/GRSZ driven/P driver/MS driveway/MS drone/GMRS droning/Y drool/DGRS droop/DGS drooping/Y drop/MS dropped dropper/MS dropping/MS drought/MS drove/RSZ drown/DGJRS drowsy/PRT drudgery drug/MS druggist/MS drum/MS drummed drummer/MS drumming drunk/MNRSY drunkard/MS drunken/PY dry/DGRSTYZ dual/SY duality/MS dub/S dubious/PY duchess/MS duchy/S duck/DGRS dude due/PS duel/S dug duke/MS dull/DGPRST dully duly/U dumb/PRTY dumbbell/MS dummy/DGMS dump/DGRSZ dunce/MS dune/MS dungeon/MS duplicate/DGNSVX duplicated/A duplicator/MS durability/S durable/PS durably duration/MS during dusk dusky/PR dust/DGRSZ dusty/PRT dutiful/PUY duty/MS dwarf/DPS dwell/DGJRSZ dwindle/DGS dye/DGRSZ dyeing dying/U Dylan/M dynamic/S dynamically dynamite/DGRS dynasty/MS each eager/PY eagle/MS ear/DGHSY earl/MS early/PRT earmark/DGJS earn/DGJRSTZ earned/U earner/MS earnest/PY earring/MS earshot earth/DMNY earthenware earthly/PU earthquake/MS earths earthworm/MS ease/DGRS easement/MS easily/U east/GRS easter/Y eastern/RZ eastward/S easy/PRT eat/GJNRSZ eaves eavesdrop/S eavesdropped eavesdropper/MS eavesdropping ebb/DGS ebony eccentric/MS eccentricity/S ecclesiastical/Y echo/DGS echoes eclipse/DGS ecology economic/S economical/Y economist/MS economy/MS ecstasy eddy/DGMS edge/DGRS edible/PS edict/MS edifice/MS edit/DGS edited/IU edition/MS editor/MS editorial/SY EDP Edsger/M educate/DGNSVX educated/PY education/MS educational/Y educator/MS eel/MS eerie/R effect/DGSV effective/PSY effector/MS effectually effeminate efficacy/I efficiency/IS efficient/IY effigy effort/MS effortless/PY EGA EGA's egg/DGRS ego/S eigenvalue/MS eight/S eighteen/HS eighth/MS eighty/HS either ejaculate/DGNSX eject/DGSV eke/DGS el/AS elaborate/DGNPSVXY elaborators elapse/DGS elastic/S elastically/I elasticity/S elate/DGNRS elated/PY elbow/DGS elder/SY elderly/P eldest elect/ADGSV elected/AU election/MS elective/PSY elector/MS electoral/Y electric/S electrical/PY electricity/S electrify/DGN electrocute/DGNSX electrode/MS electrolyte/MS electrolytic electron/MS electronic/S electronically elegance/S elegant/IY element/MS elemental/SY elementary/P elephant/MS elevate/DGNSX elevator/MS eleven/HS elevens/S elf elicit/DGS eligibility/S eligible/S eliminate/DGNSVXY eliminator/S elk/MS Ellen/M ellipse/MS ellipsis ellipsoid/MS ellipsoidal elliptic elliptical/Y elm/RS elongate/DGNS eloquence eloquent/IY else/M elsewhere elucidate/DGNSV elude/DGS elusive/PY elves Elvis/M emaciated emacs/M email/M emanating emancipation embark/DGS embarrass/DGS embarrassed/Y embarrassing/Y embarrassment embassy/MS embed/S embedded embedding embellish/DGRS embellished/U embellishment/MS ember/S embezzle/DGRSZ embezzler/MS emblem/S embodiment/MS embody/DGRS embrace/DGRSV embracing/Y embroider/DRS embroidery/S embryo/MS embryology emerald/MS emerge/DGS emerged/A emergence emergency/MS emergent emery/S emigrant/MS emigrate/DGNS eminence eminent/Y emit/S emitted emotion/MS emotional/UY empathy emperor/MS emphases emphasis emphatic/U emphatically/U empire/MS empirical/Y empiricist/MS employ/DGRSZ employable/U employed/U employee/MS employer/MS employment/MS empower/DGS empress emptily empty/DGPRST emulate/DGNSVX emulative/Y emulator/MS enable/DGRSZ enact/DGS enactment/S enamel/S encamp/DGS encapsulate/DGNS enchant/DGRS enchanting/Y enchantment encipher/DGRS encircle/DGS enclose/DGS enclosure/MS encode/DGJRSZ encompass/DGS encounter/DGS encourage/DGRS encouragement/S encouraging/Y encrypt/DGS encryption/MS encumber/DGS encumbered/U encyclopedia/MS encyclopedic end/DGJRSVZ endanger/DGS endear/DGS endearing/Y endemic endless/PY endorse/DGRS endorsement/MS endow/DGS endowment/MS endurable/U endurably/U endurance endure/DGS enduring/PY enema/MS enemy/MS energetic/S energy/S enforce/DGRSZ enforced/Y enforcement/A enfranchise/DGRS enfranchisement engage/DGS engagement/MS engaging/Y engender/DGS engine/DGMS engineer/DGJMS engineering/SY england/RZ English/M engrave/DGJRSZ engross/DGR engrossed/Y engrossing/Y enhance/DGS enhancement/MS enigmatic enjoin/DGS enjoy/DGS enjoyable/P enjoyably enjoyment enlarge/DGRSZ enlargement/MS enlighten/DGS enlightening/U enlightenment enlist/DGRS enlistment/S enlists/A enliven/DGS enmity/S ennoble/DGRS ennui enormity/S enormous/PY enough enqueue/DS enquire/DGRSZ enrage/DGS enrich/DGRS enrolled enrolling ensemble/MS ensign/MS enslave/DGRSZ ensnare/DGS ensue/DGS ensure/DGRSZ entail/DGRS entangle/DGRS enter/DGRS enterprise/GRS enterprising/Y entertain/DGRSZ entertaining/Y entertainment/MS enthusiasm/S enthusiast/MS enthusiastic/U enthusiastically/U entice/DGRSZ entire/Y entirety/S entitle/DGS entity/MS entrance/DGS entreat/DGS entreating/Y entreaty/S entrench/DGS entrepreneur/MS entropy/S entrust/DGS entry/MS enumerable enumerate/DGNSVX enumerated/U enumerator/MS enunciation envelop/DGRS envelope/DGRS enviably envied/U envious/PY environ/DGS environment/MS environmental/Y envisage/DGS envision/DGS envoy/MS envy/DGRS envying/Y epaulet/MS ephemeral/SY epic/MS epidemic/MS episcopal/Y episode/MS episodic epistemological/Y epistemology epistle/MRS epitaph/DG epitaphs epitaxial/Y epithet/MS epoch epochs epsilon/S equal/SY equalities/I equality/MS equally/U equate/DGNSX equator/MS equatorial equilibrium/S equip/S equipment/S equipped equipping equitable/P equitably/I equity/IS equivalence/DGS equivalent/SY era/MS eradicate/DGNSV eras/DGRSZ erasable erase/DGNRSZ erasure ere erect/DGPSY erection/MS erector/MS ergo Erlang/M ermine/DMS err/DGS errand/S erratic erring/UY erroneous/PY error/MS eruption/S escalate/DGNS escapable/I escapade/MS escape/DGRS escapee/MS eschew/DGS escort/DGS esoteric especial/Y espionage espouse/DGRS esprit/S espy/DGS esquire/S essay/DRS essence/MS essential/PSY establish/DGRS establishment/MS estate/MS esteem/DGS estimate/DGNSVX estimating/A etc eternal/PY eternity/S ethereal/PY Ethernet/MS ethic/S ethical/PY ethically/U ethnic etiquette eunuch eunuchs euphemism/MS euphoria Europe/M European/MS evacuate/DGNSVX evade/DGRS evaluate/DGNSVX evaluated/AU evaluator/MS evaporate/DGNSVX evaporative/Y eve/RS even/DGJPRSY evenhanded/PY evening/MS event/MS eventful/PY eventfully/U eventual/Y eventuality/S ever/T evergreen everlasting/PY evermore every everybody/M everyday/P everyone/MS everything everywhere eves/A evict/DGS eviction/MS evidence/DGS evident/Y evil/PSY evince/DGS evoke/DGS evolute/MNSX evolution/MS evolutionary evolve/DGS ewe/MRS exacerbate/DGNSX exact/DGPRSY exacting/PY exaction/MS exactitude/I exaggerate/DGNSVX exaggerated/PY exaggerative/Y exalt/DGRSZ exalted/Y exam/MNS examination/MS examine/DGRSZ examined/AU example/DGMS exampled/U exasperate/DGNSX exasperated/Y exasperating/Y excavate/DGNSX exceed/DGRS exceeding/Y excel/S excelled excellence/S excellency excellent/Y excelling except/DGSV exception/MS exceptional/PY exceptionally/U excerpt/DRS excess/SV excessive/PY exchange/DGRSZ exchangeable exchequer/MS excise/DGNSX excitable/P excitation/MS excite/DGRS excited/Y excitement exciting/Y exclaim/DGRSZ exclamation/MS exclude/DGRS exclusion/RSZ exclusive/PY exclusivity excommunicate/DGNSV excrete/DGNRSX excruciatingly excursion/MS excusable/IP excusably/I excuse/DGRS excused/U executable/MS execute/DGNRSVXZ execution/RS executional executive/MS executor/MS exemplar/S exemplary/P exemplify/DGNRSZ exempt/DGS exercise/DGRSZ exert/DGS exertion/MS exhale/DGS exhaust/DGRSV exhausted/Y exhaustible/I exhausting/Y exhaustion exhaustive/PY exhibit/DGSV exhibition/MRS exhibitor/MS exhortation/MS exigency/S exile/DGS exist/DGS existence/S existent/I existential/Y existentialism existentialist/MS exit/DGS exorbitant/Y exoskeletons exotic/P expand/DGRSZ expandable expanded/U expander/MS expanse/DGNSVX expansionism expansive/PY expect/DGS expectancy/S expectant/Y expectation/MS expected/PUY expecting/Y expedient/IY expedite/DGNRSX expedition/MS expeditious/PY expel/S expelled expelling expend/DGRS expendable expended/U expenditure/MS expense/DGSV expensive/IPY experience/DGS experienced/IU experiment/DGRSZ experimental/Y experimentation/MS expert/PSY expertise expiration/MS expire/DGS explain/DGRSZ explainable/IU explained/U explanation/MS explanatory explicit/PY explode/DGRS exploit/DGRSVZ exploitable exploitation/MS exploited/U exploration/MS exploratory explore/DGRSZ explored/U explosion/MS explosive/PSY exponent/MS exponential/SY exponentiate/DGNSX exponentiation/MS export/DGRSZ expose/DGRSZ exposition/MS expository exposure/MS expound/DGRS express/DGRSVY expressed/U expressibility/I expressible/I expressibly/I expression/MS expressive/IPY expropriate/DGNSX expulsion expunge/DGRS exquisite/PY extant extend/DGRS extended/PY extendible/S extensibility extensible/I extension/MS extensive/PY extent/MS extenuate/DGN exterior/MSY exterminate/DGNSX external/SY extinct/V extinction extinguish/DGRSZ extol/S extortion/R extortionist/MS extra/S extract/DGSV extraction/MS extractive/Y extractor/MS extracurricular extraneous/PY extraordinarily extraordinary/P extrapolate/DGNSVX extravagance extravagant/Y extremal extreme/DPRSTY extremist/MS extremity/MS extrinsic exuberance exult/DGS exultation exulting/Y eye/DGRSZ eyeball/S eyebrow/MS eyed/P eyeglass/S eyeing eyelid/MS eyepiece/MS eyesight eyewitness/MS fable/DGRS fabric/MS fabricate/DGNSX fabulous/PY facade/DGS face/DGJRS faced/A faceless/P faces/A facet/DGS facial/Y facile/PY facilitate/DGNSV facility/MS facsimile/DGMS fact/MS faction/MS factor/DGJS factorial factory/MS factual/PY faculty/MS fade/DGRSZ faded/Y fading/U fag/S fail/DGJS failing/SY failure/MS fain faint/DGPRSTY fair/DGPRSTY Fairbanks fairy/MS fairyland faith/U faithful/PSY faithless/PY faiths fake/DGRS falcon/RS fall/GNRS fallacious/PY fallacy/MS fallibility/I fallible/I false/PRTY falsehood/MS falsify/DGNRS falsity falter/DGRS faltering/UY fame/DGS familiar/PSY familiarity/S familiarly/U family/MS famine/MS famish/DGS famous/PY famously/I fan/MS fanatic/MS fanatically fancier/MS fanciful/PY fancily fancy/DGPRSTZ fang/DMS fanned fanning fantastic fantasy/DMS far/DGR faraway farce/GMS fare/DGRS farewell/S farm/DGRSZ farmer/MS farmhouse/MS farmyard/MS farther farthest farthing fascinate/DGNSX fascinating/Y fashion/DGRSZ fashionable/P fashionably/U fast/DGNPRSTX fasten/DGJRSZ fastened/U fat/DGPSY fatal/SY fatality/MS fate/DGS father/DGMSY fathered/U fatherland fatherly/P fathom/DGS fatigue/DGS fatiguing/Y fatten/DGRSZ fatter fattest fault/DGS faultless/PY faulty/PR fawn/DGRS fawning/Y fear/DGRS fearful/PY fearless/PY feasibility feasible/P feast/DGRS feat/GMSY feather/DGRSZ feathered/U feature/DGS featureless February/MS fed/S federal/SY federation fee/DS feeble/PRT feebly feed/GJRSZ feedback/S feel/GJRSZ feeling/PSY feet feign/DGRS feigned/U Felder felicity/S fell/DGPRSZ felled/A felling/A fellow/MSY fellowship/MS felt/DGS female/MPS feminine/PY femininity feminist/MS femur/MS fen fence/DGRSZ fenced/U ferment/DGRS fermentation/MS fern/MS ferocious/PY ferocity ferrite ferry/DGS fertile/PY fertility/S fervent/Y festival/MS festive/PY festivity/S fetch/DGRS fetching/Y fetter/DGS fettered/U feud/MS feudal/Y feudalism fever/DGS feverish/PY few/PRST fibrous/PY fickle/P fiction/MS fictional/Y fictitious/PY fiddle/DGRS fidelity/I field/DGRSZ fields/I fiend/S fierce/PRTY fiery/P fife FIFO fifteen/HS fifth/Y fifty/HS fig/MS fight/GRSZ fighter/IS fighting/I figurative/PY figure/DGJRSZ filament/MS file/DGJMRSZ filename/MS filial/UY fill/DGJRSZ fillable/A filled/AU film/DGS filter/DGMRS filth filthy/PRT filtration/M fin/DGMRST final/SY finality finance/DGS financial/Y financier/MS find/GJRSZ fine/DGPRSTY finger/DGJRS finish/DGJRSZ finished/AU finite/PSY fir/DGHJRZ fire/DGJRSZ firearm/MS fired/U firefly/MS firelight/G fireman fireplace/MS fireside firewood fireworks firm/DGMPRSTY firmament firmware/S first/SY firsthand fiscal/SY fish/DGRSZ fisherman/M fishermen/M fishery/S fissure/DGS fist/DS fit/PSY fitful/PY fitted/U fitter/MS fitting/PSY five/RS fix/DGJRSZ fixate/DGNSVX fixed/PY fixture/MS flab flabby/PR flag/MS flagged flagging/UY flagrant/Y flagship/MS flake/DGRS flame/DGRSZ flaming/Y flammable/S flank/DGRSZ flannel/MS flap/MS flapping flare/DGS flaring/Y flash/DGRSZ flashlight/MS flask flat/PSY flatness/S flatten/DGRS flatter/DGRS flattering/UY flattery flattest flaunt/DGS flaunting/Y flaw/DGS flawless/PY flax/N flea/MS fled fledged/U fledgling/MS flee/RS fleece/DMS fleecy/R fleeing fleet/GPSTY fleeting/PY flesh/DGJRSY fleshy/PR flew/S flexibility/S flexible/I flexibly/I flick/DGRS flicker/DG flickering/Y flight/MS flinch/DGRS flinching/U fling/GMRS flint/S flip/S flirt/DGRS flit/S float/DGRSZ flock/DGS flood/DGRS floor/DGJRS flop/MS floppily floppy/MPRS flora Florida/M florin floss/DGS flounder/DGS flour/DS flourish/DGRS flourishing/Y flow/DGRSZ flowchart/GS flower/DGRS flowery/P flowing/Y flown flows/I fluctuate/DGNSX fluent/AI fluently fluffy/PRT fluid/PSY fluidity flung flunk/DGRS fluorescence flurry/DGS flush/DGPS flute/DGMRS flutter/DGRS fly/GRSZ flyable flyer/MS foam/DGRS focal/Y foci focus/DGRS focusable focused/AU fodder foe/MS fog/MS fogged foggily fogging foggy/PRT foil/DGS fold/DGJRSZ folded/AU foliage/DS folk/MS folklore follow/DGJRSZ folly/S fond/PRSTY fondle/DGRS font/MS food/MS foodstuff/MS fool/DGS foolish/PY foolproof foot/DGJRSZ football/DMRSZ foothold/S footman footnote/MS footprint/MS footstep/S for/HT forage/DGRS foray/MRS forbade forbear/GMRS forbearance forbid/S forbidden forbidding/PY force/DGMRS forced/Y forcefield/MS forceful/PY forcible/P forcibly ford/S fore/T forearm/DMS foreboding/PSY forecast/DGRSZ forecastle/S forefather/MS forefinger/MS forego/GR foregoes foregone foreground/S forehead/MS foreign/PRSYZ foreman foremost forenoon foresee/RS foreseeable foreseen/U foresight/D foresighted/PY forest/DRSZ forestall/DGRS forestallment foretell/GRS forethought/M foretold forever/P forewarn/DGJRS forfeit/DGRSZ forgave forge/DGRSVZ forgery/MS forget/SV forgetful/PY forgettable/U forgettably/U forgetting forgivable/U forgivably forgive/GPRS forgiven forgiving/PY forgot forgotten fork/DGRS forlorn/PY form/ADGIRSZ formal/PSY formalism/MS formality/S formally/I formant/IS format/DGSV formation/MS formations/I formative/PY formatted/AU formatter/MS formatting/A formed/AIU former/SY formidable/P formula/MS formulae formulate/DGNSX formulator/MS fornication forsake/GS forsaken fort/MS forte/S forthcoming/U forthwith fortify/DGNRSX fortitude fortnight/Y Fortran/M fortress/MS fortuitous/PY fortunate/PSY fortune/DGMS forty/HRS forum/MS forward/DGPRSYZ fossil/S foster/DGRS fought foul/DGPRSTY found/DGRSZ foundation/MS founded/U founder/DGS foundry/MS fount/MS fountain/MS four/HS Fourier/M fourscore fourteen/HRS fourth/Y fowl/GRS fox/DGMS fractal/MS fraction/DGMS fractional/Y fractions/I fracture/DGS fragile/Y fragment/DGS fragmentary/P fragrance/MS fragrant/Y frail/PRTY frailty/S frame/DGJMRSZ framework/MS franc/S France/MS franchise/DGMRS frank/DGPRSTY frantic/PY frantically fraternal/Y fraternity/MS fraud/MS fraudulently fraught/DGS fray/DGS freak/MS freckle/DGS free/DPRSTY freedom/MS freeing/S freeman freeway/MS freeze/GRSZ freight/DGRSZ French/M frenzied/Y frenzy/DGS frequency/S frequent/DGPRSYZ frequented/U frequently/I fresh/NPRTXYZ freshen/DGRSZ freshman freshmen fret/S fretful/PY friar/MSY fricative/S friction/MS frictionless/Y Friday/MS friend/MSY friendless/P friendly/PRST friendship/MS frieze/MS frigate/MS fright/NX frighten/DGS frightening/Y frightful/PY frill/DMS fringe/DGIS frisk/DGRS frivolous/PY frock/DGMS frog/MS frolic/S from front/DGS frontier/MS frost/DGS frosted/U frosty/PR froth/G frown/DGRS frowning/Y froze frozen/PY frugal/Y fruit/DMRS fruiter/R fruitful/PUY fruition fruitless/PY frustrate/DGNRSX frustrating/Y fry/DGNRS fuel/AS fugitive/MPSY fulfilled/U fulfiller fulfilling full/PRT fullword/MS fully fumble/DGRS fumbling/Y fume/DGS fun function/DGMS functional/SY functionality/S functor/MS fund/ADGRSZ fundamental/SY fundamentalist/MS funded/AU funeral/MS fungus/S funnel/S funnily/U funny/PRST fur/MPS furious/PRY furnace/DGMS furnish/DGJRSZ furnished/U furniture furrow/DGS further/DGRST furthermore furtive/PY fury/MS fuse/DGNSX fuss/GR futile/PY futility future/MS fuzzy/PRT gabardine/S gable/DRS gad gadget/MS gag/DGRS gagged gagging gaiety/S gaily gain/DGJRSYZ gait/DRSZ galaxy/MS gale/S gall/DGS gallant/SY gallantly/U gallantry gallery/DS galley/MS galling/Y gallon/MS gallop/DGRSZ gallows/S Galvin/M gamble/DGRSZ game/DGPSY gamma/S gang/MRSY gangly/R gangrene/DGS gangster/MS gap/DGMRS gape/DGRS gaping/Y garage/DGS garb/D garbage/DGMS garble/DGRS garden/DGRSZ Garfunkel gargle/DGS garland/DS garlic/S garment/DGMS garner/DGS garnish/DS garrison/DGS garter/DGMS gas/MS gaseous/PY gash/DGMS gasoline/S gasp/DGRSZ gasping/Y gassed gasser/S gassing/S gastric gastrointestinal gate/DGS gateway/MS gather/DGJRSZ gaudy/PRS gauge/DGRS gaunt/PY gauze/DGS gave gay/PRTY gaze/DGRSZ gear/DGS geese gel/MS gelatin gelled gelling gem/MS gender/DGMS gene/MS general/MPSY generalist/MS generality/S generate/DGNSVX generative/AY generator/MS generators/A generic/P generically generosity/MS generous/PY generously/U genetic/S genetically genial/PY genius/MS genre/MS genteel/PRTY gentle/DGPRT gentleman/Y gentlemanly/P gentlewoman gently gentry/S genuine/PY genus Geoff/M Geoffrey/M geographic geographical/Y geography/S geological geologist/MS geometric geometry/S geranium germ/MNS German/MS germane Germany/M germinate/DGNSVX germinative/Y gestalt gesture/DGS get/S getter/DMS getting ghastly/PR ghost/DGSY ghostliness/S ghostly/PR giant/MS gibberish Gibson/M giddy/DGPR gift/DS gifted/PY gig/MS gigantic/P giggle/DGRS giggling/Y gild/DGRS gill/DMRS gilt gimmick/MS gin/MS ginger/DGY gingerbread gingerly/P gingham/S Gipsy/MS giraffe/MS gird/DGRSZ girder/MS girdle/DGRS girl/MS girlfriend/MS girt/U girth give/GHRSZ given/PS giving/Y gizmo/MS glacial/Y glacier/MS glad/PY gladder gladdest glade/S glamour/DGS glance/DGS glancing/Y gland/MSZ glare/DGS glaring/PY glass/DS glassy/PRS glaze/DGRSZ glazed/U gleam/DGS glean/DGJRS glee/DS gleeful/PY glen/MS glide/DGRSZ glimmer/DGS glimpse/DGRSZ glint/DGS glisten/DGS glitch/MS glitter/DGS glittering/Y global/SY globe/GMS globular/PY globularity gloom/S gloomily gloomy/PR glorify/DNRSXZ glorious/IPY glory/DGS gloss/DGS glossary/MS glossy/PRS glottal glove/DGRSZ glow/DGRSZ glower/DGS glowing/Y glucose glue/DGRSZ glued/U gnat/MS gnaw/DGRS go/GHJR goad/DGS goal/MS goat/MS goatee/MS gobble/DGRSZ goblet/MS goblin/MS god/MSY goddess/MS godlike/P godly/PR godmother/MS Godzilla/M goer/G goes gold/GNS golden/PY goldsmith golf/GRSZ gone/NR gong/MS good/PSY goodbye/MS goodie/MS goody/MS goose/GS gore/DGS gorge/GRS gorgeous/PY gorilla/MS gosh gospel/S gossip/RSZ got/IU gotcha/MS Gothic goto gotten/U gouge/DGRS govern/DGS governed/U governess/S government/MS governmental/Y governor/MS gown/DS GPSS grab/S grabbed grabber/MS grabbing/S grace/DGS graceful/PUY gracious/PY graciously/U gradation/MS grade/DGJRSYZ graded/U gradient/MS gradual/PY graduate/DGNSX graft/DGRS graham/MS grain/DGRS grained/I grains/I grammar/MS grammatical/PY granary/MS grand/PRSTY grandeur grandfather/MSY grandiose/PY grandkid/MS grandma/M grandmother/MSY grandpa/MS grandparent/S grandson/MS grange/RS granite granny/S grant/DGMRS granularity granulate/DGNSVX grape/MS grapevine/MS graph/DGM graphic/PS graphical/Y graphite graphs grapple/DGRS grasp/DGRS graspable grasping/PY grass/DGSZ grassy/RT grate/DGJRS grateful/PUY gratified/U gratify/DGNX gratifying/Y grating/SY gratitude/I gratuitous/PY gratuity/MS grave/GPRSTYZ gravel/SY gravitation gravitational/Y gravity/S gravy/S gray/DGPRSTY graze/DGRS grease/DGRSZ greasy/PR great/NPRSTY greaten/DG greed greedily greedy/PR Greek/MS green/DGPRSTY greenhouse/MS greenish/P greet/DGJRS greets/A Greg/M grenade/MS grew grey/GT grid/MS grids/A grief/MS grievance/MS grieve/DGRSZ grieving/Y grievous/PY grill/DGRS grim/DGPY grin/S grind/GJRSZ grinding/SY grindstone/MS grip/DGRS gripe/DGRS gripped gripper/MS gripping/Y grit/MS grizzly/R groan/DGRSZ grocer/MS grocery/S groom/DGMRS groove/DGRS grope/DGRS gross/DGPRSTY grotesque/PY grotto/MS ground/DGRSZ grounded/U groundwork group/DGJMRS grouse/DGRS grove/RSZ grovel/S grow/GHRSYZ growing/Y growl/DGRS growling/Y growly/PR grown/I grownup/MS growth/I growths/I grub/MS grudge/DGMRS grudging/Y gruesome/PY gruff/PY grumble/DGRS grumbling/Y grunt/DGRS guarantee/DRSZ guaranteeing guaranty guard/DGRS guarded/PUY guardian/MS guardianship guerrilla/MS guess/DGRS guessed/U guest/DGMS guidance/S guide/DGRS guidebook/MS guided/U guideline/MS guild/R guile guilt/S guiltily guiltless/PY guilty/PRT guinea/S guise/DGMS guitar/MS gulch/MS gulf/MS gull/DGS gullibility gully/DGMS gulp/DRS gum/MS gun/MS gunfire/S gunned gunner/MS gunning gunpowder/S gurgle/DGS guru/MS gush/DGRS gust/MS gut/S guts/R gutter/DGS guy/DGMRSZ gym/S gymnasium/MS gymnast/MS gymnastic/S gypsy/DGMS gyration/S gyroscope/MS ha/HS habit/MS habitable/P habitat/MS habitation/MS habitual/PY hack/DGRSZ hacker/MS had hadn't hag/N haggard/PY hail/DGRS hair/DMS haircut/MS hairdresser/MS hairless/P hairy/PR hale/GIR half/P halfway halfword/MS hall/MRS hallmark/DGMS hallow/DGS hallowed/U hallway/MS halt/DGRSZ halter/DGS halting/Y halve/DGSZ ham/MS hamburger/MS hamlet/MS hammer/DGRS hammock/MS hamper/DGS hampered/U hand/DGRSZ handbag/MS handbook/MS handcuff/DGS handed/PY handful/S handicap/MS handicapped handily/U handiwork handkerchief/MS handle/DGRSZ handshake/GMRS handsome/PRTY handsomely/U handwriting handwritten handy/PRT hang/DGRSZ hangar/MS hangover/MS hap/Y haphazard/PY hapless/PY happen/DGJS happily/U happy/PRTU harass/DGRS harassment/S hard/GJNPRSTXY harden/DGRS hardness/S hardship/MS hardware/S hardy/PR hare/MS hark/DGNS harlot/MS harm/DGRS harmed/U harmful/PY harmless/PY harmonious/IPY harmony/S harness/DGRS harp/DGJRSZ harrow/DGRS harry/DGR harsh/NPRTY harshen/DG hart harvest/DGRSZ hash/DGRS hasn't hassle/DGRS haste/DGJS hasten/DGRS hastily hasty/PRT hat/DGMRS hatch/DGRS hatchery/MS hatchet/MS hate/DGRS hateful/PY hatred haughtily haughty/PR haul/DGRSZ haunch/MS haunt/DGRS haunting/Y have/GRSZ haven/MS haven't haver/GS havoc/S hawk/DGRSZ hay/GRS hazard/DGMS hazardous/PY haze/DGMRS hazel hazy/PRT he/MRVZ he'd he'll head/DGJMRSZ headache/MS headgear heading/MS headland/MS headline/DGRS headlong headphone/MS headquarters headway heal/DGHRSZ healthful/PY healthily/U healthy/PRT heap/DGS hear/GHJRSTZ heard/U hearken/DG hears/GS hearsay heart/DMNSX heartache/MS hearted/Y hearten/DGS heartening/Y heartily heartless/PY hearty/PRST heat/DGRSZ heatable heated/Y heath/NR heave/DGRSZ heaven/MSY heavenly/P heavily heavy/PRST hedge/DGRS hedgehog/MS hedging/Y heed/DGS heeded/U heeding/U heedless/PY heel/DGRSZ heifer height/NSX heighten/DGS Heinlein/M heinous/PY heir/MS heiress/MS held hell/MRS hello/S helm/U helmet/DMS help/DGRSZ helpful/PY helpfully/U helpless/PY hem/MS hemisphere/DMS hemlock/MS hemostat/S hemp/N hen/MS hence henceforth henchman henchmen herald/DGS heralded/U herb/MS herbivore herbivorous/Y herd/DGRS here/MS hereabout/S hereafter hereby hereditary heredity herein hereinafter heresy heretic/MS heretofore herewith heritage/S hermit/MS hero/MS heroes heroic/S heroically heroin heroine/MS heroism heron/MS herring/MS herself hesitant/Y hesitate/DGNRSX hesitating/UY heterogeneous/PY heuristic/MS heuristically hew/DGRS Hewlett/M hex/R hexagonal/Y hey hickory/S hid/DGR hidden hide/DGRS hideous/PY hideout/MS hierarchical/Y hierarchy/MS high/PRTY highland/RS highlight/DGS highness/MS highway/MS hijack/DGRSZ hike/DGRSZ hilarious/PY hill/DGMRS hillock/S hillside hilltop/MS hilt/MS him/S himself hind/RSZ hinder/DGRS hindrance/S hindsight hinge/DGRS hinged/U hint/DGRS hip/MPS hire/DGJRSZ his hiss/DGRS histogram/MS historian/MS historic historical/PY history/MS hit/MS hitch/DGRS hitched/U hitchhike/DGRSZ hither hitherto hitter/MS hitting hive/GS hoar hoard/DGRS hoarse/PRTY hoary/PR hoax/DGMRS hobble/DGRS hobby/MS hobbyist/MS hockey hoe/MRS hog/MS hoist/DGRS hold/GJNRSZ holding/IS hole/DGMS holiday/MRS holistic Holland/MRSZ hollow/DGPRSTY holly/S holocaust hologram/MS holy/PRS homage/DGRS home/DGRSYZ homebuilt homeless/P homely/PR homemade homemaker/MS homeomorphic homeomorphism/MS homesick/P homespun homestead/RSZ homeward/S homework/RZ homogeneities/I homogeneity/MS homogeneous/PY homomorphic homomorphism/MS Honda/M hone/DGRST honest/Y honesty honey/DGS honeycomb/D honeymoon/DGRSZ honeysuckle honorary hood/DGMS hooded/P hoodwink/DGRS hoof/DMRS hook/DGRSZ hooked/P hooks/U hoop/DGRS hooray/MS hoot/DGRSZ hop/DGRS hope/DGRS hoped/U hopeful/PSY hopeless/PY hopped hopper/MS hopping horde/MS horizon/MS horizontal/Y hormone/MS horn/DS horned/P hornet/MS horrendous/Y horrible/P horribly horrid/PY horrify/DGS horrifying/Y horror/MS horse/GMSY horseback horseman horsepower/S horseshoe/RS hose/DGMS hospitable/I hospitably/I hospital/MS hospitality/I host/DGMSY hostage/MS hostess/MS hostile/Y hostility/S hot/PY hotel/MS hotter hottest hound/DGRS hour/MSY house/DGJMRS housed/A housefly/MS household/MRSZ housekeeper/MS housekeeping houses/A housetop/MS housewife/MY housewifely/P housework/RZ hovel/MS hover/DGRS how/MS however howl/DGRS hrs hub/MS hubris huddle/DGRS hue/DMS hug/RST huge/PRTY huh hull/DGMRS hum/S human/PSY humane/PY humanely/I humanities/I humanity/MS humble/DGPRST humbly humid/Y humidify/DGNRSXZ humidity/S humiliate/DGNSX humiliating/Y humility hummed humming humorous/PY hump/DGS hunch/DS hundred/HS hung/RZ hunger/DGS hungrily hungry/PRT hunk/MRSZ hunker/DGS hunt/DGRSZ huntsman hurdle/DGRS hurl/DGRZ hurrah hurricane/MS hurried/PY hurriedly/U hurry/DGRS hurt/GRS hurting/Y husband/MRSY husbandry hush/DGS husk/DGRS husky/PRS hustle/DGRSZ hut/MS hyacinth hybrid/S hydraulic/S hydraulically hydrodynamic/S hydrogen/MS hygiene hymn/GMS hype/DMRS hyperbolic hypertext/M hyphen/DGMS hypocrisy/S hypocrite/MS hypodermic/S hypotheses hypothesis hypothetical/Y hysteresis hysterical/UY Hz I'd I'll I'm I've IBM IBM's ice/DGJS iceberg/MS icon/MS icy/PRT id/MY idea/MS ideal/SY idealism idealistic identical/PY identifiable/U identifiably identified/U identify/DGNRSXZ identity/MS ideological/Y ideology/S idiocy/S idiosyncrasy/MS idiosyncratic idiot/MS idiotic idle/DGPRSTZ idol/MS idolatry IEEE if ignition ignoble/P ignorance ignorant/PY ignore/DGRS ii iii ill/PS illegal/Y illegality/S illicit/Y Illinois illiterate/PSY illness/MS illogical/PY illuminate/DGNSVX illuminating/Y illusion/MS illusive/PY illustrate/DGNSVX illustrative/Y illustrator/MS illustrious/PY illy image/DGS imaginable/P imaginably/U imaginary/P imagination/MS imaginative/PY imaginatively/U imagine/DGJRS imbalance/S imitate/DGNSVX imitative/PY immaculate/PY immaterial/PY immature/PY immaturity immediacy/S immediate/PY immemorial/Y immense/PY immerse/DGNRSX immigrant/MS immigrate/DGNS imminent/PY immoral/Y immorality/S immortal/SY immortality immovability immovable/P immovably immune immunity/MS immunology immutable/P imp/MSY impact/DGRSV impaction/S impactor/MS impair/DGRS impaired/U impart/DGS impartial/Y impasse/NSVX impassion/DGS impassioned/U impassive/PY impatience impatient/Y impeach/DGS impedance/MS impede/DGRS impeded/U impediment/MS impel/S impending impenetrability impenetrable/P impenetrably imperative/PSY imperfect/PVY imperfection/MS imperial/Y imperialism imperialist/MS imperil imperious/PY impermanence impermanent/Y impermissible impersonal/Y impersonate/DGNSX impertinent/Y imperturbability impervious/PY impetuous/PY impetus impinge/DGS impious/Y implant/DGRS implausible implement/DGRSZ implementable implementation/MS implemented/U implementor/MS implicant/MS implicate/DGNSVX implicative/PY implicit/PY implore/DGS imply/DGNSX import/DGRSZ importance/U important/Y importation/S impose/DGRS imposing/Y imposition/MS impossibility/S impossible/PS impossibly impostor/MS impotence impotent/Y impoverish/DGRS impoverishment impracticable/P impractical/PY impracticality imprecise/NPY impregnable/P impress/DGRSV impressed/U impression/MS impressionable/P impressionist/S impressionistic impressive/PY impressment imprint/DGS imprison/DGS imprisonment/MS improbable/P impromptu improper/PY improve/DGRS improved/U improvement/S improvisation/MS improvisational improvise/DGRSZ impudent/Y impulse/DGNSVX impulsive/PY impunity impure/PY impurity/MS impute/DGS in/SY inability/S inaccurate/Y inactive/Y inactivity inadvertent/Y inadvisable inalterable/P inane/PRTY inanimate/PY inappropriate/PY inarticulable inasmuch inaugural inaugurate/DGNX Inc incantation/S incapacitating incarnation/MS incendiary/S incense/DGS incentive/MSY inception/S incessant/Y inch/DGS incidence/S incident/MS incidental/SY incipient/Y incision/MS incite/DGRS incivility inclination/MS incline/DGRS inclose/DGS include/DGS inclusion/MS inclusive/PY incoherence/S income/GRSZ incommensurate incomparable incompatible incompetence incompetent/MSY incomplete/NPY incomprehensibly inconceivable/P inconsequential/Y inconsiderable/P inconsiderate/NPY inconsistency/MS inconsolable/P inconvenience/DGS incorporate/DGNSV incorporated/U incorporating/A incorporation/A incorrect/PY increasing/Y incredible/P incredulous/Y increment/DGS incremental/Y incubate/DGNSV incubator/MS incur/S incurable/PS incurred incurring indebted/P indecision indeed indefinable/P indefinite/PY indemnity indent/DGRS indentation/MS indented/U independence indescribable/P indeterminacy/MS indeterminate/NPY index/DGRSZ indexable India/M Indian/MS Indiana/M indicate/DGNSVX indicative/SY indicator/MS indictment/MS indifference indifferent/Y indigenous/PY indigestion indignant/Y indignation indigo indirect/DGPSY indirection/S indiscipline/D indiscriminate/GNPY indispensability indispensable/P indispensably indistinct/PVY indistinguishable/P individual/MSY individualistic individuality indivisibility indivisible/P indoctrinate/DGNS indolent/Y indomitable/P indoor/S induce/DGRS inducement/MS induct/DGSV inductance/S induction/MS inductive/PY inductor/MS indulge/DGRS indulgence/MS industrial/SY industrialist/MS industrious/PY industry/MS ineffective/PY inequality/S inert/PY inertia/S inescapably inessential inestimable inevitability/S inevitable/P inevitably inexact/PY inexhaustible/P inexorable/P inexorably inexperience/D inexplicable/P inexplicably inexpressible/P infallibly infamous/Y infancy infant/MS infantry infeasible infect/DGSV infected/U infection/MS infectious/PY infer/S inference/GMRS inferential/Y inferior/MSY inferiority infernal/Y inferno/MS inferred inferring infertility infest/DGRS infidel/MS infighter/MS infiltrate/DGNSV infinite/PVY infinitesimal/Y infinitive/MSY infinitum infinity/S infirmity infix/MS inflame/DGR inflammable/P inflatable inflate/DGNRS inflationary inflexibility inflexible/P inflict/DGRSV influence/DGRS influenced/U influential/Y influenza informal/Y informality informant/MS information/S informational informative/PY informatively/U informed/U infrastructure/S infrequent/Y infringe/DGRS infringement/MS infuriate/DGNSY infuriating/Y infuse/DGNRSX ingenious/PY ingenuity ingrained/Y ingredient/MS ingrown/P inhabit/DGRS inhabitable inhabitance inhabitant/MS inhabited/U inhale/DGRS inhere/DGS inherent/Y inherit/DGS inheritable/P inheritance/MS inheritor/MS inheritress/MS inheritrices inheritrix inhibit/DGRSV inhibition/MS inhibitors inhomogeneity/S inhospitable/P inhuman/PY inhumane/Y iniquity/MS initial/PS initiate/DGNSVX initiated/U initiative/MS initiator/MS inject/DGSV injection/MS injure/DGRS injured/U injurious/PY ink/DGJRSZ inkling/MS inland/R inly/GR inmate/MS inn/GJRS innards innate/PY inner/Y innermost innocence innocent/SY innocuous/PY innovate/DGNSVX innovation/MS innovative/P innumerability innumerable/P innumerably inopportune/PY inordinate/PY inorganic input/DGMRS inquire/DGRSZ inquiring/Y inquiry/MS inquisition/MS inquisitive/PY inroad/S insane/PY inscribe/DGRS inscription/MS insecure/PY insecurity insensitive/PY insensitivity insert/DGRS insertion/MS insertions/A inside/RSZ insidious/PY insight/MS insightful/Y insignia/S insignificant/Y insinuate/DGNSVX insinuating/Y insist/DGS insistence insistent/Y insofar insolence insolent/Y insoluble/P inspect/DGSV inspection/MS inspector/MS inspiration/MS inspire/DGRS inspired/U inspiring/U instability/S install/DGRSZ installation/MS installment/MS instance/DGS instant/PRSY instantaneous/PY instantiate/DGNSX instantiated/U instantiation/MS instead instigate/DGNSV instigator/MS instinct/MSV instinctive/Y institute/DGNRSVXZ institution/MS institutional/Y instruct/DGSV instruction/MS instructional instructive/PY instructor/MS instrument/DGS instrumental/SY instrumentalist/MS instrumentation insufficiency/S insulate/DGNSX insulated/U insulator/MS insult/DGRS insulting/Y insuperable insupportable/P insurance/S insure/DGRSZ insurgent/MS insurmountable insurrection/MS intact/P intangible/MPS integer/MS integral/MSY integrate/DGNSVX integrated/A integrity Intel/M intellect/MSV intellective/Y intellectual/PSY intelligence/RS intelligent/UY intelligibility/U intelligible/PU intelligibly/U intend/DGRS intended/PY intense/NPVY intensify/DGNRSZ intensity/S intensive/PY intent/PSY intention/DS intentional/UY interact/DGSV interaction/MS interactive/Y interactivity intercept/DGRS interchange/DGJRS interchangeability interchangeable/P interchangeably intercity intercommunicate/DGNS interconnect/DGS interconnected/P interconnection/MS interconnectivity intercourse interdependence interdependency/S interdependent/Y interdisciplinary interest/DGS interested/Y interesting/PY interestingly/U interface/DGRS interfere/DGRS interference/S interfering/Y interim interior/MSY interlace/DGS interleave/DGS interlink/DGS interlisp/M intermediary/S intermediate/DGMNPSY interminable intermingle/DGS intermittent/Y intermix/DGRS intermodule intern/DGS internal/SY international/SY internationality Internet/M interpersonal/Y interplay interpolate/DGNSVX interpose/DGRS interpret/DGRSVZ interpretable/U interpretation/MS interpretations/A interpreted/AU interpretive/Y interprocess interrelate/DGNSX interrelated/PY interrelationship/MS interrogate/DGNSVX interrogative/SY interrupt/DGRSVZ interruptible interruption/MS intersect/DGS intersection/MS intersperse/DGNSX interstage interstate intertask intertwine/DGS interval/MS intervene/DGRS intervention/MS interview/DGRSZ interviewed/AU interviewee/MS interviewer/MS interwoven intestinal/Y intestine/MS intimacy intimate/DGNPRSXY intimidate/DGNS intolerable/P intolerance intolerant/PY intonation/MS intoxicate/DGN intoxicated/Y intractable/P intractably intramural/Y intransigent/SY intraprocess intricacy/S intricate/PY intrigue/DGRS intriguing/Y intrinsic/S intrinsically introduce/DGRS introduction/MS introductory introspect/V introspection/S introspective/PY introvert/D intrude/DGRSZ intruder/MS intrusion/MS intrusive/PY intrust intubate/DGNS intuition/MS intuitionist intuitive/PY invade/DGRSZ invalid/PSY invalidity/S invaluable/P invariable/P invariance invasion/MS invent/ADGSV invention/MS inventive/PY inventor/MS inventory/MS inverse/NSVXY invert/DGRSZ invertebrate/MS invertible invested/A investigate/DGNSVX investigator/MS investment/MS investor/MS invincible/P invisibility invitation/MS invite/DGRS invited/U inviting/Y invocation/MS invoice/DGS invokable invoke/DGRSZ invoked/A invokes/A involve/DGRS involved/Y involvement/MS inward/PSY ioctl iodine ion/IU ions/U Iran/M irate/PY ire/MS Ireland/M iris/S irk/DGS irksome/PY iron/DGJPRS ironical/PY ironwork/MRS irony/S irrational/PSY irrationality irrecoverable/P irreducible irreducibly irreflexive irrefutable irregular/SY irregularity/S irrelevance/S irrelevant/Y irrepressible irresistible/P irrespective/Y irresponsible/P irresponsibly irreversible irrigate/DGNSX irritate/DGNSVX irritating/Y is island/RSZ isle/GMS islet/MS isn't isolate/DGNSX isometric/S isomorphic isomorphically isomorphism/MS isotope/MS ispell/M Israel/M Israeli/MS issuance issue/ADGRSZ isthmus it/MSU it'd it'll Italian/MS italic/S itch/GS ITCorp/M ITcorp/M item/MS iterate/ADGNSVX iterative/AY iterator/MS itinerary/S itself iv ivory/S ivy/DMS ix jab/MS jabbed jabbing jack/DGRS jacket/DS jacketed/U jade/DGS jaded/PY jail/DGRSZ jam/S James jammed/U jamming/U janitor/MS January/MS Japan/M Japanese/M jar/MS jargon jarred jarring/Y jaunt/DGMS jaunty/PR javelin/MS jaw/DMS jay jazz jealous/PY jealousy/S jean/MS jeep/DGMSZ jeer/MRS Jefferson/M jelly/DGMS jellyfish jenny jerk/DGJRS jerky/PR jersey/MS jest/DGRS jet/MS jetted jetting jewel/S jewelry/S jig/MS Jill/M jingle/DGRS job/MS jocks jocund/Y jog/S john/MS Johnnie/M join/DGRSZ joined/AU joint/DGMPRSY jointed/PY joke/DGRSZ joking/Y jolly/DGRS jolt/DGRS jostle/DGS jot/S jotted jotting journal/MS journalism journalist/MS journalistic journey/DGJS joust/DGRS joy/MS joyful/PY joyous/PY Jr jubilee judge/DGRS judicable judicial/Y judiciary/S judicious/IPY jug/MS juggle/DGRSZ juice/DGMRSZ juicy/PRT Julie/MS July/MS Julys jumble/DGS jump/DGRSZ jumpy/PR junction/IMS juncture/MS June/MS jungle/DMS junior/MS juniper junk/RSZ junkie/S junky/S jurisdiction/MS juror/MS jury/IMS just/GPRY justice/IMS justifiable/U justifiably justified/U justifier/MS justify/DGNRSXZ jut juvenile/MS juxtapose/DGS keel/DGRS keen/GPRTY keep/GRSZ ken kennel/MS kept kerchief/DMS kernel/MS kerosene ketchup kettle/MS key/DGS keyboard/GMRS keyclick/MS keypad/MS keystroke/MS keyword/MS kHz kick/DGRSZ kid/MS kidded kidding/Y kidnap/MS kidney/MS kill/DGJRSZ killing/SY kilobit/S kilobyte/S kin kind/PRSTY kindergarten kindhearted/PY kindle/ADGRS kindly/PR kindness/S kindred king/SY kingdom/MS kingly/PR kinky/PR kinship kinsman kiss/DGJRSZ kit/DGMRS kitchen/MRS kite/DGRS kitsch kitten/DGMS kitty/S Klein/M Kleinrock/M Kline/M kludge/DGMRSZ kludger/MS kludgey klutz/MS klutzy/P knack/RS knapsack/MS knave/MS knead/DGRS knee/DS kneeing kneel/DGRS knell/MS knelt knew knife/DGS knight/DGSY knighthood knightly/P knit/AU knits knives knob/MS knock/DGRSZ knoll/MS knot/MS knotted knotting know/GRS knowable/U knowhow knowing/UY knowledge/S knowledgeable/P known/U knuckle/DGS Knuth/M kudos Kuenning/M lab/MS label/MS labels/A laboratory/MS labyrinth labyrinths lace/DGRS laced/U lacerate/DGNSVX lack/DGRS lackadaisical/Y lacquer/DGRSZ lad/DGNS ladder/S laden/DG lady/MS lag/RSZ lagged lagoon/MS Lagrangian/M laid/I lain lair/MS lake/GMRS lamb/MRS lambda/MS lame/DGPRSTY lament/DGS lamentable/P lamentation/MS lamented/U laminar lamp/MRS Lamport/M lance/DGRSZ land/DGJRSZ landlady/MS landlord/MS landmark/MS landowner/MS landscape/DGRS lane/MS language/MS languid/PY languish/DGRS languishing/Y lantern/MS lap/MS lapel/MS laps/DGRS lapse/ADGRS lard/DGRS large/PRTY lark/MRS larva/S larvae laser/MS lash/DGJRS lashed/U lass/MS last/DGRSY lasting/PY latch/DGS late/DPRTY latency/MS latent/SY lateral/Y LaTeX latex/MS LaTeX's lath/GRS lather/DGR Latin/M latitude/MS latrine/MS latter/MY lattice/DGMS laugh/DGRZ laughable/P laughably laughing/Y laughs laughter/S launch/DGJRSZ launder/DGJRS laundered/U laundry/S laurel/MS Laurie/M lava lavatory/MS lavender/DG lavish/DGPY law/MS lawful/PUY lawless/PY lawn/MS lawsuit/MS lawyer/MSY lay/GRSZ layer/DGS layman laymen layoffs layout/MS lazed lazily lazing lazy/DGPRT lead/DGJNRSZ leaded/U leaden/PY leader/MS leadership/MS leaf/DGS leafless leaflet/MS leafy/RT league/DGRSZ leak/DGRS leakage/MS lean/DGJPRSTY leap/DGRS leapt learn/DGJRSZ learned/PY learns/A lease/ADGS leash/MS least leather/DGS leathern leave/DGJRSZ leaven/DG leavened/U lecture/DGRSZ led LED's ledge/RSZ LEDs lee/RSZ leech/MS leer/DGS left/S leftist/MS leftmost leftover/MS leftward/S leg/S legacy/MS legal/SY legality/S legend/MS legendary legged leggings legibility legible legibly legion/MS legislate/DGNSVX legislative/Y legislator/MS legislature/MS legitimacy legitimate/DGNSY leisure/DY leisurely/P lemma/MS lemon/MS lemonade lend/GRSZ length/NXY lengthen/DGRS lengths lengthwise lengthy/PR leniency lenient/Y lens/DGJMRSZ lent/A Lenten lentil/MS leopard/MS leprosy less/GNRSX lessen/DGS lesson/DGMS lest/R let/IMS letter/DGRS lettered/U letting lettuce levee/DMS level/PSY lever/DGMS leverage/DGS levy/DGRS lewd/PY lexical/Y lexicographic lexicographical/Y lexicon/MS liability/MS liable/AP liaison/MS liar/MS liberal/PSY liberate/DGNS liberator/MS liberty/MS libido librarian/MS library/MS libretti license/ADGRS licensed/AU licensee/MS lichen/DMS lick/DGRS licked/U lid/MS lie/DRS lied/R liege lien/MS lieu lieutenant/MS life/MRZ lifeless/PY lifelike/P lifelong lifestyle/S lifetime/MS lift/DGRSZ light/DGNPRSTXYZ lighten/DGRS lighter/MS lighthouse/MS lightning/DMS lightweight/S like/DGJPRSTY likelihood/SU likely/PRT liken/DGS likeness/MS likewise lilac/MS lily/DMS limb/DRSZ limber/DGPSY limbers/U lime/DGMS limestone limit/DGRSZ limitability limitably limitation/MS limited/PSY limitedly/U limp/DGPRSY linden line/DGJMRSZ linear/Y linearity/S lined/U linen/MS linger/DGRS lingering/Y linguist/MS linguistic/S linguistically link/DGJRSZ linkage/MS linking/AU linoleum linseed lint/RS lion/MS lioness/MS lip/MS lipstick liquefy/DGRSZ liquid/MPSY liquidation/MS liquidity liquor/DGMS lisp/DGMRS list/DGJNRSXZ listed/U listen/DGRSZ listing/MS lit literacy literal/PSY literary/P literate/NPY literature/MS lithe/PY litigate/DGNS litigator litter/DGRS little/PRT livable/P livably live/DGHJPRSTYZ livelihood lively/PRT liven/DG livery/D living/PSY Liz/M lizard/MS load/DGJRSZ loaf/DGRSZ loan/DGRS loath/DGPRSY loathe/DGRS loathsome/PY loaves lobby/DGS lobe/DMS lobster/MS local/SY locality/MS locate/DGNRSVX locative/S locator/MS loci lock/DGJRSZ lockout/MS lockup/MS locomotion locomotive/MSY locus/M locust/MS lodge/DGJRSZ lodger/MS loft/MRS lofty/PR log/MS logarithm/MS logarithmically logged/U logger/MS logging logic/MS logical/PSY logician/MS login/S logistic/S logout loin/MS loiter/DGRS lone/PRYZ lonely/PRT lonesome/PY long/DGJPRSTY longing/SY longitude/MS longword/MS look/DGRSZ lookahead lookout/S lookup/MS loom/DGS loon loop/DGRS loophole/DGMS loose/DGPRSTY loosen/DGRS loot/DGRS lord/GMSY lordly/PR lordship lore lorry/S lose/GJRSZ loss/MS lossy/RT lost/P lot/MS lottery/S lotus loud/NPRTY louden/DG loudspeaker/MS lounge/DGRSZ lousy/PR lovable/P lovably love/DGMRSYZ loved/U lovely/PRST lover/GMSY loving/PY low/GPRSTYZ lower/DGS lowland/RS lowly/PRT loyal/Y loyalty/MS lubricant/MS lubrication luck/DS luckily/U luckless lucky/PRT ludicrous/PY luggage lukewarm/PY lull/DS lullaby lumber/DGRS luminous/PY lump/DGNRS lunar lunatic/S lunch/DGRS luncheon/MS lung/DGRS lurch/DGRS lure/DGRS lurk/DGRSZ luscious/PY lust/GS lustily lustrous/PY lusty/PR lute/DGMS luxuriant/Y luxurious/PY luxury/MS lying/SY Lyle/M lymph lynch/DRS lynx/MS lyre/MS lyric/S ma'am macaroni/M MacDraw/M mace/DGRS machine/DGMS machinery/S MacIntosh/M MacPaint/M macro/MS macroeconomics macromolecule/MS macroscopic mad/PY madam/S madden/DG maddening/Y madder maddest made/AU mademoiselle/S madman madras Mafia/M magazine/DGMS maggot/MS magic magical/Y magician/MS magistrate/MS magnesium/S magnet/MS magnetic/S magnetically magnetism/MS magnificence magnificent/Y magnified/U magnify/DGNRSXZ magnitude/MS mahogany maid/MNSX maiden/SY maidenly/P mail/DGJRSZ mailable mailbox/MS mailer/MS maim/DGRSZ maimed/P main/SY mainframe/MS mainland/RZ mainstay maintain/DGRSZ maintainability maintainable/U maintained/U maintainer/MS maintenance/MS majestic majesty/MS major/DGS majority/MS makable make/GJRSZ makefile/S makeshift/S makeup/S malady/MS malaria male/MPS malefactor/MS malfunction/DGS Malibu/M malice malicious/PY maliciously/U malignant/Y mall/MS mallet/MS malnutrition malt/DGS mama mamma/MS mammal/MS mammoth man/DMSY manage/DGRSZ manageable/P managed/U management/MS manager/MS managerial/Y mandate/DGS mandatory/S Mandelbrot/M mandible mandolin/MS mane/DMS manger/MS mangle/DGRS Manhattan/M manhood maniac/MS manicure/DGS manifest/DGPSY manifestation/MS manifold/MPRSY Manila/M manipulability manipulable manipulatable manipulate/DGNSVX manipulative/P manipulator/MS manipulatory mankind manly/PRT manned/U manner/DSY mannered/U mannerly/PU manning manometer/MS manor/MS manpower mansion/MS mantel/MS mantissa/MS mantle/DGMS manual/MSY manufacture/DGRSZ manufacturer/MS manure/DGRSZ manuscript/MS many map/MS maple/MS mappable mapped/U mapping/MS maps/U mar/S marble/DGRS march/DGRS mare/MS margin/DGMS marginal/SY Marianne/M marigold/MS marijuana/M marinate/DGS marine/RS maritime/R mark/DGJRSZ markable/A marked/AU markedly market/DGJRS marketability marketable marketplace/MS marquis/S marriage/MS marriages/A married/AU marrow/S marry/DGS marsh/MS marshal/DGRSZ mart/NSX martial/Y martyr/MS martyrdom marvel/S Mary/M Maryland/MZ masculine/PY masculinity mash/DGJRSZ mask/DGJRS masked/U masochist/MS mason/DGMS masonry masquerade/GRS mass/DGSV Massachusetts massacre/DGRS massage/DGRS Massey/M massing/R massive/PY mast/DRSZ master/DGJMSY masterful/PY masterly/P masterpiece/MS mastery masturbate/DGNS mat/DGJMRS match/DGJRSZ matchable/U matched/U matchless/Y matchmaker/MS matchmaking/M mate/DGJMRS mated/U material/PSY materialism/M maternal/Y mates/IU math mathematical/Y mathematician/MS mathematics matrices matriculation matrimony matrix/S matron/Y Matt/M matted matter/DGS mattress/MS maturation mature/DGPRSY maturity/S max maxim/MS maximal/Y maximum/SY Maxtor/M may/GRST maybe mayhap mayhem mayonnaise mayor/MS mayoral maze/DGMRS mazed/PY mazedness/S McElhaney/M McKenzie/M McMartin/M me/DGR mead/S meadow/MS meager/PY meal/MS mean/GJPRSTY meander/DGJS meaning/MS meaningful/PY meaningless/PY meant/U meantime meanwhile measles measurable/U measurably measure/DGRS measured/Y measurement/MS meat/MS mechanic/MS mechanical/SY mechanism/MS medal/MS medallion/MS meddle/DGRS media/S median/MSY mediate/DGNPSVXY medic/MS medical/Y medicinal/Y medicine/MS medieval/MSY meditate/DGNSVX meditative/PY medium/MS Medusa/M meek/PRTY meet/GJRSY megabit/S megabyte/S megaword/S melancholy meld/GS mellow/DGPSY melodious/PY melodrama/MS melody/MS melon/MS melt/DGRS melting/Y member/DMS membership/MS membrane/DMS memo/MS memoir/S memorability memorable/P memoranda memorandum/S memorial/SY memory/MS memoryless men/MS menace/DGS menacing/Y menagerie/S mend/DGRS menial/SY mens/DGS mental/Y mentality/S mention/DGRSZ mentionable/U mentioned/U mentor/MS menu/MS mercenary/MPS merchandise/DGRS merchant/MS merciful/PY mercifully/U merciless/PY mercury/S mercy/S mere/TY merge/DGRSZ meridian/S merit/DGS meritorious/PY merrily merriment/S merry/PRT mesh/DGS meshed/U mess/DGS message/DGMS messenger/MS messiah messiahs messieurs messily messy/PRT met/DGRSZ meta metacircular metacircularity metal/MS metalanguage/S metallic metallurgy metamathematical metamorphosis metaphor/MS metaphorical/Y metaphysical/Y metaphysics metavariable mete/DGRSZ meteor/MS meteoric meteorology meter/DGMS method/MS methodical/PY methodist/MS methodological/Y methodologists methodology/MS metric/MS metrical/Y metropolis metropolitan mew/DS MHz mica mice Michigan/M microbicidal microbicide microcode/DGS microcomputer/MS microeconomics microfilm/DMRS microinstruction/MS microphone/GS Microport/M microprocessing microprocessor/MS microprogram/MS microprogrammed microprogramming microscope/MS microscopic microsecond/MS Microsoft/M microstore microwave/MS microword/S mid midday middle/DGJRS middling/SY midnight/SY midpoint/MS midst/S midsummer midway/S Midwest midwinter/Y mien/S miff/DGS might/S mightily mighty/PRT migrate/DGNSVX mild/NPRTY mildew/S mile/MRS mileage/S milestone/MS militant/PSY militarily militarism/S military/S militia/S milk/DGRSZ milkmaid/MS milky/PR mill/DGRSZ millet million/DHS millionaire/MS millipede/MS millisecond/S millstone/MS mimic/S mimicked mimicking mince/DGRSZ mincing/Y mind/ADGRSZ minded/P mindful/PY mindless/PY mine/DGNRSXZ mineral/MS mingle/DGS miniature/DGMS minicomputer/MS minimal/Y minimum/S minister/DGMS ministry/MS mink/MS Minnesota/M minnow/MS minor/DGMS minority/MS minstrel/MS mint/DGRS minus/S minute/DGPRSTY miracle/MS miraculous/PY mire/DGS mirror/DGS mirth misapply/DGNRS misbehaving miscalculation/MS miscellaneous/PY mischief mischievous/PY miscommunicate/DNS misconception/MS misconstrue/DGS misdirect/DS misdirection miser/SY miserable/P miserably miserly/P misery/MS misfeature misfit/MS misfortune/MS misgiving/SY misguide/DGRS misguided/PY mishap/MS misinform/DGS misinformation misinterpret/DGRSZ mislead/GJRS misleading/SY misled mismatch/DGS misnomer/D misperceive/DS misplace/DGS misread/GRS misrepresentation/MS miss/DGSV missile/MS mission/DGRS missionary/MS missions/A missive/S misspell/DGJS misstate/DGRS mist/DGRSZ mistakable/U mistake/GRS mistaken/Y mistaking/Y mister/DGS mistreat/DGS mistress/Y mistrust/DGRS misty/PRT mistype/DGS misunderstand/GJRSZ misunderstanding/MS misunderstood misuse/DGRS MIT MIT's mite/S mitigate/DGNSVX mitten/MS mix/DGRSZ mixed/AU mixture/MS ml mnemonic/MS mnemonically moan/DGS moat/MS mob/MS mobility moccasin/MS mock/DGRSZ mockery mocking/Y modal/Y modality/MS mode/ST model/MS models/A modem/S moderate/DGNPSXY moderated/U moderator/MS modern/PSY modernity modest/Y modesty modifiability modifiable/P modified/U modify/DGNRSXZ modular/Y modularity/S modulate/DGNSX modulator/AMS module/MS modulo modulus modus moist/NPY moisten/DGR moisture/S molasses mold/DGRSZ molder/DGS molding/A moldy/PR mole/ST molecular/Y molecule/MS molest/DGRSZ molested/U molten mom/MS moment/MSY momentarily momentary/P momentous/PY momentum/S monarch monarchs monarchy/MS monastery/MS monastic Monday/MS monetary money/DMRS monitor/DGS monk/MS monkey/DGS mono/M monochrome/S monograph/MS monographs monolithic monopoly/MS monotheism monotone monotonic monotonically monotonicity monotonous/PY monotony monster/MS monstrous/PY Montana/M Montanan/M month/MY monthly/S months monument/MS monumental/Y mood/MS moody/PR moon/DGS moonlight/DGRS moonlit moonshine/R moor/DGJMS moose moot/D mop/DGRS moral/MSY morale/S morality/S morass/S morbid/PY more/DNS moreover morn/GJ morphological/Y morphology morrow morsel/MS mortal/SY mortality mortar/DGS mortgage/DGMRS mortified/Y mortify/DGNRSX mosaic/MS Moslem/MS mosquito/S mosquitoes moss/MS mossy/R most/Y motel/MS moth/RZ mother/DGMRSYZ motherboard/MS motherly/P motif/MS motion/DGRS motionless/PY motivate/DGNSVX motivated/U motivational/Y motive/DGS motley motor/DGS motorcar/MS motorcycle/MS motorist/MS Motorola/M motto/S mottoes mould/DGRS moulder/G moulds/A mound/DS mount/DGJRS mountain/MS mountaineer/GS mountainous/PY mounted/U mourn/DGRSZ mournful/PY mourning/Y mouse/GRS mouth/DGRS mouthful mouths movable/AP move/DGJRSZ moved/AU movement/MS movie/MS moving/SY mow/DGRSZ Mr/S Ms much/P muck/DGRS mud/S muddle/DGRSZ muddy/DGPR muff/MS muffin/MS muffle/DGRSZ mug/MS mulberry/MS mule/GMS Multibus/M multicellular multicomponent Multics multidimensional multilevel multinational multiple/MS multiplex/DGRSZ multiplexor/MS multiplicand/MS multiplicative/SY multiplicity multiply/DGNRSXZ multiprocess/G multiprocessor/MS multiprogram multiprogrammed multiprogramming/S multistage multitasking multitude/MS multiuser multivariate mumble/DGJRSZ mummy/MS munch/DGRS mundane/PY municipal/Y municipality/MS munition/S Munsey/M mural/S murder/DGRSZ murderous/PY murky/PR murmur/DGRS murmuring/U muscle/DGS muscular/Y muse/DGJRS museum/MS mushroom/DGS mushy/PR music/S musical/SY musician/SY musing/SY musk/S musket/MS muskrat/MS Muslim/MS muslin mussel/MS must/RSZ mustard/S muster/DGS musty/PR mutability mutable/P mutate/DGNSVX mutator/S mute/DGPRSTY muted/Y mutilate/DGNSX mutiny/MS mutter/DGRSZ mutton mutual/Y muzzle/DGMRS my/S myriad myrtle myself mysterious/PY mystery/MS mystic/MS mystical/Y mysticism/S myth/MS mythical/Y mythology/MS nag/MS nail/DGRS naive/PRY naivete naked/PY name/DGMRSYZ nameable/U named/AU nameless/PY namesake/MS nanosecond/S nap/MS napkin/MS narcissistic narcissus/S narcotic/S narrative/MSY narrow/DGPRSTY narrowing/P nasal/Y nastily nasty/PRST nation/MS national/SY nationalist/MS nationality/MS nationwide native/PSY nativity natural/PSY naturalism naturalist nature/DMS natured/A natures/A naught/MS naughty/PR naval/Y navigable/P navigate/DGNSX navigator/MS navy/MS nay Nazi/MS near/DGPRSTY nearby neat/NPRSTY Nebraska/M Nebraskan/M nebula necessarily/U necessary/S necessitate/DGNSX necessity/S neck/DGRS necklace/MS necktie/MS need/DGRSY needed/U needful/PY needle/DGRSZ needless/PY needlework/R needn't needy/PR negate/DGNRSVX negated/U negative/DGPSY negator/S neglect/DGRS negligence negligible negotiable/A negotiate/DGNSX negotiated/A negotiates/A Negro/M Negroes neigh neither neophyte/S Nepal/M nephew/MS nerve/DGMS nervous/PY nest/DGRS nestle/DGRS net/MS nether Netherlands netted netting nettle/DGS network/DGMS neural/Y neurobiology/M neurological/Y neurologists neuron/MS neutral/PSY neutrality/S neutrino/MS never nevertheless new/PRSTY newborn/S newcomer/MS newline/MS NeWS newsgroup/MS newsletter/MS newsman newsmen newspaper/MS newswire newt/S Newtonian next NFS nibble/DGRSZ nice/PRTY nicety/S niche/GS nick/DGRS nickel/MS nicker/DG nickname/DRS nicotine niece/MS nifty/RS nigh night/DMSYZ nightfall nightgown nightingale/MS nightmare/MS nil/Y nimble/PRT nimbly nine/S nineteen/HS ninety/HS ninth nip/S nitrogen nix/DGRS no/A nobility/S noble/PRST nobleman nobly nobody/MS nocturnal/Y nod/MS nodded nodding node/MS noise/DGS noiseless/Y noisily noisy/PR nomenclature/S nominal/Y nominate/DGNSVX nominated/A nominates/A nomination/MS nominative/Y non nonblocking nonconservative noncyclic nondecreasing nondescript/Y nondestructively nondeterminacy nondeterminate/Y nondeterminism nondeterministic nondeterministically nondisclosure/S none/S nonempty nonetheless nonexistence nonexistent nonextensible nonfunctional noninteracting noninterference nonintuitive nonlinear/Y nonlinearity/MS nonlocal nonnegative nonorthogonal nonorthogonality nonperishable nonprocedural/Y nonprogrammable nonprogrammer nonsense nonsensical/PY nonspecialist/MS nonstandard nontechnical/Y nonterminal/MS nonterminating nontermination nontrivial nonuniform nonzero nook/MS noon/GS noonday noontide nope nor/H norm/DMS normal/SY normalcy normality north/GMRZ northeast/R northeaster/Y northeastern norther/SY northern/RYZ northward/S northwest/R northwester/Y northwestern nose/DGS nostril/MS not/DGR notable/PS notably notation/MS notational/Y notch/DGS note/DGNRSX notebook/MS noted/PY noteworthy/P nothing/PS notice/DGS noticeable noticeably noticed/U notify/DGNRSXZ notorious/PY notwithstanding noun/MS nourish/DGRS nourished/U nourishment novel/MS novelist/MS novelty/MS November/MS novice/MS now/S nowadays nowhere/S nroff/M nuances nuclear nucleotide/MS nucleus/S nuisance/MS null/DS nullify/DGNRSZ numb/DGPRSYZ number/DGRS numbered/AU numberless numbing/Y numeral/MSY numerator/MS numeric/S numerical/Y numerous/PY nun/MS nuptial/S nurse/DGMRS nursery/MS nurture/DGRS nut/MS nutrition/M nymph nymphs o'clock oak/NS oar/DGMS oasis oat/NRS oath oaths oatmeal obedience/S obedient/Y obey/DGRS obfuscate/DGNRSX object/DGMSV objection/MS objectionable/P objective/PSY objector/MS oblate/NPXY obligate/DGNSXY obligation/MS obligatory oblige/DGRS obliging/PY oblique/PY obliterate/DGNSVX obliterative/Y oblivion/S oblivious/PY oblong/PY obscene/Y obscure/DGPRSY obscurity/S observable/U observance/MS observant/Y observation/MS observatory/S observe/DGRSZ observed/U observing/Y obsession/MS obsolescence obsolete/DGPSY obstacle/MS obstinacy obstinate/PY obstruct/DGRSV obstruction/MS obstructionist obstructive/PY obtain/DGRS obtainable/U obtainably obviate/DGNSX obvious/PY occasion/DGJS occasional/Y occlude/DGS occlusion/MS occupancy/S occupant/MS occupation/MS occupational/Y occupied/U occupy/DGRSZ occur/S occurred occurrence/MS occurring ocean/MS octal/S octave/S October/MS octopus odd/PRSTY oddity/MS ode/DMRS Oderberg/MS odious/PY odorous/PY Oedipus OEM/S OEM's of off/GRSZ offend/DGRSZ offensive/PSY offer/DGJRSZ office/MRSZ officer/DMS official/MSY officially/U officiate/DGNSX officio officious/PY offset/MS offspring/S oft/N often/R oftentimes oh Ohio/M oil/DGRSZ oilcloth oily/PRT ointment/S OK okay/MS Oklahoma/M Oklahoman/M old/NPRT olive/MRS Oliver's omen/MS ominous/PY omission/MS omit/S omitted omitting omnipresent/Y omniscient/Y omnivore on/RSY onanism once/R one/MNPRSX onerous/PY oneself ongoing online only/P onset/MS onto onward/S oops ooze/DGS opacity/S opal/MS opaque/PY opcode/MS open/DGJPRSTYZ opened/AU opening/MS opera/MS operable/I operand/MS operandi operate/DGNSVX operational/Y operative/PSY operator/MS opiate/S opinion/MS opium opponent/MS opportune/IY opportunism opportunistic opportunistically opportunity/MS oppose/DGRS opposite/NPSXY oppress/DGSV oppression oppressive/PY oppressor/MS opt/DGS optic/S optical/Y optimal/Y optimality optimism optimistic optimistically optimum option/MS optional/Y or/MY oracle/MS oral/SY orange/MS oration/MS orator/MS oratory/MS orb orbit/DGRSZ orbital/SY orchard/MS orchestra/MS orchid/MS ordain/DGRS ordeal/S order/DGJRSY ordered/AU orderly/PS ordinal ordinance/MS ordinarily ordinary/PS ordinate/DGNSX ore/MNS organ/MS organic/S organism/MS organist/MS orgy/MS orient/DGS orientation/MS oriented/A orifice/MS origin/MS original/SY originality originals/U originate/DGNSVX originative/Y originator/MS ornament/DGS ornamental/Y ornamentation/S orphan/DGS orthodox/SY orthodoxly/U orthogonal/Y orthogonality OS OS's oscillate/DGNSX oscillation/MS oscillator/MS oscillatory oscilloscope/MS ostrich/MS other/MPS otherwise otter/MS ought/S ounce/S our/S ourself ourselves out/DGJPRS outbreak/MS outburst/MS outcast/MS outcome/MS outcry/S outdoor/S outermost outfit/MS outgoing/PS outgrew outgrow/GHS outgrown outing/MS outlast/S outlaw/DGS outlay/MS outlet/MS outline/DGS outlive/DGS outlook outperform/DGS outpost/MS output/MS outputting outrage/DGS outrageous/PY outright/Y outrun/S outset outside/RZ outsider/MPS outskirts outstanding/Y outstretched outstrip/S outstripped outstripping outvote/DGS outward/PSY outweigh/DG outweighs outwit/S outwitted outwitting oval/MPSY ovary/MS oven/MS over/GSY overall/MS overblown overboard overcame overcast/G overcoat/GMS overcome/GRS overcrowd/DGS overdone overdose/DGMS overdraft/MS overdraw/GS overdrawn overdrew overdue overemphasis overestimate/DGNSX overflow/DGS overhang/GS overhaul/DGJRS overhead/S overhear/GRS overheard overjoy/D overkill/M overlaid overland overlap/MS overlapped overlapping overlay/GS overload/DGS overlook/DGS overly/G overnight/RSZ overpower/DGS overpowering/Y overprint/DGS overproduction overridden override/GRS overrode overrule/DGS overrun/S overseas oversee/RSZ overseeing overshadow/DGS overshoot/GS overshot oversight/MS oversimplify/DGNSX overstate/DGS overstatement/MS overstocks overt/PY overtake/GRSZ overtaken overthrew overthrow/GS overthrown overtime overtone/MS overtook overture/MS overturn/DGS overuse overview/MS overweight overwhelm/DGS overwhelming/Y overwork/DGS overwrite/GS overwritten overwrote overzealous/P ovum owe/DGS owl/MRS own/DGRSZ owner/MS ownership/S ox/N oxidation oxide/MS oxygen/S oyster/GMS pa/HS pace/DGMRSZ pacific pacify/DGNRSX pack/DGRSZ package/DGJRSZ packaged/AU packages/AU Packard/MS packet/DGMS packs/AU pact/MS pad/MS padded/U padding/S paddle/DGRS paddy/S pagan/MS page/DGMRSZ pageant/MS paged/U pager/MS paginate/DGNSX paid/AU pail/MS pain/DGS painful/PY painless/PY painstaking/Y paint/DGJRSZ painted/AU painter/SY painterly/P pair/DGJS paired/AU pairwise pal/DGMRSTY palace/MS palate/MS pale/DGPRSTY Palestinian palfrey pall/G palliate/NV palliative/SY pallid/PY palm/DGRS pamphlet/MS pan/MS panacea/MS pancake/DGMS pancreas panda/MS pandemonium pander/DGRS pane/MS panel/S panelist/MS pang/MS panic/MS panned panning pansy/MS pant/DGS panther/MS pantry/MS panty/S papa papal/Y paper/DGJMRSZ paperback/MS paperwork paprika par/GJRS parachute/DGMRS parade/DGRS paradigm/MS paradise paradox/MS paradoxical/PY paraffin/S paragon/MS paragraph/DGR paragraphs parallax/M parallel/S parallelism parallelogram/MS paralysis parameter/MS parameterless parametric paramilitary paramount paranoia paranoid parapet/DMS paraphrase/DGRS parasite/MS parasitic/S parcel/S parch/D parchment pardon/DGRSZ pardonable/P pardonably pare/GJRS parent/GMS parentage parental/Y parentheses parenthesis parenthetical/Y parenthood parish/MS parity/S park/DGRSZ parliament/MS parliamentary/U parole/DGS parrot/GS parry/DG pars/DGJRSZ parse/DGJRSZ parsed/U parser/MS parsimony parsley parson/MS part/DGJRSYZ partake/GRS partial/SY partiality participant/MS participate/DGNSVX participatory particle/MS particular/SY partisan/MS partition/ADGRS partitioned/AU partner/DGMS partnership/S partridge/MS party/DGMS Pascal/M pass/DGRSVZ passage/DGMS passageway passe/DGNRSVXZ passenger/MSY passionate/PY passive/PSY passivity passport/MS password/DMS past/DGMPS paste/DGS pastime/MS pastor/MS pastoral/PY pastry/S pasture/DGMRS pat/DMNRS patch/DGRS patchwork/RZ patent/DGRSYZ patentable paternal/Y pathetic pathname/MS pathological/Y pathologist/MS pathology/S pathos paths pathway/MS patience patient/MSY patriarch patriarchs patrician/MS patriot/MS patriotic/U patriotism patrol/MS patron/MSY patronage patter/DGJRS pattern/DGS patty/MS paucity pause/DGS pave/DGRS paved/U pavement/MS pavilion/MS paving/A paw/DGS pawn/DGMRS pay/DGRSZ payable/A paycheck/MS payer/MS payment/MS payments/A payoff/MS payroll/S PC PC's PCs PDP pea/MS peace/S peaceable/P peaceful/PY peach/MS peacock/MS peak/DGS peaked/P peal/ADGS peanut/MS pear/SY pearl/MRS pearly/R peasant/MS peasantry peat/A pebble/DGMS peck/DGRS peculiar/SY peculiarity/MS pedagogic/S pedagogical/Y pedantic peddler/MS pedestal/S pedestrian/MS pediatric/S peek/DGS peel/DGRS peeler/M peep/DGRSZ peer/DGS peerless/PY peeve/DGMSZ peg/MS pellet/DGMS pelt/GRS pen/S penalty/MS penance/DGS pence pencil/S pend/DGS pendulum/MS penetrate/DGNSVX penetrating/Y penetrative/PY penetrator/MS penguin/MS peninsula/MS penitent/Y penitentiary penned penniless penning Pennsylvania/M penny/MS pens/V pension/DGRSZ pensive/PY pent/A pentagon/MS penthouse/MS people/DGMS pep pepper/DGRS peppercorn/MS per perceivable perceivably perceive/DGRSZ perceived/U percent/S percentage/S percentile/S perceptible perceptibly perception/S perceptive/PY perceptual/Y perch/DGS perchance percolate/DGNS percutaneous/Y peremptory/P perennial/SY perfect/DGPRSVY perfection/S perfectionist/MS perfective/PY perforce perform/DGRSZ performance/MS performed/U perfume/DGRS perhaps peril/MS perilous/PY period/MS periodic periodical/SY peripheral/SY periphery/MS perish/DGRSZ perishable/MS perishing/Y permanence permanent/PSY permeate/DGNSVX permissibility permissible/P permissibly permission/S permissive/PY permit/MS permitted permitting permutation/MS permute/DGS perpendicular/SY perpetrate/DGNSX perpetrator/MS perpetual/Y perpetuate/DGNS perplex/DGS perplexed/Y perplexity/S persecute/DGNSV persecutor/MS perseverance persevere/DGS persist/DGRS persistence persistent/Y person/MS personable/P personage/MS personal/SY personality/MS personify/DGNRSX personnel perspective/MSY perspicuous/PY perspiration/S persuadable persuade/DGRSZ persuasion/MS persuasive/PY pertain/DGS pertinent/Y perturb/DG perturbation/MS perturbed/U perusal peruse/DGRSZ pervade/DGS pervasive/PY pervert/DGRS perverted/PY pessimistic pest/RSZ pester/DGS pestilence/S pet/RSZ petal/MS peter/DS Peter's petition/DGRS Petkiewicz/M petroleum petted petter/MS petticoat/DMS pettiness/S petting petty/PRT pew/MS pewter/R phantom/MS phase/DGRSZ PhD pheasant/MS phenomena phenomenal/Y phenomenological/Y phenomenology/S phenomenon philosopher/MS philosophic philosophical/Y philosophy/MS phone/DGMS phoneme/MS phonemic/S phonetic/S phonograph/R phonographs phosphate/MS phosphoric photo/MS photocopy/DGRS photograph/DGRZ photographic photographs photography phrase/DGJS phyla phylum physic/S physical/PSY physician/MS physicist/MS physiological/Y physiology physique/D pi/DHRZ piano/MS piazza/MS picayune pick/DGJRSZ picker/GS picket/DGRSZ pickle/DGS pickup/MS picnic/MS pictorial/PY picture/DGS picturesque/PY pie/DRSZ piece/DGRS piecemeal piecewise pierce/DGS piercing/Y piety/S pig/MS pigeon/MS pigment/DS pike/DGMRS pile/DGJSZ pilferage pilgrim/MS pilgrimage/MS pill/MS pillage/DGRS pillar/DS pillow/MS pilot/DGMS pin/DGMS pinch/DGRS pine/DGNSX pineapple/MS ping/GR pinion/DS pink/DGPRSTY pinnacle/DGMS pinned pinning/S pinpoint/DGS pint/MRS pioneer/DGS pious/PY pipe/DGJRSZ pipeline/DGS piping/SY pique/DG pirate/DGMS piss/DGRS pistil/MS pistol/MS piston/MS pit/MS pitch/DGRSZ piteous/PY pitfall/MS pith/DGS pithy/PRT pitiable/P pitiful/PY pitiless/PY pitted pity/DGRSZ pitying/Y pivot/DGS pivotal/Y pixel/MS placard/MS place/ADGRS placed/AU placement/AMS placid/PY plague/DGRS plagued/U plaid/DMS plain/PRSTY plaintiff/MS plaintive/PY plait/GMRS plan/DGMRSZ planar planarity Planck/M plane/DGMRSZ planet/MS planetary plank/GS planned/U planner/MS planning plant/DGJRSZ plantation/MS planted/A plasma plaster/DGRSZ plastic/SY plasticity plate/DGJRSZ plateau/MS platelet/MS platen/MS platform/MS platinum platter/MS plausibility plausible/P play/DGRSZ playable player/MS playful/PY playground/MS playmate/MS plaything/MS playwright/MS plea/MS plead/DGJRS pleader/A pleading/SY pleas/DGRS pleasant/PUY please/DGRSY pleased/U pleasing/PY pleasurable/P pleasure/DGS plebeian/Y plebiscite/MS pledge/DGRS plenary plenteous/PY plentiful/PY plenty/S pleurisy plight/R plod/S plot/MS plotted plotter/MS plotting ploy/MS pluck/DGR plucky/PR plug/MS plugged/U plugging/U plugs/U plum/DGMS plumage/DS plumb/DGMRSZ plumbed/U plume/DGS plummeting plump/DNPRY plunder/DGRSZ plunge/DGRSZ plural/SY plurality plus/S plush/PY ply/DGNRSZ pneumonia poach/DGRSZ pocket/DGS pocketbook/MS pod/MS poem/MS poet/MS poetic/S poetical/PY poetry/MS point/DGRSZ pointed/PY pointless/PY pointy/RT poise/DGS poison/DGRS poisonous/PY poke/DGRS Poland/M polar polarity/MS pole/DGRS polemic/S police/DGMS policeman/M policemen/M policy/MS polish/DGRSZ polite/PRTY politic/S political/Y politician/MS poll/DGNRS polled/U pollute/DGNRSV polluted/U polo polygon/MS polymer/MS polynomial/MS polyphonic pomp pompous/PY pond/RSZ ponder/DGRS ponderous/PY pony/MS poof pool/DGS poor/PRTY pop/MS pope/MS Popek/MS poplar popped popping poppy/DMS populace popular/Y popularity/U populate/DGNSX populous/PY porcelain porch/MS porcupine/MS pore/DGS pork/R porn pornographic porridge port/DGRSYZ portability portable/S portably portal/MS portamento/M portend/DGS porter/GS portion/DGMS portly/PR portrait/MS portray/DGRS pose/DGRSZ posit/DGSV position/ADGS positional positive/PSY possess/DGSV possessed/PY possession/MS possessional possessive/MPSY possessor/MS possibility/MS possible/S possibly possum/MS post/DGJRSZ postage postal postcard/MS postcondition/S poster/MS posterior/Y posterity postman postmaster/MS postpone/DGRS postscript/MS postulate/DGNSX posture/DGMRS pot/MS potash potassium potato potatoes potent/Y potentate/MS potential/SY potentiality/S potentiating potentiometer/MS potted potter/MRS pottery/S potting pouch/DMS poultry pounce/DGS pound/DGRSZ pour/DGRSZ pouring/Y pout/DGRS poverty powder/DGRS power/DGS powerful/PY powerless/PY pox/S practicable/P practicably practical/PY practicality/S practice/MS practitioner/MS pragmatic/S pragmatically prairie/S praise/DGRSZ praising/Y prance/DGRS prancing/Y prank/MS prate/DGRS prating/Y pray/DGRSZ prayer/MS preach/DGRSZ preaching/Y preallocate/DGNSX preallocation/MS preallocator/S preassign/DGS precarious/PY precaution/DGMS precede/DGS precedence/MS precedent/DS precedented/U precept/MSV preceptive/Y precinct/MS precious/PY precipice precipitate/DGNPSVY precipitous/PY precise/NPXY preclude/DGS precocious/PY preconceive/D preconception/MS precondition/DS precursor/MS predate/DGNS predecessor/MS predefine/DGS predefinition/MS predetermine/DGRS predicament predicate/DGNSVX predict/DGSV predictability/U predictable/U predictably/U predicted/U prediction/MS predictive/Y predictor/S predominant/Y predominate/DGNSY preempt/DGSV preemption preemptive/Y preface/DGRS prefer/S preferable/P preferably preference/MS preferential/Y preferred preferring prefix/DGS pregnant/Y prehistoric prejudge/DR prejudice/DGS prejudiced/U prelate preliminary/S prelude/DGMRS premature/PY prematurity premeditated/Y premier/DGMS premiere/DGS premise/DGMS premium/MS preoccupation/S preoccupy/DS preparation/MS preparative/MSY preparatory prepare/DGRS prepared/PY prepend/DGRSZ preposition/MS prepositional/Y preposterous/PY preprint/DGS preprocessor/S preproduction preprogrammed prerequisite/MS prerogative/DMS prescribe/DGRS prescribed/U prescription/MS prescriptive/Y preselect/DGS presence/MS present/DGPRSYZ presentation/AMS preservation/S preservative/MS preserve/DGRSZ preserved/U preset/S preside/DGRS presidency president/MS presidential/Y press/DGJRS pressing/SY pressure/DGS prestige presumably presume/DGRS presuming/Y presumption/MS presumptuous/PY presuppose/DGS pretend/DGRSZ pretended/Y pretending/U pretentious/PUY pretext/MS prettily pretty/DGPRST prevail/DGS prevailing/Y prevalence prevalent/Y prevent/DGRSV preventable preventably prevention/S preventive/PSY preview/DGRSZ previous/PY prey/DGRS price/DGRSZ priced/U priceless prick/DGRSY prickly/PR pride/DGS priest/SY priestly/P primacy primarily primary/MS prime/DGPRSYZ Prime's primed/U primeval/Y primitive/PSY primrose prince/SY princely/PR princess/MS principal/SY principality/MS principle/DS print/DGRSZ printable/U printably printed/AU printout/S prior/SY priori priority/MS priory prism/MS prison/RSZ prisoner/MS privacy/S private/NPSVXY privative/Y privilege/DS privileged/U privy/MS prize/DGRSZ pro/MS probabilistic probabilistically probability/S probable probably probate/DGNSV probates/A probation/RZ probe/DGJRS problem/MS problematic/U problematical/UY procedural/Y procedure/MS proceed/DGJRS process/DGMS processed/AU procession processor/MS proclaim/DGRSZ proclamation/MS proclivity/MS procrastinate/DGNS procrastinator/MS procure/DGRSZ procurement/MS prodigal/Y prodigious/PY produce/ADGRSZ producible/A product/MSV production/AMS productive/PY productively/A productivity/S profane/DGPRY profess/DGS professed/Y profession/MS professional/SY professionalism/S professor/MS proffer/DGS proficiency/S proficient/Y profile/DGRSZ profiler/MS profit/DGMRSZ profitability profitable/PU profitably/U profiteer/MS profound/PTY progeny program/MS programmability programmable programmed/A programmer/AMS programming/A progress/DGSV progression/MS progressive/PY prohibit/DGRSV prohibition/MS prohibitive/PY project/DGMSV projected/U projection/MS projective/Y projector/MS Prokofiev/M prolegomena proletariat proliferate/DGNSV prolific/P prolog/MS prologue/MS prolong/DGRS promenade/GMRS prominence prominent/Y promiscuity/M promiscuous/PY promise/DGRS promising/UY promontory/S promote/DGNRSVXZ promotional promotive/P prompt/DGJPRSTYZ prompted/U promulgate/DGNSX prone/PY prong/DS pronoun/MS pronounce/DGRS pronounceable/U pronounced/Y pronouncement/MS pronunciation/MS proof/DGMRS prop/RS propaganda propagate/DGNSVX propagated/U propel/S propelled propeller/MS propensity/S proper/PY propertied/U property/DS prophecy/MS prophesy/DGRS prophet/MS prophetic propitious/PY proponent/MS proportion/DGRS proportional/Y proportionately proportionment proposal/MS propose/DGRSZ proposition/DGS propositional/Y propound/DGRS proprietary proprietor/MS propriety propulsion/MS pros/GR prose/GR prosecute/DGNSX prosodic/S prospect/DGSV prospection/MS prospective/PSY prospector/MS prospectus prosper/DGS prosperity prosperous/PY prostitution prostrate/DN protect/DGSV protected/UY protection/MS protective/PY protector/MS protectorate protege/MS protein/MS protest/DGMRSZ protestants protestation/S protester/MS protesting/Y protocol/MS proton/MS protoplasm prototype/DGMS prototypical/Y protrude/DGS protrusion/MS proud/RTY provability/U provable/P provably prove/DGRSZ proved/AU proven/Y proverb/MS provide/DGRSZ provided/U providence province/MS provincial/Y provision/DGRS provisional/Y provocation provoke/DGS provoking/Y prow/MS prowess prowl/DGRSZ proximal/Y proximate/PY proximity prudence prudent/Y prune/DGRSZ pry/DGRST prying/Y psalm/MS pseudo psyche/MS psychiatrist/MS psychiatry psychological/Y psychologist/MS psychology psychosocial/Y pub/MS public/PSY publication/MS publicity publish/ADGRSZ published/AU pucker/DGS pudding/MS puddle/DGRS puff/DGRSZ pull/DGJRS pulley/MS pulp/GR pulpit/MS pulse/DGRS pump/DGRS pumpkin/MS pun/MS punch/DGJRSZ punched/U puncher/MS punctual/PY punctuation puncture/DGMS punish/DGRS punishable punished/U punishment/MS punitive/PY punt/DGRSZ puny/PR pup/MS pupa/S pupil/MS puppet/MS puppy/MS purchasable purchase/DGRSZ pure/PRTY purge/DGRS purify/DGNRSXZ purity purple/DGRST purport/DGRSZ purported/Y purpose/DGSVY purposeful/PY purposive/PY purr/DGS purring/Y purse/DGRSZ pursue/DGRSZ pursuit/MS purview push/DGRSZ pushbutton/S pushdown puss pussy/RS put/IS putter/GRS putting/I puzzle/DGJRSZ puzzlement pygmy/MS pyramid/MS QA quack/DGS quadrant/MS quadratic/S quadratical/Y quadrature/MS quadruple/DGS quadword/MS quagmire/MS quail/MS quaint/PY quake/DGRSZ qualified/UY qualify/DGNRSXZ qualitative/Y quality/MS qualm/S quandary/MS quanta quantifiable/U quantify/DGNRSXZ quantitative/PY quantity/MS quantum quarantine/DGMS quarrel/S quarrelsome/PY quarry/DGMRS quart/RSZ quarter/DGRSY quarterly/S quartet/MS quartz quash/DGS quasi quaver/DGS quavering/Y quay/S queen/MSY queer/PRSTY quell/DGRS quench/DGRS quenched/U query/DGRS quest/ADGRSZ question/DGJRSZ questionable/P questionably/U questioned/AU questioning/SY questioningly/U questionnaire/MS queue/DMRSZ queuer/MS quick/NPRTXY quicken/DGRS quicksilver quiet/DGNPRSTXY quieten/DGS quietude/I quill/S quilt/DGRS quinine quit/S quite/A quitter/MS quitting quiver/DGS quiz quizzed quizzes quizzing quo/H quota/MS quotation/MS quote/DGS quoted/U quotient/S rabbit/DGMRS rabble/DGR raccoon/MS race/DGRSZ racehorse/MS racial/Y rack/DGRS racket/MS racketeer/GS radar/MS radial/Y radiance radiant/Y radiate/DGNSVXY radiative/Y radiator/MS radical/PSY radio/DGS radiology radish/MS radius/S radix/S raft/RSZ rafter/DS rag/DGMS rage/DGS ragged/PY raid/DGRSZ rail/DGRSZ railroad/DGRSZ railway/MS raiment rain/DGMS rainbow/S raincoat/MS raindrop/MS rainfall rainy/RT raise/DGRSZ raisin/S rake/DGRS rally/DGS ram/MS ramble/DGJRSZ rambling/SY ramification/MS ramp/DGMS rampart/S rams/S ran/A ranch/DGRSZ random/PY rang/DGRZ range/DGRSZ rank/DGJPRSTYZ ranked/U ranker/MS ranking/MS rankle/DGS ransack/DGRS ransom/GRS rant/DGRSZ ranting/Y rap/DGMRS rape/DGRS rapid/PSY rapidity rapt/PY rapture/DGMS rapturous/PY rare/GPRTY rarity/MS rascal/SY rash/PRSY rasp/DGJRS raspberry rasping/SY raster/S rat/DGJMRSZ rate/DGJNRSXZ rated/U rather ratify/DGNSX ratio/MS ration/DGS rational/PY rationale/MS rationality/S rattle/DGRSZ rattlesnake/MS rattling/Y ravage/DGRSZ rave/DGJRS raven/DGRS ravenous/PY ravine/DMS raw/PRSTY ray/DMS razor/MS RCS re/DGJSTVY reabbreviate/DGS reach/DGRS reachable/U reachably reacted/U reactionary/MS reactivate/DGNS reactivity read/GJRSZ readability/U readable/P reader/MS readily readout/MS ready/DGPRST real/PSTY realign/DGS realism/U realist/MS realistic/U realistically/U reality/S realizable/MPS realizably/S realization/MS realize/DGJRSZ realized/U realizes/U realizing/MSY realm/MS ream/DGMRS reap/DGRS reappear/DGS reappraisal/S rear/DGRS rearrange/DGS rearrangeable rearrest/D reason/DGJRS reasonable/PU reasonably/U reassemble/DGRS reassign/DGS reassure/DGS reassuringly/U reawaken/DGS rebate/DGMRS rebel/MS rebelled rebelling rebellion/MS rebellious/PY rebirth/M reboot/DGRSZ rebound/DGRS rebroadcast/S rebuff/DGS rebuild/GS rebuke/DGRS rebuttal/S recall/DGRS recapitulate/DGNS recapture/DGS recast/GS recede/DGS receipt/DGMS receivable/S receive/DGRSZ receiver/MS recent/PY receptacle/MS reception/MS receptive/PY receptivity receptor/MS recess/DGSV recession/MS recessive/PY recipe/MS recipient/MS reciprocal/SY reciprocate/DGNSV reciprocity recirculate/DGNS recital/MS recite/DGRS reckless/PY reckon/DGJRS reclaim/DGRSZ reclamation/S reclassify/DGNS recline/DGS recode/DGS recognition/MS recombine/DGS recompense recompile/DGS recompute/DGS reconcile/DGRS reconciliation/MS reconfigure/DGRS reconnect/DGRS reconnection reconsider/DGS reconstruct/DGSV reconstructed/U reconstruction/S record/DGJRSZ recorded/U recount/DGRS recourse/S recover/DGRS recoverability recoverable/U recovery/MS recreate/DGNSVX recreational recruit/DGMRSZ recruiter/MS recta rectangle/MS rectangular/Y rector/MS rectum/MS recur/S recurrence/MS recurrent/Y recurring recurse/DGNSVX recursion/MS recyclable recycle/DGS red/PSY redbreast redden/DG redder reddest reddish/P redeclare/DGS redeem/DGRSZ redeemed/U redefine/DGS redemption/R redeposit/DGMS redesign/DGS redevelopment Redford/M redirect/DGS redirection/S redisplay/DGS redistribute/DGNSVX redouble/DGS redraw/GS redrawn redress/DGRS reduce/DGRSZ reducibility reducible reducibly reduction/MS redundancy/S redundant/Y reed/GMRS reeducation reef/GRS reel/DGRS reenactment reenter/DGS reentrant reestablish/DGS reevaluate/DGNS reexamine/DGS refer/S referee/DMS refereeing reference/DGRS referenced/U referendum referent/MS referential/Y referentiality referral/MS referred referrer referring refill/DGS refine/DGRS refined/U refinement/MS reflect/DGSV reflected/U reflection/MS reflective/PY reflectivity reflector/MS reflex/DMSVY reflexive/PY reflexivity refocus/DGS reformable reformat/SV reformation reformatter reformulate/DGNS refractory/P refrain/DGS refresh/DGNRSZ refreshing/Y refreshment/MS refrigerator/MS refry/DGS refuge/DGS refugee/MS refund/DGMRSZ refusal/S refuse/DGRS refutable refutation refute/DGRS regain/DGS regal/DGY regard/DGS regardless/PY regenerate/DGNPSVY regent/MS regime/MS regimen regiment/DS region/MS regional/Y register/DGSU registration/MS regress/DGSV regression/MS regressive/PY regret/S regretful/PY regrettable regrettably regretted regretting regroup/DG regular/SY regularity/S regulate/DGNSVX regulated/U regulator/MS rehash/DGS rehearsal/MS rehearse/DGRS rehearsed/U reign/DGS reimbursed reimbursement/MS rein/DGS reincarnate/DN reindeer reinforce/DGRS reinforced/U reinforcement/MS reinsert/DGS reinstall/DGRS reinstate/DGS reinstatement reinterpret/DGS reintroduce/DGS reinvention reissuer/MS reiterate/DGNSVX reiterative/PY reject/DGRSV rejecting/Y rejection/MS rejector/MS rejoice/DGRS rejoicing/Y rejoin/DGS relabel/S relate/DGNRSVX related/PY relational/Y relationship/MS relative/PSY relativism relativistic relativistically relativity/M relax/DGRS relaxation/MS relaxed/PY relay/DGS release/DGRS released/U relegate/DGNS relent/DGS relenting/U relentless/PY relevance/S relevant/Y reliability/SU reliably/U reliance relic/MS relief/S relieve/DGRSZ relieved/Y religion/MS religious/PY relinquish/DGS relish/DGS relive/GS reload/DGRS relocate/DGNSX reluctance/S reluctant/Y rely/DGRS remain/DGS remainder/DGMS remark/DGS remarkable/P remarkably remarked/U remedy/DGS remember/DGRS remembrance/MRS reminiscence/MS reminiscent/Y remittance/S remnant/MS remodel/S remodulate/DGNS remonstrate/DGNSV remonstrative/Y remorse remote/NPTY removal/MS remove/DGRS renaissance renal rename/DGS rend/GRSZ render/DGJRS rendezvous/DGS rendition/MS renew/DGRS renewal/S renounce/DGRS renown/D rent/DGRSZ rental/MS renter/MS renumber/DGS reopen/DGS reorder/DGS repackage/DGRS repaint/DGRSZ repair/DGRSZ repairman reparable reparation/MS repartition/DGRSZ repast/MS repay/GS repeal/DGRS repeat/DGRSZ repeatable repeated/Y repel/S repent/DGRS repentance repercussion/MS repertoire repetition/MS repetitive/PY rephrase/DGS repine/DGR replaceable replay/DGS replenish/DGRS replete/NP replica/MS replicate/DGNSVX reply/DGNRSX report/DGRSZ reported/Y repose/DGS repository/MS repost/DGJRS represent/DGRS representable/U representably representational/Y representative/PSY represented/U repress/DGSV repression/MS repressive/PY reprieve/DGS reprint/DGRS reprisal/MS reproach/DGRS reproaching/Y reproducibility/S reproducibly reproductive/Y reproductivity reproof reprove/DGR reproving/Y reptile/MS republic/MS republican/MS republication republisher/MS repudiate/DGNSX repulse/DGNSVX repulsive/PY reputable reputably reputation/MS repute/DGS reputed/Y requested/U requiem/MS require/DGRS requirement/MS requisite/NPSX requisition/DGRS requite/DGR requited/U reread/GS reroute/DJRSZ reschedule/DGRS rescue/DGRSZ research/DGRSZ reselect/DGS resemblance/MS resemble/DGS resent/DGS resentful/PY resentment reservation/MS reserve/DGRS reserved/PUY reservoir/MS reset/DGRS reshape/DGRS reside/DGRS residence/MS resident/MS residential/Y residue/MS resign/DGRS resignation/MS resigned/PY resin/DGMS resist/DGRSV resistance/S resistant/Y resisted/U resistible resistibly resisting/U resistive/PY resistivity resistor/MS resize/DGS resold resolute/NPVXY resolved/U resonance/S resonant/Y resort/DGRS resound/GS resounding/Y resource/DGMS resourceful/PY respect/DGRSV respectability respectable/P respectably respectful/PY respective/PY respiration/S respite/DG resplendent/Y respond/DGRSZ respondent/MS response/RSVX responsibility/S responsible/P responsibly responsive/PUY rest/DGRSV restart/DGRS restate/DGS restatement restaurant/MS restful/PY restive/PY restless/PY restoration/MS restore/DGRSZ restrained/UY restraint/MS restrict/DGSV restricted/UY restriction/MS restrictive/PY restroom/MS restructure/DGS result/DGS resultant/SY resumable resume/DGS resumption/MS resurface/DGRSZ resurfacer/MS resurrect/DGS resurrection/MS retail/DGRSZ retain/DGRSZ retainment retaliation retard/DGR retention/S retentive/PY reticence reticent/Y reticle/MS reticular reticulate/DGNSY retina/MS retinal retinue/S retirement/MS retiring/PY retort/DGS retrace/DGS retract/DGS retraction/S retrain/DGS retreat/DGRS retrievable retrieval/MS retrieve/DGRSZ retroactively retrospect/V retrospection retrospective/Y return/DGRSZ returned/U retype/DGS reunite/DG reuse/DGS revamp/DGS reveal/DGRS revealing/U revel/S revelation/MS revelry revenge/DGMRS revenue/RSZ revere/DGS reverence/R reverend/MS reverently reverify/DGS reversal/MS reverse/DGNRSXY reversible reversion/RS revert/DGRSV review/DGRSZ revile/DGR revise/DGNRSX revision/MS revival/MS revive/DGRS revocation/S revoke/DGRS revolt/DGRS revolting/Y revolution/MS revolutionary/MPS revolve/DGRSZ reward/DGRS rewarding/Y rewind/DGRS reword/DGJS rewording/MS rework/DGS rewound rewrite/GJRS rhetoric rheumatism rhinoceros rhubarb rhyme/DGRS rhythm/MS rhythmic/S rhythmical/Y rib/MS ribbed ribbing ribbon/MS rice/RS rich/NPRSTY richen/DG Rick/M rickshaw/MS rid/GJRSZ ridden riddle/DGRS ride/GJRSZ rider/MS ridge/DGMS ridicule/DGRS ridiculous/PY rifle/DGRS rifled/U rifleman rift rig/MS rigged rigging right/DGNPRSY righteous/PUY rightful/PY rightmost rightward/S rigid/PY rigidity/S rigorous/PY rill rim/GMRS rime/GR rind/DMS ring/DGJRSZ ringing/SY rinse/DGRS riot/DGRSZ riotous/PY rip/NRSTX ripe/PRTY ripen/DGRS ripped ripping ripple/DGRS rise/GJRSZ risen risk/DGRS Ritchie/M rite/DMS ritual/SY rival/S rivalry/MS rive/DGRZ riven river/MS riverside rivet/DGRS rivulet/MS road/MS roads/I roadside/S roadster/MS roadway/MS roam/DGRS roar/DGRS roaring/T roast/DGRS rob/DGS robbed robber/MS robbery/MS robbing robe/DGS Robert/MS robin/MS Robinson/M robot/MS robotic/S robust/PY rock/DGRSZ rocket/DGMS rocky/PRS rod/MS rode roe/S rogue/GMS role/MS roll/DGRSZ ROM Roman/MS romance/DGRSZ romantic/MS romantically/U romp/DGRSZ roof/DGRSZ rook/S room/DGRSZ roost/RZ root/DGMRS rooted/P rope/DGRSZ rose/MS rosebud/MS rosy/PR rot/S rotary rotate/DGNSVX rotated/U rotational/Y rotative/Y rotator/MS rotten/PY rouge/G rough/DNPRTXY roughen/DGS round/DGPRSTYZ roundabout/P rounded/P roundoff roundup/MS rouse/DGRS rout/DGJRZ route/DGJRSZ routine/SY rove/DGRS row/DGNRSZ Roy/M royal/Y royalist/MS royalty/MS RSX rub/S rubbed rubber/MS rubbing rubbish/S rubble/DG Rubens rubout ruby/MS rudder/MS ruddy/PR rude/PRTY rudiment/MS rudimentary/P rue/GS ruefully ruffian/SY ruffle/DGRS ruffled/U rug/MS rugged/PY ruin/DGRS ruination/MS ruinous/PY rule/DGJRSZ ruled/U rum/NX rumble/DGRS rump/SY rumple/DGS rumply/R run/AS runaway/S rung/MS runnable runner/MS running/A runtime rupture/DGS rural/Y rush/DGRS russet/DGS Russian/MS rust/DGS rustic rusticate/DGNS rustle/DGRSZ rusty/NPR rut/MS ruthless/PY rye/M sable/MS sabotage/DGS sack/DGRS sacred/PY sacrifice/DGRSZ sacrificial/Y sad/PY sadden/DGS sadder saddest saddle/DGRS sadism sadist/MS sadistic sadistically safe/PRSTY safeguard/DGS safely/U safety/DGS sag/S sagacious/PY sagacity sage/PSY said/U sail/DGRS sailor/SY saint/DSY saintly/P sake/RS salable/A salad/MS salary/DS sale/MS salesman salesmen salespeople/M salesperson/M salient/Y saline saliva sallow/P sally/DGS Sally's salmon/S salon/MS saloon/MS salt/DGPRSZ salted/U salty/PRT salutary/P salutation/MS salute/DGRS salvage/DGRS salvation salve/GRS Salz/M Sam/M same/P sample/DGJMRSZ sanctify/DNR sanction/DGS sanctity/S sanctuary/MS sand/DGRSZ sandal/MS sandpaper sandstone/S sandwich/DGS sandy/PR sane/PRTY sang sanguine/PY sanitarium/S sanitary/IU sanitation sanity/I sank sap/MS sapling/MS sapphire sarcasm/MS sarcastic sash/DS sat/DG satchel/MS sate/DGS satellite/MS satin satire/MS satirist/MS satisfaction/MS satisfactorily/U satisfactory/P satisfiability/U satisfiable/U satisfied/U satisfy/DGRSZ satisfying/Y saturate/DGNRSX saturated/AU saturates/A Saturday/MS satyr sauce/GRSZ saucepan/MS saucy/PR saunter/DGRS sausage/MS savage/DGPRSYZ save/DGJRSZ saved/U saw/DGRS sawmill/MS sawtooth say/GJRSZ scabbard/MS scaffold/GJS scalable scalar/MS scald/DGS scale/DGJRSZ scaled/A scallop/DGRS scalp/GMRS scaly/PR scam/MS scamper/DGS scan/AS scandal/MS scandalous/PY scanned/A scanner/MS scanning/A scant/PY scantily scanty/PRST scar/DGMRS scarce/PRTY scarcity scare/DGRS scarf/S scarlet scary/R scatter/DGRS scattering/Y scavenger/MS SCCS scenario/MS scene/MS scenery/S scenic/S scent/DS schedule/DGMRSZ scheduled/AU scheduler/MS schema/MS schemata schematic/S schematically scheme/DGMRSZ schizophrenia scholar/SY scholarship/MS scholastic/S scholastically school/DGRSZ schoolboy/MS schooled/U schoolhouse/MS schoolmaster/MS schoolroom/MS schoolyard/MS schooner science/MS scientific/U scientifically/U scientist/MS scissor/DGS scoff/DGRS scold/DGRS scoop/DGRS scope/DGS scorch/DGRS scorching/Y score/DGJMRSZ scorn/DGRS scornful/PY scorpion/MS Scotland/M scoundrel/MSY scour/DGJRS scourge/GR scout/DGRS scow scowl/DGRS scramble/DGRSU scrap/DGJMRSZ scrape/DGJRSZ scrapped scratch/DGRSZ scratched/U scrawl/DGRS scream/DGRSZ screaming/Y screech/DGRS screen/DGJRS screened/U screw/DGRS screws/U scribble/DGRS scribe/GIRS script/DGMS scripted/U scripture/S scroll/DGS scrooge/MS scrub/S scruple/DGS scrupulous/PUY scrutiny scuffle/DGS sculpt/DGS sculptor/MS sculpture/DGS scum/MS scurry/DG scuttle/DGS scythe/GMS sea/SY seaboard seacoast/MS Seagate/M seal/DGRS sealed/AU seals/U seam/DGNRS seaman/Y seaport/MS sear/DGS search/DGJRSZ searcher/AMS searching/SY searing/Y seashore/MS seaside season/DGJMRSYZ seasonable/PU seasonably/U seasonal/Y seasoned/U seat/DGRS seaward/S seaweed/S secede/DGRS secluded/PY seclusion second/DGRSYZ secondarily secondary/PS secondhand secrecy secret/DGSVY secretarial secretary/MS secrete/DGNSVX secretive/PY sect/IMS section/DGS sectional/Y sector/DGMS secular/Y secure/DGJPRSY secured/U security/S sedge sediment/MS seduce/DGRSZ seductive/PY see/DRSZ seed/DGJRSZ seeded/U seedling/MS seeing/U seek/GRSZ seeking/Y seem/DGSY seeming/Y seemly/PR seen/U seep/DGS seethe/DGS segment/DGS segmentation/MS segmented/U segregate/DGNSV segregated/U seismic seizable seize/DGJRSZ seizin/S seizor/S seizure/MS seldom select/DGPSV selected/AU selection/MS selective/PY selectivity selector/MS self/P selfish/PUY selfsame/P sell/AGRSZ selves semantic/S semantical/Y semanticist/MS semaphore/MS semblance/A semester/MS semiautomated semicolon/MS semiconductor/MS seminal/Y seminar/MS seminary/MS semipermanent/Y senate/MS senator/MS send/GRSZ sends/A senior/MS seniority sensation/MS sensational/Y sense/DGS senseless/PY sensibility/S sensible/IP sensibly/I sensitive/PSY sensitivity/S sensor/MS sensory sent/AU sentence/DGS sentential/Y sentiment/MS sentimental/Y sentinel/MS sentry/MS separable/IP separate/DGNPSVXY separator/MS September/MS sequel/MS sequence/DGJRSZ sequenced/A sequential/Y sequentiality sequester/DG serendipitous/Y serendipity serene/PY serenity serf/MS sergeant/MS serial/SY series serious/PY sermon/MS serpent/MS serpentine/Y serum/MS servant/MS serve/DGJRSZ served/AU server/MS service/DGRS serviceable/P serviced/U servile/PY servitude session/MS set/MS sets/AI setter/MS setting/AI settings/A settle/DGJRSZ settled/AU settlement/MS settles/A settling/AU setup/S seven/HS seventeen/HS seventy/HS sever/DGRST several/SY severance severe/DGPRTY severity/MS sew/DGRSZ sex/DS sexism/M sexist/MS sexual/Y sexuality shabby/PR shack/DS shackle/DGRS shade/DGJRS shaded/U shadily shadow/DGRS shadowy/P shady/PRT shaft/DGMS shaggy/PR shakable/U shakably shake/GRSZ shaken/U shaky/PR shale/S shall shallow/PRSY sham/DGMS shambles shame/DGS shameful/PY shameless/PY shan't shanty/MS shape/DGRSYZ shapeless/PY shapely/PR sharable share/DGRSZ sharecropper/MS shared/U shareholder/MS shark/MS sharp/DGNPRSTXY sharpen/DGRS sharpened/U shatter/DGS shattering/Y shave/DGJRS shaved/U shaven/U shawl/MS she/DM she'd she'll sheaf shear/DGRSZ sheath/GR sheathing/U sheaths sheaves shed/S sheep sheer/DPY sheet/DGRS shelf/S shell/DGMRS shelled/U shelter/DGRS sheltered/U shelve/DGRS shepherd/DGMS sheriff/MS shield/DGRS shielded/U shift/DGRSZ shiftily shifty/PRT shilling/S shimmer/DG shin/DGRZ shine/DGRSZ shingle/DGMRS shining/Y shiny/PR ship/MS shipboard/S shipbuilding shipment/MS shippable shipped shipper/MS shipping shipwreck/DS shirk/GRS shirt/GS shit shiver/DGRS shoal/MS shock/DGRSZ shocking/Y shod/U shoe/DRS shoeing shoemaker shone shook shoot/GJRSZ shop/MS shopkeeper/MS shopped shopper/MS shopping shore/DGMS shorn short/DGNPRSTXY shortage/MS shortcoming/MS shortcut/MS shorten/DGRS shorthand/DS shot/MS shotgun/MS should/RTZ shoulder/DGS shouldn't shout/DGRSZ shove/DGRS shovel/S show/DGJRSZ shower/DGS shown shrank shred/MS shredder/MS shrew/MS shrewd/PTY shriek/DGS shrill/DGP shrilly shrimp shrine/MS shrink/GRS shrinkable shrivel/S shroud/DGS shrub/MS shrubbery shrug/S shrunk/N shudder/DGS shuffle/DGRS shun/S shut/S shutdown/MS shutter/DGS shutting shuttle/DGS shy/DGRSTY shyness sibling/MS sick/GNPRSTY sicken/DGR sickening/Y sicker/Y sickle/DG sickly/DGP sickness/MS side/DGJS sideboard/MS sideburns sided/P sidelight/MS sidetrack/DGS sidewalk/MS sideways sidewise siege/GMS sierra/S sieve/GMSZ sift/DGJRS sifted/A sigh/DGR sighs sight/DGJRSY sightly/P sign/DGRSZ signal/SY signature/MS signed/AU signet significance/IS significant/SY signify/DGNRS Signor Sikkim/M Sikkimese silence/DGRSZ silent/PSY silhouette/DS silicon/S silicone silk/NS silkily silky/PRT sill/MS silly/PRT silt/DGS silver/DGRSY Silverstein/M silvery/P similar/Y similarity/S similitude simmer/DGS simple/PRST simplex/S simplicity/MS simplified/U simplify/DGNRSXZ simplistic simply simulate/DGNSVX simulator/MS simultaneity simultaneous/PY sin/AGMS since sincere/PTY sincerity/I sine/GS sinew/MS sinful/PY sing/DGRSYZ singable Singapore/M singer/MS singing/Y single/DGPS singleton/MS singular/Y singularity/MS sinister/PY sink/DGRSZ sinkhole/S sinned sinner/MS sinning sinusoidal/Y sinusoids sip/S sir/DGNSX sire/DGS sirup sister/DGMSY sit/DGS site/DGMS sitter/MS sitting/S situate/DGNSX situational/Y six/HS sixpence/S sixteen/HS sixth/Y sixty/HS sizable/P size/DGJRSZ sized/AU skate/DGRSZ skater/MS skeletal/Y skeleton/MS skeptic/MS skeptical/Y sketch/DGRS sketchily sketchy/PR skew/DGPRSZ skewer/DGS ski/DGNRS skill/DGS skilled/U skillful/PUY skim/MS skimmed skimmer/MS skimming/S skimp/DGS skin/MS skinned skinner/MS skinning skip/S skipped skipper/DGMS skipping skirmish/DGRSZ skirt/DGRS skulk/DGRS skull/DMS skunk/MS sky/DGMRS skylark/GRS skylight/MS skyscraper/MS slab/S slack/DGNPRSTXY slacken/DGS slain slam/S slammed slamming slander/DGRS slang/G slant/DGS slanting/Y slap/S slapped slapping slash/DGRS slashing/Y slat/DGMRSZ slate/DGRSZ slaughter/DGRS slave/DGRS slaver/DG slavery slay/GRSZ sled/MS sledge/GMS sleek/PY sleep/GRSZ sleepily sleepless/PY sleepy/PR sleet sleeve/DGMS sleigh sleighs sleken/DG slender/PRY slept slew/DG slice/DGRSZ slick/PRSYZ slid/GRZ slide/GRSZ slight/DGPRSTY slighting/Y slim/DGPY slime/DGS slimy/PR sling/GRS slings/U slip/MS slippage slipped slipper/MS slippery/PR slipping slit/MS slogan/MS slop/DGRSZ slope/DGRSZ sloped/U slopped slopping sloppy/PR slot/MS sloth sloths slotted slouch/DGRS slow/DGPRSTY slug/S sluggish/PY slum/MS slumber/DGMRS slump/DS slung/U slur/MS sly/RTY smack/DGRS small/PRT smallpox smart/DGNPRSTY smarten/DG smash/DGRSZ smashing/Y smear/DGRS smell/DGRS smelly/R smelt/RS smile/DGRS smiling/UY smite/GR smith/M smiths smithy/S smitten smock/GS smog smokable smoke/DGRSZ smoker/MS smoky/PRS smolder/DGS smoldering/Y smooth/DGNPRSTYZ smoothen/DG smote smother/DGS SMTP smug/PY smuggle/DGRSZ snail/MS snake/DGS snap/SU snapped/U snapper/MS snappily snapping/U snappy/PRT snapshot/MS snare/DGRS snarf/DGJS snarl/DGRS snatch/DGRS sneak/DGRSZ sneaker/DS sneakily sneaking/Y sneaky/PRT sneer/DGRS sneeze/DGRS sniff/DGRS snoop/DGRS snore/DGRS snort/DGRS snout/DMS snow/DGS snowily snowman snowmen snowshoe/DMRS snowy/PRT snuff/DGRS snug/PSY snuggle/DGS so/S soak/DGRS soap/DGS soar/DGRS sob/RSZ sober/DGPRSTY soccer sociability/IU sociable/IU sociably/IU social/UY socialism socialist/MS societal/Y society/MS sociological/Y sociology sock/DGS socket/MS sod/MS soda sodium sodomy sofa/MS soft/NPRTXY soften/DGRS software/MS soil/DGS sojourn/RZ solace/DGR solar sold/RZ solder/DGRS soldier/DGSY sole/DGPSY solemn/PY solemnity solicit/DGS solicited/U solicitor/S solid/PSY solidify/DGNS solidity soling/N solitaire solitary/P solitude/MS solo/DGMS solubility/I soluble/AI solution/MS solvable/AIU solve/ADGRSZ solved/AU solvent/MSY somber/PY some/Z somebody/M someday somehow someone/M someplace/M something sometime/S somewhat somewhere/S son/MSY sonar/S song/MS sonnet/MS soon/RT soot sooth/DGRSY soothe/DGRS soothing/PY sophisticated/Y sophistication/U sophomore/MS sorcerer/MS sorcery sordid/PY sore/PRSTY sorrow/MRS sorrowful/PY sorry/PRT sort/DGRSZ sorted/AU sought/U soul/DMS sound/DGJPRSTY sounding/MSY soup/MS sour/DGPRSTY source/AMS south/GR souther/Y southern/PRYZ sovereign/MSY soviet/MS space/DGJRSZ spaceship/MS spade/DGRS Spafford/M spaghetti Spain/M span/MS Spanish/M spank/DGRS spanned spanner/MS spanning spare/DGPRSTY sparing/UY spark/DGRS sparrow/MS sparse/PRTY spat/S spate/MS spatial/Y spatter/D spawn/DGRS speak/GRSZ speakable/U speaker/MS spear/DGRS special/PSY specialist/MS species specifiable specific/S specifically specificity/S specified/AU specify/DGNRSXZ specimen/MS speck/MS speckle/DGS spectacle/DS spectacular/Y spectator/MS spectra spectrogram/MS spectroscopically spectrum/S speculate/DGNSVX speculative/Y speculator/MS sped speech/MS speechless/PY speed/DGRSZ speedily speedup/MS speedy/PR spell/DGJRSZ Spencer/M spend/GRSZ spent/U sphere/GMS spherical/Y spice/DGS spicy/PR spider/MS spike/DGRS spill/DGRS spin/S spinach spinal/Y spindle/DGRS spine/S spinner/MS spinning spiral/SY spire/DGMS spired/AI spires/AI spirit/DGS spirited/PY spiritual/PSY spit/DGS spite/DGS spiteful/PY spitting splash/DGRSZ spleen splendid/PY splice/DGJRSZ spline/DMS splinter/DGS split/MS splitter/MS splitting/S spoil/DGRSZ spoiled/U spoke/DGS spoken/U spokesman spokesmen sponge/DGRSZ sponsor/DGS sponsorship spontaneous/PY spook spooky/PR spool/DGRSZ spoon/DGS spore/DGMS sport/DGSV sporting/Y sportive/PY sportsman/Y spot/MS spotless/PY spotlight/DGMS spotted/U spotter/MS spotting spouse/GMS spout/DGRS sprang sprawl/DGS spray/DGRS sprayed/U spread/GJRSZ spreadsheet/S spree/MS sprig sprightly/PR spring/GRSZ springtime springy/PRT sprinkle/DGRS sprinkler/D sprint/DGRSZ sprite sprout/DGS spruce/DGPRTY sprung/U Spuds spun spur/MS spurious/PY spurn/DGRS spurt/DGS sputter/DR spy/DGRS squabble/DGRS squad/MS squadron/MS squall/MRS square/DGPRSTY squash/DGRS squat/PSY squawk/DGRS squeak/DGRS squeal/DGRS squeeze/DGRS squid/S squint/DGRS squinting/Y squire/GMS squirm/DGS squirrel/SY Sr stab/SY stabbed stabbing stability/MS stable/DGPRST stably/U stack/DGMRS stacked/U stacks/U staff/DGMRSZ stag/DGMRSZ stage/DGRSZ stagecoach stagger/DGRS staggering/Y stagnant/Y staid/PY stain/DGRS stained/U stainless/Y stair/MS staircase/MS stairway/MS stake/DGS stale/DGPRSTY stalk/DGRS stall/DGJS stalwart/PY stamen/MS stamina stammer/DGRS stamp/DGRSZ stampede/DGRS stance/MS stanch/RT stand/GJRS standard/SY standby standpoint/MS standstill stanza/MS staple/DGRSZ stapled/U star/DGMRS starboard/DGS starch/DGS stare/DGRS starfish staring/U stark/PTY starlet/MS starlight starred starring starry/R start/DGRSZ startle/DGS startling/PY startup/MS starvation starve/DGRS state/DGMNRSVXY stated/AIU stately/PR statement/MS states/AI statesman/MY static/S statically station/DGRS stationary/S statistic/MS statistical/Y statistician/MS statue/DMS statuesque/PY stature status/S statute/MS statutorily statutory/P staunch/PTY stave/DGS stay/DGRSZ stdio stead/G steadfast/PY steadily/U steady/DGPRST steak/MS steal/GHRS stealthily stealthy/PR steam/DGRSZ steamboat/MS steamship/MS steed/S steel/DGSZ steep/DGNPRSTY steepen/DG steeple/MS steer/DGRS stellar stem/MS stemmed/U stemming stench/MS stencil/MS stenographer/MS step/MS stepmother/MS stepped stepper stepping steps/I stepwise stereo/MS stereotype/DGRSZ stereotypical/Y sterile sterling/PY stern/PSY stew/DGS steward/MS stick/DGRSZ stickily sticky/PRT stiff/NPRSTXY stiffen/DGRSZ stiffness/S stifle/DGRS stifling/Y stigma/S stile/MS still/DGPRST stills/I stimulant/MS stimulate/DGNSVX stimuli stimulus sting/GRS stinging/Y stink/GRSZ stinking/Y stint/DGMRS stinting/U stipend/MS stipple/DGRS stipulate/DGNSX stir/S stirred stirrer/MS stirring/SY stirrup/S stitch/DGRS stochastic stochastically stock/DGJRSZ stockade/DGMS stockholder/MS stocking/DS stole/DMS stolen stomach/DGRS stone/DGMRS stony/PR stood stool/S stoop/DGS stop/MS stopcock/S stopgap/MS stoppable/U stoppage/S stopped/U stopper/DGMS stopping storage/MS store/ADGS storehouse/MS stork/MS storm/DGS stormy/PRT story/DGMS stout/NPRTY stouten/DG stove/MRS stow/DGS straggle/DGRSZ straight/NPRTXY straighten/DGRSZ straightforward/PSY straightway strain/ADGRSZ strained/AU strait/NPSY straiten/DG strand/DGRS stranded/P strange/PRTYZ stranger/MS strangle/DGJRSZ strangulation/MS strap/MS stratagem/MS strategic/S strategy/MS stratified/U stratify/DGNSX stratum straw/MS strawberry/MS stray/DGMRS streak/DGS stream/DGRSZ streamed/U streamline/DGRS street/SZ streetcar/MS strength/NX strengthen/DGRS strengths strenuous/PY stress/DGS stressed/U stretch/DGRSZ strew/GHS strewn stricken strict/PRTY stride/GRS strife strike/GRSZ striking/Y string/DGMRSZ stringent/Y stringy/PRT strip/DGMRS stripe/DGRS striped/U stripped stripper/MS stripping strive/GJRS strobe/DGMS stroboscopic strode stroke/DGRSZ stroll/DGRS strong/RTY stronghold strove struck structural/Y structure/DGRS structured/AU struggle/DGRS strung/U strut/S strutted strutter strutting stub/MS stubbed stubbing stubble stubborn/PY stuck/U stud/MS student/MS studied/PY studio/MS studious/PY study/DGRS stuff/DGJRS stuffy/PRT stumble/DGRS stumbling/Y stump/DGRS stun/S stung stunning/Y stunt/DGMS stunted/P stupefy/G stupendous/PY stupid/PRTY stupidity/S stupor sturdy/PR style/DGRSZ stylish/PY stylistic/S stylistically sub/S subatomic subclass/MS subcommittee/MS subcomponent/MS subcomputation/MS subconscious/PY subculture/MS subdivide/DGRS subdivision/MS subdue/DGRS subdued/Y subexpression/MS subfield/MS subfile/MS subgoal/MS subgraph subgraphs subgroup/GMS subinterval/MS subject/DGMSV subjection subjective/PY subjectivity sublimation/S sublime/DGPRY sublist/MS submarine/DGRSZ submerge/DGS submission/MS submit/AS submitted/A submitting/A submode/S submodule/MS subnetwork/MS subordinate/DGNPSVY subproblem/MS subprocess/MS subprogram/MS subproject subproof/MS subrange/MS subroutine/MS subschema/MS subscribe/DGRSZ subscript/DGS subscripted/U subscription/MS subsection/MS subsegment/MS subsequence/MS subsequent/PY subset/MS subside/DGS subsidiary/MS subsidy/MS subsist/DGS subsistence subspace/MS substance/MS substantial/PY substantially/U substantiate/DGNSVX substantiated/U substantive/PY substantivity substitutability substitutable substitute/DGNRSVX substituted/U substitutive/Y substrate/MS substring/S substructure/MS subsume/DGS subsystem/MS subtask/MS subterranean/Y subtitle/DGMS subtle/PRT subtlety/S subtly subtopic/MS subtract/DGRSVZ subtracter/MS subtraction/S subtrahend/MS subtree/MS subunit/MS suburb/MS suburban subversion subvert/DGRS subway/MS succeed/DGRS success/SV successful/PY successfully/U succession/MS successive/PY successor/MS succinct/PY succumb/DGS such suck/DGRSZ sucker/DGS suckle/DGS suction sudden/PY suds/GR sue/DGRS sued/DG suffer/DGJRSZ sufferance suffice/DGRS sufficiency/I sufficient/IY suffix/DGRS suffixed/U suffocate/DGNSV suffocating/Y suffrage sugar/DGJS suggest/DGRSV suggestible suggestion/MS suggestive/PY suicidal/Y suicide/DGMS suit/DGMSZ suitability/U suitable/P suitably/U suitcase/MS suite/DGSZ suited/U suitor/MS sulk/DGS sulky/PS sullen/PY sulphate/S sulphur/D sulphuric sultan/MS sultry/PR sum/MRS summand/MS summary/MS summation/MS summed summer/DGMS summing summit summon/DGRSZ summons/S sumptuous/PY sun/MS sunbeam/MS sunburn Sunday/MS sundown/RZ sundry/S sung/U sunglass/S sunk/N sunlight/S sunned sunning sunny/PR sunrise/S sunset/S sunshine/S sup/R super/DG superb/PY superclass/M supercomputer/MS superego/MS superficial/PY superfluity/MS superfluous/PY superhuman/PY superimpose/DGS superintend superintendent/MS superior/MSY superiority superlative/PSY supermarket/MS superpose/DGS superscript/DGS supersede/DGRS superset/MS superstition/MS superstitious/PY supertitle/DGMS superuser/MS supervise/DGNSX supervisor/MS supervisory supper/MS supplant/DGRS supple/DGPRY supplement/DGRS supplemental supplementary/S supplier/AMS supply/DGMNRSZ support/DGRSVZ supportable/IU supported/U supporting/Y supportive/Y suppose/DGRS supposed/Y supposition/MS suppress/DGSV suppression/S suppressive/P supremacy supreme/PY sure/DPRTY surety/S surf/GRZ surface/DGPRSZ surfer/MS surge/DGSY surged/A surgeon/MS surgery/S surges/A surgical/Y surly/PR surmise/DGRS surmount/DGS surname/DMS surpass/DGS surpassed/U surpassing/Y surplus/MS surprise/DGMRS surprised/U surprising/UY surrender/DGRS surrogate/MNS surround/DGJS survey/DGS surveyor/MS survival/S survive/DGRS survivor/MS susceptible/I suspect/DGRS suspected/U suspecting/U suspend/DGRSZ suspended/AU suspender/MS suspense/NSVX suspensive/Y suspicion/DGMS suspicious/PY sustain/DGRS suture/DGS swagger/DG swain/MS swallow/DGRS swam swamp/DGRS swampy/PR swan/MS swap/S swapped swapper/MS swapping swarm/DGRS swarthy/PR swatted sway/DGRS swear/GRS sweat/DGRSZ sweep/GJRSZ sweeping/PSY sweet/GNPRSTXY sweeten/DGJRSZ sweetheart/MS sweetie/MS swell/DGJS swept swerve/DGS swerving/U swift/PRTY swim/S swimmer/MS swimming/Y swimsuit/MS swine swing/GRSZ swinging/Y swipe/DGS swirl/DGRS swirling/Y swish/DR switch/DGJMRSZ switchboard/MS swollen swoon/DGRS swooning/Y swoop/DGRS sword/MS swore sworn swum swung sycamore syllabi syllable/DGMS syllabus syllogism/MS symbiosis symbiotic symbol/MS symbolic/MS symbolically symbolism/S symmetric symmetrical/PY symmetrically/U symmetry/MS sympathetic/U sympathy/MS symphony/MS symposium/S symptom/MS symptomatic synapse/DGMS synchronous/PY synchrony syndicate/DGNS syndrome/MS synergism synergistic synonym/MS synonymous/Y synopses synopsis syntactic/SY syntactical/Y syntax/S syntheses synthesis synthetic/S syringe/DGS syrup system/MS systematic/PS systematically tab/S tabernacle/DGMS table/DGS tableau/MS tablecloth tablecloths tablespoon/MS tablespoonful/MS tablet/MS taboo/MS tabular/Y tabulate/DGNSX tabulator/MS tachometer/MS tachometry tacit/PY tack/DGRS tackle/DGMRS tact/I tactics tactile/Y tag/MS tagged tagging tail/DGJRS tailor/DGS taint/DS take/GHJRSZ taken takes/I tale/MNRS talent/DS talk/DGRSZ talkative/PY talkie tall/PRT tallow tame/DGPRSTY tamed/U tamper/DGRS tampered/U tan/S tandem tang/DY tangent/MS tangential/Y tangible/IP tangibly/I tangle/DGS tangy/R tank/DGRSZ tanner/MS tantamount tantrum/MS tap/DGJMRSZ tape/DGJRSZ taped/U taper/DGRS tapestry/DMS tapped/U tapper/MS tapping taproot/MS tar/GS tardy/PRS target/DGS tariff/MS tarry/DGS tart/PSY task/DGS taste/DGRSZ tasteful/PY tasteless/PY tatter/D tattoo/DRS tau taught/U taunt/DGRS taunting/Y taut/NPY tauten/DG tautological/Y tautology/MS tavern/MRS tawny/PRS tax/DGRS taxable taxation taxi/DGMS taxicab/MS taxing/Y taxonomic taxonomically taxonomy taxpayer/MS TCP tea/S teach/GJRSZ teachable/P teacher/MS team/DGMS tear/DGMRS tearful/PY teas/DGRS tease/DGRS teasing/Y teaspoon/MS teaspoonful/MS technical/PY technicality/MS technician/MS technique/MS technological/Y technologist/MS technology/MS tedious/PY tedium teem/DGS teeming/PY teen/RS teenage/DRZ teeth/DGRS teethe/DGRS Teflon/M Tektronix/M telecommunication/S teleconference/DGMS telegram/MS telegraph/DGRZ telegraphic telegraphs teleological/Y teleology telephone/DGRSZ telephonic telephony telescope/DGS teletype/MS televise/DGNSX televisor/MS tell/GJRSZ telling/SY temper/DGRS temperament/S temperamental/Y temperance/I temperate/IPY temperature/MS tempest/S tempestuous/PY template/MS temple/DMS temporal/Y temporarily temporary/PS tempt/DGRSZ temptation/MS tempting/Y ten/HMS tenacious/PY tenant/MS tend/DGRSZ tendency/S tender/DGPSY tenement/MS Tennessee/M tennis tenor/MS tens/DGRSTV tense/DGNPRSTVXY tension/DGRS tensor/MS tent/DGRS tentacle/DS tentative/PY tented/U tenth/S tenure/DS tequila/M term/DGRSY termcap terminal/MSY terminate/DGNSVX terminated/U terminative/Y terminator/MS terminology/S terminus ternary terrace/DGS terrain/MS terrestrial/MSY terrible/P terribly terrier/MS terrific/Y terrify/DGS terrifying/Y territorial/Y territory/MS terror/MS terrorism terrorist/MS terroristic tertiary/S test/DGJMRSZ testability testable/U testament/MS tested/U tester/MS testicle/MS testify/DGRSZ testimony/MS TeX TeX's Texas/MS text/MS textbook/MS textile/MS textual/Y texture/DGS than thank/DGRS thankful/PY thankless/PY thanksgiving/MS that/MS thatch/DGRS thaw/DGS the/GJ theatrical/SY theft/MS their/MS them thematic/U theme/MS themselves then thence thenceforth theologian/MS theological/Y theology/S theorem/MS theoretic/S theoretical/Y theoreticians theorist/MS theory/MS therapeutic/S therapist/MS therapy/MS there/M thereabouts thereafter thereby therefore therein thereof thereon thereto thereupon therewith thermodynamic/S thermometer/MS thermostat/DMS these/S thesis they they'd they'll they're they've thick/NPRSTXY thicken/DGRSZ thicket/DMS thickness/S thief thieve/GS thigh/D thighs thimble/MS thin/PRSTY thing/PS thingamajig/MS think/GRSZ thinkable/P thinkably/U thinking/PY thinkingly/U thinks/A thinner/S thinnest third/SY thirst/DRS thirsty/PR thirteen/HS thirty/HS this thistle thong/D thorn/MS thorny/PR thorough/PY thoroughfare/MS those though thought/MS thoughtful/PY thoughtless/PY thousand/HS thrash/DGRS thread/DGRSZ threading/A threat/NSX threaten/DGRS threatening/Y three/MS threescore threshold/DGMS threw thrice thrift thrifty/PR thrill/DGRSZ thrilling/Y thrive/DGRS thriving/Y throat/DGS throb/S throbbed throbbing throne/GMS throng/GMS throttle/DGRS through/Y throughout throughput throw/GRS thrown thrush/S thrust/GRSZ thud/S thug/MS thumb/DGS thump/DGRS thunder/DGRSZ thunderbolt/MS thundering/Y thunderstorm/MS thunderstruck Thursday/MS thus/Y thwart/DGRSY thyself tick/DGRSZ ticket/DGMS tickle/DGRS ticklish/PY tidal/Y tide/DGJS tidy/DGPRS tie/DRSZ tied/AU tier/DS tiger/MS tight/NPRSTXY tighten/DGJRSZ tilde/S tile/DGRS till/DGRSZ tillable tiller/DGS tilt/DGRSZ timber/DGS time/DGJRSYZ timeless/PY timely/PR timeout/S timeshare/DGS timetable/DGMS timid/PY timidity tin/MS tinge/DG tingle/DGS tingling/Y tinily tinker/DGRS tinkle/DGS tinned tinnily tinning tinny/PRT Tinseltown/M tint/DGRS tiny/PRT tip/MS tipped tipper/MS tipping tiptoe/D tire/ADGS tired/APY tireless/PY tiresome/PY tissue/DGMS tit/MS tithe/GMRS title/DGS titled/AU titter/DGS tizzy/S to/IU toad/MS toast/DGRSZ toasty/R tobacco today/MS toe/DMS together/P toggle/DGS toil/DGRS toilet/MS token/MS told/AU tolerability/I tolerable/I tolerably/I tolerance/S tolerant/IY tolerate/DGNSV toll/DGS tom/MS tomahawk/MS tomato tomatoes tomb/MS tomography tomorrow/MS ton/DGMRS tone/DGRS toned/I toner/I tongs tongue/DGS tonic/MS tonight tonnage tonsil too/H took tool/DGRSZ toolkit/MS tooth/DG toothbrush/GMS toothpick/MS top/DGRS topic/MS topical/Y topmost topological/Y topology/S topple/DGS torch/MS tore torment/DGRSZ torn tornado/S tornadoes torpedo/DGS torpedoes torque/GRSZ torrent/MS torrid/PY tortoise/MS torture/DGRSZ torus/MS toss/DGRS total/MSY totality/MS totter/DGS tottering/Y touch/DGRS touchable/U touched/U touchily touching/Y touchy/PRT tough/NPRTXY toughen/DGS tour/DGRS tourist/MS tournament/MS tow/DGRSZ toward/SY towardly/P towel/MS tower/DGS towering/Y town/MRS township/MS toxicity toxin/MS toy/DGRS trace/DGJRSZ traceable/P traced/AU traceless/Y track/DGRSZ tracked/U tract/MSV tractability/I tractable/AI tractor/AMS trade/DGRSZ trademark/MS tradeoff/S tradesman tradition/MS traditional/Y traffic/MS trafficked trafficker/MS trafficking tragedy/MS tragic tragically trail/DGJRSZ train/DGRSZ trained/AU trainee/MS trait/MS traitor/MS trajectory/MS tramp/DGRS trample/DGRS trance/GMS tranquil/PY tranquility tranquillity transact/DGS transaction/MS transceiver/MS transcend/DGS transcendent/Y transcontinental transcribe/DGRSZ transcript/MS transcription/MS transfer/DMS transferability transferable transferal/MS transference transferral/MS transferred transferrer/MS transferring transfinite transform/DGRSZ transformable transformation/MS transformational transformed/U transgress/DGSV transgression/MS transience transiency transient/SY transistor/MS transit/V transition/DS transitional/Y transitive/IPY transitivity transitory/P translatability translatable translate/DGNSVX translated/AU translational translator/MS translucent/Y transmission/AMS transmit/AS transmittal transmitted/A transmitter/MS transmitting/A transmogrify/N transparency/MS transparent/PY transpire/DGS transplant/DGRS transport/DGRSZ transportability transportation/S transpose/DGS transposed/U transposition trap/MS trapezoid/MS trapezoidal trapped trapper/MS trapping/S trash/DGRS traumatic travail/S travel/S traversal/MS traverse/DGRS travesty/MS tray/MS treacherous/PY treachery/MS tread/DGRS treason treasure/DGRS treasury/MS treat/DGRSZ treated/AU treatise/MS treatment/MS treaty/MS treble/DGS tree/DMS treetop/MS trek/MS tremble/DGRS tremendous/PY tremor/MS trench/DRSZ trend/GS trespass/DRSZ tress/DMS trial/MS triangle/MS triangular/Y tribal/Y tribe/MS tribunal/MS tribune/MS tributary tribute/GMS trichotomy trick/DGRS trickle/DGS tricky/PRT tried/AU trifle/DGRS trigger/DGS trigonometric trigonometry trihedral trill/DR trillion/HS trim/PRSY trimmed trimmer trimmest trimming/S trinket/DMRS trip/MSY triple/DGS triplet/MS triply/N triumph/DG triumphal triumphantly triumphs trivia trivial/Y triviality/S trod/U troff/MR troll/MS trolley/DMS troop/DGRSZ trophy/DGMS tropic/MS tropical/Y trot/S trouble/DGRS troubled/U troublemaker/MS troubleshoot/DGRSZ troublesome/PY trough trouser/DS trout/S trowel/MS truant/MS truce/G truck/DGRSZ Trudeau/M trudge/DGRS true/DGPRST truism/MS truly/U trump/DS trumpet/DGRS truncate/DGNSX truncation/MS trunk/DMS trust/DGRS trusted/U trustee/DMS trustful/PY trusting/Y trustworthiness/U trustworthy/P trusty/PRS truth/U truthful/PUY truths try/ADGRSZ trying/Y tty/M ttys tub/DGMRSZ tube/DGRSZ tuberculosis tuck/DGRS tucker/DG Tuesday/MS tuft/DMRS tug/S tuition/IS tulip/MS tumble/DGRSZ tumult/MS tumultuous/PY tunable/P tune/DGJRSZ tunic/MS tuning/MS tunnel/S tuple/MS turban/DMS turbulence/M turbulent/Y turf Turing/M turkey/MS turmoil/MS turn/DGJRSZ turnable/A turnip/MS turnkey/S turnover/S turpentine turquoise turret/DMS turtle/GMS tutor/DGS tutored/U tutorial/MS TV's twain twang/G twas tweak/DGRS tweed tweezer/S twelfth twelve/S twenty/HS twice twig/MS twilight/MS twill/DG twin/DGMRS twine/DGRS twinkle/DGRS twirl/DGRS twirling/Y twist/DGRSZ twisted/U twitch/DGR twitter/DGR two/MS twofold tying/U type/DGMRS typed/AU typedef/S typewriter/MS typhoid typical/PY typify/DGNS typist/MS typographic typographical/Y typography typos tyranny tyrant/MS UART ubiquitous/PY ubiquity UCLA ugh ugly/PRT ulcer/DGMS ultimate/PY Ultrix/M umbrella/MS umpire/DGMS unabashed/Y unabated/Y unable unacceptable unaccustomed/Y unacknowledged unadulterated/Y unalienability unalienable unalterable/P unalterably unambiguous/Y unambitious unanimous/Y unanticipated/Y unary unassailable/P unassuming/P unattainability unattainable unavailability unavailable unavailing/PY unaware/PSY unbecoming/PY unbelieving/Y unbiased/P unblinking/Y unblock/DGS unbound/D unbounded/P unbreakable unbroken unbudging/Y uncanny/P unceasing/Y uncertain/PY unchangeable unchanging/PY uncle/MS unclean/PY uncleanly/P unclear/D unclouded/Y uncomfortable uncommon/PY uncomprehending/Y unconcerned/PY unconditional/Y unconfirmed unconnected unconscious/PY unconstrained uncool/D uncooperative uncouth/PY uncover/DGS undaunted/Y undecided undefinability undefined/P undelete/D undeniable/P undeniably under/Y underbrush underdone underestimate/DGNSX underflow/DGS underfoot undergo/G undergoes undergone undergrad/MS undergraduate/MS underground/R underlie/S underline/DGJS underling/MS underly/GS undermine/DGS underneath underpayment/MS underpinning/S underplay/DGS underscore/DS understand/GJS understandability understandable understandably understanding/SY understated understood undertake/GJRSZ undertaken undertaker/MS undertook underway underwear underwent underworld underwrite/GRSZ undetermined undeviating/Y undiplomatic undo/GJR undoubted/Y undress/DGS undue undumper/M uneasy/P uneconomical unemployment unending/Y unendurable/P unequal/Y unequivocal/Y unessential uneven/PY uneventful/Y unextended unfading/Y unfair/PY unfaithful/PY unfamiliar/Y unfamiliarity unfashionable unfeigned/Y unfit/PY unfixed unflinching/Y unfold/DGS unforgeable unforgiving/P unfortunate/SY unfriendly/P ungainly/P ungrammatical unguessable unhallow/D unhappy/PRT unhealthy/P unicorn/MS unidirectional/Y unidirectionality uniform/DGPSY uniformity/S unify/DGNRSXZ unilluminating unimaginable unimportant uninhibited/PY unintended uninteresting/Y uninterrupted/PY union/AMS unique/PY unison unit/DGMRSV unite/DGRSV united/Y unity/MS univalve/MS universal/PSY universality universe/MS university/MS Unix/M UNIX's unjam unjust/PY unkind/PY unkindly/P unknown/S unleash/DGS unless unlike/PY unlikely/P unlimited/Y unlink/DGS unload/DGRSZ unlock/DGS unlucky/P unmanageable unmanageably unmannered/Y unmarried/S unmentionable/S unmerciful/Y unmistakably unmitigated/PY unmodifiable unmount/D unmountable unnatural/PY unnecessary unnerve/DGS unnerving/Y unobservable/S unofficial/Y unpack/DGRS unperturbed/Y unplowed unpopular unprecedented/Y unprincipled/P unprovable unproven unravel/S unread unreadable unreal unrecordable unrelated unrelenting/Y unreliable unreported unrest unrestrained/PY unrestrictive unroll/DGS unruly/P unsafe/Y unsatisfactory unsatisfying unseemly unsettled/P unsettling/Y unsociable/P unsophisticated unsound/DPY unstable/P unsteady/P unstinting/Y unsuccessful/Y unsuitable unsure unthinkable untidy/P untie/DS until untimely/P untouchable/MS untoward/PY untraceable untrue unvarying unwashed/P unwearied/Y unwelcome unwholesome/Y unwieldy/P unwilling/PY unwind/GRSZ unwise/RTY unwitting/Y unworthy/P unwound/D unwrap/S unwrapping unyielding/Y up/S upbraid/R upbringing update/DGRS upfield upgrade/DGS upheld uphill uphold/GRSZ upholster/DGRSZ upholstering/A upkeep upland/RS uplift/DGRS upload/DGS upon upper/S uppermost upright/PY uprising/MS uproar uproot/DGRS upset/S upsetting upshot/MS upside/S upstairs upstream upturn/DGS upward/PSY urban urchin/MS urge/DGJRS urgent/Y urinate/DGNS urine urn/GMS us/DGRSZ usability usable/AU usably usage/S USC USC's use/DGRSZ used/AU useful/PY useless/PY Usenet/M Usenix/M user/MS USG USG's usher/DGS usual/PUY usurp/DR Utah/M utensil/MS utility/MS utmost utopian/MS utter/DGRSY utterance/MS uttered/U uttermost uucp/M vacancy/MS vacant/PY vacate/DGNSX vacation/DGRSZ vacillate/DGNSX vacillating/Y vacillator/MS vacuo vacuous/PY vacuum/DGS vagabond/MS vagary/MS vagina/MS vagrant/SY vague/PRTY vainly vale/MS valedictorian/M valence/MS valentine/MS valet/MS valiant/PY valid/IPY validate/DGINSX validated/AI validates/AI validation/AI validity/I valley/MS valuable/PS valuably/I valuation/MS valuator/S value/DGRSZ valued/AU values/A valve/DGMS van/DMS vane/DMS Vanessa/M vanilla vanish/DGRS vanishing/Y vanity/S vanquish/DGRS vantage/S VAR variability/I variable/MPS variably/I variance/MS variant/ISY variation/MS varied/Y variety/MS various/PY varnish/DGMRSZ varnished/U vary/DGJRS varying/SY vase/MS vassal/S vast/PRTY vat/MS vaudeville vault/DGRS vaunt/DR Vax/M VCR veal/AGR vector/DGMS veer/DGS veering/Y vegetable/MS vegetarian/MS vegetate/DGNSV vegetative/PY vehemence vehement/Y vehicle/MS vehicular veil/DGSU vein/DGRS velocity/MS velvet vend/GR vendor/MS venerable/P vengeance venison venom venomous/PY vent/DGRS ventilate/DGNSVX ventilated/U ventral/Y ventricle/MS Ventura/M venture/DGJRSZ veracity/I veranda/DMS verb/MS verbal/Y verbose/PY verdict/S verdure/D verge/RS verifiability verifiable/P verified/AU verifier/MS verify/DGNRSXZ verily veritable/P vermin versa versatile/PY versatility verse/ADGNRSX version/AIS versus vertebrate/MNS vertex/S vertical/PSY vertices very/RT vessel/MS vest/DGIS vestige/MS vestigial/Y veteran/MS veterinarian/MS veterinary veto/DGR vetoes vetting/A vex/DGS vexation vexed/Y vi/DMRS via viability/I viable/I viably vial/MS vibrate/DGNSX vice/GMS viceroy vicinity/S vicious/PY vicissitude/MS victim/MS victor/MS victorious/PY victory/MS victual/S video/S videotape/DGMS vie/DRS view/DGJRSZ viewable viewpoint/MS vigilance vigilant/Y vigilante/MS vignette/DGMRS vigorous/PY vii viii vile/PRTY vilify/DGNRSX villa/MS village/MRSZ villain/MS villainous/PY villainy vindictive/PY vine/GMS vinegar/S vineyard/MS vintage/RS violate/DGNSVX violator/MS violence violent/Y violet/MS violin/MS violinist/MS viper/MS viral/Y virgin/MS Virginia/M virginity virtual/Y virtue/MS virtuoso/MS virtuous/PY virus/MS visa/DGS visage/D viscosity/S viscount/MS viscous/PY visibility/S visible/IP visibly/I vision/DGMS visionary/P visit/ADGS visitation/MS visited/AU visitor/MS visor/DMS vista/DMS visual/SY vita vitae vital/SY vitality vitamin/MS vivid/PY vizier VMS VMS's vocabulary/S vocal/SY vocation/MS vocational/Y vocations/AI vogue voice/DGRSZ voiced/IU void/DGPRS volatile/PS volatility/S volcanic volcano/MS volley/DGRS volleyball/MS volt/AS voltage/S volume/DGMS voluntarily/I voluntary/IP volunteer/DGS vomit/DGRS vortex/S vote/DGRSVZ votive/PY vouch/GRSZ vow/DGRS vowel/MS voyage/DGJRSZ vulgar/Y vulnerability/S vulnerable/IP vulture/MS wade/DGRSZ wafer/DGMS waffle/DGMS waft/R wag/DGRSZ wage/DGRSZ waged/U wager/DGRS wagon/MS wail/DGRS waist/DMRS waistcoat/DMS wait/DGRSZ waiter/MS waitress/MS waive/DGRSZ waiverable wake/DGRS waken/DGR walk/DGRSZ walkway/MS wall/DGMRS wallet/MS wallow/DGRS walnut/MS walrus/MS waltz/DGRS wan/DGPY wand/RZ wander/DGJRSZ wane/DGS want/DGRS wanted/U wanton/PRY war/GMS warble/DGRS ward/DGNRSX wardrobe/MS ware/GS warehouse/DGRS warfare warily/U warlike warm/DGHPRSTYZ warn/DGJRS warning/SY Warnock/M warp/DGMRS warrant/DGRS warranted/U warranty/MS warred warring warrior/MS warship/MS wart/DMS wary/PRT was wash/DGJRSZ Washington/M wasn't wasp/MS waste/DGRS wasteful/PY wasting/Y watch/DGJRSZ watched/U watchful/PY watchman watchword/MS water/DGJRS waterfall/MS waterproof/DGPRS waterway/MS watery/P wave/DGRSZ waveform/MS wavefront/MS wavelength wavelengths waver/DGRS wavering/UY wax/DGNRSZ waxy/PR way/MS wayside/S wayward/PY we/DGJT we'd we'll we're we've weak/NPRTXY weaken/DGRS weakly/P weakness/MS wealth wealths wealthy/PRT wean/DGR weapon/DMS wear/GRS wearable wearied/U wearily wearing/Y wearisome/PY weary/DGPRST weasel/MS weather/DGRSY weathercock/MS weave/GRSZ web/MRS wed/S wedded wedding/MS wedge/DGS Wednesday/MS wee/D weed/DGRS week/MSY weekday/MS weekend/MRS weekly/S weep/DGRSZ Weibull/M weigh/DGJR weighed/U weighs weight/DGJRS weird/PY welcome/DGPRSY weld/DGJRSZ welfare well/DGPS wench/MRS went wept/U were weren't west/GR wester/DGY westerly/S western/RZ westward/S wet/PSY wetted wetter wettest wetting whack/DGRS whale/GRS whammy/S wharf/S wharves what/M whatchamacallit/MS whatever whatsoever wheat/N wheel/DGJRSZ whelp when/S whence whenever where/M whereabouts whereas whereby wherein whereupon wherever whether whew whey which whichever while/DGS whim/MS whimper/DGS whimsical/PY whimsy/DMS whine/DGRS whining/Y whip/MS whipped whipper/MS whipping/MS whirl/DGRS whirlpool/MS whirlwind whirr/G whisk/DGRSZ whisker/DS whiskey/MS whisper/DGJRS whispering/SY whistle/DGRSZ whit/DGNRTX white/DGPRSTY whiten/DGRSZ whitespace whitewash/DGR whittle/DGJRS whiz whizzed whizzes whizzing who/M whoever whole/PS wholehearted/Y wholesale/DGRSZ wholesome/PY wholly whom whomever whoop/DGRS whore/GMS whorl/DMS whose why wick/DGRS wicked/PY wide/PRTY widen/DGRS widespread widget/MS widow/DRSZ width widths wield/DGRS wife/MY wifely/P wig/MS wigwam Wilbur/M wild/GPRTY wildcat/MS wilder/P wile/DGS will/DGJRS willed/U willful/PY willing/PSY Willisson/M willow/MRS Wilson/M wilt/DGS wily/PR win/DGRSZ wince/DGS wind/DGRSZ windmill/GMS window/DGMS windy/PR wine/DGRSZ wing/DGRSZ wink/DGRS winking/U winner/MS winning/SY winter/DGRSY wintry/PR wipe/DGRSZ wire/DGJRS wired/AU wireless wires/A wiretap/MS wiry/PR wisdom/S wise/DGPRSTY wish/DGRSZ wishful/PY wisp/MS wistful/PY wit/MPS witch/GS witchcraft with/RZ withal withdraw/GRS withdrawal/MS withdrawn/P withdrew wither/DGS withering/Y withheld withhold/GJRSZ within without withstand/GS withstood witness/DGS witnessed/U witty/PRT wives wizard/MSY woe/P woeful/Y woke wolf/R wolves woman/MY womanhood womanly/P womb/DMS women/MS won't wonder/DGRS wonderful/PY wondering/Y wonderland/M wonderment wondrous/PY wont/DG wonted/PUY woo/DGRSY wood/DGMNS woodchuck/MS woodcock/MS wooden/PY woodland/R woodman woodpecker/MS woods/R woodwork/GR woody/PR woof/DGRSZ wool/DNSXY woolly/PRS word/DGJMS wordily wordy/PR wore work/DGJRSZ workable/P workably workaround/MS workbench/MS workbook/MS worker/MS workhorse/MS workingman workload/S workman/Y workmanship workmen/M workshop/MS workstation/MS world/MSYZ worldly/PU worldwide worm/DGRS worn/U worried/Y worrisome/PY worry/DGRSZ worrying/Y worse/R worship/S worshipful/PY worst/D worth/G worthless/PY worths worthwhile/P worthy/PRST would/T wouldn't wound/DGS wove woven/U wrangle/DGRSZ wrap/MS wrapped/U wrapper/MS wrapping/S wraps/U wrath wreak/S wreath/DGS wreck/DGRSZ wreckage wren/MS wrench/DGS wrenching/Y wrest/DGRS wrestle/DGJRS wretch/DS wretched/PY wriggle/DGRS wring/GRS wrinkle/DGS wrinkled/U wrist/MS wristwatch/MS writ/GJMRSZ writable/U write/GJRSZ writer/MS writhe/DGS written/AU wrong/DGPRSTY wrote/A wrought/I wrung Xenix/M Xeroxed Xeroxes Xeroxing xi xii xiii xiv xix xv xvi xvii xviii xx yacc/M Yamaha/M yank/DGS yard/DGMS yardstick/MS yarn/DGMS yawn/GRS yawning/Y yea/S yeah year/MSY yearn/DGJRS yearning/SY yeast/MS yecch yell/DGRS yellow/DGPRST yellowish yelp/DGRS Yentl/M yeoman/Y yeomen yes/S yesterday/MS yet yield/DGRS yielded/U yielding/U yoke/GMS yon yonder York/MRSZ you/H you'd you'll you're you've young/PRTY youngster/MS your/MS yourself yourselves youth/MS youthful/PY yuck yummy/R yuppie/MS zap/S zapped zapping zeal Zealand/M zealous/PY zebra/MS zenith zero/DGHS zeroes zest zigzag zinc/M zodiac/S zonal/Y zone/DGRSY zoo/MS zoological/Y zoom/DGS Zulu/MS htdig-3.2.0b6/installdir/english.aff0100644006314600127310000001317406275416057016661 0ustar angusgbhtdig# # $Id: english.aff,v 1.1.1.1 1997/02/03 17:11:11 turtle Exp $ # # Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All modifications to the source code must be clearly marked as # such. Binary redistributions based on modified source code # must be clearly marked as modified versions in the documentation # and/or other materials provided with the distribution. # 4. All advertising materials mentioning features or use of this software # must display the following acknowledgment: # This product includes software developed by Geoff Kuenning and # other unpaid contributors. # 5. The name of Geoff Kuenning may not be used to endorse or promote # products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Affix table for English # # $Log: english.aff,v $ # Revision 1.1.1.1 1997/02/03 17:11:11 turtle # Initial CVS # # Revision 1.16 1995/01/08 23:23:59 geoff # Add a NeXT to the defstringtype statement so that nextispell can # select it. # # Revision 1.15 1994/01/25 07:12:40 geoff # Get rid of all old RCS log lines in preparation for the 3.1 release. # # nroffchars ().\\* texchars ()\[]{}<\>\\$*.% # First we declare the character set. Since it's English, it's easy. # The only special character is the apostrophe, so that possessives can # be handled. We declare it as a boundary character, so that quoting with # single quotes doesn't confuse things. The apostrophe is the only # character that gets such treatment. # # We declare the apostrophe first so that "Jon's" collates before "Jonas". # (This is the way ASCII does it). # defstringtype "nroff" "nroff" ".mm" ".ms" ".me" ".man" ".NeXT" boundarychars ' wordchars [a-z] [A-Z] altstringtype "tex" "tex" ".tex" ".bib" # Here's a record of flags used, in case you want to add new ones. # Right now, we fit within the minimal MASKBITS definition. # # ABCDEFGHIJKLMNOPQRSTUVWXYZ # Used: * * **** ** * ***** *** # A D GHIJ MN P RSTUV XYZ # Available: -- -- -- - - - # BC EF KL O Q W # Now the prefix table. There are only three prefixes that are truly # frequent in English, and none of them seem to need conditional variations. # prefixes flag *A: . > RE # As in enter > reenter flag *I: . > IN # As in disposed > indisposed flag *U: . > UN # As in natural > unnatural # Finally, the suffixes. These are exactly the suffixes that came out # with the original "ispell"; I haven't tried to improve them. The only # thing I did besides translate them was to add selected cross-product flags. # suffixes flag V: E > -E,IVE # As in create > creative [^E] > IVE # As in prevent > preventive flag *N: E > -E,ION # As in create > creation Y > -Y,ICATION # As in multiply > multiplication [^EY] > EN # As in fall > fallen flag *X: E > -E,IONS # As in create > creations Y > -Y,ICATIONS # As in multiply > multiplications [^EY] > ENS # As in weak > weakens flag H: Y > -Y,IETH # As in twenty > twentieth [^Y] > TH # As in hundred > hundredth flag *Y: . > LY # As in quick > quickly flag *G: E > -E,ING # As in file > filing [^E] > ING # As in cross > crossing flag *J: E > -E,INGS # As in file > filings [^E] > INGS # As in cross > crossings flag *D: E > D # As in create > created [^AEIOU]Y > -Y,IED # As in imply > implied [^EY] > ED # As in cross > crossed [AEIOU]Y > ED # As in convey > conveyed flag T: E > ST # As in late > latest [^AEIOU]Y > -Y,IEST # As in dirty > dirtiest [AEIOU]Y > EST # As in gray > grayest [^EY] > EST # As in small > smallest flag *R: E > R # As in skate > skater [^AEIOU]Y > -Y,IER # As in multiply > multiplier [AEIOU]Y > ER # As in convey > conveyer [^EY] > ER # As in build > builder flag *Z: E > RS # As in skate > skaters [^AEIOU]Y > -Y,IERS # As in multiply > multipliers [AEIOU]Y > ERS # As in convey > conveyers [^EY] > ERS # As in build > builders flag *S: [^AEIOU]Y > -Y,IES # As in imply > implies [AEIOU]Y > S # As in convey > conveys [SXZH] > ES # As in fix > fixes [^SXZHY] > S # As in bat > bats flag *P: [^AEIOU]Y > -Y,INESS # As in cloudy > cloudiness [AEIOU]Y > NESS # As in gray > grayness [^Y] > NESS # As in late > lateness flag *M: . > 'S # As in dog > dog's htdig-3.2.0b6/installdir/footer.html0100644006314600127310000000030207426615601016716 0ustar angusgbhtdig$(PAGEHEADER) $(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
    ht://Dig $(VERSION) htdig-3.2.0b6/installdir/header.html0100644006314600127310000000156507426615601016664 0ustar angusgbhtdig Search results for '$&(WORDS)'

    ht://Dig Search results for '$&(LOGICAL_WORDS)'


    Match: $(METHOD) Format: $(FORMAT) Sort by: $(SORT)
    Refine search:

    Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches. More *'s indicate a better match.
    htdig-3.2.0b6/installdir/htdig-pdfparser.1.in0100644006314600127310000000176510024270231020302 0ustar angusgbhtdig.TH htdig-pdfparser 1 "17 February 2002" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .SH NAME htdig-pdfparser \- parse a PDF document (wrapper script for htdig) .SH SYNOPSIS .B htdig-pdfparser .SH "DESCRIPTION" This script acts as a wrapper script for the htdig program. The exact program that htdig uses to search in pdf documents for index words, can be set in the htdig config file. Set the program by using the .I debian_pdf_parser directive. .SH "OPTIONS" .TP .B acrobat Use the acroread utility to parse PDF documents .TP .B xpdf Use the pstotext utility, part of the xpdf package, to parse PDF documents .SH "FILES" .TP .B @DEFAULT_CONFIG_FILE@ The default configuration file. .SH "SEE ALSO" Please refer to the HTML pages (in the htdig-doc package) .B /usr/share/doc/htdig-doc/html/index.html and the manual pages .I htdig(1) for a detailed description of ht://Dig and its commands. .SH AUTHOR Stijn de Bekker htdig-3.2.0b6/installdir/htdig.1.in0100644006314600127310000001146010062603601016312 0ustar angusgbhtdig.TH htdig 1 "21 July 1997" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .SH NAME htdig \- retrieve HTML documents for ht://Dig search engine .SH SYNOPSIS .B htdig .I "[options]" .SH "DESCRIPTION" Htdig retrieves HTML documents using the HTTP protocol and gathers information from these documents which can later be used to search these documents. This program can be referred to as the search robot. .SH OPTIONS .TP .B \- Get the list of URLs to start indexing from standard input. This will override the default parameter \fIstart_url\fR specified in the config file and the file supplied to the \fI-m\fR option. .TP .B \-a Use alternate work files. Tells htdig to append .I .work to database files, causing a second copy of the database to be built. This allows the original files to be used by htsearch during the indexing run. .TP .B \-c \fIconfigfile\fR Use the specified .I configfile instead of the default. .TP .B \-h \fImaxhops\fR Restrict the dig to documents that are at most .I maxhops links away from the starting document. This only works if option \fI\-i\fR is also given. .TP .B \-i Initial. Do not use any old databases. Old databases will be erased before runing the program. .TP .B \-m \fIfilename\fR Minimal run. Only index the URLs given in the file \fIfilename\fR, ignoring all others. URLs in the file should be formatted one URL per line. .B \-s Print statistics about the dig after completion. .TP .B \-t Create an ASCII version of the document database. This database is easy to parse with other programs so that information can be extracted from it for purposes other than searching. One could gather some interesting statistics from this database. .TS cB cB c l . Fieldname Value u URL t Title a State (0 normal, 1 not found, 2 not indexed, 3 obsolete) m Time of last modification reported by the server s Document Size in bytes H Excerpt of the document h Meta Description l Time of last rerievial L Count of links in the document or of \fIoutgoing links\fR b Number of links to the document, also called \fIincoming\fR links or \fIbacklinks\fR c Hop count of this document g Signature of this document (used to detect duplicates) e E-Mail address to use for a notification from \fIhtnotify\fR n Date on which such notification is sent S Subject of the notfication message d The text of Incoming links pointing to this document (e.g. description) A Anchors in the document (i.e. for more) # max_doc_size: 200000 # # Most people expect some sort of excerpt in results. By default, if the # search words aren't found in context in the stored excerpt, htsearch shows # the text defined in the no_excerpt_text attribute: # (None of the search words were found in the top of this document.) # This attribute instead will show the top of the excerpt. # no_excerpt_show_top: true # # Depending on your needs, you might want to enable some of the fuzzy search # algorithms. There are several to choose from and you can use them in any # combination you feel comfortable with. Each algorithm will get a weight # assigned to it so that in combinations of algorithms, certain algorithms get # preference over others. Note that the weights only affect the ranking of # the results, not the actual searching. # The available algorithms are: # accents # exact # endings # metaphone # prefix # regex # soundex # speling [sic] # substring # synonyms # By default only the "exact" algorithm is used with weight 1. # Note that if you are going to use the endings, metaphone, soundex, accents, # or synonyms algorithms, you will need to run htfuzzy to generate # the databases they use. # search_algorithm: exact:1 synonyms:0.5 endings:0.1 # # The following are the templates used in the builtin search results # The default is to use compiled versions of these files, which produces # slightly faster results. However, uncommenting these lines makes it # very easy to change the format of search results. # See for more details. # # template_map: Long long ${common_dir}/long.html \ # Short short ${common_dir}/short.html # template_name: long # # The following are used to change the text for the page index. # The defaults are just boring text numbers. These images spice # up the result pages quite a bit. (Feel free to do whatever, though) # next_page_text: next no_next_page_text: prev_page_text: prev no_prev_page_text: page_number_text: '1' \ '2' \ '3' \ '4' \ '5' \ '6' \ '7' \ '8' \ '9' \ '10' # # To make the current page stand out, we will put a border around the # image for that page. # no_page_number_text: '1' \ '2' \ '3' \ '4' \ '5' \ '6' \ '7' \ '8' \ '9' \ '10' # local variables: # mode: text # eval: (if (eq window-system 'x) (progn (setq font-lock-keywords (list '("^#.*" . font-lock-keyword-face) '("^[a-zA-Z][^ :]+" . font-lock-function-name-face) '("[+$]*:" . font-lock-comment-face) )) (font-lock-mode))) # end: htdig-3.2.0b6/installdir/htdig.gif0100644006314600127310000000343606275416057016340 0ustar angusgbhtdigGIF87aQ6Äÿÿÿµµµ{ss„{{B99µssµJJµ))­½½­„J΄s{cZ”R1ÿÆ¥91çïïJRJckcŒœ9csZ{ŒRs„Œ¥µBk„ÎÖÞRRZ,Q6ÿà%Ždižhª®,™½p,Ït‰š7i£íÿ0ÎHôi0˜c¹$ ‹Ðàð¥áX56$†CÄv:ÂÒ`p|U«U;ͤ9X¢ð%Ø'Сl<@vJvvvCuwrS“y3…ƒŸŽŽ:\–t°›2”?“¦§¹«¬•´º@s˜š4¸ÉYƒaÀŒŽŽ‘<n5O³³µä1У Tq0¢ŸÀíŽì/´Ä£pC€Ì.!ËTÑ8Grµ{gEÆ>*L&áµßö4"À¥ <*HŽÿL˜fà\BX$’äQŒš7;*ôPÀAƒ€1q¯Ñ71bX¸¡RXv(´Lˆ®&)Å $…Pa܇ ,ë ÂcÓ¥öÔW¦ k~XFw!…i„nˆŠÊ§k£* ]¶°™„ /p ñhRÀp‘u˜°’”ª™&$ýংÄàÑÊ•áÃXÅb}¢-v±Ñ¶ ÃZi‡€æFS©¾¤´9àçHn–NÌñbX·vðú±ÎÙ{3.ôÀE7¦~óf`‡}ˆˆ2ˆ[/ì3±ØåÍÿ>·³6Æì]^‡ÏyûgÚ5ΠÆ1ÑX©¥÷Èz Ý´Áÿw| fØõf%#(A@œךa‰­åX#oÁRÁ6QEUŸ| EØH}ÜéÔ4`€}e^qç ð^,UË«C]žÐçÛšUð>lpA'pµk øG^GáåDdvXàdY—¢‘¶³ØV –a¦‰õD|emX@gGF …I$o+ ¦"L•VC©FÜØt¹—î̶JãTrÙn£éÏ †zà$8å@¨¦çœÕ´È&³áå›Î'¡ «|@#X@ÈìJÆ ˜‡«Dò {=ÊêÉ&t%¥¢vÛMšMÿ5DÐÍ Z0Á·à×@w6ÒÁ–œ~‚Œ&IeãÒ Þ‘3BA0;Q^>²I@Md„ È‚S8@a1¢@žAL ÈgaayPHJÀM€—á0#A5‹ @M”F6T‚\ ÌÆ*,Ye٤لÁ˜*B‹Y`´@",Špp *{R»s°Ì¦AP賟¸¤„¸´´´¨€ £„¸(Ä@6^^y)P± T/%*Ó®4Ø$%@åÈD€Â]_‹pqIa^~yˆl¢@†<…² wÊ€‚C72D t ¿0 Ê(,&‚“8:™@á@„ÚÒRòÀ:KX˜·|Ü/Œù\#ÆúP—6U[üÈל¬@½@W²³ƒÂ€ÈZÏt&/$:ø†sðM—•g•fá㻑•è v Ð@mP_þp„Ä ¤ fjaaFf9YYayÜÉ @@9At!(description) .TP .B A Anchors in the document (i.e. description) .TP .B A Anchors in the document (i.e.
    $&(TITLE)$(STARSLEFT)
    $(EXCERPT)
    $&(URL) $(MODIFIED), $(SIZE) bytes
    htdig-3.2.0b6/installdir/mime.types0100644006314600127310000001652710061573563016566 0ustar angusgbhtdig# This is the default mime.types file from the Apache web server distribution # This file controls what Internet media types are sent to the client for # given file extension(s). Sending the correct media type to the client # is important so they know how to handle the content of the file. # Extra types can either be added here or by using an AddType directive # in your config files. For more information about Internet media types, # please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type # registry is at . # MIME type Extension application/EDI-Consent application/EDI-X12 application/EDIFACT application/activemessage application/andrew-inset ez application/applefile application/atomicmail application/cals-1840 application/commonground application/cybercash application/dca-rft application/dec-dx application/eshop application/hyperstudio application/iges application/mac-binhex40 hqx application/mac-compactpro cpt application/macwriteii application/marc application/mathematica application/msword doc application/news-message-id application/news-transmission application/octet-stream bin dms lha lzh exe class application/oda oda application/pdf pdf application/pgp-encrypted application/pgp-keys application/pgp-signature application/pkcs10 application/pkcs7-mime application/pkcs7-signature application/postscript ai eps ps application/prs.alvestrand.titrax-sheet application/prs.cww application/prs.nprend application/remote-printing application/riscos application/rtf rtf application/set-payment application/set-payment-initiation application/set-registration application/set-registration-initiation application/sgml application/sgml-open-catalog application/slate application/smil smi smil application/vemmi application/vnd.3M.Post-it-Notes application/vnd.FloGraphIt application/vnd.acucobol application/vnd.anser-web-certificate-issue-initiation application/vnd.anser-web-funds-transfer-initiation application/vnd.audiograph application/vnd.businessobjects application/vnd.claymore application/vnd.comsocaller application/vnd.dna application/vnd.dxr application/vnd.ecdis-update application/vnd.ecowin.chart application/vnd.ecowin.filerequest application/vnd.ecowin.fileupdate application/vnd.ecowin.series application/vnd.ecowin.seriesrequest application/vnd.ecowin.seriesupdate application/vnd.enliven application/vnd.epson.salt application/vnd.fdf application/vnd.ffsns application/vnd.framemaker application/vnd.fujitsu.oasys application/vnd.fujitsu.oasys2 application/vnd.fujitsu.oasys3 application/vnd.fujitsu.oasysgp application/vnd.fujitsu.oasysprs application/vnd.fujixerox.docuworks application/vnd.hp-HPGL application/vnd.hp-PCL application/vnd.hp-PCLXL application/vnd.hp-hps application/vnd.ibm.MiniPay application/vnd.ibm.modcap application/vnd.intercon.formnet application/vnd.intertrust.digibox application/vnd.intertrust.nncp application/vnd.is-xpr application/vnd.japannet-directory-service application/vnd.japannet-jpnstore-wakeup application/vnd.japannet-payment-wakeup application/vnd.japannet-registration application/vnd.japannet-registration-wakeup application/vnd.japannet-setstore-wakeup application/vnd.japannet-verification application/vnd.japannet-verification-wakeup application/vnd.koan application/vnd.lotus-1-2-3 application/vnd.lotus-approach application/vnd.lotus-freelance application/vnd.lotus-organizer application/vnd.lotus-screencam application/vnd.lotus-wordpro application/vnd.meridian-slingshot application/vnd.mif mif application/vnd.minisoft-hp3000-save application/vnd.mitsubishi.misty-guard.trustweb application/vnd.ms-artgalry application/vnd.ms-asf application/vnd.ms-excel application/vnd.ms-powerpoint ppt application/vnd.ms-project application/vnd.ms-tnef application/vnd.ms-works application/vnd.music-niff application/vnd.musician application/vnd.netfpx application/vnd.noblenet-directory application/vnd.noblenet-sealer application/vnd.noblenet-web application/vnd.novadigm.EDM application/vnd.novadigm.EDX application/vnd.novadigm.EXT application/vnd.osa.netdeploy application/vnd.powerbuilder6 application/vnd.powerbuilder6-s application/vnd.rapid application/vnd.seemail application/vnd.shana.informed.formtemplate application/vnd.shana.informed.interchange application/vnd.shana.informed.package application/vnd.street-stream application/vnd.sun.xml.calc sxc application/vnd.sun.xml.draw sxd application/vnd.sun.xml.impress sxi application/vnd.sun.xml.writer sxw application/vnd.svd application/vnd.swiftview-ics application/vnd.truedoc application/vnd.visio application/vnd.webturbo application/vnd.wrq-hp3000-labelled application/vnd.wt.stf application/vnd.xara application/vnd.yellowriver-custom-menu application/wita application/wordperfect5.1 application/x-bcpio bcpio application/x-cdlink vcd application/x-chess-pgn pgn application/x-compress application/x-cpio cpio application/x-csh csh application/x-director dcr dir dxr application/x-dvi dvi application/x-futuresplash spl application/x-gtar gtar application/x-gzip application/x-hdf hdf application/x-javascript js application/x-koan skp skd skt skm application/x-latex latex application/x-netcdf nc cdf application/x-sh sh application/x-shar shar application/x-shockwave-flash swf application/x-stuffit sit application/x-sv4cpio sv4cpio application/x-sv4crc sv4crc application/x-tar tar application/x-tcl tcl application/x-tex tex application/x-texinfo texinfo texi application/x-troff t tr roff application/x-troff-man man application/x-troff-me me application/x-troff-ms ms application/x-ustar ustar application/x-wais-source src application/x400-bp application/xml application/zip zip audio/32kadpcm audio/basic au snd audio/midi mid midi kar audio/mpeg mpga mp2 mp3 audio/vnd.qcelp audio/x-aiff aif aiff aifc audio/x-pn-realaudio ram rm audio/x-pn-realaudio-plugin rpm audio/x-realaudio ra audio/x-wav wav chemical/x-pdb pdb xyz image/cgm image/g3fax image/gif gif image/ief ief image/jpeg jpeg jpg jpe image/naplps image/png png image/prs.btif image/tiff tiff tif image/vnd.dwg image/vnd.dxf image/vnd.fpx image/vnd.net-fpx image/vnd.svf image/vnd.xiff image/x-cmu-raster ras image/x-portable-anymap pnm image/x-portable-bitmap pbm image/x-portable-graymap pgm image/x-portable-pixmap ppm image/x-rgb rgb image/x-xbitmap xbm image/x-xpixmap xpm image/x-xwindowdump xwd message/delivery-status message/disposition-notification message/external-body message/http message/news message/partial message/rfc822 model/iges igs iges model/mesh msh mesh silo model/vnd.dwf model/vrml wrl vrml multipart/alternative multipart/appledouble multipart/byteranges multipart/digest multipart/encrypted multipart/form-data multipart/header-set multipart/mixed multipart/parallel multipart/related multipart/report multipart/signed multipart/voice-message text/css css text/directory text/enriched text/plain asc txt text/prs.lines.tag text/rfc822-headers text/richtext rtx text/rtf rtf text/sgml sgml sgm text/tab-separated-values tsv text/uri-list text/vnd.abc text/vnd.flatland.3dml text/vnd.fmi.flexstor text/vnd.in3d.3dml text/vnd.in3d.spot text/vnd.latex-z text/x-setext etx text/xml xml video/mpeg mpeg mpg mpe video/quicktime qt mov video/vnd.motorola.video video/vnd.motorola.videop video/vnd.vivo video/x-msvideo avi video/x-sgi-movie movie x-conference/x-cooltalk ice text/html html htm htdig-3.2.0b6/installdir/nomatch.html0100644006314600127310000000256607426615601017067 0ustar angusgbhtdig No match for '$&(LOGICAL_WORDS)'

    ht://Dig Search results


    No matches were found for '$&(LOGICAL_WORDS)'

    Check the spelling of the search word(s) you used. If the spelling is correct and you only used one word, try using one or more similar search words with "Any."

    If the spelling is correct and you used more than one word with "Any," try using one or more similar search words with "Any."

    If the spelling is correct and you used more than one word with "All," try using one or more of the same words with "Any."


    Match: $(METHOD) Format: $(FORMAT) Sort by: $(SORT)
    Refine search:

    ht://Dig $(VERSION) htdig-3.2.0b6/installdir/rundig0100755006314600127310000000443307773765201015770 0ustar angusgbhtdig#!/bin/sh # # rundig # # $Id: rundig,v 1.9 2003/12/29 08:49:05 lha Exp $ # # This is a sample script to create a search database for ht://Dig. # DBDIR=@DATABASE_DIR@ COMMONDIR=@COMMON_DIR@ BINDIR=@BIN_DIR@ conffile=@DEFAULT_CONFIG_FILE@ # To help debug problems, try running rundig -vvv # This will add lots of debugging output to all of the programs stats= opts= alt= while [ "$#" -gt 0 ] do case "$1" in -a) alt="$1" ;; -s) stats="$1" ;; -c) shift conffile="$1" opts="$opts -c $conffile" ;; *) opts="$opts $1" ;; # e.g. -v esac shift done # If -a specified, note the database directory to move the temp files correctly # TODO: Should also check for files relative to COMMONDIR. if [ -f "$conffile" ] then new_db_dir=`awk '/^[^#a-zA-Z]*database_dir/ { print $NF }' < $conffile` if [ "$new_db_dir" != "" ] then DBDIR=$new_db_dir fi else echo "Config file $conffile cannot be found" exit 1 fi # # Set the TMPDIR variable if you want htdig and other programs to put # files in a location other than the default. This is important if # you are running this script as root, since /tmp is usually not # secure. Also, be aware that on some systems, /tmp is a memory # mapped filesystem that takes away from virtual memory. # TMPDIR=$DBDIR export TMPDIR $BINDIR/htdig -i $opts $stats $alt $BINDIR/htpurge $opts $alt case "$alt" in -a) ( cd $DBDIR && test -f db.docdb.work && for f in *.work do mv -f $f `basename $f .work` done test -f db.words.db.work_weakcmpr && mv -f db.words.db.work_weakcmpr db.words.db_weakcmpr) ;; esac $BINDIR/htnotify $opts # If you want to use the soundex and (or) metaphone fuzzy matchings, # Uncomment the following line # $BINDIR/htfuzzy $opts soundex metaphone # # Create the endings and synonym databases if they don't exist # or if they're older than the files they're generated from. # These databases are semi-static, so even if pages change, # these databases will not need to be rebuilt. # if [ "`ls -t $COMMONDIR/english.0 $COMMONDIR/word2root.db 2>/dev/null | sed 1q`" = \ "$COMMONDIR/english.0" ] then $BINDIR/htfuzzy $opts endings fi if [ "`ls -t $COMMONDIR/synonyms $COMMONDIR/synonyms.db 2>/dev/null | sed 1q`" = \ "$COMMONDIR/synonyms" ] then $BINDIR/htfuzzy $opts synonyms fi htdig-3.2.0b6/installdir/rundig.1.in0100644006314600127310000000176110024270232016504 0ustar angusgbhtdig.TH rundig 1 "23 April 1999" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .SH NAME rundig \- sample script to create a search database for ht://Dig .SH SYNOPSIS .B rundig .I "[options]" .SH "DESCRIPTION" .I rundig is a sample script to create a search database for the ht://Dig search engine. .SH OPTIONS .TP .B \-v Verbose mode. This increases the verbosity of the program. .TP .B \-a Use alternate work files. .TP .B \-s Print statistics about the dig after completion .TP .B \-c configfile Use alternate config file. .SH "SEE ALSO" Please refer to the HTML pages (in the htdig-doc package) .B /usr/share/doc/htdig-doc/html/index.html and the manual pages .I htdig(1) , .I htmerge(1) , .I htnotify(1) , .I htfuzzy(1) for a detailed description of ht://Dig and its commands. .SH AUTHOR This manual page was written by Christian Schwarz, modified by Gergely Madarasz and Stijn de Bekker, based on the HTML documentation of ht://Dig. htdig-3.2.0b6/installdir/search.html0100644006314600127310000000244707671021177016702 0ustar angusgbhtdig ht://Dig WWW Search

    ht://Dig WWW Site Search


    This search will allow you to search the contents of all the publicly available WWW documents at this site.

    Match: Format: Sort by:
    Search:

    Powered by ht://Dig $(VERSION) htdig-3.2.0b6/installdir/short.html0100644006314600127310000000010307426615601016556 0ustar angusgbhtdig$(STARSRIGHT) $&(TITLE)
    htdig-3.2.0b6/installdir/star.gif0100644006314600127310000000013106275416057016177 0ustar angusgbhtdigGIF89a ñÿÿÿÿÿ!ù, &„»Ê„{'N…l¡w-y]–åô™!d^H?qü®ÆwS;n=0 htdig-3.2.0b6/installdir/star.png0100644006314600127310000000030306645156451016217 0ustar angusgbhtdig‰PNG  IHDR  pÜÒ PLTEÿÿÿÿÿÖ,n tRNS@æØfeIDATxœb``d` @ l &ˆAj@1„FM  ©U«&몕ÄÀµ„ €2—0ã’L€b` s VF€o ‚zp°IEND®B`‚htdig-3.2.0b6/installdir/star_blank.gif0100644006314600127310000000006506275416057017354 0ustar angusgbhtdigGIF89a €ÿÿÿ!ù,  „©Ëí£œ´Ú› ;htdig-3.2.0b6/installdir/star_blank.png0100644006314600127310000000022706645156451017373 0ustar angusgbhtdig‰PNG  IHDR LЦPLTEÿÿÿUÂÓ~tRNS@æØf?IDATxœb`` €"€"€"€"€"€"€"€"€"€"€"€'.;…÷IEND®B`‚htdig-3.2.0b6/installdir/synonyms0100644006314600127310000003422007664657517016402 0ustar angusgbhtdigPaleocene Palaeocene Romanian Rumanian Roumanian Romansh Romansch Rumansh abridgment abridgement abridgments abridgements accouterment accoutrement accouterments accoutrements accoutre accouter acknowledgment acknowledgement acknowledgments acknowledgements adapter adaptor adapters adaptors adviser advisor advisers advisors adze adz aeon eon aeons eons aesthete esthete aesthetes esthetes aesthetic esthetic aggrandize aggrandise aging ageing airplane aeroplane airplanes aeroplanes aluminum aluminium ameba amoeba americanize americanise americanized americanised amid amidst among amongst amphitheater amphitheatre amphitheaters amphitheatres analogue analog analyze analyse analyzed analysed analyzers analysers analyzing analysing anemia anaemia anemic anaemic anesthesia anaesthesia anesthesiologist anaesthesiologist anesthesiology anaesthesiology anesthetic anaesthetic anesthetics anaesthetics anesthetist anaesthetist anesthetizing anaesthetising anodizing anodising apologize apologise apothegm apophthegm appall appal apprise apprize arbor arbour arbors arbours archaean archean archaeological archeological archaeologist archeologist archaeologists archeologists archaeology archeology archaeozoic archeozoic ardor ardour armor armour armored armoured armorer armourer armorers armourers armories armouries armoring armouring armory armoury artifact artefact artifacts artefacts atomized atomised atomizer atomiser atomizers atomisers atomizing atomising ax axe balk baulk baloney boloney barbecue barbeque barreled barelled barreling barelling battleax battleaxe behavior behaviour behavioral behavioural behaviorism behaviourism behaviors behaviours behoove behove biased biassed biasing biassing bisulfate bisulphate boric boracic burglarize burglarise burned burnt buses busses caenozoic cenozoic caliber calibre calibers calibres caliper calliper calipers callipers calisthenics callisthenics calk caulk canceled cancelled canceling cancelling candor candour cantaloupe cantaloup cantaloupes cantaloups capitalize capitalise capitalized capitalised carbonization carbonisation carburetor carburettor carburetors carburettors carcass carcase catalog catalogue catalogs catalogues catalyze catalyse catalyzed catalysed categorize categorise categorized categorised cauldron caldron cauldrons caldrons cauterization cauterisation cauterizing cauterising center centre centerboard centreboard centerboards centreboards centerfold centrefold centerfolds centrefolds centering centring centreing centers centres cesarean caesarean cesarian cesium caesium chamomile camomile characterize characterise check cheque checker chequer checks cheques chili chile chilli cigarette cigaret cigarettes cigarets citrus citrous clamor clamour clangor clangour clarinetist clarinettist clerestory clearstory colonize colonise color colour colorable colourable coloration colouration colorations colourations colored coloured colorful colourful colorfully colourfully coloring colouring colorless colourless colorlessly colourlessly colors colours connection connexion connections connexions councillor councilor councillors councilors counseled counselled counseling counselling counselor counsellor cozy cosy crayfish crawfish criticize criticise criticized criticised crystallizing crystallising cyclization cyclisation curb kerb czar tsar tzar decolorizing decolourising defense defence defenses defences deflection deflexion demagnetizing demagnetising demeanor demeanour demeanors demeanours deodorizing deodorising dependent dependant dependents dependants depolarizing depolarising depolymerizing depolymerising dept department desensitizers desensitisers desulfurizing desulfurising deviled devilled deviling devilling diaeresis dieresis dialogue dialog dialogues dialogs dialyze dialyse diarrhea diarrhoea dike dyke dikes dykes disc disk discs disks disheveled dishevelled disheveling dishevelling dissension dissention distill distil disulfide disulphide dolor dolour doodad doodah doodads doodahs doughnut donut doughnuts donuts draft draught drafts draughts draftsman draughtsman draftsmans draughtsmans drafty draughty dramatize dramatise dramatized dramatised dreamed dreamt economizer economiser economizers economisers edema oedema emphasize emphasise enamor enamour enamored enamoured encase incase encased incased enclose inclose enclosed inclosed encyclopedia encyclopaedia encyclopedic encyclopaedic encyclopedias encyclopaedias endeavor endeavour endeavors endeavours endorse indorse endorsed indorsed enology oenology enroll enrol enrolled enroled enrollment enrolment ensure insure ensured insured enthrall enthral enthralled enthraled epilogue epilog epilogues epilogs equaled equalled equaling equalling equalize equalise equalized equalised equalizing equalising esophagus oesophagus estrogen oestrogen estrus oestrus ether aether etiology aetiology eurythmy eurhythmy extemporize extemporise extemporized extemporised fagot faggot fagoting faggoting fagots faggots favor favour favored favoured favorite favourite favorites favourites favoritism favouritism favors favours fecal faecal feces faeces fertilization fertilisation fertilizer fertiliser fertilizing fertilising fervor fervour fetal foetal fetid foetid fetor foetor fetus foetus fiber fibre fiberboard fibreboard fiberboards fibreboards fiberglass fibreglass fibers fibres finalize finalise flaky flakey flavor flavour flavored flavoured flavoring flavouring flavors flavours fledgling fledgeling flexion flection flexions flections flotation floatation fluidized fluidised fluidizing fluidising focused focussed focusing focussing fueled fuelled fueling fuelling fulfill fulfil fulfilled fulfiled fulfillment fulfilment furor furore galvanizing galvanising garrote garotte garroted garotted garrotes garottes garroting garotting gauge gage gauged gaged gauges gages genuflection genuflexion glamor glamour glamorize glamorise glamorized glamorised goiter goitre goiters goitres gonorrhea gonorrhoea gram gramme grams grammes graphitizing graphitising gray grey groveled grovelled groveler groveller groveling grovelling gynecological gynaecological gynecologist gynaecologist gynecology gynaecology gypsies gipsies gypsy gipsy harbor harbour harbors harbours hemaglobin haemaglobin hemoglobin haemoglobin hematin haematin hematite haematite hematologist haematologist hematology haematology hemophilia haemophilia hemorrhage haemorrhage hemorrhages haemorrhages hemorrhoid haemorrhoid hemorrhoids haemorrhoids homeopath homoeopath homeostasis homoeostasis homogenizing homogenising homologue homolog homologues homologs honor honour honored honoured honoring honouring honors honours hosteled hostelled hosteler hosteller hostelers hostellers hosteling hostelling humor humour humored humoured humoring humouring humors humours immobilized immobilised immunizing immunising inflection inflexion inflections inflexions inquire enquire inquired enquired inquiries enquiries inquiring enquiring inquiry enquiry install instal installation instalation installed instaled installment instalment instill instil instilled instiled inure enure inured enured ionization ionisation ionized ionised isomerizing isomerising jail gaol jailbird gaolbird jailbirds gaolbirds jailbreak gaolbreak jailed gaoled jailer gaoler jailers gaolers jails gaols jeweler jeweller jewelers jewellers jewelry jewellery jibe gybe judgment judgement judgments judgements karat carat karats carats ketchup catsup kidnapped kidnaped kidnapper kidnaper kidnappers kidnapers kidnapping kidnapping kilogram kilogramme kilograms kilogrammes knelt kneeled labeled labelled labor labour laborer labourer laborers labourers laboring labouring labors labours largesse largess leaned leant leaped leapt learned learnt lens lense leukemia leukaemia leveled levelled leveler leveller levelers levellers leveling levelling libeled libelled libeling libelling libelous libellous liberalize liberalise license licence licensed licenced licenses licences licorice liquorice liter litre liters litres localizing localising louver louvre louvers louvres luster lustre magnetization magnetisation magnetizing magnetising malleableizing malleabilising maneuver manoeuvre maneuvered manoeuvred maneuvering manoeuvring maneuvers manoeuvres marveled marvelled marveling marvelling marvelous marvellous matchetes machetes meager meagre mercerizing mercerising medieval mediaeval medievalism mediaevalism medievalist mediaevalist medievalists mediaevalists metacenter metacentre metacenters metacentres metalized metallised metalizing metallising menorrhea menorrhoea merchandise merchandize metaled metalled metaling metalling meter metre meters metres mineralization mineralisation minimizing minimising misdemeanor misdemeanour misdemeanors misdemeanours misjudgment misjudgement misjudgments misjudgements miter mitre mitered mitred miters mitres mobilization mobilisation mobilize mobilise mobilized mobilised modeled modelled modeler modeller modeling modelling mold mould molded moulded molding moulding moldings mouldings molds moulds mollusk mollusc mollusks molluscs molt moult monologue monolog monologues monologs motorize motorise motorize motorise multicolor multicolour multicolored multicoloured mustache moustache mustaches moustaches naturalize naturalise naught nought nebulizer nebuliser nebulizers nebulisers neighbor neighbour neighborhood neighbourhood neighborhoods neighbourhoods neighborly neighbourly neighbors neighbours neutralization neutralisation neutralizing neutralising night nite nights nites niter nitre niters nitres normalize normalise normalized normalised nursling nurseling ocher ochre odor odour odors odours offense offence offenses offences omelette omelet omelettes omelets optimization optimisation organisation organization organize organise organised organized orthopedics orthopaedics oxidizing oxidising ozonizing ozonising pajamas pyjamas paleobotany palaeobotany paleoclimatology palaeoclimatology paleogeography palaeogeography paleography palaeography paleolithic palaeolithic paleomagnetism palaeomagnetism paleontological palaeontological paleontologist palaeontologist paleontology palaeontology paleozoic palaeozoic paneled panelled paneling panelling panelist panellist paralyze paralyse parameterize parametrize parametrise parenthesize parenthesise parlor parlour parlors parlours pasteurized pasteurised pasteurizing pasteurising pavior paviour pedagogue pedagog pedagogues pedagogs pedagogy paedagogy peddler pedlar peddlers pedlars pederast paederast pederasts paederasts pediatric paediatric pediatrician paediatrician pediatricians paediatricians pediatrics paediatrics pedodontia paedodontia pedodontics paedodontics pedophile paedophile pedophiles paedophiles pedophilia paedophilia penology poenology persnickety pernickety philter philtre philters philtres pickaninny picaninny piccaninny plasticizers plasticisers plow plough plowed ploughed plowing ploughing plowman ploughman plowmen ploughmen plows ploughs plowshare ploughshare plowshares ploughshares polarization polarisation polarized polarised polyethylene polythene polyethene polymerizable polymerisable polymerized polymerised popularize popularise practice practise practiced practised practices practises practicing practising premise premiss premises premisses pretense pretence pretenses pretences primeval primaeval program programme programmed programed programmer programer programmers programers programming programing programs programmes prologue prolog prologues prologs propellant propellent propellants propellents propeller propellor propellers propellors pulverized pulverised pulverizing pulverising pupilage pupillage quarreled quarrelled quarreler quarreller quarreling quarrelling rancor rancour realize realise recognize recognise recognizing recognising reconnoiter reconnoitre reflection reflexion renege renegue retroflection retroflexion reveled revelled reveling revelling reverie revery rigor rigour rigors rigours romanize romanise ruble rouble rubles roubles rumor rumour rumored rumoured rumors rumours saber sabre sabers sabres saltpeter saltpetre sanatorium sanitarium sanitorium satirize satirise satirized satirised savior saviour saviors saviours savor savour savory savoury scalawag scallywag scalawags scallywags scepter sceptre sceptered sceptred scepters sceptres scion cion selvage selvedge selvages selvedges sensitizing sensitising stabilized stabilised stabilizer stabiliser stabilizers stabilisers stabilizing stabilising sepulchre sepulcher sepulchres sepulchers siphon syphon siphoning syphoning sissy cissy skeptic sceptic skeptical sceptical skepticism scepticism skeptics sceptics skillful skilful smelled smelt smolder smoulder snowplow snowplough snowplows snowploughs somber sombre specialty speciality specter spectre specters spectres spelled spelt spilled spilt splendor splendour splendors splendours spoiled spoilt stabilize stabilise standardize standardise sterilization sterilisation subsidizing subsidising succor succour sulfate sulphate sulfates sulphates sulfide sulphide sulfides sulphides sulfites sulphites sulfur sulphur sulfureted sulphuretted summarize summarise summarized summarised surprise surprize surprised surprized surprises surprizes swab swob swabs swobs swap swop swaps swops symbolize symbolise symbolizes symbolises synagogue synagog synagogues synagogs synchronise synchronize synchronization synchronisation syneresis synaeresis synesthesia synaesthesia synthesizing synthesising tableting tabletting tantalize tantalise theater theatre theaters theatres thiosulfate thiosulphate thiosulfates thiosulphates though tho thralldom thraldom through thru tidbit titbit tidbits titbits tire tyre tires tyres titer titre tonight tonite traveled travelled traveler traveller traveling travelling travelogue travelog trisulfate trisulphate troweled trowelled troweling trowelling tumor tumour tumors tumours tyke tike tykes tikes tyro tiro tyros tiros unauthorized unauthorised valor valour vapor vapour vaporization vaporisation vaporize vaporise vaporized vaporised vaporizers vaporisers vapors vapours vial phial vials phials vigor vigour vise vice vises vices vulcanized vulcanised vulcanizing vulcanising wagon waggon while whilst whiskey whisky whiskeys whiskies willfull wilful woolen woollen woolens woollens woollie woolies woolly wooly woolie worshiped worshipped worshiper worshipper worshipers worshippers worshiping worshipping htdig-3.2.0b6/installdir/synonyms.original0100644006314600127310000000643007571045744020175 0ustar angusgbhtdigabcense absence abridgement abridgment accomodate accommodate acknowledgment acknowledgement airplane aeroplane andy andrew anemia anaemia anemic anaemic anesthesia anaesthesia anesthesiologist anaesthesiologist anesthesiololy anaesthesiology anesthetic anaesthetic anesthetist anaesthetist apr april archean archaean archeology archaeology archeozoic archaeozoic armor armour artic arctic attendence attendance aug august barbecue barbeque bbq behavior behaviour behaviorism behaviourism biassed biased biol biology buletin bulletin calender calendar canceled cancelled car auto automobile catalog catalogue cenozoic caenozoic center centre check cheque color colour colored coloured coloring colouring colorless colourless comission commission comittee committee commitee committee conceed concede connexion connection curiculum curriculum dec december defense defence dept department develope develop discription description dulness dullness encyclopedia encyclopaedia enroll enrol esthetic aesthetic etiology aetiology exhorbitant exorbitant exhuberant exuberant existance existence favorite favourite feb february fetus foetus ficticious fictitious flavor flavour flourescent fluorescent foriegn foreign fourty forty gage guage geneology genealogy grammer grammar gray grey guerilla guerrilla gynecological gynaecological gynecologist gynaecologist gynecology gynaecology harbor harbour heighth height hemaglobin haemaglobin hematin haematin hematite haematite hematologist haematologist hematology haematology hemophilia haemophilia hemorrhage haemorrhage hemorrhoids haemorrhoids honor honour innoculate inoculate installment instalment irrelevent irrelevant irrevelant irrelevant jan january jeweler jeweller judgement judgment jul july jun june labeled labelled labor labour laborer labourer laborers labourers laboring labouring lib library licence license liesure leisure liquify liquefy maintainance maintenance maintenence maintenance marshal marshall medieval mediaeval medievalism mediaevalism medievalist mediaevalist meg margaret meter metre milage mileage millipede millepede miscelaneous miscellaneous morgage mortgage noticable noticeable nov november occurence occurrence oct october offense offence ommision omission ommission omission organisation organization organise organize organised organized pajamas pyjamas paleography palaeography paleolithic palaeolithic paleontological palaeontological paleontologist palaeontologist paleontology palaeontology paleozoic palaeozoic pamplet pamphlet paralell parallel parl parliament parlt parliament pediatric paediatric pediatrician paediatrician pediatrics paediatrics pedodontia paedodontia pedodontics paedodontics personel personnel practise practice program programme psych psychology qld queensland questionaire questionnaire rarify rarefy reccomend recommend recieve receive resistence resistance restaraunt restaurant savior saviour sep september seperate separate sept september sieze seize summarize summarise summerize summarise superceed supercede superintendant superintendent supersede supercede suprise surprise surprize surprise synchronise synchronize tas tasmania temperary temporary theater theatre threshhold threshold transfered transferred truely truly truley truly useable usable valor valour vic victoria vigor vigour vol volume withold withhold yeild yield htdig-3.2.0b6/installdir/syntax.html0100644006314600127310000000236507426615601016761 0ustar angusgbhtdig Error in Boolean search for '$&(WORDS)'

    ht://Dig Error in Boolean search for '$&(LOGICAL_WORDS)'


    Boolean expressions need to be 'correct' in order for the search system to use them. The expression you entered has errors in it.

    Examples of correct expressions are: cat and dog, cat not dog, cat or (dog not nose).
    Note that the operator not has the meaning of 'without'.

    $(SYNTAXERROR)

    Match: $(METHOD) Format: $(FORMAT) Sort: $(SORT)
    Refine search:

    ht://Dig $(VERSION) htdig-3.2.0b6/installdir/wrapper.html0100644006314600127310000000211307426615601017102 0ustar angusgbhtdig Search results for '$&(WORDS)'

    ht://Dig Search results for '$&(LOGICAL_WORDS)'


    Match: $(METHOD) Format: $(FORMAT) Sort by: $(SORT)
    Refine search:

    Documents $(FIRSTDISPLAYED) - $(LASTDISPLAYED) of $(MATCHES) matches. More *'s indicate a better match.
    $(HTSEARCH_RESULTS) $(PAGEHEADER) $(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
    ht://Dig $(VERSION) htdig-3.2.0b6/libhtdig/0040755006314600127310000000000010063260370014151 5ustar angusgbhtdightdig-3.2.0b6/libhtdig/BasicDocument.cc0100644006314600127310000001725110055635560017213 0ustar angusgbhtdig// // BasicDocument.cc // // 2/6/2002 created for libhtdig to simplify & mimic Document.cc // // Neal Richter nealr@rightnow.com // // // BasicDocument: This class holds everything there is to know about a document. // The actual contents of the document may or may not be present at // all times for memory conservation reasons. // // This is a basic extensable container for plain text holding documents. // // Uses any Parser with parse method handling this class. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: BasicDocument.cc,v 1.3 2004/05/28 13:15:28 lha Exp $ // //-------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #include #include "BasicDocument.h" #include "TextCollector.h" #include "StringList.h" #include "htdig.h" #include "Plaintext.h" #include "HTML.h" #include "ExternalParser.h" #include "lib.h" #include "defaults.h" #if 1 typedef void (*SIGNAL_HANDLER) (...); #else typedef SIG_PF SIGNAL_HANDLER; #endif //***************************************************************************** // BasicDocument::BasicDocument(char *loc) // Initialize with the given loc-parameter as the location for this document. // If the max_size is given, use that for size, otherwise use the // config value. // BasicDocument::BasicDocument(char *loc, int suggested_size) { int temp_size = 0; id = 0; location = 0; title = 0; metacontent = 0; contents = 0; document_length = 0; HtConfiguration *config = HtConfiguration::config(); //We probably need to move assignment of max_doc_size, according //to a configuration value. if (suggested_size > 0) temp_size = suggested_size; else temp_size = config->Value("max_doc_size"); contents.allocate(temp_size + 100); contentType = ""; if (loc) { Location(loc); } } //***************************************************************************** // BasicDocument::~BasicDocument() // BasicDocument::~BasicDocument() { // We delete only the derived class objects #if MEM_DEBUG char *p = new char; cout << "==== BasicDocument deleted: " << this << " new at " << ((void *) p) << endl; delete p; #endif } //***************************************************************************** // void BasicDocument::Reset() // Restore the BasicDocument object to an initial state. // void BasicDocument::Reset() { id = 0; location = 0; title = 0; metacontent = 0; contents = 0; contentType = 0; document_length = 0; } //***************************************************************************** // void BasicDocument::Length() // Return/Calc length of BasicDocument... icummulative size of the Strings // int BasicDocument::Length() { if (document_length < 0) { document_length = 0; document_length += location.length(); document_length += title.length(); document_length += metacontent.length(); document_length += contents.length(); document_length += id.length(); } return (document_length); } //***************************************************************************** // Parsable *BasicDocument::getParsable() // Given the content-type of a document, returns a document parser. // This will first look through the list of user supplied parsers and // then at our (limited) builtin list of parsers. The user supplied // parsers are external programs that will be used. Parsable * BasicDocument::getParsable() { static HTML *html = 0; static Plaintext *plaintext = 0; static ExternalParser *externalParser = 0; Parsable *parsable = 0; if (ExternalParser::canParse(contentType)) { if (externalParser) { delete externalParser; } externalParser = new ExternalParser(contentType); parsable = externalParser; } else if (mystrncasecmp((char *) contentType, "text/html", 9) == 0) { if (!html) html = new HTML(); parsable = html; } else if (mystrncasecmp((char *) contentType, "text/plain", 10) == 0) { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; } else if (mystrncasecmp((char *) contentType, "text/css", 8) == 0) { return NULL; } else if (mystrncasecmp((char *) contentType, "text/", 5) == 0) { if (!plaintext) plaintext = new Plaintext(); parsable = plaintext; if (debug > 1) { cout << '"' << contentType << "\" not a recognized type. Assuming text/plain\n"; } } else { if (debug > 1) { cout << '"' << contentType << "\" not a recognized type. Ignoring\n"; } return NULL; } parsable->setContents(contents.get(), contents.length()); return parsable; } //***************************************************************************** // // Test for self parseaable // int BasicDocument::SelfParseable() { if (mystrncasecmp((char *) contentType, "text/vnd.customdocument", 10) == 0) { return (TRUE); } else return (FALSE); } //***************************************************************************** // Parsable *BasicDocument::internalParser() int BasicDocument::internalParser(TextCollector & textcollector) { HtConfiguration* config= HtConfiguration::config(); char *position = NULL; static int minimumWordLength = config->Value("minimum_word_length", 3); int wordIndex = 1; String word; int letter_count = 0; //First Process Title textcollector.got_title((char *) title); //Next Process Contents position = contents; while (*position) { word = 0; if (HtIsStrictWordChar(*position)) { // // Start of a word. Try to find the whole thing // //TODO NEAL RICHTER Imposed a 50-letter word length limit here // while (*position && HtIsWordChar(*position) && (letter_count < 50)) { word << *position; position++; letter_count++; } letter_count = 0; if (word.length() >= minimumWordLength) { textcollector.got_word((char *) word, wordIndex++, 0); } } if (*position) position++; }//end while textcollector.got_head((char*) contents); //Third, Process MetaContent position = metacontent; textcollector.got_meta_dsc(metacontent); //max_meta_description_length??? while (*position) { word = 0; if (HtIsStrictWordChar(*position)) { // // Start of a word. Try to find the whole thing // while (*position && HtIsWordChar(*position) && (letter_count < 50)) { word << *position; position++; letter_count++; } letter_count = 0; if (word.length() >= minimumWordLength) { textcollector.got_word((char *) word, wordIndex++, 9); } } if (*position) position++; }//end while return(1); } htdig-3.2.0b6/libhtdig/BasicDocument.h0100644006314600127310000000737710055635560017065 0ustar angusgbhtdig//-------------------------------------------------------------------- // // BasicDocument.h // // 2/6/2002 created for libhtdig to simplify & mimic Document.cc // // Neal Richter nealr@rightnow.com // // // BasicDocument: This class holds everything there is to know about a document. // The actual contents of the document may or may not be present at // all times for memory conservation reasons. // // This is a basic extensable container for plain text holding documents. // // Uses any Parser with parse method handling this class. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: BasicDocument.h,v 1.4 2004/05/28 13:15:28 lha Exp $ // //-------------------------------------------------------------------- #ifndef _BasicDocument_h_ #define _BasicDocument_h_ #include "htString.h" #include "Parsable.h" #include "Object.h" #include "StringList.h" #include "HtDateTime.h" class TextCollector; class BasicDocument:public Object { public: // // Construction/Destruction // BasicDocument(char *location = 0, int max_size = 0); ~BasicDocument(); // // Interface to the document. // void Reset(); int Length(); //int StoredLength() {return contents.length();} char *Title() {return title;} void Title(char *t) {title = t; document_length = -1;} void Title(const String & t) {title = t; document_length = -1;} int TitleLength() {return title.length();} char *MetaContent() {return metacontent;} void MetaContent(char *m) {metacontent = m; document_length = -1;} void MetaContent(const String & m) {metacontent = m; document_length = -1;} int MetaContentLength() {return metacontent.length();} char *Contents() {return contents;} void Contents(char *s) {contents = s; document_length = -1;} void Contents(const String & s) {contents = s; document_length = -1;} int ContentsLength() {return contents.length();} char *Location() {return location;} void Location(char *l) {location = l; document_length = -1;} void Location(const String & l) {location = l; document_length = -1;} int LocationLength() {return location.length();} char *DocumentID() {return id;} void DocumentID(char *ida) {id = ida; document_length = -1;} void DocumentID(const String & ida) {id = ida; document_length = -1;} int DocumentIDLength() {return id.length();} char *ContentType() {return contentType;} void ContentType(char *ct) {contentType = ct;} void ContentType(const String & ct) {contentType = ct;} time_t ModTime() {return modtime.GetTime_t();} void ModTime(time_t t) {modtime = t;} // // Return an appropriate parsable object for the document type. // Parsable *getParsable(); int internalParser(TextCollector & textcollector); int SelfParseable(); private: String id; String location; String title; String metacontent; String contents; String contentType; HtDateTime modtime; int document_length; //int max_doc_size; }; #endif htdig-3.2.0b6/libhtdig/Makefile0100644006314600127310000001632707675677401015645 0ustar angusgbhtdig#libhtdig.so makefile for Unix systems LIBHTDIG_BUILD_VER = 3.2.1 #Berkeley DB Specific defines BDB_INC_DIRS = -I../db -I/usr/local/include BDB_DEFS = -DHAVE_CONFIG_H INC_DIRS= -I. -I../htdig -I../include -I../db -I../htlib -I../htnet -I../htcommon -I../htword -I../htfuzzy -I../htsearch -I/usr/local/include #HTDIG_INC_DIR= -I../htdig #define your own defaults here! DEFAULT_CONFIG_FILE=\"/etc/htdig/htdig.conf\" DEFAULT_DB_PATH=\"/etc/htdig/\" BIN_DIR=\"/usr/local/bin\" COMMON_DIR=\"/usr/local/share/htdig\" CONFIG_DIR=\"/etc/htdig\" DATABASE_DIR=\"/var/lib/htdig\" IMAGE_URL_PREFIX=\"/htdig\" DEFS= -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=$(DEFAULT_CONFIG_FILE) -DBIN_DIR=$(BIN_DIR) -DCOMMON_DIR=$(COMMON_DIR) DEFS+= -DCONFIG_DIR=$(CONFIG_DIR) -DDATABASE_DIR=$(DATABASE_DIR) -DIMAGE_URL_PREFIX=$(IMAGE_URL_PREFIX) #LEX define based on your system LEX = flex AM_LFLAGS = -L LEX_OUTPUT_ROOT = lex.yy #YACC define based on your system YACC = bison -y AM_YFLAGS = -l -d YACC_OUTPUT_ROOT = y.tab ifdef INSURE CC=insure gcc CXX=insure g++ else CC=gcc CXX=g++ endif #OPTIMZ=-O2 OPTIMZ=-O0 #OPTS=$(OPTIMZ) -Wall -fno-rtti -fno-exceptions -Werror OPTS=$(OPTIMZ) -Wall -fno-rtti -fno-exceptions -fPIC DBG= -g $(PROFILING) ifdef FULLDEBUG DBG+= -DDEBUG -DDEBUG_CMPR $(INC_DIRS) endif ifdef DEBUG DBG+= -DDEBUG endif ifdef EXPKEY OPTS += -DEXPKEY endif LIB_DIRS= #use '-G' with Solaris LFLAGS = -lc -lstdc++ #LFLAGS = -lc -lstdc++ -G LIBZ = -lz #use this if you've built an -fPIC version of libz.a to link into the libhtdig.so #LIBZ = -lz-fpic #berkeley db c files BDB_C_OBJS += bt_compare.o bt_conv.o bt_curadj.o bt_cursor.o bt_delete.o bt_method.o bt_open.o bt_put.o bt_rec.o bt_reclaim.o bt_recno.o bt_rsearch.o bt_search.o bt_split.o bt_stat.o bt_upgrade.o btree_auto.o crdel_auto.o crdel_rec.o db.o db_am.o db_auto.o db_byteorder.o db_conv.o db_dispatch.o db_dup.o db_err.o db_getlong.o db_iface.o db_join.o db_log2.o db_meta.o db_method.o db_overflow.o db_pr.o db_rec.o db_reclaim.o db_ret.o db_salloc.o db_shash.o db_upgrade.o env_method.o env_open.o env_recover.o env_region.o hash.o hash_auto.o hash_conv.o hash_dup.o hash_func.o hash_meta.o hash_method.o hash_page.o hash_rec.o hash_reclaim.o hash_stat.o hash_upgrade.o lock.o lock_conflict.o lock_deadlock.o lock_region.o lock_util.o log.o log_archive.o log_auto.o log_compare.o log_findckp.o log_get.o log_method.o log_put.o log_rec.o log_register.o mp_alloc.o mp_bh.o mp_cmpr.o mp_fget.o mp_fopen.o mp_fput.o mp_fset.o mp_method.o mp_region.o mp_register.o mp_stat.o mp_sync.o mp_trickle.o mut_fcntl.o mut_pthread.o mut_tas.o mutex.o os_abs.o os_alloc.o os_dir.o os_errno.o os_fid.o os_finit.o os_fsync.o os_handle.o os_map.o os_method.o os_oflags.o os_open.o os_region.o os_rename.o os_root.o os_rpath.o os_rw.o os_seek.o os_sleep.o os_spin.o os_stat.o os_tmpdir.o os_unlink.o qam.o qam_auto.o qam_conv.o qam_method.o qam_open.o qam_rec.o qam_stat.o txn.o txn_auto.o txn_rec.o txn_region.o xa.o xa_db.o xa_map.o #htlib c files $(REGEX) HTLIB_C_OBJS += getcwd.o mhash_md5.o regex.o vsnprintf.o memcmp.o mktime.o snprintf.o memcpy.o myqsort.o strerror.o memmove.o raise.o timegm.o #htlib c++ files HTLIB_CXX_OBJS += Configuration.o Database.o Dictionary.o DB2_db.o IntObject.o List.o Object.o ParsedString.o Queue.o QuotedStringList.o Stack.o String.o StringList.o StringMatch.o String_fmt.o good_strtok.o strcasecmp.o strptime.o HtCodec.o HtWordCodec.o HtVector.o HtHeap.o HtPack.o HtDateTime.o HtRegex.o HtRegexList.o HtRegexReplace.o HtRegexReplaceList.o HtVectorGeneric.o HtMaxMin.o HtWordType.o md5.o #htword c++ files HTWORD_CXX_OBJS += WordBitCompress.o WordContext.o WordCursor.o WordDB.o WordDBCompress.o WordDBInfo.o WordDBPage.o WordKey.o WordKeyInfo.o WordList.o WordMonitor.o WordRecord.o WordRecordInfo.o WordReference.o WordStat.o WordType.o #htcommon c++ files HTCOMMON_CXX_OBJS += DocumentDB.o DocumentRef.o HtWordReference.o HtWordList.o defaults.o HtURLCodec.o URL.o URLTrans.o HtZlibCodec.o cgi.o HtSGMLCodec.o HtConfiguration.o HtURLRewriter.o #htnet c++ files HTNET_CXX_OBJS += Connection.o Transport.o HtHTTP.o HtFile.o HtNNTP.o HtCookie.o HtCookieJar.o HtCookieMemJar.o HtHTTPBasic.o HtHTTPSecure.o SSLConnection.o HtFTP.o HtCookieInFileJar.o #htdig c++ files HTDIG_CXX_OBJS += Document.o ExternalTransport.o Parsable.o Retriever.o URLRef.o ExternalParser.o HTML.o Plaintext.o Server.o #htfuzzy c++ files HTFUZZY_CXX_OBJS += Accents.o EndingsDB.o Fuzzy.o Prefix.o Soundex.o Substring.o Synonym.o Endings.o Exact.o Metaphone.o Regexp.o Speling.o SuffixEntry.o filecopy.o #HTFUZZY_C_OBJS += filecopy.o #htsearch c++ files HTSEARCH_CXX_OBJS += Collection.o DocMatch.o ResultList.o SplitMatches.o TemplateList.o Display.o HtURLSeedScore.o ResultMatch.o Template.o WeightWord.o parser.o #libhtdig c++ files LIBHTDIG_CXX_OBJS += ResultFetch.o BasicDocument.o TextCollector.o libhtdig_htdig.o libhtdig_htmerge.o libhtdig_htfuzzy.o libhtdig_log.o libhtdig_htsearch.o #htcommon lex & yacc targets LIBHTDIG_CXX_OBJS += conf_lexer.o conf_parser.o #libhtdig c files #LIBHTDIG_C_OBJS += filecopy.o LXX_TARGETS += conf_lexer.cc YXX_TARGETS += conf_parser.cc OBJS += $(BDB_C_OBJS) $(HTLIB_C_OBJS) $(HTLIB_CXX_OBJS) $(HTWORD_CXX_OBJS) OBJS += $(HTCOMMON_CXX_OBJS) $(HTNET_CXX_OBJS) $(HTDIG_CXX_OBJS) OBJS += $(HTFUZZY_CXX_OBJS) $(HTFUZZY_C_OBJS) $(HTSEARCH_CXX_OBJS) $(LIBHTDIG_CXX_OBJS) $(LIBHTDIG_C_OBJS) libhtdig-3.2.0.so: $(OBJS) $(LXX_TARGETS) $(YXX_TARGETS) $(CC) -shared $(LIB_DIRS) $(OTHER_OBJS) $(OBJS) -L/usr/local/lib $(LIBZ) $(LFLAGS) -Xlinker -h -Xlinker libhtdig.so.$(LIBHTDIG_BUILD_VER) -o libhtdig.so.$(LIBHTDIG_BUILD_VER) libhtdig.a: $(OBJS) $(LXX_TARGETS) $(YXX_TARGETS) ar cru libhtdig.a $(OTHER_OBJS) $(OBJS) ranlib libhtdig.a $(BDB_C_OBJS): %.o: ../db/%.c $(CC) $(BDB_INC_DIRS) $(BDB_DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTLIB_C_OBJS): %.o: ../htlib/%.c $(CC) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTLIB_CXX_OBJS): %.o: ../htlib/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTWORD_CXX_OBJS): %.o: ../htword/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTCOMMON_CXX_OBJS): %.o: ../htcommon/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTNET_CXX_OBJS): %.o: ../htnet/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTDIG_CXX_OBJS): %.o: ../htdig/%.cc $(CXX) $(HTDIG_INC_DIR) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTFUZZY_C_OBJS): %.o: ../htfuzzy/%.c $(CC) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTFUZZY_CXX_OBJS): %.o: ../htfuzzy/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(HTSEARCH_CXX_OBJS): %.o: ../htsearch/%.cc $(CXX) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(LIBHTDIG_CXX_OBJS): %.o: %.cc $(CXX) $(HTDIG_INC_DIR) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(LIBHTDIG_C_OBJS): %.o: %.c $(CC) $(HTDIG_INC_DIR) $(INC_DIRS) $(DEFS) $(OPTS) $(DBG) -c $< -o $@ $(LXX_TARGETS): %.cc: ../htcommon/%.lxx $(LEX) $(AM_LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ #$(LEX) $(AM_LFLAGS) $(LFLAGS) -o$@ $< $(YXX_TARGETS): %.cc: ../htcommon/%.yxx $(YACC) $(AM_YFLAGS) $< && mv $(YACC_OUTPUT_ROOT).c $@ if test -f y.tab.h; then if cmp -s y.tab.h conf_parser.h; then rm -f y.tab.h; else mv y.tab.h conf_parser.h; fi; else :; fi clean: rm -f *.o *~ *.bak *.lo *.a* *.so* core $(LXX_TARGETS) $(YXX_TARGETS) htdig-3.2.0b6/libhtdig/Makefile.win320100644006314600127310000001672107675643756016612 0ustar angusgbhtdig# # Makefile - makefile for libhtdig # PRODUCT = htdig TARGET = $(LIBDIR)/libhtdig$(DLLSFX) include ../Makedefs.win32 ARCH = win32 #MV = move MV = mv #define your own defaults here! DEFAULT_CONFIG_FILE=\"/etc/htdig/htdig.conf\" DEFAULT_DB_PATH=\"/etc/htdig/\" BIN_DIR=\"/usr/local/bin\" COMMON_DIR=\"/usr/local/share/htdig\" CONFIG_DIR=\"/etc/htdig\" DATABASE_DIR=\"/var/lib/htdig\" IMAGE_URL_PREFIX=\"/htdig\" DEFS= -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=$(DEFAULT_CONFIG_FILE) -DBIN_DIR=$(BIN_DIR) -DCOMMON_DIR=$(COMMON_DIR) DEFS+= -DCONFIG_DIR=$(CONFIG_DIR) -DDATABASE_DIR=$(DATABASE_DIR) -DIMAGE_URL_PREFIX=$(IMAGE_URL_PREFIX) #LEX define based on your system LEX = flex AM_LFLAGS = -L LEX_OUTPUT_ROOT = lex.yy #YACC define based on your system YACC = bison -y AM_YFLAGS = -l -d YACC_OUTPUT_ROOT = y.tab # ----------------------------------------------------------------------------- # add new library members to this list #berkeley db c files BDB_C_OBJS += bt_compare.obj bt_conv.obj bt_curadj.obj bt_cursor.obj bt_delete.obj bt_method.obj bt_open.obj bt_put.obj bt_rec.obj bt_reclaim.obj bt_recno.obj bt_rsearch.obj bt_search.obj bt_split.obj bt_stat.obj bt_upgrade.obj btree_auto.obj crdel_auto.obj crdel_rec.obj db.obj db_am.obj db_auto.obj db_byteorder.obj db_conv.obj db_dispatch.obj db_dup.obj db_err.obj db_getlong.obj db_iface.obj db_join.obj db_log2.obj db_meta.obj db_method.obj db_overflow.obj db_pr.obj db_rec.obj db_reclaim.obj db_ret.obj db_salloc.obj db_shash.obj db_upgrade.obj env_method.obj env_open.obj env_recover.obj env_region.obj hash.obj hash_auto.obj hash_conv.obj hash_dup.obj hash_func.obj hash_meta.obj hash_method.obj hash_page.obj hash_rec.obj hash_reclaim.obj hash_stat.obj hash_upgrade.obj lock.obj lock_conflict.obj lock_deadlock.obj lock_region.obj lock_util.obj log.obj log_archive.obj log_auto.obj log_compare.obj log_findckp.obj log_get.obj log_method.obj log_put.obj log_rec.obj log_register.obj mp_alloc.obj mp_bh.obj mp_cmpr.obj mp_fget.obj mp_fopen.obj mp_fput.obj mp_fset.obj mp_method.obj mp_region.obj mp_register.obj mp_stat.obj mp_sync.obj mp_trickle.obj mut_fcntl.obj mut_pthread.obj mut_tas.obj mutex.obj os_abs.obj os_alloc.obj os_dir.obj os_errno.obj os_fid.obj os_finit.obj os_fsync.obj os_handle.obj os_map.obj os_method.obj os_oflags.obj os_open.obj os_region.obj os_rename.obj os_root.obj os_rpath.obj os_rw.obj os_seek.obj os_sleep.obj os_spin.obj os_stat.obj os_tmpdir.obj os_unlink.obj qam.obj qam_auto.obj qam_conv.obj qam_method.obj qam_open.obj qam_rec.obj qam_stat.obj txn.obj txn_auto.obj txn_rec.obj txn_region.obj xa.obj xa_db.obj xa_map.obj ifdef WINDIR BDB_C_OBJS += dirent_local.obj endif #htlib c files $(REGEX) HTLIB_C_OBJS += getcwd.obj mhash_md5.obj regex.obj vsnprintf.obj memcmp.obj mktime.obj snprintf.obj memcpy.obj myqsort.obj strerror.obj memmove.obj raise.obj timegm.obj #htlib c++ files HTLIB_CXX_OBJS += Configuration.obj Database.obj Dictionary.obj DB2_db.obj IntObject.obj List.obj Object.obj ParsedString.obj Queue.obj QuotedStringList.obj Stack.obj String.obj StringList.obj StringMatch.obj String_fmt.obj good_strtok.obj strcasecmp.obj strptime.obj HtCodec.obj HtWordCodec.obj HtVector.obj HtHeap.obj HtPack.obj HtDateTime.obj HtRegex.obj HtRegexList.obj HtRegexReplace.obj HtRegexReplaceList.obj HtVectorGeneric.obj HtMaxMin.obj HtWordType.obj md5.obj filecopy.obj #htword c++ files HTWORD_CXX_OBJS += WordBitCompress.obj WordContext.obj WordCursor.obj WordDB.obj WordDBCompress.obj WordDBInfo.obj WordDBPage.obj WordKey.obj WordKeyInfo.obj WordList.obj WordMonitor.obj WordRecord.obj WordRecordInfo.obj WordReference.obj WordStat.obj WordType.obj #htcommon c++ files HTCOMMON_CXX_OBJS += DocumentDB.obj DocumentRef.obj HtWordReference.obj HtWordList.obj defaults.obj HtURLCodec.obj URL.obj URLTrans.obj HtZlibCodec.obj cgi.obj HtSGMLCodec.obj HtConfiguration.obj HtURLRewriter.obj #htnet c++ files HTNET_CXX_OBJS += Connection.obj Transport.obj HtHTTP.obj HtFile.obj HtNNTP.obj HtCookie.obj HtCookieJar.obj HtCookieMemJar.obj HtHTTPBasic.obj HtHTTPSecure.obj SSLConnection.obj HtFTP.obj HtCookieInFileJar.obj #htdig c++ files HTDIG_CXX_OBJS += Document.obj ExternalTransport.obj Parsable.obj Retriever.obj URLRef.obj ExternalParser.obj HTML.obj Plaintext.obj Server.obj #htfuzzy c++ files HTFUZZY_CXX_OBJS += Accents.obj EndingsDB.obj Fuzzy.obj Prefix.obj Soundex.obj Substring.obj Synonym.obj Endings.obj Exact.obj Metaphone.obj Regexp.obj Speling.obj SuffixEntry.obj #HTFUZZY_C_OBJS += filecopy.o #htsearch c++ files HTSEARCH_CXX_OBJS += Collection.obj DocMatch.obj ResultList.obj SplitMatches.obj TemplateList.obj Display.obj HtURLSeedScore.obj ResultMatch.obj Template.obj WeightWord.obj parser.obj #libhtdig c++ files LIBHTDIG_CXX_OBJS += ResultFetch.obj BasicDocument.obj TextCollector.obj libhtdig_htdig.obj libhtdig_htmerge.obj libhtdig_htfuzzy.obj libhtdig_log.obj libhtdig_htsearch.obj #htcommon lex & yacc targets LIBHTDIG_CXX_OBJS += conf_lexer.obj conf_parser.obj #libhtdig c files #LIBHTDIG_C_OBJS += filecopy.o LXX_TARGETS += conf_lexer.cc YXX_TARGETS += conf_parser.cc OBJS += $(BDB_C_OBJS) $(HTLIB_C_OBJS) $(HTLIB_CXX_OBJS) $(HTWORD_CXX_OBJS) OBJS += $(HTCOMMON_CXX_OBJS) $(HTNET_CXX_OBJS) $(HTDIG_CXX_OBJS) OBJS += $(HTFUZZY_CXX_OBJS) $(HTFUZZY_C_OBJS) $(HTSEARCH_CXX_OBJS) $(LIBHTDIG_CXX_OBJS) $(LIBHTDIG_C_OBJS) OTHERLIBS = L:/win32/lib/zlib114/zlib.lib ws2_32.lib # ----------------------------------------------------------------------------- CMNDLLS = CPPFLAGS += -DHAVE_CONFIG_H -I. -I../include -I../htlib -I../htcommon -I../htword \ -I../db -I../htnet -I../htsearch -I../htdig -I../htfuzzy CFLAGS += $(CPPFLAGS) #ifeq ($(ARCH),win32) CFLAGS += -DDYNAMIC_LIBUTIL CPPFLAGS += -DDYNAMIC_LIBUTIL -DYY_NEVER_INTERACTIVE #endif ifeq ($(ARCH),linux) LDFLAGS += -Xlinker -Bsymbolic endif # ----------------------------------------------------------------------------- #win32/%.obj: %.cc %.c # $(CC) $(CPPFLAGS) -c $< -o $@ #$(CC) $(CPPFLAGS) $(OPTS) $(DBG) -c $< /Fo$@ $(BDB_C_OBJS): %.obj: ../db/%.c $(CC) $(CFLAGS) $(OPTS) $(DBG) /TC -c $< $(HTLIB_C_OBJS): %.obj: ../htlib/%.c $(CC) $(CFLAGS) $(OPTS) $(DBG) /TC -c $< $(HTLIB_CXX_OBJS): %.obj: ../htlib/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTWORD_CXX_OBJS): %.obj: ../htword/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTCOMMON_CXX_OBJS): %.obj: ../htcommon/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTNET_CXX_OBJS): %.obj: ../htnet/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTDIG_CXX_OBJS): %.obj: ../htdig/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTFUZZY_C_OBJS): %.obj: ../htfuzzy/%.c $(CC) $(CFLAGS) $(OPTS) $(DBG) /TC -c $< $(HTFUZZY_CXX_OBJS): %.obj: ../htfuzzy/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(HTSEARCH_CXX_OBJS): %.obj: ../htsearch/%.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(LIBHTDIG_CXX_OBJS): %.obj: %.cc $(CC) $(CFLAGS) $(OPTS) $(DBG) /TP -c $< $(LIBHTDIG_C_OBJS): %.obj: %.c $(CC) $(CFLAGS) $(OPTS) $(DBG) /TC -c $< $(LXX_TARGETS): %.cc: ../htcommon/%.lxx $(LEX) $(AM_LFLAGS) $< && cat $(LEX_OUTPUT_ROOT).c | sed -e 's/#include //g' > $@ #$(LEX) $(AM_LFLAGS) $(LFLAGS) -o$@ $< $(YXX_TARGETS): %.cc: ../htcommon/%.yxx $(YACC) $(AM_YFLAGS) $< && $(MV) $(YACC_OUTPUT_ROOT).c $@ if test -f y.tab.h; then if cmp -s y.tab.h conf_parser.h; then rm -f y.tab.h; else mv y.tab.h conf_parser.h; fi; else :; fi $(TARGET): $(OBJDIRDEP) $(LIBDIRDEP) $(OBJS) $(RM) $(basename $(TARGET))* $(DLLLD) $(LDFLAGS) $(OBJS) $(LDLIBS) $(DBLIBS) $(OTHERLIBS) $(DLL_SYMLINK_CMD) include ../Makerules.win32 htdig-3.2.0b6/libhtdig/README0100644006314600127310000000151307644667253015054 0ustar angusgbhtdigNeal Richter 10/6/2002 How to use this: -------------------------- Building htdig: unzip the tarball cd inside of the tarball root directory ./configure' with any parameters needed --------------------------- Building libhtdig: cd libhtdig make -------------------------- Building libhtdigphp: cd libhtdigphp ./configure make ./relink Note: The relink script uses the PHP wrapper objects as well as all the object in libhtdig to create a one-piece sharded library --------------------------- note that the libhtdig_xxxx.cc take the place of the various utilities 'main' functions. Please look through them and compare to see if changes need to be synced in. --------------------------- This should make you a libhtdig.so.XXXX Copy the latest libhtdig_api.h to a place that you might need it. link against libhtdig.so.XXXXX htdig-3.2.0b6/libhtdig/ResultFetch.cc0100644006314600127310000015172110055635560016724 0ustar angusgbhtdig//-------------------------------------------------------------------- // // ResultFetch.cc // // 2/6/2002 created for libhtdig // // Neal Richter nealr@rightnow.com // // ResultFetch: Takes results of search and fills in the HTML templates // // FOR USE IN LIBHTDIG... does NOT stream to stdout!! // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: ResultFetch.cc,v 1.5 2004/05/28 13:15:28 lha Exp $ // //-------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "htsearch.h" #include "ResultFetch.h" #include "ResultMatch.h" #include "WeightWord.h" #include "StringMatch.h" #include "StringList.h" #include "QuotedStringList.h" #include "URL.h" #include "HtSGMLCodec.h" #include "HtURLCodec.h" #include "WordType.h" #include "Collection.h" #include "HtURLSeedScore.h" #include "SplitMatches.h" #include "HtConfiguration.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include #include #ifndef _WIN32 #include #endif #include #include #include #if !defined(DBL_MAX) && defined(MAXFLOAT) # define DBL_MAX MAXFLOAT #endif //***************************************************************************** // ResultFetch::ResultFetch(Dictionary *collections, const StringList& templist) //ResultFetch::ResultFetch(Dictionary * collections) { HtConfiguration *config = HtConfiguration::config(); selected_collections = collections; //collectionList = &templist; limitTo = 0; excludeFrom = 0; // needExcerpt = 0; templateError = 0; maxStars = config->Value("max_stars"); maxScore = -DBL_MAX; minScore = DBL_MAX; setupImages(); setupTemplates(); if (!templates.createFromString(config->Find("template_map"))) { // Error in createFromString. // Let's try the default template_map config->Add("template_map", "Long builtin-long builtin-long Short builtin-short builtin-short"); if (!templates.createFromString(config->Find("template_map"))) { // Unrecoverable Error // (No idea why this would happen) templateError = 1; } } currentTemplate = templates.get(config->Find("template_name")); if (!currentTemplate) { // // Must have been some error. Resort to the builtin-long (slot 0) // currentTemplate = (Template *) templates.templates[0]; } if (!currentTemplate) { // // Another error!? Time to bail out... // templateError = 1; } // if (mystrcasestr(currentTemplate->getMatchTemplate(), "excerpt")) // needExcerpt = 1; } //***************************************************************************** ResultFetch::~ResultFetch() { // docDB.Close(); } //***************************************************************************** // //void List * ResultFetch::fetch() { int pageNumber = 1; HtConfiguration *config = HtConfiguration::config(); int good_sort = 0; good_sort = ResultMatch::setSortType(config->Find("sort")); if (!good_sort) { // Must temporarily stash the message in a String, since // displaySyntaxError will overwrite the static temp used in form. String s(form("No such sort method: `%s'", (const char *) config->Find("sort"))); displaySyntaxError(s); //return; return(NULL); } List *matches = buildMatchList(); //int currentMatch = 0; //int numberDisplayed = 0; ResultMatch *match = 0; int number = 0; number = config->Value("matches_per_page"); if (number <= 0) number = 10; //int startAt = (pageNumber - 1) * number; if (config->Boolean("logging")) { logSearch(pageNumber, matches); } setVariables(pageNumber, matches); // // The first match is guaranteed to have the highest score of // all the matches. We use this to compute the number of stars // to display for all the other matches. // match = (ResultMatch *) (*matches)[0]; if (!match) { // // No matches. // delete matches; if (config->Boolean("nph")) { //cout << "HTTP/1.0 200 OK\r\n"; } //cout << "Content-type: text/html\r\n\r\n"; //displayNomatch(); //return; return(NULL); } // maxScore = match->getScore(); // now done in buildMatchList() if (config->Boolean("nph")) { //cout << "HTTP/1.0 200 OK\r\n"; } //cout << "Content-type: text/html\r\n\r\n"; String wrap_file = config->Find("search_results_wrapper"); String *wrapper = 0; char *header = 0, *footer = 0; if (wrap_file.length()) { wrapper = readFile(wrap_file.get()); if (wrapper && wrapper->length()) { char wrap_sepr[] = "HTSEARCH_RESULTS"; char *h = wrapper->get(); char *p = strstr(h, wrap_sepr); if (p) { if (p > h && p[-1] == '$') { footer = p + strlen(wrap_sepr); header = h; p[-1] = '\0'; } else if (p > h + 1 && p[-2] == '$' && (p[-1] == '(' || p[-1] == '{') && (p[strlen(wrap_sepr)] == ')' || p[strlen(wrap_sepr)] == '}')) { footer = p + strlen(wrap_sepr) + 1; header = h; p[-2] = '\0'; } } } } if (header) { //expandVariables(header); } else { //displayHeader(); } //neal return(matches); /* // // Display the window of matches requested. // if (!currentTemplate->getStartTemplate().empty()) { expandVariables(currentTemplate->getStartTemplate()); } matches->Start_Get(); while ((match = (ResultMatch *) matches->Get_Next()) && numberDisplayed < number) { if (currentMatch >= startAt) { // DocumentRef *ref = docDB[match->getID()]; Collection *collection = match->getCollection(); DocumentRef *ref = collection->getDocumentRef(match->getID()); if (!ref || ref->DocState() != Reference_normal) continue; // The document isn't present or shouldn't be displayed ref->DocAnchor(match->getAnchor()); ref->DocScore(match->getScore()); fetchMatch(match, ref, currentMatch + 1); numberDisplayed++; delete ref; } currentMatch++; } if (!currentTemplate->getEndTemplate().empty()) { expandVariables(currentTemplate->getEndTemplate()); } if (footer) { //expandVariables(footer); } else { //displayFooter(); } if (wrapper) delete wrapper; delete matches; */ } //***************************************************************************** // Return true if the specified URL should be counted towards the results. int ResultFetch::includeURL(const String & url) { if (limitTo && limitTo->match(url, 1, 0) == 0) return 0; else { if (excludeFrom && excludeFrom->match(url, 0, 0) != 0) return 0; else return 1; } } //***************************************************************************** //void Dictionary * ResultFetch::fetchMatch(ResultMatch * match, DocumentRef * ref, int current) { HtConfiguration *config = HtConfiguration::config(); String *str = 0; char *url = NULL; url = form("%s", ref->DocURL()); vars.Add("URL", new String(url)); int iA = ref->DocAnchor(); String *anchor = 0; int fanchor = 0; if (iA > 0) // if an anchor was found { List *anchors = ref->DocAnchors(); if (anchors->Count() >= iA) { anchor = new String(); fanchor = 1; *anchor << "#" << ((String *) (*anchors)[iA - 1])->get(); vars.Add("ANCHOR", anchor); } } // // no condition for determining excerpt any more: // we need it anyway to see if an anchor is relevant // int first = -1; String urlanchor(url); if (anchor) urlanchor << anchor; vars.Add("EXCERPT", excerpt(match, ref, urlanchor, fanchor, first)); // // anchor only relevant if an excerpt was found, i.e., // the search expression matches the body of the document // instead of only META keywords. // if (first < 0) { vars.Remove("ANCHOR"); } vars.Add("METADESCRIPTION", new String(ref->DocMetaDsc())); vars.Add("SCORE", new String(form("%f", ref->DocScore()))); vars.Add("CURRENT", new String(form("%d", current))); char *title = ref->DocTitle(); if (!title || !*title) { if (strcmp(config->Find("no_title_text"), "filename") == 0) { // use actual file name title = strrchr(url, '/'); if (title) { title++; // Skip slash str = new String(form("[%s]", title)); } else // URL without '/' ?? str = new String("[No title]"); } else // use configure 'no title' text str = new String(config->Find("no_title_text")); } else str = new String(title); vars.Add("TITLE", str); vars.Add("STARSRIGHT", generateStars(ref, 1)); vars.Add("STARSLEFT", generateStars(ref, 0)); vars.Add("SIZE", new String(form("%d", ref->DocSize()))); vars.Add("SIZEK", new String(form("%d", (ref->DocSize() + 1023) / 1024))); if (maxScore != 0 && maxScore != minScore) { int percent = (int) ((ref->DocScore() - minScore) * 100 / (maxScore - minScore)); if (percent <= 0) percent = 1; vars.Add("PERCENT", new String(form("%d", percent))); } else vars.Add("PERCENT", new String("100")); { str = new String(); char buffer[100]; time_t t = ref->DocTime(); if (t) { struct tm *tm = localtime(&t); String datefmt = config->Find("date_format"); const String locale = config->Find("locale"); if (datefmt.empty()) { if (config->Boolean("iso_8601")) datefmt = "%Y-%m-%d %H:%M:%S %Z"; else datefmt = "%x"; } if (!locale.empty()) { setlocale(LC_TIME, locale); } strftime(buffer, sizeof(buffer), (char *) datefmt, tm); *str << buffer; } vars.Add("MODIFIED", str); } vars.Add("HOPCOUNT", new String(form("%d", ref->DocHopCount()))); vars.Add("DOCID", new String(form("%d", ref->DocID()))); vars.Add("BACKLINKS", new String(form("%d", ref->DocBackLinks()))); { str = new String(); List *list = ref->Descriptions(); int n = list->Count(); for (int i = 0; i < n; i++) { *str << ((String *) (*list)[i])->get() << "
    \n"; } vars.Add("DESCRIPTIONS", str); String *description = new String(); if (list->Count()) *description << ((String *) (*list)[0]); vars.Add("DESCRIPTION", description); } int index = 0; int length = 0; int status = -1; if (URLtemplate.hasPattern()) status = URLtemplate.FindFirst(ref->DocURL(), index, length); /* if (status >= 0 && index >= 0) displayParsedFile(((String *) URLtemplateList[index])->get()); else expandVariables(currentTemplate->getMatchTemplate()); int vars_count = vars.Count(); vars.Start_Get(); String key; String * value; for(int i = 0; i < vars_count; i++) { key = vars.Get_Next(); value = (String *) vars[key]; cout << key.get() << "[" << value->get() << "]" << endl; cout.flush(); } */ return(&vars); } //***************************************************************************** void ResultFetch::setVariables(int pageNumber, List * matches) { HtConfiguration *config = HtConfiguration::config(); String tmp; int i; int nMatches = 0; if (matches) nMatches = matches->Count(); int matchesPerPage = config->Value("matches_per_page"); if (matchesPerPage <= 0) matchesPerPage = 10; int nPages = (nMatches + matchesPerPage - 1) / matchesPerPage; if (nPages > config->Value("maximum_pages", 10)) nPages = config->Value("maximum_pages", 10); if (nPages < 1) nPages = 1; // We always have at least one page... vars.Add("MATCHES_PER_PAGE", new String(config->Find("matches_per_page"))); vars.Add("MAX_STARS", new String(config->Find("max_stars"))); vars.Add("CONFIG", new String(config->Find("config"))); vars.Add("VERSION", new String(config->Find("version"))); vars.Add("RESTRICT", new String(config->Find("restrict"))); vars.Add("EXCLUDE", new String(config->Find("exclude"))); vars.Add("KEYWORDS", new String(config->Find("keywords"))); if (mystrcasecmp(config->Find("match_method"), "and") == 0) vars.Add("MATCH_MESSAGE", new String("all")); else if (mystrcasecmp(config->Find("match_method"), "or") == 0) vars.Add("MATCH_MESSAGE", new String("some")); vars.Add("MATCHES", new String(form("%d", nMatches))); vars.Add("PLURAL_MATCHES", new String((nMatches == 1) ? (char *) "" : (const char *) config->Find("plural_suffix"))); vars.Add("PAGE", new String(form("%d", pageNumber))); vars.Add("PAGES", new String(form("%d", nPages))); vars.Add("FIRSTDISPLAYED", new String(form("%d", (pageNumber - 1) * matchesPerPage + 1))); if (nPages > 1) vars.Add("PAGEHEADER", new String(config->Find("page_list_header"))); else vars.Add("PAGEHEADER", new String(config->Find("no_page_list_header"))); i = pageNumber * matchesPerPage; if (i > nMatches) i = nMatches; vars.Add("LASTDISPLAYED", new String(form("%d", i))); if (config->Find("script_name").length() != 0) { vars.Add("CGI", new String(config->Find("script_name"))); } else { vars.Add("CGI", new String(getenv("SCRIPT_NAME"))); } vars.Add("STARTYEAR", new String(config->Find("startyear"))); vars.Add("STARTMONTH", new String(config->Find("startmonth"))); vars.Add("STARTDAY", new String(config->Find("startday"))); vars.Add("ENDYEAR", new String(config->Find("endyear"))); vars.Add("ENDMONTH", new String(config->Find("endmonth"))); vars.Add("ENDDAY", new String(config->Find("endday"))); String *str; //char *format = input->get("format"); char *format = "builtin-long"; String *in; vars.Add("SELECTED_FORMAT", new String(format)); str = new String(); *str << "\n"; vars.Add("FORMAT", str); str = new String(); QuotedStringList ml(config->Find("method_names"), " \t\r\n"); *str << "\n"; vars.Add("METHOD", str); vars.Add("SELECTED_METHOD", new String(config->Find("match_method"))); ////////////////// Multiple database support ////////////////////// // Emit collection table. Ensure that previously selected collections // are "checked". // Collections are specified in the config file with the // "collection_names" attribute. An example of the corresponding snippet // in the config file is as follows: // // collection_names: htdig_docs htdig_bugs // // htdig_bugs and htdig_docs are the two collections (databases) and // their corresponding config files are: $CONFIG_DIR/htdig_bugs.conf and // $CONFIG_DIR/htdig_docs.conf respectively. // QuotedStringList clist(config->Find("collection_names"), " \t\r\n"); for (i = 0; i < clist.Count(); i++) { String config_name = clist[i]; for (int j = 0; j < collectionList.Count(); j++) { if (strcmp(config_name.get(), collectionList[j]) == 0) { str = new String(); *str << "checked"; String collection_id = "COLLECTION_"; collection_id << config_name; vars.Add(collection_id, str); break; } } } ////////////////// Multiple database support ////////////////////// str = new String(); QuotedStringList sl(config->Find("sort_names"), " \t\r\n"); const String st = config->Find("sort"); StringMatch datetime; datetime.IgnoreCase(); datetime.Pattern("date|time"); *str << "\n"; vars.Add("SORT", str); vars.Add("SELECTED_SORT", new String(st)); // // If a paged output is required, set the appropriate variables // if (nPages > 1) { if (pageNumber > 1) { str = new String("" << config->Find("prev_page_text") << ""; } else { str = new String(config->Find("no_prev_page_text")); } vars.Add("PREVPAGE", str); if (pageNumber < nPages) { str = new String("" << config->Find("next_page_text") << ""; } else { str = new String(config->Find("no_next_page_text")); } vars.Add("NEXTPAGE", str); str = new String(); char *p; QuotedStringList pnt(config->Find("page_number_text"), " \t\r\n"); QuotedStringList npnt(config->Find("no_page_number_text"), " \t\r\n"); QuotedStringList sep(config->Find("page_number_separator"), " \t\r\n"); if (nPages > config->Value("maximum_page_buttons", 10)) nPages = config->Value("maximum_page_buttons", 10); for (i = 1; i <= nPages; i++) { if (i == pageNumber) { p = npnt[i - 1]; if (!p) p = form("%d", i); *str << p; } else { p = pnt[i - 1]; if (!p) p = form("%d", i); *str << "" << p << ""; } if (i != nPages && sep.Count() > 0) *str << sep[(i - 1) % sep.Count()]; else if (i != nPages && sep.Count() <= 0) *str << " "; } vars.Add("PAGELIST", str); } StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); String *key; for (i = 0; i < form_vars.Count(); i++) { if (!config->Find(form_vars[i]).empty()) { key = new String(form_vars[i]); key->uppercase(); vars.Add(key->get(), new String(config->Find(form_vars[i]))); } } } //***************************************************************************** void ResultFetch::createURL(String & url, int pageNumber) { HtConfiguration *config = HtConfiguration::config(); String s; int i; //#define encodeInput(name) (s = input->get(name), encodeURL(s), s.get()) if (!config->Find("script_name").empty()) { url << config->Find("script_name"); } else { url << getenv("SCRIPT_NAME"); } url << '?'; //if (input->exists("restrict")) // url << "restrict=" << encodeInput("restrict") << '&'; //if (input->exists("exclude")) // url << "exclude=" << encodeInput("exclude") << '&'; // Not needed: The next loop below handles this output //if (input->exists("config")) // url << "config=" << encodeInput("config") << '&'; // Put out all specified collections. If none selected, resort to // default behaviour. char *config_name = collectionList[0]; String config_encoded; if (config_name && config_name[0] == '\0') config_name = NULL; if (config_name) { for (i = 0; i < collectionList.Count(); i++) { config_name = collectionList[i]; config_encoded = config_name; encodeURL(config_encoded); url << "config=" << config_encoded << '&'; } } /* if (input->exists("method")) url << "method=" << encodeInput("method") << '&'; if (input->exists("format")) url << "format=" << encodeInput("format") << '&'; if (input->exists("sort")) url << "sort=" << encodeInput("sort") << '&'; if (input->exists("matchesperpage")) url << "matchesperpage=" << encodeInput("matchesperpage") << '&'; if (input->exists("keywords")) url << "keywords=" << encodeInput("keywords") << '&'; if (input->exists("words")) url << "words=" << encodeInput("words") << '&'; if (input->exists("startyear")) url << "startyear=" << encodeInput("startyear") << '&'; if (input->exists("startmonth")) url << "startmonth=" << encodeInput("startmonth") << '&'; if (input->exists("startday")) url << "startday=" << encodeInput("startday") << '&'; if (input->exists("endyear")) url << "endyear=" << encodeInput("endyear") << '&'; if (input->exists("endmonth")) url << "endmonth=" << encodeInput("endmonth") << '&'; if (input->exists("endday")) url << "endday=" << encodeInput("endday") << '&'; StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); for (i = 0; i < form_vars.Count(); i++) { if (input->exists(form_vars[i])) { s = form_vars[i]; encodeURL(s); // shouldn't be needed, but just in case url << s << '='; url << encodeInput(form_vars[i]) << '&'; } } url << "page=" << pageNumber; */ } //***************************************************************************** void ResultFetch::displayHeader() { HtConfiguration *config = HtConfiguration::config(); displayParsedFile(config->Find("search_results_header")); } //***************************************************************************** void ResultFetch::displayFooter() { HtConfiguration *config = HtConfiguration::config(); displayParsedFile(config->Find("search_results_footer")); } //***************************************************************************** void ResultFetch::displayNomatch() { HtConfiguration *config = HtConfiguration::config(); displayParsedFile(config->Find("nothing_found_file")); } //***************************************************************************** void ResultFetch::displaySyntaxError(const String & message) { HtConfiguration *config = HtConfiguration::config(); if (config->Boolean("nph")) { // cout << "HTTP/1.0 200 OK\r\n"; } //cout << "Content-type: text/html\r\n\r\n"; setVariables(0, 0); vars.Add("SYNTAXERROR", new String(message)); displayParsedFile(config->Find("syntax_error_file")); } //***************************************************************************** void ResultFetch::displayParsedFile(const String & filename) { FILE *fl = fopen(filename, "r"); char buffer[1000]; while (fl && fgets(buffer, sizeof(buffer), fl)) { expandVariables(buffer); } if (fl) fclose(fl); else if (debug) cerr << "displayParsedFile: Can't open " << filename << endl; } //***************************************************************************** // If the result templates need to depend on the URL of the match, we need // an efficient way to determine which template file to use. To do this, we // will build a StringMatch object with all the URL patterns and also // a List parallel to that pattern that contains the actual template file // names to use for each URL. // void ResultFetch::setupTemplates() { HtConfiguration *config = HtConfiguration::config(); String templatePatterns = config->Find("template_patterns"); if (!templatePatterns.empty()) { // // The templatePatterns string will have pairs of values. The first // value of a pair will be a pattern, the second value will be a // result template file name. // char *token = strtok(templatePatterns, " \t\r\n"); String pattern; while (token) { // // First token is a pattern... // pattern << token << '|'; // // Second token is an URL // token = strtok(0, " \t\r\n"); URLtemplateList.Add(new String(token)); if (token) token = strtok(0, " \t\r\n"); } pattern.chop(1); URLtemplate.Pattern(pattern); } } //***************************************************************************** // If the star images need to depend on the URL of the match, we need // an efficient way to determine which image to use. To do this, we // will build a StringMatch object with all the URL patterns and also // a List parallel to that pattern that contains the actual images to // use for each URL. // void ResultFetch::setupImages() { HtConfiguration *config = HtConfiguration::config(); String starPatterns = config->Find("star_patterns"); if (!starPatterns.empty()) { // // The starPatterns string will have pairs of values. The first // value of a pair will be a pattern, the second value will be an // URL to an image. // char *token = strtok(starPatterns, " \t\r\n"); String pattern; while (token) { // // First token is a pattern... // pattern << token << '|'; // // Second token is an URL // token = strtok(0, " \t\r\n"); URLimageList.Add(new String(token)); if (token) token = strtok(0, " \t\r\n"); } pattern.chop(1); URLimage.Pattern(pattern); } } //***************************************************************************** String * ResultFetch::generateStars(DocumentRef * ref, int right) { int i; String *result = new String(); HtConfiguration *config = HtConfiguration::config(); if (!config->Boolean("use_star_image", 1)) return result; String image = config->Find("star_image"); const String blank = config->Find("star_blank"); double score; if (maxScore != 0 && maxScore != minScore) { score = (ref->DocScore() - minScore) / (maxScore - minScore); if (debug) cerr << "generateStars: doc, min, max " << ref-> DocScore() << ", " << minScore << ", " << maxScore << endl; } else { maxScore = ref->DocScore(); score = 1; } int nStars = int (score * (maxStars - 1) + 0.5) + 1; vars.Add("NSTARS", new String(form("%.d", nStars))); if (debug) cerr << "generateStars: nStars " << nStars << " of " << maxStars << endl; if (right) { for (i = 0; i < maxStars - nStars; i++) { *result << "\""; } } int match = 0; int length = 0; int status; if (URLimage.hasPattern()) status = URLimage.FindFirst(ref->DocURL(), match, length); else status = -1; if (status >= 0 && match >= 0) { image = ((String *) URLimageList[match])->get(); } for (i = 0; i < nStars; i++) { *result << "\"*\""; } if (!right) { for (i = 0; i < maxStars - nStars; i++) { *result << "\""; } } return result; } //***************************************************************************** String * ResultFetch::readFile(const String & filename) { FILE *fl; String *s = new String(); char line[1024]; fl = fopen(filename, "r"); while (fl && fgets(line, sizeof(line), fl)) { *s << line; } if (fl) fclose(fl); else if (debug) cerr << "readFile: Can't open " << filename << endl; return s; } //***************************************************************************** void ResultFetch::expandVariables(const String & str_arg) { const char *str = str_arg; enum { StStart, StLiteral, StVarStart, StVarClose, StVarPlain, StGotVar } state = StStart; String var = ""; while (str && *str) { switch (state) { case StStart: if (*str == '\\') state = StLiteral; else if (*str == '$') state = StVarStart; else { cout << *str; cout.flush(); } break; case StLiteral: cout << *str; cout.flush(); state = StStart; break; case StVarStart: if (*str == '%' || *str == '=') var << *str; // code for URL-encoded/decoded variable else if (*str == '&') { var << *str; // code for SGML-encoded variable if (mystrncasecmp("&", str, 5) == 0) str += 4; } else if (*str == '(' || *str == '{') state = StVarClose; else if (isalnum(*str) || *str == '_' || *str == '-') { var << *str; state = StVarPlain; } else state = StStart; break; case StVarClose: if (*str == ')' || *str == '}') state = StGotVar; else if (isalnum(*str) || *str == '_' || *str == '-') var << *str; else state = StStart; break; case StVarPlain: if (isalnum(*str) || *str == '_' || *str == '-') var << *str; else { state = StGotVar; continue; } break; case StGotVar: // // We have a complete variable in var. Look it up and // see if we can find a good replacement for it. // outputVariable(var); var = ""; state = StStart; continue; } str++; } if (state == StGotVar || state == StVarPlain) { // // The end of string was reached, but we are still trying to // put a variable together. Since we now have a complete // variable, we will look up the value for it. // outputVariable(var); } } //***************************************************************************** void ResultFetch::outputVariable(const String & var) { String *temp; String value = ""; const char *ev, *name; // We have a complete variable name in var. Look it up and // see if we can find a good replacement for it, either in our // vars dictionary or in the environment variables. name = var; while (*name == '&' || *name == '%' || *name == '=') name++; temp = (String *) vars[name]; if (temp) value = *temp; else { ev = getenv(name); if (ev) value = ev; } while (--name >= var.get() && value.length()) { if (*name == '%') encodeURL(value); else if (*name == '&') value = HtSGMLCodec::instance()->decode(value); else // (*name == '=') decodeURL(value); } cout << value; cout.flush(); } //***************************************************************************** List * ResultFetch::buildMatchList() { HtConfiguration *config = HtConfiguration::config(); char *cpid; String url; ResultMatch *thisMatch; SplitMatches matches(*config); double backlink_factor = config->Double("backlink_factor"); double date_factor = config->Double("date_factor"); double backlink_score = 0; double date_score = 0; double base_score = 0; // Additions made here by Mike Grommet ... tm startdate; // structure to hold the startdate specified by the user tm enddate; // structure to hold the enddate specified by the user time_t now = time((time_t *) 0); // fill in all fields for mktime tm *lt = localtime(&now); // - Gilles's fix startdate = *lt; enddate = *lt; time_t eternity = ~(1 << (sizeof(time_t) * 8 - 1)); // will be the largest value holdable by a time_t tm *endoftime; // the time_t eternity will be converted into a tm, held by this variable time_t timet_startdate; time_t timet_enddate; int monthdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; // boolean to test to see if we need to build date information or not int dategiven = ((config->Value("startmonth")) || (config->Value("startday")) || (config->Value("startyear")) || (config->Value("endmonth")) || (config->Value("endday")) || (config->Value("endyear"))); // find the end of time endoftime = gmtime(&eternity); if (dategiven) // user specified some sort of date information { // set up the startdate structure // see man mktime for details on the tm structure startdate.tm_sec = 0; startdate.tm_min = 0; startdate.tm_hour = 0; startdate.tm_yday = 0; startdate.tm_wday = 0; // The concept here is that if a user did not specify a part of a date, // then we will make assumtions... // For instance, suppose the user specified Feb, 1999 as the start // range, we take steps to make sure that the search range date starts // at Feb 1, 1999, // along these same lines: (these are in MM-DD-YYYY format) // Startdates: Date Becomes // 01-01 01-01-1970 // 01-1970 01-01-1970 // 04-1970 04-01-1970 // 1970 01-01-1970 // These things seem to work fine for start dates, as all months have // the same first day however the ending date can't work this way. if (config->Value("startmonth")) // form input specified a start month { startdate.tm_mon = config->Value("startmonth") - 1; // tm months are zero based. They are passed in as 1 based } else startdate.tm_mon = 0; // otherwise, no start month, default to 0 if (config->Value("startday")) // form input specified a start day { startdate.tm_mday = config->Value("startday"); // tm days are 1 based, they are passed in as 1 based } else startdate.tm_mday = 1; // otherwise, no start day, default to 1 // year is handled a little differently... the tm_year structure // wants the tm_year in a format of year - 1900. // since we are going to convert these dates to a time_t, // a time_t value of zero, the earliest possible date // occurs Jan 1, 1970. If we allow dates < 1970, then we // could get negative time_t values right??? // (barring minor timezone offsets west of GMT, where Epoch is 12-31-69) if (config->Value("startyear")) // form input specified a start year { startdate.tm_year = config->Value("startyear") - 1900; if (startdate.tm_year < 69 - 1900) // correct for 2-digit years 00-68 startdate.tm_year += 2000; // - Gilles's fix if (startdate.tm_year < 0) // correct for 2-digit years 69-99 startdate.tm_year += 1900; } else startdate.tm_year = 1970 - 1900; // otherwise, no start day, specify start at 1970 // set up the enddate structure enddate.tm_sec = 59; // allow up to last second of end day enddate.tm_min = 59; // - Gilles's fix enddate.tm_hour = 23; enddate.tm_yday = 0; enddate.tm_wday = 0; if (config->Value("endmonth")) // form input specified an end month { enddate.tm_mon = config->Value("endmonth") - 1; // tm months are zero based. They are passed in as 1 based } else enddate.tm_mon = 11; // otherwise, no end month, default to 11 if (config->Value("endyear")) // form input specified a end year { enddate.tm_year = config->Value("endyear") - 1900; if (enddate.tm_year < 69 - 1900) // correct for 2-digit years 00-68 enddate.tm_year += 2000; // - Gilles's fix if (enddate.tm_year < 0) // correct for 2-digit years 69-99 enddate.tm_year += 1900; } else enddate.tm_year = endoftime->tm_year; // otherwise, no end year, specify end at the end of time allowable // Months have different number of days, and this makes things more // complicated than the startdate range. // Following the example above, here is what we want to happen: // Enddates: Date Becomes // 04-31 04-31-endoftime->tm_year // 05-1999 05-31-1999, may has 31 days... we want to search until the end of may so... // 1999 12-31-1999, search until the end of the year if (config->Value("endday")) // form input specified an end day { enddate.tm_mday = config->Value("endday"); // tm days are 1 based, they are passed in as 1 based } else { // otherwise, no end day, default to the end of the month enddate.tm_mday = monthdays[enddate.tm_mon]; if (enddate.tm_mon == 1) // February, so check for leap year if (((enddate.tm_year + 1900) % 4 == 0 && (enddate.tm_year + 1900) % 100 != 0) || (enddate.tm_year + 1900) % 400 == 0) enddate.tm_mday += 1; // Feb. 29 - Gilles's fix } // Convert the tm values into time_t values. // Web servers specify modification times in GMT, but htsearch // displays these modification times in the server's local time zone. // For consistency, we would prefer to select based on this same // local time zone. - Gilles's fix timet_startdate = mktime(&startdate); timet_enddate = mktime(&enddate); // I'm not quite sure what behavior I want to happen if // someone reverses the start and end dates, and one of them is invalid. // for now, if there is a completely invalid date on the start or end // date, I will force the start date to time_t 0, and the end date to // the maximum that can be handled by a time_t. if (timet_startdate < 0) timet_startdate = 0; if (timet_enddate < 0) timet_enddate = eternity; // what if the user did something really goofy like choose an end date // that's before the start date if (timet_enddate < timet_startdate) // if so, then swap them so they are in order { time_t timet_temp = timet_enddate; timet_enddate = timet_startdate; timet_startdate = timet_temp; } } else // no date was specifed, so plug in some defaults { timet_startdate = 0; timet_enddate = eternity; } // ... MG URLSeedScore adjustments(*config); // If we knew where to pass it, this would be a good place to pass // on errors from adjustments.ErrMsg(). // Deal with all collections // selected_collections->Start_Get(); Collection *collection = NULL; while ((collection = (Collection *) selected_collections->Get_NextElement())) { ResultList *results = collection->getResultList(); if (results == NULL) continue; results->Start_Get(); while ((cpid = results->Get_Next())) { int id = atoi(cpid); // DocumentRef *thisRef = docDB[id]; DocMatch *dm = results->find(cpid); Collection *collection = NULL; if (dm) collection = dm->collection; if (collection == NULL) continue; DocumentRef *thisRef = collection->getDocumentRef(id); // // If it wasn't there, then ignore it // if (thisRef == 0) { continue; } if (!includeURL(thisRef->DocURL())) { // Get rid of it to free the memory! delete thisRef; continue; } // Code added by Mike Grommet for date search ranges // check for valid date range. toss it out if it isn't relevant. if ((timet_startdate > 0 || enddate.tm_year < endoftime->tm_year) && (thisRef->DocTime() < timet_startdate || thisRef->DocTime() > timet_enddate)) { delete thisRef; continue; } thisMatch = ResultMatch::create(); thisMatch->setID(id); thisMatch->setCollection(collection); // // Assign the incomplete score to this match. This score was // computed from the word database only, no excerpt context was // known at that time, or info about the document itself, // so this still needs to be done. // // Moved up: DocMatch *dm = results->find(cpid); double score = dm->score; // We need to scale based on date relevance and backlinks // Other changes to the score can happen now // Or be calculated by the result match in getScore() // This formula derived through experimentation // We want older docs to have smaller values and the // ultimate values to be a reasonable size (max about 100) base_score = score; if (date_factor != 0.0) { date_score = date_factor * ((thisRef->DocTime() * 1000.0 / (double) now) - 900); score += date_score; } if (backlink_factor != 0.0) { int links = thisRef->DocLinks(); if (links == 0) links = 1; // It's a hack, but it helps... backlink_score = backlink_factor * (thisRef->DocBackLinks() / (double) links); score += backlink_score; } if (debug) { cerr << thisRef->DocURL() << "\n"; } thisMatch->setTime(thisRef->DocTime()); thisMatch->setTitle(thisRef->DocTitle()); score = adjustments.adjust_score(score, thisRef->DocURL()); // Get rid of it to free the memory! delete thisRef; score = log(1.0 + score); thisMatch->setScore(score); thisMatch->setAnchor(dm->anchor); // // Append this match to our list of matches. // matches.Add(thisMatch, url.get()); if (debug) { cerr << " base_score " << base_score << " date_score " << date_score << " backlink_score " << backlink_score << "\n"; cerr << " score " << score << "(" << thisMatch-> getScore() << "), maxScore " << maxScore << ", minScore " << minScore << endl; } if (maxScore < score) { if (debug) cerr << "Set maxScore = score" << endl; maxScore = score; } if (minScore > score) { if (debug) cerr << "Set minScore = score" << endl; minScore = score; } } } // // Each sub-area is then sorted by relevance level. // List *matches_part; // Outside of loop to keep for-scope warnings away. for (matches_part = matches.Get_First(); matches_part != 0; matches_part = matches.Get_Next()) sort(matches_part); // Then all sub-lists are concatenated and put in a new list. return matches.JoinedLists(); } //***************************************************************************** String * ResultFetch::excerpt(ResultMatch * match, DocumentRef * ref, String urlanchor, int fanchor, int &first) { HtConfiguration *config = HtConfiguration::config(); // It is necessary to keep alive the String you .get() a char * from, // as long as you use the char *. //String head_string; char *head; int use_meta_description = 0; Collection *collection = match->getCollection(); if (config->Boolean("use_meta_description", 0) && strlen(ref->DocMetaDsc()) != 0) { // Set the head to point to description head = ref->DocMetaDsc(); use_meta_description = 1; } else { // docDB.ReadExcerpt(*ref); collection->ReadExcerpt(*ref); head = ref->DocHead(); // head points to the top } //head_string = HtSGMLCodec::instance()->decode(head); //head = head_string.get(); int which, length; char *temp = head; String part; String *text = new String(""); StringMatch *allWordsPattern = NULL; if (collection) allWordsPattern = collection->getSearchWordsPattern(); if (!allWordsPattern) return text; // htsearch displays the description when: // 1) a description has been found // 2) the option "use_meta_description" is set to true // If previous conditions are false and "excerpt_show_top" is set to true // it shows the whole head. Else, it acts as default. if (config->Boolean("excerpt_show_top", 0) || use_meta_description || !allWordsPattern->hasPattern()) first = 0; else first = allWordsPattern->FindFirstWord(head, which, length); if (first < 0 && config->Boolean("no_excerpt_show_top")) first = 0; // No excerpt, but we want to show the top. if (first < 0) { // // No excerpt available, don't show top, so display message // if (!config->Find("no_excerpt_text").empty()) { *text << config->Find("no_excerpt_text"); } } else { int headLength = strlen(head); int length = config->Value("excerpt_length", 50); char *start; char *end; WordType type(*config); if (!config->Boolean("add_anchors_to_excerpt")) // negate flag if it's on (anchor available) fanchor = 0; // // Figure out where to start the excerpt. Basically we go back // half the excerpt length from the first matched word // start = &temp[first] - length / 2; if (start < temp) start = temp; else { *text << config->Find("start_ellipses"); while (*start && type.IsStrictChar(*start)) start++; } // // Figure out the end of the excerpt. // end = start + length; if (end > temp + headLength) { end = temp + headLength; *text << hilight(match, start, urlanchor, fanchor); } else { while (*end && type.IsStrictChar(*end)) end++; *end = '\0'; *text << hilight(match, start, urlanchor, fanchor); *text << config->Find("end_ellipses"); } } return text; } //***************************************************************************** String ResultFetch::hilight(ResultMatch * match, const String & str_arg, const String & urlanchor, int fanchor) { HtConfiguration * config = HtConfiguration::config(); const String start_highlight = config->Find("start_highlight"); const String end_highlight = config->Find("end_highlight"); const char * str = str_arg; String result; int pos = 0; int which, length; WeightWord * ww; int first = 1; String s; #define SGMLencodedChars(p, l) (s = 0, s.append(p, l), HtSGMLCodec::instance()->decode(s)) result = 0; Collection * collection = match->getCollection(); StringMatch * allWordsPattern = NULL; if (collection) allWordsPattern = collection->getSearchWordsPattern(); List * searchWords = NULL; if (collection) searchWords = collection->getSearchWords(); if (!allWordsPattern || !searchWords) return result; while (allWordsPattern->hasPattern() && (pos = allWordsPattern->FindFirstWord(str, which, length)) >= 0) { //result.append(str, pos); result << SGMLencodedChars(str, pos); ww = (WeightWord *) (*searchWords)[which]; result << start_highlight; if (first && fanchor) result << ""; //result.append(str + pos, length); result << SGMLencodedChars(str + pos, length); if (first && fanchor) result << ""; result << end_highlight; str += pos + length; first = 0; } //result.append(str); result << SGMLencodedChars(str, strlen(str)); return result; } //***************************************************************************** void ResultFetch::sort(List * matches) { HtConfiguration *config = HtConfiguration::config(); int numberOfMatches = matches->Count(); int i; if (numberOfMatches <= 1) return; ResultMatch **array = new ResultMatch *[numberOfMatches]; for (i = 0; i < numberOfMatches; i++) { array[i] = (ResultMatch *) (*matches)[i]; } matches->Release(); qsort((char *) array, numberOfMatches, sizeof(ResultMatch *), array[0]->getSortFun()); const String st = config->Find("sort"); if (!st.empty() && mystrncasecmp("rev", st, 3) == 0) { for (i = numberOfMatches; --i >= 0;) matches->Add(array[i]); } else { for (i = 0; i < numberOfMatches; i++) matches->Add(array[i]); } delete[]array; } //***************************************************************************** void ResultFetch::logSearch(int page, List * matches) { //Note: This is Posix and dependent on a running syslogd.. //does not work for Win32 //TODO: Look into using native windows system logs instead #ifndef _WIN32 HtConfiguration *config = HtConfiguration::config(); // Currently unused time_t t; int nMatches = 0; int level = LOG_LEVEL; int facility = LOG_FACILITY; char *host = getenv("REMOTE_HOST"); char *ref = getenv("HTTP_REFERER"); if (host == NULL) host = getenv("REMOTE_ADDR"); if (host == NULL) host = "-"; if (ref == NULL) ref = "-"; if (matches) nMatches = matches->Count(); openlog("htsearch", LOG_PID, facility); syslog(level, "%s [%s] (%s) [%s] [%s] (%d/%s) - %d -- %s\n", host, input->exists("config") ? input->get("config") : "default", (const char *) config->Find("match_method"), input->get("words"), logicalWords.get(), nMatches, (const char *) config->Find("matches_per_page"), page, ref); #endif } htdig-3.2.0b6/libhtdig/ResultFetch.h0100644006314600127310000001367210055635561016571 0ustar angusgbhtdig//-------------------------------------------------------------------- // // ResultFetch.h // // 2/6/2002 created for libhtdig // // Neal Richter nealr@rightnow.com // // // ResultFetch: Takes results of search and fills in the HTML templates // // FOR USE IN LIBHTDIG... does NOT stream to stdout!! // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: ResultFetch.h,v 1.4 2004/05/28 13:15:29 lha Exp $ // //-------------------------------------------------------------------- #ifndef _ResultFetch_h_ #define _ResultFetch_h_ #include "Object.h" #include "ResultList.h" #include "ResultMatch.h" #include "TemplateList.h" #include "cgi.h" #include "StringMatch.h" #include "List.h" #include "DocumentDB.h" #include "Database.h" #include "Dictionary.h" #include "HtRegex.h" class ResultFetch : public Object { public: // // Construction/Destruction // // Display(const String& docFile, const String& indexFile, const String& excerptFile); ResultFetch(Dictionary *selected_collections, const StringList& templist); ResultFetch(Dictionary *selected_collections); ~ResultFetch(); void setStartTemplate(const String& templateName); void setMatchTemplate(const String& templateName); void setEndTemplate(const String& templateName); // inline void setResults(ResultList *results); // inline void setSearchWords(List *searchWords); inline void setLimit(HtRegex *); inline void setExclude(HtRegex *); // inline void setAllWordsPattern(StringMatch *); inline void setLogicalWords(char *); inline void setOriginalWords(char *); inline void setCGI(cgi *); //void fetch(int pageNumber); //void fetchMatch(ResultMatch *match, DocumentRef *ref, int current); List * fetch(); Dictionary * fetchMatch(ResultMatch *match, DocumentRef *ref, int current); void displayHeader(); void displayFooter(); void displayNomatch(); void displaySyntaxError(const String &); int hasTemplateError() {return templateError;} protected: // // Multiple database support // Dictionary *selected_collections; // // Search Policy char *search_policy; // // The list of search results. // // ResultList *results; // // The database that contains documents. // // DocumentDB docDB; // List of databases to search on StringList collectionList; // // A list of words that we are searching for // // List *searchWords; // // Pattern that all result URLs must match or exclude // HtRegex *limitTo; HtRegex *excludeFrom; // // Pattern of all the words // // StringMatch *allWordsPattern; // // Variables for substitution into text are stored in a dictionary // Dictionary vars; // // Since the creation of excerpts is somewhat time consuming, we will // only compute them if they're actually going to be used. This is the // flag that tells us if we will need the excerpt. // int needExcerpt; // // Since we might have errors we cannot recover from, this tells us // what happened. // int templateError; // // To allow the result templates to be dependant on the match URL, we need // the following: // StringMatch URLtemplate; List URLtemplateList; // // To allow the star images to be dependant on the match URL, we need // the following: // StringMatch URLimage; List URLimageList; // // Maximum number of stars to display // int maxStars; double maxScore; double minScore; // // For display, we have different versions of the list of words. // String logicalWords; String originalWords; // // To be able to recreate the URL that will get to us again, we need // the info from the HTML form that called us. // cgi *input; // // Match output is done through templates. This is the interface to these // templates. // TemplateList templates; Template *currentTemplate; // // Methods... // List *buildMatchList(); void sort(List *); int includeURL(const String&); String *readFile(const String&); void expandVariables(const String&); void outputVariable(const String&); String *excerpt(ResultMatch *match, DocumentRef *ref, String urlanchor, int fanchor, int &first); String hilight(ResultMatch *match, const String& str, const String& urlanchor, int fanchor); void setupTemplates(); void setupImages(); String *generateStars(DocumentRef *, int); void displayParsedFile(const String&); void setVariables(int, List *); void createURL(String &, int); void logSearch(int, List *); }; //***************************************************************************** inline void ResultFetch::setLimit(HtRegex *limit) { limitTo = limit; } inline void ResultFetch::setExclude(HtRegex *exclude) { excludeFrom = exclude; } #if 0 inline void Display::setAllWordsPattern(StringMatch *pattern) { allWordsPattern = pattern; } inline void Display::setResults(ResultList *results) { this->results = results; } inline void Display::setSearchWords(List *searchWords) { this->searchWords = searchWords; } #endif inline void ResultFetch::setLogicalWords(char *s) { logicalWords = s; vars.Add("LOGICAL_WORDS", new String(logicalWords)); } inline void ResultFetch::setOriginalWords(char *s) { originalWords = s; vars.Add("WORDS", new String(originalWords)); } inline void ResultFetch::setCGI(cgi *aCgi) { input = aCgi; } #endif htdig-3.2.0b6/libhtdig/TextCollector.cc0100644006314600127310000003017710055635561017271 0ustar angusgbhtdig//-------------------------------------------------------------------- // // TextCollector.cc // // 2/6/2002 created for libhtdig // // Neal Richter nealr@rightnow.com // // TextCollector: // General Purpose Text Document Indexer. // Calls appropriate parsers. // The parser notifies the TextCollector object that it got something // (got_* functions) and the TextCollector object feed the databases // and statistics accordingly. // // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: TextCollector.cc,v 1.4 2004/05/28 13:15:29 lha Exp $ // //-------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include "TextCollector.h" #include "htdig.h" #include "HtWordList.h" #include "WordRecord.h" #include "URLRef.h" #include "Server.h" #include "Parsable.h" #include "BasicDocument.h" #include "StringList.h" #include "WordType.h" #include "md5.h" #include "defaults.h" #include #include #include //***************************************************************************** // TextCollector::TextCollector() // TextCollector::TextCollector(TextCollectorLog flags): words(*(HtConfiguration::config())) { HtConfiguration *config = HtConfiguration::config(); //FILE *urls_parsed; currenthopcount = 0; //turn on word tracking! trackWords = 1; // // Initialize the flags for the various HTML factors // // text_factor factor[0] = FLAG_TEXT; // title_factor factor[1] = FLAG_TITLE; // heading factor (now generic) factor[2] = FLAG_HEADING; factor[3] = FLAG_HEADING; factor[4] = FLAG_HEADING; factor[5] = FLAG_HEADING; factor[6] = FLAG_HEADING; factor[7] = FLAG_HEADING; // img alt text //factor[8] = FLAG_KEYWORDS; factor[8] = FLAG_TEXT; // treat alt text as plain text, until it has // its own FLAG and factor. // keywords factor factor[9] = FLAG_KEYWORDS; // META description factor factor[10] = FLAG_DESCRIPTION; doc = NULL; minimumWordLength = config->Value("minimum_word_length", 3); //TODO put document-index log file stuff here via logs like Retriever check_unique_md5 = config->Boolean("check_unique_md5", 0); check_unique_date = config->Boolean("check_unique_date", 0); d_md5 = 0; if (check_unique_md5) { d_md5 = Database::getDatabaseInstance(DB_HASH); if (d_md5->OpenReadWrite(config->Find("md5_db"), 0666) != OK) { cerr << "DocumentDB::Open: " << config->Find("md5_db") << " " << strerror(errno) << "\n"; } } temp_doc_count = 0; } //***************************************************************************** // TextCollector::~TextCollector() // TextCollector::~TextCollector() { if (d_md5) d_md5->Close(); //delete doc; if(temp_doc_count != 0) { words.Flush(); temp_doc_count = 0; } words.Flush(); words.Close(); } //***************************************************************************** // void TextCollector::IndexDoc() // // int TextCollector::IndexDoc(BasicDocument & a_basicdoc) { DocumentRef *ref; time_t date; int old_document = 0; static int index = 0; //struct timeb tb; //HtConfiguration *config = HtConfiguration::config(); doc = &a_basicdoc; ref = docs[doc->Location()]; // It might be nice to have just an Exists() here if (ref) { // // We already have an entry for this document in our database. // This means we can get the document ID and last modification // time from there. // current_id = ref->DocID(); date = ref->DocTime(); if (ref->DocAccessed()) old_document = 1; else // we haven't retrieved it yet, so we only have the first link old_document = 0; ref->DocBackLinks(ref->DocBackLinks() + 1); // we had a new link ref->DocAccessed(time(0)); ref->DocState(Reference_normal); currenthopcount = ref->DocHopCount(); } else { // // Never seen this document before. We need to create an // entry for it. This implies that it gets a new document ID. // date = 0; current_id = docs.NextDocID(); ref = new DocumentRef; ref->DocID(current_id); ref->DocURL(doc->Location()); ref->DocState(Reference_normal); ref->DocAccessed(time(0)); ref->DocHopCount(0); ref->DocBackLinks(1); // We had to have a link to get here! old_document = 0; } word_context.DocID(ref->DocID()); if (debug > 0) { // // Display progress // cout << index++ << ':' << current_id << ':' << currenthopcount << ':' << doc->Location() << ": "; cout.flush(); } //printf("New Doc\n"); //ftime(&tb); //fprintf(stderr, "[1] TIME: [%s] [%d]\n", ctime(&tb.time), tb.millitm); RetrievedDocument(ref); //ftime(&tb); //fprintf(stderr, "[2] TIME: [%s] [%d]\n", ctime(&tb.time), tb.millitm); if(temp_doc_count > 250) { //words.Flush(); temp_doc_count = 0; } else { temp_doc_count++; } //ftime(&tb); //fprintf(stderr, "[3] TIME: [%s] [%d]\n", ctime(&tb.time), tb.millitm); docs.Add(*ref); //ftime(&tb); //fprintf(stderr, "[4] TIME: [%s] [%d]\n", ctime(&tb.time), tb.millitm); delete ref; words.Flush(); //words.Close(); if (urls_seen) { fprintf(urls_seen, "%s|%d|%s|%d|0|1\n", (const char *) doc->Location(), doc->Length(), doc->ContentType(), (int) doc->ModTime()); } return(1); } int TextCollector::FlushWordDB() { if(temp_doc_count != 0) { words.Flush(); temp_doc_count = 0; } words.Flush(); words.Close(); return(1); } //***************************************************************************** // void TextCollector::RetrievedDocument(Document &doc, const String &url, DocumentRef *ref) // We found a document that needs to be parsed. Since we don't know the // document type, we'll let the Document itself return an appropriate // Parsable object which we can call upon to parse the document contents. // void TextCollector::RetrievedDocument(DocumentRef * ref) { n_links = 0; current_ref = ref; current_title = 0; word_context.Anchor(0); current_time = 0; current_head = 0; current_meta_dsc = 0; time_t doc_time; //Check if the Document is self-parseable //We will pass ourselves as a callback object for all the got_*() routines if (doc->SelfParseable() == TRUE) { doc->internalParser(*this); } else { // Create a parser object and let it have a go at the document. // We will pass ourselves as a callback object for all the got_*() // routines. // This will generate the Parsable object as a specific parser /* Parsable *parsable = doc->getParsable(); if (parsable) parsable->parse(*this, *base); else { // If we didn't get a parser, then we should get rid of this! ref->DocState(Reference_noindex); return; } */ } // We don't need to dispose of the parsable object since it will // automatically be reused. // // Update the document reference // ref->DocTitle((char *) current_title); ref->DocHead((char *) current_head); ref->DocMetaDsc((char *) current_meta_dsc); /* if (current_time == 0) ref->DocTime(doc->ModTime()); else ref->DocTime(current_time); */ doc_time = doc->ModTime(); if(doc_time != 0) ref->DocTime(doc_time); else ref->DocTime(time(NULL)); ref->DocSize(doc->Length()); ref->DocAccessed(time(0)); ref->DocLinks(n_links); } //***************************************************************************** // void TextCollector::got_word(char *word, int location, int heading) // The location is normalized to be in the range 0 - 1000. // void TextCollector::got_word(const char *word, int location, int heading) { if (debug > 3) cout << "word: " << word << '@' << location << endl; if (heading >= 11 || heading < 0) // Current limits for headings heading = 0; // Assume it's just normal text if ((trackWords) && (strlen(word) >= minimumWordLength)) { String w = word; HtWordReference wordRef; wordRef.Location(location); wordRef.Flags(factor[heading]); wordRef.Word(w); words.Replace(WordReference::Merge(wordRef, word_context)); #ifdef DEBUG cout << "Adding: [" << w << "]"<< endl; //NEALR #endif // Check for compound words... String parts = word; int added; int nparts = 1; do { added = 0; char *start = parts.get(); char *punctp = 0, *nextp = 0, *p; char punct; int n; while (*start) { p = start; for (n = 0; n < nparts; n++) { while (HtIsStrictWordChar((unsigned char) *p)) p++; punctp = p; if (!*punctp && n + 1 < nparts) break; while (*p && !HtIsStrictWordChar((unsigned char) *p)) p++; if (n == 0) nextp = p; } if (n < nparts) break; punct = *punctp; *punctp = '\0'; if (*start && (*p || start > parts.get())) { w = start; HtStripPunctuation(w); if (w.length() >= minimumWordLength) { wordRef.Word(w); words.Replace(WordReference::Merge(wordRef, word_context)); if (debug > 3) cout << "word part: " << start << '@' << location << endl; #ifdef DEBUG cout << "Adding: [" << w << "]"<< endl; //NEALR #endif } added++; } start = nextp; *punctp = punct; } nparts++; } while (added > 2); } } //***************************************************************************** // void TextCollector::got_title(const char *title) // void TextCollector::got_title(const char *title) { if (debug > 1) cout << "\ntitle: " << title << endl; current_title = title; } //***************************************************************************** // void TextCollector::got_time(const char *time) // void TextCollector::got_time(const char *time) { HtDateTime new_time(current_time); if (debug > 1) cout << "\ntime: " << time << endl; // // As defined by the Dublin Core, this should be YYYY-MM-DD // In the future, we'll need to deal with the scheme portion // in case someone picks a different format. // new_time.SetFTime(time, "%Y-%m-%d"); current_time = new_time.GetTime_t(); // If we can't convert it, current_time stays the same and we get // the default--the date returned by the server... } //***************************************************************************** // void TextCollector::got_head(const char *head) // void TextCollector::got_head(const char *head) { if (debug > 4) cout << "head: " << head << endl; current_head = head; } //***************************************************************************** // void TextCollector::got_meta_dsc(const char *md) // void TextCollector::got_meta_dsc(const char *md) { if (debug > 4) cout << "meta description: " << md << endl; current_meta_dsc = md; } //***************************************************************************** // void TextCollector::got_meta_email(const char *e) // void TextCollector::got_meta_email(const char *e) { if (debug > 1) cout << "\nmeta email: " << e << endl; current_ref->DocEmail(e); } //***************************************************************************** // void TextCollector::got_meta_notification(const char *e) // void TextCollector::got_meta_notification(const char *e) { if (debug > 1) cout << "\nmeta notification date: " << e << endl; current_ref->DocNotification(e); } //***************************************************************************** // void TextCollector::got_meta_subject(const char *e) // void TextCollector::got_meta_subject(const char *e) { if (debug > 1) cout << "\nmeta subect: " << e << endl; current_ref->DocSubject(e); } //***************************************************************************** // void TextCollector::got_noindex() // void TextCollector::got_noindex() { if (debug > 1) cout << "\nMETA ROBOT: Noindex " << current_ref->DocURL() << endl; current_ref->DocState(Reference_noindex); } htdig-3.2.0b6/libhtdig/TextCollector.h0100644006314600127310000000700710055635561017127 0ustar angusgbhtdig//-------------------------------------------------------------------- // // TextCollector.h // // 2/6/2002 created for libhtdig // // Neal Richter nealr@rightnow.com // // TextCollector: // General Purpose Text Document Indexer. // Calls appropriate parsers. // The parser notifies the TextCollector object that it got something // (got_* functions) and the TextCollector object feed the databases // and statistics accordingly. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: TextCollector.h,v 1.4 2004/05/28 13:15:29 lha Exp $ // //-------------------------------------------------------------------- #ifndef _TextCollector_h_ #define _TextCollector_h_ #include "BasicDocument.h" #include "DocumentRef.h" #include "Dictionary.h" #include "Queue.h" #include "HtWordReference.h" #include "List.h" #include "StringList.h" #include "DocumentDB.h" class Document; class HtWordList; enum TextCollectorLog { TextCollector_noLog, TextCollector_logUrl, TextCollector_Restart }; class TextCollector { public: // // Construction/Destruction // TextCollector(TextCollectorLog flags = TextCollector_noLog); virtual ~TextCollector(); int IndexDoc(BasicDocument & adoc); int FlushWordDB(); // // Report statistics about the parser // void ReportStatistics(const String& name); // // These are the callbacks that we need to write code for // void got_word(const char *word, int location, int heading); void got_href(URL &url, const char *description, int hops = 1); void got_title(const char *title); void got_time(const char *time); void got_head(const char *head); void got_meta_dsc(const char *md); void got_anchor(const char *anchor); void got_image(const char *src); void got_meta_email(const char *); void got_meta_notification(const char *); void got_meta_subject(const char *); void got_noindex(); private: // // A hash to keep track of what we've seen // Dictionary visited; URL *base; String current_title; String current_head; String current_meta_dsc; time_t current_time; int current_id; DocumentRef *current_ref; int current_anchor_number; int trackWords; int n_links; HtWordReference word_context; HtWordList words; int check_unique_md5; int check_unique_date; TextCollectorLog log; // // These are weights for the words. The index is the heading level. // long int factor[11]; int currenthopcount; // // For efficiency reasons, we will only use one document object which // we reuse. // BasicDocument *doc; Database *d_md5; // Some useful constants int minimumWordLength; // // Helper routines // void RetrievedDocument(DocumentRef *ref); int temp_doc_count; }; #endif htdig-3.2.0b6/libhtdig/htsearch.h0100644006314600127310000000310110055635561016124 0ustar angusgbhtdig// // htsearch.h // // htsearch: The main search CGI. Parses the CGI input, reads the config files // and calls the necessary code to put together the result lists // and the final display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: htsearch.h,v 1.5 2004/05/28 13:15:29 lha Exp $ // #ifndef _htsearch_h_ #define _htsearch_h_ #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "List.h" #include "StringList.h" #include "Dictionary.h" #include "DocumentRef.h" #include "Database.h" #include "good_strtok.h" #include "DocumentDB.h" #include "htString.h" #include "HtConfiguration.h" #include "ResultMatch.h" #include "ResultList.h" #include "HtWordReference.h" #include "StringMatch.h" #include "defaults.h" #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #ifndef _WIN32 #include #endif extern int n_matches; extern int do_and; extern int do_short; extern StringList fields; #ifndef _WIN32 //extern StringMatch limit_to; #endif extern StringMatch URLimage; extern List URLimageList; extern StringMatch wm; extern Database *dbf; extern String logicalWords; extern String originalWords; extern int debug; extern StringList collectionList; #endif htdig-3.2.0b6/libhtdig/libhtdig_api.h0100644006314600127310000004515310055635561016757 0ustar angusgbhtdig//---------------------------------------------------------------- // // libhtdig_api.h // // Header function for htdig shared library API // // 1/25/2002 created // // Neal Richter nealr@rightnow.com // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_api.h,v 1.4 2004/05/28 13:15:29 lha Exp $ // //---------------------------------------------------------------- #ifndef LIBHTDIG_API_H #define LIBHTDIG_API_H #include #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define HTDIG_MAX_FILENAME_PATH_L 1024 #define HTDIG_DOCUMENT_ID_L 32 #define HTDIG_DOCUMENT_TITLE_L 256 #define HTDIG_DOCUMENT_META_L 4096 #define HTDIG_DOCUMENT_CONTENT_TYPE_L 32 #define HTDIG_DOCUMENT_EXCERPT_L 1024 //make sure HTDIG_DOCUMENT_EXCERPT_L is more than config 'excerpt_length' //default failsafe size of 'excerpt' document //make sure it's more than config 'max_head_length' #define HTDIG_DEFAULT_EXCERPT_SIZE 524288 //should be the same as the default value in HTDIG #define HTDIG_MAX_QUERY_L 256 #define HTDIG_CUSTOM_TEXT_MIME_TYPE "text/vnd.customdocument" //htfuzzy #define HTDIG_ALG_ACCENTS 0x00000100 //"accents" #define HTDIG_ALG_ACCENTS_STR "accents" #define HTDIG_ALG_ENDINGS 0x00001000 //"endings" #define HTDIG_ALG_ENDINGS_STR "endings" #define HTDIG_ALG_METAPHONE 0x00000010 //"metaphone" #define HTDIG_ALG_METAPHONE_STR "metaphone" #define HTDIG_ALG_SOUNDEX 0x00000001 //"soundex" #define HTDIG_ALG_SOUNDEX_STR "soundex" #define HTDIG_ALG_SYNONYMS 0x00010000 //"synonyms" #define HTDIG_ALG_SYNONYMS_STR "synonyms" //searching #define HTSEARCH_ALG_AND 0x00000100 //"and" #define HTSEARCH_ALG_AND_STR "and" #define HTSEARCH_ALG_BOOLEAN 0x00000001 //"boolean" #define HTSEARCH_ALG_BOOLEAN_STR "boolean" #define HTSEARCH_ALG_OR 0x00000010 //"or" #define HTSEARCH_ALG_OR_STR "or" #define HTSEARCH_FORMAT_LONG 0x00000001 //"long" #define HTSEARCH_FORMAT_LONG_STR "long" #define HTSEARCH_FORMAT_SHORT 0x00000010 //"short" #define HTSEARCH_FORMAT_SHORT_STR "short" #define HTSEARCH_SORT_SCORE 0x00000001 //"score" #define HTSEARCH_SORT_SCORE_STR "score" #define HTSEARCH_SORT_REV_SCORE 0x00000010 //"reverse score" #define HTSEARCH_SORT_REV_SCORE_STR "reverse score" #define HTSEARCH_SORT_TIME 0x00000100 //"time" #define HTSEARCH_SORT_TIME_STR "time" #define HTSEARCH_SORT_REV_TIME 0x00001000 //"reverse time" #define HTSEARCH_SORT_REV_TIME_STR "reverse time" #define HTSEARCH_SORT_TITLE 0x00010000 //"title" #define HTSEARCH_SORT_TITLE_STR "title" #define HTSEARCH_SORT_REV_TITLE 0x00100000 //"reverse title" #define HTSEARCH_SORT_REV_TITLE_STR "reverse title" #define HTDIG_ERROR_CONFIG_READ -101 #define HTDIG_ERROR_URL_PART -102 #define HTDIG_ERROR_URL_REWRITE -103 #define HTDIG_ERROR_URL_CREATE_FILE -104 #define HTDIG_ERROR_IMAGE_CREATE_FILE -105 #define HTDIG_ERROR_OPEN_CREATE_DOCDB -106 #define HTDIG_ERROR_LOGFILE_OPEN -107 #define HTDIG_ERROR_LOGFILE_CLOSE -108 #define HTDIG_ERROR_TESTURL_EXCLUDE -109 #define HTDIG_ERROR_TESTURL_BADQUERY -110 #define HTDIG_ERROR_TESTURL_EXTENSION -111 #define HTDIG_ERROR_TESTURL_EXTENSION2 -112 #define HTDIG_ERROR_TESTURL_LIMITS -113 #define HTDIG_ERROR_TESTURL_LIMITSNORM -114 #define HTDIG_ERROR_TESTURL_SRCH_RESTRICT -115 #define HTDIG_ERROR_TESTURL_SRCH_EXCLUDE -116 #define HTDIG_ERROR_TESTURL_REWRITE_EMPTY -117 #define HTDIG_ERROR_TESTURL_ROBOT_FORBID -118 #define HTSEARCH_ERROR_NO_MATCH -201 #define HTSEARCH_ERROR_BAD_MATCH_INDEX -202 #define HTSEARCH_ERROR_BAD_DOCUMENT -203 #define HTSEARCH_ERROR_TEMPLATE_ERROR -204 #define HTSEARCH_ERROR_LOGFILE_OPEN -205 #define HTSEARCH_ERROR_LOGFILE_CLOSE -206 #define HTSEARCH_ERROR_CONFIG_READ -207 #define HTSEARCH_ERROR_URL_PART -208 #define HTSEARCH_ERROR_WORDDB_READ -209 #define HTSEARCH_ERROR_DOCINDEX_READ -210 #define HTSEARCH_ERROR_DOCDB_READ -211 #define HTSEARCH_ERROR_EXCERPTDB_READ -212 #define HTMERGE_ERROR_LOGFILE_OPEN -301 #define HTMERGE_ERROR_LOGFILE_CLOSE -302 #define HTMERGE_ERROR_CONFIG_READ -303 #define HTMERGE_ERROR_URL_PART -304 #define HTMERGE_ERROR_WORDDB_READ -305 #define HTMERGE_ERROR_DOCINDEX_READ -306 #define HTMERGE_ERROR_DOCDB_READ -307 #define HTMERGE_ERROR_EXCERPTDB_READ -308 #define PHP_HTDIG_CONFIGFILE_PARM "configFile" #define PHP_HTDIG_URL_PARM "URL" #define PHP_HTDIG_LIMITTO_PARM "limit_urls_to" #define PHP_HTDIG_LIMITN_PARM "limit_normalized" #define PHP_HTDIG_EXCLUDEURLS_PARM "exclude_urls" #define PHP_HTDIG_SEARCHRESTRICT_PARM "search_restrict" #define PHP_HTDIG_SEARCHEXCLUDE_PARM "search_exclude" #define PHP_HTDIG_MAXHOPCOUNT_PARM "max_hop_cont" #define PHP_HTDIG_URLREWRITE_PARM "url_rewrite_rules" #define PHP_HTDIG_BAD_QUERYSTR_PARM "bad_querystr" //============================================================================= //===== HTDIG INDEXING API ==================================================== /*************************************************** * HTDIG_DOCUMENTATION for htdig_parameters_struct * * DEBUGGING PARAMETERS * * int debug * Verbose mode. This increases the verbosity of the * program. Using more than 2 is probably only useful * for debugging purposes. The default verbose mode * gives a nice progress report while digging. * * char logFile * File to stream debugging & error messages to! * * BOOLEAN PARAMETERS * * int initial * Initial. Do not use any old databases. This is * accomplished by first erasing the databases * * int create_text_database * Create an ASCII version of the document database. * This database is easy to parse with other programs so * that information can be extracted from it. * * int report_statistics * Report statistics after completion. * * int alt_work_area * Use alternate work files. * Tells htdig to append .work to database files, causing * a second copy of the database to be built. This allows * the original files to be used by htsearch during the * indexing run. * * * STRING PARAMETERS * * char configFile * configfile * Use the specified configuration file instead of the * default. * * char credentials * username:password * Tells htdig to send the supplied username and * password with each HTTP request. The credentials * will be encoded using the 'Basic' authentication scheme. * There *HAS* to be a colon (:) between the username * and password. * * * char maxhops //9 digit limit * hopcount * Limit the stored documents to those which are at * most hopcount links away from the start URL. * * char minimalFile * * char URL * 'command-line' URLs from stdin * fetches & indexes these URLs * ******************************************************************/ typedef struct htdig_parameters_struct { char configFile[HTDIG_MAX_FILENAME_PATH_L]; char DBpath[HTDIG_MAX_FILENAME_PATH_L]; char credentials[HTDIG_MAX_FILENAME_PATH_L]; char max_hops[10]; //9 digit limit char minimalFile[HTDIG_MAX_FILENAME_PATH_L]; //debugging & logfile char logFile[HTDIG_MAX_FILENAME_PATH_L]; //location of log file int debug; //0, 1 ,2, 3, 4, 5 //booelan values int initial; int create_text_database; int report_statistics; int alt_work_area; int use_cookies; //spidering filters char URL[HTDIG_MAX_FILENAME_PATH_L]; char limit_urls_to[HTDIG_MAX_FILENAME_PATH_L]; char limit_normalized[HTDIG_MAX_FILENAME_PATH_L]; char exclude_urls[HTDIG_MAX_FILENAME_PATH_L]; char search_restrict[HTDIG_MAX_FILENAME_PATH_L]; char search_exclude[HTDIG_MAX_FILENAME_PATH_L]; char url_rewrite_rules[HTDIG_MAX_FILENAME_PATH_L]; char bad_querystr[HTDIG_MAX_FILENAME_PATH_L]; char locale[16]; char title_factor[16]; char text_factor[16]; char meta_description_factor[16]; int max_hop_count; //the rewritten URL - OUTGOING after htdig_index_test_url char rewritten_URL[HTDIG_MAX_FILENAME_PATH_L]; } htdig_parameters_struct; /***************************************************************** * HTDIG_DOCUMENTATION for htdig_simple_doc_struct * * STRING PARAMETERS * * char location * the 'URL' of the document. Can be any usefull string. * * char documentid * document id of document [NOT CURRENTLY USED - IGNORED] * * char title * document title * * char meta * content that is indexed but won appear in an search excerpts * * char * contents * pointer to a NULL TERMINATED string on information to be * indexed. * * char content_type * a MIME-like string * custom MIME-type defined above, others are supported by * htdig as well. * * *****************************************************************/ typedef struct htdig_simple_doc_struct { char location[HTDIG_MAX_FILENAME_PATH_L]; char documentid[HTDIG_DOCUMENT_ID_L]; char title[HTDIG_DOCUMENT_TITLE_L]; char meta[HTDIG_DOCUMENT_META_L]; char *contents; //MUST ALLOCATE & FREE!!! char content_type[HTDIG_DOCUMENT_CONTENT_TYPE_L]; //MIME-ISH string //struct tm time_tm; // use to override index time time_t doc_time; } htdig_simple_doc_struct; int htdig_index_open(htdig_parameters_struct *); int htdig_index_simple_doc(htdig_simple_doc_struct * ); int htdig_index_urls(void); int htdig_index_reset(void); int htdig_index_close(void); int htdig_index_test_url(htdig_parameters_struct *htparms); int htdig_get_max_head_length(void); //============================================================================= //===== HTDIG MERGING API ===================================================== /************************************************** * HTDIG_DOCUMENTATION for htmerge_parameters_struct * * DEBUGGING PARAMETERS * * int debug * Verbose mode. This increases the verbosity of the * program. Using more than 2 is probably only useful * for debugging purposes. The default verbose mode * gives a progress on what it is doing and where it is. * * char logFile * File to stream debugging & error messages to! * * * BOOLEAN PARAMETERS * * int alt_work_area * Use alternate work files. * Tells htmerge to append .work to database files causing * a second copy of the database to be built. This allows * original files to be used by htsearch during the indexing run. * * * STRING PARAMETERS * * char configFile * configfile * Use the specified configuration file instead of the default. * * char merge_configFile * merge_configfile * Merge the databases specified into the databases specified * by -c or the default. * * *************************************************/ typedef struct htmerge_parameters_struct { char configFile[HTDIG_MAX_FILENAME_PATH_L]; char merge_configFile[HTDIG_MAX_FILENAME_PATH_L]; //debugging & logfile char logFile[HTDIG_MAX_FILENAME_PATH_L]; //location of log file int debug; //0, 1 ,2, 3, 4, 5 //booelan values int alt_work_area; } htmerge_parameters_struct; int htmerge_index_merge(htmerge_parameters_struct *); //============================================================================= //===== HTDIG HTFUZZY API ===================================================== /************************************************** * HTDIG_DOCUMENTATION for htfuzzy_parameters_struct * * DEBUGGING PARAMETERS * * int debug * Verbose mode. This increases the verbosity of the * program. Using more than 2 is probably only useful * for debugging purposes. * * char logFile * File to stream debugging & error messages to! * * * PARAMETERS * * char configFile * configfile * Use the specified configuration file instead of the default. * * int algorithms_flag * Bitwise Flags to signal algorithms to be used * * soundex == HTDIG_ALG_SOUNDEX * metaphone == HTDIG_ALG_METAPHONE * accents == HTDIG_ALG_ACCENTS * endings == HTDIG_ALG_ENDINGS * synonyms == HTDIG_ALG_SYNONYMS * ***************************************************/ typedef struct htfuzzy_parameters_struct { char configFile[HTDIG_MAX_FILENAME_PATH_L]; int algorithms_flag; //debugging & logfile char logFile[HTDIG_MAX_FILENAME_PATH_L]; //location of log file int debug; //0, 1 ,2, 3, 4, 5 //booelan values } htfuzzy_parameters_struct; // htfuzzy functions int htfuzzy_index(htfuzzy_parameters_struct *); //============================================================================== //===== HTDIG SEARCHING API ==================================================== /************************************************ * HTDIG_DOCUMENTATION for htsearch_parameters_struct * * DEBUGGING PARAMETERS * * int debug * Verbose mode. This increases the verbosity of the; * program. Using more than 2 is probably only useful; * for debugging purposes. The default verbose mode; * gives a progress on what it is doing and where it is.; * * char logFile * File to stream debugging & error messages to! * * STRING PARAMETERS * * char configFile * configfile * Use the specified configuration file instead of the default. * * **************************************************/ typedef struct htsearch_parameters_struct { char configFile[HTDIG_MAX_FILENAME_PATH_L]; char DBpath[HTDIG_MAX_FILENAME_PATH_L]; char locale[16]; //debugging & logfile char logFile[HTDIG_MAX_FILENAME_PATH_L]; //location of log file int debug; //0, 1 ,2, 3, 4, 5 //filters char search_restrict[HTDIG_MAX_FILENAME_PATH_L]; char search_exclude[HTDIG_MAX_FILENAME_PATH_L]; char title_factor[16]; char text_factor[16]; char meta_description_factor[16]; } htsearch_parameters_struct; /***************************************************************** * HTDIG_DOCUMENTATION for htsearch_query_struct * * STRING PARAMETERS * * char raw_query * STRING of text that is the search query -- syntax is important * * INTEGER PARAMETERS * * int algorithms_flag [ALSO CALLED 'method' IN HTDIG] * HTSEARCH_ALG_BOOLEAN * HTSEARCH_ALG_OR * HTSEARCH_ALG_AND * * int sortby_flag * score, date, title & reversed * HTSEARCH_SORT_SCORE * HTSEARCH_SORT_REV_SCORE * HTSEARCH_SORT_TIME * HTSEARCH_SORT_REV_TIME * HTSEARCH_SORT_TITLE * HTSEARCH_SORT_REV_TITLE * * int format * short, long (with excerpt) * HTSEARCH_FORMAT_LONG * HTSEARCH_FORMAT_SHORT * * * * TODO: 'Connect' these htsearch features to this API * * config * Specifies the name of the configuration file. * * exclude * This value is a pattern that specifies which URLs are to be excluded from * the search results. * * keywords * Used to specify a list of required words that have to be in the documents. * * restrict * This value is a pattern that all URLs of the search results will have to * match. * * startyear, startmonth, startday, endyear, endmonth, endday * These values specify the allowed range of document modification dates * allowed in the search results. * * * *****************************************************************/ typedef struct htsearch_query_struct { char raw_query[HTDIG_MAX_QUERY_L]; int algorithms_flag; int sortby_flag; int format; } htsearch_query_struct; /***************************************************************** * HTDIG_DOCUMENTATION for htsearch_query_match_struct * * STRING PARAMETERS * * char title * Title of document returned * * char URL * URL/location-string of document returned * * char excerpt * Excerpt with search words highlighted with * searchword * * INTEGER PARAMETERS * * int score * score in 'number of stars' * [MAX NUMBER OF STARS DECLARED IN CONFIG FILE] * * int score_percent //top result is 100% * * time_t time [DOCUMENT TIME] * struct tm time_tm [DOCUMENT TIME] * int size [TOTAL DOCUMENT SIZE] * * *****************************************************************/ typedef struct htsearch_query_match_struct { char title[HTDIG_DOCUMENT_TITLE_L]; char URL[HTDIG_MAX_FILENAME_PATH_L]; char excerpt[HTDIG_DOCUMENT_EXCERPT_L]; int score; int score_percent; //top result is 100% struct tm time_tm; int size; } htsearch_query_match_struct; // htsearch functions int htsearch_open(htsearch_parameters_struct *); int htsearch_query(htsearch_query_struct *); int htsearch_get_nth_match(int, htsearch_query_match_struct *); int htsearch_close(); //htsearch_free(indicator) char * htsearch_get_error(); #endif /* LIBHTDIG_API_H */ htdig-3.2.0b6/libhtdig/libhtdig_htdig.cc0100644006314600127310000006720110055635561017441 0ustar angusgbhtdig//------------------------------------------------------------- // // libhtdig_htdig.cc // // 1/25/2002 created from htdig.cc // // Neal Richter nealr@rightnow.com // // libhtdig_htdig.cc // // htdig: Indexes the web sites specified in the config file // generating several databases to be used by htmerge // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_htdig.cc,v 1.5 2004/05/28 13:15:29 lha Exp $ // //------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ extern "C" { #include "libhtdig_api.h" } #include "libhtdig_log.h" #include "BasicDocument.h" #include "Document.h" #include "TextCollector.h" #include "Retriever.h" #include "StringList.h" #include "htdig.h" #include "defaults.h" #include "HtURLCodec.h" #include "WordContext.h" #include "HtDateTime.h" #include "HtURLRewriter.h" #include "URL.h" #include "Server.h" //////////////////////////// // For cookie jar //////////////////////////// #include "HtCookieJar.h" #include "HtCookieMemJar.h" #include "HtHTTP.h" //////////////////////////// // If we have this, we probably want it. //#ifdef HAVE_GETOPT_H //#include //#endif //Global Variables for Library int debug = 0; HtRegexList limits; HtRegexList limitsn; String configFile = DEFAULT_CONFIG_FILE; FILE *urls_seen = NULL; FILE *images_seen = NULL; DocumentDB docs; // // Global variables for this file // static int report_statistics = 0; static String minimalFile = 0; static HtDateTime StartTime; static HtDateTime EndTime; //static char *max_hops = NULL; static String credentials; static HtCookieJar *_cookie_jar = NULL; static HtConfiguration * config = NULL; static WordContext * wc = NULL; static int create_text_database = 0; static int alt_work_area = 0; static int initial = 0; int htdig_index_open_flag = FALSE; //new. URLs from 'command-line' #define URL_SEPCHARS " ," static char *myURL = NULL; BasicDocument *a_basicdoc; TextCollector *Indexer; BasicDocument the_basicdoc; //TextCollector the_Indexer; /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_open(...) * * * opens/creates document indexes and initializes variables * for indexing. * * * see libhtdig_api.h headerfile for definition of * htdig_parameters_struct * * * TODO Examine external function calls for error return * codes * *******************************************************/ int htdig_index_open(htdig_parameters_struct * htdig_parms) { int ret = -1; if(htdig_index_open_flag != FALSE) return(FALSE); //load 'comand-line' parameters if (htdig_parms->configFile[0] != 0) configFile = htdig_parms->configFile; if (htdig_parms->URL[0] != 0) { myURL = strdup(htdig_parms->URL); } debug = htdig_parms->debug; if(debug != 0) { ret = logOpen(htdig_parms->logFile); if(ret == FALSE) { reportError (form ("[HTDIG] Error opening log file [%s] . Error:[%d], %s\n", htdig_parms->logFile, errno, strerror(errno)) ); return(HTDIG_ERROR_LOGFILE_OPEN); } } initial = htdig_parms->initial; create_text_database = htdig_parms->create_text_database; //max_hops = strdup(htdig_parms->max_hops); report_statistics = htdig_parms->report_statistics; credentials = htdig_parms->credentials; alt_work_area = htdig_parms->alt_work_area; minimalFile = htdig_parms->minimalFile; if(htdig_parms->use_cookies == TRUE) { // Cookie jar dynamic creation. _cookie_jar = new HtCookieMemJar (); // new cookie jar if (_cookie_jar) HtHTTP::SetCookieJar (_cookie_jar); } // // First set all the defaults and then read the specified config // file to override the defaults. // config = HtConfiguration::config (); config->Defaults (&defaults[0]); if (access ((char *) configFile, R_OK) < 0) { reportError (form ("[HTDIG] Unable to find configuration file '%s'", configFile.get ())); return(HTDIG_ERROR_CONFIG_READ); } config->Read (configFile); //------- Now override config settings ------------ //------- override database path ------------ if(strlen(htdig_parms->DBpath) > 0) { config->Add("database_dir", htdig_parms->DBpath); } //------- custom filters from htdig_parms ---------- if(strlen(htdig_parms->locale) > 0) { config->Add("locale", htdig_parms->locale); } if (config->Find ("locale").empty () && debug > 0) logEntry("Warning: unknown locale!\n"); if (strlen(htdig_parms->max_hops) > 0) { config->Add ("max_hop_count", htdig_parms->max_hops); } if(strlen(htdig_parms->limit_urls_to) > 0) { config->Add("limit_urls_to", htdig_parms->limit_urls_to); } if(strlen(htdig_parms->limit_normalized) > 0) { config->Add("limit_normalized", htdig_parms->limit_normalized); } if(strlen(htdig_parms->exclude_urls) > 0) { config->Add("exclude_urls", htdig_parms->exclude_urls); } if(strlen(htdig_parms->url_rewrite_rules) > 0) { config->Add("url_rewrite_rules", htdig_parms->url_rewrite_rules); } if(strlen(htdig_parms->bad_querystr) > 0) { config->Add("bad_querystr", htdig_parms->bad_querystr); } if(strlen(htdig_parms->locale) > 0) { config->Add("locale", htdig_parms->locale); } if(strlen(htdig_parms->meta_description_factor) > 0) { config->Add("meta_description_factor", htdig_parms->meta_description_factor); } if(strlen(htdig_parms->title_factor) > 0) { config->Add("title_factor", htdig_parms->title_factor); } if(strlen(htdig_parms->text_factor) > 0) { config->Add("text_factor", htdig_parms->text_factor); } if(strlen(htdig_parms->URL) > 0) { config->Add("start_url", htdig_parms->URL); free(myURL); myURL=NULL; } //------- end custom filters from htdig_parms ---------- // Set up credentials for this run if (credentials.length ()) config->Add ("authorization", credentials); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance ()->ErrMsg (); if (url_part_errors.length () != 0) { reportError (form("[HTDIG] Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get ())); return(HTDIG_ERROR_URL_PART); } // // Check url_rewrite_rules for errors. String url_rewrite_rules = HtURLRewriter::instance ()->ErrMsg (); if (url_rewrite_rules.length () != 0) { reportError (form ("[HTDIG] Invalid url_rewrite_rules: %s", url_rewrite_rules.get ())); return(HTDIG_ERROR_URL_REWRITE); } // // If indicated, change the database file names to have the .work // extension // if (alt_work_area != 0) { String configValue = config->Find ("doc_db"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_db", configValue); } configValue = config->Find ("word_db"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("word_db", configValue); } configValue = config->Find ("doc_index"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_index", configValue); } configValue = config->Find ("doc_excerpt"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_excerpt", configValue); } configValue = config->Find ("md5_db"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("md5_db", configValue); } } // // If needed, we will create a list of every URL we come across. //TODO put document-index log file stuff here if (config->Boolean ("create_url_list")) { const String filename = config->Find ("url_list"); urls_seen = fopen (filename, initial ? "w" : "a"); if (urls_seen == 0) { reportError (form ("[HTDIG] Unable to create URL file '%s'", filename.get ())); return(HTDIG_ERROR_URL_CREATE_FILE); } } // // If needed, we will create a list of every image we come across. // if (config->Boolean ("create_image_list")) { const String filename = config->Find ("image_list"); images_seen = fopen (filename, initial ? "w" : "a"); if (images_seen == 0) { reportError (form ("[HTDIG] Unable to create images file '%s'", filename.get ())); return(HTDIG_ERROR_IMAGE_CREATE_FILE); } } // // Set up the limits list // StringList l (config->Find ("limit_urls_to"), " \t"); limits.setEscaped (l, config->Boolean ("case_sensitive")); l.Destroy (); l.Create (config->Find ("limit_normalized"), " \t"); limitsn.setEscaped (l, config->Boolean ("case_sensitive")); l.Destroy (); // // Open the document database // const String filename = config->Find ("doc_db"); if (initial) unlink (filename); const String index_filename = config->Find ("doc_index"); if (initial) unlink (index_filename); const String head_filename = config->Find ("doc_excerpt"); if (initial) unlink (head_filename); if (docs.Open (filename, index_filename, head_filename) < 0) { reportError (form ("[HTDIG] Unable to open/create document database '%s'", filename.get ())); return(HTDIG_ERROR_OPEN_CREATE_DOCDB); } const String word_filename = config->Find ("word_db"); if (initial) unlink (word_filename); // Initialize htword wc = new WordContext; wc->Initialize(*config); //a_basicdoc = new BasicDocument; Indexer = new TextCollector; a_basicdoc = &the_basicdoc; a_basicdoc->Reset(); //Indexer = &the_Indexer; if ((a_basicdoc == NULL) || (Indexer == NULL)) return(FALSE); htdig_index_open_flag = TRUE; return(TRUE); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_simple_doc(...) * * * indexes a simple document supplied by parameter * * see libhtdig_api.h headerfile for definition of * htdig_simple_doc_struct * * TODO Examine external function calls for error return * codes * *******************************************************/ int htdig_index_simple_doc(htdig_simple_doc_struct * a_simple_doc) { int index_error = 0; //int ret = 0; // Reset the document to clean out any old data a_basicdoc->Reset(); a_basicdoc->ModTime(a_simple_doc->doc_time); a_basicdoc->Location(a_simple_doc->location); a_basicdoc->DocumentID(a_simple_doc->documentid); a_basicdoc->Title(a_simple_doc->title); a_basicdoc->MetaContent(a_simple_doc->meta); a_basicdoc->Contents(a_simple_doc->contents); //MUST ALLOCATE & FREE!!! a_basicdoc->ContentType(a_simple_doc->content_type); //MIME-ISH string a_basicdoc->Length(); //TODO What is this error? index_error = Indexer->IndexDoc(*a_basicdoc); return(TRUE); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_urls(...) * * Starts fetch & index of URL supplied in config file * OR supplied in htdig_index_open parameter * * TODO Examine external function calls for error return * codes * TODO Blank/empty URL error? *******************************************************/ int htdig_index_urls(void) { char * temp_URL_list = NULL; char * temp_url = NULL; // Create the Retriever object which we will use to parse all the // HTML files. // In case this is just an update dig, we will add all existing // URLs? // Retriever retriever (Retriever_logUrl); if (minimalFile.length () == 0) { List *list = docs.URLs (); retriever.Initial (*list); delete list; // Add start_url to the initial list of the retriever. // Don't check a URL twice! // Beware order is important, if this bugs you could change // previous line retriever.Initial(*list, 0) to Initial(*list,1) retriever.Initial (config->Find ("start_url"), 1); } // Handle list of URLs given on 'command-line' if (myURL != NULL) { String str; temp_URL_list = strdup(myURL); temp_url = strtok(temp_URL_list, URL_SEPCHARS); while (temp_url != NULL) { str = temp_url; str.chop ("\r\n"); if (str.length () > 0) retriever.Initial (str, 1); temp_url = strtok(NULL, URL_SEPCHARS); } free(temp_URL_list); } else if (minimalFile.length () != 0) { FILE *input = fopen (minimalFile.get (), "r"); char buffer[1000]; if (input) { while (fgets (buffer, sizeof (buffer), input)) { String str (buffer); str.chop ("\r\n\t "); if (str.length () > 0) retriever.Initial (str, 1); } fclose (input); } } // // Go do it! // retriever.Start (); // // All done with parsing. // // // If the user so wants, create a text version of the document database. // if (create_text_database) { const String doc_list = config->Find ("doc_list"); if (initial) unlink (doc_list); docs.DumpDB (doc_list); const String word_dump = config->Find ("word_dump"); if (initial) unlink (word_dump); HtWordList words (*config); if (words.Open (config->Find ("word_db"), O_RDONLY) == OK) { words.Dump (word_dump); } } // // Cleanup // if (images_seen) fclose (images_seen); // // If needed, report some statistics // if (report_statistics) { retriever.ReportStatistics ("htdig"); } return(TRUE); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_close(...) * * Closes the database and destroys various objects * * TODO Examine external function calls for error return * codes * *******************************************************/ int htdig_index_close(void) { int ret = -1; if(htdig_index_open_flag == TRUE) { //delete a_basicdoc; //delete Indexer; Indexer->FlushWordDB(); if (_cookie_jar) delete _cookie_jar; //if (max_hops != NULL) // free(max_hops); if (myURL != NULL) free(myURL); //call destructors here docs.~DocumentDB(); //config->~HtConfiguration(); if (debug != 0) { ret = logClose(); if (ret == FALSE) { reportError (form ("[HTDIG] Error closing log file . Error:[%d], %s\n", errno, strerror(errno)) ); return(HTDIG_ERROR_LOGFILE_CLOSE); } } /* if(config) { WordContext::Finish(); } */ if (wc) delete wc; if (urls_seen) fclose (urls_seen); htdig_index_open_flag = FALSE; } return(TRUE); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_reset(...) * * * TODO Examine external function calls for error return * codes * *******************************************************/ int htdig_index_reset(void) { Indexer->FlushWordDB(); a_basicdoc->Reset(); return(TRUE); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_get_max_head_length(...) * * * Returns size of maximum document storage length * for db.excerpts [htdig.conf:max_head_length] * * This represents the maximum amount of the document * That will be available for excerpting. * * *******************************************************/ int htdig_get_max_head_length() { int ret = -1; if(config != NULL) ret = config->Value("max_head_length"); return(ret); } /******************************************************* * * LIBHTDIG API FUNCTION * * int htdig_index_test_url(...) * * * Test a URL for filter Pass/Fail * * Pass = return(TRUE) * Fail = return(XXX) [Negative Value] * * * * * *******************************************************/ //int htdig_index_test_url(htdig_parameters_struct *htdig_parms) int htdig_index_test_url(htdig_parameters_struct *htdig_parms) { //int ret = FALSE; String the_URL(htdig_parms->URL); HtConfiguration* config= HtConfiguration::config(); Dictionary invalids; Dictionary valids; URL aUrl(the_URL); String rewritten_url(the_URL); StringList tmpList; HtRegex limitTo; HtRegex excludeFrom; //initalize outgoing-parameter rewritten_URL htdig_parms->rewritten_URL[0] = 0; #ifdef DEBUG //output relevant config variables cout << " bad_extensions = " << config->Find("bad_extensions") << endl; cout << " valid_extensions = " << config->Find("valid_extensions") << endl; cout << " exclude_urls = " << config->Find("exclude_urls") << endl; cout << " bad_querystr = " << config->Find("bad_querystr") << endl; cout << " limit_urls_to = " << config->Find("limit_urls_to") << endl; cout << " limit_normalized = " << config->Find("limit_normalized") << endl; cout << " restrict = " << config->Find("restrict") << endl; cout << " exclude = " << config->Find("exclude") << endl; #endif //------------ read the config file if it is given --------------- if (htdig_parms->configFile[0] != 0) configFile = htdig_parms->configFile; config = HtConfiguration::config (); config->Defaults (&defaults[0]); if (access ((char *) configFile, R_OK) < 0) { reportError (form ("[HTDIG] Unable to find configuration file '%s'", configFile.get ())); return(HTDIG_ERROR_CONFIG_READ); } config->Read (configFile); //---------- Now override config settings ----------------- //------- override database path ------------ if(strlen(htdig_parms->DBpath) > 0) { config->Add("database_dir", htdig_parms->DBpath); } //------- custom filters from htdig_parms ---------- if(strlen(htdig_parms->locale) > 0) { config->Add("locale", htdig_parms->locale); } if (config->Find ("locale").empty () && debug > 0) logEntry("Warning: unknown locale!\n"); if (strlen(htdig_parms->max_hops) > 0) { config->Add ("max_hop_count", htdig_parms->max_hops); } if(strlen(htdig_parms->limit_urls_to) > 0) { config->Add("limit_urls_to", htdig_parms->limit_urls_to); } if(strlen(htdig_parms->limit_normalized) > 0) { config->Add("limit_normalized", htdig_parms->limit_normalized); } if(strlen(htdig_parms->exclude_urls) > 0) { config->Add("exclude_urls", htdig_parms->exclude_urls); } if(strlen(htdig_parms->url_rewrite_rules) > 0) { config->Add("url_rewrite_rules", htdig_parms->url_rewrite_rules); } if(strlen(htdig_parms->bad_querystr) > 0) { config->Add("bad_querystr", htdig_parms->bad_querystr); } if(strlen(htdig_parms->locale) > 0) { config->Add("locale", htdig_parms->locale); } if(strlen(htdig_parms->meta_description_factor) > 0) { config->Add("meta_description_factor", htdig_parms->meta_description_factor); } if(strlen(htdig_parms->title_factor) > 0) { config->Add("title_factor", htdig_parms->title_factor); } if(strlen(htdig_parms->text_factor) > 0) { config->Add("text_factor", htdig_parms->text_factor); } //------------------------------------------------------------------- #ifdef DEBUG //output relevant config variables cout << " bad_extensions = " << config->Find("bad_extensions") << endl; cout << " valid_extensions = " << config->Find("valid_extensions") << endl; cout << " exclude_urls = " << config->Find("exclude_urls") << endl; cout << " bad_querystr = " << config->Find("bad_querystr") << endl; cout << " limit_urls_to = " << config->Find("limit_urls_to") << endl; cout << " limit_normalized = " << config->Find("limit_normalized") << endl; cout << " restrict = " << config->Find("restrict") << endl; cout << " exclude = " << config->Find("exclude") << endl; #endif //------ bad_extensions ----------------------------------------------- //A list of bad extensions, separated by spaces or tabs String t = config->Find("bad_extensions"); String lowerp; char *p = strtok(t, " \t"); while (p) { // Extensions are case insensitive lowerp = p; lowerp.lowercase(); invalids.Add(lowerp, 0); p = strtok(0, " \t"); } //------ valid_extensions ------------------------------------------------ // Valid extensions are performed similarly // A list of valid extensions, separated by spaces or tabs t = config->Find("valid_extensions"); p = strtok(t, " \t"); while (p) { // Extensions are case insensitive lowerp = p; lowerp.lowercase(); valids.Add(lowerp, 0); p = strtok(0, " \t"); } //----- rewrite the URL------------------------------------------ aUrl.rewrite(); rewritten_url = aUrl.get(); if(rewritten_url.length() <= 0) { //Rejected: empty rewritten URL String temp = config->Find("url_rewrite_rules"); strcpy(htdig_parms->rewritten_URL, temp.get()); system(form("echo \"%s\" > /tmp/neal", temp.get())); return(HTDIG_ERROR_TESTURL_REWRITE_EMPTY); } //cout << form("TestURL: org=[%s]\n", the_URL.get()); //cout << form(" rewritten[%s]\n", rewritten_url.get()); //copy the rewritten URL for outgoing parm pass strcpy(htdig_parms->rewritten_URL, rewritten_url.get()); //---- exclude_urls --------------------------------------------- // If the URL contains any of the patterns in the exclude list, // mark it as invalid /*if(strlen(htdig_parms->exclude_urls) > 0) tmpList.Create(htdig_parms->exclude_urls," \t"); else*/ tmpList.Create(config->Find("exclude_urls")," \t"); HtRegexList excludes; excludes.setEscaped(tmpList, config->Boolean("case_sensitive")); if (excludes.match(rewritten_url, 0, 0) != 0) { //Rejected: item in exclude list return(HTDIG_ERROR_TESTURL_EXCLUDE); } //---- bad_querystr ------------------------------------------- // If the URL has a query string and it is in the bad query list // mark it as invalid tmpList.Destroy(); /*if(strlen(htdig_parms->bad_querystr) > 0) tmpList.Create(htdig_parms->bad_querystr, " \t"); else*/ tmpList.Create(config->Find("bad_querystr"), " \t"); HtRegexList badquerystr; badquerystr.setEscaped(tmpList, config->Boolean("case_sensitive")); char *ext = strrchr((char*)rewritten_url, '?'); if (ext && badquerystr.match(ext, 0, 0) != 0) { //if (debug > 2) // cout << endl << " Rejected: item in bad query list "; return(HTDIG_ERROR_TESTURL_BADQUERY); } //------ invalid_extensions #2 ------ // See if the file extension is in the list of invalid ones ext = strrchr((char*)rewritten_url, '.'); String lowerext; if (ext && strchr(ext,'/')) // Ignore a dot if it's not in the ext = NULL; // final component of the path. if(ext) { lowerext.set(ext); int parm = lowerext.indexOf('?'); // chop off URL parameter if (parm >= 0) lowerext.chop(lowerext.length() - parm); lowerext.lowercase(); if (invalids.Exists(lowerext)) { //Rejected: Extension is invalid! return(HTDIG_ERROR_TESTURL_EXTENSION); } } //------ valid_extensions #2 ------ // Or NOT in the list of valid ones if (ext && valids.Count() > 0 && !valids.Exists(lowerext)) { //Rejected: Extension is not valid! return(HTDIG_ERROR_TESTURL_EXTENSION2); } //----- limit_urls_to & limit_normalized ------------------------------ // Set up the limits list StringList l; /*if(strlen(htdig_parms->limit_urls_to) > 0) l.Create(htdig_parms->limit_urls_to, " \t"); else*/ l.Create(config->Find ("limit_urls_to"), " \t"); limits.setEscaped (l, config->Boolean ("case_sensitive")); l.Destroy (); /*if(strlen(htdig_parms->limit_normalized) > 0) l.Create (htdig_parms->limit_normalized, " \t"); else*/ l.Create (config->Find ("limit_normalized"), " \t"); limitsn.setEscaped (l, config->Boolean ("case_sensitive")); l.Destroy (); // If any of the limits are met, we allow the URL if (limits.match(rewritten_url, 1, 0) == 0) { //Rejected: URL not in the limits!; return(HTDIG_ERROR_TESTURL_LIMITS); } // or not in list of normalized urls // Warning! should be last in checks because of aUrl normalization aUrl.normalize(); if (limitsn.match(rewritten_url.get(), 1, 0) == 0) { //Rejected: not in "limit_normalized" list! return(HTDIG_ERROR_TESTURL_LIMITSNORM); } //----- restrict & exclude ---------------------------------- //Search-Time Filters String temp; /*if(strlen(htdig_parms->search_restrict) > 0) temp = htdig_parms->search_restrict; else*/ temp = config->Find("restrict"); if (temp.length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(temp, " \t\r\n\001|"); limitTo.setEscaped(l); } /*if(strlen(htdig_parms->search_exclude) > 0) temp = htdig_parms->search_exclude; else*/ temp = config->Find("exclude"); if (temp.length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(temp, " \t\r\n\001|"); excludeFrom.setEscaped(l); } //Restrict Test if (limitTo.match(rewritten_url, 1, 0) == 0) { //Rejected URL Not in SearchTime Restrict List return(HTDIG_ERROR_TESTURL_SRCH_RESTRICT); } //Exclude Test if (excludeFrom.match(rewritten_url, 0, 0) != 0) { //Rejected URL in SearchTime Exclude List return(HTDIG_ERROR_TESTURL_SRCH_EXCLUDE); } //Success! return TRUE; } htdig-3.2.0b6/libhtdig/libhtdig_htfuzzy.cc0100644006314600127310000001501310055635561020057 0ustar angusgbhtdig//---------------------------------------------------------------- // // libhtdig_htfuzzy.cc // // 1/25/2002 created from htfuzzy.cc // // Neal Richter nealr@rightnow.com // // libhtdig_htfuzzy.cc // // htfuzzy: Create one or more ``fuzzy'' indexes into the main word database. // These indexes can be used by htsearch to perform a search that uses // other algorithms than exact word match. // // This program is meant to be run after htmerge has created the word // database. // // For each fuzzy algorithm, there will be a separate database. Each // database is simply a mapping from the fuzzy key to a list of words // in the main word database. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_htfuzzy.cc,v 1.5 2004/05/28 13:15:29 lha Exp $ // //---------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ extern "C" { #include "libhtdig_api.h" } #include "libhtdig_log.h" //#include "htfuzzy.h" //NOT USED #include "Fuzzy.h" #include "Accents.h" #include "Soundex.h" #include "Endings.h" #include "Metaphone.h" #include "Synonym.h" #include "htString.h" #include "List.h" #include "Dictionary.h" #include "defaults.h" #include "HtWordList.h" #include "WordContext.h" // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif #include "HtConfiguration.h" #include "HtWordList.h" #include #ifndef _WIN32 #include #endif #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include extern int debug; static HtConfiguration * config = NULL; //***************************************************************************** // int main(int ac, char **av) // //int main(int ac, char **av) int htfuzzy_index(htfuzzy_parameters_struct * htfuzzy_parms) { String configFile = DEFAULT_CONFIG_FILE; int ret = 0; // // Parse command line arguments // debug = htfuzzy_parms->debug; if (debug != 0) { ret = logOpen(htfuzzy_parms->logFile); if (ret == FALSE) { fprintf(stderr, "htdig: Error opening file [%s]. Error:[%d], %s\n", htfuzzy_parms->logFile, errno, strerror(errno)); } } configFile = htfuzzy_parms->configFile; config = HtConfiguration::config(); // // Determine what algorithms to use // List wordAlgorithms; List noWordAlgorithms; if (htfuzzy_parms->algorithms_flag & HTDIG_ALG_SOUNDEX) { wordAlgorithms.Add(new Soundex(*config)); } else if (htfuzzy_parms->algorithms_flag & HTDIG_ALG_METAPHONE) { wordAlgorithms.Add(new Metaphone(*config)); } else if (htfuzzy_parms->algorithms_flag & HTDIG_ALG_ACCENTS) { wordAlgorithms.Add(new Accents(*config)); } else if (htfuzzy_parms->algorithms_flag & HTDIG_ALG_ENDINGS) { noWordAlgorithms.Add(new Endings(*config)); } else if (htfuzzy_parms->algorithms_flag & HTDIG_ALG_SYNONYMS) { noWordAlgorithms.Add(new Synonym(*config)); } if (wordAlgorithms.Count() == 0 && noWordAlgorithms.Count() == 0) { logEntry(form("htfuzzy: No algorithms specified\n")); } // // Find and parse the configuration file. // config->Defaults(&defaults[0]); if (access((char *) configFile, R_OK) < 0) { reportError(form("[HTFUZZY] Unable to find configuration file '%s'", configFile.get())); } config->Read(configFile); // Initialize htword library (key description + wordtype...) WordContext::Initialize(*config); Fuzzy *fuzzy; if (wordAlgorithms.Count() > 0) { // // Open the word database so that we can grab the words from it. // HtWordList worddb(*config); if (worddb.Open(config->Find("word_db"), O_RDONLY) == OK) { // // Go through all the words in the database // List *words = worddb.Words(); String *key; Fuzzy *fuzzy = 0; String word, fuzzyKey; int count = 0; words->Start_Get(); while ((key = (String *) words->Get_Next())) { word = *key; wordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) wordAlgorithms.Get_Next())) { fuzzy->addWord(word); } count++; if ((count % 100) == 0 && debug) { //cout << "htfuzzy: words: " << count << '\n'; } } if (debug) { logEntry(form("htfuzzy: total words: %d\n", count)); logEntry(form("htfuzzy: Writing index files...\n")); } // // All the information is now in memory. // Write all of it out to the individual databases // wordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) wordAlgorithms.Get_Next())) { fuzzy->writeDB(); } worddb.Close(); words->Destroy(); delete words; if (fuzzy) delete fuzzy; } else { reportError(form("[htfuzzy] Unable to open word database %s", config->Find("word_db").get())); } } if (noWordAlgorithms.Count() > 0) { noWordAlgorithms.Start_Get(); while ((fuzzy = (Fuzzy *) noWordAlgorithms.Get_Next())) { if (debug) { logEntry(form( "htfuzzy: Selected algorithm: %s\n", fuzzy->getName())); } if (fuzzy->createDB(*config) == NOTOK) { logEntry(form("htfuzzy: Could not create database for algorithm: %s\n", fuzzy->getName())); } } } if (debug) { logEntry("htfuzzy: Done.\n"); } if (debug != 0) { ret = logClose(); if (ret == FALSE) { fprintf(stderr, "htfuzzy: Error closing file [%s]. Error:[%d], %s\n", htfuzzy_parms->logFile, errno, strerror(errno)); } } delete config; return 0; } htdig-3.2.0b6/libhtdig/libhtdig_htmerge.cc0100644006314600127310000002657710055635561020010 0ustar angusgbhtdig//---------------------------------------------------------------- // // libhtdig_htmerge.cc // // 1/25/2002 created from htmerge.cc // // Neal Richter nealr@rightnow.com // // libhtdig_htmerge.cc // // htmerge: Merges two databases and/or updates databases to remove // old documents and ensures the databases are consistent. // Calls db.cc, docs.cc, and/or words.cc as necessary // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_htmerge.cc,v 1.5 2004/05/28 13:15:29 lha Exp $ // //---------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ extern "C" { #include "libhtdig_api.h" } #include "libhtdig_log.h" #include "WordContext.h" #include "good_strtok.h" #include "defaults.h" #include "DocumentDB.h" #include "HtURLCodec.h" #include "HtWordList.h" #include "HtWordReference.h" #include "htString.h" #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #ifndef _WIN32 #include #endif #include #include #include // If we have this, we probably want it. //#ifdef HAVE_GETOPT_H //#include //#endif //Global Variables for this file // This hash is used to keep track of all the document IDs which have to be // discarded. // This is generated from the doc database and is used to prune words // from the word db static Dictionary discard_list; // This config is used for merging multiple databses static HtConfiguration merge_config; static HtConfiguration *config = NULL; static int verbose = 0; //static int stats = 0; static int alt_work_area = 0; //static String configFile = DEFAULT_CONFIG_FILE; extern String configFile; static String merge_configFile = 0; // Component procedures static int mergeDB (); int htmerge_index_merge(htmerge_parameters_struct *htmerge_parms) { int ret = -1; int merge_ret = -1; //load htmerge 'command-line parameters' configFile = htmerge_parms->configFile; merge_configFile = htmerge_parms->merge_configFile; verbose = htmerge_parms->debug; if(verbose != 0) { ret = logOpen(htmerge_parms->logFile); if(ret == FALSE) { reportError (form ("[HTDIG] Error opening log file [%s] . Error:[%d], %s\n", htmerge_parms->logFile, errno, strerror(errno)) ); return(HTMERGE_ERROR_LOGFILE_OPEN); } } alt_work_area = htmerge_parms->alt_work_area; config = HtConfiguration::config (); config->Defaults (&defaults[0]); if (access ((char *) configFile, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to find configuration file '%s'", configFile.get ())); return(HTMERGE_ERROR_CONFIG_READ); } config->Read (configFile); // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance ()->ErrMsg (); if (url_part_errors.length () != 0) { reportError (form("[HTMERGE] Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get ())); return(HTMERGE_ERROR_URL_PART); } if (merge_configFile.length ()) { merge_config.Defaults (&defaults[0]); if (access ((char *) merge_configFile, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to find configuration file '%s'", merge_configFile.get ())); return(HTMERGE_ERROR_CONFIG_READ); } merge_config.Read (merge_configFile); } if (alt_work_area != 0) { String configValue; configValue = config->Find ("word_db"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("word_db", configValue); } configValue = config->Find ("doc_db"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_db", configValue); } configValue = config->Find ("doc_index"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_index", configValue); } configValue = config->Find ("doc_excerpt"); if (configValue.length () != 0) { configValue << ".work"; config->Add ("doc_excerpt", configValue); } } WordContext::Initialize(*config); if (merge_configFile.length()) { // Merge the databases specified in merge_configFile into the current // databases. Do this first then update the other databases as usual // Note: We don't have to specify anything, it's all in the config vars merge_ret = mergeDB(); } //call destructors here config->~HtConfiguration(); merge_config.~HtConfiguration(); if (verbose != 0) { ret = logClose(); if (ret == FALSE) { reportError (form("[HTMERGE]: Error closing file [%s]. Error:[%d], %s\n", htmerge_parms->logFile, errno, strerror(errno)) ); return(HTMERGE_ERROR_LOGFILE_CLOSE); } } return(TRUE); } //***************************************************************************** // void mergeDB() // static int mergeDB () { HtConfiguration *config = HtConfiguration::config (); DocumentDB merge_db, db; List *urls; Dictionary merge_dup_ids, db_dup_ids; // Lists of DocIds to ignore int docIDOffset; const String doc_index = config->Find ("doc_index"); if (access (doc_index, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to open document index '%s'", (const char *) doc_index)); return(HTMERGE_ERROR_DOCINDEX_READ); } const String doc_excerpt = config->Find ("doc_excerpt"); if (access (doc_excerpt, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to open document excerpts '%s'", (const char *) doc_excerpt)); return(HTMERGE_ERROR_EXCERPTDB_READ); } const String doc_db = config->Find ("doc_db"); if (db.Open (doc_db, doc_index, doc_excerpt) < 0) { reportError (form ("[HTMERGE] Unable to open/create document database '%s'", (const char *) doc_db)); return(HTMERGE_ERROR_DOCDB_READ); } const String merge_doc_index = merge_config["doc_index"]; if (access (merge_doc_index, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to open document index '%s'", (const char *) merge_doc_index)); return(HTMERGE_ERROR_DOCINDEX_READ); } const String merge_doc_excerpt = merge_config["doc_excerpt"]; if (access (merge_doc_excerpt, R_OK) < 0) { reportError (form ("[HTMERGE] Unable to open document excerpts '%s'", (const char *) merge_doc_excerpt)); return(HTMERGE_ERROR_EXCERPTDB_READ); } const String merge_doc_db = merge_config["doc_db"]; if (merge_db.Open (merge_doc_db, merge_doc_index, merge_doc_excerpt) < 0) { reportError (form ("[HTMERGE] Unable to open document database '%s'", (const char *) merge_doc_db)); return(HTMERGE_ERROR_DOCDB_READ); } // Start the merging by going through all the URLs that are in // the database to be merged urls = merge_db.URLs (); // This ensures that every document added from merge_db has a unique ID // in the new database docIDOffset = db.NextDocID (); urls->Start_Get (); String *url; String id; while ((url = (String *) urls->Get_Next ())) { DocumentRef *ref = merge_db[url->get ()]; DocumentRef *old_ref = db[url->get ()]; if (!ref) continue; if (old_ref) { // Oh well, we knew this would happen. Let's get the duplicate // And we'll only use the most recent date. if (old_ref->DocTime () >= ref->DocTime ()) { // Cool, the ref we're merging is too old, just ignore it char str[20]; sprintf (str, "%d", ref->DocID ()); merge_dup_ids.Add (str, 0); if (verbose > 1) { logEntry(form("[HTMERGE] Duplicate, URL: {%s} ignoring & merging copy\n", url)); } } else { // The ref we're merging is newer, delete the old one and add char str[20]; sprintf (str, "%d", old_ref->DocID ()); db_dup_ids.Add (str, 0); db.Delete (old_ref->DocID ()); ref->DocID (ref->DocID () + docIDOffset); db.Add (*ref); if (verbose > 1) { logEntry(form("[HTMERGE] Duplicate, URL: {%s} ignoring destination copy\n",url->get())); } } } else { // It's a new URL, just add it, making sure to load the excerpt merge_db.ReadExcerpt (*ref); ref->DocID (ref->DocID () + docIDOffset); db.Add (*ref); if (verbose > 1) { logEntry(form("[HTMERGE] Merged URL: {%s} \n",url->get())); } } delete ref; delete old_ref; } delete urls; // As reported by Roman Dimov, we must update db.NextDocID() // because of all the added records... db.IncNextDocID (merge_db.NextDocID ()); merge_db.Close (); db.Close (); // OK, after merging the doc DBs, we do the same for the words HtWordList mergeWordDB (*config), wordDB (*config); List *words; String docIDKey; if (wordDB.Open (config->Find ("word_db"), O_RDWR) < 0) { reportError (form ("[HTMERGE] Unable to open/create word database '%s'", (const char *) config->Find ("word_db"))); return(HTMERGE_ERROR_WORDDB_READ); } if (mergeWordDB.Open (merge_config["word_db"], O_RDONLY) < 0) { reportError (form ("[HTMERGE] Unable to open word database '%s'", (const char *) merge_config["word_db"])); return(HTMERGE_ERROR_WORDDB_READ); } // Start the merging by going through all the URLs that are in // the database to be merged words = mergeWordDB.WordRefs (); words->Start_Get (); HtWordReference *word; while ((word = (HtWordReference *) words->Get_Next ())) { docIDKey = word->DocID (); if (merge_dup_ids.Exists (docIDKey)) continue; word->DocID (word->DocID () + docIDOffset); wordDB.Override (*word); } delete words; words = wordDB.WordRefs (); words->Start_Get (); while ((word = (HtWordReference *) words->Get_Next ())) { docIDKey = word->DocID (); if (db_dup_ids.Exists (docIDKey)) wordDB.Delete (*word); } delete words; // Cleanup--just close the two word databases mergeWordDB.Close (); wordDB.Close (); return(TRUE); } htdig-3.2.0b6/libhtdig/libhtdig_htsearch.cc0100644006314600127310000007046610055635561020152 0ustar angusgbhtdig//---------------------------------------------------------------- // // libhtdig_htsearch.cc // // 1/25/2002 created from htsearch.cc // // Neal Richter nealr@rightnow.com // // // htsearch: The main search CGI. Parses the CGI input, reads the config files // and calls the necessary code to put together the result lists // and the final display. // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_htsearch.cc,v 1.4 2004/05/28 13:15:29 lha Exp $ // //---------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ extern "C" { #include "libhtdig_api.h" } #include "libhtdig_log.h" #include "htsearch.h" #include "defaults.h" #include "WeightWord.h" #include "parser.h" #include "ResultFetch.h" #include "../htfuzzy/Fuzzy.h" #include "cgi.h" #include "WordRecord.h" #include "HtWordList.h" #include "StringList.h" #include "IntObject.h" #include "HtURLCodec.h" #include "HtURLRewriter.h" #include "WordContext.h" #include "HtRegex.h" #include "Collection.h" //define _XOPEN_SOURCE //#define _GNU_SOURCE #include #include #include #ifndef _WIN32 #include #endif // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif typedef void (*SIGNAL_HANDLER) (...); // ResultList *htsearch(const String&, List &, Parser *); int htsearch(Collection *, List &, Parser *); void setupWords(char *, List &, int, Parser *, String &); void createLogicalWords(List &, String &, String &); void reportError(char *); void convertToBoolean(List & words); void doFuzzy(WeightWord *, List &, List &); void addRequiredWords(List &, StringList &); int minimum_word_length = 3; StringList boolean_keywords; Parser *parser = NULL; extern String configFile; extern int debug; static HtConfiguration *config = NULL; Dictionary selected_collections; // Multiple database support Collection *collection = NULL; String errorMsg; String originalWords; String origPattern; String logicalWords; String logicalPattern; StringMatch *searchWordsPattern = NULL; StringList requiredWords; //TODO add this HtRegex limit_to; HtRegex exclude_these; // List searchWords; List *searchWords = NULL; StringList collectionList; // List of databases to search on static int total_matches = 0; static List *matches_list = 0; static ResultFetch *resultfetch = 0; //***************************************************************************** // int main() // //int main(int ac, char **av) int htsearch_open(htsearch_parameters_struct * htsearch_parms) { int ret = -1; int override_config = 0; String logicalWords; String logicalPattern; // StringMatch searchWordsPattern; StringMatch *searchWordsPattern = NULL; StringList requiredWords; //int i; //int c; int cInd = 0; //load 'comand-line' parameters if (htsearch_parms->configFile[0] != 0) configFile = htsearch_parms->configFile; debug = htsearch_parms->debug; if (debug != 0) { ret = logOpen(htsearch_parms->logFile); if (ret == FALSE) { reportError(form("[HTDIG] Error opening log file [%s] . Error:[%d], %s\n", htsearch_parms->logFile, errno, strerror(errno))); return (HTSEARCH_ERROR_LOGFILE_OPEN); } } //case 'c': // The default is obviously to do this securely // but if people want to shoot themselves in the foot... // configFile = optarg; // override_config = 1; // // The total search can NEVER take more than 5 minutes. // //alarm(5 * 60); errorMsg = ""; config = HtConfiguration::config(); // Each collection is handled in an iteration. Reset the following so // that we start with a clean slate. // logicalWords = 0; origPattern = 0; logicalPattern = 0; searchWords = new List; searchWordsPattern = new StringMatch; char *config_name = collectionList[cInd]; if (config_name && config_name[0] == '\0') config_name = NULL; // use default config // // Setup the configuration database. First we read the compiled defaults. // Then we override those with defaults read in from the configuration // file, and finally we override some attributes with information we // got from the HTML form. // config->Defaults(&defaults[0]); // To allow . in filename while still being 'secure', // e.g. htdig-f.q.d.n.conf if (!override_config && config_name && (strstr(config_name, "./") == NULL)) { char *configDir = getenv("CONFIG_DIR"); if (configDir) { configFile = configDir; } else { configFile = CONFIG_DIR; } if (strlen(config_name) == 0) configFile = DEFAULT_CONFIG_FILE; else configFile << '/' << config_name << ".conf"; } if (access((char *) configFile, R_OK) < 0) { reportError(form("Unable to read configuration file '%s'", configFile.get())); return (HTSEARCH_ERROR_CONFIG_READ); } config->Read(configFile); //---------- Now override config settings ----------------- //------- override database path ------------ if (strlen(htsearch_parms->DBpath) > 0) { config->Add("database_dir", htsearch_parms->DBpath); } //------- custom filters from htsearch_parms ---------- //resrict,exclude,urlrewrite if (strlen(htsearch_parms->meta_description_factor) > 0) { config->Add("meta_description_factor", htsearch_parms->meta_description_factor); } if (strlen(htsearch_parms->title_factor) > 0) { config->Add("title_factor", htsearch_parms->title_factor); } if (strlen(htsearch_parms->text_factor) > 0) { config->Add("text_factor", htsearch_parms->text_factor); } if(strlen(htsearch_parms->locale) > 0) { config->Add("locale", htsearch_parms->locale); } //------------------------------------------------------------------- // Initialize htword library (key description + wordtype...) WordContext::Initialize(*config); //NON-CGI Usage libhtdig /* config->Add("match_method", input["method"]); config->Add("template_name", input["format"]); // minimum check for a valid int value of "matchesperpage" cgi variable if (atoi(input["matchesperpage"]) > 0) config->Add("matches_per_page", input["matchesperpage"]); pageNumber = atoi(input["page"]); config->Add("config", input["config"]); config->Add("restrict", input["restrict"]); config->Add("exclude", input["exclude"]); config->Add("keywords", input["keywords"]); requiredWords.Create(config->Find("keywords"), " \t\r\n\001"); config->Add("sort", input["sort"]); config->Add("startmonth", input["startmonth"]); config->Add("startday", input["startday"]); config->Add("startyear", input["startyear"]); config->Add("endmonth", input["endmonth"]); config->Add("endday", input["endday"]); config->Add("endyear", input["endyear"]); StringList form_vars(config->Find("allow_in_form"), " \t\r\n"); for (i = 0; i < form_vars.Count(); i++) { if (input.exists(form_vars[i])) config->Add(form_vars[i], input[form_vars[i]]); } */ //NON-CGI Usage libhtdig minimum_word_length = config->Value("minimum_word_length", minimum_word_length); // // Compile the URL limit patterns. // if (config->Find("restrict").length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(config->Find("restrict"), " \t\r\n\001|"); limit_to.setEscaped(l); String u = l.Join('|'); config->Add("restrict", u); // re-create the config attribute } if (config->Find("exclude").length()) { // Create a temporary list from either the configuration // file or the input parameter StringList l(config->Find("exclude"), " \t\r\n\001|"); exclude_these.setEscaped(l); String u = l.Join('|'); config->Add("exclude", u); // re-create the config attribute } // // Check url_part_aliases and common_url_parts for // errors. String url_part_errors = HtURLCodec::instance()->ErrMsg(); if (url_part_errors.length() != 0) { reportError(form("Invalid url_part_aliases or common_url_parts: %s", url_part_errors.get())); return (HTSEARCH_ERROR_URL_PART); } // for htsearch, use search_rewrite_rules attribute for HtURLRewriter. config->AddParsed("url_rewrite_rules", "${search_rewrite_rules}"); url_part_errors = HtURLRewriter::instance()->ErrMsg(); if (url_part_errors.length() != 0) reportError(form("Invalid url_rewrite_rules: %s", url_part_errors.get())); // Load boolean_keywords from configuration // they should be placed in this order: // 0 1 2 // and or not boolean_keywords.Create(config->Find("boolean_keywords"), "| \t\r\n\001"); if (boolean_keywords.Count() != 3) reportError("boolean_keywords attribute should have three entries"); parser = new Parser(); return (TRUE); } //--------------------------------------------------------------------------------------- // // // RETURN: Number of Documents resulted from search // //--------------------------------------------------------------------------------------- int htsearch_query(htsearch_query_struct * htseach_query) { int total_match_count = 0; originalWords = htseach_query->raw_query; originalWords.chop(" \t\r\n"); //sort switch (htseach_query->sortby_flag) { case HTSEARCH_SORT_SCORE: config->Add("sort", "score"); break; case HTSEARCH_SORT_REV_SCORE: config->Add("sort", "revscore"); break; case HTSEARCH_SORT_TIME: config->Add("sort", "time"); break; case HTSEARCH_SORT_REV_TIME: config->Add("sort", "revtime"); break; case HTSEARCH_SORT_TITLE: config->Add("sort", "title"); break; case HTSEARCH_SORT_REV_TITLE: config->Add("sort", "revtitle"); break; } switch (htseach_query->algorithms_flag) { case HTSEARCH_ALG_BOOLEAN: config->Add("match_method", "boolean"); break; case HTSEARCH_ALG_OR: config->Add("match_method", "or"); break; case HTSEARCH_ALG_AND: config->Add("match_method", "and"); break; } //format switch (htseach_query->algorithms_flag) { case HTSEARCH_FORMAT_SHORT: config->Add("template_name", "builtin-short"); break; case HTSEARCH_FORMAT_LONG: config->Add("template_name", "builtin-long"); break; } origPattern = 0; logicalWords = 0; logicalPattern = 0; searchWordsPattern = new StringMatch; // Iterate over all specified collections (databases) //for (int cInd = 0; errorMsg.empty() && cInd < collectionList.Count(); cInd++) //{ // Parse the words to search for from the argument list. // This will produce a list of WeightWord objects. // setupWords(originalWords, *searchWords, strcmp(config->Find("match_method"), "boolean") == 0, parser, origPattern); // // Convert the list of WeightWord objects to a pattern string // that we can compile. // createLogicalWords(*searchWords, logicalWords, logicalPattern); // // Assemble the full pattern for excerpt matching and highlighting // origPattern += logicalPattern; searchWordsPattern->IgnoreCase(); searchWordsPattern->IgnorePunct(); searchWordsPattern->Pattern(logicalPattern); // this should now be enough //searchWordsPattern.Pattern(origPattern); //if (debug > 2) // cout << "Excerpt pattern: " << origPattern << "\n"; // // If required keywords were given in the search form, we will // modify the current searchWords list to include the required // words. // if (requiredWords.Count() > 0) { addRequiredWords(*searchWords, requiredWords); } // // Perform the actual search. The function htsearch() is used for this. // The Dictionary it returns is then passed on to the Display object to // actually render the results in HTML. // const String word_db = config->Find("word_db"); if (access(word_db, R_OK) < 0) { reportError(form("Unable to read word database file '%s'\nDid you run htdig?", word_db.get())); return (HTSEARCH_ERROR_WORDDB_READ); } // ResultList *results = htsearch((char*)word_db, searchWords, parser); String doc_index = config->Find("doc_index"); if (access((char *) doc_index, R_OK) < 0) { reportError(form("Unable to read document index file '%s'\nDid you run htdig?", doc_index.get())); return (HTSEARCH_ERROR_DOCINDEX_READ); } const String doc_db = config->Find("doc_db"); if (access(doc_db, R_OK) < 0) { reportError(form("Unable to read document database file '%s'\nDid you run htdig?", doc_db.get())); return (HTSEARCH_ERROR_DOCDB_READ); } const String doc_excerpt = config->Find("doc_excerpt"); if (access(doc_excerpt, R_OK) < 0) { reportError(form("Unable to read document excerpts '%s'\nDid you run htdig?", doc_excerpt.get())); return (HTSEARCH_ERROR_EXCERPTDB_READ); } // Multiple database support collection = new Collection((char *) configFile, word_db.get(), doc_index.get(), doc_db.get(), doc_excerpt.get()); // Perform search within the collection. Each collection stores its // own result list. total_match_count += htsearch(collection, *searchWords, parser); collection->setSearchWords(searchWords); collection->setSearchWordsPattern(searchWordsPattern); selected_collections.Add(configFile, collection); if (parser->hadError()) errorMsg = parser->getErrorMessage(); delete parser; //} total_matches = total_match_count; if (total_matches > 0) { resultfetch = new ResultFetch(&selected_collections, collectionList); if (resultfetch->hasTemplateError()) { reportError(form("Unable to read template file '%s'\nDoes it exist?", (const char *) config->Find("template_name"))); return (HTSEARCH_ERROR_TEMPLATE_ERROR); } resultfetch->setOriginalWords(originalWords); resultfetch->setLimit(&limit_to); resultfetch->setExclude(&exclude_these); resultfetch->setLogicalWords(logicalWords); if (!errorMsg.empty()) resultfetch->displaySyntaxError(errorMsg); else { matches_list = resultfetch->fetch(); //matches_list->Start_Get(); } } //if ((total_matches > 0) && (desired_match_index == 0)) return (total_match_count); } //------------------ htsearch_get_nth_match (...) ------------------------------------- // // Parameters // result_desired_index ZERO based results index. // query_result structure to fill with result // // htsearch_query_match_struct: // char title[HTDIG_DOCUMENT_TITLE_L]; // char URL[HTDIG_MAX_FILENAME_PATH_L]; // char excerpt[HTDIG_DOCUMENT_EXCERPT_L]; // int score; // int match_percent; //top result is 100% // time_t doc_date; // int size; // //--------------------------------------------------------------------------------------- int htsearch_get_nth_match(int desired_match_index, htsearch_query_match_struct * query_result) { ResultMatch *match = 0; Dictionary *vars = 0; if (total_matches == 0) { return (HTSEARCH_ERROR_NO_MATCH); } else if (desired_match_index >= total_matches) { return (HTSEARCH_ERROR_BAD_MATCH_INDEX); } else if ((total_matches > 0) && (desired_match_index < total_matches)) { match = (ResultMatch *) matches_list->Nth(desired_match_index); // DocumentRef *ref = docDB[match->getID()]; Collection *collection = match->getCollection(); DocumentRef *ref = collection->getDocumentRef(match->getID()); if (!ref || ref->DocState() != Reference_normal) { // The document isn't present or shouldn't be displayed return (HTSEARCH_ERROR_BAD_DOCUMENT); } ref->DocAnchor(match->getAnchor()); ref->DocScore(match->getScore()); vars = resultfetch->fetchMatch(match, ref, desired_match_index); delete ref; String *value; String key; key = "NSTARS"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; query_result->score = atoi(value->get()); key = "PERCENT"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; query_result->score_percent = atoi(value->get()); key = "TITLE"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; snprintf(query_result->title, HTDIG_DOCUMENT_TITLE_L, "%s", value->get()); key = "EXCERPT"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; snprintf(query_result->excerpt, HTDIG_DOCUMENT_EXCERPT_L, "%s", value->get()); key = "URL"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; snprintf(query_result->URL, HTDIG_MAX_FILENAME_PATH_L, "%s", value->get()); String datefmt = config->Find("date_format"); key = "MODIFIED"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; mystrptime(value->get(), datefmt.get(), &(query_result->time_tm)); //cout << "[" << asctime(&query_result->time_tm) << "]" << endl; key = "SIZE"; value = (String *) vars->Find(key); //cout << key.get() << "[" << value->get() << "]" << endl; query_result->size = atoi(value->get()); } return (TRUE); } //--------------------------------------------------------------------------------------- // // // RETURN: TRUE or FALSE // //--------------------------------------------------------------------------------------- int htsearch_close() { // delete results; // delete parser; return (TRUE); } //***************************************************************************** void createLogicalWords(List & searchWords, String & logicalWords, String & wm) { String pattern; int i; int wasHidden = 0; int inPhrase = 0; for (i = 0; i < searchWords.Count(); i++) { WeightWord *ww = (WeightWord *) searchWords[i]; if (!ww->isHidden) { if (strcmp((char *) ww->word, "&") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[AND] << ' '; else if (strcmp((char *) ww->word, "|") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[OR] << ' '; else if (strcmp((char *) ww->word, "!") == 0 && wasHidden == 0) logicalWords << ' ' << boolean_keywords[NOT] << ' '; else if (strcmp((char *) ww->word, "\"") == 0 && wasHidden == 0) { if (inPhrase) logicalWords.chop(' '); inPhrase = !inPhrase; logicalWords << "\""; } else if (wasHidden == 0) { logicalWords << ww->word; if (inPhrase) logicalWords << " "; } wasHidden = 0; } else wasHidden = 1; if (ww->weight > 0 // Ignore boolean syntax stuff && !ww->isIgnore) // Ignore short or bad words { if (pattern.length() && !inPhrase) pattern << '|'; else if (pattern.length() && inPhrase) pattern << ' '; pattern << ww->word; } } wm = pattern; if (debug) { cerr << "LogicalWords: " << logicalWords << endl; cerr << "Pattern: " << pattern << endl; } } void dumpWords(List & words, char *msg = "") { if (debug) { cerr << msg << ": '"; for (int i = 0; i < words.Count(); i++) { WeightWord *ww = (WeightWord *) words[i]; cerr << ww->word << ':' << ww->isHidden << ' '; } cerr << "'\n"; } } //***************************************************************************** // void setupWords(char *allWords, List &searchWords, // int boolean, Parser *parser, String &originalPattern) // void setupWords(char *allWords, List & searchWords, int boolean, Parser * parser, String & originalPattern) { HtConfiguration *config = HtConfiguration::config(); List tempWords; int i; // // Parse the words we need to search for. It should be a list of words // with optional 'and' and 'or' between them. The list of words // will be put in the searchWords list and at the same time in the // String pattern separated with '|'. // // // Convert the string to a list of WeightWord objects. The special // characters '(' and ')' will be put into their own WeightWord objects. // unsigned char *pos = (unsigned char *) allWords; unsigned char t; String word; const String prefix_suffix = config->Find("prefix_match_character"); while (*pos) { while (1) { t = *pos++; if (isspace(t)) { continue; } else if (t == '"') { tempWords.Add(new WeightWord("\"", -1.0)); break; } else if (boolean && (t == '(' || t == ')')) { char s[2]; s[0] = t; s[1] = '\0'; tempWords.Add(new WeightWord(s, -1.0)); break; } else if (HtIsWordChar(t) || t == ':' || (strchr(prefix_suffix, t) != NULL) || (t >= 161 && t <= 255)) { word = 0; while (t && (HtIsWordChar(t) || t == ':' || (strchr(prefix_suffix, t) != NULL) || (t >= 161 && t <= 255))) { word << (char) t; t = *pos++; } pos--; if (boolean && (mystrcasecmp(word.get(), "+") == 0 || mystrcasecmp(word.get(), boolean_keywords[AND]) == 0)) { tempWords.Add(new WeightWord("&", -1.0)); } else if (boolean && mystrcasecmp(word.get(), boolean_keywords[OR]) == 0) { tempWords.Add(new WeightWord("|", -1.0)); } else if (boolean && (mystrcasecmp(word.get(), "-") == 0 || mystrcasecmp(word.get(), boolean_keywords[NOT]) == 0)) { tempWords.Add(new WeightWord("!", -1.0)); } else { // Add word to excerpt matching list originalPattern << word << "|"; WeightWord *ww = new WeightWord(word, 1.0); if (HtWordNormalize(word) & WORD_NORMALIZE_NOTOK) ww->isIgnore = 1; tempWords.Add(ww); } break; } } } dumpWords(tempWords, "tempWords"); // // If the user specified boolean expression operators, the whole // expression has to be syntactically correct. If not, we need // to report a syntax error. // if (boolean) { if (!parser->checkSyntax(&tempWords)) { for (i = 0; i < tempWords.Count(); i++) { searchWords.Add(tempWords[i]); } tempWords.Release(); return; // reportError("Syntax error"); } } else { convertToBoolean(tempWords); } dumpWords(tempWords, "Boolean"); // // We need to assign weights to the words according to the search_algorithm // configuration attribute. // For algorithms other than exact, we need to also do word lookups. // StringList algs(config->Find("search_algorithm"), " \t"); List algorithms; String name, weight; double fweight; Fuzzy *fuzzy = 0; // // Generate the list of algorithms to use and associate the given // weights with them. // for (i = 0; i < algs.Count(); i++) { name = strtok(algs[i], ":"); weight = strtok(0, ":"); if (name.length() == 0) name = "exact"; if (weight.length() == 0) weight = "1"; fweight = atof((char *) weight); fuzzy = Fuzzy::getFuzzyByName(name, *config); if (fuzzy) { fuzzy->setWeight(fweight); fuzzy->openIndex(); algorithms.Add(fuzzy); } } dumpWords(searchWords, "initial"); // // For each of the words, apply all the algorithms. // int in_phrase = 0; // If we get into a phrase, we don't want to fuzz. for (i = 0; i < tempWords.Count(); i++) { WeightWord *ww = (WeightWord *) tempWords[i]; if (ww->weight > 0 && !ww->isIgnore && !in_phrase) { // // Apply all the algorithms to the word. // if (debug) cerr << "Fuzzy on: " << ww->word << endl; doFuzzy(ww, searchWords, algorithms); delete ww; } else if (ww->word.length() == 1 && ww->word[0] == '"') { in_phrase = !in_phrase; if (debug) cerr << "Add: " << ww->word << endl; searchWords.Add(ww); } else { // // This is '(', ')', '&', or '|'. These will be automatically // transfered to the searchWords list. // if (debug) cerr << "Add: " << ww->word << endl; searchWords.Add(ww); } dumpWords(searchWords, "searchWords"); } tempWords.Release(); } //***************************************************************************** void doFuzzy(WeightWord * ww, List & searchWords, List & algorithms) { List fuzzyWords; List weightWords; Fuzzy *fuzzy; WeightWord *newWw; String *word; algorithms.Start_Get(); while ((fuzzy = (Fuzzy *) algorithms.Get_Next())) { if (debug > 1) cout << " " << fuzzy->getName(); fuzzy->getWords(ww->word, fuzzyWords); fuzzyWords.Start_Get(); while ((word = (String *) fuzzyWords.Get_Next())) { if (debug > 1) cout << " " << word->get(); newWw = new WeightWord(word->get(), fuzzy->getWeight()); newWw->isExact = ww->isExact; newWw->isHidden = ww->isHidden; weightWords.Add(newWw); } if (debug > 1) cout << endl; fuzzyWords.Destroy(); } // // We now have a list of substitute words. They need to be added // to the searchWords. // if (weightWords.Count()) { if (weightWords.Count() > 1) searchWords.Add(new WeightWord("(", -1.0)); for (int i = 0; i < weightWords.Count(); i++) { if (i > 0) searchWords.Add(new WeightWord("|", -1.0)); searchWords.Add(weightWords[i]); } if (weightWords.Count() > 1) searchWords.Add(new WeightWord(")", -1.0)); } else // if no fuzzy matches, add exact word, but give it tiny weight { searchWords.Add(new WeightWord(word->get(), 0.000001)); } weightWords.Release(); } //***************************************************************************** // void convertToBoolean(List &words) // void convertToBoolean(List & words) { HtConfiguration *config = HtConfiguration::config(); List list; int i; int do_and = strcmp(config->Find("match_method"), "and") == 0; int in_phrase = 0; String quote = "\""; if (words.Count() == 0) return; list.Add(words[0]); // We might start off with a phrase match if (((WeightWord *) words[0])->word == quote) in_phrase = 1; for (i = 1; i < words.Count(); i++) { if (do_and && !in_phrase) list.Add(new WeightWord("&", -1.0)); else if (!in_phrase) list.Add(new WeightWord("|", -1.0)); if (((WeightWord *) words[i])->word == quote) in_phrase = !in_phrase; list.Add(words[i]); } words.Release(); for (i = 0; i < list.Count(); i++) { words.Add(list[i]); } list.Release(); } //***************************************************************************** // Dictionary *htsearch(char *wordfile, List &searchWords, Parser *parser) // This returns a dictionary indexed by document ID and containing a // List of HtWordReference objects. // int htsearch(Collection * collection, List & searchWords, Parser * parser) { int count = 0; // // Pick the database type we are going to use // ResultList *matches = new ResultList; if (searchWords.Count() > 0) { // parser->setDatabase(wordfile); parser->setCollection(collection); parser->parse(&searchWords, *matches); } collection->setResultList(matches); count = matches->Count(); return (count); } //***************************************************************************** // Modify the search words list to include the required words as well. // This is done by putting the existing search words in parenthesis and // appending the required words separated with "and". void addRequiredWords(List & searchWords, StringList & requiredWords) { HtConfiguration *config = HtConfiguration::config(); static int any_keywords = config->Boolean("any_keywords", 0); if (requiredWords.Count() == 0) return; if (searchWords.Count() > 0) { searchWords.Insert(new WeightWord("(", -1.0), 0); searchWords.Add(new WeightWord(")", -1.0)); searchWords.Add(new WeightWord("&", -1.0)); } if (requiredWords.Count() == 1) { searchWords.Add(new WeightWord(requiredWords[0], 1.0)); } else { searchWords.Add(new WeightWord("(", -1.0)); searchWords.Add(new WeightWord(requiredWords[0], 1.0)); for (int i = 1; i < requiredWords.Count(); i++) { if (any_keywords) searchWords.Add(new WeightWord("|", -1.0)); else searchWords.Add(new WeightWord("&", -1.0)); searchWords.Add(new WeightWord(requiredWords[i], 1.0)); } searchWords.Add(new WeightWord(")", -1.0)); } } //***************************************************************************** // Report an error. Since we don' know if we are running as a CGI or not, // we will assume this is the first thing returned by a CGI program. // void reportError_html(char *msg) { HtConfiguration *config = HtConfiguration::config(); cout << "Content-type: text/html\r\n\r\n"; cout << "htsearch error\n"; cout << "\n"; cout << "

    ht://Dig error

    \n"; cout << "

    htsearch detected an error. Please report this to the\n"; cout << "webmaster of this site by sending an e-mail to:\n"; cout << "Find("maintainer") << "\">"; cout << config->Find("maintainer") << "\n"; cout << "The error message is:

    \n"; cout << "
    \n" << msg << "\n
    \n\n"; exit(1); } htdig-3.2.0b6/libhtdig/libhtdig_log.cc0100644006314600127310000000350210055635561017115 0ustar angusgbhtdig//-------------------------------------------------------------------- // // libhtdig_log.cc // // 2/6/2002 created // // Neal Richter nealr@rightnow.com // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_log.cc,v 1.5 2004/05/28 13:15:29 lha Exp $ // //-------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif #include "libhtdig_log.h" #include #ifndef _WIN32 #include #endif #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ #include #include static FILE *errorlog_fp = NULL; int logOpen(char *filename) { if(errorlog_fp == NULL) errorlog_fp = fopen(filename, "a+"); if (errorlog_fp == NULL) return (TRUE); else return (FALSE); } void logEntry (char *msg) { time_t now = time(NULL); if(errorlog_fp != NULL) fprintf(errorlog_fp, "[%s] %s\n", ctime(&now), msg); } //***************************************************************************** // Report an error void reportError (char *msg) { time_t now = time(NULL); if(errorlog_fp != NULL) fprintf(errorlog_fp, "%s [ERROR] %s\n", ctime(&now), msg); fprintf(stderr, "%s [ERROR] %s\n", ctime(&now), msg); } int logClose() { int ret = -1; if(errorlog_fp != NULL) { ret = fclose(errorlog_fp); errorlog_fp = NULL; if(ret == 0) return(TRUE); else return(FALSE); } return(TRUE); } htdig-3.2.0b6/libhtdig/libhtdig_log.h0100644006314600127310000000152010055635561016755 0ustar angusgbhtdig//-------------------------------------------------------------------- // // libhtdig_log.h // // 2/6/2002 created // // Neal Richter nealr@rightnow.com // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later or later // // // $Id: libhtdig_log.h,v 1.4 2004/05/28 13:15:29 lha Exp $ // //-------------------------------------------------------------------- #ifndef LIBHTDIG_LOG_H #define LIBHTDIG_LOG_H #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif int logOpen(char *file); void logEntry(char *msg); void reportError(char *msg); int logClose(void); #endif /* LIBHTDIG_LOG_H */ htdig-3.2.0b6/libhtdigphp/0040755006314600127310000000000010063260370014661 5ustar angusgbhtdightdig-3.2.0b6/libhtdigphp/Makefile0100644006314600127310000000120310026717351016317 0ustar angusgbhtdigtop_srcdir = /nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp top_builddir = /nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp srcdir = /nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp/ builddir = /nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp/ VPATH = /nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp/ # $Id: Makefile,v 1.1 2004/03/20 01:31:21 nealr Exp $ LTLIBRARY_NAME = libhtdigphp.la LTLIBRARY_SOURCES = htdigphp.c LTLIBRARY_SHARED_NAME = libhtdigphp.la LTLIBRARY_SHARED_LIBADD = -lhtdig include $(top_srcdir)/build/dynlib.mk DEFS += -I../libhtdig htdig-3.2.0b6/libhtdigphp/LGPL0100644006314600127310000006347610026717351015364 0ustar angusgbhtdig GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! htdig-3.2.0b6/libhtdigphp/build/0040755006314600127310000000000010063260370015760 5ustar angusgbhtdightdig-3.2.0b6/libhtdigphp/Makefile.in0100644006314600127310000000037610063260372016733 0ustar angusgbhtdig# $Id: Makefile.in,v 1.1 2004/03/20 01:31:21 nealr Exp $ LTLIBRARY_NAME = libhtdigphp.la LTLIBRARY_SOURCES = htdigphp.c LTLIBRARY_SHARED_NAME = htdigphp.la LTLIBRARY_SHARED_LIBADD = $(BZ2_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk htdig-3.2.0b6/libhtdigphp/README0100644006314600127310000000051510026717351015544 0ustar angusgbhtdigREADME for libhtdigphp 1)First Download the latest snapshot of HtDig 3.2.0 & libhtdig from http://www.htdig.org Build HtDig 3.2.0 & libhtdig 2) run ./configure make ./relink [relinks the htdigphp library with stdc++ & libhtdig, this is a temporary measure] use htdig_search.php as a test script and example PHP code htdig-3.2.0b6/libhtdigphp/acinclude.m40100644006314600127310000006371510026717351017070 0ustar angusgbhtdigdnl $Id: acinclude.m4,v 1.1 2004/03/20 01:31:21 nealr Exp $ dnl dnl This file contains local autoconf functions. sinclude(dynlib.m4) dnl dnl PHP_TARGET_RDYNAMIC dnl dnl Checks whether -rdynamic is supported by the compiler. This dnl is necessary for some targets to populate the global symbol dnl table. Otherwise, dynamic modules would not be able to resolve dnl PHP-related symbols. dnl dnl If successful, adds -rdynamic to PHP_LDFLAGS. dnl AC_DEFUN(PHP_TARGET_RDYNAMIC,[ if test -n "$GCC"; then dnl we should use a PHP-specific macro here TSRM_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) if test "$gcc_rdynamic" = "yes"; then PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic" fi fi ]) AC_DEFUN(PHP_REMOVE_USR_LIB,[ unset ac_new_flags for i in [$]$1; do case [$]i in -L/usr/lib|-L/usr/lib/) ;; *) ac_new_flags="[$]ac_new_flags [$]i" ;; esac done $1=[$]ac_new_flags ]) AC_DEFUN(PHP_SETUP_OPENSSL,[ if test "$PHP_OPENSSL" = "no"; then PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl" fi for i in $PHP_OPENSSL; do if test -r $i/include/openssl/evp.h; then OPENSSL_DIR=$i OPENSSL_INC=$i/include fi done if test -z "$OPENSSL_DIR"; then AC_MSG_ERROR(Cannot find OpenSSL's ) fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$OPENSSL_INC AC_MSG_CHECKING(for OpenSSL version) AC_EGREP_CPP(yes,[ #include #if OPENSSL_VERSION_NUMBER >= 0x0090500fL yes #endif ],[ AC_MSG_RESULT(>= 0.9.5) ],[ AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.) ]) CPPFLAGS=$old_CPPFLAGS PHP_ADD_LIBPATH($OPENSSL_DIR/lib) AC_CHECK_LIB(crypto, CRYPTO_free, [ PHP_ADD_LIBRARY(crypto) ],[ AC_MSG_ERROR(libcrypto not found!) ]) AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [ PHP_ADD_LIBRARY(ssl) ],[ AC_MSG_ERROR(libssl not found!) ]) PHP_ADD_INCLUDE($OPENSSL_INC) ]) dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) dnl dnl Use this macro, if you need to add libraries and or library search dnl paths to the PHP build system which are only given in compiler dnl notation. dnl AC_DEFUN(PHP_EVAL_LIBLINE,[ for ac_i in $1; do case $ac_i in -l*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_LIBRARY($ac_ii,,$2) ;; -L*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_LIBPATH($ac_ii,$2) ;; esac done ]) dnl PHP_EVAL_INCLINE(LINE) dnl dnl Use this macro, if you need to add header search paths to the PHP dnl build system which are only given in compiler notation. dnl AC_DEFUN(PHP_EVAL_INCLINE,[ for ac_i in $1; do case $ac_i in -I*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_INCLUDE($ac_ii) ;; esac done ]) AC_DEFUN(PHP_READDIR_R_TYPE,[ dnl HAVE_READDIR_R is also defined by libmysql AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) if test "$ac_cv_func_readdir_r" = "yes"; then AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ AC_TRY_RUN([ #define _REENTRANT #include #include #ifndef PATH_MAX #define PATH_MAX 1024 #endif main() { DIR *dir; char entry[sizeof(struct dirent)+PATH_MAX]; struct dirent *pentry = (struct dirent *) &entry; dir = opendir("/"); if (!dir) exit(1); if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) exit(0); exit(1); } ],[ ac_cv_what_readdir_r=POSIX ],[ AC_TRY_CPP([ #define _REENTRANT #include #include int readdir_r(DIR *, struct dirent *); ],[ ac_cv_what_readdir_r=old-style ],[ ac_cv_what_readdir_r=none ]) ],[ ac_cv_what_readdir_r=none ]) ]) case $ac_cv_what_readdir_r in POSIX) AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; old-style) AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; esac fi ]) AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[ PHP_SUBST(SHLIB_SUFFIX_NAME) SHLIB_SUFFIX_NAME=so case $host_alias in *hpux*) SHLIB_SUFFIX_NAME=sl ;; esac ]) AC_DEFUN(PHP_DEBUG_MACRO,[ DEBUG_LOG=$1 cat >$1 <conftest.$ac_ext <>$1 2>&1 rm -fr conftest* ]) AC_DEFUN(PHP_MISSING_PREAD_DECL,[ AC_CACHE_CHECK(whether pread works without custom declaration,ac_cv_pread,[ AC_TRY_COMPILE([#include ],[size_t (*func)() = pread],[ ac_cv_pread=yes ],[ echo test > conftest_in AC_TRY_RUN([ #include #include #include main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } ],[ ac_cv_pread=yes ],[ echo test > conftest_in AC_TRY_RUN([ #include #include #include #include ssize_t pread(int, void *, size_t, off64_t); main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } ],[ ac_cv_pread=64 ],[ ac_cv_pread=no ]) ]) ]) ]) case $ac_cv_pread in no) ac_cv_func_pread=no;; 64) AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]);; esac ]) AC_DEFUN(PHP_MISSING_PWRITE_DECL,[ AC_CACHE_CHECK(whether pwrite works without custom declaration,ac_cv_pwrite,[ AC_TRY_COMPILE([#include ],[size_t (*func)() = pwrite],[ ac_cv_pwrite=yes ],[ AC_TRY_RUN([ #include #include #include main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } ],[ ac_cv_pwrite=yes ],[ AC_TRY_RUN([ #include #include #include #include ssize_t pwrite(int, void *, size_t, off64_t); main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } ],[ ac_cv_pwrite=64 ],[ ac_cv_pwrite=no ]) ]) ]) ]) case $ac_cv_pwrite in no) ac_cv_func_pwrite=no;; 64) AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]);; esac ]) AC_DEFUN(PHP_MISSING_TIME_R_DECL,[ AC_MSG_CHECKING(for missing declarations of reentrant functions) AC_TRY_COMPILE([#include ],[struct tm *(*func)() = localtime_r],[ : ],[ AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) ]) AC_TRY_COMPILE([#include ],[struct tm *(*func)() = gmtime_r],[ : ],[ AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = asctime_r],[ : ],[ AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = ctime_r],[ : ],[ AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = strtok_r],[ : ],[ AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) ]) AC_MSG_RESULT(done) ]) dnl dnl PHP_LIBGCC_LIBPATH(gcc) dnl Stores the location of libgcc in libgcc_libpath dnl AC_DEFUN(PHP_LIBGCC_LIBPATH,[ changequote({,}) libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` changequote([,]) ]) AC_DEFUN(PHP_ARG_ANALYZE,[ case [$]$1 in shared,*) ext_output="yes, shared" ext_shared=yes $1=`echo "[$]$1"|sed 's/^shared,//'` ;; shared) ext_output="yes, shared" ext_shared=yes $1=yes ;; no) ext_output=no ext_shared=no ;; *) ext_output=yes ext_shared=no ;; esac if test "$php_always_shared" = "yes"; then ext_output="yes, shared" ext_shared=yes test "[$]$1" = "no" && $1=yes fi AC_MSG_RESULT($ext_output) ]) dnl dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val]) dnl Sets PHP_ARG_NAME either to the user value or to the default value. dnl default-val defaults to no. This will also set the variable ext_shared, dnl and will overwrite any previous variable of that name. dnl AC_DEFUN(PHP_ARG_WITH,[ PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_)) ]) AC_DEFUN(PHP_REAL_ARG_WITH,[ AC_MSG_CHECKING($2) AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4)) PHP_ARG_ANALYZE($5) ]) dnl dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val]) dnl Sets PHP_ARG_NAME either to the user value or to the default value. dnl default-val defaults to no. This will also set the variable ext_shared, dnl and will overwrite any previous variable of that name. dnl AC_DEFUN(PHP_ARG_ENABLE,[ PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_)) ]) AC_DEFUN(PHP_REAL_ARG_ENABLE,[ AC_MSG_CHECKING($2) AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4)) PHP_ARG_ANALYZE($5) ]) AC_DEFUN(PHP_MODULE_PTR,[ EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1," ]) AC_DEFUN(PHP_CONFIG_NICE,[ rm -f $1 cat >$1<> $1 fi done for arg in [$]0 "[$]@"; do echo "'[$]arg' \\" >> $1 done echo '"[$]@"' >> $1 chmod +x $1 ]) AC_DEFUN(PHP_TIME_R_TYPE,[ AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ AC_TRY_RUN([ #include main() { char buf[27]; struct tm t; time_t old = 0; int r, s; s = gmtime_r(&old, &t); r = (int) asctime_r(&t, buf, 26); if (r == s && s == 0) return (0); return (1); } ],[ ac_cv_time_r_type=hpux ],[ AC_TRY_RUN([ #include main() { struct tm t, *s; time_t old = 0; char buf[27], *p; s = gmtime_r(&old, &t); p = asctime_r(&t, buf, 26); if (p == buf && s == &t) return (0); return (1); } ],[ ac_cv_time_r_type=irix ],[ ac_cv_time_r_type=POSIX ]) ],[ ac_cv_time_r_type=POSIX ]) ]) case $ac_cv_time_r_type in hpux) AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; irix) AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; esac ]) AC_DEFUN(PHP_SUBST,[ PHP_VAR_SUBST="$PHP_VAR_SUBST $1" ]) AC_DEFUN(PHP_SUBST_OLD,[ PHP_SUBST($1) AC_SUBST($1) ]) AC_DEFUN(PHP_FAST_OUTPUT,[ PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1" ]) AC_DEFUN(PHP_MKDIR_P_CHECK,[ AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[ test -d conftestdir && rm -rf conftestdir mkdir -p conftestdir/somedir >/dev/null 2>&1 dnl `mkdir -p' must be quiet about creating existing directories mkdir -p conftestdir/somedir >/dev/null 2>&1 if test "$?" = "0" && test -d conftestdir/somedir; then ac_cv_mkdir_p=yes else ac_cv_mkdir_p=no fi rm -rf conftestdir ]) ]) AC_DEFUN(PHP_GEN_CONFIG_VARS,[ PHP_MKDIR_P_CHECK echo creating config_vars.mk > config_vars.mk for i in $PHP_VAR_SUBST; do eval echo "$i = \$$i" >> config_vars.mk done ]) AC_DEFUN(PHP_GEN_MAKEFILES,[ $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1 ]) AC_DEFUN(PHP_TM_GMTOFF,[ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = yes; then AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) fi ]) dnl PHP_CONFIGURE_PART(MESSAGE) dnl Idea borrowed from mm AC_DEFUN(PHP_CONFIGURE_PART,[ AC_MSG_RESULT() AC_MSG_RESULT(${T_MD}$1${T_ME}) ]) AC_DEFUN(PHP_PROG_SENDMAIL,[ AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib) if test -n "$PROG_SENDMAIL"; then AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) fi ]) AC_DEFUN(PHP_RUNPATH_SWITCH,[ dnl check for -R, etc. switch AC_MSG_CHECKING(if compiler supports -R) AC_CACHE_VAL(php_cv_cc_dashr,[ SAVE_LIBS=$LIBS LIBS="-R /usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) LIBS=$SAVE_LIBS]) AC_MSG_RESULT($php_cv_cc_dashr) if test $php_cv_cc_dashr = "yes"; then ld_runpath_switch=-R else AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) AC_CACHE_VAL(php_cv_cc_rpath,[ SAVE_LIBS=$LIBS LIBS="-Wl,-rpath,/usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) LIBS=$SAVE_LIBS]) AC_MSG_RESULT($php_cv_cc_rpath) if test $php_cv_cc_rpath = "yes"; then ld_runpath_switch=-Wl,-rpath, else dnl something innocuous ld_runpath_switch=-L fi fi ]) AC_DEFUN(PHP_STRUCT_FLOCK,[ AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, AC_TRY_COMPILE([ #include #include ], [struct flock x;], [ ac_cv_struct_flock=yes ],[ ac_cv_struct_flock=no ]) ) if test "$ac_cv_struct_flock" = "yes" ; then AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) fi ]) AC_DEFUN(PHP_SOCKLEN_T,[ AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, AC_TRY_COMPILE([ #include #include ],[ socklen_t x; ],[ ac_cv_socklen_t=yes ],[ ac_cv_socklen_t=no ])) if test "$ac_cv_socklen_t" = "yes"; then AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) fi ]) dnl dnl PHP_SET_SYM_FILE(path) dnl dnl set the path of the file which contains the symbol export list dnl AC_DEFUN(PHP_SET_SYM_FILE, [ PHP_SYM_FILE=$1 ]) dnl dnl PHP_BUILD_THREAD_SAFE dnl AC_DEFUN(PHP_BUILD_THREAD_SAFE,[ enable_experimental_zts=yes if test "$pthreads_working" != "yes"; then AC_MSG_ERROR(ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.) fi ]) AC_DEFUN(PHP_REQUIRE_CXX,[ if test -z "$php_cxx_done"; then AC_PROG_CXX AC_PROG_CXXCPP php_cxx_done=yes fi ]) dnl dnl PHP_BUILD_SHARED dnl AC_DEFUN(PHP_BUILD_SHARED,[ php_build_target=shared ]) dnl dnl PHP_BUILD_STATIC dnl AC_DEFUN(PHP_BUILD_STATIC,[ php_build_target=static ]) dnl dnl PHP_BUILD_PROGRAM dnl AC_DEFUN(PHP_BUILD_PROGRAM,[ php_build_target=program ]) dnl dnl AC_PHP_ONCE(namespace, variable, code) dnl dnl execute code, if variable is not set in namespace dnl AC_DEFUN(AC_PHP_ONCE,[ changequote({,}) unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) cmd="echo $ac_n \"\$$1$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "$1$unique=set" $3 fi ]) dnl dnl PHP_EXPAND_PATH(path, variable) dnl dnl expands path to an absolute path and assigns it to variable dnl AC_DEFUN(PHP_EXPAND_PATH,[ if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then $2=$1 else changequote({,}) ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" changequote([,]) ep_realdir="`(cd \"$ep_dir\" && pwd)`" $2="$ep_realdir/`basename \"$1\"`" fi ]) dnl dnl PHP_ADD_LIBPATH(path[, shared-libadd]) dnl dnl add a library to linkpath/runpath dnl AC_DEFUN(PHP_ADD_LIBPATH,[ if test "$1" != "/usr/lib"; then PHP_EXPAND_PATH($1, ai_p) if test "$ext_shared" = "yes" && test -n "$2"; then $2="-R$1 -L$1 [$]$2" else AC_PHP_ONCE(LIBPATH, $ai_p, [ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" LDFLAGS="$LDFLAGS -L$ai_p" PHP_RPATHS="$PHP_RPATHS $ai_p" ]) fi fi ]) dnl dnl PHP_BUILD_RPATH() dnl dnl builds RPATH from PHP_RPATHS dnl AC_DEFUN(PHP_BUILD_RPATH,[ if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then OLD_RPATHS="$PHP_RPATHS" unset PHP_RPATHS for i in $OLD_RPATHS; do PHP_LDFLAGS="$PHP_LDFLAGS -L$i" PHP_RPATHS="$PHP_RPATHS -R $i" NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" done fi ]) dnl dnl PHP_ADD_INCLUDE(path [,before]) dnl dnl add an include path. dnl if before is 1, add in the beginning of INCLUDES. dnl AC_DEFUN(PHP_ADD_INCLUDE,[ if test "$1" != "/usr/include"; then PHP_EXPAND_PATH($1, ai_p) AC_PHP_ONCE(INCLUDEPATH, $ai_p, [ if test "$2"; then INCLUDES="-I$ai_p $INCLUDES" else INCLUDES="$INCLUDES -I$ai_p" fi ]) fi ]) AC_DEFUN(PHP_X_ADD_LIBRARY,[ ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1") ]) dnl dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) dnl dnl add a library to the link line dnl AC_DEFUN(PHP_ADD_LIBRARY,[ case $1 in c|c_r|pthread*) ;; *) ifelse($3,,[ PHP_X_ADD_LIBRARY($1,$2,LIBS) ],[ if test "$ext_shared" = "yes"; then PHP_X_ADD_LIBRARY($1,$2,$3) else PHP_ADD_LIBRARY($1,$2) fi ]) ;; esac ]) dnl dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) dnl dnl add a library to the link line (deferred) dnl AC_DEFUN(PHP_ADD_LIBRARY_DEFER,[ case $1 in c|c_r|pthread*) ;; *) ifelse($3,,[ PHP_X_ADD_LIBRARY($1,$2,DLIBS) ],[ if test "$ext_shared" = "yes"; then PHP_X_ADD_LIBRARY($1,$2,$3) else PHP_ADD_LIBRARY_DEFER($1,$2) fi ]) ;; esac ]) dnl dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd]) dnl dnl add a library to the link line and path to linkpath/runpath. dnl if shared-libadd is not empty and $ext_shared is yes, dnl shared-libadd will be assigned the library information dnl AC_DEFUN(PHP_ADD_LIBRARY_WITH_PATH,[ ifelse($3,,[ if test -n "$2"; then PHP_ADD_LIBPATH($2) fi PHP_ADD_LIBRARY($1) ],[ if test "$ext_shared" = "yes"; then $3="-l$1 [$]$3" if test -n "$2"; then PHP_ADD_LIBPATH($2,$3) fi else PHP_ADD_LIBRARY_WITH_PATH($1,$2) fi ]) ]) dnl dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path) dnl dnl add a library to the link line (deferred) dnl and path to linkpath/runpath (not deferred) dnl AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[ PHP_ADD_LIBPATH($2) PHP_ADD_LIBRARY_DEFER($1) ]) dnl dnl Set libtool variable dnl AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[ LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' ]) dnl dnl Check for cc option dnl AC_DEFUN(PHP_CHECK_CC_OPTION,[ echo "main(){return 0;}" > conftest.$ac_ext opt=$1 changequote({,}) var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) AC_MSG_CHECKING([if compiler supports -$1 really]) ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then eval php_cc_$var=no AC_MSG_RESULT(no) else if eval ./conftest 2>/dev/null ; then eval php_cc_$var=yes AC_MSG_RESULT(yes) else eval php_cc_$var=no AC_MSG_RESULT(no) fi fi ]) AC_DEFUN(PHP_REGEX,[ if test "$REGEX_TYPE" = "php"; then REGEX_LIB=regex/libregex.la REGEX_DIR=regex AC_DEFINE(HSREGEX,1,[ ]) AC_DEFINE(REGEX,1,[ ]) PHP_FAST_OUTPUT(regex/Makefile) elif test "$REGEX_TYPE" = "system"; then AC_DEFINE(REGEX,0,[ ]) fi AC_MSG_CHECKING(which regex library to use) AC_MSG_RESULT($REGEX_TYPE) PHP_SUBST(REGEX_DIR) PHP_SUBST(REGEX_LIB) PHP_SUBST(HSREGEX) ]) dnl dnl See if we have broken header files like SunOS has. dnl AC_DEFUN(PHP_MISSING_FCLOSE_DECL,[ AC_MSG_CHECKING([for fclose declaration]) AC_TRY_COMPILE([#include ],[int (*func)() = fclose],[ AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) AC_MSG_RESULT(ok) ],[ AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) AC_MSG_RESULT(missing) ]) ]) dnl dnl Check for broken sprintf() dnl AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[ AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ ac_cv_broken_sprintf=no ],[ ac_cv_broken_sprintf=yes ],[ ac_cv_broken_sprintf=no ]) ]) if test "$ac_cv_broken_sprintf" = "yes"; then AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ]) else AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ]) fi ]) dnl dnl PHP_EXTENSION(extname [, shared]) dnl dnl Includes an extension in the build. dnl dnl "extname" is the name of the ext/ subdir where the extension resides dnl "shared" can be set to "shared" or "yes" to build the extension as dnl a dynamically loadable library. dnl AC_DEFUN(PHP_EXTENSION,[ EXT_SUBDIRS="$EXT_SUBDIRS $1" if test -d "$abs_srcdir/ext/$1"; then dnl ---------------------------------------------- Internal Module ext_builddir=ext/$1 ext_srcdir=$abs_srcdir/ext/$1 else dnl ---------------------------------------------- External Module ext_builddir=. ext_srcdir=$abs_srcdir fi if test "$2" != "shared" && test "$2" != "yes"; then dnl ---------------------------------------------- Static module LIB_BUILD($ext_builddir) EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la" EXT_STATIC="$EXT_STATIC $1" else dnl ---------------------------------------------- Shared module LIB_BUILD($ext_builddir,yes) AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module) fi PHP_FAST_OUTPUT($ext_builddir/Makefile) ]) dnl dnl Solaris requires main code to be position independent in order dnl to let shared objects find symbols. Weird. Ugly. dnl dnl Must be run after all --with-NN options that let the user dnl choose dynamic extensions, and after the gcc test. dnl AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[ AC_MSG_CHECKING(whether -fPIC is required) if test -n "$EXT_SHARED"; then os=`uname -sr 2>/dev/null` case $os in "SunOS 5.6"|"SunOS 5.7") case $CC in gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; *) CFLAGS="$CFLAGS -fpic";; esac AC_MSG_RESULT(yes);; *) AC_MSG_RESULT(no);; esac else AC_MSG_RESULT(no) fi ]) dnl dnl Checks whether $withval is "shared" or starts with "shared,XXX" dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff dnl from $withval. dnl AC_DEFUN(PHP_WITH_SHARED,[ case $withval in shared) shared=yes withval=yes ;; shared,*) shared=yes withval=`echo $withval | sed -e 's/^shared,//'` ;; *) shared=no ;; esac if test -n "$php_always_shared"; then shared=yes fi ]) dnl The problem is that the default compilation flags in Solaris 2.6 won't dnl let programs access large files; you need to tell the compiler that dnl you actually want your programs to work on large files. For more dnl details about this brain damage please see: dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html dnl Written by Paul Eggert . AC_DEFUN(PHP_SYS_LFS, [dnl # If available, prefer support for large files unless the user specified # one of the CPPFLAGS, LDFLAGS, or LIBS variables. AC_MSG_CHECKING(whether large file support needs explicit enabling) ac_getconfs='' ac_result=yes ac_set='' ac_shellvars='CPPFLAGS LDFLAGS LIBS' for ac_shellvar in $ac_shellvars; do case $ac_shellvar in CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; *) ac_lfsvar=LFS_$ac_shellvar ;; esac eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } ac_getconf=`getconf $ac_lfsvar` ac_getconfs=$ac_getconfs$ac_getconf eval ac_test_$ac_shellvar=\$ac_getconf done case "$ac_result$ac_getconfs" in yes) ac_result=no ;; esac case "$ac_result$ac_set" in yes?*) ac_result="yes, but $ac_set is already set, so use its settings" esac AC_MSG_RESULT($ac_result) case $ac_result in yes) for ac_shellvar in $ac_shellvars; do eval $ac_shellvar=\$ac_test_$ac_shellvar done ;; esac ]) AC_DEFUN(PHP_SOCKADDR_SA_LEN,[ AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ AC_TRY_COMPILE([#include #include ], [struct sockaddr s; s.sa_len;], [ac_cv_sockaddr_sa_len=yes AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])], [ac_cv_sockaddr_sa_len=no]) ]) ]) dnl ## PHP_OUTPUT(file) dnl ## adds "file" to the list of files generated by AC_OUTPUT dnl ## This macro can be used several times. AC_DEFUN(PHP_OUTPUT,[ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" ]) AC_DEFUN(PHP_DECLARED_TIMEZONE,[ AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ AC_TRY_COMPILE([ #include #include #ifdef HAVE_SYS_TIME_H #include #endif ],[ time_t foo = (time_t) timezone; ],[ ac_cv_declared_timezone=yes ],[ ac_cv_declared_timezone=no ])]) if test "$ac_cv_declared_timezone" = "yes"; then AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) fi ]) AC_DEFUN(PHP_EBCDIC,[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [ int main(void) { return (unsigned char)'A' != (unsigned char)0xC1; } ],[ ac_cv_ebcdic=yes ],[ ac_cv_ebcdic=no ],[ ac_cv_ebcdic=no ])]) if test "$ac_cv_ebcdic" = "yes"; then AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) fi ]) AC_DEFUN(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH], $@)]) AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY], $@)]) AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH], $@)]) AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE], $@)]) AC_DEFUN(PHP_FOPENCOOKIE,[ AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) if test "$have_glibc_fopencookie" = "yes" ; then dnl this comes in two flavors: dnl newer glibcs (since 2.1.2 ? ) dnl have a type called cookie_io_functions_t AC_TRY_COMPILE([ #define _GNU_SOURCE #include ], [ cookie_io_functions_t cookie; ], [ have_cookie_io_functions_t=yes ], [ ] ) if test "$have_cookie_io_functions_t" = "yes" ; then cookie_io_functions_t=cookie_io_functions_t have_fopen_cookie=yes else dnl older glibc versions (up to 2.1.2 ?) dnl call it _IO_cookie_io_functions_t AC_TRY_COMPILE([ #define _GNU_SOURCE #include ], [ _IO_cookie_io_functions_t cookie; ], [ have_IO_cookie_io_functions_t=yes ], [] ) if test "$have_cookie_io_functions_t" = "yes" ; then cookie_io_functions_t=_IO_cookie_io_functions_t have_fopen_cookie=yes fi fi if test "$have_fopen_cookie" = "yes" ; then AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) fi fi ]) htdig-3.2.0b6/libhtdigphp/aclocal.m40100644006314600127310000041416610026717351016537 0ustar angusgbhtdigdnl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. dnl $Id: aclocal.m4,v 1.1 2004/03/20 01:31:21 nealr Exp $ dnl dnl This file contains local autoconf functions. sinclude(dynlib.m4) dnl dnl PHP_TARGET_RDYNAMIC dnl dnl Checks whether -rdynamic is supported by the compiler. This dnl is necessary for some targets to populate the global symbol dnl table. Otherwise, dynamic modules would not be able to resolve dnl PHP-related symbols. dnl dnl If successful, adds -rdynamic to PHP_LDFLAGS. dnl AC_DEFUN(PHP_TARGET_RDYNAMIC,[ if test -n "$GCC"; then dnl we should use a PHP-specific macro here TSRM_CHECK_GCC_ARG(-rdynamic, gcc_rdynamic=yes) if test "$gcc_rdynamic" = "yes"; then PHP_LDFLAGS="$PHP_LDFLAGS -rdynamic" fi fi ]) AC_DEFUN(PHP_REMOVE_USR_LIB,[ unset ac_new_flags for i in [$]$1; do case [$]i in -L/usr/lib|-L/usr/lib/) ;; *) ac_new_flags="[$]ac_new_flags [$]i" ;; esac done $1=[$]ac_new_flags ]) AC_DEFUN(PHP_SETUP_OPENSSL,[ if test "$PHP_OPENSSL" = "no"; then PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl" fi for i in $PHP_OPENSSL; do if test -r $i/include/openssl/evp.h; then OPENSSL_DIR=$i OPENSSL_INC=$i/include fi done if test -z "$OPENSSL_DIR"; then AC_MSG_ERROR(Cannot find OpenSSL's ) fi old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$OPENSSL_INC AC_MSG_CHECKING(for OpenSSL version) AC_EGREP_CPP(yes,[ #include #if OPENSSL_VERSION_NUMBER >= 0x0090500fL yes #endif ],[ AC_MSG_RESULT(>= 0.9.5) ],[ AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.) ]) CPPFLAGS=$old_CPPFLAGS PHP_ADD_LIBPATH($OPENSSL_DIR/lib) AC_CHECK_LIB(crypto, CRYPTO_free, [ PHP_ADD_LIBRARY(crypto) ],[ AC_MSG_ERROR(libcrypto not found!) ]) AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [ PHP_ADD_LIBRARY(ssl) ],[ AC_MSG_ERROR(libssl not found!) ]) PHP_ADD_INCLUDE($OPENSSL_INC) ]) dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD) dnl dnl Use this macro, if you need to add libraries and or library search dnl paths to the PHP build system which are only given in compiler dnl notation. dnl AC_DEFUN(PHP_EVAL_LIBLINE,[ for ac_i in $1; do case $ac_i in -l*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_LIBRARY($ac_ii,,$2) ;; -L*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_LIBPATH($ac_ii,$2) ;; esac done ]) dnl PHP_EVAL_INCLINE(LINE) dnl dnl Use this macro, if you need to add header search paths to the PHP dnl build system which are only given in compiler notation. dnl AC_DEFUN(PHP_EVAL_INCLINE,[ for ac_i in $1; do case $ac_i in -I*) ac_ii=`echo $ac_i|cut -c 3-` PHP_ADD_INCLUDE($ac_ii) ;; esac done ]) AC_DEFUN(PHP_READDIR_R_TYPE,[ dnl HAVE_READDIR_R is also defined by libmysql AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no) if test "$ac_cv_func_readdir_r" = "yes"; then AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[ AC_TRY_RUN([ #define _REENTRANT #include #include #ifndef PATH_MAX #define PATH_MAX 1024 #endif main() { DIR *dir; char entry[sizeof(struct dirent)+PATH_MAX]; struct dirent *pentry = (struct dirent *) &entry; dir = opendir("/"); if (!dir) exit(1); if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) exit(0); exit(1); } ],[ ac_cv_what_readdir_r=POSIX ],[ AC_TRY_CPP([ #define _REENTRANT #include #include int readdir_r(DIR *, struct dirent *); ],[ ac_cv_what_readdir_r=old-style ],[ ac_cv_what_readdir_r=none ]) ],[ ac_cv_what_readdir_r=none ]) ]) case $ac_cv_what_readdir_r in POSIX) AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);; old-style) AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);; esac fi ]) AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[ PHP_SUBST(SHLIB_SUFFIX_NAME) SHLIB_SUFFIX_NAME=so case $host_alias in *hpux*) SHLIB_SUFFIX_NAME=sl ;; esac ]) AC_DEFUN(PHP_DEBUG_MACRO,[ DEBUG_LOG=$1 cat >$1 <conftest.$ac_ext <>$1 2>&1 rm -fr conftest* ]) AC_DEFUN(PHP_MISSING_PREAD_DECL,[ AC_CACHE_CHECK(whether pread works without custom declaration,ac_cv_pread,[ AC_TRY_COMPILE([#include ],[size_t (*func)() = pread],[ ac_cv_pread=yes ],[ echo test > conftest_in AC_TRY_RUN([ #include #include #include main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } ],[ ac_cv_pread=yes ],[ echo test > conftest_in AC_TRY_RUN([ #include #include #include #include ssize_t pread(int, void *, size_t, off64_t); main() { char buf[3]; return !(pread(open("conftest_in", O_RDONLY), buf, 2, 0) == 2); } ],[ ac_cv_pread=64 ],[ ac_cv_pread=no ]) ]) ]) ]) case $ac_cv_pread in no) ac_cv_func_pread=no;; 64) AC_DEFINE(PHP_PREAD_64, 1, [whether pread64 is default]);; esac ]) AC_DEFUN(PHP_MISSING_PWRITE_DECL,[ AC_CACHE_CHECK(whether pwrite works without custom declaration,ac_cv_pwrite,[ AC_TRY_COMPILE([#include ],[size_t (*func)() = pwrite],[ ac_cv_pwrite=yes ],[ AC_TRY_RUN([ #include #include #include main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } ],[ ac_cv_pwrite=yes ],[ AC_TRY_RUN([ #include #include #include #include ssize_t pwrite(int, void *, size_t, off64_t); main() { return !(pwrite(open("conftest_out", O_WRONLY|O_CREAT, 0600), "Ok", 2, 0) == 2); } ],[ ac_cv_pwrite=64 ],[ ac_cv_pwrite=no ]) ]) ]) ]) case $ac_cv_pwrite in no) ac_cv_func_pwrite=no;; 64) AC_DEFINE(PHP_PWRITE_64, 1, [whether pwrite64 is default]);; esac ]) AC_DEFUN(PHP_MISSING_TIME_R_DECL,[ AC_MSG_CHECKING(for missing declarations of reentrant functions) AC_TRY_COMPILE([#include ],[struct tm *(*func)() = localtime_r],[ : ],[ AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared]) ]) AC_TRY_COMPILE([#include ],[struct tm *(*func)() = gmtime_r],[ : ],[ AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = asctime_r],[ : ],[ AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = ctime_r],[ : ],[ AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared]) ]) AC_TRY_COMPILE([#include ],[char *(*func)() = strtok_r],[ : ],[ AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared]) ]) AC_MSG_RESULT(done) ]) dnl dnl PHP_LIBGCC_LIBPATH(gcc) dnl Stores the location of libgcc in libgcc_libpath dnl AC_DEFUN(PHP_LIBGCC_LIBPATH,[ changequote({,}) libgcc_libpath=`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'` changequote([,]) ]) AC_DEFUN(PHP_ARG_ANALYZE,[ case [$]$1 in shared,*) ext_output="yes, shared" ext_shared=yes $1=`echo "[$]$1"|sed 's/^shared,//'` ;; shared) ext_output="yes, shared" ext_shared=yes $1=yes ;; no) ext_output=no ext_shared=no ;; *) ext_output=yes ext_shared=no ;; esac if test "$php_always_shared" = "yes"; then ext_output="yes, shared" ext_shared=yes test "[$]$1" = "no" && $1=yes fi AC_MSG_RESULT($ext_output) ]) dnl dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val]) dnl Sets PHP_ARG_NAME either to the user value or to the default value. dnl default-val defaults to no. This will also set the variable ext_shared, dnl and will overwrite any previous variable of that name. dnl AC_DEFUN(PHP_ARG_WITH,[ PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_)) ]) AC_DEFUN(PHP_REAL_ARG_WITH,[ AC_MSG_CHECKING($2) AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4)) PHP_ARG_ANALYZE($5) ]) dnl dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val]) dnl Sets PHP_ARG_NAME either to the user value or to the default value. dnl default-val defaults to no. This will also set the variable ext_shared, dnl and will overwrite any previous variable of that name. dnl AC_DEFUN(PHP_ARG_ENABLE,[ PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_)) ]) AC_DEFUN(PHP_REAL_ARG_ENABLE,[ AC_MSG_CHECKING($2) AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4)) PHP_ARG_ANALYZE($5) ]) AC_DEFUN(PHP_MODULE_PTR,[ EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1," ]) AC_DEFUN(PHP_CONFIG_NICE,[ rm -f $1 cat >$1<> $1 fi done for arg in [$]0 "[$]@"; do echo "'[$]arg' \\" >> $1 done echo '"[$]@"' >> $1 chmod +x $1 ]) AC_DEFUN(PHP_TIME_R_TYPE,[ AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[ AC_TRY_RUN([ #include main() { char buf[27]; struct tm t; time_t old = 0; int r, s; s = gmtime_r(&old, &t); r = (int) asctime_r(&t, buf, 26); if (r == s && s == 0) return (0); return (1); } ],[ ac_cv_time_r_type=hpux ],[ AC_TRY_RUN([ #include main() { struct tm t, *s; time_t old = 0; char buf[27], *p; s = gmtime_r(&old, &t); p = asctime_r(&t, buf, 26); if (p == buf && s == &t) return (0); return (1); } ],[ ac_cv_time_r_type=irix ],[ ac_cv_time_r_type=POSIX ]) ],[ ac_cv_time_r_type=POSIX ]) ]) case $ac_cv_time_r_type in hpux) AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; irix) AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; esac ]) AC_DEFUN(PHP_SUBST,[ PHP_VAR_SUBST="$PHP_VAR_SUBST $1" ]) AC_DEFUN(PHP_SUBST_OLD,[ PHP_SUBST($1) AC_SUBST($1) ]) AC_DEFUN(PHP_FAST_OUTPUT,[ PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1" ]) AC_DEFUN(PHP_MKDIR_P_CHECK,[ AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[ test -d conftestdir && rm -rf conftestdir mkdir -p conftestdir/somedir >/dev/null 2>&1 dnl `mkdir -p' must be quiet about creating existing directories mkdir -p conftestdir/somedir >/dev/null 2>&1 if test "$?" = "0" && test -d conftestdir/somedir; then ac_cv_mkdir_p=yes else ac_cv_mkdir_p=no fi rm -rf conftestdir ]) ]) AC_DEFUN(PHP_GEN_CONFIG_VARS,[ PHP_MKDIR_P_CHECK echo creating config_vars.mk > config_vars.mk for i in $PHP_VAR_SUBST; do eval echo "$i = \$$i" >> config_vars.mk done ]) AC_DEFUN(PHP_GEN_MAKEFILES,[ $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1 ]) AC_DEFUN(PHP_TM_GMTOFF,[ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = yes; then AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm]) fi ]) dnl PHP_CONFIGURE_PART(MESSAGE) dnl Idea borrowed from mm AC_DEFUN(PHP_CONFIGURE_PART,[ AC_MSG_RESULT() AC_MSG_RESULT(${T_MD}$1${T_ME}) ]) AC_DEFUN(PHP_PROG_SENDMAIL,[ AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib) if test -n "$PROG_SENDMAIL"; then AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail]) fi ]) AC_DEFUN(PHP_RUNPATH_SWITCH,[ dnl check for -R, etc. switch AC_MSG_CHECKING(if compiler supports -R) AC_CACHE_VAL(php_cv_cc_dashr,[ SAVE_LIBS=$LIBS LIBS="-R /usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) LIBS=$SAVE_LIBS]) AC_MSG_RESULT($php_cv_cc_dashr) if test $php_cv_cc_dashr = "yes"; then ld_runpath_switch=-R else AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) AC_CACHE_VAL(php_cv_cc_rpath,[ SAVE_LIBS=$LIBS LIBS="-Wl,-rpath,/usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) LIBS=$SAVE_LIBS]) AC_MSG_RESULT($php_cv_cc_rpath) if test $php_cv_cc_rpath = "yes"; then ld_runpath_switch=-Wl,-rpath, else dnl something innocuous ld_runpath_switch=-L fi fi ]) AC_DEFUN(PHP_STRUCT_FLOCK,[ AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, AC_TRY_COMPILE([ #include #include ], [struct flock x;], [ ac_cv_struct_flock=yes ],[ ac_cv_struct_flock=no ]) ) if test "$ac_cv_struct_flock" = "yes" ; then AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock]) fi ]) AC_DEFUN(PHP_SOCKLEN_T,[ AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, AC_TRY_COMPILE([ #include #include ],[ socklen_t x; ],[ ac_cv_socklen_t=yes ],[ ac_cv_socklen_t=no ])) if test "$ac_cv_socklen_t" = "yes"; then AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) fi ]) dnl dnl PHP_SET_SYM_FILE(path) dnl dnl set the path of the file which contains the symbol export list dnl AC_DEFUN(PHP_SET_SYM_FILE, [ PHP_SYM_FILE=$1 ]) dnl dnl PHP_BUILD_THREAD_SAFE dnl AC_DEFUN(PHP_BUILD_THREAD_SAFE,[ enable_experimental_zts=yes if test "$pthreads_working" != "yes"; then AC_MSG_ERROR(ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.) fi ]) AC_DEFUN(PHP_REQUIRE_CXX,[ if test -z "$php_cxx_done"; then AC_PROG_CXX AC_PROG_CXXCPP php_cxx_done=yes fi ]) dnl dnl PHP_BUILD_SHARED dnl AC_DEFUN(PHP_BUILD_SHARED,[ php_build_target=shared ]) dnl dnl PHP_BUILD_STATIC dnl AC_DEFUN(PHP_BUILD_STATIC,[ php_build_target=static ]) dnl dnl PHP_BUILD_PROGRAM dnl AC_DEFUN(PHP_BUILD_PROGRAM,[ php_build_target=program ]) dnl dnl AC_PHP_ONCE(namespace, variable, code) dnl dnl execute code, if variable is not set in namespace dnl AC_DEFUN(AC_PHP_ONCE,[ changequote({,}) unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) cmd="echo $ac_n \"\$$1$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "$1$unique=set" $3 fi ]) dnl dnl PHP_EXPAND_PATH(path, variable) dnl dnl expands path to an absolute path and assigns it to variable dnl AC_DEFUN(PHP_EXPAND_PATH,[ if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then $2=$1 else changequote({,}) ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" changequote([,]) ep_realdir="`(cd \"$ep_dir\" && pwd)`" $2="$ep_realdir/`basename \"$1\"`" fi ]) dnl dnl PHP_ADD_LIBPATH(path[, shared-libadd]) dnl dnl add a library to linkpath/runpath dnl AC_DEFUN(PHP_ADD_LIBPATH,[ if test "$1" != "/usr/lib"; then PHP_EXPAND_PATH($1, ai_p) if test "$ext_shared" = "yes" && test -n "$2"; then $2="-R$1 -L$1 [$]$2" else AC_PHP_ONCE(LIBPATH, $ai_p, [ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" LDFLAGS="$LDFLAGS -L$ai_p" PHP_RPATHS="$PHP_RPATHS $ai_p" ]) fi fi ]) dnl dnl PHP_BUILD_RPATH() dnl dnl builds RPATH from PHP_RPATHS dnl AC_DEFUN(PHP_BUILD_RPATH,[ if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then OLD_RPATHS="$PHP_RPATHS" unset PHP_RPATHS for i in $OLD_RPATHS; do PHP_LDFLAGS="$PHP_LDFLAGS -L$i" PHP_RPATHS="$PHP_RPATHS -R $i" NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" done fi ]) dnl dnl PHP_ADD_INCLUDE(path [,before]) dnl dnl add an include path. dnl if before is 1, add in the beginning of INCLUDES. dnl AC_DEFUN(PHP_ADD_INCLUDE,[ if test "$1" != "/usr/include"; then PHP_EXPAND_PATH($1, ai_p) AC_PHP_ONCE(INCLUDEPATH, $ai_p, [ if test "$2"; then INCLUDES="-I$ai_p $INCLUDES" else INCLUDES="$INCLUDES -I$ai_p" fi ]) fi ]) AC_DEFUN(PHP_X_ADD_LIBRARY,[ ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1") ]) dnl dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]]) dnl dnl add a library to the link line dnl AC_DEFUN(PHP_ADD_LIBRARY,[ case $1 in c|c_r|pthread*) ;; *) ifelse($3,,[ PHP_X_ADD_LIBRARY($1,$2,LIBS) ],[ if test "$ext_shared" = "yes"; then PHP_X_ADD_LIBRARY($1,$2,$3) else PHP_ADD_LIBRARY($1,$2) fi ]) ;; esac ]) dnl dnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]]) dnl dnl add a library to the link line (deferred) dnl AC_DEFUN(PHP_ADD_LIBRARY_DEFER,[ case $1 in c|c_r|pthread*) ;; *) ifelse($3,,[ PHP_X_ADD_LIBRARY($1,$2,DLIBS) ],[ if test "$ext_shared" = "yes"; then PHP_X_ADD_LIBRARY($1,$2,$3) else PHP_ADD_LIBRARY_DEFER($1,$2) fi ]) ;; esac ]) dnl dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd]) dnl dnl add a library to the link line and path to linkpath/runpath. dnl if shared-libadd is not empty and $ext_shared is yes, dnl shared-libadd will be assigned the library information dnl AC_DEFUN(PHP_ADD_LIBRARY_WITH_PATH,[ ifelse($3,,[ if test -n "$2"; then PHP_ADD_LIBPATH($2) fi PHP_ADD_LIBRARY($1) ],[ if test "$ext_shared" = "yes"; then $3="-l$1 [$]$3" if test -n "$2"; then PHP_ADD_LIBPATH($2,$3) fi else PHP_ADD_LIBRARY_WITH_PATH($1,$2) fi ]) ]) dnl dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path) dnl dnl add a library to the link line (deferred) dnl and path to linkpath/runpath (not deferred) dnl AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[ PHP_ADD_LIBPATH($2) PHP_ADD_LIBRARY_DEFER($1) ]) dnl dnl Set libtool variable dnl AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[ LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' ]) dnl dnl Check for cc option dnl AC_DEFUN(PHP_CHECK_CC_OPTION,[ echo "main(){return 0;}" > conftest.$ac_ext opt=$1 changequote({,}) var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) AC_MSG_CHECKING([if compiler supports -$1 really]) ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then eval php_cc_$var=no AC_MSG_RESULT(no) else if eval ./conftest 2>/dev/null ; then eval php_cc_$var=yes AC_MSG_RESULT(yes) else eval php_cc_$var=no AC_MSG_RESULT(no) fi fi ]) AC_DEFUN(PHP_REGEX,[ if test "$REGEX_TYPE" = "php"; then REGEX_LIB=regex/libregex.la REGEX_DIR=regex AC_DEFINE(HSREGEX,1,[ ]) AC_DEFINE(REGEX,1,[ ]) PHP_FAST_OUTPUT(regex/Makefile) elif test "$REGEX_TYPE" = "system"; then AC_DEFINE(REGEX,0,[ ]) fi AC_MSG_CHECKING(which regex library to use) AC_MSG_RESULT($REGEX_TYPE) PHP_SUBST(REGEX_DIR) PHP_SUBST(REGEX_LIB) PHP_SUBST(HSREGEX) ]) dnl dnl See if we have broken header files like SunOS has. dnl AC_DEFUN(PHP_MISSING_FCLOSE_DECL,[ AC_MSG_CHECKING([for fclose declaration]) AC_TRY_COMPILE([#include ],[int (*func)() = fclose],[ AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) AC_MSG_RESULT(ok) ],[ AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) AC_MSG_RESULT(missing) ]) ]) dnl dnl Check for broken sprintf() dnl AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[ AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ ac_cv_broken_sprintf=no ],[ ac_cv_broken_sprintf=yes ],[ ac_cv_broken_sprintf=no ]) ]) if test "$ac_cv_broken_sprintf" = "yes"; then AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ]) else AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ]) fi ]) dnl dnl PHP_EXTENSION(extname [, shared]) dnl dnl Includes an extension in the build. dnl dnl "extname" is the name of the ext/ subdir where the extension resides dnl "shared" can be set to "shared" or "yes" to build the extension as dnl a dynamically loadable library. dnl AC_DEFUN(PHP_EXTENSION,[ EXT_SUBDIRS="$EXT_SUBDIRS $1" if test -d "$abs_srcdir/ext/$1"; then dnl ---------------------------------------------- Internal Module ext_builddir=ext/$1 ext_srcdir=$abs_srcdir/ext/$1 else dnl ---------------------------------------------- External Module ext_builddir=. ext_srcdir=$abs_srcdir fi if test "$2" != "shared" && test "$2" != "yes"; then dnl ---------------------------------------------- Static module LIB_BUILD($ext_builddir) EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la" EXT_STATIC="$EXT_STATIC $1" else dnl ---------------------------------------------- Shared module LIB_BUILD($ext_builddir,yes) AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module) fi PHP_FAST_OUTPUT($ext_builddir/Makefile) ]) dnl dnl Solaris requires main code to be position independent in order dnl to let shared objects find symbols. Weird. Ugly. dnl dnl Must be run after all --with-NN options that let the user dnl choose dynamic extensions, and after the gcc test. dnl AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[ AC_MSG_CHECKING(whether -fPIC is required) if test -n "$EXT_SHARED"; then os=`uname -sr 2>/dev/null` case $os in "SunOS 5.6"|"SunOS 5.7") case $CC in gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; *) CFLAGS="$CFLAGS -fpic";; esac AC_MSG_RESULT(yes);; *) AC_MSG_RESULT(no);; esac else AC_MSG_RESULT(no) fi ]) dnl dnl Checks whether $withval is "shared" or starts with "shared,XXX" dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff dnl from $withval. dnl AC_DEFUN(PHP_WITH_SHARED,[ case $withval in shared) shared=yes withval=yes ;; shared,*) shared=yes withval=`echo $withval | sed -e 's/^shared,//'` ;; *) shared=no ;; esac if test -n "$php_always_shared"; then shared=yes fi ]) dnl The problem is that the default compilation flags in Solaris 2.6 won't dnl let programs access large files; you need to tell the compiler that dnl you actually want your programs to work on large files. For more dnl details about this brain damage please see: dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html dnl Written by Paul Eggert . AC_DEFUN(PHP_SYS_LFS, [dnl # If available, prefer support for large files unless the user specified # one of the CPPFLAGS, LDFLAGS, or LIBS variables. AC_MSG_CHECKING(whether large file support needs explicit enabling) ac_getconfs='' ac_result=yes ac_set='' ac_shellvars='CPPFLAGS LDFLAGS LIBS' for ac_shellvar in $ac_shellvars; do case $ac_shellvar in CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;; *) ac_lfsvar=LFS_$ac_shellvar ;; esac eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } ac_getconf=`getconf $ac_lfsvar` ac_getconfs=$ac_getconfs$ac_getconf eval ac_test_$ac_shellvar=\$ac_getconf done case "$ac_result$ac_getconfs" in yes) ac_result=no ;; esac case "$ac_result$ac_set" in yes?*) ac_result="yes, but $ac_set is already set, so use its settings" esac AC_MSG_RESULT($ac_result) case $ac_result in yes) for ac_shellvar in $ac_shellvars; do eval $ac_shellvar=\$ac_test_$ac_shellvar done ;; esac ]) AC_DEFUN(PHP_SOCKADDR_SA_LEN,[ AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ AC_TRY_COMPILE([#include #include ], [struct sockaddr s; s.sa_len;], [ac_cv_sockaddr_sa_len=yes AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])], [ac_cv_sockaddr_sa_len=no]) ]) ]) dnl ## PHP_OUTPUT(file) dnl ## adds "file" to the list of files generated by AC_OUTPUT dnl ## This macro can be used several times. AC_DEFUN(PHP_OUTPUT,[ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1" ]) AC_DEFUN(PHP_DECLARED_TIMEZONE,[ AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ AC_TRY_COMPILE([ #include #include #ifdef HAVE_SYS_TIME_H #include #endif ],[ time_t foo = (time_t) timezone; ],[ ac_cv_declared_timezone=yes ],[ ac_cv_declared_timezone=no ])]) if test "$ac_cv_declared_timezone" = "yes"; then AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) fi ]) AC_DEFUN(PHP_EBCDIC,[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [ int main(void) { return (unsigned char)'A' != (unsigned char)0xC1; } ],[ ac_cv_ebcdic=yes ],[ ac_cv_ebcdic=no ],[ ac_cv_ebcdic=no ])]) if test "$ac_cv_ebcdic" = "yes"; then AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) fi ]) AC_DEFUN(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH], $@)]) AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY], $@)]) AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH], $@)]) AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE], $@)]) AC_DEFUN(PHP_FOPENCOOKIE,[ AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ]) if test "$have_glibc_fopencookie" = "yes" ; then dnl this comes in two flavors: dnl newer glibcs (since 2.1.2 ? ) dnl have a type called cookie_io_functions_t AC_TRY_COMPILE([ #define _GNU_SOURCE #include ], [ cookie_io_functions_t cookie; ], [ have_cookie_io_functions_t=yes ], [ ] ) if test "$have_cookie_io_functions_t" = "yes" ; then cookie_io_functions_t=cookie_io_functions_t have_fopen_cookie=yes else dnl older glibc versions (up to 2.1.2 ?) dnl call it _IO_cookie_io_functions_t AC_TRY_COMPILE([ #define _GNU_SOURCE #include ], [ _IO_cookie_io_functions_t cookie; ], [ have_IO_cookie_io_functions_t=yes ], [] ) if test "$have_cookie_io_functions_t" = "yes" ; then cookie_io_functions_t=_IO_cookie_io_functions_t have_fopen_cookie=yes fi fi if test "$have_fopen_cookie" = "yes" ; then AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ]) AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ]) fi fi ]) # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- # serial 46 AC_PROG_LIBTOOL AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ]) AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl _LT_AC_PROG_ECHO_BACKSLASH # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_RESTORE]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, [AC_TRY_LINK([], [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) case $host/$CC in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) CFLAGS="$SAVE_CFLAGS" ;; *-*-cygwin* | *-*-pw32*) # cygwin systems need to pass --dll to the linker, and not link # crt.o which will require a WinMain@16 definition. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; esac ;; ]) esac _LT_AC_LTCONFIG_HACK ]) # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN(_LT_AC_CHECK_DLFCN, [AC_CHECK_HEADERS(dlfcn.h) ])# _LT_AC_CHECK_DLFCN # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. [symcode='[BCDEGRST]'] # Regexp to match symbols that can be accessed directly from C. [sympat='\([_A-Za-z][_A-Za-z0-9]*\)'] # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case $host_os in aix*) [symcode='[BCDT]'] ;; cygwin* | mingw* | pw32*) [symcode='[ABCDGISTW]'] ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ;; irix*) [symcode='[BCDEGRST]'] ;; solaris* | sysv5*) [symcode='[BDT]'] ;; sysv4) [symcode='[DFNSTU]'] ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then [symcode='[ABCDGISTW]'] fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. [lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"] # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } [lt_preloaded_symbols[] =] { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $nlist" >&AC_FD_CC fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" fi if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # --------------------------------- AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [# Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac fi ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn;t interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) AC_DIVERT_POP ])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF, [if test "$cross_compiling" = yes; then : [$4] else AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF, [if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load", [AC_CHECK_LIB(svld, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB(dld, shl_load, [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF AC_DEFUN([_LT_AC_LTCONFIG_HACK], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="[$]2" AC_MSG_CHECKING([for objdir]) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null AC_MSG_RESULT($objdir) AC_ARG_WITH(pic, [ --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. AC_MSG_CHECKING([for $compiler option to produce PIC]) AC_CACHE_VAL(lt_cv_prog_cc_pic, [ lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi ]) if test -z "$lt_cv_prog_cc_pic"; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$lt_cv_prog_cc_pic]) # Check to make sure the pic_flag actually works. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" AC_TRY_COMPILE([], [], [dnl case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac ], [dnl lt_cv_prog_cc_pic_works=no ]) CFLAGS="$save_CFLAGS" ]) if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then : else AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) lt_cv_prog_cc_can_build_shared=no fi fi AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) LDFLAGS="$save_LDFLAGS" ]) # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) AC_CACHE_VAL([lt_cv_compiler_c_o], [ $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&AC_FD_CC lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null ]) compiler_c_o=$lt_cv_compiler_c_o AC_MSG_RESULT([$compiler_c_o]) if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) AC_CACHE_VAL([lt_cv_compiler_o_lo], [ lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi ]) CFLAGS="$save_CFLAGS" ]) compiler_o_lo=$lt_cv_compiler_o_lo AC_MSG_RESULT([$compiler_o_lo]) else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$compiler_rtti_exceptions]) if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* ) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \[$]# in 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else if test "$host_cpu" = ia64; then shared_flag='-G' else shared_flag='${wl}-bM:SRE' fi hardcode_direct=yes fi if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # Test if we are trying to use run time linking, or normal AIX style linking. # If -brtl is somewhere in LDFLAGS, we need to do run time linking. aix_use_runtimelinking=no for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then aix_use_runtimelinking=yes break fi done exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' allow_undefined_flag=' -Wl,-G' archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-znodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, -berok will # link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) allow_undefined_flag='-undefined suppress' # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z defs' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in [solaris2.[0-5] | solaris2.[0-5].*]) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi AC_MSG_RESULT([$ld_shlibs]) test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. AC_MSG_CHECKING([how to hardcode library paths into programs]) hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi AC_MSG_RESULT([$hardcode_action]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in [ aix4 | aix4.[01] | aix4.[01].*)] if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so instead of # lib.a to let people know that these are not typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH deplibs_check_method=pass_all fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi AC_LIBTOOL_DLOPEN_SELF if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], [$rm conftest* echo 'static int dummy;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi]) AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ])# _LT_AC_LTCONFIG_HACK # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac], enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac], enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) # AC_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ]) # AC_PATH_MAGIC - find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) else MAGIC_CMD=: fi fi ]) # AC_PROG_LD - find the path to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) # AC_PROG_LD_GNU - AC_DEFUN([AC_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi]) with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" ]) # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependant libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # ['file_magic [regex]'] -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;] esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] else [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'] fi ;; newos6*) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; [sysv5uw[78]* | sysv4*uw2*)] lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;; sni) lt_cv_file_magic_cmd='/bin/file' [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"] lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, main, LIBM="-lm") ;; esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for # the libltdl convenience library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-convenience to the # configure arguments. Note that LIBLTDL and INCLTDL are not # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed # with '${top_builddir}/' and INCLTDL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-install to the configure # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed # with '${top_srcdir}/' (note the single quotes!). If your package is # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" INCLTDL= fi ]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) htdig-3.2.0b6/libhtdigphp/confdefs.h0100644006314600127310000000000110026717351016612 0ustar angusgbhtdig htdig-3.2.0b6/libhtdigphp/config.guess0100755006314600127310000011461710026717351017215 0ustar angusgbhtdig#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-04-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 if test $? = 0 ; then CC_FOR_BUILD="$c"; break fi done rm -f $dummy.c $dummy.o $dummy.rel if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) cat >$dummy.c < /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __MIPSEB__ printf ("%s-unknown-linux-gnu\n", argv[1]); #endif #ifdef __MIPSEL__ printf ("%sel-unknown-linux-gnu\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy ;; ppc:Linux:*:*) # Determine Lib Version cat >$dummy.c < #if defined(__GLIBC__) extern char __libc_version[]; extern char __libc_release[]; #endif main(argc, argv) int argc; char *argv[]; { #if defined(__GLIBC__) printf("%s %s\n", __libc_version, __libc_release); #else printf("unknown\n"); #endif return 0; } EOF LIBC="" $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null if test "$?" = 0 ; then ./$dummy | grep 1\.99 > /dev/null if test "$?" = 0 ; then LIBC="libc1" ; fi fi rm -f $dummy.c $dummy echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; alpha:Linux:*:*) cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF LIBC="" $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; esac objdump --private-headers $dummy | \ grep ld.so.1 > /dev/null if test "$?" = 0 ; then LIBC="libc1" fi fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_emulations=`cd /; ld --help 2>&1 \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// s/ .*// p'` case "$ld_supported_emulations" in i*86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; elf_i*86) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; i*86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; esac # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i*86) VENDOR=pc; ;; *) VENDOR=unknown; ;; esac # Determine whether the default compiler is a.out or elf cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. i*86:DYNIX/ptx:4*:*) echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:7*) # Fixed at (any) Pentium or better UNAME_MACHINE=i586 if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} fi exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: htdig-3.2.0b6/libhtdigphp/config.h0100644006314600127310000000063310026717351016303 0ustar angusgbhtdig/* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if your C compiler doesn't accept -c and -o together. */ /* #undef NO_MINUS_C_MINUS_O */ /* Define if you have the header file. */ #define HAVE_DLFCN_H 1 /* Whether to build bz2 as dynamic module */ #define COMPILE_DL_BZ2 1 #define COMPILE_DL_HTDIG 1 htdig-3.2.0b6/libhtdigphp/config.h.in0100644006314600127310000000047410026717351016713 0ustar angusgbhtdig/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define if you have the header file. */ #undef HAVE_DLFCN_H /* Whether to build bz2 as dynamic module */ #undef COMPILE_DL_BZ2 htdig-3.2.0b6/libhtdigphp/config.log0100644006314600127310000000100510026717351016627 0ustar angusgbhtdigThis file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. configure:710: checking for gcc configure:823: checking whether the C compiler (gcc ) works configure:839: gcc -o conftest conftest.c 1>&5 configure:865: checking whether the C compiler (gcc ) is a cross-compiler configure:870: checking whether we are using GNU C configure:898: checking whether gcc accepts -g configure:931: checking whether gcc and cc understand -c and -o together htdig-3.2.0b6/libhtdigphp/config.m40100644006314600127310000000164410026717351016377 0ustar angusgbhtdigdnl $Id: config.m4,v 1.1 2004/03/20 01:31:21 nealr Exp $ dnl config.m4 for extension HtDig PHP_ARG_WITH(bz2, for HtDig support, [ --with-bz2[=DIR] Include HtDig support]) if test "$PHP_HTDIG" != "no"; then if test -r $PHP_HTDIG/include/libhtdig_api.h; then HTDIG_DIR=$PHP_HTDIG else AC_MSG_CHECKING(for HtDig in default path) for i in /usr/local /usr; do if test -r $i/include/libhtdig_api.h; then HTDIG_DIR=$i AC_MSG_RESULT(found in $i) fi done fi if test -z "$HTDIG_DIR"; then AC_MSG_RESULT(not found) AC_MSG_ERROR(Please reinstall the HtDig distribution) fi PHP_ADD_INCLUDE($HTDIG_DIR/include) PHP_SUBST(HTDIG_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(bz2, $HTDIG_DIR/lib, HTDIG_SHARED_LIBADD) #AC_CHECK_LIB(bz2, BZ2_bzerror, [AC_DEFINE(HAVE_BZ2,1,[ ])], [AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)],) PHP_EXTENSION(bz2, $ext_shared) fi htdig-3.2.0b6/libhtdigphp/config.status0100644006314600127310000001725710026717351017411 0ustar angusgbhtdig#! /bin/sh # Generated automatically by configure. # Run this file to recreate the current configuration. # This directory was configured as follows, # on host swan.rightnowtech.com: # # ./configure --with-php-config=/nfs/local/linux/bin/php-config # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" for ac_option do case "$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running ${CONFIG_SHELL-/bin/sh} ./configure --with-php-config=/nfs/local/linux/bin/php-config --no-create --no-recursion" exec ${CONFIG_SHELL-/bin/sh} ./configure --with-php-config=/nfs/local/linux/bin/php-config --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "./config.status generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "$ac_cs_usage"; exit 0 ;; *) echo "$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=. trap 'rm -fr config.h conftest*; exit 1' 1 2 15 # Protect against being on the right side of a sed subst in config.status. sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF /^[ ]*VPATH[ ]*=[^:]*$/d s%@SHELL@%/bin/sh%g s%@CFLAGS@%-g -O2%g s%@CPPFLAGS@% -DHAVE_CONFIG_H%g s%@CXXFLAGS@%%g s%@FFLAGS@%%g s%@DEFS@%-DHAVE_CONFIG_H%g s%@LDFLAGS@%%g s%@LIBS@%%g s%@exec_prefix@%$(prefix)%g s%@prefix@%/nfs/local/linux%g s%@program_transform_name@%s,x,x,%g s%@bindir@%${exec_prefix}/bin%g s%@sbindir@%${exec_prefix}/sbin%g s%@libexecdir@%${exec_prefix}/libexec%g s%@datadir@%${prefix}/share%g s%@sysconfdir@%${prefix}/etc%g s%@sharedstatedir@%${prefix}/com%g s%@localstatedir@%${prefix}/var%g s%@libdir@%${exec_prefix}/lib%g s%@includedir@%${prefix}/include%g s%@oldincludedir@%/usr/include%g s%@infodir@%${prefix}/info%g s%@mandir@%${prefix}/man%g s%@CC@%gcc%g s%@host@%i686-pc-linux-gnu%g s%@host_alias@%i686-pc-linux-gnu%g s%@host_cpu@%i686%g s%@host_vendor@%pc%g s%@host_os@%linux-gnu%g s%@build@%i686-pc-linux-gnu%g s%@build_alias@%i686-pc-linux-gnu%g s%@build_cpu@%i686%g s%@build_vendor@%pc%g s%@build_os@%linux-gnu%g s%@LN_S@%ln -s%g s%@OBJEXT@%o%g s%@EXEEXT@%%g s%@ECHO@%echo%g s%@RANLIB@%ranlib%g s%@STRIP@%strip%g s%@CPP@%gcc -E%g s%@LIBTOOL@%$(SHELL) $(top_builddir)/libtool%g CEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi CONFIG_FILES=${CONFIG_FILES-""} for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then CONFIG_HEADERS="config.h" fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in cat > conftest.frag < conftest.out rm -f conftest.in mv conftest.out conftest.in rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done exit 0 htdig-3.2.0b6/libhtdigphp/config.sub0100755006314600127310000006571210026717351016661 0ustar angusgbhtdig#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-04-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ | we32k | ns16k | clipper | i370 | sh | sh[34] \ | powerpc | powerpcle \ | 1750a | dsp16xx | pdp10 | pdp11 \ | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \ | v850 | c4x \ | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ | pj | pjl | h8500) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ | hppa2.0n-* | hppa64-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | clipper-* | orion-* \ | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \ | mips16-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ | [cjt]90-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: htdig-3.2.0b6/libhtdigphp/config_vars.mk0100644006314600127310000000135110026717351017514 0ustar angusgbhtdigHTDIG_SHARED_LIBADD = -R/usr/local/lib -L/usr/local/lib -lbz2 prefix = /nfs/local/linux exec_prefix = $(prefix) libdir = ${exec_prefix}/lib prefix = /nfs/local/linux phplibdir = modules #phplibdir = $(PWD)/modules PHP_COMPILE = $(LIBTOOL) --mode=compile $(COMPILE) -c $< CC = gcc CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = -DHAVE_CONFIG_H CXX = DEFS = EXTENSION_DIR = /usr/local/lib/php/extensions/no-debug-non-zts-20010901 EXTRA_LDFLAGS = EXTRA_LIBS = INCLUDES = -I/nfs/local/linux/include/php4 -I/nfs/local/linux/include/php4/main -I/nfs/local/linux/include/php4/Zend -I/nfs/local/linux/include/php4/TSRM -I/usr/local/include LEX = LEX_OUTPUT_ROOT = LFLAGS = SHARED_LIBTOOL = $(LIBTOOL) LIBTOOL = $(SHELL) $(top_builddir)/libtool SHELL = /bin/sh htdig-3.2.0b6/libhtdigphp/configure0100755006314600127310000053532010063260373016600 0ustar angusgbhtdig#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-php-config=PATH" ac_default_prefix= ac_help="$ac_help --with-bz2[=DIR] Include HtDig support" ac_help="$ac_help --enable-shared[=PKGS] build shared libraries [default=yes]" ac_help="$ac_help --enable-static[=PKGS] build static libraries [default=yes]" ac_help="$ac_help --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" ac_help="$ac_help --with-gnu-ld assume the C compiler uses GNU ld [default=no]" # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi ac_help="$ac_help --disable-libtool-lock avoid locking (might break parallel builds)" ac_help="$ac_help --with-pic try to use only PIC/non-PIC objects [default=use both]" # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=Makefile.in # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi abs_srcdir=`(cd $srcdir && pwd)` php_always_shared=yes # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:710: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:740: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" break fi done IFS="$ac_save_ifs" if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" "$@" shift ac_cv_prog_CC="$@" fi fi fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$CC"; then case "`uname -s`" in *win32* | *WIN32*) # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:791: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="cl" break fi done IFS="$ac_save_ifs" fi fi CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi ;; esac fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 echo "configure:823: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF #line 834 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then ac_cv_prog_cc_cross=no else ac_cv_prog_cc_cross=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_works=no fi rm -fr conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 echo "configure:865: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 echo "configure:870: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes else GCC= fi ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 echo "configure:898: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 if test "$ac_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 if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 echo "configure:931: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 echo "configure:934: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'foo(){}' > conftest.c # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' if { (eval echo configure:946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && test -f conftest.o && { (eval echo configure:947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' if { (eval echo configure:954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && test -f conftest.o && { (eval echo configure:955: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 cat >> confdefs.h <<\EOF #define NO_MINUS_C_MINUS_O 1 EOF fi # Check whether --with-php-config or --without-php-config was given. if test "${with_php_config+set}" = set; then withval="$with_php_config" PHP_CONFIG=$withval else PHP_CONFIG=php-config fi prefix=`$PHP_CONFIG --prefix 2>/dev/null` INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` EXTENSION_DIR=`$PHP_CONFIG --extension-dir` if test -z "$prefix"; then { echo "configure: error: Cannot find php-config. Please use --with-php-config=PATH" 1>&2; exit 1; } fi echo $ac_n "checking for PHP prefix""... $ac_c" 1>&6 echo "configure:1004: checking for PHP prefix" >&5 echo "$ac_t""$prefix" 1>&6 echo $ac_n "checking for PHP includes""... $ac_c" 1>&6 echo "configure:1007: checking for PHP includes" >&5 echo "$ac_t""$INCLUDES" 1>&6 echo $ac_n "checking for PHP extension directory""... $ac_c" 1>&6 echo "configure:1010: checking for PHP extension directory" >&5 echo "$ac_t""$EXTENSION_DIR" 1>&6 echo $ac_n "checking for HtDig support""... $ac_c" 1>&6 echo "configure:1020: checking for HtDig support" >&5 # Check whether --with-bz2 or --without-bz2 was given. if test "${with_bz2+set}" = set; then withval="$with_bz2" PHP_BZ2=$withval else PHP_BZ2=no fi case $PHP_BZ2 in shared,*) ext_output="yes, shared" ext_shared=yes PHP_BZ2=`echo "$PHP_BZ2"|sed 's/^shared,//'` ;; shared) ext_output="yes, shared" ext_shared=yes PHP_BZ2=yes ;; no) ext_output=no ext_shared=no ;; *) ext_output=yes ext_shared=no ;; esac if test "$php_always_shared" = "yes"; then ext_output="yes, shared" ext_shared=yes test "$PHP_BZ2" = "no" && PHP_BZ2=yes fi echo "$ac_t""$ext_output" 1>&6 if test "$PHP_HTDIG" != "no"; then if test -r $PHP_HTDIG/include/libhtdig_api.h; then HTDIG_DIR=$PHP_HTDIG else echo $ac_n "checking for HtDig in default path""... $ac_c" 1>&6 echo "configure:1067: checking for HtDig in default path" >&5 for i in /usr/local /usr; do if test -r $i/include/libhtdig_api.h; then HTDIG_DIR=$i echo "$ac_t""found in $i" 1>&6 fi done fi if test -z "$HTDIG_DIR"; then echo "$ac_t""not found" 1>&6 { echo "configure: error: Please reinstall the HtDig distribution" 1>&2; exit 1; } fi if test "$HTDIG_DIR/include" != "/usr/include"; then if test -z "$HTDIG_DIR/include" || echo "$HTDIG_DIR/include" | grep '^/' >/dev/null ; then ai_p=$HTDIG_DIR/include else ep_dir="`echo $HTDIG_DIR/include|sed 's%/*[^/][^/]*/*$%%'`" ep_realdir="`(cd \"$ep_dir\" && pwd)`" ai_p="$ep_realdir/`basename \"$HTDIG_DIR/include\"`" fi unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'` cmd="echo $ac_n \"\$INCLUDEPATH$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "INCLUDEPATH$unique=set" if test ""; then INCLUDES="-I$ai_p $INCLUDES" else INCLUDES="$INCLUDES -I$ai_p" fi fi fi PHP_VAR_SUBST="$PHP_VAR_SUBST HTDIG_SHARED_LIBADD" if test "$ext_shared" = "yes"; then HTDIG_SHARED_LIBADD="-lbz2 $HTDIG_SHARED_LIBADD" if test -n "$HTDIG_DIR/lib"; then if test "$HTDIG_DIR/lib" != "/usr/lib"; then if test -z "$HTDIG_DIR/lib" || echo "$HTDIG_DIR/lib" | grep '^/' >/dev/null ; then ai_p=$HTDIG_DIR/lib else ep_dir="`echo $HTDIG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`" ep_realdir="`(cd \"$ep_dir\" && pwd)`" ai_p="$ep_realdir/`basename \"$HTDIG_DIR/lib\"`" fi if test "$ext_shared" = "yes" && test -n "HTDIG_SHARED_LIBADD"; then HTDIG_SHARED_LIBADD="-R$HTDIG_DIR/lib -L$HTDIG_DIR/lib $HTDIG_SHARED_LIBADD" else unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'` cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "LIBPATH$unique=set" test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" LDFLAGS="$LDFLAGS -L$ai_p" PHP_RPATHS="$PHP_RPATHS $ai_p" fi fi fi fi else if test -n "$HTDIG_DIR/lib"; then if test "$HTDIG_DIR/lib" != "/usr/lib"; then if test -z "$HTDIG_DIR/lib" || echo "$HTDIG_DIR/lib" | grep '^/' >/dev/null ; then ai_p=$HTDIG_DIR/lib else ep_dir="`echo $HTDIG_DIR/lib|sed 's%/*[^/][^/]*/*$%%'`" ep_realdir="`(cd \"$ep_dir\" && pwd)`" ai_p="$ep_realdir/`basename \"$HTDIG_DIR/lib\"`" fi if test "$ext_shared" = "yes" && test -n ""; then ="-R$HTDIG_DIR/lib -L$HTDIG_DIR/lib $" else unique=`echo $ai_p|sed 's/[^a-zA-Z0-9]/_/g'` cmd="echo $ac_n \"\$LIBPATH$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "LIBPATH$unique=set" test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p" LDFLAGS="$LDFLAGS -L$ai_p" PHP_RPATHS="$PHP_RPATHS $ai_p" fi fi fi fi case bz2 in c|c_r|pthread*) ;; *) LIBS="-lbz2 $LIBS" ;; esac fi #AC_CHECK_LIB(bz2, BZ2_bzerror, [AC_DEFINE(HAVE_BZ2,1,[ ])], [AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)],) EXT_SUBDIRS="$EXT_SUBDIRS bz2" if test -d "$abs_srcdir/ext/bz2"; then ext_builddir=ext/bz2 ext_srcdir=$abs_srcdir/ext/bz2 else ext_builddir=. ext_srcdir=$abs_srcdir fi if test "$ext_shared" != "shared" && test "$ext_shared" != "yes"; then lib_makefile="$ext_builddir/libs.mk" lib_target="" $php_shtool mkdir -p $ext_builddir if test "$BSD_MAKEFILE" = "yes"; then lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\"" else lib_include_conf="include \$(top_builddir)/config_vars.mk" fi cat >$lib_makefile<>$lib_makefile<>$lib_makefile<>$lib_makefile<>$lib_makefile<$lib_makefile<>$lib_makefile<>$lib_makefile<>$lib_makefile<>$lib_makefile<> confdefs.h <&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 echo "configure:1373: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cygwin=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 echo "configure:1406: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_mingw32=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1435: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi rm -f conftest* fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" else ac_cv_prog_CPP="$CPP" fi echo "$ac_t""$CPP" 1>&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 echo "configure:1590: checking host system type" >&5 host_alias=$host case "$host_alias" in NONE) case $nonopt in NONE) if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } fi ;; *) host_alias=$nonopt ;; esac ;; esac host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 echo "configure:1611: checking build system type" >&5 build_alias=$build case "$build_alias" in NONE) case $nonopt in NONE) build_alias=$host_alias ;; *) build_alias=$nonopt ;; esac ;; esac build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$build" 1>&6 # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 echo "configure:1640: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 echo "configure:1670: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "configure:1673: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else echo "$ac_t""no" 1>&6 fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 echo "configure:1708: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 echo "configure:1725: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_ld_reload_flag='-r' fi echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 echo "configure:1737: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1775: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftestdata if ln -s X conftestdata 2>/dev/null then rm -f conftestdata ac_cv_prog_LN_S="ln -s" else ac_cv_prog_LN_S=ln fi fi LN_S="$ac_cv_prog_LN_S" if test "$ac_cv_prog_LN_S" = "ln -s"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 echo "configure:1796: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # ['file_magic [regex]'] -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.012) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[78]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac fi echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 echo "configure:1969: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext if { (eval echo configure:1975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } fi rm -f conftest* fi echo "$ac_t""$ac_cv_objext" 1>&6 OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 echo "configure:1995: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= if { (eval echo configure:2005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done else { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } fi rm -f conftest* test x"${ac_cv_exeext}" = x && ac_cv_exeext=no fi fi EXEEXT="" test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT if test $host != $build; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 echo "configure:2036: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo configure:2115: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" fi if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then echo "$ac_t""failed" 1>&6 else echo "$ac_t""ok" 1>&6 fi for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2212: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 echo "configure:2257: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$ac_t""$MAGIC_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 echo "configure:2319: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$ac_t""$MAGIC_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi else MAGIC_CMD=: fi fi fi ;; esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2390: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" break fi done IFS="$ac_save_ifs" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$ac_cv_prog_RANLIB"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2422: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi else RANLIB=":" fi fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2457: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" break fi done IFS="$ac_save_ifs" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$ac_cv_prog_STRIP"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2489: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_STRIP="strip" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi else STRIP=":" fi fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" : fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '#line 2538 "configure"' > conftest.$ac_ext if { (eval echo configure:2539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 echo "configure:2560: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* lt_cv_cc_needs_belf=no fi rm -f conftest* ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross fi echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 echo "configure:2693: checking for objdir" >&5 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t""$objdir" 1>&6 # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 echo "configure:2720: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$ac_t""none" 1>&6 else echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 echo "configure:2872: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* lt_cv_prog_cc_pic_works=no fi rm -f conftest* CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6 fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 lt_cv_prog_cc_can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 echo "configure:2938: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 echo "configure:2980: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:2999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null fi compiler_c_o=$lt_cv_compiler_c_o echo "$ac_t""$compiler_c_o" 1>&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 echo "configure:3028: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* CFLAGS="$save_CFLAGS" fi compiler_o_lo=$lt_cv_compiler_o_lo echo "$ac_t""$compiler_o_lo" 1>&6 else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 echo "configure:3074: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t""$hard_links" 1>&6 if test "$hard_links" = no; then echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2 need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 echo "configure:3093: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* CFLAGS="$save_CFLAGS" echo "$ac_t""$compiler_rtti_exceptions" 1>&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 echo "configure:3133: checking whether the linker ($LD) supports shared libraries" >&5 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* ) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else if test "$host_cpu" = ia64; then shared_flag='-G' else shared_flag='${wl}-bM:SRE' fi hardcode_direct=yes fi if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # Test if we are trying to use run time linking, or normal AIX style linking. # If -brtl is somewhere in LDFLAGS, we need to do run time linking. aix_use_runtimelinking=no for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then aix_use_runtimelinking=yes break fi done exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' allow_undefined_flag=' -Wl,-G' archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-znodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, -berok will # link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) allow_undefined_flag='-undefined suppress' # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z defs' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t""$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 echo "configure:3749: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t""$hardcode_action" 1>&6 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 echo "configure:3777: checking whether stripping libraries is possible" >&5 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 echo "configure:3791: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so instead of # lib.a to let people know that these are not typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH deplibs_check_method=pass_all fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t""$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 echo "configure:4177: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "configure:4216: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "configure:4254: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo configure:4282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "configure:4300: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo configure:4328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 echo "configure:4346: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "configure:4384: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "configure:4456: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "configure:4550: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo configure:4621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 echo "configure:4670: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo configure:4677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo configure:4690: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6 ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # */ # # #include /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion SHARED_LIBTOOL='$(LIBTOOL)' PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<' phplibdir="`pwd`/modules" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" test "$prefix" = "NONE" && prefix="/usr/local" test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' PHP_VAR_SUBST="$PHP_VAR_SUBST prefix" PHP_VAR_SUBST="$PHP_VAR_SUBST exec_prefix" PHP_VAR_SUBST="$PHP_VAR_SUBST libdir" PHP_VAR_SUBST="$PHP_VAR_SUBST prefix" PHP_VAR_SUBST="$PHP_VAR_SUBST phplibdir" PHP_VAR_SUBST="$PHP_VAR_SUBST PHP_COMPILE" PHP_VAR_SUBST="$PHP_VAR_SUBST CC" PHP_VAR_SUBST="$PHP_VAR_SUBST CFLAGS" PHP_VAR_SUBST="$PHP_VAR_SUBST CPP" PHP_VAR_SUBST="$PHP_VAR_SUBST CPPFLAGS" PHP_VAR_SUBST="$PHP_VAR_SUBST CXX" PHP_VAR_SUBST="$PHP_VAR_SUBST DEFS" PHP_VAR_SUBST="$PHP_VAR_SUBST EXTENSION_DIR" PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LDFLAGS" PHP_VAR_SUBST="$PHP_VAR_SUBST EXTRA_LIBS" PHP_VAR_SUBST="$PHP_VAR_SUBST INCLUDES" PHP_VAR_SUBST="$PHP_VAR_SUBST LEX" PHP_VAR_SUBST="$PHP_VAR_SUBST LEX_OUTPUT_ROOT" PHP_VAR_SUBST="$PHP_VAR_SUBST LFLAGS" PHP_VAR_SUBST="$PHP_VAR_SUBST SHARED_LIBTOOL" PHP_VAR_SUBST="$PHP_VAR_SUBST LIBTOOL" PHP_VAR_SUBST="$PHP_VAR_SUBST SHELL" PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES Makefile" echo $ac_n "checking for working mkdir -p""... $ac_c" 1>&6 echo "configure:5351: checking for working mkdir -p" >&5 if eval "test \"`echo '$''{'ac_cv_mkdir_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else test -d conftestdir && rm -rf conftestdir mkdir -p conftestdir/somedir >/dev/null 2>&1 mkdir -p conftestdir/somedir >/dev/null 2>&1 if test "$?" = "0" && test -d conftestdir/somedir; then ac_cv_mkdir_p=yes else ac_cv_mkdir_p=no fi rm -rf conftestdir fi echo "$ac_t""$ac_cv_mkdir_p" 1>&6 echo creating config_vars.mk > config_vars.mk for i in $PHP_VAR_SUBST; do eval echo "$i = \$$i" >> config_vars.mk done $SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $PHP_FAST_OUTPUT_FILES test -d modules || mkdir modules touch .deps trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir trap 'rm -fr `echo " config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@CC@%$CC%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g s%@host_vendor@%$host_vendor%g s%@host_os@%$host_os%g s%@build@%$build%g s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g s%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g s%@ECHO@%$ECHO%g s%@RANLIB@%$RANLIB%g s%@STRIP@%$STRIP%g s%@CPP@%$CPP%g s%@LIBTOOL@%$LIBTOOL%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 htdig-3.2.0b6/libhtdigphp/configure.in0100644006314600127310000000322210063260372017170 0ustar angusgbhtdig AC_INIT(Makefile.in) AC_DEFUN(PHP_WITH_PHP_CONFIG,[ AC_ARG_WITH(php-config, [ --with-php-config=PATH],[ PHP_CONFIG=$withval ],[ PHP_CONFIG=php-config ]) prefix=`$PHP_CONFIG --prefix 2>/dev/null` INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` EXTENSION_DIR=`$PHP_CONFIG --extension-dir` if test -z "$prefix"; then AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH) fi AC_MSG_CHECKING(for PHP prefix) AC_MSG_RESULT($prefix) AC_MSG_CHECKING(for PHP includes) AC_MSG_RESULT($INCLUDES) AC_MSG_CHECKING(for PHP extension directory) AC_MSG_RESULT($EXTENSION_DIR) ]) abs_srcdir=`(cd $srcdir && pwd)` php_always_shared=yes AC_PROG_CC AC_PROG_CC_C_O PHP_WITH_PHP_CONFIG AC_PREFIX_DEFAULT() sinclude(config.m4) enable_static=no enable_shared=yes AC_PROG_LIBTOOL SHARED_LIBTOOL='$(LIBTOOL)' PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<' phplibdir="`pwd`/modules" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" test "$prefix" = "NONE" && prefix="/usr/local" test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)' PHP_SUBST(prefix) PHP_SUBST(exec_prefix) PHP_SUBST(libdir) PHP_SUBST(prefix) PHP_SUBST(phplibdir) PHP_SUBST(PHP_COMPILE) PHP_SUBST(CC) PHP_SUBST(CFLAGS) PHP_SUBST(CPP) PHP_SUBST(CPPFLAGS) PHP_SUBST(CXX) PHP_SUBST(DEFS) PHP_SUBST(EXTENSION_DIR) PHP_SUBST(EXTRA_LDFLAGS) PHP_SUBST(EXTRA_LIBS) PHP_SUBST(INCLUDES) PHP_SUBST(LEX) PHP_SUBST(LEX_OUTPUT_ROOT) PHP_SUBST(LFLAGS) PHP_SUBST(SHARED_LIBTOOL) PHP_SUBST(LIBTOOL) PHP_SUBST(SHELL) PHP_FAST_OUTPUT(Makefile) PHP_GEN_CONFIG_VARS PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES) test -d modules || mkdir modules touch .deps AC_CONFIG_HEADER(config.h) AC_OUTPUT() htdig-3.2.0b6/libhtdigphp/conftest0100644006314600127310000001545410026717351016444 0ustar angusgbhtdigELF°4<4 (þþüLLL°°%)(!%$"'&# ”Ôd6ˆÀàè 0 ` ° ä  Lüü’5LñÿSu"/0 };¤" üñÿs5ä ‰ºñÿ™üñÿ ñÿ¬ñÿ _DYNAMIC_GLOBAL_OFFSET_TABLE___gmon_start___init_fini__deregister_frame_info__register_frame_infolibc.so.6__environ___brk_addr__curbrkatexit_edata__bss_start_endconftestGCC.INTERNALGLIBC_2.0ªM±¼=ºiii Ç8<@D!H((,04(U‰åSè[Ã・,tèR‰öèÓè&‹]üÉÃÿ³ÿ£ÿ£ héàÿÿÿÿ£héÐÿÿÿÿ£héÀÿÿÿÿ£hé°ÿÿÿU‰åSè[Ãcƒ»èÿÿÿu>ët&P‰“äÿÿÿ‹ÿЋƒäÿÿÿƒ8u胻$t ƒìÿÿÿPè“ÿÿÿǃèÿÿÿ‹]ü‰ì]ÉöU‰åSè[Ë]ü‰ì]ÃU‰åSè[Ã냻tƒàPƒìÿÿÿPè,ÿÿÿ‹]ü‰ì]ÃU‰åSè[÷‹]ü‰ì]ÃU‰åVSè[Ã’ƒôÿÿÿpüƒxüÿt ‹ÿЃÆüƒ>ÿuôeø[^‰ì]ÃvU‰åSè[Ã[‹“(‹ƒ ‹‰è“þÿÿ‹]ü‰ì]ÃU‰åSè[Ã/è·þÿÿ‹]üÉÃÿÿÿÿÿÿÿÿLv†–¦i± 0 ä”dÔ º  à0üÿÿoˆýÿÿoþÿÿoÀÿÿÿoðÿÿo6˜ dtdtC<R€€›€Ï€€D€€Ü€€,€R€w€‘€¬€Í€€)€M€w€‹(dtconftest.c/nfs/users/rnw/nealr/code/htdig/htdig-CVS/libhtdigphp/gcc2_compiled.int:t(0,1)=r(0,1);0020000000000;0017777777777;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,1);0020000000000;0017777777777;unsigned int:t(0,4)=r(0,1);0000000000000;0037777777777;long unsigned int:t(0,5)=r(0,1);0000000000000;0037777777777;long long int:t(0,6)=r(0,1);01000000000000000000000;0777777777777777777777;long long unsigned int:t(0,7)=r(0,1);0000000000000;01777777777777777777777;short int:t(0,8)=r(0,8);-32768;32767;short unsigned int:t(0,9)=r(0,9);0;65535;signed char:t(0,10)=r(0,10);-128;127;unsigned char:t(0,11)=r(0,11);0;255;float:t(0,12)=r(0,1);4;0;double:t(0,13)=r(0,1);8;0;long double:t(0,14)=r(0,1);12;0;complex int:t(0,15)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,16)=r(0,16);4;0;complex double:t(0,17)=r(0,17);8;0;complex long double:t(0,18)=r(0,18);12;0;void:t(0,19)=(0,19)dummy:S(0,1)GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)GCC: (GNU) egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)01.0101.0101.0101.0101.01.symtab.strtab.shstrtab.hash.dynsym.dynstr.gnu.version.gnu.version_d.gnu.version_r.rel.data.rel.got.rel.plt.init.plt.text.fini.data.eh_frame.ctors.dtors.got.dynamic.sbss.bss.stab.stabstr.comment.note””@! ÔÔ)ddÑ1ÿÿÿo66R>ýÿÿoˆˆ8MþÿÿoÀÀ \ ààf èè(o   x00/~``Pƒ°°4‰ä䕟  ¦­0²LL°»üüÁüüÆü, Ì( ˜ÕÀ 1ÞñdUäÄp8 4ø”Ôd6ˆÀàè 0 ` ° ä  Lüüñÿ ° ñÿ ° &*8D° Zm xü( \ ˜¦ ñÿ € ´€ ʸ ˜×äñÿ ä òñÿý5Lñÿu"?0 E\¤"üñÿ‹ ä ¦ºñÿÇüñÿÎñÿäñÿé initfini.cgcc2_compiled.crtstuff.cp.2__DTOR_LIST__completed.3__do_global_dtors_aux__EH_FRAME_BEGIN__fini_dummyobject.8frame_dummyinit_dummyforce_to_data__CTOR_LIST____do_global_ctors_aux__CTOR_END____DTOR_END____FRAME_END__conftest.cdummyatexit@@GLIBC_2.0_DYNAMIC__register_frame_info@@GLIBC_2.0_init___brk_addr@@GLIBC_2.0__deregister_frame_info@@GLIBC_2.0__bss_start__environ@@GLIBC_2.0_fini__curbrk@@GLIBC_2.0GCC.INTERNAL_edata_GLOBAL_OFFSET_TABLE__end__gmon_start__htdig-3.2.0b6/libhtdigphp/conftest.c0100644006314600127310000000002210026717351016646 0ustar angusgbhtdigstatic int dummy; htdig-3.2.0b6/libhtdigphp/dynlib.m40100644006314600127310000000642310026717351016413 0ustar angusgbhtdig# +----------------------------------------------------------------------+ # | PHP version 4.0 | # +----------------------------------------------------------------------+ # | Copyright (c) 1997-2001 The PHP Group | # +----------------------------------------------------------------------+ # | This source file is subject to version 2.02 of the PHP license, | # | that is bundled with this package in the file LICENSE, and is | # | available at through the world-wide-web at | # | http://www.php.net/license/2_02.txt. | # | If you did not receive a copy of the PHP license and are unable to | # | obtain it through the world-wide-web, please send a note to | # | license@php.net so we can mail you a copy immediately. | # +----------------------------------------------------------------------+ # | Authors: Sascha Schumann | # +----------------------------------------------------------------------+ # # $Id: dynlib.m4,v 1.1 2004/03/20 01:31:21 nealr Exp $ # AC_DEFUN(LIB_SHARED_CONVENIENCE,[ lib_target="\$(LTLIBRARY_NAME)" cat >>$1<>$1<>$1<$lib_makefile<>$lib_makefile<\n"; foreach($functions as $func) { echo $func."
    \n"; } echo "
    \n"; $function = 'confirm_' . $module . '_compiled'; if (extension_loaded($module)) { $str = $function($module); } else { $str = "Module $module is not compiled into PHP"; } echo "$str\n"; ?> htdig-3.2.0b6/libhtdigphp/htdig.phph0100644006314600127310000000157310026717351016651 0ustar angusgbhtdig htdig-3.2.0b6/libhtdigphp/htdig_search.php0100644006314600127310000000346410026717351020027 0ustar angusgbhtdig\n"; foreach($functions as $func) { echo $func."
    \n"; } echo "
    \n"; echo "\n
    \n\n"; $htsearch_parms = array("configFile" => "/home/httpd/cgi-bin/nealr.db/archive/archive.conf", "logFile" => " ", "debug" => 0); echo "htsearch_parms array:\n"; foreach ($htsearch_parms as $key => $value) { echo "key[$key] => value[$value]\n"; } echo "\n"; $error = htsearch_open($htsearch_parms); if ($error == 0) { $p_query = "claim"; echo "p_query[$p_query]\n"; $htsearch_query = array("raw_query" => "$p_query", "algorithm" => HTSEARCH_ALG_AND_STR, "sortby" => HTSEARCH_SORT_SCORE_STR, "format" => HTSEARCH_FORMAT_LONG_STR, "time_format" => "%Y-%m-%d"); echo "htsearch_query array:\n"; foreach ($htsearch_query as $key => $value) { echo "key[$key] => value[$value]\n"; } echo "\n"; $num_results = htsearch_query($htsearch_query); if ($num_results > 0) { for($i = 0; $i < $num_results; $i++) { echo "-------------------------------------------------------\n"; echo "[$i]\n"; $htsearch_match = htsearch_get_nth_match($i); foreach ($htsearch_match as $key => $value) { echo "key[$key] => value[$value]\n"; } } echo "Num Results: ".$num_results."\n"; } else { echo "No Results or Error\n"; } } else { echo "Error htsearch_open [$error]\n"; } htsearch_close(); ?> htdig-3.2.0b6/libhtdigphp/htdigphp.c0100644006314600127310000005023310026717351016641 0ustar angusgbhtdig// ------------------------------------------------- // libhtdigphp.c // // Code for libhtdig PHP 4.0 wrapper. // // Requires libhtdig 3.2.0 or better // // Part of the ht://Dig package // // // Copyright (c) 1995-2002 The ht://Dig Group // Copyright (c) 2002 Rightnow Technologies, Inc. // // Dual Licensed LGPL // See LGPL file for License. // // Copies available at // http://www.fsf.org/licenses/gpl.html // http://www.fsf.org/licenses/lgpl.html // // -------------------------------------------------- /* $Id: htdigphp.c,v 1.1 2004/03/20 01:31:21 nealr Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "htdigphp.h" /* PHP Includes */ #include "ext/standard/file.h" #include "ext/standard/info.h" /* for fileno() */ #include #include /* HtDig includes */ #include PHP_FUNCTION(htsearch_open); PHP_FUNCTION(htsearch_query); PHP_FUNCTION(htsearch_get_nth_match); PHP_FUNCTION(htsearch_close); PHP_FUNCTION(htsearch_get_error); PHP_FUNCTION(htdig_index_test_url); function_entry htdig_functions[] = { PHP_FE(htsearch_open, NULL) PHP_FE(htsearch_query, NULL) PHP_FE(htsearch_get_nth_match, NULL) PHP_FE(htsearch_close, NULL) PHP_FE(htsearch_get_error, NULL) PHP_FE(htdig_index_test_url, NULL) {NULL, NULL, NULL} }; zend_module_entry htdig_module_entry = { STANDARD_MODULE_HEADER, "htdig", htdig_functions, PHP_MINIT(htdig), NULL, NULL, NULL, PHP_MINFO(htdig), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_HTDIG ZEND_GET_MODULE(htdig) #endif //static int le_htdig; static int num_search_results; static char time_format[TIME_FORMAT_SIZE]; //static void php_htdig_close(zend_rsrc_list_entry * rsrc TSRMLS_DC); PHP_MINIT_FUNCTION(htdig) { /* Register the resource, with destructor (arg 1) and text description (arg 3), the other arguments are just standard placeholders */ //le_htdig = zend_register_list_destructors_ex(php_htdig_close, NULL, "HtDig 3.2.0", module_number); return SUCCESS; } PHP_MINFO_FUNCTION(htdig) { php_info_print_table_start(); php_info_print_table_row(2, "HtDig Support", "Enabled"); php_info_print_table_row(2, "HtDig Version", "3.2.0b5"); php_info_print_table_end(); } /* * htsearch_open * * Wrapper for * int htsearch_open(htsearch_parameters_struct *); * * TODO recieve configFile, debug, logFile as parameters. 2 & 3 are Optional! * */ PHP_FUNCTION(htsearch_open) { zval **config_array_arg, **pvalue; HashTable *config_array_ht; htsearch_parameters_struct htsearch_params; int array_size = 0; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &config_array_arg) == FAILURE) WRONG_PARAM_COUNT; if (Z_TYPE_PP(config_array_arg) != IS_ARRAY) { php_error(E_WARNING, "First argument to htsearch_open() should be an array"); return; } convert_to_array_ex(config_array_arg); config_array_ht = Z_ARRVAL_PP(config_array_arg); array_size = zend_hash_num_elements(config_array_ht); if (array_size < 3) { php_error(E_WARNING, "First argument to htsearch_open() should be an array with at least 3 elements"); return; } memset(&htsearch_params ,0, sizeof(htsearch_params)); //----------- Required Paramters -------------- if (zend_hash_find(config_array_ht, "configFile", sizeof("configFile"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.configFile, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'configFile' key not in array parameter"); return; } if (zend_hash_find(config_array_ht, "debug", sizeof("debug"), (void **) &pvalue) == SUCCESS) { convert_to_long_ex(pvalue); htsearch_params.debug = Z_LVAL_PP(pvalue); } else { php_error(E_WARNING, "'debug' key not in array parameter"); return; } if (zend_hash_find(config_array_ht, "logFile", sizeof("logFile"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.logFile, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'logFile' key not in array parameter"); return; } //----------- Optional Paramters -------------- if (zend_hash_find(config_array_ht, "DBpath", sizeof("DBpath"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.DBpath, Z_STRVAL_PP(pvalue)); } else { htsearch_params.DBpath[0] = 0; //NULL terminator htsearch_params.DBpath[1] = 0; } if (zend_hash_find(config_array_ht, "locale", sizeof("locale"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.locale, Z_STRVAL_PP(pvalue)); } else { htsearch_params.locale[0] = 0; //NULL terminator htsearch_params.locale[1] = 0; } if (zend_hash_find(config_array_ht, "restrict", sizeof("restrict"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.search_restrict, Z_STRVAL_PP(pvalue)); } else { htsearch_params.search_restrict[0] = 0; //NULL terminator htsearch_params.search_restrict[1] = 0; } if (zend_hash_find(config_array_ht, "exclude", sizeof("exclude"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.search_exclude, Z_STRVAL_PP(pvalue)); } else { htsearch_params.search_exclude[0] = 0; //NULL terminator htsearch_params.search_exclude[1] = 0; } if (zend_hash_find(config_array_ht, "alwaysret", sizeof("alwaysret"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.search_alwaysreturn, Z_STRVAL_PP(pvalue)); } else { htsearch_params.search_alwaysreturn[0] = 0; //NULL terminator htsearch_params.search_alwaysreturn[1] = 0; } if (zend_hash_find(config_array_ht, "title_factor", sizeof("title_factor"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.title_factor, Z_STRVAL_PP(pvalue)); } else { htsearch_params.title_factor[0] = 0; //NULL terminator htsearch_params.title_factor[1] = 0; } if (zend_hash_find(config_array_ht, "text_factor", sizeof("text_factor"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.text_factor, Z_STRVAL_PP(pvalue)); } else { htsearch_params.text_factor[0] = 0; //NULL terminator htsearch_params.text_factor[1] = 0; } if (zend_hash_find(config_array_ht, "meta_description_factor", sizeof("meta_description_factor"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htsearch_params.meta_description_factor, Z_STRVAL_PP(pvalue)); } else { htsearch_params.meta_description_factor[0] = 0; //NULL terminator htsearch_params.meta_description_factor[1] = 0; } snprintf(time_format, TIME_FORMAT_SIZE, "%s", DEFAULT_TIME_FORMAT); htsearch_open(&htsearch_params); num_search_results = 0; RETURN_LONG(SUCCESS); } /* * wrapper for htsearch_query(htsearch_query_struct *) * * TODO recieve query, algorithms_flag, sortby_flag, format as parameters * Some Optional?? * * "raw_query" => "$p_query" * "algorithm" => HTSEARCH_ALG_AND_STR * "sortby" => HTSEARCH_SORT_SCORE_STR * "format" => HTSEARCH_FORMAT_LONG_STR * "time_format" **** optional *** * * */ PHP_FUNCTION(htsearch_query) { zval **query_array_arg, **pvalue; HashTable *query_array_ht; htsearch_query_struct the_query; int array_size = 0; num_search_results = 0; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &query_array_arg) == FAILURE) WRONG_PARAM_COUNT; if (Z_TYPE_PP(query_array_arg) != IS_ARRAY) { php_error(E_WARNING, "First argument to htsearch_query() should be an array"); return; } //SEPARATE_ZVAL(query_array_arg); convert_to_array_ex(query_array_arg); query_array_ht = Z_ARRVAL_PP(query_array_arg); array_size = zend_hash_num_elements(query_array_ht); if (array_size < 4) { php_error(E_WARNING, "First argument to htsearch_open() should be an array with at least 4 elements"); return; } if (zend_hash_find(query_array_ht, "raw_query", sizeof("raw_query"), (void **) &pvalue) == SUCCESS) { //SEPARATE_ZVAL(pvalue); convert_to_string_ex(pvalue); sprintf(the_query.raw_query, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'raw_query' key not in array parameter"); return; } if (zend_hash_find(query_array_ht, "algorithm", sizeof("algorithm"), (void **) &pvalue) == SUCCESS) { //SEPARATE_ZVAL(pvalue); convert_to_string_ex(pvalue); if (strcmp(HTSEARCH_ALG_AND_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.algorithms_flag = HTSEARCH_ALG_AND; else if (strcmp(HTSEARCH_ALG_OR_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.algorithms_flag = HTSEARCH_ALG_OR; else if (strcmp(HTSEARCH_ALG_BOOLEAN_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.algorithms_flag = HTSEARCH_ALG_BOOLEAN; else { php_error(E_WARNING, "'algorithm' value not valid [%s]", Z_STRVAL_PP(pvalue)); return; } } else { php_error(E_WARNING, "'algorithm' key not in array parameter"); return; } if (zend_hash_find(query_array_ht, "format", sizeof("format"), (void **) &pvalue) == SUCCESS) { //SEPARATE_ZVAL(pvalue); convert_to_string_ex(pvalue); if (strcmp(HTSEARCH_FORMAT_LONG_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.format = HTSEARCH_FORMAT_LONG; else if (strcmp(HTSEARCH_FORMAT_SHORT_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.format = HTSEARCH_FORMAT_SHORT; else { php_error(E_WARNING, "'format' value not valid [%s]", Z_STRVAL_PP(pvalue)); return; } } else { php_error(E_WARNING, "'format' key not in array parameter"); return; } if (zend_hash_find(query_array_ht, "sortby", sizeof("sortby"), (void **) &pvalue) == SUCCESS) { //SEPARATE_ZVAL(pvalue); convert_to_string_ex(pvalue); if (strcmp(HTSEARCH_SORT_SCORE_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_SCORE; else if (strcmp(HTSEARCH_SORT_REV_SCORE_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_REV_SCORE; else if (strcmp(HTSEARCH_SORT_TIME_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_TIME; else if (strcmp(HTSEARCH_SORT_REV_TIME_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_REV_TIME; else if (strcmp(HTSEARCH_SORT_TITLE_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_TITLE; else if (strcmp(HTSEARCH_SORT_REV_TITLE_STR, Z_STRVAL_PP(pvalue)) == 0) the_query.sortby_flag = HTSEARCH_SORT_REV_TITLE; else { php_error(E_WARNING, "'sortby' value not valid [%s]", Z_STRVAL_PP(pvalue)); return; } } else { php_error(E_WARNING, "'sortby' key not in array parameter"); return; } if (zend_hash_find(query_array_ht, "time_format", sizeof("time_format"), (void **) &pvalue) == SUCCESS) { //SEPARATE_ZVAL(pvalue); convert_to_string_ex(pvalue); snprintf(time_format, TIME_FORMAT_SIZE, "%s", Z_STRVAL_PP(pvalue)); } num_search_results = htsearch_query(&the_query); //printf("[%s][%d]\n", the_query.raw_query, num_results); RETURN_LONG(num_search_results); } /* * * */ PHP_FUNCTION(htsearch_get_nth_match) { zval **result_num_arg, **pvalue; htsearch_query_match_struct result; int result_num; int ret = 0; char local_time_str[TIME_FORMAT_SIZE]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result_num_arg) == FAILURE) WRONG_PARAM_COUNT; if (Z_TYPE_PP(result_num_arg) != IS_LONG) { php_error(E_WARNING, "First argument to htsearch_get_nth_match() should be an integer"); return; } convert_to_long_ex(result_num_arg); result_num = Z_LVAL_PP(result_num_arg); if (array_init(return_value) == FAILURE) { RETURN_FALSE; } ret = htsearch_get_nth_match(result_num, &result); if(ret > 0) { strftime(local_time_str, TIME_FORMAT_SIZE, time_format, &result.time_tm); //fprintf(stderr, "time:[%s]\n", asctime(&result.time_tm)); add_assoc_string(return_value, "title", result.title, 1); add_assoc_string(return_value, "URL", result.URL, 1); add_assoc_string(return_value, "excerpt", result.excerpt, 1); add_assoc_string(return_value, "time", local_time_str, 1); add_assoc_long( return_value, "score", result.score ); add_assoc_long( return_value, "scorepercent", result.score_percent ); add_assoc_long( return_value, "size", result.size ); add_assoc_long( return_value, "size", result.size ); //fprintf(stderr, "%s\n", result.title); } else { add_assoc_long( return_value, "error", ret ); } } /* * * */ PHP_FUNCTION(htsearch_close) { int ret = 0; ret = htsearch_close(); RETURN_LONG(ret); } /* * * */ PHP_FUNCTION(htsearch_get_error) { RETURN_LONG(SUCCESS); } PHP_FUNCTION(htdig_index_test_url) { zval **config_array_arg, **pvalue; zval *tmp; HashTable *config_array_ht; htdig_parameters_struct htdigparms; int array_size = 0; int ret = 0; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &config_array_arg) == FAILURE) WRONG_PARAM_COUNT; if (Z_TYPE_PP(config_array_arg) != IS_ARRAY) { php_error(E_WARNING, "First argument to htdig_index_test_url() should be an array"); } convert_to_array_ex(config_array_arg); config_array_ht = Z_ARRVAL_PP(config_array_arg); array_size = zend_hash_num_elements(config_array_ht); if (array_size < 1) { php_error(E_WARNING, "First argument to htdig_index_test_url() should be an array with at least 1 elements"); return; } MAKE_STD_ZVAL(tmp); memset(&htdigparms ,0, sizeof(htdigparms)); //configFile if (zend_hash_find(config_array_ht, "configFile", sizeof("configFile"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.configFile, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'configFile' key not in array parameter"); return; } //URL if (zend_hash_find(config_array_ht, "URL", sizeof("URL"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.URL, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'URL' key not in array parameter"); return; } //limit_urls_to if (zend_hash_find(config_array_ht, "limit_urls_to", sizeof("limit_urls_to"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.limit_urls_to, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'limit_urls_to' key not in array parameter"); return; } //limit_normalized if (zend_hash_find(config_array_ht, "limit_normalized", sizeof("limit_normalized"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.limit_normalized, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'limit_normalized' key not in array parameter"); return; } //exclude_urls if (zend_hash_find(config_array_ht, "exclude_urls", sizeof("exclude_urls"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.exclude_urls, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'exclude_urls' key not in array parameter"); return; } //search_restrict if (zend_hash_find(config_array_ht, "search_restrict", sizeof("search_restrict"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.search_restrict, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'search_restrict' key not in array parameter"); return; } //search_exclude if (zend_hash_find(config_array_ht, "search_exclude", sizeof("search_exclude"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.search_exclude, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'search_exclude' key not in array parameter"); return; } //url_rewrite_rules if (zend_hash_find(config_array_ht, "url_rewrite_rules", sizeof("url_rewrite_rules"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.url_rewrite_rules, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'url_rewrite_rules' key not in array parameter"); return; } //bad_querystr if (zend_hash_find(config_array_ht, "bad_querystr", sizeof("bad_querystr"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.bad_querystr, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'bad_querystr' key not in array parameter"); return; } //max_hop_count if (zend_hash_find(config_array_ht, "max_hop_count", sizeof("max_hop_count"), (void **) &pvalue) == SUCCESS) { convert_to_string_ex(pvalue); sprintf(htdigparms.max_hop_count, Z_STRVAL_PP(pvalue)); } else { php_error(E_WARNING, "'max_hop_count' key not in array parameter"); return; } //now test the URL with these filters ret = htdig_index_test_url(&htdigparms); //add_assoc_string(*config_array_arg, "rewritten_URL", htdigparms.rewritten_URL, 1); if (zend_hash_find(config_array_ht, "rewritten_URL", sizeof("rewritten_URL"), (void **) &pvalue) == SUCCESS) { //update rewritten_URL in hashtable-array ZVAL_STRING(tmp, htdigparms.rewritten_URL, TRUE); zend_hash_update(config_array_ht, "rewritten_URL", sizeof("rewritten_URL"), (void *) &tmp, sizeof(zval *), NULL); } else { //add rewritten_URL to hashtable-array ZVAL_STRING(tmp, htdigparms.rewritten_URL, TRUE); zend_hash_add(config_array_ht, "rewritten_URL", sizeof("rewritten_URL"), (void *) &tmp, sizeof(zval *), NULL); } //test add/update if (zend_hash_find(config_array_ht, "rewritten_URL", sizeof("rewritten_URL"), (void **) &pvalue) != SUCCESS) { RETURN_LONG(-9999999); } RETURN_LONG(ret); } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 tw=78 fdm=marker * vim<600: sw=4 ts=4 tw=78 */ htdig-3.2.0b6/libhtdigphp/htdigphp.h0100644006314600127310000000243610026717351016650 0ustar angusgbhtdig// ------------------------------------------------- // libhtdigphp.h // // Header File for libhtdig PHP 4.0 wrapper. // // Requires libhtdig 3.2.0 or better // // Part of the ht://Dig package // // // Copyright (c) 1995-2002 The ht://Dig Group // Copyright (c) 2002 Rightnow Technologies, Inc. // // Dual Licensed under GPL & LGPL // See GPL and LGPL files for License. // // Copies available at // http://www.fsf.org/licenses/gpl.html // http://www.fsf.org/licenses/lgpl.html // // -------------------------------------------------- /* $Id: htdigphp.h,v 1.1 2004/03/20 01:31:21 nealr Exp $ */ #ifndef HTDIGPHP_H #define HTDIGPHP_H //#if HAVE_HTDIG #ifdef PHP_WIN32 #define PHP_HTDIG_API __declspec(dllexport) #else #define PHP_HTDIG_API #endif PHP_MINIT_FUNCTION(htdig); PHP_MINFO_FUNCTION(htdig); PHP_FUNCTION(htsearch_open); PHP_FUNCTION(htsearch_query); PHP_FUNCTION(htsearch_get_nth_match); PHP_FUNCTION(htsearch_close); PHP_FUNCTION(htsearch_get_error); PHP_FUNCTION(htdig_index_test_url); //#define DEFAULT_TIME_FORMAT "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n" #define DEFAULT_TIME_FORMAT "%Y-%m-%d" #define TIME_FORMAT_SIZE 256 #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ htdig-3.2.0b6/libhtdigphp/install-sh0100755006314600127310000000000010026717351016655 0ustar angusgbhtdightdig-3.2.0b6/libhtdigphp/libs.mk0100644006314600127310000000077310026717351016154 0ustar angusgbhtdiginclude $(top_builddir)/config_vars.mk LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X) LTLIBRARY_SHARED_OBJECTS = $(LTLIBRARY_OBJECTS:.lo=.slo) $(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_SHARED_OBJECTS) $(LTLIBRARY_DEPENDENCIES) $(SHARED_LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@ -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD) $(SHARED_LIBTOOL) --mode=install cp $@ $(phplibdir) targets = $(LTLIBRARY_SHARED_NAME) htdig-3.2.0b6/libhtdigphp/libtool0100644006314600127310000043706610026717351016272 0ustar angusgbhtdig#! /bin/sh # libtool - Provide generalized library-building support services. # Generated automatically by (GNU ) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host swan.rightnowtech.com: # Shell to use when invoking shell scripts. SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=no # Whether or not to build static libraries. build_old_libs=no # Whether or not to optimize for fast installation. fast_install=yes # The host system. host_alias=i686-pc-linux-gnu host=i686-pc-linux-gnu # An echo program that does not interpret backslashes. echo="echo" # The archiver. AR="ar" AR_FLAGS="cru" # The default C compiler. CC="gcc" # Is the compiler the GNU C compiler? with_gcc=yes # The linker used to build libraries. LD="/usr/bin/ld" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. NM="/usr/bin/nm -B" # A symbol stripping program STRIP=strip # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=file # Used on cygwin: DLL creation program. DLLTOOL="dlltool" # Used on cygwin: object dumper. OBJDUMP="objdump" # Used on cygwin: assembler. AS="as" # The name of the directory that contains temporary libtool files. objdir=.libs # How to create reloadable object files. reload_flag=" -r" reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" # How to pass a linker flag through the compiler. wl="-Wl," # Object file suffix (normally "o"). objext="o" # Old archive suffix (normally "a"). libext="a" # Executable file suffix (normally ""). exeext="" # Additional compiler flags for building library objects. pic_flag=" -fPIC" pic_mode=default # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" # Can we write directly to a .lo ? compiler_o_lo="yes" # Must we lock files when doing compilation ? need_locks="no" # Do we need the lib prefix for modules? need_lib_prefix=no # Do we need a version for libraries? need_version=no # Whether dlopen is supported. dlopen_support=unknown # Whether dlopen of programs is supported. dlopen_self=unknown # Whether dlopen of statically linked programs is supported. dlopen_self_static=unknown # Compiler flag to prevent dynamic linking. link_static_flag="-static" # Compiler flag to turn off builtin functions. no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions" # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" # Library versioning type. version_type=linux # Format of library name prefix. libname_spec="lib\$name" # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so" # The coded name of the library, if different from the real name. soname_spec="\${libname}\${release}.so\$major" # Commands used to build and install an old-style archive. RANLIB="ranlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" old_postuninstall_cmds="" # Create an old-style archive from a shared archive. old_archive_from_new_cmds="" # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" postinstall_cmds="" postuninstall_cmds="" # Commands to strip libraries. old_striplib="strip --strip-debug" striplib="strip --strip-unneeded" # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" # Command to use when deplibs_check_method == file_magic. file_magic_cmd="\$MAGIC_CMD" # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag="" # Flag that forces no undefined symbols. no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'" # This is the shared library runtime path variable. runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=no # How to hardcode a shared library path into an executable. hardcode_action=immediate # Whether we should hardcode library paths into libraries. hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator="" # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=no # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=no # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=unsupported # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=unknown # Compile-time system search path for libraries sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" # Run-time system search path for libraries sys_lib_dlsearch_path_spec="/lib /usr/lib" # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" # Set to yes if exported symbols are required. always_export_symbols=no # The commands to list exported symbols. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols" # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds="" # Symbols that should not be listed in the preloaded symbols. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Symbols that must always be exported. include_expsyms="" # ### END LIBTOOL CONFIG # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode" = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test "$linkmode" = oldlib && test "$linkmode" = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test "$linkmode" = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | sed -e 's/^.*\///'` newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n $old_archive_from_expsyms_cmds if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then test "$pass" != scan && dependency_libs="$newdependency_libs" if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ | sed 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = {\ " sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr_t) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if (eval \$relink_command); then : else $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: htdig-3.2.0b6/libhtdigphp/ltmain.sh0100755006314600127310000041623210026717351016516 0ustar angusgbhtdig# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode" = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test "$linkmode" = oldlib && test "$linkmode" = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test "$linkmode" = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | sed -e 's/^.*\///'` newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n $old_archive_from_expsyms_cmds if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then test "$pass" != scan && dependency_libs="$newdependency_libs" if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ | sed 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = {\ " sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr_t) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if (eval \$relink_command); then : else $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec $SHELL $0 --finish$current_libdirs exit 1 fi exit 0 ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now actually exec the command. eval "exec \$cmd$args" $echo "$modename: cannot exec \$cmd$args" exit 1 else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi # test -z "$show_help" # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: htdig-3.2.0b6/libhtdigphp/missing0100755006314600127310000000000010026717351016250 0ustar angusgbhtdightdig-3.2.0b6/libhtdigphp/mkinstalldirs0100755006314600127310000000000010026717351017457 0ustar angusgbhtdightdig-3.2.0b6/libhtdigphp/relink.sh0100644006314600127310000001677610026717351016524 0ustar angusgbhtdig#!/bin/sh #LIBHTDIG_LIBRARY = libhtdig.so.3.2 LIBHTDIG_VER='3.2.0' set -x gcc -g -I. -I/nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp/ -I/nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp/main -I/nfs/users/rnw/nealr/code/htdig/htdig-CVS-linux/libhtdigphp -I../libhtdig -I/nfs/local/linux/include/php4 -I/nfs/local/linux/include/php4/main -I/nfs/local/linux/include/php4/Zend -I/nfs/local/linux/include/php4/TSRM -I/usr/local/include -DHAVE_CONFIG_H -c htdigphp.c -fPIC -DPIC -o htdigphp.lo #relink with all objects from linhtdig.so LIBHTDIG_OBJS=' ../libhtdig/bt_compare.o ../libhtdig/bt_conv.o ../libhtdig/bt_curadj.o ../libhtdig/bt_cursor.o ../libhtdig/bt_delete.o ../libhtdig/bt_method.o ../libhtdig/bt_open.o ../libhtdig/bt_put.o ../libhtdig/bt_rec.o ../libhtdig/bt_reclaim.o ../libhtdig/bt_recno.o ../libhtdig/bt_rsearch.o ../libhtdig/bt_search.o ../libhtdig/bt_split.o ../libhtdig/bt_stat.o ../libhtdig/bt_upgrade.o ../libhtdig/btree_auto.o ../libhtdig/crdel_auto.o ../libhtdig/crdel_rec.o ../libhtdig/db.o ../libhtdig/db_am.o ../libhtdig/db_auto.o ../libhtdig/db_byteorder.o ../libhtdig/db_conv.o ../libhtdig/db_dispatch.o ../libhtdig/db_dup.o ../libhtdig/db_err.o ../libhtdig/db_getlong.o ../libhtdig/db_iface.o ../libhtdig/db_join.o ../libhtdig/db_log2.o ../libhtdig/db_meta.o ../libhtdig/db_method.o ../libhtdig/db_overflow.o ../libhtdig/db_pr.o ../libhtdig/db_rec.o ../libhtdig/db_reclaim.o ../libhtdig/db_ret.o ../libhtdig/db_salloc.o ../libhtdig/db_shash.o ../libhtdig/db_upgrade.o ../libhtdig/env_method.o ../libhtdig/env_open.o ../libhtdig/env_recover.o ../libhtdig/env_region.o ../libhtdig/hash.o ../libhtdig/hash_auto.o ../libhtdig/hash_conv.o ../libhtdig/hash_dup.o ../libhtdig/hash_func.o ../libhtdig/hash_meta.o ../libhtdig/hash_method.o ../libhtdig/hash_page.o ../libhtdig/hash_rec.o ../libhtdig/hash_reclaim.o ../libhtdig/hash_stat.o ../libhtdig/hash_upgrade.o ../libhtdig/lock.o ../libhtdig/lock_conflict.o ../libhtdig/lock_deadlock.o ../libhtdig/lock_region.o ../libhtdig/lock_util.o ../libhtdig/log.o ../libhtdig/log_archive.o ../libhtdig/log_auto.o ../libhtdig/log_compare.o ../libhtdig/log_findckp.o ../libhtdig/log_get.o ../libhtdig/log_method.o ../libhtdig/log_put.o ../libhtdig/log_rec.o ../libhtdig/log_register.o ../libhtdig/mp_alloc.o ../libhtdig/mp_bh.o ../libhtdig/mp_cmpr.o ../libhtdig/mp_fget.o ../libhtdig/mp_fopen.o ../libhtdig/mp_fput.o ../libhtdig/mp_fset.o ../libhtdig/mp_method.o ../libhtdig/mp_region.o ../libhtdig/mp_register.o ../libhtdig/mp_stat.o ../libhtdig/mp_sync.o ../libhtdig/mp_trickle.o ../libhtdig/mut_fcntl.o ../libhtdig/mut_pthread.o ../libhtdig/mut_tas.o ../libhtdig/mutex.o ../libhtdig/os_abs.o ../libhtdig/os_alloc.o ../libhtdig/os_dir.o ../libhtdig/os_errno.o ../libhtdig/os_fid.o ../libhtdig/os_finit.o ../libhtdig/os_fsync.o ../libhtdig/os_handle.o ../libhtdig/os_map.o ../libhtdig/os_method.o ../libhtdig/os_oflags.o ../libhtdig/os_open.o ../libhtdig/os_region.o ../libhtdig/os_rename.o ../libhtdig/os_root.o ../libhtdig/os_rpath.o ../libhtdig/os_rw.o ../libhtdig/os_seek.o ../libhtdig/os_sleep.o ../libhtdig/os_spin.o ../libhtdig/os_stat.o ../libhtdig/os_tmpdir.o ../libhtdig/os_unlink.o ../libhtdig/qam.o ../libhtdig/qam_auto.o ../libhtdig/qam_conv.o ../libhtdig/qam_method.o ../libhtdig/qam_open.o ../libhtdig/qam_rec.o ../libhtdig/qam_stat.o ../libhtdig/txn.o ../libhtdig/txn_auto.o ../libhtdig/txn_rec.o ../libhtdig/txn_region.o ../libhtdig/xa.o ../libhtdig/xa_db.o ../libhtdig/xa_map.o ../libhtdig/getcwd.o ../libhtdig/mhash_md5.o ../libhtdig/regex.o ../libhtdig/vsnprintf.o ../libhtdig/memcmp.o ../libhtdig/mktime.o ../libhtdig/snprintf.o ../libhtdig/memcpy.o ../libhtdig/myqsort.o ../libhtdig/strerror.o ../libhtdig/memmove.o ../libhtdig/raise.o ../libhtdig/timegm.o ../libhtdig/Configuration.o ../libhtdig/Database.o ../libhtdig/Dictionary.o ../libhtdig/DB2_db.o ../libhtdig/IntObject.o ../libhtdig/List.o ../libhtdig/Object.o ../libhtdig/ParsedString.o ../libhtdig/Queue.o ../libhtdig/QuotedStringList.o ../libhtdig/Stack.o ../libhtdig/String.o ../libhtdig/StringList.o ../libhtdig/StringMatch.o ../libhtdig/String_fmt.o ../libhtdig/good_strtok.o ../libhtdig/strcasecmp.o ../libhtdig/strptime.o ../libhtdig/HtCodec.o ../libhtdig/HtWordCodec.o ../libhtdig/HtVector.o ../libhtdig/HtHeap.o ../libhtdig/HtPack.o ../libhtdig/HtDateTime.o ../libhtdig/HtRegex.o ../libhtdig/HtRegexList.o ../libhtdig/HtRegexReplace.o ../libhtdig/HtRegexReplaceList.o ../libhtdig/HtVectorGeneric.o ../libhtdig/HtMaxMin.o ../libhtdig/HtWordType.o ../libhtdig/md5.o ../libhtdig/WordBitCompress.o ../libhtdig/WordContext.o ../libhtdig/WordCursor.o ../libhtdig/WordDB.o ../libhtdig/WordDBCompress.o ../libhtdig/WordDBInfo.o ../libhtdig/WordDBPage.o ../libhtdig/WordKey.o ../libhtdig/WordKeyInfo.o ../libhtdig/WordList.o ../libhtdig/WordMonitor.o ../libhtdig/WordRecord.o ../libhtdig/WordRecordInfo.o ../libhtdig/WordReference.o ../libhtdig/WordStat.o ../libhtdig/WordType.o ../libhtdig/DocumentDB.o ../libhtdig/DocumentRef.o ../libhtdig/HtWordReference.o ../libhtdig/HtWordList.o ../libhtdig/defaults.o ../libhtdig/HtURLCodec.o ../libhtdig/URL.o ../libhtdig/URLTrans.o ../libhtdig/HtZlibCodec.o ../libhtdig/cgi.o ../libhtdig/HtSGMLCodec.o ../libhtdig/HtConfiguration.o ../libhtdig/HtURLRewriter.o ../libhtdig/conf_lexer.o ../libhtdig/conf_parser.o ../libhtdig/Connection.o ../libhtdig/Transport.o ../libhtdig/HtHTTP.o ../libhtdig/HtFile.o ../libhtdig/HtNNTP.o ../libhtdig/HtCookie.o ../libhtdig/HtCookieJar.o ../libhtdig/HtCookieMemJar.o ../libhtdig/HtCookieInFileJar.o ../libhtdig/HtHTTPBasic.o ../libhtdig/HtHTTPSecure.o ../libhtdig/SSLConnection.o ../libhtdig/Document.o ../libhtdig/ExternalParser.o ../libhtdig/HTML.o ../libhtdig/Parsable.o ../libhtdig/Plaintext.o ../libhtdig/Retriever.o ../libhtdig/Server.o ../libhtdig/URLRef.o ../libhtdig/ExternalTransport.o ../libhtdig/Accents.o ../libhtdig/Endings.o ../libhtdig/EndingsDB.o ../libhtdig/Exact.o ../libhtdig/Fuzzy.o ../libhtdig/Metaphone.o ../libhtdig/Prefix.o ../libhtdig/Regexp.o ../libhtdig/Soundex.o ../libhtdig/Speling.o ../libhtdig/Substring.o ../libhtdig/SuffixEntry.o ../libhtdig/Synonym.o ../libhtdig/Collection.o ../libhtdig/DocMatch.o ../libhtdig/HtURLSeedScore.o ../libhtdig/HtFTP.o ../libhtdig/ResultList.o ../libhtdig/ResultMatch.o ../libhtdig/SplitMatches.o ../libhtdig/Template.o ../libhtdig/TemplateList.o ../libhtdig/WeightWord.o ../libhtdig/parser.o ../libhtdig/ResultFetch.o ../libhtdig/BasicDocument.o ../libhtdig/TextCollector.o ../libhtdig/IndexPurge.o ../libhtdig/libhtdig_htdig.o ../libhtdig/libhtdig_htmerge.o ../libhtdig/libhtdig_htfuzzy.o ../libhtdig/libhtdig_log.o ../libhtdig/libhtdig_htsearch.o ../libhtdig/filecopy.o ' ln -s ../libhtdig/libhtdig.so.$LIBHTDIG_VER libhtdig.so.$LIBHTDIG_VER if [ `uname` = 'Linux' ]; then gcc -shared htdigphp.lo $LIBHTDIG_OBJS -lstdc++ -Xlinker -h -Xlinker libhtdigphp.so.$LIBHTDIG_VER -o libhtdigphp.so.$LIBHTDIG_VER #gcc -shared htdigphp.lo /nfs/local/linux/lib/libhtdig.so.$LIBHTDIG_VER -lstdc++ -Xlinker -h -Xlinker libhtdigphp.so.$LIBHTDIG_VER -o libhtdigphp.so.$LIBHTDIG_VER elif [ `uname` = 'SunOS' ]; then gcc -shared htdigphp.lo $LIBHTDIG_OBJS -Xlinker -h -Xlinker libhtdigphp.so.$LIBHTDIG_VER -o libhtdigphp.so.$LIBHTDIG_VER #gcc -shared htdigphp.lo /nfs/local/sunos/lib/libhtdig.so.$LIBHTDIG_VER -Xlinker -h -Xlinker libhtdigphp.so.$LIBHTDIG_VER -o libhtdigphp.so.$LIBHTDIG_VER fi #gcc -shared -L../libhtdig htdigphp.lo-l $(LIBHTDIG_LIBRARY) -lstdc++ -Wl,-soname -Wl,libhtdigphp.so -o .libs/libhtdigphp.so cp libhtdigphp.so.$LIBHTDIG_VER modules/. #cp .libs/libhtdigphp.so modules/libhtdigphp.so ldd modules/libhtdigphp.so.$LIBHTDIG_VER htdig-3.2.0b6/libhtdigphp/modules/0040755006314600127310000000000010063260370016331 5ustar angusgbhtdightdig-3.2.0b6/test/0040755006314600127310000000000010063260370013342 5ustar angusgbhtdightdig-3.2.0b6/test/benchmark/0040755006314600127310000000000010063260370015274 5ustar angusgbhtdightdig-3.2.0b6/test/.cvsignore0100644006314600127310000000024607426615601015353 0ustar angusgbhtdigMakefile *.lo *.la .pure .purify .deps .libs test_functions dbbench testnet document word logs var url txt2mifluz search test test_weakcmpr t_htdb.d1 t_htdb.d2 __db.*htdig-3.2.0b6/test/Makefile.am0100644006314600127310000001174010055635561015407 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # # include $(top_srcdir)/Makefile.config # # All test programs use the index description from the # mifluz.conf file (MIFLUZ_CONFIG set in test_functions.in). # Some have hard wired additions but these # additions are never redundant with mifluz.conf content. Some # programs have options that allow command line overriding of # index parameters (page size, compression and such). # # To run individual tests use (for instance): # make TESTS=t_wordkey check # # To turn on verbosity use (for instance): # VERBOSE=-vv make TESTS=t_wordkey check # # Run individual test without using make # MAKE=make srcdir=. VERBOSE=-vv t_wordkey # # To purify objects use: # ( cd ../test ; rm -f word ; make CXXLD='purify g++' word ) # # To generate benchmarks in benchmark/... make sure # you have rrdtool installed and use # make MONITOR=' -m' dobench # TESTS = t_wordkey t_wordlist t_wordskip t_wordbitstream \ t_search t_htdb t_rdonly t_trunc t_url \ t_htdig t_htsearch t_htmerge t_htnet t_htdig_local \ t_factors t_fuzzy t_parsing t_templates t_validwords TESTS_ENVIRONMENT = $(top_srcdir)/test/test_prepare AM_MAKEFLAGS = MAKE="$(MAKE)" EXTRA_DIST = test_functions.in test_prepare $(TESTS) \ skiptest_db.txt search.txt mifluz.conf mifluz-search.conf \ benchmark-report benchmark t_htdb.dump \ htdocs conf url.parents url.children url.output LOCAL_DEFINES = -I$(top_builddir)/db -I$(top_srcdir)/db $(PROFILING) check_PROGRAMS = word dbbench txt2mifluz search testnet document url dbbench_SOURCES = dbbench.cc dbbench_DEPENDENCIES = $(HTLIBS) dbbench_LDFLAGS = $(PROFILING) ${extra_ldflags} dbbench_LDADD = $(HTLIBS) word_SOURCES = word.cc word_DEPENDENCIES = $(HTLIBS) word_LDFLAGS = $(PROFILING) ${extra_ldflags} word_LDADD = $(HTLIBS) txt2mifluz_SOURCES = txt2mifluz.cc txt2mifluz_DEPENDENCIES = $(HTLIBS) txt2mifluz_LDFLAGS = $(PROFILING) ${extra_ldflags} txt2mifluz_LDADD = $(HTLIBS) search_SOURCES = search.cc search_DEPENDENCIES = $(HTLIBS) search_LDFLAGS = $(PROFILING) ${extra_ldflags} search_LDADD = $(HTLIBS) testnet_SOURCES = testnet.cc testnet_DEPENDENCIES = $(HTLIBS) testnet_LDFLAGS = $(PROFILING) ${extra_ldflags} testnet_LDADD = $(HTLIBS) document_SOURCES = document.cc document_DEPENDENCIES = $(HTLIBS) document_LDFLAGS = $(PROFILING) ${extra_ldflags} document_LDADD = $(HTLIBS) url_SOURCES = url.cc url_DEPENDENCIES = $(HTLIBS) url_LDFLAGS = $(PROFILING) ${extra_ldflags} url_LDADD = $(HTLIBS) clean-local: rm -fr gmon.out test test_weakcmpr __db* rm -f tmpfile t_htdb.d? monitor.out cd conf; $(MAKE) clean distclean-local: rm -fr words.all words.uniq # # The benchmark directory contains the result of some benchmarks in HTML # form generated by benchmark-report, if MONITOR='-m' is specified. # dobench: dbbench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-z' REPORT='Nz' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='' REPORT='N' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-W -z' REPORT='Wz' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-W' REPORT='W' MONITOR="$(MONITOR)" bench BASE = test CACHESIZE = -C `expr 64 \* 1024 \* 1024` PAGESIZE = -S 8192 CMPR = -z WORDS = -w words.all LOOP = -l 3 NWORDS = #MONITOR = -m MONITOR = bench: rm -f $(BASE) $(BASE)_weakcmpr __db* monitor.out bench.out ( \ MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(TIMEV) $(top_builddir)/test/dbbench $(CACHESIZE) $(PAGESIZE) $(CMPR) $(WORDS) $(LOOP) -B $(BASE) $(NWORDS) $(MONITOR) ; \ ls -l $(BASE) ; \ if [ -f $(BASE)_weakcmpr ] ; then MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(top_builddir)/htdb/htdump -p $(BASE)_weakcmpr ; fi ; \ MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(top_builddir)/htdb/htstat $(CMPR) -d $(BASE) ; \ ) 2>&1 | tee bench.out if [ "$(RRDTOOL)" -a "X$(MONITOR)" != "X" ] ; then \ if [ "$(REPORT)" ] ; \ then \ output="--output $(REPORT)" ; \ fi ; \ $(PERL) benchmark-report $$output --comment="`cat bench.out`" ; \ rm monitor.out ; \ fi # # Generate list of words from info and man files. # words: if [ -d /usr/info ] ; then root=/usr ; else root=/usr/share ; fi ; \ find $$root/info -name '*.gz' -print | xargs zcat | perl -n -e 'print join("\n", map { lc } grep(length() > 2 && length() < 32, m/[a-z]+/ig)) . "\n"' | grep -v '^$$' > words.all ; \ find $$root/man -type f -name '*.gz' -print | xargs zcat | perl -n -e 'print join("\n", map { lc } grep(length() > 2 && length() < 32, m/[a-z]+/ig)) . "\n"' | grep -v '^$$' >> words.all sort -u < words.all > words.uniq htdig-3.2.0b6/test/Makefile.in0100644006314600127310000005166110063260372015417 0ustar angusgbhtdig# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # 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@ # # To compile with profiling do the following: # # make CFLAGS=-g CXXFLAGS=-g PROFILING=-p all # srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : host_triplet = @host@ ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ APACHE = @APACHE@ APACHE_MODULES = @APACHE_MODULES@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CGIBIN_DIR = @CGIBIN_DIR@ COMMON_DIR = @COMMON_DIR@ CONFIG_DIR = @CONFIG_DIR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATABASE_DIR = @DATABASE_DIR@ DEFAULT_CONFIG_FILE = @DEFAULT_CONFIG_FILE@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FIND = @FIND@ GUNZIP = @GUNZIP@ HAVE_SSL = @HAVE_SSL@ HTDIG_MAJOR_VERSION = @HTDIG_MAJOR_VERSION@ HTDIG_MICRO_VERSION = @HTDIG_MICRO_VERSION@ HTDIG_MINOR_VERSION = @HTDIG_MINOR_VERSION@ IMAGE_DIR = @IMAGE_DIR@ IMAGE_URL_PREFIX = @IMAGE_URL_PREFIX@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MV = @MV@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ RRDTOOL = @RRDTOOL@ SEARCH_DIR = @SEARCH_DIR@ SEARCH_FORM = @SEARCH_FORM@ SED = @SED@ SENDMAIL = @SENDMAIL@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TAR = @TAR@ TESTS_FALSE = @TESTS_FALSE@ TESTS_TRUE = @TESTS_TRUE@ TIME = @TIME@ TIMEV = @TIMEV@ USER = @USER@ VERSION = @VERSION@ YACC = @YACC@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ extra_ldflags = @extra_ldflags@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign no-dependencies INCLUDES = -DDEFAULT_CONFIG_FILE=\"$(DEFAULT_CONFIG_FILE)\" \ -I$(top_srcdir)/include -I$(top_srcdir)/htlib \ -I$(top_srcdir)/htnet -I$(top_srcdir)/htcommon \ -I$(top_srcdir)/htword \ -I$(top_srcdir)/db -I$(top_builddir)/db \ $(LOCAL_DEFINES) $(PROFILING) HTLIBS = $(top_builddir)/htnet/libhtnet.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/htlib/libht.la \ $(top_builddir)/htcommon/libcommon.la \ $(top_builddir)/htword/libhtword.la \ $(top_builddir)/db/libhtdb.la \ $(top_builddir)/htlib/libht.la # # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License version 2 or later # # # # All test programs use the index description from the # mifluz.conf file (MIFLUZ_CONFIG set in test_functions.in). # Some have hard wired additions but these # additions are never redundant with mifluz.conf content. Some # programs have options that allow command line overriding of # index parameters (page size, compression and such). # # To run individual tests use (for instance): # make TESTS=t_wordkey check # # To turn on verbosity use (for instance): # VERBOSE=-vv make TESTS=t_wordkey check # # Run individual test without using make # MAKE=make srcdir=. VERBOSE=-vv t_wordkey # # To purify objects use: # ( cd ../test ; rm -f word ; make CXXLD='purify g++' word ) # # To generate benchmarks in benchmark/... make sure # you have rrdtool installed and use # make MONITOR=' -m' dobench # TESTS = t_wordkey t_wordlist t_wordskip t_wordbitstream \ t_search t_htdb t_rdonly t_trunc t_url \ t_htdig t_htsearch t_htmerge t_htnet t_htdig_local \ t_factors t_fuzzy t_parsing t_templates t_validwords TESTS_ENVIRONMENT = $(top_srcdir)/test/test_prepare AM_MAKEFLAGS = MAKE="$(MAKE)" EXTRA_DIST = test_functions.in test_prepare $(TESTS) \ skiptest_db.txt search.txt mifluz.conf mifluz-search.conf \ benchmark-report benchmark t_htdb.dump \ htdocs conf url.parents url.children url.output LOCAL_DEFINES = -I$(top_builddir)/db -I$(top_srcdir)/db $(PROFILING) check_PROGRAMS = word dbbench txt2mifluz search testnet document url dbbench_SOURCES = dbbench.cc dbbench_DEPENDENCIES = $(HTLIBS) dbbench_LDFLAGS = $(PROFILING) ${extra_ldflags} dbbench_LDADD = $(HTLIBS) word_SOURCES = word.cc word_DEPENDENCIES = $(HTLIBS) word_LDFLAGS = $(PROFILING) ${extra_ldflags} word_LDADD = $(HTLIBS) txt2mifluz_SOURCES = txt2mifluz.cc txt2mifluz_DEPENDENCIES = $(HTLIBS) txt2mifluz_LDFLAGS = $(PROFILING) ${extra_ldflags} txt2mifluz_LDADD = $(HTLIBS) search_SOURCES = search.cc search_DEPENDENCIES = $(HTLIBS) search_LDFLAGS = $(PROFILING) ${extra_ldflags} search_LDADD = $(HTLIBS) testnet_SOURCES = testnet.cc testnet_DEPENDENCIES = $(HTLIBS) testnet_LDFLAGS = $(PROFILING) ${extra_ldflags} testnet_LDADD = $(HTLIBS) document_SOURCES = document.cc document_DEPENDENCIES = $(HTLIBS) document_LDFLAGS = $(PROFILING) ${extra_ldflags} document_LDADD = $(HTLIBS) url_SOURCES = url.cc url_DEPENDENCIES = $(HTLIBS) url_LDFLAGS = $(PROFILING) ${extra_ldflags} url_LDADD = $(HTLIBS) BASE = test CACHESIZE = -C `expr 64 \* 1024 \* 1024` PAGESIZE = -S 8192 CMPR = -z WORDS = -w words.all LOOP = -l 3 NWORDS = #MONITOR = -m MONITOR = subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = test_functions check_PROGRAMS = word$(EXEEXT) dbbench$(EXEEXT) txt2mifluz$(EXEEXT) \ search$(EXEEXT) testnet$(EXEEXT) document$(EXEEXT) url$(EXEEXT) am_dbbench_OBJECTS = dbbench.$(OBJEXT) dbbench_OBJECTS = $(am_dbbench_OBJECTS) am_document_OBJECTS = document.$(OBJEXT) document_OBJECTS = $(am_document_OBJECTS) am_search_OBJECTS = search.$(OBJEXT) search_OBJECTS = $(am_search_OBJECTS) am_testnet_OBJECTS = testnet.$(OBJEXT) testnet_OBJECTS = $(am_testnet_OBJECTS) am_txt2mifluz_OBJECTS = txt2mifluz.$(OBJEXT) txt2mifluz_OBJECTS = $(am_txt2mifluz_OBJECTS) am_url_OBJECTS = url.$(OBJEXT) url_OBJECTS = $(am_url_OBJECTS) am_word_OBJECTS = word.$(OBJEXT) word_OBJECTS = $(am_word_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = am__depfiles_maybe = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(dbbench_SOURCES) $(document_SOURCES) $(search_SOURCES) \ $(testnet_SOURCES) $(txt2mifluz_SOURCES) $(url_SOURCES) \ $(word_SOURCES) DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/Makefile.config \ Makefile.am test_functions.in SOURCES = $(dbbench_SOURCES) $(document_SOURCES) $(search_SOURCES) $(testnet_SOURCES) $(txt2mifluz_SOURCES) $(url_SOURCES) $(word_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.config $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign test/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) test_functions: $(top_builddir)/config.status test_functions.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dbbench$(EXEEXT): $(dbbench_OBJECTS) $(dbbench_DEPENDENCIES) @rm -f dbbench$(EXEEXT) $(CXXLINK) $(dbbench_LDFLAGS) $(dbbench_OBJECTS) $(dbbench_LDADD) $(LIBS) document$(EXEEXT): $(document_OBJECTS) $(document_DEPENDENCIES) @rm -f document$(EXEEXT) $(CXXLINK) $(document_LDFLAGS) $(document_OBJECTS) $(document_LDADD) $(LIBS) search$(EXEEXT): $(search_OBJECTS) $(search_DEPENDENCIES) @rm -f search$(EXEEXT) $(CXXLINK) $(search_LDFLAGS) $(search_OBJECTS) $(search_LDADD) $(LIBS) testnet$(EXEEXT): $(testnet_OBJECTS) $(testnet_DEPENDENCIES) @rm -f testnet$(EXEEXT) $(CXXLINK) $(testnet_LDFLAGS) $(testnet_OBJECTS) $(testnet_LDADD) $(LIBS) txt2mifluz$(EXEEXT): $(txt2mifluz_OBJECTS) $(txt2mifluz_DEPENDENCIES) @rm -f txt2mifluz$(EXEEXT) $(CXXLINK) $(txt2mifluz_LDFLAGS) $(txt2mifluz_OBJECTS) $(txt2mifluz_LDADD) $(LIBS) url$(EXEEXT): $(url_OBJECTS) $(url_DEPENDENCIES) @rm -f url$(EXEEXT) $(CXXLINK) $(url_LDFLAGS) $(url_OBJECTS) $(url_LDADD) $(LIBS) word$(EXEEXT): $(word_OBJECTS) $(word_DEPENDENCIES) @rm -f word$(EXEEXT) $(CXXLINK) $(word_LDFLAGS) $(word_OBJECTS) $(word_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .cc.o: $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cc.obj: $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` .cc.lo: $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -n "$$skipped" && echo "$$skipped"; \ test -n "$$report" && echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/.. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: 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: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_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-checkPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-local distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool clean-local \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-local distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am clean-local: rm -fr gmon.out test test_weakcmpr __db* rm -f tmpfile t_htdb.d? monitor.out cd conf; $(MAKE) clean distclean-local: rm -fr words.all words.uniq # # The benchmark directory contains the result of some benchmarks in HTML # form generated by benchmark-report, if MONITOR='-m' is specified. # dobench: dbbench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-z' REPORT='Nz' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='' REPORT='N' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-W -z' REPORT='Wz' MONITOR="$(MONITOR)" bench $(MAKE) BASE="$(BASE)" CACHESIZE="$(CACHESIZE)" PAGESIZE="$(PAGESIZE)" LOOP="$(LOOP)" NWORDS="$(NWORDS)" CMPR='-W' REPORT='W' MONITOR="$(MONITOR)" bench bench: rm -f $(BASE) $(BASE)_weakcmpr __db* monitor.out bench.out ( \ MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(TIMEV) $(top_builddir)/test/dbbench $(CACHESIZE) $(PAGESIZE) $(CMPR) $(WORDS) $(LOOP) -B $(BASE) $(NWORDS) $(MONITOR) ; \ ls -l $(BASE) ; \ if [ -f $(BASE)_weakcmpr ] ; then MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(top_builddir)/htdb/htdump -p $(BASE)_weakcmpr ; fi ; \ MIFLUZ_CONFIG=$(top_srcdir)/test/mifluz.conf $(top_builddir)/htdb/htstat $(CMPR) -d $(BASE) ; \ ) 2>&1 | tee bench.out if [ "$(RRDTOOL)" -a "X$(MONITOR)" != "X" ] ; then \ if [ "$(REPORT)" ] ; \ then \ output="--output $(REPORT)" ; \ fi ; \ $(PERL) benchmark-report $$output --comment="`cat bench.out`" ; \ rm monitor.out ; \ fi # # Generate list of words from info and man files. # words: if [ -d /usr/info ] ; then root=/usr ; else root=/usr/share ; fi ; \ find $$root/info -name '*.gz' -print | xargs zcat | perl -n -e 'print join("\n", map { lc } grep(length() > 2 && length() < 32, m/[a-z]+/ig)) . "\n"' | grep -v '^$$' > words.all ; \ find $$root/man -type f -name '*.gz' -print | xargs zcat | perl -n -e 'print join("\n", map { lc } grep(length() > 2 && length() < 32, m/[a-z]+/ig)) . "\n"' | grep -v '^$$' >> words.all sort -u < words.all > words.uniq # 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: htdig-3.2.0b6/test/bad_word_list0100644006314600127310000000001207766741211016105 0ustar angusgbhtdigtechnical htdig-3.2.0b6/test/benchmark-report0100644006314600127310000001752710055635561016552 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # # Use the result from WordMonitor (--input=file) and generate a report in # benchmark/<--output=name>-YYYY-MM-DD/index.html. # If --comment='bla bla' is provided it is copied in the comment.txt file. # use strict; use Getopt::Long; use File::Path; use POSIX qw(strftime); my($report) = "unknown"; my($verbose); my($comment) = ""; my($dir); sub main { my($file) = "monitor.out"; GetOptions("input=s" => \$file, "output=s" => \$report, "comment=s" => \$comment, "verbose=i" => \$verbose, ); my($timestamp) = strftime("%Y-%m-%d", localtime); $dir = "benchmark/$report-$timestamp"; if(-d $dir) { print STDERR "directory $dir exists, will not override: abort\n"; exit(1); } mkpath($dir, 0, 0777) or die "cannot mkdirp $dir : $!"; my($cmds) = "$dir/README"; open(CMDS, ">$cmds") or die "cannot open $cmds for writing : $!"; report(build($file)); close(CMDS); my($file) = "$dir/monitor.rrd"; unlink($file) or die "cannot unlink $file : $!"; } sub report { my($started, $finished, @fields) = @_; my($file) = "$dir/config.html"; open(FILE, ">$file") or die "cannot open $file for writing : $!"; print FILE "\n
    ";
        close(FILE);
        run("uname -a >> $file");
        run("cat /proc/cpuinfo >> $file") if(-f "/proc/cpuinfo");
        run("cat /proc/meminfo >> $file") if(-f "/proc/meminfo");
    
        $file = "$dir/comment.html";
        open(FILE, ">$file") or die "cannot open $file for writing : $!";
        print FILE "\n
    ";
        if(!$comment) {
    	print FILE "No comment\n";
        } else {
    	print FILE $comment;
        }
        close(FILE);
    
        #
        # Generate a graph for each value
        #
        my(%vlabel) = (
    		   'Write' => 'Pages',
    		   'Read' => 'Pages',
    		   'P_IBTREE' => 'Pages',
    		   'P_LBTREE' => 'Pages',
    		   'P_UNKNOWN' => 'Pages',
    		   'Put' => 'Put',
    		   'Get__0_' => 'Get',
    		   'Get__NEXT_' => 'Get',
    		   'Get__SET_RANGE_' => 'Get',
    		   'Get__Other_' => 'Get',
    		   'LEVEL' => 'Level',
    		   'PGNO' => 'Pages',
    		   'CMP' => 'Compare',
    		   );
        my(%hlabel) = (
    		   'Write' => 'Write/second',
    		   'Read' => 'Read/second',
    		   'P_IBTREE' => 'Internal B-Tree nodes read + write / second',
    		   'P_LBTREE' => 'Leaf B-Tree nodes read + write / second',
    		   'P_UNKNOWN' => 'Unknown pages read + write / second',
    		   'Put' => 'Put / second',
    		   'Get__0_' => 'Get(0) / second',
    		   'Get__NEXT_' => 'Get(DB_NEXT) / second',
    		   'Get__SET_RANGE_' => 'Get(DB_SET_RANGE) / second',
    		   'Get__Other_' => 'Get(???) / second',
    		   'LEVEL' => 'Height of the B-Tree',
    		   'PGNO' => 'Size of the B-Tree in pages',
    		   'CMP' => 'Key compare / second',
    		   );
    	
        my(@graphs);
        my($field);
        foreach $field (@fields) {
    	my($image) = "$dir/$field.gif";
    	my($hlabel) = exists($hlabel{$field}) ? "--title '$hlabel{$field}'" : "";
    	my($vlabel) = exists($vlabel{$field}) ? "--vertical-label '$vlabel{$field}'" : "";
    	run("rrdtool graph $image --start $started --end $finished $hlabel $vlabel DEF:in=$dir/monitor.rrd:$field:AVERAGE 'LINE2:in#FF0000' >/dev/null");
        }
    
        #
        # Generate a cumulated graph for compression rates
        #
        my(%rate) = (
    		 'Compress_1_1' => 1,
    		 'Compress_1_2' => 2,
    		 'Compress_1_3' => 3,
    		 'Compress_1_4' => 4,
    		 'Compress_1_5' => 5,
    		 'Compress_1_6' => 6,
    		 'Compress_1_7' => 7,
    		 'Compress_1_8' => 8,
    		 'Compress_1_9' => 9,
    		 'Compress_1_10' => 10,
    		 'Compress_1__10' => 11,
    		 );
        my(%color) = (
    		 'Compress_1_1' => "#ff0000",
    		 'Compress_1_2' => "#ee1100",
    		 'Compress_1_3' => "#dd2200",
    		 'Compress_1_4' => "#cc3300",
    		 'Compress_1_5' => "#bb4400",
    		 'Compress_1_6' => "#996600",
    		 'Compress_1_7' => "#778800",
    		 'Compress_1_8' => "#55aa00",
    		 'Compress_1_9' => "#33cc00",
    		 'Compress_1_10' => "#11ee00",
    		 'Compress_1__10' => "#00ff00",
    		 );
        my($last_total);
        my(@lines);
        foreach $field (@fields) {
    	next if($field !~ /^Compress/);
    	my($cdef) = "";
    	my($total) = "cmpr$rate{$field}";
    	if($last_total) {
    	    $total = "total$rate{$field}";
    	    $cdef = "CDEF:$total=$last_total,cmpr$rate{$field},+";
    	}
    	$last_total = $total;
    	push(@lines, "DEF:cmpr$rate{$field}=$dir/monitor.rrd:$field:AVERAGE $cdef 'LINE1:$total$color{$field}:1/$rate{$field}'");
        }
        run("rrdtool graph $dir/compress.gif --start $started --end  $finished --title 'Compression rate comparison / second' --vertical-label 'Pages' @lines >/dev/null");
    
        #
        # Build home page
        #
        $file = "$dir/index.html";
        open(FILE, ">$file") or die "cannot open $file for writing : $!";
        print FILE <
    
    [Configuration | Comment | Samples | Compression]

    EOF print FILE <
    In the graph above, the area under each line is the number of pages compressed in the corresponding proportions. The bottom line is always 1/1 compression. For instance the area between the 1/11 line and the 1/10 line shows how many pages were compressed in a proportion equal or better than 1/11. In the compression report an individual graph is shown for each line.
    EOF foreach $field (@fields) { next if($field =~ /^Compress/); print FILE <
    EOF } print FILE "

    \n"; close(FILE); # # Build compression details page # $file = "$dir/compress.html"; open(FILE, ">$file") or die "cannot open $file for writing : $!"; print FILE <
    [Home page]

    EOF print FILE <
    EOF foreach $field (@fields) { next if($field !~ /^Compress/); print FILE <
    EOF } print FILE "

    \n"; close(FILE); } sub run { my($cmd) = @_; system($cmd); print STDERR "$cmd\n" if($verbose); print CMDS "$cmd\n"; } sub build { my($file) = @_; system("cp $file $dir"); my(@fields); my($started); my($step); my($heartbeat); my($finished); my(@updates); open(FILE, "<$file") or die "cannot open $file for reading : $!"; while() { if(/WordMonitor starting/) { ($started) = =~ /^Started:(\d+)/; ($step) = =~ /^Period:(\d+)/; $heartbeat = $step * 2; my(@ds); @fields = split(':', scalar()); shift(@fields); # get rid of Time field pop(@fields); # get rid of last empty field my($field); foreach $field (@fields) { my($type) = $field =~ /^(.)\./; $field =~ s/^..//; $field =~ s/[^a-z0-9_]/_/gi; if($type eq 'C') { push(@ds, "DS:$field:COUNTER:$heartbeat:U:U"); } elsif($type eq 'G') { push(@ds, "DS:$field:GAUGE:$heartbeat:0:U"); } else { print STDERR "Unknown type $type for field $field\n"; exit(1); } } my($ds) = join(' ', @ds); my($rra) = "RRA:AVERAGE:0.5:1:2000"; my($cmd) = "rrdtool create $dir/monitor.rrd --step $step --start $started $ds $rra"; run("rm -f $dir/monitor.rrd ; $cmd"); next; } next if(/-------------/ || /^\s*$/); chop; # remove new line chop; # remove last : ($finished) = m/^(\d+):/; print STDERR "$_\n" if($verbose); push(@updates, $_); if(@updates > 50) { run("rrdtool update $dir/monitor.rrd " . join(' ', @updates)); @updates = (); } } if(@updates) { run("rrdtool update $dir/monitor.rrd " . join(' ', @updates)); } close(FILE); print STDERR "started = $started, finished = $finished\n" if($verbose); return ($started, $finished, @fields); } main(); htdig-3.2.0b6/test/dbbench.cc0100644006314600127310000004600610055635561015252 0ustar angusgbhtdig// // dbbench.cc // // dbbench: stress test the Berkeley DB database and WordList interface. // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: dbbench.cc,v 1.13 2004/05/28 13:15:29 lha Exp $ // #ifdef HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ //#include // included later, as non __STDC__ may #define open #include // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif /* HAVE_GETOPT_H */ #ifdef HAVE_MALLOC_H #include #endif /* HAVE_MALLOC_H */ #include /* AIX requires this to be the first thing in the file. */ //#ifndef __GNUC__ // Why not if g++? Needed by g++ on Solaris 2.8 # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif //#endif #include #include #include #include #include"HtTime.h" #include"WordMonitor.h" #define RAND() ((unsigned int) (1000.0*rand()/(RAND_MAX+1.0))) /* * Store all options from the command line */ class params_t { public: char* wordsfile; char* dbfile; char* find; int nwords; int loop; DBTYPE type; int page_size; int cache_size; int multiply_keys; int wordlist; int compress; int pool; int compress_test; int npage; int uncompress; int remove; int count; int monitor; int random; void show() { printf("wordsfile:: %s\n", wordsfile); printf("dbfile:: %s\n", dbfile); printf("find:: %s\n", find); printf("nwords:: %d\n", nwords); printf("loop:: %d\n", loop); printf("page_size:: %d\n", page_size); printf("cache_size:: %d\n", cache_size); printf("multiply_keys:: %d\n", multiply_keys); printf("wordlist:: %d\n", wordlist); printf("compress:: %d\n", compress); printf("pool:: %d\n", pool); printf("compress_test:: %d\n", compress_test); printf("npage:: %d\n", npage); printf("uncompress:: %d\n", uncompress); printf("remove:: %d\n", remove); printf("count:: %d\n", count); printf("monitor:: %d\n", monitor); } }; /* * Explain options */ static void usage(); /* * Verbosity level set with -v (++) */ static int verbose = 0; // ***************************************************************** // Test framework // class Dbase { public: Dbase(params_t* nparams) { params = nparams; } virtual ~Dbase() {} virtual void dbinit() = 0; void dobench(); virtual void dbfinish() = 0; void fill(); virtual void fill_one(String& line, int count) = 0; virtual void find() = 0; virtual void remove() = 0; protected: params_t* params; }; /* * Run function according to user specfied options. */ void Dbase::dobench() { dbinit(); if(params->find) { find(); } else if(params->remove) { remove(); } else { fill(); } dbfinish(); } /* * Generate a list of words from a file. * Call the fill_one function for each generated word. */ void Dbase::fill() { #define FILL_BUFFER_SIZE (50*1024) char buffer[FILL_BUFFER_SIZE + 1]; int count = params->count; int words_count; int i; fprintf(stderr, "Reading from %s ... ", params->wordsfile); for(i = 0; i < params->loop; i++) { FILE* in = fopen(params->wordsfile, "r"); if(!in) { fprintf(stderr, "cannot open %s for reading : ", params->wordsfile); perror(""); exit(1); } words_count = 0; while(fgets(buffer, FILL_BUFFER_SIZE, in)) { String line(buffer); line.chop("\r\n"); for(int j = 0; j < params->multiply_keys; j++) { fill_one(line, count); count++; } words_count++; if(params->nwords > 0 && params->nwords <= words_count) break; } fclose(in); } fprintf(stderr, "pushed %d words\n", count); } // ***************************************************************** // Test Berkeley DB alone // class Dsimple : public Dbase { public: Dsimple(params_t* nparams) : Dbase(nparams) { pad = 0; } virtual ~Dsimple() { if(pad) free(pad); } virtual void dbinit(); void dbinit_env(); void dbopen(); virtual void dbfinish(); virtual void fill_one(String& line, int count); virtual void find(); virtual void remove(); void dbput(const String& key, const String& data); protected: DB_ENV* dbenv; DB* db; char* pad; }; /* * Comparison routine for the string keys. */ static int int_cmp(const DBT *a, const DBT *b) { // First compare word size_t len = (a->size > b->size ? b->size : a->size) - (sizeof(unsigned short) + sizeof(int)); u_int8_t *p1, *p2; for (p1 = (u_int8_t*)a->data + sizeof(unsigned short) + sizeof(int), p2 = (u_int8_t*)b->data + sizeof(unsigned short) + sizeof(int); len--; ++p1, ++p2) if (*p1 != *p2) return ((long)*p1 - (long)*p2); // // If words compare equal, compare numbers // if(a->size == b->size) { int ai, bi; memcpy((char*)&ai, ((char*)a->data + sizeof(unsigned short)), sizeof(int)); memcpy((char*)&bi, ((char*)b->data + sizeof(unsigned short)), sizeof(int)); if(ai - bi) return ai - bi; unsigned short as, bs; memcpy((char*)&as, ((char*)a->data), sizeof(unsigned short)); memcpy((char*)&bs, ((char*)b->data), sizeof(unsigned short)); return as - bs; } return ((long)a->size - (long)b->size); } /* * Init and Open the database */ void Dsimple::dbinit() { dbinit_env(); dbopen(); } /* * Prepare the ground for testing. */ void Dsimple::dbinit_env() { char *progname = "dbbench problem..."; Configuration* config = WordContext::Initialize(); config->Add("wordlist_env_skip", "true"); if(params->monitor) config->Add("wordlist_monitor", "true"); WordContext::Initialize(*config); // // Make sure the size of a record used with raw Berkeley DB is equal to the // size of a record used with Word classes. // { pad = strdup("0123456789012345678900123456789012345678901234567890"); // // Dsimple uses an int (unique count) and short (docid) in addition to the word // int pad_length = WordKeyInfo::Instance()->num_length - sizeof(unsigned short) - sizeof(int); if(pad_length > 0) { if(pad_length > (int)(strlen(pad) - 1)) { fprintf(stderr, "Not enough padding\n"); exit(1); } } else { fprintf(stderr, "WordKey is always bigger than simulated key\n"); exit(1); } pad[pad_length] = '\0'; } int error; if((error = CDB_db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "%s: %s\n", progname, CDB_db_strerror(error)); exit (1); } dbenv->set_errfile(dbenv, stderr); dbenv->set_errpfx(dbenv, progname); if(params->cache_size > 500 * 1024) dbenv->set_cachesize(dbenv, 0, params->cache_size, 0); int flags = DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_NOMMAP; if(!params->pool) flags |= DB_PRIVATE; dbenv->open(dbenv, NULL, NULL, flags, 0666); } /* * Open of database after dbinit_env */ void Dsimple::dbopen() { if(CDB_db_create(&db, dbenv, 0) != 0) exit(1); // Note that prefix is disabled because bt_compare is set and // bt_prefix is not. if(params->type == DB_BTREE) db->set_bt_compare(db, int_cmp); if(params->page_size) db->set_pagesize(db, params->page_size); int flags = DB_CREATE | DB_NOMMAP; if(params->compress) flags |= DB_COMPRESS; if(params->find) flags |= DB_RDONLY; if(db->open(db, params->dbfile, NULL, params->type, flags, 0666) != 0) exit(1); } /* * Close the database and free objects */ void Dsimple::dbfinish() { (void)db->close(db, 0); (void)dbenv->close(dbenv, 0); WordContext::Finish(); } /* * Create a key from the word in and the unique count in */ void Dsimple::fill_one(String& line, int count) { unsigned short docid = params->random ? RAND() : ((count >> 16) & 0xff); String key((char*)&docid, sizeof(unsigned short)); key.append((char*)&count, sizeof(int)); key.append(line.get(), line.length()); key.append(pad); dbput(key, ""); } /* * Search for words. */ void Dsimple::find() { int seqrc; DBC* cursor; DBT key; DBT data; if((seqrc = db->cursor(db, NULL, &cursor, 0)) != 0) abort(); memset(&key, '\0', sizeof(DBT)); memset(&data, '\0', sizeof(DBT)); String word("\0\0\0\0", sizeof(int)); int next; if(strlen(params->find) > 0) { word.append(params->find, strlen(params->find)); key.data = word.get(); key.size = word.length(); cursor->c_get(cursor, &key, &data, DB_SET_RANGE); next = DB_NEXT_DUP; } else { cursor->c_get(cursor, &key, &data, DB_FIRST); next = DB_NEXT; } do { if(verbose == 1) { int docid; memcpy(&docid, key.data, sizeof(int)); String word(((char*)key.data) + sizeof(int), key.size - sizeof(int)); fprintf(stderr, "key: docid = %d word = %s\n", docid, (char*)word); } // // Straight dump of the entry // if(verbose > 1) { String k((const char*)key.data, (int)key.size); String d((const char*)data.data, (int)data.size); fprintf(stderr, "key: %s data: %s\n", (char*)k, (char*)d); } key.flags = 0; } while(cursor->c_get(cursor, &key, &data, next) == 0); cursor->c_close(cursor); } /* * Delete keys */ void Dsimple::remove() { int seqrc; DBC* cursor; DBT key; DBT data; int removed = 0; if((seqrc = db->cursor(db, NULL, &cursor, 0)) != 0) abort(); memset(&key, '\0', sizeof(DBT)); memset(&data, '\0', sizeof(DBT)); String word("\0\0\0\0", sizeof(int)); cursor->c_get(cursor, &key, &data, DB_FIRST); do { if(verbose) { int docid; memcpy(&docid, key.data, sizeof(int)); String word(((char*)key.data) + sizeof(int), key.size - sizeof(int)); fprintf(stderr, "key: docid = %d word = %s\n", docid, (char*)word); } cursor->c_del(cursor, 0); removed++; if(params->remove < removed) break; } while(cursor->c_get(cursor, &key, &data, DB_NEXT) == 0); cursor->c_close(cursor); } /* * Wrap a key + data insertion from String to DBT */ void Dsimple::dbput(const String& key, const String& data) { DBT k, d; memset(&k, 0, sizeof(DBT)); memset(&d, 0, sizeof(DBT)); char* key_string = (char*)alloca(key.length()); memcpy(key_string, key.get(),key.length()); k.data = key_string; k.size = key.length(); char* data_string = (char*)alloca(data.length()); memcpy(data_string, data.get(),data.length()); d.data = data_string; d.size = data.length(); if((db->put)(db, NULL, &k, &d, 0) != 0) abort(); } // ***************************************************************** // Test WordList // class Dwordlist : public Dbase { public: Dwordlist(params_t* nparams) : Dbase(nparams) {} virtual void dbinit(); virtual void dbfinish(); virtual void fill_one(String& line, int count); virtual void find(); virtual void remove(); void dbput(const String& key, const String& data); protected: WordList* words; }; static Configuration* config = 0; /* * Init and Open the database */ void Dwordlist::dbinit() { if(verbose) { fprintf(stderr, "Dwordlist::dbinit\n"); params->show(); } config = WordContext::Initialize(); if(params->cache_size > 500 * 1024) { String str; str << params->cache_size; config->Add("wordlist_cache_size", str); if(verbose) fprintf(stderr, "setting cache size to: %s\n", (char*)str); } if(params->page_size) { String str; str << params->page_size; config->Add("wordlist_page_size", str); if(verbose) fprintf(stderr, "setting page size to: %s\n", (char*)str); } if(params->compress) config->Add("wordlist_compress", "true"); if(params->monitor) config->Add("wordlist_monitor", "true"); WordContext::Initialize(*config); words = new WordList(*config); if(verbose) WordKeyInfo::Instance()->Show(); if(words->Open(params->dbfile, (params->find ? O_RDONLY : O_RDWR)) != OK) exit(1); } /* * Close the database and free objects */ void Dwordlist::dbfinish() { delete words; WordContext::Finish(); } /* * Create a key from the word in and the unique count in */ void Dwordlist::fill_one(String& line, int count) { WordReference wordRef; WordKey& key = wordRef.Key(); if(params->random) count = RAND(); key.SetWord(line); key.Set(WORD_FIRSTFIELD, count >> 16); key.Set(WORD_FIRSTFIELD + 1, 0); key.Set(WORD_FIRSTFIELD + 2, count & 0xffff); words->Override(wordRef); } static int wordlist_walk_callback_file_out(WordList *, WordDBCursor&, const WordReference *word, Object &) { printf("%s\n", (char*)word->Get()); return OK; } /* * Search for words. */ void Dwordlist::find() { if(strlen(params->find) > 0) { Object data; WordKey key; key.SetWord(params->find); WordCursor *cursor = words->Cursor(key, wordlist_walk_callback_file_out, &data); cursor->Walk(); delete cursor; } else { words->Write(stdout); } } /* * Delete keys */ void Dwordlist::remove() { } #ifdef HAVE_LIBZ static void docompress(params_t* params); #endif /* HAVE_LIBZ */ // ***************************************************************************** // Entry point // int main(int ac, char **av) { int c; extern char *optarg; params_t params; params.wordsfile = strdup("words.uniq"); params.dbfile = strdup("test"); params.nwords = -1; params.loop = 1; params.type = DB_BTREE; params.page_size = 4096; params.cache_size = 0; params.multiply_keys = 1; params.compress = 0; params.wordlist = 0; params.compress_test = 0; params.pool = 0; params.find = 0; params.npage = 0; params.remove = 0; params.count = 0; params.monitor = 0; params.random = 0; while ((c = getopt(ac, av, "vB:T:C:S:MZf:l:w:k:n:zWp:ur:c:mR")) != -1) { switch (c) { case 'v': verbose++; break; case 'B': free(params.dbfile); params.dbfile = strdup(optarg); break; case 'T': if(!strcmp(optarg, "hash")) { params.type = DB_HASH; } else { params.type = DB_BTREE; } break; case 'C': params.cache_size = atoi(optarg); break; case 'S': params.page_size = atoi(optarg); break; case 'M': params.pool = 1; break; case 'W': params.wordlist = 1; break; case 'z': params.compress = 1; break; case 'f': params.find = strdup(optarg); break; case 'l': params.loop = atoi(optarg); break; case 'w': free(params.wordsfile); params.wordsfile = strdup(optarg); break; case 'k': params.multiply_keys = atoi(optarg); break; case 'n': params.nwords = atoi(optarg); break; break; case 'Z': params.compress_test = 1; break; case 'p': params.npage = atoi(optarg); break; case 'u': params.uncompress = 1; break; case 'r': params.remove = atoi(optarg); break; case 'c': params.count = atoi(optarg); break; case 'm': params.monitor = 1; break; case 'R': params.random = 1; break; case '?': usage(); break; } } if(params.compress_test) { #ifdef HAVE_LIBZ docompress(¶ms); #else /* HAVE_LIBZ */ fprintf(stderr, "compiled without zlib, compression test not available\n"); exit(1); #endif /* HAVE_LIBZ */ } else { if(params.wordlist) { Dwordlist bench(¶ms); bench.dobench(); } else { Dsimple bench(¶ms); bench.dobench(); } } free(params.wordsfile); free(params.dbfile); if(params.find) free(params.find); return 0; } // ***************************************************************************** // void usage() // Display program usage information // static void usage() { printf("usage: dbbench [options]\n"); printf("Options:\n"); printf("\t-v\t\tIncreases the verbosity\n"); printf("\t-B dbfile\tuse as a db file name (default test).\n"); printf("\t-T {hash|btree}\tfile structure (default btree).\n"); printf("\t-C \tset cache size to .\n"); printf("\t-S \tset page size to .\n"); printf("\t-M\t\tuse shared memory pool (default do not use).\n"); printf("\t-z\t\tSet DB_COMPRESS flag\n"); printf("\t-R\t\tUse random number for numerical values\n"); printf("\n"); printf("\t-W\t\tuse WordList instead of raw Berkeley DB\n"); printf("\n"); printf("\t-f word\t\tfind word and display entries. If empty string show all.\n"); printf("\t-m\t\tMonitor Word classes activity\n"); printf("\n"); printf("\t-r n\t\tRemove first entries.\n"); printf("\n"); printf("\t-Z\t\tcompress blocks of existing dbfile.\n"); printf("\t-p n\t\ttest compress on first pages (default all pages).\n"); printf("\t-u\t\tuncompress each page & check with original (default don't uncompress).\n"); printf("\n"); printf("\t-l loop\t\tread the word file loop times (default 1).\n"); printf("\t-w file\t\tRead words list from file (default words.uniq).\n"); printf("\t-k n\t\tcreate entries for each word (default 1).\n"); printf("\t-n limit\tRead at most words (default read all).\n"); printf("\t-c count\tStart serial count at (default 0).\n"); exit(0); } #ifdef HAVE_LIBZ /* * Compress file one block after the other. Intended for mesuring the * compression overhead. */ extern "C" { extern int CDB___memp_cmpr_inflate(const u_int8_t *, int, u_int8_t * , int , void *); extern int CDB___memp_cmpr_deflate(const u_int8_t *, int, u_int8_t **, int *, void *); } int compressone(params_t* params, unsigned char* buffin, int buffin_length) { u_int8_t *buffout = 0; int buffout_length = 0; if(CDB___memp_cmpr_deflate(buffin, buffin_length, &buffout, &buffout_length,NULL) != 0) { printf("compressone: deflate failed\n"); abort(); } if(verbose) fprintf(stderr, "compressone: %d\n", buffout_length); if(params->uncompress) { u_int8_t *bufftmp = (u_int8_t*)malloc(buffin_length); int bufftmp_length = buffin_length; if(CDB___memp_cmpr_inflate(buffout, buffout_length, bufftmp, bufftmp_length,NULL) != 0) { fprintf(stderr, "compressone: inflate failed\n"); abort(); } if(bufftmp_length != buffin_length) abort(); if(memcmp(bufftmp, buffin, bufftmp_length)) abort(); free(bufftmp); } free(buffout); return buffout_length > (params->page_size / 2) ? 1 : 0; } #include // if included at top, db->open may have caused problems static void docompress(params_t* params) { if(params->page_size == 0) params->page_size = 4096; int in = open(params->dbfile, O_RDONLY); unsigned char* buffin = (unsigned char*)malloc(params->page_size); int read_count; int overflow = 0; int count = 0; while((read_count = read(in, buffin, params->page_size)) == params->page_size) { overflow += compressone(params, buffin, params->page_size); if(params->npage > 1 && params->npage <= count) break; count++; } printf("overflow: %d out of %d\n", overflow, count); close(in); } #endif /* HAVE_LIBZ */ htdig-3.2.0b6/test/document.cc0100644006314600127310000000532710055635561015504 0ustar angusgbhtdig// // document.cc // // document: Query the document database // // Part of the ht://Dig package // Copyright (c) 1995-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: document.cc,v 1.5 2004/05/28 13:15:29 lha Exp $ // #ifdef HAVE_CONFIG_H #include "htconfig.h" #endif /* HAVE_CONFIG_H */ #include #include #include #ifdef HAVE_STD #include #ifdef HAVE_NAMESPACES using namespace std; #endif #else #include #endif /* HAVE_STD */ // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif #include "defaults.h" #include "DocumentDB.h" typedef struct { char* config; int urls; int docids; } params_t; static void usage(); static void dodoc(params_t* params); static int verbose = 0; //***************************************************************************** // int main(int ac, char **av) // int main(int ac, char **av) { int c; extern char *optarg; params_t params; params.config = strdup("???"); params.urls = 0; params.docids = 0; while ((c = getopt(ac, av, "vudc:")) != -1) { switch (c) { case 'v': verbose++; break; case 'u': params.urls = 1; break; case 'd': params.docids = 1; break; case 'c': free(params.config); params.config = strdup(optarg); break; case '?': usage(); break; } } dodoc(¶ms); free(params.config); return 0; } static void dodoc(params_t* params) { HtConfiguration* const config= HtConfiguration::config(); config->Defaults(&defaults[0]); config->Read(params->config); DocumentDB docs; if(docs.Read(config->Find("doc_db"), config->Find("doc_index"), config->Find("doc_excerpt")) < 0) { cerr << "dodoc: cannot open\n"; exit(1); } List* docids = docs.DocIDs(); IntObject* docid = 0; for(docids->Start_Get(); (docid = (IntObject*)docids->Get_Next()); ) { if(params->docids) cout << docid->Value(); if(params->urls) { if(params->docids) cout << " "; DocumentRef* docref = docs[docid->Value()]; cout << docref->DocURL(); cout << "\n"; delete docref; } } delete docids; } //***************************************************************************** // void usage() // Display program usage information // static void usage() { cout << "usage: word [options]\n"; cout << "Options:\n"; cout << "\t-v\t\tIncreases the verbosity\n"; cout << "\t-u\t\tShow URLs\n"; cout << "\t-dl\t\tShow DocIDs\n"; cout << "\t-c file\tspecify the config file to load\n"; exit(0); } htdig-3.2.0b6/test/dummy.affixes0100644006314600127310000001000007766741211016046 0ustar angusgbhtdig# # $Id: dummy.affixes,v 1.1 2003/12/14 01:53:13 lha Exp $ # # Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All modifications to the source code must be clearly marked as # such. Binary redistributions based on modified source code # must be clearly marked as modified versions in the documentation # and/or other materials provided with the distribution. # 4. All advertising materials mentioning features or use of this software # must display the following acknowledgment: # This product includes software developed by Geoff Kuenning and # other unpaid contributors. # 5. The name of Geoff Kuenning may not be used to endorse or promote # products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # Affix table for English # # $Log: dummy.affixes,v $ # Revision 1.1 2003/12/14 01:53:13 lha # Add t_fuzzy t_templates t_validwords and t_factors to test suite # # Revision 1.1.1.1 1997/02/03 17:11:11 turtle # Initial CVS # # Revision 1.16 1995/01/08 23:23:59 geoff # Add a NeXT to the defstringtype statement so that nextispell can # select it. # # Revision 1.15 1994/01/25 07:12:40 geoff # Get rid of all old RCS log lines in preparation for the 3.1 release. # # nroffchars ().\\* texchars ()\[]{}<\>\\$*.% # First we declare the character set. Since it's English, it's easy. # The only special character is the apostrophe, so that possessives can # be handled. We declare it as a boundary character, so that quoting with # single quotes doesn't confuse things. The apostrophe is the only # character that gets such treatment. # # We declare the apostrophe first so that "Jon's" collates before "Jonas". # (This is the way ASCII does it). # defstringtype "nroff" "nroff" ".mm" ".ms" ".me" ".man" ".NeXT" boundarychars ' wordchars [a-z] [A-Z] altstringtype "tex" "tex" ".tex" ".bib" # Here's a record of flags used, in case you want to add new ones. # Right now, we fit within the minimal MASKBITS definition. # # ABCDEFGHIJKLMNOPQRSTUVWXYZ # Used: * * **** ** * ***** *** # A D GHIJ MN P RSTUV XYZ # Available: -- -- -- - - - # BC EF KL O Q W # Now the prefix table. There are only three prefixes that are truly # frequent in English, and none of them seem to need conditional variations. # prefixes flag *A: . > RE # As in enter > reenter flag *I: . > IN # As in disposed > indisposed flag *U: . > UN # As in natural > unnatural # Finally, the suffixes. These are exactly the suffixes that came out # with the original "ispell"; I haven't tried to improve them. The only # thing I did besides translate them was to add selected cross-product flags. # suffixes flag *R: . > RIGHT # As in copy > copyright htdig-3.2.0b6/test/dummy.stems0100644006314600127310000000000707766741211015562 0ustar angusgbhtdigcopy/R htdig-3.2.0b6/test/mifluz-search.conf0100644006314600127310000000111310055635561016764 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # wordlist_extend: true minimum_word_length: 1 maximum_word_length: 25 wordlist_cache_size: 10485760 wordlist_page_size: 32768 wordlist_compress: 0 wordlist_wordrecord_description: NONE wordlist_wordkey_description: Word/Tag 8/Server 8/URL 8/Location 8 wordlist_compress_debug: 0 wordlist_monitor: false htdig-3.2.0b6/test/mifluz.conf0100644006314600127310000000116510055635561015530 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # wordlist_extend: true minimum_word_length: 1 maximum_word_length: 25 wordlist_cache_size: 10485760 wordlist_page_size: 32768 wordlist_compress: 0 wordlist_wordrecord_description: NONE wordlist_wordkey_description: Word/DocID 32/Flags 8/Location 16 wordlist_compress_debug: 0 wordlist_monitor_period: 10 wordlist_monitor_output: monitor.out,rrd htdig-3.2.0b6/test/search.cc0100644006314600127310000026163010055635561015134 0ustar angusgbhtdig// // search.cc // // search: Sample implementation of search algorithms using // a mifluz inverted index. // // Each class is documented in the class definition. Before // each method declaration a comment explains the semantic of // the method. In the method definition comments in the code // may contain additional information. // // Each virtual function is documented in the base class, not // in the derived classes except for semantic differences. // // The class tree is: // // WordKeySemantic // // WordExclude // WordExcludeMask // WordPermute // // WordSearch // // WordMatch // // WordTree // WordTreeOperand // WordTreeOptional // WordTreeOr // WordTreeAnd // WordTreeNear // WordTreeMandatory // WordTreeNot // WordTreeLiteral // // WordParser // // Part of the ht://Dig package // Copyright (c) 1999-2004 The ht://Dig Group // For copyright details, see the file COPYING in your distribution // or the GNU Library General Public License (LGPL) version 2 or later // // // $Id: search.cc,v 1.9 2004/05/28 13:15:29 lha Exp $ // #ifdef HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ // If we have this, we probably want it. #ifdef HAVE_GETOPT_H #include #endif /* HAVE_GETOPT_H */ #ifdef HAVE_MALLOC_H #include #endif /* HAVE_MALLOC_H */ #include #include #include #include #include // // Verbosity level set with -v (++) // static int verbose = 0; // ************************* Document definition implementation *********** #define TAG 1 #define SERVER 2 #define URL 3 #define LOCATION 4 // *********************** WordKeySemantic implementation ******************** // // NAME // // encapsulate WordKey semantic for document and location // // SYNOPSIS // // #include // // #define SERVER 1 // #define URL 2 // #define LOCATION 3 // // static int document[] = { // SERVER, // URL // }; // // WordKeySemantic semantic; // semantic.Initialize(document, sizeof(document)/sizeof(int), LOCATION); // // DESCRIPTION // // Encapsulate the semantic of a WordKey object fields. It defines // what a document and a location are. It implements the set of // operation that a search needs to perform given the fact that it // implements a search whose purpose is to retrieve a document and // wants to implement proximity search based on a word location. // // // END // // A document is a set of fields in a given order. // A location is a field. // The actual fields used to implement WordKeySemantic methods are // set with the Initialize method. // class WordKeySemantic { public: WordKeySemantic(); ~WordKeySemantic(); //- // Set the actual field numbers that define what a document is and // what a location is. The document_arg is a list of WordKey field // positions of length document_length_arg that must be adjacent. // The location_arg is the WordKey field position of the word // location within a document. // Return OK on success, NOTOK on failure. // int Initialize(int* document_arg, int document_length_arg, int location_arg); // // These functions and only these know what a document is. // This should really be a class containing function pointers and be // given as argument to the search algorithm. // //- // Copy the document in from into to. // void DocumentSet(const WordKey& from, WordKey& to); //- // Increment the document in key using the SetToFollowing // method of WordKey. uniq is the WordKey position at which the // increment starts. // void DocumentNext(WordKey& key, int uniq); //- // Compare the document fields defined in both a and b // and return the difference a - b, as in strcmp. If all document // fields in a or b are undefined return 1. // int DocumentCompare(const WordKey& a, const WordKey& b); //- // Set all document fields to 0. // int DocumentClear(WordKey& key); // // These functions and only these know what a location is. // This should really be a class containing function pointers and be // given as argument to the search algorithm. // //- // Copy the document and location in from into to. // void LocationSet(const WordKey& from, WordKey& to); //- // Increment the document and location in key // using the SetToFollowing // method of WordKey. // void LocationNext(WordKey& key); //- // Compare expected location to actual location. Compares equal // as long as expected location is at a maximum distance of proximity // of actual. If actual only has undefined field, return > 0. // expected must always be the lowest possible bound. // actual is tolerated if it is greater than actual but not // greater than proximity if proximity > 0 or abs(proximity) * 2 if // proximity < 0. // Return the difference expected - actual. // int LocationCompare(const WordKey& expected, const WordKey& actual, int proximity = 0); //- // key is the expected location of a searched key. // LocationNearLowest modifies key to add tolerance accroding to // proximity. // // The idea is that key will be the lowest possible match for // for the proximity range. If is positive, key // is already the lowest possible match since we accept [0 proximity]. // If proximity is negative, substract it since we accept // [-proximity proximity]. // // For better understanding see the functions in which it is used. // void LocationNearLowest(WordKey& key, int proximity); //- // Undefined the location field in key.. // void Location2Document(WordKey& key); protected: int* document; int document_length; int location; }; WordKeySemantic::WordKeySemantic() { int nfields = WordKey::NFields(); document = new int[nfields]; document_length = 0; location = -1; } WordKeySemantic::~WordKeySemantic() { if(document) delete [] document; } int WordKeySemantic::Initialize(int* document_arg, int document_length_arg, int location_arg) { memcpy((char*)document, (char*)document_arg, document_length_arg * sizeof(int)); document_length = document_length_arg; location = location_arg; return OK; } void WordKeySemantic::DocumentSet(const WordKey& from, WordKey& to) { to.Clear(); for(int i = 0; i < document_length; i++) to.Set(document[i], from.Get(document[i])); } int WordKeySemantic::DocumentCompare(const WordKey& a, const WordKey& b) { int ret = 1; for(int i = 0; i < document_length; i++) { int idx = document[i]; if((a.IsDefined(idx) && b.IsDefined(idx)) && (ret = a.Get(idx) - b.Get(idx)) != 0) return ret; } return ret; } int WordKeySemantic::DocumentClear(WordKey& key) { for(int i = 0; i < document_length; i++) key.Set(document[i], 0); return 0; } void WordKeySemantic::DocumentNext(WordKey& key, int uniq) { if(uniq) key.SetToFollowing(uniq); else key.SetToFollowing(document[document_length-1]); } void WordKeySemantic::LocationSet(const WordKey& from, WordKey& to) { DocumentSet(from, to); to.Set(location, from.Get(location)); } int WordKeySemantic::LocationCompare(const WordKey& expected, const WordKey& actual, int proximity) { int ret = 1; if((ret = DocumentCompare(expected, actual)) != 0) return ret; // // Only compare location if defined. // if((expected.IsDefined(location) && actual.IsDefined(location)) && (ret = expected.Get(location) - actual.Get(location))) { if(proximity < 0) { // // -N means ok if in range [-N +N] // proximity *= 2; if(ret < 0 && ret >= proximity) ret = 0; } else { // // N means ok if in range [0 +N] // if(ret < 0 && ret >= -proximity) ret = 0; } } return ret; } void WordKeySemantic::LocationNext(WordKey& key) { key.SetToFollowing(location); } void WordKeySemantic::LocationNearLowest(WordKey& key, int proximity) { if(proximity < 0) { if(key.Underflow(location, proximity)) key.Get(location) = 0; else key.Get(location) += proximity; } } void WordKeySemantic::Location2Document(WordKey& key) { key.Undefined(location); } // ************************* WordExclude implementation ******************** // // NAME // // permute bits in bit field // // SYNOPSIS // // #include // // #define BITS 5 // // WordExclude permute; // permute.Initialize(BITS); // while(permute.Next() == WORD_EXCLUDE_OK) // ... // // DESCRIPTION // // Count from 1 to the specified maximum. A variable++ loop does the same. // The WordExclude class counts in a specific order. // It first step thru all the permutations containing only 1 bit set, in // increasing order. Then thru all the permutations containing 2 bits set, // in increasing order. As so forth until the maximum number is reached. // See the Permute method for more information. // // // END // // Helper that displays an unsigned int in binary/hexa/decimal // static inline void show_bits(unsigned int result) { int i; for(i = 0; i < 10; i++) { fprintf(stderr, "%c", (result & (1 << i)) ? '1' : '0'); } fprintf(stderr, " (0x%08x - %15d)\n", result, result); } // // WordExclude methods return values // #define WORD_EXCLUDE_OK 1 #define WORD_EXCLUDE_END 2 // // Maximum number of bits // #define WORD_EXCLUDE_MAX (sizeof(unsigned int) * 8) // // Convert a position

    in a bits mask into a bit offset (from 0) // #define WORD_EXCLUDE_POSITION2BIT(l,p) ((l) - (p) - 1) class WordExclude { public: //- // Reset the generator and prepare it for length bits generation. // The length cannot be greater than WORD_EXCLUDE_MAX. // Returns OK if no error occurs, NOTOK otherwise. // virtual int Initialize(unsigned int length); //- // Move to next exclude mask. Returns WORD_EXCLUDE_OK if successfull, // WORD_EXCLUDE_END if at the end of the permutations. It starts by // calling Permute with one bit set, then two and up to // Maxi() included. The last permutation only generates one // possibility since all the bits are set. // virtual int Next(); //- // Exclude bit for position starts at most significant bit. That is // position 0 exclude bit is most significant bit of the current mask. // Returns true if position is excluded, false otherwise. // virtual inline unsigned int Excluded(int position) { return mask & (1 << WORD_EXCLUDE_POSITION2BIT(maxi, position)); } //- // Returns how many bits are not excluded with current mask. // virtual inline int NotExcludedCount() const { return maxi - bits; } //- // Returns how many bits are excluded with current mask. // virtual inline int ExcludedCount() const { return bits; } // // Save and restore in string // //- // Write an ascii representation of the WordExclude object in buffer. // Each bit is represented by the character 0 or 1. The most significant // bit is the last character in the string. For instance // 1000 is the string representation of a WordExclude object initialized // with length = 4 after the first Next operation. // virtual void Get(String& buffer) const; //- // Initialize the object from the string representation in buffer. // Returns OK on success, NOTOK on failure. // virtual int Set(const String& buffer); //- // Generate all the permutations // containing n bits in a bits bit word in increasing order. // The mask argument is originally filled by the caller // with the n least significant bits set. A call to Permute // generates the next permutation immediately greater (numerically) // than the one contained in mask. // // Permute returns the next permutation or 0 if it reached the // maximum. // // To understand the algorithm, imagine 1 is a ball and 0 a space. // // When playing the game you start with a rack of bits slots filled // with n balls all on the left side. You end the game when all // the balls are on the right side. // // Sarting from the left, search for the first ball that has an empty // space to the right. While searching remove all the balls you find. // Place a ball in the empty space you found, at the right of the last // ball removed. Sarting from the left, fill all empty spaces with // the removed balls. Repeat until all balls are to the right. // // Here is a sample generated by repeated calls to WordExclude::Permute: // (left most bit is least significant) //

      // mask = 1111100000 
      // while(mask = WordExclude::Permute(mask, 7))
      //    show_bits(mask)
      //
      // 1111100000 (0x0000001f -              31)
      // 1111010000 (0x0000002f -              47)
      // 1110110000 (0x00000037 -              55)
      // 1101110000 (0x0000003b -              59)
      // 1011110000 (0x0000003d -              61)
      // 0111110000 (0x0000003e -              62)
      // 1111001000 (0x0000004f -              79)
      // 1110101000 (0x00000057 -              87)
      // 1101101000 (0x0000005b -              91)
      // 1011101000 (0x0000005d -              93)
      // 0111101000 (0x0000005e -              94)
      // 1110011000 (0x00000067 -             103)
      // 1101011000 (0x0000006b -             107)
      // 1011011000 (0x0000006d -             109)
      // 0111011000 (0x0000006e -             110)
      // 1100111000 (0x00000073 -             115)
      // 1010111000 (0x00000075 -             117)
      // 0110111000 (0x00000076 -             118)
      // 1001111000 (0x00000079 -             121)
      // 0101111000 (0x0000007a -             122)
      // 0011111000 (0x0000007c -             124)
      // 
    // A recursive implementation would be: //
      // /* Recursive */
      // void permute(unsigned int result, int bits_count, int bits_toset)
      // {
      //  if(bits_toset <= 0 || bits_count <= 0) {
      //    if(bits_toset <= 0)
      //      do_something(result);
      //  } else {
      //    permute(result, bits_count - 1, bits_toset);
      //    permute(result | (1 << (bits_count - 1)), bits_count - 1, bits_toset - 1);
      //  }
      // }
      // 
    // Which is more elegant but not practical at all in our case. // inline unsigned int Permute(unsigned int mask, unsigned int bits); //- // Return the current bit field value. // virtual inline unsigned int& Mask() { return mask; } virtual inline unsigned int Mask() const { return mask; } virtual inline unsigned int& Maxi() { return maxi; } virtual inline unsigned int Maxi() const { return maxi; } virtual inline unsigned int& Bits() { return bits; } virtual inline unsigned int Bits() const { return bits; } private: unsigned int mask; unsigned int maxi; unsigned int bits; }; int WordExclude::Initialize(unsigned int length) { if(length > WORD_EXCLUDE_MAX) { fprintf(stderr, "WordExclude::Initialize: length must be < %d\n", (int)WORD_EXCLUDE_MAX); return NOTOK; } mask = 0; bits = 0; maxi = length; return OK; } inline unsigned int WordExclude::Permute(unsigned int mask, unsigned int bits) { unsigned int bits_cleared = 0; unsigned int j; for(j = 0; j < bits; j++) { if(mask & (1 << j)) { bits_cleared++; mask &= ~(1 << j); } else { if(bits_cleared) { bits_cleared--; mask |= (1 << j); break; } } } if(j >= bits) return 0; for(j = 0; j < bits_cleared; j++) mask |= (1 << j); return mask; } int WordExclude::Next() { mask = Permute(mask, maxi); int ret = WORD_EXCLUDE_OK; if(mask == 0) { bits++; if(bits > maxi) ret = WORD_EXCLUDE_END; else { unsigned int i; for(i = 0; i < bits; i++) mask |= (1 << i); ret = WORD_EXCLUDE_OK; } } if(verbose > 2) show_bits(mask); return ret; } void WordExclude::Get(String& buffer) const { buffer.trunc(); unsigned int i; for(i = 0; i < maxi; i++) { buffer << ((mask & (1 << i)) ? '1' : '0'); } } int WordExclude::Set(const String& buffer) { if(Initialize(buffer.length()) == NOTOK) return NOTOK; unsigned int i; for(i = 0; i < maxi; i++) { if(buffer[i] == '1') { mask |= (1 << i); bits++; } } return OK; } // ************************* WordExcludeMask implementation ******************* // // NAME // // WordExclude specialization that ignore some bits // // SYNOPSIS // // #include // // #define BITS 9 // #define IGNORE 0x0f0 // #define IGNORE_MASK 0x050 // // WordExcludeMask permute; // permute.Initialize(BITS, IGNORE, IGNORE_MASK); // while(permute.Next() == WORD_EXCLUDE_OK) // ... // // DESCRIPTION // // Only perform WordExclude operations on the bits that are not set in // ignore. The bits of ignore_mask that are set in // ignore are untouched. In the synopsis section, for instance, // bits 1,2,3,4 and 9 will be permuted and the bits 5,6,7,8 will be // left untouched. // // // END // #define WORD_EXCLUDE_IGNORED (-1) class WordExcludeMask : public WordExclude { public: //- // ignore gives the mask of bits to ignore. The actual WordExclude // operations are made on a number of bits that is length - (the number // of bits set in ignore). // The ignore_mask_arg contains the actual values of the bits ignored by // the ignore argument. // virtual inline int Initialize(unsigned int length, unsigned int ignore, unsigned int ignore_mask_arg) { ignore_mask = ignore_mask_arg; ignore_maxi = length; unsigned int maxi = 0; unsigned int i; for(i = 0, ignore_bits = 0; i < length; i++) { if(ignore & (1 << i)) { bit2bit[i] = WORD_EXCLUDE_IGNORED; if(ignore_mask & (1 << i)) ignore_bits++; } else { bit2bit[i] = maxi++; } } return WordExclude::Initialize(maxi); } virtual inline unsigned int Excluded(int position) { position = WORD_EXCLUDE_POSITION2BIT(ignore_maxi, position); if(bit2bit[position] == WORD_EXCLUDE_IGNORED) return ignore_mask & (1 << position); else return WordExclude::Mask() & (1 << bit2bit[position]); } virtual inline int NotExcludedCount() const { return ignore_maxi - ignore_bits - WordExclude::Bits(); } virtual inline int ExcludedCount() const { return ignore_bits - WordExclude::Bits(); } //- // The semantic is the same as the Get method of Wordexclude // except that ignored bits are assigned 3 and 2 instead of 1 and 0 // respectively. // virtual void Get(String& buffer) const; //- // The semantic is the same as the Get method of Wordexclude // except that ignored bits are assigned 3 and 2 instead of 1 and 0 // respectively. // virtual int Set(const String& buffer); virtual inline unsigned int Mask() const { unsigned int ret = ignore_mask; unsigned int i; for(i = 0; i < ignore_maxi; i++) { if(bit2bit[i] != WORD_EXCLUDE_IGNORED) { if(WordExclude::Mask() & (1 << bit2bit[i])) ret |= (1 << i); } } return ret; } virtual inline unsigned int Maxi() const { return ignore_maxi; } virtual inline unsigned int Bits() const { return ignore_bits + WordExclude::Bits(); } private: unsigned int ignore_mask; unsigned int ignore_maxi; unsigned int ignore_bits; int bit2bit[WORD_EXCLUDE_MAX]; }; void WordExcludeMask::Get(String& buffer) const { buffer.trunc(); unsigned int i; for(i = 0; i < ignore_maxi; i++) { if(bit2bit[i] == WORD_EXCLUDE_IGNORED) buffer << ((ignore_mask & (1 << i)) ? '3' : '2'); else buffer << ((WordExclude::Mask() & (1 << bit2bit[i])) ? '1' : '0'); } } int WordExcludeMask::Set(const String& buffer) { WordExclude::Initialize(0); unsigned int& maxi = WordExclude::Maxi(); unsigned int& mask = WordExclude::Mask(); unsigned int& bits = WordExclude::Bits(); ignore_mask = 0; ignore_bits = 0; ignore_maxi = buffer.length(); unsigned int i; for(i = 0; i < ignore_maxi; i++) { if(buffer[i] == '1' || buffer[i] == '0') { if(buffer[i] == '1') { mask |= (1 << maxi); bits++; } bit2bit[i] = maxi; maxi++; } else if(buffer[i] == '3' || buffer[i] == '2') { if(buffer[i] == '3') { ignore_mask |= (1 << i); ignore_bits++; } bit2bit[i] = WORD_EXCLUDE_IGNORED; } } return OK; } // ************************* WordPermute implementation ******************** // // NAME // // WordExclude specialization with proximity toggle // // SYNOPSIS // // #include // // #define BITS 5 // // WordPermute permute; // permute.Initialize(BITS); // while(permute.Next() == WORD_EXCLUDE_OK) // if(permute.UseProximity()) ... // // DESCRIPTION // // Each WordExclude permutation is used twice by Next. Once with // the proximity flag set and once with the proximity flag cleared. // If the length of the bit field (length argument of Initialize) is // lower or equal to 1, then the proximity flag is always false. // // // END // // WordPermute methods return values // #define WORD_PERMUTE_OK WORD_EXCLUDE_OK #define WORD_PERMUTE_END WORD_EXCLUDE_END // // Use or don't use proximity flag // #define WORD_PERMUTE_PROXIMITY_NO 0 #define WORD_PERMUTE_PROXIMITY_TOGGLE 1 #define WORD_PERMUTE_PROXIMITY_ONLY 2 // // Deals with word exclusion and proximity permutations for // the implementation of the Optional retrieval model. // class WordPermute : public WordExcludeMask { public: //- // The nuse_proximity may be set to the following: // // WORD_PERMUTE_PROXIMITY_NO so that the object behaves as // WordExcludeMask and Proximity() always return false. // // WORD_PERMUTE_PROXIMITY_TOGGLE so that each permutation is issued twice: // once with the proximity flag set (Proximity() method) and once with // the proximity flag cleared. // // WORD_PERMUTE_PROXIMITY_ONLY so that the object behaves as // WordExcludeMask and Proximity() always return true. // virtual inline int Initialize(unsigned int length, unsigned int ignore, unsigned int ignore_mask_arg, int nuse_proximity) { use_proximity = nuse_proximity; switch(use_proximity) { case WORD_PERMUTE_PROXIMITY_NO: proximity = 0; break; case WORD_PERMUTE_PROXIMITY_TOGGLE: // // Don't bother to try proximity search if only one word // is involved. // proximity = length > 1; break; case WORD_PERMUTE_PROXIMITY_ONLY: proximity = 1; break; default: fprintf(stderr, "WordPermute::Initialize: unexpected use_proximity = %d\n", use_proximity); return 0; } return WordExcludeMask::Initialize(length, ignore, ignore_mask_arg); } //- // Return true if the proximity flag is set, false if it is // cleared. // inline int Proximity() { switch(use_proximity) { case WORD_PERMUTE_PROXIMITY_NO: return 0; break; case WORD_PERMUTE_PROXIMITY_TOGGLE: return proximity; break; case WORD_PERMUTE_PROXIMITY_ONLY: return 1; break; default: fprintf(stderr, "WordPermute::Proximity: unexpected use_proximity = %d\n", use_proximity); return 0; break; } } //- // Return WORD_PERMUTE_PROXIMITY_NO, WORD_PERMUTE_PROXIMITY_TOGGLE or // WORD_PERMUTE_PROXIMITY_ONLY. // inline int UseProximity() { return use_proximity; } //- // Find the next permutation. If WORD_PERMUTE_PROXIMITY_TOGGLE was // specified in Initialize each permutation is issued twice (see // Proximity() to differentiate them), except when the mask // only contains one non exluded bit (NotExcludeCount() <= 1). // In both case the last permutation with all bits excluded // (i.e. when NotExcludedCount() <= 0) is never returned because // it is useless. // virtual int Next() { if(Maxi() <= 0) return WORD_PERMUTE_END; int ret = WORD_PERMUTE_OK; int check_useless = 0; if(use_proximity == WORD_PERMUTE_PROXIMITY_TOGGLE) { // // Move to next permutation as follows: // exclude mask 1 + use proximity // exclude mask 1 + don't use proximity // exclude mask 2 + use proximity // exclude mask 2 + don't use proximity // and so on. // If only one word is involved never use proximity. // if(proximity) { proximity = 0; } else { proximity = 1; if((ret = WordExcludeMask::Next()) == WORD_PERMUTE_OK) { // // Do not toggle proximity for only one non excluded word // if(NotExcludedCount() <= 1) proximity = 0; check_useless = 1; } else if(ret == WORD_PERMUTE_END) proximity = 0; } } else { ret = WordExcludeMask::Next(); check_useless = 1; } if(check_useless && ret == WORD_PERMUTE_OK) { // // If no bits are ignored or all ignore_mask bits are set to // one, the last permutation has all exclude bits set, which // is useless. Just skip it and expect to be at the end of // all permutations. // if(NotExcludedCount() <= 0) { ret = WordExcludeMask::Next(); if(ret != WORD_PERMUTE_END) { fprintf(stderr, "WordPermute::Next: expected WORD_PERMUTE_END\n"); ret = NOTOK; } } } return ret; } //- // The semantic is the same as the Get method of Wordexclude // but a letter T is appended to the string if the proximity // flag is set, or F is appended to the string if the proximity // is clear. // virtual inline void Get(String& buffer) const { WordExcludeMask::Get(buffer); if(use_proximity == WORD_PERMUTE_PROXIMITY_TOGGLE) buffer << (proximity ? 'T' : 'F'); } //- // The semantic is the same as the Get method of Wordexclude // but if the string end with a T the proximity flag is set // and if the string end with a F the proximity flag is cleared. // virtual inline int Set(const String& buffer) { if(buffer.length() < 1) { fprintf(stderr, "WordPermute::Set: buffer length < 1\n"); return NOTOK; } int ret = OK; if(use_proximity == WORD_PERMUTE_PROXIMITY_TOGGLE) { if((ret = WordExcludeMask::Set(buffer.sub(0, buffer.length() - 1))) == OK) proximity = buffer.last() == 'T'; } else { ret = WordExcludeMask::Set(buffer); } return ret; } protected: int use_proximity; int proximity; }; // ************************* WordTree implementation ******************** // // NAME // // Base class for query resolution nodes // // SYNOPSIS // // #include // // class WordTreeMethod : public WordTree { // ... // }; // // DESCRIPTION // // The WordTree class is derived from the WordCursor class and implement // the basic operations and data structures needed for query resolution. // It is the common base class of all the classes that actually implement // a query resolution. The derived classes must be implemented to follow // the WordCursor semantic for Walk* operations. // // // END // #define WORD_WALK_REDO 0x1000 #define WORD_WALK_RESTART 0x2000 #define WORD_WALK_NEXT 0x4000 // // Return values of CursorsObeyProximity method // #define WORD_SEARCH_NOPROXIMITY 1 // // operand values // #define WORD_TREE_OR 1 #define WORD_TREE_AND 2 #define WORD_TREE_NEAR 3 #define WORD_TREE_OPTIONAL 4 #define WORD_TREE_LITERAL 5 #define WORD_TREE_MANDATORY 6 #define WORD_TREE_NOT 7 #define WORD_TREE_OP_SIZE 20 // // Default proximity is to search for adjacent words in order // #ifndef WORD_SEARCH_DEFAULT_PROXIMITY #define WORD_SEARCH_DEFAULT_PROXIMITY 1 #endif /* WORD_SEARCH_DEFAULT_PROXIMITY */ static char* operator_name[WORD_TREE_OP_SIZE] = { "", "or", "and", "near", "optional", "literal", "mandatory", "not", 0 }; class WordTree : public WordCursor { public: WordTree() { proximity = 0; uniq = 0; } virtual int ContextSaveList(StringList& list) const { return OK; } virtual int ContextRestoreList(StringList& list) { return OK; } //- // Initialize the object. words is used to initialize the // WordCursor base class, document, document_length and // location are used to initialize the WordKeySemantic data // member. The nuniq is the WordKey field position used by // the WordKeySemantic::DocumentNext function. The nproximity // is the proximity factor used by the WordKeySemantic::LocationCompare // method. // Return OK on success, NOTOK on failure. // virtual int Prepare(WordList *words, int nuniq, int nproximity, int *document, int document_length, int location) { int ret; proximity = nproximity; uniq = nuniq; if((ret = key_semantic.Initialize(document, document_length, location)) != OK) return ret; WordKey key; if(!scope.empty()) { if(key.Set(scope) != OK) { fprintf(stderr, "WordTree::Prepare: setting scope %s failed\n", (char*)scope); return NOTOK; } } key.SetWord(search); return WordCursor::Initialize(words, key, 0, 0, HTDIG_WORDLIST_WALKER); } //- // Return a copy of the last document found. // WordKey GetDocument() { WordKey found; key_semantic.DocumentSet(GetFound().Key(), found); return found; } //- // Store in the info data member textual information about // the latest match found. // virtual void SetInfo() { info = GetFound().Key().GetWord(); } //- // Return a copy of the info data member. Should be // called after SetInfo(). // String GetInfo() { return info; } //- // Sort WordTree data members (if any) in ascending frequency order. // Return OK on success, NOTOK on failure. // virtual int AscendingFrequency() { return OK; } //- // Delete WordTree data members (if any) that have a zero frequency. // The number of data members deleted is returned in stripped. // Return OK on success, NOTOK on failure. // virtual int StripNonExistent(unsigned int& stripped) { stripped = 0; return OK; } // // Input // //- // Proximity factor. See WordKeySemantic::LocationCompare. // int proximity; //- // Uniq WordKey field position. See WordKeySemantic::DocumentNext. // int uniq; //- // Semantic of the WordKey object. // WordKeySemantic key_semantic; //- // Textual representation of the search scope. // String scope; //- // Original search criterion that may be different from the // WordCursor::searchKey data member. // String search; // // Internal state // //- // Textual information about the latest match. // String info; }; // ************************* WordTreeLiteral implementation **************** class WordTreeLiteral : public WordTree { public: //- // Constructor. The search criterion is string and the // scope is nscope.. // WordTreeLiteral(const char* string, const char* nscope = "") { search.set((char*)string); scope.set((char*)nscope); } //- // Returns WORD_TREE_LITERAL. // int IsA() const { return WORD_TREE_LITERAL; } virtual int WalkRewind(); //- // Only return a match for each distinct document. // virtual int WalkNext(); virtual int Seek(const WordKey& patch); //- // If scope is set the bufferout is filled with //
      // ( word "scope" )
      // 
    // otherwise the bufferout only contains the word. // virtual int Get(String& bufferout) const { if(scope.empty()) bufferout << search; else bufferout << "( " << operator_name[IsA()] << " \"" << scope << "\" " << search << " )"; return OK; } protected: WordKey current_document; }; int WordTreeLiteral::WalkRewind() { current_document.Clear(); return WordCursor::WalkRewind(); } int WordTreeLiteral::WalkNext() { int ret; do { ret = WordCursor::WalkNext(); if(verbose > 3) fprintf(stderr, "WordTreeLiteral::WalkNext: reached %s\n", (char*)GetDocument().Get()); } while(ret == OK && key_semantic.DocumentCompare(current_document, GetDocument()) == 0); if(ret == OK) current_document = GetDocument(); else current_document.Clear(); return ret; } int WordTreeLiteral::Seek(const WordKey& position) { current_document.Clear(); return WordCursor::Seek(position); } // ************************* WordTreeOperand implementation **************** // // NAME // // Base class for boolean query resolution nodes // // SYNOPSIS // // #include // // class WordTreeMethod : public WordTreeOperand { // ... // }; // // DESCRIPTION // // The WordTreeOperand class is derived from WordTree and implemet // the basic operations and data structures needed for query resultion // of boolean operators. It contains a list of WordTree objects (the // operands or cursors) and redefine the basic WordCursor methods // to operate on all of them according to the logic defined by the // derived class. // // // END // // // Helper for debugging that returns the string representation // of the return codes. // static char* ret2str(int ret) { if(ret == WORD_WALK_REDO) return "REDO"; if(ret == WORD_WALK_RESTART) return "RESTART"; if(ret == WORD_WALK_NEXT) return "NEXT"; if(ret == OK) return "OK"; if(ret == NOTOK) return "NOTOK"; if(ret == WORD_WALK_ATEND) return "ATEND"; return "???"; } class WordTreeOperand : public WordTree { public: //- // Constructor. The scope is nscope. // WordTreeOperand(const char* nscope) { scope.set((char*)nscope); } //- // Free the objects pointed by cursors with delete as well // as the cursors array itself with delete []. // virtual ~WordTreeOperand(); virtual void Clear() { cursors = 0; cursors_length = 0; WordCursor::Clear(); } //- // Recursively call Optimize on each cursors. // virtual int Optimize(); //- // Change the permutation data member ignore mask according // to WORD_TREE_MANDATORY and WORD_TREE_NOT nodes found in // cursors. MANDATORY and NOT nodes are reduced (replaced // by their first child cursor. For each MANDATORY and NOT nodes // the bit (see WordExcludeMask for information) // corresponding to their position is ignored (set in the ignore // argument of the WordExcludeMask::Initialize function. For NOT // nodes, the bit corresponding to their position is set in // the ignore_mask of the WordExcludeMask::Initialize function // (i.e. implementing a not operation). // The proximity argument may be WORD_PERMUTE_PROXIMITY_TOGGLE or // WORD_PERMUTE_PROXIMITY_NO. // Returns OK on success, NOTOK on failure. // int OptimizeOr(int proximity); virtual int ContextSave(String& buffer) const { StringList list; int ret; if((ret = ContextSaveList(list)) != OK) return ret; buffer.trunc(); String* element; list.Start_Get(); while((element = (String*)list.Get_Next())) { buffer << (*element) << ';'; } // // Trim last ; // buffer.chop(1); return OK; } virtual int ContextSaveList(StringList& list) const { // // Apply to each cursor // unsigned int i; for(i = 0; i < cursors_length; i++) if(cursors[i]->ContextSaveList(list) == NOTOK) return NOTOK; return OK; } virtual int ContextRestore(const String& buffer) { if(!buffer.empty()) { StringList list(buffer, ";"); return ContextRestoreList(list); } else { return OK; } } virtual int ContextRestoreList(StringList& list) { // // Apply to each cursor // unsigned int i; for(i = 0; i < cursors_length; i++) if(cursors[i]->ContextRestoreList(list) == NOTOK) return NOTOK; return OK; } //- // Recursively call WalkInit on each cursors. // virtual int WalkInit(); //- // Recursively call WalkRewind on each cursors. // Reset the pos data member with WordKeySemantic::DocumentClear. // virtual int WalkRewind(); //- // Recursively call WalkFinish on each cursors. // virtual int WalkFinish(); //- // Recursively call Seek on each cursors. // Save the patch argument in the pos data // member. // virtual int Seek(const WordKey& patch); //- // The number of occurrence of a WordTreeOperand is the sum of the // number of occurrence of each term. // virtual int Noccurrence(unsigned int& noccurrence) const { noccurrence = 0; unsigned int i; for(i = 0; i < cursors_length; i++) { unsigned int frequency; if(cursors[i]->Noccurrence(frequency) != OK) return NOTOK; noccurrence += frequency; } return OK; } //- // The bufferout argument is filled with a lisp like representation // of the tree starting at this node. // virtual int Get(String& bufferout) const { bufferout << "( " << operator_name[IsA()] << " \"" << scope << "\" "; unsigned int i; for(i = 0; i < cursors_length; i++) bufferout << cursors[i]->Get() << " "; bufferout << " )"; return OK; } //- // Call Prepare on each cursors. Set the search member // with an textual representation of the tree starting at this node. // virtual int Prepare(WordList *words, int nuniq, int nproximity, int *document, int document_length, int location) { int ret; if((ret = WordTree::Prepare(words, nuniq, nproximity, document, document_length, location)) != OK) return ret; unsigned int i; for(i = 0; i < cursors_length; i++) { if((ret = cursors[i]->Prepare(words, nuniq, nproximity, document, document_length, location)) != OK) return ret; } return Get(GetSearch().GetWord()); } //- // The current cursor offset (set by Seek for instance). It // duplicates the function of the WordCursor key data member // because the data type is different (WordKey instead of String). // WordKey pos; //- // Sub nodes array. // WordTree** cursors; //- // Number of valid entries in the cursors member. // unsigned int cursors_length; //- // Permutation generator with proximity toggle // WordPermute permutation; }; WordTreeOperand::~WordTreeOperand() { if(cursors) { unsigned int i; for(i = 0; i < cursors_length; i++) delete cursors[i]; free(cursors); } } int WordTreeOperand::Optimize() { // // Apply to each cursor // unsigned int i; for(i = 0; i < cursors_length; i++) if(cursors[i]->Optimize() == NOTOK) return NOTOK; return OK; } int WordTreeOperand::OptimizeOr(int proximity) { unsigned int ignore = 0; unsigned int ignore_mask = 0; unsigned int i; for(i = 0; i < cursors_length; i++) { int reduce; // // Set ignore & ignore_mask if cursor is NOT or MANDATORY // switch(cursors[i]->IsA()) { case WORD_TREE_MANDATORY: ignore |= (1 << WORD_EXCLUDE_POSITION2BIT(cursors_length, i)); reduce = 1; break; case WORD_TREE_NOT: ignore |= (1 << WORD_EXCLUDE_POSITION2BIT(cursors_length, i)); ignore_mask |= (1 << WORD_EXCLUDE_POSITION2BIT(cursors_length, i)); reduce = 1; break; default: reduce = 0; break; } // // Replace the NOT or MANDATORY node by its only child // if(reduce) { WordTreeOperand* old = (WordTreeOperand*)cursors[i]; cursors[i] = old->cursors[0]; old->cursors[0] = 0; old->cursors_length--; if(old->cursors_length > 0) { fprintf(stderr, "WordTreeOptional::OptimizeOr: too many cursors\n"); return NOTOK; } delete old; } } return permutation.Initialize(cursors_length, ignore, ignore_mask, proximity); } int WordTreeOperand::WalkInit() { unsigned int i; int ret = WORD_WALK_ATEND; for(i = 0; i < cursors_length; i++) if((ret = cursors[i]->WalkInit()) != OK) return ret; return (status = ret); } int WordTreeOperand::WalkRewind() { unsigned int i; int ret = OK; for(i = 0; i < cursors_length; i++) if((ret = cursors[i]->WalkRewind()) != OK) return ret; status = OK; key_semantic.DocumentClear(pos); cursor_get_flags = DB_SET_RANGE; found.Clear(); return ret; } int WordTreeOperand::WalkFinish() { unsigned int i; int ret = OK; for(i = 0; i < cursors_length; i++) if((ret = cursors[i]->WalkFinish()) != OK) return ret; return ret; } int WordTreeOperand::Seek(const WordKey& patch) { pos.CopyFrom(patch); cursor_get_flags = DB_SET_RANGE; unsigned int i; int ret = OK; for(i = 0; i < cursors_length; i++) if((ret = cursors[i]->Seek(patch)) != OK && ret != WORD_WALK_ATEND) return ret; status = OK; return OK; } // ************************* WordTreeOptional implementation **************** class WordTreeOptional : public WordTreeOperand { public: WordTreeOptional(const char* nscope) : WordTreeOperand(nscope) { } //- // Return WORD_TREE_OPTIONAL // virtual int IsA() const { return WORD_TREE_OPTIONAL; } virtual int Optimize(); virtual int ContextSaveList(StringList& list) const; virtual int ContextRestoreList(StringList& list); //- // Multipass walk of the occurrences according to the permutation // data member specifications. First search for documents containing // all occurrences near to each other. Then documents that // contain all occurrences far appart. Then ignore the most frequent // search criterion and search for documents that contain all the others // near to each other. The logic goes on until there only remains the // most frequent word. // virtual int WalkNext(); //- // Only seek the first non excluded cursor. The implementation // of WalkNext makes it useless to seek the others. // virtual int Seek(const WordKey& position); virtual int Prepare(WordList *words, int nuniq, int nproximity, int *document, int document_length, int location) { int ret; if((ret = permutation.Initialize(cursors_length, 0, 0, WORD_PERMUTE_PROXIMITY_TOGGLE)) != OK) return ret; return WordTreeOperand::Prepare(words, nuniq, nproximity, document, document_length, location); } virtual void SetInfo(); virtual int UseProximity() const { return WORD_PERMUTE_PROXIMITY_TOGGLE; } virtual int UsePermutation() const { return 1; } //- // Returns true if all cursors must have a frequency > 0, false otherwise. // virtual int AllOrNothing() const { return 0; } //- // Comparison between cursor and constraint is made // with WordKeySemantic::LocationCompare using the proximity // argument. If master is NULL it is set to point to // cursor. // // Return WORD_WALK_NEXT if cursor is at constraint and // set constraint if cursor is master. // // Return WORD_WALK_REDO if cursor is above constraint and // call cursor.WalkNext(). // // Return WORD_WALK_RESTART if cursor is below constraint and // set constraint from cursor using // WordKeySemantic::DocumentSet if cursor is not master // otherwise also set location of constraint using // WordKeySemantic::LocationSet and call WordKeySemantic::LocationNext // on constraint. // // Return WORD_WALK_ATEND if no more match possible. // // Return NOTOK on failure. // int SearchCursorNear(WordTree& cursor, WordTree*& master, WordKey& constraint, int proximity); //- // Comparison between cursor and document is made // with WordKeySemantic::DocumentCompare. // // Return WORD_WALK_NEXT if cursor is above document. // // Return WORD_WALK_REDO if cursor is below document // and call cursor.WalkNext(). // // Return WORD_WALK_RESTART if cursor is at document // and call WordKeySemantic::DocumentNext method on document. // // Return WORD_WALK_ATEND if no more match possible. // // Return NOTOK on failure. // int SearchCursorNot(WordTree& cursor, WordKey& document); //- // Comparison between cursor and document is made // with WordKeySemantic::DocumentCompare. // // Return WORD_WALK_NEXT if cursor is at document.. // // Return WORD_WALK_REDO if cursor is below document // // Return WORD_WALK_RESTART if cursor is above document // and call WordKeySemantic::DocumentNext method on document. // // Return WORD_WALK_ATEND if no more match possible. // // Return NOTOK on failure. // // int SearchCursorAnd(WordTree& cursor, WordKey& document, WordExclude& permutation); // // We know that : // 1) document does not contain any excluded words. // 2) contains at least one occurrence of each non excluded word. // The logic, although very similar to WordSearchNear::SearchOne // is therefore simpler. We ignore all excluded cursors and // return WORD_SEARCH_NOPROXIMITY as soon as a cursor move outside // . // //- // If document contains words that match proximity // requirement, return OK. Return WORD_SEARCH_NOPROXIMITY if proximity // requirement cannot be matched for . // int CursorsObeyProximity(WordKey& document); //- // Sort the cursors in ascending frequency order using the // Noccurrence method on each cursor. // Return OK on success, NOTOK on failure. // virtual int AscendingFrequency(); //- // Delete all elements of the cursors array that have a // zero frequency. The cursors array is shrinked and the // cursors_length set accordingly. Returns the number of // deletions in the stripped
    argument. // Return OK on success, NOTOK on failure. // virtual int StripNonExistent(unsigned int& stripped); }; int WordTreeOptional::Optimize() { int ret; if((ret = WordTreeOperand::Optimize()) != OK) return ret; if(UseProximity() != WORD_PERMUTE_PROXIMITY_ONLY) { if((ret = AscendingFrequency()) != OK) return ret; } unsigned int stripped; if((ret = StripNonExistent(stripped)) != OK) return ret; if(AllOrNothing() && stripped) { // // One word is missing and everything is lost, // Just kill the remaining cursors. // unsigned int i; for(i = 0; i < cursors_length; i++) delete cursors[i]; cursors_length = 0; return OK; } else { return OptimizeOr(UseProximity()); } } int WordTreeOptional::ContextSaveList(StringList& list) const { int ret; if((ret = WordTreeOperand::ContextSaveList(list)) != OK) return ret; if(UsePermutation()) { String* buffer = new String(); permutation.Get(*buffer); list.Add(buffer); } { String* buffer = new String(); if((ret = WordCursor::ContextSave(*buffer)) != OK) return ret; list.Add(buffer); } return OK; } int WordTreeOptional::ContextRestoreList(StringList& list) { int ret; if((ret = WordTreeOperand::ContextRestoreList(list)) != OK) return ret; if(UsePermutation()) { char* buffer = list[0]; if((ret = permutation.Set(buffer)) != OK) return ret; list.Remove(0); } { char* buffer = list[0]; if(!buffer) return NOTOK; WordKey key(buffer); if((ret = Seek(key)) != OK) return ret; cursor_get_flags = DB_NEXT; list.Remove(0); } return OK; } int WordTreeOptional::WalkNext() { WordKey& constraint = pos; // // Set constraint with all 0 // if(constraint.Empty()) key_semantic.DocumentClear(constraint); // // Advance cursors to next constraint, if not at the // beginning of the search. // int ret = OK; int match_ok = 0; do { // // Advance cursors so that next call fetches another constraint // if(cursor_get_flags == DB_NEXT) key_semantic.DocumentNext(constraint, uniq); if((ret = Seek(constraint)) != OK) return ret; int near = permutation.Proximity(); WordTree* first = 0; for(unsigned int i = 0; i < cursors_length;) { WordTree& cursor = *(cursors[i]); near = permutation.Proximity(); int excluded = permutation.Excluded(i); if(verbose) fprintf(stderr, "WordTreeOptional::WalkNext: %s excluded = %s, proximity = %s\n", (char*)cursor.GetSearch().GetWord(), (excluded ? "yes" : "no"), (near ? "yes" : "no" )); int ret; if(excluded) { ret = SearchCursorNot(cursor, constraint); if(verbose > 2) fprintf(stderr, "WordTreeOptional::WalkNext: Not -> %s\n", ret2str(ret)); } else { if(near) { ret = SearchCursorNear(cursor, first, constraint, proximity); if(verbose > 2) fprintf(stderr, "WordTreeOptional::WalkNext: Near -> %s\n", ret2str(ret)); } else { ret = SearchCursorAnd(cursor, constraint, permutation); if(verbose > 2) fprintf(stderr, "WordTreeOptional::WalkNext: And -> %s\n", ret2str(ret)); } } switch(ret) { case WORD_WALK_ATEND: if(UsePermutation()) { // // The search is over with this permutation, try another one. // switch(permutation.Next()) { // // No permutations left, the end // case WORD_PERMUTE_END: return (status = WORD_WALK_ATEND); break; // // Sart over with this permutation // case WORD_PERMUTE_OK: if(WalkRewind() != OK) return NOTOK; break; } first = 0; i = 0; } else { return (status = WORD_WALK_ATEND); } break; case WORD_WALK_REDO: break; case WORD_WALK_RESTART: first = 0; i = 0; break; case WORD_WALK_NEXT: i++; break; case NOTOK: default: return ret; break; } } cursor_get_flags = DB_NEXT; SetInfo(); // // Save possible result, i.e. first non excluded cursor // for(unsigned int i = 0; i < cursors_length; i++) { WordTree& cursor = *(cursors[i]); if(!permutation.Excluded(i)) { found.Key().CopyFrom(cursor.GetFound().Key()); break; } } match_ok = 1; // // Only bother if near and non near search are involved // if(UseProximity() == WORD_PERMUTE_PROXIMITY_TOGGLE) { // // If we reach this point in the function and // either proximity search is active or there is // only one word involved, the match is valid. // Otherwise it may be excluded, see below. // if(!near && permutation.NotExcludedCount() > 1) { // // If not using proximity, a match that fits the proximity // requirements must be skipped because it was matched by // the previous permutation (see WordPermute). // switch(CursorsObeyProximity(constraint)) { case OK: match_ok = 0; break; case WORD_SEARCH_NOPROXIMITY: match_ok = 1; break; default: case NOTOK: return NOTOK; break; } } } } while(!match_ok && ret == OK); return ret; } int WordTreeOptional::Seek(const WordKey& position) { pos.CopyFrom(position); cursor_get_flags = DB_SET_RANGE; status = OK; unsigned int i; for(i = 0; i < cursors_length; i++) { if(!permutation.Excluded(i)) { WordTree& cursor = *(cursors[i]); return cursor.Seek(position); } } fprintf(stderr, "WordTreeOptional::Seek: failed\n"); return NOTOK; } void WordTreeOptional::SetInfo() { unsigned int i; for(i = 0; i < cursors_length; i++) cursors[i]->SetInfo(); info.trunc(); for(i = 0; i < cursors_length; i++) { WordTree& cursor = *(cursors[i]); if(!permutation.Excluded(i)) info << cursor.info << " "; } info << (permutation.Proximity() ? "proximity" : ""); } int WordTreeOptional::SearchCursorNear(WordTree& cursor, WordTree*& master, WordKey& constraint, int proximity) { int is_master = master == 0 || master == &cursor; if(master == 0) master = &cursor; const WordKey& masterKey = master->GetFound().Key(); int direction = key_semantic.LocationCompare(constraint, cursor.GetFound().Key(), proximity); if(verbose > 2) fprintf(stderr, "WordTreeOptional::SearchCursorNear: LocationCompare(\n\t%s,\n\t%s)\n\t = %d\n", (char*)(constraint.Get()), (char*)(cursor.GetFound().Key().Get()), direction); // // If the cursor is in the authorized locations, consider // next cursor // if(direction == 0) { // // master cursor makes the rules for location : its location // is the base to calculate other words mandatory loacations. // if(is_master) key_semantic.LocationSet(cursor.GetFound().Key(), constraint); // // Fix location constraint to accomodate proximity tolerance. // key_semantic.LocationNearLowest(constraint, proximity); return WORD_WALK_NEXT; // // If current location is above cursor location // } else if(direction > 0) { // // Move the cursor up to the location. // cursor.Seek(constraint); if(verbose > 1) fprintf(stderr, "WordTreeOptional::SearchCursorNear: leap to %s\n", (char*)constraint.Get()); int ret; if((ret = cursor.WalkNext()) == OK) { // // Remove the location constraint for the master word // so that it matches and then enforce location for other // keys. // if(is_master) key_semantic.Location2Document(constraint); // // Reconsider the situation for this cursor // return WORD_WALK_REDO; } else { return ret; } // // If current location is lower than cursor location, // meaning that the cursor found no match for the current // location. // } else if(direction < 0) { // // The cursor document becomes the current document. // The master cursor is forced to catch up. // key_semantic.DocumentSet(cursor.GetDocument(), constraint); // // It is possible that this cursor document is the same // as the master cursor document (if this cursor hit in the // same document but a higher location). In this case we must // increase the location of the master cursor otherwise it will // match without moving and loop forever. // if(!is_master && key_semantic.DocumentCompare(masterKey, constraint) == 0) { key_semantic.LocationSet(masterKey, constraint); key_semantic.LocationNext(constraint); } // // Since the current location changed, start over. // return WORD_WALK_RESTART; } else { fprintf(stderr, "WordTreeOptional::WordCursorNear: reached unreachable statement\n"); return NOTOK; } return NOTOK; } int WordTreeOptional::SearchCursorNot(WordTree& cursor, WordKey& document) { int direction = key_semantic.DocumentCompare(document, cursor.GetFound().Key()); if(verbose > 2) fprintf(stderr, "WordTreeOptional::SearchCursorNot: DocumentCompare(\n\t%s,\n\t%s)\n\t = %d\n", (char*)(document.Get()), (char*)(cursor.GetFound().Key().Get()), direction); // // If the cursor is above the current document // (being at the end of walk is being above all documents). // // Means that the cursor is positioned in an acceptable document // and proceed to the next cursor. // if(direction < 0 || cursor.IsAtEnd()) { return WORD_WALK_NEXT; // // If the cursor is below current document // } else if(direction > 0) { // // Move the cursor up to the document // cursor.Seek(document); if(verbose > 1) fprintf(stderr, "WordTreeOptional::SearchCursorNot: leap to %s\n", (char*)document.Get()); int ret; if((ret = cursor.WalkNext()) != OK && ret != WORD_WALK_ATEND) return NOTOK; // // It is expected in this case that the cursor has moved above // the current document and another visit in the loop will // tell us. // return WORD_WALK_REDO; // // If the cursor matches the current document. // // Means that the current document is not a possible match // since it is pointed by this cursor. // } else if(direction == 0) { // // The cursor does not give any hint on a possible // next document, just go to the next possible one. // key_semantic.DocumentNext(document, uniq); // // Since the current document changed, start over. // return WORD_WALK_RESTART; } else { fprintf(stderr, "WordTreeOptional::WordCursorNot: reached unreachable statement\n"); return NOTOK; } return NOTOK; } int WordTreeOptional::SearchCursorAnd(WordTree& cursor, WordKey& document, WordExclude& permutation) { int direction = key_semantic.DocumentCompare(document, cursor.GetFound().Key()); if(verbose > 2) fprintf(stderr, "WordTreeOptional::SearchCursorAnd: DocumentCompare(\n\t%s,\n\t%s)\n\t = %d\n", (char*)(document.Get()), (char*)(cursor.GetFound().Key().Get()), direction); // // If the cursor is in the current document. // // Means that the cursor is positioned in an acceptable document // and proceed to the next cursor. // if(direction == 0) { return WORD_WALK_NEXT; // // If the cursor is below current document // } else if(direction > 0) { // // Move the cursor up to the document // cursor.Seek(document); if(verbose > 1) fprintf(stderr, "WordTreeOptional::SearchCursorAnd: leap to %s\n", (char*)document.Get()); int ret; if((ret = cursor.WalkNext()) == OK) return WORD_WALK_REDO; else return ret; // // If the cursor is above current document. // // Means the the current document is not a possible match // since it will never reach it because it's already // above it. // } else if(direction < 0) { // // The cursor document becomes the current document. // key_semantic.DocumentSet(cursor.GetDocument(), document); // // Since the current document changed, start over. // return WORD_WALK_RESTART; } else { fprintf(stderr, "WordTreeOptional::WordCursorAnd: reached unreachable statement\n"); return NOTOK; } return NOTOK; } int WordTreeOptional::CursorsObeyProximity(WordKey& document) { // // Run if more than one word is involved, proximity // is always true if there is only one word. // if(permutation.NotExcludedCount() <= 1) return OK; WordKey location; // // The first non excluded cursor contains anchor location. // unsigned int master_index = 0; for(unsigned int i = 0; i < cursors_length; i++) { if(!permutation.Excluded(i)) { master_index = i; break; } } const WordKey& masterKey = cursors[master_index]->GetFound().Key(); key_semantic.DocumentSet(masterKey, location); for(unsigned int i = 0; i < cursors_length;) { if(permutation.Excluded(i)) { i++; continue; } WordTree& cursor = *(cursors[i]); if(cursor.IsAtEnd()) return WORD_SEARCH_NOPROXIMITY; // if(cursor.status & WORD_WALK_FAILED) return NOTOK; // // If the cursor moved outside of the tested document, // no proximity match is possible. // if(key_semantic.DocumentCompare(cursor.GetFound().Key(), document) != 0) return WORD_SEARCH_NOPROXIMITY; int direction = key_semantic.LocationCompare(location, cursor.GetFound().Key(), proximity); // // If the cursor is in the authorized locations, consider // next cursor // if(direction == 0) { // // master cursor makes the rules for location : its location // is the base to calculate other words mandatory loacations. // if(i == master_index) key_semantic.LocationSet(cursor.GetFound().Key(), location); // // Fix location constraint to accomodate proximity tolerance. // key_semantic.LocationNearLowest(location, proximity); i++; // // If current location is greater than cursor location // } else if(direction > 0) { // // Move the cursor up to the location. // cursor.Seek(location); if(verbose > 1) fprintf(stderr, "WordTreeOptional::CursorsObeyProximity: leap to %s\n", (char*)location.Get()); int ret; if((ret = cursor.WalkNext()) != OK) { if(ret == WORD_WALK_ATEND) { return WORD_SEARCH_NOPROXIMITY; } else { return NOTOK; } } // // Remove the location constraint for the master word // so that it matches and then enforce location for other // keys. // if(i == master_index) key_semantic.Location2Document(location); // // Reconsider the situation for this cursor // // // If current location is lower than cursor location, // meaning that the cursor found no match in the current // document. // } else if(direction < 0) { // // Move to next master key, if possible. // if(i != master_index) { key_semantic.LocationSet(masterKey, location); key_semantic.LocationNext(location); } // // Since the current location changed, start over. // i = 0; } } return OK; } // // Helper class for AscendingFrequency method // class WordSort { public: unsigned int frequency; WordTree *cursor; }; // // Helper function for AscendingFrequency method // static int ascending_frequency(const void *a, const void *b) { const WordSort& a_cursor = *(WordSort*)a; const WordSort& b_cursor = *(WordSort*)b; return a_cursor.frequency - b_cursor.frequency; } int WordTreeOptional::AscendingFrequency() { // // Reorder cursors // WordSort *tmp = new WordSort[cursors_length]; memset((char*)tmp, '\0', cursors_length * sizeof(WordSort)); unsigned int i; for(i = 0; i < cursors_length; i++) { unsigned int frequency; if(cursors[i]->Noccurrence(frequency) != OK) { delete [] tmp; return NOTOK; } if(verbose > 2) fprintf(stderr, "WordTreeOptional::AscendingFrequency: %s occurs %d times\n", (char*)cursors[i]->GetSearch().Get(), frequency); tmp[i].frequency = frequency; tmp[i].cursor = cursors[i]; } memset((char*)cursors, '\0', cursors_length * sizeof(WordTree*)); qsort((void *)tmp, cursors_length, sizeof(WordSort), &ascending_frequency); for(i = 0; i < cursors_length; i++) cursors[i] = tmp[i].cursor; delete [] tmp; return OK; } int WordTreeOptional::StripNonExistent(unsigned int& stripped) { stripped = 0; WordTree** tmp = new WordTree*[cursors_length]; memset((char*)tmp, '\0', cursors_length * sizeof(WordTree*)); unsigned int from; unsigned int to; for(to = from = 0; from < cursors_length; from++) { unsigned int frequency; if(cursors[from]->Noccurrence(frequency) != OK) { delete [] tmp; return NOTOK; } if(verbose > 2) fprintf(stderr, "WordTreeOptional::StripNonExistent: %s occurs %d times\n", (char*)cursors[from]->GetSearch().Get(), frequency); if(frequency > 0) { tmp[to++] = cursors[from]; } else { delete cursors[from]; stripped++; } } memset((char*)cursors, '\0', cursors_length * sizeof(WordTree*)); cursors_length = to; unsigned int i; for(i = 0; i < cursors_length; i++) cursors[i] = tmp[i]; delete [] tmp; return OK; } // ************************* WordTreeOr implementation ******************** class WordTreeOr : public WordTreeOperand { public: WordTreeOr(const char* nscope) : WordTreeOperand(nscope) { } //- // Return WORD_TREE_OR // virtual int IsA() const { return WORD_TREE_OR; } virtual int Optimize(); virtual int ContextSaveList(StringList& list) const; virtual int ContextRestoreList(StringList& list); virtual void SetInfo(); virtual int WalkNext(); virtual int UsePermutation() const { return 0; } virtual int UseProximity() const { return WORD_PERMUTE_PROXIMITY_NO; } }; int WordTreeOr::Optimize() { int ret; if((ret = WordTreeOperand::Optimize()) != OK) return ret; if((ret = AscendingFrequency()) != OK) return ret; unsigned int stripped; if((ret = StripNonExistent(stripped)) != OK) return ret; return OptimizeOr(WORD_PERMUTE_PROXIMITY_NO); } int WordTreeOr::ContextSaveList(StringList& list) const { int ret; if((ret = WordTreeOperand::ContextSaveList(list)) != OK) return ret; { String* buffer = new String(); permutation.Get(*buffer); list.Add(buffer); } { String* buffer = new String(); if((ret = WordCursor::ContextSave(*buffer)) != OK) return ret; list.Add(buffer); } return OK; } int WordTreeOr::ContextRestoreList(StringList& list) { int ret; if((ret = WordTreeOperand::ContextRestoreList(list)) != OK) return ret; { char* buffer = list[0]; if((ret = permutation.Set(buffer)) != OK) return ret; list.Remove(0); } { char* buffer = list[0]; if(!buffer) return NOTOK; WordKey key(buffer); if((ret = Seek(key)) != OK) return ret; cursor_get_flags = DB_NEXT; list.Remove(0); } return OK; } void WordTreeOr::SetInfo() { unsigned int i; for(i = 0; i < cursors_length; i++) cursors[i]->SetInfo(); info.trunc(); for(i = 0; i < cursors_length; i++) { WordTree& cursor = *(cursors[i]); if(!permutation.Excluded(i) && !cursor.IsAtEnd() && key_semantic.DocumentCompare(cursor.GetFound().Key(), GetFound().Key()) == 0) { info << cursor.info << " "; } } } int WordTreeOr::WalkNext() { WordKey& constraint = pos; // // Set constraint with all 0 // if(constraint.Empty()) key_semantic.DocumentClear(constraint); WordKey candidate; int match_ok; do { int ret; unsigned int i; candidate.Clear(); // // Advance cursors so that next call fetches another constraint // if(cursor_get_flags == DB_NEXT) key_semantic.DocumentNext(constraint, uniq); if((ret = Seek(constraint)) != OK) return ret; match_ok = 1; // // All non excluded cursors are about to move // at or beyond constraint. Search for the one (candidate) that // is located at the lowest location beyond the constraint. // for(i = 0; i < cursors_length; i++) { if(permutation.Excluded(i)) continue; WordTree& cursor = *(cursors[i]); switch((ret = cursor.WalkNext())) { case WORD_WALK_ATEND: // // Constraint is above all matches for this cursor // break; case OK: // // If candidate is not set or current cursor is below // the current candidate, the curent cursor document becomes // the candidate. // if(candidate.Empty() || key_semantic.DocumentCompare(candidate, cursor.GetFound().Key()) > 0) { key_semantic.DocumentSet(cursor.GetDocument(), candidate); } break; default: return ret; break; } } // // No candidate ? It's the end of the match list. // if(candidate.Empty()) return WORD_WALK_ATEND; found.Key().CopyFrom(candidate); SetInfo(); if(permutation.ExcludedCount() > 0) { if((ret = Seek(candidate)) != OK) return ret; // // Restart loop if candidate matches an excluded cursor. // for(i = 0; i < cursors_length && match_ok; i++) { if(!permutation.Excluded(i)) continue; WordTree& cursor = *(cursors[i]); switch((ret = cursor.WalkNext())) { case WORD_WALK_ATEND: // // This excluded cursor can't match the candidate, fine. // break; case OK: // // This excluded cursor matches candidate therefore it's // not a valid candidate. Restart search with this candidate // as the constraint. // if(key_semantic.DocumentCompare(candidate, cursor.GetFound().Key()) == 0) { constraint = candidate; match_ok = 0; } break; default: return ret; break; } } } cursor_get_flags = DB_NEXT; } while(!match_ok); constraint = candidate; return OK; } // ************************* WordTreeAnd implementation ******************** class WordTreeAnd : public WordTreeOptional { public: WordTreeAnd(const char* nscope) : WordTreeOptional(nscope) { } //- // Return WORD_TREE_AND // virtual int IsA() const { return WORD_TREE_AND; } virtual int UsePermutation() const { return 0; } virtual int UseProximity() const { return WORD_PERMUTE_PROXIMITY_NO; } virtual int AllOrNothing() const { return 1; } }; // ************************* WordTreeNear implementation ******************** class WordTreeNear : public WordTreeOptional { public: WordTreeNear(const char* nscope) : WordTreeOptional(nscope) { } //- // Return WORD_TREE_NEAR // virtual int IsA() const { return WORD_TREE_NEAR; } virtual int UsePermutation() const { return 0; } virtual int UseProximity() const { return WORD_PERMUTE_PROXIMITY_ONLY; } virtual int AllOrNothing() const { return 1; } }; // ************************* WordTreeMandatory implementation *************** class WordTreeMandatory : public WordTreeOperand { public: WordTreeMandatory(const char* nscope) : WordTreeOperand(nscope) { } //- // Return WORD_TREE_MANDATORY // virtual int IsA() const { return WORD_TREE_MANDATORY; } }; // ************************* WordTreeNot implementation *************** class WordTreeNot : public WordTreeOperand { public: WordTreeNot(const char* nscope) : WordTreeOperand(nscope) { } //- // Return WORD_TREE_NOT // virtual int IsA() const { return WORD_TREE_NOT; } }; // ************************* WordMatch implementation ******************** // // Return value of the Search method, tells us which document // matched and why. // class WordMatch { public: //- // Return a textual representation of the object. // String Get() const; //- // The document that matched // WordKey match; //- // An ascii description of why it matched. // String info; }; String WordMatch::Get() const { String tmp; match.Get(tmp); if(!info.empty()) tmp << "(" << info << ")"; return tmp; } // ************************* WordSearch implementation ******************** // // NAME // // Solve a query from a WordTree syntax tree // // SYNOPSIS // // #include // // WordTree* expr = get_query(); // WordSearch search; // search.limit_count = NUMBER_OF_RESULTS; // WordMatch* search.Search(expr); // ... // // DESCRIPTION // // The WordSearch class is a wrapper to query an inverted index // using a WordTree syntax tree. // // END // class WordSearch { public: WordSearch(); //- // Perform a search from the expr specifications. // Restore the context from context_in on expr. // Then skip (using WalkNext) limit_bottom entries. // Then collect in a WordMatch array of size limit_count // each match returned by WalkNext. When finished store // the context (ContextSave) in context_out. // It is the responsibility of the caller to free the WordMatch // array. If no match are found a null pointer is returned. // WordMatch *Search(); // // Search backend, only run the WalkNext loop but does not // allocate/deallocate data. // int SearchLoop(WordTree *expr); // // Return a context description string to resume the // search at a given point. // const String& Context() const { return context_out; } // // Input // unsigned int limit_bottom; unsigned int limit_count; String context_in; WordTree* expr; // // Output // WordMatch* matches; unsigned int matches_size; unsigned int matches_length; String context_out; }; WordSearch::WordSearch() { // // Input // limit_bottom = 0; limit_count = 0; context_in.trunc(); expr = 0; // // Output // matches = 0; matches_size = 0; matches_length = 0; context_out.trunc(); } WordMatch *WordSearch::Search() { int ret = 0; if(verbose) fprintf(stderr, "WordSearch::Search: non optimized expression %s\n", (char*)expr->Get()); if(expr->Optimize() != OK) return 0; if(verbose) fprintf(stderr, "WordSearch::Search: optimized expression %s\n", (char*)expr->Get()); // // Build space for results // matches_size = limit_count + 1; matches = new WordMatch[matches_size]; matches_length = 0; // // Move to first possible position. // if(expr->WalkInit() != OK) goto end; if(expr->ContextRestore(context_in) == NOTOK) goto end; ret = SearchLoop(expr); // // Don't bother saving the context if at end of // search (WORD_WALK_ATEND) or error (NOTOK) // if(ret == OK && expr->ContextSave(context_out) == NOTOK) goto end; end: expr->WalkFinish(); if(ret == NOTOK || matches_length <= 0) { delete [] matches; matches = 0; } return matches; } int WordSearch::SearchLoop(WordTree *expr) { int ret = OK; unsigned int i; // // Skip the first documents // { for(i = 0; i < limit_bottom; i++) { if((ret = expr->WalkNext()) != OK) return ret; } } // // Get documents up to or exhaustion // for(matches_length = 0; matches_length < limit_count; matches_length++) { if((ret = expr->WalkNext()) != OK) { break; } else { matches[matches_length].match = expr->GetDocument(); if(expr->IsA() != WORD_TREE_LITERAL) matches[matches_length].info = ((WordTreeOperand*)expr)->GetInfo(); if(verbose) fprintf(stderr, "WordSearch::Search: match %s\n", (char*)matches[matches_length].match.Get()); } } if(ret == WORD_WALK_ATEND) matches[matches_length].match.Clear(); return ret; } // ************************* WordParser implementation ******************** // // NAME // // Textual query parser for test purpose // // SYNOPSIS // // #include // // WordParser parser; // WordTree* expr = parser.Parse("( or \"scope1\" a query )"); // ... // delete expr; // // DESCRIPTION // // The WordParser class implement a lisp-like parser for queries // implemented by the WordTree derived classes. The syntax is rigid // and should not be used for human input. The generic syntax of an // expression is //
    // ( operator "scope" operand [operand ...] )
    // 
    // The parenthesis must always be surrounded by white space otherwise // the parser will be lost. The separator is white space and newline. // Tabulation may be used in scope to separate key fields. // // As a special case a single word is strictly equivalent // to //
    // ( literal "" word )
    // 
    // // Operators can be lower case or upper case. There is almost no syntax // checking and it's the responsibility of the caller to associate meaningfull // operands. For instance ( near ( not foo ) bar ) is meaningless. // // OPERATORS // //
    // //
    optional //
    WordTreeOptional // //
    or //
    WordTreeOr // //
    and //
    WordTreeAnd // //
    near //
    WordTreeNear // //
    not,forbiden //
    WordTreeNot // //
    mandatory //
    WordTreeMandatory // //
    literal //
    WordTreeLiteral // //
    // // // END // // Possible values of the info argument of ParseOperands // #define WORD_TREE_MANY 0x01 #define WORD_TREE_ONE 0x02 #define WORD_TREE_TWO 0x04 class WordParser { public: WordTree *Parse(const String& expr); WordTree *ParseList(StringList& terms); WordTree *ParseExpr(StringList& terms); WordTree *ParseUnary(StringList& terms); WordTree *ParseConj(StringList& terms); void ParseOperands(StringList& terms, int info, WordTreeOperand* expr); WordTree *ParseLiteral(StringList& terms); char *ParseScope(StringList& terms); void Shift(StringList& terms); char *Term(StringList& terms); }; WordTree *WordParser::Parse(const String& expr) { StringList terms(expr, " \n"); return ParseList(terms); } WordTree *WordParser::ParseList(StringList& terms) { WordTree *expr = ParseExpr(terms); return expr; } WordTree *WordParser::ParseExpr(StringList& terms) { WordTree *expr = 0; char* term = strdup(Term(terms)); if(!strcmp(term, "(")) { Shift(terms); expr = ParseExpr(terms); } else if(!strcmp(term, ")")) { // // At end of expression, return null // } else if(!mystrcasecmp(term, "optional") || !mystrcasecmp(term, "or") || !mystrcasecmp(term, "and") || !mystrcasecmp(term, "near")) { expr = ParseConj(terms); } else if(!mystrcasecmp(term, "not") || !mystrcasecmp(term, "mandatory") || !mystrcasecmp(term, "forbiden")) { expr = ParseUnary(terms); } else { expr = ParseLiteral(terms); } free(term); return expr; } WordTree *WordParser::ParseUnary(StringList& terms) { int op = 0; if(!mystrcasecmp(Term(terms), "mandatory")) op = WORD_TREE_MANDATORY; else if(!mystrcasecmp(Term(terms), "forbiden") || !mystrcasecmp(Term(terms), "not")) op = WORD_TREE_NOT; Shift(terms); char* scope = ParseScope(terms); WordTreeOperand *expr = 0; switch(op) { case WORD_TREE_MANDATORY: expr = new WordTreeMandatory(scope); break; case WORD_TREE_NOT: expr = new WordTreeNot(scope); break; default: fprintf(stderr, "WordParser::ParseUnary: unexpected operator %d\n", op); exit(1); break; } free(scope); ParseOperands(terms, WORD_TREE_ONE, expr); return expr; } WordTree *WordParser::ParseConj(StringList& terms) { int op = 0; if(!mystrcasecmp(Term(terms), "optional")) op = WORD_TREE_OPTIONAL; else if(!mystrcasecmp(Term(terms), "or")) op = WORD_TREE_OR; else if(!mystrcasecmp(Term(terms), "and")) op = WORD_TREE_AND; else if(!mystrcasecmp(Term(terms), "near")) op = WORD_TREE_NEAR; Shift(terms); char* scope = ParseScope(terms); WordTreeOperand *expr = 0; switch(op) { case WORD_TREE_OR: expr = new WordTreeOr(scope); break; case WORD_TREE_OPTIONAL: expr = new WordTreeOptional(scope); break; case WORD_TREE_AND: expr = new WordTreeAnd(scope); break; case WORD_TREE_NEAR: expr = new WordTreeNear(scope); break; default: fprintf(stderr, "WordParser::ParseOrAnd: unexpected operator %d\n", op); exit(1); break; } free(scope); ParseOperands(terms, WORD_TREE_MANY, expr); return expr; } void WordParser::ParseOperands(StringList& terms, int info, WordTreeOperand* expr) { unsigned int operands_length = 0; unsigned int operands_size = 1; WordTree **operands = (WordTree**)malloc(operands_size * sizeof(WordTree*)); WordTree *subexpr = 0; while((subexpr = ParseExpr(terms))) { operands_length++; if((info & WORD_TREE_ONE) && operands_length > 1) { fprintf(stderr, "WordParser::ParseOperands: expected only one operands\n"); exit(1); } else if((info & WORD_TREE_TWO) && operands_length > 2) { fprintf(stderr, "WordParser::ParseOperands: expected only two operands\n"); exit(1); } if(operands_length > operands_size) { operands_size = operands_length * 2; operands = (WordTree**)realloc(operands, operands_size * sizeof(WordTree*)); } operands[operands_length - 1] = subexpr; } // // Discard close parenthesis // if(strcmp(Term(terms), ")")) { fprintf(stderr, "WordParser::ParseOperands: expected close parenthesis\n"); exit(1); } Shift(terms); expr->cursors = operands; expr->cursors_length = operands_length; } WordTree *WordParser::ParseLiteral(StringList& terms) { char* term = strdup(Term(terms)); char* scope = 0; if(!mystrcasecmp(term, "literal")) { Shift(terms); scope = ParseScope(terms); free(term); term = strdup(Term(terms)); Shift(terms); } else { scope = strdup(""); } WordTreeLiteral *expr = new WordTreeLiteral(term, scope); Shift(terms); free(scope); free(term); return expr; } char *WordParser::ParseScope(StringList& terms) { char *scope = Term(terms); int scope_length = strlen(scope); // // Remove surrounding quotes, if any // if(scope_length > 0) { if(scope[scope_length - 1] == '"') scope[--scope_length] = '\0'; if(scope[0] == '"') scope++; } scope = strdup(scope); Shift(terms); return scope; } char *WordParser::Term(StringList& terms) { char *term = terms[0]; if(!term) { fprintf(stderr, "WordParser::Term: unexpected end of expression\n"); exit(1); } return term; } void WordParser::Shift(StringList& terms) { terms.Shift(LIST_REMOVE_DESTROY); } // ************************* main loop implementation ******************** // // Store all options from the command line // class params_t { public: char* dbfile; char* find; unsigned int bottom; unsigned int count; char* context; int uniq_server; int proximity; int nop; int exclude; }; // // Explain options // static void usage(); // // Torture WordExclude* classes // static void exclude_test(); int main(int ac, char **av) { int c; extern char *optarg; params_t params; params.dbfile = strdup("test"); params.find = 0; params.bottom = 0; params.count = 10; params.context = 0; params.uniq_server = 0; params.proximity = WORD_SEARCH_DEFAULT_PROXIMITY; params.nop = 0; params.exclude = 0; while ((c = getopt(ac, av, "vB:f:b:c:C:SP:ne")) != -1) { switch (c) { case 'v': verbose++; break; case 'B': free(params.dbfile); params.dbfile = strdup(optarg); break; case 'f': params.find = strdup(optarg); break; case 'b': params.bottom = (unsigned int)atoi(optarg); break; case 'c': params.count = (unsigned int)atoi(optarg); break; case 'C': params.context = strdup(optarg); break; case 'P': params.proximity = atoi(optarg); break; case 'S': params.uniq_server = SERVER; break; case 'n': params.nop = 1; break; case 'e': params.exclude = 1; break; case '?': usage(); break; } } if(params.exclude) { exclude_test(); exit(0); } if(!params.find) usage(); Configuration* config = WordContext::Initialize(); if(!config) { fprintf(stderr, "search: no config file found\n"); exit(1); } // // Forward command line verbosity to htword library. // if(verbose > 1) { String tmp; tmp << (verbose - 1); config->Add("wordlist_verbose", tmp); } // // Prepare the index (-B). // WordList words(*config); words.Open(params.dbfile, O_RDONLY); // // Try the query parser alone // if(params.nop) { WordTree* expr = WordParser().Parse(params.find); printf("%s\n", (char*)expr->Get()); exit(0); } // // Build a syntax tree from the expression provided by user // WordTree* expr = WordParser().Parse(params.find); // // Define the semantic of the key // { #define DOCUMENT_LENGTH 3 static int document[DOCUMENT_LENGTH] = { TAG, SERVER, URL }; int document_length = DOCUMENT_LENGTH; int location = LOCATION; if(expr->Prepare(&words, params.uniq_server, params.proximity, document, document_length, location) != OK) exit(1); } WordSearch* search = new WordSearch(); // // Forward query options to WordSearch object // search->limit_bottom = params.bottom; // -b search->limit_count = params.count; // -c if(params.context) // -C search->context_in.set(params.context, strlen(params.context)); // // Perform the search (-f) // search->expr = expr; WordMatch* matches = search->Search(); // // Display results, if any. // if(matches) { int i; for(i = 0; !matches[i].match.Empty(); i++) printf("match: %s\n", (char*)matches[i].Get()); const String& context = search->Context(); if(!context.empty()) printf("context: %s\n", (const char*)context); delete [] matches; } else { printf("match: none\n"); } // // Cleanup // delete search; if(params.context) free(params.context); if(params.find) free(params.find); if(params.dbfile) free(params.dbfile); delete expr; words.Close(); delete config; } static void exclude_test() { static unsigned int expected[] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000003, 0x00000005, 0x00000006, 0x00000009, 0x0000000a, 0x0000000c, 0x00000011, 0x00000012, 0x00000014, 0x00000018, 0x00000007, 0x0000000b, 0x0000000d, 0x0000000e, 0x00000013, 0x00000015, 0x00000016, 0x00000019, 0x0000001a, 0x0000001c, 0x0000000f, 0x00000017, 0x0000001b, 0x0000001d, 0x0000001e, 0x0000001f }; // // WordExclude // if(verbose) fprintf(stderr, "exclude_test: testing WordExclude\n"); { WordExclude exclude; exclude.Initialize(5); int count = 0; while(exclude.Next() == WORD_EXCLUDE_OK) { if(expected[count] != exclude.Mask()) { fprintf(stderr, "exclude_test: WordExclude iteration %d expected 0x%08x but got 0x%08x\n", count, expected[count], exclude.Mask()); exit(1); } count++; } if(count != sizeof(expected)/sizeof(unsigned int)) { fprintf(stderr, "exclude_test: WordExclude expected %d iterations but got %d\n", (int)(sizeof(expected)/sizeof(unsigned int)), count); exit(1); } } // // WordExcludeMask without ignore bits behaves exactly the same // as WordExclude. // if(verbose) fprintf(stderr, "exclude_test: testing WordExcludeMask behaving like WordExclude\n"); { WordExcludeMask exclude; exclude.Initialize(5, 0, 0); int count = 0; while(exclude.Next() == WORD_EXCLUDE_OK) { if(expected[count] != exclude.Mask()) { fprintf(stderr, "exclude_test: WordExcludeMask 1 iteration %d expected 0x%08x but got 0x%08x\n", count, expected[count], exclude.Mask()); exit(1); } count++; } if(count != sizeof(expected)/sizeof(unsigned int)) { fprintf(stderr, "exclude_test: WordExcludeMask 1 expected %d iterations but got %d\n", (int)(sizeof(expected)/sizeof(unsigned int)), count); exit(1); } } // // WordExcludeMask // if(verbose) fprintf(stderr, "exclude_test: testing WordExcludeMask\n"); { static unsigned int expected[] = { 0x00000102, 0x00000108, 0x00000120, 0x00000180, 0x0000010a, 0x00000122, 0x00000128, 0x00000182, 0x00000188, 0x000001a0, 0x0000012a, 0x0000018a, 0x000001a2, 0x000001a8, 0x000001aa }; static unsigned int excluded[] = { 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1 }; WordExcludeMask exclude; unsigned int ignore = 0x155; unsigned int ignore_mask = 0x100; exclude.Initialize(9, ignore, ignore_mask); if(verbose) { fprintf(stderr, "exclude_test: ignore\n"); show_bits(ignore); fprintf(stderr, "exclude_test: ignore_mask\n"); show_bits(ignore_mask); } if(exclude.NotExcludedCount() != 8) { fprintf(stderr, "exclude_test: WordExcludeMask 2 expected NoExcludedCount = 8 but got %d\n", exclude.NotExcludedCount()); exit(1); } int count = 0; while(exclude.Next() == WORD_EXCLUDE_OK) { if(expected[count] != exclude.Mask()) { fprintf(stderr, "exclude_test: WordExcludeMask 2 iteration %d expected 0x%08x but got 0x%08x\n", count, expected[count], exclude.Mask()); exit(1); } // // Test Excluded() method on ignored bit // Is bit 5 set ? (9 - 4) = 5 (counting from 1) // if(exclude.Excluded(4)) { fprintf(stderr, "exclude_test: WordExcludeMask 2 iteration %d bit 5 was set 0x%08x\n", count, exclude.Mask()); exit(1); } // // Test Excluded() method on variable bit // Is bit 2 set ? (9 - 2) = 7 (counting from 1) // if((exclude.Excluded(7) && !excluded[count]) || (!exclude.Excluded(7) && excluded[count])) { fprintf(stderr, "exclude_test: WordExcludeMask 2 iteration %d expected bit 2 %s but was %s in 0x%08x\n", count, (excluded[count] ? "set" : "not set"), (excluded[count] ? "not set" : "set"), expected[count]); exit(1); } count++; } if(count != sizeof(expected)/sizeof(unsigned int)) { fprintf(stderr, "exclude_test: WordExcludeMask 2 expected %d iterations but got %d\n", (int)(sizeof(expected)/sizeof(unsigned int)), count); exit(1); } } { WordExclude exclude; String ascii("110101"); String tmp; exclude.Set(ascii); exclude.Get(tmp); if(tmp != ascii) { fprintf(stderr, "exclude_test: WordExclude::Get/Set expected %s but got %s\n", (char*)ascii, (char*)tmp); exit(1); } if(exclude.Mask() != 0x2b) { fprintf(stderr, "exclude_test: WordExclude::Mask expected 0x2b but got 0x%02x\n", exclude.Mask()); exit(1); } } { WordExcludeMask exclude; String ascii("12031"); String tmp; exclude.Set(ascii); exclude.Get(tmp); if(tmp != ascii) { fprintf(stderr, "exclude_test: WordExcludeMask::Get/Set expected %s but got %s\n", (char*)ascii, (char*)tmp); exit(1); } if(exclude.Mask() != 0x19) { fprintf(stderr, "exclude_test: WordExcludeMask::Mask expected 0x19 but got 0x%02x\n", exclude.Mask()); exit(1); } } } // ***************************************************************************** // void usage() // Display program usage information // static void usage() { printf("usage:\tsearch -f words [options]\n"); printf("\tsearch -e\n"); printf("Options:\n"); printf("\t-v\t\tIncreases the verbosity.\n"); printf("\t-B dbfile\tUse as a db file name (default test).\n"); printf("\t-f expr\t\tLisp like search expression.\n"); printf("\t\t\tSee WordParser comments in source for more information.\n"); printf("\t-b number\tSkip number documents before retrieving.\n"); printf("\t-c number\tRetrieve number documents at most.\n"); printf("\t-n\t\tOnly parse the search expression and print it.\n"); printf("\t-P proximity\tUse with near/optional, proximity tolerance is \n"); printf("\t\t\tif negative order of terms is not meaningful\n"); printf("\t\t\t(default 1).\n"); printf("\t-C context\tResume search at .\n"); printf("\t-S\t\tReturn at most one match per server.\n"); printf("\n"); printf("\t-e\t\tRun tests on WordExclude and WordExcludeMask.\n"); exit(1); } htdig-3.2.0b6/test/search.txt0100644006314600127310000000274107427026545015367 0ustar angusgbhtdigto 0 0 1 1 the 0 0 3 1 the 0 0 5 1 world 0 0 5 2 the 0 0 5 3 world 0 0 5 4 comes 0 0 6 1 world 0 0 11 1 the 0 0 20 1 an 0 0 20 2 end 0 0 20 3 the 0 0 20 4 world 0 0 20 5 the 0 0 21 1 world 0 0 21 2 the 0 0 51 1 world 0 0 51 2 the 0 0 71 1 world 0 0 71 2 the 0 0 81 1 world 0 0 81 2 lazy 0 1 11 2 dog 0 1 11 3 lazy 0 1 11 4 lazy 0 1 21 2 dog 0 1 21 3 lazy 0 5 9 1 lazy 0 5 21 2 dog 0 5 21 3 lazy 0 5 53 2 dog 0 5 53 4 lazy 0 5 56 7 dog 0 5 56 8 dog 0 6 1 5 lazy 0 6 1 8 htdig-3.2.0b6/test/set_attr0100644006314600127310000000025507766741211015127 0ustar angusgbhtdig#!/bin/sh conf=conf/htdig.conf.tmp if grep $1 $conf > /dev/null ; then mv $conf tmp_conf sed "s@$1.*@$1: $2@" < tmp_conf > $conf else echo "$1: $2" >> $conf fi htdig-3.2.0b6/test/skiptest_db.txt0100644006314600127310000000210107426615601016417 0ustar angusgbhtdigaz 5 1 0 bz 5 0 2 cz 6 0 3 et 1 0 50 et 20 0 10 et 20 0 20 et 20 0 40 et 20 0 50 et 20 0 60 et 21 0 10 et 21 0 20 et 21 0 30 et 23 0 56 et 28 0 10 eta 1 0 5 eta 9 0 4 eta 10 0 3 eu 2 0 10 serhysdfh 1 0 11 serhysdfh 1 0 50 tata 4 0 6 tata 8 0 6 tito 1 0 3 tz 7 0 4 uu 6 0 5 htdig-3.2.0b6/test/synonym_dict0100644006314600127310000000007007766741211016014 0ustar angusgbhtdigxxyyzz promotion updating zzyyxx fred xyzxyz monitoring htdig-3.2.0b6/test/t_factors0100755006314600127310000001605710060263616015265 0ustar angusgbhtdig#!/bin/sh # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_factors,v 1.7 2004/06/05 06:26:22 lha Exp $ # # Tests (or should eventually test) the following config attributes: # author_factor # backlink_factor # caps_factor # date_factor (TODO) # description_factor # heading_factor # keywords_factor # meta_description_factor # multimatch_factor # search_results_order # text_factor # title_factor # url_seed_score # url_text_factor # try_order comment query pattern1 patern2 ... # comment - description of test, displayed if error occurs # query - search string passed to htsearch # pattern - strings expected to occur *in order* in the output try_order() { comment="$1" shift query="$1" shift $htsearch -c $config "$query" > $tmp 2> /dev/null array="" for pattern do array="$array; array[i++] = "\"$pattern\" done miss=`$awk "BEGIN {$array; line = 0; } \ "'$0'" ~ \".*\"array[line] { line++ } \ END { print array[line] } " < $tmp ` if [ "$miss" != "" ] then $htsearch -vv -c $config "$query" > /dev/null echo "String \"$miss\" was not found where expected" fail "$htsearch -c $config '$query' >> $tmp -- $comment" fi } test_functions_action=--start-apache . ./test_functions config=$testdir/conf/htdig.conf.tmp tmp=/tmp/t_htsearch$$ # set up config file with chosen non-default values cp $testdir/conf/htdig.conf $config $htdig "$@" -t -i -c $config || fail "Couldn't dig" $htpurge -c $config || fail "Couldn't purge" try_order "Search for 'also'" \ "words=also" \ '4 matches' 'site2.html' 'site4.html' 'bad_local.htm' 'script.html' set_attr url_seed_score "site4 *1000+1000" try_order "Seed score 1000 for site4.html" \ "words=also" \ '4 matches' 'site4.html' 'site2.html' 'bad_local.htm' 'script.html' set_attr url_seed_score "site4 *1000+1000 script *1000+1000" try_order "Seed score 1000 for site4.html and script.html" \ "words=also" \ '4 matches' 'site4.html' 'script.html' 'site2.html' 'bad_local.htm' set_attr url_seed_score "site4|script *1000+1000" try_order "Seed score 1000 for site4|script" \ "words=also" \ '4 matches' 'site4.html' 'script.html' 'site2.html' 'bad_local.htm' set_attr search_results_order "bad_local" try_order "Search_results_order bad_local" \ "words=also" \ '4 matches' 'bad_local.htm' 'site4.html' 'script.html' 'site2.html' set_attr search_results_order "script * e2|e4" try_order "Search_results_order * script e2|e4" \ "words=also" \ '4 matches' 'script.html' 'bad_local.htm' 'site4.html' 'site2.html' set_attr url_seed_score "" set_attr search_results_order "" set_attr author_factor 0 set_attr backlink_factor 0 set_attr caps_factor 0 # not implemented set_attr date_factor 0 # TODO set_attr description_factor 0 set_attr heading_factor 0 set_attr keywords_factor 0 set_attr meta_description_factor 0 set_attr multimatch_factor 0 set_attr text_factor 0 set_attr title_factor 0 set_attr url_text_factor 0 # not implemented try_order "Search with factors 0" \ "words=also" \ 'No matches' try_order "Search for 'service' with title_factor 0" \ "words=service" \ 'No matches' set_attr title_factor 1 try_order "Search for 'service' with title_factor 1" \ "words=service" \ '1 matches' 'script.html' set_attr text_factor 0.3 try_order "Greater weight to title factor" \ "words=service" \ '4 matches' 'script.html' 'site4.html' 'site%201.html' 'site3.html' set_attr title_factor -3.2 try_order "Checking negative title factor" \ "words=service" \ '4 matches' 'site4.html' 'site%201.html' 'site3.html' 'script.html' set_attr title_factor 0 set_attr text_factor 0 # test with all factors 0 except the one which matches set_attr description_factor 1 try_order "Search for 'crossRef' with description_factor 1" \ "words=crossRef" \ '1 matches' 'site%201.html' set_attr description_factor 0 set_attr author_factor 1 try_order "Search for 'media' with author_factor 1" \ "words=media" \ '1 matches' 'script.html' set_attr author_factor 0 set_attr meta_description_factor 1 try_order "Search for 'stars' with meta_description_factor 1" \ "words=stars" \ '1 matches' 'site2.html' set_attr meta_description_factor 0 set_attr heading_factor 1 try_order "Search for 'obtain' with heading_factor 1" \ "words=obtain" \ '1 matches' 'bad_local.htm' set_attr heading_factor 0 set_attr keywords_factor 1 try_order "Search for 'newWord' with keywords_factor 1" \ "words=newWord" \ '1 matches' 'title.html' set_attr keywords_factor 0 # test with all document-based factors non-zero except the one which matches set_attr author_factor 1 #set_attr backlink_factor 1 # not document based set_attr caps_factor 1 #set_attr date_factor 1 # not document based set_attr description_factor 1 set_attr heading_factor 1 set_attr keywords_factor 1 set_attr meta_description_factor 1 set_attr multimatch_factor 1 set_attr text_factor 1 set_attr title_factor 1 set_attr url_text_factor 1 set_attr description_factor 1 set_attr description_factor 0 try_order "Search for 'crossRef' with description_factor 0" \ "words=crossRef" \ '1 matches' 'title.html' set_attr description_factor 1 set_attr author_factor 0 try_order "Search for 'media' with author_factor 0" \ "words=media" \ 'No matches' set_attr author_factor 1 set_attr meta_description_factor 0 try_order "Search for 'stars' with meta_description_factor 0" \ "words=stars" \ 'No matches' set_attr meta_description_factor 1 set_attr heading_factor 0 try_order "Search for 'obtain' with heading_factor 0" \ "words=obtain" \ 'No matches' set_attr heading_factor 1 set_attr keywords_factor 0 try_order "Search for 'newWord' with keywords_factor 0" \ "words=newWord" \ 'No matches' set_attr keywords_factor 1 # multimatch_factor gives a "boost" to searches matching multiple terms set_attr title_factor 10 # "get" in title of bad_local set_attr multimatch_factor 10000 try_order "Search for 'get or interest or repay' with multimatch_factor 10000" \ "words=get+interest+repay;method=or" \ '2 matches' 'site4.html' 'bad_local.htm' set_attr multimatch_factor 0 try_order "Search for 'get or interest or repay' with multimatch_factor 0" \ "words=get+interest+repay;method=or" \ '2 matches' 'bad_local.htm' 'site4.html' # backlink counts the number of references (of any type) to this document set_attr backlink_factor 0 try_order "site4.html has repay+interest, site 1.html only has suggestions" \ "words=suggestions+repay+interest;method=or" \ '2 matches' 'site4.html' 'site%201.html' set_attr backlink_factor 100 try_order "site 1.html has a higher ratio of backlinks to outgoing links" \ "words=suggestions+repay+interest;method=or" \ '2 matches' 'site%201.html' 'site4.html' test_functions_action=--stop-apache . ./test_functions htdig-3.2.0b6/test/t_fuzzy0100755006314600127310000002157710055635562015025 0ustar angusgbhtdig#!/bin/sh # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_fuzzy,v 1.2 2004/05/28 13:15:30 lha Exp $ # try() { comment="$1" shift query="$1" shift $htsearch -c $config "$query" > $tmp for pattern do if grep "$pattern" $tmp > /dev/null then : else $htsearch -vv -c $config "$query" > /dev/null echo "Output doesn't match \"$pattern\"" fail "$htsearch -c $config '$query' >> $tmp -- $comment" fi done } test_functions_action=--start-apache . ./test_functions config=$testdir/conf/htdig.conf.tmp tmp=/tmp/t_htsearch$$ databases="accents metaphone soundex synonym endings_root2word endings_word2root" # set up config file with chosen non-default values cp $testdir/conf/htdig.conf $config for database in $databases; do set_attr ${database}_db "$testdir/var/htdig/test_${database}.db" rm -f $testdir/var/htdig/test_${database}.db done set_attr synonym_dictionary "$testdir/synonym_dict" set_attr endings_affix_file "$testdir/dummy.affixes" set_attr endings_dictionary "$testdir/dummy.stems" # db.words.db needed by htfuzzy, so dig before generating fuzzy databases #set_attr locale fr set_attr extra_word_characters çé $htdig "$@" -t -i -c $config $htpurge -c $config # Check that databases can be generated $htfuzzy -c $config accents soundex metaphone endings synonyms || fail "Error generating fuzzy database" # Make sure databases put in correct locations for database in $databases; do if [ ! -f $testdir/var/htdig/test_${database}.db ] ; then fail "htfuzzy didn't recognise ${database}_db attribute" fi done try "Search for 'álso' without search_algorithm=accents" \ "words=álso;search_algorithm=exact" \ 'No matches' try "Search for 'álso' with search_algorithm not in allow_in_form" \ "words=álso;search_algorithm=accents" \ 'No matches' set_attr allow_in_form search_algorithm try "Search for 'álso' with search_algorithm=accents" \ "words=álso;search_algorithm=accents:0.1" \ '4 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' 'also' try "Search for 'francais' without search_algorithm=accents" \ "words=francais;search_algorithm=exact:0.1" \ 'No matches' #try "Search for '\"fran ais\"' with search_algorithm=accents" \ # "words=%22fran+ais%22;search_algorithm=accents:1" \ # '1 matches' 'site4.html' try "Search for 'francais' with search_algorithm=accents" \ "words=francais;search_algorithm=accents:0.1" \ '1 matches' 'site4.html' try "Search for 'quebec' without search_algorithm=accents" \ "words=quebec;search_algorithm=exact:0.1" \ 'No matches' try "Search for 'quebec' with search_algorithm=accents" \ "words=quebec;search_algorithm=accents:0.1" \ '1 matches' 'site4.html' try "Search for 'accownt' without search_algorithm=soundex" \ "words=accownt;search_algorithm=exact:1" \ 'No matches' try "Search for 'accownt' with search_algorithm=soundex" \ "words=accownt;search_algorithm=soundex:1" \ '2 matches' 'script.html' 'site4.html' 'account' try "Search for 'accownt' with search_algorithm=metaphone" \ "words=accownt;search_algorithm=metaphone:1" \ '2 matches' 'script.html' 'site4.html' 'account' try "Search for 'zzyyxx' without search_algorithm=synonyms" \ "words=zzyyxx;search_algorithm=exact:1" \ 'No matches' try "Checking synonyms of the form word-in-doc word-in-query" \ "words=zzyyxx;search_algorithm=synonyms:1" \ '1 matches' 'site3.html' try "Search for 'xxyyzz' without search_algorithm=synonyms" \ "words=xxyyzz;search_algorithm=exact:1" \ 'No matches' try "Checking synonyms of the form word-in-query word-in-doc" \ "words=xxyyzz;search_algorithm=synonyms:1" \ '1 matches' 'site3.html' try "Search for 'xyzxyz' without search_algorithm=synonyms" \ "words=xyzxyz;search_algorithm=exact:1" \ 'No matches' try "Checking synonyms of the form common-word word-in-query word-in-doc" \ "words=xyzxyz;search_algorithm=synonyms:1" \ '1 matches' 'site3.html' try "Checking exact is used as a default if fuzzy rules yield no word" \ "words=road;search_algorithm=synonyms:1" \ '1 matches' 'site4.html' 'Road' try "Searching for 'copy' without 'endings'" \ "words=copy;search_algorithm=exact:1" \ 'No matches' try "Searching for 'copy' with 'endings'" \ "words=copy;search_algorithm=endings:1" \ '2 matches' 'bad_local.htm' 'site3.html' 'Copyright' try "Searching for 'univers*' without 'prefix'" \ "words=univers*;search_algorithm=exact:1" \ 'No matches' try "Searching for 'univers*' with 'prefix'" \ "words=univers*;search_algorithm=prefix:1" \ '2 matches' 'script.html' 'site4.html' set_attr allow_in_form "search_algorithm max_prefix_matches min_prefix_length" set_attr prefix_match_character "?" try "Searching for 'res?' with 'prefix'" \ "words=res?;search_algorithm=prefix:1;max_prefix_matches=100" \ '3 matches' 'script.html' 'site3.html' 'site4.html' 'reserved' 'residency' 'residents' 'resources' 'respectively' 'response' 'restricted' try "Searching for 'res?' with 'prefix', at most 2 prefixes" \ "words=res?;search_algorithm=prefix:1;max_prefix_matches=2" \ '2 matches' 'site3.html' 'site4.html' 'reserved' 'residency)' set_attr prefix_match_character "etc" try "Searching for 'resetc' with 'prefix', prefix_match_character=etc" \ "words=resetc;search_algorithm=prefix:1;max_prefix_matches=2" \ '2 matches' 'site3.html' 'site4.html' 'reserved' 'residency)' set_attr minimum_prefix_length 4 # Check it doesn't count the prefix_match "character" as part of the # "minimum_prefix_length" try "Searching for 'resetc' with 'prefix', minimum prefix length 4" \ "words=resetc;search_algorithm=prefix:1;max_prefix_matches=4" \ 'No matches' set_attr prefix_match_character "?" try "Searching for 'res?' with 'prefix', minimum prefix length 4" \ "words=res?;search_algorithm=prefix:1;max_prefix_matches=100" \ 'No matches' try "Searching for 'ili' without 'substring'" \ "words=ili;search_algorithm=exact:1" \ 'No matches' try "Searching for 'ili' with 'substring'" \ "words=ili;search_algorithm=substring:1" \ '2 matches' 'script.html' 'site4.html' '(affiliated' 'utilised)' set_attr allow_in_form "search_algorithm substring_max_words" try "Searching for 'ili' with 'substring', substring_max_words=3" \ "words=ili;search_algorithm=substring:1;substring_max_words=3" \ '2 matches' 'script.html' 'site4.html' 'eligibility)' try "Searching for 'acccount' without 'speling'" \ "words=acccount;search_algorithm=exact:1" \ 'No matches' try "Searching for 'acccount' with 'speling'" \ "words=acccount;search_algorithm=speling:1" \ '2 matches' 'script.html' 'site4.html' 'account' try "Searching for 'accountx' with 'speling'" \ "words=accountx;search_algorithm=speling:1" \ '2 matches' 'script.html' 'site4.html' 'account' set_attr allow_in_form "search_algorithm minimum_speling_length" try "Searching for 'accountx' with minimum_speling_length=9" \ "words=accountx;search_algorithm=speling:1;minimum_speling_length=9" \ 'No matches' try "Searching for 'accountx' with minimum_speling_length=8" \ "words=accountx;search_algorithm=speling:1;minimum_speling_length=8" \ '2 matches' 'script.html' 'site4.html' 'account' try "Searching for '.*vers[^a].*' without 'regex'" \ "words=.*vers[^a].*;search_algorithm=exact:1" \ 'No matches' set_attr extra_word_characters ".*[^]\\$" try "Searching for '.*vers[^a].*' with 'regex'" \ "words=.*vers[^a].*;search_algorithm=regex:1" \ '3 matches' '(universities' 'versions)' set_attr allow_in_form "search_algorithm regex_max_words" try "Searching for '.*vers[^a].*' with 'regex', regex_max_words=3" \ "words=.*vers[^a].*;search_algorithm=regex:1;regex_max_words=3" \ '2 matches' '(universities' 'version)' try "Searching for 'versi' without 'substring'" \ "words=versi;search_algorithm=exact:1" \ 'No matches' try "Searching for 'versi' with 'substring'" \ "words=versi;search_algorithm=substring:1" \ '3 matches' '(universities' 'versions)' set_attr allow_in_form "search_algorithm substring_max_words" try "Searching for 'versi' with 'substring', substring_max_words=3" \ "words=versi;search_algorithm=substring:1;substring_max_words=3" \ '2 matches' '(universities' 'version)' for database in $databases; do rm -f $testdir/var/htdig/test_${database}.db try "Searching width $database database missing" \ "words=account" \ '2 matches' done test_functions_action=--stop-apache . ./test_functions htdig-3.2.0b6/test/t_htdb0100755006314600127310000000215410055635562014545 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htdb,v 1.4 2004/05/28 13:15:30 lha Exp $ # . ./test_functions for compress in "" "-z" do rm -f test ../htdb/htdb_load -f $srcdir/t_htdb.dump $compress test || exit 1 ../htdb/htdb_dump -p $compress test > t_htdb.d1 || exit 1 cmp $srcdir/t_htdb.dump t_htdb.d1 || exit 1 ../htdb/htdb_stat $compress -d test | grep '11 Number of keys in the tree' > /dev/null || exit 1 done export MIFLUZ_CONFIG ; MIFLUZ_CONFIG=${srcdir}/mifluz-search.conf for compress in "" "-z" do rm -f test test_weakcmpr ./txt2mifluz $compress $VERBOSE < $srcdir/search.txt ../htdb/htdb_dump -W -p $compress test > t_htdb.d1 || exit 1 rm -f test test_weakcmpr ../htdb/htdb_load -W -f t_htdb.d1 $compress test || exit 1 ../htdb/htdb_dump -W -p $compress test > t_htdb.d2 || exit 1 cmp t_htdb.d1 t_htdb.d2 || exit 1 done htdig-3.2.0b6/test/t_htdb.dump0100755006314600127310000000172407427026545015517 0ustar angusgbhtdigVERSION=2 format=print type=btree db_pagesize=8192 HEADER=END \00\00\00\00aaa0123456789012345678900123456789012345678901234567890 0123456789 \01\00\00\00aaaa0123456789012345678900123456789012345678901234567890 0123456789 \02\00\00\00aaaaaaaaaa0123456789012345678900123456789012345678901234567890 0123456789 \03\00\00\00aaaabcd0123456789012345678900123456789012345678901234567890 0123456789 \15u\00\00aaa0123456789012345678900123456789012345678901234567890 0123456789 \16u\00\00aaaa0123456789012345678900123456789012345678901234567890 0123456789 \17u\00\00aaaaaaaaaa0123456789012345678900123456789012345678901234567890 0123456789 \18u\00\00aaaabcd0123456789012345678900123456789012345678901234567890 0123456789 *\ea\00\00aaa0123456789012345678900123456789012345678901234567890 0123456789 +\ea\00\00aaaa0123456789012345678900123456789012345678901234567890 0123456789 ,\ea\00\00aaaaaaaaaa0123456789012345678900123456789012345678901234567890 0123456789 DATA=END htdig-3.2.0b6/test/t_htdig0100755006314600127310000001023010060263616014706 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htdig,v 1.16 2004/06/05 06:26:22 lha Exp $ # # Tests the following config attributes: # case_sensitive # common_url_parts # limit_urls_to # robotstxt_name # url_part_aliases # url_rewrite_rules flags="$@" try() { config=$1 expected=$2 # $htdig "$flags" -t -i -c $config # crashes on Solaris, HP-UX -- lha $htdig $flags -t -i -c $config # One test gives empty database -- suppress this warning. $htpurge -c $config 2&> /dev/null # only used when url_part_aliases was set before the call... set_attr url_part_aliases "bar foo" got=`./document -c $config -u | sort` if [ "$expected" != "$got" ] then fail "running htdig: expected $expected but got $got" fi } test_functions_action=--start-apache . ./test_functions conf=$testdir/conf/htdig.conf.tmp cp $testdir/conf/htdig.conf $conf # complete dig of set 1 try $conf \ 'http://localhost:7400/set1/ http://localhost:7400/set1/bad_local.htm http://localhost:7400/set1/script.html http://localhost:7400/set1/site%201.html http://localhost:7400/set1/site2.html http://localhost:7400/set1/site3.html http://localhost:7400/set1/site4.html http://localhost:7400/set1/sub%2520dir/ http://localhost:7400/set1/sub%2520dir/empty%20file.html http://localhost:7400/set1/title.html' # Check common_url_parts being encoded properly set_attr common_url_parts "dummy1 dummy2 dummy3 dummy4 dummy5 dummy6 dummy7 dummy8 dummy9 dummy10 dummy11 dummy12" got=`./document -c $config -u | sort` expected='dummy1localhost:7400/set1/ dummy1localhost:7400/set1/bad_localdummy7 dummy1localhost:7400/set1/scriptdummy6 dummy1localhost:7400/set1/site%201dummy6 dummy1localhost:7400/set1/site2dummy6 dummy1localhost:7400/set1/site3dummy6 dummy1localhost:7400/set1/site4dummy6 dummy1localhost:7400/set1/sub%2520dir/ dummy1localhost:7400/set1/sub%2520dir/empty%20filedummy6 dummy1localhost:7400/set1/titledummy6' if [ "$expected" != "$got" ] then fail "running htdig: expected $expected but got $got" fi # Pretend we are another user; robots.txt bans us from seeing 'site*' set_attr robotstxt_name other # (Reverse mapping from 'foo' to 'bar' implemented in try.) set_attr url_part_aliases "http://localhost:7400/set1 foo" try $conf \ 'bar/ bar/bad_local.htm bar/script.html bar/sub%2520dir/ bar/sub%2520dir/empty%20file.html bar/title.html' # back to default. set_attr url_part_aliases # check limit_urls_to obeys case sensitive set_attr start_url HTTP://LocalHost:7400/Set1/ try $conf "" set_attr case_sensitive false set_attr robotstxt_name htdig # common_url_parts is case sensitive, despite case_sensitive=false set_attr common_url_parts "http:// http://local HTTP://LocalHost 7400/set1" # Replace site4.html by a file:/// URL. Must explicitly add leading chars set_attr url_rewrite_rules '(.*)si[a-z]*[4-9]*\.([a-z]*)tml file:///'$PWD'/htdocs/set1/site4.\\2tml' set_attr limit_urls_to '${start_url} site4.html' try $conf \ 'file://'$PWD'/htdocs/set1/site4.html http://localhost:7400/set1/ http://localhost:7400/set1/bad_local.htm http://localhost:7400/set1/script.html http://localhost:7400/set1/site%201.html http://localhost:7400/set1/site2.html http://localhost:7400/set1/site3.html http://localhost:7400/set1/sub%2520dir/ http://localhost:7400/set1/sub%2520dir/empty%20file.html http://localhost:7400/set1/title.html' # Check common_url_parts being encoded properly set_attr common_url_parts "dummy1 dummy2 dummy3 dummy4" got=`./document -c $config -u | sort` expected='dummy2host:dummy4/ dummy2host:dummy4/bad_local.htm dummy2host:dummy4/script.html dummy2host:dummy4/site%201.html dummy2host:dummy4/site2.html dummy2host:dummy4/site3.html dummy2host:dummy4/sub%2520dir/ dummy2host:dummy4/sub%2520dir/empty%20file.html dummy2host:dummy4/title.html file://'$PWD'/htdocs/set1/site4.html' if [ "$expected" != "$got" ] then fail "running htdig: expected $expected but got $got" fi test_functions_action=--stop-apache . ./test_functions htdig-3.2.0b6/test/t_htdig_local0100755006314600127310000002173110055635562016077 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htdig_local,v 1.10 2004/05/28 13:15:30 lha Exp $ # # Tests the following config attributes: # bad_local_extensions # check_unique_md5 # content_classifier # database_dir # exclude_urls # limit_normalized # limit_urls_to # local_extensions # local_urls # local_urls_only # local_user_urls # max_hop_count # md5_db # mime_types # remove_default_doc # server_aliases # start_url test_functions_action=--start-apache . ./test_functions # set up config file with chosen non-default values config=$testdir/conf/htdig.conf.tmp cp $testdir/conf/htdig.conf2 $config ################################################################################ #test for local-file-system access to URLs /bin/rm -f var/htdig2/* set_attr start_url "http://localhost:7400/set1/ http://localhost:7400/set1/title.html?site3.html http://localhost:7400/set1/title.html?site4.html" # ban ite3.htm from query, but not from main URL. # Allow site3.html, but not title.html?site3.html set_attr bad_querystr ite3.htm expected='bad_local.htm' got=`$htdig "$@" -t -i -vv -c $config | grep "Bad local extension:" | sed -e"s-.*/--"` if [ "$expected" != "$got" ] then fail "first htdig: expected $expected but got $got" fi expected='db.docdb db.docs db.docs.index db.excerpts db.worddump db.words.db db.words.db_weakcmpr' got=`/bin/ls var/htdig2` if [ "$expected" != "$got" ] then fail "created files: expected $expected but got $got" fi $htpurge -c $config # should http://localhost:7400/set1/sub%2520dir be purged? expected='http://localhost:7400/set1/ http://localhost:7400/set1/bad_local.htm http://localhost:7400/set1/script.html http://localhost:7400/set1/site%201.html http://localhost:7400/set1/site2.html http://localhost:7400/set1/site3.html http://localhost:7400/set1/site4.html http://localhost:7400/set1/sub%2520dir/ http://localhost:7400/set1/sub%2520dir/empty%20file.html http://localhost:7400/set1/title.html http://localhost:7400/set1/title.html?site4.html' got=`./document -c $config -u | sort` if [ "$expected" != "$got" ] then fail "first document: expected $expected but got $got" fi set_attr bad_query_str ################################################################################ # limit_urls_to applies before server alias expansion set_attr start_url http://myhost/set1/index.html set_attr limit_urls_to "http://myhost/set1/" set_attr server_aliases myhost=localhost:7400 $htdig "$@" -t -i -c $config || fail "couldn't dig second time" $htpurge -c $config || fail "couldn't purge second time" # only start_url uses alias, so only it passes the limit_urls_to test expected='http://localhost:7400/set1/' got=`./document -c $config -u | sort` if [ "$expected" != "$got" ] then fail "second document: expected $expected but got $got" fi ################################################################################ # Check remote URLs not retrieved if local_urls_only specified set_attr local_urls_only true set_attr remove_default_doc site2.html # Note: local_urls_only doesn't handle directories without a default doc set_attr local_default_doc "site2.html empty%20file.html" set_attr start_url http://myhost/set1/index.html # don't care what the aliased URL is; only check the normalized one set_attr limit_urls_to set_attr limit_normalized "http://localhost:7400/set1/" set_attr server_aliases myhost=localhost:7400 $htdig "$@" -t -i -c $config || fail "couldn't dig third time" $htpurge -c $config || fail "couldn't purge third time" expected='http://localhost:7400/set1/ http://localhost:7400/set1/index.html http://localhost:7400/set1/script.html http://localhost:7400/set1/site%201.html http://localhost:7400/set1/site3.html http://localhost:7400/set1/site4.html http://localhost:7400/set1/sub%2520dir/ http://localhost:7400/set1/title.html' got=`./document -c $config -u | sort` if [ "$expected" != "$got" ] then fail "third document: expected $expected but got $got" fi set_attr remove_default_doc index.html set_attr local_urls_only false set_attr limit_normalized ################################################################################ #test for URLs expected='' # no "bad local" extensions for file:/// # Check only one "title.html" found... set_attr check_unique_md5 true set_attr start_url "http://localhost:7400/set1/title.html file://$PWD/htdocs/set1/" set_attr limit_urls_to '${start_url}' got=`$htdig "$@" -t -i -vv -c $config | grep "Bad local extension:" | sed -e"s-.*/--"` if [ "$expected" != "$got" ] then fail "fourth htdig: expected $expected but got $got" fi expected='db.docdb db.docs db.docs.index db.excerpts db.md5hash.db db.worddump db.words.db db.words.db_weakcmpr' got=`/bin/ls var/htdig2` if [ "$expected" != "$got" ] then fail "fourth created files: expected $expected but got $got" fi $htpurge -c $config || fail "couldn't purge fourth time" expected='file:///set1/bad_local.htm file:///set1/index.html file:///set1/script.html file:///set1/site%201.html file:///set1/site2.html file:///set1/site3.html file:///set1/site4.html file:///set1/sub%2520dir/empty%20file.html /title.html' got=`./document -c $config -u | sed "s#${PWD}/htdocs##" | sort | sed "s#.*/title.html#/title.html#"` if [ "$expected" != "$got" ] then fail "fourth document: expected $expected but got $got" fi ################################################################################ #test mime types handling expected='' # no "bad local" extensions for file:/// set_attr max_hop_count 1 # removes "empty%20file.html" set_attr exclude_urls "site4.html script.html site[3].html" set_attr bad_extensions .foo set_attr local_urls_only false rm -f var/htdig2/db.md5hash.db set_attr md5_db '${database_base}.md5.db' set_attr mime_types $PWD/mime-without-htm set_attr content_classifier $PWD/say-text echo 'text/html html' > mime-without-htm echo '#!/bin/sh echo text/plain' > say-text chmod 700 say-text got=`$htdig "$@" -t -i -vv -c $config | grep "MIME type:" | sed -e"s-.*/--"` if [ "$expected" != "$got" ] then fail "fifth htdig: expected $expected but got $got" fi expected='db.docdb db.docs db.docs.index db.excerpts db.md5.db db.worddump db.words.db db.words.db_weakcmpr' got=`/bin/ls var/htdig2` if [ "$expected" != "$got" ] then fail "fifth created files: expected $expected but got $got" fi $htpurge -c $config || fail "couldn't purge fifth time" expected='file:///set1/bad_local.htm file:///set1/index.html file:///set1/nph-location.cgi file:///set1/site%201.html file:///set1/site2.html file:///set1/site3.html file:///set1/title.html' got=`./document -c $config -u | sed "s#${PWD}/htdocs##" | sort` if [ "$expected" != "$got" ] then fail "fifth document: expected $expected but got $got" fi ################################################################################ expected='' # no "bad local" extensions for file:/// set_attr max_hop_count # removes "empty%20file.html" set_attr exclude_urls /CVS/ set_attr valid_extensions ".foo .html" set_attr bad_extensions set_attr mime_types $PWD/mime-without-htm set_attr content_classifier $PWD/say-text echo 'text/html html' > mime-without-htm echo '#!/bin/sh echo text/plain' > say-text chmod 700 say-text got=`$htdig "$@" -t -i -vv -c $config | grep "MIME type:" | sed -e"s-.*/--"` if [ "$expected" != "$got" ] then fail "sixth htdig: expected $expected but got $got" fi $htpurge -c $config || fail "couldn't purge sixth time" expected='file:///set1/index.html file:///set1/nph-location.foo file:///set1/script.html file:///set1/site%201.html file:///set1/site2.html file:///set1/site3.html file:///set1/site4.html file:///set1/sub%2520dir/empty%20file.html file:///set1/title.html' got=`./document -c $config -u | sed "s#${PWD}/htdocs##" | sort` if [ "$expected" != "$got" ] then fail "sixth document: expected $expected but got $got" fi ################################################################################ set_attr local_urls_only set_attr local_urls "http://somewhere/=$PWD/htdocs/" set_attr local_user_urls "http://somewhere/=$PWD/,/set1/" set_attr start_url "http://somewhere/~htdocs/" set_attr valid_extensions set_attr local_default_doc index.html set_attr remove_default_doc index.html $htdig "$@" -t -i -c $config || fail "couldn't dig seventh time" $htpurge -c $config || fail "couldn't purge seventh time" #local_urls_only can't handle .../~htdocs/sub%2520dir/empty%20file.html expected='http://somewhere/~htdocs/ http://somewhere/~htdocs/script.html http://somewhere/~htdocs/site%201.html http://somewhere/~htdocs/site2.html http://somewhere/~htdocs/site3.html http://somewhere/~htdocs/site4.html http://somewhere/~htdocs/title.html' got=`./document -c $config -u | sort` if [ "$expected" != "$got" ] then fail "seventh document: expected $expected but got $got" fi /bin/rm mime-without-htm say-text test_functions_action=--stop-apache . ./test_functions htdig-3.2.0b6/test/t_htmerge0100755006314600127310000000104510055635562015255 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htmerge,v 1.7 2004/05/28 13:15:30 lha Exp $ # . ./test_functions $htdig "$@" -t -i -c $testdir/conf/htdig.conf $htdig "$@" -t -i -c $testdir/conf/htdig.conf2 $htmerge "$@" -c $testdir/conf/htdig.conf -m $testdir/conf/htdig.conf2 >/dev/null 2>/dev/null htdig-3.2.0b6/test/t_htnet0100755006314600127310000000111610055635562014743 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htnet,v 1.9 2004/05/28 13:15:30 lha Exp $ # test_functions_action=--start-apache . ./test_functions verbose=$1 ./testnet -U http://localhost:7400/set3/nph-hang.cgi $verbose if test $? = 1 then exit 0 else fail "Could not fetch URL" fi test-functions_action=--stop-apache . ./test-functions htdig-3.2.0b6/test/t_htsearch0100755006314600127310000001251510055635562015427 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_htsearch,v 1.14 2004/05/28 13:15:30 lha Exp $ # test_functions_action=--start-apache . ./test_functions config=$testdir/conf/htdig.conf tmp=/tmp/t_htsearch$$ $htdig "$@" -t -i -c $config $htpurge -c $config test_functions_action=--stop-apache . ./test_functions try() { comment="$1" shift query="$1" shift $htsearch -c $config "$query" > $tmp for pattern do if grep "$pattern" $tmp > /dev/null then : else $htsearch -v -c $config "$query" > /dev/null echo "Output doesn't match \"$pattern\"" fail "$htsearch -c $config '$query' >> $tmp -- $comment" fi done } try "Simple search for 'also'" \ "words=also" \ '4 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' try "Implicit and search with two words 'also movies'" \ "method=and&words=also+movies" \ '1 match' 'site2.html' try "Explicit and search with two words 'also movies'" \ "method=boolean&words=also+and+movies" \ '1 match' 'site2.html' try "Implicit or search for 'also distribution'" \ "method=or&words=also+distribution" \ '5 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' 'site%201.html' try "Explicit or search for 'also distribution'" \ "method=boolean&words=also+or+distribution" \ '5 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' 'site%201.html' try "Boolean and/or mixed 'also or distribution and ltd'" \ "method=boolean&words=also+or+distribution+and+ltd" \ '5 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' 'site%201.html' try "Boolean explicit priority '(also or distribution) and ltd'" \ "method=boolean&words=(also+or+distribution)+and+ltd" \ '2 matches' 'script.html' 'site%201.html' try "Wildcard search for '*'" \ "method=and&words=*" \ '10 matches' 'set1/bad_local.htm' 'set1/title.html' 'set1/site2.html' 'set1/script.html' 'set1/"' 'set1/site3.html' 'set1/site4.html' 'set1/site%201.html' 'set1/sub%2520dir/' 'set1/sub%2520dir/empty%20file.html' try "Phrase search for '\"who offer\" and \"loans to graduate\"'" \ "method=boolean&words=%22who+offer%22+and+%22loans+to+graduate%22" \ '1 match' 'site4.html' try "Phrase search for 'may be deferred' -- stop words at start" \ "method=boolean&words=%22may+be+deferred%22" \ '1 match' 'site4.html' 'may be deferred' try "Phrase search for 'Repayment may be' -- stop words at end" \ "method=boolean&words=%22Repayment+may+be%22" \ '1 match' 'site4.html' 'Repayment may be' # This test fails # #try "Phrase search for 'may be' -- all stop words" \ # "method=boolean&words=%22may+be%22" \ # '1 match' 'site4.html' try "Phrase search for 'Repayment may be deferred' -- stop words in middle" \ "method=boolean&words=%22Repayment+may+be+deferred%22" \ '1 match' 'site4.html' 'Repayment may be deferred' try "Phrase search for 'Repayment deferred' -- phrase interrupted by stop words" \ "method=boolean&words=%22Repayment+deferred%22" \ 'No match' try "Syntax error: finishing with 'and'" \ "method=boolean&words=also+and" \ 'Expected a search word, a quoted phrase or a boolean expression between () at the end' try "Syntax error: excess open brackets" \ "method=boolean&words=(also+or+distribution" \ "Expected ')' at the end" try "Syntax error: excess close brackets" \ "method=boolean&words=also+or+distribution)" \ "Expected end of expression instead of ')'" try "Syntax error: missing end quote" \ "method=boolean&words=also+or+%22distribution" \ 'Expected quotes at the end' try "Unrestricted search for 'group'" \ "method=and&words=group" \ '4 matches' 'script.html' 'bad_local.htm' 'site3.html' 'site4.html' try "Field-restricted search for 'author:group'" \ "method=and&words=author:group" \ '1 match' 'script.html' try "Field-restricted search for 'text:group'" \ "method=and&words=text:group" \ '3 matches' 'bad_local.htm' 'site3.html' 'site4.html' try "Checking prefix parsing using 'text: group'" \ "method=and&words=text:%20group" \ '1 match' 'script.html' try "Checking prefix parsing using 'text::group'" \ "method=and&words=text::group" \ '1 match' 'script.html' try "Checking prefix parsing using 'unknown:group'" \ "method=any&words=unknown:group" \ '5 matches' 'script.html' 'bad_local.htm' 'site3.html' 'site4.html' 'set1/"' try "Field-restricted search for 'descr:cost'" \ "method=and&words=descr:cost" \ '1 match' 'script.html' config=$testdir/conf/htdig.conf3 try "Testing boolean_keywords and search_rewrite_urls" \ "method=boolean&words=also+ou+distribution+et+ltd" \ '5 matches' 'bad_local.htm' 'place2.html' 'script.html' 'place4.html' 'place%201.html' try "Testing boolean_syntax_errors" \ "method=boolean&words=ou+distribution" \ "Attendait un mot au lieu de '|' ou 'ou'" try "Testing htdig's noindex_start/end overlapping" \ "words=considered" \ '1 match' 'script.html' try "Testing htdig's noindex_start/end nested" \ "words=neglected" \ 'No match' rm -f $tmp exit 0 htdig-3.2.0b6/test/t_parsing0100755006314600127310000001260710055635562015273 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_parsing,v 1.4 2004/05/28 13:15:30 lha Exp $ # # Tests (or should eventually test) the following config attributes: # description_meta_tag_names # ignore_alt_text # max_doc_size # max_keywords # max_meta_description_length # max_description_length # max_descriptions # max_head_length # noindex_end # noindex_start # external_parsers # external_protocols # use_meta_description test_functions_action=--start-apache . ./test_functions config=$testdir/conf/htdig.conf.tmp tmp=/tmp/t_htsearch$$ # set up config file with chosen non-default values cp $testdir/conf/htdig.conf $config try() { comment="$1" shift query="$1" shift $htsearch -c $config "$query" > $tmp for pattern do if grep "$pattern" $tmp > /dev/null then : else $htsearch -v -c $config "$query" > /dev/null echo "Output doesn't match \"$pattern\"" fail "$htsearch -c $config '$query' >> $tmp -- $comment" fi done } # Tests (or should eventually test) the following config attributes: # description_meta_tag_names # ignore_alt_text # max_doc_size # max_keywords # max_meta_description_length # max_description_length (May put in t_templates) # max_descriptions (May put in t_templates) # max_head_length # noindex_end # noindex_start # external_parsers (TODO) # external_protocols # use_meta_description $htdig "$@" -t -i -c $config || fail "Couldn't do first dig" $htpurge -c $config || fail "Couldn't do first purge" try "Search for alt text 'earth'" \ "words=earth" \ '1 matches' 'site3.html' try "'claims and collections', unlimited doc size" \ "words=%22claims+and+collections%22" \ '1 matches' 'site4.html' try "Search for keyword 'martial', default max_keywords" \ "words=martial" \ '1 matches' 'site2.html' try "Search for 'service', default noindex_start/end" \ "words=technical" \ '1 matches' 'site%201.html' set_attr use_meta_description true try "Search for 'call handling' with default max_meta_description_length" \ "words=%22call+handling%22" \ '1 matches' 'script.html' 'call handling.*signalling' set_attr ignore_alt_text true set_attr max_doc_size 15112 set_attr max_keywords 5 set_attr noindex_start "'Software Distribution'" set_attr noindex_end "'Contact Information'" set_attr max_meta_description_length 80 set_attr description_meta_tag_names "description generator" set_attr max_head_length 30 $htdig "$@" -t -i -c $config || fail "Couldn't do second dig" $htpurge -c $config || fail "Couldn't do second purge" try "Search for alt text 'earth' with ignore_alt_text=true" \ "words=earth" \ 'No matches' try "'claims and collections', max_doc_size 15112" \ "words=%22claims+and+collections%22" \ '1 matches' 'site4.html' # (Martial is 6th keyword listed in site 2, but "Fu" is too short and omitted.) try "Search for keyword 'martial', max_keywords = 5" \ "words=martial" \ 'No matches' # Only occurrence of "technical" is between noindex_start and _end in site 1 try "Search for 'technical', noindex_start=Software Distribution, noindex_end=Contact Information" \ "words=technical" \ 'No matches' # Visitor occurs after noindex_end try "Search for 'visitor', noindex_start=Software Distribution, noindex_end=Contact Information" \ "words=visitor" \ '2 matches' 'site%201.html' 'site3.html' # Displaying meta description instead of excerpt, check it is truncated try "Search for 'call handling' with max_meta_description_length=80" \ "words=%22call+handling%22" \ '1 matches' 'script.html' 'means of
    ' # Check counts as a description try "Search for 'category', description_meta_tag_names includes 'generator'" \ "words=category" \ '1 matches' 'site3.html' 'FrontPage' # Check that only specified number of bytes of header is stored. # Header size is rounded up to contain the whole of the last word. try "Search for 'also', max_head_length=30" \ "words=also" \ '4 matches' 'bad_local.htm' 'site2.html' 'script.html' 'site4.html' \ 'WHERE.*Copyright
    ' set_attr max_doc_size 15042 set_attr max_keywords 6 set_attr noindex_start "'software distribution'" set_attr noindex_end "'contact information'" $htdig "$@" -t -i -c $config || fail "Couldn't do third dig" $htpurge -c $config || fail "Couldn't do third purge" try "Search for keyword 'martial', max_keywords = 6" \ "words=martial" \ '1 matches' 'site2.html' try "'claims and collections', max_doc_size 15042" \ "words=%22claims+and+collections%22" \ 'No matches' # Check noindex_start/end are case-insensitive try "Search for 'technical', noindex_start=software distribution, noindex_end=contact information" \ "words=technical" \ 'No matches' PROTOCOL=my-protocol echo '#!/bin/sh echo "s 200" echo "t text/html" echo echo "$2"' > $PROTOCOL chmod 755 $PROTOCOL set_attr external_protocols "echo: $PWD/$PROTOCOL" set_attr start_url "echo:foo.html" $htdig "$@" -t -i -c $config || fail "Couldn't do fourth dig" try "trying external protocol echo" \ "words=foo" \ "1 matches" "echo:foo.html" test_functions_action=--stop-apache . ./test_functions rm -f $tmp $PROTOCOL exit 0 htdig-3.2.0b6/test/t_rdonly0100755006314600127310000000141110055635562015126 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_rdonly,v 1.4 2004/05/28 13:15:30 lha Exp $ # . ./test_functions export MIFLUZ_CONFIG ; MIFLUZ_CONFIG=${srcdir}/mifluz-search.conf ./txt2mifluz -z $VERBOSE < $srcdir/search.txt chmod a-w test test_weakcmpr a=`./dbbench -Wz -f world` b="world 0 0 5 2 world 0 0 5 4 world 0 0 11 1 world 0 0 20 5 world 0 0 21 2 world 0 0 51 2 world 0 0 71 2 world 0 0 81 2 " if [ "$a" != "$b" ] then echo "expected $b but got $a" >&2 exit 1 fi htdig-3.2.0b6/test/t_search0100755006314600127310000004145310055635562015076 0ustar angusgbhtdig# # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_search,v 1.4 2004/05/28 13:15:30 lha Exp $ # . ./test_functions export MIFLUZ_CONFIG ; MIFLUZ_CONFIG=${srcdir}/mifluz-search.conf # # Test the query parser # # # Run $1 and expect $2 as a result # runparser() { command="$1" expected="$2" out=`eval "$command"` if [ "$expected" != "$out" ] then echo "running $command: expected $expected but got $out" exit 1 fi } # # Simple test # runparser "./search -n -f '( and scope1 the world )' $VERBOSE" \ '( and "scope1" the world )' # # All boolean constructions # runparser "./search -n -f '( and scope1 ( not scope2 the ) world ( or scope3 is coming to ( near scope4 an ( literal scope5 end ) ) ) )' $VERBOSE" \ '( and "scope1" ( not "scope2" the ) world ( or "scope3" is coming to ( near "scope4" an ( literal "scope5" end ) ) ) )' # # Mandatory and Forbiden nodes # runparser "./search -n -f '( or scope1 ( mandatory scope2 the ) world ( forbiden scope3 is ) )' $VERBOSE" \ '( or "scope1" ( mandatory "scope2" the ) world ( not "scope3" is ) )' # # Test the WordExclude* classes # ./search -e || exit 1 # # Run queries with various operators on an index built from the content # of search.txt. # ./txt2mifluz $VERBOSE < $srcdir/search.txt # # Run $1 and expect $2 as a result (all lines starting with match:) # Feed the context variable with output starting with context:, stripping # context: itself. # runsearch() { command="$1" expected="$2" if [ "$VERBOSE" ] then echo "running $command" >&2 fi out=`eval "$command"` match=`echo "$out" | grep '^match:'` context=`echo "$out" | sed -n -e 's/^context: *//p'` # echo "context: $context" >&2 if [ "$expected" != "$match" ] then echo "running $command: expected $expected but got $match" exit 1 fi } # # Test context restoration on WordTreeLiteral # runsearch "./search -c 1 -f 'lazy' $VERBOSE" \ 'match: 0 1 11 ' runsearch "./search -c 1 -C '$context' -f 'lazy' $VERBOSE" \ 'match: 0 1 21 ' # # Literal search using scope : only want documents with Flags set to 5 # Be carefull to use tabulation in scope. # runsearch "./search -f '( literal \" 5 \" lazy )' $VERBOSE" \ 'match: 0 5 9 match: 0 5 21 match: 0 5 53 match: 0 5 56 ' # # And search using scope : only want documents with Flags set to 5 # Be carefull to use tabulation in scope. # runsearch "./search -f '( and \"\" ( literal \" 5 \" lazy ) dog )' $VERBOSE" \ 'match: 0 5 21 (dog lazy ) match: 0 5 53 (dog lazy ) match: 0 5 56 (dog lazy )' # # And/Not : document 20 is excluded because it contains 'an' # runsearch "./search -f '( and \"\" world ( not \"\" an ) the )' $VERBOSE" \ 'match: 0 0 5 (world the ) match: 0 0 21 (world the ) match: 0 0 51 (world the ) match: 0 0 71 (world the ) match: 0 0 81 (world the )' # # Or/Not : document 20 is excluded because it contains 'an' # runsearch "./search -f '( or \"\" world ( not \"\" an ) the )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (world the ) match: 0 0 11 (world ) match: 0 0 21 (world the ) match: 0 0 51 (world the ) match: 0 0 71 (world the ) match: 0 0 81 (world the )' # # Or : each word matches only once in separate documents # runsearch "./search -c 2 -f '( or \"\" comes end )' $VERBOSE" \ 'match: 0 0 6 (comes ) match: 0 0 20 (end )' # # Or : each word matches only once in separate documents # docid 20 contains 'the' and 'end', therefore first # docid 6 contains 'comes', is second before any document # containing 'the' alone because 'comes' is less frequent than 'the' # other docid only contain 'the'. # runsearch "./search -c 8 -f '( or \"\" the comes end )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the ) match: 0 0 6 (comes ) match: 0 0 20 (the end ) match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # Run the same search in 3 times using context to resume search # runsearch "./search -c 2 -f '( or \"\" the comes end )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the )' runsearch "./search -c 2 -C '$context' -f '( or \"\" the comes end )' $VERBOSE" \ 'match: 0 0 6 (comes ) match: 0 0 20 (the end )' runsearch "./search -c 5 -C '$context' -f '( or \"\" the comes end )' $VERBOSE" \ 'match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # After a search that stopped because there was not matches left, there # must be no context for resuming. # if test "$context" != "" then echo "Expected empty context after fulfilled search" exit 1 fi # # Or search with word not in database (klklk) # runsearch "./search -f '( or \"\" the klkl )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the ) match: 0 0 20 (the ) match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # Compound boolean query: nested 'and' # runsearch "./search -f '( and \"\" the ( and \"\" an end ) )' $VERBOSE" \ 'match: 0 0 20 (an end the )' # # Compound boolean query: nested 'and' that fails immediately # because 'foo' is not in the inverted index. # runsearch "./search -f '( and \"\" the ( and \"\" an foo ) )' $VERBOSE" \ 'match: none' # # Compound boolean query: 'or' & 'and' # runsearch "./search -f '( and \"\" the ( or \"\" comes end ) )' $VERBOSE" \ 'match: 0 0 20 (end the )' runsearch "./search -f '( or \"\" comes ( and \"\" the world ) )' $VERBOSE" \ 'match: 0 0 5 (world the ) match: 0 0 6 (comes ) match: 0 0 20 (world the ) match: 0 0 21 (world the ) match: 0 0 51 (world the ) match: 0 0 71 (world the ) match: 0 0 81 (world the )' runsearch "./search -P 1 -f '( or \"\" comes ( near \"\" lazy dog ) )' $VERBOSE" \ 'match: 0 0 6 (comes ) match: 0 1 11 (lazy dog proximity ) match: 0 1 21 (lazy dog proximity ) match: 0 5 21 (lazy dog proximity ) match: 0 5 56 (lazy dog proximity )' # # Compound boolean query: limit to 2 documents # runsearch "./search -f '( or \"\" comes ( or \"\" the world ) )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the world ) match: 0 0 6 (comes ) match: 0 0 11 (world ) match: 0 0 20 (the world ) match: 0 0 21 (the world ) match: 0 0 51 (the world ) match: 0 0 71 (the world ) match: 0 0 81 (the world )' runsearch "./search -c 1 -f '( or \"\" comes ( or \"\" the world ) )' $VERBOSE" \ 'match: 0 0 3 (the )' runsearch "./search -c 4 -C '$context' -f '( or \"\" comes ( or \"\" the world ) )' $VERBOSE" \ 'match: 0 0 5 (the world ) match: 0 0 6 (comes ) match: 0 0 11 (world ) match: 0 0 20 (the world )' # # Compound boolean query: nested 'optional' # runsearch "./search -f '( optional \"\" the ( optional \"\" world foo ) )' $VERBOSE" \ 'match: 0 0 5 (world the proximity) match: 0 0 20 (world the ) match: 0 0 21 (world the ) match: 0 0 51 (world the ) match: 0 0 71 (world the ) match: 0 0 81 (world the ) match: 0 0 11 (world ) match: 0 0 3 (the )' # # # Most simple search : single word # runsearch "./search -f 'the' $VERBOSE" \ 'match: 0 0 3 match: 0 0 5 match: 0 0 20 match: 0 0 21 match: 0 0 51 match: 0 0 71 match: 0 0 81 ' # # Get all we can # runsearch "./search -f '( and \"\" the world )' $VERBOSE" \ 'match: 0 0 5 (world the ) match: 0 0 20 (world the ) match: 0 0 21 (world the ) match: 0 0 51 (world the ) match: 0 0 71 (world the ) match: 0 0 81 (world the )' # # First two # runsearch "./search -c 2 -f '( and \"\" the world )' $VERBOSE" \ 'match: 0 0 5 (world the ) match: 0 0 20 (world the )' # # The next two # runsearch "./search -b 2 -c 2 -f '( and \"\" the world )' $VERBOSE" \ 'match: 0 0 21 (world the ) match: 0 0 51 (world the )' # # First four # runsearch "./search -c 4 -f '( and \"\" the world )' $VERBOSE" \ 'match: 0 0 5 (world the ) match: 0 0 20 (world the ) match: 0 0 21 (world the ) match: 0 0 51 (world the )' # # Next document, using last document returned # runsearch "./search -c 1 -C '$context' -f '( and \"\" the world )' $VERBOSE" \ 'match: 0 0 71 (world the )' # # Implicit or : each word matches only once in separate documents # runsearch "./search -c 2 -f '( optional \"\" comes end )' $VERBOSE" \ 'match: 0 0 6 (comes ) match: 0 0 20 (end )' # # Implicit or : each word matches only once in separate documents # docid 20 contains 'the' and 'end', therefore first # docid 6 contains 'comes', is second before any document # containing 'the' alone because 'comes' is less frequent than 'the' # other docid only contain 'the'. # runsearch "./search -c 8 -f '( optional \"\" the comes end )' $VERBOSE" \ 'match: 0 0 20 (end the proximity) match: 0 0 6 (comes ) match: 0 0 3 (the ) match: 0 0 5 (the ) match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # Run the same search in 3 times using context to resume search # runsearch "./search -c 2 -f '( optional \"\" the comes end )' $VERBOSE" \ 'match: 0 0 20 (end the proximity) match: 0 0 6 (comes )' runsearch "./search -c 2 -C '$context' -f '( optional \"\" the comes end )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the )' runsearch "./search -c 5 -C '$context' -f '( optional \"\" the comes end )' $VERBOSE" \ 'match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # After a search that stopped because there was not matches left, there # must be no context for resuming. # if test "$context" != "" then echo "Expected empty context after fulfilled search" exit 1 fi # # Or search with word not in database (klklk) # runsearch "./search -f '( optional \"\" the klkl )' $VERBOSE" \ 'match: 0 0 3 (the ) match: 0 0 5 (the ) match: 0 0 20 (the ) match: 0 0 21 (the ) match: 0 0 51 (the ) match: 0 0 71 (the ) match: 0 0 81 (the )' # # And search with word not in database (klklk) # runsearch "./search -c 1 -f '( and \"\" comes klkl )' $VERBOSE" \ 'match: none' # # From there we deal with more complex keys (TAG,SERVER,URL) # instead of URL alone above. # # # And search with 'dog lazy' # runsearch "./search -c 3 -f '( and \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy ) match: 0 1 21 (dog lazy ) match: 0 5 21 (dog lazy )' # # And search with 'dog lazy' one URL per server only (-S) # runsearch "./search -S -f '( and \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy ) match: 0 5 21 (dog lazy ) match: 0 6 1 (dog lazy )' # # Or search with 'dog lazy' one URL per server only (-S) # runsearch "./search -S -f '( optional \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 5 21 (dog lazy ) match: 0 6 1 (dog lazy ) match: 0 5 9 (lazy )' # # Near search with 'lazy dog' # runsearch "./search -f '( near \"\" lazy dog )' $VERBOSE" \ 'match: 0 1 11 (lazy dog proximity) match: 0 1 21 (lazy dog proximity) match: 0 5 21 (lazy dog proximity) match: 0 5 56 (lazy dog proximity)' # # Near search with 'dog lazy' # runsearch "./search -f '( near \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity)' # # Near search with 'dog lazy', order of term is not meaningfull # matching 'dog lazy' and 'lazy dog' # runsearch "./search -P -1 -f '( near \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 1 21 (dog lazy proximity) match: 0 5 21 (dog lazy proximity) match: 0 5 56 (dog lazy proximity)' # # Near search with 'dog lazy', order of term is not meaningfull # tolerance is -2, adding match for 'dog ? lazy' and 'lazy ? dog' # runsearch "./search -P -2 -f '( near \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 1 21 (dog lazy proximity) match: 0 5 21 (dog lazy proximity) match: 0 5 53 (dog lazy proximity) match: 0 5 56 (dog lazy proximity)' # # Near search with 'dog lazy', order of term is meaningfull # tolerance is 3, adding match for 'dog ? lazy' and 'dog ? ? lazy' # runsearch "./search -P 3 -f '( near \"\" dog lazy )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 6 1 (dog lazy proximity)' # # Near search with 'lazy dog', only first 2 # runsearch "./search -c 2 -f '( near \"\" lazy dog )' $VERBOSE" \ 'match: 0 1 11 (lazy dog proximity) match: 0 1 21 (lazy dog proximity)' # # Near search with 'lazy dog', resume from previous search # and get 2 more. # runsearch "./search -c 2 -C '$context' -f '( near \"\" lazy dog )' $VERBOSE" \ 'match: 0 5 21 (lazy dog proximity) match: 0 5 56 (lazy dog proximity)' # # Near search with non existent word # runsearch "./search -f '( near \"\" lazy bar )' $VERBOSE" \ 'match: none' # # Or search using proximity (document 0 5 53 contains lazy ? dog) # order of term is meaningfull. # runsearch "./search -P 2 -f '( optional \"\" lazy dog )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 1 21 (dog lazy ) match: 0 5 21 (dog lazy ) match: 0 5 53 (dog lazy ) match: 0 5 56 (dog lazy ) match: 0 6 1 (dog lazy ) match: 0 5 9 (lazy )' # # Or search using proximity (document 0 5 53 contains lazy ? dog) # order of term is not meaningfull. # runsearch "./search -P -2 -f '( optional \"\" lazy dog )' $VERBOSE" \ 'match: 0 1 11 (dog lazy proximity) match: 0 1 21 (dog lazy proximity) match: 0 5 21 (dog lazy proximity) match: 0 5 53 (dog lazy proximity) match: 0 5 56 (dog lazy proximity) match: 0 6 1 (dog lazy ) match: 0 5 9 (lazy )' htdig-3.2.0b6/test/t_templates0100755006314600127310000003211610055635562015623 0ustar angusgbhtdig#!/bin/sh # Part of the ht://Dig package # Copyright (c) 1999-2004 The ht://Dig Group # For copyright details, see the file COPYING in your distribution # or the GNU Library General Public License (LGPL) version 2 or later # # # $Id: t_templates,v 1.4 2004/05/28 13:15:30 lha Exp $ # # Tests the following config attributes: # add_anchors_to_excerpt # allow_in_form # anchor_target # any_keywords # build_select_lists # date_format # end_ellipses # end_highlight # excerpt_show_top # image_url_prefix # iso_8601 # matches_per_page # matches_per_page_list # max_excerpts # max_descriptions # max_description_length # max_stars # maximum_page_buttons # maximum_pages # method_names # next_page_text # no_excerpt_show_top # no_excerpt_text # no_page_list_header # no_page_number_text # no_next_page_text # no_prev_page_text # no_title_text # nothing_found_file # page_list_header # page_number_separator # page_number_text # prev_page_text # plural_suffix # search_results_contenttype # search_results_wrapper # sort_names # star_blank # star_image # star_patterns # start_ellipses # start_highlight # syntax_error_file # use_star_image try() { comment="$1" shift query="$1" shift $htsearch -c $config "$query" > $tmp 2> /dev/null for pattern do if grep "$pattern" $tmp > /dev/null then : else $htsearch -vv -c $config "$query" > /dev/null echo "Output doesn't match \"$pattern\"" fail "$htsearch -c $config '$query' >> $tmp -- $comment" fi done } test_functions_action=--start-apache . ./test_functions config=$testdir/conf/htdig.conf.tmp tmp=/tmp/t_htsearch$$ # set up config file with chosen non-default values cp $testdir/conf/htdig.conf $config $htdig "$@" -t -i -c $config || fail "Couldn't dig" $htpurge -vv -c $config > tmp1 || fail "Couldn't purge" # How can I check that unretrieved urls have been removed, but bad ones haven't? set_attr search_results_wrapper "$testdir/conf/main-template" set_attr any_keywords "true" set_attr image_url_prefix "image-prefix" try ". Single page of results" \ "words=also;config=hello;exclude=site2;format=builtin-short;keywords=subject+please+node;matchesperpage=10;method=and;page=1;restrict=http;sort=score;startyear=1999;startmonth=8;startday=1;endyear=2005;endmonth=9;endday=30" \ 'MATCHES *=3' 'bad_local.htm' 'script.html' 'site4.html' \ 'CGI *=-' 'CONFIG *=hello' 'EXCLUDE *=site2' 'FIRSTDISPLAYED *=1' \ 'builtin-short" selected>Short' 'KEYWORDS *=subject please node' \ 'LASTDISPLAYED *=3' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=10' 'MATCH_MESSAGE *=All' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>All' 'MODIFIED *=-' \ 'NEXTPAGE *=-' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=-' \ 'PAGELIST *=-' 'PAGES *=1' 'PLURAL_MATCHES *=s' \ 'PREVPAGE *=-' 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-short' \ 'SELECTED_METHOD *=and' 'SELECTED_SORT *=score' \ 'selected>Score' 'VERSION *=3.2' 'WORDS *=also' \ 'image-prefix/star.gif' set_attr plural_suffix "es" set_attr allow_in_form "script_name" set_attr page_list_header "head" set_attr add_anchors_to_excerpt "true" # make sure "script" is the page returned... set_attr search_results_order "bad_local script *" # set_attr iso_8601 FALSE # no point -- format set by locale # (Ensure keyword 'moderate' for script.html occurs after 'also', as anchors # are broken if keyword preceeds anchor, but search term follows it.) try "2nd page, 1 match per page, no excludes" \ "words=also;script_name=qtest;format=builtin-long;keywords=subject+please+moderate;matchesperpage=1;method=or;page=2;restrict=http;sort=revtime;startyear=1999;startmonth=8;startday=1;endyear=2005;endmonth=9;endday=30" \ 'MATCHES *=3' 'script.html' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' 'FIRSTDISPLAYED *=2' \ 'builtin-long" selected>Long' 'KEYWORDS *=subject please moderate' \ 'LASTDISPLAYED *=2' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=1' 'MATCH_MESSAGE *=Any' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>Any' 'MODIFIED *=-' \ 'NEXTPAGE *=.*;page=3' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=head' \ 'PAGELIST *=.*;page=1.*;page=3' 'PAGES *=3' 'PLURAL_MATCHES *=es' \ 'PREVPAGE *=.*;page=1' 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revtime' \ 'selected>Reverse Time' 'VERSION *=3.2' 'WORDS *=also' \ '\.\.\. ' 'also' \ set_attr method_names "or Or and And boolean Logical" set_attr page_list_header 'multiple' set_attr no_page_list_header 'single' set_attr anchor_target "body" set_attr maximum_page_buttons "2" set_attr no_next_page_text "none" set_attr no_prev_page_text "none" set_attr next_page_text "following" set_attr prev_page_text "preceeding" set_attr iso_8601 true try "2nd page, 1 match per page, no excludes, no keywords" \ "words=also;script_name=qtest;format=builtin-long;matchesperpage=1;method=or;page=2;restrict=http;sort=revtime;startyear=1999;startmonth=8;startday=1;endyear=2005;endmonth=9;endday=30" \ 'MATCHES *=4' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' 'FIRSTDISPLAYED *=2' \ 'builtin-long" selected>Long' 'KEYWORDS *=-' \ 'LASTDISPLAYED *=2' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=1' 'MATCH_MESSAGE *=Or' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>Or' 'MODIFIED *=-' \ 'NEXTPAGE *=.*;page=3.*following' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=multiple' \ 'PAGELIST *=.*;page=1.*2[^0-9]*-' 'PAGES *=4' 'PLURAL_MATCHES *=es' \ 'PREVPAGE *=.*;page=1.*preceeding' 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revtime' \ 'selected>Reverse Time' 'VERSION *=3.2' 'WORDS *=also' \ '\.\.\. ' 'also' \ '20[0-9][0-9]-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]* [a-zA-Z]*' # iso date # ('\\\\' because original line in htdig.conf has a continuation '\' ) set_attr page_number_text "first second third fourth \\\\" set_attr no_page_number_text "FIRST SECOND THIRD FOURTH \\\\" set_attr page_number_separator "PAGE_SEP" set_attr maximum_pages 2 set_attr date_format "%Y-date-%m-date-%d-" # overrides iso_8601 try "2nd page, 1 match per page, changed page numbers" \ "words=also;script_name=qtest;format=builtin-long;matchesperpage=1;method=or;page=2;restrict=http;sort=revtime;startyear=1999;startmonth=8;startday=1;endyear=2005;endmonth=9;endday=30" \ 'MATCHES *=4' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' 'FIRSTDISPLAYED *=2' \ 'builtin-long" selected>Long' 'KEYWORDS *=-' \ 'LASTDISPLAYED *=2' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=1' 'MATCH_MESSAGE *=Or' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>Or' 'MODIFIED *=-' \ 'NEXTPAGE *=none' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=multiple' \ 'PAGELIST *=.*first.*PAGE_SEP.*SECOND' 'PAGES *=2' 'PLURAL_MATCHES *=es' \ 'PREVPAGE *=.*;page=1' 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revtime' \ 'selected>Reverse Time' 'VERSION *=3.2' 'WORDS *=also' \ '\.\.\. ' 'also' \ '20[0-9][0-9]-date-[0-9]*-date-[0-9]*-' #'MATCHES *=4' 'bad_local.htm' 'script.html' 'site2.html' 'site4.html' set_attr any_keywords "false" set_attr nothing_found_file "$testdir/conf/main-template" set_attr add_anchors_to_excerpt "false" try "fails keyword match" \ "words=also;script_name=qtest;format=builtin-long;keywords=subject+please+node;matchesperpage=1;method=or;page=2;restrict=http;sort=revtime;startyear=1999;startmonth=8;startday=1;endyear=2005;endmonth=9;endday=30" \ 'MATCHES *=0' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' \ 'builtin-long" selected>Long' 'KEYWORDS *=subject please node' \ 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=1' 'MATCH_MESSAGE *=Or' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>Or' 'MODIFIED *=-' \ 'NSTARS *=-' 'PAGELIST *=-' 'PAGES *=1' \ 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revtime' \ 'selected>Reverse Time' 'VERSION *=3.2' 'WORDS *=also' \ 'starting date =1999/8/1-' \ 'ending date =2005/9/30-' set_attr start_ellipses "START_ELLIPSES" set_attr end_ellipses "END_ELLIPSES" set_attr star_blank "NIL" set_attr star_image "STAR" set_attr matches_per_page 8 try "test highlighting" \ "words=also;script_name=qtest;format=builtin-long;method=or;restrict=http;sort=revscore" \ 'MATCHES *=4' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' 'FIRSTDISPLAYED *=1' \ 'LASTDISPLAYED *=4' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=8' 'MATCH_MESSAGE *=Or' 'MAX_STARS *=4' \ 'METADESCRIPTION *=-' 'selected>Or' 'MODIFIED *=-' \ 'NEXTPAGE *=-' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=single' \ 'PAGELIST *=-' 'PAGES *=1' 'PLURAL_MATCHES *=es' \ 'PREVPAGE *=-' 'RESTRICT *=http' 'SELECTED_FORMAT *=builtin-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revscore' \ 'selected>Reverse Score' 'VERSION *=3.2' 'WORDS *=also' \ 'START_ELLIPSES' 'END_ELLIPSES' 'also' \ '^[^S]*"STAR".*"NIL".*"NIL".*"NIL"' set_attr max_stars 5 set_attr start_highlight "START" set_attr end_highlight "STOP" set_attr max_excerpts 2 set_attr template_map "Long builtin-long builtin-long Short builtin-short builtin-short Very-long user-long $PWD/conf/entry-template" try "test max_stars. Also needs max_descriptions >= 2" \ "words=also;script_name=qtest;format=user-long;method=or;restrict=http;sort=revscore" \ 'MATCHES *=4' \ 'CGI *=qtest' 'CONFIG *=-' 'EXCLUDE *=-' 'FIRSTDISPLAYED *=1' \ 'LASTDISPLAYED *=4' 'LOGICAL_WORDS *=also' \ 'MATCHES_PER_PAGE *=8' 'MATCH_MESSAGE *=Or' 'MAX_STARS *=5' \ 'METADESCRIPTION *=-' 'selected>Or' 'MODIFIED *=-' \ 'NEXTPAGE *=-' 'NSTARS *=-' 'PAGE *=1' 'PAGEHEADER *=single' \ 'PAGELIST *=-' 'PAGES *=1' 'PLURAL_MATCHES *=es' \ 'PREVPAGE *=-' 'RESTRICT *=http' 'SELECTED_FORMAT *=user-long' \ 'SELECTED_METHOD *=or' 'SELECTED_SORT *=revscore' \ 'selected>Reverse Score' 'VERSION *=3.2' 'WORDS *=also' \ 'START_ELLIPSES.*START_ELLIPSES.*END_ELLIPSES' 'STARTalsoSTOP' \ '^[^N]*"STAR".*"NIL".*"NIL".*"NIL".*"NIL"' \ 'DESCRIPTIONS=JavaScript test
    top

    ' try "Search for 'empty'" \ "words=empty;format=builtin-long" \ 'MATCHES *=2' \ 'empty%20file.html' 'empty file.html' 'sub%2520dir' 'INDEX OF /SET1/SUB%20DIR' set_attr no_title_text "Empty-Title" try "Search for 'empty'" \ "words=empty;format=builtin-long" \ 'MATCHES *=2' \ 'empty%20file.html' 'Empty-Title' 'sub%2520dir' set_attr star_patterns "site foo bad_local bar" try "test star_patterns" \ "words=also;format=builtin-long" \ 'MATCHES *=4' '"foo"' '"bar"' set_attr star_patterns "site foo bad_local" try "test star_patterns syntax error" \ "words=also;format=builtin-long" \ 'MATCHES *=4' '"foo"' '""' set_attr search_results_contenttype "foo" set_attr use_star_image "false" try "Checking use_star_image" \ "words=bad_local;format=builtin-short" \ "^[^*]*bad_local" "Content-type: foo" set_attr search_results_contenttype "" set_attr no_excerpt_text "No-excerpt-found" try "Checking no_excerpt_show_top true" \ "words=Yuki" \ "a#bcd" set_attr no_excerpt_show_top "false" try "Checking no_excerpt_show_top false" \ "words=Yuki" \ "No-excerpt-found" try "Checking excerpt_show_top false" \ "words=also" \ "STARTalsoSTOP" set_attr build_select_lists 'MATCH_LIST,multiple matchesperpage matches_per_page_list 2 2 1 matches_per_page "Previous Amount"' set_attr matches_per_page_list 'one 1 five 5 ten 10 twenty 20 "one hundred" 100 "two hundred" 200' set_attr sort_names "score 'Best Match' time Newest title A-Z revscore 'Worst Match' revtime Oldest revtitle Z-A" set_attr excerpt_show_top "true" try "Checking excerpt_show_top true" \ "words=also;matchesperpage=40" \ "Copyright" \ "MATCH_LIST *=<" "selected>Previous Amount" '